@cube-dev/ui-kit 0.212.0 → 0.213.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 (727) hide show
  1. package/dist/CHANGELOG.md +22 -0
  2. package/dist/_internal/hooks/use-debounced-value.js +1 -1
  3. package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
  4. package/dist/_internal/hooks/use-event.js +1 -1
  5. package/dist/_internal/hooks/use-is-first-render.js +1 -1
  6. package/dist/_internal/hooks/use-sync-ref.js +1 -1
  7. package/dist/_internal/hooks/use-timer/timer.js +1 -1
  8. package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
  9. package/dist/_internal/hooks/use-warn.js +1 -1
  10. package/dist/components/Block.js +1 -1
  11. package/dist/components/CollectionItem.js +1 -1
  12. package/dist/components/GlobalStyles.js +1 -1
  13. package/dist/components/GridProvider.d.ts +2 -1
  14. package/dist/components/GridProvider.js +6 -4
  15. package/dist/components/GridProvider.js.map +1 -1
  16. package/dist/components/HiddenInput.js +1 -1
  17. package/dist/components/Root.js +1 -1
  18. package/dist/components/actions/Action/Action.js +1 -1
  19. package/dist/components/actions/Banner/Banner.js +1 -1
  20. package/dist/components/actions/Button/AutoCollapseObserver.js +1 -1
  21. package/dist/components/actions/Button/Button.js +1 -1
  22. package/dist/components/actions/Button/index.js +1 -1
  23. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  24. package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
  25. package/dist/components/actions/ButtonSplit/context.js +1 -1
  26. package/dist/components/actions/CommandMenu/CommandMenu.d.ts +3 -2
  27. package/dist/components/actions/CommandMenu/CommandMenu.js +128 -131
  28. package/dist/components/actions/CommandMenu/CommandMenu.js.map +1 -1
  29. package/dist/components/actions/CommandMenu/styled.js +1 -1
  30. package/dist/components/actions/ItemAction/ItemAction.js +1 -1
  31. package/dist/components/actions/ItemActionContext.js +1 -1
  32. package/dist/components/actions/ItemActionsWrapper.js +1 -1
  33. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  34. package/dist/components/actions/Link/Link.js +1 -1
  35. package/dist/components/actions/Menu/Menu.js +1 -1
  36. package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
  37. package/dist/components/actions/Menu/MenuItem.js +1 -1
  38. package/dist/components/actions/Menu/MenuSection.js +1 -1
  39. package/dist/components/actions/Menu/MenuTrigger.js +4 -3
  40. package/dist/components/actions/Menu/MenuTrigger.js.map +1 -1
  41. package/dist/components/actions/Menu/SubMenuTrigger.js +4 -3
  42. package/dist/components/actions/Menu/SubMenuTrigger.js.map +1 -1
  43. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  44. package/dist/components/actions/Menu/context.js +1 -1
  45. package/dist/components/actions/Menu/styled.js +1 -1
  46. package/dist/components/actions/actions-run.js +1 -1
  47. package/dist/components/actions/use-action.js +1 -1
  48. package/dist/components/actions/use-anchored-menu.js +1 -1
  49. package/dist/components/actions/use-context-menu.js +1 -1
  50. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  51. package/dist/components/content/Alert/Alert.js +1 -1
  52. package/dist/components/content/Alert/use-alert.js +1 -1
  53. package/dist/components/content/Avatar/Avatar.js +1 -1
  54. package/dist/components/content/Badge/Badge.js +1 -1
  55. package/dist/components/content/Card/Card.js +1 -1
  56. package/dist/components/content/Content.js +1 -1
  57. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  58. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  59. package/dist/components/content/Disclosure/Disclosure.js +1 -1
  60. package/dist/components/content/Divider/Divider.js +1 -1
  61. package/dist/components/content/Footer.js +1 -1
  62. package/dist/components/content/Header.js +1 -1
  63. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  64. package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
  65. package/dist/components/content/InlineInput/InlineInput.js +1 -1
  66. package/dist/components/content/Item/Item.js +1 -1
  67. package/dist/components/content/Item/ItemWithNativeLinks.js +6 -10
  68. package/dist/components/content/Item/ItemWithNativeLinks.js.map +1 -1
  69. package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
  70. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  71. package/dist/components/content/Layout/GridLayout.js +1 -1
  72. package/dist/components/content/Layout/Layout.d.ts +3 -2
  73. package/dist/components/content/Layout/Layout.js +12 -5
  74. package/dist/components/content/Layout/Layout.js.map +1 -1
  75. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  76. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  77. package/dist/components/content/Layout/LayoutContainer.d.ts +3 -2
  78. package/dist/components/content/Layout/LayoutContainer.js +4 -3
  79. package/dist/components/content/Layout/LayoutContainer.js.map +1 -1
  80. package/dist/components/content/Layout/LayoutContent.d.ts +3 -2
  81. package/dist/components/content/Layout/LayoutContent.js +56 -45
  82. package/dist/components/content/Layout/LayoutContent.js.map +1 -1
  83. package/dist/components/content/Layout/LayoutContext.js +1 -1
  84. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  85. package/dist/components/content/Layout/LayoutFooter.js +1 -1
  86. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  87. package/dist/components/content/Layout/LayoutHeader.js +3 -3
  88. package/dist/components/content/Layout/LayoutHeader.js.map +1 -1
  89. package/dist/components/content/Layout/LayoutPane.d.ts +3 -2
  90. package/dist/components/content/Layout/LayoutPane.js +66 -55
  91. package/dist/components/content/Layout/LayoutPane.js.map +1 -1
  92. package/dist/components/content/Layout/LayoutPanel.d.ts +3 -2
  93. package/dist/components/content/Layout/LayoutPanel.js +15 -8
  94. package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
  95. package/dist/components/content/Layout/LayoutPanelHeader.d.ts +3 -2
  96. package/dist/components/content/Layout/LayoutPanelHeader.js +38 -68
  97. package/dist/components/content/Layout/LayoutPanelHeader.js.map +1 -1
  98. package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
  99. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  100. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  101. package/dist/components/content/Layout/index.js +1 -1
  102. package/dist/components/content/Layout/utils.js +1 -1
  103. package/dist/components/content/Paragraph.js +1 -1
  104. package/dist/components/content/Placeholder/Placeholder.d.ts +3 -2
  105. package/dist/components/content/Placeholder/Placeholder.js +16 -37
  106. package/dist/components/content/Placeholder/Placeholder.js.map +1 -1
  107. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  108. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  109. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  110. package/dist/components/content/Result/Result.js +1 -1
  111. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  112. package/dist/components/content/Tag/Tag.js +1 -1
  113. package/dist/components/content/Text.js +1 -1
  114. package/dist/components/content/TextItem/TextItem.js +1 -1
  115. package/dist/components/content/Title.js +1 -1
  116. package/dist/components/content/Tree/Tree.js +11 -3
  117. package/dist/components/content/Tree/Tree.js.map +1 -1
  118. package/dist/components/content/Tree/TreeNode.js +1 -1
  119. package/dist/components/content/Tree/checked-keys.js +1 -1
  120. package/dist/components/content/Tree/rowId.js +1 -1
  121. package/dist/components/content/Tree/styled.js +1 -1
  122. package/dist/components/content/Tree/tree-index.js +1 -1
  123. package/dist/components/content/Tree/types.d.ts +3 -2
  124. package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
  125. package/dist/components/content/Tree/use-load-data.js +1 -1
  126. package/dist/components/content/highlightText.js +1 -1
  127. package/dist/components/content/use-auto-tooltip.js +1 -1
  128. package/dist/components/data/DataTable/DataTable.js +3 -1
  129. package/dist/components/data/DataTable/DataTable.js.map +1 -1
  130. package/dist/components/data/DataTable/types.d.ts +3 -2
  131. package/dist/components/data/ItemTable/ItemTable.js +3 -1
  132. package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
  133. package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
  134. package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
  135. package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
  136. package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
  137. package/dist/components/data/ItemTable/item-table-sections.js +1 -1
  138. package/dist/components/data/ItemTable/types.d.ts +3 -2
  139. package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
  140. package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
  141. package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
  142. package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
  143. package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
  144. package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
  145. package/dist/components/data/TableBase/ColumnResizer.js +1 -1
  146. package/dist/components/data/TableBase/RowCollection.js +1 -1
  147. package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
  148. package/dist/components/data/TableBase/TableRow.js +1 -1
  149. package/dist/components/data/TableBase/TableRowLink.js +1 -1
  150. package/dist/components/data/TableBase/TableView.d.ts +1 -0
  151. package/dist/components/data/TableBase/TableView.js +7 -2
  152. package/dist/components/data/TableBase/TableView.js.map +1 -1
  153. package/dist/components/data/TableBase/TreeGridTable.js +1 -1
  154. package/dist/components/data/TableBase/column-header.js +1 -1
  155. package/dist/components/data/TableBase/column-menu.js +1 -1
  156. package/dist/components/data/TableBase/column-styles.js +1 -1
  157. package/dist/components/data/TableBase/column-tint.js +1 -1
  158. package/dist/components/data/TableBase/row-menu.js +1 -1
  159. package/dist/components/data/TableBase/styled.js +1 -1
  160. package/dist/components/data/TableBase/table-body-sections.js +1 -1
  161. package/dist/components/data/TableBase/table-tree.js +1 -1
  162. package/dist/components/data/TableBase/types.js +1 -1
  163. package/dist/components/data/TableBase/use-cell-selection.js +0 -0
  164. package/dist/components/data/TableBase/use-column-menu.js +1 -1
  165. package/dist/components/data/TableBase/use-column-order.js +1 -1
  166. package/dist/components/data/TableBase/use-column-window.js +1 -1
  167. package/dist/components/data/TableBase/use-container-width.js +1 -1
  168. package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
  169. package/dist/components/data/TableBase/use-scrollability.js +1 -1
  170. package/dist/components/data/TableBase/use-table-columns.js +1 -1
  171. package/dist/components/data/TableBase/use-table-search.js +1 -1
  172. package/dist/components/data/TableBase/use-table-selection.js +1 -1
  173. package/dist/components/data/TableBase/use-table-sort.js +1 -1
  174. package/dist/components/data/TableBase/use-table-sorts.js +1 -1
  175. package/dist/components/data/TableBase/use-table-storage.js +1 -1
  176. package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
  177. package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
  178. package/dist/components/fields/Checkbox/Checkbox.d.ts +3 -2
  179. package/dist/components/fields/Checkbox/Checkbox.js +5 -6
  180. package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
  181. package/dist/components/fields/Checkbox/CheckboxGroup.d.ts +3 -2
  182. package/dist/components/fields/Checkbox/CheckboxGroup.js +38 -31
  183. package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
  184. package/dist/components/fields/Checkbox/context.js +1 -1
  185. package/dist/components/fields/ColorInput/ColorInput.d.ts +3 -2
  186. package/dist/components/fields/ColorInput/ColorInput.js +1 -1
  187. package/dist/components/fields/ColorInput/ColorInput.js.map +1 -1
  188. package/dist/components/fields/ColorPicker/ColorPicker.d.ts +3 -2
  189. package/dist/components/fields/ColorPicker/ColorPicker.js +150 -137
  190. package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
  191. package/dist/components/fields/ColorSwatch/ColorSwatch.d.ts +3 -2
  192. package/dist/components/fields/ColorSwatch/ColorSwatch.js +47 -28
  193. package/dist/components/fields/ColorSwatch/ColorSwatch.js.map +1 -1
  194. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +3 -2
  195. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +157 -135
  196. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
  197. package/dist/components/fields/ComboBox/ComboBox.d.ts +3 -2
  198. package/dist/components/fields/ComboBox/ComboBox.js +240 -225
  199. package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
  200. package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
  201. package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
  202. package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
  203. package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
  204. package/dist/components/fields/DatePicker/CalendarPopover.js +4 -3
  205. package/dist/components/fields/DatePicker/CalendarPopover.js.map +1 -1
  206. package/dist/components/fields/DatePicker/DateInput.d.ts +3 -2
  207. package/dist/components/fields/DatePicker/DateInput.js +4 -1
  208. package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
  209. package/dist/components/fields/DatePicker/DateInputBase.js +108 -92
  210. package/dist/components/fields/DatePicker/DateInputBase.js.map +1 -1
  211. package/dist/components/fields/DatePicker/DatePicker.d.ts +3 -2
  212. package/dist/components/fields/DatePicker/DatePicker.js +42 -32
  213. package/dist/components/fields/DatePicker/DatePicker.js.map +1 -1
  214. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  215. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  216. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  217. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  218. package/dist/components/fields/DatePicker/DateRangePicker.d.ts +3 -2
  219. package/dist/components/fields/DatePicker/DateRangePicker.js +32 -27
  220. package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
  221. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.d.ts +3 -2
  222. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +185 -175
  223. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
  224. package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
  225. package/dist/components/fields/DatePicker/PeriodPicker.d.ts +3 -2
  226. package/dist/components/fields/DatePicker/PeriodPicker.js +97 -86
  227. package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
  228. package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
  229. package/dist/components/fields/DatePicker/TimeInput.d.ts +3 -2
  230. package/dist/components/fields/DatePicker/TimeInput.js +4 -1
  231. package/dist/components/fields/DatePicker/TimeInput.js.map +1 -1
  232. package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
  233. package/dist/components/fields/DatePicker/YearPicker.js +1 -1
  234. package/dist/components/fields/DatePicker/parseDate.js +1 -1
  235. package/dist/components/fields/DatePicker/period.js +1 -1
  236. package/dist/components/fields/DatePicker/props.js +1 -1
  237. package/dist/components/fields/DatePicker/utils.js +1 -1
  238. package/dist/components/fields/FileInput/FileInput.d.ts +3 -2
  239. package/dist/components/fields/FileInput/FileInput.js +104 -87
  240. package/dist/components/fields/FileInput/FileInput.js.map +1 -1
  241. package/dist/components/fields/FilterListBox/FilterListBox.js +3 -1
  242. package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
  243. package/dist/components/fields/FilterListBox/styled.js +1 -1
  244. package/dist/components/fields/FilterPicker/FilterPicker.d.ts +2 -2
  245. package/dist/components/fields/FilterPicker/FilterPicker.js +4 -3
  246. package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
  247. package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
  248. package/dist/components/fields/Input/Input.js +1 -1
  249. package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
  250. package/dist/components/fields/ListBox/ListBox.d.ts +3 -2
  251. package/dist/components/fields/ListBox/ListBox.js +15 -3
  252. package/dist/components/fields/ListBox/ListBox.js.map +1 -1
  253. package/dist/components/fields/ListBox/empty-row.js +1 -1
  254. package/dist/components/fields/ListBox/optionId.js +1 -1
  255. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +4 -3
  256. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
  257. package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
  258. package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
  259. package/dist/components/fields/NumberInput/NumberInput.js +1 -1
  260. package/dist/components/fields/NumberInput/StepButton.js +1 -1
  261. package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
  262. package/dist/components/fields/Picker/Picker.d.ts +2 -2
  263. package/dist/components/fields/Picker/Picker.js +4 -3
  264. package/dist/components/fields/Picker/Picker.js.map +1 -1
  265. package/dist/components/fields/RadioGroup/Radio.d.ts +6 -5
  266. package/dist/components/fields/RadioGroup/Radio.js +113 -137
  267. package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
  268. package/dist/components/fields/RadioGroup/RadioGroup.d.ts +3 -2
  269. package/dist/components/fields/RadioGroup/RadioGroup.js +67 -79
  270. package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
  271. package/dist/components/fields/RadioGroup/context.js +1 -1
  272. package/dist/components/fields/RadioGroup/joined-styles.js +100 -0
  273. package/dist/components/fields/RadioGroup/joined-styles.js.map +1 -0
  274. package/dist/components/fields/SearchComboBox/SearchComboBox.d.ts +3 -2
  275. package/dist/components/fields/SearchComboBox/SearchComboBox.js +7 -3
  276. package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
  277. package/dist/components/fields/SearchInput/SearchInput.js +1 -1
  278. package/dist/components/fields/Select/Select.d.ts +5 -3
  279. package/dist/components/fields/Select/Select.js +87 -69
  280. package/dist/components/fields/Select/Select.js.map +1 -1
  281. package/dist/components/fields/Slider/Gradation.js +1 -1
  282. package/dist/components/fields/Slider/HueSlider.js +1 -1
  283. package/dist/components/fields/Slider/RangeSlider.js +1 -1
  284. package/dist/components/fields/Slider/Slider.js +1 -1
  285. package/dist/components/fields/Slider/SliderBase.js +44 -24
  286. package/dist/components/fields/Slider/SliderBase.js.map +1 -1
  287. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  288. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  289. package/dist/components/fields/Slider/elements.js +1 -1
  290. package/dist/components/fields/Slider/index.js +1 -1
  291. package/dist/components/fields/Slider/types.d.ts +3 -2
  292. package/dist/components/fields/Switch/Switch.d.ts +3 -2
  293. package/dist/components/fields/Switch/Switch.js +9 -3
  294. package/dist/components/fields/Switch/Switch.js.map +1 -1
  295. package/dist/components/fields/TagInput/TagInput.d.ts +3 -2
  296. package/dist/components/fields/TagInput/TagInput.js +5 -5
  297. package/dist/components/fields/TagInput/TagInput.js.map +1 -1
  298. package/dist/components/fields/TagInput/TagList.js +1 -1
  299. package/dist/components/fields/TagInput/useActiveOption.js +1 -1
  300. package/dist/components/fields/TagInput/useTagError.js +1 -1
  301. package/dist/components/fields/TextArea/TextArea.js +1 -1
  302. package/dist/components/fields/TextInput/TextInput.js +1 -1
  303. package/dist/components/fields/TextInput/TextInputBase.d.ts +3 -2
  304. package/dist/components/fields/TextInput/TextInputBase.js +14 -3
  305. package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
  306. package/dist/components/fields/TextInput/displayed-validation.js +1 -1
  307. package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
  308. package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
  309. package/dist/components/fields/ToggleGroup/ToggleGroup.d.ts +53 -0
  310. package/dist/components/fields/ToggleGroup/ToggleGroup.js +237 -0
  311. package/dist/components/fields/ToggleGroup/ToggleGroup.js.map +1 -0
  312. package/dist/components/fields/ToggleGroup/ToggleGroupItem.d.ts +29 -0
  313. package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +166 -0
  314. package/dist/components/fields/ToggleGroup/ToggleGroupItem.js.map +1 -0
  315. package/dist/components/fields/ToggleGroup/context.d.ts +8 -0
  316. package/dist/components/fields/ToggleGroup/context.js +13 -0
  317. package/dist/components/fields/ToggleGroup/context.js.map +1 -0
  318. package/dist/components/fields/ToggleGroup/index.d.ts +5 -0
  319. package/dist/components/fields/TriggerActions.js +1 -1
  320. package/dist/components/fields/color/ColorPanel.js +1 -1
  321. package/dist/components/fields/color/channels.js +1 -1
  322. package/dist/components/fields/color/color.js +1 -1
  323. package/dist/components/fields/color/context.js +1 -1
  324. package/dist/components/fields/index.d.ts +5 -1
  325. package/dist/components/fields/option-origin-press.js +1 -1
  326. package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
  327. package/dist/components/form/FieldWrapper/field-description.js +1 -1
  328. package/dist/components/form/Form/Field.js +1 -1
  329. package/dist/components/form/Form/Form.d.ts +3 -2
  330. package/dist/components/form/Form/Form.js +6 -4
  331. package/dist/components/form/Form/Form.js.map +1 -1
  332. package/dist/components/form/Form/FormContext.js +1 -1
  333. package/dist/components/form/Form/FormElement.js +1 -1
  334. package/dist/components/form/Form/ModernFormRoot.js +43 -40
  335. package/dist/components/form/Form/ModernFormRoot.js.map +1 -1
  336. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  337. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  338. package/dist/components/form/Form/SubmitError.js +1 -1
  339. package/dist/components/form/Form/backend.js +1 -1
  340. package/dist/components/form/Form/index.js +1 -1
  341. package/dist/components/form/Form/modern/actions.js +1 -1
  342. package/dist/components/form/Form/modern/context.js +1 -1
  343. package/dist/components/form/Form/modern/controller.js +1 -1
  344. package/dist/components/form/Form/modern/field-binding.js +1 -1
  345. package/dist/components/form/Form/modern/field.js +1 -1
  346. package/dist/components/form/Form/modern/react.js +1 -1
  347. package/dist/components/form/Form/modern/store.js +1 -1
  348. package/dist/components/form/Form/modern/validation.js +1 -1
  349. package/dist/components/form/Form/modern/values.js +1 -1
  350. package/dist/components/form/Form/reset-unbound-controls.js +1 -1
  351. package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
  352. package/dist/components/form/Form/use-field/use-field-props.js +1 -1
  353. package/dist/components/form/Form/use-field/use-field.js +1 -1
  354. package/dist/components/form/Form/use-form.js +1 -1
  355. package/dist/components/form/Form/validation.js +1 -1
  356. package/dist/components/form/Label.d.ts +3 -2
  357. package/dist/components/form/Label.js +31 -26
  358. package/dist/components/form/Label.js.map +1 -1
  359. package/dist/components/form/field-chrome.js +1 -1
  360. package/dist/components/form/field-layout.js +1 -1
  361. package/dist/components/form/legacy-tooltip.js +1 -1
  362. package/dist/components/form/validation/ValidationIndicator.js +1 -1
  363. package/dist/components/form/validation/resolve-validation-props.js +1 -1
  364. package/dist/components/form/validation/use-validation-props.js +1 -1
  365. package/dist/components/form/wrapper.js +1 -1
  366. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  367. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  368. package/dist/components/layout/Flex.js +1 -1
  369. package/dist/components/layout/Flow.js +1 -1
  370. package/dist/components/layout/Grid.js +1 -1
  371. package/dist/components/layout/Panel.js +1 -1
  372. package/dist/components/layout/Prefix.d.ts +3 -2
  373. package/dist/components/layout/Prefix.js +22 -17
  374. package/dist/components/layout/Prefix.js.map +1 -1
  375. package/dist/components/layout/ResizablePanel.js +1 -1
  376. package/dist/components/layout/Space.js +1 -1
  377. package/dist/components/layout/Suffix.d.ts +3 -2
  378. package/dist/components/layout/Suffix.js +22 -17
  379. package/dist/components/layout/Suffix.js.map +1 -1
  380. package/dist/components/navigation/Pagination/Pagination.js +1 -1
  381. package/dist/components/navigation/Pagination/use-pagination.js +1 -1
  382. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
  383. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  384. package/dist/components/navigation/Tabs/TabButton.js +148 -143
  385. package/dist/components/navigation/Tabs/TabButton.js.map +1 -1
  386. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  387. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  388. package/dist/components/navigation/Tabs/TabPicker.js +1 -1
  389. package/dist/components/navigation/Tabs/Tabs.js +15 -5
  390. package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
  391. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  392. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  393. package/dist/components/navigation/Tabs/popover-placement.js +1 -1
  394. package/dist/components/navigation/Tabs/segmented-styles.js +1 -1
  395. package/dist/components/navigation/Tabs/styled.js +1 -1
  396. package/dist/components/navigation/Tabs/types.d.ts +4 -3
  397. package/dist/components/navigation/Tabs/types.js +1 -1
  398. package/dist/components/navigation/Tabs/types.js.map +1 -1
  399. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  400. package/dist/components/navigation/Tabs/use-tab-indicator.js +54 -101
  401. package/dist/components/navigation/Tabs/use-tab-indicator.js.map +1 -1
  402. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  403. package/dist/components/other/Calendar/Calendar.js +1 -1
  404. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  405. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  406. package/dist/components/other/Calendar/CalendarHeader.js +1 -1
  407. package/dist/components/other/Calendar/CalendarPanel.js +1 -1
  408. package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
  409. package/dist/components/other/Calendar/PeriodGrid.js +1 -1
  410. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  411. package/dist/components/other/Calendar/styled.js +1 -1
  412. package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
  413. package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
  414. package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
  415. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
  416. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  417. package/dist/components/overlays/Dialog/Dialog.d.ts +3 -2
  418. package/dist/components/overlays/Dialog/Dialog.js +5 -2
  419. package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
  420. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  421. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  422. package/dist/components/overlays/Dialog/DialogTrigger.js +4 -3
  423. package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
  424. package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
  425. package/dist/components/overlays/Dialog/context.js +1 -1
  426. package/dist/components/overlays/Dialog/default-button-text.js +1 -1
  427. package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
  428. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  429. package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
  430. package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
  431. package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
  432. package/dist/components/overlays/Modal/Modal.js +1 -1
  433. package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
  434. package/dist/components/overlays/Modal/Overlay.js +1 -1
  435. package/dist/components/overlays/Modal/Popover.js +1 -1
  436. package/dist/components/overlays/Modal/Tray.js +1 -1
  437. package/dist/components/overlays/Modal/Underlay.js +1 -1
  438. package/dist/components/overlays/Modal/modal-containment.js +1 -1
  439. package/dist/components/overlays/Notifications/Notification.js +1 -1
  440. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  441. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  442. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  443. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  444. package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
  445. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  446. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  447. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  448. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  449. package/dist/components/overlays/Notifications/index.js +1 -1
  450. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  451. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  452. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  453. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  454. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  455. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  456. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  457. package/dist/components/overlays/Toast/index.js +1 -1
  458. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  459. package/dist/components/overlays/Toast/useToast.js +1 -1
  460. package/dist/components/overlays/Tooltip/Tooltip.d.ts +3 -2
  461. package/dist/components/overlays/Tooltip/Tooltip.js +60 -28
  462. package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
  463. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  464. package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
  465. package/dist/components/overlays/Tooltip/TooltipTrigger.js.map +1 -1
  466. package/dist/components/overlays/Tooltip/context.js +1 -1
  467. package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
  468. package/dist/components/portal/Portal.js +1 -1
  469. package/dist/components/portal/PortalProvider.js +1 -1
  470. package/dist/components/portal/usePortal.js +1 -1
  471. package/dist/components/shared/DraggableCollection.js +1 -1
  472. package/dist/components/shared/InvalidIcon.js +1 -1
  473. package/dist/components/shared/ValidIcon.js +1 -1
  474. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  475. package/dist/components/status/Spin/Cube.js +1 -1
  476. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  477. package/dist/components/status/Spin/Spin.js +1 -1
  478. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  479. package/dist/data/item-themes.js +3 -3
  480. package/dist/data/item-themes.js.map +1 -1
  481. package/dist/data/themes.js +1 -1
  482. package/dist/eslint-plugin/defaults.generated.js +1 -1
  483. package/dist/eslint-plugin/index.js +1 -1
  484. package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
  485. package/dist/i18n/I18nProvider.js +1 -1
  486. package/dist/i18n/createFormatter.js +1 -1
  487. package/dist/i18n/index.js +1 -1
  488. package/dist/i18n/instance.js +1 -1
  489. package/dist/i18n/locales/de-DE/uikit.js +1 -1
  490. package/dist/i18n/locales/en-US/uikit.js +1 -1
  491. package/dist/i18n/locales/es-ES/uikit.js +1 -1
  492. package/dist/i18n/locales/es-MX/uikit.js +1 -1
  493. package/dist/i18n/locales/fr-FR/uikit.js +1 -1
  494. package/dist/i18n/locales/it-IT/uikit.js +1 -1
  495. package/dist/i18n/locales/ja-JP/uikit.js +1 -1
  496. package/dist/i18n/locales/nb-NO/uikit.js +1 -1
  497. package/dist/i18n/locales/pt-BR/uikit.js +1 -1
  498. package/dist/i18n/locales/pt-PT/uikit.js +1 -1
  499. package/dist/i18n/locales/sv-SE/uikit.js +1 -1
  500. package/dist/i18n/locales/vi-VN/uikit.js +1 -1
  501. package/dist/i18n/locales.js +1 -1
  502. package/dist/i18n/namespace.js +1 -1
  503. package/dist/i18n/useFormatter.js +1 -1
  504. package/dist/i18n/useI18n.js +1 -1
  505. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  506. package/dist/icons/AdjustmentsIcon.js +1 -1
  507. package/dist/icons/AiIcon.js +1 -1
  508. package/dist/icons/AreaChartIcon.js +1 -1
  509. package/dist/icons/ArrowNarrowDownIcon.js +1 -1
  510. package/dist/icons/ArrowNarrowUpIcon.js +1 -1
  511. package/dist/icons/BackwardIcon.js +1 -1
  512. package/dist/icons/BarChartIcon.js +1 -1
  513. package/dist/icons/BellFilledIcon.js +1 -1
  514. package/dist/icons/BellIcon.js +1 -1
  515. package/dist/icons/BooleanIcon.js +1 -1
  516. package/dist/icons/CalendarEditIcon.js +1 -1
  517. package/dist/icons/CalendarIcon.js +1 -1
  518. package/dist/icons/CaretDownIcon.js +1 -1
  519. package/dist/icons/CaretUpIcon.js +1 -1
  520. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  521. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  522. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  523. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  524. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  525. package/dist/icons/ChartBarLineIcon.js +1 -1
  526. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  527. package/dist/icons/ChartBarStackedIcon.js +1 -1
  528. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  529. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  530. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  531. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  532. package/dist/icons/ChartBubbleIcon.js +1 -1
  533. package/dist/icons/ChartDonut2Icon.js +1 -1
  534. package/dist/icons/ChartFunnelIcon.js +1 -1
  535. package/dist/icons/ChartHeatmapIcon.js +1 -1
  536. package/dist/icons/ChartKPIIcon.js +1 -1
  537. package/dist/icons/ChartPie2Icon.js +1 -1
  538. package/dist/icons/ChartScatterIcon.js +1 -1
  539. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  540. package/dist/icons/CheckCircleIcon.js +1 -1
  541. package/dist/icons/CheckIcon.js +1 -1
  542. package/dist/icons/CircleFilledIcon.js +1 -1
  543. package/dist/icons/ClearIcon.js +1 -1
  544. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  545. package/dist/icons/CloseCircleIcon.js +1 -1
  546. package/dist/icons/CloseIcon.js +1 -1
  547. package/dist/icons/CodeIcon.js +1 -1
  548. package/dist/icons/ColumnTotalIcon.js +1 -1
  549. package/dist/icons/CopyIcon.js +1 -1
  550. package/dist/icons/CountIcon.js +1 -1
  551. package/dist/icons/CubeIcon.js +1 -1
  552. package/dist/icons/CubePauseIcon.js +1 -1
  553. package/dist/icons/CubePlayIcon.js +1 -1
  554. package/dist/icons/CurrencyDollarIcon.js +1 -1
  555. package/dist/icons/DangerIcon.js +1 -1
  556. package/dist/icons/DashboardIcon.js +1 -1
  557. package/dist/icons/DatabaseIcon.js +1 -1
  558. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  559. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  560. package/dist/icons/DirectionIcon.js +1 -1
  561. package/dist/icons/DonutIcon.js +1 -1
  562. package/dist/icons/DownIcon.js +1 -1
  563. package/dist/icons/EditIcon.js +1 -1
  564. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  565. package/dist/icons/ExclamationCircleIcon.js +1 -1
  566. package/dist/icons/ExclamationIcon.js +1 -1
  567. package/dist/icons/EyeIcon.js +1 -1
  568. package/dist/icons/EyeInvisibleIcon.js +1 -1
  569. package/dist/icons/FilterIcon.js +1 -1
  570. package/dist/icons/FolderFilledIcon.js +1 -1
  571. package/dist/icons/FolderIcon.js +1 -1
  572. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  573. package/dist/icons/FolderOpenIcon.js +1 -1
  574. package/dist/icons/ForwardIcon.js +1 -1
  575. package/dist/icons/GripVerticalIcon.js +1 -1
  576. package/dist/icons/HierarchyIcon.js +1 -1
  577. package/dist/icons/HierarchyOpenIcon.js +1 -1
  578. package/dist/icons/Icon.js +1 -1
  579. package/dist/icons/InfoCircleIcon.js +1 -1
  580. package/dist/icons/InfoIcon.js +1 -1
  581. package/dist/icons/KeyIcon.js +1 -1
  582. package/dist/icons/LeftIcon.js +1 -1
  583. package/dist/icons/LineChartIcon.js +1 -1
  584. package/dist/icons/LoadingIcon.js +1 -1
  585. package/dist/icons/LockFilledIcon.js +1 -1
  586. package/dist/icons/LockIcon.js +1 -1
  587. package/dist/icons/MoreIcon.js +1 -1
  588. package/dist/icons/NotAllowedIcon.js +1 -1
  589. package/dist/icons/Number123Icon.js +1 -1
  590. package/dist/icons/NumberIcon.js +1 -1
  591. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  592. package/dist/icons/PauseCircleIcon.js +1 -1
  593. package/dist/icons/PauseIcon.js +1 -1
  594. package/dist/icons/PercentageIcon.js +1 -1
  595. package/dist/icons/PieChartIcon.js +1 -1
  596. package/dist/icons/PipetteIcon.js +1 -1
  597. package/dist/icons/PlayCircleIcon.js +1 -1
  598. package/dist/icons/PlayIcon.js +1 -1
  599. package/dist/icons/PlusIcon.js +1 -1
  600. package/dist/icons/ProgressBarIcon.js +1 -1
  601. package/dist/icons/ReloadIcon.js +1 -1
  602. package/dist/icons/ReportIcon.js +1 -1
  603. package/dist/icons/ReturnIcon.js +1 -1
  604. package/dist/icons/RightIcon.js +1 -1
  605. package/dist/icons/RowTotalsIcon.js +1 -1
  606. package/dist/icons/SchemeIcon.js +1 -1
  607. package/dist/icons/SearchIcon.js +1 -1
  608. package/dist/icons/SemanticQueryIcon.js +1 -1
  609. package/dist/icons/SettingsIcon.js +1 -1
  610. package/dist/icons/ShieldFilledIcon.js +1 -1
  611. package/dist/icons/ShieldIcon.js +1 -1
  612. package/dist/icons/SlashIcon.js +1 -1
  613. package/dist/icons/SparklesIcon.js +1 -1
  614. package/dist/icons/SqlIcon.js +1 -1
  615. package/dist/icons/StatsIcon.js +1 -1
  616. package/dist/icons/StopIcon.js +1 -1
  617. package/dist/icons/StringIcon.js +1 -1
  618. package/dist/icons/SubtotalsIcon.js +1 -1
  619. package/dist/icons/SwitchIcon.js +1 -1
  620. package/dist/icons/TableIcon.js +1 -1
  621. package/dist/icons/ThumbsDownIcon.js +1 -1
  622. package/dist/icons/ThumbsUpIcon.js +1 -1
  623. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  624. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  625. package/dist/icons/ThunderboltIcon.js +1 -1
  626. package/dist/icons/TimeIcon.js +1 -1
  627. package/dist/icons/TrashIcon.js +1 -1
  628. package/dist/icons/UnlockIcon.js +1 -1
  629. package/dist/icons/UpIcon.js +1 -1
  630. package/dist/icons/UserGroupIcon.js +1 -1
  631. package/dist/icons/UserIcon.js +1 -1
  632. package/dist/icons/UserLockIcon.js +1 -1
  633. package/dist/icons/ViewIcon.js +1 -1
  634. package/dist/icons/WarningFilledIcon.js +1 -1
  635. package/dist/icons/WarningIcon.js +1 -1
  636. package/dist/icons/wrap-icon.js +1 -1
  637. package/dist/index.d.ts +4 -1
  638. package/dist/index.js +4 -3
  639. package/dist/index.js.map +1 -1
  640. package/dist/probe/canonicalize.js +1 -1
  641. package/dist/probe/css.js +1 -1
  642. package/dist/probe/index.js +1 -1
  643. package/dist/provider.js +1 -1
  644. package/dist/providers/TrackingProvider.js +1 -1
  645. package/dist/providers/navigation-url.js +1 -1
  646. package/dist/providers/navigationAdapter.default.js +1 -1
  647. package/dist/providers/use-navigation.js +1 -1
  648. package/dist/tokens/all-tokens.js +1 -1
  649. package/dist/tokens/base.js +1 -1
  650. package/dist/tokens/color-seed.js +1 -1
  651. package/dist/tokens/color-theme.js +1 -1
  652. package/dist/tokens/colors.js +1 -1
  653. package/dist/tokens/layout.js +1 -1
  654. package/dist/tokens/lazy-styles.js +1 -1
  655. package/dist/tokens/legacy-color.js +1 -1
  656. package/dist/tokens/palette-config.js +1 -1
  657. package/dist/tokens/palette.js +12 -3
  658. package/dist/tokens/palette.js.map +1 -1
  659. package/dist/tokens/resolve.js +1 -1
  660. package/dist/tokens/shadows.js +1 -1
  661. package/dist/tokens/sizes.js +1 -1
  662. package/dist/tokens/spacing.js +1 -1
  663. package/dist/tokens/typography.js +1 -1
  664. package/dist/utils/ResizeSensor.js +1 -1
  665. package/dist/utils/colors.js +1 -1
  666. package/dist/utils/dotize.js +1 -1
  667. package/dist/utils/is-dev-env.js +1 -1
  668. package/dist/utils/layout-scale.js +25 -0
  669. package/dist/utils/layout-scale.js.map +1 -0
  670. package/dist/utils/modules.js +1 -1
  671. package/dist/utils/promise.js +1 -1
  672. package/dist/utils/raf.js +1 -1
  673. package/dist/utils/random.js +1 -1
  674. package/dist/utils/range.js +1 -1
  675. package/dist/utils/react/RenderCache.js +1 -1
  676. package/dist/utils/react/Slots.js +1 -1
  677. package/dist/utils/react/chain.js +1 -1
  678. package/dist/utils/react/componentBaseProps.d.ts +9 -0
  679. package/dist/utils/react/componentBaseProps.js +15 -0
  680. package/dist/utils/react/componentBaseProps.js.map +1 -0
  681. package/dist/utils/react/disabledProps.js +1 -1
  682. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  683. package/dist/utils/react/index.js +1 -1
  684. package/dist/utils/react/interactions.js +1 -1
  685. package/dist/utils/react/isTextOnly.js +1 -1
  686. package/dist/utils/react/mapProps.js +1 -1
  687. package/dist/utils/react/mergeProps.js +1 -1
  688. package/dist/utils/react/nullableValue.js +1 -1
  689. package/dist/utils/react/overlayKeyPropagation.js +1 -1
  690. package/dist/utils/react/pickBaseCustomizationProps.d.ts +2 -0
  691. package/dist/utils/react/pickBaseCustomizationProps.js +16 -0
  692. package/dist/utils/react/pickBaseCustomizationProps.js.map +1 -0
  693. package/dist/utils/react/programmaticFocus.js +1 -1
  694. package/dist/utils/react/resolveIcon.js +1 -1
  695. package/dist/utils/react/sharedStore.js +1 -1
  696. package/dist/utils/react/useBufferedValue.js +1 -1
  697. package/dist/utils/react/useCombinedRefs.js +1 -1
  698. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  699. package/dist/utils/react/useEventBus.js +1 -1
  700. package/dist/utils/react/useId.js +1 -1
  701. package/dist/utils/react/useIsDarwin.js +1 -1
  702. package/dist/utils/react/useKeySymbols.js +1 -1
  703. package/dist/utils/react/useLayoutEffect.js +1 -1
  704. package/dist/utils/react/useLocalStorage.js +1 -1
  705. package/dist/utils/react/useMergeStyles.js +1 -1
  706. package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
  707. package/dist/utils/react/useOverlayPosition.js +75 -0
  708. package/dist/utils/react/useOverlayPosition.js.map +1 -0
  709. package/dist/utils/react/usePopoverSync.js +1 -1
  710. package/dist/utils/react/useQaProps.js +1 -1
  711. package/dist/utils/react/useScheme.js +1 -1
  712. package/dist/utils/react/useViewportSize.js +1 -1
  713. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  714. package/dist/utils/selection.js +1 -1
  715. package/dist/utils/styles.js +1 -1
  716. package/dist/utils/tree.js +1 -1
  717. package/dist/utils/warnings.js +1 -1
  718. package/dist/version.js +2 -2
  719. package/docs/BaseProperties.md +9 -4
  720. package/docs/CreateComponent.md +15 -8
  721. package/docs/Theming.md +2 -0
  722. package/docs/Usage.md +2 -0
  723. package/docs/components/GridProvider.md +1 -1
  724. package/docs/components/fields/ColorSwatchGroup.md +7 -5
  725. package/docs/components/fields/RadioGroup.md +13 -0
  726. package/docs/components/fields/ToggleGroup.md +227 -0
  727. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CommandMenu.js","names":["useObjectRef","useSyncRef","CollectionChildren","FocusStrategy","Key","BasePropsWithoutChildren","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","Styles","React","KeyboardEvent","ReactElement","ReactNode","Ref","useId","useRef","useState","useFilter","useMenu","Section","useTreeState","useI18n","LoadingIcon","mergeProps","extractStyles","mergeStyleLayers","useMenuContext","CubeMenuProps","getMenuItemReactKey","MenuCollectionItem","Item","MenuItem","MenuSection","MenuTrigger","StyledDivider","StyledFooter","StyledHeader","StyledMenu","StyledCommandMenu","StyledEmptyState","StyledLoadingWrapper","StyledSearchInput","collectItemKeys","nodes","Iterable","keys","node","type","childNodes","push","key","getNextEnabledKey","currentKey","direction","isDisabled","isEnabled","index","indexOf","ahead","slice","Math","max","reverse","ordered","find","CommandMenuItem","id","textValue","keywords","forceMount","CubeCommandMenuProps","Omit","T","searchPlaceholder","searchValue","onSearchChange","value","filter","inputValue","emptyLabel","searchInputStyles","headerStyles","footerStyles","isLoading","shouldFilter","autoFocus","size","selectedKeys","defaultSelectedKeys","onSelectionChange","CommandMenu","props","ref","$","_c","t","t0","controlledSearchValue","customFilter","t1","t2","t3","t4","t5","qa","styles","onAction","header","footer","restMenuProps","t6","undefined","t7","domRef","searchInputRef","instanceId","menuId","contextProps","ariaSelectedKeys","Set","ariaDefaultSelectedKeys","handleSelectionChange","allKeys","Array","from","treeState","collection","getKeys","map","_temp","_temp2","t8","key_1","completeProps","internalSearchValue","setInternalSearchValue","t9","handleSearchChange","t10","Symbol","for","sensitivity","contains","t11","item","searchWords","trim","toLowerCase","split","_temp3","length","searchableTexts","isArray","_temp4","every","searchWord","some","text","includes","enhancedFilter","t12","term","searchWords_0","_temp5","filterNodes","iter","result","filteredChildren","text_0","String","rendered","collectionFilter","treeStateProps","children","shouldUseVirtualFocus","itemId","key_2","item_0","getItem","actions","href","encodeURIComponent","collectionItems","_temp6","focusedKey","selectionManager","filteredCollectionItems","hasFilteredItems","viewHasSections","_temp7","findFirstSelectableItem","key_3","menuRef","menuProps","renderedItems","isFirstSection","forEach","item_3","reactKey","sectionStyles","itemStyles","sectionHeadingStyles","menuItem","wrapper","cloneElement","t13","t14","current","timeoutId","setTimeout","focus","clearTimeout","useEffect","t15","t16","timeoutId_0","prevSearchValueRef","currentSearchValue","prevSearchValue","firstSelectableKey","setFocusedKey","handleArrowKey","e","preventDefault","nextKey","key_4","handleActionKey","e_0","stopPropagation","repeat","item_4","ownerDocument","getElementById","shouldActivate","dispatchEvent","window","code","ctrlKey","metaKey","altKey","shiftKey","bubbles","cancelable","MouseEvent","detail","handleSearchKeyDown","e_1","nativeEvent","isComposing","extractedStyles","t17","hasSearchTerm","showEmptyState","activeDescendant","t18","t19","t20","mods","popover","t21","tray","t22","sections","t23","t24","Record","wrapperProps","_ariaLabel","_ariaLabelledBy","_ariaDescribedBy","_ariaDetails","t25","T0","t26","t27","border","t28","t29","t30","t31","t32","t33","t34","e_2","target","t35","t36","t37","boxShadow","radius","padding","t38","t39","t40","item_2","item_1","word_0","word","keyword","key_0","_CommandMenu","forwardRef","RefAttributes","HTMLDivElement","__CommandMenu","Object","assign","Trigger","displayName","_c","mergeProps","MenuTrigger"],"sources":["../../../../src/components/actions/CommandMenu/CommandMenu.tsx"],"sourcesContent":["import { useObjectRef, useSyncRef } from '@react-aria/utils';\nimport { CollectionChildren, FocusStrategy, Key } from '@react-types/shared';\nimport {\n BasePropsWithoutChildren,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n Styles,\n} from '@tenphi/tasty';\nimport React, {\n KeyboardEvent,\n ReactElement,\n ReactNode,\n Ref,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useMenu } from 'react-aria';\nimport { Section, useTreeState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n/useI18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\nimport { useMenuContext } from '../Menu/context';\nimport { CubeMenuProps } from '../Menu/Menu';\nimport {\n getMenuItemReactKey,\n MenuCollectionItem as Item,\n} from '../Menu/MenuCollectionItem';\nimport { MenuItem } from '../Menu/MenuItem';\nimport { MenuSection } from '../Menu/MenuSection';\nimport { MenuTrigger } from '../Menu/MenuTrigger';\nimport {\n StyledDivider,\n StyledFooter,\n StyledHeader,\n StyledMenu,\n} from '../Menu/styled';\n\nimport {\n StyledCommandMenu,\n StyledEmptyState,\n StyledLoadingWrapper,\n StyledSearchInput,\n} from './styled';\n\n/** The keys of the items in `nodes`, in order, including those in sections. */\nfunction collectItemKeys(nodes: Iterable<any>, keys: Key[] = []): Key[] {\n for (const node of nodes) {\n if (node?.type === 'section') {\n collectItemKeys(node.childNodes ?? [], keys);\n } else if (node?.type === 'item') {\n keys.push(node.key);\n }\n }\n\n return keys;\n}\n\n/**\n * The key an arrow press moves to: the next enabled key after `currentKey` in\n * `direction`, wrapping round to the first enabled key in that direction (the\n * last one going up). With nothing focused, or the focused key filtered out,\n * it returns that key.\n */\nfunction getNextEnabledKey(\n keys: Key[],\n currentKey: Key | null,\n direction: 1 | -1,\n isDisabled: (key: Key) => boolean,\n): Key | null {\n const isEnabled = (key: Key) => !isDisabled(key);\n const index = currentKey == null ? -1 : keys.indexOf(currentKey);\n const ahead =\n direction === 1\n ? keys.slice(index + 1)\n : keys.slice(0, Math.max(index, 0)).reverse();\n const ordered = direction === 1 ? keys : [...keys].reverse();\n\n return ahead.find(isEnabled) ?? ordered.find(isEnabled) ?? null;\n}\n\nexport interface CommandMenuItem {\n // Standard item props\n id: string;\n textValue: string;\n\n // Enhanced search features\n keywords?: string[];\n forceMount?: boolean;\n\n // Standard Menu item props inherited\n [key: string]: any;\n}\n\nexport interface CubeCommandMenuProps<T>\n extends\n BasePropsWithoutChildren,\n ContainerStyleProps,\n Omit<\n CubeMenuProps<T>,\n 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'\n > {\n // Search-specific props\n searchPlaceholder?: string;\n searchValue?: string;\n onSearchChange?: (value: string) => void;\n filter?: (textValue: string, inputValue: string) => boolean;\n emptyLabel?: ReactNode;\n searchInputStyles?: Styles;\n headerStyles?: Styles;\n footerStyles?: Styles;\n\n // Advanced search features\n isLoading?: boolean;\n shouldFilter?: boolean;\n\n // Focus management - override the autoFocus from CubeMenuProps to allow boolean | FocusStrategy\n autoFocus?: boolean | FocusStrategy;\n\n // Size prop\n size?: 'medium' | 'large' | (string & {});\n\n /** Currently selected keys (controlled) */\n selectedKeys?: string[];\n /** Initially selected keys (uncontrolled) */\n defaultSelectedKeys?: string[];\n /** Handler for selection changes */\n onSelectionChange?: (keys: string[]) => void;\n}\n\nfunction CommandMenu<T extends object>(\n props: CubeCommandMenuProps<T>,\n ref: Ref<HTMLDivElement>,\n) {\n const { t } = useI18n();\n\n const {\n searchPlaceholder = t(\n 'commandMenu.searchPlaceholder',\n 'Search commands...',\n ),\n searchValue: controlledSearchValue,\n onSearchChange,\n filter: customFilter,\n emptyLabel = t('commandMenu.empty', 'No commands found'),\n searchInputStyles,\n headerStyles,\n footerStyles,\n isLoading = false,\n shouldFilter = true,\n autoFocus = true,\n size = 'medium',\n qa,\n styles,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n onAction,\n header,\n footer,\n ...restMenuProps\n } = props;\n\n const domRef = useObjectRef(ref);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const instanceId = useId();\n const menuId = `${qa || 'CommandMenu'}-${instanceId}-menu`;\n const contextProps = useMenuContext();\n\n // Convert string[] to Set<Key> for React Aria compatibility\n const ariaSelectedKeys = selectedKeys ? new Set(selectedKeys) : undefined;\n const ariaDefaultSelectedKeys = defaultSelectedKeys\n ? new Set(defaultSelectedKeys)\n : undefined;\n\n const handleSelectionChange = onSelectionChange\n ? (keys: 'all' | Set<Key>) => {\n if (keys === 'all') {\n // Handle 'all' selection case - collect all available keys\n const allKeys = Array.from(treeState.collection.getKeys()).map(\n (key: any) => String(key),\n );\n onSelectionChange(allKeys);\n } else if (keys instanceof Set) {\n onSelectionChange(Array.from(keys).map((key) => String(key)));\n } else {\n onSelectionChange([]);\n }\n }\n : undefined;\n\n const completeProps = mergeProps(contextProps, restMenuProps, {\n onAction: onAction ? (key: Key) => onAction(key) : undefined,\n selectedKeys: ariaSelectedKeys,\n defaultSelectedKeys: ariaDefaultSelectedKeys,\n onSelectionChange: handleSelectionChange,\n });\n\n // Search state management\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const searchValue = controlledSearchValue ?? internalSearchValue;\n\n const handleSearchChange = (value: string) => {\n if (controlledSearchValue === undefined) {\n setInternalSearchValue(value);\n }\n onSearchChange?.(value);\n };\n\n // Filter setup\n const { contains } = useFilter({ sensitivity: 'base' });\n const textFilterFn = customFilter || contains;\n\n // Enhanced filter function that supports keywords and forceMount\n const enhancedFilter = (\n textValue: string,\n inputValue: string,\n item?: any,\n ) => {\n // Always show force-mounted items\n if (item?.forceMount) {\n return true;\n }\n\n // If shouldFilter is false, show all items\n if (!shouldFilter) {\n return true;\n }\n\n // Split input value into individual words and filter out empty strings\n const searchWords = inputValue\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no search words, show all items\n if (searchWords.length === 0) {\n return true;\n }\n\n // Collect all searchable text for this item\n const searchableTexts: string[] = [];\n\n // Add main text value\n searchableTexts.push(textValue.toLowerCase());\n\n // Add keywords if available\n if (item?.keywords && Array.isArray(item.keywords)) {\n searchableTexts.push(\n ...item.keywords.map((keyword: string) => keyword.toLowerCase()),\n );\n }\n\n // Check if ALL search words match at least one of the searchable texts\n return searchWords.every((searchWord) =>\n searchableTexts.some((text) => text.includes(searchWord)),\n );\n };\n\n // Collection filter for React Stately\n const collectionFilter = (nodes: Iterable<any>): Iterable<any> => {\n const term = searchValue.trim();\n\n // If no search term, return all nodes\n if (!term) {\n return nodes;\n }\n\n // Split search term into words for multi-word filtering\n const searchWords = term\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no valid search words, return all nodes\n if (searchWords.length === 0) {\n return nodes;\n }\n\n // Recursive helper to filter sections and items\n const filterNodes = (iter: Iterable<any>): any[] => {\n const result: any[] = [];\n\n for (const node of iter) {\n if (node.type === 'section') {\n const filteredChildren = filterNodes(node.childNodes);\n\n if (filteredChildren.length) {\n result.push({\n ...node,\n childNodes: filteredChildren,\n });\n }\n } else {\n const text = node.textValue ?? String(node.rendered ?? '');\n\n if (enhancedFilter(text, term, node.props)) {\n result.push(node);\n }\n }\n }\n\n return result;\n };\n\n return filterNodes(nodes);\n };\n\n // Create tree state with filter for both keyboard navigation and rendering\n const treeStateProps = {\n ...completeProps,\n children: completeProps.children as CollectionChildren<T>,\n filter: collectionFilter,\n shouldUseVirtualFocus: true, // Always use virtual focus for CommandMenu\n };\n\n const treeState = useTreeState(treeStateProps);\n const itemId = (key: Key) => {\n const item = treeState.collection.getItem(key);\n const actions = item?.props.actions;\n // A plain command's layout and semantic target share the consumer's DOM id.\n if (\n item?.props.id != null &&\n item.props.href == null &&\n (!actions || actions === true)\n )\n return String(item.props.id);\n return `${menuId}-option-${typeof key}-${encodeURIComponent(String(key))}`;\n };\n\n const collectionItems = [...treeState.collection];\n const hasSections = collectionItems.some((item) => item.type === 'section');\n\n const focusedKey = treeState.selectionManager.focusedKey;\n\n // Apply filtering to collection items for rendering and empty state checks\n const filteredCollectionItems = [...collectionFilter(collectionItems)];\n\n const hasFilteredItems = filteredCollectionItems.length > 0;\n const viewHasSections = filteredCollectionItems.some(\n (item) => item.type === 'section',\n );\n\n // Helper function to find the first selectable item from filtered results\n const findFirstSelectableItem = () =>\n collectItemKeys(filteredCollectionItems).find(\n (key) => !treeState.selectionManager.isDisabled(key),\n ) ?? null;\n\n // Create a ref for the menu container\n const menuRef = useRef<HTMLUListElement>(null);\n\n // Use menu hook for accessibility\n const { menuProps } = useMenu(\n {\n ...completeProps,\n 'aria-label': t('commandMenu.menu', 'Command menu'),\n shouldUseVirtualFocus: true,\n },\n treeState,\n menuRef,\n );\n\n // Manual rendering of menu items (similar to Menu component)\n const renderedItems: React.ReactNode[] = [];\n let isFirstSection = true;\n\n filteredCollectionItems.forEach((item) => {\n const reactKey = getMenuItemReactKey(item.key);\n if (item.type === 'section') {\n if (!isFirstSection) {\n renderedItems.push(\n <StyledDivider\n key={`divider-${reactKey}`}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />,\n );\n }\n\n renderedItems.push(\n <MenuSection\n key={reactKey}\n item={item}\n state={treeState}\n styles={completeProps.sectionStyles}\n itemStyles={completeProps.itemStyles}\n headingStyles={completeProps.sectionHeadingStyles}\n size={size}\n itemId={itemId}\n />,\n );\n\n isFirstSection = false;\n return;\n }\n\n let menuItem = (\n <MenuItem\n key={reactKey}\n item={item}\n state={treeState}\n styles={completeProps.itemStyles}\n size={size}\n id={itemId(item.key)}\n />\n );\n\n // Apply custom wrapper if provided\n if (item.props.wrapper) {\n menuItem = item.props.wrapper(menuItem);\n }\n\n // Ensure every child has a stable key, even if the wrapper component didn't set one.\n renderedItems.push(React.cloneElement(menuItem, { key: reactKey }));\n });\n\n // Auto-focus search input\n React.useEffect(() => {\n if (autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the element is visible and focusable\n // This is especially important when the CommandMenu is opened in a popover\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus]);\n\n // Also focus when the component becomes visible (for trigger/popover usage)\n React.useEffect(() => {\n // Check if autoFocus is enabled and we're in a trigger context\n if (autoFocus && contextProps.autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the popover is fully rendered\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 50); // Slightly longer timeout for popover context\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus, contextProps.autoFocus]);\n\n // Track the previous search value to only run auto-focus when search actually changes\n const prevSearchValueRef = useRef<string>('');\n\n // Auto-focus first item when search value changes (but not on initial render)\n React.useEffect(() => {\n const currentSearchValue = searchValue.trim();\n const prevSearchValue = prevSearchValueRef.current;\n\n // Only auto-focus when search value actually changes\n if (currentSearchValue !== prevSearchValue && currentSearchValue !== '') {\n const firstSelectableKey = findFirstSelectableItem();\n\n if (firstSelectableKey != null && hasFilteredItems) {\n // Focus the first item in the selection manager\n treeState.selectionManager.setFocusedKey(firstSelectableKey);\n } else {\n // Clear focus if no items are available\n treeState.selectionManager.setFocusedKey(null);\n }\n }\n\n // Update the previous search value\n prevSearchValueRef.current = currentSearchValue;\n }, [searchValue, findFirstSelectableItem, hasFilteredItems]);\n\n // ---- search input keyboard ----------------------------------------------\n const handleArrowKey = (e: KeyboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const { selectionManager } = treeState;\n const currentKey = selectionManager.focusedKey;\n const nextKey = getNextEnabledKey(\n collectItemKeys(filteredCollectionItems),\n currentKey,\n e.key === 'ArrowDown' ? 1 : -1,\n (key) => selectionManager.isDisabled(key),\n );\n\n if (nextKey != null) {\n selectionManager.setFocusedKey(nextKey);\n }\n };\n\n // Use the rendered item's Aria handlers for commands, selection and navigation.\n const handleActionKey = (e: KeyboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (\n e.repeat ||\n focusedKey == null ||\n treeState.selectionManager.isDisabled(focusedKey)\n )\n return;\n const item = menuRef.current?.ownerDocument.getElementById(\n itemId(focusedKey),\n );\n if (!item || !menuRef.current?.contains(item)) return;\n const shouldActivate = item.dispatchEvent(\n new window.KeyboardEvent('keydown', {\n key: e.key,\n code: e.code,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n shiftKey: e.shiftKey,\n bubbles: true,\n cancelable: true,\n }),\n );\n // An anchor's Enter handler leaves its native default action to the browser.\n if (shouldActivate && e.key === 'Enter') {\n item.dispatchEvent(\n new window.MouseEvent('click', {\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n shiftKey: e.shiftKey,\n bubbles: true,\n cancelable: true,\n detail: 1,\n }),\n );\n }\n // The real keyup belongs to the search input, so balance the item's press here.\n item.dispatchEvent(\n new window.KeyboardEvent('keyup', {\n key: e.key,\n code: e.code,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n shiftKey: e.shiftKey,\n bubbles: true,\n cancelable: true,\n }),\n );\n };\n\n const handleSearchKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.nativeEvent.isComposing) return;\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n handleArrowKey(e);\n } else if (e.key === 'Enter' || (e.key === ' ' && !searchValue.trim())) {\n handleActionKey(e);\n } else if (e.key === 'Escape' && searchValue) {\n e.preventDefault();\n handleSearchChange('');\n }\n };\n\n // Extract styles\n const extractedStyles = extractStyles(props, CONTAINER_STYLES);\n\n // Determine if we should show empty state based on actual filtered collection\n const hasSearchTerm = searchValue.trim().length > 0;\n const showEmptyState = hasSearchTerm && !hasFilteredItems && !isLoading;\n const activeDescendant =\n !isLoading &&\n !showEmptyState &&\n focusedKey != null &&\n collectItemKeys(filteredCollectionItems).includes(focusedKey)\n ? itemId(focusedKey)\n : undefined;\n\n // Sync refs\n useSyncRef(contextProps, menuRef);\n\n // Determine mods based on menu context\n const mods = {\n sections: viewHasSections,\n footer: !!footer,\n header: !!header,\n popover: completeProps.mods?.popover,\n tray: completeProps.mods?.tray,\n };\n\n const {\n 'aria-label': _ariaLabel,\n 'aria-labelledby': _ariaLabelledBy,\n 'aria-describedby': _ariaDescribedBy,\n 'aria-details': _ariaDetails,\n ...wrapperProps\n } = filterBaseProps(props) as Record<string, unknown>;\n\n return (\n <StyledCommandMenu\n {...wrapperProps}\n ref={domRef}\n qa={qa || 'CommandMenu'}\n data-size={size}\n mods={mods}\n styles={mergeStyleLayers(extractedStyles, styles)}\n >\n {/* Header */}\n {header && (\n <StyledHeader\n role=\"presentation\"\n data-size={size}\n styles={mergeStyleLayers({ border: 'none' }, headerStyles)}\n >\n {header}\n </StyledHeader>\n )}\n\n {/* Search Input */}\n <StyledSearchInput\n ref={searchInputRef}\n type=\"search\"\n placeholder={searchPlaceholder}\n value={searchValue}\n styles={searchInputStyles}\n data-size={size}\n aria-label={completeProps['aria-label'] ?? searchPlaceholder}\n aria-labelledby={completeProps['aria-labelledby']}\n aria-describedby={completeProps['aria-describedby']}\n aria-details={completeProps['aria-details']}\n aria-controls={!isLoading && !showEmptyState ? menuId : undefined}\n role=\"searchbox\"\n aria-activedescendant={activeDescendant}\n // For a dialog kept mounted while closed, as on `Button`.\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n onChange={(e) => handleSearchChange(e.target.value)}\n onKeyDown={handleSearchKeyDown}\n />\n\n {/* Loading State */}\n {isLoading && (\n <StyledLoadingWrapper>\n <LoadingIcon\n role=\"progressbar\"\n aria-label={t('commandMenu.loading', 'Loading commands')}\n aria-hidden={false}\n />\n </StyledLoadingWrapper>\n )}\n\n {/* Menu Content - always render unless loading */}\n {!isLoading && !showEmptyState && (\n <StyledMenu\n {...menuProps}\n ref={menuRef}\n id={menuId}\n aria-label={t('commandMenu.menu', 'Command menu')}\n qa=\"Menu\"\n data-size={size}\n mods={mods}\n styles={{\n border: 'none',\n boxShadow: 'none',\n radius: 0,\n padding: '0.5x',\n }}\n >\n {renderedItems}\n </StyledMenu>\n )}\n\n {/* Empty State - show when search term exists but no results */}\n {!isLoading && showEmptyState && (\n <StyledEmptyState>{emptyLabel}</StyledEmptyState>\n )}\n\n {/* Footer */}\n {footer && (\n <StyledFooter\n role=\"presentation\"\n data-size={size}\n styles={footerStyles}\n >\n {footer}\n </StyledFooter>\n )}\n </StyledCommandMenu>\n );\n}\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\nconst _CommandMenu = React.forwardRef(CommandMenu) as <T>(\n props: CubeCommandMenuProps<T> & React.RefAttributes<HTMLDivElement>,\n) => ReactElement;\n\n// Attach Trigger alias from MenuTrigger for consistent API\n// Also attach Item and Section for compound component pattern\nconst __CommandMenu = Object.assign(_CommandMenu, {\n Trigger: MenuTrigger,\n Item,\n Section,\n displayName: 'CommandMenu',\n});\n\nexport { __CommandMenu as CommandMenu };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiDA,SAAS2C,gBAAgBC,OAAsBE,OAAc,CAAA,GAAW;CACtE,KAAK,MAAMC,QAAQH,OACjB,IAAIG,MAAMC,SAAS,WACjBL,gBAAgBI,KAAKE,cAAc,CAAA,GAAIH,IAAI;MACtC,IAAIC,MAAMC,SAAS,QACxBF,KAAKI,KAAKH,KAAKI,GAAG;CAItB,OAAOL;AACT;;;;;;;AAQA,SAASM,kBACPN,MACAO,YACAC,WACAC,YACY;CACZ,MAAMC,aAAaL,QAAa,CAACI,WAAWJ,GAAG;CAC/C,MAAMM,QAAQJ,cAAc,OAAO,KAAKP,KAAKY,QAAQL,UAAU;CAC/D,MAAMM,QACJL,cAAc,IACVR,KAAKc,MAAMH,QAAQ,CAAC,IACpBX,KAAKc,MAAM,GAAGC,KAAKC,IAAIL,OAAO,CAAC,CAAC,CAAC,CAACM,QAAQ;CAChD,MAAMC,UAAUV,cAAc,IAAIR,OAAO,CAAC,GAAGA,IAAI,CAAC,CAACiB,QAAQ;CAE3D,OAAOJ,MAAMM,KAAKT,SAAS,KAAKQ,QAAQC,KAAKT,SAAS,KAAK;AAC7D;AAmDA,SAAAmC,YAAAC,OAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAIE,MAAA,EAAAC,MAAc1E,Q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kD0BuH,OAAOvH,GAAG;AAAC;AAyfrC,MAAM0P,eAAenS,MAAMoS,WAAWnN,WAAW;AAMjD,MAAMsN,gBAAgBC,OAAOC,OAAON,cAAc;CAChDO,SAASlR;CACTH,MAAAA;CACAX;CACAiS,aAAa;AACf,CAAC"}
1
+ {"version":3,"file":"CommandMenu.js","names":["useObjectRef","useSyncRef","CollectionChildren","FocusStrategy","Key","CONTAINER_STYLES","ContainerStyleProps","Styles","React","KeyboardEvent","ReactElement","ReactNode","Ref","useId","useRef","useState","useFilter","useMenu","Section","useTreeState","useI18n","LoadingIcon","filterComponentBaseProps","mergeProps","extractStyles","mergeStyleLayers","useMenuContext","CubeMenuProps","getMenuItemReactKey","MenuCollectionItem","Item","MenuItem","MenuSection","MenuTrigger","StyledDivider","StyledFooter","StyledHeader","StyledMenu","StyledCommandMenu","StyledEmptyState","StyledLoadingWrapper","StyledSearchInput","ComponentBasePropsWithoutChildren","collectItemKeys","nodes","Iterable","keys","node","type","childNodes","push","key","getNextEnabledKey","currentKey","direction","isDisabled","isEnabled","index","indexOf","ahead","slice","Math","max","reverse","ordered","find","CommandMenuItem","id","textValue","keywords","forceMount","CubeCommandMenuProps","Omit","T","searchPlaceholder","searchValue","onSearchChange","value","filter","inputValue","emptyLabel","searchInputStyles","headerStyles","footerStyles","isLoading","shouldFilter","autoFocus","size","selectedKeys","defaultSelectedKeys","onSelectionChange","CommandMenu","props","ref","$","_c","t","t0","controlledSearchValue","customFilter","t1","t2","t3","t4","t5","qa","styles","onAction","header","footer","restMenuProps","t6","undefined","t7","domRef","searchInputRef","instanceId","menuId","contextProps","ariaSelectedKeys","Set","ariaDefaultSelectedKeys","handleSelectionChange","allKeys","Array","from","treeState","collection","getKeys","map","_temp","_temp2","t8","key_1","completeProps","internalSearchValue","setInternalSearchValue","t9","handleSearchChange","t10","Symbol","for","sensitivity","contains","t11","item","searchWords","trim","toLowerCase","split","_temp3","length","searchableTexts","isArray","_temp4","every","searchWord","some","text","includes","enhancedFilter","t12","term","searchWords_0","_temp5","filterNodes","iter","result","filteredChildren","text_0","String","rendered","collectionFilter","treeStateProps","children","shouldUseVirtualFocus","itemId","key_2","item_0","getItem","actions","href","encodeURIComponent","collectionItems","_temp6","focusedKey","selectionManager","filteredCollectionItems","hasFilteredItems","viewHasSections","_temp7","findFirstSelectableItem","key_3","menuRef","menuProps","renderedItems","isFirstSection","forEach","item_3","reactKey","sectionStyles","itemStyles","sectionHeadingStyles","menuItem","wrapper","cloneElement","t13","t14","current","timeoutId","setTimeout","focus","clearTimeout","useEffect","t15","t16","timeoutId_0","prevSearchValueRef","currentSearchValue","prevSearchValue","firstSelectableKey","setFocusedKey","handleArrowKey","e","preventDefault","nextKey","key_4","handleActionKey","e_0","stopPropagation","repeat","item_4","ownerDocument","getElementById","shouldActivate","dispatchEvent","window","code","ctrlKey","metaKey","altKey","shiftKey","bubbles","cancelable","MouseEvent","detail","handleSearchKeyDown","e_1","nativeEvent","isComposing","extractedStyles","t17","hasSearchTerm","showEmptyState","activeDescendant","t18","t19","t20","mods","sections","t21","t22","Record","wrapperProps","_ariaLabel","_ariaLabelledBy","_ariaDescribedBy","_ariaDetails","t23","T0","t24","t25","border","t26","t27","t28","t29","t30","t31","t32","e_2","target","t33","t34","t35","boxShadow","radius","padding","t36","t37","t38","item_2","item_1","word_0","word","keyword","key_0","_CommandMenu","forwardRef","RefAttributes","HTMLDivElement","__CommandMenu","Object","assign","Trigger","displayName","_c","mergeProps","MenuTrigger"],"sources":["../../../../src/components/actions/CommandMenu/CommandMenu.tsx"],"sourcesContent":["import { useObjectRef, useSyncRef } from '@react-aria/utils';\nimport { CollectionChildren, FocusStrategy, Key } from '@react-types/shared';\nimport { CONTAINER_STYLES, ContainerStyleProps, Styles } from '@tenphi/tasty';\nimport React, {\n KeyboardEvent,\n ReactElement,\n ReactNode,\n Ref,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useMenu } from 'react-aria';\nimport { Section, useTreeState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n/useI18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { filterComponentBaseProps } from '../../../utils/react/componentBaseProps';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\nimport { useMenuContext } from '../Menu/context';\nimport { CubeMenuProps } from '../Menu/Menu';\nimport {\n getMenuItemReactKey,\n MenuCollectionItem as Item,\n} from '../Menu/MenuCollectionItem';\nimport { MenuItem } from '../Menu/MenuItem';\nimport { MenuSection } from '../Menu/MenuSection';\nimport { MenuTrigger } from '../Menu/MenuTrigger';\nimport {\n StyledDivider,\n StyledFooter,\n StyledHeader,\n StyledMenu,\n} from '../Menu/styled';\n\nimport {\n StyledCommandMenu,\n StyledEmptyState,\n StyledLoadingWrapper,\n StyledSearchInput,\n} from './styled';\n\nimport type { ComponentBasePropsWithoutChildren } from '../../../utils/react/componentBaseProps';\n\n/** The keys of the items in `nodes`, in order, including those in sections. */\nfunction collectItemKeys(nodes: Iterable<any>, keys: Key[] = []): Key[] {\n for (const node of nodes) {\n if (node?.type === 'section') {\n collectItemKeys(node.childNodes ?? [], keys);\n } else if (node?.type === 'item') {\n keys.push(node.key);\n }\n }\n\n return keys;\n}\n\n/**\n * The key an arrow press moves to: the next enabled key after `currentKey` in\n * `direction`, wrapping round to the first enabled key in that direction (the\n * last one going up). With nothing focused, or the focused key filtered out,\n * it returns that key.\n */\nfunction getNextEnabledKey(\n keys: Key[],\n currentKey: Key | null,\n direction: 1 | -1,\n isDisabled: (key: Key) => boolean,\n): Key | null {\n const isEnabled = (key: Key) => !isDisabled(key);\n const index = currentKey == null ? -1 : keys.indexOf(currentKey);\n const ahead =\n direction === 1\n ? keys.slice(index + 1)\n : keys.slice(0, Math.max(index, 0)).reverse();\n const ordered = direction === 1 ? keys : [...keys].reverse();\n\n return ahead.find(isEnabled) ?? ordered.find(isEnabled) ?? null;\n}\n\nexport interface CommandMenuItem {\n // Standard item props\n id: string;\n textValue: string;\n\n // Enhanced search features\n keywords?: string[];\n forceMount?: boolean;\n\n // Standard Menu item props inherited\n [key: string]: any;\n}\n\nexport interface CubeCommandMenuProps<T>\n extends\n ComponentBasePropsWithoutChildren,\n ContainerStyleProps,\n Omit<\n CubeMenuProps<T>,\n 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'\n > {\n // Search-specific props\n searchPlaceholder?: string;\n searchValue?: string;\n onSearchChange?: (value: string) => void;\n filter?: (textValue: string, inputValue: string) => boolean;\n emptyLabel?: ReactNode;\n searchInputStyles?: Styles;\n headerStyles?: Styles;\n footerStyles?: Styles;\n\n // Advanced search features\n isLoading?: boolean;\n shouldFilter?: boolean;\n\n // Focus management - override the autoFocus from CubeMenuProps to allow boolean | FocusStrategy\n autoFocus?: boolean | FocusStrategy;\n\n // Size prop\n size?: 'medium' | 'large' | (string & {});\n\n /** Currently selected keys (controlled) */\n selectedKeys?: string[];\n /** Initially selected keys (uncontrolled) */\n defaultSelectedKeys?: string[];\n /** Handler for selection changes */\n onSelectionChange?: (keys: string[]) => void;\n}\n\nfunction CommandMenu<T extends object>(\n props: CubeCommandMenuProps<T>,\n ref: Ref<HTMLDivElement>,\n) {\n const { t } = useI18n();\n\n const {\n searchPlaceholder = t(\n 'commandMenu.searchPlaceholder',\n 'Search commands...',\n ),\n searchValue: controlledSearchValue,\n onSearchChange,\n filter: customFilter,\n emptyLabel = t('commandMenu.empty', 'No commands found'),\n searchInputStyles,\n headerStyles,\n footerStyles,\n isLoading = false,\n shouldFilter = true,\n autoFocus = true,\n size = 'medium',\n qa,\n styles,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n onAction,\n header,\n footer,\n ...restMenuProps\n } = props;\n\n const domRef = useObjectRef(ref);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const instanceId = useId();\n const menuId = `${qa || 'CommandMenu'}-${instanceId}-menu`;\n const contextProps = useMenuContext();\n\n // Convert string[] to Set<Key> for React Aria compatibility\n const ariaSelectedKeys = selectedKeys ? new Set(selectedKeys) : undefined;\n const ariaDefaultSelectedKeys = defaultSelectedKeys\n ? new Set(defaultSelectedKeys)\n : undefined;\n\n const handleSelectionChange = onSelectionChange\n ? (keys: 'all' | Set<Key>) => {\n if (keys === 'all') {\n // Handle 'all' selection case - collect all available keys\n const allKeys = Array.from(treeState.collection.getKeys()).map(\n (key: any) => String(key),\n );\n onSelectionChange(allKeys);\n } else if (keys instanceof Set) {\n onSelectionChange(Array.from(keys).map((key) => String(key)));\n } else {\n onSelectionChange([]);\n }\n }\n : undefined;\n\n const completeProps = mergeProps(contextProps, restMenuProps, {\n onAction: onAction ? (key: Key) => onAction(key) : undefined,\n selectedKeys: ariaSelectedKeys,\n defaultSelectedKeys: ariaDefaultSelectedKeys,\n onSelectionChange: handleSelectionChange,\n });\n\n // Search state management\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const searchValue = controlledSearchValue ?? internalSearchValue;\n\n const handleSearchChange = (value: string) => {\n if (controlledSearchValue === undefined) {\n setInternalSearchValue(value);\n }\n onSearchChange?.(value);\n };\n\n // Filter setup\n const { contains } = useFilter({ sensitivity: 'base' });\n const textFilterFn = customFilter || contains;\n\n // Enhanced filter function that supports keywords and forceMount\n const enhancedFilter = (\n textValue: string,\n inputValue: string,\n item?: any,\n ) => {\n // Always show force-mounted items\n if (item?.forceMount) {\n return true;\n }\n\n // If shouldFilter is false, show all items\n if (!shouldFilter) {\n return true;\n }\n\n // Split input value into individual words and filter out empty strings\n const searchWords = inputValue\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no search words, show all items\n if (searchWords.length === 0) {\n return true;\n }\n\n // Collect all searchable text for this item\n const searchableTexts: string[] = [];\n\n // Add main text value\n searchableTexts.push(textValue.toLowerCase());\n\n // Add keywords if available\n if (item?.keywords && Array.isArray(item.keywords)) {\n searchableTexts.push(\n ...item.keywords.map((keyword: string) => keyword.toLowerCase()),\n );\n }\n\n // Check if ALL search words match at least one of the searchable texts\n return searchWords.every((searchWord) =>\n searchableTexts.some((text) => text.includes(searchWord)),\n );\n };\n\n // Collection filter for React Stately\n const collectionFilter = (nodes: Iterable<any>): Iterable<any> => {\n const term = searchValue.trim();\n\n // If no search term, return all nodes\n if (!term) {\n return nodes;\n }\n\n // Split search term into words for multi-word filtering\n const searchWords = term\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no valid search words, return all nodes\n if (searchWords.length === 0) {\n return nodes;\n }\n\n // Recursive helper to filter sections and items\n const filterNodes = (iter: Iterable<any>): any[] => {\n const result: any[] = [];\n\n for (const node of iter) {\n if (node.type === 'section') {\n const filteredChildren = filterNodes(node.childNodes);\n\n if (filteredChildren.length) {\n result.push({\n ...node,\n childNodes: filteredChildren,\n });\n }\n } else {\n const text = node.textValue ?? String(node.rendered ?? '');\n\n if (enhancedFilter(text, term, node.props)) {\n result.push(node);\n }\n }\n }\n\n return result;\n };\n\n return filterNodes(nodes);\n };\n\n // Create tree state with filter for both keyboard navigation and rendering\n const treeStateProps = {\n ...completeProps,\n children: completeProps.children as CollectionChildren<T>,\n filter: collectionFilter,\n shouldUseVirtualFocus: true, // Always use virtual focus for CommandMenu\n };\n\n const treeState = useTreeState(treeStateProps);\n const itemId = (key: Key) => {\n const item = treeState.collection.getItem(key);\n const actions = item?.props.actions;\n // A plain command's layout and semantic target share the consumer's DOM id.\n if (\n item?.props.id != null &&\n item.props.href == null &&\n (!actions || actions === true)\n )\n return String(item.props.id);\n return `${menuId}-option-${typeof key}-${encodeURIComponent(String(key))}`;\n };\n\n const collectionItems = [...treeState.collection];\n const hasSections = collectionItems.some((item) => item.type === 'section');\n\n const focusedKey = treeState.selectionManager.focusedKey;\n\n // Apply filtering to collection items for rendering and empty state checks\n const filteredCollectionItems = [...collectionFilter(collectionItems)];\n\n const hasFilteredItems = filteredCollectionItems.length > 0;\n const viewHasSections = filteredCollectionItems.some(\n (item) => item.type === 'section',\n );\n\n // Helper function to find the first selectable item from filtered results\n const findFirstSelectableItem = () =>\n collectItemKeys(filteredCollectionItems).find(\n (key) => !treeState.selectionManager.isDisabled(key),\n ) ?? null;\n\n // Create a ref for the menu container\n const menuRef = useRef<HTMLUListElement>(null);\n\n // Use menu hook for accessibility\n const { menuProps } = useMenu(\n {\n ...completeProps,\n 'aria-label': t('commandMenu.menu', 'Command menu'),\n shouldUseVirtualFocus: true,\n },\n treeState,\n menuRef,\n );\n\n // Manual rendering of menu items (similar to Menu component)\n const renderedItems: React.ReactNode[] = [];\n let isFirstSection = true;\n\n filteredCollectionItems.forEach((item) => {\n const reactKey = getMenuItemReactKey(item.key);\n if (item.type === 'section') {\n if (!isFirstSection) {\n renderedItems.push(\n <StyledDivider\n key={`divider-${reactKey}`}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />,\n );\n }\n\n renderedItems.push(\n <MenuSection\n key={reactKey}\n item={item}\n state={treeState}\n styles={completeProps.sectionStyles}\n itemStyles={completeProps.itemStyles}\n headingStyles={completeProps.sectionHeadingStyles}\n size={size}\n itemId={itemId}\n />,\n );\n\n isFirstSection = false;\n return;\n }\n\n let menuItem = (\n <MenuItem\n key={reactKey}\n item={item}\n state={treeState}\n styles={completeProps.itemStyles}\n size={size}\n id={itemId(item.key)}\n />\n );\n\n // Apply custom wrapper if provided\n if (item.props.wrapper) {\n menuItem = item.props.wrapper(menuItem);\n }\n\n // Ensure every child has a stable key, even if the wrapper component didn't set one.\n renderedItems.push(React.cloneElement(menuItem, { key: reactKey }));\n });\n\n // Auto-focus search input\n React.useEffect(() => {\n if (autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the element is visible and focusable\n // This is especially important when the CommandMenu is opened in a popover\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus]);\n\n // Also focus when the component becomes visible (for trigger/popover usage)\n React.useEffect(() => {\n // Check if autoFocus is enabled and we're in a trigger context\n if (autoFocus && contextProps.autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the popover is fully rendered\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 50); // Slightly longer timeout for popover context\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus, contextProps.autoFocus]);\n\n // Track the previous search value to only run auto-focus when search actually changes\n const prevSearchValueRef = useRef<string>('');\n\n // Auto-focus first item when search value changes (but not on initial render)\n React.useEffect(() => {\n const currentSearchValue = searchValue.trim();\n const prevSearchValue = prevSearchValueRef.current;\n\n // Only auto-focus when search value actually changes\n if (currentSearchValue !== prevSearchValue && currentSearchValue !== '') {\n const firstSelectableKey = findFirstSelectableItem();\n\n if (firstSelectableKey != null && hasFilteredItems) {\n // Focus the first item in the selection manager\n treeState.selectionManager.setFocusedKey(firstSelectableKey);\n } else {\n // Clear focus if no items are available\n treeState.selectionManager.setFocusedKey(null);\n }\n }\n\n // Update the previous search value\n prevSearchValueRef.current = currentSearchValue;\n }, [searchValue, findFirstSelectableItem, hasFilteredItems]);\n\n // ---- search input keyboard ----------------------------------------------\n const handleArrowKey = (e: KeyboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const { selectionManager } = treeState;\n const currentKey = selectionManager.focusedKey;\n const nextKey = getNextEnabledKey(\n collectItemKeys(filteredCollectionItems),\n currentKey,\n e.key === 'ArrowDown' ? 1 : -1,\n (key) => selectionManager.isDisabled(key),\n );\n\n if (nextKey != null) {\n selectionManager.setFocusedKey(nextKey);\n }\n };\n\n // Use the rendered item's Aria handlers for commands, selection and navigation.\n const handleActionKey = (e: KeyboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (\n e.repeat ||\n focusedKey == null ||\n treeState.selectionManager.isDisabled(focusedKey)\n )\n return;\n const item = menuRef.current?.ownerDocument.getElementById(\n itemId(focusedKey),\n );\n if (!item || !menuRef.current?.contains(item)) return;\n const shouldActivate = item.dispatchEvent(\n new window.KeyboardEvent('keydown', {\n key: e.key,\n code: e.code,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n shiftKey: e.shiftKey,\n bubbles: true,\n cancelable: true,\n }),\n );\n // An anchor's Enter handler leaves its native default action to the browser.\n if (shouldActivate && e.key === 'Enter') {\n item.dispatchEvent(\n new window.MouseEvent('click', {\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n shiftKey: e.shiftKey,\n bubbles: true,\n cancelable: true,\n detail: 1,\n }),\n );\n }\n // The real keyup belongs to the search input, so balance the item's press here.\n item.dispatchEvent(\n new window.KeyboardEvent('keyup', {\n key: e.key,\n code: e.code,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n shiftKey: e.shiftKey,\n bubbles: true,\n cancelable: true,\n }),\n );\n };\n\n const handleSearchKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.nativeEvent.isComposing) return;\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n handleArrowKey(e);\n } else if (e.key === 'Enter' || (e.key === ' ' && !searchValue.trim())) {\n handleActionKey(e);\n } else if (e.key === 'Escape' && searchValue) {\n e.preventDefault();\n handleSearchChange('');\n }\n };\n\n // Extract styles\n const extractedStyles = extractStyles(props, CONTAINER_STYLES);\n\n // Determine if we should show empty state based on actual filtered collection\n const hasSearchTerm = searchValue.trim().length > 0;\n const showEmptyState = hasSearchTerm && !hasFilteredItems && !isLoading;\n const activeDescendant =\n !isLoading &&\n !showEmptyState &&\n focusedKey != null &&\n collectItemKeys(filteredCollectionItems).includes(focusedKey)\n ? itemId(focusedKey)\n : undefined;\n\n // Sync refs\n useSyncRef(contextProps, menuRef);\n\n // Determine mods based on menu context\n const mods = {\n sections: viewHasSections,\n footer: !!footer,\n header: !!header,\n ...completeProps.mods,\n };\n\n const {\n 'aria-label': _ariaLabel,\n 'aria-labelledby': _ariaLabelledBy,\n 'aria-describedby': _ariaDescribedBy,\n 'aria-details': _ariaDetails,\n ...wrapperProps\n } = filterComponentBaseProps(props) as Record<string, unknown>;\n\n return (\n <StyledCommandMenu\n {...wrapperProps}\n ref={domRef}\n qa={qa || 'CommandMenu'}\n data-size={size}\n mods={mods}\n styles={mergeStyleLayers(extractedStyles, styles)}\n >\n {/* Header */}\n {header && (\n <StyledHeader\n role=\"presentation\"\n data-size={size}\n styles={mergeStyleLayers({ border: 'none' }, headerStyles)}\n >\n {header}\n </StyledHeader>\n )}\n\n {/* Search Input */}\n <StyledSearchInput\n ref={searchInputRef}\n type=\"search\"\n placeholder={searchPlaceholder}\n value={searchValue}\n styles={searchInputStyles}\n data-size={size}\n aria-label={completeProps['aria-label'] ?? searchPlaceholder}\n aria-labelledby={completeProps['aria-labelledby']}\n aria-describedby={completeProps['aria-describedby']}\n aria-details={completeProps['aria-details']}\n aria-controls={!isLoading && !showEmptyState ? menuId : undefined}\n role=\"searchbox\"\n aria-activedescendant={activeDescendant}\n // For a dialog kept mounted while closed, as on `Button`.\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n onChange={(e) => handleSearchChange(e.target.value)}\n onKeyDown={handleSearchKeyDown}\n />\n\n {/* Loading State */}\n {isLoading && (\n <StyledLoadingWrapper>\n <LoadingIcon\n role=\"progressbar\"\n aria-label={t('commandMenu.loading', 'Loading commands')}\n aria-hidden={false}\n />\n </StyledLoadingWrapper>\n )}\n\n {/* Menu Content - always render unless loading */}\n {!isLoading && !showEmptyState && (\n <StyledMenu\n {...menuProps}\n ref={menuRef}\n id={menuId}\n aria-label={t('commandMenu.menu', 'Command menu')}\n qa=\"Menu\"\n data-size={size}\n mods={mods}\n styles={{\n border: 'none',\n boxShadow: 'none',\n radius: 0,\n padding: '0.5x',\n }}\n >\n {renderedItems}\n </StyledMenu>\n )}\n\n {/* Empty State - show when search term exists but no results */}\n {!isLoading && showEmptyState && (\n <StyledEmptyState>{emptyLabel}</StyledEmptyState>\n )}\n\n {/* Footer */}\n {footer && (\n <StyledFooter\n role=\"presentation\"\n data-size={size}\n styles={footerStyles}\n >\n {footer}\n </StyledFooter>\n )}\n </StyledCommandMenu>\n );\n}\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\nconst _CommandMenu = React.forwardRef(CommandMenu) as <T>(\n props: CubeCommandMenuProps<T> & React.RefAttributes<HTMLDivElement>,\n) => ReactElement;\n\n// Attach Trigger alias from MenuTrigger for consistent API\n// Also attach Item and Section for compound component pattern\nconst __CommandMenu = Object.assign(_CommandMenu, {\n Trigger: MenuTrigger,\n Item,\n Section,\n displayName: 'CommandMenu',\n});\n\nexport { __CommandMenu as CommandMenu };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAS2C,gBAAgBC,OAAsBE,OAAc,CAAA,GAAW;CACtE,KAAK,MAAMC,QAAQH,OACjB,IAAIG,MAAMC,SAAS,WACjBL,gBAAgBI,KAAKE,cAAc,CAAA,GAAIH,IAAI;MACtC,IAAIC,MAAMC,SAAS,QACxBF,KAAKI,KAAKH,KAAKI,GAAG;CAItB,OAAOL;AACT;;;;;;;AAQA,SAASM,kBACPN,MACAO,YACAC,WACAC,YACY;CACZ,MAAMC,aAAaL,QAAa,CAACI,WAAWJ,GAAG;CAC/C,MAAMM,QAAQJ,cAAc,OAAO,KAAKP,KAAKY,QAAQL,UAAU;CAC/D,MAAMM,QACJL,cAAc,IACVR,KAAKc,MAAMH,QAAQ,CAAC,IACpBX,KAAKc,MAAM,GAAGC,KAAKC,IAAIL,OAAO,CAAC,CAAC,CAAC,CAACM,QAAQ;CAChD,MAAMC,UAAUV,cAAc,IAAIR,OAAO,CAAC,GAAGA,IAAI,CAAC,CAACiB,QAAQ;CAE3D,OAAOJ,MAAMM,KAAKT,SAAS,KAAKQ,QAAQC,KAAKT,SAAS,KAAK;AAC7D;AAmDA,SAAAmC,YAAAC,OAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAIE,MAAA,EAAAC,MAAc5E,QAAQ;CAEtB,MAAA,EAAAsD,mBAA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ACA+R,aAAa;AACf,CAAC"}
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { tasty } from "@tenphi/tasty";
3
3
  //#region src/components/actions/CommandMenu/styled.tsx
4
4
  const StyledCommandMenu = tasty({
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { mergeProps } from "../../../utils/react/mergeProps.js";
3
3
  import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
4
4
  import { CURRENT_CLEAR_STYLES, CURRENT_OUTLINE_STYLES, CURRENT_PRIMARY_STYLES, DANGER_CLEAR_STYLES, DANGER_OUTLINE_STYLES, DANGER_PRIMARY_STYLES, DEFAULT_CLEAR_STYLES, DEFAULT_OUTLINE_STYLES, DEFAULT_PRIMARY_STYLES, ITEM_ACTION_BASE_STYLES, NOTE_CLEAR_STYLES, NOTE_OUTLINE_STYLES, NOTE_PRIMARY_STYLES, SPECIAL_CLEAR_STYLES, SPECIAL_OUTLINE_STYLES, SPECIAL_PRIMARY_STYLES, SUCCESS_CLEAR_STYLES, SUCCESS_OUTLINE_STYLES, SUCCESS_PRIMARY_STYLES, WARNING_CLEAR_STYLES, WARNING_OUTLINE_STYLES, WARNING_PRIMARY_STYLES } from "../../../data/item-themes.js";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { createContext, useContext } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { DisplayTransition } from "../helpers/DisplayTransition/DisplayTransition.js";
3
3
  import { ITEM_RESTING_COLOR_VARIANTS, ROW_STATE_ALIASES, resolveItemVariant } from "../../data/item-themes.js";
4
4
  import { ItemActionProvider } from "./ItemActionContext.js";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { mergeProps } from "../../../utils/react/mergeProps.js";
3
3
  import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
4
4
  import { useEvent } from "../../../_internal/hooks/use-event.js";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { Button } from "../Button/Button.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { forwardRef } from "react";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { extractStyles } from "../../../utils/styles.js";
3
3
  import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
4
4
  import { useMenuContext } from "./context.js";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { normalizeNavigationUrl } from "../../../providers/navigation-url.js";
3
3
  import { parseTo } from "../use-action.js";
4
4
  import { COLLECTION_ITEM_CLICK, CollectionItem as _CollectionItem } from "../../CollectionItem.js";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
3
3
  import { isExternalUrl, normalizeNavigationUrl } from "../../../providers/navigation-url.js";
4
4
  import { useNavigation } from "../../../providers/use-navigation.js";
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { getMenuItemReactKey } from "./MenuCollectionItem.js";
3
3
  import { MenuItem } from "./MenuItem.js";
4
4
  import { StyledMenu, StyledSection, StyledSectionHeading } from "./styled.js";
@@ -1,16 +1,17 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { SlotProvider } from "../../../utils/react/Slots.js";
3
3
  import { useEvent } from "../../../_internal/hooks/use-event.js";
4
4
  import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
5
5
  import { Tray as _Tray } from "../../overlays/Modal/Tray.js";
6
6
  import { MenuContext } from "./context.js";
7
7
  import { generateRandomId } from "../../../utils/random.js";
8
+ import { useOverlayPosition as useOverlayPosition$1 } from "../../../utils/react/useOverlayPosition.js";
8
9
  import { Popover as _Popover } from "../../overlays/Modal/Popover.js";
9
10
  import { isOwnActionsPress } from "../actions-run.js";
10
11
  import { c } from "react/compiler-runtime";
11
12
  import { Fragment, forwardRef, useEffect, useRef } from "react";
12
13
  import { jsx, jsxs } from "react/jsx-runtime";
13
- import { DismissButton, FocusScope, useMenuTrigger, useOverlayPosition } from "react-aria";
14
+ import { DismissButton, FocusScope, useMenuTrigger } from "react-aria";
14
15
  import { useIsMobileDevice } from "@react-spectrum/utils";
15
16
  import { useMenuTriggerState } from "react-stately";
16
17
  import { PressResponder } from "@react-aria/interactions";
@@ -113,7 +114,7 @@ function MenuTrigger(props, ref) {
113
114
  $[22] = t9;
114
115
  $[23] = t12;
115
116
  } else t12 = $[23];
116
- const { overlayProps: positionProps, placement } = useOverlayPosition(t12);
117
+ const { overlayProps: positionProps, placement } = useOverlayPosition$1(t12);
117
118
  let t13;
118
119
  if ($[24] !== isTray || $[25] !== menuPopoverRef || $[26] !== menuTriggerRef) {
119
120
  t13 = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.js","names":["PressResponder","useObjectRef","useIsMobileDevice","forwardRef","Fragment","MutableRefObject","ReactElement","Ref","RefObject","useEffect","useMemo","useRef","AriaMenuTriggerProps","DismissButton","FocusScope","Placement","PositionProps","useMenuTrigger","useOverlayPosition","MenuTriggerState","useMenuTriggerState","useEvent","generateRandomId","SlotProvider","usePopoverSync","Popover","Tray","isOwnActionsPress","MenuContext","MenuContextValue","CubeMenuTriggerProps","Omit","isDisabled","defaultOpen","onOpenChange","isOpen","targetRef","HTMLElement","children","state","closeOnSelect","isDummy","shouldRestoreFocus","popoverRef","HTMLDivElement","mobileType","MenuTrigger","props","ref","$","_c","internalPopoverRef","menuPopoverRef","trayRef","triggerRef","domRef","menuTriggerRef","menuRef","wasOpenRef","shouldFlip","t0","trigger","t1","t2","t3","undefined","t4","Symbol","for","menuId","Array","isArray","length","Error","menuTrigger","menu","t5","close","t6","t7","onClose","enabled","containerRef","t8","menuTriggerProps","menuProps","initialPlacement","placement","isMobileDevice","isTray","t9","t10","offset","t11","crossOffset","t12","containerPadding","overlayRef","scrollRef","overlayProps","positionProps","t13","activeElement","document","body","isConnected","overlay","current","contains","hasFocusMovedOutsideMenu","t14","t15","setTimeout","focus","t16","focusStrategy","t17","t18","popover","tray","t19","t20","autoFocus","mods","isClosing","menuContext","t21","t22","t23","contents","t24","el","menuTriggerEl","closest","shouldCloseOnInteractOutside","t25","t26","style","actionButton","holdAffordance","t27","t28","t29","overlay_0","t30","_MenuTrigger","displayName","_c","Tray","Popover"],"sources":["../../../../src/components/actions/Menu/MenuTrigger.tsx"],"sourcesContent":["import { PressResponder } from '@react-aria/interactions';\nimport { useObjectRef } from '@react-aria/utils';\nimport { useIsMobileDevice } from '@react-spectrum/utils';\nimport {\n forwardRef,\n Fragment,\n MutableRefObject,\n ReactElement,\n Ref,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n FocusScope,\n Placement,\n PositionProps,\n useMenuTrigger,\n useOverlayPosition,\n} from 'react-aria';\nimport { MenuTriggerState, useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { generateRandomId } from '../../../utils/random';\nimport { SlotProvider } from '../../../utils/react/Slots';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover } from '../../overlays/Modal/Popover';\nimport { Tray } from '../../overlays/Modal/Tray';\nimport { isOwnActionsPress } from '../actions-run';\n\nimport { MenuContext, MenuContextValue } from './context';\n\nexport type { AriaMenuTriggerProps };\n\nexport type CubeMenuTriggerProps = Omit<AriaMenuTriggerProps, 'children'> &\n PositionProps & {\n isDisabled?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n targetRef?: RefObject<HTMLElement | null>;\n children: [\n ReactElement | ((state: MenuTriggerState) => ReactElement),\n ReactElement,\n ];\n\n closeOnSelect?: boolean;\n isDummy?: boolean;\n /**\n * Whether focus returns to the trigger when the menu closes. Defaults to\n * `true`.\n *\n * The restore is skipped automatically whenever the action that closed the\n * menu has already moved focus somewhere else, so an item that opens a\n * panel/dialog/inline editor and focuses it needs nothing here. Pass\n * `false` for the remaining case: a surface that claims focus *later* than\n * the menu's own restore (after an async load, an entry animation, or a\n * `requestAnimationFrame`), where the trigger would otherwise take focus\n * first and produce a visible flash.\n */\n shouldRestoreFocus?: boolean;\n /**\n * External ref to the popover container element. When provided, it is\n * aliased to the internal `menuPopoverRef`, letting consumers (e.g.\n * `useAnchoredMenu` / `useContextMenu`) feed the popover container into\n * their own `usePopoverSync` so the nested-popover guard can recognize\n * submenus opened inside this menu. Optional.\n */\n popoverRef?: MutableRefObject<HTMLDivElement | null>;\n /**\n * Overlay variant to use on mobile screens. Defaults to `'popover'`, which\n * keeps the desktop overlay even on small viewports. Pass `'tray'` to opt\n * into the bottom-sheet `Tray` overlay on mobile (the previous implicit\n * default). Mirrors the `mobileType` API on `DialogTrigger`.\n */\n mobileType?: 'popover' | 'tray';\n };\n\nfunction MenuTrigger(props: CubeMenuTriggerProps, ref: Ref<HTMLElement>) {\n const internalPopoverRef = useRef<HTMLDivElement>(null);\n const menuPopoverRef = props.popoverRef ?? internalPopoverRef;\n const trayRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n const domRef = useObjectRef(ref);\n const menuTriggerRef = props.targetRef || domRef || triggerRef;\n const menuRef = useRef<HTMLUListElement>(null);\n const wasOpenRef = useRef(false);\n const {\n children,\n shouldFlip = true,\n closeOnSelect,\n trigger = 'press',\n isDisabled,\n isDummy,\n mobileType = 'popover',\n shouldRestoreFocus = true,\n } = props;\n\n // Generate a unique ID for this menu instance\n const menuId = useMemo(() => generateRandomId(), []);\n\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('MenuTrigger must have exactly 2 children');\n }\n\n let [menuTrigger, menu] = children;\n const state: MenuTriggerState = useMenuTriggerState(props);\n\n usePopoverSync({\n menuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n enabled: !isDummy,\n triggerRef: menuTriggerRef,\n containerRef: menuPopoverRef,\n });\n\n if (typeof menuTrigger === 'function') {\n menuTrigger = menuTrigger(state);\n }\n\n const { menuTriggerProps, menuProps } = useMenuTrigger(\n { isDisabled },\n state,\n menuTriggerRef,\n );\n\n let initialPlacement: Placement = props.placement ?? 'bottom start';\n\n // Tray rendering is now opt-in via `mobileType=\"tray\"` (matches DialogTrigger).\n // Without that opt-in, MenuTrigger always renders a Popover so that environments\n // like jsdom (where `window.screen.width === 0` makes useIsMobileDevice() true)\n // don't accidentally swap in the tray overlay.\n const isMobileDevice = useIsMobileDevice();\n const isTray = mobileType === 'tray' && isMobileDevice;\n const { overlayProps: positionProps, placement } = useOverlayPosition({\n targetRef: menuTriggerRef,\n overlayRef: menuPopoverRef,\n scrollRef: menuRef,\n placement: initialPlacement,\n shouldFlip: shouldFlip,\n isOpen: state.isOpen && !isTray,\n onClose: state.close,\n containerPadding: props.containerPadding,\n offset: props.offset ?? 8,\n crossOffset: props.crossOffset ?? 0,\n });\n\n // Whether focus has been claimed by something outside the closing menu —\n // the signal that a menu action handed focus off and the trigger must not\n // take it back.\n //\n // Focus still inside the menu overlay means nobody claimed it: the pressed\n // item keeps focus while the popover plays its ~350ms exit animation. Focus\n // on `<body>` (or on a detached element) means the focused node went away\n // with the menu. Both are cases where the trigger is where focus belongs.\n const hasFocusMovedOutsideMenu = useEvent(() => {\n const activeElement = document.activeElement;\n\n if (!activeElement || activeElement === document.body) return false;\n if (!activeElement.isConnected) return false;\n\n // `menuPopoverRef` is only wired to the `Popover` branch, so the overlay\n // container is `trayRef` when `mobileType=\"tray\"` is in effect.\n const overlay = isTray ? trayRef.current : menuPopoverRef.current;\n\n return !(\n overlay?.contains(activeElement) ||\n menuRef.current?.contains(activeElement) ||\n menuTriggerRef.current?.contains(activeElement)\n );\n });\n\n // Restore focus manually when the menu closes\n useEffect(() => {\n if (!state.isOpen && wasOpenRef.current && !isDummy) {\n wasOpenRef.current = false;\n\n if (!shouldRestoreFocus) return;\n\n // Use setTimeout to ensure focus restoration happens after any animations\n setTimeout(() => {\n // An action that opened a panel, a dialog or an inline editor has\n // already focused it by now — taking focus back to the trigger would\n // undo the hand-off, which consumers previously had to out-race by\n // re-focusing on every animation frame (CUB-3962).\n if (hasFocusMovedOutsideMenu()) return;\n\n menuTriggerRef.current?.focus();\n }, 0);\n } else if (state.isOpen) {\n wasOpenRef.current = true;\n }\n }, [\n state.isOpen,\n menuTriggerRef,\n isDummy,\n shouldRestoreFocus,\n hasFocusMovedOutsideMenu,\n ]);\n\n const menuContext = {\n ...menuProps,\n ref: menuRef,\n onClose: state.close,\n closeOnSelect,\n autoFocus: (state.focusStrategy as any) ?? 'first',\n mods: {\n popover: !isTray,\n tray: isTray,\n },\n isClosing: !state.isOpen,\n } as MenuContextValue;\n\n // Wrap in a FocusScope so the menu popover registers as a child of any\n // outer contained FocusScope (e.g. a parent Dialog/Popover). Without this,\n // when the menu opens inside an outer contained FocusScope, the outer\n // scope rejects focus moving into the menu items (which live in a portal\n // and would otherwise belong to no scope) and yanks focus back to the\n // menu trigger.\n //\n // `restoreFocus` follows `shouldRestoreFocus`, so opting out silences the\n // scope's own unmount restore too. Scope registration (and therefore the\n // guarantee above) is unaffected — `FocusScope` joins the tree and tracks\n // the active scope regardless of `restoreFocus`.\n const contents = (\n <FocusScope restoreFocus={shouldRestoreFocus}>\n <DismissButton onDismiss={state.close} />\n {menu}\n <DismissButton onDismiss={state.close} />\n </FocusScope>\n );\n\n // Shared between the Popover and Tray branches so both react-aria\n // `useOverlay` calls see the same predicate. Without this, the Tray branch\n // falls back to unconditional dismiss-on-outside-interaction, which\n // `useOverlay` translates into stopPropagation/preventDefault in the\n // capture phase — that swallows clicks on sibling triggers (see Menu\n // rapid-open test).\n //\n // `useEvent` gives us a single stable callback reference for the lifetime\n // of the component while always reading the latest closure values. This\n // matters because `useMenuTriggerState` returns a fresh `state` object on\n // every render, so a vanilla `useCallback([..., state])` would produce a\n // new function every render and defeat any stability guarantees consumers\n // rely on.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n // While `Popover` is animating out, `useInteractOutside`'s capture-phase\n // listener is still attached (jsdom 29+ uses pointerdown/click capture).\n // The animation lasts ~350ms; without this guard, clicks on a sibling\n // trigger during the exit window get stopPropagation()'d and the\n // sibling's `onClick` never runs — breaking rapid-open and \"open menu\n // again with new props\" flows. Reading `state.isOpen` directly is safe\n // because `useEvent` always sees the latest closure.\n if (!state.isOpen) return false;\n\n // A press on our OWN trigger's actions run — an `ItemButton` row's\n // `actions` — is not a press outside. The run is rendered as a sibling of\n // the trigger (see `ItemActionsWrapper`), so the checks below cannot\n // recognise it and we closed instead, which cost the action its press: the\n // first press on it while the menu was open only closed the menu.\n if (isOwnActionsPress(el, menuTriggerRef.current)) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n // Plain interactive controls (Button, ItemButton) opt in via\n // `data-popover-dismiss`. We schedule the close via setTimeout(0) so\n // it lands AFTER the click event finishes — the button's onPress\n // fires first, then the popover closes. Without this, useOverlay\n // would stopPropagation() the click and the user would need a second\n // click to actually press the button.\n if (el.closest('[data-popover-dismiss]')) {\n setTimeout(() => state.close(), 0);\n return false;\n }\n return true;\n }\n if (\n isDummy &&\n (menuTriggerEl === menuTriggerRef.current ||\n menuTriggerRef.current?.contains(el))\n ) {\n return true;\n }\n if (menuTriggerEl === menuTriggerRef.current) return true;\n return false;\n });\n\n let overlay;\n if (isTray) {\n overlay = (\n <Tray\n ref={trayRef}\n isOpen={state.isOpen}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Tray>\n );\n } else {\n overlay = (\n <Popover\n ref={menuPopoverRef}\n hideArrow\n isNonModal\n isOpen={state.isOpen}\n // oxlint-disable-next-line tasty/no-style-prop -- React Aria's overlay positioning computes these coordinates\n style={positionProps.style}\n placement={placement ?? undefined}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Popover>\n );\n }\n\n return (\n <Fragment>\n <SlotProvider\n slots={{ actionButton: { holdAffordance: trigger === 'longPress' } }}\n >\n {!isDummy ? (\n <PressResponder\n {...menuTriggerProps}\n ref={menuTriggerRef}\n data-popover-trigger\n isPressed={state.isOpen}\n >\n {menuTrigger}\n </PressResponder>\n ) : null}\n </SlotProvider>\n <MenuContext.Provider value={menuContext}>{overlay}</MenuContext.Provider>\n </Fragment>\n );\n}\n\n/**\n * The MenuTrigger serves as a wrapper around a Menu and its associated trigger,\n * linking the Menu's open state with the trigger's press state.\n */\nlet _MenuTrigger = forward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;CAAA,OAAAA,MAAA3F,EAAA;CAAA,IAAA4F;CAAA,IAAA5F,EAAA,QAAAuF,OAAAvF,EAAA,QAAA2F,KAAA;EAZVC,MAAA,oBAAC,cAAD;GACS,OAAAL;GAENI,UAAAA;EAHU,CAAA;EAaE3F,EAAA,MAAAuF;EAAAvF,EAAA,MAAA2F;EAAA3F,EAAA,MAAA4F;CAAA,OAAAA,MAAA5F,EAAA;CAAA,IAAA6F;CAAA,IAAA7F,EAAA,QAAA4E,eAAA5E,EAAA,QAAA8F,WAAA;EACfD,MAAA,oBAAA,YAAA,UAAA;GAA6BjB,OAAAA;GAAcnB,UAAAA;EAAQ,CAAA;EAAuBzD,EAAA,MAAA4E;EAAA5E,EAAA,MAAA8F;EAAA9F,EAAA,MAAA6F;CAAA,OAAAA,MAAA7F,EAAA;CAAA,IAAA+F;CAAA,IAAA/F,EAAA,QAAA4F,OAAA5F,EAAA,QAAA6F,KAAA;EAf5EE,MAAA,qBAAC,UAAD,EAAA,UAAA,CACEH,KAcAC,GAfO,EAAA,CAAA;EAgBE7F,EAAA,MAAA4F;EAAA5F,EAAA,MAAA6F;EAAA7F,EAAA,MAAA+F;CAAA,OAAAA,MAAA/F,EAAA;CAAA,OAhBX+F;AAgBW;;;;;AAQf,IAAIC,eAAe9I,WAAW2C,WAAW;AAEzCmG,aAAaC,cAAc"}
1
+ {"version":3,"file":"MenuTrigger.js","names":["PressResponder","useObjectRef","useIsMobileDevice","forwardRef","Fragment","MutableRefObject","ReactElement","Ref","RefObject","useEffect","useMemo","useRef","AriaMenuTriggerProps","DismissButton","FocusScope","Placement","PositionProps","useMenuTrigger","MenuTriggerState","useMenuTriggerState","useEvent","generateRandomId","SlotProvider","useOverlayPosition","usePopoverSync","Popover","Tray","isOwnActionsPress","MenuContext","MenuContextValue","CubeMenuTriggerProps","Omit","isDisabled","defaultOpen","onOpenChange","isOpen","targetRef","HTMLElement","children","state","closeOnSelect","isDummy","shouldRestoreFocus","popoverRef","HTMLDivElement","mobileType","MenuTrigger","props","ref","$","_c","internalPopoverRef","menuPopoverRef","trayRef","triggerRef","domRef","menuTriggerRef","menuRef","wasOpenRef","shouldFlip","t0","trigger","t1","t2","t3","undefined","t4","Symbol","for","menuId","Array","isArray","length","Error","menuTrigger","menu","t5","close","t6","t7","onClose","enabled","containerRef","t8","menuTriggerProps","menuProps","initialPlacement","placement","isMobileDevice","isTray","t9","t10","offset","t11","crossOffset","t12","containerPadding","overlayRef","scrollRef","overlayProps","positionProps","t13","activeElement","document","body","isConnected","overlay","current","contains","hasFocusMovedOutsideMenu","t14","t15","setTimeout","focus","t16","focusStrategy","t17","t18","popover","tray","t19","t20","autoFocus","mods","isClosing","menuContext","t21","t22","t23","contents","t24","el","menuTriggerEl","closest","shouldCloseOnInteractOutside","t25","t26","style","actionButton","holdAffordance","t27","t28","t29","overlay_0","t30","_MenuTrigger","displayName","_c","useOverlayPosition","Tray","Popover"],"sources":["../../../../src/components/actions/Menu/MenuTrigger.tsx"],"sourcesContent":["import { PressResponder } from '@react-aria/interactions';\nimport { useObjectRef } from '@react-aria/utils';\nimport { useIsMobileDevice } from '@react-spectrum/utils';\nimport {\n forwardRef,\n Fragment,\n MutableRefObject,\n ReactElement,\n Ref,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n FocusScope,\n Placement,\n PositionProps,\n useMenuTrigger,\n} from 'react-aria';\nimport { MenuTriggerState, useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { generateRandomId } from '../../../utils/random';\nimport { SlotProvider } from '../../../utils/react/Slots';\nimport { useOverlayPosition } from '../../../utils/react/useOverlayPosition';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover } from '../../overlays/Modal/Popover';\nimport { Tray } from '../../overlays/Modal/Tray';\nimport { isOwnActionsPress } from '../actions-run';\n\nimport { MenuContext, MenuContextValue } from './context';\n\nexport type { AriaMenuTriggerProps };\n\nexport type CubeMenuTriggerProps = Omit<AriaMenuTriggerProps, 'children'> &\n PositionProps & {\n isDisabled?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n targetRef?: RefObject<HTMLElement | null>;\n children: [\n ReactElement | ((state: MenuTriggerState) => ReactElement),\n ReactElement,\n ];\n\n closeOnSelect?: boolean;\n isDummy?: boolean;\n /**\n * Whether focus returns to the trigger when the menu closes. Defaults to\n * `true`.\n *\n * The restore is skipped automatically whenever the action that closed the\n * menu has already moved focus somewhere else, so an item that opens a\n * panel/dialog/inline editor and focuses it needs nothing here. Pass\n * `false` for the remaining case: a surface that claims focus *later* than\n * the menu's own restore (after an async load, an entry animation, or a\n * `requestAnimationFrame`), where the trigger would otherwise take focus\n * first and produce a visible flash.\n */\n shouldRestoreFocus?: boolean;\n /**\n * External ref to the popover container element. When provided, it is\n * aliased to the internal `menuPopoverRef`, letting consumers (e.g.\n * `useAnchoredMenu` / `useContextMenu`) feed the popover container into\n * their own `usePopoverSync` so the nested-popover guard can recognize\n * submenus opened inside this menu. Optional.\n */\n popoverRef?: MutableRefObject<HTMLDivElement | null>;\n /**\n * Overlay variant to use on mobile screens. Defaults to `'popover'`, which\n * keeps the desktop overlay even on small viewports. Pass `'tray'` to opt\n * into the bottom-sheet `Tray` overlay on mobile (the previous implicit\n * default). Mirrors the `mobileType` API on `DialogTrigger`.\n */\n mobileType?: 'popover' | 'tray';\n };\n\nfunction MenuTrigger(props: CubeMenuTriggerProps, ref: Ref<HTMLElement>) {\n const internalPopoverRef = useRef<HTMLDivElement>(null);\n const menuPopoverRef = props.popoverRef ?? internalPopoverRef;\n const trayRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n const domRef = useObjectRef(ref);\n const menuTriggerRef = props.targetRef || domRef || triggerRef;\n const menuRef = useRef<HTMLUListElement>(null);\n const wasOpenRef = useRef(false);\n const {\n children,\n shouldFlip = true,\n closeOnSelect,\n trigger = 'press',\n isDisabled,\n isDummy,\n mobileType = 'popover',\n shouldRestoreFocus = true,\n } = props;\n\n // Generate a unique ID for this menu instance\n const menuId = useMemo(() => generateRandomId(), []);\n\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('MenuTrigger must have exactly 2 children');\n }\n\n let [menuTrigger, menu] = children;\n const state: MenuTriggerState = useMenuTriggerState(props);\n\n usePopoverSync({\n menuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n enabled: !isDummy,\n triggerRef: menuTriggerRef,\n containerRef: menuPopoverRef,\n });\n\n if (typeof menuTrigger === 'function') {\n menuTrigger = menuTrigger(state);\n }\n\n const { menuTriggerProps, menuProps } = useMenuTrigger(\n { isDisabled },\n state,\n menuTriggerRef,\n );\n\n let initialPlacement: Placement = props.placement ?? 'bottom start';\n\n // Tray rendering is now opt-in via `mobileType=\"tray\"` (matches DialogTrigger).\n // Without that opt-in, MenuTrigger always renders a Popover so that environments\n // like jsdom (where `window.screen.width === 0` makes useIsMobileDevice() true)\n // don't accidentally swap in the tray overlay.\n const isMobileDevice = useIsMobileDevice();\n const isTray = mobileType === 'tray' && isMobileDevice;\n const { overlayProps: positionProps, placement } = useOverlayPosition({\n targetRef: menuTriggerRef,\n overlayRef: menuPopoverRef,\n scrollRef: menuRef,\n placement: initialPlacement,\n shouldFlip: shouldFlip,\n isOpen: state.isOpen && !isTray,\n onClose: state.close,\n containerPadding: props.containerPadding,\n offset: props.offset ?? 8,\n crossOffset: props.crossOffset ?? 0,\n });\n\n // Whether focus has been claimed by something outside the closing menu —\n // the signal that a menu action handed focus off and the trigger must not\n // take it back.\n //\n // Focus still inside the menu overlay means nobody claimed it: the pressed\n // item keeps focus while the popover plays its ~350ms exit animation. Focus\n // on `<body>` (or on a detached element) means the focused node went away\n // with the menu. Both are cases where the trigger is where focus belongs.\n const hasFocusMovedOutsideMenu = useEvent(() => {\n const activeElement = document.activeElement;\n\n if (!activeElement || activeElement === document.body) return false;\n if (!activeElement.isConnected) return false;\n\n // `menuPopoverRef` is only wired to the `Popover` branch, so the overlay\n // container is `trayRef` when `mobileType=\"tray\"` is in effect.\n const overlay = isTray ? trayRef.current : menuPopoverRef.current;\n\n return !(\n overlay?.contains(activeElement) ||\n menuRef.current?.contains(activeElement) ||\n menuTriggerRef.current?.contains(activeElement)\n );\n });\n\n // Restore focus manually when the menu closes\n useEffect(() => {\n if (!state.isOpen && wasOpenRef.current && !isDummy) {\n wasOpenRef.current = false;\n\n if (!shouldRestoreFocus) return;\n\n // Use setTimeout to ensure focus restoration happens after any animations\n setTimeout(() => {\n // An action that opened a panel, a dialog or an inline editor has\n // already focused it by now — taking focus back to the trigger would\n // undo the hand-off, which consumers previously had to out-race by\n // re-focusing on every animation frame (CUB-3962).\n if (hasFocusMovedOutsideMenu()) return;\n\n menuTriggerRef.current?.focus();\n }, 0);\n } else if (state.isOpen) {\n wasOpenRef.current = true;\n }\n }, [\n state.isOpen,\n menuTriggerRef,\n isDummy,\n shouldRestoreFocus,\n hasFocusMovedOutsideMenu,\n ]);\n\n const menuContext = {\n ...menuProps,\n ref: menuRef,\n onClose: state.close,\n closeOnSelect,\n autoFocus: (state.focusStrategy as any) ?? 'first',\n mods: {\n popover: !isTray,\n tray: isTray,\n },\n isClosing: !state.isOpen,\n } as MenuContextValue;\n\n // Wrap in a FocusScope so the menu popover registers as a child of any\n // outer contained FocusScope (e.g. a parent Dialog/Popover). Without this,\n // when the menu opens inside an outer contained FocusScope, the outer\n // scope rejects focus moving into the menu items (which live in a portal\n // and would otherwise belong to no scope) and yanks focus back to the\n // menu trigger.\n //\n // `restoreFocus` follows `shouldRestoreFocus`, so opting out silences the\n // scope's own unmount restore too. Scope registration (and therefore the\n // guarantee above) is unaffected — `FocusScope` joins the tree and tracks\n // the active scope regardless of `restoreFocus`.\n const contents = (\n <FocusScope restoreFocus={shouldRestoreFocus}>\n <DismissButton onDismiss={state.close} />\n {menu}\n <DismissButton onDismiss={state.close} />\n </FocusScope>\n );\n\n // Shared between the Popover and Tray branches so both react-aria\n // `useOverlay` calls see the same predicate. Without this, the Tray branch\n // falls back to unconditional dismiss-on-outside-interaction, which\n // `useOverlay` translates into stopPropagation/preventDefault in the\n // capture phase — that swallows clicks on sibling triggers (see Menu\n // rapid-open test).\n //\n // `useEvent` gives us a single stable callback reference for the lifetime\n // of the component while always reading the latest closure values. This\n // matters because `useMenuTriggerState` returns a fresh `state` object on\n // every render, so a vanilla `useCallback([..., state])` would produce a\n // new function every render and defeat any stability guarantees consumers\n // rely on.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n // While `Popover` is animating out, `useInteractOutside`'s capture-phase\n // listener is still attached (jsdom 29+ uses pointerdown/click capture).\n // The animation lasts ~350ms; without this guard, clicks on a sibling\n // trigger during the exit window get stopPropagation()'d and the\n // sibling's `onClick` never runs — breaking rapid-open and \"open menu\n // again with new props\" flows. Reading `state.isOpen` directly is safe\n // because `useEvent` always sees the latest closure.\n if (!state.isOpen) return false;\n\n // A press on our OWN trigger's actions run — an `ItemButton` row's\n // `actions` — is not a press outside. The run is rendered as a sibling of\n // the trigger (see `ItemActionsWrapper`), so the checks below cannot\n // recognise it and we closed instead, which cost the action its press: the\n // first press on it while the menu was open only closed the menu.\n if (isOwnActionsPress(el, menuTriggerRef.current)) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n // Plain interactive controls (Button, ItemButton) opt in via\n // `data-popover-dismiss`. We schedule the close via setTimeout(0) so\n // it lands AFTER the click event finishes — the button's onPress\n // fires first, then the popover closes. Without this, useOverlay\n // would stopPropagation() the click and the user would need a second\n // click to actually press the button.\n if (el.closest('[data-popover-dismiss]')) {\n setTimeout(() => state.close(), 0);\n return false;\n }\n return true;\n }\n if (\n isDummy &&\n (menuTriggerEl === menuTriggerRef.current ||\n menuTriggerRef.current?.contains(el))\n ) {\n return true;\n }\n if (menuTriggerEl === menuTriggerRef.current) return true;\n return false;\n });\n\n let overlay;\n if (isTray) {\n overlay = (\n <Tray\n ref={trayRef}\n isOpen={state.isOpen}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Tray>\n );\n } else {\n overlay = (\n <Popover\n ref={menuPopoverRef}\n hideArrow\n isNonModal\n isOpen={state.isOpen}\n // oxlint-disable-next-line tasty/no-style-prop -- React Aria's overlay positioning computes these coordinates\n style={positionProps.style}\n placement={placement ?? undefined}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Popover>\n );\n }\n\n return (\n <Fragment>\n <SlotProvider\n slots={{ actionButton: { holdAffordance: trigger === 'longPress' } }}\n >\n {!isDummy ? (\n <PressResponder\n {...menuTriggerProps}\n ref={menuTriggerRef}\n data-popover-trigger\n isPressed={state.isOpen}\n >\n {menuTrigger}\n </PressResponder>\n ) : null}\n </SlotProvider>\n <MenuContext.Provider value={menuContext}>{overlay}</MenuContext.Provider>\n </Fragment>\n );\n}\n\n/**\n * The MenuTrigger serves as a wrapper around a Menu and its associated trigger,\n * linking the Menu's open state with the trigger's press state.\n */\nlet _MenuTrigger = forwardRef(MenuTrigger);\n\n_MenuTrigger.displayName = 'MenuTrigger';\n\nexport { _MenuTrigger as MenuTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgFA,SAAA8C,YAAAC,OAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACE,MAAAC,qBAA2BxC,OAAuB,IAAI;CACtD,MAAAyC,iBAAuBL,MAAKJ,cAALQ;CACvB,MAAAE,UAAgB1C,OAAoB,IAAI;CACxC,MAAA2C,aAAmB3C,OAAoB,IAAI;CAC3C,MAAA4C,SAAetD,aAAa+C,GAAG;CAC/B,MAAAQ,iBAAuBT,MAAKX,aAALmB,UAAAD;CACvB,MAAAG,UAAgB9C,OAAyB,IAAI;CAC7C,MAAA+C,aAAmB/C,OAAO,KAAK;CAC/B,MAAA,EAAA2B,UAAAqB,YAAAC,IAAAp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A,IAAA/F,EAAA,QAAA4F,OAAA5F,EAAA,QAAA6F,KAAA;EAf5EE,MAAA,qBAAC,UAAD,EAAA,UAAA,CACEH,KAcAC,GAfO,EAAA,CAAA;EAgBE7F,EAAA,MAAA4F;EAAA5F,EAAA,MAAA6F;EAAA7F,EAAA,MAAA+F;CAAA,OAAAA,MAAA/F,EAAA;CAAA,OAhBX+F;AAgBW;;;;;AAQf,IAAIC,eAAe9I,WAAW2C,WAAW;AAEzCmG,aAAaC,cAAc"}
@@ -1,14 +1,15 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import { useEvent } from "../../../_internal/hooks/use-event.js";
3
3
  import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
4
4
  import { MenuContext, useMenuContext } from "./context.js";
5
5
  import { SubmenuTriggerContext } from "./SubmenuTriggerContext.js";
6
6
  import { generateRandomId } from "../../../utils/random.js";
7
+ import { useOverlayPosition as useOverlayPosition$1 } from "../../../utils/react/useOverlayPosition.js";
7
8
  import { Popover as _Popover } from "../../overlays/Modal/Popover.js";
8
9
  import { tasty } from "@tenphi/tasty";
9
10
  import React, { useEffect, useMemo, useRef } from "react";
10
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- import { DismissButton, useMenuTrigger, useOverlayPosition } from "react-aria";
12
+ import { DismissButton, useMenuTrigger } from "react-aria";
12
13
  import { useMenuTriggerState } from "react-stately";
13
14
  import { useSyncRef } from "@react-aria/utils";
14
15
  //#region src/components/actions/Menu/SubMenuTrigger.tsx
@@ -41,7 +42,7 @@ function InternalSubMenuTrigger(props) {
41
42
  }, state, domTriggerRef);
42
43
  const parentContext = useMenuContext();
43
44
  const { onKeyDown: _mtOnKeyDown, onPress: _mtOnPress, onPressStart: _mtOnPressStart, onKeyUp: _mtOnKeyUp, ...menuTriggerProps } = rawTriggerProps;
44
- const { overlayProps: positionProps, placement: resolvedPlacement } = useOverlayPosition({
45
+ const { overlayProps: positionProps, placement: resolvedPlacement } = useOverlayPosition$1({
45
46
  targetRef: domTriggerRef,
46
47
  overlayRef: popoverRef,
47
48
  scrollRef: menuRef,
@@ -1 +1 @@
1
- {"version":3,"file":"SubMenuTrigger.js","names":["useSyncRef","tasty","React","Key","ReactElement","ReactNode","useEffect","useMemo","useRef","useState","AriaMenuTriggerProps","DismissButton","Placement","useMenuTrigger","useOverlayPosition","useMenuTriggerState","useEvent","generateRandomId","usePopoverSync","Popover","MenuContext","MenuContextValue","useMenuContext","SubmenuTriggerContext","DEFAULT_PLACEMENT","DEFAULT_OFFSET","DEFAULT_CROSS_OFFSET","PointerAreaElement","styles","display","CubeSubMenuTriggerProps","placement","offset","crossOffset","shouldFlip","containerPadding","children","isDisabled","onAction","key","autoFocus","InternalSubMenuTriggerProps","targetKey","InternalSubMenuTrigger","props","overlayProps","menuTrigger","menu","Children","toArray","state","submenuId","domTriggerRef","HTMLElement","popoverRef","HTMLDivElement","menuRef","HTMLUListElement","menuId","isOpen","onClose","close","triggerRef","containerRef","menuTriggerProps","rawTriggerProps","menuProps","type","parentContext","onKeyDown","_mtOnKeyDown","onPress","_mtOnPress","onPressStart","_mtOnPressStart","onKeyUp","_mtOnKeyUp","positionProps","resolvedPlacement","targetRef","overlayRef","scrollRef","nestedMenuContext","ctx","ref","closeOnSelect","mods","popover","isClosing","hoverOpenTimerRef","current","clearTimeout","hoverCloseTimerRef","isHoveringRef","isHoveringSubmenuRef","handleKeyDown","e","KeyboardEvent","preventDefault","stopPropagation","open","nativeEvent","stopImmediatePropagation","ReturnType","setTimeout","checkShouldClose","handleMouseEnter","handleMouseLeave","handlePopoverMouseEnter","handlePopoverMouseLeave","mergeHandler","handler1","handler2","args","shouldCloseOnInteractOutside","el","Element","menuTriggerEl","closest","triggerContextValue","triggerProps","onMouseEnter","onMouseLeave","undefined","style","cloneElement","querySelector","focus","SubMenuTrigger","getCollectionNode","trigger","element","wrapper","displayName","Popover"],"sources":["../../../../src/components/actions/Menu/SubMenuTrigger.tsx"],"sourcesContent":["import { useSyncRef } from '@react-aria/utils';\nimport { tasty } from '@tenphi/tasty';\nimport React, {\n Key,\n ReactElement,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n Placement,\n useMenuTrigger,\n useOverlayPosition,\n} from 'react-aria';\nimport { useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { generateRandomId } from '../../../utils/random';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover } from '../../overlays/Modal/Popover';\n\nimport { MenuContext, MenuContextValue, useMenuContext } from './context';\nimport { SubmenuTriggerContext } from './SubmenuTriggerContext';\n\n// Default placement & offset for sub-menus (matches Spectrum / Aria)\nconst DEFAULT_PLACEMENT: Placement = 'right top';\nconst DEFAULT_OFFSET = 4;\nconst DEFAULT_CROSS_OFFSET = -5;\n\n// Takes no box of its own: it only listens for the pointer entering and\n// leaving the sub-menu.\nconst PointerAreaElement = tasty({ styles: { display: 'contents' } });\n\nexport interface CubeSubMenuTriggerProps extends AriaMenuTriggerProps {\n /** The preferred placement of the sub-menu relative to the trigger */\n placement?: Placement;\n\n /** Distance in pixels between the trigger and sub-menu */\n offset?: number;\n\n /** Distance in pixels along the cross axis from the default alignment */\n crossOffset?: number;\n\n /** Whether the sub-menu should flip to the opposite side when it would overflow */\n shouldFlip?: boolean;\n\n /** Minimum padding in pixels between the sub-menu and viewport edges */\n containerPadding?: number;\n\n /**\n * Sub-menu trigger and the sub-menu itself. Must be exactly two React nodes.\n *\n * 1) Trigger – a `Menu.Item` with its semantic menuitem inside a list row.\n * 2) Sub-menu – a `<Menu>` element.\n */\n children: [ReactNode, ReactElement];\n\n /** Whether the trigger is disabled and cannot be activated */\n isDisabled?: boolean;\n\n /**\n * Callback fired when an action is selected from the sub-menu.\n * Bubbles the `onAction` event from the sub-menu to parent components.\n */\n onAction?: (key: Key) => void;\n\n /**\n * Controls focus behavior when the sub-menu opens.\n * - `true` or `'first'`: Focus the first item\n * - `'last'`: Focus the last item\n * - `false`: Don't auto-focus any item\n * @default 'first'\n */\n autoFocus?: boolean | 'first' | 'last';\n}\n\ninterface InternalSubMenuTriggerProps extends CubeSubMenuTriggerProps {\n targetKey?: Key;\n}\n\n/**\n * Internal SubMenuTrigger that receives the already-rendered trigger element\n * from the collection system and wraps it with submenu behavior.\n */\nfunction InternalSubMenuTrigger(props: InternalSubMenuTriggerProps) {\n const {\n children,\n placement = DEFAULT_PLACEMENT,\n offset = DEFAULT_OFFSET,\n crossOffset = DEFAULT_CROSS_OFFSET,\n shouldFlip = true,\n isDisabled,\n autoFocus = 'first',\n onAction,\n targetKey,\n ...overlayProps\n } = props;\n\n // Children: [menuTrigger (already rendered MenuItem), menu (Menu component)]\n const [menuTrigger, menu] = React.Children.toArray(children) as [\n ReactElement,\n ReactElement,\n ];\n\n const state = useMenuTriggerState(props as AriaMenuTriggerProps);\n\n // Generate a unique ID for this submenu instance\n const submenuId = useMemo(() => generateRandomId(), []);\n\n // Refs – trigger (MenuItem <li>) and overlay (<div> from Popover)\n const domTriggerRef = useRef<HTMLElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLUListElement>(null);\n\n usePopoverSync({\n menuId: submenuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n triggerRef: domTriggerRef,\n containerRef: popoverRef,\n });\n\n // Strip keyboard/press handlers that we will implement ourselves\n const { menuTriggerProps: rawTriggerProps, menuProps } = useMenuTrigger(\n { type: 'menu', isDisabled },\n state,\n domTriggerRef,\n );\n\n // Get parent context to check if parent menu is closing\n const parentContext = useMenuContext();\n\n // Remove default onKeyDown/onPress handlers from trigger props – we implement custom ones\n const {\n onKeyDown: _mtOnKeyDown,\n onPress: _mtOnPress,\n onPressStart: _mtOnPressStart,\n onKeyUp: _mtOnKeyUp,\n ...menuTriggerProps\n } = rawTriggerProps;\n\n const { overlayProps: positionProps, placement: resolvedPlacement } =\n useOverlayPosition({\n targetRef: domTriggerRef,\n overlayRef: popoverRef,\n scrollRef: menuRef,\n placement,\n offset: offset as number,\n crossOffset: crossOffset as number,\n shouldFlip,\n isOpen: state.isOpen,\n onClose: state.close,\n });\n\n /**\n * Build a MenuContext for the nested menu so it behaves just like a regular\n * popover-based Menu (selection handling, focus management, etc.).\n */\n const nestedMenuContext = useMemo(() => {\n const ctx: MenuContextValue = {\n ...menuProps,\n ref: menuRef,\n // Pass the parent's onClose to close the entire menu hierarchy\n onClose: () => {\n // Close this submenu state immediately\n state.close();\n\n // Then close the parent menu\n if (parentContext.onClose) {\n parentContext.onClose();\n }\n },\n closeOnSelect: true,\n autoFocus,\n mods: {\n popover: true,\n },\n // Propagate closing state from parent\n isClosing: parentContext.isClosing || !state.isOpen,\n };\n\n return ctx;\n }, [\n menuProps,\n autoFocus,\n state,\n parentContext.onClose,\n parentContext.isClosing,\n ]);\n\n // Sync the parent selection manager focus with DOM ref (for virtual focus scenarios)\n useSyncRef(parentContext, domTriggerRef);\n\n // Cleanup hover timers and reset refs on unmount\n useEffect(() => {\n return () => {\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n }\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n }\n isHoveringRef.current = false;\n isHoveringSubmenuRef.current = false;\n };\n }, []);\n\n // ----- Render -----\n\n // Handle keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (isDisabled) return;\n\n // Arrow right opens submenu\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n e.stopPropagation();\n state.open();\n }\n // Enter or Space opens submenu. Preventing the default keeps `MenuItem`\n // from passing the key on to React Aria's item handler, which would click\n // the item and run its action as well.\n else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n // Stop immediate propagation to prevent React Aria's handlers from running\n e.nativeEvent.stopImmediatePropagation();\n state.open();\n }\n // Arrow left closes submenu if open\n else if (e.key === 'ArrowLeft' && state.isOpen) {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n }\n };\n\n // Use refs to store timer IDs\n const hoverOpenTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hoverCloseTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Track if mouse is over trigger or submenu\n const isHoveringRef = useRef(false);\n const isHoveringSubmenuRef = useRef(false);\n\n const checkShouldClose = () => {\n // Only close if mouse is not over trigger OR submenu\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n hoverCloseTimerRef.current = setTimeout(() => {\n // Double check before closing\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n state.close();\n }\n }, 300);\n }\n };\n\n // Handle mouse interactions on trigger\n const handleMouseEnter = () => {\n if (isDisabled) return;\n\n isHoveringRef.current = true;\n\n // Clear any pending close timer\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n\n // Use a small delay to prevent accidental opens\n if (!state.isOpen) {\n hoverOpenTimerRef.current = setTimeout(() => {\n if (isHoveringRef.current) {\n state.open();\n }\n }, 200);\n }\n };\n\n const handleMouseLeave = () => {\n isHoveringRef.current = false;\n\n // Clear open timer if it exists\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n hoverOpenTimerRef.current = null;\n }\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Handle mouse events on the submenu popover\n const handlePopoverMouseEnter = () => {\n isHoveringSubmenuRef.current = true;\n\n // Clear any pending close timer when entering submenu\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n };\n\n const handlePopoverMouseLeave = () => {\n isHoveringSubmenuRef.current = false;\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Merge event handlers\n const mergeHandler = (handler1: any, handler2: any) => {\n return (...args: any[]) => {\n handler1?.(...args);\n handler2?.(...args);\n };\n };\n\n // Outside-click handling for the nested submenu Popover.\n //\n // React Aria's `useOverlay` keeps a module-level `visibleOverlays` stack and\n // only invokes `onClose` for the topmost overlay (`onHide` gates on the\n // stack tail). With root + N nested submenus open, a single outside click\n // would otherwise only close the deepest submenu. Scheduling\n // `parentContext.onClose()` here propagates the close upward; the existing\n // `parentContext.isClosing` cascade (see `nestedMenuContext.isClosing` and\n // the Popover's `isOpen={!parentContext.isClosing}`) collapses every\n // intermediate submenu visually.\n //\n // Mirrors `MenuTrigger`'s predicate so clicks on `[data-popover-trigger]`\n // and `[data-popover-dismiss]` elements behave consistently across nesting\n // levels.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n if (!state.isOpen) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n if (el.closest('[data-popover-dismiss]')) {\n // Let the button's onPress fire first, then collapse the chain.\n setTimeout(() => parentContext.onClose?.(), 0);\n return false;\n }\n // True outside click: schedule parent close so the entire hierarchy\n // cascades. `useOverlay`'s own `onHide` will close this submenu via the\n // topmost-overlay rule.\n setTimeout(() => parentContext.onClose?.(), 0);\n return true;\n }\n // Click landed on a popover trigger (parent menu item, sibling submenu\n // trigger, or a different menu's button). Don't close ourselves here —\n // either the trigger handles it or `usePopoverSync` closes us via\n // `popover:open`.\n return false;\n });\n\n // Provide context to the trigger element (already rendered MenuItem)\n const triggerContextValue = useMemo(\n () => ({\n triggerRef: domTriggerRef,\n triggerProps: menuTriggerProps,\n isOpen: state.isOpen,\n isDisabled,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n onAction: isDisabled\n ? undefined\n : () => {\n // A pointer press: Enter and Space open the submenu in\n // `handleKeyDown` and never reach the item's action.\n state.open();\n },\n }),\n [\n state,\n isDisabled,\n handleMouseEnter,\n handleMouseLeave,\n handleKeyDown,\n menuTriggerProps,\n ],\n );\n\n return (\n <>\n <SubmenuTriggerContext.Provider value={triggerContextValue}>\n {menuTrigger}\n </SubmenuTriggerContext.Provider>\n {state.isOpen && (\n <Popover\n ref={popoverRef}\n hideArrow\n isNonModal\n isOpen={!parentContext.isClosing}\n // oxlint-disable-next-line tasty/no-style-prop -- React Aria's overlay positioning computes these coordinates\n style={positionProps.style}\n placement={resolvedPlacement ?? undefined}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n // Spread any additional overlay props\n {...overlayProps}\n >\n {/* Wrap content in a div to capture mouse events */}\n <PointerAreaElement\n onMouseEnter={handlePopoverMouseEnter}\n onMouseLeave={handlePopoverMouseLeave}\n >\n {/* Dismiss buttons for screen reader / keyboard support */}\n <DismissButton onDismiss={state.close} />\n {/* Provide updated menu context so nested menu behaves correctly */}\n <MenuContext.Provider value={nestedMenuContext}>\n {/* Clone nested menu to inject required props */}\n {React.cloneElement(menu, {\n ...(menu.props as any),\n autoFocus,\n onAction: (key: Key) => {\n // Call original menu onAction first\n (menu.props as any).onAction?.(key);\n onAction?.(key);\n // Don't close here - MenuItem will handle it via context.onClose\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n // Handle keyboard navigation for closing submenu\n if (e.key === 'ArrowLeft' || e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n // Return focus to trigger\n (\n domTriggerRef.current?.querySelector<HTMLElement>(\n '[data-menu-native-primary]',\n ) ?? domTriggerRef.current\n )?.focus();\n }\n // Call original handler if exists\n (menu.props as any).onKeyDown?.(e);\n },\n ref: menuRef,\n })}\n </MenuContext.Provider>\n <DismissButton onDismiss={state.close} />\n </PointerAreaElement>\n </Popover>\n )}\n </>\n );\n}\n\n/**\n * Public SubMenuTrigger component that users interact with.\n * It just provides the getCollectionNode for the collection system.\n */\nexport function SubMenuTrigger(props: CubeSubMenuTriggerProps) {\n // This component is never actually rendered directly.\n // The collection system uses getCollectionNode to build the menu.\n return null;\n}\n\n// Allow React Stately collection builder to treat SubMenuTrigger as an Item\n(SubMenuTrigger as any).getCollectionNode = function* (\n props: CubeSubMenuTriggerProps,\n) {\n const [trigger, menu] = React.Children.toArray(\n props.children,\n ) as ReactElement[];\n\n // Yield a collection node that tells the Menu to wrap this item with InternalSubMenuTrigger\n yield {\n element: trigger,\n wrapper: (element: ReactElement) => (\n <InternalSubMenuTrigger\n key={element.key || undefined}\n targetKey={element.key || undefined}\n {...props}\n >\n {element}\n {menu}\n </InternalSubMenuTrigger>\n ),\n };\n};\n\nSubMenuTrigger.displayName = 'SubMenuTrigger';\n"],"mappings":";;;;;;;;;;;;;;AA6BA,MAAMwB,oBAA+B;AACrC,MAAMC,iBAAiB;AACvB,MAAMC,uBAAuB;AAI7B,MAAMC,qBAAqB1B,MAAM,EAAE2B,QAAQ,EAAEC,SAAS,WAAW,EAAE,CAAC;;;;;AAqDpE,SAASc,uBAAuBC,OAAoC;CAClE,MAAM,EACJR,UACAL,YAAYP,mBACZQ,SAASP,gBACTQ,cAAcP,sBACdQ,aAAa,MACbG,YACAG,YAAY,SACZF,UACAI,WACA,GAAGG,iBACDD;CAGJ,MAAM,CAACE,aAAaC,QAAQ7C,MAAM8C,SAASC,QAAQb,QAAQ;CAK3D,MAAMc,QAAQnC,oBAAoB6B,KAA6B;CAG/D,MAAMO,YAAY5C,cAAcU,iBAAiB,GAAG,CAAA,CAAE;CAGtD,MAAMmC,gBAAgB5C,OAAoB,IAAI;CAC9C,MAAM8C,aAAa9C,OAAuB,IAAI;CAC9C,MAAMgD,UAAUhD,OAAyB,IAAI;CAE7CU,eAAe;EACbwC,QAAQP;EACRQ,QAAQT,MAAMS;EACdC,eAAeV,MAAMW,MAAM;EAC3BC,YAAYV;EACZW,cAAcT;CAChB,CAAC;CAGD,MAAM,EAAEU,kBAAkBC,iBAAiBC,cAAcrD,eACvD;EAAEsD,MAAM;EAAQ9B;CAAW,GAC3Ba,OACAE,aACF;CAGA,MAAMgB,gBAAgB9C,eAAe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BAAgB;QAClBjD,MAAMW,MAAM;QAEZ,CACET,cAAcsC,SAASoC,cACrB,4BACF,KAAK1E,cAAcsC,QAAAA,EAClBqC,MAAM;OACX;OAEA,KAAMnF,MAAcyB,YAAY2B,GAAC;MACnC;MACAZ,KAAK5B;KACP,CAAC;IACmB,CAAA;IACtB,oBAAC,eAAD,EAAe,WAAWN,MAAMW,MAAM,CAAA;GACpB;;CACb,CAAA,CAEb,EAAA,CAAA;AAEJ;;;;;AAMA,SAAgBmE,eAAepF,OAAgC;CAG7D,OAAO;AACT;AAGA,eAAwBqF,oBAAoB,WAC1CrF,OACA;CACA,MAAM,CAACsF,SAASnF,QAAQ7C,MAAM8C,SAASC,QACrCL,MAAMR,QACR;CAGA,MAAM;EACJ+F,SAASD;EACTE,UAAUD,YACR,qBAAC,wBAAD;GAEE,WAAWA,QAAQ5F,OAAOoF,KAAAA;GAC1B,GAAI/E;GAHN,UAAA,CAKGuF,SACApF,IACqB;EANjBoF,GAAAA,QAAQ5F,OAAOoF,KAAAA,CAME;CAE5B;AACF;AAEAK,eAAeK,cAAc"}
1
+ {"version":3,"file":"SubMenuTrigger.js","names":["useSyncRef","tasty","React","Key","ReactElement","ReactNode","useEffect","useMemo","useRef","useState","AriaMenuTriggerProps","DismissButton","Placement","useMenuTrigger","useMenuTriggerState","useEvent","generateRandomId","useOverlayPosition","usePopoverSync","Popover","MenuContext","MenuContextValue","useMenuContext","SubmenuTriggerContext","DEFAULT_PLACEMENT","DEFAULT_OFFSET","DEFAULT_CROSS_OFFSET","PointerAreaElement","styles","display","CubeSubMenuTriggerProps","placement","offset","crossOffset","shouldFlip","containerPadding","children","isDisabled","onAction","key","autoFocus","InternalSubMenuTriggerProps","targetKey","InternalSubMenuTrigger","props","overlayProps","menuTrigger","menu","Children","toArray","state","submenuId","domTriggerRef","HTMLElement","popoverRef","HTMLDivElement","menuRef","HTMLUListElement","menuId","isOpen","onClose","close","triggerRef","containerRef","menuTriggerProps","rawTriggerProps","menuProps","type","parentContext","onKeyDown","_mtOnKeyDown","onPress","_mtOnPress","onPressStart","_mtOnPressStart","onKeyUp","_mtOnKeyUp","positionProps","resolvedPlacement","targetRef","overlayRef","scrollRef","nestedMenuContext","ctx","ref","closeOnSelect","mods","popover","isClosing","hoverOpenTimerRef","current","clearTimeout","hoverCloseTimerRef","isHoveringRef","isHoveringSubmenuRef","handleKeyDown","e","KeyboardEvent","preventDefault","stopPropagation","open","nativeEvent","stopImmediatePropagation","ReturnType","setTimeout","checkShouldClose","handleMouseEnter","handleMouseLeave","handlePopoverMouseEnter","handlePopoverMouseLeave","mergeHandler","handler1","handler2","args","shouldCloseOnInteractOutside","el","Element","menuTriggerEl","closest","triggerContextValue","triggerProps","onMouseEnter","onMouseLeave","undefined","style","cloneElement","querySelector","focus","SubMenuTrigger","getCollectionNode","trigger","element","wrapper","displayName","useOverlayPosition","Popover"],"sources":["../../../../src/components/actions/Menu/SubMenuTrigger.tsx"],"sourcesContent":["import { useSyncRef } from '@react-aria/utils';\nimport { tasty } from '@tenphi/tasty';\nimport React, {\n Key,\n ReactElement,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n Placement,\n useMenuTrigger,\n} from 'react-aria';\nimport { useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { generateRandomId } from '../../../utils/random';\nimport { useOverlayPosition } from '../../../utils/react/useOverlayPosition';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover } from '../../overlays/Modal/Popover';\n\nimport { MenuContext, MenuContextValue, useMenuContext } from './context';\nimport { SubmenuTriggerContext } from './SubmenuTriggerContext';\n\n// Default placement & offset for sub-menus (matches Spectrum / Aria)\nconst DEFAULT_PLACEMENT: Placement = 'right top';\nconst DEFAULT_OFFSET = 4;\nconst DEFAULT_CROSS_OFFSET = -5;\n\n// Takes no box of its own: it only listens for the pointer entering and\n// leaving the sub-menu.\nconst PointerAreaElement = tasty({ styles: { display: 'contents' } });\n\nexport interface CubeSubMenuTriggerProps extends AriaMenuTriggerProps {\n /** The preferred placement of the sub-menu relative to the trigger */\n placement?: Placement;\n\n /** Distance in pixels between the trigger and sub-menu */\n offset?: number;\n\n /** Distance in pixels along the cross axis from the default alignment */\n crossOffset?: number;\n\n /** Whether the sub-menu should flip to the opposite side when it would overflow */\n shouldFlip?: boolean;\n\n /** Minimum padding in pixels between the sub-menu and viewport edges */\n containerPadding?: number;\n\n /**\n * Sub-menu trigger and the sub-menu itself. Must be exactly two React nodes.\n *\n * 1) Trigger – a `Menu.Item` with its semantic menuitem inside a list row.\n * 2) Sub-menu – a `<Menu>` element.\n */\n children: [ReactNode, ReactElement];\n\n /** Whether the trigger is disabled and cannot be activated */\n isDisabled?: boolean;\n\n /**\n * Callback fired when an action is selected from the sub-menu.\n * Bubbles the `onAction` event from the sub-menu to parent components.\n */\n onAction?: (key: Key) => void;\n\n /**\n * Controls focus behavior when the sub-menu opens.\n * - `true` or `'first'`: Focus the first item\n * - `'last'`: Focus the last item\n * - `false`: Don't auto-focus any item\n * @default 'first'\n */\n autoFocus?: boolean | 'first' | 'last';\n}\n\ninterface InternalSubMenuTriggerProps extends CubeSubMenuTriggerProps {\n targetKey?: Key;\n}\n\n/**\n * Internal SubMenuTrigger that receives the already-rendered trigger element\n * from the collection system and wraps it with submenu behavior.\n */\nfunction InternalSubMenuTrigger(props: InternalSubMenuTriggerProps) {\n const {\n children,\n placement = DEFAULT_PLACEMENT,\n offset = DEFAULT_OFFSET,\n crossOffset = DEFAULT_CROSS_OFFSET,\n shouldFlip = true,\n isDisabled,\n autoFocus = 'first',\n onAction,\n targetKey,\n ...overlayProps\n } = props;\n\n // Children: [menuTrigger (already rendered MenuItem), menu (Menu component)]\n const [menuTrigger, menu] = React.Children.toArray(children) as [\n ReactElement,\n ReactElement,\n ];\n\n const state = useMenuTriggerState(props as AriaMenuTriggerProps);\n\n // Generate a unique ID for this submenu instance\n const submenuId = useMemo(() => generateRandomId(), []);\n\n // Refs – trigger (MenuItem <li>) and overlay (<div> from Popover)\n const domTriggerRef = useRef<HTMLElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLUListElement>(null);\n\n usePopoverSync({\n menuId: submenuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n triggerRef: domTriggerRef,\n containerRef: popoverRef,\n });\n\n // Strip keyboard/press handlers that we will implement ourselves\n const { menuTriggerProps: rawTriggerProps, menuProps } = useMenuTrigger(\n { type: 'menu', isDisabled },\n state,\n domTriggerRef,\n );\n\n // Get parent context to check if parent menu is closing\n const parentContext = useMenuContext();\n\n // Remove default onKeyDown/onPress handlers from trigger props – we implement custom ones\n const {\n onKeyDown: _mtOnKeyDown,\n onPress: _mtOnPress,\n onPressStart: _mtOnPressStart,\n onKeyUp: _mtOnKeyUp,\n ...menuTriggerProps\n } = rawTriggerProps;\n\n const { overlayProps: positionProps, placement: resolvedPlacement } =\n useOverlayPosition({\n targetRef: domTriggerRef,\n overlayRef: popoverRef,\n scrollRef: menuRef,\n placement,\n offset: offset as number,\n crossOffset: crossOffset as number,\n shouldFlip,\n isOpen: state.isOpen,\n onClose: state.close,\n });\n\n /**\n * Build a MenuContext for the nested menu so it behaves just like a regular\n * popover-based Menu (selection handling, focus management, etc.).\n */\n const nestedMenuContext = useMemo(() => {\n const ctx: MenuContextValue = {\n ...menuProps,\n ref: menuRef,\n // Pass the parent's onClose to close the entire menu hierarchy\n onClose: () => {\n // Close this submenu state immediately\n state.close();\n\n // Then close the parent menu\n if (parentContext.onClose) {\n parentContext.onClose();\n }\n },\n closeOnSelect: true,\n autoFocus,\n mods: {\n popover: true,\n },\n // Propagate closing state from parent\n isClosing: parentContext.isClosing || !state.isOpen,\n };\n\n return ctx;\n }, [\n menuProps,\n autoFocus,\n state,\n parentContext.onClose,\n parentContext.isClosing,\n ]);\n\n // Sync the parent selection manager focus with DOM ref (for virtual focus scenarios)\n useSyncRef(parentContext, domTriggerRef);\n\n // Cleanup hover timers and reset refs on unmount\n useEffect(() => {\n return () => {\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n }\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n }\n isHoveringRef.current = false;\n isHoveringSubmenuRef.current = false;\n };\n }, []);\n\n // ----- Render -----\n\n // Handle keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (isDisabled) return;\n\n // Arrow right opens submenu\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n e.stopPropagation();\n state.open();\n }\n // Enter or Space opens submenu. Preventing the default keeps `MenuItem`\n // from passing the key on to React Aria's item handler, which would click\n // the item and run its action as well.\n else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n // Stop immediate propagation to prevent React Aria's handlers from running\n e.nativeEvent.stopImmediatePropagation();\n state.open();\n }\n // Arrow left closes submenu if open\n else if (e.key === 'ArrowLeft' && state.isOpen) {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n }\n };\n\n // Use refs to store timer IDs\n const hoverOpenTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hoverCloseTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Track if mouse is over trigger or submenu\n const isHoveringRef = useRef(false);\n const isHoveringSubmenuRef = useRef(false);\n\n const checkShouldClose = () => {\n // Only close if mouse is not over trigger OR submenu\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n hoverCloseTimerRef.current = setTimeout(() => {\n // Double check before closing\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n state.close();\n }\n }, 300);\n }\n };\n\n // Handle mouse interactions on trigger\n const handleMouseEnter = () => {\n if (isDisabled) return;\n\n isHoveringRef.current = true;\n\n // Clear any pending close timer\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n\n // Use a small delay to prevent accidental opens\n if (!state.isOpen) {\n hoverOpenTimerRef.current = setTimeout(() => {\n if (isHoveringRef.current) {\n state.open();\n }\n }, 200);\n }\n };\n\n const handleMouseLeave = () => {\n isHoveringRef.current = false;\n\n // Clear open timer if it exists\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n hoverOpenTimerRef.current = null;\n }\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Handle mouse events on the submenu popover\n const handlePopoverMouseEnter = () => {\n isHoveringSubmenuRef.current = true;\n\n // Clear any pending close timer when entering submenu\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n };\n\n const handlePopoverMouseLeave = () => {\n isHoveringSubmenuRef.current = false;\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Merge event handlers\n const mergeHandler = (handler1: any, handler2: any) => {\n return (...args: any[]) => {\n handler1?.(...args);\n handler2?.(...args);\n };\n };\n\n // Outside-click handling for the nested submenu Popover.\n //\n // React Aria's `useOverlay` keeps a module-level `visibleOverlays` stack and\n // only invokes `onClose` for the topmost overlay (`onHide` gates on the\n // stack tail). With root + N nested submenus open, a single outside click\n // would otherwise only close the deepest submenu. Scheduling\n // `parentContext.onClose()` here propagates the close upward; the existing\n // `parentContext.isClosing` cascade (see `nestedMenuContext.isClosing` and\n // the Popover's `isOpen={!parentContext.isClosing}`) collapses every\n // intermediate submenu visually.\n //\n // Mirrors `MenuTrigger`'s predicate so clicks on `[data-popover-trigger]`\n // and `[data-popover-dismiss]` elements behave consistently across nesting\n // levels.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n if (!state.isOpen) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n if (el.closest('[data-popover-dismiss]')) {\n // Let the button's onPress fire first, then collapse the chain.\n setTimeout(() => parentContext.onClose?.(), 0);\n return false;\n }\n // True outside click: schedule parent close so the entire hierarchy\n // cascades. `useOverlay`'s own `onHide` will close this submenu via the\n // topmost-overlay rule.\n setTimeout(() => parentContext.onClose?.(), 0);\n return true;\n }\n // Click landed on a popover trigger (parent menu item, sibling submenu\n // trigger, or a different menu's button). Don't close ourselves here —\n // either the trigger handles it or `usePopoverSync` closes us via\n // `popover:open`.\n return false;\n });\n\n // Provide context to the trigger element (already rendered MenuItem)\n const triggerContextValue = useMemo(\n () => ({\n triggerRef: domTriggerRef,\n triggerProps: menuTriggerProps,\n isOpen: state.isOpen,\n isDisabled,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n onAction: isDisabled\n ? undefined\n : () => {\n // A pointer press: Enter and Space open the submenu in\n // `handleKeyDown` and never reach the item's action.\n state.open();\n },\n }),\n [\n state,\n isDisabled,\n handleMouseEnter,\n handleMouseLeave,\n handleKeyDown,\n menuTriggerProps,\n ],\n );\n\n return (\n <>\n <SubmenuTriggerContext.Provider value={triggerContextValue}>\n {menuTrigger}\n </SubmenuTriggerContext.Provider>\n {state.isOpen && (\n <Popover\n ref={popoverRef}\n hideArrow\n isNonModal\n isOpen={!parentContext.isClosing}\n // oxlint-disable-next-line tasty/no-style-prop -- React Aria's overlay positioning computes these coordinates\n style={positionProps.style}\n placement={resolvedPlacement ?? undefined}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n // Spread any additional overlay props\n {...overlayProps}\n >\n {/* Wrap content in a div to capture mouse events */}\n <PointerAreaElement\n onMouseEnter={handlePopoverMouseEnter}\n onMouseLeave={handlePopoverMouseLeave}\n >\n {/* Dismiss buttons for screen reader / keyboard support */}\n <DismissButton onDismiss={state.close} />\n {/* Provide updated menu context so nested menu behaves correctly */}\n <MenuContext.Provider value={nestedMenuContext}>\n {/* Clone nested menu to inject required props */}\n {React.cloneElement(menu, {\n ...(menu.props as any),\n autoFocus,\n onAction: (key: Key) => {\n // Call original menu onAction first\n (menu.props as any).onAction?.(key);\n onAction?.(key);\n // Don't close here - MenuItem will handle it via context.onClose\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n // Handle keyboard navigation for closing submenu\n if (e.key === 'ArrowLeft' || e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n // Return focus to trigger\n (\n domTriggerRef.current?.querySelector<HTMLElement>(\n '[data-menu-native-primary]',\n ) ?? domTriggerRef.current\n )?.focus();\n }\n // Call original handler if exists\n (menu.props as any).onKeyDown?.(e);\n },\n ref: menuRef,\n })}\n </MenuContext.Provider>\n <DismissButton onDismiss={state.close} />\n </PointerAreaElement>\n </Popover>\n )}\n </>\n );\n}\n\n/**\n * Public SubMenuTrigger component that users interact with.\n * It just provides the getCollectionNode for the collection system.\n */\nexport function SubMenuTrigger(props: CubeSubMenuTriggerProps) {\n // This component is never actually rendered directly.\n // The collection system uses getCollectionNode to build the menu.\n return null;\n}\n\n// Allow React Stately collection builder to treat SubMenuTrigger as an Item\n(SubMenuTrigger as any).getCollectionNode = function* (\n props: CubeSubMenuTriggerProps,\n) {\n const [trigger, menu] = React.Children.toArray(\n props.children,\n ) as ReactElement[];\n\n // Yield a collection node that tells the Menu to wrap this item with InternalSubMenuTrigger\n yield {\n element: trigger,\n wrapper: (element: ReactElement) => (\n <InternalSubMenuTrigger\n key={element.key || undefined}\n targetKey={element.key || undefined}\n {...props}\n >\n {element}\n {menu}\n </InternalSubMenuTrigger>\n ),\n };\n};\n\nSubMenuTrigger.displayName = 'SubMenuTrigger';\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,MAAMwB,oBAA+B;AACrC,MAAMC,iBAAiB;AACvB,MAAMC,uBAAuB;AAI7B,MAAMC,qBAAqB1B,MAAM,EAAE2B,QAAQ,EAAEC,SAAS,WAAW,EAAE,CAAC;;;;;AAqDpE,SAASc,uBAAuBC,OAAoC;CAClE,MAAM,EACJR,UACAL,YAAYP,mBACZQ,SAASP,gBACTQ,cAAcP,sBACdQ,aAAa,MACbG,YACAG,YAAY,SACZ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@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.212.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
2
2
  import React from "react";
3
3
  //#region src/components/actions/Menu/SubmenuTriggerContext.tsx
4
4
  const SubmenuTriggerContext = React.createContext(null);