Skip to content

Commit dccfc63

Browse files
Update site navigation (#982)
* Update site navigation * Address navigation review feedback * Update navbar mega menu * Round library menu chips * Soften library chip borders * Simplify mega menu background transition * Use local mega menu background animation * ci: apply automated fixes * Use CSS-only desktop mega menu * Tighten desktop nav trigger hit areas * Normalize desktop nav item weight * Fix compact desktop nav dropdown bridge * Tighten desktop nav item type size * Balance compact desktop dropdown gutters * Remove libraries dropdown promo rail * ci: apply automated fixes * Remove unused libraries nav rail metadata --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 762e5d8 commit dccfc63

22 files changed

Lines changed: 1096 additions & 647 deletions

src/components/Collapsible.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ type CollapsibleProps = {
1616
className?: string
1717
}
1818

19-
type CollapsibleTriggerProps = {
19+
type CollapsibleTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
2020
children: React.ReactNode
21-
className?: string
2221
}
2322

2423
type CollapsibleContentProps = {
@@ -76,16 +75,26 @@ export function Collapsible({
7675
export function CollapsibleTrigger({
7776
children,
7877
className,
78+
onClick,
79+
onMouseDown,
80+
type = 'button',
81+
...props
7982
}: CollapsibleTriggerProps) {
80-
const { toggle } = useCollapsible()
83+
const { open, toggle } = useCollapsible()
8184

8285
return (
8386
<button
84-
type="button"
85-
onMouseDown={(e) => e.stopPropagation()}
87+
{...props}
88+
type={type}
89+
aria-expanded={open}
90+
onMouseDown={(e) => {
91+
e.stopPropagation()
92+
onMouseDown?.(e)
93+
}}
8694
onClick={(e) => {
8795
e.stopPropagation()
8896
toggle()
97+
onClick?.(e)
8998
}}
9099
className={twMerge('cursor-pointer select-none', className)}
91100
data-collapsible-trigger

0 commit comments

Comments
 (0)