@womp/kookie-ui 0.29.2 → 0.30.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.
Files changed (106) hide show
  1. package/components.css +86 -0
  2. package/dist/cjs/components/_internal/navigator-host.d.ts +21 -0
  3. package/dist/cjs/components/_internal/navigator-host.d.ts.map +1 -0
  4. package/dist/cjs/components/_internal/navigator-host.js +3 -0
  5. package/dist/cjs/components/_internal/navigator-host.js.map +7 -0
  6. package/dist/cjs/components/combobox.js +1 -1
  7. package/dist/cjs/components/combobox.js.map +4 -4
  8. package/dist/cjs/components/dialog.d.ts.map +1 -1
  9. package/dist/cjs/components/dialog.js +1 -1
  10. package/dist/cjs/components/dialog.js.map +4 -4
  11. package/dist/cjs/components/index.d.ts +1 -0
  12. package/dist/cjs/components/index.d.ts.map +1 -1
  13. package/dist/cjs/components/index.js +2 -2
  14. package/dist/cjs/components/index.js.map +4 -4
  15. package/dist/cjs/components/navigator.d.ts +99 -0
  16. package/dist/cjs/components/navigator.d.ts.map +1 -0
  17. package/dist/cjs/components/navigator.js +3 -0
  18. package/dist/cjs/components/navigator.js.map +7 -0
  19. package/dist/cjs/components/popover.d.ts.map +1 -1
  20. package/dist/cjs/components/popover.js +1 -1
  21. package/dist/cjs/components/popover.js.map +4 -4
  22. package/dist/cjs/components/sheet.d.ts.map +1 -1
  23. package/dist/cjs/components/sheet.js +1 -1
  24. package/dist/cjs/components/sheet.js.map +4 -4
  25. package/dist/cjs/components/sidebar.js +1 -1
  26. package/dist/cjs/components/sidebar.js.map +4 -4
  27. package/dist/cjs/index.js +5 -5
  28. package/dist/cjs/index.js.map +4 -4
  29. package/dist/esm/chunk-4KBKS3ZE.js +3 -0
  30. package/dist/esm/chunk-4KBKS3ZE.js.map +7 -0
  31. package/dist/esm/chunk-5KX3RA3P.js +3 -0
  32. package/dist/esm/chunk-5KX3RA3P.js.map +7 -0
  33. package/dist/esm/chunk-6UFIS6B2.js +3 -0
  34. package/dist/esm/chunk-6UFIS6B2.js.map +7 -0
  35. package/dist/esm/chunk-CMHKCUHP.js +3 -0
  36. package/dist/esm/chunk-CMHKCUHP.js.map +7 -0
  37. package/dist/esm/{chunk-4LV37PHM.js → chunk-D74WY6UO.js} +2 -2
  38. package/dist/esm/chunk-E4KT72IB.js +2 -0
  39. package/dist/esm/chunk-EQE6QQXM.js +3 -0
  40. package/dist/esm/chunk-EQE6QQXM.js.map +7 -0
  41. package/dist/esm/{chunk-2E57H3NH.js → chunk-FRFVGYGX.js} +2 -2
  42. package/dist/esm/{chunk-2FYUM6TA.js → chunk-NEKIU24N.js} +2 -2
  43. package/dist/esm/{chunk-WAXRIARV.js → chunk-R4UKO4UK.js} +2 -2
  44. package/dist/esm/{chunk-AS2STDGA.js → chunk-VGJALIJ5.js} +2 -2
  45. package/dist/esm/{chunk-JTMLFTNZ.js → chunk-WAE4MLBN.js} +2 -2
  46. package/dist/esm/{chunk-MJROOEPE.js → chunk-YMRN5ESN.js} +2 -2
  47. package/dist/esm/{chunk-324VC67W.js → chunk-ZYQEFENG.js} +2 -2
  48. package/dist/esm/components/_internal/base-menu.utils.js +1 -1
  49. package/dist/esm/components/_internal/menu-context.js +1 -1
  50. package/dist/esm/components/_internal/navigator-host.d.ts +21 -0
  51. package/dist/esm/components/_internal/navigator-host.d.ts.map +1 -0
  52. package/dist/esm/components/_internal/navigator-host.js +3 -0
  53. package/dist/esm/components/_internal/navigator-host.js.map +7 -0
  54. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  55. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  56. package/dist/esm/components/alert-dialog.js +1 -1
  57. package/dist/esm/components/combobox.js +1 -1
  58. package/dist/esm/components/context-menu.js +1 -1
  59. package/dist/esm/components/dialog.d.ts.map +1 -1
  60. package/dist/esm/components/dialog.js +1 -1
  61. package/dist/esm/components/dropdown-menu.js +1 -1
  62. package/dist/esm/components/index.d.ts +1 -0
  63. package/dist/esm/components/index.d.ts.map +1 -1
  64. package/dist/esm/components/index.js +1 -1
  65. package/dist/esm/components/navigator.d.ts +99 -0
  66. package/dist/esm/components/navigator.d.ts.map +1 -0
  67. package/dist/esm/components/navigator.js +3 -0
  68. package/dist/esm/components/navigator.js.map +7 -0
  69. package/dist/esm/components/popover.d.ts.map +1 -1
  70. package/dist/esm/components/popover.js +1 -1
  71. package/dist/esm/components/schemas/index.js +1 -1
  72. package/dist/esm/components/separator.js +1 -1
  73. package/dist/esm/components/sheet.d.ts.map +1 -1
  74. package/dist/esm/components/sheet.js +1 -1
  75. package/dist/esm/components/shell.js +1 -1
  76. package/dist/esm/components/sidebar.js +1 -1
  77. package/dist/esm/components/toolbar.js +1 -1
  78. package/dist/esm/components/virtual-menu.js +1 -1
  79. package/dist/esm/hooks/index.js +1 -1
  80. package/dist/esm/index.js +1 -1
  81. package/package.json +1 -1
  82. package/src/components/_internal/navigator-host.ts +17 -0
  83. package/src/components/dialog.tsx +8 -0
  84. package/src/components/index.css +1 -0
  85. package/src/components/index.tsx +14 -0
  86. package/src/components/navigator.css +85 -0
  87. package/src/components/navigator.tsx +385 -0
  88. package/src/components/popover.tsx +18 -1
  89. package/src/components/sheet.tsx +8 -0
  90. package/styles.css +86 -0
  91. package/dist/esm/chunk-5BX2YZV6.js +0 -3
  92. package/dist/esm/chunk-5BX2YZV6.js.map +0 -7
  93. package/dist/esm/chunk-HR2VHGJ5.js +0 -3
  94. package/dist/esm/chunk-HR2VHGJ5.js.map +0 -7
  95. package/dist/esm/chunk-MJKVVGGV.js +0 -3
  96. package/dist/esm/chunk-MJKVVGGV.js.map +0 -7
  97. package/dist/esm/chunk-NG54K6FL.js +0 -2
  98. /package/dist/esm/{chunk-4LV37PHM.js.map → chunk-D74WY6UO.js.map} +0 -0
  99. /package/dist/esm/{chunk-NG54K6FL.js.map → chunk-E4KT72IB.js.map} +0 -0
  100. /package/dist/esm/{chunk-2E57H3NH.js.map → chunk-FRFVGYGX.js.map} +0 -0
  101. /package/dist/esm/{chunk-2FYUM6TA.js.map → chunk-NEKIU24N.js.map} +0 -0
  102. /package/dist/esm/{chunk-WAXRIARV.js.map → chunk-R4UKO4UK.js.map} +0 -0
  103. /package/dist/esm/{chunk-AS2STDGA.js.map → chunk-VGJALIJ5.js.map} +0 -0
  104. /package/dist/esm/{chunk-JTMLFTNZ.js.map → chunk-WAE4MLBN.js.map} +0 -0
  105. /package/dist/esm/{chunk-MJROOEPE.js.map → chunk-YMRN5ESN.js.map} +0 -0
  106. /package/dist/esm/{chunk-324VC67W.js.map → chunk-ZYQEFENG.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/sidebar.tsx", "../../../src/components/slot.tsx", "../../../src/components/dropdown-menu.tsx", "../../../src/components/scroll-area.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/width.props.ts", "../../../src/props/height.props.ts", "../../../src/props/color.prop.ts", "../../../src/components/_internal/base-menu.props.ts", "../../../src/components/theme.tsx", "../../../src/helpers/get-matching-gray-color.ts", "../../../src/hooks/theme-size.ts", "../../../src/helpers/theme-size.ts", "../../../src/hooks/use-prop-synced-state.ts", "../../../src/components/theme.props.tsx", "../../../src/components/_internal/portal-theme.tsx", "../../../src/components/_internal/pane-band-context.ts", "../../../src/components/icons.tsx", "../../../src/components/_internal/dropdown-menu-drill-down.tsx", "../../../src/components/_internal/menu-context.tsx", "../../../src/components/_internal/base-menu.utils.tsx", "../../../src/components/kbd.tsx", "../../../src/components/kbd.props.tsx", "../../../src/hooks/use-breakpoint.ts", "../../../src/components/shell.types.ts", "../../../src/helpers/require-react-element.ts", "../../../src/components/popover.tsx", "../../../src/components/popover.props.tsx", "../../../src/components/separator.tsx", "../../../src/components/separator.props.tsx", "../../../src/components/chip.tsx", "../../../src/components/chip.props.tsx", "../../../src/components/tooltip.tsx", "../../../src/components/text.tsx", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/text.props.tsx", "../../../src/components/tooltip.props.tsx", "../../../src/components/_internal/pane-chrome.tsx", "../../../src/components/_internal/shell-page-scroll.ts"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot.js';\nimport * as Accordion from '@radix-ui/react-accordion';\nimport * as DropdownMenu from './dropdown-menu.js';\nimport * as Popover from './popover.js';\n\nimport { Separator } from './separator.js';\nimport { ThickChevronRightIcon } from './icons.js';\nimport { Kbd } from './kbd.js';\nimport { Chip } from './chip.js';\nimport { ShellSizeContext, useSidebarVisual } from './_internal/pane-chrome.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { ChipProps } from './chip.js';\n\n// Chip configuration for the `badge` slot of sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: ChipProps['variant'];\n size?: ChipProps['size'];\n color?: ChipProps['color'];\n radius?: ChipProps['radius'];\n};\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, SidebarSeparatorProps>(({ className, ...props }, forwardedRef) => (\n <Separator {...props} ref={forwardedRef} className={classNames('kui-SidebarSeparator', className)} />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - styled like dropdown menus, but semantically a navigation list.\n// No menu/menuitem roles: those promise an application menu, which a list of links is not.\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(({ className, ...props }, forwardedRef) => (\n <ul {...props} ref={forwardedRef} className={classNames('kui-SidebarMenu', className)} />\n));\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuItem', className)} />\n));\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\n// The name a component type goes by: a function, or the function inside forwardRef or memo.\nfunction componentName(type: unknown): string | undefined {\n if (typeof type === 'function') {\n const fn = type as { displayName?: string; name?: string };\n return fn.displayName || fn.name;\n }\n if (type && typeof type === 'object') {\n const wrapped = type as { displayName?: string; render?: unknown; type?: unknown };\n return wrapped.displayName || componentName(wrapped.render) || componentName(wrapped.type);\n }\n return undefined;\n}\n\nfunction isIconElement(el: React.ReactElement<{ icon?: unknown }>): boolean {\n if (el.type === 'svg') return true;\n if (el.props?.icon) return true;\n return componentName(el.type)?.includes('Icon') ?? false;\n}\n\nfunction isText(node: React.ReactNode): node is string | number {\n return typeof node === 'string' || typeof node === 'number';\n}\n\n// Thin mode puts the row's icon in a wrapper that carries the hover and active tile. An icon is\n// an svg, a HugeiconsIcon, or a component named *Icon. Failing that, the first element ahead of\n// other content is taken as the icon (Lucide and other icon sets).\nfunction separateIconsAndLabels(node: React.ReactNode): { icons: React.ReactNode[]; labels: React.ReactNode[] } {\n const children = React.Children.toArray(node);\n const icons: React.ReactNode[] = [];\n const labels: React.ReactNode[] = [];\n\n for (const child of children) {\n if (React.isValidElement<{ icon?: unknown }>(child) && isIconElement(child)) icons.push(child);\n else labels.push(isText(child) ? <span key={labels.length} className=\"kui-SidebarMenuLabel\">{child}</span> : child);\n }\n\n if (icons.length === 0 && children.length > 1 && React.isValidElement(children[0])) {\n icons.push(children[0]);\n labels.shift();\n }\n\n return { icons, labels };\n}\n\n// Wraps the row's own text in a label span. Text inside the caller's elements is left alone.\nfunction wrapTextNodes(node: React.ReactNode): React.ReactNode {\n return React.Children.map(node, (child) => (isText(child) ? <span className=\"kui-SidebarMenuLabel\">{child}</span> : child));\n}\n\n// Arrow Up and Down move between the visible buttons of the same sidebar, as a\n// convenience on top of Tab. Sub-menu triggers take part, so the one-item Accordion\n// behind each sub-menu doesn't keep focus on its own trigger.\nfunction focusAdjacentSidebarButton(event: React.KeyboardEvent<HTMLElement>) {\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n const scope = event.currentTarget.closest('.kui-SidebarContent, .kui-SidebarSearchPopover');\n const buttons = scope\n ? Array.from(scope.querySelectorAll<HTMLElement>('.kui-SidebarMenuButton')).filter((el) => el.offsetParent !== null)\n : [];\n const index = buttons.indexOf(event.currentTarget);\n const next = buttons[index + (event.key === 'ArrowDown' ? 1 : -1)];\n if (index !== -1 && next) {\n event.preventDefault();\n next.focus();\n }\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, shortcut, badge, className, children, onKeyDown, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const sidebarSize = visual?.size ?? shellSize;\n const isThinMode = visual?.presentation === 'thin';\n\n const Comp = asChild ? Slot : 'button';\n\n // Enter and Space are left to the native button or link. The caller's handler runs first,\n // so it can preventDefault to keep the arrow keys for itself.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) focusAdjacentSidebarButton(event);\n };\n\n const extras = isThinMode ? null : (\n <>\n {badge && (\n <div className=\"kui-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Chip size={sidebarSize} variant=\"soft\">\n {badge}\n </Chip>\n ) : (\n <Chip size={badge.size || sidebarSize} variant={badge.variant || 'soft'} color={badge.color} radius={badge.radius}>\n {badge.content}\n </Chip>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"kui-BaseMenuShortcut kui-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n );\n\n const renderContent = (content: React.ReactNode): React.ReactNode => {\n if (isThinMode) {\n const { icons, labels } = separateIconsAndLabels(content);\n if (icons.length > 0) {\n return (\n <>\n <span className=\"kui-SidebarMenuIconWrapper\">{icons}</span>\n {labels}\n </>\n );\n }\n }\n return (\n <>\n {wrapTextNodes(content)}\n {extras}\n </>\n );\n };\n\n // When rendering asChild, Slot expects a single child element. The row's content goes\n // inside that element, so a Link gets the label, icon tile, badge and shortcut.\n let body: React.ReactNode;\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children) && React.Children.count(children) === 1) {\n body = React.cloneElement(children, undefined, renderContent(children.props.children));\n } else if (asChild) {\n body = children;\n } else {\n body = renderContent(children);\n }\n\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n {...props}\n ref={forwardedRef}\n aria-current={isActive ? 'page' : undefined}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n onKeyDown={handleKeyDown}\n >\n {body}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components: Accordion in expanded, Dropdown in thin\nconst SidebarSubMenuModeContext = React.createContext<'accordion' | 'dropdown'>('accordion');\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(({ defaultOpen = false, children, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const mode: 'accordion' | 'dropdown' = visual?.presentation === 'thin' ? 'dropdown' : 'accordion';\n\n if (mode === 'dropdown') {\n return (\n <div {...props} ref={forwardedRef}>\n <DropdownMenu.Root>\n <SidebarSubMenuModeContext.Provider value=\"dropdown\">{children}</SidebarSubMenuModeContext.Provider>\n </DropdownMenu.Root>\n </div>\n );\n }\n\n return (\n <div {...props} ref={forwardedRef}>\n <SidebarSubMenuModeContext.Provider value=\"accordion\">\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </SidebarSubMenuModeContext.Provider>\n </div>\n );\n});\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<React.ElementRef<typeof Accordion.Trigger>, SidebarMenuSubTriggerProps>(\n ({ asChild = false, className, children, onKeyDown, ...props }, forwardedRef) => {\n const mode = React.useContext(SidebarSubMenuModeContext);\n\n if (mode === 'dropdown') {\n return (\n <DropdownMenu.Trigger>\n <button\n {...(props as any)}\n onKeyDown={onKeyDown}\n ref={forwardedRef as any}\n type=\"button\"\n aria-haspopup=\"menu\"\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarMenuSubTrigger', className)}\n >\n {children}\n </button>\n </DropdownMenu.Trigger>\n );\n }\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n onKeyDown={(event) => {\n // Runs before the Accordion's own arrow handling, which would keep focus here.\n focusAdjacentSidebarButton(event);\n onKeyDown?.(event);\n }}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarMenuSubTrigger', className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon className={classNames('kui-BaseMenuSubTriggerIcon', 'kui-SidebarMenuSubTriggerIcon')} />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\n// In a Rail a sub-menu is a dropdown. Each row becomes a menu item: a MenuButton hands the item\n// its props (onClick, disabled, active), and an asChild one hands it its link.\nfunction toDropdownItem(node: React.ReactNode, key: React.Key): React.ReactNode {\n if (React.isValidElement<SidebarMenuButtonProps>(node) && node.type === SidebarMenuButton) {\n // The badge and shortcut have no place in a dropdown row; `type` belongs to a button only.\n const { asChild, isActive, shortcut, badge, type, children, ...rest } = node.props;\n const itemProps = {\n ...(rest as Omit<React.ComponentPropsWithoutRef<typeof DropdownMenu.Item>, 'color'>),\n 'data-active': isActive || undefined,\n 'aria-current': isActive ? ('page' as const) : undefined,\n };\n if (asChild && React.isValidElement(children) && React.Children.count(children) === 1) {\n return (\n <DropdownMenu.Item key={key} {...itemProps} asChild>\n {children}\n </DropdownMenu.Item>\n );\n }\n return (\n <DropdownMenu.Item key={key} {...itemProps}>\n {children}\n </DropdownMenu.Item>\n );\n }\n if (React.isValidElement(node)) {\n return (\n <DropdownMenu.Item key={key} asChild>\n {node}\n </DropdownMenu.Item>\n );\n }\n return <DropdownMenu.Item key={key}>{node}</DropdownMenu.Item>;\n}\n\n// The sub-list is a <ul>, so each row needs its own <li>. A MenuButton written straight into\n// MenuSubContent gets a MenuItem around it, rather than leaving an <a> or <button> in the list.\nfunction wrapBareMenuButtons(children: React.ReactNode): React.ReactNode {\n return React.Children.map(children, (child, index) =>\n React.isValidElement(child) && child.type === SidebarMenuButton ? (\n <SidebarMenuItem key={child.key ?? index}>{child}</SidebarMenuItem>\n ) : (\n child\n ),\n );\n}\n\nconst SidebarMenuSubContent = React.forwardRef<React.ElementRef<typeof Accordion.Content>, SidebarMenuSubContentProps>(({ className, children, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const mode = React.useContext(SidebarSubMenuModeContext);\n\n if (mode === 'dropdown') {\n const items = React.Children.map(children, (child, index) => {\n if (React.isValidElement<{ children?: React.ReactNode }>(child) && child.type === SidebarMenuItem) {\n const rows = React.Children.toArray(child.props.children);\n return toDropdownItem(rows.length === 1 ? rows[0] : rows, index);\n }\n return toDropdownItem(child, index);\n });\n\n return (\n <DropdownMenu.Content\n {...(props as Omit<React.ComponentPropsWithoutRef<typeof DropdownMenu.Content>, 'color'>)}\n ref={forwardedRef}\n size={visual?.size}\n className={classNames(className)}\n >\n <DropdownMenu.Group>{items}</DropdownMenu.Group>\n </DropdownMenu.Content>\n );\n }\n\n return (\n <Accordion.Content {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuSubContent', className)}>\n <ul className=\"kui-SidebarMenuSubList\">{wrapBareMenuButtons(children)}</ul>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components. A group with a label is a named group; one without stays a plain div, so it\n// isn't announced as an empty group.\ntype SidebarGroupContextValue = { labelId: string; setLabelId: (id: string | null) => void };\nconst SidebarGroupContext = React.createContext<SidebarGroupContextValue | null>(null);\n\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(({ className, ...props }, forwardedRef) => {\n const labelId = React.useId();\n const [renderedLabelId, setLabelId] = React.useState<string | null>(null);\n const context = React.useMemo(() => ({ labelId, setLabelId }), [labelId]);\n return (\n <SidebarGroupContext.Provider value={context}>\n <div\n role={renderedLabelId ? 'group' : undefined}\n aria-labelledby={renderedLabelId ?? undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-SidebarGroup', className)}\n />\n </SidebarGroupContext.Provider>\n );\n});\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(({ asChild = false, className, id, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n const group = React.useContext(SidebarGroupContext);\n const labelId = id ?? group?.labelId;\n const setLabelId = group?.setLabelId;\n\n React.useEffect(() => {\n if (!setLabelId || !labelId) return;\n setLabelId(labelId);\n return () => setLabelId(null);\n }, [setLabelId, labelId]);\n\n return <Comp {...props} id={labelId} ref={forwardedRef} className={classNames('kui-BaseMenuLabel', 'kui-SidebarGroupLabel', className)} />;\n});\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(({ className, ...props }, forwardedRef) => (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarGroupContent', className)} />\n));\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Search component: inline input in expanded, popover trigger in thin\ninterface SidebarSearchProps extends React.ComponentPropsWithoutRef<'div'> {\n value: string;\n onValueChange: (value: string) => void;\n placeholder?: string;\n children?: React.ReactNode;\n}\n\nconst SearchIcon = ({ className }: { className?: string }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n);\n\nconst ClearIcon = ({ className }: { className?: string }) => (\n <svg className={className} width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n);\n\nconst SidebarSearch = React.forwardRef<HTMLDivElement, SidebarSearchProps>(\n ({ value, onValueChange, placeholder = 'Search...', children, className, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const isThin = visual?.presentation === 'thin';\n const inputRef = React.useRef<HTMLInputElement>(null);\n const popoverRef = React.useRef<HTMLDivElement>(null);\n const searchId = React.useId();\n const resultsId = `${searchId}-results`;\n\n // Stable refs for values used in callbacks \u2014 avoids recreating handlers on every keystroke\n const valueRef = React.useRef(value);\n valueRef.current = value;\n const onValueChangeRef = React.useRef(onValueChange);\n onValueChangeRef.current = onValueChange;\n\n // Derive a clean aria-label from placeholder (strip trailing dots/ellipsis)\n const searchLabel = placeholder.replace(/\\.+$/, '');\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Escape' && valueRef.current) {\n e.preventDefault();\n e.stopPropagation();\n onValueChangeRef.current('');\n inputRef.current?.focus();\n }\n },\n [],\n );\n\n // Arrow key navigation within the popover (input \u2194 results)\n const handlePopoverKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n // A result row already moved focus with its own arrow handling (focusAdjacentSidebarButton\n // scopes to this popover); moving again would skip a row.\n if (e.defaultPrevented) return;\n const container = popoverRef.current;\n if (!container) return;\n\n const resultsGroup = container.querySelector('[role=\"group\"]');\n if (!resultsGroup) return;\n\n const items = Array.from(\n resultsGroup.querySelectorAll<HTMLElement>('a, button'),\n );\n if (items.length === 0) return;\n\n const active = document.activeElement as HTMLElement;\n const isOnInput = active === inputRef.current;\n const currentIndex = items.indexOf(active);\n\n // Typing while a result is focused \u2192 redirect focus to input\n if (\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey &&\n !isOnInput &&\n currentIndex !== -1\n ) {\n inputRef.current?.focus();\n return;\n }\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n if (isOnInput || currentIndex === -1) {\n items[0]?.focus();\n } else if (currentIndex < items.length - 1) {\n items[currentIndex + 1]?.focus();\n }\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n if (currentIndex <= 0) {\n inputRef.current?.focus();\n } else {\n items[currentIndex - 1]?.focus();\n }\n break;\n }\n case 'Home': {\n // Only intercept when focused on a result, not the input (where Home moves cursor)\n if (!isOnInput) {\n e.preventDefault();\n items[0]?.focus();\n }\n break;\n }\n case 'End': {\n if (!isOnInput) {\n e.preventDefault();\n items[items.length - 1]?.focus();\n }\n break;\n }\n }\n },\n [],\n );\n\n if (isThin) {\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarSearch', 'kui-SidebarSearch--thin', className)}>\n <Popover.Root>\n <Popover.Trigger>\n <button\n type=\"button\"\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarSearchTrigger')}\n aria-label={searchLabel}\n >\n <span className=\"kui-SidebarMenuIconWrapper\">\n <SearchIcon />\n </span>\n <span className=\"kui-SidebarMenuLabel\">Search</span>\n </button>\n </Popover.Trigger>\n <Popover.Content side=\"right\" align=\"start\" size=\"2\" width=\"280px\" aria-label={searchLabel}>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- keyDown manages arrow-key navigation between input and results, which is accessibility-enhancing */}\n <div\n ref={popoverRef}\n className=\"kui-SidebarSearchPopover\"\n role=\"search\"\n onKeyDown={handlePopoverKeyDown}\n >\n <div className=\"kui-SidebarSearchInputWrapper\">\n <SearchIcon className=\"kui-SidebarSearchIcon\" />\n <input\n ref={inputRef}\n type=\"search\"\n className=\"kui-SidebarSearchInput\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n aria-label={searchLabel}\n aria-controls={children ? resultsId : undefined}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- intentional: popover opens on user action, focusing the input is expected UX\n autoFocus\n />\n {value && (\n <button\n type=\"button\"\n className=\"kui-reset kui-SidebarSearchClear\"\n onClick={() => {\n onValueChange('');\n inputRef.current?.focus();\n }}\n aria-label=\"Clear search\"\n >\n <ClearIcon />\n </button>\n )}\n </div>\n {children && (\n <div id={resultsId} role=\"group\" aria-label=\"Search results\">\n {children}\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n }\n\n // Expanded mode: inline input\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarSearch', 'kui-SidebarSearch--expanded', 'kui-ShellPaneChrome', `kui-r-size-${visual?.size ?? '2'}`, className)} role=\"search\">\n <div className=\"kui-SidebarSearchInputWrapper\">\n <SearchIcon className=\"kui-SidebarSearchIcon\" />\n <input\n ref={inputRef}\n type=\"search\"\n className=\"kui-SidebarSearchInput\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n aria-label={searchLabel}\n />\n {value && (\n <button\n type=\"button\"\n className=\"kui-reset kui-SidebarSearchClear\"\n onClick={() => {\n onValueChange('');\n inputRef.current?.focus();\n }}\n aria-label=\"Clear search\"\n >\n <ClearIcon />\n </button>\n )}\n </div>\n </div>\n );\n },\n);\nSidebarSearch.displayName = 'Sidebar.Search';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n SidebarSearch as Search,\n};\n\nexport type { BadgeConfig };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\nimport { useCallbackRef } from 'radix-ui/internal';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuSubContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { useThemeContext } from './theme.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport {\n DrillDownLevelContext,\n DrillDownRoot,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n} from './_internal/dropdown-menu-drill-down.js';\nimport {\n MenuCloseProvider,\n MenuGroupLabelProvider,\n MenuProvider,\n useMenuGroupLabelId,\n useMenuGroupLabelledBy,\n} from './_internal/menu-context.js';\nimport {\n MenuShortcut,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n useResolvedResponsiveValue,\n} from './_internal/base-menu.utils.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { SubmenuBehavior } from './_internal/dropdown-menu-drill-down.js';\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes, Responsive } from '../props/prop-def.js';\n\n/**\n * Open state of the menu, mirrored from Root so Content can reset drill-down\n * navigation when a force-mounted menu opens again.\n */\nconst DropdownMenuOpenContext = React.createContext(false);\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => {\n const { open: openProp, defaultOpen = false, onOpenChange } = props;\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n handleOpenChangeProp(next);\n },\n [handleOpenChangeProp],\n );\n\n const close = React.useCallback(() => handleOpenChange(false), [handleOpenChange]);\n\n return (\n <DropdownMenuOpenContext.Provider value={open}>\n <MenuCloseProvider value={close}>\n <DropdownMenuPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} />\n </MenuCloseProvider>\n </DropdownMenuOpenContext.Provider>\n );\n};\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\n/** Visual props shared by Content and SubContent. */\ntype DropdownMenuSurfaceProps = GetPropDefTypes<typeof dropdownMenuSubContentPropDefs>;\n\ntype DropdownMenuContentContextValue = {\n size?: DropdownMenuSurfaceProps['size'];\n color?: DropdownMenuSurfaceProps['color'];\n};\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\n\n/** Keys that navigate back one drill-down level, by writing direction. */\nconst BACK_KEYS = { ltr: 'ArrowLeft', rtl: 'ArrowRight' } as const;\nconst FORWARD_KEYS = { ltr: 'ArrowRight', rtl: 'ArrowLeft' } as const;\n\nfunction isTextEntryTarget(target: EventTarget | null) {\n return (\n target instanceof HTMLElement &&\n (target.isContentEditable || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA')\n );\n}\n\nfunction getDirection(element: HTMLElement | null): 'ltr' | 'rtl' {\n return element?.closest('[dir]')?.getAttribute('dir') === 'rtl' ? 'rtl' : 'ltr';\n}\n\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior?: Responsive<SubmenuBehavior>;\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the dropdown.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, dropdownMenuContentPropDefs.size);\n const themeContext = useThemeContext();\n const {\n size = dropdownMenuContentPropDefs.size.default,\n } = props;\n const {\n className,\n children,\n color,\n container,\n forceMount,\n submenuBehavior,\n virtualized = false,\n onEscapeKeyDown,\n onKeyDown,\n ...contentProps\n } = extractProps(props, dropdownMenuContentPropDefs);\n\n const resolvedColor = color || themeContext.accentColor;\n const behavior = useResolvedResponsiveValue<SubmenuBehavior>(submenuBehavior, 'cascade');\n const isDrillDown = behavior === 'drill-down';\n const open = React.useContext(DropdownMenuOpenContext);\n const drillDownStore = useCreateDrillDownStore();\n\n // Escape goes back one drill-down level before it closes the menu.\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n onEscapeKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n event.preventDefault();\n drillDownStore.pop('keyboard');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n if (isTextEntryTarget(event.target)) return;\n if (event.key === BACK_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.pop('keyboard');\n }\n };\n\n const contextValue = React.useMemo(\n () => ({ size, color: resolvedColor }),\n [size, resolvedColor],\n );\n\n const contentBody = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>\n <DrillDownRoot store={drillDownStore} behavior={behavior} open={open}>\n {children}\n </DrillDownRoot>\n </DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n onEscapeKeyDown={handleEscapeKeyDown}\n onKeyDown={handleKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-DropdownMenuContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {contentBody}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>\n {contentBody}\n </div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.Content>\n </PortalTheme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, id: idProp, ...props }, forwardedRef) => {\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n const id = useMenuGroupLabelId(idProp, isLevelVisible);\n if (!isLevelVisible) return null;\n return (\n <DropdownMenuPrimitive.Label\n {...props}\n id={id}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-DropdownMenuLabel', className)}\n />\n );\n },\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n // In drill-down mode, items of levels that are not on screen do not mount.\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n // A drill-down level that is not on screen keeps its groups only to hold the open path.\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <DropdownMenuPrimitive.Group\n {...(isLevelVisible ? { 'aria-labelledby': labelledBy } : { role: 'none' })}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-DropdownMenuGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n },\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <DropdownMenuPrimitive.RadioGroup\n {...(isLevelVisible ? { 'aria-labelledby': labelledBy } : { role: 'none' })}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuRadioGroup', 'kui-DropdownMenuRadioGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n});\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuRadioItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuRadioItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickDotIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuCheckboxItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuCheckboxItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {\n /**\n * Label displayed in the back button when using drill-down mode.\n * If not provided, defaults to \"Back\".\n */\n label?: React.ReactNode;\n}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = ({\n label = 'Back',\n open,\n defaultOpen,\n onOpenChange,\n children,\n}) => {\n const drillDownStore = useDrillDownStore();\n const id = React.useId();\n const subContextValue = React.useMemo(() => ({ id, label }), [id, label]);\n const isOpenInDrillDown = usePanelPosition(drillDownStore, id) !== 'closed';\n\n const handleOpenChange = useCallbackRef(onOpenChange);\n const isControlled = open !== undefined;\n\n // Drill-down, controlled: navigating asks `onOpenChange` and leaves the stack to `open`.\n React.useLayoutEffect(() => {\n if (!drillDownStore || !isControlled) return;\n drillDownStore.setController(id, handleOpenChange);\n return () => drillDownStore.setController(id, null);\n }, [drillDownStore, isControlled, id, handleOpenChange]);\n\n React.useLayoutEffect(() => {\n if (!drillDownStore || open === undefined) return;\n if (open && !drillDownStore.isOpen(id)) drillDownStore.open(id, drillDownStore.takePendingModality(id));\n else if (!open && drillDownStore.isOpen(id)) drillDownStore.close(id, drillDownStore.takePendingModality(id));\n }, [drillDownStore, open, id]);\n\n // A `defaultOpen` push on mount is the starting state, not a change to report.\n const defaultOpenRef = React.useRef(open === undefined && Boolean(defaultOpen));\n React.useLayoutEffect(() => {\n if (drillDownStore && defaultOpenRef.current) drillDownStore.open(id);\n else defaultOpenRef.current = false;\n // Only on mount, like an uncontrolled default.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Uncontrolled, the stack drives `onOpenChange`. Controlled, it reports only a close\n // the `open` prop did not ask for, such as a parent level closing.\n const wasOpenRef = React.useRef(isOpenInDrillDown);\n React.useEffect(() => {\n if (!drillDownStore || wasOpenRef.current === isOpenInDrillDown) return;\n wasOpenRef.current = isOpenInDrillDown;\n if (isOpenInDrillDown && defaultOpenRef.current) {\n defaultOpenRef.current = false;\n return;\n }\n if (open !== undefined && open === isOpenInDrillDown) return;\n handleOpenChange(isOpenInDrillDown);\n }, [drillDownStore, isOpenInDrillDown, handleOpenChange, open]);\n\n // Radix Sub stays mounted in both behaviors so switching behavior does not\n // remount the subtree. It only renders context; in drill-down its trigger\n // and content are never rendered, so it reports no open changes of its own.\n return (\n <SubContext.Provider value={subContextValue}>\n <DropdownMenuPrimitive.Sub\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={drillDownStore ? undefined : onOpenChange}\n >\n {children}\n </DropdownMenuPrimitive.Sub>\n </SubContext.Provider>\n );\n};\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, onKeyDown, ...subTriggerProps } = props;\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n\n if (drillDownStore && subContext) {\n if (!isLevelVisible) return null;\n\n const handleSelect = (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore.push(subContext.id);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || subTriggerProps.disabled) return;\n if (event.key === FORWARD_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.push(subContext.id, 'keyboard');\n }\n };\n\n return (\n // The row navigates within the same menu, so it announces no popup.\n <DropdownMenuPrimitive.Item\n {...subTriggerProps}\n data-drill-down-trigger={subContext.id}\n data-drill-down-name={subTriggerProps.textValue}\n onSelect={handleSelect}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n 'kui-DropdownMenuDrillDownSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n onKeyDown={onKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => {\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-DropdownMenuSeparator', className)}\n />\n );\n});\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\n/** The row at the top of a drill-down panel that returns to the parent level. */\nfunction DrillDownBackItem({ label, name }: { label: React.ReactNode; name: string }) {\n const drillDownStore = useDrillDownStore();\n\n const handleSelect = React.useCallback(\n (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore?.pop();\n },\n [drillDownStore],\n );\n\n // The visible label is often the submenu title, so the accessible name says\n // what the row does while still containing the visible text.\n const labelText = typeof label === 'string' ? label : name;\n const ariaLabel = labelText && labelText !== 'Back' ? `Back from ${labelText}` : undefined;\n\n return (\n <DropdownMenuPrimitive.Item\n aria-label={ariaLabel}\n textValue={labelText || 'Back'}\n onSelect={handleSelect}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuDrillDownBackItem',\n )}\n >\n <ThickChevronLeftIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuDrillDownBackIcon\" />\n <span className=\"kui-DropdownMenuDrillDownBackLabel\">{label}</span>\n </DropdownMenuPrimitive.Item>\n );\n}\n\n/** Radix positioning and layer props that have no meaning for an inline drill-down panel. */\ntype PopperOnlyProps =\n | 'loop'\n | 'onEscapeKeyDown'\n | 'onPointerDownOutside'\n | 'onFocusOutside'\n | 'onInteractOutside'\n | 'sideOffset'\n | 'alignOffset'\n | 'avoidCollisions'\n | 'collisionBoundary'\n | 'collisionPadding'\n | 'arrowPadding'\n | 'sticky'\n | 'hideWhenDetached'\n | 'updatePositionStrategy';\n\nfunction omitPopperProps<T extends Record<string, unknown>>(props: T): Omit<T, PopperOnlyProps> {\n const {\n loop: _loop,\n onEscapeKeyDown: _onEscapeKeyDown,\n onPointerDownOutside: _onPointerDownOutside,\n onFocusOutside: _onFocusOutside,\n onInteractOutside: _onInteractOutside,\n sideOffset: _sideOffset,\n alignOffset: _alignOffset,\n avoidCollisions: _avoidCollisions,\n collisionBoundary: _collisionBoundary,\n collisionPadding: _collisionPadding,\n arrowPadding: _arrowPadding,\n sticky: _sticky,\n hideWhenDetached: _hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n ...rest\n } = props;\n return rest;\n}\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * When true, skips the ScrollArea wrapper so a VirtualMenu can handle its own\n * scrolling. Applies to cascade submenus; a drill-down panel scrolls with the\n * root content.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n\n if (drillDownStore && subContext) {\n return (\n <DrillDownPanel {...props} ref={forwardedRef} store={drillDownStore} sub={subContext} />\n );\n }\n return <CascadeSubContent {...props} ref={forwardedRef} />;\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\nconst CascadeSubContent = React.forwardRef<DropdownMenuSubContentElement, DropdownMenuSubContentProps>(\n (props, forwardedRef) => {\n const parent = React.useContext(DropdownMenuContentContext);\n\n // A submenu inherits the parent surface, and its own props win.\n const size = props.size ?? parent.size;\n const color = props.color ?? parent.color;\n\n const {\n className,\n children,\n container,\n forceMount,\n color: _color,\n virtualized = false,\n ...subContentProps\n } = extractProps({ ...props, size }, dropdownMenuSubContentPropDefs);\n\n const scalarSize = useResolvedResponsiveValue(size, dropdownMenuSubContentPropDefs.size.default);\n\n const contextValue = React.useMemo(\n () => ({ size, color }),\n [size, color],\n );\n\n const body = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>{children}</DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={getMenuAlignOffset(scalarSize)}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-BaseMenuSubContent',\n 'kui-DropdownMenuContent',\n 'kui-DropdownMenuSubContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {body}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>{body}</div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.SubContent>\n </PortalTheme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nCascadeSubContent.displayName = 'DropdownMenu.CascadeSubContent';\n\ninterface DrillDownPanelProps extends DropdownMenuSubContentProps {\n store: NonNullable<ReturnType<typeof useDrillDownStore>>;\n sub: NonNullable<ReturnType<typeof useSubContext>>;\n}\n\n/**\n * A submenu rendered inline in drill-down mode. It mounts its children only\n * while it is on the navigation stack, and shows its own items only while it\n * is the top level; deeper panels inside it stay mounted.\n */\nconst DrillDownPanel = React.forwardRef<DropdownMenuSubContentElement, DrillDownPanelProps>(\n ({ store, sub, ...props }, forwardedRef) => {\n const position = usePanelPosition(store, sub.id);\n const entry = useStackEntry(store, sub.id);\n\n if (position === 'closed') return null;\n\n const {\n className,\n children,\n container: _container,\n forceMount: _forceMount,\n virtualized: _virtualized,\n size: _size,\n color: _color,\n ...panelProps\n } = omitPopperProps(props);\n\n const isTop = position === 'top';\n const name = entry?.name || (typeof sub.label === 'string' ? sub.label : '');\n\n return (\n <div\n role=\"group\"\n aria-label={name || undefined}\n {...panelProps}\n ref={forwardedRef}\n data-drill-down-panel={sub.id}\n data-drill-down-active={isTop ? true : undefined}\n className={classNames('kui-DropdownMenuDrillDownPanel', className)}\n >\n {isTop && (\n <>\n <DrillDownBackItem label={sub.label} name={name} />\n <DropdownMenuPrimitive.Separator className=\"kui-BaseMenuSeparator kui-DropdownMenuSeparator\" />\n </>\n )}\n <MenuGroupLabelProvider value={null}>\n <DrillDownLevelContext.Provider value={isTop}>{children}</DrillDownLevelContext.Provider>\n </MenuGroupLabelProvider>\n </div>\n );\n },\n);\nDrillDownPanel.displayName = 'DropdownMenu.DrillDownPanel';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>(({ className, ...props }, forwardedRef) => (\n <ChevronDownIcon\n {...props}\n ref={forwardedRef}\n className={classNames('kui-DropdownMenuTriggerIcon', className)}\n />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n SubmenuBehavior,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { scrollableOverflow, useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const scrollable = overflow.x > 0 || overflow.y > 0;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * How far content runs past the element on each axis, in px. An axis whose overflow is hidden\n * cannot be scrolled (a ScrollArea with `scrollbars=\"vertical\"` hides the inline axis), so it\n * counts as 0, however wide the content.\n */\nexport function scrollableOverflow(element: HTMLElement) {\n const style = getComputedStyle(element);\n return {\n x: style.overflowX === 'hidden' ? 0 : Math.max(0, element.scrollWidth - element.clientWidth),\n y: style.overflowY === 'hidden' ? 0 : Math.max(0, element.scrollHeight - element.clientHeight),\n };\n}\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, overflow.y - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, overflow.x - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { colorPropDef } from '../../props/color.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\nconst submenuBehaviors = ['cascade', 'drill-down'] as const;\n\n// Base props shared between Content and SubContent\nconst baseMenuSharedPropDefs = {\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n ...colorPropDef,\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\n// Content-specific props (includes submenuBehavior)\nconst baseMenuContentPropDefs = {\n ...baseMenuSharedPropDefs,\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior: {\n type: 'enum',\n values: submenuBehaviors,\n default: 'cascade',\n responsive: true,\n },\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n submenuBehavior: PropDef<(typeof submenuBehaviors)[number]>;\n};\n\n// SubContent props (no submenuBehavior)\nconst baseMenuSubContentPropDefs = baseMenuSharedPropDefs;\n\nconst baseMenuItemPropDefs = {\n ...asChildPropDef,\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuCheckboxItemPropDefs = {\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuRadioItemPropDefs = {\n ...colorPropDef,\n};\n\nexport {\n baseMenuContentPropDefs,\n baseMenuSubContentPropDefs,\n baseMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs,\n submenuBehaviors,\n};\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slot } from 'radix-ui';\n\nimport { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';\nimport { ThemeSizeContext } from '../hooks/theme-size.js';\nimport { usePropSyncedState } from '../hooks/use-prop-synced-state.js';\nimport { themePropDefs } from './theme.props.js';\n\nimport type { ThemeOwnProps } from './theme.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\nconst noop = () => {};\n\ntype ThemeAppearance = (typeof themePropDefs.appearance.values)[number];\ntype ThemeAccentColor = (typeof themePropDefs.accentColor.values)[number];\ntype ThemeGrayColor = (typeof themePropDefs.grayColor.values)[number];\ntype ThemeRadius = (typeof themePropDefs.radius.values)[number];\ntype ThemeFontFamily = (typeof themePropDefs.fontFamily.values)[number];\ntype ThemeSize = (typeof themePropDefs.size.values)[number];\n// Headings follow the body font until something sets this, so `undefined` is a\n// meaningful value here rather than a missing one.\ntype ThemeHeadingFontFamily = ThemeFontFamily | undefined;\n\ninterface ThemeChangeHandlers {\n onAppearanceChange: (appearance: ThemeAppearance) => void;\n onAccentColorChange: (accentColor: ThemeAccentColor) => void;\n onGrayColorChange: (grayColor: ThemeGrayColor) => void;\n onRadiusChange: (radius: ThemeRadius) => void;\n onFontFamilyChange: (fontFamily: ThemeFontFamily) => void;\n onHeadingFontFamilyChange: (headingFontFamily: ThemeHeadingFontFamily) => void;\n onSizeChange: (size: ThemeSize) => void;\n}\n\ninterface ThemeContextValue extends ThemeChangeHandlers {\n appearance: ThemeAppearance;\n accentColor: ThemeAccentColor;\n grayColor: ThemeGrayColor;\n resolvedGrayColor: ThemeGrayColor;\n radius: ThemeRadius;\n fontFamily: ThemeFontFamily;\n headingFontFamily: ThemeHeadingFontFamily;\n size: ThemeSize;\n}\n// Default theme values used when components render outside a Theme provider\nconst defaultThemeContext: ThemeContextValue = {\n appearance: themePropDefs.appearance.default,\n accentColor: themePropDefs.accentColor.default,\n grayColor: themePropDefs.grayColor.default,\n resolvedGrayColor: themePropDefs.grayColor.default,\n radius: themePropDefs.radius.default,\n fontFamily: themePropDefs.fontFamily.default,\n headingFontFamily: undefined,\n size: themePropDefs.size.default,\n onAppearanceChange: noop,\n onAccentColorChange: noop,\n onGrayColorChange: noop,\n onRadiusChange: noop,\n onFontFamilyChange: noop,\n onHeadingFontFamilyChange: noop,\n onSizeChange: noop,\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | undefined>(undefined);\n\nfunction useThemeContext() {\n const context = React.useContext(ThemeContext);\n // Return default context if used outside Theme provider (e.g., during SSR)\n return context ?? defaultThemeContext;\n}\n\ninterface ThemeProps extends ThemeImplPublicProps {}\nconst Theme = React.forwardRef<ThemeImplElement, ThemeProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n // Direction is inherited: a Radix DirectionProvider above the Theme (for a right-to-left app)\n // wins, and left-to-right stays the default when there is none.\n const dir = Direction.useDirection();\n const isRoot = context === undefined;\n if (isRoot) {\n return (\n <Direction.Provider dir={dir}>\n <ThemeRoot {...props} ref={forwardedRef} />\n </Direction.Provider>\n );\n }\n return <ThemeImpl {...props} ref={forwardedRef} />;\n});\nTheme.displayName = 'Theme';\n\nconst ThemeRoot = React.forwardRef<ThemeImplElement, ThemeImplPublicProps>((props, forwardedRef) => {\n const {\n appearance: appearanceProp = themePropDefs.appearance.default,\n accentColor: accentColorProp = themePropDefs.accentColor.default,\n grayColor: grayColorProp = themePropDefs.grayColor.default,\n radius: radiusProp = themePropDefs.radius.default,\n fontFamily: fontFamilyProp = themePropDefs.fontFamily.default,\n headingFontFamily: headingFontFamilyProp,\n size: sizeProp = themePropDefs.size.default,\n hasBackground = themePropDefs.hasBackground.default,\n ...rootProps\n } = props;\n\n // Each of these follows its prop but stays independently settable, so\n // the context setters can change the theme at runtime. Syncing during render\n // rather than in an effect matters here: an effect would commit the old\n // theme first and re-render every consumer of the context a second time.\n const [appearance, setAppearance] = usePropSyncedState(appearanceProp);\n const [accentColor, setAccentColor] = usePropSyncedState(accentColorProp);\n const [grayColor, setGrayColor] = usePropSyncedState(grayColorProp);\n const [radius, setRadius] = usePropSyncedState(radiusProp);\n const [fontFamily, setFontFamily] = usePropSyncedState(fontFamilyProp);\n const [headingFontFamily, setHeadingFontFamily] = usePropSyncedState(headingFontFamilyProp);\n const [size, setSize] = usePropSyncedState(sizeProp);\n\n return (\n <ThemeImpl\n {...rootProps}\n ref={forwardedRef}\n isRoot\n hasBackground={hasBackground}\n //\n appearance={appearance}\n accentColor={accentColor}\n grayColor={grayColor}\n radius={radius}\n fontFamily={fontFamily}\n headingFontFamily={headingFontFamily}\n size={size}\n //\n onAppearanceChange={setAppearance}\n onAccentColorChange={setAccentColor}\n onGrayColorChange={setGrayColor}\n onRadiusChange={setRadius}\n onFontFamilyChange={setFontFamily}\n onHeadingFontFamilyChange={setHeadingFontFamily}\n onSizeChange={setSize}\n />\n );\n});\nThemeRoot.displayName = 'ThemeRoot';\n\ntype ThemeImplElement = React.ElementRef<'div'>;\ninterface ThemeImplProps extends ThemeImplPublicProps, ThemeImplPrivateProps {}\ninterface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {}\ninterface ThemeImplPrivateProps extends Partial<ThemeChangeHandlers> {\n isRoot?: boolean;\n}\nconst ThemeImpl = React.forwardRef<ThemeImplElement, ThemeImplProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n const {\n asChild,\n isRoot,\n hasBackground: hasBackgroundProp,\n //\n appearance = props.appearance ?? context?.appearance ?? themePropDefs.appearance.default,\n accentColor = props.accentColor ?? context?.accentColor ?? themePropDefs.accentColor.default,\n grayColor = props.grayColor ?? context?.resolvedGrayColor ?? themePropDefs.grayColor.default,\n radius = props.radius ?? context?.radius ?? themePropDefs.radius.default,\n fontFamily = props.fontFamily ?? context?.fontFamily ?? themePropDefs.fontFamily.default,\n headingFontFamily = props.headingFontFamily ?? context?.headingFontFamily,\n size = props.size ?? context?.size ?? themePropDefs.size.default,\n // A nested Theme forwards changes to the one above it, so a switcher\n // inside a portal (Dialog, Popover, menus) still reaches the root.\n onAppearanceChange = context?.onAppearanceChange ?? noop,\n onAccentColorChange = context?.onAccentColorChange ?? noop,\n onGrayColorChange = context?.onGrayColorChange ?? noop,\n onRadiusChange = context?.onRadiusChange ?? noop,\n onFontFamilyChange = context?.onFontFamilyChange ?? noop,\n onHeadingFontFamilyChange = context?.onHeadingFontFamilyChange ?? noop,\n onSizeChange = context?.onSizeChange ?? noop,\n //\n ...themeProps\n } = props;\n const Comp = asChild ? Slot.Root : 'div';\n const resolvedGrayColor = grayColor === 'auto' ? getMatchingGrayColor(accentColor) : grayColor;\n const isExplicitAppearance = props.appearance === 'light' || props.appearance === 'dark';\n const hasBackground = hasBackgroundProp === undefined ? isRoot || isExplicitAppearance : hasBackgroundProp;\n\n return (\n <ThemeContext.Provider\n value={React.useMemo(\n () => ({\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n }),\n [\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n ],\n )}\n >\n {/* Size travels on its own context as a bare string, so the components\n that read it do not re-render when another theme value changes. */}\n <ThemeSizeContext.Provider value={size}>\n <Comp\n data-is-root-theme={isRoot ? 'true' : 'false'}\n data-accent-color={accentColor}\n data-gray-color={resolvedGrayColor}\n // for nested `Theme` background\n data-has-background={hasBackground ? 'true' : 'false'}\n data-radius={radius}\n data-font-family={fontFamily}\n data-heading-font-family={headingFontFamily}\n ref={forwardedRef}\n {...themeProps}\n className={classNames(\n 'kui-theme',\n {\n light: appearance === 'light',\n dark: appearance === 'dark',\n },\n themeProps.className,\n )}\n />\n </ThemeSizeContext.Provider>\n </ThemeContext.Provider>\n );\n});\nThemeImpl.displayName = 'ThemeImpl';\n\nexport { Theme, ThemeContext, useThemeContext };\nexport type { ThemeProps, ThemeContextValue };\n", "import type { accentColors } from '../props/color.prop.js';\n\ntype ThemeAccentColor = (typeof accentColors)[number];\n\nexport function getMatchingGrayColor(accentColor: ThemeAccentColor) {\n switch (accentColor) {\n case 'tomato':\n case 'red':\n case 'ruby':\n case 'crimson':\n case 'pink':\n case 'plum':\n case 'purple':\n case 'violet':\n return 'mauve';\n case 'iris':\n case 'indigo':\n case 'blue':\n case 'sky':\n case 'cyan':\n return 'slate';\n case 'teal':\n case 'jade':\n case 'mint':\n case 'green':\n return 'sage';\n case 'grass':\n case 'lime':\n return 'olive';\n case 'yellow':\n case 'amber':\n case 'orange':\n case 'brown':\n case 'gold':\n case 'bronze':\n return 'sand';\n case 'gray':\n return 'gray';\n }\n}\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n", "import * as React from 'react';\n\n/**\n * State that tracks a prop but can also be set imperatively \u2014 the shape `Theme`\n * needs, where a prop sets the value and the context setters can change it at runtime.\n *\n * Adjusts state during render rather than syncing in a `useEffect`. An effect\n * would commit one render carrying the *old* value and schedule a second one,\n * which for a provider means every consumer renders twice and the browser can\n * paint the stale value in between.\n *\n * @see https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\nexport function usePropSyncedState<T>(propValue: T) {\n const [value, setValue] = React.useState(propValue);\n const [previousPropValue, setPreviousPropValue] = React.useState(propValue);\n\n if (!Object.is(propValue, previousPropValue)) {\n setPreviousPropValue(propValue);\n setValue(propValue);\n }\n\n return [value, setValue] as const;\n}\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColors, grayColors } from '../props/color.prop.js';\nimport { radii } from '../props/radius.prop.js';\n\nimport type { GetPropDefTypes, PropDef } from '../props/prop-def.js';\n\nconst appearances = ['inherit', 'light', 'dark'] as const;\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst themePropDefs = {\n ...asChildPropDef,\n /**\n * Whether to apply background color to the Theme element.\n *\n * Defaults to true for the root Theme and for Theme elements that\n * have an explicit light or dark appearance prop.\n */\n hasBackground: { type: 'boolean', default: true },\n /**\n * Sets the color scheme of the theme, typcially referred to as light and dark mode.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/dark-mode\n */\n appearance: { type: 'enum', values: appearances, default: 'inherit' },\n /**\n * Selects one of the accent color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n accentColor: { type: 'enum', values: accentColors, default: 'gray' },\n /**\n * Selects one of the gray color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n grayColor: { type: 'enum', values: grayColors, default: 'gray' },\n /**\n * Sets the default radius of the components.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/visual-style\n */\n radius: { type: 'enum', values: radii, default: 'full' },\n /**\n * Sets the font family used for body text in the theme.\n *\n * Headings follow this unless `headingFontFamily` (or the `--font-heading`\n * token) says otherwise.\n *\n * @default 'sans'\n */\n fontFamily: { type: 'enum', values: fontFamilies, default: 'sans' },\n /**\n * Sets the font family used for `Heading`, independently of body text.\n *\n * Deliberately has no default: when it is left unset no attribute is\n * emitted and `--font-heading` keeps following `--font-body`, so a\n * `--font-heading` override in your own CSS survives a `fontFamily` switch.\n */\n headingFontFamily: { type: 'enum', values: fontFamilies },\n /**\n * The app-wide size index. Every component on the 1-4 control and surface\n * scale that states no `size` of its own takes this one; an explicit\n * `size` always wins. Nested Themes override it for their subtree.\n *\n * @default '2'\n */\n size: { type: 'enum', values: sizes, default: '2' },\n} satisfies {\n hasBackground: PropDef<boolean>;\n appearance: PropDef<(typeof appearances)[number]>;\n accentColor: PropDef<(typeof accentColors)[number]>;\n grayColor: PropDef<(typeof grayColors)[number]>;\n radius: PropDef<(typeof radii)[number]>;\n fontFamily: PropDef<(typeof fontFamilies)[number]>;\n headingFontFamily: PropDef<(typeof fontFamilies)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\ntype ThemeOwnProps = GetPropDefTypes<typeof themePropDefs & typeof asChildPropDef>;\n\nexport { themePropDefs };\nexport type { ThemeOwnProps };\n", "import * as React from 'react';\n\nimport { Theme } from '../theme.js';\nimport { PaneBandSizeContext } from './pane-band-context.js';\n\n/**\n * The Theme at the root of a portalled surface (Popover, Dialog, Sheet, menus, Tooltip). The\n * surface renders outside any Shell pane even though context flows into it, so a Toolbar in it\n * does not take the pane's band size. A `Theme asChild` an app nests in a pane keeps the band.\n */\nconst PortalTheme = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<typeof Theme>>((props, forwardedRef) => (\n <PaneBandSizeContext.Provider value={null}>\n <Theme {...props} ref={forwardedRef} />\n </PaneBandSizeContext.Provider>\n));\nPortalTheme.displayName = 'PortalTheme';\n\nexport { PortalTheme };\n", "import * as React from 'react';\n\ntype BandSize = '1' | '2' | '3' | '4';\n\n/**\n * Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to\n * null (a scrolling list has no band). `PortalTheme`, the root of every portalled surface\n * (Popover, Dialog, Sheet, menus), sets null too, so a Toolbar in one does not take the Shell's\n * step; a `Theme asChild` an app nests in a pane leaves it alone. `Shell.Root` clears it again.\n * Unset (`undefined`) everywhere else.\n *\n * Its own module so PortalTheme can reset it without bringing the Shell.\n */\nconst PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);\n\nexport { PaneBandSizeContext };\nexport type { BandSize };\n", "import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n});\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\n/** The tick a button shows in place of its icon while `done`. Drawn on the 24 grid at the icon set's stroke. */\nconst TickIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M5 12.75L9.5 17.25L19 7.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n});\nTickIcon.displayName = 'TickIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon, TickIcon };\n", "'use client';\n\nimport * as React from 'react';\n\nimport type { submenuBehaviors } from './base-menu.props.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/*\n * Drill-down navigation for DropdownMenu.\n *\n * The stack of open submenus lives in a small external store rather than in\n * React state, so each part subscribes only to the slice it renders from:\n * a panel re-renders when it enters or leaves the stack, a Sub when its own\n * open state changes, and nothing else on the path re-renders on navigation.\n *\n * Only the levels on the stack mount their children, and only the top level\n * mounts its items (see `DrillDownLevelContext`). That keeps the Radix item\n * collection limited to what is on screen, so roving focus and typeahead\n * never land on a hidden item.\n */\n\ntype Modality = 'keyboard' | 'pointer';\n\ninterface StackEntry {\n id: string;\n /** Accessible name of the submenu, taken from its trigger text */\n name: string;\n /** Scroll position of the parent level when this entry was pushed */\n scrollTop: number;\n}\n\ntype LastChange =\n | { type: 'push'; id: string; modality: Modality | null }\n | { type: 'pop'; id: string; modality: Modality | null; scrollTop: number }\n | { type: 'reset' };\n\ninterface DrillDownState {\n stack: StackEntry[];\n lastChange: LastChange | null;\n}\n\nconst INITIAL_STATE: DrillDownState = { stack: [], lastChange: null };\n\nconst PANEL_ITEM_SELECTOR = '[role^=\"menuitem\"]:not([data-disabled])';\nconst BACK_ITEM_CLASS = 'kui-DropdownMenuDrillDownBackItem';\n\nfunction escapeAttributeValue(value: string) {\n return value.replace(/[\"\\\\]/g, '\\\\$&');\n}\n\nclass DrillDownStore {\n private state = INITIAL_STATE;\n private listeners = new Set<() => void>();\n private modality: Modality = 'keyboard';\n /**\n * Controlled submenus. A request to open or close one of them goes to its\n * `onOpenChange` instead of the stack; its `open` prop then moves the stack.\n */\n private controllers = new Map<string, (open: boolean) => void>();\n private pendingModality = new Map<string, Modality | null>();\n /** The drill-down root element, set by the provider */\n rootElement: HTMLElement | null = null;\n\n setRootElement = (element: HTMLElement | null) => {\n this.rootElement = element;\n };\n\n getState = () => this.state;\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n private setState(next: DrillDownState) {\n this.state = next;\n this.listeners.forEach((listener) => listener());\n }\n\n /** Records how the user is interacting, so focus can follow the same model as Radix. */\n setModality = (modality: Modality) => {\n this.modality = modality;\n };\n\n getModality = () => this.modality;\n\n getDepth = () => this.state.stack.length;\n\n isOpen = (id: string) => this.state.stack.some((entry) => entry.id === id);\n\n setController = (id: string, onOpenChange: ((open: boolean) => void) | null) => {\n if (onOpenChange) this.controllers.set(id, onOpenChange);\n else this.controllers.delete(id);\n };\n\n /** The modality of the last open or close request for a controlled submenu. */\n takePendingModality = (id: string) => {\n const modality = this.pendingModality.get(id) ?? null;\n this.pendingModality.delete(id);\n return modality;\n };\n\n private request(id: string, open: boolean, modality: Modality | null) {\n const controller = this.controllers.get(id);\n if (!controller) return false;\n this.pendingModality.set(id, modality);\n controller(open);\n return true;\n }\n\n private getScrollContainer() {\n const root = this.rootElement;\n if (!root) return null;\n return (\n root.closest<HTMLElement>('.kui-ScrollAreaViewport') ??\n root.closest<HTMLElement>('.kui-BaseMenuViewport')\n );\n }\n\n private getTrigger(id: string) {\n return this.rootElement?.querySelector<HTMLElement>(\n `[data-drill-down-trigger=\"${escapeAttributeValue(id)}\"]`,\n );\n }\n\n /**\n * Opens a submenu. `modality` decides where focus goes: the first item for\n * keyboard, the menu for pointer, and nowhere for a programmatic open\n * (`null`) unless focus was lost.\n */\n push = (id: string, modality: Modality | null = this.modality) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n if (this.request(id, true, modality)) return;\n this.open(id, modality);\n };\n\n /** Puts a submenu on the stack, bypassing its controller. */\n open = (id: string, modality: Modality | null = null) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n const trigger = this.getTrigger(id);\n const name = (trigger?.dataset.drillDownName ?? trigger?.textContent ?? '').trim();\n const scrollTop = this.getScrollContainer()?.scrollTop ?? 0;\n this.setState({\n stack: [...stack, { id, name, scrollTop }],\n lastChange: { type: 'push', id, modality },\n });\n };\n\n pop = (modality: Modality = this.modality) => {\n const { stack } = this.state;\n const top = stack[stack.length - 1];\n if (!top) return;\n if (this.request(top.id, false, modality)) return;\n this.setState({\n stack: stack.slice(0, -1),\n lastChange: { type: 'pop', id: top.id, modality, scrollTop: top.scrollTop },\n });\n };\n\n /**\n * Closes a submenu and everything opened from it, bypassing its controller.\n * Focus moves to its trigger only for a keyboard close.\n */\n close = (id: string, modality: Modality | null = null) => {\n const { stack } = this.state;\n const index = stack.findIndex((entry) => entry.id === id);\n if (index === -1) return;\n this.setState({\n stack: stack.slice(0, index),\n lastChange: { type: 'pop', id, modality, scrollTop: stack[index].scrollTop },\n });\n };\n\n reset = () => {\n if (this.state.stack.length === 0) return;\n this.setState({ stack: [], lastChange: { type: 'reset' } });\n };\n\n /**\n * Moves focus and scroll after a navigation step has been committed. Runs in\n * a layout effect, so the new level is already in the DOM and nothing paints\n * with focus on `<body>` or at the old scroll position.\n */\n applyLastChange() {\n const change = this.state.lastChange;\n const root = this.rootElement;\n if (!change || !root) return;\n this.state = { ...this.state, lastChange: null };\n\n const content = root.closest<HTMLElement>('[role=\"menu\"]');\n const scroller = this.getScrollContainer();\n const focus = (element: HTMLElement | null | undefined) => element?.focus({ preventScroll: true });\n\n if (change.type === 'push') {\n if (scroller) scroller.scrollTop = 0;\n const panel = root.querySelector<HTMLElement>(\n `[data-drill-down-panel=\"${escapeAttributeValue(change.id)}\"]`,\n );\n if (change.modality === 'keyboard') {\n // Land on the first real option; the back row stays one ArrowUp away.\n const items = panel ? Array.from(panel.querySelectorAll<HTMLElement>(PANEL_ITEM_SELECTOR)) : [];\n focus(items.find((item) => !item.classList.contains(BACK_ITEM_CLASS)) ?? items[0] ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n // Match Radix: pointer users get focus on the menu, not a highlighted item.\n focus(content);\n }\n return;\n }\n\n if (change.type === 'pop') {\n if (scroller) scroller.scrollTop = change.scrollTop;\n const trigger = this.getTrigger(change.id);\n if (change.modality === 'keyboard') {\n focus(trigger ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n focus(content);\n }\n return;\n }\n\n if (scroller) scroller.scrollTop = 0;\n }\n}\n\nconst DrillDownStoreContext = React.createContext<DrillDownStore | null>(null);\n\n/**\n * Whether the items of the current level are on screen. The root level and\n * every panel provide it; menu parts render nothing when it is false.\n */\nconst DrillDownLevelContext = React.createContext(true);\n\nfunction useDrillDownStore() {\n return React.useContext(DrillDownStoreContext);\n}\n\nfunction useCreateDrillDownStore() {\n const [store] = React.useState(() => new DrillDownStore());\n return store;\n}\n\nconst selectDepth = (state: DrillDownState) => state.stack.length;\nconst getServerDepth = () => 0;\n\ninterface DrillDownRootProps {\n store: DrillDownStore;\n behavior: SubmenuBehavior;\n /** Open state of the menu; the stack resets every time the menu opens */\n open: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Provides the drill-down store and renders the root level. The wrapper is\n * the same element in both behaviors, so crossing a breakpoint that switches\n * between cascade and drill-down does not remount the items.\n */\nfunction DrillDownRoot({ store, behavior, open, children }: DrillDownRootProps) {\n const isDrillDown = behavior === 'drill-down';\n const depth = React.useSyncExternalStore(\n store.subscribe,\n () => selectDepth(store.getState()),\n getServerDepth,\n );\n const isRoot = !isDrillDown || depth === 0;\n\n // Cascade mode has no stack. A reset while switching modes keeps the next\n // switch back to drill-down from resuming a stale level.\n React.useLayoutEffect(() => {\n if (!isDrillDown) store.reset();\n }, [isDrillDown, store]);\n\n // Start every opening at the root. Content usually remounts on open anyway;\n // this covers `forceMount`. Resetting on open rather than on close keeps the\n // closing animation on the level the user was looking at.\n const wasOpenRef = React.useRef(open);\n React.useLayoutEffect(() => {\n if (open && !wasOpenRef.current) store.reset();\n wasOpenRef.current = open;\n }, [open, store]);\n\n // Focus and scroll follow each navigation step once it is in the DOM.\n React.useLayoutEffect(() => {\n store.applyLastChange();\n }, [depth, store]);\n\n const rootRef = React.useCallback((element: HTMLDivElement | null) => store.setRootElement(element), [store]);\n const handleKeyDownCapture = React.useCallback(() => store.setModality('keyboard'), [store]);\n const handlePointerDownCapture = React.useCallback(() => store.setModality('pointer'), [store]);\n\n return (\n <DrillDownStoreContext.Provider value={isDrillDown ? store : null}>\n {/* Event capture only records the input modality; it does not handle interaction. */}\n <div\n ref={rootRef}\n className=\"kui-DropdownMenuDrillDownRoot\"\n data-submenu-behavior={behavior}\n data-drill-down-active={isRoot ? undefined : true}\n onKeyDownCapture={isDrillDown ? handleKeyDownCapture : undefined}\n onPointerDownCapture={isDrillDown ? handlePointerDownCapture : undefined}\n >\n <DrillDownLevelContext.Provider value={isRoot}>{children}</DrillDownLevelContext.Provider>\n </div>\n </DrillDownStoreContext.Provider>\n );\n}\n\n/** Where a submenu sits in the stack: not open, open under another level, or on top. */\ntype PanelPosition = 'closed' | 'open' | 'top';\n\nfunction usePanelPosition(store: DrillDownStore | null, id: string): PanelPosition {\n const getSnapshot = React.useCallback((): PanelPosition => {\n if (!store) return 'closed';\n const { stack } = store.getState();\n if (stack.length > 0 && stack[stack.length - 1].id === id) return 'top';\n return stack.some((entry) => entry.id === id) ? 'open' : 'closed';\n }, [store, id]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getClosed);\n}\n\nfunction useStackEntry(store: DrillDownStore | null, id: string): StackEntry | undefined {\n const getSnapshot = React.useCallback(\n () => store?.getState().stack.find((entry) => entry.id === id),\n [store, id],\n );\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getUndefined);\n}\n\nconst noopSubscribe = () => () => {};\nconst getClosed = (): PanelPosition => 'closed';\nconst getUndefined = () => undefined;\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownRoot,\n DrillDownLevelContext,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n};\n\nexport type { SubmenuBehavior, DrillDownStore, PanelPosition, SubContextValue };\n", "'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\n\nimport { useResolvedResponsiveValue } from './base-menu.utils.js';\n\nimport type { Responsive } from '../../props/prop-def.js';\n\n/**\n * Context to detect if a component is rendered inside a menu (DropdownMenu, ContextMenu, etc.)\n * Used by VirtualMenu to adjust its behavior:\n * - Skip role=\"menu\" when inside a parent menu (parent owns the role)\n * - Delegate certain keyboard handling to parent\n * - Use the correct item height based on menu size\n */\n\nexport type MenuSize = '1' | '2' | '3' | '4';\n\ninterface MenuContextValue {\n /** Whether we're inside a menu that owns the menu role */\n isInsideMenu: boolean;\n /** Menu size for the current breakpoint */\n size?: MenuSize;\n /** Item height in px for the current size and theme scaling */\n itemHeight?: number;\n}\n\nconst MenuContext = React.createContext<MenuContextValue>({ isInsideMenu: false });\n\n/** The register function of the menu Group a Label sits in (see useMenuGroupLabelId). */\nconst MenuGroupLabelContext = React.createContext<((id: string | null) => void) | null>(null);\n\ninterface MenuProviderProps {\n children: React.ReactNode;\n /** Menu size passed from parent (DropdownMenu.Content, ContextMenu.Content, etc.) */\n size?: Responsive<MenuSize>;\n}\n\n/**\n * Menu row height in pixels per size: the line height plus --row-inset-N above and below\n * (base-menu.css), never under the 24px target floor.\n */\nexport const menuSizeToItemHeight: Record<MenuSize, number> = {\n '1': 24,\n '2': 30,\n '3': 34,\n '4': 38,\n};\n\nexport function getMenuItemHeight(size: MenuSize): number {\n return menuSizeToItemHeight[size];\n}\n\nexport function MenuProvider({ children, size }: MenuProviderProps) {\n const resolvedSize = useResolvedResponsiveValue<MenuSize | undefined>(size, undefined);\n const itemHeight = resolvedSize ? getMenuItemHeight(resolvedSize) : undefined;\n const value = React.useMemo(\n () => ({ isInsideMenu: true, size: resolvedSize, itemHeight }),\n [resolvedSize, itemHeight],\n );\n // A submenu is its own surface, so its labels never name a group of the parent menu.\n return (\n <MenuContext.Provider value={value}>\n <MenuGroupLabelContext.Provider value={null}>{children}</MenuGroupLabelContext.Provider>\n </MenuContext.Provider>\n );\n}\n\nexport function useMenuContext() {\n return React.useContext(MenuContext);\n}\n\n/**\n * Closes the whole menu from inside it. DropdownMenu.Root and ContextMenu.Root provide it,\n * so a VirtualMenu row can close the menu on select the way a menu item does.\n */\nconst MenuCloseContext = React.createContext<(() => void) | undefined>(undefined);\nexport const MenuCloseProvider = MenuCloseContext.Provider;\n\nexport function useMenuClose() {\n return React.useContext(MenuCloseContext);\n}\n\n/**\n * Names a menu group by its label, the way v2's MenuGroup does. A Group holds the id of\n * the Label inside it and points aria-labelledby at it, so a screen reader announces the\n * section name when focus enters the group.\n */\nexport const MenuGroupLabelProvider = MenuGroupLabelContext.Provider;\n\n/** For a Group: the id its aria-labelledby points to, and the setter a nested Label calls. */\nexport function useMenuGroupLabelledBy(ariaLabelledBy: string | undefined) {\n const [labelId, setLabelId] = React.useState<string | null>(null);\n return [ariaLabelledBy ?? labelId ?? undefined, setLabelId] as const;\n}\n\n/** For a Label: its id, registered with the Group it sits in while the label is rendered. */\nexport function useMenuGroupLabelId(idProp: string | undefined, rendered = true) {\n const register = React.useContext(MenuGroupLabelContext);\n const generatedId = React.useId();\n const id = idProp ?? generatedId;\n useLayoutEffect(() => {\n if (!register || !rendered) return;\n register(id);\n return () => register(null);\n }, [register, id, rendered]);\n return register ? id : idProp;\n}\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Kbd } from '../kbd.js';\nimport { useBreakpoint } from '../../hooks/use-breakpoint.js';\n\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\n\nconst BREAKPOINTS_DESCENDING: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n\n/**\n * Resolves a responsive value for the given breakpoint, falling back through\n * the smaller breakpoints when the current one is not set.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T,\n): T {\n if (value === undefined || value === null) return defaultValue;\n if (typeof value !== 'object') return value;\n\n const map = value as Partial<Record<Breakpoint, T>>;\n for (let i = BREAKPOINTS_DESCENDING.indexOf(currentBreakpoint); i < BREAKPOINTS_DESCENDING.length; i++) {\n const resolved = map[BREAKPOINTS_DESCENDING[i]];\n if (resolved !== undefined) return resolved;\n }\n return defaultValue;\n}\n\n/**\n * Resolves a possibly responsive value against the current viewport. Only a\n * responsive object subscribes to breakpoint changes; a plain value costs\n * nothing.\n */\nfunction useResolvedResponsiveValue<T>(value: Responsive<T> | undefined, defaultValue: T): T {\n const isResponsive = typeof value === 'object' && value !== null;\n const { breakpoint } = useBreakpoint(isResponsive);\n return resolveResponsiveValue(value as T | Partial<Record<Breakpoint, T>> | undefined, breakpoint, defaultValue);\n}\n\n/** Content padding per menu size, in px (see base-menu.css). */\n// The panel padding ladder (--panel-p-N).\nconst CONTENT_PADDING: Record<string, number> = { '1': 8, '2': 12, '3': 16, '4': 24 };\n\n/**\n * Offset that lines the first item of a menu up with its anchor: the pointer\n * for a context menu, or the sub trigger for a submenu. It cancels the content\n * padding.\n */\nfunction getMenuAlignOffset(size: string): number {\n return -(CONTENT_PADDING[size] ?? CONTENT_PADDING['2']);\n}\n\nconst KEY_SYMBOLS: Record<string, string> = {\n '\u2318': 'Meta',\n cmd: 'Meta',\n command: 'Meta',\n meta: 'Meta',\n '\u2325': 'Alt',\n option: 'Alt',\n opt: 'Alt',\n alt: 'Alt',\n '\u21E7': 'Shift',\n shift: 'Shift',\n '\u2303': 'Control',\n ctrl: 'Control',\n control: 'Control',\n '\u232B': 'Backspace',\n '\u2326': 'Delete',\n '\u23CE': 'Enter',\n '\u21B5': 'Enter',\n '\u238B': 'Escape',\n esc: 'Escape',\n '\u21E5': 'Tab',\n '\u2191': 'ArrowUp',\n '\u2193': 'ArrowDown',\n '\u2190': 'ArrowLeft',\n '\u2192': 'ArrowRight',\n};\n\nconst ariaKeyShortcutsCache = new Map<string, string>();\n\n/**\n * Converts a display shortcut such as \"\u2318 \u21E7 P\" or \"Ctrl+S\" into the\n * `aria-keyshortcuts` format (\"Meta+Shift+P\", \"Control+S\").\n */\nfunction toAriaKeyShortcuts(shortcut: string): string | undefined {\n const cached = ariaKeyShortcutsCache.get(shortcut);\n if (cached !== undefined) return cached || undefined;\n\n // Modifier symbols are tokens of their own (\"\u2318\u21E7P\"); otherwise split on \"+\" and spaces.\n const tokens = shortcut.match(/[\u2318\u2325\u21E7\u2303]|[^\\s+\u2318\u2325\u21E7\u2303]+/gu) ?? [];\n const keys = tokens.map((token) => {\n const mapped = KEY_SYMBOLS[token] ?? KEY_SYMBOLS[token.toLowerCase()];\n return mapped ?? (token.length === 1 ? token.toUpperCase() : token);\n });\n const result = keys.join('+');\n ariaKeyShortcutsCache.set(shortcut, result);\n return result || undefined;\n}\n\n/**\n * The keyboard shortcut hint at the end of a menu item. It is hidden from\n * assistive technology because the item exposes it through\n * `aria-keyshortcuts` instead of reading it as part of the item name.\n */\nfunction MenuShortcut({ shortcut, className }: { shortcut: string; className?: string }) {\n return (\n <div aria-hidden className={classNames('kui-BaseMenuShortcut', className)}>\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n );\n}\n\nexport {\n resolveResponsiveValue,\n useResolvedResponsiveValue,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n MenuShortcut,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { kbdPropDefs } from './kbd.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype KbdElement = React.ElementRef<'kbd'>;\ntype KbdOwnProps = GetPropDefTypes<typeof kbdPropDefs>;\ninterface KbdProps extends ComponentPropsWithout<'kbd', RemovedProps>, KbdOwnProps {}\nconst Kbd = React.forwardRef<KbdElement, KbdProps>((props, forwardedRef) => {\n const { asChild, className, ...kbdProps } = extractProps(props, kbdPropDefs);\n const Comp = asChild ? Slot.Root : 'kbd';\n return (\n <Comp\n {...kbdProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-Kbd', className)}\n />\n );\n});\nKbd.displayName = 'Kbd';\n\nexport { Kbd };\nexport type { KbdProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['raised', 'soft'] as const;\n\nconst kbdPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n variant: {\n type: 'enum',\n className: 'kui-variant',\n values: variants,\n default: 'raised',\n },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { kbdPropDefs };\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n", "import * as React from 'react';\n\n/** A function that throws an error when a value isn't a valid React Element, otherwise returns the value */\nexport const requireReactElement = <T extends React.ReactNode>(children: T): T => {\n const isReactElement = React.isValidElement(children);\n\n if (!isReactElement) {\n throw Error(\n `Expected a single React Element child, but got: ${React.Children.toArray(children)\n .map((child) =>\n typeof child === 'object' && 'type' in child && typeof child.type === 'string'\n ? child.type\n : typeof child\n )\n .join(', ')}`\n );\n }\n\n return children;\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { popoverContentPropDefs } from './popover.props.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\n\nimport type { PopoverContentOwnProps } from './popover.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// ---------------------------------------------\n// Popover Content Context\n// ---------------------------------------------\ntype PopoverContentContextValue = {\n /** Wire up aria-labelledby for toolbar title */\n setLabelId: (id: string | undefined) => void;\n};\n\nconst PopoverContentContext = React.createContext<PopoverContentContextValue | null>(null);\nconst usePopoverContentContext = (caller: string) => {\n const ctx = React.useContext(PopoverContentContext);\n if (!ctx) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`${caller} must be used within Popover.Content`);\n }\n }\n return ctx;\n};\n\ninterface PopoverRootProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {}\nconst PopoverRoot: React.FC<PopoverRootProps> = (props: PopoverRootProps) => (\n <PopoverPrimitive.Root {...props} />\n);\nPopoverRoot.displayName = 'Popover.Root';\n\ntype PopoverTriggerElement = React.ElementRef<typeof PopoverPrimitive.Trigger>;\ninterface PopoverTriggerProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Trigger, RemovedProps> {}\nconst PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <PopoverPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </PopoverPrimitive.Trigger>\n ),\n);\nPopoverTrigger.displayName = 'Popover.Trigger';\n\ntype PopoverContentElement = React.ElementRef<typeof PopoverPrimitive.Content>;\ninterface PopoverContentProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Content, RemovedProps>,\n PopoverContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>['container'];\n}\nconst PopoverContent = React.forwardRef<PopoverContentElement, PopoverContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, popoverContentPropDefs.size);\n const {\n className,\n forceMount,\n container,\n ...contentProps\n } = extractProps(props, popoverContentPropDefs);\n\n const [labelId, setLabelId] = React.useState<string | undefined>(undefined);\n const contextValue = React.useMemo(() => ({ setLabelId }), []);\n\n return (\n <PopoverPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={8}\n collisionPadding={10}\n {...contentProps}\n ref={forwardedRef}\n // A Toolbar.Title names the panel; without one, the caller's own value stands.\n aria-labelledby={labelId ?? contentProps['aria-labelledby']}\n className={classNames('kui-PopperContent', 'kui-PopoverContent', className)}\n >\n <PopoverContentContext.Provider value={contextValue}>\n {props.children}\n </PopoverContentContext.Provider>\n </PopoverPrimitive.Content>\n </PortalTheme>\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = 'Popover.Content';\n\ntype PopoverCloseElement = React.ElementRef<typeof PopoverPrimitive.Close>;\ninterface PopoverCloseProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Close, RemovedProps> {}\nconst PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <PopoverPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </PopoverPrimitive.Close>\n ),\n);\nPopoverClose.displayName = 'Popover.Close';\n\ntype PopoverAnchorElement = React.ElementRef<typeof PopoverPrimitive.Anchor>;\ninterface PopoverAnchorProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor> {}\nconst PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props, forwardedRef) => <PopoverPrimitive.Anchor {...props} ref={forwardedRef} />,\n);\n\nPopoverAnchor.displayName = 'Popover.Anchor';\n\n// ---------------------------------------------\n// Toolbar (Popover-only)\n// ---------------------------------------------\n\ntype PopoverToolbarElement = HTMLDivElement;\ntype PopoverToolbarProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst PopoverToolbarBase = React.forwardRef<PopoverToolbarElement, PopoverToolbarProps>(\n ({ className, children, ...props }, forwardedRef) => {\n // The toolbar is sticky in the content's own CSS, so it needs no measuring; this only warns\n // when it is used outside Popover.Content.\n usePopoverContentContext('Popover.Toolbar');\n\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-PopoverToolbar', className)}>\n {children}\n </div>\n );\n },\n);\nPopoverToolbarBase.displayName = 'Popover.Toolbar';\n\ntype PopoverToolbarSectionProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst PopoverToolbarLeft = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarLeft', className)}\n />\n ),\n);\nPopoverToolbarLeft.displayName = 'Popover.Toolbar.Left';\n\nconst PopoverToolbarCenter = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarCenter', className)}\n />\n ),\n);\nPopoverToolbarCenter.displayName = 'Popover.Toolbar.Center';\n\nconst PopoverToolbarRight = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarRight', className)}\n />\n ),\n);\nPopoverToolbarRight.displayName = 'Popover.Toolbar.Right';\n\ntype PopoverToolbarTitleProps = React.ComponentPropsWithoutRef<'span'>;\nconst PopoverToolbarTitle = React.forwardRef<HTMLSpanElement, PopoverToolbarTitleProps>(\n ({ className, id: idProp, ...props }, ref) => {\n const ctx = usePopoverContentContext('Popover.Toolbar.Title');\n const reactId = React.useId();\n const id = idProp ?? `kui-popover-toolbar-title-${reactId}`;\n React.useEffect(() => {\n ctx?.setLabelId(id);\n return () => ctx?.setLabelId(undefined);\n }, [ctx, id]);\n return (\n <span\n {...props}\n id={id}\n ref={ref}\n className={classNames('kui-PopoverToolbarTitle', className)}\n />\n );\n },\n);\nPopoverToolbarTitle.displayName = 'Popover.Toolbar.Title';\n\ntype PopoverToolbarComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<PopoverToolbarProps> & React.RefAttributes<HTMLDivElement>\n> & {\n Left: typeof PopoverToolbarLeft;\n Center: typeof PopoverToolbarCenter;\n Right: typeof PopoverToolbarRight;\n Title: typeof PopoverToolbarTitle;\n};\n\nconst PopoverToolbar = Object.assign(PopoverToolbarBase, {\n Left: PopoverToolbarLeft,\n Center: PopoverToolbarCenter,\n Right: PopoverToolbarRight,\n Title: PopoverToolbarTitle,\n}) as PopoverToolbarComponent;\n\nexport {\n PopoverRoot as Root,\n PopoverContent as Content,\n PopoverTrigger as Trigger,\n PopoverClose as Close,\n PopoverAnchor as Anchor,\n PopoverToolbar as Toolbar,\n};\nexport type {\n PopoverRootProps as RootProps,\n PopoverContentProps as ContentProps,\n PopoverTriggerProps as TriggerProps,\n PopoverCloseProps as CloseProps,\n PopoverAnchorProps as AnchorProps,\n PopoverToolbarProps as ToolbarProps,\n PopoverToolbarSectionProps as ToolbarSectionProps,\n PopoverToolbarTitleProps as ToolbarTitleProps,\n};\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { heightPropDefs } from '../props/height.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\n\nconst popoverContentPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '480px' },\n ...heightPropDefs,\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\ntype PopoverContentOwnProps = GetPropDefTypes<\n typeof popoverContentPropDefs &\n typeof asChildPropDef &\n typeof widthPropDefs &\n typeof heightPropDefs\n>;\n\nexport { popoverContentPropDefs };\nexport type { PopoverContentOwnProps };\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { separatorPropDefs } from './separator.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport { SHELL_BREAKPOINTS } from './shell.types.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SeparatorElement = React.ElementRef<'span'>;\ntype SeparatorOwnProps = GetPropDefTypes<typeof separatorPropDefs>;\ninterface SeparatorProps extends ComponentPropsWithout<'span', RemovedProps>, SeparatorOwnProps {}\ntype Orientation = 'horizontal' | 'vertical';\n\nconst Separator = React.forwardRef<SeparatorElement, SeparatorProps>((props, forwardedRef) => {\n const { className, color, decorative, ...separatorProps } = extractProps(props, separatorPropDefs);\n const responsive = typeof props.orientation === 'object' && props.orientation !== null;\n const { breakpoint } = useBreakpoint(responsive);\n\n // A responsive orientation announces the one drawn at the current breakpoint.\n let orientation: Orientation = 'horizontal';\n if (responsive) {\n const values = props.orientation as Partial<Record<string, Orientation>>;\n for (const bp of SHELL_BREAKPOINTS) {\n if (values[bp] !== undefined) orientation = values[bp]!;\n if (bp === breakpoint) break;\n }\n } else if (props.orientation === 'vertical') {\n orientation = 'vertical';\n }\n\n return (\n <span\n data-accent-color={color}\n role={decorative ? undefined : 'separator'}\n aria-orientation={decorative ? undefined : orientation}\n {...separatorProps}\n ref={forwardedRef}\n className={classNames('kui-Separator', className)}\n />\n );\n});\nSeparator.displayName = 'Separator';\n\nexport { Separator };\nexport type { SeparatorProps };\n", "import { colorPropDef } from '../props/color.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst orientationValues = ['horizontal', 'vertical'] as const;\n\nconst separatorPropDefs = {\n orientation: {\n type: 'enum',\n className: 'kui-r-orientation',\n values: orientationValues,\n default: 'horizontal',\n responsive: true,\n },\n color: { ...colorPropDef.color, default: 'gray' },\n decorative: { type: 'boolean', default: false },\n light: { type: 'boolean', className: 'kui-light', default: false },\n} satisfies {\n orientation: PropDef<(typeof orientationValues)[number]>;\n color: typeof colorPropDef.color;\n decorative: PropDef<boolean>;\n light: PropDef<boolean>;\n};\n\nexport { separatorPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { chipPropDefs } from './chip.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { Tooltip } from './tooltip.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ChipElement = React.ElementRef<'span'>;\ntype ChipOwnProps = GetPropDefTypes<typeof chipPropDefs>;\n\n// Tooltip props that can be passed to Chip\ninterface ChipTooltipProps {\n tooltip?: React.ReactNode;\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n tooltipAlign?: 'start' | 'center' | 'end';\n tooltipDelayDuration?: number;\n tooltipDisableHoverableContent?: boolean;\n}\n\ninterface ChipProps\n extends ComponentPropsWithout<'span', RemovedProps>,\n ChipOwnProps,\n ChipTooltipProps {}\n\nconst Chip = React.forwardRef<ChipElement, ChipProps>((props, forwardedRef) => {\n const {\n asChild,\n className,\n children,\n color,\n radius,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n ...chipProps\n } = extractProps(props, chipPropDefs);\n\n const Comp = asChild ? Slot.Root : 'span';\n\n const chip = (\n <Comp\n data-accent-color={color}\n data-radius={radius}\n // A tooltip opens on focus, so a chip that has one joins the tab order.\n tabIndex={tooltip ? 0 : undefined}\n {...chipProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-Chip', className)}\n >\n {children}\n </Comp>\n );\n\n // If no tooltip is provided, return the chip as-is\n if (!tooltip) {\n return chip;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n return (\n <Tooltip\n content={tooltip}\n side={tooltipSide}\n align={tooltipAlign}\n delayDuration={tooltipDelayDuration}\n disableHoverableContent={tooltipDisableHoverableContent}\n >\n {chip}\n </Tooltip>\n );\n});\nChip.displayName = 'Chip';\n\nexport { Chip };\nexport type { ChipProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { grayAccentColorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;\n\nconst chipPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n ...grayAccentColorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { chipPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { Text } from './text.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { tooltipPropDefs } from './tooltip.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/** The rest before a tooltip opens, in milliseconds. */\nconst TOOLTIP_DELAY = 200;\n\n/** True inside a `TooltipProvider`, so a Tooltip knows it need not bring its own. */\nconst TooltipProviderContext = React.createContext(false);\n\ninterface TooltipProviderProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider> {}\n\n/**\n * Groups the tooltips inside it: the first one waits `delayDuration` (200ms), and the next ones\n * open at once while the pointer moves between them. Put it once near the root of the app.\n * A Tooltip outside one still works, with the same delay, but each one waits on its own.\n */\nfunction TooltipProvider({ delayDuration = TOOLTIP_DELAY, children, ...props }: TooltipProviderProps) {\n return (\n <TooltipProviderContext.Provider value={true}>\n <TooltipPrimitive.Provider delayDuration={delayDuration} {...props}>\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n );\n}\nTooltipProvider.displayName = 'TooltipProvider';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs>;\ninterface TooltipProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>,\n ComponentPropsWithout<typeof TooltipPrimitive.Content, RemovedProps | 'content'>,\n TooltipOwnProps {\n content: React.ReactNode;\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'];\n}\nconst Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const {\n children,\n className,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n content,\n container,\n forceMount,\n ...tooltipContentProps\n } = extractProps(props, tooltipPropDefs);\n const rootProps = { open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent };\n const hasProvider = React.useContext(TooltipProviderContext);\n const tooltip = (\n <TooltipPrimitive.Root {...rootProps}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...tooltipContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-TooltipContent', className)}\n >\n <Text as=\"p\" className=\"kui-TooltipText\" size=\"1\">\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"kui-TooltipArrow\" />\n </TooltipPrimitive.Content>\n </PortalTheme>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n // Radix needs a provider above every tooltip. Outside a TooltipProvider, bring one.\n return hasProvider ? tooltip : <TooltipPrimitive.Provider delayDuration={TOOLTIP_DELAY}>{tooltip}</TooltipPrimitive.Provider>;\n});\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip, TooltipProvider };\nexport type { TooltipProps, TooltipProviderProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n", "import { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst tooltipPropDefs = {\n content: { type: 'ReactNode', required: true },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '360px' },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n content: PropDef<React.ReactNode>;\n};\n\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs & typeof widthPropDefs>;\n\nexport { tooltipPropDefs };\nexport type { TooltipOwnProps };\n", "'use client';\n\n/**\n * A pane's own chrome: a header row, a scrolling region and a footer row.\n *\n * Shell.Sidebar and Shell.Panel render these as `Shell.PaneHeader`, `Shell.Scroll` and\n * `Shell.PaneFooter`. The pane renders anything; with these parts it is the presentation, so\n * Sidebar's menu parts work inside it with no `Sidebar.Root`. The index comes from the nearest\n * Shell (`Shell.Root size`), or from a deprecated `Sidebar.Root` that still wraps them.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { ScrollArea } from '../scroll-area.js';\nimport { ShellStoreContext } from './shell-store.js';\nimport { PaneBandSizeContext, type BandSize } from './pane-band-context.js';\nimport { usePageScrollMedia } from './shell-page-scroll.js';\n\ntype PaneSize = '1' | '2' | '3';\n\ntype SidebarVisualContextValue = {\n size: PaneSize;\n menuVariant: 'solid' | 'soft';\n presentation?: 'thin' | 'expanded';\n color?: string;\n};\n\n/** Size, menu highlight and presentation for the Sidebar parts. Internal: not exported. */\nconst SidebarVisualContext = React.createContext<SidebarVisualContextValue | null>(null);\n\nfunction useSidebarVisual() {\n return React.useContext(SidebarVisualContext);\n}\n\n/** The Shell's index. `Shell.Root size` sets it; panes hand it to their chrome. */\nconst ShellSizeContext = React.createContext<PaneSize>('2');\n\n/**\n * True inside `Shell.Content`. `Shell.Root` sets it back to false, so a Shell nested in the\n * content gets pane chrome in its own panes. Read by `Shell.Scroll`: in the content it holds a\n * page, not a menu, so it takes none of the menu's padding, gap or layering.\n */\nconst ShellContentContext = React.createContext(false);\n\n/**\n * True inside a window Shell: one with no `contained` and no `height`, which lets the page scroll\n * on a narrow touch screen. Each `Shell.Root` sets its own, so a Shell nested in another answers\n * for itself.\n */\nconst ShellWindowContext = React.createContext(false);\n\n/**\n * Gives a Shell pane's children the Shell's index, so Sidebar parts size themselves. In a Rail\n * the rows are `thin`: icon tiles with a small label, sub-menus as dropdowns.\n */\nfunction PaneChromeScope({ children, presentation }: { children: React.ReactNode; presentation?: 'thin' }) {\n const size = React.useContext(ShellSizeContext);\n const value = React.useMemo<SidebarVisualContextValue>(() => ({ size, menuVariant: 'soft', presentation }), [size, presentation]);\n return <SidebarVisualContext.Provider value={value}>{children}</SidebarVisualContext.Provider>;\n}\n\nfunction useChromeClasses() {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const size = visual?.size ?? shellSize;\n const menuVariant = visual?.menuVariant ?? 'soft';\n return ['kui-ShellPaneChrome', `kui-r-size-${size}`, `kui-menu-variant-${menuVariant}`];\n}\n\n/**\n * The index a Toolbar in a pane's header or footer rests at when it states none: one step above\n * the Shell's, so the band reads as chrome over the rows (v2 BAND_STEP). 4 has no step above.\n */\nconst BAND_STEP = { '1': '2', '2': '3', '3': '4', '4': '4' } as const satisfies Record<BandSize, BandSize>;\n\nfunction useBandSize(): BandSize {\n const visual = useSidebarVisual();\n const shellSize = React.useContext(ShellSizeContext);\n return BAND_STEP[visual?.size ?? shellSize];\n}\n\n/**\n * The size a Toolbar with no `size` of its own rests at, or null for none.\n *\n * In a pane's header or footer it is that band's size. Anywhere else inside a Shell, such as\n * `Shell.Content` or a pane's body, it is the same step: one above the Shell's index, so a\n * toolbar in the content area matches the ones in the pane headers beside it (v2 sizes every\n * toolbar this way). A pane's scrolling list, and anything outside a Shell, has none.\n */\nfunction usePaneBandSize(): BandSize | null {\n const band = React.useContext(PaneBandSizeContext);\n const inShell = React.useContext(ShellStoreContext) !== null;\n const step = useBandSize();\n if (band !== undefined) return band;\n return inShell ? step : null;\n}\n\ninterface PaneHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Floats the row over the top of `Shell.Scroll`, so the list scrolls behind it. The list\n * starts below the row, and `Shell.Scroll fade` fades it out under the row. The row paints\n * nothing and lets clicks through between its controls; a `Toolbar backdrop` in it keeps\n * the controls readable.\n */\n float?: boolean;\n}\n\n/** A pane's header row, pinned above its scrolling region. */\nconst PaneHeader = React.forwardRef<HTMLDivElement, PaneHeaderProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneHeader', 'kui-SidebarHeader', 'kui-SidebarHeader--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneHeader.displayName = 'Shell.PaneHeader';\n\ninterface PaneFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Floats the row over the bottom of `Shell.Scroll`, the way `Shell.PaneHeader float` does at the top. */\n float?: boolean;\n}\n\n/** A pane's footer row, pinned below its scrolling region. */\nconst PaneFooter = React.forwardRef<HTMLDivElement, PaneFooterProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneFooter', 'kui-SidebarFooter', 'kui-SidebarFooter--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneFooter.displayName = 'Shell.PaneFooter';\n\ninterface ScrollProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Fades the list out toward an edge with more past it, and under a floating header or footer. */\n fade?: boolean;\n /**\n * Keeps the pane's list (its menu rows) when React puts this under `Shell.Content`, as when an\n * app renders a pane's content in its page and portals it into `Shell.Panel`. In a Rail, Panel\n * or Sidebar it is already the pane's list.\n */\n pane?: boolean;\n}\n\n/**\n * The one region of a pane that scrolls; it takes the room the header and footer leave.\n * In `Shell.Content` it is the page's scroller, and a `Shell.PaneHeader float` beside it pins\n * the page's toolbar over it. The ref, events and ARIA props land on the element that scrolls;\n * `className`, `style` and `dir` apply to the content inside it. In a Rail, Panel or Sidebar the pane is\n * already a navigation landmark, so it needs no role of its own.\n */\nconst Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, style, dir, children, fade = false, pane = false, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n // A Sidebar.Root inside the content still gets a menu.\n const contentPane = React.useContext(ShellContentContext);\n const visual = useSidebarVisual();\n const inContent = contentPane && visual === null && !pane;\n // While the page scrolls, the content's viewport scrolls nothing: as a tab stop it would take a\n // Tab, ring the whole page and move nothing. Resolved after mount; a `tabIndex` of the caller's wins.\n const windowShell = React.useContext(ShellWindowContext);\n const pageScrolls = usePageScrollMedia();\n if (inContent) {\n const tabIndex = props.tabIndex ?? (windowShell && pageScrolls ? -1 : undefined);\n return (\n <ScrollArea {...props} tabIndex={tabIndex} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-ShellScrollContent', className)}>\n {children}\n </div>\n </ScrollArea>\n );\n }\n return (\n <ScrollArea {...props} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-BaseMenuContent', 'kui-SidebarContent', ...chrome, className)}>\n {/* A header's band does not reach a Toolbar in the scrolling list. */}\n <PaneBandSizeContext.Provider value={null}>\n <div className=\"kui-BaseMenuViewport\">{children}</div>\n </PaneBandSizeContext.Provider>\n </div>\n </ScrollArea>\n );\n});\nScroll.displayName = 'Shell.Scroll';\n\nexport { SidebarVisualContext, useSidebarVisual, ShellSizeContext, ShellContentContext, ShellWindowContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };\nexport type { SidebarVisualContextValue, PaneSize, BandSize, PaneHeaderProps, PaneFooterProps, ScrollProps };\n", "'use client';\n\nimport * as React from 'react';\n\n/**\n * When a window Shell lets the page scroll: a narrow window (below the `sm` breakpoint) under a\n * coarse pointer. The stylesheet decides it (shell.css, the page-scroll block), so first paint is\n * right with no script. This is the script's copy, for the few things only script can do when the\n * answer changes: carry the reading position between the two scrollers, and take the content's\n * unused viewport out of the tab order. A test holds it equal to the stylesheet's.\n */\nexport const PAGE_SCROLL_QUERY = '(max-width: 767.98px) and (pointer: coarse)';\n\nlet list: MediaQueryList | undefined;\nconst media = () => (list ??= window.matchMedia(PAGE_SCROLL_QUERY));\n\nfunction listen(m: MediaQueryList, handler: () => void): () => void {\n // Safari below 14 has only the deprecated listener API.\n if (typeof m.addEventListener === 'function') {\n m.addEventListener('change', handler);\n return () => m.removeEventListener('change', handler);\n }\n m.addListener?.(handler);\n return () => m.removeListener?.(handler);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n return listen(media(), onChange);\n}\n\n/** True where a window Shell lets the page scroll. False on the server and through hydration. */\nexport function usePageScrollMedia(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => media().matches,\n () => false,\n );\n}\n\n/** Whether the page scrolls right now. */\nexport function pageScrollMatches(): boolean {\n return media().matches;\n}\n\n/** Subscribes to the answer changing, outside React. */\nexport function onPageScrollMediaChange(onChange: (matches: boolean) => void): () => void {\n const m = media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,8BAA+B,sBAAuB,cAAc6B,GAAQ,MAAQ,GAAG,GAAIjC,CAAS,EAAG,KAAK,UACxL,gBAAC,OAAI,UAAU,iCACb,gBAAC4E,GAAA,CAAW,UAAU,wBAAwB,EAC9C,gBAAC,SACC,IAAKO,EACL,KAAK,SACL,UAAU,yBACV,MAAOJ,EACP,SAAWU,GAAMT,EAAcS,EAAE,OAAO,KAAK,EAC7C,UAAWhD,EACX,YAAawC,EACb,aAAYO,EACd,EACCT,GACC,gBAAC,UACC,KAAK,SACL,UAAU,mCACV,QAAS,IAAM,CACbC,EAAc,EAAE,EAChBG,EAAS,SAAS,MAAM,CAC1B,EACA,aAAW,gBAEX,gBAACN,GAAA,IAAU,CACb,CAEJ,CACF,CAEJ,CACF,EACAC,GAAc,YAAc",
6
- "names": ["sidebar_exports", "__export", "SidebarGroup", "SidebarGroupContent", "SidebarGroupLabel", "SidebarMenu", "SidebarMenuButton", "SidebarMenuItem", "SidebarMenuSub", "SidebarMenuSubContent", "SidebarMenuSubTrigger", "SidebarSearch", "SidebarSeparator", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "Accordion", "React", "import_classnames", "import_radix_ui", "import_internal", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "radii", "radiusPropDef", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "scrollableOverflow", "element", "style", "useScrollEdges", "enabled", "setElement", "frame", "write", "overflow", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "widthPropDefs", "heightPropDefs", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "overflow", "scrollableOverflow", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree", "accentColors", "grayColors", "colorPropDef", "grayAccentColorPropDef", "accentColors", "contentSizes", "submenuBehaviors", "baseMenuSharedPropDefs", "colorPropDef", "baseMenuContentPropDefs", "baseMenuSubContentPropDefs", "baseMenuItemPropDefs", "asChildPropDef", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "React", "import_classnames", "import_radix_ui", "getMatchingGrayColor", "accentColor", "React", "clampSize", "size", "values", "n", "nearest", "distance", "d", "ThemeSizeContext", "useThemeSizeProps", "props", "propDef", "themeSize", "ThemeSizeContext", "size", "clampSize", "React", "usePropSyncedState", "propValue", "value", "setValue", "previousPropValue", "setPreviousPropValue", "appearances", "fontFamilies", "sizes", "themePropDefs", "asChildPropDef", "accentColors", "grayColors", "radii", "noop", "defaultThemeContext", "themePropDefs", "ThemeContext", "useThemeContext", "Theme", "props", "forwardedRef", "context", "dir", "ThemeRoot", "ThemeImpl", "appearanceProp", "accentColorProp", "grayColorProp", "radiusProp", "fontFamilyProp", "headingFontFamilyProp", "sizeProp", "hasBackground", "rootProps", "appearance", "setAppearance", "usePropSyncedState", "accentColor", "setAccentColor", "grayColor", "setGrayColor", "radius", "setRadius", "fontFamily", "setFontFamily", "headingFontFamily", "setHeadingFontFamily", "size", "setSize", "asChild", "isRoot", "hasBackgroundProp", "onAppearanceChange", "onAccentColorChange", "onGrayColorChange", "onRadiusChange", "onFontFamilyChange", "onHeadingFontFamilyChange", "onSizeChange", "themeProps", "Comp", "resolvedGrayColor", "getMatchingGrayColor", "isExplicitAppearance", "ThemeSizeContext", "classNames", "React", "React", "PaneBandSizeContext", "PortalTheme", "props", "forwardedRef", "PaneBandSizeContext", "Theme", "import_react", "ThickDividerHorizontalIcon", "React", "props", "forwardedRef", "ThickCheckIcon", "ChevronDownIcon", "ThickChevronRightIcon", "ThickChevronLeftIcon", "ThickDotIcon", "CloseIcon", "React", "_props", "_forwardedRef", "PaperclipIcon", "props", "forwardedRef", "FileIcon", "FileTextIcon", "TickIcon", "React", "INITIAL_STATE", "PANEL_ITEM_SELECTOR", "BACK_ITEM_CLASS", "escapeAttributeValue", "value", "DrillDownStore", "__publicField", "element", "listener", "modality", "id", "entry", "onOpenChange", "stack", "trigger", "name", "scrollTop", "top", "index", "next", "open", "controller", "root", "change", "content", "scroller", "focus", "panel", "items", "item", "DrillDownStoreContext", "DrillDownLevelContext", "useDrillDownStore", "useCreateDrillDownStore", "store", "selectDepth", "state", "getServerDepth", "DrillDownRoot", "behavior", "children", "isDrillDown", "depth", "isRoot", "wasOpenRef", "rootRef", "handleKeyDownCapture", "handlePointerDownCapture", "usePanelPosition", "getSnapshot", "noopSubscribe", "getClosed", "useStackEntry", "getUndefined", "SubContext", "useSubContext", "React", "import_internal", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "sizes", "variants", "kbdPropDefs", "asChildPropDef", "Kbd", "props", "forwardedRef", "asChild", "className", "kbdProps", "extractProps", "kbdPropDefs", "Comp", "classNames", "React", "_BREAKPOINTS", "SHELL_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "subscribe", "getSnapshot", "getServerSnapshot", "ready", "BREAKPOINTS_DESCENDING", "resolveResponsiveValue", "value", "currentBreakpoint", "defaultValue", "map", "i", "resolved", "useResolvedResponsiveValue", "isResponsive", "breakpoint", "useBreakpoint", "CONTENT_PADDING", "getMenuAlignOffset", "size", "KEY_SYMBOLS", "ariaKeyShortcutsCache", "toAriaKeyShortcuts", "shortcut", "cached", "result", "token", "MenuShortcut", "className", "classNames", "Kbd", "MenuContext", "MenuGroupLabelContext", "menuSizeToItemHeight", "getMenuItemHeight", "size", "MenuProvider", "children", "resolvedSize", "useResolvedResponsiveValue", "itemHeight", "value", "MenuCloseContext", "MenuCloseProvider", "MenuGroupLabelProvider", "MenuGroupLabelContext", "useMenuGroupLabelledBy", "ariaLabelledBy", "labelId", "setLabelId", "useMenuGroupLabelId", "idProp", "rendered", "register", "generatedId", "id", "React", "requireReactElement", "children", "child", "DropdownMenuOpenContext", "DropdownMenuRoot", "props", "openProp", "defaultOpen", "onOpenChange", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChangeProp", "handleOpenChange", "next", "close", "MenuCloseProvider", "DropdownMenuPrimitive", "DropdownMenuTrigger", "children", "forwardedRef", "requireReactElement", "DropdownMenuContentContext", "BACK_KEYS", "FORWARD_KEYS", "isTextEntryTarget", "target", "getDirection", "element", "DropdownMenuContent", "ownProps", "useThemeSizeProps", "baseMenuContentPropDefs", "themeContext", "useThemeContext", "size", "className", "color", "container", "forceMount", "submenuBehavior", "virtualized", "onEscapeKeyDown", "onKeyDown", "contentProps", "extractProps", "resolvedColor", "behavior", "useResolvedResponsiveValue", "isDrillDown", "drillDownStore", "useCreateDrillDownStore", "handleEscapeKeyDown", "event", "handleKeyDown", "contextValue", "contentBody", "MenuProvider", "DrillDownRoot", "PortalTheme", "classNames", "ScrollArea", "DropdownMenuLabel", "idProp", "isLevelVisible", "DrillDownLevelContext", "id", "useMenuGroupLabelId", "DropdownMenuItem", "baseMenuItemPropDefs", "shortcut", "itemProps", "toAriaKeyShortcuts", "MenuShortcut", "DropdownMenuGroup", "ariaLabelledBy", "labelledBy", "setLabelId", "useMenuGroupLabelledBy", "MenuGroupLabelProvider", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "baseMenuRadioItemPropDefs", "ThickDotIcon", "DropdownMenuCheckboxItem", "baseMenuCheckboxItemPropDefs", "ThickCheckIcon", "DropdownMenuSub", "label", "useDrillDownStore", "subContextValue", "isOpenInDrillDown", "usePanelPosition", "isControlled", "defaultOpenRef", "wasOpenRef", "SubContext", "DropdownMenuSubTrigger", "subTriggerProps", "subContext", "useSubContext", "handleSelect", "ThickChevronRightIcon", "DropdownMenuSeparator", "DrillDownBackItem", "name", "labelText", "ariaLabel", "ThickChevronLeftIcon", "omitPopperProps", "_loop", "_onEscapeKeyDown", "_onPointerDownOutside", "_onFocusOutside", "_onInteractOutside", "_sideOffset", "_alignOffset", "_avoidCollisions", "_collisionBoundary", "_collisionPadding", "_arrowPadding", "_sticky", "_hideWhenDetached", "_updatePositionStrategy", "rest", "DropdownMenuSubContent", "DrillDownPanel", "CascadeSubContent", "parent", "_color", "subContentProps", "baseMenuSubContentPropDefs", "scalarSize", "body", "getMenuAlignOffset", "store", "sub", "position", "entry", "useStackEntry", "_container", "_forceMount", "_virtualized", "_size", "panelProps", "isTop", "DropdownMenuTriggerIcon", "ChevronDownIcon", "React", "import_classnames", "import_radix_ui", "contentSizes", "popoverContentPropDefs", "asChildPropDef", "widthPropDefs", "heightPropDefs", "PopoverContentContext", "usePopoverContentContext", "caller", "ctx", "PopoverRoot", "props", "PopoverPrimitive", "PopoverTrigger", "children", "forwardedRef", "requireReactElement", "PopoverContent", "ownProps", "useThemeSizeProps", "popoverContentPropDefs", "className", "forceMount", "container", "contentProps", "extractProps", "labelId", "setLabelId", "contextValue", "PortalTheme", "classNames", "PopoverClose", "PopoverAnchor", "PopoverToolbarBase", "PopoverToolbarLeft", "ref", "PopoverToolbarCenter", "PopoverToolbarRight", "PopoverToolbarTitle", "idProp", "reactId", "id", "PopoverToolbar", "React", "import_classnames", "orientationValues", "separatorPropDefs", "colorPropDef", "Separator", "props", "forwardedRef", "className", "color", "decorative", "separatorProps", "extractProps", "separatorPropDefs", "responsive", "breakpoint", "useBreakpoint", "orientation", "values", "bp", "SHELL_BREAKPOINTS", "classNames", "React", "import_classnames", "import_radix_ui", "sizes", "variants", "chipPropDefs", "asChildPropDef", "grayAccentColorPropDef", "radiusPropDef", "React", "import_classnames", "import_radix_ui", "React", "import_radix_ui", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "tooltipPropDefs", "widthPropDefs", "TOOLTIP_DELAY", "TooltipProviderContext", "TooltipProvider", "delayDuration", "children", "props", "TooltipPrimitive", "Tooltip", "forwardedRef", "className", "open", "defaultOpen", "onOpenChange", "disableHoverableContent", "content", "container", "forceMount", "tooltipContentProps", "extractProps", "tooltipPropDefs", "rootProps", "hasProvider", "tooltip", "PortalTheme", "classNames", "Text", "Chip", "props", "forwardedRef", "asChild", "className", "children", "color", "radius", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "chipProps", "extractProps", "chipPropDefs", "Comp", "chip", "classNames", "Tooltip", "React", "import_classnames", "React", "PAGE_SCROLL_QUERY", "list", "media", "listen", "m", "handler", "subscribe", "onChange", "usePageScrollMedia", "SidebarVisualContext", "useSidebarVisual", "ShellSizeContext", "ShellContentContext", "ShellWindowContext", "useChromeClasses", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "size", "menuVariant", "BAND_STEP", "useBandSize", "PaneHeader", "className", "float", "children", "props", "forwardedRef", "chrome", "useChromeClasses", "band", "useBandSize", "classNames", "PaneBandSizeContext", "PaneFooter", "Scroll", "style", "dir", "fade", "pane", "contentPane", "ShellContentContext", "visual", "useSidebarVisual", "inContent", "windowShell", "ShellWindowContext", "pageScrolls", "usePageScrollMedia", "tabIndex", "ScrollArea", "SidebarSeparator", "className", "props", "forwardedRef", "Separator", "classNames", "SidebarMenu", "SidebarMenuItem", "componentName", "type", "fn", "wrapped", "isIconElement", "el", "isText", "node", "separateIconsAndLabels", "children", "icons", "labels", "child", "wrapTextNodes", "focusAdjacentSidebarButton", "event", "scope", "buttons", "index", "next", "SidebarMenuButton", "asChild", "isActive", "shortcut", "badge", "onKeyDown", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "sidebarSize", "isThinMode", "Comp", "Slot", "handleKeyDown", "extras", "Chip", "Kbd", "renderContent", "content", "body", "SidebarSubMenuModeContext", "SidebarMenuSub", "defaultOpen", "DropdownMenuRoot", "SidebarMenuSubTrigger", "DropdownMenuTrigger", "ThickChevronRightIcon", "toDropdownItem", "key", "rest", "itemProps", "DropdownMenuItem", "wrapBareMenuButtons", "SidebarMenuSubContent", "items", "rows", "DropdownMenuContent", "DropdownMenuGroup", "SidebarGroupContext", "SidebarGroup", "labelId", "renderedLabelId", "setLabelId", "context", "SidebarGroupLabel", "id", "group", "SidebarGroupContent", "SearchIcon", "ClearIcon", "SidebarSearch", "value", "onValueChange", "placeholder", "isThin", "inputRef", "popoverRef", "resultsId", "valueRef", "onValueChangeRef", "searchLabel", "e", "handlePopoverKeyDown", "container", "resultsGroup", "active", "isOnInput", "currentIndex", "PopoverRoot", "PopoverTrigger", "PopoverContent"]
3
+ "sources": ["../../../src/components/sidebar.tsx", "../../../src/components/slot.tsx", "../../../src/components/dropdown-menu.tsx", "../../../src/components/scroll-area.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/scroll-area.props.tsx", "../../../src/hooks/use-scroll-edges.ts", "../../../src/hooks/use-thumb-sync.ts", "../../../src/helpers/get-subtree.ts", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/width.props.ts", "../../../src/props/height.props.ts", "../../../src/props/color.prop.ts", "../../../src/components/_internal/base-menu.props.ts", "../../../src/components/theme.tsx", "../../../src/helpers/get-matching-gray-color.ts", "../../../src/hooks/theme-size.ts", "../../../src/helpers/theme-size.ts", "../../../src/hooks/use-prop-synced-state.ts", "../../../src/components/theme.props.tsx", "../../../src/components/_internal/portal-theme.tsx", "../../../src/components/_internal/pane-band-context.ts", "../../../src/components/icons.tsx", "../../../src/components/_internal/dropdown-menu-drill-down.tsx", "../../../src/components/_internal/menu-context.tsx", "../../../src/components/_internal/base-menu.utils.tsx", "../../../src/components/kbd.tsx", "../../../src/components/kbd.props.tsx", "../../../src/hooks/use-breakpoint.ts", "../../../src/components/shell.types.ts", "../../../src/helpers/require-react-element.ts", "../../../src/components/popover.tsx", "../../../src/components/popover.props.tsx", "../../../src/components/_internal/navigator-host.ts", "../../../src/components/separator.tsx", "../../../src/components/separator.props.tsx", "../../../src/components/chip.tsx", "../../../src/components/chip.props.tsx", "../../../src/components/tooltip.tsx", "../../../src/components/text.tsx", "../../../src/props/emphasis.prop.ts", "../../../src/props/leading-trim.prop.ts", "../../../src/props/text-align.prop.ts", "../../../src/props/text-wrap.prop.ts", "../../../src/props/truncate.prop.ts", "../../../src/props/font-family.prop.ts", "../../../src/props/weight.prop.ts", "../../../src/components/text.props.tsx", "../../../src/components/tooltip.props.tsx", "../../../src/components/_internal/pane-chrome.tsx", "../../../src/components/_internal/shell-page-scroll.ts"],
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot.js';\nimport * as Accordion from '@radix-ui/react-accordion';\nimport * as DropdownMenu from './dropdown-menu.js';\nimport * as Popover from './popover.js';\n\nimport { Separator } from './separator.js';\nimport { ThickChevronRightIcon } from './icons.js';\nimport { Kbd } from './kbd.js';\nimport { Chip } from './chip.js';\nimport { ShellSizeContext, useSidebarVisual } from './_internal/pane-chrome.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { ChipProps } from './chip.js';\n\n// Chip configuration for the `badge` slot of sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: ChipProps['variant'];\n size?: ChipProps['size'];\n color?: ChipProps['color'];\n radius?: ChipProps['radius'];\n};\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, SidebarSeparatorProps>(({ className, ...props }, forwardedRef) => (\n <Separator {...props} ref={forwardedRef} className={classNames('kui-SidebarSeparator', className)} />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - styled like dropdown menus, but semantically a navigation list.\n// No menu/menuitem roles: those promise an application menu, which a list of links is not.\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(({ className, ...props }, forwardedRef) => (\n <ul {...props} ref={forwardedRef} className={classNames('kui-SidebarMenu', className)} />\n));\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuItem', className)} />\n));\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\n// The name a component type goes by: a function, or the function inside forwardRef or memo.\nfunction componentName(type: unknown): string | undefined {\n if (typeof type === 'function') {\n const fn = type as { displayName?: string; name?: string };\n return fn.displayName || fn.name;\n }\n if (type && typeof type === 'object') {\n const wrapped = type as { displayName?: string; render?: unknown; type?: unknown };\n return wrapped.displayName || componentName(wrapped.render) || componentName(wrapped.type);\n }\n return undefined;\n}\n\nfunction isIconElement(el: React.ReactElement<{ icon?: unknown }>): boolean {\n if (el.type === 'svg') return true;\n if (el.props?.icon) return true;\n return componentName(el.type)?.includes('Icon') ?? false;\n}\n\nfunction isText(node: React.ReactNode): node is string | number {\n return typeof node === 'string' || typeof node === 'number';\n}\n\n// Thin mode puts the row's icon in a wrapper that carries the hover and active tile. An icon is\n// an svg, a HugeiconsIcon, or a component named *Icon. Failing that, the first element ahead of\n// other content is taken as the icon (Lucide and other icon sets).\nfunction separateIconsAndLabels(node: React.ReactNode): { icons: React.ReactNode[]; labels: React.ReactNode[] } {\n const children = React.Children.toArray(node);\n const icons: React.ReactNode[] = [];\n const labels: React.ReactNode[] = [];\n\n for (const child of children) {\n if (React.isValidElement<{ icon?: unknown }>(child) && isIconElement(child)) icons.push(child);\n else labels.push(isText(child) ? <span key={labels.length} className=\"kui-SidebarMenuLabel\">{child}</span> : child);\n }\n\n if (icons.length === 0 && children.length > 1 && React.isValidElement(children[0])) {\n icons.push(children[0]);\n labels.shift();\n }\n\n return { icons, labels };\n}\n\n// Wraps the row's own text in a label span. Text inside the caller's elements is left alone.\nfunction wrapTextNodes(node: React.ReactNode): React.ReactNode {\n return React.Children.map(node, (child) => (isText(child) ? <span className=\"kui-SidebarMenuLabel\">{child}</span> : child));\n}\n\n// Arrow Up and Down move between the visible buttons of the same sidebar, as a\n// convenience on top of Tab. Sub-menu triggers take part, so the one-item Accordion\n// behind each sub-menu doesn't keep focus on its own trigger.\nfunction focusAdjacentSidebarButton(event: React.KeyboardEvent<HTMLElement>) {\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n const scope = event.currentTarget.closest('.kui-SidebarContent, .kui-SidebarSearchPopover');\n const buttons = scope\n ? Array.from(scope.querySelectorAll<HTMLElement>('.kui-SidebarMenuButton')).filter((el) => el.offsetParent !== null)\n : [];\n const index = buttons.indexOf(event.currentTarget);\n const next = buttons[index + (event.key === 'ArrowDown' ? 1 : -1)];\n if (index !== -1 && next) {\n event.preventDefault();\n next.focus();\n }\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, shortcut, badge, className, children, onKeyDown, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const sidebarSize = visual?.size ?? shellSize;\n const isThinMode = visual?.presentation === 'thin';\n\n const Comp = asChild ? Slot : 'button';\n\n // Enter and Space are left to the native button or link. The caller's handler runs first,\n // so it can preventDefault to keep the arrow keys for itself.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) focusAdjacentSidebarButton(event);\n };\n\n const extras = isThinMode ? null : (\n <>\n {badge && (\n <div className=\"kui-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Chip size={sidebarSize} variant=\"soft\">\n {badge}\n </Chip>\n ) : (\n <Chip size={badge.size || sidebarSize} variant={badge.variant || 'soft'} color={badge.color} radius={badge.radius}>\n {badge.content}\n </Chip>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"kui-BaseMenuShortcut kui-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n );\n\n const renderContent = (content: React.ReactNode): React.ReactNode => {\n if (isThinMode) {\n const { icons, labels } = separateIconsAndLabels(content);\n if (icons.length > 0) {\n return (\n <>\n <span className=\"kui-SidebarMenuIconWrapper\">{icons}</span>\n {labels}\n </>\n );\n }\n }\n return (\n <>\n {wrapTextNodes(content)}\n {extras}\n </>\n );\n };\n\n // When rendering asChild, Slot expects a single child element. The row's content goes\n // inside that element, so a Link gets the label, icon tile, badge and shortcut.\n let body: React.ReactNode;\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children) && React.Children.count(children) === 1) {\n body = React.cloneElement(children, undefined, renderContent(children.props.children));\n } else if (asChild) {\n body = children;\n } else {\n body = renderContent(children);\n }\n\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n {...props}\n ref={forwardedRef}\n aria-current={isActive ? 'page' : undefined}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n onKeyDown={handleKeyDown}\n >\n {body}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components: Accordion in expanded, Dropdown in thin\nconst SidebarSubMenuModeContext = React.createContext<'accordion' | 'dropdown'>('accordion');\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(({ defaultOpen = false, children, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const mode: 'accordion' | 'dropdown' = visual?.presentation === 'thin' ? 'dropdown' : 'accordion';\n\n if (mode === 'dropdown') {\n return (\n <div {...props} ref={forwardedRef}>\n <DropdownMenu.Root>\n <SidebarSubMenuModeContext.Provider value=\"dropdown\">{children}</SidebarSubMenuModeContext.Provider>\n </DropdownMenu.Root>\n </div>\n );\n }\n\n return (\n <div {...props} ref={forwardedRef}>\n <SidebarSubMenuModeContext.Provider value=\"accordion\">\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </SidebarSubMenuModeContext.Provider>\n </div>\n );\n});\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<React.ElementRef<typeof Accordion.Trigger>, SidebarMenuSubTriggerProps>(\n ({ asChild = false, className, children, onKeyDown, ...props }, forwardedRef) => {\n const mode = React.useContext(SidebarSubMenuModeContext);\n\n if (mode === 'dropdown') {\n return (\n <DropdownMenu.Trigger>\n <button\n {...(props as any)}\n onKeyDown={onKeyDown}\n ref={forwardedRef as any}\n type=\"button\"\n aria-haspopup=\"menu\"\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarMenuSubTrigger', className)}\n >\n {children}\n </button>\n </DropdownMenu.Trigger>\n );\n }\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n onKeyDown={(event) => {\n // Runs before the Accordion's own arrow handling, which would keep focus here.\n focusAdjacentSidebarButton(event);\n onKeyDown?.(event);\n }}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarMenuSubTrigger', className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon className={classNames('kui-BaseMenuSubTriggerIcon', 'kui-SidebarMenuSubTriggerIcon')} />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\n// In a Rail a sub-menu is a dropdown. Each row becomes a menu item: a MenuButton hands the item\n// its props (onClick, disabled, active), and an asChild one hands it its link.\nfunction toDropdownItem(node: React.ReactNode, key: React.Key): React.ReactNode {\n if (React.isValidElement<SidebarMenuButtonProps>(node) && node.type === SidebarMenuButton) {\n // The badge and shortcut have no place in a dropdown row; `type` belongs to a button only.\n const { asChild, isActive, shortcut, badge, type, children, ...rest } = node.props;\n const itemProps = {\n ...(rest as Omit<React.ComponentPropsWithoutRef<typeof DropdownMenu.Item>, 'color'>),\n 'data-active': isActive || undefined,\n 'aria-current': isActive ? ('page' as const) : undefined,\n };\n if (asChild && React.isValidElement(children) && React.Children.count(children) === 1) {\n return (\n <DropdownMenu.Item key={key} {...itemProps} asChild>\n {children}\n </DropdownMenu.Item>\n );\n }\n return (\n <DropdownMenu.Item key={key} {...itemProps}>\n {children}\n </DropdownMenu.Item>\n );\n }\n if (React.isValidElement(node)) {\n return (\n <DropdownMenu.Item key={key} asChild>\n {node}\n </DropdownMenu.Item>\n );\n }\n return <DropdownMenu.Item key={key}>{node}</DropdownMenu.Item>;\n}\n\n// The sub-list is a <ul>, so each row needs its own <li>. A MenuButton written straight into\n// MenuSubContent gets a MenuItem around it, rather than leaving an <a> or <button> in the list.\nfunction wrapBareMenuButtons(children: React.ReactNode): React.ReactNode {\n return React.Children.map(children, (child, index) =>\n React.isValidElement(child) && child.type === SidebarMenuButton ? (\n <SidebarMenuItem key={child.key ?? index}>{child}</SidebarMenuItem>\n ) : (\n child\n ),\n );\n}\n\nconst SidebarMenuSubContent = React.forwardRef<React.ElementRef<typeof Accordion.Content>, SidebarMenuSubContentProps>(({ className, children, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const mode = React.useContext(SidebarSubMenuModeContext);\n\n if (mode === 'dropdown') {\n const items = React.Children.map(children, (child, index) => {\n if (React.isValidElement<{ children?: React.ReactNode }>(child) && child.type === SidebarMenuItem) {\n const rows = React.Children.toArray(child.props.children);\n return toDropdownItem(rows.length === 1 ? rows[0] : rows, index);\n }\n return toDropdownItem(child, index);\n });\n\n return (\n <DropdownMenu.Content\n {...(props as Omit<React.ComponentPropsWithoutRef<typeof DropdownMenu.Content>, 'color'>)}\n ref={forwardedRef}\n size={visual?.size}\n className={classNames(className)}\n >\n <DropdownMenu.Group>{items}</DropdownMenu.Group>\n </DropdownMenu.Content>\n );\n }\n\n return (\n <Accordion.Content {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuSubContent', className)}>\n <ul className=\"kui-SidebarMenuSubList\">{wrapBareMenuButtons(children)}</ul>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components. A group with a label is a named group; one without stays a plain div, so it\n// isn't announced as an empty group.\ntype SidebarGroupContextValue = { labelId: string; setLabelId: (id: string | null) => void };\nconst SidebarGroupContext = React.createContext<SidebarGroupContextValue | null>(null);\n\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(({ className, ...props }, forwardedRef) => {\n const labelId = React.useId();\n const [renderedLabelId, setLabelId] = React.useState<string | null>(null);\n const context = React.useMemo(() => ({ labelId, setLabelId }), [labelId]);\n return (\n <SidebarGroupContext.Provider value={context}>\n <div\n role={renderedLabelId ? 'group' : undefined}\n aria-labelledby={renderedLabelId ?? undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-SidebarGroup', className)}\n />\n </SidebarGroupContext.Provider>\n );\n});\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(({ asChild = false, className, id, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n const group = React.useContext(SidebarGroupContext);\n const labelId = id ?? group?.labelId;\n const setLabelId = group?.setLabelId;\n\n React.useEffect(() => {\n if (!setLabelId || !labelId) return;\n setLabelId(labelId);\n return () => setLabelId(null);\n }, [setLabelId, labelId]);\n\n return <Comp {...props} id={labelId} ref={forwardedRef} className={classNames('kui-BaseMenuLabel', 'kui-SidebarGroupLabel', className)} />;\n});\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(({ className, ...props }, forwardedRef) => (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarGroupContent', className)} />\n));\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Search component: inline input in expanded, popover trigger in thin\ninterface SidebarSearchProps extends React.ComponentPropsWithoutRef<'div'> {\n value: string;\n onValueChange: (value: string) => void;\n placeholder?: string;\n children?: React.ReactNode;\n}\n\nconst SearchIcon = ({ className }: { className?: string }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n);\n\nconst ClearIcon = ({ className }: { className?: string }) => (\n <svg className={className} width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n);\n\nconst SidebarSearch = React.forwardRef<HTMLDivElement, SidebarSearchProps>(\n ({ value, onValueChange, placeholder = 'Search...', children, className, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const isThin = visual?.presentation === 'thin';\n const inputRef = React.useRef<HTMLInputElement>(null);\n const popoverRef = React.useRef<HTMLDivElement>(null);\n const searchId = React.useId();\n const resultsId = `${searchId}-results`;\n\n // Stable refs for values used in callbacks \u2014 avoids recreating handlers on every keystroke\n const valueRef = React.useRef(value);\n valueRef.current = value;\n const onValueChangeRef = React.useRef(onValueChange);\n onValueChangeRef.current = onValueChange;\n\n // Derive a clean aria-label from placeholder (strip trailing dots/ellipsis)\n const searchLabel = placeholder.replace(/\\.+$/, '');\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Escape' && valueRef.current) {\n e.preventDefault();\n e.stopPropagation();\n onValueChangeRef.current('');\n inputRef.current?.focus();\n }\n },\n [],\n );\n\n // Arrow key navigation within the popover (input \u2194 results)\n const handlePopoverKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n // A result row already moved focus with its own arrow handling (focusAdjacentSidebarButton\n // scopes to this popover); moving again would skip a row.\n if (e.defaultPrevented) return;\n const container = popoverRef.current;\n if (!container) return;\n\n const resultsGroup = container.querySelector('[role=\"group\"]');\n if (!resultsGroup) return;\n\n const items = Array.from(\n resultsGroup.querySelectorAll<HTMLElement>('a, button'),\n );\n if (items.length === 0) return;\n\n const active = document.activeElement as HTMLElement;\n const isOnInput = active === inputRef.current;\n const currentIndex = items.indexOf(active);\n\n // Typing while a result is focused \u2192 redirect focus to input\n if (\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey &&\n !isOnInput &&\n currentIndex !== -1\n ) {\n inputRef.current?.focus();\n return;\n }\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n if (isOnInput || currentIndex === -1) {\n items[0]?.focus();\n } else if (currentIndex < items.length - 1) {\n items[currentIndex + 1]?.focus();\n }\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n if (currentIndex <= 0) {\n inputRef.current?.focus();\n } else {\n items[currentIndex - 1]?.focus();\n }\n break;\n }\n case 'Home': {\n // Only intercept when focused on a result, not the input (where Home moves cursor)\n if (!isOnInput) {\n e.preventDefault();\n items[0]?.focus();\n }\n break;\n }\n case 'End': {\n if (!isOnInput) {\n e.preventDefault();\n items[items.length - 1]?.focus();\n }\n break;\n }\n }\n },\n [],\n );\n\n if (isThin) {\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarSearch', 'kui-SidebarSearch--thin', className)}>\n <Popover.Root>\n <Popover.Trigger>\n <button\n type=\"button\"\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarSearchTrigger')}\n aria-label={searchLabel}\n >\n <span className=\"kui-SidebarMenuIconWrapper\">\n <SearchIcon />\n </span>\n <span className=\"kui-SidebarMenuLabel\">Search</span>\n </button>\n </Popover.Trigger>\n <Popover.Content side=\"right\" align=\"start\" size=\"2\" width=\"280px\" aria-label={searchLabel}>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- keyDown manages arrow-key navigation between input and results, which is accessibility-enhancing */}\n <div\n ref={popoverRef}\n className=\"kui-SidebarSearchPopover\"\n role=\"search\"\n onKeyDown={handlePopoverKeyDown}\n >\n <div className=\"kui-SidebarSearchInputWrapper\">\n <SearchIcon className=\"kui-SidebarSearchIcon\" />\n <input\n ref={inputRef}\n type=\"search\"\n className=\"kui-SidebarSearchInput\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n aria-label={searchLabel}\n aria-controls={children ? resultsId : undefined}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- intentional: popover opens on user action, focusing the input is expected UX\n autoFocus\n />\n {value && (\n <button\n type=\"button\"\n className=\"kui-reset kui-SidebarSearchClear\"\n onClick={() => {\n onValueChange('');\n inputRef.current?.focus();\n }}\n aria-label=\"Clear search\"\n >\n <ClearIcon />\n </button>\n )}\n </div>\n {children && (\n <div id={resultsId} role=\"group\" aria-label=\"Search results\">\n {children}\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n }\n\n // Expanded mode: inline input\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarSearch', 'kui-SidebarSearch--expanded', 'kui-ShellPaneChrome', `kui-r-size-${visual?.size ?? '2'}`, className)} role=\"search\">\n <div className=\"kui-SidebarSearchInputWrapper\">\n <SearchIcon className=\"kui-SidebarSearchIcon\" />\n <input\n ref={inputRef}\n type=\"search\"\n className=\"kui-SidebarSearchInput\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n aria-label={searchLabel}\n />\n {value && (\n <button\n type=\"button\"\n className=\"kui-reset kui-SidebarSearchClear\"\n onClick={() => {\n onValueChange('');\n inputRef.current?.focus();\n }}\n aria-label=\"Clear search\"\n >\n <ClearIcon />\n </button>\n )}\n </div>\n </div>\n );\n },\n);\nSidebarSearch.displayName = 'Sidebar.Search';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n SidebarSearch as Search,\n};\n\nexport type { BadgeConfig };\n", "import { Slot as SlotPrimitive } from 'radix-ui';\nexport const Root = SlotPrimitive.Root;\nexport const Slot = SlotPrimitive.Root;\nexport const Slottable: typeof SlotPrimitive.Slottable = SlotPrimitive.Slottable;\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\nimport { useCallbackRef } from 'radix-ui/internal';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuSubContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { useThemeContext } from './theme.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport {\n DrillDownLevelContext,\n DrillDownRoot,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n} from './_internal/dropdown-menu-drill-down.js';\nimport {\n MenuCloseProvider,\n MenuGroupLabelProvider,\n MenuProvider,\n useMenuGroupLabelId,\n useMenuGroupLabelledBy,\n} from './_internal/menu-context.js';\nimport {\n MenuShortcut,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n useResolvedResponsiveValue,\n} from './_internal/base-menu.utils.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { SubmenuBehavior } from './_internal/dropdown-menu-drill-down.js';\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes, Responsive } from '../props/prop-def.js';\n\n/**\n * Open state of the menu, mirrored from Root so Content can reset drill-down\n * navigation when a force-mounted menu opens again.\n */\nconst DropdownMenuOpenContext = React.createContext(false);\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => {\n const { open: openProp, defaultOpen = false, onOpenChange } = props;\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n\n const handleOpenChangeProp = useCallbackRef(onOpenChange);\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n handleOpenChangeProp(next);\n },\n [handleOpenChangeProp],\n );\n\n const close = React.useCallback(() => handleOpenChange(false), [handleOpenChange]);\n\n return (\n <DropdownMenuOpenContext.Provider value={open}>\n <MenuCloseProvider value={close}>\n <DropdownMenuPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} />\n </MenuCloseProvider>\n </DropdownMenuOpenContext.Provider>\n );\n};\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\n/** Visual props shared by Content and SubContent. */\ntype DropdownMenuSurfaceProps = GetPropDefTypes<typeof dropdownMenuSubContentPropDefs>;\n\ntype DropdownMenuContentContextValue = {\n size?: DropdownMenuSurfaceProps['size'];\n color?: DropdownMenuSurfaceProps['color'];\n};\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\n\n/** Keys that navigate back one drill-down level, by writing direction. */\nconst BACK_KEYS = { ltr: 'ArrowLeft', rtl: 'ArrowRight' } as const;\nconst FORWARD_KEYS = { ltr: 'ArrowRight', rtl: 'ArrowLeft' } as const;\n\nfunction isTextEntryTarget(target: EventTarget | null) {\n return (\n target instanceof HTMLElement &&\n (target.isContentEditable || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA')\n );\n}\n\nfunction getDirection(element: HTMLElement | null): 'ltr' | 'rtl' {\n return element?.closest('[dir]')?.getAttribute('dir') === 'rtl' ? 'rtl' : 'ltr';\n}\n\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior?: Responsive<SubmenuBehavior>;\n /**\n * When true, skips the ScrollArea wrapper to allow VirtualMenu to handle its own scrolling.\n * Use this when rendering virtualized lists inside the dropdown.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, dropdownMenuContentPropDefs.size);\n const themeContext = useThemeContext();\n const {\n size = dropdownMenuContentPropDefs.size.default,\n } = props;\n const {\n className,\n children,\n color,\n container,\n forceMount,\n submenuBehavior,\n virtualized = false,\n onEscapeKeyDown,\n onKeyDown,\n ...contentProps\n } = extractProps(props, dropdownMenuContentPropDefs);\n\n const resolvedColor = color || themeContext.accentColor;\n const behavior = useResolvedResponsiveValue<SubmenuBehavior>(submenuBehavior, 'cascade');\n const isDrillDown = behavior === 'drill-down';\n const open = React.useContext(DropdownMenuOpenContext);\n const drillDownStore = useCreateDrillDownStore();\n\n // Escape goes back one drill-down level before it closes the menu.\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n onEscapeKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n event.preventDefault();\n drillDownStore.pop('keyboard');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !isDrillDown || drillDownStore.getDepth() === 0) return;\n if (isTextEntryTarget(event.target)) return;\n if (event.key === BACK_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.pop('keyboard');\n }\n };\n\n const contextValue = React.useMemo(\n () => ({ size, color: resolvedColor }),\n [size, resolvedColor],\n );\n\n const contentBody = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>\n <DrillDownRoot store={drillDownStore} behavior={behavior} open={open}>\n {children}\n </DrillDownRoot>\n </DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n onEscapeKeyDown={handleEscapeKeyDown}\n onKeyDown={handleKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-DropdownMenuContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {contentBody}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>\n {contentBody}\n </div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.Content>\n </PortalTheme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, id: idProp, ...props }, forwardedRef) => {\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n const id = useMenuGroupLabelId(idProp, isLevelVisible);\n if (!isLevelVisible) return null;\n return (\n <DropdownMenuPrimitive.Label\n {...props}\n id={id}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-DropdownMenuLabel', className)}\n />\n );\n },\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n // In drill-down mode, items of levels that are not on screen do not mount.\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n // A drill-down level that is not on screen keeps its groups only to hold the open path.\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <DropdownMenuPrimitive.Group\n {...(isLevelVisible ? { 'aria-labelledby': labelledBy } : { role: 'none' })}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-DropdownMenuGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n },\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, 'aria-labelledby': ariaLabelledBy, ...props }, forwardedRef) => {\n const [labelledBy, setLabelId] = useMenuGroupLabelledBy(ariaLabelledBy);\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n return (\n <MenuGroupLabelProvider value={setLabelId}>\n <DropdownMenuPrimitive.RadioGroup\n {...(isLevelVisible ? { 'aria-labelledby': labelledBy } : { role: 'none' })}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuRadioGroup', 'kui-DropdownMenuRadioGroup', className)}\n />\n </MenuGroupLabelProvider>\n );\n});\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuRadioItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuRadioItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickDotIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n aria-keyshortcuts={shortcut ? toAriaKeyShortcuts(shortcut) : undefined}\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuCheckboxItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuCheckboxItem',\n className,\n )}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n <DropdownMenuPrimitive.ItemIndicator className=\"kui-BaseMenuItemIndicator kui-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"kui-BaseMenuItemIndicatorIcon kui-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && <MenuShortcut shortcut={shortcut} className=\"kui-DropdownMenuShortcut\" />}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {\n /**\n * Label displayed in the back button when using drill-down mode.\n * If not provided, defaults to \"Back\".\n */\n label?: React.ReactNode;\n}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = ({\n label = 'Back',\n open,\n defaultOpen,\n onOpenChange,\n children,\n}) => {\n const drillDownStore = useDrillDownStore();\n const id = React.useId();\n const subContextValue = React.useMemo(() => ({ id, label }), [id, label]);\n const isOpenInDrillDown = usePanelPosition(drillDownStore, id) !== 'closed';\n\n const handleOpenChange = useCallbackRef(onOpenChange);\n const isControlled = open !== undefined;\n\n // Drill-down, controlled: navigating asks `onOpenChange` and leaves the stack to `open`.\n React.useLayoutEffect(() => {\n if (!drillDownStore || !isControlled) return;\n drillDownStore.setController(id, handleOpenChange);\n return () => drillDownStore.setController(id, null);\n }, [drillDownStore, isControlled, id, handleOpenChange]);\n\n React.useLayoutEffect(() => {\n if (!drillDownStore || open === undefined) return;\n if (open && !drillDownStore.isOpen(id)) drillDownStore.open(id, drillDownStore.takePendingModality(id));\n else if (!open && drillDownStore.isOpen(id)) drillDownStore.close(id, drillDownStore.takePendingModality(id));\n }, [drillDownStore, open, id]);\n\n // A `defaultOpen` push on mount is the starting state, not a change to report.\n const defaultOpenRef = React.useRef(open === undefined && Boolean(defaultOpen));\n React.useLayoutEffect(() => {\n if (drillDownStore && defaultOpenRef.current) drillDownStore.open(id);\n else defaultOpenRef.current = false;\n // Only on mount, like an uncontrolled default.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Uncontrolled, the stack drives `onOpenChange`. Controlled, it reports only a close\n // the `open` prop did not ask for, such as a parent level closing.\n const wasOpenRef = React.useRef(isOpenInDrillDown);\n React.useEffect(() => {\n if (!drillDownStore || wasOpenRef.current === isOpenInDrillDown) return;\n wasOpenRef.current = isOpenInDrillDown;\n if (isOpenInDrillDown && defaultOpenRef.current) {\n defaultOpenRef.current = false;\n return;\n }\n if (open !== undefined && open === isOpenInDrillDown) return;\n handleOpenChange(isOpenInDrillDown);\n }, [drillDownStore, isOpenInDrillDown, handleOpenChange, open]);\n\n // Radix Sub stays mounted in both behaviors so switching behavior does not\n // remount the subtree. It only renders context; in drill-down its trigger\n // and content are never rendered, so it reports no open changes of its own.\n return (\n <SubContext.Provider value={subContextValue}>\n <DropdownMenuPrimitive.Sub\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={drillDownStore ? undefined : onOpenChange}\n >\n {children}\n </DropdownMenuPrimitive.Sub>\n </SubContext.Provider>\n );\n};\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, onKeyDown, ...subTriggerProps } = props;\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n const isLevelVisible = React.useContext(DrillDownLevelContext);\n\n if (drillDownStore && subContext) {\n if (!isLevelVisible) return null;\n\n const handleSelect = (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore.push(subContext.id);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || subTriggerProps.disabled) return;\n if (event.key === FORWARD_KEYS[getDirection(event.currentTarget)]) {\n event.preventDefault();\n drillDownStore.push(subContext.id, 'keyboard');\n }\n };\n\n return (\n // The row navigates within the same menu, so it announces no popup.\n <DropdownMenuPrimitive.Item\n {...subTriggerProps}\n data-drill-down-trigger={subContext.id}\n data-drill-down-name={subTriggerProps.textValue}\n onSelect={handleSelect}\n onKeyDown={handleKeyDown}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n 'kui-DropdownMenuDrillDownSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n onKeyDown={onKeyDown}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-BaseMenuItem',\n 'kui-BaseMenuSubTrigger',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"kui-BaseMenuShortcut kui-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuSubTriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => {\n if (!React.useContext(DrillDownLevelContext)) return null;\n return (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-DropdownMenuSeparator', className)}\n />\n );\n});\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\n/** The row at the top of a drill-down panel that returns to the parent level. */\nfunction DrillDownBackItem({ label, name }: { label: React.ReactNode; name: string }) {\n const drillDownStore = useDrillDownStore();\n\n const handleSelect = React.useCallback(\n (event: Event) => {\n // Navigating does not close the menu.\n event.preventDefault();\n drillDownStore?.pop();\n },\n [drillDownStore],\n );\n\n // The visible label is often the submenu title, so the accessible name says\n // what the row does while still containing the visible text.\n const labelText = typeof label === 'string' ? label : name;\n const ariaLabel = labelText && labelText !== 'Back' ? `Back from ${labelText}` : undefined;\n\n return (\n <DropdownMenuPrimitive.Item\n aria-label={ariaLabel}\n textValue={labelText || 'Back'}\n onSelect={handleSelect}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-DropdownMenuItem',\n 'kui-DropdownMenuDrillDownBackItem',\n )}\n >\n <ThickChevronLeftIcon className=\"kui-BaseMenuSubTriggerIcon kui-DropdownMenuDrillDownBackIcon\" />\n <span className=\"kui-DropdownMenuDrillDownBackLabel\">{label}</span>\n </DropdownMenuPrimitive.Item>\n );\n}\n\n/** Radix positioning and layer props that have no meaning for an inline drill-down panel. */\ntype PopperOnlyProps =\n | 'loop'\n | 'onEscapeKeyDown'\n | 'onPointerDownOutside'\n | 'onFocusOutside'\n | 'onInteractOutside'\n | 'sideOffset'\n | 'alignOffset'\n | 'avoidCollisions'\n | 'collisionBoundary'\n | 'collisionPadding'\n | 'arrowPadding'\n | 'sticky'\n | 'hideWhenDetached'\n | 'updatePositionStrategy';\n\nfunction omitPopperProps<T extends Record<string, unknown>>(props: T): Omit<T, PopperOnlyProps> {\n const {\n loop: _loop,\n onEscapeKeyDown: _onEscapeKeyDown,\n onPointerDownOutside: _onPointerDownOutside,\n onFocusOutside: _onFocusOutside,\n onInteractOutside: _onInteractOutside,\n sideOffset: _sideOffset,\n alignOffset: _alignOffset,\n avoidCollisions: _avoidCollisions,\n collisionBoundary: _collisionBoundary,\n collisionPadding: _collisionPadding,\n arrowPadding: _arrowPadding,\n sticky: _sticky,\n hideWhenDetached: _hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n ...rest\n } = props;\n return rest;\n}\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps>,\n DropdownMenuSurfaceProps {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n /**\n * When true, skips the ScrollArea wrapper so a VirtualMenu can handle its own\n * scrolling. Applies to cascade submenus; a drill-down panel scrolls with the\n * root content.\n */\n virtualized?: boolean;\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n const drillDownStore = useDrillDownStore();\n const subContext = useSubContext();\n\n if (drillDownStore && subContext) {\n return (\n <DrillDownPanel {...props} ref={forwardedRef} store={drillDownStore} sub={subContext} />\n );\n }\n return <CascadeSubContent {...props} ref={forwardedRef} />;\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\nconst CascadeSubContent = React.forwardRef<DropdownMenuSubContentElement, DropdownMenuSubContentProps>(\n (props, forwardedRef) => {\n const parent = React.useContext(DropdownMenuContentContext);\n\n // A submenu inherits the parent surface, and its own props win.\n const size = props.size ?? parent.size;\n const color = props.color ?? parent.color;\n\n const {\n className,\n children,\n container,\n forceMount,\n color: _color,\n virtualized = false,\n ...subContentProps\n } = extractProps({ ...props, size }, dropdownMenuSubContentPropDefs);\n\n const scalarSize = useResolvedResponsiveValue(size, dropdownMenuSubContentPropDefs.size.default);\n\n const contextValue = React.useMemo(\n () => ({ size, color }),\n [size, color],\n );\n\n const body = (\n <MenuProvider size={size}>\n <DropdownMenuContentContext.Provider value={contextValue}>{children}</DropdownMenuContentContext.Provider>\n </MenuProvider>\n );\n\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={getMenuAlignOffset(scalarSize)}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-BaseMenuSubContent',\n 'kui-DropdownMenuContent',\n 'kui-DropdownMenuSubContent',\n className,\n )}\n >\n {virtualized ? (\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport', 'kui-virtualized')}>\n {body}\n </div>\n ) : (\n <ScrollArea type=\"auto\" scrollbars=\"vertical\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-DropdownMenuViewport')}>{body}</div>\n </ScrollArea>\n )}\n </DropdownMenuPrimitive.SubContent>\n </PortalTheme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nCascadeSubContent.displayName = 'DropdownMenu.CascadeSubContent';\n\ninterface DrillDownPanelProps extends DropdownMenuSubContentProps {\n store: NonNullable<ReturnType<typeof useDrillDownStore>>;\n sub: NonNullable<ReturnType<typeof useSubContext>>;\n}\n\n/**\n * A submenu rendered inline in drill-down mode. It mounts its children only\n * while it is on the navigation stack, and shows its own items only while it\n * is the top level; deeper panels inside it stay mounted.\n */\nconst DrillDownPanel = React.forwardRef<DropdownMenuSubContentElement, DrillDownPanelProps>(\n ({ store, sub, ...props }, forwardedRef) => {\n const position = usePanelPosition(store, sub.id);\n const entry = useStackEntry(store, sub.id);\n\n if (position === 'closed') return null;\n\n const {\n className,\n children,\n container: _container,\n forceMount: _forceMount,\n virtualized: _virtualized,\n size: _size,\n color: _color,\n ...panelProps\n } = omitPopperProps(props);\n\n const isTop = position === 'top';\n const name = entry?.name || (typeof sub.label === 'string' ? sub.label : '');\n\n return (\n <div\n role=\"group\"\n aria-label={name || undefined}\n {...panelProps}\n ref={forwardedRef}\n data-drill-down-panel={sub.id}\n data-drill-down-active={isTop ? true : undefined}\n className={classNames('kui-DropdownMenuDrillDownPanel', className)}\n >\n {isTop && (\n <>\n <DrillDownBackItem label={sub.label} name={name} />\n <DropdownMenuPrimitive.Separator className=\"kui-BaseMenuSeparator kui-DropdownMenuSeparator\" />\n </>\n )}\n <MenuGroupLabelProvider value={null}>\n <DrillDownLevelContext.Provider value={isTop}>{children}</DrillDownLevelContext.Provider>\n </MenuGroupLabelProvider>\n </div>\n );\n },\n);\nDrillDownPanel.displayName = 'DropdownMenu.DrillDownPanel';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>(({ className, ...props }, forwardedRef) => (\n <ChevronDownIcon\n {...props}\n ref={forwardedRef}\n className={classNames('kui-DropdownMenuTriggerIcon', className)}\n />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n SubmenuBehavior,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { scrollableOverflow, useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps,\n WidthProps,\n HeightProps {}\n\n/** Menus and listboxes move focus between their items, so a scroller inside one stays out of the tab order. */\nconst OWNS_FOCUS = '[role=\"menu\"], [role=\"listbox\"]';\n\n/**\n * Puts the viewport in the tab order while it has something to scroll, so a keyboard can reach it\n * and scroll it with the arrow keys. A `tabIndex` the caller set wins.\n */\nfunction useFocusableWhileScrollable(element: HTMLDivElement | null, enabled: boolean) {\n React.useEffect(() => {\n if (!enabled || !element || element.closest(OWNS_FOCUS)) return;\n let frame = 0;\n const update = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const scrollable = overflow.x > 0 || overflow.y > 0;\n if (scrollable) element.setAttribute('tabindex', '0');\n else element.removeAttribute('tabindex');\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n update();\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n return () => {\n if (frame) cancelAnimationFrame(frame);\n // The attribute stays: a caller who now sets `tabIndex` has already written it.\n observer?.disconnect();\n };\n }, [element, enabled]);\n}\n\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = extractProps(props, widthPropDefs, heightPropDefs);\n const [viewport, setViewport] = React.useState<HTMLDivElement | null>(null);\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport, setViewport);\n useFocusableWhileScrollable(viewport, viewportProps.tabIndex === undefined);\n // A named scroller is a region, so a screen reader can find it and say what it holds.\n const named = viewportProps['aria-label'] !== undefined || viewportProps['aria-labelledby'] !== undefined;\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n dir={dir}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n role={named ? 'region' : undefined}\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst scrollbarsValues = ['vertical', 'horizontal', 'both'] as const;\n\nconst scrollAreaPropDefs = {\n ...asChildPropDef,\n ...radiusPropDef,\n scrollbars: { type: 'enum', values: scrollbarsValues, default: 'both' },\n /**\n * Fades the content toward the top and bottom edges while there is more content past them.\n * An edge with nothing hidden past it does not fade. A floating band over an edge can set\n * `--scroll-fade-start` or `--scroll-fade-end` to its height, so content fades as it passes\n * under the band.\n */\n fade: { type: 'boolean', default: false },\n} satisfies {\n scrollbars: PropDef<(typeof scrollbarsValues)[number]>;\n fade: PropDef<boolean>;\n};\n\nexport { scrollAreaPropDefs };\n", "import * as React from 'react';\n\n/**\n * How far content runs past the element on each axis, in px. An axis whose overflow is hidden\n * cannot be scrolled (a ScrollArea with `scrollbars=\"vertical\"` hides the inline axis), so it\n * counts as 0, however wide the content.\n */\nexport function scrollableOverflow(element: HTMLElement) {\n const style = getComputedStyle(element);\n return {\n x: style.overflowX === 'hidden' ? 0 : Math.max(0, element.scrollWidth - element.clientWidth),\n y: style.overflowY === 'hidden' ? 0 : Math.max(0, element.scrollHeight - element.clientHeight),\n };\n}\n\n/**\n * Publishes how much content is hidden past each edge of a scroller, as\n * `--scroll-overflow-start` and `--scroll-overflow-end` (block axis) and\n * `--scroll-overflow-x-start` and `--scroll-overflow-x-end` (inline axis, from\n * the inline start, so right-to-left reads the same) in px on the element.\n * The scroll fade reads them, so an edge fades only while content is hidden\n * there, and the fade ramps in over the first pixels of scrolling.\n *\n * Writes happen at most once per frame, on scroll and when the element or its\n * content resizes. Nothing re-renders.\n */\nexport function useScrollEdges<T extends HTMLElement>(enabled: boolean) {\n const [element, setElement] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n if (!enabled || !element) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n const overflow = scrollableOverflow(element);\n const start = Math.max(0, element.scrollTop);\n const end = Math.max(0, overflow.y - element.scrollTop);\n element.style.setProperty('--scroll-overflow-start', `${start}px`);\n element.style.setProperty('--scroll-overflow-end', `${end}px`);\n // scrollLeft runs negative in right-to-left, so its size is the distance from the inline start.\n const xStart = Math.abs(element.scrollLeft);\n const xEnd = Math.max(0, overflow.x - xStart);\n element.style.setProperty('--scroll-overflow-x-start', `${xStart}px`);\n element.style.setProperty('--scroll-overflow-x-end', `${xEnd}px`);\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n write();\n element.addEventListener('scroll', schedule, { passive: true });\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);\n observer?.observe(element);\n for (const child of Array.from(element.children)) observer?.observe(child);\n const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(schedule);\n mutations?.observe(element, { childList: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n element.removeEventListener('scroll', schedule);\n observer?.disconnect();\n mutations?.disconnect();\n element.style.removeProperty('--scroll-overflow-start');\n element.style.removeProperty('--scroll-overflow-end');\n element.style.removeProperty('--scroll-overflow-x-start');\n element.style.removeProperty('--scroll-overflow-x-end');\n };\n }, [enabled, element]);\n\n return setElement;\n}\n", "import * as React from 'react';\n\n/**\n * Keeps a Radix ScrollArea's thumbs on the scroll position on every scroll.\n *\n * Radix moves a thumb from a requestAnimationFrame loop it starts on the first scroll event of a\n * burst. Next's production minifier compiles that self-calling loop away, so in a production\n * build the thumb moves once, sits while the content scrolls, and jumps when the next burst\n * starts. This writes the transform Radix would, at most once per frame. Nothing re-renders.\n *\n * Pass the hook's setter as a ref on `ScrollArea.Viewport`; the scrollbars are its siblings.\n */\nexport function useThumbSync<T extends HTMLElement>() {\n const [viewport, setViewport] = React.useState<T | null>(null);\n\n React.useEffect(() => {\n const root = viewport?.parentElement;\n if (!viewport || !root) return;\n let frame = 0;\n const write = () => {\n frame = 0;\n for (const thumb of root.querySelectorAll<HTMLElement>(':scope > .kui-ScrollAreaScrollbar > .kui-ScrollAreaThumb')) {\n const scrollbar = thumb.parentElement as HTMLElement;\n const style = getComputedStyle(scrollbar);\n if (scrollbar.dataset.orientation === 'horizontal') {\n const track = scrollbar.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);\n const offset = thumbOffset(viewport.scrollLeft, viewport.scrollWidth - viewport.offsetWidth, track - thumb.offsetWidth);\n thumb.style.transform = `translate3d(${offset}px, 0, 0)`;\n } else {\n const track = scrollbar.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n const offset = thumbOffset(viewport.scrollTop, viewport.scrollHeight - viewport.offsetHeight, track - thumb.offsetHeight);\n thumb.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n }\n };\n const schedule = () => {\n if (!frame) frame = requestAnimationFrame(write);\n };\n viewport.addEventListener('scroll', schedule, { passive: true });\n return () => {\n if (frame) cancelAnimationFrame(frame);\n viewport.removeEventListener('scroll', schedule);\n };\n }, [viewport]);\n\n return setViewport;\n}\n\n/** Radix's mapping: scroll position over its range, onto the room the thumb has to travel. */\nfunction thumbOffset(position: number, range: number, travel: number) {\n if (range <= 0 || travel <= 0) return 0;\n // Right-to-left scrolls run from -range to 0; the thumb then travels from -travel to 0.\n const clamped = Math.min(Math.max(position, -range), range);\n return (clamped / range) * travel;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { GetPropDefTypes, PropDef } from './prop-def.js';\n\nconst widthPropDefs = {\n /**\n * Sets the CSS **width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * width=\"100px\"\n * width={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/width\n */\n width: {\n type: 'string',\n className: 'kui-r-w',\n customProperties: ['--width'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minWidth=\"100px\"\n * minWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\n */\n minWidth: {\n type: 'string',\n className: 'kui-r-min-w',\n customProperties: ['--min-width'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-width** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxWidth=\"100px\"\n * maxWidth={{ md: '100vw', xl: '1400px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n */\n maxWidth: {\n type: 'string',\n className: 'kui-r-max-w',\n customProperties: ['--max-width'],\n responsive: true,\n },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype WidthProps = GetPropDefTypes<typeof widthPropDefs>;\n\nexport { widthPropDefs };\nexport type { WidthProps };\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\nconst heightPropDefs = {\n /**\n * Sets the CSS **height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * height=\"100px\"\n * height={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/height\n */\n height: {\n type: 'string',\n className: 'kui-r-h',\n customProperties: ['--height'],\n responsive: true,\n },\n /**\n * Sets the CSS **min-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * minHeight=\"100px\"\n * minHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\n */\n minHeight: {\n type: 'string',\n className: 'kui-r-min-h',\n customProperties: ['--min-height'],\n responsive: true,\n },\n /**\n * Sets the CSS **max-height** property.\n * Supports CSS strings and responsive objects.\n *\n * @example\n * maxHeight=\"100px\"\n * maxHeight={{ md: '100vh', xl: '600px' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\n */\n maxHeight: {\n type: 'string',\n className: 'kui-r-max-h',\n customProperties: ['--max-height'],\n responsive: true,\n },\n} satisfies {\n height: PropDef<string>;\n minHeight: PropDef<string>;\n maxHeight: PropDef<string>;\n};\n\ntype HeightProps = GetPropDefTypes<typeof heightPropDefs>;\n\nexport { heightPropDefs };\nexport type { HeightProps };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { colorPropDef } from '../../props/color.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\nconst submenuBehaviors = ['cascade', 'drill-down'] as const;\n\n// Base props shared between Content and SubContent\nconst baseMenuSharedPropDefs = {\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n ...colorPropDef,\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\n// Content-specific props (includes submenuBehavior)\nconst baseMenuContentPropDefs = {\n ...baseMenuSharedPropDefs,\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior: {\n type: 'enum',\n values: submenuBehaviors,\n default: 'cascade',\n responsive: true,\n },\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n submenuBehavior: PropDef<(typeof submenuBehaviors)[number]>;\n};\n\n// SubContent props (no submenuBehavior)\nconst baseMenuSubContentPropDefs = baseMenuSharedPropDefs;\n\nconst baseMenuItemPropDefs = {\n ...asChildPropDef,\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuCheckboxItemPropDefs = {\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuRadioItemPropDefs = {\n ...colorPropDef,\n};\n\nexport {\n baseMenuContentPropDefs,\n baseMenuSubContentPropDefs,\n baseMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs,\n submenuBehaviors,\n};\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slot } from 'radix-ui';\n\nimport { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';\nimport { ThemeSizeContext } from '../hooks/theme-size.js';\nimport { usePropSyncedState } from '../hooks/use-prop-synced-state.js';\nimport { themePropDefs } from './theme.props.js';\n\nimport type { ThemeOwnProps } from './theme.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\nconst noop = () => {};\n\ntype ThemeAppearance = (typeof themePropDefs.appearance.values)[number];\ntype ThemeAccentColor = (typeof themePropDefs.accentColor.values)[number];\ntype ThemeGrayColor = (typeof themePropDefs.grayColor.values)[number];\ntype ThemeRadius = (typeof themePropDefs.radius.values)[number];\ntype ThemeFontFamily = (typeof themePropDefs.fontFamily.values)[number];\ntype ThemeSize = (typeof themePropDefs.size.values)[number];\n// Headings follow the body font until something sets this, so `undefined` is a\n// meaningful value here rather than a missing one.\ntype ThemeHeadingFontFamily = ThemeFontFamily | undefined;\n\ninterface ThemeChangeHandlers {\n onAppearanceChange: (appearance: ThemeAppearance) => void;\n onAccentColorChange: (accentColor: ThemeAccentColor) => void;\n onGrayColorChange: (grayColor: ThemeGrayColor) => void;\n onRadiusChange: (radius: ThemeRadius) => void;\n onFontFamilyChange: (fontFamily: ThemeFontFamily) => void;\n onHeadingFontFamilyChange: (headingFontFamily: ThemeHeadingFontFamily) => void;\n onSizeChange: (size: ThemeSize) => void;\n}\n\ninterface ThemeContextValue extends ThemeChangeHandlers {\n appearance: ThemeAppearance;\n accentColor: ThemeAccentColor;\n grayColor: ThemeGrayColor;\n resolvedGrayColor: ThemeGrayColor;\n radius: ThemeRadius;\n fontFamily: ThemeFontFamily;\n headingFontFamily: ThemeHeadingFontFamily;\n size: ThemeSize;\n}\n// Default theme values used when components render outside a Theme provider\nconst defaultThemeContext: ThemeContextValue = {\n appearance: themePropDefs.appearance.default,\n accentColor: themePropDefs.accentColor.default,\n grayColor: themePropDefs.grayColor.default,\n resolvedGrayColor: themePropDefs.grayColor.default,\n radius: themePropDefs.radius.default,\n fontFamily: themePropDefs.fontFamily.default,\n headingFontFamily: undefined,\n size: themePropDefs.size.default,\n onAppearanceChange: noop,\n onAccentColorChange: noop,\n onGrayColorChange: noop,\n onRadiusChange: noop,\n onFontFamilyChange: noop,\n onHeadingFontFamilyChange: noop,\n onSizeChange: noop,\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | undefined>(undefined);\n\nfunction useThemeContext() {\n const context = React.useContext(ThemeContext);\n // Return default context if used outside Theme provider (e.g., during SSR)\n return context ?? defaultThemeContext;\n}\n\ninterface ThemeProps extends ThemeImplPublicProps {}\nconst Theme = React.forwardRef<ThemeImplElement, ThemeProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n // Direction is inherited: a Radix DirectionProvider above the Theme (for a right-to-left app)\n // wins, and left-to-right stays the default when there is none.\n const dir = Direction.useDirection();\n const isRoot = context === undefined;\n if (isRoot) {\n return (\n <Direction.Provider dir={dir}>\n <ThemeRoot {...props} ref={forwardedRef} />\n </Direction.Provider>\n );\n }\n return <ThemeImpl {...props} ref={forwardedRef} />;\n});\nTheme.displayName = 'Theme';\n\nconst ThemeRoot = React.forwardRef<ThemeImplElement, ThemeImplPublicProps>((props, forwardedRef) => {\n const {\n appearance: appearanceProp = themePropDefs.appearance.default,\n accentColor: accentColorProp = themePropDefs.accentColor.default,\n grayColor: grayColorProp = themePropDefs.grayColor.default,\n radius: radiusProp = themePropDefs.radius.default,\n fontFamily: fontFamilyProp = themePropDefs.fontFamily.default,\n headingFontFamily: headingFontFamilyProp,\n size: sizeProp = themePropDefs.size.default,\n hasBackground = themePropDefs.hasBackground.default,\n ...rootProps\n } = props;\n\n // Each of these follows its prop but stays independently settable, so\n // the context setters can change the theme at runtime. Syncing during render\n // rather than in an effect matters here: an effect would commit the old\n // theme first and re-render every consumer of the context a second time.\n const [appearance, setAppearance] = usePropSyncedState(appearanceProp);\n const [accentColor, setAccentColor] = usePropSyncedState(accentColorProp);\n const [grayColor, setGrayColor] = usePropSyncedState(grayColorProp);\n const [radius, setRadius] = usePropSyncedState(radiusProp);\n const [fontFamily, setFontFamily] = usePropSyncedState(fontFamilyProp);\n const [headingFontFamily, setHeadingFontFamily] = usePropSyncedState(headingFontFamilyProp);\n const [size, setSize] = usePropSyncedState(sizeProp);\n\n return (\n <ThemeImpl\n {...rootProps}\n ref={forwardedRef}\n isRoot\n hasBackground={hasBackground}\n //\n appearance={appearance}\n accentColor={accentColor}\n grayColor={grayColor}\n radius={radius}\n fontFamily={fontFamily}\n headingFontFamily={headingFontFamily}\n size={size}\n //\n onAppearanceChange={setAppearance}\n onAccentColorChange={setAccentColor}\n onGrayColorChange={setGrayColor}\n onRadiusChange={setRadius}\n onFontFamilyChange={setFontFamily}\n onHeadingFontFamilyChange={setHeadingFontFamily}\n onSizeChange={setSize}\n />\n );\n});\nThemeRoot.displayName = 'ThemeRoot';\n\ntype ThemeImplElement = React.ElementRef<'div'>;\ninterface ThemeImplProps extends ThemeImplPublicProps, ThemeImplPrivateProps {}\ninterface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {}\ninterface ThemeImplPrivateProps extends Partial<ThemeChangeHandlers> {\n isRoot?: boolean;\n}\nconst ThemeImpl = React.forwardRef<ThemeImplElement, ThemeImplProps>((props, forwardedRef) => {\n const context = React.useContext(ThemeContext);\n const {\n asChild,\n isRoot,\n hasBackground: hasBackgroundProp,\n //\n appearance = props.appearance ?? context?.appearance ?? themePropDefs.appearance.default,\n accentColor = props.accentColor ?? context?.accentColor ?? themePropDefs.accentColor.default,\n grayColor = props.grayColor ?? context?.resolvedGrayColor ?? themePropDefs.grayColor.default,\n radius = props.radius ?? context?.radius ?? themePropDefs.radius.default,\n fontFamily = props.fontFamily ?? context?.fontFamily ?? themePropDefs.fontFamily.default,\n headingFontFamily = props.headingFontFamily ?? context?.headingFontFamily,\n size = props.size ?? context?.size ?? themePropDefs.size.default,\n // A nested Theme forwards changes to the one above it, so a switcher\n // inside a portal (Dialog, Popover, menus) still reaches the root.\n onAppearanceChange = context?.onAppearanceChange ?? noop,\n onAccentColorChange = context?.onAccentColorChange ?? noop,\n onGrayColorChange = context?.onGrayColorChange ?? noop,\n onRadiusChange = context?.onRadiusChange ?? noop,\n onFontFamilyChange = context?.onFontFamilyChange ?? noop,\n onHeadingFontFamilyChange = context?.onHeadingFontFamilyChange ?? noop,\n onSizeChange = context?.onSizeChange ?? noop,\n //\n ...themeProps\n } = props;\n const Comp = asChild ? Slot.Root : 'div';\n const resolvedGrayColor = grayColor === 'auto' ? getMatchingGrayColor(accentColor) : grayColor;\n const isExplicitAppearance = props.appearance === 'light' || props.appearance === 'dark';\n const hasBackground = hasBackgroundProp === undefined ? isRoot || isExplicitAppearance : hasBackgroundProp;\n\n return (\n <ThemeContext.Provider\n value={React.useMemo(\n () => ({\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n }),\n [\n appearance,\n accentColor,\n grayColor,\n resolvedGrayColor,\n radius,\n fontFamily,\n headingFontFamily,\n size,\n //\n onAppearanceChange,\n onAccentColorChange,\n onGrayColorChange,\n onRadiusChange,\n onFontFamilyChange,\n onHeadingFontFamilyChange,\n onSizeChange,\n ],\n )}\n >\n {/* Size travels on its own context as a bare string, so the components\n that read it do not re-render when another theme value changes. */}\n <ThemeSizeContext.Provider value={size}>\n <Comp\n data-is-root-theme={isRoot ? 'true' : 'false'}\n data-accent-color={accentColor}\n data-gray-color={resolvedGrayColor}\n // for nested `Theme` background\n data-has-background={hasBackground ? 'true' : 'false'}\n data-radius={radius}\n data-font-family={fontFamily}\n data-heading-font-family={headingFontFamily}\n ref={forwardedRef}\n {...themeProps}\n className={classNames(\n 'kui-theme',\n {\n light: appearance === 'light',\n dark: appearance === 'dark',\n },\n themeProps.className,\n )}\n />\n </ThemeSizeContext.Provider>\n </ThemeContext.Provider>\n );\n});\nThemeImpl.displayName = 'ThemeImpl';\n\nexport { Theme, ThemeContext, useThemeContext };\nexport type { ThemeProps, ThemeContextValue };\n", "import type { accentColors } from '../props/color.prop.js';\n\ntype ThemeAccentColor = (typeof accentColors)[number];\n\nexport function getMatchingGrayColor(accentColor: ThemeAccentColor) {\n switch (accentColor) {\n case 'tomato':\n case 'red':\n case 'ruby':\n case 'crimson':\n case 'pink':\n case 'plum':\n case 'purple':\n case 'violet':\n return 'mauve';\n case 'iris':\n case 'indigo':\n case 'blue':\n case 'sky':\n case 'cyan':\n return 'slate';\n case 'teal':\n case 'jade':\n case 'mint':\n case 'green':\n return 'sage';\n case 'grass':\n case 'lime':\n return 'olive';\n case 'yellow':\n case 'amber':\n case 'orange':\n case 'brown':\n case 'gold':\n case 'bronze':\n return 'sand';\n case 'gray':\n return 'gray';\n }\n}\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n", "import * as React from 'react';\n\n/**\n * State that tracks a prop but can also be set imperatively \u2014 the shape `Theme`\n * needs, where a prop sets the value and the context setters can change it at runtime.\n *\n * Adjusts state during render rather than syncing in a `useEffect`. An effect\n * would commit one render carrying the *old* value and schedule a second one,\n * which for a provider means every consumer renders twice and the browser can\n * paint the stale value in between.\n *\n * @see https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\nexport function usePropSyncedState<T>(propValue: T) {\n const [value, setValue] = React.useState(propValue);\n const [previousPropValue, setPreviousPropValue] = React.useState(propValue);\n\n if (!Object.is(propValue, previousPropValue)) {\n setPreviousPropValue(propValue);\n setValue(propValue);\n }\n\n return [value, setValue] as const;\n}\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { accentColors, grayColors } from '../props/color.prop.js';\nimport { radii } from '../props/radius.prop.js';\n\nimport type { GetPropDefTypes, PropDef } from '../props/prop-def.js';\n\nconst appearances = ['inherit', 'light', 'dark'] as const;\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst themePropDefs = {\n ...asChildPropDef,\n /**\n * Whether to apply background color to the Theme element.\n *\n * Defaults to true for the root Theme and for Theme elements that\n * have an explicit light or dark appearance prop.\n */\n hasBackground: { type: 'boolean', default: true },\n /**\n * Sets the color scheme of the theme, typcially referred to as light and dark mode.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/dark-mode\n */\n appearance: { type: 'enum', values: appearances, default: 'inherit' },\n /**\n * Selects one of the accent color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n accentColor: { type: 'enum', values: accentColors, default: 'gray' },\n /**\n * Selects one of the gray color options to use in the Theme.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/color\n */\n grayColor: { type: 'enum', values: grayColors, default: 'gray' },\n /**\n * Sets the default radius of the components.\n *\n * @link\n * https://www.radix-ui.com/themes/docs/theme/visual-style\n */\n radius: { type: 'enum', values: radii, default: 'full' },\n /**\n * Sets the font family used for body text in the theme.\n *\n * Headings follow this unless `headingFontFamily` (or the `--font-heading`\n * token) says otherwise.\n *\n * @default 'sans'\n */\n fontFamily: { type: 'enum', values: fontFamilies, default: 'sans' },\n /**\n * Sets the font family used for `Heading`, independently of body text.\n *\n * Deliberately has no default: when it is left unset no attribute is\n * emitted and `--font-heading` keeps following `--font-body`, so a\n * `--font-heading` override in your own CSS survives a `fontFamily` switch.\n */\n headingFontFamily: { type: 'enum', values: fontFamilies },\n /**\n * The app-wide size index. Every component on the 1-4 control and surface\n * scale that states no `size` of its own takes this one; an explicit\n * `size` always wins. Nested Themes override it for their subtree.\n *\n * @default '2'\n */\n size: { type: 'enum', values: sizes, default: '2' },\n} satisfies {\n hasBackground: PropDef<boolean>;\n appearance: PropDef<(typeof appearances)[number]>;\n accentColor: PropDef<(typeof accentColors)[number]>;\n grayColor: PropDef<(typeof grayColors)[number]>;\n radius: PropDef<(typeof radii)[number]>;\n fontFamily: PropDef<(typeof fontFamilies)[number]>;\n headingFontFamily: PropDef<(typeof fontFamilies)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\ntype ThemeOwnProps = GetPropDefTypes<typeof themePropDefs & typeof asChildPropDef>;\n\nexport { themePropDefs };\nexport type { ThemeOwnProps };\n", "import * as React from 'react';\n\nimport { Theme } from '../theme.js';\nimport { PaneBandSizeContext } from './pane-band-context.js';\n\n/**\n * The Theme at the root of a portalled surface (Popover, Dialog, Sheet, menus, Tooltip). The\n * surface renders outside any Shell pane even though context flows into it, so a Toolbar in it\n * does not take the pane's band size. A `Theme asChild` an app nests in a pane keeps the band.\n */\nconst PortalTheme = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<typeof Theme>>((props, forwardedRef) => (\n <PaneBandSizeContext.Provider value={null}>\n <Theme {...props} ref={forwardedRef} />\n </PaneBandSizeContext.Provider>\n));\nPortalTheme.displayName = 'PortalTheme';\n\nexport { PortalTheme };\n", "import * as React from 'react';\n\ntype BandSize = '1' | '2' | '3' | '4';\n\n/**\n * Set by `Shell.PaneHeader` and `Shell.PaneFooter` to their band size, and by `Shell.Scroll` to\n * null (a scrolling list has no band). `PortalTheme`, the root of every portalled surface\n * (Popover, Dialog, Sheet, menus), sets null too, so a Toolbar in one does not take the Shell's\n * step; a `Theme asChild` an app nests in a pane leaves it alone. `Shell.Root` clears it again.\n * Unset (`undefined`) everywhere else.\n *\n * Its own module so PortalTheme can reset it without bringing the Shell.\n */\nconst PaneBandSizeContext = React.createContext<BandSize | null | undefined>(undefined);\n\nexport { PaneBandSizeContext };\nexport type { BandSize };\n", "import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n});\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\n/** The tick a button shows in place of its icon while `done`. Drawn on the 24 grid at the icon set's stroke. */\nconst TickIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path d=\"M5 12.75L9.5 17.25L19 7.25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n});\nTickIcon.displayName = 'TickIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon, TickIcon };\n", "'use client';\n\nimport * as React from 'react';\n\nimport type { submenuBehaviors } from './base-menu.props.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/*\n * Drill-down navigation for DropdownMenu.\n *\n * The stack of open submenus lives in a small external store rather than in\n * React state, so each part subscribes only to the slice it renders from:\n * a panel re-renders when it enters or leaves the stack, a Sub when its own\n * open state changes, and nothing else on the path re-renders on navigation.\n *\n * Only the levels on the stack mount their children, and only the top level\n * mounts its items (see `DrillDownLevelContext`). That keeps the Radix item\n * collection limited to what is on screen, so roving focus and typeahead\n * never land on a hidden item.\n */\n\ntype Modality = 'keyboard' | 'pointer';\n\ninterface StackEntry {\n id: string;\n /** Accessible name of the submenu, taken from its trigger text */\n name: string;\n /** Scroll position of the parent level when this entry was pushed */\n scrollTop: number;\n}\n\ntype LastChange =\n | { type: 'push'; id: string; modality: Modality | null }\n | { type: 'pop'; id: string; modality: Modality | null; scrollTop: number }\n | { type: 'reset' };\n\ninterface DrillDownState {\n stack: StackEntry[];\n lastChange: LastChange | null;\n}\n\nconst INITIAL_STATE: DrillDownState = { stack: [], lastChange: null };\n\nconst PANEL_ITEM_SELECTOR = '[role^=\"menuitem\"]:not([data-disabled])';\nconst BACK_ITEM_CLASS = 'kui-DropdownMenuDrillDownBackItem';\n\nfunction escapeAttributeValue(value: string) {\n return value.replace(/[\"\\\\]/g, '\\\\$&');\n}\n\nclass DrillDownStore {\n private state = INITIAL_STATE;\n private listeners = new Set<() => void>();\n private modality: Modality = 'keyboard';\n /**\n * Controlled submenus. A request to open or close one of them goes to its\n * `onOpenChange` instead of the stack; its `open` prop then moves the stack.\n */\n private controllers = new Map<string, (open: boolean) => void>();\n private pendingModality = new Map<string, Modality | null>();\n /** The drill-down root element, set by the provider */\n rootElement: HTMLElement | null = null;\n\n setRootElement = (element: HTMLElement | null) => {\n this.rootElement = element;\n };\n\n getState = () => this.state;\n\n subscribe = (listener: () => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n private setState(next: DrillDownState) {\n this.state = next;\n this.listeners.forEach((listener) => listener());\n }\n\n /** Records how the user is interacting, so focus can follow the same model as Radix. */\n setModality = (modality: Modality) => {\n this.modality = modality;\n };\n\n getModality = () => this.modality;\n\n getDepth = () => this.state.stack.length;\n\n isOpen = (id: string) => this.state.stack.some((entry) => entry.id === id);\n\n setController = (id: string, onOpenChange: ((open: boolean) => void) | null) => {\n if (onOpenChange) this.controllers.set(id, onOpenChange);\n else this.controllers.delete(id);\n };\n\n /** The modality of the last open or close request for a controlled submenu. */\n takePendingModality = (id: string) => {\n const modality = this.pendingModality.get(id) ?? null;\n this.pendingModality.delete(id);\n return modality;\n };\n\n private request(id: string, open: boolean, modality: Modality | null) {\n const controller = this.controllers.get(id);\n if (!controller) return false;\n this.pendingModality.set(id, modality);\n controller(open);\n return true;\n }\n\n private getScrollContainer() {\n const root = this.rootElement;\n if (!root) return null;\n return (\n root.closest<HTMLElement>('.kui-ScrollAreaViewport') ??\n root.closest<HTMLElement>('.kui-BaseMenuViewport')\n );\n }\n\n private getTrigger(id: string) {\n return this.rootElement?.querySelector<HTMLElement>(\n `[data-drill-down-trigger=\"${escapeAttributeValue(id)}\"]`,\n );\n }\n\n /**\n * Opens a submenu. `modality` decides where focus goes: the first item for\n * keyboard, the menu for pointer, and nowhere for a programmatic open\n * (`null`) unless focus was lost.\n */\n push = (id: string, modality: Modality | null = this.modality) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n if (this.request(id, true, modality)) return;\n this.open(id, modality);\n };\n\n /** Puts a submenu on the stack, bypassing its controller. */\n open = (id: string, modality: Modality | null = null) => {\n const { stack } = this.state;\n if (stack.some((entry) => entry.id === id)) return;\n const trigger = this.getTrigger(id);\n const name = (trigger?.dataset.drillDownName ?? trigger?.textContent ?? '').trim();\n const scrollTop = this.getScrollContainer()?.scrollTop ?? 0;\n this.setState({\n stack: [...stack, { id, name, scrollTop }],\n lastChange: { type: 'push', id, modality },\n });\n };\n\n pop = (modality: Modality = this.modality) => {\n const { stack } = this.state;\n const top = stack[stack.length - 1];\n if (!top) return;\n if (this.request(top.id, false, modality)) return;\n this.setState({\n stack: stack.slice(0, -1),\n lastChange: { type: 'pop', id: top.id, modality, scrollTop: top.scrollTop },\n });\n };\n\n /**\n * Closes a submenu and everything opened from it, bypassing its controller.\n * Focus moves to its trigger only for a keyboard close.\n */\n close = (id: string, modality: Modality | null = null) => {\n const { stack } = this.state;\n const index = stack.findIndex((entry) => entry.id === id);\n if (index === -1) return;\n this.setState({\n stack: stack.slice(0, index),\n lastChange: { type: 'pop', id, modality, scrollTop: stack[index].scrollTop },\n });\n };\n\n reset = () => {\n if (this.state.stack.length === 0) return;\n this.setState({ stack: [], lastChange: { type: 'reset' } });\n };\n\n /**\n * Moves focus and scroll after a navigation step has been committed. Runs in\n * a layout effect, so the new level is already in the DOM and nothing paints\n * with focus on `<body>` or at the old scroll position.\n */\n applyLastChange() {\n const change = this.state.lastChange;\n const root = this.rootElement;\n if (!change || !root) return;\n this.state = { ...this.state, lastChange: null };\n\n const content = root.closest<HTMLElement>('[role=\"menu\"]');\n const scroller = this.getScrollContainer();\n const focus = (element: HTMLElement | null | undefined) => element?.focus({ preventScroll: true });\n\n if (change.type === 'push') {\n if (scroller) scroller.scrollTop = 0;\n const panel = root.querySelector<HTMLElement>(\n `[data-drill-down-panel=\"${escapeAttributeValue(change.id)}\"]`,\n );\n if (change.modality === 'keyboard') {\n // Land on the first real option; the back row stays one ArrowUp away.\n const items = panel ? Array.from(panel.querySelectorAll<HTMLElement>(PANEL_ITEM_SELECTOR)) : [];\n focus(items.find((item) => !item.classList.contains(BACK_ITEM_CLASS)) ?? items[0] ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n // Match Radix: pointer users get focus on the menu, not a highlighted item.\n focus(content);\n }\n return;\n }\n\n if (change.type === 'pop') {\n if (scroller) scroller.scrollTop = change.scrollTop;\n const trigger = this.getTrigger(change.id);\n if (change.modality === 'keyboard') {\n focus(trigger ?? content);\n } else if (change.modality === 'pointer' || !root.contains(document.activeElement)) {\n focus(content);\n }\n return;\n }\n\n if (scroller) scroller.scrollTop = 0;\n }\n}\n\nconst DrillDownStoreContext = React.createContext<DrillDownStore | null>(null);\n\n/**\n * Whether the items of the current level are on screen. The root level and\n * every panel provide it; menu parts render nothing when it is false.\n */\nconst DrillDownLevelContext = React.createContext(true);\n\nfunction useDrillDownStore() {\n return React.useContext(DrillDownStoreContext);\n}\n\nfunction useCreateDrillDownStore() {\n const [store] = React.useState(() => new DrillDownStore());\n return store;\n}\n\nconst selectDepth = (state: DrillDownState) => state.stack.length;\nconst getServerDepth = () => 0;\n\ninterface DrillDownRootProps {\n store: DrillDownStore;\n behavior: SubmenuBehavior;\n /** Open state of the menu; the stack resets every time the menu opens */\n open: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Provides the drill-down store and renders the root level. The wrapper is\n * the same element in both behaviors, so crossing a breakpoint that switches\n * between cascade and drill-down does not remount the items.\n */\nfunction DrillDownRoot({ store, behavior, open, children }: DrillDownRootProps) {\n const isDrillDown = behavior === 'drill-down';\n const depth = React.useSyncExternalStore(\n store.subscribe,\n () => selectDepth(store.getState()),\n getServerDepth,\n );\n const isRoot = !isDrillDown || depth === 0;\n\n // Cascade mode has no stack. A reset while switching modes keeps the next\n // switch back to drill-down from resuming a stale level.\n React.useLayoutEffect(() => {\n if (!isDrillDown) store.reset();\n }, [isDrillDown, store]);\n\n // Start every opening at the root. Content usually remounts on open anyway;\n // this covers `forceMount`. Resetting on open rather than on close keeps the\n // closing animation on the level the user was looking at.\n const wasOpenRef = React.useRef(open);\n React.useLayoutEffect(() => {\n if (open && !wasOpenRef.current) store.reset();\n wasOpenRef.current = open;\n }, [open, store]);\n\n // Focus and scroll follow each navigation step once it is in the DOM.\n React.useLayoutEffect(() => {\n store.applyLastChange();\n }, [depth, store]);\n\n const rootRef = React.useCallback((element: HTMLDivElement | null) => store.setRootElement(element), [store]);\n const handleKeyDownCapture = React.useCallback(() => store.setModality('keyboard'), [store]);\n const handlePointerDownCapture = React.useCallback(() => store.setModality('pointer'), [store]);\n\n return (\n <DrillDownStoreContext.Provider value={isDrillDown ? store : null}>\n {/* Event capture only records the input modality; it does not handle interaction. */}\n <div\n ref={rootRef}\n className=\"kui-DropdownMenuDrillDownRoot\"\n data-submenu-behavior={behavior}\n data-drill-down-active={isRoot ? undefined : true}\n onKeyDownCapture={isDrillDown ? handleKeyDownCapture : undefined}\n onPointerDownCapture={isDrillDown ? handlePointerDownCapture : undefined}\n >\n <DrillDownLevelContext.Provider value={isRoot}>{children}</DrillDownLevelContext.Provider>\n </div>\n </DrillDownStoreContext.Provider>\n );\n}\n\n/** Where a submenu sits in the stack: not open, open under another level, or on top. */\ntype PanelPosition = 'closed' | 'open' | 'top';\n\nfunction usePanelPosition(store: DrillDownStore | null, id: string): PanelPosition {\n const getSnapshot = React.useCallback((): PanelPosition => {\n if (!store) return 'closed';\n const { stack } = store.getState();\n if (stack.length > 0 && stack[stack.length - 1].id === id) return 'top';\n return stack.some((entry) => entry.id === id) ? 'open' : 'closed';\n }, [store, id]);\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getClosed);\n}\n\nfunction useStackEntry(store: DrillDownStore | null, id: string): StackEntry | undefined {\n const getSnapshot = React.useCallback(\n () => store?.getState().stack.find((entry) => entry.id === id),\n [store, id],\n );\n return React.useSyncExternalStore(store?.subscribe ?? noopSubscribe, getSnapshot, getUndefined);\n}\n\nconst noopSubscribe = () => () => {};\nconst getClosed = (): PanelPosition => 'closed';\nconst getUndefined = () => undefined;\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownRoot,\n DrillDownLevelContext,\n SubContext,\n useCreateDrillDownStore,\n useDrillDownStore,\n usePanelPosition,\n useStackEntry,\n useSubContext,\n};\n\nexport type { SubmenuBehavior, DrillDownStore, PanelPosition, SubContextValue };\n", "'use client';\n\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\n\nimport { useResolvedResponsiveValue } from './base-menu.utils.js';\n\nimport type { Responsive } from '../../props/prop-def.js';\n\n/**\n * Context to detect if a component is rendered inside a menu (DropdownMenu, ContextMenu, etc.)\n * Used by VirtualMenu to adjust its behavior:\n * - Skip role=\"menu\" when inside a parent menu (parent owns the role)\n * - Delegate certain keyboard handling to parent\n * - Use the correct item height based on menu size\n */\n\nexport type MenuSize = '1' | '2' | '3' | '4';\n\ninterface MenuContextValue {\n /** Whether we're inside a menu that owns the menu role */\n isInsideMenu: boolean;\n /** Menu size for the current breakpoint */\n size?: MenuSize;\n /** Item height in px for the current size and theme scaling */\n itemHeight?: number;\n}\n\nconst MenuContext = React.createContext<MenuContextValue>({ isInsideMenu: false });\n\n/** The register function of the menu Group a Label sits in (see useMenuGroupLabelId). */\nconst MenuGroupLabelContext = React.createContext<((id: string | null) => void) | null>(null);\n\ninterface MenuProviderProps {\n children: React.ReactNode;\n /** Menu size passed from parent (DropdownMenu.Content, ContextMenu.Content, etc.) */\n size?: Responsive<MenuSize>;\n}\n\n/**\n * Menu row height in pixels per size: the line height plus --row-inset-N above and below\n * (base-menu.css), never under the 24px target floor.\n */\nexport const menuSizeToItemHeight: Record<MenuSize, number> = {\n '1': 24,\n '2': 30,\n '3': 34,\n '4': 38,\n};\n\nexport function getMenuItemHeight(size: MenuSize): number {\n return menuSizeToItemHeight[size];\n}\n\nexport function MenuProvider({ children, size }: MenuProviderProps) {\n const resolvedSize = useResolvedResponsiveValue<MenuSize | undefined>(size, undefined);\n const itemHeight = resolvedSize ? getMenuItemHeight(resolvedSize) : undefined;\n const value = React.useMemo(\n () => ({ isInsideMenu: true, size: resolvedSize, itemHeight }),\n [resolvedSize, itemHeight],\n );\n // A submenu is its own surface, so its labels never name a group of the parent menu.\n return (\n <MenuContext.Provider value={value}>\n <MenuGroupLabelContext.Provider value={null}>{children}</MenuGroupLabelContext.Provider>\n </MenuContext.Provider>\n );\n}\n\nexport function useMenuContext() {\n return React.useContext(MenuContext);\n}\n\n/**\n * Closes the whole menu from inside it. DropdownMenu.Root and ContextMenu.Root provide it,\n * so a VirtualMenu row can close the menu on select the way a menu item does.\n */\nconst MenuCloseContext = React.createContext<(() => void) | undefined>(undefined);\nexport const MenuCloseProvider = MenuCloseContext.Provider;\n\nexport function useMenuClose() {\n return React.useContext(MenuCloseContext);\n}\n\n/**\n * Names a menu group by its label, the way v2's MenuGroup does. A Group holds the id of\n * the Label inside it and points aria-labelledby at it, so a screen reader announces the\n * section name when focus enters the group.\n */\nexport const MenuGroupLabelProvider = MenuGroupLabelContext.Provider;\n\n/** For a Group: the id its aria-labelledby points to, and the setter a nested Label calls. */\nexport function useMenuGroupLabelledBy(ariaLabelledBy: string | undefined) {\n const [labelId, setLabelId] = React.useState<string | null>(null);\n return [ariaLabelledBy ?? labelId ?? undefined, setLabelId] as const;\n}\n\n/** For a Label: its id, registered with the Group it sits in while the label is rendered. */\nexport function useMenuGroupLabelId(idProp: string | undefined, rendered = true) {\n const register = React.useContext(MenuGroupLabelContext);\n const generatedId = React.useId();\n const id = idProp ?? generatedId;\n useLayoutEffect(() => {\n if (!register || !rendered) return;\n register(id);\n return () => register(null);\n }, [register, id, rendered]);\n return register ? id : idProp;\n}\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Kbd } from '../kbd.js';\nimport { useBreakpoint } from '../../hooks/use-breakpoint.js';\n\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\n\nconst BREAKPOINTS_DESCENDING: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n\n/**\n * Resolves a responsive value for the given breakpoint, falling back through\n * the smaller breakpoints when the current one is not set.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T,\n): T {\n if (value === undefined || value === null) return defaultValue;\n if (typeof value !== 'object') return value;\n\n const map = value as Partial<Record<Breakpoint, T>>;\n for (let i = BREAKPOINTS_DESCENDING.indexOf(currentBreakpoint); i < BREAKPOINTS_DESCENDING.length; i++) {\n const resolved = map[BREAKPOINTS_DESCENDING[i]];\n if (resolved !== undefined) return resolved;\n }\n return defaultValue;\n}\n\n/**\n * Resolves a possibly responsive value against the current viewport. Only a\n * responsive object subscribes to breakpoint changes; a plain value costs\n * nothing.\n */\nfunction useResolvedResponsiveValue<T>(value: Responsive<T> | undefined, defaultValue: T): T {\n const isResponsive = typeof value === 'object' && value !== null;\n const { breakpoint } = useBreakpoint(isResponsive);\n return resolveResponsiveValue(value as T | Partial<Record<Breakpoint, T>> | undefined, breakpoint, defaultValue);\n}\n\n/** Content padding per menu size, in px (see base-menu.css). */\n// The panel padding ladder (--panel-p-N).\nconst CONTENT_PADDING: Record<string, number> = { '1': 8, '2': 12, '3': 16, '4': 24 };\n\n/**\n * Offset that lines the first item of a menu up with its anchor: the pointer\n * for a context menu, or the sub trigger for a submenu. It cancels the content\n * padding.\n */\nfunction getMenuAlignOffset(size: string): number {\n return -(CONTENT_PADDING[size] ?? CONTENT_PADDING['2']);\n}\n\nconst KEY_SYMBOLS: Record<string, string> = {\n '\u2318': 'Meta',\n cmd: 'Meta',\n command: 'Meta',\n meta: 'Meta',\n '\u2325': 'Alt',\n option: 'Alt',\n opt: 'Alt',\n alt: 'Alt',\n '\u21E7': 'Shift',\n shift: 'Shift',\n '\u2303': 'Control',\n ctrl: 'Control',\n control: 'Control',\n '\u232B': 'Backspace',\n '\u2326': 'Delete',\n '\u23CE': 'Enter',\n '\u21B5': 'Enter',\n '\u238B': 'Escape',\n esc: 'Escape',\n '\u21E5': 'Tab',\n '\u2191': 'ArrowUp',\n '\u2193': 'ArrowDown',\n '\u2190': 'ArrowLeft',\n '\u2192': 'ArrowRight',\n};\n\nconst ariaKeyShortcutsCache = new Map<string, string>();\n\n/**\n * Converts a display shortcut such as \"\u2318 \u21E7 P\" or \"Ctrl+S\" into the\n * `aria-keyshortcuts` format (\"Meta+Shift+P\", \"Control+S\").\n */\nfunction toAriaKeyShortcuts(shortcut: string): string | undefined {\n const cached = ariaKeyShortcutsCache.get(shortcut);\n if (cached !== undefined) return cached || undefined;\n\n // Modifier symbols are tokens of their own (\"\u2318\u21E7P\"); otherwise split on \"+\" and spaces.\n const tokens = shortcut.match(/[\u2318\u2325\u21E7\u2303]|[^\\s+\u2318\u2325\u21E7\u2303]+/gu) ?? [];\n const keys = tokens.map((token) => {\n const mapped = KEY_SYMBOLS[token] ?? KEY_SYMBOLS[token.toLowerCase()];\n return mapped ?? (token.length === 1 ? token.toUpperCase() : token);\n });\n const result = keys.join('+');\n ariaKeyShortcutsCache.set(shortcut, result);\n return result || undefined;\n}\n\n/**\n * The keyboard shortcut hint at the end of a menu item. It is hidden from\n * assistive technology because the item exposes it through\n * `aria-keyshortcuts` instead of reading it as part of the item name.\n */\nfunction MenuShortcut({ shortcut, className }: { shortcut: string; className?: string }) {\n return (\n <div aria-hidden className={classNames('kui-BaseMenuShortcut', className)}>\n <Kbd size=\"1\">{shortcut}</Kbd>\n </div>\n );\n}\n\nexport {\n resolveResponsiveValue,\n useResolvedResponsiveValue,\n getMenuAlignOffset,\n toAriaKeyShortcuts,\n MenuShortcut,\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { kbdPropDefs } from './kbd.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype KbdElement = React.ElementRef<'kbd'>;\ntype KbdOwnProps = GetPropDefTypes<typeof kbdPropDefs>;\ninterface KbdProps extends ComponentPropsWithout<'kbd', RemovedProps>, KbdOwnProps {}\nconst Kbd = React.forwardRef<KbdElement, KbdProps>((props, forwardedRef) => {\n const { asChild, className, ...kbdProps } = extractProps(props, kbdPropDefs);\n const Comp = asChild ? Slot.Root : 'kbd';\n return (\n <Comp\n {...kbdProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-Kbd', className)}\n />\n );\n});\nKbd.displayName = 'Kbd';\n\nexport { Kbd };\nexport type { KbdProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['raised', 'soft'] as const;\n\nconst kbdPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n variant: {\n type: 'enum',\n className: 'kui-variant',\n values: variants,\n default: 'raised',\n },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { kbdPropDefs };\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n", "import * as React from 'react';\n\n/** A function that throws an error when a value isn't a valid React Element, otherwise returns the value */\nexport const requireReactElement = <T extends React.ReactNode>(children: T): T => {\n const isReactElement = React.isValidElement(children);\n\n if (!isReactElement) {\n throw Error(\n `Expected a single React Element child, but got: ${React.Children.toArray(children)\n .map((child) =>\n typeof child === 'object' && 'type' in child && typeof child.type === 'string'\n ? child.type\n : typeof child\n )\n .join(', ')}`\n );\n }\n\n return children;\n};\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { popoverContentPropDefs } from './popover.props.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { NavigatorHostContext, type NavigatorHost } from './_internal/navigator-host.js';\n\nimport type { PopoverContentOwnProps } from './popover.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// ---------------------------------------------\n// Popover Content Context\n// ---------------------------------------------\ntype PopoverContentContextValue = {\n /** Wire up aria-labelledby for toolbar title */\n setLabelId: (id: string | undefined) => void;\n};\n\nconst PopoverContentContext = React.createContext<PopoverContentContextValue | null>(null);\nconst usePopoverContentContext = (caller: string) => {\n const ctx = React.useContext(PopoverContentContext);\n if (!ctx) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`${caller} must be used within Popover.Content`);\n }\n }\n return ctx;\n};\n\ninterface PopoverRootProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {}\n/** A Navigator screen's title names the popover through the content's label. */\nfunction PopoverNavigatorTitle({ children }: { children: React.ReactElement<{ id?: string }> }) {\n const setLabelId = usePopoverContentContext('Navigator')?.setLabelId;\n const id = React.useId();\n React.useEffect(() => {\n setLabelId?.(id);\n return () => setLabelId?.(undefined);\n }, [id, setLabelId]);\n return React.cloneElement(children, { id });\n}\n\nconst popoverNavigatorHost: NavigatorHost = {\n Title: PopoverNavigatorTitle,\n Close: ({ children }) => <PopoverPrimitive.Close asChild>{children}</PopoverPrimitive.Close>,\n};\n\nconst PopoverRoot: React.FC<PopoverRootProps> = (props: PopoverRootProps) => (\n <PopoverPrimitive.Root {...props} />\n);\nPopoverRoot.displayName = 'Popover.Root';\n\ntype PopoverTriggerElement = React.ElementRef<typeof PopoverPrimitive.Trigger>;\ninterface PopoverTriggerProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Trigger, RemovedProps> {}\nconst PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <PopoverPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </PopoverPrimitive.Trigger>\n ),\n);\nPopoverTrigger.displayName = 'Popover.Trigger';\n\ntype PopoverContentElement = React.ElementRef<typeof PopoverPrimitive.Content>;\ninterface PopoverContentProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Content, RemovedProps>,\n PopoverContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>['container'];\n}\nconst PopoverContent = React.forwardRef<PopoverContentElement, PopoverContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, popoverContentPropDefs.size);\n const {\n className,\n forceMount,\n container,\n ...contentProps\n } = extractProps(props, popoverContentPropDefs);\n\n const [labelId, setLabelId] = React.useState<string | undefined>(undefined);\n const contextValue = React.useMemo(() => ({ setLabelId }), []);\n\n return (\n <PopoverPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={8}\n collisionPadding={10}\n {...contentProps}\n ref={forwardedRef}\n // A Toolbar.Title names the panel; without one, the caller's own value stands.\n aria-labelledby={labelId ?? contentProps['aria-labelledby']}\n className={classNames('kui-PopperContent', 'kui-PopoverContent', className)}\n >\n <PopoverContentContext.Provider value={contextValue}>\n <NavigatorHostContext.Provider value={popoverNavigatorHost}>{props.children}</NavigatorHostContext.Provider>\n </PopoverContentContext.Provider>\n </PopoverPrimitive.Content>\n </PortalTheme>\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = 'Popover.Content';\n\ntype PopoverCloseElement = React.ElementRef<typeof PopoverPrimitive.Close>;\ninterface PopoverCloseProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Close, RemovedProps> {}\nconst PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <PopoverPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </PopoverPrimitive.Close>\n ),\n);\nPopoverClose.displayName = 'Popover.Close';\n\ntype PopoverAnchorElement = React.ElementRef<typeof PopoverPrimitive.Anchor>;\ninterface PopoverAnchorProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor> {}\nconst PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props, forwardedRef) => <PopoverPrimitive.Anchor {...props} ref={forwardedRef} />,\n);\n\nPopoverAnchor.displayName = 'Popover.Anchor';\n\n// ---------------------------------------------\n// Toolbar (Popover-only)\n// ---------------------------------------------\n\ntype PopoverToolbarElement = HTMLDivElement;\ntype PopoverToolbarProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst PopoverToolbarBase = React.forwardRef<PopoverToolbarElement, PopoverToolbarProps>(\n ({ className, children, ...props }, forwardedRef) => {\n // The toolbar is sticky in the content's own CSS, so it needs no measuring; this only warns\n // when it is used outside Popover.Content.\n usePopoverContentContext('Popover.Toolbar');\n\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-PopoverToolbar', className)}>\n {children}\n </div>\n );\n },\n);\nPopoverToolbarBase.displayName = 'Popover.Toolbar';\n\ntype PopoverToolbarSectionProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst PopoverToolbarLeft = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarLeft', className)}\n />\n ),\n);\nPopoverToolbarLeft.displayName = 'Popover.Toolbar.Left';\n\nconst PopoverToolbarCenter = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarCenter', className)}\n />\n ),\n);\nPopoverToolbarCenter.displayName = 'Popover.Toolbar.Center';\n\nconst PopoverToolbarRight = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarRight', className)}\n />\n ),\n);\nPopoverToolbarRight.displayName = 'Popover.Toolbar.Right';\n\ntype PopoverToolbarTitleProps = React.ComponentPropsWithoutRef<'span'>;\nconst PopoverToolbarTitle = React.forwardRef<HTMLSpanElement, PopoverToolbarTitleProps>(\n ({ className, id: idProp, ...props }, ref) => {\n const ctx = usePopoverContentContext('Popover.Toolbar.Title');\n const reactId = React.useId();\n const id = idProp ?? `kui-popover-toolbar-title-${reactId}`;\n React.useEffect(() => {\n ctx?.setLabelId(id);\n return () => ctx?.setLabelId(undefined);\n }, [ctx, id]);\n return (\n <span\n {...props}\n id={id}\n ref={ref}\n className={classNames('kui-PopoverToolbarTitle', className)}\n />\n );\n },\n);\nPopoverToolbarTitle.displayName = 'Popover.Toolbar.Title';\n\ntype PopoverToolbarComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<PopoverToolbarProps> & React.RefAttributes<HTMLDivElement>\n> & {\n Left: typeof PopoverToolbarLeft;\n Center: typeof PopoverToolbarCenter;\n Right: typeof PopoverToolbarRight;\n Title: typeof PopoverToolbarTitle;\n};\n\nconst PopoverToolbar = Object.assign(PopoverToolbarBase, {\n Left: PopoverToolbarLeft,\n Center: PopoverToolbarCenter,\n Right: PopoverToolbarRight,\n Title: PopoverToolbarTitle,\n}) as PopoverToolbarComponent;\n\nexport {\n PopoverRoot as Root,\n PopoverContent as Content,\n PopoverTrigger as Trigger,\n PopoverClose as Close,\n PopoverAnchor as Anchor,\n PopoverToolbar as Toolbar,\n};\nexport type {\n PopoverRootProps as RootProps,\n PopoverContentProps as ContentProps,\n PopoverTriggerProps as TriggerProps,\n PopoverCloseProps as CloseProps,\n PopoverAnchorProps as AnchorProps,\n PopoverToolbarProps as ToolbarProps,\n PopoverToolbarSectionProps as ToolbarSectionProps,\n PopoverToolbarTitleProps as ToolbarTitleProps,\n};\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { heightPropDefs } from '../props/height.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\n\nconst popoverContentPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '480px' },\n ...heightPropDefs,\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\ntype PopoverContentOwnProps = GetPropDefTypes<\n typeof popoverContentPropDefs &\n typeof asChildPropDef &\n typeof widthPropDefs &\n typeof heightPropDefs\n>;\n\nexport { popoverContentPropDefs };\nexport type { PopoverContentOwnProps };\n", "import * as React from 'react';\n\n/**\n * The overlay a Navigator screen sits in: a Dialog, a Sheet or a Popover. Its `Title` wraps the\n * screen's title so it names the panel, and its `Close` wraps the band's close button. Set by\n * each overlay's Content, which also tells the Navigator it is not in a Shell pane, even when\n * the overlay was opened from one.\n */\ntype NavigatorHost = {\n Title: React.ComponentType<{ children: React.ReactElement<{ id?: string }> }>;\n Close: React.ComponentType<{ children: React.ReactElement }>;\n};\n\nconst NavigatorHostContext = React.createContext<NavigatorHost | null>(null);\n\nexport { NavigatorHostContext };\nexport type { NavigatorHost };\n", "'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { separatorPropDefs } from './separator.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport { SHELL_BREAKPOINTS } from './shell.types.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SeparatorElement = React.ElementRef<'span'>;\ntype SeparatorOwnProps = GetPropDefTypes<typeof separatorPropDefs>;\ninterface SeparatorProps extends ComponentPropsWithout<'span', RemovedProps>, SeparatorOwnProps {}\ntype Orientation = 'horizontal' | 'vertical';\n\nconst Separator = React.forwardRef<SeparatorElement, SeparatorProps>((props, forwardedRef) => {\n const { className, color, decorative, ...separatorProps } = extractProps(props, separatorPropDefs);\n const responsive = typeof props.orientation === 'object' && props.orientation !== null;\n const { breakpoint } = useBreakpoint(responsive);\n\n // A responsive orientation announces the one drawn at the current breakpoint.\n let orientation: Orientation = 'horizontal';\n if (responsive) {\n const values = props.orientation as Partial<Record<string, Orientation>>;\n for (const bp of SHELL_BREAKPOINTS) {\n if (values[bp] !== undefined) orientation = values[bp]!;\n if (bp === breakpoint) break;\n }\n } else if (props.orientation === 'vertical') {\n orientation = 'vertical';\n }\n\n return (\n <span\n data-accent-color={color}\n role={decorative ? undefined : 'separator'}\n aria-orientation={decorative ? undefined : orientation}\n {...separatorProps}\n ref={forwardedRef}\n className={classNames('kui-Separator', className)}\n />\n );\n});\nSeparator.displayName = 'Separator';\n\nexport { Separator };\nexport type { SeparatorProps };\n", "import { colorPropDef } from '../props/color.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst orientationValues = ['horizontal', 'vertical'] as const;\n\nconst separatorPropDefs = {\n orientation: {\n type: 'enum',\n className: 'kui-r-orientation',\n values: orientationValues,\n default: 'horizontal',\n responsive: true,\n },\n color: { ...colorPropDef.color, default: 'gray' },\n decorative: { type: 'boolean', default: false },\n light: { type: 'boolean', className: 'kui-light', default: false },\n} satisfies {\n orientation: PropDef<(typeof orientationValues)[number]>;\n color: typeof colorPropDef.color;\n decorative: PropDef<boolean>;\n light: PropDef<boolean>;\n};\n\nexport { separatorPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { chipPropDefs } from './chip.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { Tooltip } from './tooltip.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ChipElement = React.ElementRef<'span'>;\ntype ChipOwnProps = GetPropDefTypes<typeof chipPropDefs>;\n\n// Tooltip props that can be passed to Chip\ninterface ChipTooltipProps {\n tooltip?: React.ReactNode;\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n tooltipAlign?: 'start' | 'center' | 'end';\n tooltipDelayDuration?: number;\n tooltipDisableHoverableContent?: boolean;\n}\n\ninterface ChipProps\n extends ComponentPropsWithout<'span', RemovedProps>,\n ChipOwnProps,\n ChipTooltipProps {}\n\nconst Chip = React.forwardRef<ChipElement, ChipProps>((props, forwardedRef) => {\n const {\n asChild,\n className,\n children,\n color,\n radius,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n ...chipProps\n } = extractProps(props, chipPropDefs);\n\n const Comp = asChild ? Slot.Root : 'span';\n\n const chip = (\n <Comp\n data-accent-color={color}\n data-radius={radius}\n // A tooltip opens on focus, so a chip that has one joins the tab order.\n tabIndex={tooltip ? 0 : undefined}\n {...chipProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-Chip', className)}\n >\n {children}\n </Comp>\n );\n\n // If no tooltip is provided, return the chip as-is\n if (!tooltip) {\n return chip;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n return (\n <Tooltip\n content={tooltip}\n side={tooltipSide}\n align={tooltipAlign}\n delayDuration={tooltipDelayDuration}\n disableHoverableContent={tooltipDisableHoverableContent}\n >\n {chip}\n </Tooltip>\n );\n});\nChip.displayName = 'Chip';\n\nexport { Chip };\nexport type { ChipProps };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { grayAccentColorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;\n\nconst chipPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n ...grayAccentColorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n};\n\nexport { chipPropDefs };\n", "import * as React from 'react';\nimport classNames from 'classnames';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\n\nimport { Text } from './text.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { tooltipPropDefs } from './tooltip.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\n/** The rest before a tooltip opens, in milliseconds. */\nconst TOOLTIP_DELAY = 200;\n\n/** True inside a `TooltipProvider`, so a Tooltip knows it need not bring its own. */\nconst TooltipProviderContext = React.createContext(false);\n\ninterface TooltipProviderProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider> {}\n\n/**\n * Groups the tooltips inside it: the first one waits `delayDuration` (200ms), and the next ones\n * open at once while the pointer moves between them. Put it once near the root of the app.\n * A Tooltip outside one still works, with the same delay, but each one waits on its own.\n */\nfunction TooltipProvider({ delayDuration = TOOLTIP_DELAY, children, ...props }: TooltipProviderProps) {\n return (\n <TooltipProviderContext.Provider value={true}>\n <TooltipPrimitive.Provider delayDuration={delayDuration} {...props}>\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n );\n}\nTooltipProvider.displayName = 'TooltipProvider';\n\ntype TooltipElement = React.ElementRef<typeof TooltipPrimitive.Content>;\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs>;\ninterface TooltipProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>,\n ComponentPropsWithout<typeof TooltipPrimitive.Content, RemovedProps | 'content'>,\n TooltipOwnProps {\n content: React.ReactNode;\n container?: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Portal>['container'];\n}\nconst Tooltip = React.forwardRef<TooltipElement, TooltipProps>((props, forwardedRef) => {\n const {\n children,\n className,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n content,\n container,\n forceMount,\n ...tooltipContentProps\n } = extractProps(props, tooltipPropDefs);\n const rootProps = { open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent };\n const hasProvider = React.useContext(TooltipProviderContext);\n const tooltip = (\n <TooltipPrimitive.Root {...rootProps}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <TooltipPrimitive.Content\n sideOffset={4}\n collisionPadding={10}\n {...tooltipContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-TooltipContent', className)}\n >\n <Text as=\"p\" className=\"kui-TooltipText\" size=\"1\">\n {content}\n </Text>\n <TooltipPrimitive.Arrow className=\"kui-TooltipArrow\" />\n </TooltipPrimitive.Content>\n </PortalTheme>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n // Radix needs a provider above every tooltip. Outside a TooltipProvider, bring one.\n return hasProvider ? tooltip : <TooltipPrimitive.Provider delayDuration={TOOLTIP_DELAY}>{tooltip}</TooltipPrimitive.Provider>;\n});\nTooltip.displayName = 'Tooltip';\n\nexport { Tooltip, TooltipProvider };\nexport type { TooltipProps, TooltipProviderProps };\n", "import * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { textPropDefs } from './text.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype TextElement = React.ElementRef<'span'>;\ntype TextOwnProps = GetPropDefTypes<typeof textPropDefs>;\ninterface CommonTextProps extends TextOwnProps {}\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>;\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>;\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>;\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>;\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);\n\n// Pre-merge prop definitions at module level to avoid per-render allocation\n\nconst Text = React.memo(\n React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n className,\n asChild,\n as: Tag = 'span',\n color,\n ...textProps\n } = extractProps(props, textPropDefs);\n\n const combinedClassName = className ? `kui-Text ${className}` : 'kui-Text';\n\n if (asChild) {\n return (\n <Slot.Root\n data-accent-color={color}\n {...textProps}\n ref={forwardedRef}\n className={combinedClassName}\n >\n {children}\n </Slot.Root>\n );\n }\n\n return (\n <Tag\n data-accent-color={color}\n {...(textProps as React.HTMLAttributes<HTMLElement>)}\n ref={forwardedRef as any}\n className={combinedClassName}\n >\n {children}\n </Tag>\n );\n })\n);\nText.displayName = 'Text';\n\nexport { Text };\nexport type { TextProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst emphases = ['loud', 'medium', 'quiet'] as const;\n\n// Text-first components only (Text, Heading, Blockquote, Code).\n// No colour + emphasis reads the gray ink ladder; colour + emphasis reads the accent ink ladder.\n// Components that need a different default spread this def and override `default`.\nconst emphasisPropDef = {\n emphasis: {\n type: 'enum',\n className: 'kui-emphasis',\n values: emphases,\n default: undefined,\n },\n} satisfies {\n emphasis: PropDef<(typeof emphases)[number]>;\n};\n\nexport { emphasisPropDef, emphases };\n", "import type { PropDef } from './prop-def.js';\n\nconst leadingTrimValues = ['normal', 'start', 'end', 'both'] as const;\n\nconst leadingTrimPropDef = {\n trim: {\n type: 'enum',\n className: 'kui-r-lt',\n values: leadingTrimValues,\n responsive: true,\n },\n} satisfies {\n trim: PropDef<(typeof leadingTrimValues)[number]>;\n};\n\nexport { leadingTrimPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textAlignValues = ['left', 'center', 'right'] as const;\n\nconst textAlignPropDef = {\n align: {\n type: 'enum',\n className: 'kui-r-ta',\n values: textAlignValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof textAlignValues)[number]>;\n};\n\nexport { textAlignPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst textWrapValues = ['wrap', 'nowrap', 'pretty', 'balance'] as const;\n\nconst textWrapPropDef = {\n wrap: {\n type: 'enum',\n className: 'kui-r-tw',\n values: textWrapValues,\n responsive: true,\n },\n} satisfies {\n wrap: PropDef<(typeof textWrapValues)[number]>;\n};\n\nexport { textWrapPropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst truncatePropDef = {\n truncate: {\n type: 'boolean',\n className: 'kui-truncate',\n },\n} satisfies {\n truncate: PropDef<boolean>;\n};\n\nexport { truncatePropDef };\n", "import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n/** v2's three weights (\u00A715). No bold: a larger size or stronger emphasis says importance. */\nconst weights = ['regular', 'medium', 'semibold'] as const;\n\nconst weightPropDef = {\n weight: {\n type: 'enum',\n className: 'kui-r-weight',\n values: weights,\n responsive: true,\n },\n} satisfies {\n weight: PropDef<(typeof weights)[number]>;\n};\n\nexport { weightPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { emphasisPropDef } from '../props/emphasis.prop.js';\nimport { leadingTrimPropDef } from '../props/leading-trim.prop.js';\nimport { textAlignPropDef } from '../props/text-align.prop.js';\nimport { textWrapPropDef } from '../props/text-wrap.prop.js';\nimport { truncatePropDef } from '../props/truncate.prop.js';\nimport { fontFamilyPropDef } from '../props/font-family.prop.js';\nimport { weightPropDef } from '../props/weight.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst as = ['span', 'div', 'label', 'p'] as const;\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\nconst textPropDefs = {\n as: { type: 'enum', values: as, default: 'span' },\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: sizes,\n responsive: true,\n },\n ...fontFamilyPropDef,\n ...weightPropDef,\n ...textAlignPropDef,\n ...leadingTrimPropDef,\n ...truncatePropDef,\n ...textWrapPropDef,\n ...colorPropDef,\n ...emphasisPropDef,\n} satisfies {\n as: PropDef<(typeof as)[number]>;\n size: PropDef<(typeof sizes)[number]>;\n};\n\nexport { textPropDefs };\n", "import { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst tooltipPropDefs = {\n content: { type: 'ReactNode', required: true },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '360px' },\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n content: PropDef<React.ReactNode>;\n};\n\ntype TooltipOwnProps = GetPropDefTypes<typeof tooltipPropDefs & typeof widthPropDefs>;\n\nexport { tooltipPropDefs };\nexport type { TooltipOwnProps };\n", "'use client';\n\n/**\n * A pane's own chrome: a header row, a scrolling region and a footer row.\n *\n * Shell.Sidebar and Shell.Panel render these as `Shell.PaneHeader`, `Shell.Scroll` and\n * `Shell.PaneFooter`. The pane renders anything; with these parts it is the presentation, so\n * Sidebar's menu parts work inside it with no `Sidebar.Root`. The index comes from the nearest\n * Shell (`Shell.Root size`), or from a deprecated `Sidebar.Root` that still wraps them.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { ScrollArea } from '../scroll-area.js';\nimport { ShellStoreContext } from './shell-store.js';\nimport { PaneBandSizeContext, type BandSize } from './pane-band-context.js';\nimport { usePageScrollMedia } from './shell-page-scroll.js';\n\ntype PaneSize = '1' | '2' | '3';\n\ntype SidebarVisualContextValue = {\n size: PaneSize;\n menuVariant: 'solid' | 'soft';\n presentation?: 'thin' | 'expanded';\n color?: string;\n};\n\n/** Size, menu highlight and presentation for the Sidebar parts. Internal: not exported. */\nconst SidebarVisualContext = React.createContext<SidebarVisualContextValue | null>(null);\n\nfunction useSidebarVisual() {\n return React.useContext(SidebarVisualContext);\n}\n\n/** The Shell's index. `Shell.Root size` sets it; panes hand it to their chrome. */\nconst ShellSizeContext = React.createContext<PaneSize>('2');\n\n/**\n * True inside `Shell.Content`. `Shell.Root` sets it back to false, so a Shell nested in the\n * content gets pane chrome in its own panes. Read by `Shell.Scroll`: in the content it holds a\n * page, not a menu, so it takes none of the menu's padding, gap or layering.\n */\nconst ShellContentContext = React.createContext(false);\n\n/**\n * True inside a window Shell: one with no `contained` and no `height`, which lets the page scroll\n * on a narrow touch screen. Each `Shell.Root` sets its own, so a Shell nested in another answers\n * for itself.\n */\nconst ShellWindowContext = React.createContext(false);\n\n/**\n * Gives a Shell pane's children the Shell's index, so Sidebar parts size themselves. In a Rail\n * the rows are `thin`: icon tiles with a small label, sub-menus as dropdowns.\n */\nfunction PaneChromeScope({ children, presentation }: { children: React.ReactNode; presentation?: 'thin' }) {\n const size = React.useContext(ShellSizeContext);\n const value = React.useMemo<SidebarVisualContextValue>(() => ({ size, menuVariant: 'soft', presentation }), [size, presentation]);\n return <SidebarVisualContext.Provider value={value}>{children}</SidebarVisualContext.Provider>;\n}\n\nfunction useChromeClasses() {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const size = visual?.size ?? shellSize;\n const menuVariant = visual?.menuVariant ?? 'soft';\n return ['kui-ShellPaneChrome', `kui-r-size-${size}`, `kui-menu-variant-${menuVariant}`];\n}\n\n/**\n * The index a Toolbar in a pane's header or footer rests at when it states none: one step above\n * the Shell's, so the band reads as chrome over the rows (v2 BAND_STEP). 4 has no step above.\n */\nconst BAND_STEP = { '1': '2', '2': '3', '3': '4', '4': '4' } as const satisfies Record<BandSize, BandSize>;\n\nfunction useBandSize(): BandSize {\n const visual = useSidebarVisual();\n const shellSize = React.useContext(ShellSizeContext);\n return BAND_STEP[visual?.size ?? shellSize];\n}\n\n/**\n * The size a Toolbar with no `size` of its own rests at, or null for none.\n *\n * In a pane's header or footer it is that band's size. Anywhere else inside a Shell, such as\n * `Shell.Content` or a pane's body, it is the same step: one above the Shell's index, so a\n * toolbar in the content area matches the ones in the pane headers beside it (v2 sizes every\n * toolbar this way). A pane's scrolling list, and anything outside a Shell, has none.\n */\nfunction usePaneBandSize(): BandSize | null {\n const band = React.useContext(PaneBandSizeContext);\n const inShell = React.useContext(ShellStoreContext) !== null;\n const step = useBandSize();\n if (band !== undefined) return band;\n return inShell ? step : null;\n}\n\ninterface PaneHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Floats the row over the top of `Shell.Scroll`, so the list scrolls behind it. The list\n * starts below the row, and `Shell.Scroll fade` fades it out under the row. The row paints\n * nothing and lets clicks through between its controls; a `Toolbar backdrop` in it keeps\n * the controls readable.\n */\n float?: boolean;\n}\n\n/** A pane's header row, pinned above its scrolling region. */\nconst PaneHeader = React.forwardRef<HTMLDivElement, PaneHeaderProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneHeader', 'kui-SidebarHeader', 'kui-SidebarHeader--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneHeader.displayName = 'Shell.PaneHeader';\n\ninterface PaneFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Floats the row over the bottom of `Shell.Scroll`, the way `Shell.PaneHeader float` does at the top. */\n float?: boolean;\n}\n\n/** A pane's footer row, pinned below its scrolling region. */\nconst PaneFooter = React.forwardRef<HTMLDivElement, PaneFooterProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneFooter', 'kui-SidebarFooter', 'kui-SidebarFooter--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneFooter.displayName = 'Shell.PaneFooter';\n\ninterface ScrollProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Fades the list out toward an edge with more past it, and under a floating header or footer. */\n fade?: boolean;\n /**\n * Keeps the pane's list (its menu rows) when React puts this under `Shell.Content`, as when an\n * app renders a pane's content in its page and portals it into `Shell.Panel`. In a Rail, Panel\n * or Sidebar it is already the pane's list.\n */\n pane?: boolean;\n}\n\n/**\n * The one region of a pane that scrolls; it takes the room the header and footer leave.\n * In `Shell.Content` it is the page's scroller, and a `Shell.PaneHeader float` beside it pins\n * the page's toolbar over it. The ref, events and ARIA props land on the element that scrolls;\n * `className`, `style` and `dir` apply to the content inside it. In a Rail, Panel or Sidebar the pane is\n * already a navigation landmark, so it needs no role of its own.\n */\nconst Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, style, dir, children, fade = false, pane = false, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n // A Sidebar.Root inside the content still gets a menu.\n const contentPane = React.useContext(ShellContentContext);\n const visual = useSidebarVisual();\n const inContent = contentPane && visual === null && !pane;\n // While the page scrolls, the content's viewport scrolls nothing: as a tab stop it would take a\n // Tab, ring the whole page and move nothing. Resolved after mount; a `tabIndex` of the caller's wins.\n const windowShell = React.useContext(ShellWindowContext);\n const pageScrolls = usePageScrollMedia();\n if (inContent) {\n const tabIndex = props.tabIndex ?? (windowShell && pageScrolls ? -1 : undefined);\n return (\n <ScrollArea {...props} tabIndex={tabIndex} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-ShellScrollContent', className)}>\n {children}\n </div>\n </ScrollArea>\n );\n }\n return (\n <ScrollArea {...props} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-BaseMenuContent', 'kui-SidebarContent', ...chrome, className)}>\n {/* A header's band does not reach a Toolbar in the scrolling list. */}\n <PaneBandSizeContext.Provider value={null}>\n <div className=\"kui-BaseMenuViewport\">{children}</div>\n </PaneBandSizeContext.Provider>\n </div>\n </ScrollArea>\n );\n});\nScroll.displayName = 'Shell.Scroll';\n\nexport { SidebarVisualContext, useSidebarVisual, ShellSizeContext, ShellContentContext, ShellWindowContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };\nexport type { SidebarVisualContextValue, PaneSize, BandSize, PaneHeaderProps, PaneFooterProps, ScrollProps };\n", "'use client';\n\nimport * as React from 'react';\n\n/**\n * When a window Shell lets the page scroll: a narrow window (below the `sm` breakpoint) under a\n * coarse pointer. The stylesheet decides it (shell.css, the page-scroll block), so first paint is\n * right with no script. This is the script's copy, for the few things only script can do when the\n * answer changes: carry the reading position between the two scrollers, and take the content's\n * unused viewport out of the tab order. A test holds it equal to the stylesheet's.\n */\nexport const PAGE_SCROLL_QUERY = '(max-width: 767.98px) and (pointer: coarse)';\n\nlet list: MediaQueryList | undefined;\nconst media = () => (list ??= window.matchMedia(PAGE_SCROLL_QUERY));\n\nfunction listen(m: MediaQueryList, handler: () => void): () => void {\n // Safari below 14 has only the deprecated listener API.\n if (typeof m.addEventListener === 'function') {\n m.addEventListener('change', handler);\n return () => m.removeEventListener('change', handler);\n }\n m.addListener?.(handler);\n return () => m.removeListener?.(handler);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n return listen(media(), onChange);\n}\n\n/** True where a window Shell lets the page scroll. False on the server and through hydration. */\nexport function usePageScrollMedia(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => media().matches,\n () => false,\n );\n}\n\n/** Whether the page scrolls right now. */\nexport function pageScrollMatches(): boolean {\n return media().matches;\n}\n\n/** Subscribes to the answer changing, outside React. */\nexport function onPageScrollMediaChange(onChange: (matches: boolean) => void): () => void {\n const m = media();\n return listen(m, () => onChange(m.matches));\n}\n"],
5
+ "mappings": ";suBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,WAAAE,GAAA,iBAAAC,GAAA,eAAAC,GAAA,SAAAC,GAAA,eAAAC,GAAA,aAAAC,GAAA,YAAAC,GAAA,mBAAAC,GAAA,mBAAAC,GAAA,WAAAC,GAAA,cAAAC,KAAA,eAAAC,GAAAb,IAEA,IAAAc,EAAuB,oBACvBC,EAAuB,yBCHvB,IAAAC,GAAsC,oBACzBC,GAAO,GAAAC,KAAc,KACrBC,GAAO,GAAAD,KAAc,KACrBE,GAA4C,GAAAF,KAAc,UDEvE,IAAAG,EAA2B,wCEH3B,IAAAC,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA4D,oBAC5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,aAAW,EAAAE,SAAW,oBAAqB,8BAA+B,sBAAuB,cAAc6B,GAAQ,MAAQ,GAAG,GAAIjC,CAAS,EAAG,KAAK,UACxL,gBAAC,OAAI,UAAU,iCACb,gBAAC4E,GAAA,CAAW,UAAU,wBAAwB,EAC9C,gBAAC,SACC,IAAKO,EACL,KAAK,SACL,UAAU,yBACV,MAAOJ,EACP,SAAWU,GAAMT,EAAcS,EAAE,OAAO,KAAK,EAC7C,UAAWhD,EACX,YAAawC,EACb,aAAYO,EACd,EACCT,GACC,gBAAC,UACC,KAAK,SACL,UAAU,mCACV,QAAS,IAAM,CACbC,EAAc,EAAE,EAChBG,EAAS,SAAS,MAAM,CAC1B,EACA,aAAW,gBAEX,gBAACN,GAAA,IAAU,CACb,CAEJ,CACF,CAEJ,CACF,EACAC,GAAc,YAAc",
6
+ "names": ["sidebar_exports", "__export", "SidebarGroup", "SidebarGroupContent", "SidebarGroupLabel", "SidebarMenu", "SidebarMenuButton", "SidebarMenuItem", "SidebarMenuSub", "SidebarMenuSubContent", "SidebarMenuSubTrigger", "SidebarSearch", "SidebarSeparator", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "Root", "SlotPrimitive", "Slot", "Slottable", "Accordion", "React", "import_classnames", "import_radix_ui", "import_internal", "React", "import_classnames", "import_radix_ui", "import_internal", "asChildPropDef", "radii", "radiusPropDef", "scrollbarsValues", "scrollAreaPropDefs", "asChildPropDef", "radiusPropDef", "React", "scrollableOverflow", "element", "style", "useScrollEdges", "enabled", "setElement", "frame", "write", "overflow", "start", "end", "xStart", "xEnd", "schedule", "observer", "child", "mutations", "React", "useThumbSync", "viewport", "setViewport", "root", "frame", "write", "thumb", "scrollbar", "style", "track", "offset", "thumbOffset", "schedule", "position", "range", "travel", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "widthPropDefs", "heightPropDefs", "OWNS_FOCUS", "useFocusableWhileScrollable", "element", "enabled", "frame", "update", "overflow", "scrollableOverflow", "schedule", "observer", "child", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "extractProps", "widthPropDefs", "heightPropDefs", "viewport", "setViewport", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "named", "ScrollAreaPrimitive", "classNames", "getSubtree", "accentColors", "grayColors", "colorPropDef", "grayAccentColorPropDef", "accentColors", "contentSizes", "submenuBehaviors", "baseMenuSharedPropDefs", "colorPropDef", "baseMenuContentPropDefs", "baseMenuSubContentPropDefs", "baseMenuItemPropDefs", "asChildPropDef", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "React", "import_classnames", "import_radix_ui", "getMatchingGrayColor", "accentColor", "React", "clampSize", "size", "values", "n", "nearest", "distance", "d", "ThemeSizeContext", "useThemeSizeProps", "props", "propDef", "themeSize", "ThemeSizeContext", "size", "clampSize", "React", "usePropSyncedState", "propValue", "value", "setValue", "previousPropValue", "setPreviousPropValue", "appearances", "fontFamilies", "sizes", "themePropDefs", "asChildPropDef", "accentColors", "grayColors", "radii", "noop", "defaultThemeContext", "themePropDefs", "ThemeContext", "useThemeContext", "Theme", "props", "forwardedRef", "context", "dir", "ThemeRoot", "ThemeImpl", "appearanceProp", "accentColorProp", "grayColorProp", "radiusProp", "fontFamilyProp", "headingFontFamilyProp", "sizeProp", "hasBackground", "rootProps", "appearance", "setAppearance", "usePropSyncedState", "accentColor", "setAccentColor", "grayColor", "setGrayColor", "radius", "setRadius", "fontFamily", "setFontFamily", "headingFontFamily", "setHeadingFontFamily", "size", "setSize", "asChild", "isRoot", "hasBackgroundProp", "onAppearanceChange", "onAccentColorChange", "onGrayColorChange", "onRadiusChange", "onFontFamilyChange", "onHeadingFontFamilyChange", "onSizeChange", "themeProps", "Comp", "resolvedGrayColor", "getMatchingGrayColor", "isExplicitAppearance", "ThemeSizeContext", "classNames", "React", "React", "PaneBandSizeContext", "PortalTheme", "props", "forwardedRef", "PaneBandSizeContext", "Theme", "import_react", "ThickDividerHorizontalIcon", "React", "props", "forwardedRef", "ThickCheckIcon", "ChevronDownIcon", "ThickChevronRightIcon", "ThickChevronLeftIcon", "ThickDotIcon", "CloseIcon", "React", "_props", "_forwardedRef", "PaperclipIcon", "props", "forwardedRef", "FileIcon", "FileTextIcon", "TickIcon", "React", "INITIAL_STATE", "PANEL_ITEM_SELECTOR", "BACK_ITEM_CLASS", "escapeAttributeValue", "value", "DrillDownStore", "__publicField", "element", "listener", "modality", "id", "entry", "onOpenChange", "stack", "trigger", "name", "scrollTop", "top", "index", "next", "open", "controller", "root", "change", "content", "scroller", "focus", "panel", "items", "item", "DrillDownStoreContext", "DrillDownLevelContext", "useDrillDownStore", "useCreateDrillDownStore", "store", "selectDepth", "state", "getServerDepth", "DrillDownRoot", "behavior", "children", "isDrillDown", "depth", "isRoot", "wasOpenRef", "rootRef", "handleKeyDownCapture", "handlePointerDownCapture", "usePanelPosition", "getSnapshot", "noopSubscribe", "getClosed", "useStackEntry", "getUndefined", "SubContext", "useSubContext", "React", "import_internal", "React", "import_classnames", "React", "import_classnames", "import_radix_ui", "sizes", "variants", "kbdPropDefs", "asChildPropDef", "Kbd", "props", "forwardedRef", "asChild", "className", "kbdProps", "extractProps", "kbdPropDefs", "Comp", "classNames", "React", "_BREAKPOINTS", "SHELL_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "subscribe", "getSnapshot", "getServerSnapshot", "ready", "BREAKPOINTS_DESCENDING", "resolveResponsiveValue", "value", "currentBreakpoint", "defaultValue", "map", "i", "resolved", "useResolvedResponsiveValue", "isResponsive", "breakpoint", "useBreakpoint", "CONTENT_PADDING", "getMenuAlignOffset", "size", "KEY_SYMBOLS", "ariaKeyShortcutsCache", "toAriaKeyShortcuts", "shortcut", "cached", "result", "token", "MenuShortcut", "className", "classNames", "Kbd", "MenuContext", "MenuGroupLabelContext", "menuSizeToItemHeight", "getMenuItemHeight", "size", "MenuProvider", "children", "resolvedSize", "useResolvedResponsiveValue", "itemHeight", "value", "MenuCloseContext", "MenuCloseProvider", "MenuGroupLabelProvider", "MenuGroupLabelContext", "useMenuGroupLabelledBy", "ariaLabelledBy", "labelId", "setLabelId", "useMenuGroupLabelId", "idProp", "rendered", "register", "generatedId", "id", "React", "requireReactElement", "children", "child", "DropdownMenuOpenContext", "DropdownMenuRoot", "props", "openProp", "defaultOpen", "onOpenChange", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChangeProp", "handleOpenChange", "next", "close", "MenuCloseProvider", "DropdownMenuPrimitive", "DropdownMenuTrigger", "children", "forwardedRef", "requireReactElement", "DropdownMenuContentContext", "BACK_KEYS", "FORWARD_KEYS", "isTextEntryTarget", "target", "getDirection", "element", "DropdownMenuContent", "ownProps", "useThemeSizeProps", "baseMenuContentPropDefs", "themeContext", "useThemeContext", "size", "className", "color", "container", "forceMount", "submenuBehavior", "virtualized", "onEscapeKeyDown", "onKeyDown", "contentProps", "extractProps", "resolvedColor", "behavior", "useResolvedResponsiveValue", "isDrillDown", "drillDownStore", "useCreateDrillDownStore", "handleEscapeKeyDown", "event", "handleKeyDown", "contextValue", "contentBody", "MenuProvider", "DrillDownRoot", "PortalTheme", "classNames", "ScrollArea", "DropdownMenuLabel", "idProp", "isLevelVisible", "DrillDownLevelContext", "id", "useMenuGroupLabelId", "DropdownMenuItem", "baseMenuItemPropDefs", "shortcut", "itemProps", "toAriaKeyShortcuts", "MenuShortcut", "DropdownMenuGroup", "ariaLabelledBy", "labelledBy", "setLabelId", "useMenuGroupLabelledBy", "MenuGroupLabelProvider", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "baseMenuRadioItemPropDefs", "ThickDotIcon", "DropdownMenuCheckboxItem", "baseMenuCheckboxItemPropDefs", "ThickCheckIcon", "DropdownMenuSub", "label", "useDrillDownStore", "subContextValue", "isOpenInDrillDown", "usePanelPosition", "isControlled", "defaultOpenRef", "wasOpenRef", "SubContext", "DropdownMenuSubTrigger", "subTriggerProps", "subContext", "useSubContext", "handleSelect", "ThickChevronRightIcon", "DropdownMenuSeparator", "DrillDownBackItem", "name", "labelText", "ariaLabel", "ThickChevronLeftIcon", "omitPopperProps", "_loop", "_onEscapeKeyDown", "_onPointerDownOutside", "_onFocusOutside", "_onInteractOutside", "_sideOffset", "_alignOffset", "_avoidCollisions", "_collisionBoundary", "_collisionPadding", "_arrowPadding", "_sticky", "_hideWhenDetached", "_updatePositionStrategy", "rest", "DropdownMenuSubContent", "DrillDownPanel", "CascadeSubContent", "parent", "_color", "subContentProps", "baseMenuSubContentPropDefs", "scalarSize", "body", "getMenuAlignOffset", "store", "sub", "position", "entry", "useStackEntry", "_container", "_forceMount", "_virtualized", "_size", "panelProps", "isTop", "DropdownMenuTriggerIcon", "ChevronDownIcon", "React", "import_classnames", "import_radix_ui", "contentSizes", "popoverContentPropDefs", "asChildPropDef", "widthPropDefs", "heightPropDefs", "React", "NavigatorHostContext", "PopoverContentContext", "usePopoverContentContext", "caller", "ctx", "PopoverNavigatorTitle", "children", "setLabelId", "id", "popoverNavigatorHost", "PopoverPrimitive", "PopoverRoot", "props", "PopoverTrigger", "forwardedRef", "requireReactElement", "PopoverContent", "ownProps", "useThemeSizeProps", "popoverContentPropDefs", "className", "forceMount", "container", "contentProps", "extractProps", "labelId", "contextValue", "PortalTheme", "classNames", "NavigatorHostContext", "PopoverClose", "PopoverAnchor", "PopoverToolbarBase", "PopoverToolbarLeft", "ref", "PopoverToolbarCenter", "PopoverToolbarRight", "PopoverToolbarTitle", "idProp", "reactId", "PopoverToolbar", "React", "import_classnames", "orientationValues", "separatorPropDefs", "colorPropDef", "Separator", "props", "forwardedRef", "className", "color", "decorative", "separatorProps", "extractProps", "separatorPropDefs", "responsive", "breakpoint", "useBreakpoint", "orientation", "values", "bp", "SHELL_BREAKPOINTS", "classNames", "React", "import_classnames", "import_radix_ui", "sizes", "variants", "chipPropDefs", "asChildPropDef", "grayAccentColorPropDef", "radiusPropDef", "React", "import_classnames", "import_radix_ui", "React", "import_radix_ui", "emphases", "emphasisPropDef", "leadingTrimValues", "leadingTrimPropDef", "textAlignValues", "textAlignPropDef", "textWrapValues", "textWrapPropDef", "truncatePropDef", "fontFamilies", "fontFamilyPropDef", "weights", "weightPropDef", "as", "sizes", "textPropDefs", "asChildPropDef", "fontFamilyPropDef", "weightPropDef", "textAlignPropDef", "leadingTrimPropDef", "truncatePropDef", "textWrapPropDef", "colorPropDef", "emphasisPropDef", "Text", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "textProps", "extractProps", "textPropDefs", "combinedClassName", "tooltipPropDefs", "widthPropDefs", "TOOLTIP_DELAY", "TooltipProviderContext", "TooltipProvider", "delayDuration", "children", "props", "TooltipPrimitive", "Tooltip", "forwardedRef", "className", "open", "defaultOpen", "onOpenChange", "disableHoverableContent", "content", "container", "forceMount", "tooltipContentProps", "extractProps", "tooltipPropDefs", "rootProps", "hasProvider", "tooltip", "PortalTheme", "classNames", "Text", "Chip", "props", "forwardedRef", "asChild", "className", "children", "color", "radius", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "chipProps", "extractProps", "chipPropDefs", "Comp", "chip", "classNames", "Tooltip", "React", "import_classnames", "React", "PAGE_SCROLL_QUERY", "list", "media", "listen", "m", "handler", "subscribe", "onChange", "usePageScrollMedia", "SidebarVisualContext", "useSidebarVisual", "ShellSizeContext", "ShellContentContext", "ShellWindowContext", "useChromeClasses", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "size", "menuVariant", "BAND_STEP", "useBandSize", "PaneHeader", "className", "float", "children", "props", "forwardedRef", "chrome", "useChromeClasses", "band", "useBandSize", "classNames", "PaneBandSizeContext", "PaneFooter", "Scroll", "style", "dir", "fade", "pane", "contentPane", "ShellContentContext", "visual", "useSidebarVisual", "inContent", "windowShell", "ShellWindowContext", "pageScrolls", "usePageScrollMedia", "tabIndex", "ScrollArea", "SidebarSeparator", "className", "props", "forwardedRef", "Separator", "classNames", "SidebarMenu", "SidebarMenuItem", "componentName", "type", "fn", "wrapped", "isIconElement", "el", "isText", "node", "separateIconsAndLabels", "children", "icons", "labels", "child", "wrapTextNodes", "focusAdjacentSidebarButton", "event", "scope", "buttons", "index", "next", "SidebarMenuButton", "asChild", "isActive", "shortcut", "badge", "onKeyDown", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "sidebarSize", "isThinMode", "Comp", "Slot", "handleKeyDown", "extras", "Chip", "Kbd", "renderContent", "content", "body", "SidebarSubMenuModeContext", "SidebarMenuSub", "defaultOpen", "DropdownMenuRoot", "SidebarMenuSubTrigger", "DropdownMenuTrigger", "ThickChevronRightIcon", "toDropdownItem", "key", "rest", "itemProps", "DropdownMenuItem", "wrapBareMenuButtons", "SidebarMenuSubContent", "items", "rows", "DropdownMenuContent", "DropdownMenuGroup", "SidebarGroupContext", "SidebarGroup", "labelId", "renderedLabelId", "setLabelId", "context", "SidebarGroupLabel", "id", "group", "SidebarGroupContent", "SearchIcon", "ClearIcon", "SidebarSearch", "value", "onValueChange", "placeholder", "isThin", "inputRef", "popoverRef", "resultsId", "valueRef", "onValueChangeRef", "searchLabel", "e", "handlePopoverKeyDown", "container", "resultsGroup", "active", "isOnInput", "currentIndex", "PopoverRoot", "PopoverTrigger", "PopoverContent"]
7
7
  }