@cube-dev/ui-kit 0.0.0-canary-bef9600 → 0.0.0-canary-e3f8a1a

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 (654) hide show
  1. package/dist/_internal/hooks/use-debounced-value.js +1 -1
  2. package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
  3. package/dist/_internal/hooks/use-event.js +1 -1
  4. package/dist/_internal/hooks/use-is-first-render.js +1 -1
  5. package/dist/_internal/hooks/use-sync-ref.js +1 -1
  6. package/dist/_internal/hooks/use-timer/timer.js +1 -1
  7. package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
  8. package/dist/_internal/hooks/use-warn.js +1 -1
  9. package/dist/components/Block.js +1 -1
  10. package/dist/components/CollectionItem.js +1 -1
  11. package/dist/components/GlobalStyles.js +1 -1
  12. package/dist/components/GridProvider.js +1 -1
  13. package/dist/components/HiddenInput.js +1 -1
  14. package/dist/components/Root.js +1 -1
  15. package/dist/components/actions/Action/Action.js +1 -1
  16. package/dist/components/actions/Banner/Banner.js +1 -1
  17. package/dist/components/actions/Button/Button.js +11 -5
  18. package/dist/components/actions/Button/Button.js.map +1 -1
  19. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  20. package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
  21. package/dist/components/actions/ButtonSplit/context.js +1 -1
  22. package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
  23. package/dist/components/actions/CommandMenu/styled.js +1 -1
  24. package/dist/components/actions/ItemAction/ItemAction.js +27 -25
  25. package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
  26. package/dist/components/actions/ItemActionContext.js +1 -1
  27. package/dist/components/actions/ItemActionsWrapper.js +1 -1
  28. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  29. package/dist/components/actions/Link/Link.js +1 -1
  30. package/dist/components/actions/Menu/Menu.js +1 -1
  31. package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
  32. package/dist/components/actions/Menu/MenuItem.js +1 -1
  33. package/dist/components/actions/Menu/MenuSection.js +1 -1
  34. package/dist/components/actions/Menu/MenuTrigger.js +1 -1
  35. package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
  36. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  37. package/dist/components/actions/Menu/context.js +1 -1
  38. package/dist/components/actions/Menu/styled.js +1 -4
  39. package/dist/components/actions/Menu/styled.js.map +1 -1
  40. package/dist/components/actions/actions-run.js +1 -1
  41. package/dist/components/actions/index.js +1 -1
  42. package/dist/components/actions/use-action.js +1 -1
  43. package/dist/components/actions/use-anchored-menu.js +1 -1
  44. package/dist/components/actions/use-context-menu.js +1 -1
  45. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  46. package/dist/components/content/Alert/Alert.js +1 -1
  47. package/dist/components/content/Alert/use-alert.js +1 -1
  48. package/dist/components/content/Avatar/Avatar.js +1 -1
  49. package/dist/components/content/Badge/Badge.js +1 -1
  50. package/dist/components/content/Card/Card.js +1 -1
  51. package/dist/components/content/Content.js +1 -1
  52. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  53. package/dist/components/content/CopySnippet/CopySnippet.d.ts +4 -4
  54. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  55. package/dist/components/content/Disclosure/Disclosure.js +1 -1
  56. package/dist/components/content/Divider.js +1 -1
  57. package/dist/components/content/Footer.js +1 -1
  58. package/dist/components/content/Header.js +1 -1
  59. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  60. package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
  61. package/dist/components/content/InlineInput/InlineInput.js +1 -1
  62. package/dist/components/content/Item/Item.js +3 -3
  63. package/dist/components/content/Item/Item.js.map +1 -1
  64. package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
  65. package/dist/components/content/ItemBadge/ItemBadge.js +7 -3
  66. package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
  67. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  68. package/dist/components/content/Layout/GridLayout.js +1 -1
  69. package/dist/components/content/Layout/Layout.js +28 -15
  70. package/dist/components/content/Layout/Layout.js.map +1 -1
  71. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  72. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  73. package/dist/components/content/Layout/LayoutContainer.js +1 -1
  74. package/dist/components/content/Layout/LayoutContent.js +1 -1
  75. package/dist/components/content/Layout/LayoutContext.js +20 -10
  76. package/dist/components/content/Layout/LayoutContext.js.map +1 -1
  77. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  78. package/dist/components/content/Layout/LayoutFooter.js +12 -9
  79. package/dist/components/content/Layout/LayoutFooter.js.map +1 -1
  80. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  81. package/dist/components/content/Layout/LayoutHeader.js +1 -1
  82. package/dist/components/content/Layout/LayoutPane.js +1 -1
  83. package/dist/components/content/Layout/LayoutPanel.js +1 -1
  84. package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
  85. package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
  86. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  87. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  88. package/dist/components/content/Layout/index.js +1 -1
  89. package/dist/components/content/Layout/utils.js +1 -1
  90. package/dist/components/content/Paragraph.js +1 -1
  91. package/dist/components/content/Placeholder/Placeholder.js +1 -1
  92. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  93. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  94. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  95. package/dist/components/content/Result/Result.js +1 -1
  96. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  97. package/dist/components/content/Tag/Tag.js +1 -1
  98. package/dist/components/content/Text.d.ts +14 -14
  99. package/dist/components/content/Text.js +1 -1
  100. package/dist/components/content/TextItem/TextItem.js +1 -1
  101. package/dist/components/content/Title.js +1 -1
  102. package/dist/components/content/Tree/Tree.js +1 -1
  103. package/dist/components/content/Tree/TreeNode.js +1 -1
  104. package/dist/components/content/Tree/styled.js +1 -1
  105. package/dist/components/content/Tree/tree-index.js +1 -1
  106. package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
  107. package/dist/components/content/Tree/use-load-data.js +1 -1
  108. package/dist/components/content/highlightText.js +1 -1
  109. package/dist/components/content/use-auto-tooltip.js +3 -3
  110. package/dist/components/content/use-auto-tooltip.js.map +1 -1
  111. package/dist/components/data/DataTable/DataTable.js +1 -1
  112. package/dist/components/data/ItemTable/ItemTable.js +1 -1
  113. package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
  114. package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
  115. package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
  116. package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
  117. package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
  118. package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
  119. package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
  120. package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
  121. package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
  122. package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
  123. package/dist/components/data/TableBase/ColumnResizer.js +1 -1
  124. package/dist/components/data/TableBase/RowCollection.js +1 -1
  125. package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
  126. package/dist/components/data/TableBase/TableRow.js +1 -1
  127. package/dist/components/data/TableBase/TableView.js +1 -1
  128. package/dist/components/data/TableBase/TreeGridTable.js +1 -1
  129. package/dist/components/data/TableBase/column-header.js +1 -1
  130. package/dist/components/data/TableBase/column-menu.js +1 -1
  131. package/dist/components/data/TableBase/column-styles.js +1 -1
  132. package/dist/components/data/TableBase/column-tint.js +1 -1
  133. package/dist/components/data/TableBase/row-menu.js +1 -1
  134. package/dist/components/data/TableBase/styled.js +1 -1
  135. package/dist/components/data/TableBase/table-tree.js +1 -1
  136. package/dist/components/data/TableBase/types.js +1 -1
  137. package/dist/components/data/TableBase/use-cell-selection.js +0 -0
  138. package/dist/components/data/TableBase/use-column-menu.js +1 -1
  139. package/dist/components/data/TableBase/use-column-order.js +1 -1
  140. package/dist/components/data/TableBase/use-column-window.js +1 -1
  141. package/dist/components/data/TableBase/use-container-width.js +1 -1
  142. package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
  143. package/dist/components/data/TableBase/use-scrollability.js +1 -1
  144. package/dist/components/data/TableBase/use-table-columns.js +1 -1
  145. package/dist/components/data/TableBase/use-table-search.js +1 -1
  146. package/dist/components/data/TableBase/use-table-selection.js +1 -1
  147. package/dist/components/data/TableBase/use-table-sort.js +1 -1
  148. package/dist/components/data/TableBase/use-table-sorts.js +1 -1
  149. package/dist/components/data/TableBase/use-table-storage.js +1 -1
  150. package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
  151. package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
  152. package/dist/components/fields/Checkbox/Checkbox.js +2 -2
  153. package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
  154. package/dist/components/fields/Checkbox/CheckboxGroup.js +5 -5
  155. package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
  156. package/dist/components/fields/Checkbox/context.js +1 -1
  157. package/dist/components/fields/ColorInput/ColorInput.js +1 -1
  158. package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
  159. package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
  160. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
  161. package/dist/components/fields/ComboBox/ComboBox.d.ts +26 -6
  162. package/dist/components/fields/ComboBox/ComboBox.js +1095 -619
  163. package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
  164. package/dist/components/fields/ComboBox/comboBoxOptions.js +84 -0
  165. package/dist/components/fields/ComboBox/comboBoxOptions.js.map +1 -0
  166. package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
  167. package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
  168. package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
  169. package/dist/components/fields/DatePicker/DateInput.js +1 -1
  170. package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
  171. package/dist/components/fields/DatePicker/DatePicker.js +1 -1
  172. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  173. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  174. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  175. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  176. package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
  177. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
  178. package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
  179. package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
  180. package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
  181. package/dist/components/fields/DatePicker/TimeInput.js +1 -1
  182. package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
  183. package/dist/components/fields/DatePicker/YearPicker.js +1 -1
  184. package/dist/components/fields/DatePicker/parseDate.js +1 -1
  185. package/dist/components/fields/DatePicker/period.js +1 -1
  186. package/dist/components/fields/DatePicker/props.js +1 -1
  187. package/dist/components/fields/DatePicker/utils.js +1 -1
  188. package/dist/components/fields/FileInput/FileInput.js +1 -1
  189. package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
  190. package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
  191. package/dist/components/fields/Input/Input.d.ts +2 -2
  192. package/dist/components/fields/Input/Input.js +2 -2
  193. package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
  194. package/dist/components/fields/ListBox/ListBox.d.ts +10 -4
  195. package/dist/components/fields/ListBox/ListBox.js +293 -143
  196. package/dist/components/fields/ListBox/ListBox.js.map +1 -1
  197. package/dist/components/fields/ListBox/optionId.js +1 -1
  198. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +15 -12
  199. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
  200. package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
  201. package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
  202. package/dist/components/fields/NumberInput/NumberInput.d.ts +0 -1
  203. package/dist/components/fields/NumberInput/NumberInput.js +136 -128
  204. package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
  205. package/dist/components/fields/NumberInput/StepButton.js +38 -48
  206. package/dist/components/fields/NumberInput/StepButton.js.map +1 -1
  207. package/dist/components/fields/PasswordInput/PasswordInput.d.ts +1 -2
  208. package/dist/components/fields/PasswordInput/PasswordInput.js +77 -111
  209. package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
  210. package/dist/components/fields/Picker/Picker.d.ts +1 -1
  211. package/dist/components/fields/Picker/Picker.js +8 -3
  212. package/dist/components/fields/Picker/Picker.js.map +1 -1
  213. package/dist/components/fields/RadioGroup/Radio.d.ts +8 -8
  214. package/dist/components/fields/RadioGroup/Radio.js +1 -1
  215. package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
  216. package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
  217. package/dist/components/fields/RadioGroup/context.js +1 -1
  218. package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
  219. package/dist/components/fields/SearchInput/SearchInput.d.ts +8 -3
  220. package/dist/components/fields/SearchInput/SearchInput.js +22 -29
  221. package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
  222. package/dist/components/fields/Select/Select.d.ts +12 -1
  223. package/dist/components/fields/Select/Select.js +365 -207
  224. package/dist/components/fields/Select/Select.js.map +1 -1
  225. package/dist/components/fields/Slider/Gradation.js +1 -1
  226. package/dist/components/fields/Slider/HueSlider.js +1 -1
  227. package/dist/components/fields/Slider/RangeSlider.js +3 -4
  228. package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
  229. package/dist/components/fields/Slider/Slider.js +1 -1
  230. package/dist/components/fields/Slider/SliderBase.js +1 -1
  231. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  232. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  233. package/dist/components/fields/Slider/elements.js +1 -1
  234. package/dist/components/fields/Slider/index.js +1 -1
  235. package/dist/components/fields/Switch/Switch.js +1 -1
  236. package/dist/components/fields/TagInput/TagInput.js +1 -1
  237. package/dist/components/fields/TagInput/TagList.js +1 -1
  238. package/dist/components/fields/TagInput/useActiveOption.js +1 -1
  239. package/dist/components/fields/TagInput/useTagError.js +1 -1
  240. package/dist/components/fields/TextArea/TextArea.d.ts +0 -1
  241. package/dist/components/fields/TextArea/TextArea.js +49 -63
  242. package/dist/components/fields/TextArea/TextArea.js.map +1 -1
  243. package/dist/components/fields/TextInput/TextInput.d.ts +1 -1
  244. package/dist/components/fields/TextInput/TextInput.js +42 -46
  245. package/dist/components/fields/TextInput/TextInput.js.map +1 -1
  246. package/dist/components/fields/TextInput/TextInputBase.d.ts +6 -2
  247. package/dist/components/fields/TextInput/TextInputBase.js +32 -10
  248. package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
  249. package/dist/components/fields/TextInput/displayed-validation.js +50 -0
  250. package/dist/components/fields/TextInput/displayed-validation.js.map +1 -0
  251. package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
  252. package/dist/components/fields/TextInputMapper/TextInputMapper.js +2 -2
  253. package/dist/components/fields/TriggerActions.js +1 -1
  254. package/dist/components/fields/color/ColorPanel.js +1 -1
  255. package/dist/components/fields/color/channels.js +1 -1
  256. package/dist/components/fields/color/color.js +1 -1
  257. package/dist/components/fields/color/context.js +1 -1
  258. package/dist/components/fields/index.d.ts +2 -2
  259. package/dist/components/fields/option-origin-press.js +78 -0
  260. package/dist/components/fields/option-origin-press.js.map +1 -0
  261. package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
  262. package/dist/components/form/FieldWrapper/field-description.js +1 -1
  263. package/dist/components/form/Form/Field.js +1 -1
  264. package/dist/components/form/Form/Form.js +1 -1
  265. package/dist/components/form/Form/ModernFormRoot.js +1 -1
  266. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  267. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  268. package/dist/components/form/Form/SubmitError.js +1 -1
  269. package/dist/components/form/Form/backend.js +1 -1
  270. package/dist/components/form/Form/index.js +1 -1
  271. package/dist/components/form/Form/modern/actions.js +1 -1
  272. package/dist/components/form/Form/modern/context.js +1 -1
  273. package/dist/components/form/Form/modern/controller.js +1 -1
  274. package/dist/components/form/Form/modern/field-binding.js +1 -1
  275. package/dist/components/form/Form/modern/field.js +1 -1
  276. package/dist/components/form/Form/modern/react.js +1 -1
  277. package/dist/components/form/Form/modern/store.js +1 -1
  278. package/dist/components/form/Form/modern/validation.js +1 -1
  279. package/dist/components/form/Form/modern/values.js +1 -1
  280. package/dist/components/form/Form/reset-unbound-controls.js +1 -1
  281. package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
  282. package/dist/components/form/Form/use-field/use-field-props.js +1 -1
  283. package/dist/components/form/Form/use-field/use-field.js +1 -1
  284. package/dist/components/form/Form/use-form.js +1 -1
  285. package/dist/components/form/Form/validation.js +1 -1
  286. package/dist/components/form/Label.js +1 -1
  287. package/dist/components/form/field-chrome.js +1 -1
  288. package/dist/components/form/legacy-tooltip.js +1 -1
  289. package/dist/components/form/validation/ValidationIndicator.js +1 -1
  290. package/dist/components/form/validation/resolve-validation-props.js +1 -1
  291. package/dist/components/form/validation/use-validation-props.js +1 -1
  292. package/dist/components/form/wrapper.js +1 -1
  293. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  294. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  295. package/dist/components/layout/Flex.js +1 -1
  296. package/dist/components/layout/Flow.js +1 -1
  297. package/dist/components/layout/Grid.js +1 -1
  298. package/dist/components/layout/Panel.js +1 -1
  299. package/dist/components/layout/Prefix.js +1 -1
  300. package/dist/components/layout/ResizablePanel.js +1 -1
  301. package/dist/components/layout/Space.js +1 -1
  302. package/dist/components/layout/Suffix.js +1 -1
  303. package/dist/components/navigation/Pagination/Pagination.js +1 -1
  304. package/dist/components/navigation/Pagination/use-pagination.js +1 -1
  305. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
  306. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  307. package/dist/components/navigation/Tabs/TabButton.js +1 -1
  308. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  309. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  310. package/dist/components/navigation/Tabs/TabPicker.js +1 -1
  311. package/dist/components/navigation/Tabs/Tabs.js +1 -1
  312. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  313. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  314. package/dist/components/navigation/Tabs/popover-placement.js +1 -1
  315. package/dist/components/navigation/Tabs/styled.js +1 -1
  316. package/dist/components/navigation/Tabs/types.js +1 -1
  317. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  318. package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
  319. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  320. package/dist/components/other/Calendar/Calendar.js +1 -1
  321. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  322. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  323. package/dist/components/other/Calendar/CalendarHeader.js +1 -1
  324. package/dist/components/other/Calendar/CalendarPanel.js +1 -1
  325. package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
  326. package/dist/components/other/Calendar/PeriodGrid.js +1 -1
  327. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  328. package/dist/components/other/Calendar/styled.js +1 -1
  329. package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
  330. package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
  331. package/dist/components/overlays/AlertDialog/AlertDialog.d.ts +6 -1
  332. package/dist/components/overlays/AlertDialog/AlertDialog.js +3 -2
  333. package/dist/components/overlays/AlertDialog/AlertDialog.js.map +1 -1
  334. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +3 -2
  335. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js.map +1 -1
  336. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  337. package/dist/components/overlays/Dialog/Dialog.js +28 -14
  338. package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
  339. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  340. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  341. package/dist/components/overlays/Dialog/DialogTrigger.d.ts +7 -3
  342. package/dist/components/overlays/Dialog/DialogTrigger.js +149 -132
  343. package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
  344. package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
  345. package/dist/components/overlays/Dialog/context.js +1 -1
  346. package/dist/components/overlays/Dialog/default-button-text.js +1 -1
  347. package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
  348. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  349. package/dist/components/overlays/Dialog/use-dialog-open-sync.js +83 -0
  350. package/dist/components/overlays/Dialog/use-dialog-open-sync.js.map +1 -0
  351. package/dist/components/overlays/Modal/Modal.js +1 -1
  352. package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
  353. package/dist/components/overlays/Modal/Overlay.js +3 -2
  354. package/dist/components/overlays/Modal/Overlay.js.map +1 -1
  355. package/dist/components/overlays/Modal/Popover.js +1 -1
  356. package/dist/components/overlays/Modal/Popover.js.map +1 -1
  357. package/dist/components/overlays/Modal/Tray.js +1 -1
  358. package/dist/components/overlays/Modal/Underlay.js +1 -1
  359. package/dist/components/overlays/Modal/modal-containment.js +1 -1
  360. package/dist/components/overlays/Notifications/Notification.js +1 -1
  361. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  362. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  363. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  364. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  365. package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
  366. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  367. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  368. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  369. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  370. package/dist/components/overlays/Notifications/index.js +1 -1
  371. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  372. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  373. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  374. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  375. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  376. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  377. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  378. package/dist/components/overlays/Toast/index.js +1 -1
  379. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  380. package/dist/components/overlays/Toast/useToast.js +1 -1
  381. package/dist/components/overlays/Tooltip/Tooltip.d.ts +8 -0
  382. package/dist/components/overlays/Tooltip/Tooltip.js +16 -22
  383. package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
  384. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  385. package/dist/components/overlays/Tooltip/TooltipTrigger.d.ts +1 -1
  386. package/dist/components/overlays/Tooltip/TooltipTrigger.js +163 -113
  387. package/dist/components/overlays/Tooltip/TooltipTrigger.js.map +1 -1
  388. package/dist/components/overlays/Tooltip/context.js +1 -1
  389. package/dist/components/overlays/Tooltip/context.js.map +1 -1
  390. package/dist/components/overlays/Tooltip/split-trigger-props.js +6 -5
  391. package/dist/components/overlays/Tooltip/split-trigger-props.js.map +1 -1
  392. package/dist/components/portal/Portal.js +1 -1
  393. package/dist/components/portal/PortalProvider.js +1 -1
  394. package/dist/components/portal/usePortal.js +1 -1
  395. package/dist/components/shared/DraggableCollection.js +1 -1
  396. package/dist/components/shared/InvalidIcon.js +1 -1
  397. package/dist/components/shared/ValidIcon.js +1 -1
  398. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  399. package/dist/components/status/Spin/Cube.js +1 -1
  400. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  401. package/dist/components/status/Spin/Spin.js +1 -1
  402. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  403. package/dist/data/item-themes.js +1 -1
  404. package/dist/data/themes.js +1 -1
  405. package/dist/eslint-plugin/defaults.generated.js +11 -17
  406. package/dist/eslint-plugin/defaults.generated.js.map +1 -1
  407. package/dist/eslint-plugin/index.js +1 -1
  408. package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
  409. package/dist/i18n/I18nProvider.js +1 -1
  410. package/dist/i18n/createFormatter.js +1 -1
  411. package/dist/i18n/index.js +1 -1
  412. package/dist/i18n/instance.js +1 -1
  413. package/dist/i18n/locales/de-DE/uikit.js +6 -4
  414. package/dist/i18n/locales/en-US/uikit.js +6 -4
  415. package/dist/i18n/locales/en-US/uikit.json.d.ts +3 -1
  416. package/dist/i18n/locales/es-ES/uikit.js +6 -4
  417. package/dist/i18n/locales/es-MX/uikit.js +6 -4
  418. package/dist/i18n/locales/fr-FR/uikit.js +6 -4
  419. package/dist/i18n/locales/it-IT/uikit.js +6 -4
  420. package/dist/i18n/locales/ja-JP/uikit.js +6 -4
  421. package/dist/i18n/locales/nb-NO/uikit.js +6 -4
  422. package/dist/i18n/locales/pt-BR/uikit.js +6 -4
  423. package/dist/i18n/locales/pt-PT/uikit.js +6 -4
  424. package/dist/i18n/locales/sv-SE/uikit.js +6 -4
  425. package/dist/i18n/locales/vi-VN/uikit.js +6 -4
  426. package/dist/i18n/locales.js +1 -1
  427. package/dist/i18n/namespace.js +1 -1
  428. package/dist/i18n/useFormatter.js +1 -1
  429. package/dist/i18n/useI18n.js +1 -1
  430. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  431. package/dist/icons/AdjustmentsIcon.js +1 -1
  432. package/dist/icons/AiIcon.js +1 -1
  433. package/dist/icons/AreaChartIcon.js +1 -1
  434. package/dist/icons/ArrowNarrowDownIcon.js +1 -1
  435. package/dist/icons/ArrowNarrowUpIcon.js +1 -1
  436. package/dist/icons/BackwardIcon.js +1 -1
  437. package/dist/icons/BarChartIcon.js +1 -1
  438. package/dist/icons/BellFilledIcon.js +1 -1
  439. package/dist/icons/BellIcon.js +1 -1
  440. package/dist/icons/BooleanIcon.js +1 -1
  441. package/dist/icons/CalendarEditIcon.js +1 -1
  442. package/dist/icons/CalendarIcon.js +1 -1
  443. package/dist/icons/CaretDownIcon.js +1 -1
  444. package/dist/icons/CaretUpIcon.js +1 -1
  445. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  446. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  447. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  448. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  449. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  450. package/dist/icons/ChartBarLineIcon.js +1 -1
  451. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  452. package/dist/icons/ChartBarStackedIcon.js +1 -1
  453. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  454. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  455. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  456. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  457. package/dist/icons/ChartBubbleIcon.js +1 -1
  458. package/dist/icons/ChartDonut2Icon.js +1 -1
  459. package/dist/icons/ChartFunnelIcon.js +1 -1
  460. package/dist/icons/ChartHeatmapIcon.js +1 -1
  461. package/dist/icons/ChartKPIIcon.js +1 -1
  462. package/dist/icons/ChartPie2Icon.js +1 -1
  463. package/dist/icons/ChartScatterIcon.js +1 -1
  464. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  465. package/dist/icons/CheckCircleIcon.js +1 -1
  466. package/dist/icons/CheckIcon.js +1 -1
  467. package/dist/icons/CircleFilledIcon.js +1 -1
  468. package/dist/icons/ClearIcon.js +1 -1
  469. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  470. package/dist/icons/CloseCircleIcon.js +1 -1
  471. package/dist/icons/CloseIcon.js +1 -1
  472. package/dist/icons/CodeIcon.js +1 -1
  473. package/dist/icons/ColumnTotalIcon.js +1 -1
  474. package/dist/icons/CopyIcon.js +1 -1
  475. package/dist/icons/CountIcon.js +1 -1
  476. package/dist/icons/CubeIcon.js +1 -1
  477. package/dist/icons/CubePauseIcon.js +1 -1
  478. package/dist/icons/CubePlayIcon.js +1 -1
  479. package/dist/icons/CurrencyDollarIcon.js +1 -1
  480. package/dist/icons/DangerIcon.js +1 -1
  481. package/dist/icons/DashboardIcon.js +1 -1
  482. package/dist/icons/DatabaseIcon.js +1 -1
  483. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  484. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  485. package/dist/icons/DirectionIcon.js +1 -1
  486. package/dist/icons/DonutIcon.js +1 -1
  487. package/dist/icons/DownIcon.js +1 -1
  488. package/dist/icons/EditIcon.js +1 -1
  489. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  490. package/dist/icons/ExclamationCircleIcon.js +1 -1
  491. package/dist/icons/ExclamationIcon.js +1 -1
  492. package/dist/icons/EyeIcon.js +1 -1
  493. package/dist/icons/EyeInvisibleIcon.js +1 -1
  494. package/dist/icons/FilterIcon.js +1 -1
  495. package/dist/icons/FolderFilledIcon.js +1 -1
  496. package/dist/icons/FolderIcon.js +1 -1
  497. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  498. package/dist/icons/FolderOpenIcon.js +1 -1
  499. package/dist/icons/ForwardIcon.js +1 -1
  500. package/dist/icons/GripVerticalIcon.js +1 -1
  501. package/dist/icons/HierarchyIcon.js +1 -1
  502. package/dist/icons/HierarchyOpenIcon.js +1 -1
  503. package/dist/icons/Icon.js +1 -1
  504. package/dist/icons/InfoCircleIcon.js +1 -1
  505. package/dist/icons/InfoIcon.js +1 -1
  506. package/dist/icons/KeyIcon.js +1 -1
  507. package/dist/icons/LeftIcon.js +1 -1
  508. package/dist/icons/LineChartIcon.js +1 -1
  509. package/dist/icons/LoadingIcon.js +1 -1
  510. package/dist/icons/LockFilledIcon.js +1 -1
  511. package/dist/icons/LockIcon.js +1 -1
  512. package/dist/icons/MoreIcon.js +1 -1
  513. package/dist/icons/NotAllowedIcon.js +1 -1
  514. package/dist/icons/Number123Icon.js +1 -1
  515. package/dist/icons/NumberIcon.js +1 -1
  516. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  517. package/dist/icons/PauseCircleIcon.js +1 -1
  518. package/dist/icons/PauseIcon.js +1 -1
  519. package/dist/icons/PercentageIcon.js +1 -1
  520. package/dist/icons/PieChartIcon.js +1 -1
  521. package/dist/icons/PipetteIcon.js +1 -1
  522. package/dist/icons/PlayCircleIcon.js +1 -1
  523. package/dist/icons/PlayIcon.js +1 -1
  524. package/dist/icons/PlusIcon.js +1 -1
  525. package/dist/icons/ProgressBarIcon.js +1 -1
  526. package/dist/icons/ReloadIcon.js +1 -1
  527. package/dist/icons/ReportIcon.js +1 -1
  528. package/dist/icons/ReturnIcon.js +1 -1
  529. package/dist/icons/RightIcon.js +1 -1
  530. package/dist/icons/RowTotalsIcon.js +1 -1
  531. package/dist/icons/SchemeIcon.js +1 -1
  532. package/dist/icons/SearchIcon.js +1 -1
  533. package/dist/icons/SemanticQueryIcon.js +1 -1
  534. package/dist/icons/SettingsIcon.js +1 -1
  535. package/dist/icons/ShieldFilledIcon.js +1 -1
  536. package/dist/icons/ShieldIcon.js +1 -1
  537. package/dist/icons/SlashIcon.js +1 -1
  538. package/dist/icons/SparklesIcon.js +1 -1
  539. package/dist/icons/SqlIcon.js +1 -1
  540. package/dist/icons/StatsIcon.js +1 -1
  541. package/dist/icons/StopIcon.js +1 -1
  542. package/dist/icons/StringIcon.js +1 -1
  543. package/dist/icons/SubtotalsIcon.js +1 -1
  544. package/dist/icons/SwitchIcon.js +1 -1
  545. package/dist/icons/TableIcon.js +1 -1
  546. package/dist/icons/ThumbsDownIcon.js +1 -1
  547. package/dist/icons/ThumbsUpIcon.js +1 -1
  548. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  549. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  550. package/dist/icons/ThunderboltIcon.js +1 -1
  551. package/dist/icons/TimeIcon.js +1 -1
  552. package/dist/icons/TrashIcon.js +1 -1
  553. package/dist/icons/UnlockIcon.js +1 -1
  554. package/dist/icons/UpIcon.js +1 -1
  555. package/dist/icons/UserGroupIcon.js +1 -1
  556. package/dist/icons/UserIcon.js +1 -1
  557. package/dist/icons/UserLockIcon.js +1 -1
  558. package/dist/icons/ViewIcon.js +1 -1
  559. package/dist/icons/WarningFilledIcon.js +1 -1
  560. package/dist/icons/WarningIcon.js +1 -1
  561. package/dist/icons/wrap-icon.js +1 -1
  562. package/dist/index.d.ts +1 -1
  563. package/dist/index.js +2 -2
  564. package/dist/probe/canonicalize.js +1 -1
  565. package/dist/probe/css.js +1 -1
  566. package/dist/probe/index.js +1 -1
  567. package/dist/provider.js +1 -1
  568. package/dist/providers/TrackingProvider.js +1 -1
  569. package/dist/providers/navigation-url.js +1 -1
  570. package/dist/providers/navigationAdapter.default.js +1 -1
  571. package/dist/providers/use-navigation.js +1 -1
  572. package/dist/tokens/all-tokens.js +1 -1
  573. package/dist/tokens/base.js +1 -1
  574. package/dist/tokens/color-seed.js +1 -1
  575. package/dist/tokens/color-theme.js +1 -1
  576. package/dist/tokens/colors.js +1 -1
  577. package/dist/tokens/layout.js +1 -1
  578. package/dist/tokens/lazy-styles.js +1 -1
  579. package/dist/tokens/legacy-color.js +1 -1
  580. package/dist/tokens/palette-config.js +1 -1
  581. package/dist/tokens/palette.js +1 -1
  582. package/dist/tokens/resolve.js +1 -1
  583. package/dist/tokens/shadows.js +1 -1
  584. package/dist/tokens/sizes.js +1 -1
  585. package/dist/tokens/spacing.js +1 -1
  586. package/dist/tokens/typography.js +1 -1
  587. package/dist/utils/ResizeSensor.js +1 -1
  588. package/dist/utils/colors.js +1 -1
  589. package/dist/utils/dotize.js +1 -1
  590. package/dist/utils/is-dev-env.js +1 -1
  591. package/dist/utils/modules.js +1 -1
  592. package/dist/utils/promise.js +1 -1
  593. package/dist/utils/raf.js +1 -1
  594. package/dist/utils/random.js +1 -1
  595. package/dist/utils/range.js +1 -1
  596. package/dist/utils/react/RenderCache.js +1 -1
  597. package/dist/utils/react/Slots.js +1 -1
  598. package/dist/utils/react/chain.js +1 -1
  599. package/dist/utils/react/disabledProps.js +1 -1
  600. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  601. package/dist/utils/react/index.js +1 -1
  602. package/dist/utils/react/interactions.js +1 -1
  603. package/dist/utils/react/isTextOnly.js +1 -1
  604. package/dist/utils/react/mapProps.js +1 -1
  605. package/dist/utils/react/mergeProps.js +1 -1
  606. package/dist/utils/react/nullableValue.js +18 -9
  607. package/dist/utils/react/nullableValue.js.map +1 -1
  608. package/dist/utils/react/overlayKeyPropagation.js +1 -1
  609. package/dist/utils/react/programmaticFocus.js +1 -1
  610. package/dist/utils/react/resolveIcon.js +1 -1
  611. package/dist/utils/react/sharedStore.js +1 -1
  612. package/dist/utils/react/useBufferedValue.js +1 -1
  613. package/dist/utils/react/useCombinedRefs.js +1 -1
  614. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  615. package/dist/utils/react/useEventBus.js +1 -1
  616. package/dist/utils/react/useId.js +1 -1
  617. package/dist/utils/react/useIsDarwin.js +1 -1
  618. package/dist/utils/react/useKeySymbols.js +1 -1
  619. package/dist/utils/react/useLayoutEffect.js +1 -1
  620. package/dist/utils/react/useLocalStorage.js +1 -1
  621. package/dist/utils/react/useMergeStyles.js +1 -1
  622. package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
  623. package/dist/utils/react/usePopoverSync.js +1 -1
  624. package/dist/utils/react/useQaProps.js +1 -1
  625. package/dist/utils/react/useScheme.js +1 -1
  626. package/dist/utils/react/useViewportSize.js +1 -1
  627. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  628. package/dist/utils/selection.js +1 -1
  629. package/dist/utils/styles.js +1 -1
  630. package/dist/utils/tree.js +1 -1
  631. package/dist/utils/warnings.js +1 -1
  632. package/dist/version.js +2 -2
  633. package/docs/components/actions/Button.md +8 -2
  634. package/docs/components/content/InfoBadge.md +2 -0
  635. package/docs/components/content/ItemBadge.md +4 -0
  636. package/docs/components/content/Layout.md +2 -1
  637. package/docs/components/fields/ComboBox.md +25 -18
  638. package/docs/components/fields/FilterListBox.md +2 -2
  639. package/docs/components/fields/FilterPicker.md +2 -2
  640. package/docs/components/fields/ListBox.md +14 -10
  641. package/docs/components/fields/NumberInput.md +10 -10
  642. package/docs/components/fields/PasswordInput.md +6 -7
  643. package/docs/components/fields/Picker.md +6 -5
  644. package/docs/components/fields/RadioGroup.md +1 -1
  645. package/docs/components/fields/SearchInput.md +7 -6
  646. package/docs/components/fields/Select.md +14 -8
  647. package/docs/components/fields/TextArea.md +4 -3
  648. package/docs/components/fields/TextInput.md +13 -6
  649. package/docs/components/overlays/AlertDialog.md +7 -1
  650. package/docs/components/overlays/Dialog.md +5 -5
  651. package/docs/components/overlays/DialogTrigger.md +6 -6
  652. package/docs/components/overlays/Tooltip.md +17 -6
  653. package/docs/components/overlays/TooltipTrigger.md +2 -0
  654. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-bef9600 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e3f8a1a | Cube Dev Team */
2
2
  import { extractStyles } from "../../../utils/styles.js";
3
3
  import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
4
4
  import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
@@ -20,11 +20,12 @@ import { filterCollectionNodes, getEdgeVisibleKey, getNextVisibleKey, markKeyboa
20
20
  import { DEFAULT_INPUT_STYLES, INPUT_WRAPPER_STYLES } from "../TextInput/TextInputBase.js";
21
21
  import { ListBoxPopover } from "../ListBoxPopover/ListBoxPopover.js";
22
22
  import { useCompositeFocus } from "../ListBoxPopover/useCompositeFocus.js";
23
+ import { collectOptions, findTypedOption, getItemLabel, highlightOption, resolveHighlightedKey, sortSelectedFirst } from "./comboBoxOptions.js";
23
24
  import { c } from "react/compiler-runtime";
24
25
  import { BASE_STYLES, COLOR_STYLES, OUTER_STYLES, tasty } from "@tenphi/tasty";
25
- import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
26
+ import React, { forwardRef, useEffect, useRef, useState } from "react";
26
27
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
27
- import { useFilter, useKeyboard } from "react-aria";
28
+ import { useCollator, useFilter, useKeyboard } from "react-aria";
28
29
  import { Section, useListState } from "react-stately";
29
30
 
30
31
  //#region src/components/fields/ComboBox/ComboBox.tsx
@@ -45,11 +46,10 @@ function useComboBoxState(t0) {
45
46
  const $ = c(12);
46
47
  const { selectedKey, defaultSelectedKey, inputValue, defaultInputValue, comboBoxId, triggerRef, popoverRef } = t0;
47
48
  const [internalSelectedKey, setInternalSelectedKey] = useState(defaultSelectedKey ?? null);
48
- const [internalInputValue, setInternalInputValue] = useState(defaultInputValue ?? "");
49
+ const [internalInputValue, setInternalInputValue] = useState(defaultInputValue ?? null);
49
50
  const isControlledKey = selectedKey !== void 0;
50
51
  const isControlledInput = inputValue !== void 0;
51
52
  const effectiveSelectedKey = isControlledKey ? selectedKey : internalSelectedKey;
52
- const effectiveInputValue = isControlledInput ? inputValue : internalInputValue;
53
53
  const [isPopoverOpen, setIsPopoverOpen] = useState(false);
54
54
  let t1;
55
55
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -73,10 +73,10 @@ function useComboBoxState(t0) {
73
73
  } else t2 = $[5];
74
74
  usePopoverSync(t2);
75
75
  let t3;
76
- if ($[6] !== effectiveInputValue || $[7] !== effectiveSelectedKey || $[8] !== isControlledInput || $[9] !== isControlledKey || $[10] !== isPopoverOpen) {
76
+ if ($[6] !== effectiveSelectedKey || $[7] !== internalInputValue || $[8] !== isControlledInput || $[9] !== isControlledKey || $[10] !== isPopoverOpen) {
77
77
  t3 = {
78
78
  effectiveSelectedKey,
79
- effectiveInputValue,
79
+ internalInputValue,
80
80
  isPopoverOpen,
81
81
  setIsPopoverOpen,
82
82
  setInternalSelectedKey,
@@ -84,8 +84,8 @@ function useComboBoxState(t0) {
84
84
  isControlledKey,
85
85
  isControlledInput
86
86
  };
87
- $[6] = effectiveInputValue;
88
- $[7] = effectiveSelectedKey;
87
+ $[6] = effectiveSelectedKey;
88
+ $[7] = internalInputValue;
89
89
  $[8] = isControlledInput;
90
90
  $[9] = isControlledKey;
91
91
  $[10] = isPopoverOpen;
@@ -93,8 +93,55 @@ function useComboBoxState(t0) {
93
93
  } else t3 = $[11];
94
94
  return t3;
95
95
  }
96
+ function useSelectedLabel(collection, selectedKey) {
97
+ const $ = c(7);
98
+ const [knownLabel, setKnownLabel] = useState(null);
99
+ let t0;
100
+ if ($[0] !== collection) {
101
+ t0 = (key) => {
102
+ const picked = getItemLabel(collection, key);
103
+ setKnownLabel({
104
+ key,
105
+ label: picked
106
+ });
107
+ return picked;
108
+ };
109
+ $[0] = collection;
110
+ $[1] = t0;
111
+ } else t0 = $[1];
112
+ const pickLabel = t0;
113
+ if (selectedKey == null) {
114
+ let t1;
115
+ if ($[2] !== pickLabel) {
116
+ t1 = {
117
+ selectedLabel: "",
118
+ pickLabel
119
+ };
120
+ $[2] = pickLabel;
121
+ $[3] = t1;
122
+ } else t1 = $[3];
123
+ return t1;
124
+ }
125
+ const label = collection.getItem(selectedKey)?.textValue;
126
+ if (label && (knownLabel?.key !== selectedKey || knownLabel.label !== label)) setKnownLabel({
127
+ key: selectedKey,
128
+ label
129
+ });
130
+ const selectedLabel = label || (knownLabel?.key === selectedKey ? knownLabel.label : String(selectedKey));
131
+ let t1;
132
+ if ($[4] !== pickLabel || $[5] !== selectedLabel) {
133
+ t1 = {
134
+ selectedLabel,
135
+ pickLabel
136
+ };
137
+ $[4] = pickLabel;
138
+ $[5] = selectedLabel;
139
+ $[6] = t1;
140
+ } else t1 = $[6];
141
+ return t1;
142
+ }
96
143
  function useComboBoxFiltering(t0) {
97
- const $ = c(11);
144
+ const $ = c(15);
98
145
  const { effectiveInputValue, filter } = t0;
99
146
  const [isFilterActive, setIsFilterActive] = useState(false);
100
147
  let t1;
@@ -104,45 +151,67 @@ function useComboBoxFiltering(t0) {
104
151
  } else t1 = $[0];
105
152
  const { contains } = useFilter(t1);
106
153
  let t2;
107
- if ($[1] !== contains || $[2] !== filter) {
108
- t2 = filter === false ? _temp : filter || contains;
109
- $[1] = contains;
110
- $[2] = filter;
111
- $[3] = t2;
112
- } else t2 = $[3];
113
- const textFilterFn = t2;
154
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
155
+ t2 = {
156
+ usage: "search",
157
+ sensitivity: "base"
158
+ };
159
+ $[1] = t2;
160
+ } else t2 = $[1];
161
+ const collator = useCollator(t2);
114
162
  let t3;
115
- if ($[4] !== effectiveInputValue || $[5] !== isFilterActive || $[6] !== textFilterFn) {
116
- t3 = (nodes) => {
163
+ if ($[2] !== collator) {
164
+ t3 = (textValue, text) => collator.compare(textValue.normalize("NFC"), text.normalize("NFC")) === 0;
165
+ $[2] = collator;
166
+ $[3] = t3;
167
+ } else t3 = $[3];
168
+ const isSameText = t3;
169
+ let t4;
170
+ if ($[4] !== contains || $[5] !== filter) {
171
+ t4 = filter === false ? _temp : filter || contains;
172
+ $[4] = contains;
173
+ $[5] = filter;
174
+ $[6] = t4;
175
+ } else t4 = $[6];
176
+ const textFilterFn = t4;
177
+ let t5;
178
+ if ($[7] !== effectiveInputValue || $[8] !== isFilterActive || $[9] !== textFilterFn) {
179
+ t5 = (nodes) => {
117
180
  const term = effectiveInputValue.trim();
118
181
  if (!isFilterActive || !term) return nodes;
119
182
  return filterCollectionNodes(nodes, term, textFilterFn);
120
183
  };
121
- $[4] = effectiveInputValue;
122
- $[5] = isFilterActive;
123
- $[6] = textFilterFn;
124
- $[7] = t3;
125
- } else t3 = $[7];
126
- const filterFn = t3;
127
- let t4;
128
- if ($[8] !== filterFn || $[9] !== isFilterActive) {
129
- t4 = {
184
+ $[7] = effectiveInputValue;
185
+ $[8] = isFilterActive;
186
+ $[9] = textFilterFn;
187
+ $[10] = t5;
188
+ } else t5 = $[10];
189
+ const filterFn = t5;
190
+ let t6;
191
+ if ($[11] !== filterFn || $[12] !== isFilterActive || $[13] !== isSameText) {
192
+ t6 = {
130
193
  filterFn,
194
+ isSameText,
131
195
  isFilterActive,
132
196
  setIsFilterActive
133
197
  };
134
- $[8] = filterFn;
135
- $[9] = isFilterActive;
136
- $[10] = t4;
137
- } else t4 = $[10];
138
- return t4;
198
+ $[11] = filterFn;
199
+ $[12] = isFilterActive;
200
+ $[13] = isSameText;
201
+ $[14] = t6;
202
+ } else t6 = $[14];
203
+ return t6;
139
204
  }
140
205
  function _temp() {
141
206
  return true;
142
207
  }
208
+ const OVERLAY_KEYS = new Set(["Escape", "Tab"]);
209
+ function isComposing(e) {
210
+ return e.nativeEvent?.isComposing || e.keyCode === 229;
211
+ }
143
212
  function useComboBoxKeyboard(t0) {
144
- const $ = c(42);
145
- const { isPopoverOpen, listStateRef, hasResults, allowsCustomValue, effectiveInputValue, isClearable, onSelectionChange, onClearValue, onOpenPopover, onClosePopover, inputRef, setIsFilterActive, onVirtualFocus, onKeyDown } = t0;
213
+ const $ = c(48);
214
+ const { isListShown, isReadOnly, listStateRef, hasResults, allowsCustomValue, effectiveInputValue, selectedKey, selectedLabel, isClearable, onSelectionChange, onClearValue, onOpenList, onCloseList, inputRef, onVirtualFocus, onKeyDown } = t0;
146
215
  let t1;
147
216
  if ($[0] !== onVirtualFocus) {
148
217
  t1 = (listState, key) => {
@@ -156,155 +225,170 @@ function useComboBoxKeyboard(t0) {
156
225
  } else t1 = $[1];
157
226
  const focusOption = t1;
158
227
  let t2;
159
- if ($[2] !== focusOption || $[3] !== hasResults || $[4] !== isPopoverOpen || $[5] !== listStateRef || $[6] !== onOpenPopover || $[7] !== setIsFilterActive) {
228
+ if ($[2] !== focusOption || $[3] !== isListShown || $[4] !== listStateRef || $[5] !== onOpenList) {
160
229
  t2 = (e) => {
161
230
  e.preventDefault();
162
- if (!isPopoverOpen) {
163
- if (!hasResults) setIsFilterActive(false);
164
- onOpenPopover();
231
+ if (!isListShown) {
232
+ onOpenList();
165
233
  return;
166
234
  }
167
235
  const listState_0 = listStateRef.current;
168
236
  if (listState_0) focusOption(listState_0, getNextVisibleKey(listState_0, e.key === "ArrowDown" ? 1 : -1));
169
237
  };
170
238
  $[2] = focusOption;
171
- $[3] = hasResults;
172
- $[4] = isPopoverOpen;
173
- $[5] = listStateRef;
174
- $[6] = onOpenPopover;
175
- $[7] = setIsFilterActive;
176
- $[8] = t2;
177
- } else t2 = $[8];
239
+ $[3] = isListShown;
240
+ $[4] = listStateRef;
241
+ $[5] = onOpenList;
242
+ $[6] = t2;
243
+ } else t2 = $[6];
178
244
  const handleArrowKey = t2;
179
245
  let t3;
180
- if ($[9] !== allowsCustomValue || $[10] !== effectiveInputValue || $[11] !== isPopoverOpen || $[12] !== onSelectionChange) {
246
+ if ($[7] !== effectiveInputValue || $[8] !== isListShown || $[9] !== onSelectionChange || $[10] !== selectedKey || $[11] !== selectedLabel) {
181
247
  t3 = (e_0) => {
182
- if (!allowsCustomValue) {
183
- e_0.preventDefault();
184
- onSelectionChange(null);
185
- return;
186
- }
187
248
  const value = effectiveInputValue.trim();
188
- onSelectionChange(value ?? null);
189
- if (isPopoverOpen || !value) e_0.preventDefault();
190
- };
191
- $[9] = allowsCustomValue;
192
- $[10] = effectiveInputValue;
193
- $[11] = isPopoverOpen;
194
- $[12] = onSelectionChange;
195
- $[13] = t3;
196
- } else t3 = $[13];
197
- const commitWithoutResults = t3;
249
+ if (isListShown || !value) e_0.preventDefault();
250
+ if (value && selectedKey != null && value === selectedLabel) return;
251
+ onSelectionChange(value || null);
252
+ };
253
+ $[7] = effectiveInputValue;
254
+ $[8] = isListShown;
255
+ $[9] = onSelectionChange;
256
+ $[10] = selectedKey;
257
+ $[11] = selectedLabel;
258
+ $[12] = t3;
259
+ } else t3 = $[12];
260
+ const commitTypedText = t3;
198
261
  let t4;
199
- if ($[14] !== commitWithoutResults || $[15] !== effectiveInputValue || $[16] !== hasResults || $[17] !== inputRef || $[18] !== isPopoverOpen || $[19] !== listStateRef || $[20] !== onClosePopover || $[21] !== onSelectionChange) {
262
+ if ($[13] !== allowsCustomValue || $[14] !== commitTypedText || $[15] !== effectiveInputValue || $[16] !== hasResults || $[17] !== inputRef || $[18] !== isListShown || $[19] !== listStateRef || $[20] !== onCloseList || $[21] !== onSelectionChange || $[22] !== selectedKey) {
200
263
  t4 = (e_1) => {
201
- const listState_1 = isPopoverOpen ? listStateRef.current : null;
202
- const focusedKey = listState_1?.selectionManager.focusedKey;
203
- if (focusedKey != null) {
264
+ const listState_1 = isListShown ? listStateRef.current : null;
265
+ const key_0 = listState_1 ? resolveHighlightedKey(listState_1, selectedKey) : null;
266
+ if (key_0 != null) {
204
267
  e_1.preventDefault();
205
- listState_1.selectionManager.select(focusedKey, e_1);
206
- onClosePopover();
268
+ listState_1.selectionManager.select(key_0, e_1);
269
+ onCloseList();
207
270
  inputRef.current?.focus();
208
- } else if (!hasResults) commitWithoutResults(e_1);
209
- else if ((effectiveInputValue || "").trim() === "") {
271
+ } else if (allowsCustomValue) commitTypedText(e_1);
272
+ else if (!hasResults || !effectiveInputValue.trim()) {
210
273
  e_1.preventDefault();
211
274
  onSelectionChange(null);
212
275
  }
213
276
  };
214
- $[14] = commitWithoutResults;
277
+ $[13] = allowsCustomValue;
278
+ $[14] = commitTypedText;
215
279
  $[15] = effectiveInputValue;
216
280
  $[16] = hasResults;
217
281
  $[17] = inputRef;
218
- $[18] = isPopoverOpen;
282
+ $[18] = isListShown;
219
283
  $[19] = listStateRef;
220
- $[20] = onClosePopover;
284
+ $[20] = onCloseList;
221
285
  $[21] = onSelectionChange;
222
- $[22] = t4;
223
- } else t4 = $[22];
286
+ $[22] = selectedKey;
287
+ $[23] = t4;
288
+ } else t4 = $[23];
224
289
  const handleEnterKey = t4;
225
290
  let t5;
226
- if ($[23] !== effectiveInputValue || $[24] !== inputRef || $[25] !== isClearable || $[26] !== isPopoverOpen || $[27] !== onClearValue || $[28] !== onClosePopover) {
291
+ if ($[24] !== effectiveInputValue || $[25] !== inputRef || $[26] !== isClearable || $[27] !== isListShown || $[28] !== onClearValue || $[29] !== onCloseList) {
227
292
  t5 = (e_2) => {
228
- if (isPopoverOpen) {
293
+ if (isListShown) {
229
294
  e_2.preventDefault();
230
- onClosePopover();
295
+ onCloseList();
231
296
  inputRef.current?.focus();
232
- } else if (effectiveInputValue && isClearable) {
297
+ return true;
298
+ }
299
+ if (effectiveInputValue && isClearable) {
233
300
  e_2.preventDefault();
234
301
  onClearValue();
302
+ return true;
235
303
  }
304
+ return false;
236
305
  };
237
- $[23] = effectiveInputValue;
238
- $[24] = inputRef;
239
- $[25] = isClearable;
240
- $[26] = isPopoverOpen;
241
- $[27] = onClearValue;
242
- $[28] = onClosePopover;
243
- $[29] = t5;
244
- } else t5 = $[29];
306
+ $[24] = effectiveInputValue;
307
+ $[25] = inputRef;
308
+ $[26] = isClearable;
309
+ $[27] = isListShown;
310
+ $[28] = onClearValue;
311
+ $[29] = onCloseList;
312
+ $[30] = t5;
313
+ } else t5 = $[30];
245
314
  const handleEscapeKey = t5;
246
315
  let t6;
247
- if ($[30] !== focusOption || $[31] !== isPopoverOpen || $[32] !== listStateRef) {
316
+ if ($[31] !== focusOption || $[32] !== isListShown || $[33] !== listStateRef) {
248
317
  t6 = (e_3) => {
249
- if (!isPopoverOpen) return;
318
+ if (!isListShown) return;
250
319
  e_3.preventDefault();
251
320
  const listState_2 = listStateRef.current;
252
321
  if (listState_2) focusOption(listState_2, getEdgeVisibleKey(listState_2, e_3.key === "Home" ? "first" : "last"));
253
322
  };
254
- $[30] = focusOption;
255
- $[31] = isPopoverOpen;
256
- $[32] = listStateRef;
257
- $[33] = t6;
258
- } else t6 = $[33];
323
+ $[31] = focusOption;
324
+ $[32] = isListShown;
325
+ $[33] = listStateRef;
326
+ $[34] = t6;
327
+ } else t6 = $[34];
259
328
  const handleEdgeKey = t6;
260
329
  let t7;
261
- if ($[34] !== handleArrowKey || $[35] !== handleEdgeKey || $[36] !== handleEnterKey || $[37] !== handleEscapeKey || $[38] !== onKeyDown) {
262
- t7 = { onKeyDown: (e_4) => {
263
- onKeyDown?.(e_4);
264
- if (e_4.isDefaultPrevented()) return;
265
- bb97: switch (e_4.key) {
330
+ if ($[35] !== handleArrowKey || $[36] !== handleEdgeKey || $[37] !== handleEnterKey || $[38] !== handleEscapeKey || $[39] !== isListShown || $[40] !== onCloseList) {
331
+ t7 = (e_4) => {
332
+ switch (e_4.key) {
266
333
  case "ArrowDown":
267
334
  case "ArrowUp":
268
335
  handleArrowKey(e_4);
269
- break bb97;
336
+ return true;
270
337
  case "Enter":
271
338
  handleEnterKey(e_4);
272
- break bb97;
273
- case "Escape":
274
- handleEscapeKey(e_4);
275
- break bb97;
339
+ return true;
340
+ case "Escape": return handleEscapeKey(e_4);
276
341
  case "Home":
277
- case "End": handleEdgeKey(e_4);
342
+ case "End":
343
+ handleEdgeKey(e_4);
344
+ return true;
345
+ case "Tab":
346
+ if (isListShown) onCloseList();
347
+ return false;
348
+ default: return true;
278
349
  }
279
- } };
280
- $[34] = handleArrowKey;
281
- $[35] = handleEdgeKey;
282
- $[36] = handleEnterKey;
283
- $[37] = handleEscapeKey;
284
- $[38] = onKeyDown;
285
- $[39] = t7;
286
- } else t7 = $[39];
287
- const { keyboardProps } = useKeyboard(t7);
350
+ };
351
+ $[35] = handleArrowKey;
352
+ $[36] = handleEdgeKey;
353
+ $[37] = handleEnterKey;
354
+ $[38] = handleEscapeKey;
355
+ $[39] = isListShown;
356
+ $[40] = onCloseList;
357
+ $[41] = t7;
358
+ } else t7 = $[41];
359
+ const handleKey = t7;
288
360
  let t8;
289
- if ($[40] !== keyboardProps) {
290
- t8 = { keyboardProps };
291
- $[40] = keyboardProps;
292
- $[41] = t8;
293
- } else t8 = $[41];
294
- return t8;
361
+ if ($[42] !== handleKey || $[43] !== isReadOnly || $[44] !== onKeyDown) {
362
+ t8 = { onKeyDown: (e_5) => {
363
+ onKeyDown?.(e_5);
364
+ if (e_5.isDefaultPrevented() || isComposing(e_5)) return;
365
+ if ((isReadOnly || !handleKey(e_5)) && OVERLAY_KEYS.has(e_5.key)) e_5.continuePropagation();
366
+ } };
367
+ $[42] = handleKey;
368
+ $[43] = isReadOnly;
369
+ $[44] = onKeyDown;
370
+ $[45] = t8;
371
+ } else t8 = $[45];
372
+ const { keyboardProps } = useKeyboard(t8);
373
+ let t9;
374
+ if ($[46] !== keyboardProps) {
375
+ t9 = { keyboardProps };
376
+ $[46] = keyboardProps;
377
+ $[47] = t9;
378
+ } else t9 = $[47];
379
+ return t9;
295
380
  }
296
381
  const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
297
- const $ = c(24);
298
- const { qa, inputRef, id, value, placeholder, isDisabled, isReadOnly, isRequired, autoFocus, autoComplete, size, mods, inputStyles, keyboardProps, focusProps, onChange, onFocus, isPopoverOpen, hasResults, comboBoxId, activeDescendant, ariaProps, isInvalid } = t0;
382
+ const $ = c(26);
383
+ const { qa, inputRef, id, value, placeholder, isDisabled, isReadOnly, isRequired, autoFocus, autoComplete, size, mods, inputStyles, keyboardProps, focusProps, onChange, onFocus, onPointerDown, onClick, isListShown, comboBoxId, activeDescendant, ariaProps, isInvalid } = t0;
299
384
  const combinedRef = useCombinedRefs(ref, inputRef);
300
385
  const t1 = autoFocus ? "" : void 0;
301
386
  const t2 = isRequired || void 0;
302
- const t3 = isPopoverOpen && hasResults;
303
- const t4 = isPopoverOpen && hasResults ? `ComboBoxListBox-${comboBoxId}` : void 0;
304
- const t5 = isInvalid || void 0;
305
- let t6;
306
- if ($[0] !== activeDescendant || $[1] !== ariaProps || $[2] !== autoComplete || $[3] !== autoFocus || $[4] !== combinedRef || $[5] !== focusProps.onBlur || $[6] !== id || $[7] !== inputStyles || $[8] !== isDisabled || $[9] !== isReadOnly || $[10] !== keyboardProps || $[11] !== mods || $[12] !== onChange || $[13] !== onFocus || $[14] !== placeholder || $[15] !== qa || $[16] !== size || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== value) {
307
- t6 = /* @__PURE__ */ jsx(InputElement, {
387
+ const t3 = isListShown ? `ComboBoxListBox-${comboBoxId}` : void 0;
388
+ const t4 = isInvalid || void 0;
389
+ let t5;
390
+ if ($[0] !== activeDescendant || $[1] !== ariaProps || $[2] !== autoComplete || $[3] !== autoFocus || $[4] !== combinedRef || $[5] !== focusProps.onBlur || $[6] !== id || $[7] !== inputStyles || $[8] !== isDisabled || $[9] !== isListShown || $[10] !== isReadOnly || $[11] !== keyboardProps || $[12] !== mods || $[13] !== onChange || $[14] !== onClick || $[15] !== onFocus || $[16] !== onPointerDown || $[17] !== placeholder || $[18] !== qa || $[19] !== size || $[20] !== t1 || $[21] !== t2 || $[22] !== t3 || $[23] !== t4 || $[24] !== value) {
391
+ t5 = /* @__PURE__ */ jsx(InputElement, {
308
392
  ref: combinedRef,
309
393
  qa,
310
394
  id,
@@ -318,6 +402,8 @@ const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
318
402
  "data-autofocus": t1,
319
403
  onChange,
320
404
  onFocus,
405
+ onPointerDown,
406
+ onClick,
321
407
  onBlur: focusProps.onBlur,
322
408
  ...keyboardProps,
323
409
  styles: inputStyles,
@@ -326,11 +412,12 @@ const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
326
412
  "data-input-type": "combobox",
327
413
  role: "combobox",
328
414
  "aria-required": t2,
329
- "aria-expanded": t3,
415
+ "aria-expanded": isListShown,
330
416
  "aria-haspopup": "listbox",
331
- "aria-controls": t4,
417
+ "aria-controls": t3,
418
+ "aria-autocomplete": "list",
332
419
  "aria-activedescendant": activeDescendant,
333
- "aria-invalid": t5,
420
+ "aria-invalid": t4,
334
421
  ...ariaProps
335
422
  });
336
423
  $[0] = activeDescendant;
@@ -342,225 +429,319 @@ const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
342
429
  $[6] = id;
343
430
  $[7] = inputStyles;
344
431
  $[8] = isDisabled;
345
- $[9] = isReadOnly;
346
- $[10] = keyboardProps;
347
- $[11] = mods;
348
- $[12] = onChange;
349
- $[13] = onFocus;
350
- $[14] = placeholder;
351
- $[15] = qa;
352
- $[16] = size;
353
- $[17] = t1;
354
- $[18] = t2;
355
- $[19] = t3;
356
- $[20] = t4;
357
- $[21] = t5;
358
- $[22] = value;
359
- $[23] = t6;
360
- } else t6 = $[23];
361
- return t6;
432
+ $[9] = isListShown;
433
+ $[10] = isReadOnly;
434
+ $[11] = keyboardProps;
435
+ $[12] = mods;
436
+ $[13] = onChange;
437
+ $[14] = onClick;
438
+ $[15] = onFocus;
439
+ $[16] = onPointerDown;
440
+ $[17] = placeholder;
441
+ $[18] = qa;
442
+ $[19] = size;
443
+ $[20] = t1;
444
+ $[21] = t2;
445
+ $[22] = t3;
446
+ $[23] = t4;
447
+ $[24] = value;
448
+ $[25] = t5;
449
+ } else t5 = $[25];
450
+ return t5;
362
451
  });
363
452
  const ComboBox = forwardRef(function ComboBox(props, ref) {
364
- props = useFieldProps(props, { valuePropsMapper: ({ value, onChange }) => {
365
- return {
366
- selectedKey: value ?? null,
367
- onSelectionChange(val) {
368
- onChange(val);
369
- }
370
- };
371
- } });
453
+ const $ = c(283);
454
+ let t0;
455
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
456
+ t0 = { valuePropsMapper: _temp2 };
457
+ $[0] = t0;
458
+ } else t0 = $[0];
459
+ props = useFieldProps(props, t0);
372
460
  const { t } = useI18n();
373
- let { qa, label, extra, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, id, icon, prefix, isDisabled, autoFocus, autoComplete = "off", wrapperRef, inputRef, triggerRef, popoverRef, listBoxRef, isLoading, inputStyles, optionStyles, triggerStyles, listBoxStyles, overlayStyles, suffix, hideTrigger, message, description, size = "medium", direction = "bottom", shouldFlip = true, popoverTrigger = "input", suffixPosition = "before", filter, styles, labelSuffix, selectedKey, defaultSelectedKey, inputValue, defaultInputValue, onInputChange, isClearable, onClear, placeholder, allowsCustomValue, shouldCommitOnBlur = true, clearOnBlur, items, children: renderChildren, sectionStyles, headingStyles, listGap, isReadOnly, overlayOffset = 8, containerPadding = 8, onSelectionChange: externalOnSelectionChange, sortSelectedToTop: sortSelectedToTopProp, onOpenChange, onFocus, onBlur, onKeyDown, form, ...otherProps } = props;
374
- const comboBoxId = useMemo(() => generateRandomId(), []);
461
+ let { qa, label, extra, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, id, icon, prefix: t1, isDisabled, autoFocus, autoComplete: t2, wrapperRef: t3, inputRef: t4, triggerRef, popoverRef, listBoxRef, isLoading, inputStyles, optionStyles, triggerStyles, listBoxStyles, overlayStyles, suffix, hideTrigger, message, description, size: t5, direction: t6, shouldFlip: t7, popoverTrigger: t8, suffixPosition: t9, filter, styles, labelSuffix, selectedKey, defaultSelectedKey, inputValue, defaultInputValue, onInputChange, isClearable, onClear, placeholder, allowsCustomValue, shouldCommitOnBlur: t10, clearOnBlur, items, children: renderChildren, sectionStyles, headingStyles, listGap, isReadOnly, overlayOffset: t11, containerPadding: t12, onSelectionChange: externalOnSelectionChange, sortSelectedToTop: sortSelectedToTopProp, onOpenChange, onFocus, onBlur, onKeyDown, form, ...otherProps } = props;
462
+ let prefix = t1;
463
+ const autoComplete = t2 === void 0 ? "off" : t2;
464
+ let wrapperRef = t3;
465
+ let inputRef = t4;
466
+ const size = t5 === void 0 ? "medium" : t5;
467
+ const direction = t6 === void 0 ? "bottom" : t6;
468
+ const shouldFlip = t7 === void 0 ? true : t7;
469
+ const popoverTrigger = t8 === void 0 ? "input" : t8;
470
+ const suffixPosition = t9 === void 0 ? "before" : t9;
471
+ const shouldCommitOnBlur = t10 === void 0 ? true : t10;
472
+ const overlayOffset = t11 === void 0 ? 8 : t11;
473
+ const containerPadding = t12 === void 0 ? 8 : t12;
474
+ let t13;
475
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
476
+ t13 = generateRandomId();
477
+ $[1] = t13;
478
+ } else t13 = $[1];
479
+ const comboBoxId = t13;
375
480
  wrapperRef = useCombinedRefs(wrapperRef);
376
481
  popoverRef = useCombinedRefs(popoverRef);
377
- const { effectiveSelectedKey, effectiveInputValue, isPopoverOpen, setIsPopoverOpen, setInternalSelectedKey, setInternalInputValue, isControlledKey, isControlledInput } = useComboBoxState({
378
- selectedKey,
379
- defaultSelectedKey,
380
- inputValue,
381
- defaultInputValue,
382
- comboBoxId,
383
- triggerRef: wrapperRef,
384
- popoverRef
385
- });
386
- const sortSelectedToTopExplicit = sortSelectedToTopProp !== void 0;
482
+ const t14 = wrapperRef;
483
+ const t15 = popoverRef;
484
+ let t16;
485
+ if ($[2] !== comboBoxId || $[3] !== defaultInputValue || $[4] !== defaultSelectedKey || $[5] !== inputValue || $[6] !== selectedKey || $[7] !== t14 || $[8] !== t15) {
486
+ t16 = {
487
+ selectedKey,
488
+ defaultSelectedKey,
489
+ inputValue,
490
+ defaultInputValue,
491
+ comboBoxId,
492
+ triggerRef: t14,
493
+ popoverRef: t15
494
+ };
495
+ $[2] = comboBoxId;
496
+ $[3] = defaultInputValue;
497
+ $[4] = defaultSelectedKey;
498
+ $[5] = inputValue;
499
+ $[6] = selectedKey;
500
+ $[7] = t14;
501
+ $[8] = t15;
502
+ $[9] = t16;
503
+ } else t16 = $[9];
504
+ const { effectiveSelectedKey, internalInputValue, isPopoverOpen, setIsPopoverOpen, setInternalSelectedKey, setInternalInputValue, isControlledKey, isControlledInput } = useComboBoxState(t16);
387
505
  const sortSelectedToTop = sortSelectedToTopProp ?? (items ? true : false);
388
- const cachedItemsOrder = useRef(null);
389
- const selectionWhenClosed = useRef(null);
390
506
  styles = extractStyles(otherProps, PROP_STYLES, styles);
391
507
  ref = useCombinedRefs(ref);
392
508
  inputRef = useCombinedRefs(inputRef);
393
509
  triggerRef = useCombinedRefs(triggerRef);
394
510
  listBoxRef = useCombinedRefs(listBoxRef);
395
- const sortedItems = useCallback(() => {
396
- if (!items) return items;
397
- if (!sortSelectedToTop) return items;
398
- if (cachedItemsOrder.current) return cachedItemsOrder.current;
399
- if (sortSelectedToTopExplicit && !items) {
400
- console.warn("ComboBox: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.");
401
- return items;
402
- }
403
- const selectedKey_0 = isPopoverOpen ? effectiveSelectedKey : selectionWhenClosed.current;
404
- if (!selectedKey_0) return items;
405
- const itemsArray = Array.isArray(items) ? items : Array.from(items);
406
- const selectedItem = itemsArray.find((item) => {
407
- const key = item?.key ?? item?.id;
408
- return key != null && String(key) === String(selectedKey_0);
409
- });
410
- if (!selectedItem) return items;
411
- const sorted = [selectedItem, ...itemsArray.filter((item_0) => {
412
- const key_0 = item_0?.key ?? item_0?.id;
413
- return key_0 == null || String(key_0) !== String(selectedKey_0);
414
- })];
415
- if (isPopoverOpen) cachedItemsOrder.current = sorted;
416
- return sorted;
417
- }, [
418
- items,
419
- sortSelectedToTop,
420
- sortSelectedToTopExplicit,
421
- effectiveSelectedKey,
422
- isPopoverOpen
423
- ])();
424
- let children = renderChildren;
425
- const renderFn = renderChildren;
426
- if (sortedItems && typeof renderFn === "function") try {
427
- children = Array.from(sortedItems).map((item_1, idx) => {
428
- const rendered = renderFn(item_1);
429
- if (React.isValidElement(rendered) && rendered.key == null) return React.cloneElement(rendered, { key: rendered?.key ?? item_1?.key ?? idx });
430
- return rendered;
431
- });
432
- } catch {}
433
- useEffect(() => {
434
- cachedItemsOrder.current = null;
435
- }, [items]);
436
- useEffect(() => {
437
- if (!isPopoverOpen) {
438
- selectionWhenClosed.current = effectiveSelectedKey != null ? String(effectiveSelectedKey) : null;
439
- cachedItemsOrder.current = null;
440
- }
441
- }, [isPopoverOpen, effectiveSelectedKey]);
442
- useEffect(() => {
443
- onOpenChange?.(isPopoverOpen);
444
- }, [isPopoverOpen]);
445
- const { filterFn, isFilterActive, setIsFilterActive } = useComboBoxFiltering({
446
- effectiveInputValue,
447
- filter
448
- });
449
- const localCollectionState = useListState({
450
- children,
451
- items: sortedItems,
452
- disabledKeys: props.disabledKeys,
453
- selectionMode: "none"
454
- });
455
- const { isFocused, focusProps } = useFocus$1();
456
- const checkInputValidity = useCallback(() => {
457
- if (!effectiveInputValue.trim()) return {
458
- isInputValid: false,
459
- singleMatchKey: null,
460
- filteredCount: 0
461
- };
462
- const filteredNodes = filterFn(localCollectionState.collection);
463
- const filteredItems = [];
464
- for (const node of filteredNodes) if (node.type === "section" && node.childNodes) {
465
- for (const child of node.childNodes) if (child.type === "item") filteredItems.push({
466
- key: child.key,
467
- textValue: child.textValue || ""
511
+ const [sortKey, setSortKey] = useState(effectiveSelectedKey);
512
+ if (!isPopoverOpen && sortKey !== effectiveSelectedKey) setSortKey(effectiveSelectedKey);
513
+ let children;
514
+ let sortedItems;
515
+ if ($[10] !== items || $[11] !== renderChildren || $[12] !== sortKey || $[13] !== sortSelectedToTop) {
516
+ sortedItems = items && sortSelectedToTop ? sortSelectedFirst(items, sortKey) : items;
517
+ children = renderChildren;
518
+ const renderFn = renderChildren;
519
+ if (sortedItems && typeof renderFn === "function") try {
520
+ children = Array.from(sortedItems).map((item, idx) => {
521
+ const rendered = renderFn(item);
522
+ if (React.isValidElement(rendered) && rendered.key == null) return React.cloneElement(rendered, { key: rendered?.key ?? item?.key ?? idx });
523
+ return rendered;
468
524
  });
469
- } else if (node.type === "item") filteredItems.push({
470
- key: node.key,
471
- textValue: node.textValue || ""
525
+ } catch {}
526
+ $[10] = items;
527
+ $[11] = renderChildren;
528
+ $[12] = sortKey;
529
+ $[13] = sortSelectedToTop;
530
+ $[14] = children;
531
+ $[15] = sortedItems;
532
+ } else {
533
+ children = $[14];
534
+ sortedItems = $[15];
535
+ }
536
+ const t17 = children;
537
+ let t18;
538
+ if ($[16] !== props.disabledKeys || $[17] !== sortedItems || $[18] !== t17) {
539
+ t18 = {
540
+ children: t17,
541
+ items: sortedItems,
542
+ disabledKeys: props.disabledKeys,
543
+ selectionMode: "none"
544
+ };
545
+ $[16] = props.disabledKeys;
546
+ $[17] = sortedItems;
547
+ $[18] = t17;
548
+ $[19] = t18;
549
+ } else t18 = $[19];
550
+ const localCollectionState = useListState(t18);
551
+ const { selectedLabel, pickLabel } = useSelectedLabel(localCollectionState.collection, effectiveSelectedKey);
552
+ const effectiveInputValue = isControlledInput ? inputValue : internalInputValue ?? selectedLabel;
553
+ let t19;
554
+ if ($[20] !== effectiveInputValue || $[21] !== filter) {
555
+ t19 = {
556
+ effectiveInputValue,
557
+ filter
558
+ };
559
+ $[20] = effectiveInputValue;
560
+ $[21] = filter;
561
+ $[22] = t19;
562
+ } else t19 = $[22];
563
+ const { filterFn, isSameText, setIsFilterActive } = useComboBoxFiltering(t19);
564
+ let t20;
565
+ if ($[23] !== filterFn || $[24] !== localCollectionState.collection) {
566
+ t20 = collectOptions(filterFn(localCollectionState.collection));
567
+ $[23] = filterFn;
568
+ $[24] = localCollectionState.collection;
569
+ $[25] = t20;
570
+ } else t20 = $[25];
571
+ const filteredOptions = t20;
572
+ const hasResults = filteredOptions.length > 0;
573
+ const shouldShowPopover = isPopoverOpen && hasResults;
574
+ const reportedOpenRef = useRef(shouldShowPopover);
575
+ let t21;
576
+ let t22;
577
+ if ($[26] !== onOpenChange || $[27] !== shouldShowPopover) {
578
+ t21 = () => {
579
+ if (reportedOpenRef.current === shouldShowPopover) return;
580
+ reportedOpenRef.current = shouldShowPopover;
581
+ onOpenChange?.(shouldShowPopover);
582
+ };
583
+ t22 = [shouldShowPopover, onOpenChange];
584
+ $[26] = onOpenChange;
585
+ $[27] = shouldShowPopover;
586
+ $[28] = t21;
587
+ $[29] = t22;
588
+ } else {
589
+ t21 = $[28];
590
+ t22 = $[29];
591
+ }
592
+ useEffect(t21, t22);
593
+ const { isFocused, focusProps } = useFocus$1();
594
+ let t23;
595
+ if ($[30] !== isControlledKey || $[31] !== setInternalSelectedKey) {
596
+ t23 = (key) => {
597
+ if (!isControlledKey) setInternalSelectedKey(key);
598
+ };
599
+ $[30] = isControlledKey;
600
+ $[31] = setInternalSelectedKey;
601
+ $[32] = t23;
602
+ } else t23 = $[32];
603
+ const setSelectedKey = t23;
604
+ let t24;
605
+ if ($[33] !== effectiveInputValue || $[34] !== isControlledInput || $[35] !== onInputChange || $[36] !== setInternalInputValue) {
606
+ t24 = (label_0) => {
607
+ if (!isControlledInput) setInternalInputValue(null);
608
+ if (label_0 !== effectiveInputValue) onInputChange?.(label_0);
609
+ };
610
+ $[33] = effectiveInputValue;
611
+ $[34] = isControlledInput;
612
+ $[35] = onInputChange;
613
+ $[36] = setInternalInputValue;
614
+ $[37] = t24;
615
+ } else t24 = $[37];
616
+ const showSelectionLabel = t24;
617
+ let t25;
618
+ if ($[38] !== effectiveSelectedKey || $[39] !== externalOnSelectionChange || $[40] !== setSelectedKey || $[41] !== showSelectionLabel) {
619
+ t25 = () => {
620
+ if (effectiveSelectedKey != null) {
621
+ externalOnSelectionChange?.(null);
622
+ setSelectedKey(null);
623
+ }
624
+ showSelectionLabel("");
625
+ };
626
+ $[38] = effectiveSelectedKey;
627
+ $[39] = externalOnSelectionChange;
628
+ $[40] = setSelectedKey;
629
+ $[41] = showSelectionLabel;
630
+ $[42] = t25;
631
+ } else t25 = $[42];
632
+ const clearSelectionAndInput = t25;
633
+ let t26;
634
+ if ($[43] !== selectedLabel || $[44] !== showSelectionLabel) {
635
+ t26 = () => showSelectionLabel(selectedLabel);
636
+ $[43] = selectedLabel;
637
+ $[44] = showSelectionLabel;
638
+ $[45] = t26;
639
+ } else t26 = $[45];
640
+ const restoreSelectedLabel = t26;
641
+ let t27;
642
+ if ($[46] !== clearSelectionAndInput || $[47] !== effectiveInputValue || $[48] !== effectiveSelectedKey || $[49] !== externalOnSelectionChange || $[50] !== restoreSelectedLabel || $[51] !== setSelectedKey || $[52] !== shouldCommitOnBlur || $[53] !== showSelectionLabel) {
643
+ t27 = () => {
644
+ const value_0 = effectiveInputValue.trim();
645
+ if (shouldCommitOnBlur && value_0 && effectiveSelectedKey == null) {
646
+ externalOnSelectionChange?.(value_0);
647
+ setSelectedKey(value_0);
648
+ showSelectionLabel(value_0);
649
+ } else if (!value_0) clearSelectionAndInput();
650
+ else restoreSelectedLabel();
651
+ };
652
+ $[46] = clearSelectionAndInput;
653
+ $[47] = effectiveInputValue;
654
+ $[48] = effectiveSelectedKey;
655
+ $[49] = externalOnSelectionChange;
656
+ $[50] = restoreSelectedLabel;
657
+ $[51] = setSelectedKey;
658
+ $[52] = shouldCommitOnBlur;
659
+ $[53] = showSelectionLabel;
660
+ $[54] = t27;
661
+ } else t27 = $[54];
662
+ const settleCustomValueOnBlur = t27;
663
+ let t28;
664
+ if ($[55] !== clearOnBlur || $[56] !== clearSelectionAndInput || $[57] !== effectiveInputValue || $[58] !== effectiveSelectedKey || $[59] !== externalOnSelectionChange || $[60] !== filteredOptions || $[61] !== isSameText || $[62] !== localCollectionState.disabledKeys || $[63] !== pickLabel || $[64] !== restoreSelectedLabel || $[65] !== setSelectedKey || $[66] !== showSelectionLabel) {
665
+ t28 = () => {
666
+ const matchKey = findTypedOption(filteredOptions, effectiveInputValue, effectiveSelectedKey, localCollectionState.disabledKeys, isSameText);
667
+ if (matchKey != null && matchKey !== effectiveSelectedKey) {
668
+ setSelectedKey(matchKey);
669
+ showSelectionLabel(pickLabel(matchKey));
670
+ externalOnSelectionChange?.(matchKey);
671
+ } else if (matchKey == null && (clearOnBlur || !effectiveInputValue.trim())) clearSelectionAndInput();
672
+ else restoreSelectedLabel();
673
+ };
674
+ $[55] = clearOnBlur;
675
+ $[56] = clearSelectionAndInput;
676
+ $[57] = effectiveInputValue;
677
+ $[58] = effectiveSelectedKey;
678
+ $[59] = externalOnSelectionChange;
679
+ $[60] = filteredOptions;
680
+ $[61] = isSameText;
681
+ $[62] = localCollectionState.disabledKeys;
682
+ $[63] = pickLabel;
683
+ $[64] = restoreSelectedLabel;
684
+ $[65] = setSelectedKey;
685
+ $[66] = showSelectionLabel;
686
+ $[67] = t28;
687
+ } else t28 = $[67];
688
+ const settleOptionOnBlur = t28;
689
+ let t29;
690
+ if ($[68] !== allowsCustomValue || $[69] !== isReadOnly || $[70] !== onBlur || $[71] !== setIsFilterActive || $[72] !== setIsPopoverOpen || $[73] !== settleCustomValueOnBlur || $[74] !== settleOptionOnBlur) {
691
+ t29 = () => {
692
+ setIsPopoverOpen(false);
693
+ if (isReadOnly) {} else if (allowsCustomValue) settleCustomValueOnBlur();
694
+ else settleOptionOnBlur();
695
+ onBlur?.();
696
+ setIsFilterActive(false);
697
+ };
698
+ $[68] = allowsCustomValue;
699
+ $[69] = isReadOnly;
700
+ $[70] = onBlur;
701
+ $[71] = setIsFilterActive;
702
+ $[72] = setIsPopoverOpen;
703
+ $[73] = settleCustomValueOnBlur;
704
+ $[74] = settleOptionOnBlur;
705
+ $[75] = t29;
706
+ } else t29 = $[75];
707
+ const handleCompositeBlur = useEvent(t29);
708
+ const t30 = wrapperRef;
709
+ let t31;
710
+ if ($[76] !== handleCompositeBlur || $[77] !== isDisabled || $[78] !== onFocus || $[79] !== popoverRef || $[80] !== t30) {
711
+ t31 = {
712
+ wrapperRef: t30,
713
+ popoverRef,
714
+ onFocus,
715
+ onBlur: handleCompositeBlur,
716
+ isDisabled
717
+ };
718
+ $[76] = handleCompositeBlur;
719
+ $[77] = isDisabled;
720
+ $[78] = onFocus;
721
+ $[79] = popoverRef;
722
+ $[80] = t30;
723
+ $[81] = t31;
724
+ } else t31 = $[81];
725
+ const { compositeFocusProps } = useCompositeFocus(t31);
726
+ let t32;
727
+ if ($[82] !== isInvalid || $[83] !== isValid) {
728
+ t32 = getValidationIcon({
729
+ isInvalid,
730
+ isValid
472
731
  });
473
- const filteredCount = filteredItems.length;
474
- const term = effectiveInputValue.trim().toLowerCase();
475
- const exactMatches = filteredItems.filter((item_2) => item_2.textValue.toLowerCase() === term);
476
- const match = exactMatches.find((item_4) => item_4.key === effectiveSelectedKey) ?? exactMatches.find((item_3) => !localCollectionState.disabledKeys.has(item_3.key)) ?? exactMatches[0] ?? (filteredCount === 1 ? filteredItems[0] : null);
477
- if (!match || match.key !== effectiveSelectedKey && localCollectionState.disabledKeys.has(match.key)) return {
478
- isInputValid: false,
479
- singleMatchKey: null,
480
- filteredCount
481
- };
482
- return {
483
- isInputValid: true,
484
- singleMatchKey: match.key,
485
- filteredCount
486
- };
487
- }, [
488
- effectiveInputValue,
489
- effectiveSelectedKey,
490
- filterFn,
491
- localCollectionState.collection,
492
- localCollectionState.disabledKeys
493
- ]);
494
- const setSelectedKey = (key_1) => {
495
- if (!isControlledKey) setInternalSelectedKey(key_1);
496
- };
497
- const setInputText = (value_0) => {
498
- if (!isControlledInput) setInternalInputValue(value_0);
499
- onInputChange?.(value_0);
500
- };
501
- const clearSelectionAndInput = () => {
502
- externalOnSelectionChange?.(null);
503
- setSelectedKey(null);
504
- setInputText("");
505
- };
506
- const restoreSelectedLabel = () => {
507
- setInputText(effectiveSelectedKey != null ? getItemLabel(effectiveSelectedKey) : "");
508
- };
509
- const settleCustomValueOnBlur = () => {
510
- if (shouldCommitOnBlur && effectiveInputValue && effectiveSelectedKey == null) {
511
- externalOnSelectionChange?.(effectiveInputValue);
512
- setSelectedKey(effectiveInputValue);
513
- } else if (!String(effectiveInputValue).trim()) clearSelectionAndInput();
514
- else restoreSelectedLabel();
515
- };
516
- const settleOptionOnBlur = () => {
517
- const { isInputValid, singleMatchKey } = checkInputValidity();
518
- if (isInputValid && singleMatchKey != null && singleMatchKey !== effectiveSelectedKey) {
519
- const label_0 = getItemLabel(singleMatchKey);
520
- setSelectedKey(singleMatchKey);
521
- setInputText(label_0);
522
- externalOnSelectionChange?.(singleMatchKey);
523
- } else if (!isInputValid && (clearOnBlur || !effectiveInputValue.trim())) clearSelectionAndInput();
524
- else restoreSelectedLabel();
525
- };
526
- const handleCompositeBlur = useEvent(() => {
527
- setIsPopoverOpen(false);
528
- if (allowsCustomValue) settleCustomValueOnBlur();
529
- else settleOptionOnBlur();
530
- onBlur?.();
531
- setIsFilterActive(false);
532
- });
533
- const { compositeFocusProps } = useCompositeFocus({
534
- wrapperRef,
535
- popoverRef,
536
- onFocus,
537
- onBlur: handleCompositeBlur,
538
- isDisabled
539
- });
540
- let validationIcon = getValidationIcon({
541
- isInvalid,
542
- isValid
543
- });
732
+ $[82] = isInvalid;
733
+ $[83] = isValid;
734
+ $[84] = t32;
735
+ } else t32 = $[84];
736
+ const validationIcon = t32;
544
737
  const listStateRef = useRef(null);
545
- const focusInitAttemptsRef = useRef(0);
546
738
  const [activeOptionKey, setActiveOptionKey] = useState(null);
547
- const getItemLabel = useCallback((key_2) => {
548
- return (localCollectionState?.collection?.getItem(key_2))?.textValue || String(key_2);
549
- }, [localCollectionState?.collection]);
550
739
  const handleSelectionChange = useEvent((selection) => {
551
- const key_3 = Array.isArray(selection) ? selection[0] : selection;
552
- if (!isControlledKey) setInternalSelectedKey(key_3 ?? null);
553
- if (key_3 != null) {
554
- setIsFilterActive(false);
555
- const label_1 = getItemLabel(key_3);
556
- if (!isControlledInput) setInternalInputValue(label_1);
557
- onInputChange?.(label_1);
558
- } else {
559
- if (!isControlledInput) setInternalInputValue("");
560
- onInputChange?.("");
561
- setIsFilterActive(false);
562
- }
563
- externalOnSelectionChange?.(key_3);
740
+ const key_0 = Array.isArray(selection) ? selection[0] : selection;
741
+ setSelectedKey(key_0 ?? null);
742
+ setIsFilterActive(false);
743
+ showSelectionLabel(key_0 != null ? pickLabel(key_0) : "");
744
+ externalOnSelectionChange?.(key_0);
564
745
  setIsPopoverOpen(false);
565
746
  setTimeout(() => {
566
747
  inputRef.current?.focus();
@@ -568,304 +749,590 @@ const ComboBox = forwardRef(function ComboBox(props, ref) {
568
749
  });
569
750
  const lastSyncedSelectedKey = useRef(void 0);
570
751
  const selectionClearedByTyping = useRef(false);
571
- const handleInputChange = useEvent((e) => {
572
- const value_1 = e.target.value;
573
- if (!isControlledInput) setInternalInputValue(value_1);
574
- onInputChange?.(value_1);
575
- setIsFilterActive(value_1.trim().length > 0);
576
- if (allowsCustomValue && effectiveSelectedKey != null) {
577
- selectionClearedByTyping.current = true;
578
- if (!isControlledKey) setInternalSelectedKey(null);
579
- externalOnSelectionChange?.(null);
580
- }
581
- if (popoverTrigger !== "manual" && value_1 && !isPopoverOpen) setIsPopoverOpen(true);
582
- });
583
- const [hasInitialized, setHasInitialized] = useState(false);
584
- useEffect(() => {
585
- if (hasInitialized || isControlledInput) return;
586
- if (defaultInputValue !== void 0) {
587
- setInternalInputValue(defaultInputValue);
588
- setHasInitialized(true);
589
- return;
590
- }
591
- if (defaultSelectedKey) {
592
- setInternalInputValue(getItemLabel(defaultSelectedKey));
593
- setHasInitialized(true);
594
- }
595
- }, [
596
- hasInitialized,
597
- isControlledInput,
598
- defaultInputValue,
599
- defaultSelectedKey,
600
- getItemLabel,
601
- children
602
- ]);
603
- useEffect(() => {
604
- const preserveTypedInput = selectionClearedByTyping.current;
605
- selectionClearedByTyping.current = false;
606
- if (!isControlledKey || isControlledInput) return;
607
- if (lastSyncedSelectedKey.current !== void 0 && lastSyncedSelectedKey.current === effectiveSelectedKey) return;
608
- lastSyncedSelectedKey.current = effectiveSelectedKey;
609
- if (preserveTypedInput && effectiveSelectedKey == null) return;
610
- setInternalInputValue(effectiveSelectedKey != null ? getItemLabel(effectiveSelectedKey) : "");
611
- }, [
612
- isControlledKey,
613
- isControlledInput,
614
- effectiveSelectedKey,
615
- effectiveInputValue,
616
- getItemLabel
617
- ]);
618
- const handleInputFocus = useEvent((e_0) => {
619
- focusProps.onFocus?.(e_0);
620
- if (popoverTrigger === "focus" && !isPopoverOpen) setIsPopoverOpen(true);
621
- });
622
- const handleInputBlur = useEvent((e_1) => {
623
- focusProps.onBlur?.(e_1);
624
- });
625
- let showClearButton = isClearable && (allowsCustomValue ? effectiveInputValue !== "" : effectiveSelectedKey != null) && !isDisabled && !isReadOnly;
626
- const hasResults = useMemo(() => {
627
- if (!children) return false;
628
- if (!Array.isArray(children) && children === null) return false;
629
- if (localCollectionState?.collection) {
630
- const filteredNodes_0 = filterFn(localCollectionState.collection);
631
- return Array.from(filteredNodes_0).flatMap((node_0) => {
632
- if (node_0.type === "section" && node_0.childNodes) return [...node_0.childNodes];
633
- return [node_0];
634
- }).length > 0;
635
- }
636
- return Array.isArray(children) ? children.length > 0 : true;
637
- }, [
638
- children,
639
- localCollectionState?.collection,
640
- filterFn
641
- ]);
642
- let clearValue = useEvent(() => {
643
- if (!isControlledInput) setInternalInputValue("");
752
+ let t33;
753
+ if ($[85] !== allowsCustomValue || $[86] !== effectiveSelectedKey || $[87] !== externalOnSelectionChange || $[88] !== isControlledInput || $[89] !== isControlledKey || $[90] !== isPopoverOpen || $[91] !== onInputChange || $[92] !== popoverTrigger || $[93] !== setInternalInputValue || $[94] !== setInternalSelectedKey || $[95] !== setIsFilterActive || $[96] !== setIsPopoverOpen) {
754
+ t33 = (e) => {
755
+ const value_1 = e.target.value;
756
+ if (!isControlledInput) setInternalInputValue(value_1);
757
+ onInputChange?.(value_1);
758
+ setIsFilterActive(value_1.trim().length > 0);
759
+ if (allowsCustomValue && effectiveSelectedKey != null) {
760
+ selectionClearedByTyping.current = true;
761
+ if (!isControlledKey) setInternalSelectedKey(null);
762
+ externalOnSelectionChange?.(null);
763
+ }
764
+ if (popoverTrigger !== "manual" && value_1 && !isPopoverOpen) setIsPopoverOpen(true);
765
+ };
766
+ $[85] = allowsCustomValue;
767
+ $[86] = effectiveSelectedKey;
768
+ $[87] = externalOnSelectionChange;
769
+ $[88] = isControlledInput;
770
+ $[89] = isControlledKey;
771
+ $[90] = isPopoverOpen;
772
+ $[91] = onInputChange;
773
+ $[92] = popoverTrigger;
774
+ $[93] = setInternalInputValue;
775
+ $[94] = setInternalSelectedKey;
776
+ $[95] = setIsFilterActive;
777
+ $[96] = setIsPopoverOpen;
778
+ $[97] = t33;
779
+ } else t33 = $[97];
780
+ const handleInputChange = useEvent(t33);
781
+ let t34;
782
+ if ($[98] !== effectiveSelectedKey || $[99] !== isControlledInput || $[100] !== isControlledKey || $[101] !== setInternalInputValue) {
783
+ t34 = () => {
784
+ const preserveTypedInput = selectionClearedByTyping.current;
785
+ selectionClearedByTyping.current = false;
786
+ if (!isControlledKey || isControlledInput) return;
787
+ if (lastSyncedSelectedKey.current !== void 0 && lastSyncedSelectedKey.current === effectiveSelectedKey) return;
788
+ lastSyncedSelectedKey.current = effectiveSelectedKey;
789
+ if (preserveTypedInput && effectiveSelectedKey == null) return;
790
+ setInternalInputValue(null);
791
+ };
792
+ $[98] = effectiveSelectedKey;
793
+ $[99] = isControlledInput;
794
+ $[100] = isControlledKey;
795
+ $[101] = setInternalInputValue;
796
+ $[102] = t34;
797
+ } else t34 = $[102];
798
+ let t35;
799
+ if ($[103] !== effectiveInputValue || $[104] !== effectiveSelectedKey || $[105] !== isControlledInput || $[106] !== isControlledKey || $[107] !== setInternalInputValue) {
800
+ t35 = [
801
+ isControlledKey,
802
+ isControlledInput,
803
+ effectiveSelectedKey,
804
+ effectiveInputValue,
805
+ setInternalInputValue
806
+ ];
807
+ $[103] = effectiveInputValue;
808
+ $[104] = effectiveSelectedKey;
809
+ $[105] = isControlledInput;
810
+ $[106] = isControlledKey;
811
+ $[107] = setInternalInputValue;
812
+ $[108] = t35;
813
+ } else t35 = $[108];
814
+ useEffect(t34, t35);
815
+ const showClearButton = isClearable && (allowsCustomValue ? effectiveInputValue !== "" : effectiveSelectedKey != null) && !isDisabled && !isReadOnly;
816
+ let t36;
817
+ if ($[109] !== hasResults || $[110] !== isDisabled || $[111] !== isReadOnly || $[112] !== setIsFilterActive || $[113] !== setIsPopoverOpen) {
818
+ t36 = () => {
819
+ if (isReadOnly || isDisabled) return;
820
+ if (!hasResults) setIsFilterActive(false);
821
+ setIsPopoverOpen(true);
822
+ };
823
+ $[109] = hasResults;
824
+ $[110] = isDisabled;
825
+ $[111] = isReadOnly;
826
+ $[112] = setIsFilterActive;
827
+ $[113] = setIsPopoverOpen;
828
+ $[114] = t36;
829
+ } else t36 = $[114];
830
+ const openList = t36;
831
+ const toggleList = () => {
832
+ if (shouldShowPopover) setIsPopoverOpen(false);
833
+ else openList();
834
+ inputRef.current?.focus();
835
+ };
836
+ let t37;
837
+ if ($[115] !== focusProps || $[116] !== isPopoverOpen || $[117] !== openList || $[118] !== popoverTrigger) {
838
+ t37 = (e_0) => {
839
+ focusProps.onFocus?.(e_0);
840
+ if (popoverTrigger === "focus" && !isPopoverOpen) openList();
841
+ };
842
+ $[115] = focusProps;
843
+ $[116] = isPopoverOpen;
844
+ $[117] = openList;
845
+ $[118] = popoverTrigger;
846
+ $[119] = t37;
847
+ } else t37 = $[119];
848
+ const handleInputFocus = useEvent(t37);
849
+ const pressStartedOnInputRef = useRef(false);
850
+ let t38;
851
+ if ($[120] !== hasResults || $[121] !== openList || $[122] !== popoverTrigger || $[123] !== shouldShowPopover) {
852
+ t38 = () => {
853
+ const isInputPress = pressStartedOnInputRef.current;
854
+ pressStartedOnInputRef.current = false;
855
+ if (!isInputPress || popoverTrigger === "manual") return;
856
+ if (!shouldShowPopover && hasResults) openList();
857
+ };
858
+ $[120] = hasResults;
859
+ $[121] = openList;
860
+ $[122] = popoverTrigger;
861
+ $[123] = shouldShowPopover;
862
+ $[124] = t38;
863
+ } else t38 = $[124];
864
+ const handleInputClick = t38;
865
+ let t39;
866
+ if ($[125] !== focusProps) {
867
+ t39 = (e_1) => {
868
+ focusProps.onBlur?.(e_1);
869
+ };
870
+ $[125] = focusProps;
871
+ $[126] = t39;
872
+ } else t39 = $[126];
873
+ const handleInputBlur = useEvent(t39);
874
+ const clearValue = useEvent(() => {
875
+ if (!isControlledInput) setInternalInputValue(null);
644
876
  onInputChange?.("");
645
- if (!isControlledKey) setInternalSelectedKey(null);
877
+ setSelectedKey(null);
646
878
  externalOnSelectionChange?.(null);
647
879
  if (isPopoverOpen) setIsPopoverOpen(false);
648
880
  inputRef.current?.focus();
649
881
  onClear?.();
650
882
  });
651
- const { keyboardProps } = useComboBoxKeyboard({
652
- isPopoverOpen,
653
- listStateRef,
654
- hasResults,
655
- allowsCustomValue,
656
- effectiveInputValue,
657
- isClearable,
658
- onSelectionChange: handleSelectionChange,
659
- onClearValue: clearValue,
660
- onOpenPopover: () => setIsPopoverOpen(true),
661
- onClosePopover: () => setIsPopoverOpen(false),
662
- inputRef,
663
- setIsFilterActive,
664
- onVirtualFocus: setActiveOptionKey,
665
- onKeyDown
666
- });
883
+ let t40;
884
+ if ($[127] !== setIsPopoverOpen) {
885
+ t40 = () => setIsPopoverOpen(false);
886
+ $[127] = setIsPopoverOpen;
887
+ $[128] = t40;
888
+ } else t40 = $[128];
889
+ const t41 = inputRef;
890
+ let t42;
891
+ if ($[129] !== allowsCustomValue || $[130] !== clearValue || $[131] !== effectiveInputValue || $[132] !== effectiveSelectedKey || $[133] !== handleSelectionChange || $[134] !== hasResults || $[135] !== isClearable || $[136] !== isReadOnly || $[137] !== onKeyDown || $[138] !== openList || $[139] !== selectedLabel || $[140] !== setActiveOptionKey || $[141] !== shouldShowPopover || $[142] !== t40 || $[143] !== t41) {
892
+ t42 = {
893
+ isListShown: shouldShowPopover,
894
+ isReadOnly,
895
+ listStateRef,
896
+ hasResults,
897
+ allowsCustomValue,
898
+ effectiveInputValue,
899
+ selectedKey: effectiveSelectedKey,
900
+ selectedLabel,
901
+ isClearable,
902
+ onSelectionChange: handleSelectionChange,
903
+ onClearValue: clearValue,
904
+ onOpenList: openList,
905
+ onCloseList: t40,
906
+ inputRef: t41,
907
+ onVirtualFocus: setActiveOptionKey,
908
+ onKeyDown
909
+ };
910
+ $[129] = allowsCustomValue;
911
+ $[130] = clearValue;
912
+ $[131] = effectiveInputValue;
913
+ $[132] = effectiveSelectedKey;
914
+ $[133] = handleSelectionChange;
915
+ $[134] = hasResults;
916
+ $[135] = isClearable;
917
+ $[136] = isReadOnly;
918
+ $[137] = onKeyDown;
919
+ $[138] = openList;
920
+ $[139] = selectedLabel;
921
+ $[140] = setActiveOptionKey;
922
+ $[141] = shouldShowPopover;
923
+ $[142] = t40;
924
+ $[143] = t41;
925
+ $[144] = t42;
926
+ } else t42 = $[144];
927
+ const { keyboardProps } = useComboBoxKeyboard(t42);
667
928
  if (icon) {
668
- icon = /* @__PURE__ */ jsx("div", {
669
- "data-element": "InputIcon",
670
- children: icon
671
- });
929
+ let t43;
930
+ if ($[145] !== icon) {
931
+ t43 = /* @__PURE__ */ jsx("div", {
932
+ "data-element": "InputIcon",
933
+ children: icon
934
+ });
935
+ $[145] = icon;
936
+ $[146] = t43;
937
+ } else t43 = $[146];
938
+ icon = t43;
672
939
  if (prefix) prefix = /* @__PURE__ */ jsxs(Fragment$1, { children: [icon, prefix] });
673
940
  else prefix = icon;
674
941
  }
675
- let mods = useMemo(() => ({
676
- ...getValidationMods({
942
+ let t43;
943
+ if ($[147] !== isInvalid || $[148] !== isValid) {
944
+ t43 = getValidationMods({
677
945
  isInvalid,
678
946
  isValid
679
- }),
680
- disabled: isDisabled,
681
- hovered: false,
682
- focused: isFocused,
683
- loading: isLoading,
684
- prefix: !!prefix,
685
- suffix: true,
686
- clearable: showClearButton
687
- }), [
688
- isInvalid,
689
- isValid,
690
- isDisabled,
691
- isFocused,
692
- isLoading,
693
- prefix,
694
- showClearButton
695
- ]);
696
- const comboBoxWidth = wrapperRef?.current?.offsetWidth;
697
- const shouldShowPopover = Boolean(isPopoverOpen && hasResults);
698
- useEffect(() => {
699
- if (isPopoverOpen && !hasResults) setIsPopoverOpen(false);
700
- }, [isPopoverOpen, hasResults]);
701
- const ensureInitialFocus = useCallback(() => {
702
- if (!shouldShowPopover) return;
703
- const listState = listStateRef.current;
704
- if (!listState) return;
705
- const { selectionManager, collection, disabledKeys, lastFocusSourceRef } = listState;
706
- if (!selectionManager || !collection) return;
707
- const collectFirstKey = () => {
708
- for (const node_1 of collection) if (node_1.type === "item") {
709
- if (!disabledKeys?.has(node_1.key)) return node_1.key;
710
- } else if (node_1.childNodes) {
711
- for (const child_0 of node_1.childNodes) if (child_0.type === "item" && !disabledKeys?.has(child_0.key)) return child_0.key;
712
- }
713
- return null;
714
- };
715
- if (lastFocusSourceRef) lastFocusSourceRef.current = "keyboard";
716
- const currentFocusedKey = selectionManager.focusedKey;
717
- let needsRefocus = false;
718
- if (currentFocusedKey == null) needsRefocus = true;
719
- else if (!(collection.getItem(currentFocusedKey) != null)) needsRefocus = true;
720
- if (!needsRefocus) setActiveOptionKey(currentFocusedKey);
721
- else {
722
- let keyToFocus = null;
723
- if (effectiveSelectedKey != null && collection.getItem(effectiveSelectedKey) != null) keyToFocus = effectiveSelectedKey;
724
- else keyToFocus = collectFirstKey();
725
- if (keyToFocus != null) {
726
- selectionManager.setFocusedKey(keyToFocus);
727
- setActiveOptionKey(keyToFocus);
728
- }
729
- }
730
- }, [
731
- shouldShowPopover,
732
- effectiveSelectedKey,
733
- setActiveOptionKey
734
- ]);
735
- useLayoutEffect$1(() => {
736
- if (!shouldShowPopover) return;
737
- focusInitAttemptsRef.current = 0;
738
- const tick = () => {
947
+ });
948
+ $[147] = isInvalid;
949
+ $[148] = isValid;
950
+ $[149] = t43;
951
+ } else t43 = $[149];
952
+ const t44 = !!prefix;
953
+ let t45;
954
+ if ($[150] !== isDisabled || $[151] !== isFocused || $[152] !== isLoading || $[153] !== showClearButton || $[154] !== t43 || $[155] !== t44) {
955
+ t45 = {
956
+ ...t43,
957
+ disabled: isDisabled,
958
+ hovered: false,
959
+ focused: isFocused,
960
+ loading: isLoading,
961
+ prefix: t44,
962
+ suffix: true,
963
+ clearable: showClearButton
964
+ };
965
+ $[150] = isDisabled;
966
+ $[151] = isFocused;
967
+ $[152] = isLoading;
968
+ $[153] = showClearButton;
969
+ $[154] = t43;
970
+ $[155] = t44;
971
+ $[156] = t45;
972
+ } else t45 = $[156];
973
+ const mods = t45;
974
+ const [comboBoxWidth, setComboBoxWidth] = useState();
975
+ let t46;
976
+ let t47;
977
+ if ($[157] !== hasResults || $[158] !== isPopoverOpen || $[159] !== setIsPopoverOpen) {
978
+ t46 = () => {
979
+ if (isPopoverOpen && !hasResults) setIsPopoverOpen(false);
980
+ };
981
+ t47 = [
982
+ isPopoverOpen,
983
+ hasResults,
984
+ setIsPopoverOpen
985
+ ];
986
+ $[157] = hasResults;
987
+ $[158] = isPopoverOpen;
988
+ $[159] = setIsPopoverOpen;
989
+ $[160] = t46;
990
+ $[161] = t47;
991
+ } else {
992
+ t46 = $[160];
993
+ t47 = $[161];
994
+ }
995
+ useEffect(t46, t47);
996
+ let t48;
997
+ if ($[162] !== effectiveSelectedKey || $[163] !== setActiveOptionKey || $[164] !== shouldShowPopover || $[165] !== wrapperRef) {
998
+ t48 = () => {
739
999
  if (!shouldShowPopover) return;
740
- ensureInitialFocus();
741
- focusInitAttemptsRef.current += 1;
742
- if (focusInitAttemptsRef.current < 8 && listStateRef.current?.selectionManager?.focusedKey == null) requestAnimationFrame(tick);
743
- };
744
- requestAnimationFrame(() => requestAnimationFrame(tick));
745
- }, [shouldShowPopover, ensureInitialFocus]);
746
- const comboBoxField = /* @__PURE__ */ jsxs(ComboBoxWrapperElement, {
747
- ref: wrapperRef,
748
- mods,
749
- styles,
750
- style: { zIndex: isFocused ? 1 : "initial" },
751
- "data-size": size,
752
- ...compositeFocusProps,
753
- children: [
754
- prefix ? /* @__PURE__ */ jsx("div", {
755
- "data-element": "Prefix",
756
- children: prefix
757
- }) : null,
758
- /* @__PURE__ */ jsx(ComboBoxInput, {
759
- qa: qa || "ComboBox",
760
- inputRef,
761
- id,
762
- value: effectiveInputValue,
763
- placeholder,
764
- isDisabled,
765
- isReadOnly,
766
- isRequired,
767
- autoFocus,
768
- autoComplete,
769
- size,
770
- mods,
771
- inputStyles,
772
- keyboardProps,
773
- focusProps: {
774
- ...focusProps,
775
- onBlur: handleInputBlur
776
- },
777
- isPopoverOpen,
778
- hasResults,
779
- comboBoxId,
780
- activeDescendant: shouldShowPopover && activeOptionKey != null ? getListBoxOptionId(`ComboBoxListBox-${comboBoxId}`, activeOptionKey) : void 0,
781
- onChange: handleInputChange,
782
- onFocus: handleInputFocus,
783
- ariaProps: {
784
- "aria-label": props["aria-label"],
785
- "aria-labelledby": props["aria-labelledby"],
786
- "aria-describedby": props["aria-describedby"]
787
- },
788
- isInvalid
789
- }),
790
- /* @__PURE__ */ jsxs("div", {
791
- "data-element": "Suffix",
792
- children: [
793
- suffixPosition === "before" ? suffix : null,
794
- isLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "data-element": "InputIcon" }) : validationIcon,
795
- suffixPosition === "after" ? suffix : null,
796
- showClearButton && /* @__PURE__ */ jsx(_CollectionItem.Action, {
797
- icon: /* @__PURE__ */ jsx(CloseIcon, {}),
798
- size,
799
- qa: "ComboBoxClearButton",
800
- "data-no-trigger": hideTrigger ? "" : void 0,
801
- "data-popover-dismiss": "",
802
- "aria-label": t("comboBox.clearValue", "Clear value"),
803
- onPress: clearValue
804
- }),
805
- !hideTrigger ? /* @__PURE__ */ jsx(_CollectionItem.Action, {
806
- ref: triggerRef,
807
- "data-popover-trigger": true,
808
- icon: /* @__PURE__ */ jsx(DirectionIcon, { to: isPopoverOpen ? "up" : "down" }),
809
- qa: "ComboBoxTrigger",
810
- mods: {
811
- pressed: isPopoverOpen,
812
- disabled: isDisabled,
813
- loading: isLoading
814
- },
815
- "data-size": size,
816
- isDisabled,
817
- styles: triggerStyles,
818
- "aria-expanded": isPopoverOpen,
819
- "aria-haspopup": "listbox",
820
- "aria-label": t("comboBox.showOptions", "Show options"),
821
- onPress: () => {
822
- if (!isDisabled) {
823
- const willOpen = !isPopoverOpen;
824
- setIsPopoverOpen(willOpen);
825
- if (willOpen) {
826
- inputRef.current?.focus();
827
- if (!hasResults) setIsFilterActive(false);
828
- }
829
- }
830
- }
831
- }) : null
832
- ]
833
- }),
834
- /* @__PURE__ */ jsx(ListBoxPopover, {
835
- isOpen: shouldShowPopover,
836
- triggerRef: wrapperRef,
837
- popoverRef,
838
- listBoxRef,
839
- direction,
840
- shouldFlip,
841
- overlayOffset,
842
- containerPadding,
843
- comboBoxWidth,
844
- listBoxId: `ComboBoxListBox-${comboBoxId}`,
845
- overlayStyles,
846
- listBoxStyles,
847
- optionStyles,
848
- sectionStyles,
849
- headingStyles,
850
- listGap,
851
- selectedKey: effectiveSelectedKey,
852
- isDisabled,
853
- disabledKeys: props.disabledKeys,
854
- items: sortedItems,
855
- listStateRef,
856
- label,
857
- ariaLabel: props["aria-label"],
858
- compositeFocusProps,
859
- filter: filterFn,
860
- size,
861
- onSelectionChange: handleSelectionChange,
862
- onClose: () => setIsPopoverOpen(false),
863
- children
864
- })
865
- ]
866
- });
867
- const { children: _, ...propsWithoutChildren } = props;
868
- return wrapWithField(comboBoxField, ref, propsWithoutChildren);
1000
+ setComboBoxWidth(wrapperRef.current?.offsetWidth);
1001
+ let attempts = 0;
1002
+ let frame = 0;
1003
+ const tick = () => {
1004
+ const key_1 = highlightOption(listStateRef.current, effectiveSelectedKey);
1005
+ if (key_1 != null) setActiveOptionKey(key_1);
1006
+ attempts = attempts + 1;
1007
+ if (key_1 == null && attempts < 8) frame = requestAnimationFrame(tick);
1008
+ };
1009
+ frame = requestAnimationFrame(() => {
1010
+ frame = requestAnimationFrame(tick);
1011
+ });
1012
+ return () => cancelAnimationFrame(frame);
1013
+ };
1014
+ $[162] = effectiveSelectedKey;
1015
+ $[163] = setActiveOptionKey;
1016
+ $[164] = shouldShowPopover;
1017
+ $[165] = wrapperRef;
1018
+ $[166] = t48;
1019
+ } else t48 = $[166];
1020
+ let t49;
1021
+ if ($[167] !== effectiveInputValue || $[168] !== effectiveSelectedKey || $[169] !== shouldShowPopover || $[170] !== wrapperRef) {
1022
+ t49 = [
1023
+ shouldShowPopover,
1024
+ effectiveSelectedKey,
1025
+ effectiveInputValue,
1026
+ wrapperRef
1027
+ ];
1028
+ $[167] = effectiveInputValue;
1029
+ $[168] = effectiveSelectedKey;
1030
+ $[169] = shouldShowPopover;
1031
+ $[170] = wrapperRef;
1032
+ $[171] = t49;
1033
+ } else t49 = $[171];
1034
+ useLayoutEffect$1(t48, t49);
1035
+ let t50;
1036
+ if ($[172] !== activeOptionKey || $[173] !== comboBoxId || $[174] !== filteredOptions || $[175] !== shouldShowPopover) {
1037
+ t50 = shouldShowPopover && activeOptionKey != null && filteredOptions.some((option) => option.key === activeOptionKey) ? getListBoxOptionId(`ComboBoxListBox-${comboBoxId}`, activeOptionKey) : void 0;
1038
+ $[172] = activeOptionKey;
1039
+ $[173] = comboBoxId;
1040
+ $[174] = filteredOptions;
1041
+ $[175] = shouldShowPopover;
1042
+ $[176] = t50;
1043
+ } else t50 = $[176];
1044
+ const activeDescendant = t50;
1045
+ const t51 = isFocused ? 1 : "initial";
1046
+ let t52;
1047
+ if ($[177] !== t51) {
1048
+ t52 = { zIndex: t51 };
1049
+ $[177] = t51;
1050
+ $[178] = t52;
1051
+ } else t52 = $[178];
1052
+ let t53;
1053
+ if ($[179] !== prefix) {
1054
+ t53 = prefix ? /* @__PURE__ */ jsx("div", {
1055
+ "data-element": "Prefix",
1056
+ children: prefix
1057
+ }) : null;
1058
+ $[179] = prefix;
1059
+ $[180] = t53;
1060
+ } else t53 = $[180];
1061
+ const t54 = qa || "ComboBox";
1062
+ let t55;
1063
+ if ($[181] !== focusProps || $[182] !== handleInputBlur) {
1064
+ t55 = {
1065
+ ...focusProps,
1066
+ onBlur: handleInputBlur
1067
+ };
1068
+ $[181] = focusProps;
1069
+ $[182] = handleInputBlur;
1070
+ $[183] = t55;
1071
+ } else t55 = $[183];
1072
+ let t56;
1073
+ if ($[184] === Symbol.for("react.memo_cache_sentinel")) {
1074
+ t56 = () => {
1075
+ pressStartedOnInputRef.current = true;
1076
+ };
1077
+ $[184] = t56;
1078
+ } else t56 = $[184];
1079
+ const t57 = props["aria-label"];
1080
+ const t58 = props["aria-labelledby"];
1081
+ const t59 = props["aria-describedby"];
1082
+ let t60;
1083
+ if ($[185] !== t57 || $[186] !== t58 || $[187] !== t59) {
1084
+ t60 = {
1085
+ "aria-label": t57,
1086
+ "aria-labelledby": t58,
1087
+ "aria-describedby": t59
1088
+ };
1089
+ $[185] = t57;
1090
+ $[186] = t58;
1091
+ $[187] = t59;
1092
+ $[188] = t60;
1093
+ } else t60 = $[188];
1094
+ let t61;
1095
+ if ($[189] !== activeDescendant || $[190] !== autoComplete || $[191] !== autoFocus || $[192] !== comboBoxId || $[193] !== effectiveInputValue || $[194] !== handleInputChange || $[195] !== handleInputClick || $[196] !== handleInputFocus || $[197] !== id || $[198] !== inputRef || $[199] !== inputStyles || $[200] !== isDisabled || $[201] !== isInvalid || $[202] !== isReadOnly || $[203] !== isRequired || $[204] !== keyboardProps || $[205] !== mods || $[206] !== placeholder || $[207] !== shouldShowPopover || $[208] !== size || $[209] !== t54 || $[210] !== t55 || $[211] !== t60) {
1096
+ t61 = /* @__PURE__ */ jsx(ComboBoxInput, {
1097
+ qa: t54,
1098
+ inputRef,
1099
+ id,
1100
+ value: effectiveInputValue,
1101
+ placeholder,
1102
+ isDisabled,
1103
+ isReadOnly,
1104
+ isRequired,
1105
+ autoFocus,
1106
+ autoComplete,
1107
+ size,
1108
+ mods,
1109
+ inputStyles,
1110
+ keyboardProps,
1111
+ focusProps: t55,
1112
+ isListShown: shouldShowPopover,
1113
+ comboBoxId,
1114
+ activeDescendant,
1115
+ onChange: handleInputChange,
1116
+ onFocus: handleInputFocus,
1117
+ onPointerDown: t56,
1118
+ onClick: handleInputClick,
1119
+ ariaProps: t60,
1120
+ isInvalid
1121
+ });
1122
+ $[189] = activeDescendant;
1123
+ $[190] = autoComplete;
1124
+ $[191] = autoFocus;
1125
+ $[192] = comboBoxId;
1126
+ $[193] = effectiveInputValue;
1127
+ $[194] = handleInputChange;
1128
+ $[195] = handleInputClick;
1129
+ $[196] = handleInputFocus;
1130
+ $[197] = id;
1131
+ $[198] = inputRef;
1132
+ $[199] = inputStyles;
1133
+ $[200] = isDisabled;
1134
+ $[201] = isInvalid;
1135
+ $[202] = isReadOnly;
1136
+ $[203] = isRequired;
1137
+ $[204] = keyboardProps;
1138
+ $[205] = mods;
1139
+ $[206] = placeholder;
1140
+ $[207] = shouldShowPopover;
1141
+ $[208] = size;
1142
+ $[209] = t54;
1143
+ $[210] = t55;
1144
+ $[211] = t60;
1145
+ $[212] = t61;
1146
+ } else t61 = $[212];
1147
+ const t62 = suffixPosition === "before" ? suffix : null;
1148
+ let t63;
1149
+ if ($[213] !== isLoading || $[214] !== validationIcon) {
1150
+ t63 = isLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "data-element": "InputIcon" }) : validationIcon;
1151
+ $[213] = isLoading;
1152
+ $[214] = validationIcon;
1153
+ $[215] = t63;
1154
+ } else t63 = $[215];
1155
+ const t64 = suffixPosition === "after" ? suffix : null;
1156
+ let t65;
1157
+ if ($[216] !== clearValue || $[217] !== hideTrigger || $[218] !== showClearButton || $[219] !== size || $[220] !== t) {
1158
+ t65 = showClearButton && /* @__PURE__ */ jsx(_CollectionItem.Action, {
1159
+ excludeFromTabOrder: true,
1160
+ icon: /* @__PURE__ */ jsx(CloseIcon, {}),
1161
+ size,
1162
+ qa: "ComboBoxClearButton",
1163
+ "data-no-trigger": hideTrigger ? "" : void 0,
1164
+ "data-popover-dismiss": "",
1165
+ "aria-label": t("comboBox.clearValue", "Clear value"),
1166
+ onPress: clearValue
1167
+ });
1168
+ $[216] = clearValue;
1169
+ $[217] = hideTrigger;
1170
+ $[218] = showClearButton;
1171
+ $[219] = size;
1172
+ $[220] = t;
1173
+ $[221] = t65;
1174
+ } else t65 = $[221];
1175
+ let t66;
1176
+ if ($[222] !== hideTrigger || $[223] !== isDisabled || $[224] !== isLoading || $[225] !== shouldShowPopover || $[226] !== size || $[227] !== t || $[228] !== toggleList || $[229] !== triggerRef || $[230] !== triggerStyles) {
1177
+ t66 = !hideTrigger ? /* @__PURE__ */ jsx(_CollectionItem.Action, {
1178
+ ref: triggerRef,
1179
+ excludeFromTabOrder: true,
1180
+ "data-popover-trigger": true,
1181
+ icon: /* @__PURE__ */ jsx(DirectionIcon, { to: shouldShowPopover ? "up" : "down" }),
1182
+ qa: "ComboBoxTrigger",
1183
+ mods: {
1184
+ pressed: shouldShowPopover,
1185
+ disabled: isDisabled,
1186
+ loading: isLoading
1187
+ },
1188
+ "data-size": size,
1189
+ isDisabled,
1190
+ styles: triggerStyles,
1191
+ "aria-expanded": shouldShowPopover,
1192
+ "aria-haspopup": "listbox",
1193
+ "aria-label": t("comboBox.showOptions", "Show options"),
1194
+ onPress: toggleList
1195
+ }) : null;
1196
+ $[222] = hideTrigger;
1197
+ $[223] = isDisabled;
1198
+ $[224] = isLoading;
1199
+ $[225] = shouldShowPopover;
1200
+ $[226] = size;
1201
+ $[227] = t;
1202
+ $[228] = toggleList;
1203
+ $[229] = triggerRef;
1204
+ $[230] = triggerStyles;
1205
+ $[231] = t66;
1206
+ } else t66 = $[231];
1207
+ let t67;
1208
+ if ($[232] !== t62 || $[233] !== t63 || $[234] !== t64 || $[235] !== t65 || $[236] !== t66) {
1209
+ t67 = /* @__PURE__ */ jsxs("div", {
1210
+ "data-element": "Suffix",
1211
+ children: [
1212
+ t62,
1213
+ t63,
1214
+ t64,
1215
+ t65,
1216
+ t66
1217
+ ]
1218
+ });
1219
+ $[232] = t62;
1220
+ $[233] = t63;
1221
+ $[234] = t64;
1222
+ $[235] = t65;
1223
+ $[236] = t66;
1224
+ $[237] = t67;
1225
+ } else t67 = $[237];
1226
+ const t68 = wrapperRef;
1227
+ const t69 = props["aria-label"];
1228
+ let t70;
1229
+ if ($[238] !== setIsPopoverOpen) {
1230
+ t70 = () => setIsPopoverOpen(false);
1231
+ $[238] = setIsPopoverOpen;
1232
+ $[239] = t70;
1233
+ } else t70 = $[239];
1234
+ let t71;
1235
+ if ($[240] !== children || $[241] !== comboBoxWidth || $[242] !== compositeFocusProps || $[243] !== containerPadding || $[244] !== direction || $[245] !== effectiveSelectedKey || $[246] !== filterFn || $[247] !== handleSelectionChange || $[248] !== headingStyles || $[249] !== isDisabled || $[250] !== label || $[251] !== listBoxRef || $[252] !== listBoxStyles || $[253] !== listGap || $[254] !== optionStyles || $[255] !== overlayOffset || $[256] !== overlayStyles || $[257] !== popoverRef || $[258] !== props.disabledKeys || $[259] !== sectionStyles || $[260] !== shouldFlip || $[261] !== shouldShowPopover || $[262] !== size || $[263] !== sortedItems || $[264] !== t68 || $[265] !== t69 || $[266] !== t70) {
1236
+ t71 = /* @__PURE__ */ jsx(ListBoxPopover, {
1237
+ isOpen: shouldShowPopover,
1238
+ triggerRef: t68,
1239
+ popoverRef,
1240
+ listBoxRef,
1241
+ direction,
1242
+ shouldFlip,
1243
+ overlayOffset,
1244
+ containerPadding,
1245
+ comboBoxWidth,
1246
+ listBoxId: `ComboBoxListBox-${comboBoxId}`,
1247
+ overlayStyles,
1248
+ listBoxStyles,
1249
+ optionStyles,
1250
+ sectionStyles,
1251
+ headingStyles,
1252
+ listGap,
1253
+ selectedKey: effectiveSelectedKey,
1254
+ shouldCloseOnTriggerInteraction: false,
1255
+ isDisabled,
1256
+ disabledKeys: props.disabledKeys,
1257
+ items: sortedItems,
1258
+ listStateRef,
1259
+ label,
1260
+ ariaLabel: t69,
1261
+ compositeFocusProps,
1262
+ filter: filterFn,
1263
+ size,
1264
+ onSelectionChange: handleSelectionChange,
1265
+ onClose: t70,
1266
+ children
1267
+ });
1268
+ $[240] = children;
1269
+ $[241] = comboBoxWidth;
1270
+ $[242] = compositeFocusProps;
1271
+ $[243] = containerPadding;
1272
+ $[244] = direction;
1273
+ $[245] = effectiveSelectedKey;
1274
+ $[246] = filterFn;
1275
+ $[247] = handleSelectionChange;
1276
+ $[248] = headingStyles;
1277
+ $[249] = isDisabled;
1278
+ $[250] = label;
1279
+ $[251] = listBoxRef;
1280
+ $[252] = listBoxStyles;
1281
+ $[253] = listGap;
1282
+ $[254] = optionStyles;
1283
+ $[255] = overlayOffset;
1284
+ $[256] = overlayStyles;
1285
+ $[257] = popoverRef;
1286
+ $[258] = props.disabledKeys;
1287
+ $[259] = sectionStyles;
1288
+ $[260] = shouldFlip;
1289
+ $[261] = shouldShowPopover;
1290
+ $[262] = size;
1291
+ $[263] = sortedItems;
1292
+ $[264] = t68;
1293
+ $[265] = t69;
1294
+ $[266] = t70;
1295
+ $[267] = t71;
1296
+ } else t71 = $[267];
1297
+ let t72;
1298
+ if ($[268] !== compositeFocusProps || $[269] !== mods || $[270] !== size || $[271] !== styles || $[272] !== t52 || $[273] !== t53 || $[274] !== t61 || $[275] !== t67 || $[276] !== t71 || $[277] !== wrapperRef) {
1299
+ t72 = /* @__PURE__ */ jsxs(ComboBoxWrapperElement, {
1300
+ ref: wrapperRef,
1301
+ mods,
1302
+ styles,
1303
+ style: t52,
1304
+ "data-size": size,
1305
+ ...compositeFocusProps,
1306
+ children: [
1307
+ t53,
1308
+ t61,
1309
+ t67,
1310
+ t71
1311
+ ]
1312
+ });
1313
+ $[268] = compositeFocusProps;
1314
+ $[269] = mods;
1315
+ $[270] = size;
1316
+ $[271] = styles;
1317
+ $[272] = t52;
1318
+ $[273] = t53;
1319
+ $[274] = t61;
1320
+ $[275] = t67;
1321
+ $[276] = t71;
1322
+ $[277] = wrapperRef;
1323
+ $[278] = t72;
1324
+ } else t72 = $[278];
1325
+ const comboBoxField = t72;
1326
+ let t73;
1327
+ if ($[279] !== comboBoxField || $[280] !== props || $[281] !== ref) {
1328
+ const { children: _, ...propsWithoutChildren } = props;
1329
+ t73 = wrapWithField(comboBoxField, ref, propsWithoutChildren);
1330
+ $[279] = comboBoxField;
1331
+ $[280] = props;
1332
+ $[281] = ref;
1333
+ $[282] = t73;
1334
+ } else t73 = $[282];
1335
+ return t73;
869
1336
  });
870
1337
  ComboBox.Item = _CollectionItem;
871
1338
  ComboBox.Section = Section;
@@ -874,6 +1341,15 @@ Object.defineProperty(ComboBox, "cubeInputType", {
874
1341
  enumerable: false,
875
1342
  configurable: false
876
1343
  });
1344
+ function _temp2(t0) {
1345
+ const { value, onChange } = t0;
1346
+ return {
1347
+ selectedKey: value ?? null,
1348
+ onSelectionChange(val) {
1349
+ onChange(val);
1350
+ }
1351
+ };
1352
+ }
877
1353
 
878
1354
  //#endregion
879
1355
  export { ComboBox };