@acronis-platform/ui-react 0.61.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/calendar-panel/calendar-panel-utils.js +63 -0
- package/dist/components/ui/calendar-panel/calendar-panel-utils.js.map +1 -0
- package/dist/components/ui/calendar-panel/calendar-panel.js +260 -0
- package/dist/components/ui/calendar-panel/calendar-panel.js.map +1 -0
- package/dist/components/ui/filter-cards/filter-cards.js +25 -0
- package/dist/components/ui/filter-cards/filter-cards.js.map +1 -0
- package/dist/components/ui/resizable/resizable.js +23 -11
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/sidebar-secondary/sidebar-secondary.js.map +1 -1
- package/dist/index.js +386 -380
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/react-day-picker@10.0.1_@types_react@19.2.15_react@19.2.6/node_modules/react-day-picker/dist/esm/useDayPicker.js +3 -3
- package/dist/react.js +386 -380
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/calendar-panel/__tests__/calendar-panel-utils.test.d.ts +1 -0
- package/dist/src/components/ui/calendar-panel/calendar-panel-utils.d.ts +55 -0
- package/dist/src/components/ui/calendar-panel/calendar-panel.d.ts +112 -0
- package/dist/src/components/ui/calendar-panel/index.d.ts +1 -0
- package/dist/src/components/ui/filter-cards/filter-cards.d.ts +11 -0
- package/dist/src/components/ui/filter-cards/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-secondary.js","sources":["../../../../src/components/ui/sidebar-secondary/sidebar-secondary.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { Collapsible } from '@base-ui/react/collapsible';\nimport {\n ChevronDownIcon,\n SquareArrowUpRightIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { useDocDir } from '@/lib/use-doc-dir';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\n\n/**\n * Tracks whether `ref`'s element is clipping its own content (`scrollWidth >\n * clientWidth`) — used to gate a tooltip so it only opens when a truncated\n * label is actually cut off. Re-measures via `ResizeObserver` (covers the\n * rail's expand/collapse width transition); `enabled` skips measurement\n * entirely (e.g. while collapsed, where the label is `sr-only`).\n */\nfunction useIsOverflowing<T extends Element>(\n ref: React.RefObject<T | null>,\n { enabled }: { enabled: boolean }\n): boolean {\n const [isOverflowing, setIsOverflowing] = React.useState(false);\n\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element) {\n setIsOverflowing(false);\n return;\n }\n const measure = () =>\n setIsOverflowing(element.scrollWidth > element.clientWidth);\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled]);\n\n return isOverflowing;\n}\n\n// Resize constraints — mirrors the design-token defaults.\n// CSS still uses `var(--ui-sidebar-secondary-expanded-container-width)` so\n// brands that override the token get the correct visual width; these JS\n// constants only govern the drag-resize clamping range.\nconst SIDEBAR_EXPANDED_WIDTH = 256; // --ui-sidebar-secondary-expanded-container-width\nconst SIDEBAR_MAX_WIDTH = SIDEBAR_EXPANDED_WIDTH * 2;\n\n// Composable SidebarSecondary primitives mirroring the Figma \"SidebarSecondary\"\n// component set (node 2468:59502, variant expanded|collapsed). Every color and\n// metric is wired to a next-gen `--ui-sidebar-secondary-*` token from\n// @acronis-platform/tokens-pd — no hex, no invented tokens.\n//\n// Like SidebarPrimary, expanded/collapsed is a width-reflow state (not a panel\n// show/hide), modelled as a controlled/uncontrolled `expanded` prop (default\n// true) that sets `data-state=\"expanded|collapsed\"` on the root and is shared to\n// descendants via context. The collapsed rail replaces the section list with a\n// vertical breadcrumb (parent → separator → current page), toggled purely by the\n// `data-[state]` selectors so it is SSR-present and needs no JS branch.\n//\n// Menu-item color wiring DIVERGES from Primary (DESIGN §6.2): Secondary recolors\n// only the CONTAINER per selected/unselected; the icon and label use the shared\n// `--ui-sidebar-secondary-menu-item-global-{icon,label}-color-color` tokens\n// across both variants and every interaction state (the next-gen token sync\n// collapsed the former per-state idle/hover/active icon+label colors into a\n// single value each). So the cva base carries the global icon/label colors and\n// the two variants only swap the container fill.\n//\n// R6 (collapsed separator icon): resolved from the Figma node metadata — the\n// collapsed `iconSeparator` instance's mainComponent is \"ChevronDown\" (updated\n// from ChevronRight), so the separator defaults to `ChevronDownIcon` (16px),\n// tinted by `--ui-sidebar-secondary-collapsed-icon-separator-color`. In the\n// vertical breadcrumb flow (writing-mode: vertical-rl) the downward chevron\n// visually points \"forward\" in the reading direction. The disclosure chevron\n// uses `ChevronDownIcon` rotated via `data-panel-open`. The focus ring reuses the\n// shared `--ui-focus-brand` (no sidebar focus token exists — R1).\n\nconst defaultResizeTooltipExpanded = (\n <>\n <span className=\"font-semibold\">Resize:</span> Drag\n <br />\n <span className=\"font-semibold\">Collapse:</span> Click\n <br />\n <span className=\"font-semibold\">Reset size:</span> Double click\n </>\n);\n\nconst defaultResizeTooltipCollapsed = (\n <>\n <span className=\"font-semibold\">Resize:</span> Drag\n <br />\n <span className=\"font-semibold\">Expand:</span> Click\n </>\n);\n\ninterface SidebarSecondaryContextValue {\n expanded: boolean;\n /** Flip the panel width — drives the controlled/uncontrolled `expanded` state. */\n toggleExpanded: () => void;\n /** Whether resize is enabled. */\n resizable: boolean;\n /** Current width in px (only meaningful when resizable + expanded). */\n width: number;\n /** Update the width (used by the resize edge during drag). */\n setWidth: (width: number) => void;\n /** Min resize width — derived from `--ui-sidebar-secondary-expanded-container-width`. */\n minWidth: number;\n /** Max resize width — expanded-width × RESIZE_MAX_WIDTH_FACTOR. */\n maxWidth: number;\n /** Default (reset) width — equals expanded-container-width token. */\n defaultWidth: number;\n /** Label registered by `SidebarSecondaryHeader` — consumed by the collapsed breadcrumb. */\n headerLabel: React.ReactNode;\n /** Register the header label (called by `SidebarSecondaryHeader`). */\n setHeaderLabel: (label: React.ReactNode) => void;\n /** Label of the currently selected `MenuItem` — consumed by the collapsed breadcrumb. */\n selectedLabel: React.ReactNode;\n /** Register the selected item label (called by `SidebarSecondaryMenuItem`). */\n setSelectedLabel: (label: React.ReactNode) => void;\n /** Accessible label for the resize edge separator. */\n resizeAriaLabel: string;\n /** Tooltip content shown when the sidebar is expanded. */\n resizeTooltipExpanded: React.ReactNode;\n /** Tooltip content shown when the sidebar is collapsed. */\n resizeTooltipCollapsed: React.ReactNode;\n}\n\nconst SidebarSecondaryContext =\n React.createContext<SidebarSecondaryContextValue | null>(null);\n\nfunction useSidebarSecondaryContext(): SidebarSecondaryContextValue {\n // Default to expanded so parts render standalone (in isolation tests /\n // stories) without a wrapping root; the toggle is a no-op outside a root.\n return (\n React.useContext(SidebarSecondaryContext) ?? {\n expanded: true,\n toggleExpanded: () => {},\n resizable: false,\n width: SIDEBAR_EXPANDED_WIDTH,\n setWidth: () => {},\n minWidth: SIDEBAR_EXPANDED_WIDTH,\n maxWidth: SIDEBAR_MAX_WIDTH,\n defaultWidth: SIDEBAR_EXPANDED_WIDTH,\n headerLabel: undefined,\n setHeaderLabel: () => {},\n selectedLabel: undefined,\n setSelectedLabel: () => {},\n resizeAriaLabel: 'Resize sidebar',\n resizeTooltipExpanded: defaultResizeTooltipExpanded,\n resizeTooltipCollapsed: defaultResizeTooltipCollapsed,\n }\n );\n}\n\n/**\n * Controlled + uncontrolled boolean state (the Base UI idiom). When `controlled`\n * is provided it wins and the setter only emits the change callback; otherwise\n * the setter updates internal state. `onChange` is ALWAYS invoked with the next\n * value so a consumer can react in either mode.\n */\nfunction useControllableBoolean(\n controlled: boolean | undefined,\n defaultValue: boolean,\n onChange?: (next: boolean) => void\n): [boolean, (next: boolean) => void] {\n const [uncontrolled, setUncontrolled] = React.useState(defaultValue);\n const isControlled = controlled !== undefined;\n const value = isControlled ? controlled : uncontrolled;\n const setValue = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolled(next);\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n return [value, setValue];\n}\n\nexport interface SidebarSecondaryProps extends React.ComponentPropsWithoutRef<'nav'> {\n /** Controlled expanded (rail width) state. */\n expanded?: boolean;\n /** Uncontrolled initial expanded state. Defaults to `true` (full width). */\n defaultExpanded?: boolean;\n /** Fires when the expanded state changes (e.g. a consumer toggle). */\n onExpandedChange?: (expanded: boolean) => void;\n /**\n * Enable the draggable resize edge on the right border.\n * When `true`, the sidebar can be resized between the expanded-width token\n * and twice that value.\n */\n resizable?: boolean;\n /** Controlled width in px (only used when `resizable`). */\n width?: number;\n /** Fires when the width changes due to a drag interaction. */\n onWidthChange?: (width: number) => void;\n /** Accessible label for the resize edge (`role=\"separator\"`). Defaults to `'Resize sidebar'`. */\n resizeAriaLabel?: string;\n /** Tooltip content shown when the sidebar is expanded. Pass `null` to hide the tooltip entirely. */\n resizeTooltipExpanded?: React.ReactNode;\n /** Tooltip content shown when the sidebar is collapsed. Pass `null` to hide the tooltip entirely. */\n resizeTooltipCollapsed?: React.ReactNode;\n /**\n * Replace the rendered `<nav>` with another element or component\n * (Base UI composition). Accepts a React element or a render function.\n */\n render?: useRender.RenderProp;\n}\n\n// ---------------------------------------------------------------------------\n// SidebarSecondaryResizeEdge — internal drag/click handle on the right edge\n// ---------------------------------------------------------------------------\n// Styled identically to `ResizableHandle` (Figma 4649:6681): 9px hit-area,\n// 1px centered divider, idle → `--ui-border-on-surface-border`,\n// hover → `--ui-resizable-border-color-hover`,\n// drag → `--ui-resizable-border-color-active`.\n// ---------------------------------------------------------------------------\n\nfunction SidebarSecondaryResizeEdge() {\n const ctx = useSidebarSecondaryContext();\n const { expanded, toggleExpanded, resizable } = ctx;\n const dir = useDocDir();\n\n // Mutable ref so the closure-captured pointermove handler always reads\n // the latest context without re-attaching listeners.\n const ctxRef = React.useRef(ctx);\n ctxRef.current = ctx;\n\n // Track whether a pointermove actually happened between down→up so we can\n // suppress the click that the browser fires after every pointerup.\n const didDragRef = React.useRef(false);\n\n // Hide the tooltip while dragging.\n const [tooltipOpen, setTooltipOpen] = React.useState(false);\n const [dragging, setDragging] = React.useState(false);\n\n // Delay single-click so a double-click can cancel it.\n const clickTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(\n null\n );\n\n // Clear any pending click timer on unmount.\n React.useEffect(() => {\n return () => {\n if (clickTimerRef.current) clearTimeout(clickTimerRef.current);\n };\n }, []);\n\n if (!resizable) return null;\n\n const handlePointerDown = (e: React.PointerEvent<HTMLDivElement>) => {\n e.preventDefault();\n const el = e.currentTarget;\n el.setPointerCapture(e.pointerId);\n didDragRef.current = false;\n setDragging(true);\n setTooltipOpen(false);\n\n // Disable the width transition while dragging so resize follows the\n // cursor without animation lag.\n const sidebarEl = el.closest('[data-state]') as HTMLElement | null;\n if (!sidebarEl) {\n setDragging(false);\n el.releasePointerCapture(e.pointerId);\n return;\n }\n sidebarEl.style.transitionProperty = 'none';\n const isRtl = getComputedStyle(sidebarEl).direction === 'rtl';\n const sidebarRect = sidebarEl.getBoundingClientRect();\n\n const { minWidth, maxWidth } = ctxRef.current;\n const collapseThreshold = minWidth / 2;\n\n const onPointerMove = (ev: PointerEvent) => {\n didDragRef.current = true;\n const newWidth = isRtl\n ? sidebarRect.right - ev.clientX\n : ev.clientX - sidebarRect.left;\n const { expanded: isExpanded } = ctxRef.current;\n\n if (isExpanded) {\n if (newWidth < collapseThreshold) {\n ctxRef.current.toggleExpanded();\n } else {\n ctxRef.current.setWidth(\n Math.min(Math.max(newWidth, minWidth), maxWidth)\n );\n }\n } else {\n if (newWidth > collapseThreshold) {\n ctxRef.current.toggleExpanded();\n }\n }\n };\n\n const onPointerUp = () => {\n setDragging(false);\n // Restore transition so collapse/expand animates.\n if (sidebarEl) sidebarEl.style.transitionProperty = '';\n window.removeEventListener('pointermove', onPointerMove);\n window.removeEventListener('pointerup', onPointerUp);\n };\n\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener('pointerup', onPointerUp);\n };\n\n const handleClick = () => {\n // Suppress click when the interaction was a drag.\n if (didDragRef.current) return;\n // Cancel any pending click timer (dblclick fires two clicks).\n if (clickTimerRef.current) clearTimeout(clickTimerRef.current);\n // Wait to see if a double-click follows.\n clickTimerRef.current = setTimeout(() => {\n toggleExpanded();\n }, 250);\n };\n\n const handleDoubleClick = () => {\n // Cancel the pending single-click toggle.\n if (clickTimerRef.current) {\n clearTimeout(clickTimerRef.current);\n clickTimerRef.current = null;\n }\n if (!expanded) toggleExpanded();\n ctxRef.current.setWidth(ctxRef.current.defaultWidth);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const {\n minWidth,\n maxWidth,\n defaultWidth,\n width: w,\n setWidth: sw,\n expanded: exp,\n toggleExpanded: te,\n } = ctxRef.current;\n const step = 16;\n const growKey = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const shrinkKey = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n if (e.key === growKey && exp) {\n e.preventDefault();\n sw(Math.min(w + step, maxWidth));\n } else if (e.key === growKey && !exp) {\n e.preventDefault();\n te();\n } else if (e.key === shrinkKey && exp) {\n e.preventDefault();\n const next = w - step;\n if (next < minWidth) {\n te();\n } else {\n sw(next);\n }\n } else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n te();\n } else if (e.key === 'Home') {\n e.preventDefault();\n if (!exp) te();\n sw(defaultWidth);\n }\n };\n\n const handleTooltipOpenChange = (open: boolean) => {\n // Never open the tooltip while dragging.\n if (dragging) return;\n setTooltipOpen(open);\n };\n\n return (\n <Tooltip open={tooltipOpen} onOpenChange={handleTooltipOpenChange} trackCursorAxis=\"y\">\n <TooltipTrigger\n render={\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={ctx.resizeAriaLabel}\n className={cn(\n // 17px hit area, absolutely positioned on inline-end edge.\n // The sidebar's own border-e provides the visible 1px line; its color\n // changes via :has() on hover/active/focus-visible.\n 'absolute end-0 top-0 h-full w-[17px] ltr:translate-x-1/2 rtl:-translate-x-1/2 cursor-[var(--ui-resizable-cursor,ew-resize)] z-10',\n // On focus: 1px active-color line (after pseudo, CSS border for pixel-snap) + 3px box-shadow ring centered on it.\n 'after:absolute after:inset-y-0 after:inset-x-0 after:mx-auto after:w-0 after:pointer-events-none',\n 'after:[border-inline-start-width:var(--ui-resizable-border-width,1px)] after:border-solid after:border-transparent',\n 'focus-visible:outline-none focus-visible:after:[border-inline-start-color:var(--ui-resizable-border-color-active)] focus-visible:after:[box-shadow:0_0_0_3px_var(--ui-focus-primary)]'\n )}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onPointerDown={handlePointerDown}\n onClick={handleClick}\n onDoubleClick={handleDoubleClick}\n />\n }\n />\n {(expanded ? ctx.resizeTooltipExpanded : ctx.resizeTooltipCollapsed) !=\n null && (\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'} align=\"center\">\n {expanded ? ctx.resizeTooltipExpanded : ctx.resizeTooltipCollapsed}\n </TooltipContent>\n )}\n </Tooltip>\n );\n}\n\nconst SidebarSecondary = React.forwardRef<HTMLElement, SidebarSecondaryProps>(\n (\n {\n className,\n expanded: expandedProp,\n defaultExpanded = true,\n onExpandedChange,\n resizable: resizableProp = true,\n width: widthProp,\n onWidthChange,\n resizeAriaLabel = 'Resize sidebar',\n resizeTooltipExpanded = defaultResizeTooltipExpanded,\n resizeTooltipCollapsed = defaultResizeTooltipCollapsed,\n 'aria-label': ariaLabel = 'Section navigation',\n render,\n children,\n ...props\n },\n ref\n ) => {\n const [expanded, setExpanded] = useControllableBoolean(\n expandedProp,\n defaultExpanded,\n onExpandedChange\n );\n\n // Width is independent of expanded/collapsed — it persists across cycles.\n const [width, setWidthState] = React.useState(SIDEBAR_EXPANDED_WIDTH);\n const isWidthControlled = widthProp !== undefined;\n const currentWidth = isWidthControlled ? widthProp : width;\n const setWidth = React.useCallback(\n (next: number) => {\n if (!isWidthControlled) setWidthState(next);\n onWidthChange?.(next);\n },\n [isWidthControlled, onWidthChange]\n );\n\n // Collapse is driven by the consumer through the layout context — the\n // `SidebarSecondaryCollapseTrigger` calls `toggleExpanded`, which updates\n // uncontrolled state and always emits `onExpandedChange`. Controlled\n // consumers ignore the internal state and react to the callback.\n // Breadcrumb auto-wiring: Header and the selected MenuItem register their\n // labels so the collapsed breadcrumb can display them without manual props.\n const [headerLabel, setHeaderLabel] =\n React.useState<React.ReactNode>(undefined);\n const [selectedLabel, setSelectedLabel] =\n React.useState<React.ReactNode>(undefined);\n\n const context = React.useMemo<SidebarSecondaryContextValue>(\n () => ({\n expanded,\n toggleExpanded: () => setExpanded(!expanded),\n resizable: resizableProp,\n width: currentWidth,\n setWidth,\n minWidth: SIDEBAR_EXPANDED_WIDTH,\n maxWidth: SIDEBAR_MAX_WIDTH,\n defaultWidth: SIDEBAR_EXPANDED_WIDTH,\n headerLabel,\n setHeaderLabel,\n selectedLabel,\n setSelectedLabel,\n resizeAriaLabel,\n resizeTooltipExpanded,\n resizeTooltipCollapsed,\n }),\n [\n expanded,\n setExpanded,\n resizableProp,\n currentWidth,\n setWidth,\n headerLabel,\n selectedLabel,\n resizeAriaLabel,\n resizeTooltipExpanded,\n resizeTooltipCollapsed,\n ]\n );\n\n // When resizable + expanded, apply inline width ONLY when the user has\n // actively resized (or width is controlled). Otherwise the CSS token\n // `--ui-sidebar-secondary-expanded-container-width` drives the width,\n // so brand overrides are honoured and no inline style wins specificity.\n const hasWidthOverride =\n isWidthControlled || currentWidth !== SIDEBAR_EXPANDED_WIDTH;\n const inlineStyle: React.CSSProperties | undefined =\n resizableProp && expanded && hasWidthOverride\n ? { width: currentWidth }\n : undefined;\n\n const element = useRender({\n render,\n ref,\n defaultTagName: 'nav',\n props: mergeProps<'nav'>(\n {\n 'aria-label': ariaLabel,\n // `data-state` drives every collapsed/expanded token switch via\n // attribute selectors; typed loosely because React's nav attribute\n // map doesn't include arbitrary data-* keys as literals.\n ...({ 'data-state': expanded ? 'expanded' : 'collapsed' } as Record<\n string,\n string\n >),\n style: inlineStyle,\n className: cn(\n 'group/sidebar relative flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-e border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-inline-end-width:var(--ui-sidebar-secondary-global-container-border-width)] w-[var(--ui-sidebar-secondary-collapsed-container-width)] data-[state=expanded]:w-[var(--ui-sidebar-secondary-expanded-container-width)] transition-[width]',\n resizableProp &&\n 'transition-[width,border-color] has-[[role=separator]:hover]:[border-inline-end-color:var(--ui-resizable-border-color-hover)] has-[[role=separator]:active]:[border-inline-end-color:var(--ui-resizable-border-color-active)] has-[[role=separator]:focus-visible]:[border-inline-end-color:var(--ui-resizable-border-color-active)]',\n className\n ),\n children: (\n <>\n <SidebarSecondaryCollapsedBreadcrumb />\n {children}\n <SidebarSecondaryResizeEdge />\n </>\n ),\n },\n props\n ),\n });\n\n return (\n <SidebarSecondaryContext.Provider value={context}>\n {element}\n </SidebarSecondaryContext.Provider>\n );\n }\n);\nSidebarSecondary.displayName = 'SidebarSecondary';\n\nexport interface SidebarSecondaryHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Heading text (or pass as children). */\n label?: React.ReactNode;\n}\n\nconst SidebarSecondaryHeader = React.forwardRef<\n HTMLDivElement,\n SidebarSecondaryHeaderProps\n>(({ className, label, children, ...props }, ref) => {\n const { setHeaderLabel } = useSidebarSecondaryContext();\n const resolvedLabel = label ?? children;\n\n // Register the header text so the collapsed breadcrumb can auto-display it.\n React.useEffect(() => {\n setHeaderLabel(resolvedLabel);\n }, [resolvedLabel, setHeaderLabel]);\n\n return (\n <div\n ref={ref}\n className={cn(\n 'hidden items-center shrink-0',\n 'group-data-[state=expanded]/sidebar:flex',\n 'px-[var(--ui-sidebar-secondary-global-container-header-padding-x)] py-[var(--ui-sidebar-secondary-global-container-header-padding-y)]',\n className\n )}\n {...props}\n >\n <h2 className=\"ui-sidebar-secondary-global-header-label-text-style truncate text-[var(--ui-sidebar-secondary-global-header-label-color)]\">\n {resolvedLabel}\n </h2>\n </div>\n );\n});\nSidebarSecondaryHeader.displayName = 'SidebarSecondaryHeader';\n\nconst SidebarSecondaryContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n // Expanded: the section list. Hidden in collapsed mode, where the\n // CollapsedBreadcrumb sibling takes over.\n <div\n ref={ref}\n className={cn(\n 'flex flex-1 flex-col overflow-y-auto gap-[var(--ui-sidebar-secondary-global-section-list-gap)]',\n 'hidden group-data-[state=expanded]/sidebar:flex',\n className\n )}\n {...props}\n />\n));\nSidebarSecondaryContent.displayName = 'SidebarSecondaryContent';\n\nexport interface SidebarSecondaryCollapsedBreadcrumbProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * The parent section label (breadcrumbLabel).\n * Auto-derived from the `SidebarSecondaryHeader` label when omitted.\n */\n parentLabel?: React.ReactNode;\n /**\n * The current page label (labelCurrentPage).\n * Auto-derived from the selected `SidebarSecondaryMenuItem` when omitted.\n */\n currentLabel?: React.ReactNode;\n /** Separator between the two; defaults to a 16px ChevronDownIcon. */\n separator?: React.ReactNode;\n}\n\nconst SidebarSecondaryCollapsedBreadcrumb = React.forwardRef<\n HTMLDivElement,\n SidebarSecondaryCollapsedBreadcrumbProps\n>(({ className, parentLabel, currentLabel, separator, ...props }, ref) => {\n const { headerLabel, selectedLabel } = useSidebarSecondaryContext();\n const resolvedParent = parentLabel ?? headerLabel;\n const resolvedCurrent = currentLabel ?? selectedLabel;\n\n return (\n // Shown only in collapsed mode — toggled by the same data-[state] selector so\n // it stays in the DOM (SSR-present) with no JS branch. Laid out vertically:\n // parent → separator → current page.\n <div\n ref={ref}\n className={cn(\n 'flex flex-1 flex-col items-center min-h-0',\n 'gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]',\n 'flex group-data-[state=expanded]/sidebar:hidden',\n className\n )}\n {...props}\n >\n <span className=\"[writing-mode:vertical-rl] [direction:ltr] shrink-0 ui-sidebar-secondary-collapsed-breadcrumb-label-text-style text-[var(--ui-sidebar-secondary-collapsed-breadcrumb-label-color)]\">\n {resolvedParent}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"inline-flex items-center text-[var(--ui-sidebar-secondary-collapsed-icon-separator-color)] [&>svg]:size-[var(--ui-sidebar-secondary-collapsed-icon-separator-size)]\"\n >\n {separator ?? <ChevronDownIcon size={16} />}\n </span>\n <span className=\"[writing-mode:vertical-rl] [direction:ltr] flex-1 min-h-0 overflow-hidden ui-sidebar-secondary-collapsed-label-current-page-text-style text-[var(--ui-sidebar-secondary-collapsed-label-current-page-color)]\">\n {resolvedCurrent}\n </span>\n </div>\n );\n});\nSidebarSecondaryCollapsedBreadcrumb.displayName =\n 'SidebarSecondaryCollapsedBreadcrumb';\n\nconst SidebarSecondaryFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex flex-col shrink-0',\n 'border-t border-[var(--ui-sidebar-secondary-global-container-footer-border-color)] [border-top-width:var(--ui-sidebar-secondary-global-container-footer-border-width)]',\n 'py-[var(--ui-sidebar-secondary-section-container-padding-y)]',\n className\n )}\n {...props}\n />\n));\nSidebarSecondaryFooter.displayName = 'SidebarSecondaryFooter';\n\n// A section can be a static group (label + items) or an EXPANDABLE disclosure\n// (Figma Section `expandable=yes-*`): the label becomes a chevron toggle that\n// shows/hides the whole item list. Whether a section is expandable is shared to\n// its label + menu via this context (default: static), so the same `SectionLabel`\n// / `Menu` parts adapt without a separate component set.\ninterface SidebarSecondarySectionContextValue {\n expandable: boolean;\n}\n\nconst SidebarSecondarySectionContext =\n React.createContext<SidebarSecondarySectionContextValue>({\n expandable: false,\n });\n\nconst SECTION_STATIC: SidebarSecondarySectionContextValue = {\n expandable: false,\n};\nconst SECTION_EXPANDABLE: SidebarSecondarySectionContextValue = {\n expandable: true,\n};\n\nexport interface SidebarSecondarySectionProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Make the section a collapsible disclosure: the `SidebarSecondarySectionLabel`\n * becomes a chevron toggle and the `SidebarSecondaryMenu` becomes its panel.\n */\n expandable?: boolean;\n /** Controlled open state (expandable sections only). */\n open?: boolean;\n /** Uncontrolled initial open state (expandable sections only). Defaults to open. */\n defaultOpen?: boolean;\n /** Fires with the next open value when an expandable section toggles. */\n onOpenChange?: (open: boolean) => void;\n}\n\nconst SidebarSecondarySection = React.forwardRef<\n HTMLDivElement,\n SidebarSecondarySectionProps\n>(\n (\n {\n className,\n expandable = false,\n open,\n defaultOpen = true,\n onOpenChange,\n children,\n ...props\n },\n ref\n ) => {\n // Sections are separated by vertical padding + the section label; the next-gen\n // token sync removed the inter-section divider (no\n // `--ui-sidebar-secondary-section-container-border-*` token survives).\n const sectionClass = cn(\n 'flex flex-col py-[var(--ui-sidebar-secondary-section-container-padding-y)]',\n className\n );\n\n if (!expandable) {\n return (\n <SidebarSecondarySectionContext.Provider value={SECTION_STATIC}>\n <div ref={ref} className={sectionClass} {...props}>\n {children}\n </div>\n </SidebarSecondarySectionContext.Provider>\n );\n }\n\n // Expandable: Base UI Collapsible owns the open state (controlled or\n // uncontrolled) + the aria-expanded/aria-controls wiring on the trigger.\n return (\n <SidebarSecondarySectionContext.Provider value={SECTION_EXPANDABLE}>\n <Collapsible.Root\n ref={ref}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n render={<div className={sectionClass} />}\n {...props}\n >\n {children}\n </Collapsible.Root>\n </SidebarSecondarySectionContext.Provider>\n );\n }\n);\nSidebarSecondarySection.displayName = 'SidebarSecondarySection';\n\nexport interface SidebarSecondarySectionLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Trailing header actions (e.g. a ghost `ButtonIcon`). Rendered outside the toggle. */\n actions?: React.ReactNode;\n /**\n * A rollup badge (e.g. a `Tag` with an unread count) shown in the header only\n * when an expandable section is collapsed. Ignored for static sections.\n */\n unreadRollup?: React.ReactNode;\n}\n\nconst sectionLabelTextClass =\n 'ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]';\nconst sectionHeaderPadClass =\n 'min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] py-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]';\n\nconst SidebarSecondarySectionLabel = React.forwardRef<\n HTMLDivElement,\n SidebarSecondarySectionLabelProps\n>(({ className, actions, unreadRollup, children, ...props }, ref) => {\n const { expandable } = React.useContext(SidebarSecondarySectionContext);\n const dir = useDocDir();\n const rowRef = React.useRef<HTMLDivElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const isOverflowing = useIsOverflowing(labelRef, { enabled: true });\n const setRowRef = (node: HTMLDivElement | null) => {\n rowRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n // Anchored to the row (not the label span) so it lines up with the\n // sidebar's right edge regardless of how much the label shrinks for\n // trailing actions/rollup.\n const labelTooltip = (\n <Tooltip disabled={!isOverflowing}>\n <TooltipTrigger\n render={\n <span\n ref={labelRef}\n className=\"min-w-0 flex-1 truncate\"\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent anchor={rowRef} side={dir === 'rtl' ? 'left' : 'right'}>\n {children}\n </TooltipContent>\n </Tooltip>\n );\n\n if (!expandable) {\n // Static header: preserve the original markup when there are no actions so\n // existing layouts/baselines are unchanged.\n const base = cn(sectionLabelTextClass, sectionHeaderPadClass, className);\n if (actions == null) {\n return (\n <div\n ref={setRowRef}\n className={cn(\n base,\n 'flex items-center'\n )}\n {...props}\n >\n {labelTooltip}\n </div>\n );\n }\n return (\n <div\n ref={setRowRef}\n className={cn(\n base,\n 'flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]'\n )}\n {...props}\n >\n {labelTooltip}\n <span className=\"flex shrink-0 items-center\">{actions}</span>\n </div>\n );\n }\n\n // Expandable header: a chevron toggle (the Collapsible trigger) plus optional\n // trailing actions kept OUTSIDE the trigger button (no nested buttons). The\n // unread-rollup badge sits inside the trigger and shows only while collapsed.\n return (\n <div\n ref={setRowRef}\n className={cn(\n 'flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]',\n sectionHeaderPadClass,\n className\n )}\n {...props}\n >\n <Collapsible.Trigger\n className={cn(\n 'group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start cursor-pointer',\n sectionLabelTextClass,\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset'\n )}\n >\n <ChevronDownIcon\n size={16}\n aria-hidden=\"true\"\n className=\"shrink-0 ltr:-rotate-90 rtl:rotate-90 transition-transform group-data-[panel-open]/section:rotate-0 text-[var(--ui-sidebar-secondary-section-icon-arrow-color)]\"\n />\n {labelTooltip}\n {unreadRollup != null && (\n <span className=\"flex shrink-0 items-center group-data-[panel-open]/section:hidden\">\n {unreadRollup}\n </span>\n )}\n </Collapsible.Trigger>\n {actions != null && (\n <span className=\"flex shrink-0 items-center\">{actions}</span>\n )}\n </div>\n );\n});\nSidebarSecondarySectionLabel.displayName = 'SidebarSecondarySectionLabel';\n\nconst SidebarSecondaryMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentPropsWithoutRef<'ul'>\n>(({ className, ...props }, ref) => {\n const { expandable } = React.useContext(SidebarSecondarySectionContext);\n const list = (\n <ul\n ref={ref}\n className={cn(\n 'flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]',\n className\n )}\n {...props}\n />\n );\n // Inside an expandable section the item list IS the collapsible panel, so it\n // mounts/unmounts with the section's open state.\n return expandable ? <Collapsible.Panel>{list}</Collapsible.Panel> : list;\n});\nSidebarSecondaryMenu.displayName = 'SidebarSecondaryMenu';\n\n// Shared row geometry + the GLOBAL icon/label state colors (shared across\n// selected/unselected — DESIGN §6.2). The cva `variant` only swaps the container\n// fill. Each interaction state is wired to its own token even where acronis's\n// value is unchanged (runtime var() references honor brand overrides only on the\n// referenced token).\nconst sidebarSecondaryRowClasses =\n 'group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-menu-item-global-container-gap)] min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] px-[var(--ui-sidebar-secondary-menu-item-global-container-padding-x)] py-[var(--ui-sidebar-secondary-menu-item-global-container-padding-y)] no-underline ui-sidebar-secondary-menu-item-global-label-text-style transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset text-[var(--ui-sidebar-secondary-menu-item-global-label-color-color)] [&_svg]:shrink-0 [&_svg]:size-[var(--ui-sidebar-secondary-menu-item-global-icon-size)] [&_svg]:text-[var(--ui-sidebar-secondary-menu-item-global-icon-color-color)]';\n\nconst sidebarSecondaryMenuItemVariants = cva(sidebarSecondaryRowClasses, {\n variants: {\n variant: {\n unselected:\n 'bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-active)]',\n selected:\n 'bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'unselected',\n },\n});\n\nexport interface SidebarSecondaryMenuItemProps\n extends\n Omit<React.ComponentPropsWithoutRef<'a'>, 'children'>,\n Omit<VariantProps<typeof sidebarSecondaryMenuItemVariants>, 'variant'> {\n /** Marks the current route: sets the `selected` variant + `aria-current=\"page\"`. */\n selected?: boolean;\n /** Optional leading 16px icon (`hasIcon` in Figma). */\n icon?: React.ReactNode;\n /** Trailing extras (tag, shortcut, external-link icon — `hasExtras` in Figma). */\n extras?: React.ReactNode;\n children?: React.ReactNode;\n /** Replace the rendered `<a>` (e.g. a router `Link` or a `<button>`). */\n render?: useRender.RenderProp;\n}\n\nconst SidebarSecondaryMenuItem = React.forwardRef<\n HTMLAnchorElement,\n SidebarSecondaryMenuItemProps\n>(\n (\n { className, selected = false, icon, extras, render, children, ...props },\n ref\n ) => {\n const { expanded, setSelectedLabel } = useSidebarSecondaryContext();\n const { expandable } = React.useContext(SidebarSecondarySectionContext);\n const dir = useDocDir();\n const rowRef = React.useRef<HTMLAnchorElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const isOverflowing = useIsOverflowing(labelRef, { enabled: expanded });\n\n // Register this item's label when selected so the collapsed breadcrumb\n // auto-displays the current page without manual props.\n React.useEffect(() => {\n if (selected) setSelectedLabel(children);\n }, [selected, children, setSelectedLabel]);\n\n const inner = useRender({\n render,\n ref: [ref, rowRef],\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn(\n sidebarSecondaryMenuItemVariants({\n variant: selected ? 'selected' : 'unselected',\n }),\n // Inside an expandable section, increase start padding so the\n // label aligns with the section header text (after chevron + gap)\n // while keeping the container full-width for hover/active fills.\n expandable &&\n 'ps-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-section-container-header-gap)+16px)]',\n className\n ),\n 'aria-current': selected ? 'page' : undefined,\n onKeyDown: (e: React.KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === ' ') {\n e.preventDefault();\n e.currentTarget.click();\n }\n },\n children: (\n <>\n {icon != null && (\n <span className=\"flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]\">\n {icon}\n </span>\n )}\n {/* Keep the label in the DOM as `sr-only` in collapsed/rail mode so\n an icon-only row keeps an accessible name (a11y §7). The tooltip\n trigger is the label span itself — it only opens when the label\n is actually clipped. It's anchored to the row (not the label\n span) so it lines up with the sidebar's right edge regardless\n of how much the label shrinks for extras. */}\n <Tooltip disabled={!isOverflowing}>\n <TooltipTrigger\n render={\n <span\n ref={labelRef}\n className={cn(\n 'flex-1 min-w-[60px] truncate text-start',\n !expanded && 'sr-only'\n )}\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent\n anchor={rowRef}\n side={dir === 'rtl' ? 'left' : 'right'}\n >\n {children}\n </TooltipContent>\n </Tooltip>\n {extras}\n </>\n ),\n },\n props\n ),\n });\n\n return (\n <li className=\"contents\">\n {/* In collapsed/rail mode the label above is `sr-only` (zero-size), so\n it never receives the hover that would open its tooltip — wrap the\n whole row so the icon itself is hoverable and always shows the\n item's label as a tooltip while collapsed. */}\n <Tooltip disabled={expanded}>\n <TooltipTrigger render={inner} />\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'}>\n {children}\n </TooltipContent>\n </Tooltip>\n </li>\n );\n }\n);\nSidebarSecondaryMenuItem.displayName = 'SidebarSecondaryMenuItem';\n\nexport interface SidebarSecondaryMenuItemExtrasProps extends React.ComponentPropsWithoutRef<'span'> {\n /** Which trailing affordance to render. */\n variant: 'tag' | 'externalLink' | 'shortcut' | 'tag-externalLink';\n /** Shortcut text for the `shortcut` variant. */\n shortcut?: string;\n /** Tag content for the `tag` / `tag-externalLink` variants. */\n tag?: React.ReactNode;\n}\n\nconst SidebarSecondaryMenuItemExtras = React.forwardRef<\n HTMLSpanElement,\n SidebarSecondaryMenuItemExtrasProps\n>(({ className, variant, shortcut, tag, children, ...props }, ref) => {\n const { expanded } = useSidebarSecondaryContext();\n const showTag = variant === 'tag' || variant === 'tag-externalLink';\n const showExternal =\n variant === 'externalLink' || variant === 'tag-externalLink';\n const showShortcut = variant === 'shortcut';\n\n return (\n <span\n ref={ref}\n className={cn(\n 'inline-flex items-center shrink-0 min-h-6 overflow-clip gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]',\n !expanded && 'hidden',\n className\n )}\n {...props}\n >\n {showTag && (tag ?? children)}\n {showShortcut && (\n <span className=\"ui-sidebar-secondary-menu-item-extras-global-shortcut-text-style text-[var(--ui-sidebar-secondary-menu-item-extras-global-shortcut-color)]\">\n {shortcut ?? children}\n </span>\n )}\n {showExternal && (\n <SquareArrowUpRightIcon\n size={16}\n className=\"text-[var(--ui-sidebar-secondary-menu-item-extras-global-external-icon-color)] size-[var(--ui-sidebar-secondary-menu-item-extras-global-external-icon-size)]\"\n />\n )}\n </span>\n );\n});\nSidebarSecondaryMenuItemExtras.displayName = 'SidebarSecondaryMenuItemExtras';\n\nexport interface SidebarSecondaryCollapseTriggerProps extends Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'children'\n> {\n /** Leading 16px icon (e.g. a panel-left glyph). Rotates 180° between expanded/collapsed — same as `SidebarPrimaryCollapseTrigger`. */\n icon?: React.ReactNode;\n /** Tooltip text shown when the sidebar is collapsed. Defaults to `'Expand'`. */\n expandTooltip?: React.ReactNode;\n /** Trailing extras (e.g. a keyboard shortcut hint), same slot as `SidebarSecondaryMenuItem`. */\n extras?: React.ReactNode;\n children?: React.ReactNode;\n}\n\n// The footer \"Collapse menu\" affordance. A row-styled `<button>` that flips the\n// panel width via the layout context — the live wiring for the controllable\n// `expanded` state (B1). Keeps its label as `sr-only` in collapsed mode.\n// When collapsed, wraps the button in a Tooltip showing \"Expand\".\nconst SidebarSecondaryCollapseTrigger = React.forwardRef<\n HTMLButtonElement,\n SidebarSecondaryCollapseTriggerProps\n>(\n (\n {\n className,\n icon,\n expandTooltip = 'Expand',\n extras,\n children,\n onClick,\n ...props\n },\n ref\n ) => {\n const { expanded, toggleExpanded } = useSidebarSecondaryContext();\n const dir = useDocDir();\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const isOverflowing = useIsOverflowing(labelRef, { enabled: expanded });\n\n const button = (\n <button\n ref={(node) => {\n buttonRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n type=\"button\"\n aria-expanded={expanded}\n className={cn(\n sidebarSecondaryMenuItemVariants({ variant: 'unselected' }),\n 'text-start',\n className\n )}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) toggleExpanded();\n }}\n {...props}\n >\n {icon != null && (\n <span\n className={cn(\n 'flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform',\n expanded ? 'rtl:rotate-180' : 'ltr:rotate-180'\n )}\n >\n {icon}\n </span>\n )}\n <Tooltip disabled={!isOverflowing}>\n <TooltipTrigger\n render={\n <span\n ref={labelRef}\n className={cn('flex-1 min-w-[60px] truncate', !expanded && 'sr-only')}\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent anchor={buttonRef} side={dir === 'rtl' ? 'left' : 'right'}>\n {children}\n </TooltipContent>\n </Tooltip>\n {extras}\n </button>\n );\n\n return (\n <li className=\"contents\">\n <Tooltip disabled={expanded}>\n <TooltipTrigger render={button} />\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'}>\n {expandTooltip}\n </TooltipContent>\n </Tooltip>\n </li>\n );\n }\n);\nSidebarSecondaryCollapseTrigger.displayName = 'SidebarSecondaryCollapseTrigger';\n\nexport {\n SidebarSecondary,\n SidebarSecondaryHeader,\n SidebarSecondaryContent,\n SidebarSecondaryCollapsedBreadcrumb,\n SidebarSecondaryFooter,\n SidebarSecondarySection,\n SidebarSecondarySectionLabel,\n SidebarSecondaryMenu,\n SidebarSecondaryMenuItem,\n SidebarSecondaryMenuItemExtras,\n SidebarSecondaryCollapseTrigger,\n sidebarSecondaryMenuItemVariants,\n};\n"],"names":["useIsOverflowing","ref","enabled","isOverflowing","setIsOverflowing","React","element","measure","observer","SIDEBAR_EXPANDED_WIDTH","SIDEBAR_MAX_WIDTH","defaultResizeTooltipExpanded","jsxs","Fragment","jsx","defaultResizeTooltipCollapsed","SidebarSecondaryContext","useSidebarSecondaryContext","useControllableBoolean","controlled","defaultValue","onChange","uncontrolled","setUncontrolled","isControlled","value","setValue","next","SidebarSecondaryResizeEdge","ctx","expanded","toggleExpanded","resizable","dir","useDocDir","ctxRef","didDragRef","tooltipOpen","setTooltipOpen","dragging","setDragging","clickTimerRef","handlePointerDown","e","el","sidebarEl","isRtl","sidebarRect","minWidth","maxWidth","collapseThreshold","onPointerMove","ev","newWidth","isExpanded","onPointerUp","handleClick","handleDoubleClick","handleKeyDown","defaultWidth","w","sw","exp","te","step","growKey","shrinkKey","Tooltip","open","TooltipTrigger","cn","TooltipContent","SidebarSecondary","className","expandedProp","defaultExpanded","onExpandedChange","resizableProp","widthProp","onWidthChange","resizeAriaLabel","resizeTooltipExpanded","resizeTooltipCollapsed","ariaLabel","render","children","props","setExpanded","width","setWidthState","isWidthControlled","currentWidth","setWidth","headerLabel","setHeaderLabel","selectedLabel","setSelectedLabel","context","useRender","mergeProps","SidebarSecondaryCollapsedBreadcrumb","SidebarSecondaryHeader","label","resolvedLabel","SidebarSecondaryContent","parentLabel","currentLabel","separator","resolvedParent","resolvedCurrent","ChevronDownIcon","SidebarSecondaryFooter","SidebarSecondarySectionContext","SECTION_STATIC","SECTION_EXPANDABLE","SidebarSecondarySection","expandable","defaultOpen","onOpenChange","sectionClass","Collapsible","sectionLabelTextClass","sectionHeaderPadClass","SidebarSecondarySectionLabel","actions","unreadRollup","rowRef","labelRef","setRowRef","node","labelTooltip","base","SidebarSecondaryMenu","list","sidebarSecondaryRowClasses","sidebarSecondaryMenuItemVariants","cva","SidebarSecondaryMenuItem","selected","icon","extras","inner","SidebarSecondaryMenuItemExtras","variant","shortcut","tag","showTag","showExternal","showShortcut","SquareArrowUpRightIcon","SidebarSecondaryCollapseTrigger","expandTooltip","onClick","buttonRef","button","event"],"mappings":";;;;;;;;;;AAyBA,SAASA,EACPC,GACA,EAAE,SAAAC,KACO;AACT,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAM,SAAS,EAAK;AAE9D,SAAAA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A,YAEH,gBAAAvE,EAACyD,KAAe,QAAQkF,GAAW,MAAMxH,MAAQ,QAAQ,SAAS,SAC/D,UAAAoD,EAAA,CACH;AAAA,UAAA,GACF;AAAA,UACCuD;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAIL,6BACG,MAAA,EAAG,WAAU,YACZ,UAAA,gBAAAhI,EAACuD,GAAA,EAAQ,UAAUrC,GACjB,UAAA;AAAA,MAAA,gBAAAhB,EAACuD,GAAA,EAAe,QAAQqF,EAAA,CAAQ;AAAA,wBAC/BnF,GAAA,EAAe,MAAMtC,MAAQ,QAAQ,SAAS,SAC5C,UAAAsH,EAAA,CACH;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAEJ;AACF;AACAD,GAAgC,cAAc;"}
|
|
1
|
+
{"version":3,"file":"sidebar-secondary.js","sources":["../../../../src/components/ui/sidebar-secondary/sidebar-secondary.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { Collapsible } from '@base-ui/react/collapsible';\nimport {\n ChevronDownIcon,\n SquareArrowUpRightIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { useDocDir } from '@/lib/use-doc-dir';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\n\n/**\n * Tracks whether `ref`'s element is clipping its own content (`scrollWidth >\n * clientWidth`) — used to gate a tooltip so it only opens when a truncated\n * label is actually cut off. Re-measures via `ResizeObserver` (covers the\n * rail's expand/collapse width transition); `enabled` skips measurement\n * entirely (e.g. while collapsed, where the label is `sr-only`).\n */\nfunction useIsOverflowing<T extends Element>(\n ref: React.RefObject<T | null>,\n { enabled }: { enabled: boolean }\n): boolean {\n const [isOverflowing, setIsOverflowing] = React.useState(false);\n\n React.useEffect(() => {\n const element = ref.current;\n if (!enabled || !element) {\n setIsOverflowing(false);\n return;\n }\n const measure = () =>\n setIsOverflowing(element.scrollWidth > element.clientWidth);\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled]);\n\n return isOverflowing;\n}\n\n// Resize constraints — mirrors the design-token defaults.\n// CSS still uses `var(--ui-sidebar-secondary-expanded-container-width)` so\n// brands that override the token get the correct visual width; these JS\n// constants only govern the drag-resize clamping range.\nconst SIDEBAR_EXPANDED_WIDTH = 256; // --ui-sidebar-secondary-expanded-container-width\nconst SIDEBAR_MAX_WIDTH = SIDEBAR_EXPANDED_WIDTH * 2;\n\n// Composable SidebarSecondary primitives mirroring the Figma \"SidebarSecondary\"\n// component set (node 2468:59502, variant expanded|collapsed). Every color and\n// metric is wired to a next-gen `--ui-sidebar-secondary-*` token from\n// @acronis-platform/tokens-pd — no hex, no invented tokens.\n//\n// Like SidebarPrimary, expanded/collapsed is a width-reflow state (not a panel\n// show/hide), modelled as a controlled/uncontrolled `expanded` prop (default\n// true) that sets `data-state=\"expanded|collapsed\"` on the root and is shared to\n// descendants via context. The collapsed rail replaces the section list with a\n// vertical breadcrumb (parent → separator → current page), toggled purely by the\n// `data-[state]` selectors so it is SSR-present and needs no JS branch.\n//\n// Menu-item color wiring DIVERGES from Primary (DESIGN §6.2): Secondary recolors\n// only the CONTAINER per selected/unselected; the icon and label use the shared\n// `--ui-sidebar-secondary-menu-item-global-{icon,label}-color-color` tokens\n// across both variants and every interaction state (the next-gen token sync\n// collapsed the former per-state idle/hover/active icon+label colors into a\n// single value each). So the cva base carries the global icon/label colors and\n// the two variants only swap the container fill.\n//\n// R6 (collapsed separator icon): resolved from the Figma node metadata — the\n// collapsed `iconSeparator` instance's mainComponent is \"ChevronDown\" (updated\n// from ChevronRight), so the separator defaults to `ChevronDownIcon` (16px),\n// tinted by `--ui-sidebar-secondary-collapsed-icon-separator-color`. In the\n// vertical breadcrumb flow (writing-mode: vertical-rl) the downward chevron\n// visually points \"forward\" in the reading direction. The disclosure chevron\n// uses `ChevronDownIcon` rotated via `data-panel-open`. The focus ring reuses the\n// shared `--ui-focus-brand` (no sidebar focus token exists — R1).\n\nconst defaultResizeTooltipExpanded = (\n <>\n <span className=\"font-semibold\">Resize:</span> Drag\n <br />\n <span className=\"font-semibold\">Collapse:</span> Click\n <br />\n <span className=\"font-semibold\">Reset size:</span> Double click\n </>\n);\n\nconst defaultResizeTooltipCollapsed = (\n <>\n <span className=\"font-semibold\">Resize:</span> Drag\n <br />\n <span className=\"font-semibold\">Expand:</span> Click\n </>\n);\n\ninterface SidebarSecondaryContextValue {\n expanded: boolean;\n /** Flip the panel width — drives the controlled/uncontrolled `expanded` state. */\n toggleExpanded: () => void;\n /** Whether resize is enabled. */\n resizable: boolean;\n /** Current width in px (only meaningful when resizable + expanded). */\n width: number;\n /** Update the width (used by the resize edge during drag). */\n setWidth: (width: number) => void;\n /** Min resize width — derived from `--ui-sidebar-secondary-expanded-container-width`. */\n minWidth: number;\n /** Max resize width — expanded-width × RESIZE_MAX_WIDTH_FACTOR. */\n maxWidth: number;\n /** Default (reset) width — equals expanded-container-width token. */\n defaultWidth: number;\n /** Label registered by `SidebarSecondaryHeader` — consumed by the collapsed breadcrumb. */\n headerLabel: React.ReactNode;\n /** Register the header label (called by `SidebarSecondaryHeader`). */\n setHeaderLabel: (label: React.ReactNode) => void;\n /** Label of the currently selected `MenuItem` — consumed by the collapsed breadcrumb. */\n selectedLabel: React.ReactNode;\n /** Register the selected item label (called by `SidebarSecondaryMenuItem`). */\n setSelectedLabel: (label: React.ReactNode) => void;\n /** Accessible label for the resize edge separator. */\n resizeAriaLabel: string;\n /** Tooltip content shown when the sidebar is expanded. */\n resizeTooltipExpanded: React.ReactNode;\n /** Tooltip content shown when the sidebar is collapsed. */\n resizeTooltipCollapsed: React.ReactNode;\n}\n\nconst SidebarSecondaryContext =\n React.createContext<SidebarSecondaryContextValue | null>(null);\n\nfunction useSidebarSecondaryContext(): SidebarSecondaryContextValue {\n // Default to expanded so parts render standalone (in isolation tests /\n // stories) without a wrapping root; the toggle is a no-op outside a root.\n return (\n React.useContext(SidebarSecondaryContext) ?? {\n expanded: true,\n toggleExpanded: () => {},\n resizable: false,\n width: SIDEBAR_EXPANDED_WIDTH,\n setWidth: () => {},\n minWidth: SIDEBAR_EXPANDED_WIDTH,\n maxWidth: SIDEBAR_MAX_WIDTH,\n defaultWidth: SIDEBAR_EXPANDED_WIDTH,\n headerLabel: undefined,\n setHeaderLabel: () => {},\n selectedLabel: undefined,\n setSelectedLabel: () => {},\n resizeAriaLabel: 'Resize sidebar',\n resizeTooltipExpanded: defaultResizeTooltipExpanded,\n resizeTooltipCollapsed: defaultResizeTooltipCollapsed,\n }\n );\n}\n\n/**\n * Controlled + uncontrolled boolean state (the Base UI idiom). When `controlled`\n * is provided it wins and the setter only emits the change callback; otherwise\n * the setter updates internal state. `onChange` is ALWAYS invoked with the next\n * value so a consumer can react in either mode.\n */\nfunction useControllableBoolean(\n controlled: boolean | undefined,\n defaultValue: boolean,\n onChange?: (next: boolean) => void\n): [boolean, (next: boolean) => void] {\n const [uncontrolled, setUncontrolled] = React.useState(defaultValue);\n const isControlled = controlled !== undefined;\n const value = isControlled ? controlled : uncontrolled;\n const setValue = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolled(next);\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n return [value, setValue];\n}\n\nexport interface SidebarSecondaryProps extends React.ComponentPropsWithoutRef<'nav'> {\n /** Controlled expanded (rail width) state. */\n expanded?: boolean;\n /** Uncontrolled initial expanded state. Defaults to `true` (full width). */\n defaultExpanded?: boolean;\n /** Fires when the expanded state changes (e.g. a consumer toggle). */\n onExpandedChange?: (expanded: boolean) => void;\n /**\n * Enable the draggable resize edge on the right border.\n * When `true`, the sidebar can be resized between the expanded-width token\n * and twice that value.\n */\n resizable?: boolean;\n /** Controlled width in px (only used when `resizable`). */\n width?: number;\n /** Fires when the width changes due to a drag interaction. */\n onWidthChange?: (width: number) => void;\n /** Accessible label for the resize edge (`role=\"separator\"`). Defaults to `'Resize sidebar'`. */\n resizeAriaLabel?: string;\n /** Tooltip content shown when the sidebar is expanded. Pass `null` to hide the tooltip entirely. */\n resizeTooltipExpanded?: React.ReactNode;\n /** Tooltip content shown when the sidebar is collapsed. Pass `null` to hide the tooltip entirely. */\n resizeTooltipCollapsed?: React.ReactNode;\n /**\n * Replace the rendered `<nav>` with another element or component\n * (Base UI composition). Accepts a React element or a render function.\n */\n render?: useRender.RenderProp;\n}\n\n// ---------------------------------------------------------------------------\n// SidebarSecondaryResizeEdge — internal drag/click handle on the right edge\n// ---------------------------------------------------------------------------\n// Styled after `ResizableHandle` (Figma 4649:6681): a hit area that takes up no\n// layout space around a 1px divider, idle → `--ui-border-on-surface-border`,\n// hover → `--ui-resizable-border-color-hover`,\n// drag → `--ui-resizable-border-color-active`.\n// ---------------------------------------------------------------------------\n\nfunction SidebarSecondaryResizeEdge() {\n const ctx = useSidebarSecondaryContext();\n const { expanded, toggleExpanded, resizable } = ctx;\n const dir = useDocDir();\n\n // Mutable ref so the closure-captured pointermove handler always reads\n // the latest context without re-attaching listeners.\n const ctxRef = React.useRef(ctx);\n ctxRef.current = ctx;\n\n // Track whether a pointermove actually happened between down→up so we can\n // suppress the click that the browser fires after every pointerup.\n const didDragRef = React.useRef(false);\n\n // Hide the tooltip while dragging.\n const [tooltipOpen, setTooltipOpen] = React.useState(false);\n const [dragging, setDragging] = React.useState(false);\n\n // Delay single-click so a double-click can cancel it.\n const clickTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(\n null\n );\n\n // Clear any pending click timer on unmount.\n React.useEffect(() => {\n return () => {\n if (clickTimerRef.current) clearTimeout(clickTimerRef.current);\n };\n }, []);\n\n if (!resizable) return null;\n\n const handlePointerDown = (e: React.PointerEvent<HTMLDivElement>) => {\n e.preventDefault();\n const el = e.currentTarget;\n el.setPointerCapture(e.pointerId);\n didDragRef.current = false;\n setDragging(true);\n setTooltipOpen(false);\n\n // Disable the width transition while dragging so resize follows the\n // cursor without animation lag.\n const sidebarEl = el.closest('[data-state]') as HTMLElement | null;\n if (!sidebarEl) {\n setDragging(false);\n el.releasePointerCapture(e.pointerId);\n return;\n }\n sidebarEl.style.transitionProperty = 'none';\n const isRtl = getComputedStyle(sidebarEl).direction === 'rtl';\n const sidebarRect = sidebarEl.getBoundingClientRect();\n\n const { minWidth, maxWidth } = ctxRef.current;\n const collapseThreshold = minWidth / 2;\n\n const onPointerMove = (ev: PointerEvent) => {\n didDragRef.current = true;\n const newWidth = isRtl\n ? sidebarRect.right - ev.clientX\n : ev.clientX - sidebarRect.left;\n const { expanded: isExpanded } = ctxRef.current;\n\n if (isExpanded) {\n if (newWidth < collapseThreshold) {\n ctxRef.current.toggleExpanded();\n } else {\n ctxRef.current.setWidth(\n Math.min(Math.max(newWidth, minWidth), maxWidth)\n );\n }\n } else {\n if (newWidth > collapseThreshold) {\n ctxRef.current.toggleExpanded();\n }\n }\n };\n\n const onPointerUp = () => {\n setDragging(false);\n // Restore transition so collapse/expand animates.\n if (sidebarEl) sidebarEl.style.transitionProperty = '';\n window.removeEventListener('pointermove', onPointerMove);\n window.removeEventListener('pointerup', onPointerUp);\n };\n\n window.addEventListener('pointermove', onPointerMove);\n window.addEventListener('pointerup', onPointerUp);\n };\n\n const handleClick = () => {\n // Suppress click when the interaction was a drag.\n if (didDragRef.current) return;\n // Cancel any pending click timer (dblclick fires two clicks).\n if (clickTimerRef.current) clearTimeout(clickTimerRef.current);\n // Wait to see if a double-click follows.\n clickTimerRef.current = setTimeout(() => {\n toggleExpanded();\n }, 250);\n };\n\n const handleDoubleClick = () => {\n // Cancel the pending single-click toggle.\n if (clickTimerRef.current) {\n clearTimeout(clickTimerRef.current);\n clickTimerRef.current = null;\n }\n if (!expanded) toggleExpanded();\n ctxRef.current.setWidth(ctxRef.current.defaultWidth);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n const {\n minWidth,\n maxWidth,\n defaultWidth,\n width: w,\n setWidth: sw,\n expanded: exp,\n toggleExpanded: te,\n } = ctxRef.current;\n const step = 16;\n const growKey = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const shrinkKey = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n if (e.key === growKey && exp) {\n e.preventDefault();\n sw(Math.min(w + step, maxWidth));\n } else if (e.key === growKey && !exp) {\n e.preventDefault();\n te();\n } else if (e.key === shrinkKey && exp) {\n e.preventDefault();\n const next = w - step;\n if (next < minWidth) {\n te();\n } else {\n sw(next);\n }\n } else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n te();\n } else if (e.key === 'Home') {\n e.preventDefault();\n if (!exp) te();\n sw(defaultWidth);\n }\n };\n\n const handleTooltipOpenChange = (open: boolean) => {\n // Never open the tooltip while dragging.\n if (dragging) return;\n setTooltipOpen(open);\n };\n\n return (\n <Tooltip open={tooltipOpen} onOpenChange={handleTooltipOpenChange} trackCursorAxis=\"y\">\n <TooltipTrigger\n render={\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={ctx.resizeAriaLabel}\n className={cn(\n // 17px hit area, absolutely positioned on inline-end edge.\n // The sidebar's own border-e provides the visible 1px line; its color\n // changes via :has() on hover/active/focus-visible.\n 'absolute end-0 top-0 h-full w-[17px] ltr:translate-x-1/2 rtl:-translate-x-1/2 cursor-[var(--ui-resizable-cursor,ew-resize)] z-10',\n // On focus: 1px active-color line (after pseudo, CSS border for pixel-snap) + 3px box-shadow ring centered on it.\n 'after:absolute after:inset-y-0 after:inset-x-0 after:mx-auto after:w-0 after:pointer-events-none',\n 'after:[border-inline-start-width:var(--ui-resizable-border-width,1px)] after:border-solid after:border-transparent',\n 'focus-visible:outline-none focus-visible:after:[border-inline-start-color:var(--ui-resizable-border-color-active)] focus-visible:after:[box-shadow:0_0_0_3px_var(--ui-focus-primary)]'\n )}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onPointerDown={handlePointerDown}\n onClick={handleClick}\n onDoubleClick={handleDoubleClick}\n />\n }\n />\n {(expanded ? ctx.resizeTooltipExpanded : ctx.resizeTooltipCollapsed) !=\n null && (\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'} align=\"center\">\n {expanded ? ctx.resizeTooltipExpanded : ctx.resizeTooltipCollapsed}\n </TooltipContent>\n )}\n </Tooltip>\n );\n}\n\nconst SidebarSecondary = React.forwardRef<HTMLElement, SidebarSecondaryProps>(\n (\n {\n className,\n expanded: expandedProp,\n defaultExpanded = true,\n onExpandedChange,\n resizable: resizableProp = true,\n width: widthProp,\n onWidthChange,\n resizeAriaLabel = 'Resize sidebar',\n resizeTooltipExpanded = defaultResizeTooltipExpanded,\n resizeTooltipCollapsed = defaultResizeTooltipCollapsed,\n 'aria-label': ariaLabel = 'Section navigation',\n render,\n children,\n ...props\n },\n ref\n ) => {\n const [expanded, setExpanded] = useControllableBoolean(\n expandedProp,\n defaultExpanded,\n onExpandedChange\n );\n\n // Width is independent of expanded/collapsed — it persists across cycles.\n const [width, setWidthState] = React.useState(SIDEBAR_EXPANDED_WIDTH);\n const isWidthControlled = widthProp !== undefined;\n const currentWidth = isWidthControlled ? widthProp : width;\n const setWidth = React.useCallback(\n (next: number) => {\n if (!isWidthControlled) setWidthState(next);\n onWidthChange?.(next);\n },\n [isWidthControlled, onWidthChange]\n );\n\n // Collapse is driven by the consumer through the layout context — the\n // `SidebarSecondaryCollapseTrigger` calls `toggleExpanded`, which updates\n // uncontrolled state and always emits `onExpandedChange`. Controlled\n // consumers ignore the internal state and react to the callback.\n // Breadcrumb auto-wiring: Header and the selected MenuItem register their\n // labels so the collapsed breadcrumb can display them without manual props.\n const [headerLabel, setHeaderLabel] =\n React.useState<React.ReactNode>(undefined);\n const [selectedLabel, setSelectedLabel] =\n React.useState<React.ReactNode>(undefined);\n\n const context = React.useMemo<SidebarSecondaryContextValue>(\n () => ({\n expanded,\n toggleExpanded: () => setExpanded(!expanded),\n resizable: resizableProp,\n width: currentWidth,\n setWidth,\n minWidth: SIDEBAR_EXPANDED_WIDTH,\n maxWidth: SIDEBAR_MAX_WIDTH,\n defaultWidth: SIDEBAR_EXPANDED_WIDTH,\n headerLabel,\n setHeaderLabel,\n selectedLabel,\n setSelectedLabel,\n resizeAriaLabel,\n resizeTooltipExpanded,\n resizeTooltipCollapsed,\n }),\n [\n expanded,\n setExpanded,\n resizableProp,\n currentWidth,\n setWidth,\n headerLabel,\n selectedLabel,\n resizeAriaLabel,\n resizeTooltipExpanded,\n resizeTooltipCollapsed,\n ]\n );\n\n // When resizable + expanded, apply inline width ONLY when the user has\n // actively resized (or width is controlled). Otherwise the CSS token\n // `--ui-sidebar-secondary-expanded-container-width` drives the width,\n // so brand overrides are honoured and no inline style wins specificity.\n const hasWidthOverride =\n isWidthControlled || currentWidth !== SIDEBAR_EXPANDED_WIDTH;\n const inlineStyle: React.CSSProperties | undefined =\n resizableProp && expanded && hasWidthOverride\n ? { width: currentWidth }\n : undefined;\n\n const element = useRender({\n render,\n ref,\n defaultTagName: 'nav',\n props: mergeProps<'nav'>(\n {\n 'aria-label': ariaLabel,\n // `data-state` drives every collapsed/expanded token switch via\n // attribute selectors; typed loosely because React's nav attribute\n // map doesn't include arbitrary data-* keys as literals.\n ...({ 'data-state': expanded ? 'expanded' : 'collapsed' } as Record<\n string,\n string\n >),\n style: inlineStyle,\n className: cn(\n 'group/sidebar relative flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-e border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-inline-end-width:var(--ui-sidebar-secondary-global-container-border-width)] w-[var(--ui-sidebar-secondary-collapsed-container-width)] data-[state=expanded]:w-[var(--ui-sidebar-secondary-expanded-container-width)] transition-[width]',\n resizableProp &&\n 'transition-[width,border-color] has-[[role=separator]:hover]:[border-inline-end-color:var(--ui-resizable-border-color-hover)] has-[[role=separator]:active]:[border-inline-end-color:var(--ui-resizable-border-color-active)] has-[[role=separator]:focus-visible]:[border-inline-end-color:var(--ui-resizable-border-color-active)]',\n className\n ),\n children: (\n <>\n <SidebarSecondaryCollapsedBreadcrumb />\n {children}\n <SidebarSecondaryResizeEdge />\n </>\n ),\n },\n props\n ),\n });\n\n return (\n <SidebarSecondaryContext.Provider value={context}>\n {element}\n </SidebarSecondaryContext.Provider>\n );\n }\n);\nSidebarSecondary.displayName = 'SidebarSecondary';\n\nexport interface SidebarSecondaryHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Heading text (or pass as children). */\n label?: React.ReactNode;\n}\n\nconst SidebarSecondaryHeader = React.forwardRef<\n HTMLDivElement,\n SidebarSecondaryHeaderProps\n>(({ className, label, children, ...props }, ref) => {\n const { setHeaderLabel } = useSidebarSecondaryContext();\n const resolvedLabel = label ?? children;\n\n // Register the header text so the collapsed breadcrumb can auto-display it.\n React.useEffect(() => {\n setHeaderLabel(resolvedLabel);\n }, [resolvedLabel, setHeaderLabel]);\n\n return (\n <div\n ref={ref}\n className={cn(\n 'hidden items-center shrink-0',\n 'group-data-[state=expanded]/sidebar:flex',\n 'px-[var(--ui-sidebar-secondary-global-container-header-padding-x)] py-[var(--ui-sidebar-secondary-global-container-header-padding-y)]',\n className\n )}\n {...props}\n >\n <h2 className=\"ui-sidebar-secondary-global-header-label-text-style truncate text-[var(--ui-sidebar-secondary-global-header-label-color)]\">\n {resolvedLabel}\n </h2>\n </div>\n );\n});\nSidebarSecondaryHeader.displayName = 'SidebarSecondaryHeader';\n\nconst SidebarSecondaryContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n // Expanded: the section list. Hidden in collapsed mode, where the\n // CollapsedBreadcrumb sibling takes over.\n <div\n ref={ref}\n className={cn(\n 'flex flex-1 flex-col overflow-y-auto gap-[var(--ui-sidebar-secondary-global-section-list-gap)]',\n 'hidden group-data-[state=expanded]/sidebar:flex',\n className\n )}\n {...props}\n />\n));\nSidebarSecondaryContent.displayName = 'SidebarSecondaryContent';\n\nexport interface SidebarSecondaryCollapsedBreadcrumbProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * The parent section label (breadcrumbLabel).\n * Auto-derived from the `SidebarSecondaryHeader` label when omitted.\n */\n parentLabel?: React.ReactNode;\n /**\n * The current page label (labelCurrentPage).\n * Auto-derived from the selected `SidebarSecondaryMenuItem` when omitted.\n */\n currentLabel?: React.ReactNode;\n /** Separator between the two; defaults to a 16px ChevronDownIcon. */\n separator?: React.ReactNode;\n}\n\nconst SidebarSecondaryCollapsedBreadcrumb = React.forwardRef<\n HTMLDivElement,\n SidebarSecondaryCollapsedBreadcrumbProps\n>(({ className, parentLabel, currentLabel, separator, ...props }, ref) => {\n const { headerLabel, selectedLabel } = useSidebarSecondaryContext();\n const resolvedParent = parentLabel ?? headerLabel;\n const resolvedCurrent = currentLabel ?? selectedLabel;\n\n return (\n // Shown only in collapsed mode — toggled by the same data-[state] selector so\n // it stays in the DOM (SSR-present) with no JS branch. Laid out vertically:\n // parent → separator → current page.\n <div\n ref={ref}\n className={cn(\n 'flex flex-1 flex-col items-center min-h-0',\n 'gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]',\n 'flex group-data-[state=expanded]/sidebar:hidden',\n className\n )}\n {...props}\n >\n <span className=\"[writing-mode:vertical-rl] [direction:ltr] shrink-0 ui-sidebar-secondary-collapsed-breadcrumb-label-text-style text-[var(--ui-sidebar-secondary-collapsed-breadcrumb-label-color)]\">\n {resolvedParent}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"inline-flex items-center text-[var(--ui-sidebar-secondary-collapsed-icon-separator-color)] [&>svg]:size-[var(--ui-sidebar-secondary-collapsed-icon-separator-size)]\"\n >\n {separator ?? <ChevronDownIcon size={16} />}\n </span>\n <span className=\"[writing-mode:vertical-rl] [direction:ltr] flex-1 min-h-0 overflow-hidden ui-sidebar-secondary-collapsed-label-current-page-text-style text-[var(--ui-sidebar-secondary-collapsed-label-current-page-color)]\">\n {resolvedCurrent}\n </span>\n </div>\n );\n});\nSidebarSecondaryCollapsedBreadcrumb.displayName =\n 'SidebarSecondaryCollapsedBreadcrumb';\n\nconst SidebarSecondaryFooter = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex flex-col shrink-0',\n 'border-t border-[var(--ui-sidebar-secondary-global-container-footer-border-color)] [border-top-width:var(--ui-sidebar-secondary-global-container-footer-border-width)]',\n 'py-[var(--ui-sidebar-secondary-section-container-padding-y)]',\n className\n )}\n {...props}\n />\n));\nSidebarSecondaryFooter.displayName = 'SidebarSecondaryFooter';\n\n// A section can be a static group (label + items) or an EXPANDABLE disclosure\n// (Figma Section `expandable=yes-*`): the label becomes a chevron toggle that\n// shows/hides the whole item list. Whether a section is expandable is shared to\n// its label + menu via this context (default: static), so the same `SectionLabel`\n// / `Menu` parts adapt without a separate component set.\ninterface SidebarSecondarySectionContextValue {\n expandable: boolean;\n}\n\nconst SidebarSecondarySectionContext =\n React.createContext<SidebarSecondarySectionContextValue>({\n expandable: false,\n });\n\nconst SECTION_STATIC: SidebarSecondarySectionContextValue = {\n expandable: false,\n};\nconst SECTION_EXPANDABLE: SidebarSecondarySectionContextValue = {\n expandable: true,\n};\n\nexport interface SidebarSecondarySectionProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Make the section a collapsible disclosure: the `SidebarSecondarySectionLabel`\n * becomes a chevron toggle and the `SidebarSecondaryMenu` becomes its panel.\n */\n expandable?: boolean;\n /** Controlled open state (expandable sections only). */\n open?: boolean;\n /** Uncontrolled initial open state (expandable sections only). Defaults to open. */\n defaultOpen?: boolean;\n /** Fires with the next open value when an expandable section toggles. */\n onOpenChange?: (open: boolean) => void;\n}\n\nconst SidebarSecondarySection = React.forwardRef<\n HTMLDivElement,\n SidebarSecondarySectionProps\n>(\n (\n {\n className,\n expandable = false,\n open,\n defaultOpen = true,\n onOpenChange,\n children,\n ...props\n },\n ref\n ) => {\n // Sections are separated by vertical padding + the section label; the next-gen\n // token sync removed the inter-section divider (no\n // `--ui-sidebar-secondary-section-container-border-*` token survives).\n const sectionClass = cn(\n 'flex flex-col py-[var(--ui-sidebar-secondary-section-container-padding-y)]',\n className\n );\n\n if (!expandable) {\n return (\n <SidebarSecondarySectionContext.Provider value={SECTION_STATIC}>\n <div ref={ref} className={sectionClass} {...props}>\n {children}\n </div>\n </SidebarSecondarySectionContext.Provider>\n );\n }\n\n // Expandable: Base UI Collapsible owns the open state (controlled or\n // uncontrolled) + the aria-expanded/aria-controls wiring on the trigger.\n return (\n <SidebarSecondarySectionContext.Provider value={SECTION_EXPANDABLE}>\n <Collapsible.Root\n ref={ref}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n render={<div className={sectionClass} />}\n {...props}\n >\n {children}\n </Collapsible.Root>\n </SidebarSecondarySectionContext.Provider>\n );\n }\n);\nSidebarSecondarySection.displayName = 'SidebarSecondarySection';\n\nexport interface SidebarSecondarySectionLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Trailing header actions (e.g. a ghost `ButtonIcon`). Rendered outside the toggle. */\n actions?: React.ReactNode;\n /**\n * A rollup badge (e.g. a `Tag` with an unread count) shown in the header only\n * when an expandable section is collapsed. Ignored for static sections.\n */\n unreadRollup?: React.ReactNode;\n}\n\nconst sectionLabelTextClass =\n 'ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]';\nconst sectionHeaderPadClass =\n 'min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] py-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]';\n\nconst SidebarSecondarySectionLabel = React.forwardRef<\n HTMLDivElement,\n SidebarSecondarySectionLabelProps\n>(({ className, actions, unreadRollup, children, ...props }, ref) => {\n const { expandable } = React.useContext(SidebarSecondarySectionContext);\n const dir = useDocDir();\n const rowRef = React.useRef<HTMLDivElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const isOverflowing = useIsOverflowing(labelRef, { enabled: true });\n const setRowRef = (node: HTMLDivElement | null) => {\n rowRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n // Anchored to the row (not the label span) so it lines up with the\n // sidebar's right edge regardless of how much the label shrinks for\n // trailing actions/rollup.\n const labelTooltip = (\n <Tooltip disabled={!isOverflowing}>\n <TooltipTrigger\n render={\n <span\n ref={labelRef}\n className=\"min-w-0 flex-1 truncate\"\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent anchor={rowRef} side={dir === 'rtl' ? 'left' : 'right'}>\n {children}\n </TooltipContent>\n </Tooltip>\n );\n\n if (!expandable) {\n // Static header: preserve the original markup when there are no actions so\n // existing layouts/baselines are unchanged.\n const base = cn(sectionLabelTextClass, sectionHeaderPadClass, className);\n if (actions == null) {\n return (\n <div\n ref={setRowRef}\n className={cn(\n base,\n 'flex items-center'\n )}\n {...props}\n >\n {labelTooltip}\n </div>\n );\n }\n return (\n <div\n ref={setRowRef}\n className={cn(\n base,\n 'flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]'\n )}\n {...props}\n >\n {labelTooltip}\n <span className=\"flex shrink-0 items-center\">{actions}</span>\n </div>\n );\n }\n\n // Expandable header: a chevron toggle (the Collapsible trigger) plus optional\n // trailing actions kept OUTSIDE the trigger button (no nested buttons). The\n // unread-rollup badge sits inside the trigger and shows only while collapsed.\n return (\n <div\n ref={setRowRef}\n className={cn(\n 'flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]',\n sectionHeaderPadClass,\n className\n )}\n {...props}\n >\n <Collapsible.Trigger\n className={cn(\n 'group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start cursor-pointer',\n sectionLabelTextClass,\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset'\n )}\n >\n <ChevronDownIcon\n size={16}\n aria-hidden=\"true\"\n className=\"shrink-0 ltr:-rotate-90 rtl:rotate-90 transition-transform group-data-[panel-open]/section:rotate-0 text-[var(--ui-sidebar-secondary-section-icon-arrow-color)]\"\n />\n {labelTooltip}\n {unreadRollup != null && (\n <span className=\"flex shrink-0 items-center group-data-[panel-open]/section:hidden\">\n {unreadRollup}\n </span>\n )}\n </Collapsible.Trigger>\n {actions != null && (\n <span className=\"flex shrink-0 items-center\">{actions}</span>\n )}\n </div>\n );\n});\nSidebarSecondarySectionLabel.displayName = 'SidebarSecondarySectionLabel';\n\nconst SidebarSecondaryMenu = React.forwardRef<\n HTMLUListElement,\n React.ComponentPropsWithoutRef<'ul'>\n>(({ className, ...props }, ref) => {\n const { expandable } = React.useContext(SidebarSecondarySectionContext);\n const list = (\n <ul\n ref={ref}\n className={cn(\n 'flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]',\n className\n )}\n {...props}\n />\n );\n // Inside an expandable section the item list IS the collapsible panel, so it\n // mounts/unmounts with the section's open state.\n return expandable ? <Collapsible.Panel>{list}</Collapsible.Panel> : list;\n});\nSidebarSecondaryMenu.displayName = 'SidebarSecondaryMenu';\n\n// Shared row geometry + the GLOBAL icon/label state colors (shared across\n// selected/unselected — DESIGN §6.2). The cva `variant` only swaps the container\n// fill. Each interaction state is wired to its own token even where acronis's\n// value is unchanged (runtime var() references honor brand overrides only on the\n// referenced token).\nconst sidebarSecondaryRowClasses =\n 'group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-menu-item-global-container-gap)] min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] px-[var(--ui-sidebar-secondary-menu-item-global-container-padding-x)] py-[var(--ui-sidebar-secondary-menu-item-global-container-padding-y)] no-underline ui-sidebar-secondary-menu-item-global-label-text-style transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset text-[var(--ui-sidebar-secondary-menu-item-global-label-color-color)] [&_svg]:shrink-0 [&_svg]:size-[var(--ui-sidebar-secondary-menu-item-global-icon-size)] [&_svg]:text-[var(--ui-sidebar-secondary-menu-item-global-icon-color-color)]';\n\nconst sidebarSecondaryMenuItemVariants = cva(sidebarSecondaryRowClasses, {\n variants: {\n variant: {\n unselected:\n 'bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-active)]',\n selected:\n 'bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'unselected',\n },\n});\n\nexport interface SidebarSecondaryMenuItemProps\n extends\n Omit<React.ComponentPropsWithoutRef<'a'>, 'children'>,\n Omit<VariantProps<typeof sidebarSecondaryMenuItemVariants>, 'variant'> {\n /** Marks the current route: sets the `selected` variant + `aria-current=\"page\"`. */\n selected?: boolean;\n /** Optional leading 16px icon (`hasIcon` in Figma). */\n icon?: React.ReactNode;\n /** Trailing extras (tag, shortcut, external-link icon — `hasExtras` in Figma). */\n extras?: React.ReactNode;\n children?: React.ReactNode;\n /** Replace the rendered `<a>` (e.g. a router `Link` or a `<button>`). */\n render?: useRender.RenderProp;\n}\n\nconst SidebarSecondaryMenuItem = React.forwardRef<\n HTMLAnchorElement,\n SidebarSecondaryMenuItemProps\n>(\n (\n { className, selected = false, icon, extras, render, children, ...props },\n ref\n ) => {\n const { expanded, setSelectedLabel } = useSidebarSecondaryContext();\n const { expandable } = React.useContext(SidebarSecondarySectionContext);\n const dir = useDocDir();\n const rowRef = React.useRef<HTMLAnchorElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const isOverflowing = useIsOverflowing(labelRef, { enabled: expanded });\n\n // Register this item's label when selected so the collapsed breadcrumb\n // auto-displays the current page without manual props.\n React.useEffect(() => {\n if (selected) setSelectedLabel(children);\n }, [selected, children, setSelectedLabel]);\n\n const inner = useRender({\n render,\n ref: [ref, rowRef],\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn(\n sidebarSecondaryMenuItemVariants({\n variant: selected ? 'selected' : 'unselected',\n }),\n // Inside an expandable section, increase start padding so the\n // label aligns with the section header text (after chevron + gap)\n // while keeping the container full-width for hover/active fills.\n expandable &&\n 'ps-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-section-container-header-gap)+16px)]',\n className\n ),\n 'aria-current': selected ? 'page' : undefined,\n onKeyDown: (e: React.KeyboardEvent<HTMLAnchorElement>) => {\n if (e.key === ' ') {\n e.preventDefault();\n e.currentTarget.click();\n }\n },\n children: (\n <>\n {icon != null && (\n <span className=\"flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]\">\n {icon}\n </span>\n )}\n {/* Keep the label in the DOM as `sr-only` in collapsed/rail mode so\n an icon-only row keeps an accessible name (a11y §7). The tooltip\n trigger is the label span itself — it only opens when the label\n is actually clipped. It's anchored to the row (not the label\n span) so it lines up with the sidebar's right edge regardless\n of how much the label shrinks for extras. */}\n <Tooltip disabled={!isOverflowing}>\n <TooltipTrigger\n render={\n <span\n ref={labelRef}\n className={cn(\n 'flex-1 min-w-[60px] truncate text-start',\n !expanded && 'sr-only'\n )}\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent\n anchor={rowRef}\n side={dir === 'rtl' ? 'left' : 'right'}\n >\n {children}\n </TooltipContent>\n </Tooltip>\n {extras}\n </>\n ),\n },\n props\n ),\n });\n\n return (\n <li className=\"contents\">\n {/* In collapsed/rail mode the label above is `sr-only` (zero-size), so\n it never receives the hover that would open its tooltip — wrap the\n whole row so the icon itself is hoverable and always shows the\n item's label as a tooltip while collapsed. */}\n <Tooltip disabled={expanded}>\n <TooltipTrigger render={inner} />\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'}>\n {children}\n </TooltipContent>\n </Tooltip>\n </li>\n );\n }\n);\nSidebarSecondaryMenuItem.displayName = 'SidebarSecondaryMenuItem';\n\nexport interface SidebarSecondaryMenuItemExtrasProps extends React.ComponentPropsWithoutRef<'span'> {\n /** Which trailing affordance to render. */\n variant: 'tag' | 'externalLink' | 'shortcut' | 'tag-externalLink';\n /** Shortcut text for the `shortcut` variant. */\n shortcut?: string;\n /** Tag content for the `tag` / `tag-externalLink` variants. */\n tag?: React.ReactNode;\n}\n\nconst SidebarSecondaryMenuItemExtras = React.forwardRef<\n HTMLSpanElement,\n SidebarSecondaryMenuItemExtrasProps\n>(({ className, variant, shortcut, tag, children, ...props }, ref) => {\n const { expanded } = useSidebarSecondaryContext();\n const showTag = variant === 'tag' || variant === 'tag-externalLink';\n const showExternal =\n variant === 'externalLink' || variant === 'tag-externalLink';\n const showShortcut = variant === 'shortcut';\n\n return (\n <span\n ref={ref}\n className={cn(\n 'inline-flex items-center shrink-0 min-h-6 overflow-clip gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]',\n !expanded && 'hidden',\n className\n )}\n {...props}\n >\n {showTag && (tag ?? children)}\n {showShortcut && (\n <span className=\"ui-sidebar-secondary-menu-item-extras-global-shortcut-text-style text-[var(--ui-sidebar-secondary-menu-item-extras-global-shortcut-color)]\">\n {shortcut ?? children}\n </span>\n )}\n {showExternal && (\n <SquareArrowUpRightIcon\n size={16}\n className=\"text-[var(--ui-sidebar-secondary-menu-item-extras-global-external-icon-color)] size-[var(--ui-sidebar-secondary-menu-item-extras-global-external-icon-size)]\"\n />\n )}\n </span>\n );\n});\nSidebarSecondaryMenuItemExtras.displayName = 'SidebarSecondaryMenuItemExtras';\n\nexport interface SidebarSecondaryCollapseTriggerProps extends Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'children'\n> {\n /** Leading 16px icon (e.g. a panel-left glyph). Rotates 180° between expanded/collapsed — same as `SidebarPrimaryCollapseTrigger`. */\n icon?: React.ReactNode;\n /** Tooltip text shown when the sidebar is collapsed. Defaults to `'Expand'`. */\n expandTooltip?: React.ReactNode;\n /** Trailing extras (e.g. a keyboard shortcut hint), same slot as `SidebarSecondaryMenuItem`. */\n extras?: React.ReactNode;\n children?: React.ReactNode;\n}\n\n// The footer \"Collapse menu\" affordance. A row-styled `<button>` that flips the\n// panel width via the layout context — the live wiring for the controllable\n// `expanded` state (B1). Keeps its label as `sr-only` in collapsed mode.\n// When collapsed, wraps the button in a Tooltip showing \"Expand\".\nconst SidebarSecondaryCollapseTrigger = React.forwardRef<\n HTMLButtonElement,\n SidebarSecondaryCollapseTriggerProps\n>(\n (\n {\n className,\n icon,\n expandTooltip = 'Expand',\n extras,\n children,\n onClick,\n ...props\n },\n ref\n ) => {\n const { expanded, toggleExpanded } = useSidebarSecondaryContext();\n const dir = useDocDir();\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const isOverflowing = useIsOverflowing(labelRef, { enabled: expanded });\n\n const button = (\n <button\n ref={(node) => {\n buttonRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n type=\"button\"\n aria-expanded={expanded}\n className={cn(\n sidebarSecondaryMenuItemVariants({ variant: 'unselected' }),\n 'text-start',\n className\n )}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) toggleExpanded();\n }}\n {...props}\n >\n {icon != null && (\n <span\n className={cn(\n 'flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform',\n expanded ? 'rtl:rotate-180' : 'ltr:rotate-180'\n )}\n >\n {icon}\n </span>\n )}\n <Tooltip disabled={!isOverflowing}>\n <TooltipTrigger\n render={\n <span\n ref={labelRef}\n className={cn('flex-1 min-w-[60px] truncate', !expanded && 'sr-only')}\n />\n }\n >\n {children}\n </TooltipTrigger>\n <TooltipContent anchor={buttonRef} side={dir === 'rtl' ? 'left' : 'right'}>\n {children}\n </TooltipContent>\n </Tooltip>\n {extras}\n </button>\n );\n\n return (\n <li className=\"contents\">\n <Tooltip disabled={expanded}>\n <TooltipTrigger render={button} />\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'}>\n {expandTooltip}\n </TooltipContent>\n </Tooltip>\n </li>\n );\n }\n);\nSidebarSecondaryCollapseTrigger.displayName = 'SidebarSecondaryCollapseTrigger';\n\nexport {\n SidebarSecondary,\n SidebarSecondaryHeader,\n SidebarSecondaryContent,\n SidebarSecondaryCollapsedBreadcrumb,\n SidebarSecondaryFooter,\n SidebarSecondarySection,\n SidebarSecondarySectionLabel,\n SidebarSecondaryMenu,\n SidebarSecondaryMenuItem,\n SidebarSecondaryMenuItemExtras,\n SidebarSecondaryCollapseTrigger,\n sidebarSecondaryMenuItemVariants,\n};\n"],"names":["useIsOverflowing","ref","enabled","isOverflowing","setIsOverflowing","React","element","measure","observer","SIDEBAR_EXPANDED_WIDTH","SIDEBAR_MAX_WIDTH","defaultResizeTooltipExpanded","jsxs","Fragment","jsx","defaultResizeTooltipCollapsed","SidebarSecondaryContext","useSidebarSecondaryContext","useControllableBoolean","controlled","defaultValue","onChange","uncontrolled","setUncontrolled","isControlled","value","setValue","next","SidebarSecondaryResizeEdge","ctx","expanded","toggleExpanded","resizable","dir","useDocDir","ctxRef","didDragRef","tooltipOpen","setTooltipOpen","dragging","setDragging","clickTimerRef","handlePointerDown","e","el","sidebarEl","isRtl","sidebarRect","minWidth","maxWidth","collapseThreshold","onPointerMove","ev","newWidth","isExpanded","onPointerUp","handleClick","handleDoubleClick","handleKeyDown","defaultWidth","w","sw","exp","te","step","growKey","shrinkKey","Tooltip","open","TooltipTrigger","cn","TooltipContent","SidebarSecondary","className","expandedProp","defaultExpanded","onExpandedChange","resizableProp","widthProp","onWidthChange","resizeAriaLabel","resizeTooltipExpanded","resizeTooltipCollapsed","ariaLabel","render","children","props","setExpanded","width","setWidthState","isWidthControlled","currentWidth","setWidth","headerLabel","setHeaderLabel","selectedLabel","setSelectedLabel","context","useRender","mergeProps","SidebarSecondaryCollapsedBreadcrumb","SidebarSecondaryHeader","label","resolvedLabel","SidebarSecondaryContent","parentLabel","currentLabel","separator","resolvedParent","resolvedCurrent","ChevronDownIcon","SidebarSecondaryFooter","SidebarSecondarySectionContext","SECTION_STATIC","SECTION_EXPANDABLE","SidebarSecondarySection","expandable","defaultOpen","onOpenChange","sectionClass","Collapsible","sectionLabelTextClass","sectionHeaderPadClass","SidebarSecondarySectionLabel","actions","unreadRollup","rowRef","labelRef","setRowRef","node","labelTooltip","base","SidebarSecondaryMenu","list","sidebarSecondaryRowClasses","sidebarSecondaryMenuItemVariants","cva","SidebarSecondaryMenuItem","selected","icon","extras","inner","SidebarSecondaryMenuItemExtras","variant","shortcut","tag","showTag","showExternal","showShortcut","SquareArrowUpRightIcon","SidebarSecondaryCollapseTrigger","expandTooltip","onClick","buttonRef","button","event"],"mappings":";;;;;;;;;;AAyBA,SAASA,EACPC,GACA,EAAE,SAAAC,KACO;AACT,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAM,SAAS,EAAK;AAE9D,SAAAA,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAUL,EAAI;AACpB,QAAI,CAACC,KAAW,CAACI,GAAS;AACxB,MAAAF,EAAiB,EAAK;AACtB;AAAA,IACF;AACA,UAAMG,IAAU,MACdH,EAAiBE,EAAQ,cAAcA,EAAQ,WAAW;AAC5D,IAAAC,EAAA;AACA,UAAMC,IAAW,IAAI,eAAeD,CAAO;AAC3C,WAAAC,EAAS,QAAQF,CAAO,GACjB,MAAME,EAAS,WAAA;AAAA,EACxB,GAAG,CAACP,GAAKC,CAAO,CAAC,GAEVC;AACT;AAMA,MAAMM,IAAyB,KACzBC,IAAoBD,IAAyB,GA+B7CE,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,iBAAgB,UAA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