@zj-dynamics/components 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (674) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.react-is +21 -0
  3. package/NOTICE.tabbable +22 -0
  4. package/README.md +31 -2
  5. package/compatibility.css +2 -0
  6. package/dist/Button.d.ts +90 -0
  7. package/dist/Button.js +58 -0
  8. package/dist/ButtonDismiss.d.ts +6 -0
  9. package/dist/ButtonDismiss.js +5 -0
  10. package/dist/Dialog.d.ts +75 -0
  11. package/dist/Dialog.js +59 -0
  12. package/dist/Icon.d.ts +20 -0
  13. package/dist/Icon.js +11 -0
  14. package/dist/InputText.d.ts +26 -0
  15. package/dist/InputText.js +63 -0
  16. package/dist/Switch.d.ts +8 -0
  17. package/dist/Switch.js +19 -0
  18. package/dist/Toast.d.ts +21 -0
  19. package/dist/Toast.js +58 -0
  20. package/dist/browserFocus.d.ts +11 -0
  21. package/dist/browserFocus.js +85 -0
  22. package/dist/browserHooks.d.ts +5 -0
  23. package/dist/browserHooks.js +4 -0
  24. package/dist/index.d.ts +100 -0
  25. package/dist/index.js +91 -0
  26. package/dist/legacyModalPortal.d.ts +1 -0
  27. package/dist/legacyModalPortal.js +2 -0
  28. package/dist/mockViewportWidth.d.ts +5 -0
  29. package/dist/mockViewportWidth.js +58 -0
  30. package/dist/slotChildren.d.ts +2 -0
  31. package/dist/slotChildren.js +6 -0
  32. package/dist/theme.d.ts +26 -0
  33. package/dist/theme.js +65 -0
  34. package/dist/unstyledPrimitives.d.ts +12 -0
  35. package/dist/unstyledPrimitives.js +12 -0
  36. package/dist/useBreakpoints.d.ts +3 -0
  37. package/dist/useBreakpoints.js +2 -0
  38. package/dist/useFocusTrap.d.ts +1 -0
  39. package/dist/useFocusTrap.js +1 -0
  40. package/dist/useInView.d.ts +1 -0
  41. package/dist/useInView.js +1 -0
  42. package/dist/useIsSmallScreen.d.ts +1 -0
  43. package/dist/useIsSmallScreen.js +1 -0
  44. package/dist/useLiveAnnounce.d.ts +1 -0
  45. package/dist/useLiveAnnounce.js +1 -0
  46. package/dist/useOnKeyDown.d.ts +1 -0
  47. package/dist/useOnKeyDown.js +1 -0
  48. package/dist/useRefocusOnActivator.d.ts +1 -0
  49. package/dist/useRefocusOnActivator.js +1 -0
  50. package/dist/useResizeObserver.d.ts +22 -0
  51. package/dist/useResizeObserver.js +47 -0
  52. package/dist/useWindowDimensions.d.ts +2 -0
  53. package/dist/useWindowDimensions.js +1 -0
  54. package/dist/viewport.d.ts +46 -0
  55. package/dist/viewport.js +141 -0
  56. package/foundation/ActivityIndicator/ActivityIndicator.d.ts +38 -0
  57. package/foundation/ActivityIndicator/index.d.mts +2 -0
  58. package/foundation/ActivityIndicator/index.mjs +6 -0
  59. package/foundation/ActivityIndicator-es.js +30 -0
  60. package/foundation/Autocomplete/Autocomplete.d.ts +8 -0
  61. package/foundation/Autocomplete/Autocomplete.types.d.ts +401 -0
  62. package/foundation/Autocomplete/hooks/useAutocompleteListNav.d.ts +30 -0
  63. package/foundation/Autocomplete/index.d.mts +3 -0
  64. package/foundation/Autocomplete/index.mjs +39 -0
  65. package/foundation/Autocomplete/utils/interactionUtils.d.ts +14 -0
  66. package/foundation/Autocomplete-es.js +1322 -0
  67. package/foundation/Avatar/Avatar.d.ts +77 -0
  68. package/foundation/Avatar/index.d.mts +1 -0
  69. package/foundation/Avatar/index.mjs +6 -0
  70. package/foundation/Avatar-es.js +80 -0
  71. package/foundation/Banner/Banner.d.ts +10 -0
  72. package/foundation/Banner/Banner.types.d.ts +165 -0
  73. package/foundation/Banner/index.d.mts +2 -0
  74. package/foundation/Banner/index.mjs +14 -0
  75. package/foundation/Banner-es.js +134 -0
  76. package/foundation/Body-es.js +45 -0
  77. package/foundation/BottomSheet-es.js +110 -0
  78. package/foundation/Box/Box.d.ts +3 -0
  79. package/foundation/Box/Box.types.d.ts +40 -0
  80. package/foundation/Box/index.d.mts +1 -0
  81. package/foundation/Box/index.mjs +4 -0
  82. package/foundation/Box-es.js +130 -0
  83. package/foundation/Button/Button.d.ts +17 -0
  84. package/foundation/Button/Button.types.d.ts +112 -0
  85. package/foundation/Button/ButtonInternals.d.ts +11 -0
  86. package/foundation/Button/ButtonProvider.d.ts +11 -0
  87. package/foundation/Button/index.d.mts +4 -0
  88. package/foundation/Button/useButtonStyles.d.ts +17 -0
  89. package/foundation/Button-es.js +122 -0
  90. package/foundation/ButtonDismiss/ButtonDismiss.d.ts +6 -0
  91. package/foundation/ButtonDismiss/index.d.mts +1 -0
  92. package/foundation/ButtonDismiss-es.js +9 -0
  93. package/foundation/Card/Card.d.ts +78 -0
  94. package/foundation/Card/cardcolors.module.d.ts +90 -0
  95. package/foundation/Card/index.d.mts +1 -0
  96. package/foundation/Card/index.mjs +37 -0
  97. package/foundation/Card/types.d.ts +63 -0
  98. package/foundation/Card-es.js +138 -0
  99. package/foundation/Checkbox/Checkbox.d.ts +7 -0
  100. package/foundation/Checkbox/Checkbox.types.d.ts +51 -0
  101. package/foundation/Checkbox/index.d.mts +2 -0
  102. package/foundation/Checkbox/index.mjs +8 -0
  103. package/foundation/Checkbox-es.js +57 -0
  104. package/foundation/Chip/Chip.d.ts +14 -0
  105. package/foundation/Chip/Chip.types.d.ts +70 -0
  106. package/foundation/Chip/components/ChipDismissible/ChipDismissible.d.ts +3 -0
  107. package/foundation/Chip/components/ChipPrefix/Chip.Prefix.d.ts +3 -0
  108. package/foundation/Chip/components/ChipSelectable/ChipSelectable.d.ts +3 -0
  109. package/foundation/Chip/components/ChipSuffix/Chip.Suffix.d.ts +9 -0
  110. package/foundation/Chip/index.d.mts +4 -0
  111. package/foundation/Chip/index.mjs +19 -0
  112. package/foundation/Chip-es.js +165 -0
  113. package/foundation/ChipDismissible-es.js +19 -0
  114. package/foundation/Chips/Chip.d.ts +9 -0
  115. package/foundation/Chips/ChipDismissible.d.ts +11 -0
  116. package/foundation/Chips/ChipTypes.d.ts +59 -0
  117. package/foundation/Chips/Chips.d.ts +8 -0
  118. package/foundation/Chips/ChipsTypes.d.ts +106 -0
  119. package/foundation/Chips/InternalChipButton.d.ts +11 -0
  120. package/foundation/Chips/index.d.mts +3 -0
  121. package/foundation/Chips/index.mjs +56 -0
  122. package/foundation/Chips-es.js +114 -0
  123. package/foundation/Cluster/Cluster.d.ts +3 -0
  124. package/foundation/Cluster/index.d.mts +2 -0
  125. package/foundation/Cluster/index.mjs +4 -0
  126. package/foundation/Cluster/types.d.ts +47 -0
  127. package/foundation/Cluster-es.js +12 -0
  128. package/foundation/Combobox/Combobox.d.ts +71 -0
  129. package/foundation/Combobox/Combobox.footer.d.ts +7 -0
  130. package/foundation/Combobox/Combobox.items.d.ts +25 -0
  131. package/foundation/Combobox/Combobox.selectAll.d.ts +4 -0
  132. package/foundation/Combobox/Combobox.slotFactory.d.ts +7 -0
  133. package/foundation/Combobox/Combobox.types.d.ts +168 -0
  134. package/foundation/Combobox/index.d.mts +2 -0
  135. package/foundation/Combobox/index.mjs +28 -0
  136. package/foundation/Combobox-es.js +782 -0
  137. package/foundation/ComboboxPrimitive-es.js +187 -0
  138. package/foundation/ComboboxSeparator-es.js +3541 -0
  139. package/foundation/ComponentSettingsContext/ComponentSettingsContext.d.ts +41 -0
  140. package/foundation/ComponentSettingsContext/index.d.mts +4 -0
  141. package/foundation/ComponentSettingsContext/index.mjs +5 -0
  142. package/foundation/ComponentSettingsContext-es.js +18 -0
  143. package/foundation/ConfirmationModal/ConfirmationModal.d.ts +79 -0
  144. package/foundation/ConfirmationModal/index.d.mts +1 -0
  145. package/foundation/ConfirmationModal/index.mjs +37 -0
  146. package/foundation/ConfirmationModal-es.js +111 -0
  147. package/foundation/Container/Container.d.ts +6 -0
  148. package/foundation/Container/index.d.mts +1 -0
  149. package/foundation/Container/index.mjs +3 -0
  150. package/foundation/Container/types.d.ts +22 -0
  151. package/foundation/Container-es.js +16 -0
  152. package/foundation/Content/Content.d.ts +22 -0
  153. package/foundation/Content/Spacing.module.d.ts +14 -0
  154. package/foundation/Content/index.d.mts +1 -0
  155. package/foundation/Content/index.mjs +3 -0
  156. package/foundation/Content-es.js +13 -0
  157. package/foundation/ContentBlock/ContentBlock.d.ts +3 -0
  158. package/foundation/ContentBlock/index.d.mts +2 -0
  159. package/foundation/ContentBlock/index.mjs +4 -0
  160. package/foundation/ContentBlock/types.d.ts +37 -0
  161. package/foundation/ContentBlock-es.js +29 -0
  162. package/foundation/Countdown/Countdown.d.ts +30 -0
  163. package/foundation/Countdown/index.d.mts +1 -0
  164. package/foundation/Countdown/index.mjs +4 -0
  165. package/foundation/Countdown-es.js +649 -0
  166. package/foundation/Cover/Cover.d.ts +6 -0
  167. package/foundation/Cover/index.d.mts +2 -0
  168. package/foundation/Cover/index.mjs +4 -0
  169. package/foundation/Cover/types.d.ts +34 -0
  170. package/foundation/Cover-es.js +14 -0
  171. package/foundation/DataDump/DataDump.d.ts +21 -0
  172. package/foundation/DataDump/index.d.mts +1 -0
  173. package/foundation/DataDump/index.mjs +40 -0
  174. package/foundation/DataDump-es.js +26 -0
  175. package/foundation/DataList/DataList.const.d.ts +22 -0
  176. package/foundation/DataList/DataList.d.ts +28 -0
  177. package/foundation/DataList/DataList.types.d.ts +323 -0
  178. package/foundation/DataList/components/DataListAction/DataListAction.d.ts +3 -0
  179. package/foundation/DataList/components/DataListAction/index.d.mts +1 -0
  180. package/foundation/DataList/components/DataListBulkActions/DataListBulkActions.d.ts +4 -0
  181. package/foundation/DataList/components/DataListBulkActions/index.d.mts +1 -0
  182. package/foundation/DataList/components/DataListEmptyState/DataListEmptyState.d.ts +4 -0
  183. package/foundation/DataList/components/DataListEmptyState/index.d.mts +1 -0
  184. package/foundation/DataList/components/DataListFilters/DataListFilters.d.ts +11 -0
  185. package/foundation/DataList/components/DataListFilters/index.d.mts +1 -0
  186. package/foundation/DataList/components/DataListItemActions/DataListItemActions.d.ts +9 -0
  187. package/foundation/DataList/components/DataListItemActions/index.d.mts +1 -0
  188. package/foundation/DataList/components/DataListLayout/DataListLayout.d.ts +3 -0
  189. package/foundation/DataList/components/DataListLayout/index.d.mts +1 -0
  190. package/foundation/DataList/components/DataListLayoutActions/DataListLayoutActions.d.ts +2 -0
  191. package/foundation/DataList/components/DataListLayoutActions/index.d.mts +1 -0
  192. package/foundation/DataList/components/DataListSearch/DataListSearch.d.ts +8 -0
  193. package/foundation/DataList/components/DataListSearch/index.d.mts +1 -0
  194. package/foundation/DataList/components/DataListStatusBar/DataListStatusBar.d.ts +11 -0
  195. package/foundation/DataList/components/DataListStatusBar/index.d.mts +1 -0
  196. package/foundation/DataList/index.d.mts +2 -0
  197. package/foundation/DataList/index.mjs +96 -0
  198. package/foundation/DataList-es.js +141 -0
  199. package/foundation/DataList.const-es.js +26 -0
  200. package/foundation/DataList.module-es.js +3 -0
  201. package/foundation/DataList.utils-es.js +167 -0
  202. package/foundation/DataListAction-es.js +43 -0
  203. package/foundation/DataListActions-es.js +53 -0
  204. package/foundation/DataListActionsMenu-es.js +52 -0
  205. package/foundation/DataListBulkActions-es.js +28 -0
  206. package/foundation/DataListContext-es.js +26 -0
  207. package/foundation/DataListEmptyState-es.js +54 -0
  208. package/foundation/DataListFilters-es.js +43 -0
  209. package/foundation/DataListHeader-es.js +130 -0
  210. package/foundation/DataListHeaderTile-es.js +86 -0
  211. package/foundation/DataListItem-es.js +118 -0
  212. package/foundation/DataListItemActions-es.js +29 -0
  213. package/foundation/DataListItemActionsOverflow-es.js +34 -0
  214. package/foundation/DataListItemClickable-es.js +45 -0
  215. package/foundation/DataListItems-es.js +19 -0
  216. package/foundation/DataListLayout-es.js +19 -0
  217. package/foundation/DataListLayoutActions-es.js +36 -0
  218. package/foundation/DataListLayoutContext-es.js +14 -0
  219. package/foundation/DataListLayoutContext-es2.js +8 -0
  220. package/foundation/DataListLoadMore-es.js +32 -0
  221. package/foundation/DataListLoadingState-es.js +22 -0
  222. package/foundation/DataListOverflowFade-es.js +22 -0
  223. package/foundation/DataListSearch-es.js +84 -0
  224. package/foundation/DataListSort-es.js +74 -0
  225. package/foundation/DataListSortingOptions-es.js +34 -0
  226. package/foundation/DataListStatusBar-es.js +22 -0
  227. package/foundation/DataListStickyHeader-es.js +23 -0
  228. package/foundation/DataListTags-es.js +62 -0
  229. package/foundation/DataListTotalCount-es.js +38 -0
  230. package/foundation/DataTable/DataTable.d.ts +74 -0
  231. package/foundation/DataTable/SortIcon.d.ts +11 -0
  232. package/foundation/DataTable/components/DataTableActions.d.ts +2 -0
  233. package/foundation/DataTable/components/DataTableBody.d.ts +2 -0
  234. package/foundation/DataTable/components/DataTableCell.d.ts +2 -0
  235. package/foundation/DataTable/components/DataTableContainer.d.ts +2 -0
  236. package/foundation/DataTable/components/DataTableFooter.d.ts +5 -0
  237. package/foundation/DataTable/components/DataTableHeader.d.ts +2 -0
  238. package/foundation/DataTable/components/DataTableHeaderCell.d.ts +5 -0
  239. package/foundation/DataTable/components/DataTablePagination.d.ts +5 -0
  240. package/foundation/DataTable/components/DataTablePaginationButton.d.ts +21 -0
  241. package/foundation/DataTable/components/DataTableRow.d.ts +2 -0
  242. package/foundation/DataTable/components/DataTableRowActions.d.ts +4 -0
  243. package/foundation/DataTable/components/DataTableSortableHeader.d.ts +24 -0
  244. package/foundation/DataTable/components/DataTableTable.d.ts +11 -0
  245. package/foundation/DataTable/components/index.d.mts +13 -0
  246. package/foundation/DataTable/index.d.mts +6 -0
  247. package/foundation/DataTable/index.mjs +29 -0
  248. package/foundation/DataTable/test-utilities/helpers.d.ts +1 -0
  249. package/foundation/DataTable/types.d.ts +83 -0
  250. package/foundation/DataTable-es.js +262 -0
  251. package/foundation/DataTableTable-es.js +117 -0
  252. package/foundation/DatePicker/DatePicker.d.ts +74 -0
  253. package/foundation/DatePicker/DatePickerActivator.d.ts +18 -0
  254. package/foundation/DatePicker/index.d.mts +1 -0
  255. package/foundation/DatePicker/index.mjs +26 -0
  256. package/foundation/DatePicker-es.js +13627 -0
  257. package/foundation/Dialog/dialogReturnFocus.d.ts +43 -0
  258. package/foundation/Disclosure/Disclosure.d.ts +68 -0
  259. package/foundation/Disclosure/index.d.mts +1 -0
  260. package/foundation/Disclosure/index.mjs +7 -0
  261. package/foundation/Disclosure-es.js +46 -0
  262. package/foundation/Divider/Divider.d.ts +39 -0
  263. package/foundation/Divider/DividerDirections.module.d.ts +6 -0
  264. package/foundation/Divider/DividerSizes.module.d.ts +8 -0
  265. package/foundation/Divider/index.d.mts +1 -0
  266. package/foundation/Divider/index.mjs +3 -0
  267. package/foundation/Divider-es.js +15 -0
  268. package/foundation/Drawer/Drawer.d.ts +14 -0
  269. package/foundation/Drawer/DrawerGrid.d.ts +7 -0
  270. package/foundation/Drawer/index.d.mts +2 -0
  271. package/foundation/Drawer/index.mjs +13 -0
  272. package/foundation/DrawerGrid-es.js +39 -0
  273. package/foundation/DrawerTitle-es.js +90 -0
  274. package/foundation/Emphasis/Emphasis.d.ts +12 -0
  275. package/foundation/Emphasis/index.d.mts +1 -0
  276. package/foundation/Emphasis/index.mjs +4 -0
  277. package/foundation/Emphasis-es.js +13 -0
  278. package/foundation/FeatureSwitch/FeatureSwitch.d.ts +52 -0
  279. package/foundation/FeatureSwitch/index.d.mts +1 -0
  280. package/foundation/FeatureSwitch/index.mjs +20 -0
  281. package/foundation/FeatureSwitch-es.js +66 -0
  282. package/foundation/FieldDescription-es.js +859 -0
  283. package/foundation/FilterPicker/FilterPicker.d.ts +11 -0
  284. package/foundation/FilterPicker/FilterPicker.types.d.ts +282 -0
  285. package/foundation/FilterPicker/FilterPickerProvider.d.ts +18 -0
  286. package/foundation/FilterPicker/components/FilterPickerAction/FilterPickerAction.d.ts +3 -0
  287. package/foundation/FilterPicker/components/FilterPickerAction/index.d.mts +1 -0
  288. package/foundation/FilterPicker/components/FilterPickerActivator/FilterPickerActivator.d.ts +3 -0
  289. package/foundation/FilterPicker/components/FilterPickerActivator/index.d.mts +1 -0
  290. package/foundation/FilterPicker/components/FilterPickerOption/FilterPickerOption.d.ts +3 -0
  291. package/foundation/FilterPicker/index.d.mts +3 -0
  292. package/foundation/FilterPicker/index.mjs +49 -0
  293. package/foundation/FilterPicker-es.js +110 -0
  294. package/foundation/FilterPicker.messages-es.js +56 -0
  295. package/foundation/FilterPickerAction-es.js +30 -0
  296. package/foundation/FilterPickerActivator-es.js +36 -0
  297. package/foundation/FilterPickerContent-es.js +180 -0
  298. package/foundation/FilterPickerContentHeader-es.js +23 -0
  299. package/foundation/FilterPickerContentList-es.js +74 -0
  300. package/foundation/FilterPickerContentSearch-es.js +35 -0
  301. package/foundation/FilterPickerLoadMore-es.js +14 -0
  302. package/foundation/FilterPickerOption-es.js +29 -0
  303. package/foundation/FilterPickerProvider-es.js +10 -0
  304. package/foundation/FilterPickerTrigger-es.js +19 -0
  305. package/foundation/Flex/Flex.d.ts +33 -0
  306. package/foundation/Flex/Flex.types.d.ts +6 -0
  307. package/foundation/Flex/index.d.mts +1 -0
  308. package/foundation/Flex/index.mjs +3 -0
  309. package/foundation/Flex-es.js +28 -0
  310. package/foundation/FormField/FormFieldAffix.d.ts +19 -0
  311. package/foundation/FormField/FormFieldTypes.d.ts +185 -0
  312. package/foundation/FormField/FormFieldWrapper.d.ts +57 -0
  313. package/foundation/FormField/hooks/useFormFieldName.d.ts +6 -0
  314. package/foundation/FormField/hooks/useFormFieldWrapperStyles.d.ts +35 -0
  315. package/foundation/FormField/index.d.mts +5 -0
  316. package/foundation/FormField/index.mjs +17 -0
  317. package/foundation/FormFieldPostFix-es.js +13 -0
  318. package/foundation/FormFieldWrapper-es.js +233 -0
  319. package/foundation/FormatFile/FormatFile.d.ts +42 -0
  320. package/foundation/FormatFile/index.d.mts +4 -0
  321. package/foundation/FormatFile/index.mjs +42 -0
  322. package/foundation/FormatFile/types.d.ts +27 -0
  323. package/foundation/FormatFile/useFormatFile.d.ts +5 -0
  324. package/foundation/FormatFile/useFormatFileStyles.d.ts +10 -0
  325. package/foundation/FormatFile-es.js +137 -0
  326. package/foundation/Frame/Frame.d.ts +3 -0
  327. package/foundation/Frame/index.d.mts +2 -0
  328. package/foundation/Frame/index.mjs +3 -0
  329. package/foundation/Frame/types.d.ts +24 -0
  330. package/foundation/Frame-es.js +10 -0
  331. package/foundation/Gallery/Gallery.d.ts +3 -0
  332. package/foundation/Gallery/GalleryTypes.d.ts +36 -0
  333. package/foundation/Gallery/index.d.mts +3 -0
  334. package/foundation/Gallery/index.mjs +64 -0
  335. package/foundation/Gallery-es.js +88 -0
  336. package/foundation/Glimmer/Glimmer.d.ts +71 -0
  337. package/foundation/Glimmer/index.d.mts +1 -0
  338. package/foundation/Glimmer/index.mjs +5 -0
  339. package/foundation/Glimmer/style/Shape.module.d.ts +9 -0
  340. package/foundation/Glimmer/style/Sizes.module.d.ts +10 -0
  341. package/foundation/Glimmer/style/Timing.module.d.ts +6 -0
  342. package/foundation/Glimmer-es.js +53 -0
  343. package/foundation/Grid/Grid.d.ts +32 -0
  344. package/foundation/Grid/GridAlign.module.d.ts +8 -0
  345. package/foundation/Grid/GridCell/GridCell.d.ts +23 -0
  346. package/foundation/Grid/GridCell/index.d.mts +1 -0
  347. package/foundation/Grid/index.d.mts +1 -0
  348. package/foundation/Grid/index.mjs +5 -0
  349. package/foundation/Grid-es.js +30 -0
  350. package/foundation/GridCell-es.js +34 -0
  351. package/foundation/Heading/Heading.d.ts +41 -0
  352. package/foundation/Heading/index.d.mts +2 -0
  353. package/foundation/Heading/index.mjs +4 -0
  354. package/foundation/Heading-es.js +55 -0
  355. package/foundation/HelperText-es.js +19 -0
  356. package/foundation/Icon/Icon.d.ts +47 -0
  357. package/foundation/Icon/index.d.mts +1 -0
  358. package/foundation/Icon-es.js +22 -0
  359. package/foundation/InlineLabel/InlineLabel.d.ts +18 -0
  360. package/foundation/InlineLabel/index.d.mts +1 -0
  361. package/foundation/InlineLabel/index.mjs +4 -0
  362. package/foundation/InlineLabel-es.js +19 -0
  363. package/foundation/InputAvatar/InputAvatar.d.ts +23 -0
  364. package/foundation/InputAvatar/index.d.mts +1 -0
  365. package/foundation/InputAvatar/index.mjs +22 -0
  366. package/foundation/InputAvatar-es.js +64 -0
  367. package/foundation/InputDate/InputDate.d.ts +3 -0
  368. package/foundation/InputDate/InputDate.types.d.ts +36 -0
  369. package/foundation/InputDate/index.d.mts +2 -0
  370. package/foundation/InputDate/index.mjs +39 -0
  371. package/foundation/InputDate-es.js +104 -0
  372. package/foundation/InputEmail/InputEmail.d.ts +3 -0
  373. package/foundation/InputEmail/InputEmail.types.d.ts +16 -0
  374. package/foundation/InputEmail/index.d.mts +2 -0
  375. package/foundation/InputEmail/index.mjs +22 -0
  376. package/foundation/InputEmail-es.js +105 -0
  377. package/foundation/InputFile/FileTypes.d.ts +17 -0
  378. package/foundation/InputFile/InputFile.d.ts +187 -0
  379. package/foundation/InputFile/InputFileButton.d.ts +6 -0
  380. package/foundation/InputFile/InputFileContentContext.d.ts +12 -0
  381. package/foundation/InputFile/InputFileDescription.d.ts +4 -0
  382. package/foundation/InputFile/InputFileDropzoneWrapper.d.ts +4 -0
  383. package/foundation/InputFile/InputFileHintText.d.ts +4 -0
  384. package/foundation/InputFile/index.d.mts +3 -0
  385. package/foundation/InputFile/index.mjs +16 -0
  386. package/foundation/InputFile-es.js +1780 -0
  387. package/foundation/InputGroup/InputGroup.d.ts +12 -0
  388. package/foundation/InputGroup/index.d.mts +1 -0
  389. package/foundation/InputGroup/index.mjs +3 -0
  390. package/foundation/InputGroup-es.js +26 -0
  391. package/foundation/InputNumber/InputNumber.d.ts +77 -0
  392. package/foundation/InputNumber/index.d.mts +2 -0
  393. package/foundation/InputNumber/index.mjs +33 -0
  394. package/foundation/InputNumber/types.d.ts +197 -0
  395. package/foundation/InputNumber-es.js +348 -0
  396. package/foundation/InputPhoneNumber/InputPhoneNumber.d.ts +3 -0
  397. package/foundation/InputPhoneNumber/InputPhoneNumber.types.d.ts +24 -0
  398. package/foundation/InputPhoneNumber/index.d.mts +2 -0
  399. package/foundation/InputPhoneNumber/index.mjs +22 -0
  400. package/foundation/InputPhoneNumber-es.js +188 -0
  401. package/foundation/InputText/InputText.d.ts +3 -0
  402. package/foundation/InputText/InputText.types.d.ts +58 -0
  403. package/foundation/InputText/index.d.mts +2 -0
  404. package/foundation/InputText/index.mjs +23 -0
  405. package/foundation/InputText-es.js +196 -0
  406. package/foundation/InputTime/InputTime.d.ts +3 -0
  407. package/foundation/InputTime/InputTime.types.d.ts +34 -0
  408. package/foundation/InputTime/index.d.mts +2 -0
  409. package/foundation/InputTime/index.mjs +23 -0
  410. package/foundation/InputTime-es.js +297 -0
  411. package/foundation/InputValidation/InputValidation.d.ts +10 -0
  412. package/foundation/InputValidation/index.d.mts +1 -0
  413. package/foundation/InputValidation/index.mjs +8 -0
  414. package/foundation/InputValidation-es.js +22 -0
  415. package/foundation/InternalChipDismissible-es.js +68 -0
  416. package/foundation/LICENSE +21 -0
  417. package/foundation/LegacySelect/LegacySelect.d.ts +7 -0
  418. package/foundation/LegacySelect/LegacySelect.types.d.ts +18 -0
  419. package/foundation/LegacySelect/Option.d.ts +18 -0
  420. package/foundation/LegacySelect/OptionGroup.d.ts +29 -0
  421. package/foundation/LegacySelect/index.d.mts +3 -0
  422. package/foundation/LegacySelect/index.mjs +23 -0
  423. package/foundation/LegacySelect-es.js +76 -0
  424. package/foundation/LegacyThemeContext/LegacyThemeContext.d.ts +5 -0
  425. package/foundation/LegacyThemeContext/index.d.mts +3 -0
  426. package/foundation/LegacyThemeContext/index.mjs +12 -0
  427. package/foundation/LegacyThemeContext/types.d.ts +59 -0
  428. package/foundation/LegacyThemeContext/updateTheme.d.ts +7 -0
  429. package/foundation/LegacyThemeContext-es.js +457 -0
  430. package/foundation/LightBox/LightBox.d.ts +165 -0
  431. package/foundation/LightBox/LightBox.types.d.ts +153 -0
  432. package/foundation/LightBox/LightBoxContext.d.ts +5 -0
  433. package/foundation/LightBox/index.d.mts +3 -0
  434. package/foundation/LightBox/index.mjs +50 -0
  435. package/foundation/LightBox-es.js +454 -0
  436. package/foundation/Link/Link.d.ts +9 -0
  437. package/foundation/Link/index.d.mts +2 -0
  438. package/foundation/Link/index.mjs +2 -0
  439. package/foundation/Link-es.js +12 -0
  440. package/foundation/List/List.d.ts +41 -0
  441. package/foundation/List/ListItem.d.ts +59 -0
  442. package/foundation/List/index.d.mts +2 -0
  443. package/foundation/List/index.mjs +22 -0
  444. package/foundation/List-es.js +199 -0
  445. package/foundation/Markdown/Markdown.d.ts +24 -0
  446. package/foundation/Markdown/index.d.mts +1 -0
  447. package/foundation/Markdown/index.mjs +10 -0
  448. package/foundation/Markdown-es.js +20558 -0
  449. package/foundation/Menu/Menu.d.ts +89 -0
  450. package/foundation/Menu/Menu.types.d.ts +105 -0
  451. package/foundation/Menu/index.d.mts +2 -0
  452. package/foundation/Menu/index.mjs +35 -0
  453. package/foundation/Menu/menuComposableTypes.d.ts +103 -0
  454. package/foundation/Menu-es.js +1033 -0
  455. package/foundation/MenuSubmenuTrigger-es.js +3088 -0
  456. package/foundation/Modal/Modal.rebuilt.d.ts +16 -0
  457. package/foundation/Modal/Modal.types.d.ts +138 -0
  458. package/foundation/Modal/ModalContext.rebuilt.d.ts +19 -0
  459. package/foundation/Modal/ModalSizes.module.d.ts +7 -0
  460. package/foundation/Modal/index.d.mts +17 -0
  461. package/foundation/Modal/index.mjs +302 -0
  462. package/foundation/Modal/useModalStyles.d.ts +12 -0
  463. package/foundation/MultiSelect/MultiSelect.d.ts +30 -0
  464. package/foundation/MultiSelect/index.d.mts +1 -0
  465. package/foundation/MultiSelect/index.mjs +9 -0
  466. package/foundation/MultiSelect/types.d.ts +13 -0
  467. package/foundation/MultiSelect-es.js +172 -0
  468. package/foundation/OverlaySeparator-es.js +13 -0
  469. package/foundation/Page/Page.d.ts +74 -0
  470. package/foundation/Page/index.d.mts +2 -0
  471. package/foundation/Page/index.mjs +42 -0
  472. package/foundation/Page/types.d.ts +123 -0
  473. package/foundation/Page-es.js +196 -0
  474. package/foundation/Popover/Popover.d.ts +9 -0
  475. package/foundation/Popover/Popover.types.d.ts +109 -0
  476. package/foundation/Popover/PopoverContext.d.ts +18 -0
  477. package/foundation/Popover/index.d.mts +4 -0
  478. package/foundation/Popover/index.mjs +27 -0
  479. package/foundation/Popover/usePopoverStyles.d.ts +5 -0
  480. package/foundation/Popover-es.js +166 -0
  481. package/foundation/ProgressBar/ProgressBar.d.ts +41 -0
  482. package/foundation/ProgressBar/ProgressBarSizes.module.d.ts +7 -0
  483. package/foundation/ProgressBar/index.d.mts +1 -0
  484. package/foundation/ProgressBar/index.mjs +5 -0
  485. package/foundation/ProgressBar-es.js +48 -0
  486. package/foundation/ProgressIndicator/ProgressIndicator.d.ts +60 -0
  487. package/foundation/ProgressIndicator/index.d.mts +1 -0
  488. package/foundation/ProgressIndicator/index.mjs +3 -0
  489. package/foundation/ProgressIndicator-es.js +41 -0
  490. package/foundation/RadioGroup/RadioGroup.d.ts +33 -0
  491. package/foundation/RadioGroup/RadioOption.d.ts +48 -0
  492. package/foundation/RadioGroup/index.d.mts +2 -0
  493. package/foundation/RadioGroup/index.mjs +5 -0
  494. package/foundation/RadioGroup-es.js +42 -0
  495. package/foundation/ResponsiveSwitcher/ResponsiveSwitcher.d.ts +3 -0
  496. package/foundation/ResponsiveSwitcher/index.d.mts +2 -0
  497. package/foundation/ResponsiveSwitcher/index.mjs +4 -0
  498. package/foundation/ResponsiveSwitcher/types.d.ts +26 -0
  499. package/foundation/ResponsiveSwitcher-es.js +11 -0
  500. package/foundation/RulnarPortalContent-es.js +1 -0
  501. package/foundation/ScrollAreaViewport-es.js +3959 -0
  502. package/foundation/SegmentedControl/SegmentedControl.d.ts +39 -0
  503. package/foundation/SegmentedControl/SegmentedControlBase.d.ts +7 -0
  504. package/foundation/SegmentedControl/SegmentedControlOption.d.ts +15 -0
  505. package/foundation/SegmentedControl/SegmentedControlProvider.d.ts +17 -0
  506. package/foundation/SegmentedControl/index.d.mts +2 -0
  507. package/foundation/SegmentedControl/index.mjs +3 -0
  508. package/foundation/SegmentedControl-es.js +64 -0
  509. package/foundation/Select/Select.d.ts +31 -0
  510. package/foundation/Select/Select.types.d.ts +145 -0
  511. package/foundation/Select/index.d.mts +2 -0
  512. package/foundation/Select/index.mjs +29 -0
  513. package/foundation/Select-es.js +227 -0
  514. package/foundation/SelectGroupLabel-es.js +1763 -0
  515. package/foundation/SelectPrimitive-es.js +126 -0
  516. package/foundation/Separator-es.js +33 -0
  517. package/foundation/SideDrawer/SideDrawer.d.ts +56 -0
  518. package/foundation/SideDrawer/SideDrawerActions.d.ts +3 -0
  519. package/foundation/SideDrawer/SideDrawerBackButton.d.ts +3 -0
  520. package/foundation/SideDrawer/SideDrawerFooter.d.ts +3 -0
  521. package/foundation/SideDrawer/SideDrawerTitle.d.ts +3 -0
  522. package/foundation/SideDrawer/SideDrawerToolbar.d.ts +2 -0
  523. package/foundation/SideDrawer/index.d.mts +1 -0
  524. package/foundation/SideDrawer/index.mjs +16 -0
  525. package/foundation/SideDrawer-es.js +198 -0
  526. package/foundation/SideKick/SideKick.d.ts +3 -0
  527. package/foundation/SideKick/index.d.mts +2 -0
  528. package/foundation/SideKick/index.mjs +4 -0
  529. package/foundation/SideKick/types.d.ts +35 -0
  530. package/foundation/SideKick-es.js +15 -0
  531. package/foundation/Spinner/Spinner.d.ts +22 -0
  532. package/foundation/Spinner/index.d.mts +1 -0
  533. package/foundation/Spinner/index.mjs +6 -0
  534. package/foundation/Spinner-es.js +21 -0
  535. package/foundation/Stack/Stack.d.ts +3 -0
  536. package/foundation/Stack/index.d.mts +2 -0
  537. package/foundation/Stack/index.mjs +4 -0
  538. package/foundation/Stack/types.d.ts +32 -0
  539. package/foundation/Stack-es.js +13 -0
  540. package/foundation/StatusIndicator/StatusIndicator.d.ts +7 -0
  541. package/foundation/StatusIndicator/StatusIndicator.type.d.ts +1 -0
  542. package/foundation/StatusIndicator/index.d.mts +2 -0
  543. package/foundation/StatusIndicator/index.mjs +2 -0
  544. package/foundation/StatusIndicator-es.js +9 -0
  545. package/foundation/StatusLabel/StatusLabel.d.ts +26 -0
  546. package/foundation/StatusLabel/index.d.mts +1 -0
  547. package/foundation/StatusLabel/index.mjs +5 -0
  548. package/foundation/StatusLabel-es.js +16 -0
  549. package/foundation/Table/Body.d.ts +7 -0
  550. package/foundation/Table/Cells/Cell.d.ts +8 -0
  551. package/foundation/Table/Cells/CellCurrency.d.ts +9 -0
  552. package/foundation/Table/Cells/CellNumeric.d.ts +5 -0
  553. package/foundation/Table/Footer.d.ts +7 -0
  554. package/foundation/Table/Header.d.ts +7 -0
  555. package/foundation/Table/Row.d.ts +7 -0
  556. package/foundation/Table/Table.d.ts +7 -0
  557. package/foundation/Table/index.d.mts +8 -0
  558. package/foundation/Table/index.mjs +4 -0
  559. package/foundation/Tabs/Tabs.d.ts +38 -0
  560. package/foundation/Tabs/index.d.mts +1 -0
  561. package/foundation/Tabs/index.mjs +8 -0
  562. package/foundation/Tabs-es.js +227 -0
  563. package/foundation/Text/Text.d.ts +29 -0
  564. package/foundation/Text/index.d.mts +2 -0
  565. package/foundation/Text/index.mjs +4 -0
  566. package/foundation/Text-es.js +25 -0
  567. package/foundation/Thumbnail/Thumbnail.d.ts +25 -0
  568. package/foundation/Thumbnail/index.d.mts +1 -0
  569. package/foundation/Thumbnail/index.mjs +9 -0
  570. package/foundation/Thumbnail-es.js +119 -0
  571. package/foundation/Tiles/Tiles.d.ts +3 -0
  572. package/foundation/Tiles/index.d.mts +2 -0
  573. package/foundation/Tiles/index.mjs +4 -0
  574. package/foundation/Tiles/types.d.ts +34 -0
  575. package/foundation/Tiles-es.js +11 -0
  576. package/foundation/Tooltip/Tooltip.d.ts +18 -0
  577. package/foundation/Tooltip/Tooltip.types.d.ts +1 -0
  578. package/foundation/Tooltip/index.d.mts +1 -0
  579. package/foundation/Tooltip/index.mjs +8 -0
  580. package/foundation/Tooltip-es.js +137 -0
  581. package/foundation/Typography/Typography.d.ts +64 -0
  582. package/foundation/Typography/css/Emphasis.module.d.ts +6 -0
  583. package/foundation/Typography/css/FontFamilies.module.d.ts +6 -0
  584. package/foundation/Typography/css/FontSizes.module.d.ts +12 -0
  585. package/foundation/Typography/css/FontWeights.module.d.ts +10 -0
  586. package/foundation/Typography/css/TextAlignment.module.d.ts +7 -0
  587. package/foundation/Typography/css/TextCases.module.d.ts +8 -0
  588. package/foundation/Typography/css/TextColors.module.d.ts +69 -0
  589. package/foundation/Typography/index.d.mts +1 -0
  590. package/foundation/Typography/index.mjs +3 -0
  591. package/foundation/Typography/types.d.ts +7 -0
  592. package/foundation/Typography-es.js +53 -0
  593. package/foundation/_baseAssignValue-es.js +29 -0
  594. package/foundation/_baseEach-es.js +1028 -0
  595. package/foundation/_baseFlatten-es.js +65 -0
  596. package/foundation/_baseFor-es.js +45 -0
  597. package/foundation/_commonjsHelpers-es.js +7 -0
  598. package/foundation/_getAllKeys-es.js +506 -0
  599. package/foundation/_getTag-es.js +133 -0
  600. package/foundation/_isIterateeCall-es.js +55 -0
  601. package/foundation/_setToString-es.js +168 -0
  602. package/foundation/buttonRenderAdapter-es.js +52 -0
  603. package/foundation/buttonStyles.d.mts +1 -0
  604. package/foundation/buttonStyles.mjs +1 -0
  605. package/foundation/clearable.d.ts +1 -0
  606. package/foundation/common.messages-es.js +18 -0
  607. package/foundation/compatHooks.mjs +2 -0
  608. package/foundation/constants-es.js +3 -0
  609. package/foundation/dateLocale-es.js +1142 -0
  610. package/foundation/debounce-es.js +329 -0
  611. package/foundation/dialogFocus.d.mts +1 -0
  612. package/foundation/dialogFocus.mjs +66 -0
  613. package/foundation/filterDataAttributes-es.js +24 -0
  614. package/foundation/floating-ui.react-es.js +6174 -0
  615. package/foundation/getMappedSpaceToken-es.js +18 -0
  616. package/foundation/helpers-es.js +15 -0
  617. package/foundation/identity-es.js +809 -0
  618. package/foundation/imageTypes.d.mts +1 -0
  619. package/foundation/imageTypes.mjs +1 -0
  620. package/foundation/index-es.js +1186 -0
  621. package/foundation/isObjectLike-es.js +190 -0
  622. package/foundation/isSymbol-es.js +33 -0
  623. package/foundation/isTypedArray-es.js +589 -0
  624. package/foundation/keysIn-es.js +385 -0
  625. package/foundation/linkEvents.d.mts +1 -0
  626. package/foundation/linkEvents.mjs +9 -0
  627. package/foundation/maxHeight-es.js +22 -0
  628. package/foundation/mergeClassName-es.js +10 -0
  629. package/foundation/mergeRefs-es.js +18 -0
  630. package/foundation/nestedEscape-es.js +91 -0
  631. package/foundation/noop-es.js +24 -0
  632. package/foundation/primitives/BottomSheet/BottomSheet.d.ts +37 -0
  633. package/foundation/primitives/BottomSheet/BottomSheet.types.d.ts +36 -0
  634. package/foundation/primitives/BottomSheet/index.d.mts +2 -0
  635. package/foundation/primitives/ComboboxPrimitive/ComboboxPrimitive.d.ts +32 -0
  636. package/foundation/primitives/ComboboxPrimitive/ComboboxPrimitive.types.d.ts +30 -0
  637. package/foundation/primitives/ComboboxPrimitive/index.d.mts +2 -0
  638. package/foundation/primitives/HelperText/HelperText.d.ts +25 -0
  639. package/foundation/primitives/HelperText/index.d.mts +1 -0
  640. package/foundation/primitives/OverlaySeparator/OverlaySeparator.d.ts +6 -0
  641. package/foundation/primitives/OverlaySeparator/index.d.mts +1 -0
  642. package/foundation/primitives/SelectPrimitive/SelectPrimitive.d.ts +74 -0
  643. package/foundation/primitives/SelectPrimitive/index.d.mts +2 -0
  644. package/foundation/primitives/SelectPrimitive/types.d.ts +31 -0
  645. package/foundation/primitives/index.d.mts +12 -0
  646. package/foundation/primitives/index.mjs +29 -0
  647. package/foundation/routerLink.d.mts +3 -0
  648. package/foundation/routerLink.mjs +1 -0
  649. package/foundation/scrollEdges-es.js +64 -0
  650. package/foundation/scrollable-es.js +54 -0
  651. package/foundation/sharedHelpers/getMappedBreakpointWidth.d.ts +8 -0
  652. package/foundation/sharedHelpers/types.d.ts +254 -0
  653. package/foundation/stringifyLocale-es.js +11 -0
  654. package/foundation/styles.css +16646 -0
  655. package/foundation/tslib.es6-es.js +97 -0
  656. package/foundation/unstyledPrimitives/index.d.mts +22 -0
  657. package/foundation/useActiveLayout-es.js +14 -0
  658. package/foundation/useBatchSelect-es.js +36 -0
  659. package/foundation/useChildComponent-es.js +15 -0
  660. package/foundation/useComponentMessages-es.js +86 -0
  661. package/foundation/useCompositeListItem-es.js +3955 -0
  662. package/foundation/useFormFieldFocus-es.js +37 -0
  663. package/foundation/useFormFieldName-es.js +11 -0
  664. package/foundation/useLabel-es.js +81 -0
  665. package/foundation/useRenderElement-es.js +628 -0
  666. package/foundation/useResponsiveSizing-es.js +8 -0
  667. package/foundation/useScrollLock-es.js +5746 -0
  668. package/foundation/useScrollToActive-es.js +581 -0
  669. package/foundation/utils/isNormalClick.d.ts +6 -0
  670. package/foundation/utils/isPreviewableImage.d.ts +1 -0
  671. package/foundation/utils/meta/meta.json +298 -0
  672. package/foundation.css +67 -0
  673. package/package.json +540 -4
  674. package/src/styles.css +181 -0
@@ -0,0 +1,1033 @@
1
+ import { ThemeBoundary } from "../dist/theme.js";
2
+ import React__default, { useState, useRef, useId, useMemo } from 'react';
3
+ import { useWindowDimensions, useRefocusOnActivator, useIsSmallScreen } from './compatHooks.mjs';
4
+ import classnames from 'classnames';
5
+ import { AnimatePresence, motion } from 'framer-motion';
6
+ import { o as offset, f as flip, m as size, u as useFloating, b as autoUpdate, e as useDismiss, n as useListNavigation, g as useInteractions, F as FloatingPortal } from './floating-ui.react-es.js';
7
+ import { d as defineMessages, u as useComponentMessages } from './useComponentMessages-es.js';
8
+ import './ComponentSettingsContext-es.js';
9
+ import { B as Button } from './Button-es.js';
10
+ import { T as Typography } from './Typography-es.js';
11
+ import { I as Icon } from './Icon-es.js';
12
+ import { f as formFieldFocusAttribute } from './useFormFieldFocus-es.js';
13
+ import { c as calculateMaxHeight } from './maxHeight-es.js';
14
+ import { m as mergeProps } from './useRenderElement-es.js';
15
+ import { n as normalizeBaseUiButtonProps, i as isRulnarButtonRenderTarget, s as stripNativeTypeFromButtonRenderTarget, r as renderRulnarButtonTarget } from './buttonRenderAdapter-es.js';
16
+ import { O as OverlaySeparator } from './OverlaySeparator-es.js';
17
+ import { a as BottomSheet } from './BottomSheet-es.js';
18
+ import './HelperText-es.js';
19
+ import './tslib.es6-es.js';
20
+ import './SelectPrimitive-es.js';
21
+ import { D as DrawerTrigger } from './ScrollAreaViewport-es.js';
22
+ import { D as DrawerTitle, a as DrawerClose } from './DrawerTitle-es.js';
23
+ import { M as MenuTrigger$1, a as MenuLinkItem, b as MenuItem$1, c as MenuRadioItem$1, d as MenuRadioItemIndicator, e as MenuSubmenuTrigger$1, f as MenuRoot, g as MenuPortal$1, h as MenuBackdrop, i as MenuPositioner, j as MenuPopup, k as MenuRadioGroup$1, l as MenuGroup$1, m as MenuSubmenuRoot, n as MenuGroupLabel$1 } from './MenuSubmenuTrigger-es.js';
24
+
25
+ var styles$2 = {"wrapper":"h-nk89U2n6Q-","floatingContainer":"krpkWzoaVcc-","menu":"_7sU7mp1w0jM-","legacySection":"_4x-vvEmn4gM-","separator":"i0QNcs4S-wk-","triggerWrapper":"_7CsejipGrzM-","ariaMenu":"bO7lGVQC42c-","ariaItem":"u6fDgbWmPck-","ariaSection":"-TSNrZBKZJI-","ariaSectionHeader":"zs7dS2pKjEw-","sectionHeader":"MZJgunQcmdQ-","legacyAction":"_-1GOlrzd098-","action":"NYXV5w4pd0c-","destructive":"baYK2zQ6-GA-","overlay":"A7T14ALVEKg-","fullWidth":"Lgbn9IRPI5Y-","screenReaderOnly":"o-ps580KdWI-","spinning":"f1oTdSTeUOM-"};
26
+
27
+ const SMALL_SCREEN_BREAKPOINT = 490;
28
+ const MENU_OFFSET = 6;
29
+ const MENU_MAX_HEIGHT_PERCENTAGE = 72;
30
+ const Y_TRANSLATION_DESKTOP = 10;
31
+ const Y_TRANSLATION_MOBILE = 150;
32
+ const MENU_ANIMATION_DURATION = 0.25;
33
+ const OVERLAY_ANIMATION_DURATION = 0.15;
34
+ const MENU_ANIMATION_CONFIG = {
35
+ duration: MENU_ANIMATION_DURATION,
36
+ type: "tween",
37
+ };
38
+ const OVERLAY_ANIMATION_CONFIG = {
39
+ duration: OVERLAY_ANIMATION_DURATION,
40
+ type: "tween",
41
+ };
42
+
43
+ const menuMessages = defineMessages({
44
+ moreActions: {
45
+ en: "More Actions",
46
+ es: "Más acciones",
47
+ },
48
+ back: {
49
+ en: "Back",
50
+ es: "Atrás",
51
+ },
52
+ "Back to {title}": {
53
+ en: "Back to {title}",
54
+ es: "Volver a {title}",
55
+ },
56
+ });
57
+
58
+ function isMobileDevice() {
59
+ if (typeof window === "undefined") {
60
+ return false;
61
+ }
62
+ return window.innerWidth <= SMALL_SCREEN_BREAKPOINT;
63
+ }
64
+ const animationVariation = {
65
+ overlayStartStop: { opacity: 0 },
66
+ startOrStop: (placement) => {
67
+ let y = Y_TRANSLATION_DESKTOP;
68
+ if (placement === null || placement === void 0 ? void 0 : placement.includes("bottom"))
69
+ y *= -1;
70
+ if (isMobileDevice())
71
+ y = Y_TRANSLATION_MOBILE;
72
+ return { opacity: 0, y };
73
+ },
74
+ done: { opacity: 1, y: 0 },
75
+ };
76
+ // eslint-disable-next-line max-statements
77
+ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
78
+ var _a;
79
+ const { t } = useComponentMessages(menuMessages);
80
+ const [visible, setVisible] = useState(false);
81
+ const [referenceElement, setReferenceElement] = useState(null);
82
+ const [activeIndex, setActiveIndex] = useState(null);
83
+ const listRef = useRef([]);
84
+ const { width } = useWindowDimensions();
85
+ const buttonID = useId();
86
+ const menuID = useId();
87
+ const fullWidth = ((_a = activator === null || activator === void 0 ? void 0 : activator.props) === null || _a === void 0 ? void 0 : _a.fullWidth) || false;
88
+ const wrapperClasses = classnames(styles$2.wrapper, {
89
+ [styles$2.fullWidth]: fullWidth,
90
+ });
91
+ useRefocusOnActivator(visible);
92
+ const isLargeScreen = width !== undefined && width >= SMALL_SCREEN_BREAKPOINT;
93
+ const middleware = useMemo(() => {
94
+ if (isLargeScreen) {
95
+ return [
96
+ offset(MENU_OFFSET),
97
+ flip({ fallbackPlacements: ["bottom-end", "top-start", "top-end"] }),
98
+ size({
99
+ apply({ availableHeight, elements }) {
100
+ const menuElement = elements.floating.querySelector('[role="menu"]');
101
+ if (menuElement) {
102
+ const viewportHeight = window.innerHeight;
103
+ const maxHeightVh = (viewportHeight * MENU_MAX_HEIGHT_PERCENTAGE) / 100;
104
+ const maxHeight = calculateMaxHeight(availableHeight, {
105
+ maxHeight: maxHeightVh,
106
+ });
107
+ Object.assign(menuElement.style, {
108
+ maxHeight: `${maxHeight}px`,
109
+ });
110
+ }
111
+ },
112
+ }),
113
+ ];
114
+ }
115
+ return [];
116
+ }, [isLargeScreen]);
117
+ const { refs, floatingStyles, context } = useFloating({
118
+ open: visible,
119
+ onOpenChange: (isOpen) => {
120
+ setVisible(isOpen);
121
+ },
122
+ placement: "bottom-start",
123
+ strategy: "fixed",
124
+ middleware,
125
+ elements: {
126
+ reference: referenceElement,
127
+ },
128
+ whileElementsMounted: autoUpdate,
129
+ });
130
+ const dismiss = useDismiss(context);
131
+ const listNavigation = useListNavigation(context, {
132
+ listRef,
133
+ activeIndex,
134
+ onNavigate: setActiveIndex,
135
+ loop: true,
136
+ });
137
+ const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([dismiss, listNavigation]);
138
+ const positionAttributes = isLargeScreen
139
+ ? {
140
+ style: floatingStyles,
141
+ }
142
+ : {};
143
+ if (!activator) {
144
+ activator = (React__default.createElement(Button, { fullWidth: true, label: t("moreActions"), icon: "more", type: "secondary" }));
145
+ }
146
+ let itemIndexCounter = 0;
147
+ const renderedSections = items === null || items === void 0 ? void 0 : items.map((item, key) => (React__default.createElement("div", { key: key, className: styles$2.legacySection },
148
+ item.header && (React__default.createElement(SectionHeader, { text: item.header, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.header, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.header })),
149
+ item.actions.map(action => {
150
+ const currentIndex = itemIndexCounter++;
151
+ return (React__default.createElement(Action, Object.assign({ UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.action, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.action, sectionLabel: item.header, key: action.label, tabIndex: activeIndex === currentIndex ? 0 : -1, setItemNode: node => {
152
+ listRef.current[currentIndex] = node;
153
+ }, getItemProps: getItemProps }, action)));
154
+ }))));
155
+ return (React__default.createElement("div", { className: wrapperClasses, onClick: handleParentClick },
156
+ React__default.createElement("div", Object.assign({ ref: setReferenceElement }, getReferenceProps()), React__default.cloneElement(activator, {
157
+ onClick: toggle(activator.props.onClick),
158
+ id: buttonID,
159
+ ariaControls: menuID,
160
+ ariaExpanded: visible,
161
+ ariaHaspopup: true,
162
+ })),
163
+ React__default.createElement(MenuPortal, null,
164
+ React__default.createElement(AnimatePresence, null, visible && (React__default.createElement(React__default.Fragment, null,
165
+ React__default.createElement(motion.div, { className: styles$2.overlay, onClick: toggle(), variants: animationVariation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
166
+ React__default.createElement("div", Object.assign({ ref: refs.setFloating, className: styles$2.floatingContainer }, getFloatingProps({
167
+ onKeyDown: event => {
168
+ if (event.key === "Tab") {
169
+ event.preventDefault();
170
+ }
171
+ },
172
+ }), positionAttributes, formFieldFocusAttribute), items.length > 0 && (React__default.createElement(motion.div, { className: classnames(styles$2.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: animationVariation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
173
+ function toggle(callbackPassthrough) {
174
+ return (event) => {
175
+ setVisible(!visible);
176
+ callbackPassthrough && callbackPassthrough(event);
177
+ };
178
+ }
179
+ function hide() {
180
+ setVisible(false);
181
+ setActiveIndex(null);
182
+ }
183
+ function handleParentClick(event) {
184
+ event.stopPropagation();
185
+ }
186
+ }
187
+ function SectionHeader({ text, UNSAFE_style, UNSAFE_className, }) {
188
+ return (React__default.createElement("div", { className: classnames(styles$2.sectionHeader, UNSAFE_className), "aria-hidden": true, style: UNSAFE_style },
189
+ React__default.createElement(DefaultHeaderContent, null, text)));
190
+ }
191
+ function Action(props) {
192
+ const { label, sectionLabel, icon, iconColor, destructive, UNSAFE_style, UNSAFE_className, onClick, tabIndex, setItemNode, getItemProps, } = props;
193
+ const buttonClasses = classnames(styles$2.action, styles$2.legacyAction, {
194
+ [styles$2.destructive]: destructive,
195
+ });
196
+ return (React__default.createElement("button", Object.assign({ className: classnames(buttonClasses, UNSAFE_className), style: UNSAFE_style, key: label, type: "button" }, getItemProps({
197
+ ref: setItemNode,
198
+ role: "menuitem",
199
+ onClick,
200
+ tabIndex,
201
+ })),
202
+ React__default.createElement(DefaultItemContent, { label: label, icon: icon, iconColor: iconColor, destructive: destructive, sectionLabel: sectionLabel })));
203
+ }
204
+ function DefaultItemContent({ label, icon, iconColor, destructive, sectionLabel, }) {
205
+ return (React__default.createElement(React__default.Fragment, null,
206
+ icon && (React__default.createElement("div", null,
207
+ React__default.createElement(Icon, { color: destructive ? "destructive" : iconColor, name: icon }))),
208
+ React__default.createElement(Typography, { element: "span", fontWeight: "semiBold", textColor: destructive ? "destructive" : "text" },
209
+ sectionLabel && (React__default.createElement("span", { className: styles$2.screenReaderOnly }, sectionLabel)),
210
+ label)));
211
+ }
212
+ function DefaultHeaderContent({ children, }) {
213
+ return (React__default.createElement(Typography, { element: "h6", size: "base", textColor: "textSecondary", fontWeight: "regular", textCase: "none" }, children));
214
+ }
215
+ function MenuPortal({ children }) {
216
+ if (typeof document === "undefined") {
217
+ return null;
218
+ }
219
+ return React__default.createElement(ScopedPortal, null, children);
220
+ }
221
+
222
+ var styles$1 = {"submenuHeader":"Vw9MFreevMU-","submenuTitle":"wpNMcBuNwwY-","spinning":"nOEBQCC4Cos-"};
223
+
224
+ var styles = {"wrapper":"fpi0W91w2ag-","floatingContainer":"ba-Kj6mvQUw-","composableBackdrop":"wqvf3hcDMM0-","menu":"-DayvgvIcVo-","legacySection":"VsRRunpS6Yo-","separator":"jnggqK3YTIU-","triggerWrapper":"oRQQVVq-yxA-","composableMenu":"atokGnmWVls-","composableDropdownPopup":"Uk14qmg-Fqc-","composableDropdownScroller":"CJKnGqldjF0-","bottomSheetMenuContent":"J3CW8IU48RM-","composableItem":"zSMkwrZodBk-","composableItemNoLeadingSlot":"qbDWOwkPouM-","composableSection":"_353OIWGazfE-","composableGroup":"Q0ssxff-Qo4-","composableRadioGroup":"_2VyPM45lQBE-","composableSectionHeader":"efA-ozx9w0w-","composableGroupHeader":"BklkzNPbJ5Q-","composableGroupLabel":"_5-p9DbyRav4-","sectionHeader":"Bq7pLWj3jm4-","legacyAction":"P4Sdaq0-lZs-","action":"M1BgN-oCmKw-","destructive":"U9ihZZavz9w-","overlay":"_7we5hh6kYs8-","bottomSheetSubmenuPopup":"nf47GCAYI-c-","menuHidden":"cuw8ct7rX6s-","bottomSheetSubmenuBody":"a6uZEXgX8sg-","fullWidth":"_5OJ7B6mFcwk-","screenReaderOnly":"Bzvkz60bwWE-","spinning":"_0-VzuzHdi8o-"};
225
+
226
+ function mergeUnsafeProps(props) {
227
+ return mergeProps({
228
+ className: props.UNSAFE_className,
229
+ style: props.UNSAFE_style,
230
+ }, {
231
+ className: props.className,
232
+ style: props.style,
233
+ });
234
+ }
235
+
236
+ // New composable menu pieces prefer standard DOM props, but we still accept the
237
+ // old UNSAFE_* names during the migration window. Base UI's merge semantics let
238
+ // either API path continue to work while standard props still win on conflicts.
239
+ function resolveComposableBaseProps(props) {
240
+ return mergeUnsafeProps(props);
241
+ }
242
+ // Detects whether a composed item already includes a specific slot so each
243
+ // shell can adjust layout without needing to understand every child shape.
244
+ function hasMenuSlot(children, slot) {
245
+ return React__default.Children.toArray(children).some(child => {
246
+ if (!React__default.isValidElement(child)) {
247
+ return false;
248
+ }
249
+ if (typeof child.type === "string" || !("menuSlot" in child.type)) {
250
+ return false;
251
+ }
252
+ return child.type.menuSlot === slot;
253
+ });
254
+ }
255
+ // Falls back to the default Rulnar button trigger when a consumer does not
256
+ // provide a custom render function or element.
257
+ function resolveMenuTriggerRender({ children, render, }) {
258
+ if (render) {
259
+ if (typeof render === "function") {
260
+ return (props) => {
261
+ const renderedElement = render(normalizeBaseUiButtonProps(props));
262
+ return isRulnarButtonRenderTarget(renderedElement)
263
+ ? stripNativeTypeFromButtonRenderTarget(renderedElement)
264
+ : renderedElement;
265
+ };
266
+ }
267
+ return isRulnarButtonRenderTarget(render)
268
+ ? renderRulnarButtonTarget(render)
269
+ : render;
270
+ }
271
+ if (isRulnarButtonRenderTarget(children)) {
272
+ return renderRulnarButtonTarget(children);
273
+ }
274
+ if (React__default.isValidElement(children)) {
275
+ return children;
276
+ }
277
+ return renderRulnarButtonTarget(React__default.createElement(Button, { type: "secondary" },
278
+ React__default.createElement(Button.Label, null, children)));
279
+ }
280
+ const MenuItemContext = React__default.createContext(null);
281
+ function MenuItemProvider({ children, variation, }) {
282
+ return (React__default.createElement(MenuItemContext.Provider, { value: { variation } }, children));
283
+ }
284
+ function useMenuItemContext() {
285
+ const context = React__default.useContext(MenuItemContext);
286
+ return context !== null && context !== void 0 ? context : {};
287
+ }
288
+ function SharedMenuItemIcon(props) {
289
+ const { variation } = useMenuItemContext();
290
+ return (
291
+ // TODO: Remove this wrapper once Icon can accept the data attributes needed
292
+ // for Menu slot styling directly.
293
+ React__default.createElement("div", { "data-menu-slot": "icon" },
294
+ React__default.createElement(Icon, Object.assign({}, props, { color: variation === "destructive" ? "destructive" : props.color }))));
295
+ }
296
+ function SharedMenuItemLabel(props) {
297
+ const { variation } = useMenuItemContext();
298
+ return (
299
+ // TODO: Remove this wrapper once Typography can accept the data attributes
300
+ // needed for Menu slot styling directly.
301
+ React__default.createElement("div", { "data-menu-slot": "label" },
302
+ React__default.createElement(Typography, { element: "span", size: "base", fontWeight: "semiBold", textColor: variation === "destructive" ? "destructive" : "text" }, props.children)));
303
+ }
304
+ function SharedMenuItemPrefix(props) {
305
+ const { className, style } = resolveComposableBaseProps(props);
306
+ return (React__default.createElement("div", { className: className, "data-menu-slot": "prefix", style: style }, props.children));
307
+ }
308
+ function SharedMenuItemSuffix(props) {
309
+ const { className, style } = resolveComposableBaseProps(props);
310
+ return (React__default.createElement("div", { className: className, "data-menu-slot": "suffix", style: style }, props.children));
311
+ }
312
+ const sharedMenuGroupLabelClassName = `${styles.composableGroupHeader} ${styles.composableGroupLabel}`;
313
+ function DefaultGroupLabelContent({ children, }) {
314
+ return (React__default.createElement(Typography, { element: "span", size: "base", textColor: "textSecondary", fontWeight: "regular", textCase: "none" }, children));
315
+ }
316
+ function SharedMenuGroupLabelContent(props) {
317
+ return React__default.createElement(DefaultGroupLabelContent, null, props.children);
318
+ }
319
+
320
+ const BottomSheetContext = React__default.createContext(null);
321
+ const BottomSheetRadioGroupContext = React__default.createContext(null);
322
+ const BottomSheetGroupContext = React__default.createContext(null);
323
+ const BottomSheetSubmenuContext = React__default.createContext(null);
324
+ const MENU_ITEM_SELECTOR = '[role="menuitem"], [role="menuitemradio"]';
325
+ function useBottomSheetContext() {
326
+ const context = React__default.useContext(BottomSheetContext);
327
+ if (!context) {
328
+ throw new Error("BottomSheetContext used outside provider");
329
+ }
330
+ return context;
331
+ }
332
+ function useBottomSheetRadioGroupContext() {
333
+ return React__default.useContext(BottomSheetRadioGroupContext);
334
+ }
335
+ function useBottomSheetGroupContext() {
336
+ const context = React__default.useContext(BottomSheetGroupContext);
337
+ if (!context) {
338
+ throw new Error("BottomSheetGroupContext used outside provider");
339
+ }
340
+ return context;
341
+ }
342
+ function useBottomSheetSubmenuContext() {
343
+ const context = React__default.useContext(BottomSheetSubmenuContext);
344
+ if (!context) {
345
+ throw new Error("BottomSheetSubmenuContext used outside provider");
346
+ }
347
+ return context;
348
+ }
349
+ function getTextContent(node) {
350
+ if (typeof node === "string" || typeof node === "number") {
351
+ return String(node);
352
+ }
353
+ if (Array.isArray(node)) {
354
+ return node.map(child => getTextContent(child)).join(" ");
355
+ }
356
+ if (!React__default.isValidElement(node)) {
357
+ return "";
358
+ }
359
+ return getTextContent(node.props.children);
360
+ }
361
+ function getBottomSheetContentStyle(style) {
362
+ if (!style) {
363
+ return undefined;
364
+ }
365
+ const safeStyle = Object.assign({}, style);
366
+ delete safeStyle.height;
367
+ delete safeStyle.maxHeight;
368
+ delete safeStyle.minHeight;
369
+ delete safeStyle.width;
370
+ return safeStyle;
371
+ }
372
+ // Bottom sheet menu interaction helpers. These adapt Drawer semantics into the
373
+ // menu-style keyboard and focus behavior we want for the mobile shell.
374
+ function getNavigableMenuItems(target) {
375
+ const menu = target.closest('[role="menu"]');
376
+ if (!menu) {
377
+ return [];
378
+ }
379
+ return Array.from(menu.querySelectorAll(MENU_ITEM_SELECTOR)).filter(item => !item.hasAttribute("disabled"));
380
+ }
381
+ function moveBottomSheetMenuFocus(currentTarget, direction) {
382
+ var _a, _b;
383
+ const items = getNavigableMenuItems(currentTarget);
384
+ if (items.length === 0) {
385
+ return;
386
+ }
387
+ const boundaryIndex = direction === "first" ? 0 : direction === "last" ? items.length - 1 : null;
388
+ if (boundaryIndex !== null) {
389
+ (_a = items[boundaryIndex]) === null || _a === void 0 ? void 0 : _a.focus();
390
+ return;
391
+ }
392
+ const currentIndex = items.indexOf(currentTarget);
393
+ const startIndex = currentIndex === -1 ? 0 : currentIndex;
394
+ const offset = direction === "next" ? 1 : -1;
395
+ const nextIndex = (startIndex + offset + items.length) % items.length;
396
+ (_b = items[nextIndex]) === null || _b === void 0 ? void 0 : _b.focus();
397
+ }
398
+ function handleBottomSheetMenuItemKeyDown(event) {
399
+ switch (event.key) {
400
+ case "ArrowDown":
401
+ event.preventDefault();
402
+ moveBottomSheetMenuFocus(event.currentTarget, "next");
403
+ break;
404
+ case "ArrowUp":
405
+ event.preventDefault();
406
+ moveBottomSheetMenuFocus(event.currentTarget, "previous");
407
+ break;
408
+ case "Home":
409
+ event.preventDefault();
410
+ moveBottomSheetMenuFocus(event.currentTarget, "first");
411
+ break;
412
+ case "End":
413
+ event.preventDefault();
414
+ moveBottomSheetMenuFocus(event.currentTarget, "last");
415
+ break;
416
+ }
417
+ }
418
+ function updateBottomSheetHighlight(event, focusModalityRef, setHighlighted) {
419
+ setHighlighted(focusModalityRef.current === "keyboard" ||
420
+ event.currentTarget.matches(":focus-visible"));
421
+ }
422
+ function useBottomSheetMenuItemInteractions() {
423
+ const { focusModalityRef } = useBottomSheetContext();
424
+ const [isHighlighted, setIsHighlighted] = React__default.useState(false);
425
+ return {
426
+ isHighlighted,
427
+ interactionProps: {
428
+ onPointerDown: () => {
429
+ focusModalityRef.current = "pointer";
430
+ },
431
+ onFocus: (event) => {
432
+ updateBottomSheetHighlight(event, focusModalityRef, setIsHighlighted);
433
+ },
434
+ onBlur: () => {
435
+ setIsHighlighted(false);
436
+ },
437
+ onKeyDown: (event) => {
438
+ focusModalityRef.current = "keyboard";
439
+ handleBottomSheetMenuItemKeyDown(event);
440
+ },
441
+ },
442
+ };
443
+ }
444
+ function getInitialBottomSheetFocus(menuRef, focusModalityRef) {
445
+ return (openType) => {
446
+ var _a;
447
+ if (openType === "keyboard") {
448
+ focusModalityRef.current = "keyboard";
449
+ return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(MENU_ITEM_SELECTOR);
450
+ }
451
+ focusModalityRef.current = "pointer";
452
+ return menuRef.current;
453
+ };
454
+ }
455
+ function handleBottomSheetMenuContainerKeyDown(event) {
456
+ if (event.target !== event.currentTarget) {
457
+ return;
458
+ }
459
+ switch (event.key) {
460
+ case "ArrowDown":
461
+ case "Home":
462
+ event.preventDefault();
463
+ moveBottomSheetMenuFocus(event.currentTarget, "first");
464
+ break;
465
+ case "ArrowUp":
466
+ case "End":
467
+ event.preventDefault();
468
+ moveBottomSheetMenuFocus(event.currentTarget, "last");
469
+ break;
470
+ }
471
+ }
472
+ function BottomSheetMenuSurface({ children, className, menuRef, style, }) {
473
+ const { focusModalityRef } = useBottomSheetContext();
474
+ return (React__default.createElement("div", { ref: menuRef, className: classnames(styles.composableMenu, className), role: "menu", tabIndex: -1, onKeyDown: event => {
475
+ focusModalityRef.current = "keyboard";
476
+ handleBottomSheetMenuContainerKeyDown(event);
477
+ }, style: style }, children));
478
+ }
479
+ function BottomSheetRoot({ children, onOpenChange, open, defaultOpen, }) {
480
+ // Mobile submenu drill-downs use their own drawer layer. We track that here
481
+ // so the parent sheet can hide while a nested submenu is open.
482
+ const [submenuOpen, setSubmenuOpen] = React__default.useState(false);
483
+ const focusModalityRef = React__default.useRef("pointer");
484
+ const actionsRef = React__default.useRef(null);
485
+ return (React__default.createElement(BottomSheet.Root, { actionsRef: actionsRef, open: open, defaultOpen: defaultOpen, onOpenChange: nextOpen => {
486
+ if (!nextOpen) {
487
+ setSubmenuOpen(false);
488
+ }
489
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
490
+ } },
491
+ React__default.createElement(BottomSheetContext.Provider, { value: {
492
+ close: () => {
493
+ var _a;
494
+ (_a = actionsRef.current) === null || _a === void 0 ? void 0 : _a.close();
495
+ },
496
+ focusModalityRef,
497
+ setSubmenuOpen,
498
+ submenuOpen,
499
+ } }, children)));
500
+ }
501
+ const BottomSheetTrigger = React__default.forwardRef(function BottomSheetTrigger({ ariaLabel, children, style, className, render, UNSAFE_style, UNSAFE_className, }, ref) {
502
+ const resolvedBaseProps = resolveComposableBaseProps({
503
+ className,
504
+ style,
505
+ UNSAFE_className,
506
+ UNSAFE_style,
507
+ });
508
+ return (React__default.createElement(DrawerTrigger, { "aria-label": ariaLabel, className: classnames(styles.triggerWrapper, resolvedBaseProps.className), style: resolvedBaseProps.style, render: resolveMenuTriggerRender({ children, render }), ref: ref }));
509
+ });
510
+ function BottomSheetContent({ children, portalContainer, style, className, UNSAFE_style, UNSAFE_className, }) {
511
+ const { focusModalityRef, submenuOpen } = useBottomSheetContext();
512
+ const menuRef = React__default.useRef(null);
513
+ const resolvedBaseProps = resolveComposableBaseProps({
514
+ className,
515
+ style,
516
+ UNSAFE_className,
517
+ UNSAFE_style,
518
+ });
519
+ const bottomSheetStyle = getBottomSheetContentStyle(resolvedBaseProps.style);
520
+ return (React__default.createElement(BottomSheet.Popup, { portalContainer, "data-elevation": "elevated", initialFocus: getInitialBottomSheetFocus(menuRef, focusModalityRef), className: classnames({
521
+ [styles.menuHidden]: submenuOpen,
522
+ }) },
523
+ React__default.createElement(BottomSheet.Content, null,
524
+ React__default.createElement(BottomSheetMenuSurface, { menuRef: menuRef, className: classnames(styles.bottomSheetMenuContent, resolvedBaseProps.className), style: bottomSheetStyle }, children))));
525
+ }
526
+ function BottomSheetSeparator({ style, className, UNSAFE_style, UNSAFE_className, }) {
527
+ const resolvedBaseProps = resolveComposableBaseProps({
528
+ className,
529
+ style,
530
+ UNSAFE_className,
531
+ UNSAFE_style,
532
+ });
533
+ return (React__default.createElement(OverlaySeparator, { className: classnames(styles.separator, resolvedBaseProps.className), style: resolvedBaseProps.style, "data-testid": "ATL-Menu-Separator" }));
534
+ }
535
+ function BottomSheetRadioGroup({ children, value, defaultValue, onValueChange, className, style, UNSAFE_style, UNSAFE_className, }) {
536
+ const resolvedBaseProps = resolveComposableBaseProps({
537
+ className,
538
+ style,
539
+ UNSAFE_className,
540
+ UNSAFE_style,
541
+ });
542
+ const [internalValue, setInternalValue] = React__default.useState(defaultValue);
543
+ const selectedValue = value !== null && value !== void 0 ? value : internalValue;
544
+ return (React__default.createElement(BottomSheetRadioGroupContext.Provider, { value: {
545
+ value: selectedValue,
546
+ setValue: nextValue => {
547
+ if (value === undefined) {
548
+ setInternalValue(nextValue);
549
+ }
550
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(nextValue);
551
+ },
552
+ } },
553
+ React__default.createElement("div", { className: classnames(styles.composableRadioGroup, resolvedBaseProps.className), style: resolvedBaseProps.style }, children)));
554
+ }
555
+ function BottomSheetGroup(props) {
556
+ const { className, style } = resolveComposableBaseProps(props);
557
+ const labelId = React__default.useId();
558
+ const [hasLabel, setHasLabel] = React__default.useState(false);
559
+ const registerLabel = React__default.useCallback((nextHasLabel) => {
560
+ setHasLabel(nextHasLabel);
561
+ }, []);
562
+ return (React__default.createElement(BottomSheetGroupContext.Provider, { value: { labelId, registerLabel } },
563
+ React__default.createElement("div", { role: "group", "aria-labelledby": hasLabel ? labelId : undefined, "aria-label": !hasLabel ? props.ariaLabel : undefined, className: classnames(styles.composableGroup, className), style: style }, props.children)));
564
+ }
565
+ const BottomSheetItem = React__default.forwardRef(function BottomSheetItem(props, ref) {
566
+ const { close } = useBottomSheetContext();
567
+ const { isHighlighted, interactionProps } = useBottomSheetMenuItemInteractions();
568
+ const { className: itemClassName, style } = resolveComposableBaseProps(props);
569
+ const hasLeadingContent = hasMenuSlot(props.children, "icon") ||
570
+ hasMenuSlot(props.children, "prefix");
571
+ const className = classnames(styles.action, styles.composableItem, {
572
+ [styles.composableItemNoLeadingSlot]: !hasLeadingContent,
573
+ }, {
574
+ [styles.destructive]: props.variation === "destructive",
575
+ }, itemClassName);
576
+ if (props.href) {
577
+ const { href, target, rel, onClick, closeOnClick = true } = props;
578
+ return (React__default.createElement("a", Object.assign({ ref: ref, className: className, "data-highlighted": isHighlighted ? "" : undefined, style: style, href: href, role: "menuitem", target: target, rel: rel }, interactionProps, { onClick: event => {
579
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
580
+ if (closeOnClick) {
581
+ close();
582
+ }
583
+ } }),
584
+ React__default.createElement(MenuItemProvider, { variation: props.variation }, props.children)));
585
+ }
586
+ return (React__default.createElement("button", Object.assign({ ref: ref, className: className, "data-highlighted": isHighlighted ? "" : undefined, style: style, type: "button", role: "menuitem" }, interactionProps, { onClick: () => {
587
+ var _a;
588
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
589
+ if (props.closeOnClick !== false) {
590
+ close();
591
+ }
592
+ } }),
593
+ React__default.createElement(MenuItemProvider, { variation: props.variation }, props.children)));
594
+ });
595
+ const BottomSheetRadioItem = React__default.forwardRef(function BottomSheetRadioItem(props, ref) {
596
+ const { close } = useBottomSheetContext();
597
+ const radioGroup = useBottomSheetRadioGroupContext();
598
+ const { isHighlighted, interactionProps } = useBottomSheetMenuItemInteractions();
599
+ const { className, style } = resolveComposableBaseProps(props);
600
+ const checked = (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === props.value;
601
+ const hasCustomSuffix = hasMenuSlot(props.children, "suffix");
602
+ const hasLeadingContent = hasMenuSlot(props.children, "icon") ||
603
+ hasMenuSlot(props.children, "prefix");
604
+ return (React__default.createElement("button", Object.assign({ ref: ref, className: classnames(styles.action, styles.composableItem, {
605
+ [styles.composableItemNoLeadingSlot]: !hasLeadingContent,
606
+ }, className), "data-highlighted": isHighlighted ? "" : undefined, style: style, type: "button", role: "menuitemradio", "aria-checked": checked }, interactionProps, { onClick: () => {
607
+ radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.setValue(props.value);
608
+ if (props.closeOnClick) {
609
+ close();
610
+ }
611
+ } }),
612
+ React__default.createElement(MenuItemProvider, null,
613
+ props.children,
614
+ !hasCustomSuffix ? (React__default.createElement("div", { "data-menu-slot": "suffix", "data-checked": checked ? "" : undefined, "data-unchecked": !checked ? "" : undefined },
615
+ React__default.createElement(Icon, { color: "icon", name: "checkmark" }))) : null)));
616
+ });
617
+ function BottomSheetSubmenu({ children, open, defaultOpen, onOpenChange, }) {
618
+ const { setSubmenuOpen } = useBottomSheetContext();
619
+ // The trigger writes its title here during render; the content reads it
620
+ // when the drill-down sheet mounts. No setState, no effect roundtrip.
621
+ const titleRef = React__default.useRef("");
622
+ React__default.useEffect(() => {
623
+ // Safety reset so the parent sheet is never left hidden if this submenu
624
+ // unmounts unexpectedly while it controls the nested-drawer state.
625
+ return () => {
626
+ setSubmenuOpen(false);
627
+ };
628
+ }, [setSubmenuOpen]);
629
+ return (React__default.createElement(BottomSheetSubmenuContext.Provider, { value: { titleRef } },
630
+ React__default.createElement(BottomSheet.Root, { open: open, defaultOpen: defaultOpen, onOpenChange: isOpen => {
631
+ setSubmenuOpen(isOpen);
632
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
633
+ } }, children)));
634
+ }
635
+ const BottomSheetSubmenuTrigger = React__default.forwardRef(function BottomSheetSubmenuTrigger({ children, className, style, textValue, UNSAFE_style, UNSAFE_className }, ref) {
636
+ const { isHighlighted, interactionProps } = useBottomSheetMenuItemInteractions();
637
+ const resolvedBaseProps = resolveComposableBaseProps({
638
+ className,
639
+ style,
640
+ UNSAFE_className,
641
+ UNSAFE_style,
642
+ });
643
+ const hasCustomSuffix = hasMenuSlot(children, "suffix");
644
+ const hasLeadingContent = hasMenuSlot(children, "icon") || hasMenuSlot(children, "prefix");
645
+ const { titleRef } = useBottomSheetSubmenuContext();
646
+ // Publish the title synchronously during render so the drill-down sheet
647
+ // header can read it the moment it mounts. Prefer the explicit textValue
648
+ // used for type-to-select, and fall back to the rendered text content.
649
+ titleRef.current = textValue !== null && textValue !== void 0 ? textValue : getTextContent(children).trim();
650
+ return (React__default.createElement(DrawerTrigger, Object.assign({ ref: ref, role: "menuitem", "aria-haspopup": "menu", "data-highlighted": isHighlighted ? "" : undefined, className: classnames(styles.action, styles.composableItem, {
651
+ [styles.composableItemNoLeadingSlot]: !hasLeadingContent,
652
+ }, resolvedBaseProps.className), style: resolvedBaseProps.style, nativeButton: true }, interactionProps, { render: React__default.createElement("button", { type: "button" }) }),
653
+ children,
654
+ !hasCustomSuffix ? (React__default.createElement("div", { "data-menu-slot": "suffix" },
655
+ React__default.createElement(Icon, { color: "icon", name: "arrowRight" }))) : null));
656
+ });
657
+ function BottomSheetSubmenuContent({ children, className, style, UNSAFE_style, UNSAFE_className, }) {
658
+ const { t } = useComponentMessages(menuMessages);
659
+ const { titleRef } = useBottomSheetSubmenuContext();
660
+ const title = titleRef.current;
661
+ const { focusModalityRef } = useBottomSheetContext();
662
+ const menuRef = React__default.useRef(null);
663
+ const resolvedBaseProps = resolveComposableBaseProps({
664
+ className,
665
+ style,
666
+ UNSAFE_className,
667
+ UNSAFE_style,
668
+ });
669
+ const bottomSheetStyle = getBottomSheetContentStyle(resolvedBaseProps.style);
670
+ return (React__default.createElement(BottomSheet.Popup, { "data-elevation": "elevated", initialFocus: getInitialBottomSheetFocus(menuRef, focusModalityRef), className: classnames(styles.menu, styles.bottomSheetSubmenuPopup) },
671
+ React__default.createElement(BottomSheet.Content, { style: bottomSheetStyle },
672
+ title ? (React__default.createElement(DrawerTitle, { className: styles.screenReaderOnly }, title)) : null,
673
+ React__default.createElement("div", { className: styles$1.submenuHeader },
674
+ React__default.createElement(DrawerClose, { "aria-label": title ? t("Back to {title}", { title }) : t("back"), render: React__default.createElement(Button, { ariaLabel: title ? t("Back to {title}", { title }) : t("back"), icon: "arrowLeft", type: "tertiary", variation: "subtle" }) }),
675
+ title ? (React__default.createElement("div", { className: styles$1.submenuTitle },
676
+ React__default.createElement(Typography, { element: "span", size: "base", fontWeight: "semiBold", textColor: "text" }, title))) : null),
677
+ React__default.createElement(BottomSheetMenuSurface, { menuRef: menuRef, className: classnames(styles.bottomSheetSubmenuBody, styles.composableSection, resolvedBaseProps.className) }, children))));
678
+ }
679
+ function BottomSheetGroupLabel(props) {
680
+ const { className, style } = resolveComposableBaseProps(props);
681
+ const { labelId, registerLabel } = useBottomSheetGroupContext();
682
+ React__default.useEffect(() => {
683
+ registerLabel(true);
684
+ return () => {
685
+ registerLabel(false);
686
+ };
687
+ }, [registerLabel]);
688
+ return (React__default.createElement("div", { id: labelId, role: "presentation", className: classnames(sharedMenuGroupLabelClassName, className), style: style },
689
+ React__default.createElement(SharedMenuGroupLabelContent, Object.assign({}, props))));
690
+ }
691
+ const MenuBottomSheet = Object.assign(BottomSheetRoot, {
692
+ Trigger: BottomSheetTrigger,
693
+ Content: BottomSheetContent,
694
+ Separator: BottomSheetSeparator,
695
+ RadioGroup: BottomSheetRadioGroup,
696
+ RadioItem: BottomSheetRadioItem,
697
+ Submenu: BottomSheetSubmenu,
698
+ SubmenuTrigger: BottomSheetSubmenuTrigger,
699
+ SubmenuContent: BottomSheetSubmenuContent,
700
+ Group: BottomSheetGroup,
701
+ Item: BottomSheetItem,
702
+ ItemIcon: SharedMenuItemIcon,
703
+ ItemLabel: SharedMenuItemLabel,
704
+ ItemPrefix: SharedMenuItemPrefix,
705
+ ItemSuffix: SharedMenuItemSuffix,
706
+ GroupLabel: BottomSheetGroupLabel,
707
+ });
708
+
709
+ // Desktop/dropdown implementation for Menu. This maps the Rulnar
710
+ // sugar API onto Base UI Menu primitives while sharing the visual slot layer
711
+ // with the mobile BottomSheet implementation.
712
+ const MenuDropdownContext = React__default.createContext(null);
713
+ function useMenuDropdownContext() {
714
+ const context = React__default.useContext(MenuDropdownContext);
715
+ if (!context) {
716
+ throw new Error("MenuDropdownContext used outside provider");
717
+ }
718
+ return context;
719
+ }
720
+ function getFloatingLayerStyle(style) {
721
+ if ((style === null || style === void 0 ? void 0 : style.zIndex) == null)
722
+ return undefined;
723
+ return { zIndex: style.zIndex };
724
+ }
725
+ function getMenuPopupStyle(style) {
726
+ return Object.assign({ maxHeight: `min(${MENU_MAX_HEIGHT_PERCENTAGE}vh, max(0px, calc(var(--available-height) - var(--space-base))))` }, style);
727
+ }
728
+ function MenuDropdownRoot({ children, onOpenChange, open, defaultOpen, }) {
729
+ const actionsRef = React__default.useRef(null);
730
+ return (React__default.createElement(MenuDropdownContext.Provider, { value: {
731
+ close: () => {
732
+ var _a;
733
+ (_a = actionsRef.current) === null || _a === void 0 ? void 0 : _a.close();
734
+ },
735
+ } },
736
+ React__default.createElement(MenuRoot, { actionsRef: actionsRef, open: open, defaultOpen: defaultOpen, onOpenChange: isOpen => {
737
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
738
+ } }, children)));
739
+ }
740
+ const MenuDropdownTrigger = React__default.forwardRef(function MenuDropdownTrigger({ ariaLabel, children, style, className, render, UNSAFE_style, UNSAFE_className, }, ref) {
741
+ const resolvedBaseProps = resolveComposableBaseProps({
742
+ className,
743
+ style,
744
+ UNSAFE_className,
745
+ UNSAFE_style,
746
+ });
747
+ // ComposableMenu.Trigger is Rulnar sugar over Base UI's trigger render API,
748
+ // letting us provide a default Rulnar trigger while still allowing custom renders.
749
+ return (React__default.createElement(MenuTrigger$1, { "aria-label": ariaLabel, className: classnames(styles.triggerWrapper, resolvedBaseProps.className), style: resolvedBaseProps.style, render: resolveMenuTriggerRender({ children, render }), ref: ref }));
750
+ });
751
+ function MenuDropdownContent({ children, portalContainer, style, className, preferredPlacement, UNSAFE_style, UNSAFE_className, }) {
752
+ var _a;
753
+ const resolvedBaseProps = resolveComposableBaseProps({
754
+ className,
755
+ style,
756
+ UNSAFE_className,
757
+ UNSAFE_style,
758
+ });
759
+ // Safe assertion: MenuPlacement is a bare side or a "side align" pair.
760
+ const [side = "bottom", align = "start"] = ((_a = preferredPlacement === null || preferredPlacement === void 0 ? void 0 : preferredPlacement.split(" ")) !== null && _a !== void 0 ? _a : []);
761
+ const floatingLayerStyle = getFloatingLayerStyle(resolvedBaseProps.style);
762
+ const popupStyle = getMenuPopupStyle(resolvedBaseProps.style);
763
+ return (React__default.createElement(ScopedPortal1, { container: portalContainer },
764
+ React__default.createElement(MenuBackdrop, { className: styles.composableBackdrop }),
765
+ React__default.createElement(MenuPositioner, { className: styles.floatingContainer, style: floatingLayerStyle, align: align, side: side, sideOffset: MENU_OFFSET },
766
+ React__default.createElement(MenuPopup, { "data-elevation": "elevated", className: classnames(styles.menu, styles.composableDropdownPopup, resolvedBaseProps.className), style: popupStyle },
767
+ React__default.createElement("div", { className: classnames(styles.composableMenu, styles.composableDropdownScroller) }, children)))));
768
+ }
769
+ function MenuDropdownRadioGroup({ children, value, defaultValue, onValueChange, className, style, UNSAFE_style, UNSAFE_className, }) {
770
+ const resolvedBaseProps = resolveComposableBaseProps({
771
+ className,
772
+ style,
773
+ UNSAFE_className,
774
+ UNSAFE_style,
775
+ });
776
+ return (React__default.createElement(MenuRadioGroup$1, { value: value, defaultValue: defaultValue, onValueChange: nextValue => {
777
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(String(nextValue));
778
+ }, className: classnames(styles.composableRadioGroup, resolvedBaseProps.className), style: resolvedBaseProps.style }, children));
779
+ }
780
+ function MenuDropdownSeparator({ style, className, UNSAFE_style, UNSAFE_className, }) {
781
+ const resolvedBaseProps = resolveComposableBaseProps({
782
+ className,
783
+ style,
784
+ UNSAFE_className,
785
+ UNSAFE_style,
786
+ });
787
+ return (React__default.createElement(OverlaySeparator, { className: classnames(styles.separator, resolvedBaseProps.className), style: resolvedBaseProps.style, "data-testid": "ATL-Menu-Separator" }));
788
+ }
789
+ function MenuDropdownGroup(props) {
790
+ const { className, style } = resolveComposableBaseProps(props);
791
+ return (React__default.createElement(MenuGroup$1, { "aria-label": props.ariaLabel, className: classnames(styles.composableGroup, className), style: style }, props.children));
792
+ }
793
+ const MenuDropdownItem = React__default.forwardRef(function MenuDropdownItem(props, ref) {
794
+ const { close } = useMenuDropdownContext();
795
+ const { className: itemClassName, style } = resolveComposableBaseProps(props);
796
+ const { textValue } = props;
797
+ const hasLeadingContent = hasMenuSlot(props.children, "icon") ||
798
+ hasMenuSlot(props.children, "prefix");
799
+ const className = classnames(styles.action, styles.composableItem, {
800
+ [styles.composableItemNoLeadingSlot]: !hasLeadingContent,
801
+ [styles.destructive]: props.variation === "destructive",
802
+ }, itemClassName);
803
+ if (props.href) {
804
+ const { href, target, rel, onClick, closeOnClick = true } = props;
805
+ return (React__default.createElement(MenuLinkItem, { ref: ref, className: className, style: style, label: textValue, href: href, target: target, rel: rel, closeOnClick: closeOnClick, onClick: onClick },
806
+ React__default.createElement(MenuItemProvider, { variation: props.variation }, props.children)));
807
+ }
808
+ return (React__default.createElement(MenuItem$1, { ref: ref, className: className, style: style, label: textValue, closeOnClick: props.closeOnClick, nativeButton: true, render: React__default.createElement("button", { type: "button" }), onClick: () => {
809
+ var _a;
810
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
811
+ }, onKeyUp: event => {
812
+ // Preserve the Space fallback for commands that dismiss the menu.
813
+ if (event.key === " " && props.closeOnClick !== false) {
814
+ close();
815
+ }
816
+ } },
817
+ React__default.createElement(MenuItemProvider, { variation: props.variation }, props.children)));
818
+ });
819
+ const MenuDropdownRadioItem = React__default.forwardRef(function MenuDropdownRadioItem(props, ref) {
820
+ const { className, style } = resolveComposableBaseProps(props);
821
+ const hasCustomSuffix = hasMenuSlot(props.children, "suffix");
822
+ const hasLeadingContent = hasMenuSlot(props.children, "icon") ||
823
+ hasMenuSlot(props.children, "prefix");
824
+ return (React__default.createElement(MenuRadioItem$1, { ref: ref, className: classnames(styles.action, styles.composableItem, {
825
+ [styles.composableItemNoLeadingSlot]: !hasLeadingContent,
826
+ }, className), style: style, value: props.value, label: props.textValue, closeOnClick: props.closeOnClick, nativeButton: true, render: React__default.createElement("button", { type: "button" }) },
827
+ React__default.createElement(MenuItemProvider, null,
828
+ props.children,
829
+ !hasCustomSuffix ? (React__default.createElement(MenuRadioItemIndicator, { "data-menu-slot": "suffix", keepMounted: true },
830
+ React__default.createElement(Icon, { color: "icon", name: "checkmark" }))) : null)));
831
+ });
832
+ function MenuDropdownSubmenu({ children, open, defaultOpen, onOpenChange, }) {
833
+ return (React__default.createElement(MenuSubmenuRoot, { open: open, defaultOpen: defaultOpen, onOpenChange: isOpen => {
834
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
835
+ } }, children));
836
+ }
837
+ const MenuDropdownSubmenuTrigger = React__default.forwardRef(function MenuDropdownSubmenuTrigger(props, ref) {
838
+ const resolvedBaseProps = resolveComposableBaseProps(props);
839
+ const hasCustomSuffix = hasMenuSlot(props.children, "suffix");
840
+ const hasLeadingContent = hasMenuSlot(props.children, "icon") ||
841
+ hasMenuSlot(props.children, "prefix");
842
+ return (React__default.createElement(MenuSubmenuTrigger$1, { ref: ref, className: classnames(styles.action, styles.composableItem, {
843
+ [styles.composableItemNoLeadingSlot]: !hasLeadingContent,
844
+ }, resolvedBaseProps.className), style: resolvedBaseProps.style, label: props.textValue, nativeButton: true, render: React__default.createElement("button", { type: "button" }) },
845
+ props.children,
846
+ !hasCustomSuffix ? (React__default.createElement("div", { "data-menu-slot": "suffix" },
847
+ React__default.createElement(Icon, { color: "icon", name: "arrowRight" }))) : null));
848
+ });
849
+ function MenuDropdownSubmenuContent({ children, className, style, UNSAFE_style, UNSAFE_className, }) {
850
+ const resolvedBaseProps = resolveComposableBaseProps({
851
+ className,
852
+ style,
853
+ UNSAFE_className,
854
+ UNSAFE_style,
855
+ });
856
+ const floatingLayerStyle = getFloatingLayerStyle(resolvedBaseProps.style);
857
+ const popupStyle = getMenuPopupStyle(resolvedBaseProps.style);
858
+ return (React__default.createElement(ScopedPortal1, null,
859
+ React__default.createElement(MenuPositioner, { className: styles.floatingContainer, style: floatingLayerStyle, align: "start", side: "right", sideOffset: MENU_OFFSET },
860
+ React__default.createElement(MenuPopup, { "data-elevation": "elevated", className: classnames(styles.menu, styles.composableDropdownPopup, resolvedBaseProps.className), style: popupStyle },
861
+ React__default.createElement("div", { className: classnames(styles.composableMenu, styles.composableDropdownScroller) }, children)))));
862
+ }
863
+ function MenuDropdownGroupLabel(props) {
864
+ const { className, style } = resolveComposableBaseProps(props);
865
+ return (React__default.createElement(MenuGroupLabel$1, { className: classnames(sharedMenuGroupLabelClassName, className), style: style },
866
+ React__default.createElement(SharedMenuGroupLabelContent, Object.assign({}, props))));
867
+ }
868
+ const MenuDropdown = Object.assign(MenuDropdownRoot, {
869
+ Trigger: MenuDropdownTrigger,
870
+ Content: MenuDropdownContent,
871
+ Separator: MenuDropdownSeparator,
872
+ RadioGroup: MenuDropdownRadioGroup,
873
+ RadioItem: MenuDropdownRadioItem,
874
+ Submenu: MenuDropdownSubmenu,
875
+ SubmenuTrigger: MenuDropdownSubmenuTrigger,
876
+ SubmenuContent: MenuDropdownSubmenuContent,
877
+ Group: MenuDropdownGroup,
878
+ Item: MenuDropdownItem,
879
+ ItemIcon: SharedMenuItemIcon,
880
+ ItemLabel: SharedMenuItemLabel,
881
+ ItemPrefix: SharedMenuItemPrefix,
882
+ ItemSuffix: SharedMenuItemSuffix,
883
+ GroupLabel: MenuDropdownGroupLabel,
884
+ });
885
+
886
+ function isLegacy(props) {
887
+ return "items" in props;
888
+ }
889
+ const MenuContext = React__default.createContext(null);
890
+ function useMenuContext() {
891
+ const context = React__default.useContext(MenuContext);
892
+ if (!context) {
893
+ throw new Error("Menu components must be rendered inside Menu");
894
+ }
895
+ return context;
896
+ }
897
+ function useMenuShell() {
898
+ const { isMobile } = useMenuContext();
899
+ return isMobile ? MenuBottomSheet : MenuDropdown;
900
+ }
901
+ function MenuComposableRoot(props) {
902
+ const isMobile = useIsSmallScreen();
903
+ const RootComponent = isMobile ? MenuBottomSheet : MenuDropdown;
904
+ return (React__default.createElement(MenuContext.Provider, { value: { isMobile } },
905
+ React__default.createElement(RootComponent, { onOpenChange: props.onOpenChange, open: props.open, defaultOpen: props.defaultOpen }, props.children)));
906
+ }
907
+ function Menu(props) {
908
+ if (isLegacy(props)) {
909
+ return React__default.createElement(MenuLegacy, Object.assign({}, props));
910
+ }
911
+ return React__default.createElement(MenuComposableRoot, Object.assign({}, props));
912
+ }
913
+ const MenuTrigger = React__default.forwardRef(function MenuTrigger(props, ref) {
914
+ const Shell = useMenuShell();
915
+ return React__default.createElement(Shell.Trigger, Object.assign({}, props, { ref: ref }));
916
+ });
917
+ function MenuContent(props) {
918
+ const Shell = useMenuShell();
919
+ return React__default.createElement(Shell.Content, Object.assign({}, props));
920
+ }
921
+ function MenuSeparator(props) {
922
+ const Shell = useMenuShell();
923
+ return React__default.createElement(Shell.Separator, Object.assign({}, props));
924
+ }
925
+ function MenuRadioGroup(props) {
926
+ const Shell = useMenuShell();
927
+ return React__default.createElement(Shell.RadioGroup, Object.assign({}, props));
928
+ }
929
+ const MenuRadioItem = React__default.forwardRef(function MenuRadioItem(props, ref) {
930
+ const Shell = useMenuShell();
931
+ return React__default.createElement(Shell.RadioItem, Object.assign({}, props, { ref: ref }));
932
+ });
933
+ function MenuSubmenu(props) {
934
+ const Shell = useMenuShell();
935
+ return React__default.createElement(Shell.Submenu, Object.assign({}, props));
936
+ }
937
+ const MenuSubmenuTrigger = React__default.forwardRef(function MenuSubmenuTrigger(props, ref) {
938
+ const Shell = useMenuShell();
939
+ return React__default.createElement(Shell.SubmenuTrigger, Object.assign({}, props, { ref: ref }));
940
+ });
941
+ function MenuSubmenuContent(props) {
942
+ const Shell = useMenuShell();
943
+ return React__default.createElement(Shell.SubmenuContent, Object.assign({}, props));
944
+ }
945
+ function MenuGroup(props) {
946
+ const Shell = useMenuShell();
947
+ return React__default.createElement(Shell.Group, Object.assign({}, props));
948
+ }
949
+ /**
950
+ * @deprecated Use Menu.Group instead.
951
+ * This wrapper keeps the old composable authoring shape working while the
952
+ * underlying menu structure uses grouped semantics.
953
+ */
954
+ function MenuSection(props) {
955
+ return React__default.createElement(MenuGroup, Object.assign({}, props));
956
+ }
957
+ const MenuItem = React__default.forwardRef(function MenuItem(props, ref) {
958
+ const Shell = useMenuShell();
959
+ return React__default.createElement(Shell.Item, Object.assign({}, props, { ref: ref }));
960
+ });
961
+ function MenuItemIcon(props) {
962
+ const Shell = useMenuShell();
963
+ return React__default.createElement(Shell.ItemIcon, Object.assign({}, props));
964
+ }
965
+ function MenuItemLabel(props) {
966
+ const Shell = useMenuShell();
967
+ return React__default.createElement(Shell.ItemLabel, Object.assign({}, props));
968
+ }
969
+ function MenuItemPrefix(props) {
970
+ const Shell = useMenuShell();
971
+ return React__default.createElement(Shell.ItemPrefix, Object.assign({}, props));
972
+ }
973
+ function MenuItemSuffix(props) {
974
+ const Shell = useMenuShell();
975
+ return React__default.createElement(Shell.ItemSuffix, Object.assign({}, props));
976
+ }
977
+ MenuItemPrefix.menuSlot =
978
+ "prefix";
979
+ MenuItemSuffix.menuSlot =
980
+ "suffix";
981
+ MenuItemIcon.menuSlot = "icon";
982
+ function MenuGroupLabel(props) {
983
+ const Shell = useMenuShell();
984
+ return React__default.createElement(Shell.GroupLabel, Object.assign({}, props));
985
+ }
986
+ /**
987
+ * @deprecated Use Menu.GroupLabel instead.
988
+ * Header remains as a thin wrapper so older JSX can keep compiling without
989
+ * recreating the old internal DOM structure.
990
+ */
991
+ function MenuHeader(props) {
992
+ return React__default.createElement(MenuGroupLabel, Object.assign({}, props));
993
+ }
994
+ /**
995
+ * @deprecated Use Menu.GroupLabel content directly instead.
996
+ * HeaderLabel is intentionally a pass-through so the old nested pattern:
997
+ * Menu.Header > Menu.HeaderLabel continues to compose onto the new GroupLabel.
998
+ */
999
+ function MenuHeaderLabel(props) {
1000
+ return React__default.createElement(React__default.Fragment, null, props.children);
1001
+ }
1002
+ // Menu now routes the legacy items-based API locally and owns the new
1003
+ // Base UI-backed composable implementation directly.
1004
+ Menu.Group = MenuGroup;
1005
+ Menu.GroupLabel = MenuGroupLabel;
1006
+ Menu.Section = MenuSection;
1007
+ Menu.Header = MenuHeader;
1008
+ Menu.HeaderLabel = MenuHeaderLabel;
1009
+ Menu.Item = MenuItem;
1010
+ Menu.Trigger = MenuTrigger;
1011
+ Menu.Content = MenuContent;
1012
+ Menu.Separator = MenuSeparator;
1013
+ Menu.RadioGroup = MenuRadioGroup;
1014
+ Menu.RadioItem = MenuRadioItem;
1015
+ Menu.Submenu = MenuSubmenu;
1016
+ Menu.SubmenuTrigger = MenuSubmenuTrigger;
1017
+ Menu.SubmenuContent = MenuSubmenuContent;
1018
+ Menu.ItemIcon = MenuItemIcon;
1019
+ Menu.ItemLabel = MenuItemLabel;
1020
+ Menu.ItemPrefix = MenuItemPrefix;
1021
+ Menu.ItemSuffix = MenuItemSuffix;
1022
+
1023
+ export { Menu as M, menuMessages as m };
1024
+
1025
+ function ScopedPortal({children}) {
1026
+ return React__default.createElement(FloatingPortal, null,
1027
+ React__default.createElement(ThemeBoundary, null, children));
1028
+ }
1029
+
1030
+ function ScopedPortal1({children, container}) {
1031
+ return React__default.createElement(MenuPortal$1, { container },
1032
+ React__default.createElement(ThemeBoundary, null, children));
1033
+ }