@epilot/zenith-react 0.2.0-next.4 → 0.2.0-next.6

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 (185) hide show
  1. package/README.md +12 -1
  2. package/codemods/README.md +18 -4
  3. package/codemods/format.ts +86 -0
  4. package/codemods/migrate/from-base-elements.ts +8 -2
  5. package/codemods/migrate/from-volt.ts +8 -2
  6. package/codemods/radix-to-base-ui.ts +300 -12
  7. package/dist/_virtual/_zenith-runtime-family_accordion.js +1 -1
  8. package/dist/_virtual/_zenith-runtime-family_alert-dialog.js +1 -1
  9. package/dist/_virtual/_zenith-runtime-family_avatar.js +1 -1
  10. package/dist/_virtual/_zenith-runtime-family_button.js +1 -1
  11. package/dist/_virtual/_zenith-runtime-family_checkbox.js +1 -1
  12. package/dist/_virtual/_zenith-runtime-family_csp-provider.js +1 -1
  13. package/dist/_virtual/_zenith-runtime-family_dialog.js +1 -1
  14. package/dist/_virtual/_zenith-runtime-family_direction-provider.js +1 -1
  15. package/dist/_virtual/_zenith-runtime-family_menu.js +1 -1
  16. package/dist/_virtual/_zenith-runtime-family_merge-props.js +1 -1
  17. package/dist/_virtual/_zenith-runtime-family_popover.js +1 -1
  18. package/dist/_virtual/_zenith-runtime-family_radio-group.js +1 -1
  19. package/dist/_virtual/_zenith-runtime-family_radio.js +1 -1
  20. package/dist/_virtual/_zenith-runtime-family_scroll-area.js +1 -1
  21. package/dist/_virtual/_zenith-runtime-family_select.js +1 -1
  22. package/dist/_virtual/_zenith-runtime-family_separator.js +1 -1
  23. package/dist/_virtual/_zenith-runtime-family_switch.js +1 -1
  24. package/dist/_virtual/_zenith-runtime-family_tabs.js +1 -1
  25. package/dist/_virtual/_zenith-runtime-family_toast.js +1 -1
  26. package/dist/_virtual/_zenith-runtime-family_toggle-group.js +1 -1
  27. package/dist/_virtual/_zenith-runtime-family_toggle.js +1 -1
  28. package/dist/_virtual/_zenith-runtime-family_tooltip.js +1 -1
  29. package/dist/_virtual/_zenith-runtime-family_use-render.js +1 -1
  30. package/dist/components/accordion/accordion.js +1 -1
  31. package/dist/components/accordion/accordion.js.map +1 -1
  32. package/dist/components/alert-dialog/alert-dialog.js +1 -1
  33. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  34. package/dist/components/appearance-boundary/appearance-boundary.js +1 -1
  35. package/dist/components/appearance-boundary/appearance-boundary.js.map +1 -1
  36. package/dist/components/avatar/avatar-group.js +1 -1
  37. package/dist/components/avatar/avatar-group.js.map +1 -1
  38. package/dist/components/avatar/avatar.js +1 -1
  39. package/dist/components/avatar/avatar.js.map +1 -1
  40. package/dist/components/badge/badge.js +1 -1
  41. package/dist/components/badge/badge.js.map +1 -1
  42. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  43. package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
  44. package/dist/components/button/button.js +1 -1
  45. package/dist/components/button/button.js.map +1 -1
  46. package/dist/components/button-group/button-group.js +1 -1
  47. package/dist/components/button-group/button-group.js.map +1 -1
  48. package/dist/components/callout/callout.js +1 -1
  49. package/dist/components/callout/callout.js.map +1 -1
  50. package/dist/components/card/card.js +1 -1
  51. package/dist/components/card/card.js.map +1 -1
  52. package/dist/components/checkbox/checkbox.js +1 -1
  53. package/dist/components/checkbox/checkbox.js.map +1 -1
  54. package/dist/components/code-block/code-block.js +1 -1
  55. package/dist/components/code-block/code-block.js.map +1 -1
  56. package/dist/components/code-editor/code-editor.js +1 -1
  57. package/dist/components/code-editor/code-editor.js.map +1 -1
  58. package/dist/components/collapsible-sidebar/collapsible-sidebar.js +1 -1
  59. package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
  60. package/dist/components/command/command.js +1 -1
  61. package/dist/components/command/command.js.map +1 -1
  62. package/dist/components/data-table/data-table-body.js +1 -1
  63. package/dist/components/data-table/data-table-body.js.map +1 -1
  64. package/dist/components/data-table/data-table-column-header.js +1 -1
  65. package/dist/components/data-table/data-table-column-header.js.map +1 -1
  66. package/dist/components/data-table/data-table-column-order.js +1 -1
  67. package/dist/components/data-table/data-table-column-order.js.map +1 -1
  68. package/dist/components/data-table/data-table-column-visibility.js +1 -1
  69. package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
  70. package/dist/components/data-table/data-table-content.js +1 -1
  71. package/dist/components/data-table/data-table-content.js.map +1 -1
  72. package/dist/components/data-table/data-table-error.js +1 -1
  73. package/dist/components/data-table/data-table-error.js.map +1 -1
  74. package/dist/components/data-table/data-table-footer.js +1 -1
  75. package/dist/components/data-table/data-table-footer.js.map +1 -1
  76. package/dist/components/data-table/data-table-header-draggable.js +1 -1
  77. package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
  78. package/dist/components/data-table/data-table-header.js +1 -1
  79. package/dist/components/data-table/data-table-header.js.map +1 -1
  80. package/dist/components/data-table/data-table-loading.js +1 -1
  81. package/dist/components/data-table/data-table-loading.js.map +1 -1
  82. package/dist/components/data-table/data-table-resize-handle.js +1 -1
  83. package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
  84. package/dist/components/data-table/data-table-row.js +1 -1
  85. package/dist/components/data-table/data-table-row.js.map +1 -1
  86. package/dist/components/data-table/data-table-toolbar.js +1 -1
  87. package/dist/components/data-table/data-table-toolbar.js.map +1 -1
  88. package/dist/components/data-table/data-table.js +1 -1
  89. package/dist/components/data-table/data-table.js.map +1 -1
  90. package/dist/components/date-range-picker/date-range-picker.js +1 -1
  91. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  92. package/dist/components/date-range-picker/range-calendar.js +1 -1
  93. package/dist/components/date-range-picker/range-calendar.js.map +1 -1
  94. package/dist/components/date-time-picker/calendar.js +1 -1
  95. package/dist/components/date-time-picker/calendar.js.map +1 -1
  96. package/dist/components/date-time-picker/date-time-picker-input.js +1 -1
  97. package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
  98. package/dist/components/date-time-picker/date-time-picker-panel.js +1 -1
  99. package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
  100. package/dist/components/date-time-picker/date-time-picker.js +1 -1
  101. package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
  102. package/dist/components/date-time-picker/time-picker.js +1 -1
  103. package/dist/components/date-time-picker/time-picker.js.map +1 -1
  104. package/dist/components/density-provider/density-provider.js +1 -1
  105. package/dist/components/dialog/dialog.js +1 -1
  106. package/dist/components/dialog/dialog.js.map +1 -1
  107. package/dist/components/drawer/drawer.js +1 -1
  108. package/dist/components/drawer/drawer.js.map +1 -1
  109. package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
  110. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  111. package/dist/components/field/field-combobox.js +190 -181
  112. package/dist/components/field/field-combobox.js.map +1 -1
  113. package/dist/components/field/field-select.js +37 -22
  114. package/dist/components/field/field-select.js.map +1 -1
  115. package/dist/components/field/field.js +1 -1
  116. package/dist/components/field/field.js.map +1 -1
  117. package/dist/components/label/label.js +1 -1
  118. package/dist/components/label/label.js.map +1 -1
  119. package/dist/components/list/list.js +1 -1
  120. package/dist/components/list/list.js.map +1 -1
  121. package/dist/components/option-card/option-card.js +1 -1
  122. package/dist/components/option-card/option-card.js.map +1 -1
  123. package/dist/components/pill/pill.js +1 -1
  124. package/dist/components/pill/pill.js.map +1 -1
  125. package/dist/components/popover/popover.js +1 -1
  126. package/dist/components/popover/popover.js.map +1 -1
  127. package/dist/components/radio/radio.js +1 -1
  128. package/dist/components/radio/radio.js.map +1 -1
  129. package/dist/components/scroll-area/scroll-area.js +1 -1
  130. package/dist/components/scroll-area/scroll-area.js.map +1 -1
  131. package/dist/components/scroll-area/scrollbar-styles.js +1 -1
  132. package/dist/components/scroll-area/scrollbar-styles.js.map +1 -1
  133. package/dist/components/scroll-overflow/scroll-overflow.js +22 -22
  134. package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
  135. package/dist/components/segmented-control/segmented-control.js +133 -122
  136. package/dist/components/segmented-control/segmented-control.js.map +1 -1
  137. package/dist/components/select/select.js +1 -1
  138. package/dist/components/select/select.js.map +1 -1
  139. package/dist/components/separator/separator.js +1 -1
  140. package/dist/components/separator/separator.js.map +1 -1
  141. package/dist/components/skeleton/skeleton.js +1 -1
  142. package/dist/components/skeleton/skeleton.js.map +1 -1
  143. package/dist/components/slot/compose-as-child.js +1 -1
  144. package/dist/components/slot/compose-as-child.js.map +1 -1
  145. package/dist/components/spinner/spinner.js +1 -1
  146. package/dist/components/spinner/spinner.js.map +1 -1
  147. package/dist/components/surface/surface.js +1 -1
  148. package/dist/components/surface/surface.js.map +1 -1
  149. package/dist/components/switch/switch.js +1 -1
  150. package/dist/components/switch/switch.js.map +1 -1
  151. package/dist/components/table/table-pagination.js +1 -1
  152. package/dist/components/table/table-pagination.js.map +1 -1
  153. package/dist/components/table/table.js +1 -1
  154. package/dist/components/table/table.js.map +1 -1
  155. package/dist/components/tabs/tabs.js +1 -1
  156. package/dist/components/tabs/tabs.js.map +1 -1
  157. package/dist/components/text/text.js +1 -1
  158. package/dist/components/text/text.js.map +1 -1
  159. package/dist/components/toast/toast.js +1 -1
  160. package/dist/components/toast/toast.js.map +1 -1
  161. package/dist/components/toggle/toggle-group.js +1 -1
  162. package/dist/components/toggle/toggle-group.js.map +1 -1
  163. package/dist/components/toggle/toggle.js +29 -26
  164. package/dist/components/toggle/toggle.js.map +1 -1
  165. package/dist/components/tooltip/tooltip.js +1 -1
  166. package/dist/components/tooltip/tooltip.js.map +1 -1
  167. package/dist/index.d.ts +1 -1
  168. package/dist/index.js +1 -1
  169. package/dist/lib/clear-button.js +1 -1
  170. package/dist/lib/clear-button.js.map +1 -1
  171. package/dist/packages/tokens/dist/delivery/index.js +1 -1
  172. package/dist/packages/tokens/dist/delivery/index.js.map +1 -1
  173. package/dist/packages/tokens/dist/install.js +1 -1
  174. package/dist/packages/tokens/dist/install.js.map +1 -1
  175. package/dist/renderer/served.js +19 -14
  176. package/dist/renderer/served.js.map +1 -1
  177. package/dist/styles/host-reset.js.map +1 -1
  178. package/dist/styles/make-styles.js +1 -1
  179. package/dist/styles/make-styles.js.map +1 -1
  180. package/dist/styles/text-box.js.map +1 -1
  181. package/dist/tokens.json +1 -1
  182. package/package.json +5 -3
  183. package/scripts/migration-diagnostics-core.mjs +284 -0
  184. package/scripts/migration-sweep.mjs +10 -10
  185. package/testing/setup.cjs +87 -0
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sources":["../../../src/components/drawer/drawer.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst easeOut = \"cubic-bezier(0.4, 0, 0.2, 1)\"\nconst easeIn = \"cubic-bezier(0.4, 0, 1, 1)\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n nativeTrigger: {\n ...nativeControl,\n },\n overlay: {\n position: \"fixed\",\n ...shorthands.inset(0),\n zIndex: OVERLAY_Z_INDEX,\n backgroundColor: \"rgb(0 0 0 / 50%)\",\n transitionProperty: \"opacity\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: easeOut,\n \"&[data-starting-style]\": { opacity: 0 },\n \"&[data-ending-style]\": { opacity: 0, transitionTimingFunction: easeIn },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n },\n content: {\n ...boxModel,\n backgroundColor: tokens.gray2,\n position: \"fixed\",\n zIndex: OVERLAY_Z_INDEX,\n display: \"flex\",\n flexDirection: \"column\",\n ...shorthands.gap(tokens.spacingLayout1),\n ...shorthands.borderRadius(tokens.radius2xl),\n // v1 shadow-lg; elevation has no token in this package.\n boxShadow: \"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a\",\n // The fade lives here, the slide's distance in each side's slot below.\n transitionProperty: \"opacity, transform\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: easeOut,\n \"&[data-starting-style]\": { opacity: 0 },\n \"&[data-ending-style]\": { opacity: 0, transitionTimingFunction: easeIn },\n // Collapses the side slots' slide too: they set only where it starts and ends.\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n },\n contentPadding: {\n ...boxModel,\n // Layout tier, unlike Dialog, AlertDialog and Popover: a drawer holds sections, not one group.\n ...shorthands.padding(tokens.spacingLayout1),\n },\n right: {\n ...boxModel,\n top: tokens.spacingElement1,\n bottom: tokens.spacingElement1,\n right: tokens.spacingElement1,\n height: \"calc(100% - 0.5rem)\",\n ...shorthands.borderLeft(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateX(100%)\" },\n \"&[data-ending-style]\": { transform: \"translateX(100%)\" },\n },\n left: {\n ...boxModel,\n top: tokens.spacingElement1,\n bottom: tokens.spacingElement1,\n left: tokens.spacingElement1,\n height: \"calc(100% - 0.5rem)\",\n ...shorthands.borderRight(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateX(-100%)\" },\n \"&[data-ending-style]\": { transform: \"translateX(-100%)\" },\n },\n top: {\n ...boxModel,\n left: tokens.spacingElement1,\n right: tokens.spacingElement1,\n top: tokens.spacingElement1,\n width: \"calc(100% - 0.5rem)\",\n ...shorthands.borderBottom(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateY(-100%)\" },\n \"&[data-ending-style]\": { transform: \"translateY(-100%)\" },\n },\n bottom: {\n ...boxModel,\n left: tokens.spacingElement1,\n right: tokens.spacingElement1,\n bottom: tokens.spacingElement1,\n width: \"calc(100% - 0.5rem)\",\n ...shorthands.borderTop(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateY(100%)\" },\n \"&[data-ending-style]\": { transform: \"translateY(100%)\" },\n },\n close: {\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n },\n closeButton: {\n ...nativeControl,\n position: \"absolute\",\n // Inset by the content padding so it lines up with the padded header.\n top: tokens.spacingLayout1,\n right: tokens.spacingLayout1,\n ...shorthands.padding(tokens.spacingElement2),\n // v1 rounded-full; no full-radius token exists in this package.\n borderRadius: \"9999px\",\n cursor: \"pointer\",\n color: tokens.accentA11,\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n \":disabled\": {\n pointerEvents: \"none\",\n },\n \"& svg\": {\n display: \"block\",\n pointerEvents: \"none\",\n flexShrink: 0,\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n header: {\n display: \"flex\",\n flexShrink: 0,\n flexDirection: \"column\",\n ...shorthands.gap(tokens.spacingElement2),\n textAlign: \"left\",\n },\n footer: {\n marginTop: \"auto\",\n display: \"flex\",\n flexShrink: 0,\n ...shorthands.gap(tokens.spacingElement2),\n justifyContent: \"flex-end\",\n },\n title: {\n ...shorthands.margin(0),\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayA12,\n },\n description: {\n ...shorthands.margin(0),\n color: tokens.grayA11,\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n },\n srOnly: {\n ...boxModel,\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: 0,\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n },\n})\n\nconst XIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(\n function XIcon(props, ref) {\n return (\n <svg\n ref={ref}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M4.38333 5.31667L1.11667 8.58333C0.994445 8.70556 0.838889 8.76667 0.65 8.76667C0.461111 8.76667 0.305556 8.70556 0.183333 8.58333C0.0611111 8.46111 0 8.30556 0 8.11667C0 7.92778 0.0611111 7.77222 0.183333 7.65L3.45 4.38333L0.183333 1.11667C0.0611111 0.994445 0 0.838889 0 0.65C0 0.461111 0.0611111 0.305556 0.183333 0.183333C0.305556 0.0611111 0.461111 0 0.65 0C0.838889 0 0.994445 0.0611111 1.11667 0.183333L4.38333 3.45L7.65 0.183333C7.77222 0.0611111 7.92778 0 8.11667 0C8.30556 0 8.46111 0.0611111 8.58333 0.183333C8.70556 0.305556 8.76667 0.461111 8.76667 0.65C8.76667 0.838889 8.70556 0.994445 8.58333 1.11667L5.31667 4.38333L8.58333 7.65C8.70556 7.77222 8.76667 7.92778 8.76667 8.11667C8.76667 8.30556 8.70556 8.46111 8.58333 8.58333C8.46111 8.70556 8.30556 8.76667 8.11667 8.76667C7.92778 8.76667 7.77222 8.70556 7.65 8.58333L4.38333 5.31667Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n }\n)\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\" | \"h2\" | \"p\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\n/**\n * Radix-shaped focus interception over Base UI's `initialFocus`/`finalFocus`. `preventDefault()`\n * leaves focus where it is; otherwise the default move happens, because Base UI reads a callback\n * that returns `undefined` as \"move nothing\".\n */\nfunction radixFocusCallback(handler: ((event: Event) => void) | undefined) {\n if (!handler) return undefined\n\n return () => {\n const event = new Event(\"focus\", { cancelable: true })\n const before = document.activeElement\n handler(event)\n const moved = document.activeElement\n // Base UI calls `finalFocus` inside React's commit, and React then restores the focus it saw\n // before the commit. Radix ran this handler after the commit, so a handler that moves focus\n // itself has its move applied again once the commit is done.\n if (moved !== before && moved instanceof HTMLElement) {\n queueMicrotask(() => moved.focus())\n }\n return !event.defaultPrevented\n }\n}\n\n/**\n * What `onOpenChange` receives as its second argument: Base UI's change details, declared in\n * Zenith. Base UI's own type drags its dialog store into the published declarations, and\n * TypeScript 4 cannot parse that store. `event` narrows with `reason`, as it does in Base UI.\n */\ntype DrawerOpenChangeDetails = (\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"close-press\"; event: MouseEvent | KeyboardEvent | PointerEvent }\n | { reason: \"focus-out\"; event: FocusEvent | KeyboardEvent }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the drawer in its current state. */\n cancel: () => void\n /** Lets the event propagate where the drawer would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the drawer's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\nexport type DrawerProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n modal?: boolean\n /**\n * Called when the drawer opens or closes. `eventDetails.reason` says why (`trigger-press`,\n * `escape-key`, `outside-press`, `focus-out`, `close-press`) and `eventDetails.cancel()` keeps\n * the drawer in its current state.\n */\n onOpenChange?: (open: boolean, eventDetails: DrawerOpenChangeDetails) => void\n}\n\nexport const Drawer = React.forwardRef<HTMLElement, DrawerProps>(\n function Drawer({ onOpenChange, ...props }, _ref) {\n return (\n <DialogPrimitive.Root\n data-slot=\"drawer\"\n onOpenChange={(open, eventDetails) => {\n // A layer inside (a Volt select or tooltip, which run on Radix, or a control handling\n // the key itself) prevents the Escape it consumes, but Base UI dismisses regardless, so\n // one Escape would close both. Honour the handled event. Consumers still mix Zenith with\n // Volt on one page, so this stays after the Radix teardown (D12).\n if (\n eventDetails.reason === \"escape-key\" &&\n eventDetails.event.defaultPrevented\n ) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n {...props}\n />\n )\n }\n)\n\nexport type DrawerTriggerProps = NativePartProps<\"button\">\n\nexport const DrawerTrigger = React.forwardRef<\n HTMLButtonElement,\n DrawerTriggerProps\n>(function DrawerTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Trigger\n ref={ref}\n data-slot=\"drawer-trigger\"\n {...{ [SLOT_ATTR]: \"drawer-trigger\" }}\n className={mergeClasses(!asChild && styles.nativeTrigger, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets DrawerContent supply Base UI's required Portal itself when no DrawerPortal wraps it, as\n// Radix rendered content inline without one.\nconst DrawerPortalPresenceContext = React.createContext(false)\n\nexport type DrawerPortalProps = {\n children?: React.ReactNode\n /** The element the overlay and the content portal into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the overlay and the content mounted while the drawer is closed. */\n forceMount?: true\n}\n\nexport const DrawerPortal = React.forwardRef<HTMLElement, DrawerPortalProps>(\n function DrawerPortal({ container, forceMount, ...props }, ref) {\n return (\n <DrawerPortalPresenceContext.Provider value={true}>\n <DialogPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"drawer-portal\"\n {...{ [SLOT_ATTR]: \"drawer-portal\" }}\n // Radix took any Element or DocumentFragment, null meaning the body. Base UI hands a\n // node straight to createPortal, which takes either, but reads null as \"wait for one\".\n container={(container ?? undefined) as HTMLElement | undefined}\n keepMounted={forceMount}\n {...props}\n />\n </DrawerPortalPresenceContext.Provider>\n )\n }\n)\n\nexport type DrawerOverlayProps = NativePartProps<\"div\"> & {\n /** Kept for compatibility: the overlay stays mounted whenever DrawerPortal's `forceMount` keeps the portal mounted. */\n forceMount?: true\n}\n\nexport const DrawerOverlay = React.forwardRef<\n HTMLDivElement,\n DrawerOverlayProps\n>(function DrawerOverlay(\n { asChild = false, children, className, forceMount: _forceMount, ...props },\n ref\n) {\n const styles = useStyles()\n // The overlay is portalled too, so it re-stamps the boundary's appearance like the content (#8).\n const appearance = useAppearanceAttributes()\n\n return (\n <DialogPrimitive.Backdrop\n ref={ref}\n // Base UI renders no backdrop for a dialog nested in another; Radix's overlay always rendered,\n // dimming the drawer beneath.\n forceRender\n data-slot=\"drawer-overlay\"\n {...{ [SLOT_ATTR]: \"drawer-overlay\" }}\n {...appearance}\n className={mergeClasses(styles.overlay, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DrawerSide = \"left\" | \"right\" | \"top\" | \"bottom\"\n\nexport type DrawerContentProps = NativePartProps<\"div\"> & {\n showCloseButton?: boolean\n /**\n * Accessible name of the built-in close button, read by screen readers. Pass a translated\n * string for any locale other than English. Defaults to \"Close\".\n */\n closeButtonLabel?: string\n side?: DrawerSide\n flush?: boolean\n /**\n * Keeps the content mounted while the drawer is closed. Inside DrawerPortal, the portal's\n * `forceMount` decides.\n */\n forceMount?: true\n /** Called before focus moves into the drawer; `preventDefault()` leaves focus where it is. */\n onOpenAutoFocus?: (event: Event) => void\n /** Called before focus returns on close; `preventDefault()` skips the return. */\n onCloseAutoFocus?: (event: Event) => void\n}\n\nexport const DrawerContent = React.forwardRef<\n HTMLDivElement,\n DrawerContentProps\n>(function DrawerContent(\n {\n asChild = false,\n className,\n children,\n showCloseButton = true,\n closeButtonLabel = \"Close\",\n side = \"right\",\n flush = false,\n forceMount,\n onOpenAutoFocus,\n onCloseAutoFocus,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const hasPortal = React.useContext(DrawerPortalPresenceContext)\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n\n const closeButton = showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"drawer-close\"\n {...{ [SLOT_ATTR]: \"drawer-close\" }}\n className={styles.closeButton}\n >\n <XIcon />\n <span className={styles.srOnly}>{closeButtonLabel}</span>\n </DialogPrimitive.Close>\n )\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the built-in close button joins them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n closeButton\n ),\n }\n : {\n children: (\n <>\n {children}\n {closeButton}\n </>\n ),\n }\n\n const popup = (\n <DialogPrimitive.Popup\n ref={ref}\n data-slot=\"drawer-content\"\n {...{ [SLOT_ATTR]: \"drawer-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n data-side={side}\n initialFocus={radixFocusCallback(onOpenAutoFocus)}\n finalFocus={radixFocusCallback(onCloseAutoFocus)}\n className={mergeClasses(\n styles.content,\n styles[side],\n !flush && styles.contentPadding,\n className\n )}\n {...props}\n {...content}\n />\n )\n\n // Base UI's Popup requires a Portal ancestor; Radix rendered inline without one.\n return hasPortal ? (\n popup\n ) : (\n <DialogPrimitive.Portal keepMounted={forceMount}>\n {popup}\n </DialogPrimitive.Portal>\n )\n})\n\nexport type DrawerCloseProps = NativePartProps<\"button\">\n\nexport const DrawerClose = React.forwardRef<\n HTMLButtonElement,\n DrawerCloseProps\n>(function DrawerClose(\n { asChild = false, className, children, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Close\n ref={ref}\n data-slot=\"drawer-close\"\n {...{ [SLOT_ATTR]: \"drawer-close\" }}\n className={mergeClasses(\n !asChild && styles.nativeTrigger,\n styles.close,\n className\n )}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DrawerHeaderProps = React.ComponentProps<\"div\">\n\nexport const DrawerHeader = React.forwardRef<HTMLDivElement, DrawerHeaderProps>(\n function DrawerHeader({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"drawer-header\"\n {...{ [SLOT_ATTR]: \"drawer-header\" }}\n className={mergeClasses(styles.header, className)}\n {...props}\n />\n )\n }\n)\n\nexport type DrawerFooterProps = React.ComponentProps<\"div\">\n\nexport const DrawerFooter = React.forwardRef<HTMLDivElement, DrawerFooterProps>(\n function DrawerFooter({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"drawer-footer\"\n {...{ [SLOT_ATTR]: \"drawer-footer\" }}\n className={mergeClasses(styles.footer, className)}\n {...props}\n />\n )\n }\n)\n\nexport type DrawerTitleProps = NativePartProps<\"h2\">\n\nexport const DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n DrawerTitleProps\n>(function DrawerTitle(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n {...{ [SLOT_ATTR]: \"drawer-title\" }}\n className={mergeClasses(styles.title, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DrawerDescriptionProps = NativePartProps<\"p\">\n\nexport const DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n DrawerDescriptionProps\n>(function DrawerDescription(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n {...{ [SLOT_ATTR]: \"drawer-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n"],"names":["easeOut","easeIn","useStyles","makeZenithStyles","nativeControl","shorthands","OVERLAY_Z_INDEX","boxModel","tokens.gray2","tokens.spacingLayout1","tokens.radius2xl","tokens.spacingElement1","tokens.grayA1","tokens.accentA8","tokens.spacingElement2","tokens.accentA11","tokens.accentSoft","tokens.textLg","tokens.leadingLg","tokens.fontWeightSemibold","tokens.grayA12","tokens.grayA11","tokens.textSm","tokens.leadingSm","XIcon","React","props","ref","jsx","onlySlotChild","children","elements","slotProps","asChild","child","radixFocusCallback","handler","event","before","moved","Drawer","onOpenChange","_ref","DialogPrimitive","open","eventDetails","DrawerTrigger","className","styles","SLOT_ATTR","mergeClasses","DrawerPortalPresenceContext","DrawerPortal","container","forceMount","DrawerOverlay","_forceMount","appearance","useAppearanceAttributes","DrawerContent","showCloseButton","closeButtonLabel","side","flush","onOpenAutoFocus","onCloseAutoFocus","hasPortal","override","useDensity","closeButton","jsxs","content","Fragment","popup","DrawerClose","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAU,gCACVC,IAAS,8BAETC,IAAYC,EAAiB;AAAA;AAAA;AAAA,EAGjC,eAAe;AAAA,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AAAA,QACA,aAAU;AAAA,QACJ,CAACsB,CAAS,GAAG;AAAA,QACnB,WAAWC,EAAaF,EAAO,QAAQD,CAAS;AAAA,QAC/C,GAAGrB;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF,GAIamD,KAAcpD,EAAM,WAG/B,SACA,EAAE,SAAAQ,IAAU,IAAO,UAAAH,GAAU,WAAAiB,GAAW,GAAGrB,EAAA,GAC3CC,GACA;AACA,QAAMqB,IAAS9C,EAAA;AAEf,SACE,gBAAA0B;AAAA,IAACe,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAhB;AAAA,MACA,aAAU;AAAA,MACJ,CAACsB,CAAS,GAAG;AAAA,MACnB,WAAWC,EAAaF,EAAO,OAAOD,CAAS;AAAA,MAC9C,GAAGrB;AAAA,MACH,GAAGM,EAAUC,GAASH,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGrC,CAAC,GAIYgD,KAAoBrD,EAAM,WAGrC,SACA,EAAE,SAAAQ,IAAU,IAAO,UAAAH,GAAU,WAAAiB,GAAW,GAAGrB,EAAA,GAC3CC,GACA;AACA,QAAMqB,IAAS9C,EAAA;AAEf,SACE,gBAAA0B;AAAA,IAACe,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAhB;AAAA,MACA,aAAU;AAAA,MACJ,CAACsB,CAAS,GAAG;AAAA,MACnB,WAAWC,EAAaF,EAAO,aAAaD,CAAS;AAAA,MACpD,GAAGrB;AAAA,MACH,GAAGM,EAAUC,GAASH,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGrC,CAAC;"}
1
+ {"version":3,"file":"drawer.js","sources":["../../../src/components/drawer/drawer.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst easeOut = \"cubic-bezier(0.4, 0, 0.2, 1)\"\nconst easeIn = \"cubic-bezier(0.4, 0, 1, 1)\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n nativeTrigger: {\n ...nativeControl,\n },\n overlay: {\n position: \"fixed\",\n ...shorthands.inset(0),\n zIndex: OVERLAY_Z_INDEX,\n backgroundColor: \"rgb(0 0 0 / 50%)\",\n transitionProperty: \"opacity\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: easeOut,\n \"&[data-starting-style]\": { opacity: 0 },\n \"&[data-ending-style]\": { opacity: 0, transitionTimingFunction: easeIn },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n },\n content: {\n ...boxModel,\n backgroundColor: tokens.gray2,\n position: \"fixed\",\n zIndex: OVERLAY_Z_INDEX,\n display: \"flex\",\n flexDirection: \"column\",\n ...shorthands.gap(tokens.spacingLayout1),\n ...shorthands.borderRadius(tokens.radius2xl),\n // v1 shadow-lg; elevation has no token in this package.\n boxShadow: \"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a\",\n // The fade lives here, the slide's distance in each side's slot below.\n transitionProperty: \"opacity, transform\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: easeOut,\n \"&[data-starting-style]\": { opacity: 0 },\n \"&[data-ending-style]\": { opacity: 0, transitionTimingFunction: easeIn },\n // Collapses the side slots' slide too: they set only where it starts and ends.\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n },\n contentPadding: {\n ...boxModel,\n // Layout tier, unlike Dialog, AlertDialog and Popover: a drawer holds sections, not one group.\n ...shorthands.padding(tokens.spacingLayout1),\n },\n right: {\n ...boxModel,\n top: tokens.spacingElement1,\n bottom: tokens.spacingElement1,\n right: tokens.spacingElement1,\n height: \"calc(100% - 0.5rem)\",\n ...shorthands.borderLeft(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateX(100%)\" },\n \"&[data-ending-style]\": { transform: \"translateX(100%)\" },\n },\n left: {\n ...boxModel,\n top: tokens.spacingElement1,\n bottom: tokens.spacingElement1,\n left: tokens.spacingElement1,\n height: \"calc(100% - 0.5rem)\",\n ...shorthands.borderRight(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateX(-100%)\" },\n \"&[data-ending-style]\": { transform: \"translateX(-100%)\" },\n },\n top: {\n ...boxModel,\n left: tokens.spacingElement1,\n right: tokens.spacingElement1,\n top: tokens.spacingElement1,\n width: \"calc(100% - 0.5rem)\",\n ...shorthands.borderBottom(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateY(-100%)\" },\n \"&[data-ending-style]\": { transform: \"translateY(-100%)\" },\n },\n bottom: {\n ...boxModel,\n left: tokens.spacingElement1,\n right: tokens.spacingElement1,\n bottom: tokens.spacingElement1,\n width: \"calc(100% - 0.5rem)\",\n ...shorthands.borderTop(\"1px\", \"solid\", tokens.grayA1),\n \"&[data-starting-style]\": { transform: \"translateY(100%)\" },\n \"&[data-ending-style]\": { transform: \"translateY(100%)\" },\n },\n close: {\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n },\n closeButton: {\n ...nativeControl,\n position: \"absolute\",\n // Inset by the content padding so it lines up with the padded header.\n top: tokens.spacingLayout1,\n right: tokens.spacingLayout1,\n ...shorthands.padding(tokens.spacingElement2),\n // v1 rounded-full; no full-radius token exists in this package.\n borderRadius: \"9999px\",\n cursor: \"pointer\",\n color: tokens.accentA11,\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n \":disabled\": {\n pointerEvents: \"none\",\n },\n \"& svg\": {\n display: \"block\",\n pointerEvents: \"none\",\n flexShrink: 0,\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n header: {\n display: \"flex\",\n flexShrink: 0,\n flexDirection: \"column\",\n ...shorthands.gap(tokens.spacingElement2),\n textAlign: \"left\",\n },\n footer: {\n marginTop: \"auto\",\n display: \"flex\",\n flexShrink: 0,\n ...shorthands.gap(tokens.spacingElement2),\n justifyContent: \"flex-end\",\n },\n title: {\n ...shorthands.margin(0),\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayA12,\n },\n description: {\n ...shorthands.margin(0),\n color: tokens.grayA11,\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n },\n srOnly: {\n ...boxModel,\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: 0,\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n },\n})\n\nconst XIcon = React.forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(\n function XIcon(props, ref) {\n return (\n <svg\n ref={ref}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 9 9\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M4.38333 5.31667L1.11667 8.58333C0.994445 8.70556 0.838889 8.76667 0.65 8.76667C0.461111 8.76667 0.305556 8.70556 0.183333 8.58333C0.0611111 8.46111 0 8.30556 0 8.11667C0 7.92778 0.0611111 7.77222 0.183333 7.65L3.45 4.38333L0.183333 1.11667C0.0611111 0.994445 0 0.838889 0 0.65C0 0.461111 0.0611111 0.305556 0.183333 0.183333C0.305556 0.0611111 0.461111 0 0.65 0C0.838889 0 0.994445 0.0611111 1.11667 0.183333L4.38333 3.45L7.65 0.183333C7.77222 0.0611111 7.92778 0 8.11667 0C8.30556 0 8.46111 0.0611111 8.58333 0.183333C8.70556 0.305556 8.76667 0.461111 8.76667 0.65C8.76667 0.838889 8.70556 0.994445 8.58333 1.11667L5.31667 4.38333L8.58333 7.65C8.70556 7.77222 8.76667 7.92778 8.76667 8.11667C8.76667 8.30556 8.70556 8.46111 8.58333 8.58333C8.46111 8.70556 8.30556 8.76667 8.11667 8.76667C7.92778 8.76667 7.77222 8.70556 7.65 8.58333L4.38333 5.31667Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n }\n)\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\" | \"h2\" | \"p\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\n/**\n * Radix-shaped focus interception over Base UI's `initialFocus`/`finalFocus`. `preventDefault()`\n * leaves focus where it is; otherwise the default move happens, because Base UI reads a callback\n * that returns `undefined` as \"move nothing\".\n */\nfunction radixFocusCallback(handler: ((event: Event) => void) | undefined) {\n if (!handler) return undefined\n\n return () => {\n const event = new Event(\"focus\", { cancelable: true })\n const before = document.activeElement\n handler(event)\n const moved = document.activeElement\n // Base UI calls `finalFocus` inside React's commit, and React then restores the focus it saw\n // before the commit. Radix ran this handler after the commit, so a handler that moves focus\n // itself has its move applied again once the commit is done.\n if (moved !== before && moved instanceof HTMLElement) {\n queueMicrotask(() => moved.focus())\n }\n return !event.defaultPrevented\n }\n}\n\n/**\n * What `onOpenChange` receives as its second argument: Base UI's change details, declared in\n * Zenith. Base UI's own type drags its dialog store into the published declarations, and\n * TypeScript 4 cannot parse that store. `event` narrows with `reason`, as it does in Base UI.\n */\ntype DrawerOpenChangeDetails = (\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"close-press\"; event: MouseEvent | KeyboardEvent | PointerEvent }\n | { reason: \"focus-out\"; event: FocusEvent | KeyboardEvent }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the drawer in its current state. */\n cancel: () => void\n /** Lets the event propagate where the drawer would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the drawer's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\nexport type DrawerProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n modal?: boolean\n /**\n * Called when the drawer opens or closes. `eventDetails.reason` says why (`trigger-press`,\n * `escape-key`, `outside-press`, `focus-out`, `close-press`) and `eventDetails.cancel()` keeps\n * the drawer in its current state.\n */\n onOpenChange?: (open: boolean, eventDetails: DrawerOpenChangeDetails) => void\n}\n\nexport const Drawer = React.forwardRef<HTMLElement, DrawerProps>(\n function Drawer({ onOpenChange, ...props }, _ref) {\n return (\n <DialogPrimitive.Root\n data-slot=\"drawer\"\n onOpenChange={(open, eventDetails) => {\n // A layer inside (a Volt select or tooltip, which run on Radix, or a control handling\n // the key itself) prevents the Escape it consumes, but Base UI dismisses regardless, so\n // one Escape would close both. Honour the handled event. Consumers still mix Zenith with\n // Volt on one page, so this stays after the Radix teardown (D12).\n if (\n eventDetails.reason === \"escape-key\" &&\n eventDetails.event.defaultPrevented\n ) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n }}\n {...props}\n />\n )\n }\n)\n\nexport type DrawerTriggerProps = NativePartProps<\"button\">\n\nexport const DrawerTrigger = React.forwardRef<\n HTMLButtonElement,\n DrawerTriggerProps\n>(function DrawerTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Trigger\n ref={ref}\n data-slot=\"drawer-trigger\"\n {...{ [SLOT_ATTR]: \"drawer-trigger\" }}\n className={mergeClasses(!asChild && styles.nativeTrigger, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets DrawerContent supply Base UI's required Portal itself when no DrawerPortal wraps it, as\n// Radix rendered content inline without one.\nconst DrawerPortalPresenceContext = React.createContext(false)\n\nexport type DrawerPortalProps = {\n children?: React.ReactNode\n /** The element the overlay and the content portal into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the overlay and the content mounted while the drawer is closed. */\n forceMount?: true\n}\n\nexport const DrawerPortal = React.forwardRef<HTMLElement, DrawerPortalProps>(\n function DrawerPortal({ container, forceMount, ...props }, ref) {\n return (\n <DrawerPortalPresenceContext.Provider value={true}>\n <DialogPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"drawer-portal\"\n {...{ [SLOT_ATTR]: \"drawer-portal\" }}\n // Radix took any Element or DocumentFragment, null meaning the body. Base UI hands a\n // node straight to createPortal, which takes either, but reads null as \"wait for one\".\n container={(container ?? undefined) as HTMLElement | undefined}\n keepMounted={forceMount}\n {...props}\n />\n </DrawerPortalPresenceContext.Provider>\n )\n }\n)\n\nexport type DrawerOverlayProps = NativePartProps<\"div\"> & {\n /** Kept for compatibility: the overlay stays mounted whenever DrawerPortal's `forceMount` keeps the portal mounted. */\n forceMount?: true\n}\n\nexport const DrawerOverlay = React.forwardRef<\n HTMLDivElement,\n DrawerOverlayProps\n>(function DrawerOverlay(\n { asChild = false, children, className, forceMount: _forceMount, ...props },\n ref\n) {\n const styles = useStyles()\n // The overlay is portalled too, so it re-stamps the boundary's appearance like the content (#8).\n const appearance = useAppearanceAttributes()\n\n return (\n <DialogPrimitive.Backdrop\n ref={ref}\n // Base UI renders no backdrop for a dialog nested in another; Radix's overlay always rendered,\n // dimming the drawer beneath.\n forceRender\n data-slot=\"drawer-overlay\"\n {...{ [SLOT_ATTR]: \"drawer-overlay\" }}\n {...appearance}\n className={mergeClasses(styles.overlay, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DrawerSide = \"left\" | \"right\" | \"top\" | \"bottom\"\n\nexport type DrawerContentProps = NativePartProps<\"div\"> & {\n showCloseButton?: boolean\n /**\n * Accessible name of the built-in close button, read by screen readers. Pass a translated\n * string for any locale other than English. Defaults to \"Close\".\n */\n closeButtonLabel?: string\n side?: DrawerSide\n flush?: boolean\n /**\n * Keeps the content mounted while the drawer is closed. Inside DrawerPortal, the portal's\n * `forceMount` decides.\n */\n forceMount?: true\n /** Called before focus moves into the drawer; `preventDefault()` leaves focus where it is. */\n onOpenAutoFocus?: (event: Event) => void\n /** Called before focus returns on close; `preventDefault()` skips the return. */\n onCloseAutoFocus?: (event: Event) => void\n}\n\nexport const DrawerContent = React.forwardRef<\n HTMLDivElement,\n DrawerContentProps\n>(function DrawerContent(\n {\n asChild = false,\n className,\n children,\n showCloseButton = true,\n closeButtonLabel = \"Close\",\n side = \"right\",\n flush = false,\n forceMount,\n onOpenAutoFocus,\n onCloseAutoFocus,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const hasPortal = React.useContext(DrawerPortalPresenceContext)\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n\n const closeButton = showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"drawer-close\"\n {...{ [SLOT_ATTR]: \"drawer-close\" }}\n className={styles.closeButton}\n >\n <XIcon />\n <span className={styles.srOnly}>{closeButtonLabel}</span>\n </DialogPrimitive.Close>\n )\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the built-in close button joins them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n closeButton\n ),\n }\n : {\n children: (\n <>\n {children}\n {closeButton}\n </>\n ),\n }\n\n const popup = (\n <DialogPrimitive.Popup\n ref={ref}\n data-slot=\"drawer-content\"\n {...{ [SLOT_ATTR]: \"drawer-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n data-side={side}\n initialFocus={radixFocusCallback(onOpenAutoFocus)}\n finalFocus={radixFocusCallback(onCloseAutoFocus)}\n className={mergeClasses(\n styles.content,\n styles[side],\n !flush && styles.contentPadding,\n className\n )}\n {...props}\n {...content}\n />\n )\n\n // Base UI's Popup requires a Portal ancestor; Radix rendered inline without one.\n return hasPortal ? (\n popup\n ) : (\n <DialogPrimitive.Portal keepMounted={forceMount}>\n {popup}\n </DialogPrimitive.Portal>\n )\n})\n\nexport type DrawerCloseProps = NativePartProps<\"button\">\n\nexport const DrawerClose = React.forwardRef<\n HTMLButtonElement,\n DrawerCloseProps\n>(function DrawerClose(\n { asChild = false, className, children, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Close\n ref={ref}\n data-slot=\"drawer-close\"\n {...{ [SLOT_ATTR]: \"drawer-close\" }}\n className={mergeClasses(\n !asChild && styles.nativeTrigger,\n styles.close,\n className\n )}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DrawerHeaderProps = React.ComponentProps<\"div\">\n\nexport const DrawerHeader = React.forwardRef<HTMLDivElement, DrawerHeaderProps>(\n function DrawerHeader({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"drawer-header\"\n {...{ [SLOT_ATTR]: \"drawer-header\" }}\n className={mergeClasses(styles.header, className)}\n {...props}\n />\n )\n }\n)\n\nexport type DrawerFooterProps = React.ComponentProps<\"div\">\n\nexport const DrawerFooter = React.forwardRef<HTMLDivElement, DrawerFooterProps>(\n function DrawerFooter({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"drawer-footer\"\n {...{ [SLOT_ATTR]: \"drawer-footer\" }}\n className={mergeClasses(styles.footer, className)}\n {...props}\n />\n )\n }\n)\n\nexport type DrawerTitleProps = NativePartProps<\"h2\">\n\nexport const DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n DrawerTitleProps\n>(function DrawerTitle(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n {...{ [SLOT_ATTR]: \"drawer-title\" }}\n className={mergeClasses(styles.title, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DrawerDescriptionProps = NativePartProps<\"p\">\n\nexport const DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n DrawerDescriptionProps\n>(function DrawerDescription(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <DialogPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n {...{ [SLOT_ATTR]: \"drawer-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n"],"names":["easeOut","easeIn","useStyles","makeZenithStyles","nativeControl","shorthands","OVERLAY_Z_INDEX","boxModel","tokens.gray2","tokens.spacingLayout1","tokens.radius2xl","tokens.spacingElement1","tokens.grayA1","tokens.accentA8","tokens.spacingElement2","tokens.accentA11","tokens.accentSoft","tokens.textLg","tokens.leadingLg","tokens.fontWeightSemibold","tokens.grayA12","tokens.grayA11","tokens.textSm","tokens.leadingSm","XIcon","React","props","ref","jsx","onlySlotChild","children","elements","slotProps","asChild","child","radixFocusCallback","handler","event","before","moved","Drawer","onOpenChange","_ref","DialogPrimitive","open","eventDetails","DrawerTrigger","className","styles","SLOT_ATTR","mergeClasses","DrawerPortalPresenceContext","DrawerPortal","container","forceMount","DrawerOverlay","_forceMount","appearance","useAppearanceAttributes","DrawerContent","showCloseButton","closeButtonLabel","side","flush","onOpenAutoFocus","onCloseAutoFocus","hasPortal","override","useDensity","closeButton","jsxs","content","Fragment","popup","DrawerClose","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAU,gCACVC,IAAS,8BAETC,IAAYC,EAAiB;AAAA;AAAA;AAAA,EAGjC,eAAe;AAAA,IACb,GAAGC;AAAA,EAAA;AAAA,EAEL,SAAS;AAAA,IACP,UAAU;AAAA,IACV,GAAGC,EAAW,MAAM,CAAC;AAAA,IACrB,QAAQC;AAAA,IACR,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,0BAA0BN;AAAA,IAC1B,0BAA0B,EAAE,SAAS,EAAA;AAAA,IACrC,wBAAwB,EAAE,SAAS,GAAG,0BAA0BC,EAAA;AAAA,IAChE,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,EACtB;AAAA,EAEF,SAAS;AAAA,IACP,GAAGM;AAAA,IACH,iBAAiBC;AAAAA,IACjB,UAAU;AAAA,IACV,QAAQF;AAAA,IACR,SAAS;AAAA,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MAC9C,GAAGrB;AAAA,MACH,GAAGM,EAAUC,GAASH,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGrC,CAAC,GAIYgD,KAAoBrD,EAAM,WAGrC,SACA,EAAE,SAAAQ,IAAU,IAAO,UAAAH,GAAU,WAAAiB,GAAW,GAAGrB,EAAA,GAC3CC,GACA;AACA,QAAMqB,IAAS9C,EAAA;AAEf,SACE,gBAAA0B;AAAA,IAACe,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAhB;AAAA,MACA,aAAU;AAAA,MACJ,CAACsB,CAAS,GAAG;AAAA,MACnB,WAAWC,EAAaF,EAAO,aAAaD,CAAS;AAAA,MACpD,GAAGrB;AAAA,MACH,GAAGM,EAAUC,GAASH,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGrC,CAAC;"}
@@ -5,7 +5,7 @@ import { Menu as f } from "../../_virtual/_zenith-runtime-family_menu.js";
5
5
  import { mergeProps as re } from "../../_virtual/_zenith-runtime-family_merge-props.js";
6
6
  import { Separator as ie } from "../../_virtual/_zenith-runtime-family_separator.js";
7
7
  import { useRender as ae } from "../../_virtual/_zenith-runtime-family_use-render.js";
8
- import { mergeClasses as w, SLOT_ATTR as g, shorthands as P } from "@epilot/zenith-runtime/v1";
8
+ import { mergeClasses as w, SLOT_ATTR as g, shorthands as P } from "@epilot/zenith-runtime/v1/core.js";
9
9
  import { useAppearanceAttributes as V } from "../appearance-boundary/appearance-boundary.js";
10
10
  import { useDensity as J } from "../density-provider/density-provider.js";
11
11
  import { makeZenithStyles as se } from "../../styles/make-styles.js";
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sources":["../../../src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { DirectionProvider } from \"@base-ui/react/direction-provider\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"16px\"\n viewBox=\"0 -960 960 960\"\n width=\"16px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n)\n\nconst ChevronRightIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"16px\"\n viewBox=\"0 -960 960 960\"\n width=\"16px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z\" />\n </svg>\n)\n\nconst CircleIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"8px\"\n viewBox=\"0 -960 960 960\"\n width=\"8px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z\" />\n </svg>\n)\n\nconst easeOut = \"cubic-bezier(0.4, 0, 0.2, 1)\"\nconst easeIn = \"cubic-bezier(0.4, 0, 1, 1)\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n triggerReset: {\n ...nativeControl,\n },\n trigger: {\n color: tokens.accentA11,\n },\n // The positioner is what stacks against other layers, as Radix's popper wrapper did; it also\n // keeps that wrapper's `max-content` floor so the content wraps the same way.\n positioner: {\n zIndex: OVERLAY_Z_INDEX,\n minWidth: \"max-content\",\n outlineStyle: \"none\",\n },\n // Radix's `hideWhenDetached`: Base UI marks the positioner when its anchor scrolls out of view.\n positionerHideWhenDetached: {\n \"&[data-anchor-hidden]\": {\n visibility: \"hidden\",\n pointerEvents: \"none\",\n },\n },\n popup: {\n ...boxModel,\n backgroundColor: tokens.body,\n color: tokens.grayA12,\n minWidth: \"10rem\",\n overflow: \"hidden\",\n ...shorthands.borderRadius(tokens.radiusXl),\n ...shorthands.padding(tokens.spacingElement1),\n // v1 shadow-lg\n boxShadow: \"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a\",\n outlineStyle: \"none\",\n zIndex: OVERLAY_Z_INDEX,\n transformOrigin: \"var(--transform-origin)\",\n transitionProperty: \"opacity, transform\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: easeOut,\n \"&[data-starting-style]\": {\n opacity: 0,\n transform: \"scale(0.95)\",\n },\n \"&[data-starting-style][data-side='bottom']\": {\n transform: `translateY(-${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-starting-style][data-side='left']\": {\n transform: `translateX(${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-starting-style][data-side='right']\": {\n transform: `translateX(-${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-starting-style][data-side='top']\": {\n transform: `translateY(${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-ending-style]\": {\n opacity: 0,\n transform: \"scale(0.95)\",\n transitionDuration: \"100ms\",\n transitionTimingFunction: easeIn,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n \"&[data-ending-style]\": {\n transitionDuration: \"0.01ms\",\n },\n },\n },\n item: {\n ...boxModel,\n position: \"relative\",\n display: \"flex\",\n cursor: \"pointer\",\n userSelect: \"none\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.borderRadius(tokens.radiusMd),\n paddingLeft: tokens.spacingElement2,\n paddingRight: tokens.spacingElement2,\n paddingTop: \"0.375rem\",\n paddingBottom: \"0.375rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n outlineStyle: \"none\",\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n \":focus-visible\": {\n backgroundColor: tokens.accentSoft,\n },\n \"&[data-highlighted]\": {\n backgroundColor: tokens.accentSoft,\n },\n \"&[data-disabled]\": {\n pointerEvents: \"none\",\n opacity: 0.5,\n },\n \"& svg\": {\n pointerEvents: \"none\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n },\n },\n itemInset: {\n ...boxModel,\n paddingLeft: \"2rem\",\n },\n itemDestructive: {\n color: tokens.errorA11,\n \":hover\": {\n backgroundColor: tokens.errorSoft,\n },\n \":focus-visible\": {\n backgroundColor: tokens.errorSoft,\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.errorA8,\n },\n \"&[data-highlighted]\": {\n backgroundColor: tokens.errorSoft,\n },\n },\n itemCheckboxRadio: {\n ...boxModel,\n paddingLeft: \"2rem\",\n paddingRight: tokens.spacingElement2,\n },\n itemIndicatorWrapper: {\n ...boxModel,\n position: \"absolute\",\n left: tokens.spacingElement2,\n display: \"flex\",\n height: \"0.875rem\",\n width: \"0.875rem\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n itemIndicator: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n subTrigger: {\n \"&[data-popup-open]\": {\n backgroundColor: tokens.accentSoft,\n },\n },\n subTriggerChevron: {\n ...boxModel,\n marginLeft: \"auto\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n pointerEvents: \"none\",\n },\n label: {\n ...boxModel,\n paddingLeft: tokens.spacingElement2,\n paddingRight: tokens.spacingElement2,\n paddingTop: \"0.375rem\",\n paddingBottom: \"0.375rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightSemibold,\n },\n separator: {\n ...boxModel,\n marginLeft: `calc(-1 * ${tokens.spacingElement1})`,\n marginRight: `calc(-1 * ${tokens.spacingElement1})`,\n marginTop: tokens.spacingElement1,\n marginBottom: tokens.spacingElement1,\n height: \"1px\",\n backgroundColor: tokens.grayA3,\n },\n shortcut: {\n marginLeft: \"auto\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n letterSpacing: \"0.1em\",\n color: tokens.grayA11,\n },\n})\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\n/**\n * Radix-shaped focus interception over Base UI's `finalFocus`. `preventDefault()` leaves focus\n * where it is; otherwise the default move happens, because Base UI reads a callback that returns\n * `undefined` as \"move nothing\".\n */\nfunction radixFocusCallback(handler: ((event: Event) => void) | undefined) {\n if (!handler) return undefined\n\n return () => {\n const event = new Event(\"focus\", { cancelable: true })\n const before = document.activeElement\n handler(event)\n const moved = document.activeElement\n // Base UI calls `finalFocus` inside React's commit, and React then restores the focus it saw\n // before the commit. Radix ran this handler after the commit, so a handler that moves focus\n // itself has its move applied again once the commit is done.\n if (moved !== before && moved instanceof HTMLElement) {\n queueMicrotask(() => moved.focus())\n }\n return !event.defaultPrevented\n }\n}\n\n/**\n * What `onOpenChange` receives as its second argument, on the menu and on a submenu: Base UI's\n * change details, declared in Zenith. Base UI's own type drags its menu store into the published\n * declarations, and TypeScript 4 cannot parse that store. `event` narrows with `reason`, as it does\n * in Base UI.\n */\ntype DropdownMenuOpenChangeDetails = (\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"trigger-hover\"; event: MouseEvent }\n | { reason: \"trigger-focus\"; event: FocusEvent }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"focus-out\"; event: FocusEvent | KeyboardEvent }\n | { reason: \"list-navigation\"; event: KeyboardEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"item-press\"; event: MouseEvent | KeyboardEvent | PointerEvent }\n | { reason: \"close-press\"; event: MouseEvent | KeyboardEvent | PointerEvent }\n | { reason: \"sibling-open\"; event: Event }\n | { reason: \"cancel-open\"; event: MouseEvent }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the menu in its current state. */\n cancel: () => void\n /** Lets the event propagate where the menu would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the menu's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\ntype OpenChangeHandler = (\n open: boolean,\n eventDetails: DropdownMenuOpenChangeDetails\n) => void\n\n// The Escapes a submenu closed on, which then close the menu above it (`closeParentOnEsc`). Base\n// UI's submenu prevents the event before the parent menu hears of it, so the parent would read it\n// as handled by some other layer.\nconst escapesClosingASubmenu = new WeakSet<Event>()\n\n/**\n * A layer inside the menu (a Volt popover or tooltip, which run on Radix, or a control handling\n * the key itself) prevents the Escape it consumes, but Base UI dismisses regardless, so one Escape\n * would close both. Honour the handled event. Consumers still mix Zenith with Volt on one page,\n * so this stays after the Radix teardown (D12).\n */\nfunction honourHandledEscape(\n onOpenChange: OpenChangeHandler | undefined,\n { submenu = false } = {}\n) {\n return (open: boolean, eventDetails: DropdownMenuOpenChangeDetails) => {\n const escape =\n eventDetails.reason === \"escape-key\" ? eventDetails.event : undefined\n if (escape?.defaultPrevented && !escapesClosingASubmenu.has(escape)) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n if (submenu && escape && !eventDetails.isCanceled) {\n escapesClosingASubmenu.add(escape)\n }\n }\n}\n\n/**\n * What the content of a menu or submenu hands up to its root: Radix took `loop` on the content,\n * Base UI takes `loopFocus` on the root. Both roots start from `false`, Radix's default, where\n * Base UI's menus wrap.\n */\nconst MenuLoopContext = React.createContext<(loop: boolean) => void>(() => {})\n\ntype Direction = \"ltr\" | \"rtl\"\n\n/** The root's `dir`, which Radix also stamped on the content. */\nconst MenuDirContext = React.createContext<Direction | undefined>(undefined)\n\nfunction useLoopOnRoot(loop: boolean | undefined) {\n const setLoop = React.useContext(MenuLoopContext)\n React.useEffect(() => {\n setLoop(loop ?? false)\n }, [setLoop, loop])\n}\n\nexport type DropdownMenuProps = {\n children?: React.ReactNode\n /** The reading direction of the menu and its submenus. Inherits the document's when omitted. */\n dir?: Direction\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the menu opens or closes. `eventDetails.reason` says why (`trigger-press`,\n * `escape-key`, `outside-press`, `item-press`, `focus-out`, …) and `eventDetails.cancel()` keeps\n * the menu in its current state.\n */\n onOpenChange?: OpenChangeHandler\n /**\n * While open, the menu locks page scroll and blocks pointer interaction outside it.\n * @default true\n */\n modal?: boolean\n}\n\nexport const DropdownMenu = React.forwardRef<HTMLElement, DropdownMenuProps>(\n function DropdownMenu({ dir, onOpenChange, children, ...props }, _ref) {\n const [loop, setLoop] = React.useState(false)\n\n const root = (\n <MenuPrimitive.Root\n data-slot=\"dropdown-menu\"\n loopFocus={loop}\n onOpenChange={honourHandledEscape(onOpenChange)}\n {...props}\n >\n <MenuLoopContext.Provider value={setLoop}>\n <MenuDirContext.Provider value={dir}>\n {children}\n </MenuDirContext.Provider>\n </MenuLoopContext.Provider>\n </MenuPrimitive.Root>\n )\n\n return dir ? (\n <DirectionProvider direction={dir}>{root}</DirectionProvider>\n ) : (\n root\n )\n }\n)\n\nexport type DropdownMenuTriggerProps = NativePartProps<\"button\">\n\nexport const DropdownMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n DropdownMenuTriggerProps\n>(function DropdownMenuTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n const child = asChild ? onlySlotChild(children) : undefined\n // Base UI drives a native <button> unless told otherwise; a child that is another intrinsic\n // element gets the ARIA button behaviour Radix's Slot gave it.\n const nativeButton =\n !child || typeof child.type !== \"string\" || child.type === \"button\"\n\n return (\n <MenuPrimitive.Trigger\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-trigger\" }}\n nativeButton={nativeButton}\n className={mergeClasses(\n !asChild && styles.triggerReset,\n styles.trigger,\n className\n )}\n {...props}\n {...(child ? { render: child } : { children })}\n />\n )\n})\n\nexport type DropdownMenuGroupProps = NativePartProps<\"div\">\n\nexport const DropdownMenuGroup = React.forwardRef<\n HTMLDivElement,\n DropdownMenuGroupProps\n>(function DropdownMenuGroup({ asChild = false, children, ...props }, ref) {\n return (\n <MenuPrimitive.Group\n ref={ref}\n data-slot=\"dropdown-menu-group\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-group\" }}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets the content use an enclosing DropdownMenuPortal instead of portalling itself, as Base UI's\n// Popup needs exactly one Portal above it. Content resets it, so a submenu inside portals on its\n// own unless a DropdownMenuPortal of its own wraps it.\nconst DropdownMenuPortalPresenceContext = React.createContext(false)\n\n// The element the content portalled into, so a submenu portals next to it rather than into the\n// body; Radix rendered submenus inline in their parent's content.\nconst DropdownMenuContainerContext = React.createContext<\n HTMLElement | undefined\n>(undefined)\n\n/** Radix took any Element or DocumentFragment, null meaning the body; Base UI reads null as \"wait for one\". */\nfunction portalContainer(\n container: Element | DocumentFragment | null | undefined\n) {\n return (container ?? undefined) as HTMLElement | undefined\n}\n\nexport type DropdownMenuPortalProps = {\n children?: React.ReactNode\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the menu is closed. */\n forceMount?: true\n}\n\nexport const DropdownMenuPortal = React.forwardRef<\n HTMLElement,\n DropdownMenuPortalProps\n>(function DropdownMenuPortal({ container, forceMount, ...props }, ref) {\n return (\n <DropdownMenuPortalPresenceContext.Provider value={true}>\n <DropdownMenuContainerContext.Provider value={portalContainer(container)}>\n <MenuPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"dropdown-menu-portal\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-portal\" }}\n container={portalContainer(container)}\n keepMounted={forceMount}\n {...props}\n />\n </DropdownMenuContainerContext.Provider>\n </DropdownMenuPortalPresenceContext.Provider>\n )\n})\n\nexport type DropdownMenuSubProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the submenu opens or closes, with the same `eventDetails` as DropdownMenu's\n * `onOpenChange`.\n */\n onOpenChange?: OpenChangeHandler\n}\n\nexport const DropdownMenuSub = React.forwardRef<\n HTMLElement,\n DropdownMenuSubProps\n>(function DropdownMenuSub({ onOpenChange, children, ...props }, _ref) {\n const [loop, setLoop] = React.useState(false)\n\n return (\n <MenuPrimitive.SubmenuRoot\n data-slot=\"dropdown-menu-sub\"\n loopFocus={loop}\n // Escape inside a Radix submenu closed the whole menu.\n closeParentOnEsc\n onOpenChange={honourHandledEscape(onOpenChange, { submenu: true })}\n {...props}\n >\n <MenuLoopContext.Provider value={setLoop}>\n {children}\n </MenuLoopContext.Provider>\n </MenuPrimitive.SubmenuRoot>\n )\n})\n\ntype RadixItemProps = {\n disabled?: boolean\n /**\n * Called when the item is chosen by pointer or keyboard. Under Base UI the menu closes\n * regardless; `preventDefault()` no longer keeps it open.\n */\n onSelect?: (event: Event) => void\n /** The text typeahead matches, when the item's content is not plain text. */\n textValue?: string\n}\n\n/** Radix's `onSelect` over Base UI's click handling, which covers pointer and keyboard selection. */\nfunction selectOnClick<Element>(\n onClick: React.MouseEventHandler<Element> | undefined,\n onSelect: ((event: Event) => void) | undefined\n): React.MouseEventHandler<Element> {\n return (event) => {\n onClick?.(event)\n onSelect?.(event.nativeEvent)\n }\n}\n\nexport type DropdownMenuRadioGroupProps = NativePartProps<\"div\"> & {\n value?: string\n onValueChange?: (value: string) => void\n}\n\nexport const DropdownMenuRadioGroup = React.forwardRef<\n HTMLDivElement,\n DropdownMenuRadioGroupProps\n>(function DropdownMenuRadioGroup(\n { asChild = false, children, onValueChange, ...props },\n ref\n) {\n return (\n <MenuPrimitive.RadioGroup\n ref={ref}\n data-slot=\"dropdown-menu-radio-group\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-radio-group\" }}\n onValueChange={\n onValueChange ? (value: string) => onValueChange(value) : undefined\n }\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DropdownMenuSubTriggerProps = NativePartProps<\"div\"> &\n Omit<RadixItemProps, \"onSelect\"> & {\n inset?: boolean\n }\n\nexport const DropdownMenuSubTrigger = React.forwardRef<\n HTMLDivElement,\n DropdownMenuSubTriggerProps\n>(function DropdownMenuSubTrigger(\n { asChild = false, className, inset, textValue, children, ...props },\n ref\n) {\n const styles = useStyles()\n const chevron = <ChevronRightIcon className={styles.subTriggerChevron} />\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the chevron joins them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n chevron\n ),\n }\n : {\n children: (\n <>\n {children}\n {chevron}\n </>\n ),\n }\n\n return (\n <MenuPrimitive.SubmenuTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-sub-trigger\" }}\n label={textValue}\n className={mergeClasses(\n styles.item,\n styles.subTrigger,\n inset && styles.itemInset,\n className\n )}\n {...props}\n {...content}\n />\n )\n})\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\"\ntype Boundary = Element | null\n\n/** Radix's popper props, translated onto Base UI's Positioner. */\ntype PositioningProps = {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n sideOffset?: number\n align?: \"start\" | \"center\" | \"end\"\n alignOffset?: number\n /** Flips and shifts the content to keep it inside the collision boundary. */\n avoidCollisions?: boolean\n collisionBoundary?: Boundary | Boundary[]\n /** Distance from the boundary's edges; `0` unless set. */\n collisionPadding?: number | Partial<Record<Side, number>>\n arrowPadding?: number\n /** `always` keeps the content in the boundary even when its trigger leaves it. */\n sticky?: \"partial\" | \"always\"\n /** Hides the content while its trigger is scrolled out of view. */\n hideWhenDetached?: boolean\n /**\n * Kept for compatibility; has no effect. Base UI repositions the content whenever its trigger\n * or the page moves, and has no per-frame mode.\n */\n updatePositionStrategy?: \"optimized\" | \"always\"\n}\n\nfunction positionerProps({\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions = true,\n collisionBoundary,\n collisionPadding = 0,\n arrowPadding,\n sticky = \"partial\",\n}: PositioningProps) {\n const boundary = (\n Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]\n ).filter((element): element is Element => element != null)\n\n return {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionPadding,\n sticky: sticky === \"always\",\n ...(boundary.length > 0\n ? { collisionBoundary: boundary.length === 1 ? boundary[0] : boundary }\n : {}),\n ...(avoidCollisions\n ? {}\n : {\n collisionAvoidance: {\n side: \"none\",\n align: \"none\",\n fallbackAxisSide: \"none\",\n } as const,\n }),\n }\n}\n\n/** The menu's open content, nested the way Base UI needs it: Portal > Positioner > Popup. */\nfunction MenuPopupLayer({\n container,\n forceMount,\n hideWhenDetached,\n placement,\n popup,\n}: {\n container: Element | DocumentFragment | null | undefined\n forceMount: true | undefined\n hideWhenDetached: boolean | undefined\n placement: ReturnType<typeof positionerProps>\n popup: React.ReactElement\n}) {\n const styles = useStyles()\n const hasPortal = React.useContext(DropdownMenuPortalPresenceContext)\n const inheritedContainer = React.useContext(DropdownMenuContainerContext)\n const ownContainer =\n container === undefined ? inheritedContainer : portalContainer(container)\n\n const positioner = (\n <MenuPrimitive.Positioner\n className={mergeClasses(\n styles.positioner,\n hideWhenDetached && styles.positionerHideWhenDetached\n )}\n {...placement}\n >\n <DropdownMenuPortalPresenceContext.Provider value={false}>\n <DropdownMenuContainerContext.Provider value={ownContainer}>\n {popup}\n </DropdownMenuContainerContext.Provider>\n </DropdownMenuPortalPresenceContext.Provider>\n </MenuPrimitive.Positioner>\n )\n\n // Base UI's Popup requires a Portal ancestor. An enclosing DropdownMenuPortal is that portal\n // unless the content names a container of its own, as its own portal did under Radix.\n return hasPortal && container === undefined ? (\n positioner\n ) : (\n <MenuPrimitive.Portal container={ownContainer} keepMounted={forceMount}>\n {positioner}\n </MenuPrimitive.Portal>\n )\n}\n\n// Radix's content took no `dir`: the root's applies.\nexport type DropdownMenuSubContentProps = Omit<NativePartProps<\"div\">, \"dir\"> &\n Omit<PositioningProps, \"side\" | \"align\"> & {\n /** Keeps the submenu's content mounted while it is closed. */\n forceMount?: true\n /** Moves the highlight from the last item to the first and back with the arrow keys. */\n loop?: boolean\n }\n\nexport const DropdownMenuSubContent = React.forwardRef<\n HTMLDivElement,\n DropdownMenuSubContentProps\n>(function DropdownMenuSubContent(\n {\n asChild = false,\n className,\n children,\n forceMount,\n loop,\n hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment. A submenu\n // portals on its own, so it needs the same independent stamp as the top-level content.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n const dir = React.useContext(MenuDirContext)\n useLoopOnRoot(loop)\n\n return (\n <MenuPopupLayer\n container={undefined}\n forceMount={forceMount}\n hideWhenDetached={hideWhenDetached}\n placement={positionerProps({\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n })}\n popup={\n <MenuPrimitive.Popup\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-sub-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n {...(dir ? { dir } : {})}\n className={mergeClasses(styles.popup, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n }\n />\n )\n})\n\nexport type DropdownMenuContentProps = Omit<NativePartProps<\"div\">, \"dir\"> &\n PositioningProps & {\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the menu is closed. */\n forceMount?: true\n /** Moves the highlight from the last item to the first and back with the arrow keys. */\n loop?: boolean\n /** Called before focus returns to the trigger on close; `preventDefault()` skips the return. */\n onCloseAutoFocus?: (event: Event) => void\n }\n\nexport const DropdownMenuContent = React.forwardRef<\n HTMLDivElement,\n DropdownMenuContentProps\n>(function DropdownMenuContent(\n {\n asChild = false,\n className,\n children,\n container,\n forceMount,\n loop,\n onCloseAutoFocus,\n hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n side,\n sideOffset = 4,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n const dir = React.useContext(MenuDirContext)\n useLoopOnRoot(loop)\n\n return (\n <MenuPopupLayer\n container={container}\n forceMount={forceMount}\n hideWhenDetached={hideWhenDetached}\n placement={positionerProps({\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n })}\n popup={\n <MenuPrimitive.Popup\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n {...(dir ? { dir } : {})}\n finalFocus={radixFocusCallback(onCloseAutoFocus)}\n className={mergeClasses(styles.popup, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n }\n />\n )\n})\n\nexport type DropdownMenuItemProps = Omit<NativePartProps<\"div\">, \"onSelect\"> &\n RadixItemProps & {\n inset?: boolean\n destructive?: boolean\n }\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuItemProps\n>(function DropdownMenuItem(\n {\n asChild = false,\n children,\n className,\n inset,\n destructive,\n textValue,\n onClick,\n onSelect,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n\n return (\n <MenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-item\" }}\n label={textValue}\n onClick={selectOnClick(onClick, onSelect)}\n className={mergeClasses(\n styles.item,\n inset && styles.itemInset,\n destructive && styles.itemDestructive,\n className\n )}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\ntype CheckedState = boolean | \"indeterminate\"\n\nexport type DropdownMenuCheckboxItemProps = Omit<\n NativePartProps<\"div\">,\n \"onSelect\"\n> &\n RadixItemProps & {\n /** `indeterminate` shows the check and reads as mixed; toggling it checks the item. */\n checked?: CheckedState\n /** Called with the new state. Under Base UI the menu stays open after a toggle. */\n onCheckedChange?: (checked: boolean) => void\n }\n\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuCheckboxItemProps\n>(function DropdownMenuCheckboxItem(\n {\n asChild = false,\n className,\n children,\n checked,\n onCheckedChange,\n textValue,\n onClick,\n onSelect,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const indeterminate = checked === \"indeterminate\"\n const indicator = (\n <span className={styles.itemIndicatorWrapper}>\n <MenuPrimitive.CheckboxItemIndicator className={styles.itemIndicator}>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n )\n const child = asChild ? onlySlotChild(children) : undefined\n\n return (\n <MenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-checkbox-item\" }}\n label={textValue}\n onClick={selectOnClick(onClick, onSelect)}\n className={mergeClasses(styles.item, styles.itemCheckboxRadio, className)}\n // Base UI's checkbox item has no mixed state: show it checked, announce it mixed, and check\n // it on toggle, as Radix did.\n checked={indeterminate ? true : checked}\n {...(indeterminate ? { \"aria-checked\": \"mixed\" as const } : {})}\n onCheckedChange={\n onCheckedChange\n ? (next: boolean) => onCheckedChange(indeterminate ? true : next)\n : undefined\n }\n {...props}\n {...(child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n indicator,\n (child.props as { children?: React.ReactNode }).children\n ),\n }\n : {\n children: (\n <>\n {indicator}\n {children}\n </>\n ),\n })}\n />\n )\n})\n\nexport type DropdownMenuRadioItemProps = Omit<\n NativePartProps<\"div\">,\n \"onSelect\"\n> &\n RadixItemProps & {\n value: string\n }\n\nexport const DropdownMenuRadioItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuRadioItemProps\n>(function DropdownMenuRadioItem(\n {\n asChild = false,\n className,\n children,\n textValue,\n onClick,\n onSelect,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const indicator = (\n <span className={styles.itemIndicatorWrapper}>\n <MenuPrimitive.RadioItemIndicator className={styles.itemIndicator}>\n <CircleIcon />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n )\n const child = asChild ? onlySlotChild(children) : undefined\n\n return (\n <MenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-radio-item\" }}\n label={textValue}\n onClick={selectOnClick(onClick, onSelect)}\n className={mergeClasses(styles.item, styles.itemCheckboxRadio, className)}\n {...props}\n {...(child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n indicator,\n (child.props as { children?: React.ReactNode }).children\n ),\n }\n : {\n children: (\n <>\n {indicator}\n {children}\n </>\n ),\n })}\n />\n )\n})\n\nexport type DropdownMenuLabelProps = NativePartProps<\"div\"> & {\n inset?: boolean\n}\n\n// Base UI's GroupLabel throws outside a Group, and labels stand alone at most call sites (data-table\n// included), so the label stays the plain element Radix rendered.\nexport const DropdownMenuLabel = React.forwardRef<\n HTMLDivElement,\n DropdownMenuLabelProps\n>(function DropdownMenuLabel(\n { asChild = false, children, className, inset, ...props },\n ref\n) {\n const styles = useStyles()\n const slot = slotProps(asChild, children)\n\n return useRender({\n render: \"render\" in slot ? slot.render : <div />,\n ref,\n props: mergeProps<\"div\">(\n {\n \"data-slot\": \"dropdown-menu-label\",\n [SLOT_ATTR]: \"dropdown-menu-label\",\n className: mergeClasses(\n styles.label,\n inset && styles.itemInset,\n className\n ),\n } as React.ComponentProps<\"div\">,\n props,\n \"children\" in slot ? { children: slot.children } : {}\n ),\n })\n})\n\nexport type DropdownMenuSeparatorProps = NativePartProps<\"div\">\n\nexport const DropdownMenuSeparator = React.forwardRef<\n HTMLDivElement,\n DropdownMenuSeparatorProps\n>(function DropdownMenuSeparator(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <SeparatorPrimitive\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-separator\" }}\n className={mergeClasses(styles.separator, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<\"span\">\n\nexport const DropdownMenuShortcut = React.forwardRef<\n HTMLSpanElement,\n DropdownMenuShortcutProps\n>(function DropdownMenuShortcut({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-shortcut\" }}\n className={mergeClasses(styles.shortcut, className)}\n {...props}\n />\n )\n})\n"],"names":["CheckIcon","props","jsx","ChevronRightIcon","CircleIcon","easeOut","easeIn","useStyles","makeZenithStyles","nativeControl","tokens.accentA11","OVERLAY_Z_INDEX","boxModel","tokens.body","tokens.grayA12","shorthands","tokens.radiusXl","tokens.spacingElement1","tokens.spacingElement2","tokens.radiusMd","tokens.textSm","tokens.leadingSm","tokens.accentSoft","tokens.errorA11","tokens.errorSoft","tokens.errorA8","tokens.fontWeightSemibold","tokens.grayA3","tokens.textXs","tokens.leadingXs","tokens.grayA11","onlySlotChild","children","elements","React","slotProps","asChild","child","radixFocusCallback","handler","event","before","moved","escapesClosingASubmenu","honourHandledEscape","onOpenChange","submenu","open","eventDetails","escape","MenuLoopContext","MenuDirContext","useLoopOnRoot","loop","setLoop","DropdownMenu","dir","_ref","root","MenuPrimitive","DirectionProvider","DropdownMenuTrigger","className","ref","styles","nativeButton","SLOT_ATTR","mergeClasses","DropdownMenuGroup","DropdownMenuPortalPresenceContext","DropdownMenuContainerContext","portalContainer","container","DropdownMenuPortal","forceMount","DropdownMenuSub","selectOnClick","onClick","onSelect","DropdownMenuRadioGroup","onValueChange","value","DropdownMenuSubTrigger","inset","textValue","chevron","content","jsxs","Fragment","positionerProps","side","sideOffset","align","alignOffset","avoidCollisions","collisionBoundary","collisionPadding","arrowPadding","sticky","boundary","element","MenuPopupLayer","hideWhenDetached","placement","popup","hasPortal","inheritedContainer","ownContainer","positioner","DropdownMenuSubContent","_updatePositionStrategy","override","useDensity","appearance","useAppearanceAttributes","DropdownMenuContent","onCloseAutoFocus","DropdownMenuItem","destructive","DropdownMenuCheckboxItem","checked","onCheckedChange","indeterminate","indicator","next","DropdownMenuRadioItem","DropdownMenuLabel","slot","useRender","mergeProps","DropdownMenuSeparator","SeparatorPrimitive","DropdownMenuShortcut"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAMA,KAAY,CAACC,MACjB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,MAAK;AAAA,IACJ,GAAGD;AAAA,IAEJ,UAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,uJAAA,CAAuJ;AAAA,EAAA;AACjK,GAGIC,KAAmB,CAACF,MACxB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SA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dropdown-menu.js","sources":["../../../src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { DirectionProvider } from \"@base-ui/react/direction-provider\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"16px\"\n viewBox=\"0 -960 960 960\"\n width=\"16px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n)\n\nconst ChevronRightIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"16px\"\n viewBox=\"0 -960 960 960\"\n width=\"16px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z\" />\n </svg>\n)\n\nconst CircleIcon = (props: React.SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"8px\"\n viewBox=\"0 -960 960 960\"\n width=\"8px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z\" />\n </svg>\n)\n\nconst easeOut = \"cubic-bezier(0.4, 0, 0.2, 1)\"\nconst easeIn = \"cubic-bezier(0.4, 0, 1, 1)\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n triggerReset: {\n ...nativeControl,\n },\n trigger: {\n color: tokens.accentA11,\n },\n // The positioner is what stacks against other layers, as Radix's popper wrapper did; it also\n // keeps that wrapper's `max-content` floor so the content wraps the same way.\n positioner: {\n zIndex: OVERLAY_Z_INDEX,\n minWidth: \"max-content\",\n outlineStyle: \"none\",\n },\n // Radix's `hideWhenDetached`: Base UI marks the positioner when its anchor scrolls out of view.\n positionerHideWhenDetached: {\n \"&[data-anchor-hidden]\": {\n visibility: \"hidden\",\n pointerEvents: \"none\",\n },\n },\n popup: {\n ...boxModel,\n backgroundColor: tokens.body,\n color: tokens.grayA12,\n minWidth: \"10rem\",\n overflow: \"hidden\",\n ...shorthands.borderRadius(tokens.radiusXl),\n ...shorthands.padding(tokens.spacingElement1),\n // v1 shadow-lg\n boxShadow: \"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a\",\n outlineStyle: \"none\",\n zIndex: OVERLAY_Z_INDEX,\n transformOrigin: \"var(--transform-origin)\",\n transitionProperty: \"opacity, transform\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: easeOut,\n \"&[data-starting-style]\": {\n opacity: 0,\n transform: \"scale(0.95)\",\n },\n \"&[data-starting-style][data-side='bottom']\": {\n transform: `translateY(-${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-starting-style][data-side='left']\": {\n transform: `translateX(${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-starting-style][data-side='right']\": {\n transform: `translateX(-${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-starting-style][data-side='top']\": {\n transform: `translateY(${tokens.spacingElement2}) scale(0.95)`,\n },\n \"&[data-ending-style]\": {\n opacity: 0,\n transform: \"scale(0.95)\",\n transitionDuration: \"100ms\",\n transitionTimingFunction: easeIn,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n \"&[data-ending-style]\": {\n transitionDuration: \"0.01ms\",\n },\n },\n },\n item: {\n ...boxModel,\n position: \"relative\",\n display: \"flex\",\n cursor: \"pointer\",\n userSelect: \"none\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.borderRadius(tokens.radiusMd),\n paddingLeft: tokens.spacingElement2,\n paddingRight: tokens.spacingElement2,\n paddingTop: \"0.375rem\",\n paddingBottom: \"0.375rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n outlineStyle: \"none\",\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n \":focus-visible\": {\n backgroundColor: tokens.accentSoft,\n },\n \"&[data-highlighted]\": {\n backgroundColor: tokens.accentSoft,\n },\n \"&[data-disabled]\": {\n pointerEvents: \"none\",\n opacity: 0.5,\n },\n \"& svg\": {\n pointerEvents: \"none\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n },\n },\n itemInset: {\n ...boxModel,\n paddingLeft: \"2rem\",\n },\n itemDestructive: {\n color: tokens.errorA11,\n \":hover\": {\n backgroundColor: tokens.errorSoft,\n },\n \":focus-visible\": {\n backgroundColor: tokens.errorSoft,\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.errorA8,\n },\n \"&[data-highlighted]\": {\n backgroundColor: tokens.errorSoft,\n },\n },\n itemCheckboxRadio: {\n ...boxModel,\n paddingLeft: \"2rem\",\n paddingRight: tokens.spacingElement2,\n },\n itemIndicatorWrapper: {\n ...boxModel,\n position: \"absolute\",\n left: tokens.spacingElement2,\n display: \"flex\",\n height: \"0.875rem\",\n width: \"0.875rem\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n itemIndicator: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n subTrigger: {\n \"&[data-popup-open]\": {\n backgroundColor: tokens.accentSoft,\n },\n },\n subTriggerChevron: {\n ...boxModel,\n marginLeft: \"auto\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n pointerEvents: \"none\",\n },\n label: {\n ...boxModel,\n paddingLeft: tokens.spacingElement2,\n paddingRight: tokens.spacingElement2,\n paddingTop: \"0.375rem\",\n paddingBottom: \"0.375rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightSemibold,\n },\n separator: {\n ...boxModel,\n marginLeft: `calc(-1 * ${tokens.spacingElement1})`,\n marginRight: `calc(-1 * ${tokens.spacingElement1})`,\n marginTop: tokens.spacingElement1,\n marginBottom: tokens.spacingElement1,\n height: \"1px\",\n backgroundColor: tokens.grayA3,\n },\n shortcut: {\n marginLeft: \"auto\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n letterSpacing: \"0.1em\",\n color: tokens.grayA11,\n },\n})\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\n/**\n * Radix-shaped focus interception over Base UI's `finalFocus`. `preventDefault()` leaves focus\n * where it is; otherwise the default move happens, because Base UI reads a callback that returns\n * `undefined` as \"move nothing\".\n */\nfunction radixFocusCallback(handler: ((event: Event) => void) | undefined) {\n if (!handler) return undefined\n\n return () => {\n const event = new Event(\"focus\", { cancelable: true })\n const before = document.activeElement\n handler(event)\n const moved = document.activeElement\n // Base UI calls `finalFocus` inside React's commit, and React then restores the focus it saw\n // before the commit. Radix ran this handler after the commit, so a handler that moves focus\n // itself has its move applied again once the commit is done.\n if (moved !== before && moved instanceof HTMLElement) {\n queueMicrotask(() => moved.focus())\n }\n return !event.defaultPrevented\n }\n}\n\n/**\n * What `onOpenChange` receives as its second argument, on the menu and on a submenu: Base UI's\n * change details, declared in Zenith. Base UI's own type drags its menu store into the published\n * declarations, and TypeScript 4 cannot parse that store. `event` narrows with `reason`, as it does\n * in Base UI.\n */\ntype DropdownMenuOpenChangeDetails = (\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"trigger-hover\"; event: MouseEvent }\n | { reason: \"trigger-focus\"; event: FocusEvent }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"focus-out\"; event: FocusEvent | KeyboardEvent }\n | { reason: \"list-navigation\"; event: KeyboardEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"item-press\"; event: MouseEvent | KeyboardEvent | PointerEvent }\n | { reason: \"close-press\"; event: MouseEvent | KeyboardEvent | PointerEvent }\n | { reason: \"sibling-open\"; event: Event }\n | { reason: \"cancel-open\"; event: MouseEvent }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the menu in its current state. */\n cancel: () => void\n /** Lets the event propagate where the menu would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the menu's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\ntype OpenChangeHandler = (\n open: boolean,\n eventDetails: DropdownMenuOpenChangeDetails\n) => void\n\n// The Escapes a submenu closed on, which then close the menu above it (`closeParentOnEsc`). Base\n// UI's submenu prevents the event before the parent menu hears of it, so the parent would read it\n// as handled by some other layer.\nconst escapesClosingASubmenu = new WeakSet<Event>()\n\n/**\n * A layer inside the menu (a Volt popover or tooltip, which run on Radix, or a control handling\n * the key itself) prevents the Escape it consumes, but Base UI dismisses regardless, so one Escape\n * would close both. Honour the handled event. Consumers still mix Zenith with Volt on one page,\n * so this stays after the Radix teardown (D12).\n */\nfunction honourHandledEscape(\n onOpenChange: OpenChangeHandler | undefined,\n { submenu = false } = {}\n) {\n return (open: boolean, eventDetails: DropdownMenuOpenChangeDetails) => {\n const escape =\n eventDetails.reason === \"escape-key\" ? eventDetails.event : undefined\n if (escape?.defaultPrevented && !escapesClosingASubmenu.has(escape)) {\n eventDetails.cancel()\n return\n }\n onOpenChange?.(open, eventDetails)\n if (submenu && escape && !eventDetails.isCanceled) {\n escapesClosingASubmenu.add(escape)\n }\n }\n}\n\n/**\n * What the content of a menu or submenu hands up to its root: Radix took `loop` on the content,\n * Base UI takes `loopFocus` on the root. Both roots start from `false`, Radix's default, where\n * Base UI's menus wrap.\n */\nconst MenuLoopContext = React.createContext<(loop: boolean) => void>(() => {})\n\ntype Direction = \"ltr\" | \"rtl\"\n\n/** The root's `dir`, which Radix also stamped on the content. */\nconst MenuDirContext = React.createContext<Direction | undefined>(undefined)\n\nfunction useLoopOnRoot(loop: boolean | undefined) {\n const setLoop = React.useContext(MenuLoopContext)\n React.useEffect(() => {\n setLoop(loop ?? false)\n }, [setLoop, loop])\n}\n\nexport type DropdownMenuProps = {\n children?: React.ReactNode\n /** The reading direction of the menu and its submenus. Inherits the document's when omitted. */\n dir?: Direction\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the menu opens or closes. `eventDetails.reason` says why (`trigger-press`,\n * `escape-key`, `outside-press`, `item-press`, `focus-out`, …) and `eventDetails.cancel()` keeps\n * the menu in its current state.\n */\n onOpenChange?: OpenChangeHandler\n /**\n * While open, the menu locks page scroll and blocks pointer interaction outside it.\n * @default true\n */\n modal?: boolean\n}\n\nexport const DropdownMenu = React.forwardRef<HTMLElement, DropdownMenuProps>(\n function DropdownMenu({ dir, onOpenChange, children, ...props }, _ref) {\n const [loop, setLoop] = React.useState(false)\n\n const root = (\n <MenuPrimitive.Root\n data-slot=\"dropdown-menu\"\n loopFocus={loop}\n onOpenChange={honourHandledEscape(onOpenChange)}\n {...props}\n >\n <MenuLoopContext.Provider value={setLoop}>\n <MenuDirContext.Provider value={dir}>\n {children}\n </MenuDirContext.Provider>\n </MenuLoopContext.Provider>\n </MenuPrimitive.Root>\n )\n\n return dir ? (\n <DirectionProvider direction={dir}>{root}</DirectionProvider>\n ) : (\n root\n )\n }\n)\n\nexport type DropdownMenuTriggerProps = NativePartProps<\"button\">\n\nexport const DropdownMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n DropdownMenuTriggerProps\n>(function DropdownMenuTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n const child = asChild ? onlySlotChild(children) : undefined\n // Base UI drives a native <button> unless told otherwise; a child that is another intrinsic\n // element gets the ARIA button behaviour Radix's Slot gave it.\n const nativeButton =\n !child || typeof child.type !== \"string\" || child.type === \"button\"\n\n return (\n <MenuPrimitive.Trigger\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-trigger\" }}\n nativeButton={nativeButton}\n className={mergeClasses(\n !asChild && styles.triggerReset,\n styles.trigger,\n className\n )}\n {...props}\n {...(child ? { render: child } : { children })}\n />\n )\n})\n\nexport type DropdownMenuGroupProps = NativePartProps<\"div\">\n\nexport const DropdownMenuGroup = React.forwardRef<\n HTMLDivElement,\n DropdownMenuGroupProps\n>(function DropdownMenuGroup({ asChild = false, children, ...props }, ref) {\n return (\n <MenuPrimitive.Group\n ref={ref}\n data-slot=\"dropdown-menu-group\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-group\" }}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets the content use an enclosing DropdownMenuPortal instead of portalling itself, as Base UI's\n// Popup needs exactly one Portal above it. Content resets it, so a submenu inside portals on its\n// own unless a DropdownMenuPortal of its own wraps it.\nconst DropdownMenuPortalPresenceContext = React.createContext(false)\n\n// The element the content portalled into, so a submenu portals next to it rather than into the\n// body; Radix rendered submenus inline in their parent's content.\nconst DropdownMenuContainerContext = React.createContext<\n HTMLElement | undefined\n>(undefined)\n\n/** Radix took any Element or DocumentFragment, null meaning the body; Base UI reads null as \"wait for one\". */\nfunction portalContainer(\n container: Element | DocumentFragment | null | undefined\n) {\n return (container ?? undefined) as HTMLElement | undefined\n}\n\nexport type DropdownMenuPortalProps = {\n children?: React.ReactNode\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the menu is closed. */\n forceMount?: true\n}\n\nexport const DropdownMenuPortal = React.forwardRef<\n HTMLElement,\n DropdownMenuPortalProps\n>(function DropdownMenuPortal({ container, forceMount, ...props }, ref) {\n return (\n <DropdownMenuPortalPresenceContext.Provider value={true}>\n <DropdownMenuContainerContext.Provider value={portalContainer(container)}>\n <MenuPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"dropdown-menu-portal\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-portal\" }}\n container={portalContainer(container)}\n keepMounted={forceMount}\n {...props}\n />\n </DropdownMenuContainerContext.Provider>\n </DropdownMenuPortalPresenceContext.Provider>\n )\n})\n\nexport type DropdownMenuSubProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the submenu opens or closes, with the same `eventDetails` as DropdownMenu's\n * `onOpenChange`.\n */\n onOpenChange?: OpenChangeHandler\n}\n\nexport const DropdownMenuSub = React.forwardRef<\n HTMLElement,\n DropdownMenuSubProps\n>(function DropdownMenuSub({ onOpenChange, children, ...props }, _ref) {\n const [loop, setLoop] = React.useState(false)\n\n return (\n <MenuPrimitive.SubmenuRoot\n data-slot=\"dropdown-menu-sub\"\n loopFocus={loop}\n // Escape inside a Radix submenu closed the whole menu.\n closeParentOnEsc\n onOpenChange={honourHandledEscape(onOpenChange, { submenu: true })}\n {...props}\n >\n <MenuLoopContext.Provider value={setLoop}>\n {children}\n </MenuLoopContext.Provider>\n </MenuPrimitive.SubmenuRoot>\n )\n})\n\ntype RadixItemProps = {\n disabled?: boolean\n /**\n * Called when the item is chosen by pointer or keyboard. Under Base UI the menu closes\n * regardless; `preventDefault()` no longer keeps it open.\n */\n onSelect?: (event: Event) => void\n /** The text typeahead matches, when the item's content is not plain text. */\n textValue?: string\n}\n\n/** Radix's `onSelect` over Base UI's click handling, which covers pointer and keyboard selection. */\nfunction selectOnClick<Element>(\n onClick: React.MouseEventHandler<Element> | undefined,\n onSelect: ((event: Event) => void) | undefined\n): React.MouseEventHandler<Element> {\n return (event) => {\n onClick?.(event)\n onSelect?.(event.nativeEvent)\n }\n}\n\nexport type DropdownMenuRadioGroupProps = NativePartProps<\"div\"> & {\n value?: string\n onValueChange?: (value: string) => void\n}\n\nexport const DropdownMenuRadioGroup = React.forwardRef<\n HTMLDivElement,\n DropdownMenuRadioGroupProps\n>(function DropdownMenuRadioGroup(\n { asChild = false, children, onValueChange, ...props },\n ref\n) {\n return (\n <MenuPrimitive.RadioGroup\n ref={ref}\n data-slot=\"dropdown-menu-radio-group\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-radio-group\" }}\n onValueChange={\n onValueChange ? (value: string) => onValueChange(value) : undefined\n }\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DropdownMenuSubTriggerProps = NativePartProps<\"div\"> &\n Omit<RadixItemProps, \"onSelect\"> & {\n inset?: boolean\n }\n\nexport const DropdownMenuSubTrigger = React.forwardRef<\n HTMLDivElement,\n DropdownMenuSubTriggerProps\n>(function DropdownMenuSubTrigger(\n { asChild = false, className, inset, textValue, children, ...props },\n ref\n) {\n const styles = useStyles()\n const chevron = <ChevronRightIcon className={styles.subTriggerChevron} />\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the chevron joins them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n chevron\n ),\n }\n : {\n children: (\n <>\n {children}\n {chevron}\n </>\n ),\n }\n\n return (\n <MenuPrimitive.SubmenuTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-sub-trigger\" }}\n label={textValue}\n className={mergeClasses(\n styles.item,\n styles.subTrigger,\n inset && styles.itemInset,\n className\n )}\n {...props}\n {...content}\n />\n )\n})\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\"\ntype Boundary = Element | null\n\n/** Radix's popper props, translated onto Base UI's Positioner. */\ntype PositioningProps = {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n sideOffset?: number\n align?: \"start\" | \"center\" | \"end\"\n alignOffset?: number\n /** Flips and shifts the content to keep it inside the collision boundary. */\n avoidCollisions?: boolean\n collisionBoundary?: Boundary | Boundary[]\n /** Distance from the boundary's edges; `0` unless set. */\n collisionPadding?: number | Partial<Record<Side, number>>\n arrowPadding?: number\n /** `always` keeps the content in the boundary even when its trigger leaves it. */\n sticky?: \"partial\" | \"always\"\n /** Hides the content while its trigger is scrolled out of view. */\n hideWhenDetached?: boolean\n /**\n * Kept for compatibility; has no effect. Base UI repositions the content whenever its trigger\n * or the page moves, and has no per-frame mode.\n */\n updatePositionStrategy?: \"optimized\" | \"always\"\n}\n\nfunction positionerProps({\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions = true,\n collisionBoundary,\n collisionPadding = 0,\n arrowPadding,\n sticky = \"partial\",\n}: PositioningProps) {\n const boundary = (\n Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]\n ).filter((element): element is Element => element != null)\n\n return {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionPadding,\n sticky: sticky === \"always\",\n ...(boundary.length > 0\n ? { collisionBoundary: boundary.length === 1 ? boundary[0] : boundary }\n : {}),\n ...(avoidCollisions\n ? {}\n : {\n collisionAvoidance: {\n side: \"none\",\n align: \"none\",\n fallbackAxisSide: \"none\",\n } as const,\n }),\n }\n}\n\n/** The menu's open content, nested the way Base UI needs it: Portal > Positioner > Popup. */\nfunction MenuPopupLayer({\n container,\n forceMount,\n hideWhenDetached,\n placement,\n popup,\n}: {\n container: Element | DocumentFragment | null | undefined\n forceMount: true | undefined\n hideWhenDetached: boolean | undefined\n placement: ReturnType<typeof positionerProps>\n popup: React.ReactElement\n}) {\n const styles = useStyles()\n const hasPortal = React.useContext(DropdownMenuPortalPresenceContext)\n const inheritedContainer = React.useContext(DropdownMenuContainerContext)\n const ownContainer =\n container === undefined ? inheritedContainer : portalContainer(container)\n\n const positioner = (\n <MenuPrimitive.Positioner\n className={mergeClasses(\n styles.positioner,\n hideWhenDetached && styles.positionerHideWhenDetached\n )}\n {...placement}\n >\n <DropdownMenuPortalPresenceContext.Provider value={false}>\n <DropdownMenuContainerContext.Provider value={ownContainer}>\n {popup}\n </DropdownMenuContainerContext.Provider>\n </DropdownMenuPortalPresenceContext.Provider>\n </MenuPrimitive.Positioner>\n )\n\n // Base UI's Popup requires a Portal ancestor. An enclosing DropdownMenuPortal is that portal\n // unless the content names a container of its own, as its own portal did under Radix.\n return hasPortal && container === undefined ? (\n positioner\n ) : (\n <MenuPrimitive.Portal container={ownContainer} keepMounted={forceMount}>\n {positioner}\n </MenuPrimitive.Portal>\n )\n}\n\n// Radix's content took no `dir`: the root's applies.\nexport type DropdownMenuSubContentProps = Omit<NativePartProps<\"div\">, \"dir\"> &\n Omit<PositioningProps, \"side\" | \"align\"> & {\n /** Keeps the submenu's content mounted while it is closed. */\n forceMount?: true\n /** Moves the highlight from the last item to the first and back with the arrow keys. */\n loop?: boolean\n }\n\nexport const DropdownMenuSubContent = React.forwardRef<\n HTMLDivElement,\n DropdownMenuSubContentProps\n>(function DropdownMenuSubContent(\n {\n asChild = false,\n className,\n children,\n forceMount,\n loop,\n hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment. A submenu\n // portals on its own, so it needs the same independent stamp as the top-level content.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n const dir = React.useContext(MenuDirContext)\n useLoopOnRoot(loop)\n\n return (\n <MenuPopupLayer\n container={undefined}\n forceMount={forceMount}\n hideWhenDetached={hideWhenDetached}\n placement={positionerProps({\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n })}\n popup={\n <MenuPrimitive.Popup\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-sub-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n {...(dir ? { dir } : {})}\n className={mergeClasses(styles.popup, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n }\n />\n )\n})\n\nexport type DropdownMenuContentProps = Omit<NativePartProps<\"div\">, \"dir\"> &\n PositioningProps & {\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the menu is closed. */\n forceMount?: true\n /** Moves the highlight from the last item to the first and back with the arrow keys. */\n loop?: boolean\n /** Called before focus returns to the trigger on close; `preventDefault()` skips the return. */\n onCloseAutoFocus?: (event: Event) => void\n }\n\nexport const DropdownMenuContent = React.forwardRef<\n HTMLDivElement,\n DropdownMenuContentProps\n>(function DropdownMenuContent(\n {\n asChild = false,\n className,\n children,\n container,\n forceMount,\n loop,\n onCloseAutoFocus,\n hideWhenDetached,\n updatePositionStrategy: _updatePositionStrategy,\n side,\n sideOffset = 4,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n const dir = React.useContext(MenuDirContext)\n useLoopOnRoot(loop)\n\n return (\n <MenuPopupLayer\n container={container}\n forceMount={forceMount}\n hideWhenDetached={hideWhenDetached}\n placement={positionerProps({\n side,\n sideOffset,\n align,\n alignOffset,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n arrowPadding,\n sticky,\n })}\n popup={\n <MenuPrimitive.Popup\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n {...(dir ? { dir } : {})}\n finalFocus={radixFocusCallback(onCloseAutoFocus)}\n className={mergeClasses(styles.popup, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n }\n />\n )\n})\n\nexport type DropdownMenuItemProps = Omit<NativePartProps<\"div\">, \"onSelect\"> &\n RadixItemProps & {\n inset?: boolean\n destructive?: boolean\n }\n\nexport const DropdownMenuItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuItemProps\n>(function DropdownMenuItem(\n {\n asChild = false,\n children,\n className,\n inset,\n destructive,\n textValue,\n onClick,\n onSelect,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n\n return (\n <MenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-item\" }}\n label={textValue}\n onClick={selectOnClick(onClick, onSelect)}\n className={mergeClasses(\n styles.item,\n inset && styles.itemInset,\n destructive && styles.itemDestructive,\n className\n )}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\ntype CheckedState = boolean | \"indeterminate\"\n\nexport type DropdownMenuCheckboxItemProps = Omit<\n NativePartProps<\"div\">,\n \"onSelect\"\n> &\n RadixItemProps & {\n /** `indeterminate` shows the check and reads as mixed; toggling it checks the item. */\n checked?: CheckedState\n /** Called with the new state. Under Base UI the menu stays open after a toggle. */\n onCheckedChange?: (checked: boolean) => void\n }\n\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuCheckboxItemProps\n>(function DropdownMenuCheckboxItem(\n {\n asChild = false,\n className,\n children,\n checked,\n onCheckedChange,\n textValue,\n onClick,\n onSelect,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const indeterminate = checked === \"indeterminate\"\n const indicator = (\n <span className={styles.itemIndicatorWrapper}>\n <MenuPrimitive.CheckboxItemIndicator className={styles.itemIndicator}>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n )\n const child = asChild ? onlySlotChild(children) : undefined\n\n return (\n <MenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-checkbox-item\" }}\n label={textValue}\n onClick={selectOnClick(onClick, onSelect)}\n className={mergeClasses(styles.item, styles.itemCheckboxRadio, className)}\n // Base UI's checkbox item has no mixed state: show it checked, announce it mixed, and check\n // it on toggle, as Radix did.\n checked={indeterminate ? true : checked}\n {...(indeterminate ? { \"aria-checked\": \"mixed\" as const } : {})}\n onCheckedChange={\n onCheckedChange\n ? (next: boolean) => onCheckedChange(indeterminate ? true : next)\n : undefined\n }\n {...props}\n {...(child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n indicator,\n (child.props as { children?: React.ReactNode }).children\n ),\n }\n : {\n children: (\n <>\n {indicator}\n {children}\n </>\n ),\n })}\n />\n )\n})\n\nexport type DropdownMenuRadioItemProps = Omit<\n NativePartProps<\"div\">,\n \"onSelect\"\n> &\n RadixItemProps & {\n value: string\n }\n\nexport const DropdownMenuRadioItem = React.forwardRef<\n HTMLDivElement,\n DropdownMenuRadioItemProps\n>(function DropdownMenuRadioItem(\n {\n asChild = false,\n className,\n children,\n textValue,\n onClick,\n onSelect,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const indicator = (\n <span className={styles.itemIndicatorWrapper}>\n <MenuPrimitive.RadioItemIndicator className={styles.itemIndicator}>\n <CircleIcon />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n )\n const child = asChild ? onlySlotChild(children) : undefined\n\n return (\n <MenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-radio-item\" }}\n label={textValue}\n onClick={selectOnClick(onClick, onSelect)}\n className={mergeClasses(styles.item, styles.itemCheckboxRadio, className)}\n {...props}\n {...(child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n indicator,\n (child.props as { children?: React.ReactNode }).children\n ),\n }\n : {\n children: (\n <>\n {indicator}\n {children}\n </>\n ),\n })}\n />\n )\n})\n\nexport type DropdownMenuLabelProps = NativePartProps<\"div\"> & {\n inset?: boolean\n}\n\n// Base UI's GroupLabel throws outside a Group, and labels stand alone at most call sites (data-table\n// included), so the label stays the plain element Radix rendered.\nexport const DropdownMenuLabel = React.forwardRef<\n HTMLDivElement,\n DropdownMenuLabelProps\n>(function DropdownMenuLabel(\n { asChild = false, children, className, inset, ...props },\n ref\n) {\n const styles = useStyles()\n const slot = slotProps(asChild, children)\n\n return useRender({\n render: \"render\" in slot ? slot.render : <div />,\n ref,\n props: mergeProps<\"div\">(\n {\n \"data-slot\": \"dropdown-menu-label\",\n [SLOT_ATTR]: \"dropdown-menu-label\",\n className: mergeClasses(\n styles.label,\n inset && styles.itemInset,\n className\n ),\n } as React.ComponentProps<\"div\">,\n props,\n \"children\" in slot ? { children: slot.children } : {}\n ),\n })\n})\n\nexport type DropdownMenuSeparatorProps = NativePartProps<\"div\">\n\nexport const DropdownMenuSeparator = React.forwardRef<\n HTMLDivElement,\n DropdownMenuSeparatorProps\n>(function DropdownMenuSeparator(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <SeparatorPrimitive\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-separator\" }}\n className={mergeClasses(styles.separator, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<\"span\">\n\nexport const DropdownMenuShortcut = React.forwardRef<\n HTMLSpanElement,\n DropdownMenuShortcutProps\n>(function DropdownMenuShortcut({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n {...{ [SLOT_ATTR]: \"dropdown-menu-shortcut\" }}\n className={mergeClasses(styles.shortcut, className)}\n {...props}\n />\n )\n})\n"],"names":["CheckIcon","props","jsx","ChevronRightIcon","CircleIcon","easeOut","easeIn","useStyles","makeZenithStyles","nativeControl","tokens.accentA11","OVERLAY_Z_INDEX","boxModel","tokens.body","tokens.grayA12","shorthands","tokens.radiusXl","tokens.spacingElement1","tokens.spacingElement2","tokens.radiusMd","tokens.textSm","tokens.leadingSm","tokens.accentSoft","tokens.errorA11","tokens.errorSoft","tokens.errorA8","tokens.fontWeightSemibold","tokens.grayA3","tokens.textXs","tokens.leadingXs","tokens.grayA11","onlySlotChild","children","elements","React","slotProps","asChild","child","radixFocusCallback","handler","event","before","moved","escapesClosingASubmenu","honourHandledEscape","onOpenChange","submenu","open","eventDetails","escape","MenuLoopContext","MenuDirContext","useLoopOnRoot","loop","setLoop","DropdownMenu","dir","_ref","root","MenuPrimitive","DirectionProvider","DropdownMenuTrigger","className","ref","styles","nativeButton","SLOT_ATTR","mergeClasses","DropdownMenuGroup","DropdownMenuPortalPresenceContext","DropdownMenuContainerContext","portalContainer","container","DropdownMenuPortal","forceMount","DropdownMenuSub","selectOnClick","onClick","onSelect","DropdownMenuRadioGroup","onValueChange","value","DropdownMenuSubTrigger","inset","textValue","chevron","content","jsxs","Fragment","positionerProps","side","sideOffset","align","alignOffset","avoidCollisions","collisionBoundary","collisionPadding","arrowPadding","sticky","boundary","element","MenuPopupLayer","hideWhenDetached","placement","popup","hasPortal","inheritedContainer","ownContainer","positioner","DropdownMenuSubContent","_updatePositionStrategy","override","useDensity","appearance","useAppearanceAttributes","DropdownMenuContent","onCloseAutoFocus","DropdownMenuItem","destructive","DropdownMenuCheckboxItem","checked","onCheckedChange","indeterminate","indicator","next","DropdownMenuRadioItem","DropdownMenuLabel","slot","useRender","mergeProps","DropdownMenuSeparator","SeparatorPrimitive","DropdownMenuShortcut"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAMA,KAAY,CAACC,MACjB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR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