@cube-dev/ui-kit 0.195.0 → 0.196.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (701) hide show
  1. package/dist/CHANGELOG.md +174 -0
  2. package/dist/_internal/hooks/use-debounced-value.js +1 -1
  3. package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
  4. package/dist/_internal/hooks/use-event.js +1 -1
  5. package/dist/_internal/hooks/use-is-first-render.js +1 -1
  6. package/dist/_internal/hooks/use-sync-ref.js +1 -1
  7. package/dist/_internal/hooks/use-timer/timer.js +1 -1
  8. package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
  9. package/dist/_internal/hooks/use-warn.js +1 -1
  10. package/dist/components/Block.js +1 -1
  11. package/dist/components/CollectionItem.js +1 -1
  12. package/dist/components/GlobalStyles.js +1 -1
  13. package/dist/components/GridProvider.js +1 -1
  14. package/dist/components/HiddenInput.js +1 -1
  15. package/dist/components/Root.d.ts +6 -0
  16. package/dist/components/Root.js +125 -102
  17. package/dist/components/Root.js.map +1 -1
  18. package/dist/components/actions/Action/Action.js +1 -1
  19. package/dist/components/actions/Banner/Banner.js +1 -1
  20. package/dist/components/actions/Button/Button.js +11 -5
  21. package/dist/components/actions/Button/Button.js.map +1 -1
  22. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  23. package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +9 -4
  24. package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
  25. package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -1
  26. package/dist/components/actions/ButtonSplit/context.js +1 -1
  27. package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
  28. package/dist/components/actions/CommandMenu/styled.js +1 -1
  29. package/dist/components/actions/ItemAction/ItemAction.js +27 -25
  30. package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
  31. package/dist/components/actions/ItemActionContext.js +1 -1
  32. package/dist/components/actions/ItemActionsWrapper.js +1 -1
  33. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  34. package/dist/components/actions/Link/Link.js +1 -1
  35. package/dist/components/actions/Menu/Menu.js +1 -1
  36. package/dist/components/actions/Menu/MenuCollectionItem.js +7 -4
  37. package/dist/components/actions/Menu/MenuCollectionItem.js.map +1 -1
  38. package/dist/components/actions/Menu/MenuItem.js +69 -60
  39. package/dist/components/actions/Menu/MenuItem.js.map +1 -1
  40. package/dist/components/actions/Menu/MenuSection.js +1 -1
  41. package/dist/components/actions/Menu/MenuTrigger.js +1 -1
  42. package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
  43. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  44. package/dist/components/actions/Menu/context.js +1 -1
  45. package/dist/components/actions/Menu/styled.js +1 -4
  46. package/dist/components/actions/Menu/styled.js.map +1 -1
  47. package/dist/components/actions/actions-run.js +1 -1
  48. package/dist/components/actions/index.js +1 -1
  49. package/dist/components/actions/use-action.js +15 -14
  50. package/dist/components/actions/use-action.js.map +1 -1
  51. package/dist/components/actions/use-anchored-menu.js +1 -1
  52. package/dist/components/actions/use-context-menu.js +1 -1
  53. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  54. package/dist/components/content/Alert/Alert.js +1 -1
  55. package/dist/components/content/Alert/use-alert.js +1 -1
  56. package/dist/components/content/Avatar/Avatar.js +1 -1
  57. package/dist/components/content/Badge/Badge.js +1 -1
  58. package/dist/components/content/Card/Card.js +1 -1
  59. package/dist/components/content/Content.js +1 -1
  60. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  61. package/dist/components/content/CopySnippet/CopySnippet.d.ts +8 -8
  62. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  63. package/dist/components/content/Disclosure/Disclosure.js +1 -1
  64. package/dist/components/content/Divider.js +1 -1
  65. package/dist/components/content/Footer.js +1 -1
  66. package/dist/components/content/Header.js +1 -1
  67. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  68. package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
  69. package/dist/components/content/InlineInput/InlineInput.js +1 -1
  70. package/dist/components/content/Item/Item.js +16 -4
  71. package/dist/components/content/Item/Item.js.map +1 -1
  72. package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
  73. package/dist/components/content/ItemBadge/ItemBadge.js +7 -3
  74. package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
  75. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  76. package/dist/components/content/Layout/GridLayout.js +1 -1
  77. package/dist/components/content/Layout/Layout.js +29 -15
  78. package/dist/components/content/Layout/Layout.js.map +1 -1
  79. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  80. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  81. package/dist/components/content/Layout/LayoutContainer.js +1 -1
  82. package/dist/components/content/Layout/LayoutContent.js +1 -1
  83. package/dist/components/content/Layout/LayoutContext.js +20 -10
  84. package/dist/components/content/Layout/LayoutContext.js.map +1 -1
  85. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  86. package/dist/components/content/Layout/LayoutFooter.js +12 -9
  87. package/dist/components/content/Layout/LayoutFooter.js.map +1 -1
  88. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  89. package/dist/components/content/Layout/LayoutHeader.js +1 -1
  90. package/dist/components/content/Layout/LayoutPane.js +1 -1
  91. package/dist/components/content/Layout/LayoutPanel.d.ts +4 -2
  92. package/dist/components/content/Layout/LayoutPanel.js +73 -2
  93. package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
  94. package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
  95. package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
  96. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  97. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  98. package/dist/components/content/Layout/index.js +1 -1
  99. package/dist/components/content/Layout/utils.js +1 -1
  100. package/dist/components/content/Paragraph.js +1 -1
  101. package/dist/components/content/Placeholder/Placeholder.js +1 -1
  102. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  103. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  104. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  105. package/dist/components/content/Result/Result.js +1 -1
  106. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  107. package/dist/components/content/Tag/Tag.js +1 -1
  108. package/dist/components/content/Text.d.ts +14 -14
  109. package/dist/components/content/Text.js +1 -1
  110. package/dist/components/content/TextItem/TextItem.js +1 -1
  111. package/dist/components/content/Title.js +1 -1
  112. package/dist/components/content/Tree/Tree.js +1 -1
  113. package/dist/components/content/Tree/TreeNode.js +2 -1
  114. package/dist/components/content/Tree/TreeNode.js.map +1 -1
  115. package/dist/components/content/Tree/styled.js +1 -1
  116. package/dist/components/content/Tree/tree-index.js +1 -1
  117. package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
  118. package/dist/components/content/Tree/use-load-data.js +1 -1
  119. package/dist/components/content/highlightText.js +1 -1
  120. package/dist/components/content/use-auto-tooltip.js +3 -3
  121. package/dist/components/content/use-auto-tooltip.js.map +1 -1
  122. package/dist/components/data/DataTable/DataTable.js +1 -1
  123. package/dist/components/data/ItemTable/ItemTable.js +1 -1
  124. package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
  125. package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
  126. package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
  127. package/dist/components/data/ItemTable/ItemTableToolbar.js +2 -1
  128. package/dist/components/data/ItemTable/ItemTableToolbar.js.map +1 -1
  129. package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
  130. package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
  131. package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
  132. package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
  133. package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
  134. package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
  135. package/dist/components/data/TableBase/ColumnResizer.js +1 -1
  136. package/dist/components/data/TableBase/RowCollection.js +1 -1
  137. package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
  138. package/dist/components/data/TableBase/TableRow.js +1 -1
  139. package/dist/components/data/TableBase/TableView.js +3 -1
  140. package/dist/components/data/TableBase/TableView.js.map +1 -1
  141. package/dist/components/data/TableBase/TreeGridTable.js +1 -1
  142. package/dist/components/data/TableBase/column-header.js +1 -1
  143. package/dist/components/data/TableBase/column-menu.js +1 -1
  144. package/dist/components/data/TableBase/column-styles.js +1 -1
  145. package/dist/components/data/TableBase/column-tint.js +1 -1
  146. package/dist/components/data/TableBase/row-menu.js +1 -1
  147. package/dist/components/data/TableBase/styled.js +1 -1
  148. package/dist/components/data/TableBase/table-tree.js +1 -1
  149. package/dist/components/data/TableBase/types.js +1 -1
  150. package/dist/components/data/TableBase/use-cell-selection.js +0 -0
  151. package/dist/components/data/TableBase/use-column-menu.js +1 -1
  152. package/dist/components/data/TableBase/use-column-order.js +1 -1
  153. package/dist/components/data/TableBase/use-column-window.js +1 -1
  154. package/dist/components/data/TableBase/use-container-width.js +1 -1
  155. package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
  156. package/dist/components/data/TableBase/use-scrollability.js +1 -1
  157. package/dist/components/data/TableBase/use-table-columns.js +1 -1
  158. package/dist/components/data/TableBase/use-table-search.js +1 -1
  159. package/dist/components/data/TableBase/use-table-selection.js +1 -1
  160. package/dist/components/data/TableBase/use-table-sort.js +1 -1
  161. package/dist/components/data/TableBase/use-table-sorts.js +1 -1
  162. package/dist/components/data/TableBase/use-table-storage.js +1 -1
  163. package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
  164. package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
  165. package/dist/components/fields/Checkbox/Checkbox.js +2 -2
  166. package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
  167. package/dist/components/fields/Checkbox/CheckboxGroup.js +5 -5
  168. package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
  169. package/dist/components/fields/Checkbox/context.js +1 -1
  170. package/dist/components/fields/ColorInput/ColorInput.js +1 -1
  171. package/dist/components/fields/ColorPicker/ColorPicker.js +3 -1
  172. package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
  173. package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
  174. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +2 -1
  175. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
  176. package/dist/components/fields/ComboBox/ComboBox.d.ts +27 -7
  177. package/dist/components/fields/ComboBox/ComboBox.js +1095 -619
  178. package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
  179. package/dist/components/fields/ComboBox/comboBoxOptions.js +84 -0
  180. package/dist/components/fields/ComboBox/comboBoxOptions.js.map +1 -0
  181. package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
  182. package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
  183. package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
  184. package/dist/components/fields/DatePicker/DateInput.js +1 -1
  185. package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
  186. package/dist/components/fields/DatePicker/DatePicker.js +1 -1
  187. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  188. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  189. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  190. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  191. package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
  192. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
  193. package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
  194. package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
  195. package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
  196. package/dist/components/fields/DatePicker/TimeInput.js +1 -1
  197. package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
  198. package/dist/components/fields/DatePicker/YearPicker.js +1 -1
  199. package/dist/components/fields/DatePicker/parseDate.d.ts +7 -0
  200. package/dist/components/fields/DatePicker/parseDate.js +17 -3
  201. package/dist/components/fields/DatePicker/parseDate.js.map +1 -1
  202. package/dist/components/fields/DatePicker/period.js +1 -1
  203. package/dist/components/fields/DatePicker/props.js +1 -1
  204. package/dist/components/fields/DatePicker/utils.js +1 -1
  205. package/dist/components/fields/FileInput/FileInput.js +1 -1
  206. package/dist/components/fields/FilterListBox/FilterListBox.js +2 -1
  207. package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
  208. package/dist/components/fields/FilterPicker/FilterPicker.js +15 -6
  209. package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
  210. package/dist/components/fields/Input/Input.d.ts +2 -2
  211. package/dist/components/fields/Input/Input.js +2 -2
  212. package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
  213. package/dist/components/fields/ListBox/ListBox.d.ts +10 -4
  214. package/dist/components/fields/ListBox/ListBox.js +298 -146
  215. package/dist/components/fields/ListBox/ListBox.js.map +1 -1
  216. package/dist/components/fields/ListBox/optionId.js +1 -1
  217. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +150 -139
  218. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
  219. package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
  220. package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
  221. package/dist/components/fields/NumberInput/NumberInput.d.ts +6 -1
  222. package/dist/components/fields/NumberInput/NumberInput.js +136 -128
  223. package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
  224. package/dist/components/fields/NumberInput/StepButton.js +38 -48
  225. package/dist/components/fields/NumberInput/StepButton.js.map +1 -1
  226. package/dist/components/fields/PasswordInput/PasswordInput.d.ts +1 -2
  227. package/dist/components/fields/PasswordInput/PasswordInput.js +77 -111
  228. package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
  229. package/dist/components/fields/Picker/Picker.d.ts +1 -1
  230. package/dist/components/fields/Picker/Picker.js +22 -8
  231. package/dist/components/fields/Picker/Picker.js.map +1 -1
  232. package/dist/components/fields/RadioGroup/Radio.d.ts +12 -12
  233. package/dist/components/fields/RadioGroup/Radio.js +1 -1
  234. package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
  235. package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
  236. package/dist/components/fields/RadioGroup/context.js +1 -1
  237. package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -6
  238. package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
  239. package/dist/components/fields/SearchInput/SearchInput.d.ts +8 -3
  240. package/dist/components/fields/SearchInput/SearchInput.js +22 -34
  241. package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
  242. package/dist/components/fields/Select/Select.d.ts +12 -1
  243. package/dist/components/fields/Select/Select.js +365 -207
  244. package/dist/components/fields/Select/Select.js.map +1 -1
  245. package/dist/components/fields/Slider/Gradation.js +1 -1
  246. package/dist/components/fields/Slider/HueSlider.js +1 -1
  247. package/dist/components/fields/Slider/RangeSlider.js +3 -4
  248. package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
  249. package/dist/components/fields/Slider/Slider.js +1 -1
  250. package/dist/components/fields/Slider/SliderBase.js +1 -1
  251. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  252. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  253. package/dist/components/fields/Slider/elements.js +1 -1
  254. package/dist/components/fields/Slider/index.js +1 -1
  255. package/dist/components/fields/Switch/Switch.js +1 -1
  256. package/dist/components/fields/TagInput/TagInput.js +2 -2
  257. package/dist/components/fields/TagInput/TagInput.js.map +1 -1
  258. package/dist/components/fields/TagInput/TagList.js +1 -1
  259. package/dist/components/fields/TagInput/useActiveOption.js +1 -1
  260. package/dist/components/fields/TagInput/useTagError.js +1 -1
  261. package/dist/components/fields/TextArea/TextArea.d.ts +0 -1
  262. package/dist/components/fields/TextArea/TextArea.js +49 -63
  263. package/dist/components/fields/TextArea/TextArea.js.map +1 -1
  264. package/dist/components/fields/TextInput/TextInput.d.ts +1 -1
  265. package/dist/components/fields/TextInput/TextInput.js +42 -46
  266. package/dist/components/fields/TextInput/TextInput.js.map +1 -1
  267. package/dist/components/fields/TextInput/TextInputBase.d.ts +6 -2
  268. package/dist/components/fields/TextInput/TextInputBase.js +32 -10
  269. package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
  270. package/dist/components/fields/TextInput/displayed-validation.js +50 -0
  271. package/dist/components/fields/TextInput/displayed-validation.js.map +1 -0
  272. package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
  273. package/dist/components/fields/TextInputMapper/TextInputMapper.js +20 -17
  274. package/dist/components/fields/TextInputMapper/TextInputMapper.js.map +1 -1
  275. package/dist/components/fields/TriggerActions.js +1 -1
  276. package/dist/components/fields/color/ColorPanel.js +3 -1
  277. package/dist/components/fields/color/ColorPanel.js.map +1 -1
  278. package/dist/components/fields/color/channels.js +1 -1
  279. package/dist/components/fields/color/color.js +1 -1
  280. package/dist/components/fields/color/context.js +1 -1
  281. package/dist/components/fields/index.d.ts +2 -2
  282. package/dist/components/fields/option-origin-press.js +78 -0
  283. package/dist/components/fields/option-origin-press.js.map +1 -0
  284. package/dist/components/form/FieldWrapper/FieldWrapper.d.ts +10 -8
  285. package/dist/components/form/FieldWrapper/FieldWrapper.js +214 -159
  286. package/dist/components/form/FieldWrapper/FieldWrapper.js.map +1 -1
  287. package/dist/components/form/FieldWrapper/field-description.js +3 -3
  288. package/dist/components/form/FieldWrapper/field-description.js.map +1 -1
  289. package/dist/components/form/FieldWrapper/types.d.ts +4 -3
  290. package/dist/components/form/Form/Field.js +1 -1
  291. package/dist/components/form/Form/Form.js +1 -1
  292. package/dist/components/form/Form/ModernFormRoot.js +1 -1
  293. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  294. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  295. package/dist/components/form/Form/SubmitError.js +1 -1
  296. package/dist/components/form/Form/backend.js +1 -1
  297. package/dist/components/form/Form/index.js +1 -1
  298. package/dist/components/form/Form/modern/actions.js +1 -1
  299. package/dist/components/form/Form/modern/context.js +1 -1
  300. package/dist/components/form/Form/modern/controller.js +1 -1
  301. package/dist/components/form/Form/modern/field-binding.js +1 -1
  302. package/dist/components/form/Form/modern/field.js +1 -1
  303. package/dist/components/form/Form/modern/react.js +1 -1
  304. package/dist/components/form/Form/modern/store.js +1 -1
  305. package/dist/components/form/Form/modern/validation.js +1 -1
  306. package/dist/components/form/Form/modern/values.js +1 -1
  307. package/dist/components/form/Form/reset-unbound-controls.js +1 -1
  308. package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
  309. package/dist/components/form/Form/use-field/use-field-props.js +21 -33
  310. package/dist/components/form/Form/use-field/use-field-props.js.map +1 -1
  311. package/dist/components/form/Form/use-field/use-field.js +1 -1
  312. package/dist/components/form/Form/use-form.js +1 -1
  313. package/dist/components/form/Form/validation.js +1 -1
  314. package/dist/components/form/Label.js +1 -1
  315. package/dist/components/form/field-chrome.js +4 -34
  316. package/dist/components/form/field-chrome.js.map +1 -1
  317. package/dist/components/form/legacy-tooltip.js +1 -1
  318. package/dist/components/form/validation/ValidationIndicator.js +1 -1
  319. package/dist/components/form/validation/resolve-validation-props.js +1 -1
  320. package/dist/components/form/validation/use-validation-props.js +1 -1
  321. package/dist/components/form/wrapper.d.ts +6 -17
  322. package/dist/components/form/wrapper.js +6 -14
  323. package/dist/components/form/wrapper.js.map +1 -1
  324. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  325. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  326. package/dist/components/layout/Flex.js +1 -1
  327. package/dist/components/layout/Flow.js +1 -1
  328. package/dist/components/layout/Grid.js +1 -1
  329. package/dist/components/layout/Panel.js +1 -1
  330. package/dist/components/layout/Prefix.js +1 -1
  331. package/dist/components/layout/ResizablePanel.js +1 -1
  332. package/dist/components/layout/Space.js +1 -1
  333. package/dist/components/layout/Suffix.js +1 -1
  334. package/dist/components/navigation/Pagination/Pagination.js +3 -1
  335. package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
  336. package/dist/components/navigation/Pagination/use-pagination.js +1 -1
  337. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
  338. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  339. package/dist/components/navigation/Tabs/TabButton.js +1 -1
  340. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  341. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  342. package/dist/components/navigation/Tabs/TabPicker.js +2 -1
  343. package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
  344. package/dist/components/navigation/Tabs/Tabs.js +1 -1
  345. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  346. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  347. package/dist/components/navigation/Tabs/popover-placement.js +1 -1
  348. package/dist/components/navigation/Tabs/styled.js +1 -1
  349. package/dist/components/navigation/Tabs/types.js +1 -1
  350. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  351. package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
  352. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  353. package/dist/components/other/Calendar/Calendar.js +1 -1
  354. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  355. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  356. package/dist/components/other/Calendar/CalendarHeader.js +1 -1
  357. package/dist/components/other/Calendar/CalendarPanel.js +1 -1
  358. package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
  359. package/dist/components/other/Calendar/PeriodGrid.js +1 -1
  360. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  361. package/dist/components/other/Calendar/styled.js +1 -1
  362. package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
  363. package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
  364. package/dist/components/overlays/AlertDialog/AlertDialog.d.ts +6 -1
  365. package/dist/components/overlays/AlertDialog/AlertDialog.js +3 -2
  366. package/dist/components/overlays/AlertDialog/AlertDialog.js.map +1 -1
  367. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +3 -2
  368. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js.map +1 -1
  369. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  370. package/dist/components/overlays/Dialog/Dialog.js +28 -14
  371. package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
  372. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  373. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  374. package/dist/components/overlays/Dialog/DialogTrigger.d.ts +7 -3
  375. package/dist/components/overlays/Dialog/DialogTrigger.js +149 -132
  376. package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
  377. package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
  378. package/dist/components/overlays/Dialog/context.js +1 -1
  379. package/dist/components/overlays/Dialog/default-button-text.js +1 -1
  380. package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
  381. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  382. package/dist/components/overlays/Dialog/use-dialog-open-sync.js +83 -0
  383. package/dist/components/overlays/Dialog/use-dialog-open-sync.js.map +1 -0
  384. package/dist/components/overlays/Modal/Modal.js +1 -1
  385. package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
  386. package/dist/components/overlays/Modal/Overlay.js +9 -3
  387. package/dist/components/overlays/Modal/Overlay.js.map +1 -1
  388. package/dist/components/overlays/Modal/Popover.js +31 -29
  389. package/dist/components/overlays/Modal/Popover.js.map +1 -1
  390. package/dist/components/overlays/Modal/Tray.js +2 -1
  391. package/dist/components/overlays/Modal/Tray.js.map +1 -1
  392. package/dist/components/overlays/Modal/Underlay.js +1 -1
  393. package/dist/components/overlays/Modal/modal-containment.js +1 -1
  394. package/dist/components/overlays/Notifications/Notification.js +1 -1
  395. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  396. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  397. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  398. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  399. package/dist/components/overlays/Notifications/OverlayContainer.js +18 -32
  400. package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
  401. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  402. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  403. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  404. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  405. package/dist/components/overlays/Notifications/index.js +1 -1
  406. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  407. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  408. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  409. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  410. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  411. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  412. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  413. package/dist/components/overlays/Toast/index.js +1 -1
  414. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  415. package/dist/components/overlays/Toast/useToast.js +1 -1
  416. package/dist/components/overlays/Tooltip/Tooltip.d.ts +8 -0
  417. package/dist/components/overlays/Tooltip/Tooltip.js +16 -22
  418. package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
  419. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  420. package/dist/components/overlays/Tooltip/TooltipTrigger.d.ts +1 -1
  421. package/dist/components/overlays/Tooltip/TooltipTrigger.js +163 -113
  422. package/dist/components/overlays/Tooltip/TooltipTrigger.js.map +1 -1
  423. package/dist/components/overlays/Tooltip/context.js +1 -1
  424. package/dist/components/overlays/Tooltip/context.js.map +1 -1
  425. package/dist/components/overlays/Tooltip/split-trigger-props.js +6 -5
  426. package/dist/components/overlays/Tooltip/split-trigger-props.js.map +1 -1
  427. package/dist/components/portal/Portal.js +1 -1
  428. package/dist/components/portal/PortalProvider.js +1 -1
  429. package/dist/components/portal/usePortal.js +1 -1
  430. package/dist/components/shared/DraggableCollection.js +1 -1
  431. package/dist/components/shared/InvalidIcon.js +1 -1
  432. package/dist/components/shared/ValidIcon.js +1 -1
  433. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  434. package/dist/components/status/Spin/Cube.js +1 -1
  435. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  436. package/dist/components/status/Spin/Spin.js +1 -1
  437. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  438. package/dist/data/item-themes.js +1 -1
  439. package/dist/data/themes.js +1 -1
  440. package/dist/eslint-plugin/defaults.generated.js +11 -17
  441. package/dist/eslint-plugin/defaults.generated.js.map +1 -1
  442. package/dist/eslint-plugin/index.js +1 -1
  443. package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
  444. package/dist/i18n/I18nProvider.js +1 -1
  445. package/dist/i18n/createFormatter.js +1 -1
  446. package/dist/i18n/index.js +1 -1
  447. package/dist/i18n/instance.js +1 -1
  448. package/dist/i18n/locales/de-DE/uikit.js +6 -4
  449. package/dist/i18n/locales/en-US/uikit.js +6 -4
  450. package/dist/i18n/locales/en-US/uikit.json.d.ts +3 -1
  451. package/dist/i18n/locales/es-ES/uikit.js +6 -4
  452. package/dist/i18n/locales/es-MX/uikit.js +6 -4
  453. package/dist/i18n/locales/fr-FR/uikit.js +6 -4
  454. package/dist/i18n/locales/it-IT/uikit.js +6 -4
  455. package/dist/i18n/locales/ja-JP/uikit.js +6 -4
  456. package/dist/i18n/locales/nb-NO/uikit.js +6 -4
  457. package/dist/i18n/locales/pt-BR/uikit.js +6 -4
  458. package/dist/i18n/locales/pt-PT/uikit.js +6 -4
  459. package/dist/i18n/locales/sv-SE/uikit.js +6 -4
  460. package/dist/i18n/locales/vi-VN/uikit.js +6 -4
  461. package/dist/i18n/locales.js +1 -1
  462. package/dist/i18n/namespace.js +1 -1
  463. package/dist/i18n/useFormatter.js +1 -1
  464. package/dist/i18n/useI18n.js +1 -1
  465. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  466. package/dist/icons/AdjustmentsIcon.js +1 -1
  467. package/dist/icons/AiIcon.js +1 -1
  468. package/dist/icons/AreaChartIcon.js +1 -1
  469. package/dist/icons/ArrowNarrowDownIcon.js +1 -1
  470. package/dist/icons/ArrowNarrowUpIcon.js +1 -1
  471. package/dist/icons/BackwardIcon.js +1 -1
  472. package/dist/icons/BarChartIcon.js +1 -1
  473. package/dist/icons/BellFilledIcon.js +1 -1
  474. package/dist/icons/BellIcon.js +1 -1
  475. package/dist/icons/BooleanIcon.js +1 -1
  476. package/dist/icons/CalendarEditIcon.js +1 -1
  477. package/dist/icons/CalendarIcon.js +1 -1
  478. package/dist/icons/CaretDownIcon.js +1 -1
  479. package/dist/icons/CaretUpIcon.js +1 -1
  480. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  481. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  482. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  483. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  484. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  485. package/dist/icons/ChartBarLineIcon.js +1 -1
  486. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  487. package/dist/icons/ChartBarStackedIcon.js +1 -1
  488. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  489. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  490. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  491. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  492. package/dist/icons/ChartBubbleIcon.js +1 -1
  493. package/dist/icons/ChartDonut2Icon.js +1 -1
  494. package/dist/icons/ChartFunnelIcon.js +1 -1
  495. package/dist/icons/ChartHeatmapIcon.js +1 -1
  496. package/dist/icons/ChartKPIIcon.js +1 -1
  497. package/dist/icons/ChartPie2Icon.js +1 -1
  498. package/dist/icons/ChartScatterIcon.js +1 -1
  499. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  500. package/dist/icons/CheckCircleIcon.js +1 -1
  501. package/dist/icons/CheckIcon.js +1 -1
  502. package/dist/icons/CircleFilledIcon.js +1 -1
  503. package/dist/icons/ClearIcon.js +1 -1
  504. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  505. package/dist/icons/CloseCircleIcon.js +1 -1
  506. package/dist/icons/CloseIcon.js +1 -1
  507. package/dist/icons/CodeIcon.js +1 -1
  508. package/dist/icons/ColumnTotalIcon.js +1 -1
  509. package/dist/icons/CopyIcon.js +1 -1
  510. package/dist/icons/CountIcon.js +1 -1
  511. package/dist/icons/CubeIcon.js +1 -1
  512. package/dist/icons/CubePauseIcon.js +1 -1
  513. package/dist/icons/CubePlayIcon.js +1 -1
  514. package/dist/icons/CurrencyDollarIcon.js +1 -1
  515. package/dist/icons/DangerIcon.js +1 -1
  516. package/dist/icons/DashboardIcon.js +1 -1
  517. package/dist/icons/DatabaseIcon.js +1 -1
  518. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  519. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  520. package/dist/icons/DirectionIcon.js +1 -1
  521. package/dist/icons/DonutIcon.js +1 -1
  522. package/dist/icons/DownIcon.js +1 -1
  523. package/dist/icons/EditIcon.js +1 -1
  524. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  525. package/dist/icons/ExclamationCircleIcon.js +1 -1
  526. package/dist/icons/ExclamationIcon.js +1 -1
  527. package/dist/icons/EyeIcon.js +1 -1
  528. package/dist/icons/EyeInvisibleIcon.js +1 -1
  529. package/dist/icons/FilterIcon.js +1 -1
  530. package/dist/icons/FolderFilledIcon.js +1 -1
  531. package/dist/icons/FolderIcon.js +1 -1
  532. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  533. package/dist/icons/FolderOpenIcon.js +1 -1
  534. package/dist/icons/ForwardIcon.js +1 -1
  535. package/dist/icons/GripVerticalIcon.js +1 -1
  536. package/dist/icons/HierarchyIcon.js +1 -1
  537. package/dist/icons/HierarchyOpenIcon.js +1 -1
  538. package/dist/icons/Icon.js +1 -1
  539. package/dist/icons/InfoCircleIcon.js +1 -1
  540. package/dist/icons/InfoIcon.js +1 -1
  541. package/dist/icons/KeyIcon.js +1 -1
  542. package/dist/icons/LeftIcon.js +1 -1
  543. package/dist/icons/LineChartIcon.js +1 -1
  544. package/dist/icons/LoadingIcon.js +1 -1
  545. package/dist/icons/LockFilledIcon.js +1 -1
  546. package/dist/icons/LockIcon.js +1 -1
  547. package/dist/icons/MoreIcon.js +1 -1
  548. package/dist/icons/NotAllowedIcon.js +1 -1
  549. package/dist/icons/Number123Icon.js +1 -1
  550. package/dist/icons/NumberIcon.js +1 -1
  551. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  552. package/dist/icons/PauseCircleIcon.js +1 -1
  553. package/dist/icons/PauseIcon.js +1 -1
  554. package/dist/icons/PercentageIcon.js +1 -1
  555. package/dist/icons/PieChartIcon.js +1 -1
  556. package/dist/icons/PipetteIcon.js +1 -1
  557. package/dist/icons/PlayCircleIcon.js +1 -1
  558. package/dist/icons/PlayIcon.js +1 -1
  559. package/dist/icons/PlusIcon.js +1 -1
  560. package/dist/icons/ProgressBarIcon.js +1 -1
  561. package/dist/icons/ReloadIcon.js +1 -1
  562. package/dist/icons/ReportIcon.js +1 -1
  563. package/dist/icons/ReturnIcon.js +1 -1
  564. package/dist/icons/RightIcon.js +1 -1
  565. package/dist/icons/RowTotalsIcon.js +1 -1
  566. package/dist/icons/SchemeIcon.js +1 -1
  567. package/dist/icons/SearchIcon.js +1 -1
  568. package/dist/icons/SemanticQueryIcon.js +1 -1
  569. package/dist/icons/SettingsIcon.js +1 -1
  570. package/dist/icons/ShieldFilledIcon.js +1 -1
  571. package/dist/icons/ShieldIcon.js +1 -1
  572. package/dist/icons/SlashIcon.js +1 -1
  573. package/dist/icons/SparklesIcon.js +1 -1
  574. package/dist/icons/SqlIcon.js +1 -1
  575. package/dist/icons/StatsIcon.js +1 -1
  576. package/dist/icons/StopIcon.js +1 -1
  577. package/dist/icons/StringIcon.js +1 -1
  578. package/dist/icons/SubtotalsIcon.js +1 -1
  579. package/dist/icons/SwitchIcon.js +1 -1
  580. package/dist/icons/TableIcon.js +1 -1
  581. package/dist/icons/ThumbsDownIcon.js +1 -1
  582. package/dist/icons/ThumbsUpIcon.js +1 -1
  583. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  584. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  585. package/dist/icons/ThunderboltIcon.js +1 -1
  586. package/dist/icons/TimeIcon.js +1 -1
  587. package/dist/icons/TrashIcon.js +1 -1
  588. package/dist/icons/UnlockIcon.js +1 -1
  589. package/dist/icons/UpIcon.js +1 -1
  590. package/dist/icons/UserGroupIcon.js +1 -1
  591. package/dist/icons/UserIcon.js +1 -1
  592. package/dist/icons/UserLockIcon.js +1 -1
  593. package/dist/icons/ViewIcon.js +1 -1
  594. package/dist/icons/WarningFilledIcon.js +1 -1
  595. package/dist/icons/WarningIcon.js +1 -1
  596. package/dist/icons/wrap-icon.js +1 -1
  597. package/dist/index.d.ts +1 -1
  598. package/dist/index.js +2 -2
  599. package/dist/probe/canonicalize.js +1 -1
  600. package/dist/probe/css.js +1 -1
  601. package/dist/probe/index.js +1 -1
  602. package/dist/provider.js +1 -1
  603. package/dist/providers/TrackingProvider.js +1 -1
  604. package/dist/providers/navigation-url.js +15 -3
  605. package/dist/providers/navigation-url.js.map +1 -1
  606. package/dist/providers/navigationAdapter.default.js +1 -1
  607. package/dist/providers/use-navigation.js +1 -1
  608. package/dist/shared/form.d.ts +11 -12
  609. package/dist/tokens/all-tokens.js +1 -1
  610. package/dist/tokens/base.js +1 -1
  611. package/dist/tokens/color-seed.js +1 -1
  612. package/dist/tokens/color-theme.js +1 -1
  613. package/dist/tokens/colors.js +1 -1
  614. package/dist/tokens/layout.js +1 -1
  615. package/dist/tokens/lazy-styles.js +1 -1
  616. package/dist/tokens/legacy-color.js +1 -1
  617. package/dist/tokens/palette-config.js +1 -1
  618. package/dist/tokens/palette.js +1 -1
  619. package/dist/tokens/resolve.js +1 -1
  620. package/dist/tokens/shadows.js +1 -1
  621. package/dist/tokens/sizes.js +1 -1
  622. package/dist/tokens/spacing.js +1 -1
  623. package/dist/tokens/typography.js +1 -1
  624. package/dist/utils/ResizeSensor.js +1 -1
  625. package/dist/utils/colors.js +1 -1
  626. package/dist/utils/dotize.js +1 -1
  627. package/dist/utils/is-dev-env.js +1 -1
  628. package/dist/utils/modules.js +1 -1
  629. package/dist/utils/promise.js +1 -1
  630. package/dist/utils/raf.js +1 -1
  631. package/dist/utils/random.js +1 -1
  632. package/dist/utils/range.js +1 -1
  633. package/dist/utils/react/RenderCache.js +1 -1
  634. package/dist/utils/react/Slots.js +1 -1
  635. package/dist/utils/react/chain.js +1 -1
  636. package/dist/utils/react/disabledProps.js +1 -1
  637. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  638. package/dist/utils/react/index.js +1 -1
  639. package/dist/utils/react/interactions.js +1 -1
  640. package/dist/utils/react/isTextOnly.js +1 -1
  641. package/dist/utils/react/mapProps.js +1 -1
  642. package/dist/utils/react/mergeProps.js +1 -1
  643. package/dist/utils/react/nullableValue.js +18 -9
  644. package/dist/utils/react/nullableValue.js.map +1 -1
  645. package/dist/utils/react/overlayKeyPropagation.js +1 -1
  646. package/dist/utils/react/programmaticFocus.js +1 -1
  647. package/dist/utils/react/resolveIcon.js +1 -1
  648. package/dist/utils/react/sharedStore.js +1 -1
  649. package/dist/utils/react/useBufferedValue.js +1 -1
  650. package/dist/utils/react/useCombinedRefs.js +1 -1
  651. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  652. package/dist/utils/react/useEventBus.js +1 -1
  653. package/dist/utils/react/useId.js +1 -1
  654. package/dist/utils/react/useIsDarwin.js +1 -1
  655. package/dist/utils/react/useKeySymbols.js +1 -1
  656. package/dist/utils/react/useLayoutEffect.js +1 -1
  657. package/dist/utils/react/useLocalStorage.js +1 -1
  658. package/dist/utils/react/useMergeStyles.js +1 -1
  659. package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
  660. package/dist/utils/react/usePopoverSync.js +1 -1
  661. package/dist/utils/react/useQaProps.js +1 -1
  662. package/dist/utils/react/useScheme.js +1 -1
  663. package/dist/utils/react/useViewportSize.js +1 -1
  664. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  665. package/dist/utils/selection.js +1 -1
  666. package/dist/utils/styles.js +1 -1
  667. package/dist/utils/tree.js +1 -1
  668. package/dist/utils/warnings.js +1 -1
  669. package/dist/version.js +2 -2
  670. package/docs/ComplexLayout.md +1 -1
  671. package/docs/CreateComponent.md +2 -0
  672. package/docs/FieldProperties.md +31 -6
  673. package/docs/Theming.md +2 -1
  674. package/docs/Usage.md +2 -0
  675. package/docs/components/Root.md +1 -1
  676. package/docs/components/actions/Button.md +8 -2
  677. package/docs/components/actions/ButtonSplit.md +27 -1
  678. package/docs/components/actions/Link.md +1 -1
  679. package/docs/components/actions/Menu.md +4 -2
  680. package/docs/components/content/InfoBadge.md +2 -0
  681. package/docs/components/content/ItemBadge.md +4 -0
  682. package/docs/components/content/Layout.md +10 -5
  683. package/docs/components/fields/ComboBox.md +30 -19
  684. package/docs/components/fields/FilterListBox.md +2 -2
  685. package/docs/components/fields/FilterPicker.md +2 -2
  686. package/docs/components/fields/ListBox.md +14 -10
  687. package/docs/components/fields/NumberInput.md +20 -11
  688. package/docs/components/fields/PasswordInput.md +6 -7
  689. package/docs/components/fields/Picker.md +6 -5
  690. package/docs/components/fields/RadioGroup.md +1 -1
  691. package/docs/components/fields/SearchInput.md +7 -6
  692. package/docs/components/fields/Select.md +14 -8
  693. package/docs/components/fields/TagInput.md +8 -1
  694. package/docs/components/fields/TextArea.md +4 -3
  695. package/docs/components/fields/TextInput.md +13 -6
  696. package/docs/components/overlays/AlertDialog.md +7 -1
  697. package/docs/components/overlays/Dialog.md +5 -5
  698. package/docs/components/overlays/DialogTrigger.md +6 -6
  699. package/docs/components/overlays/Tooltip.md +17 -6
  700. package/docs/components/overlays/TooltipTrigger.md +2 -0
  701. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.195.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.196.0 | Cube Dev Team */
2
2
  import { chain } from "../../../utils/react/chain.js";
3
3
  import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
4
4
  import { useBufferedValue } from "../../../utils/react/useBufferedValue.js";
@@ -10,6 +10,7 @@ import { EyeInvisibleIcon } from "../../../icons/EyeInvisibleIcon.js";
10
10
  import { castNullableStringValue } from "../../../utils/react/nullableValue.js";
11
11
  import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
12
12
  import { TextInputBase } from "../TextInput/TextInputBase.js";
13
+ import { useDisplayedValidation } from "../TextInput/displayed-validation.js";
13
14
  import { c } from "react/compiler-runtime";
14
15
  import { forwardRef, useRef, useState } from "react";
15
16
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -17,7 +18,7 @@ import { useTextField } from "react-aria";
17
18
 
18
19
  //#region src/components/fields/PasswordInput/PasswordInput.tsx
19
20
  function PasswordInput(rawProps, ref) {
20
- const $ = c(39);
21
+ const $ = c(19);
21
22
  const { t } = useI18n();
22
23
  let t0;
23
24
  if ($[0] !== rawProps) {
@@ -44,121 +45,86 @@ function PasswordInput(rawProps, ref) {
44
45
  isDisabled: rest.isDisabled,
45
46
  isReadOnly: rest.isReadOnly
46
47
  });
47
- const t2 = buffered.value;
48
- const t3 = buffered.onChange;
49
- const t4 = chain(rest.onBlur, buffered.reset);
50
- let t5;
51
- if ($[3] !== buffered.onChange || $[4] !== buffered.value || $[5] !== rest || $[6] !== t4 || $[7] !== type) {
52
- t5 = {
53
- ...rest,
54
- value: t2,
55
- onChange: t3,
56
- onBlur: t4,
57
- type
48
+ const displayedValidation = useDisplayedValidation();
49
+ const { labelProps, inputProps, ...validation } = useTextField(displayedValidation.trackTouched({
50
+ ...rest,
51
+ value: buffered.value,
52
+ onChange: buffered.onChange,
53
+ onBlur: chain(rest.onBlur, buffered.reset),
54
+ type
55
+ }), inputRef);
56
+ let t2;
57
+ if ($[3] !== labelProps || $[4] !== userLabelProps) {
58
+ t2 = mergeProps$1(labelProps, userLabelProps);
59
+ $[3] = labelProps;
60
+ $[4] = userLabelProps;
61
+ $[5] = t2;
62
+ } else t2 = $[5];
63
+ const mergedLabelProps = t2;
64
+ let t3;
65
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
66
+ t3 = () => {
67
+ setType(_temp2);
58
68
  };
59
- $[3] = buffered.onChange;
60
- $[4] = buffered.value;
61
- $[5] = rest;
62
- $[6] = t4;
63
- $[7] = type;
69
+ $[6] = t3;
70
+ } else t3 = $[6];
71
+ const toggleType = t3;
72
+ const t4 = rest.isDisabled;
73
+ let t5;
74
+ if ($[7] !== t) {
75
+ t5 = t("passwordInput.showPassword", "Show password");
76
+ $[7] = t;
64
77
  $[8] = t5;
65
78
  } else t5 = $[8];
66
- const { labelProps, inputProps } = useTextField(t5, inputRef);
67
- let t6;
68
- if ($[9] !== labelProps || $[10] !== userLabelProps) {
69
- t6 = mergeProps$1(labelProps, userLabelProps);
70
- $[9] = labelProps;
71
- $[10] = userLabelProps;
72
- $[11] = t6;
73
- } else t6 = $[11];
74
- const mergedLabelProps = t6;
79
+ const t6 = type === "text";
75
80
  let t7;
76
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
77
- t7 = () => {
78
- setType(_temp2);
79
- };
80
- $[12] = t7;
81
- } else t7 = $[12];
82
- const toggleType = t7;
83
- const t8 = rest.isDisabled;
84
- let t9;
85
- if ($[13] !== t) {
86
- t9 = t("passwordInput.toggleMasking", "Toggle masking");
87
- $[13] = t;
88
- $[14] = t9;
89
- } else t9 = $[14];
90
- let t10;
91
- if ($[15] !== type) {
92
- t10 = type === "password" ? /* @__PURE__ */ jsx(EyeInvisibleIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {});
93
- $[15] = type;
94
- $[16] = t10;
95
- } else t10 = $[16];
96
- let t11;
97
- if ($[17] !== t10 || $[18] !== t9) {
98
- t11 = /* @__PURE__ */ jsx(ItemAction, {
99
- tooltip: t9,
100
- icon: t10,
81
+ if ($[9] !== type) {
82
+ t7 = type === "password" ? /* @__PURE__ */ jsx(EyeInvisibleIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {});
83
+ $[9] = type;
84
+ $[10] = t7;
85
+ } else t7 = $[10];
86
+ let t8;
87
+ if ($[11] !== t5 || $[12] !== t6 || $[13] !== t7) {
88
+ t8 = /* @__PURE__ */ jsx(ItemAction, {
89
+ tooltip: t5,
90
+ "aria-pressed": t6,
91
+ icon: t7,
101
92
  onPress: toggleType
102
93
  });
103
- $[17] = t10;
104
- $[18] = t9;
105
- $[19] = t11;
106
- } else t11 = $[19];
107
- let t12;
108
- if ($[20] !== rest.isDisabled || $[21] !== t11) {
109
- t12 = /* @__PURE__ */ jsx(ItemActionProvider, {
110
- isDisabled: t8,
111
- children: t11
112
- });
113
- $[20] = rest.isDisabled;
114
- $[21] = t11;
115
- $[22] = t12;
116
- } else t12 = $[22];
117
- let t13;
118
- if ($[23] !== suffix || $[24] !== t12) {
119
- t13 = /* @__PURE__ */ jsxs(Fragment$1, { children: [suffix, t12] });
120
- $[23] = suffix;
121
- $[24] = t12;
122
- $[25] = t13;
123
- } else t13 = $[25];
124
- const wrappedSuffix = t13;
125
- let t14;
126
- if ($[26] !== inputProps || $[27] !== userInputProps) {
127
- t14 = mergeProps$1(inputProps, { "data-input-type": "passwordinput" }, userInputProps);
128
- $[26] = inputProps;
129
- $[27] = userInputProps;
130
- $[28] = t14;
131
- } else t14 = $[28];
132
- let t15;
133
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
134
- t15 = { paddingRight: "4x" };
135
- $[29] = t15;
136
- } else t15 = $[29];
137
- let t16;
138
- if ($[30] !== inputRef || $[31] !== mergedLabelProps || $[32] !== multiLine || $[33] !== ref || $[34] !== rest || $[35] !== t14 || $[36] !== type || $[37] !== wrappedSuffix) {
139
- t16 = /* @__PURE__ */ jsx(TextInputBase, {
140
- ref,
141
- labelProps: mergedLabelProps,
142
- inputProps: t14,
143
- inputRef,
144
- inputStyles: t15,
145
- type,
146
- suffixPosition: "after",
147
- suffix: wrappedSuffix,
148
- multiLine,
149
- ...rest
150
- });
151
- $[30] = inputRef;
152
- $[31] = mergedLabelProps;
153
- $[32] = multiLine;
154
- $[33] = ref;
155
- $[34] = rest;
156
- $[35] = t14;
157
- $[36] = type;
158
- $[37] = wrappedSuffix;
159
- $[38] = t16;
160
- } else t16 = $[38];
161
- return t16;
94
+ $[11] = t5;
95
+ $[12] = t6;
96
+ $[13] = t7;
97
+ $[14] = t8;
98
+ } else t8 = $[14];
99
+ const wrappedSuffix = /* @__PURE__ */ jsxs(Fragment$1, { children: [suffix, /* @__PURE__ */ jsx(ItemActionProvider, {
100
+ isDisabled: t4,
101
+ children: t8
102
+ })] });
103
+ let t9;
104
+ if ($[15] !== inputProps || $[16] !== userInputProps) {
105
+ t9 = mergeProps$1(inputProps, { "data-input-type": "passwordinput" }, userInputProps);
106
+ $[15] = inputProps;
107
+ $[16] = userInputProps;
108
+ $[17] = t9;
109
+ } else t9 = $[17];
110
+ let t10;
111
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
112
+ t10 = { paddingRight: "4x" };
113
+ $[18] = t10;
114
+ } else t10 = $[18];
115
+ return /* @__PURE__ */ jsx(TextInputBase, {
116
+ ref,
117
+ labelProps: mergedLabelProps,
118
+ inputProps: t9,
119
+ inputRef,
120
+ inputStyles: t10,
121
+ type,
122
+ suffixPosition: "after",
123
+ suffix: wrappedSuffix,
124
+ multiLine,
125
+ ...rest,
126
+ ...displayedValidation.getDisplayedValidation(rest, validation)
127
+ });
162
128
  }
163
129
  /**
164
130
  * PasswordInputs are password inputs that allow users to input passwords or code entries
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.js","names":["ForwardedRef","forwardRef","RefObject","useRef","useState","AriaTextFieldProps","useTextField","useI18n","EyeIcon","EyeInvisibleIcon","chain","mergeProps","useBufferedValue","castNullableStringValue","WithNullableValue","ItemAction","ItemActionProvider","useFieldProps","CubeBufferedValueProps","CubeTextInputBaseProps","TextInputBase","TextFieldKeyboardProps","CubePasswordInputProps","Omit","validate","PasswordInput","rawProps","ref","$","_c","t","t0","t1","Symbol","for","defaultValidationTrigger","valuePropsMapper","_temp","props","type","setType","labelProps","userLabelProps","inputProps","userInputProps","suffix","multiLine","inputRef","propsInputRef","form","isBuffered","rest","localInputRef","buffered","value","onChange","isDisabled","isReadOnly","t2","t3","t4","onBlur","reset","t5","HTMLInputElement","t6","mergedLabelProps","t7","_temp2","toggleType","t8","t9","t10","t11","t12","t13","wrappedSuffix","t14","t15","paddingRight","t16","type_0","toString","_PasswordInput","cubeInputType","displayName"],"sources":["../../../../src/components/fields/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, RefObject, useRef, useState } from 'react';\nimport { AriaTextFieldProps, useTextField } from 'react-aria';\n\nimport { useI18n } from '../../../i18n';\nimport { EyeIcon } from '../../../icons/EyeIcon';\nimport { EyeInvisibleIcon } from '../../../icons/EyeInvisibleIcon';\nimport { chain, mergeProps, useBufferedValue } from '../../../utils/react';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { ItemAction, ItemActionProvider } from '../../actions';\nimport { useFieldProps } from '../../form';\nimport {\n CubeBufferedValueProps,\n CubeTextInputBaseProps,\n TextInputBase,\n} from '../TextInput';\n\nimport type { TextFieldKeyboardProps } from '../../../shared/form';\n\nexport interface CubePasswordInputProps\n extends WithNullableValue<Omit<CubeTextInputBaseProps, 'validate'>>,\n CubeBufferedValueProps,\n TextFieldKeyboardProps {\n validate?: AriaTextFieldProps['validate'];\n}\n\nfunction PasswordInput(\n rawProps: CubePasswordInputProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n rawProps = castNullableStringValue(rawProps);\n let props = useFieldProps(rawProps, {\n defaultValidationTrigger: 'onBlur',\n valuePropsMapper: ({ value, onChange }) => ({\n value: value?.toString() ?? '',\n onChange,\n }),\n });\n\n let [type, setType] = useState('password');\n let {\n labelProps: userLabelProps,\n inputProps: userInputProps,\n suffix,\n multiLine,\n inputRef: propsInputRef,\n // The form instance, not the DOM `form` id `useTextField` forwards.\n form,\n isBuffered,\n ...rest\n } = props;\n let localInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = propsInputRef ?? localInputRef;\n\n // Hold the typed text locally until the controlled value catches up — see `useBufferedValue`.\n let buffered = useBufferedValue(rest.value, rest.onChange, {\n isBuffered,\n isDisabled: rest.isDisabled,\n isReadOnly: rest.isReadOnly,\n });\n\n let { labelProps, inputProps } = useTextField(\n {\n ...rest,\n value: buffered.value,\n onChange: buffered.onChange,\n onBlur: chain(rest.onBlur, buffered.reset),\n type,\n },\n inputRef as RefObject<HTMLInputElement | null>,\n );\n\n // Merge user-provided labelProps with aria labelProps\n const mergedLabelProps = mergeProps(labelProps, userLabelProps);\n\n const toggleType = () => {\n setType((type) => (type === 'password' ? 'text' : 'password'));\n };\n\n const wrappedSuffix = (\n <>\n {suffix}\n {/*\n The disabled state travels through the provider rather than as a prop on\n the action. Both disable it, but the provider marks the state as\n INHERITED from the field, and `current` paints from the colour it\n inherits — which a disabled field has already faded — so a second fade\n would multiply the two down to roughly a tenth opacity. No `type` is\n passed, so the `context` mod stays off and the toggle keeps its margins.\n */}\n <ItemActionProvider isDisabled={rest.isDisabled}>\n <ItemAction\n // No `type` — the default `current` type inherits the input's own text\n // color, so the toggle follows the field's theme, validation state and\n // disabled state rather than staying opaque against faded text.\n tooltip={t('passwordInput.toggleMasking', 'Toggle masking')}\n icon={type === 'password' ? <EyeInvisibleIcon /> : <EyeIcon />}\n onPress={toggleType}\n />\n </ItemActionProvider>\n </>\n );\n\n return (\n <TextInputBase\n ref={ref}\n labelProps={mergedLabelProps}\n inputProps={mergeProps(\n inputProps,\n { 'data-input-type': 'passwordinput' },\n userInputProps,\n )}\n inputRef={inputRef}\n inputStyles={{ paddingRight: '4x' }}\n type={type}\n suffixPosition=\"after\"\n suffix={wrappedSuffix}\n multiLine={multiLine}\n {...rest}\n />\n );\n}\n\n/**\n * PasswordInputs are password inputs that allow users to input passwords or code entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _PasswordInput = forwardRef(PasswordInput);\n\n(_PasswordInput as any).cubeInputType = 'Text';\n_PasswordInput.displayName = 'PasswordInput';\n\nexport { _PasswordInput as PasswordInput };\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,SAAAyB,cAAAC,UAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAIE,MAAA,EAAAC,MAAcvB,SAAS;CAAC,IAAAwB;AAAA,KAAAH,EAAA,OAAAF,UAAA;AAEbK,OAAAlB,wBAAwBa,SAAS;AAAAE,IAAA,KAAAF;AAAAE,IAAA,KAAAG;OAAAA,MAAAH,EAAA;AAA5CF,YAAWA;CAAH,IAAAM;AAAA,KAAAJ,EAAA,OAAAK,OAAAC,IAAA,4BAAA,EAAA;AAC4BF,OAAA;GAAAG,0BACR;GAAQC,kBAChBC;GAInB;AAAAT,IAAA,KAAAI;OAAAA,MAAAJ,EAAA;CAND,MAAAU,QAAYrB,cAAcS,UAAUM,GAMlC;CAEF,MAAA,CAAAO,MAAAC,WAAsBpC,SAAS,WAAW;CAC1C,MAAA,EAAAqC,YAAAC,gBAAAC,YAAAC,gBAAAC,QAAAC,WAAAC,UAAAC,eAAAC,MAAAC,YAAA,GAAAC,SAUIb;CACJ,MAAAc,g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EAAA;AAEY4C,QAAA,EAAAC,cAAgB,MAAM;AAAAnD,IAAA,MAAAkD;OAAAA,OAAAlD,EAAA;CAAA,IAAAoD;AAAA,KAAApD,EAAA,QAAAmB,YAAAnB,EAAA,QAAAsC,oBAAAtC,EAAA,QAAAkB,aAAAlB,EAAA,QAAAD,OAAAC,EAAA,QAAAuB,QAAAvB,EAAA,QAAAiD,OAAAjD,EAAA,QAAAW,QAAAX,EAAA,QAAAgD,eAAA;AATrCI,QAAA,oBAAC;GACMrD;GACOuC,YAAAA;GACA,YAAAW;GAKF9B;GACG,aAAA+B;GACPvC;GACS,gBAAA;GACPqC,QAAAA;GACG9B;GAAS,GAChBK;IACJ;AAAAvB,IAAA,MAAAmB;AAAAnB,IAAA,MAAAsC;AAAAtC,IAAA,MAAAkB;AAAAlB,IAAA,MAAAD;AAAAC,IAAA,MAAAuB;AAAAvB,IAAA,MAAAiD;AAAAjD,IAAA,MAAAW;AAAAX,IAAA,MAAAgD;AAAAhD,IAAA,MAAAoD;OAAAA,OAAApD,EAAA;AAAA,QAfFoD;;;;;;;AAhFJ,SAAAZ,OAAAa,QAAA;AAAA,QAoDuB1C,WAAS,aAAT,SAAA;;AApDvB,SAAAF,MAAAN,IAAA;CASuB,MAAA,EAAAuB,OAAAC,aAAAxB;AAAmB,QAAM;EAAAuB,OACnCA,OAAK4B,UAAkB,IAAvB;EAAuB3B;EAE/B;;AA4FL,MAAM4B,iBAAiBlF,WAAWwB,cAAc;AAEhD,AAAC0D,eAAuBC,gBAAgB;AACxCD,eAAeE,cAAc"}
1
+ {"version":3,"file":"PasswordInput.js","names":["ForwardedRef","forwardRef","RefObject","useRef","useState","AriaTextFieldProps","useTextField","useI18n","EyeIcon","EyeInvisibleIcon","chain","mergeProps","useBufferedValue","castNullableStringValue","WithNullableValue","ItemAction","ItemActionProvider","useFieldProps","useDisplayedValidation","CubeBufferedValueProps","CubeTextInputBaseProps","TextInputBase","TextFieldKeyboardProps","CubePasswordInputProps","Omit","validate","PasswordInput","rawProps","ref","$","_c","t","t0","t1","Symbol","for","defaultValidationTrigger","valuePropsMapper","_temp","props","type","setType","labelProps","userLabelProps","inputProps","userInputProps","suffix","multiLine","inputRef","propsInputRef","form","isBuffered","rest","localInputRef","buffered","value","onChange","isDisabled","isReadOnly","displayedValidation","validation","trackTouched","onBlur","reset","HTMLInputElement","t2","mergedLabelProps","t3","_temp2","toggleType","t4","t5","t6","t7","t8","wrappedSuffix","t9","t10","paddingRight","getDisplayedValidation","type_0","toString","_PasswordInput","cubeInputType","displayName"],"sources":["../../../../src/components/fields/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, RefObject, useRef, useState } from 'react';\nimport { AriaTextFieldProps, useTextField } from 'react-aria';\n\nimport { useI18n } from '../../../i18n';\nimport { EyeIcon } from '../../../icons/EyeIcon';\nimport { EyeInvisibleIcon } from '../../../icons/EyeInvisibleIcon';\nimport { chain, mergeProps, useBufferedValue } from '../../../utils/react';\nimport {\n castNullableStringValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { ItemAction } from '../../actions/ItemAction/ItemAction';\nimport { ItemActionProvider } from '../../actions/ItemActionContext';\nimport { useFieldProps } from '../../form';\nimport { useDisplayedValidation } from '../TextInput/displayed-validation';\nimport {\n CubeBufferedValueProps,\n CubeTextInputBaseProps,\n TextInputBase,\n} from '../TextInput/TextInputBase';\n\nimport type { TextFieldKeyboardProps } from '../../../shared/form';\n\nexport interface CubePasswordInputProps\n extends WithNullableValue<Omit<CubeTextInputBaseProps, 'validate'>>,\n CubeBufferedValueProps,\n TextFieldKeyboardProps {\n validate?: AriaTextFieldProps['validate'];\n}\n\nfunction PasswordInput(\n rawProps: CubePasswordInputProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n rawProps = castNullableStringValue(rawProps);\n let props = useFieldProps(rawProps, {\n defaultValidationTrigger: 'onBlur',\n valuePropsMapper: ({ value, onChange }) => ({\n value: value?.toString() ?? '',\n onChange,\n }),\n });\n\n let [type, setType] = useState('password');\n let {\n labelProps: userLabelProps,\n inputProps: userInputProps,\n suffix,\n multiLine,\n inputRef: propsInputRef,\n // The form instance, not the DOM `form` id `useTextField` forwards.\n form,\n isBuffered,\n ...rest\n } = props;\n let localInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = propsInputRef ?? localInputRef;\n\n // Hold the typed text locally until the controlled value catches up — see `useBufferedValue`.\n let buffered = useBufferedValue(rest.value, rest.onChange, {\n isBuffered,\n isDisabled: rest.isDisabled,\n isReadOnly: rest.isReadOnly,\n });\n\n let displayedValidation = useDisplayedValidation();\n let { labelProps, inputProps, ...validation } = useTextField(\n displayedValidation.trackTouched({\n ...rest,\n value: buffered.value,\n onChange: buffered.onChange,\n onBlur: chain(rest.onBlur, buffered.reset),\n type,\n }),\n inputRef as RefObject<HTMLInputElement | null>,\n );\n\n // Merge user-provided labelProps with aria labelProps\n const mergedLabelProps = mergeProps(labelProps, userLabelProps);\n\n const toggleType = () => {\n setType((type) => (type === 'password' ? 'text' : 'password'));\n };\n\n const wrappedSuffix = (\n <>\n {suffix}\n {/*\n The disabled state travels through the provider rather than as a prop on\n the action. Both disable it, but the provider marks the state as\n INHERITED from the field, and `current` paints from the colour it\n inherits — which a disabled field has already faded — so a second fade\n would multiply the two down to roughly a tenth opacity. No `type` is\n passed, so the `context` mod stays off and the toggle keeps its margins.\n */}\n <ItemActionProvider isDisabled={rest.isDisabled}>\n <ItemAction\n // No `type` — the default `current` type inherits the input's own text\n // color, so the toggle follows the field's theme, validation state and\n // disabled state rather than staying opaque against faded text.\n // A toggle button keeps one name and reports its state with\n // `aria-pressed`: pressed means the password is shown.\n tooltip={t('passwordInput.showPassword', 'Show password')}\n aria-pressed={type === 'text'}\n icon={type === 'password' ? <EyeInvisibleIcon /> : <EyeIcon />}\n onPress={toggleType}\n />\n </ItemActionProvider>\n </>\n );\n\n return (\n <TextInputBase\n ref={ref}\n labelProps={mergedLabelProps}\n inputProps={mergeProps(\n inputProps,\n { 'data-input-type': 'passwordinput' },\n userInputProps,\n )}\n inputRef={inputRef}\n inputStyles={{ paddingRight: '4x' }}\n type={type}\n suffixPosition=\"after\"\n suffix={wrappedSuffix}\n multiLine={multiLine}\n {...rest}\n {...displayedValidation.getDisplayedValidation(rest, validation)}\n />\n );\n}\n\n/**\n * PasswordInputs are password inputs that allow users to input passwords or code entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _PasswordInput = forwardRef(PasswordInput);\n\n(_PasswordInput as any).cubeInputType = 'Text';\n_PasswordInput.displayName = 'PasswordInput';\n\nexport { _PasswordInput as PasswordInput };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,SAAA0B,cAAAC,UAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAIE,MAAA,EAAAC,MAAcxB,SAAS;CAAC,IAAAyB;AAAA,KAAAH,EAAA,OAAAF,UAAA;AAEbK,OAAAnB,wBAAwBc,SAAS;AAAAE,IAAA,KAAAF;AAAAE,IAAA,KAAAG;OAAAA,MAAAH,EAAA;AAA5CF,YAAWA;CAAH,IAAAM;AAAA,KAAAJ,EAAA,OAAAK,OAAAC,IAAA,4BAAA,EAAA;AAC4BF,OAAA;GAAAG,0BACR;GAAQC,kBAChBC;GAInB;AAAAT,IAAA,KAAAI;OAAAA,MAAAJ,EAAA;CAND,MAAAU,QAAYtB,cAAcU,UAAUM,GAMlC;CAEF,MAAA,CAAAO,MAAAC,WAAsBrC,SAAS,WAAW;CAC1C,MAAA,EAAAsC,YAAAC,gBAAAC,YAAAC,gBAAAC,QAAAC,WAAAC,UAAAC,eAAAC,MAAAC,YAAA,GAAAC,SAUIb;CACJ,MAAAc,gBAAoBlD,OAA+C,KAAK;CACxE,MAAA6C,WAAeC,iBAAAI;CAGf,MAAAC,WAAe1C,iBAAiBwC,KAAIG,OAAQH,KAAII,UAAW;EAAAL;EAAAM,YAE7CL,KAAIK;EAAWC,Y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AxC,IAAA,MAAA0C;AAAA1C,IAAA,MAAA2C;AAAA3C,IAAA,MAAA4C;AAAA5C,IAAA,MAAA6C;OAAAA,MAAA7C,EAAA;CAtBR,MAAA8C,gBACE,8CACG7B,QASD,oBAAC;EAA+B,YAAAwB;YAC9BI;GAWmB,IACpB;CACH,IAAAE;AAAA,KAAA/C,EAAA,QAAAe,cAAAf,EAAA,QAAAgB,gBAAA;AAMc+B,OAAAjE,aACViC,YACA,EAAA,mBAAqB,iBAAiB,EACtCC,eACD;AAAAhB,IAAA,MAAAe;AAAAf,IAAA,MAAAgB;AAAAhB,IAAA,MAAA+C;OAAAA,MAAA/C,EAAA;CAAA,IAAAgD;AAAA,KAAAhD,EAAA,QAAAK,OAAAC,IAAA,4BAAA,EAAA;AAEY0C,QAAA,EAAAC,cAAgB,MAAM;AAAAjD,IAAA,MAAAgD;OAAAA,OAAAhD,EAAA;AAAA,QATrC,oBAAC;EACMD;EACOsC,YAAAA;EACA,YAAAU;EAKF5B;EACG,aAAA6B;EACPrC;EACS,gBAAA;EACPmC,QAAAA;EACG5B;EAAS,GAChBK;EAAI,GACJO,oBAAmBoB,uBAAwB3B,MAAMQ,WAAW;GAChE;;;;;;;AApGN,SAAAQ,OAAAY,QAAA;AAAA,QAqDuBxC,WAAS,aAAT,SAAA;;AArDvB,SAAAF,MAAAN,IAAA;CASuB,MAAA,EAAAuB,OAAAC,aAAAxB;AAAmB,QAAM;EAAAuB,OACnCA,OAAK0B,UAAkB,IAAvB;EAAuBzB;EAE/B;;AAiGL,MAAM0B,iBAAiBjF,WAAWyB,cAAc;AAEhD,AAACwD,eAAuBC,gBAAgB;AACxCD,eAAeE,cAAc"}
@@ -16,7 +16,7 @@ import { ListState, Section } from "react-stately";
16
16
  interface CubePickerProps<T> extends Omit<CubeListBoxProps<T>, 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'>, Omit<CubeItemProps, 'children' | 'size' | 'tooltip'>, BasePropsWithoutChildren, BaseStyleProps, OuterStyleProps, ColorStyleProps, FieldBaseProps<string | number | readonly (string | number)[] | null | undefined>, Pick<CubeItemButtonProps, 'type' | 'theme' | 'icon' | 'rightIcon' | 'prefix' | 'suffix' | 'hotkeys' | 'shape'> {
17
17
  /** Accessible name for the picker trigger when there is no visible label. */
18
18
  'aria-label'?: string;
19
- /** Ids of elements that also describe the trigger, beside the field's own description and message. */
19
+ /** Ids of elements that also describe the trigger, beside the displayed value and the field's own description and message. */
20
20
  'aria-describedby'?: string;
21
21
  /** Placeholder text when no selection is made */
22
22
  placeholder?: string;
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.195.0 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.196.0 | Cube Dev Team */
2
2
  import { extractStyles, mergeStyleLayers } from "../../../utils/styles.js";
3
3
  import { _Text } from "../../content/Text.js";
4
4
  import { isTextOnly } from "../../../utils/react/isTextOnly.js";
@@ -22,9 +22,9 @@ import { ListBox } from "../ListBox/ListBox.js";
22
22
  import { TriggerActions } from "../TriggerActions.js";
23
23
  import { processSelectionArray } from "../../../utils/selection.js";
24
24
  import { BASE_STYLES, COLOR_STYLES, OUTER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
25
- import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
25
+ import { forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
26
26
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
27
- import { FocusScope } from "react-aria";
27
+ import { FocusScope, mergeProps, useLabel } from "react-aria";
28
28
  import { Section, useListState } from "react-stately";
29
29
 
30
30
  //#region src/components/fields/Picker/Picker.tsx
@@ -66,7 +66,14 @@ const Picker = forwardRef(function Picker(props, ref) {
66
66
  const [internalSelectedKeys, setInternalSelectedKeys] = useState(defaultSelectedKeys ?? []);
67
67
  const [isPopoverOpen, setIsPopoverOpen] = useState(false);
68
68
  const triggerRef = useRef(null);
69
- const triggerAriaLabel = ariaLabel ?? (isTextOnly(label) ? String(label ?? "") : t("picker.pickerAriaLabel", "Picker"));
69
+ const valueId = useId();
70
+ const { labelProps, fieldProps: triggerLabelProps } = useLabel({
71
+ id: props.id,
72
+ label,
73
+ labelElementType: "span",
74
+ "aria-label": ariaLabel ?? (!label ? t("picker.pickerAriaLabel", "Picker") : void 0),
75
+ "aria-labelledby": props["aria-labelledby"]
76
+ });
70
77
  const pickerAriaLabel = `${ariaLabel ?? (isTextOnly(label) ? String(label ?? "") : "")} ${t("picker.pickerAriaLabel", "Picker")}`.trim();
71
78
  const triggerWidthRef = useRef(void 0);
72
79
  const isControlledSingle = selectedKey !== void 0;
@@ -250,10 +257,11 @@ const Picker = forwardRef(function Picker(props, ref) {
250
257
  onPress: clearValue
251
258
  }) : /* @__PURE__ */ jsx(ItemActionIcon, { children: /* @__PURE__ */ jsx(DirectionIcon, { to: isPopoverOpen ? "top" : "bottom" }) })
252
259
  });
260
+ const triggerValueId = triggerContent ? valueId : void 0;
261
+ const triggerDescribedBy = [triggerValueId, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
253
262
  const triggerElement = /* @__PURE__ */ jsx(_ItemButton, {
254
263
  ref: triggerRef,
255
264
  "data-popover-trigger": true,
256
- id,
257
265
  qa: qa || "PickerTrigger",
258
266
  type,
259
267
  theme: paintedTheme,
@@ -276,8 +284,10 @@ const Picker = forwardRef(function Picker(props, ref) {
276
284
  descriptionPlacement,
277
285
  styles: triggerStyles,
278
286
  ...keyboardProps,
279
- "aria-label": triggerAriaLabel,
280
- "aria-describedby": ariaDescribedBy,
287
+ ...mergeProps(triggerLabelProps, { id }),
288
+ labelProps: triggerValueId ? { id: triggerValueId } : void 0,
289
+ "aria-haspopup": "dialog",
290
+ "aria-describedby": triggerDescribedBy,
281
291
  children: triggerContent
282
292
  });
283
293
  const handleSelectionChange = useEvent((selection) => {
@@ -332,6 +342,7 @@ const Picker = forwardRef(function Picker(props, ref) {
332
342
  children: /* @__PURE__ */ jsx(FocusScope, {
333
343
  restoreFocus: true,
334
344
  children: /* @__PURE__ */ jsx(ListBox, {
345
+ isBare: true,
335
346
  autoFocus: true,
336
347
  items: items ? finalItems : void 0,
337
348
  "aria-label": pickerAriaLabel,
@@ -372,7 +383,10 @@ const Picker = forwardRef(function Picker(props, ref) {
372
383
  })
373
384
  })]
374
385
  })
375
- }), ref, props);
386
+ }), ref, {
387
+ ...props,
388
+ labelProps: mergeProps(labelProps, props.labelProps)
389
+ });
376
390
  });
377
391
  Picker.Item = ListBox.Item;
378
392
  Picker.Section = Section;
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.js","names":["CollectionChildren","FocusableRefValue","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","filterBaseProps","OUTER_STYLES","OuterStyleProps","Styles","tasty","ForwardedRef","forwardRef","MutableRefObject","ReactElement","ReactNode","RefObject","useEffect","useMemo","useRef","useState","FocusScope","Key","Placement","Section","BaseSection","ListState","useListState","useEvent","useWarn","useI18n","CloseIcon","DirectionIcon","LoadingIcon","isTextOnly","allowOverlayKeysToPropagate","processSelectionArray","extractStyles","mergeStyleLayers","CubeItemButtonProps","ItemAction","ItemButton","CubeItemProps","Text","getValidationIcon","getValidationTheme","useFieldProps","wrapWithField","Dialog","DialogTrigger","CubeListBoxProps","ListBox","TriggerActions","TriggerIcon","KeyboardEvent","RAKeyboardEvent","FieldBaseProps","CubePickerProps","Omit","T","Pick","placeholder","size","listBoxStyles","popoverStyles","triggerStyles","isCheckable","shouldFlip","targetRef","HTMLElement","placement","containerPadding","triggerTooltip","triggerDescription","renderSummary","args","selectedLabels","selectedKeys","selectedLabel","selectedKey","selectionMode","listStateRef","mods","Record","isClearable","clearLabel","onClear","actions","sortSelectedToTop","onOpenChange","isOpen","PROP_STYLES","PickerWrapper","qa","styles","display","flow","gridRows","placeContent","placeItems","Picker","props","ref","t","valuePropsMapper","value","onChange","fieldProps","onSelectionChange","key","Array","isArray","id","label","ariaLabel","ariaDescribedBy","extra","icon","rightIcon","prefix","suffix","hotkeys","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","isLoading","message","externalMods","description","descriptionPlacement","type","theme","shape","labelSuffix","shouldFocusWrap","children","defaultSelectedKey","defaultSelectedKeys","disabledKeys","focusOnHover","showSelectAll","selectAllLabel","items","header","footer","headerStyles","footerStyles","allValueProps","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","disallowEmptySelection","shouldUseVirtualFocus","onEscape","onOptionClick","externalListStateRef","otherProps","internalSelectedKey","setInternalSelectedKey","internalSelectedKeys","setInternalSelectedKeys","isPopoverOpen","setIsPopoverOpen","triggerRef","HTMLButtonElement","triggerAriaLabel","String","pickerAriaLabel","trim","triggerWidthRef","undefined","isControlledSingle","isControlledMultiple","effectiveSelectedKey","effectiveSelectedKeys","internalListStateRef","current","cachedItemsOrder","latestSelectionRef","single","multiple","map","selectionWhenClosed","sortSelectedToTopExplicit","shouldSortSelectedToTop","finalItems","selectedKeySet","Set","length","forEach","k","add","itemsArray","from","selectedItems","unselectedItems","item","has","push","sorted","localCollectionState","collection","labels","textValue","keysToGet","getItem","filter","Boolean","hasSelection","handleOpenChange","UNSAFE_getDOMNode","offsetWidth","keyboardProps","onKeyDown","e","preventDefault","clearValue","focus","triggerContent","join","showClearButton","isReadOnly","validationIcon","paintedTheme","hasCustomRightIcon","triggerRightIcon","hasTriggerActions","triggerActions","pressed","triggerElement","handleSelectionChange","selection","normalized","handleEscape","handleOptionClick","pickerField","eventProps","width","Item","Action","Object","defineProperty","enumerable","configurable"],"sources":["../../../../src/components/fields/Picker/Picker.tsx"],"sourcesContent":["import { CollectionChildren, FocusableRefValue } from '@react-types/shared';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n filterBaseProps,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FocusScope, Key, Placement } from 'react-aria';\nimport { Section as BaseSection, ListState, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { isTextOnly } from '../../../utils/react/isTextOnly';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { processSelectionArray } from '../../../utils/selection';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\nimport { CubeItemButtonProps, ItemAction, ItemButton } from '../../actions';\nimport { CubeItemProps } from '../../content/Item';\nimport { Text } from '../../content/Text';\nimport {\n getValidationIcon,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport { Dialog } from '../../overlays/Dialog/Dialog';\nimport { DialogTrigger } from '../../overlays/Dialog/DialogTrigger';\nimport { CubeListBoxProps, ListBox } from '../ListBox/ListBox';\nimport { TriggerActions, TriggerIcon } from '../TriggerActions';\n\nimport type { KeyboardEvent as RAKeyboardEvent } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\nexport interface CubePickerProps<T>\n extends Omit<\n CubeListBoxProps<T>,\n 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'\n >,\n // `tooltip` is the trigger's, and on a picker the trigger's is spelled\n // `triggerTooltip`; the label's info badge is `labelTooltip`.\n Omit<CubeItemProps, 'children' | 'size' | 'tooltip'>,\n BasePropsWithoutChildren,\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n >,\n Pick<\n CubeItemButtonProps,\n | 'type'\n | 'theme'\n | 'icon'\n | 'rightIcon'\n | 'prefix'\n | 'suffix'\n | 'hotkeys'\n | 'shape'\n > {\n /** Accessible name for the picker trigger when there is no visible label. */\n 'aria-label'?: string;\n /** Ids of elements that also describe the trigger, beside the field's own description and message. */\n 'aria-describedby'?: string;\n /** Placeholder text when no selection is made */\n placeholder?: string;\n /** Size of the picker component */\n size?: 'small' | 'medium' | 'large';\n /** Custom styles for the list box popover */\n listBoxStyles?: Styles;\n /** Custom styles for the popover container */\n popoverStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Whether to show checkboxes for multiple selection mode */\n isCheckable?: boolean;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /**\n * The ref of the element the popover should visually attach itself to.\n * Defaults to the trigger button.\n *\n * Forwarded to `DialogTrigger`, so the anchor also becomes what outside-click\n * dismissal treats as the trigger. The popover's `minWidth` stays tied to the\n * trigger button, not to this element.\n */\n targetRef?: RefObject<HTMLElement | null>;\n /**\n * Placement of the popover relative to the anchor.\n * Accepts React Aria's `Placement` strings (e.g. `'bottom start'`,\n * `'top start'`, `'right top'`, `'left top'`).\n * @default 'bottom start'\n */\n placement?: Placement;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /** Tooltip for the trigger button (separate from `labelTooltip`) */\n triggerTooltip?: CubeItemProps['tooltip'];\n /** Description for the trigger button (separate from field description) */\n triggerDescription?: CubeItemProps['description'];\n\n /**\n * Custom renderer for the summary shown inside the trigger when there is a selection.\n *\n * For `selectionMode=\"multiple\"` the function receives:\n * - `selectedLabels`: array of labels of the selected items.\n * - `selectedKeys`: array of keys of the selected items or \"all\".\n *\n * For `selectionMode=\"single\"` the function receives:\n * - `selectedLabel`: label of the selected item.\n * - `selectedKey`: key of the selected item.\n *\n * The function should return a `ReactNode` that will be rendered inside the trigger.\n * Set to `false` to hide the summary text completely.\n */\n renderSummary?:\n | ((args: {\n selectedLabels?: string[];\n selectedKeys?: 'all' | (string | number)[];\n selectedLabel?: string;\n selectedKey?: string | number | null;\n selectionMode?: 'single' | 'multiple';\n }) => ReactNode)\n | false;\n\n /** Ref to access internal ListBox state */\n listStateRef?: MutableRefObject<ListState<T>>;\n /** Additional modifiers for styling the Picker */\n mods?: Record<string, boolean>;\n /** Whether the picker is clearable using a clear button in the rightIcon slot */\n isClearable?: boolean;\n /** Accessible name for the built-in clear button. Defaults to a localized \"Clear value\". */\n clearLabel?: string;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n /**\n * Custom actions rendered inside the trigger, to the left of the built-in\n * clear button and dropdown caret. Use `Picker.Action` so they match the\n * trigger's size and theme.\n *\n * Pressing one runs its handler without opening or closing the popover —\n * including while the popover is open. Actions follow the trigger's disabled\n * state but NOT `isReadOnly`, since a read-only field can still host an\n * action that does not change the value; pass `isDisabled` yourself for one\n * that does.\n */\n actions?: ReactNode;\n /**\n * Sort selected item(s) to the top when the popover opens.\n * Only works when using the `items` prop (data-driven mode).\n * Supports both single and multiple selection modes.\n * @default true when items are provided, false when using JSX children\n */\n sortSelectedToTop?: boolean;\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nconst PROP_STYLES = [...BASE_STYLES, ...OUTER_STYLES, ...COLOR_STYLES];\n\nconst PickerWrapper = tasty({\n qa: 'PickerWrapper',\n styles: {\n display: 'inline-grid',\n flow: 'column',\n gridRows: '1sf',\n placeContent: 'stretch',\n placeItems: 'stretch',\n },\n});\n\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: CubePickerProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: Record<string, unknown> = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: Key | null | 'all' | Key[]) => {\n if (props.selectionMode === 'multiple') {\n // Handle \"all\" selection and array selections\n if (key === 'all') {\n onChange('all');\n } else {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n }\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n let {\n id,\n qa,\n label,\n 'aria-label': ariaLabel,\n // The field's description and message describe the trigger, which is the\n // control, not the wrapper the rest of these props land on.\n 'aria-describedby': ariaDescribedBy,\n extra,\n icon,\n rightIcon,\n prefix,\n suffix,\n actions,\n hotkeys,\n triggerTooltip,\n triggerDescription,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n message,\n mods: externalMods,\n description,\n descriptionPlacement,\n placeholder,\n size = 'medium',\n styles,\n listBoxStyles,\n popoverStyles,\n type = 'outline',\n theme = 'default',\n shape,\n labelSuffix,\n shouldFocusWrap,\n children,\n shouldFlip = true,\n targetRef,\n placement = 'bottom start',\n containerPadding = 8,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n selectionMode = 'single',\n listStateRef,\n focusOnHover,\n showSelectAll,\n selectAllLabel = t('picker.all', 'All'),\n items,\n header,\n footer,\n headerStyles,\n footerStyles,\n triggerStyles,\n renderSummary,\n isCheckable,\n allValueProps,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n disallowEmptySelection,\n shouldUseVirtualFocus,\n onEscape,\n onOptionClick,\n isClearable,\n clearLabel,\n onClear,\n sortSelectedToTop,\n onOpenChange,\n listStateRef: externalListStateRef,\n ...otherProps\n } = props;\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n // Warn if isCheckable is false in single selection mode\n useWarn(isCheckable === false && selectionMode === 'single', {\n key: ['picker-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n // Internal selection state (uncontrolled scenario)\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(\n defaultSelectedKey ?? null,\n );\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n 'all' | Key[]\n >(defaultSelectedKeys ?? []);\n\n // Popover state — used as controlled prop for DialogTrigger\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const triggerRef = useRef<FocusableRefValue<HTMLButtonElement>>(null);\n const triggerAriaLabel =\n ariaLabel ??\n (isTextOnly(label)\n ? String(label ?? '')\n : t('picker.pickerAriaLabel', 'Picker'));\n const pickerAriaLabel =\n `${ariaLabel ?? (isTextOnly(label) ? String(label ?? '') : '')} ${t('picker.pickerAriaLabel', 'Picker')}`.trim();\n\n // Measured lazily on popover open instead of on every render\n const triggerWidthRef = useRef<number | undefined>(undefined);\n\n const isControlledSingle = selectedKey !== undefined;\n const isControlledMultiple = selectedKeys !== undefined;\n\n const effectiveSelectedKey = isControlledSingle\n ? selectedKey\n : internalSelectedKey;\n const effectiveSelectedKeys = isControlledMultiple\n ? selectedKeys\n : internalSelectedKeys;\n\n // Ref to access internal ListBox state for collection API\n const internalListStateRef = useRef<ListState<T>>(null);\n\n // Sync internal ref with external ref if provided\n useEffect(() => {\n if (externalListStateRef && internalListStateRef.current) {\n externalListStateRef.current = internalListStateRef.current;\n }\n }, [externalListStateRef]);\n\n // Cache for sorted items array when using `items` prop\n const cachedItemsOrder = useRef<T[] | null>(null);\n\n const latestSelectionRef = useRef<{\n single: string | null;\n multiple: string[];\n }>({\n single: effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n });\n\n useEffect(() => {\n latestSelectionRef.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }, [effectiveSelectedKey, effectiveSelectedKeys, selectionMode]);\n\n const selectionWhenClosed = useRef<{\n single: string | null;\n multiple: string[];\n }>({ single: null, multiple: [] });\n\n const sortSelectedToTopExplicit = sortSelectedToTop !== undefined;\n const shouldSortSelectedToTop = sortSelectedToTop ?? (items ? true : false);\n\n useWarn(sortSelectedToTopExplicit && shouldSortSelectedToTop && !items, {\n key: ['picker-sort-selected-to-top-children'],\n args: [\n 'Picker: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.',\n ],\n });\n\n useEffect(() => {\n cachedItemsOrder.current = null;\n }, [items]);\n\n useEffect(() => {\n if (!isPopoverOpen) {\n selectionWhenClosed.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }\n }, [\n effectiveSelectedKey,\n effectiveSelectedKeys,\n isPopoverOpen,\n selectionMode,\n ]);\n\n const finalItems = useMemo(() => {\n if (!items || !shouldSortSelectedToTop) return items;\n if (!isPopoverOpen) return items;\n if (cachedItemsOrder.current) return cachedItemsOrder.current;\n\n const selectedKeySet = new Set<string>();\n\n if (selectionMode === 'multiple') {\n if (\n selectionWhenClosed.current.multiple.length === 0 ||\n effectiveSelectedKeys === 'all'\n ) {\n return items;\n }\n selectionWhenClosed.current.multiple.forEach((k) =>\n selectedKeySet.add(k),\n );\n } else if (selectionWhenClosed.current.single) {\n selectedKeySet.add(selectionWhenClosed.current.single);\n }\n\n if (selectedKeySet.size === 0) return items;\n\n const itemsArray = Array.isArray(items) ? items : Array.from(items);\n const selectedItems: T[] = [];\n const unselectedItems: T[] = [];\n\n itemsArray.forEach((item) => {\n const key = (item as any)?.key ?? (item as any)?.id;\n if (key != null && selectedKeySet.has(String(key))) {\n selectedItems.push(item);\n } else {\n unselectedItems.push(item);\n }\n });\n\n const sorted = [...selectedItems, ...unselectedItems];\n\n cachedItemsOrder.current = sorted;\n\n return sorted;\n }, [items, shouldSortSelectedToTop, selectionMode, isPopoverOpen]);\n\n // Create local collection state for reading item data (labels, etc.)\n // This allows us to read item labels even before the popover opens\n const localCollectionState = useListState({\n children,\n items: finalItems, // Use sorted items to match what's shown in popover\n selectionMode: 'none', // Don't manage selection in this state\n });\n\n const selectedLabels = useMemo(() => {\n const collection = localCollectionState?.collection;\n\n if (selectionMode === 'multiple' && effectiveSelectedKeys === 'all') {\n if (!collection) return [];\n const labels: string[] = [];\n for (const item of collection) {\n if (item.type === 'item') {\n labels.push(item.textValue || String(item.key));\n }\n }\n return labels;\n }\n\n const keysToGet =\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? effectiveSelectedKeys || []\n : effectiveSelectedKey != null\n ? [effectiveSelectedKey]\n : [];\n\n return keysToGet\n .map((key) => {\n const item = collection?.getItem(key);\n return item?.textValue || String(key);\n })\n .filter(Boolean);\n }, [\n selectionMode,\n effectiveSelectedKeys,\n effectiveSelectedKey,\n localCollectionState?.collection,\n ]);\n\n const hasSelection = selectedLabels.length > 0;\n\n // ---------------------------------------------------------------------------\n // Popover lifecycle — all effects moved out of the inline renderTrigger\n // function so they have a stable component identity and don't tear\n // down/setup on every parent re-render.\n // DialogTrigger is controlled via isOpen/onOpenChange.\n // ---------------------------------------------------------------------------\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (isOpen === isPopoverOpen) return;\n\n if (isOpen) {\n triggerWidthRef.current =\n triggerRef?.current?.UNSAFE_getDOMNode()?.offsetWidth;\n }\n setIsPopoverOpen(isOpen);\n if (!isOpen) {\n selectionWhenClosed.current = { ...latestSelectionRef.current };\n cachedItemsOrder.current = null;\n }\n onOpenChange?.(isOpen);\n });\n\n // Popover sync is handled by the inner `DialogTrigger` (type=\"popover\").\n\n // Keyboard handler for arrow keys to open popover\n // Deliberately NOT `useKeyboard`. `ItemButton` already runs whatever\n // `onKeyDown` it is given through `useFocusable`'s own `useKeyboard`, and a\n // second wrapper here would leave `continuePropagation()` releasing only the\n // inner one while the outer still stopped the event — `Escape` reached the\n // trigger and died there (CUB-4839). Handed over plain, this IS the outer\n // wrapper's handler, so the opt-out applies to the event that travels.\n const keyboardProps = {\n onKeyDown: (e: RAKeyboardEvent) => {\n allowOverlayKeysToPropagate(e);\n\n if ((e.key === 'ArrowUp' || e.key === 'ArrowDown') && !isPopoverOpen) {\n e.preventDefault();\n handleOpenChange(true);\n\n return;\n }\n },\n };\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (selectionMode === 'multiple') {\n if (!isControlledMultiple) {\n setInternalSelectedKeys([]);\n }\n onSelectionChange?.([]);\n } else {\n if (!isControlledSingle) {\n setInternalSelectedKey(null);\n }\n onSelectionChange?.(null);\n }\n\n handleOpenChange(false);\n triggerRef?.current?.focus?.();\n onClear?.();\n\n return false;\n });\n\n // ---------------------------------------------------------------------------\n // Trigger content\n // ---------------------------------------------------------------------------\n\n const triggerContent = useMemo((): ReactNode => {\n if (typeof renderSummary === 'function') {\n if (selectionMode === 'single') {\n return renderSummary({\n selectedLabel: selectedLabels[0],\n selectedKey: effectiveSelectedKey ?? null,\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'single',\n });\n }\n\n return renderSummary({\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'multiple',\n });\n } else if (renderSummary === false) {\n return null;\n }\n\n if (!hasSelection) {\n return <Text.Placeholder>{placeholder}</Text.Placeholder>;\n } else if (selectionMode === 'single') {\n return selectedLabels[0] || null;\n } else if (effectiveSelectedKeys === 'all') {\n return selectAllLabel;\n } else {\n return selectedLabels.join(', ') || null;\n }\n }, [\n renderSummary,\n selectionMode,\n selectedLabels,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n hasSelection,\n placeholder,\n selectAllLabel,\n ]);\n\n const showClearButton =\n isClearable && hasSelection && !isDisabled && !props.isReadOnly;\n\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n // Must be the SAME expression the trigger is painted with, not the raw\n // `theme`: this tells an action which surface it sits on, and validation\n // overrides the theme. With `theme=\"special\"` on an invalid field the trigger\n // renders `danger` — a light surface — so forwarding `special` would hand the\n // action the strong dark-purple alpha ramp and make hover/press read far too\n // heavy.\n const paintedTheme = getValidationTheme(theme, { isInvalid, isValid });\n //\n // It reaches the trailing actions through `ItemButton`'s wrapper, which is\n // what provides `ItemActionContext` for a run rendered outside the button —\n // so passing it as the trigger's `theme` is all that is needed.\n\n if (validationIcon) {\n suffix = (\n <>\n {suffix}\n {validationIcon}\n </>\n );\n }\n\n // A caller's `rightIcon` keeps the `rightIcon` slot: it accepts a render\n // function resolved against the trigger's mods, which only that slot does, and\n // it is also what a caller's `RightIcon` styles target. It replaces the\n // built-in control, exactly as before — including under `isLoading`, where the\n // spinner replaces it in turn.\n const hasCustomRightIcon = rightIcon !== undefined;\n const triggerRightIcon = hasCustomRightIcon ? (\n isLoading ? (\n <LoadingIcon />\n ) : (\n rightIcon\n )\n ) : undefined;\n\n // With a caller's own `rightIcon` the built-in control moves into that slot,\n // leaving the run with whatever the caller passed — possibly nothing. `null`\n // rather than nothing at all: the run stays in the markup, so the trigger does\n // not restructure if actions arrive later, but the row stops counting it as\n // end content. That is what keeps an icon-only trigger with `rightIcon={null}`\n // square, as it was before the run existed.\n const hasTriggerActions = !hasCustomRightIcon || !!actions;\n\n // Everything trailing that is NOT the caller's own icon goes into the actions\n // run — a sibling of the `<button>`, so the clear button is no longer nested\n // inside one. See `TriggerActions`.\n const triggerActions = (\n <TriggerActions\n actions={actions}\n builtIn={\n hasCustomRightIcon ? null : isLoading ? (\n <TriggerIcon>\n <LoadingIcon />\n </TriggerIcon>\n ) : showClearButton ? (\n <ItemAction\n icon={<CloseIcon />}\n size={size}\n qa=\"PickerClearButton\"\n // See `Select`: `ItemAction` names itself from `aria-label` or a\n // string `tooltip`, and warns for neither.\n aria-label={clearLabel ?? t('picker.clearValue', 'Clear value')}\n // No explicit `type`/`theme` — the default `current` type inherits\n // the trigger's own text color, which already carries validation\n // state here, so this renders exactly as the explicit theme did\n // while also following a custom theme.\n mods={{ pressed: false }}\n onPress={clearValue}\n />\n ) : (\n <TriggerIcon>\n <DirectionIcon to={isPopoverOpen ? 'top' : 'bottom'} />\n </TriggerIcon>\n )\n }\n />\n );\n\n // Trigger element — plain JSX with no hooks.\n const triggerElement = (\n <ItemButton\n ref={triggerRef as any}\n data-popover-trigger\n id={id}\n qa={qa || 'PickerTrigger'}\n type={type}\n theme={paintedTheme}\n size={size}\n shape={shape}\n isDisabled={isDisabled || isLoading}\n data-input-type=\"picker\"\n mods={{\n placeholder: !hasSelection,\n ...externalMods,\n }}\n icon={icon}\n rightIcon={triggerRightIcon}\n actions={hasTriggerActions ? triggerActions : null}\n prefix={prefix}\n suffix={suffix}\n hotkeys={hotkeys}\n tooltip={triggerTooltip}\n description={triggerDescription}\n descriptionPlacement={descriptionPlacement}\n styles={triggerStyles}\n {...keyboardProps}\n aria-label={triggerAriaLabel}\n aria-describedby={ariaDescribedBy}\n >\n {triggerContent}\n </ItemButton>\n );\n\n // ---------------------------------------------------------------------------\n // Selection change handler\n // ---------------------------------------------------------------------------\n\n const handleSelectionChange = useEvent((selection: any) => {\n if (selectionMode === 'single') {\n // With `disallowEmptySelection`, re-selecting the current item emits a\n // duplicate event (see `allowDuplicateSelectionEvents` below). Close the\n // popover but don't propagate the unchanged selection.\n if (\n disallowEmptySelection &&\n selection != null &&\n effectiveSelectedKey != null &&\n String(selection) === String(effectiveSelectedKey)\n ) {\n handleOpenChange(false);\n return;\n }\n\n if (!isControlledSingle) {\n setInternalSelectedKey(selection as Key | null);\n }\n } else {\n if (!isControlledMultiple) {\n let normalized: 'all' | Key[] = selection;\n\n if (selection === 'all') {\n normalized = 'all';\n } else if (Array.isArray(selection)) {\n normalized = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n normalized = processSelectionArray(selection as Set<Key>);\n }\n\n setInternalSelectedKeys(normalized);\n }\n }\n\n if (selectionMode === 'single') {\n latestSelectionRef.current.single =\n selection != null ? String(selection) : null;\n } else {\n if (selection === 'all') {\n latestSelectionRef.current.multiple = [];\n } else if (Array.isArray(selection)) {\n latestSelectionRef.current.multiple = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n latestSelectionRef.current.multiple = processSelectionArray(\n selection as Set<Key>,\n );\n } else {\n latestSelectionRef.current.multiple = [];\n }\n }\n\n onSelectionChange?.(selection);\n\n if (selectionMode === 'single') {\n handleOpenChange(false);\n }\n });\n\n const handleEscape = useEvent(() => {\n handleOpenChange(false);\n });\n\n const handleOptionClick = useEvent((key: Key) => {\n if ((selectionMode === 'multiple' && isCheckable) || key === '__ALL__') {\n handleOpenChange(false);\n }\n });\n\n const pickerField = (\n <PickerWrapper\n styles={styles}\n {...(filterBaseProps(otherProps, { eventProps: true }) as Record<\n string,\n unknown\n >)}\n >\n <DialogTrigger\n type=\"popover\"\n placement={placement}\n targetRef={targetRef}\n isOpen={isPopoverOpen}\n containerPadding={containerPadding}\n shouldFlip={shouldFlip}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {() => (\n <Dialog\n qa=\"PickerOverlay\"\n aria-label={pickerAriaLabel}\n display=\"grid\"\n styles={mergeStyleLayers(\n {\n gridRows: '1sf',\n width: 'max($overlay-min-width, 30x) max-content 50vw',\n '$overlay-min-width': '30x',\n },\n popoverStyles,\n )}\n style={\n triggerWidthRef.current\n ? ({\n '--overlay-min-width': `${triggerWidthRef.current}px`,\n } as any)\n : undefined\n }\n >\n <FocusScope restoreFocus>\n <ListBox\n autoFocus\n items={items ? (finalItems as typeof props.items) : undefined}\n aria-label={pickerAriaLabel}\n selectedKey={\n selectionMode === 'single' ? effectiveSelectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple'\n ? effectiveSelectedKeys\n : undefined\n }\n listStyles={listStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n listRef={listRef}\n disallowEmptySelection={disallowEmptySelection}\n allowDuplicateSelectionEvents={\n selectionMode === 'single' && !!disallowEmptySelection\n }\n disabledKeys={disabledKeys}\n focusOnHover={focusOnHover}\n shouldFocusWrap={shouldFocusWrap}\n selectionMode={selectionMode}\n isInvalid={isInvalid}\n isValid={isValid}\n isDisabled={isDisabled}\n isLoading={isLoading}\n stateRef={internalListStateRef}\n isCheckable={isCheckable}\n shape=\"popover\"\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n header={header}\n footer={footer}\n headerStyles={headerStyles}\n footerStyles={footerStyles}\n qa={`${props.qa || 'Picker'}ListBox`}\n allValueProps={allValueProps}\n onEscape={handleEscape}\n onOptionClick={handleOptionClick}\n onSelectionChange={handleSelectionChange}\n >\n {children as CollectionChildren<T>}\n </ListBox>\n </FocusScope>\n </Dialog>\n )}\n </DialogTrigger>\n </PickerWrapper>\n );\n\n return wrapWithField<Omit<CubePickerProps<T>, 'children'>>(\n pickerField,\n ref as any,\n props,\n );\n}) as unknown as (<T>(\n props: CubePickerProps<T> & { ref?: ForwardedRef<HTMLElement> },\n) => ReactElement) & {\n Item: typeof ListBox.Item;\n Section: typeof BaseSection;\n Action: typeof ItemAction;\n};\n\nPicker.Item = ListBox.Item;\n\nPicker.Section = BaseSection;\n\nPicker.Action = ItemAction;\n\nObject.defineProperty(Picker, 'cubeInputType', {\n value: 'Picker',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmLA,MAAM4F,cAAc;CAAC,GAAG1F;CAAa,GAAGM;CAAc,GAAGH;CAAa;AAEtE,MAAMwF,gBAAgBlF,MAAM;CAC1BmF,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC,YAAY;EACd;CACD,CAAC;AAEF,MAAaC,SAASxF,WAAW,SAASwF,OACxCC,OACAC,KACA;CACA,MAAM,EAAEC,MAAMzE,SAAS;AAEvBuE,SAAQvD,cAAcuD,OAAO,EAC3BG,mBAAmB,EAAEC,OAAOC,eAAe;EACzC,MAAMC,aAAsC,EAAE;AAE9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G,gBAAgBO,UACX,EACC,uBAAuB,GAAGP,gBAAgBO,QAAO,KAClD,GACDN;cAGN,oBAAC;KAAW;eACV,oBAAC;MACC;MACA,OAAO/B,QAAS8C,aAAoCf;MACpD,cAAYH;MACZ,aACE7F,kBAAkB,WAAWmG,uBAAuBH;MAEtD,cACEhG,kBAAkB,aACdoG,wBACAJ;MAEMzB;MACEC;MACCC;MACAC;MACNC;MACAC;MACeC;MACxB,+BACE7E,kBAAkB,YAAY,CAAC,CAAC6E;MAEpBhB;MACAC;MACGL;MACFzD;MACJ6C;MACFC;MACGC;MACDC;MACX,UAAUqD;MACGnH;MACb,OAAM;MACS6E;MACCC;MACRE;MACAC;MACMC;MACAC;MACd,IAAI,GAAGhD,MAAMR,MAAM,SAAQ;MACZyD;MACf,UAAUyF;MACV,eAAeC;MACf,mBAAmBJ;MAElBlG;OACM;MACC;KAEf;IACY;GAElB,EAICpC,KACAD,MACD;EACD;AAQFD,OAAOgJ,OAAOjM,QAAQiM;AAEtBhJ,OAAO5E,UAAUC;AAEjB2E,OAAOiJ,SAAS7M;AAEhB8M,OAAOC,eAAenJ,QAAQ,iBAAiB;CAC7CK,OAAO;CACP+I,YAAY;CACZC,cAAc;CACf,CAAC"}
1
+ {"version":3,"file":"Picker.js","names":["CollectionChildren","FocusableRefValue","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","filterBaseProps","OUTER_STYLES","OuterStyleProps","Styles","tasty","ForwardedRef","forwardRef","MutableRefObject","ReactElement","ReactNode","RefObject","useEffect","useId","useMemo","useRef","useState","FocusScope","Key","mergeProps","Placement","useLabel","Section","BaseSection","ListState","useListState","useEvent","useWarn","useI18n","CloseIcon","DirectionIcon","LoadingIcon","isTextOnly","allowOverlayKeysToPropagate","processSelectionArray","extractStyles","mergeStyleLayers","CubeItemButtonProps","ItemAction","ItemButton","CubeItemProps","Text","getValidationIcon","getValidationTheme","useFieldProps","wrapWithField","Dialog","DialogTrigger","CubeListBoxProps","ListBox","TriggerActions","TriggerIcon","KeyboardEvent","RAKeyboardEvent","FieldBaseProps","CubePickerProps","Omit","T","Pick","placeholder","size","listBoxStyles","popoverStyles","triggerStyles","isCheckable","shouldFlip","targetRef","HTMLElement","placement","containerPadding","triggerTooltip","triggerDescription","renderSummary","args","selectedLabels","selectedKeys","selectedLabel","selectedKey","selectionMode","listStateRef","mods","Record","isClearable","clearLabel","onClear","actions","sortSelectedToTop","onOpenChange","isOpen","PROP_STYLES","PickerWrapper","qa","styles","display","flow","gridRows","placeContent","placeItems","Picker","props","ref","t","valuePropsMapper","value","onChange","fieldProps","onSelectionChange","key","Array","isArray","id","label","ariaLabel","ariaDescribedBy","extra","icon","rightIcon","prefix","suffix","hotkeys","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","isLoading","message","externalMods","description","descriptionPlacement","type","theme","shape","labelSuffix","shouldFocusWrap","children","defaultSelectedKey","defaultSelectedKeys","disabledKeys","focusOnHover","showSelectAll","selectAllLabel","items","header","footer","headerStyles","footerStyles","allValueProps","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","disallowEmptySelection","shouldUseVirtualFocus","onEscape","onOptionClick","externalListStateRef","otherProps","internalSelectedKey","setInternalSelectedKey","internalSelectedKeys","setInternalSelectedKeys","isPopoverOpen","setIsPopoverOpen","triggerRef","HTMLButtonElement","valueId","labelProps","triggerLabelProps","labelElementType","undefined","pickerAriaLabel","String","trim","triggerWidthRef","isControlledSingle","isControlledMultiple","effectiveSelectedKey","effectiveSelectedKeys","internalListStateRef","current","cachedItemsOrder","latestSelectionRef","single","multiple","map","selectionWhenClosed","sortSelectedToTopExplicit","shouldSortSelectedToTop","finalItems","selectedKeySet","Set","length","forEach","k","add","itemsArray","from","selectedItems","unselectedItems","item","has","push","sorted","localCollectionState","collection","labels","textValue","keysToGet","getItem","filter","Boolean","hasSelection","handleOpenChange","UNSAFE_getDOMNode","offsetWidth","keyboardProps","onKeyDown","e","preventDefault","clearValue","focus","triggerContent","join","showClearButton","isReadOnly","validationIcon","paintedTheme","hasCustomRightIcon","triggerRightIcon","hasTriggerActions","triggerActions","pressed","triggerValueId","triggerDescribedBy","triggerElement","handleSelectionChange","selection","normalized","handleEscape","handleOptionClick","pickerField","eventProps","width","Item","Action","Object","defineProperty","enumerable","configurable"],"sources":["../../../../src/components/fields/Picker/Picker.tsx"],"sourcesContent":["import { CollectionChildren, FocusableRefValue } from '@react-types/shared';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n filterBaseProps,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FocusScope, Key, mergeProps, Placement, useLabel } from 'react-aria';\nimport { Section as BaseSection, ListState, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { isTextOnly } from '../../../utils/react/isTextOnly';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { processSelectionArray } from '../../../utils/selection';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\nimport { CubeItemButtonProps, ItemAction, ItemButton } from '../../actions';\nimport { CubeItemProps } from '../../content/Item';\nimport { Text } from '../../content/Text';\nimport {\n getValidationIcon,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport { Dialog } from '../../overlays/Dialog/Dialog';\nimport { DialogTrigger } from '../../overlays/Dialog/DialogTrigger';\nimport { CubeListBoxProps, ListBox } from '../ListBox/ListBox';\nimport { TriggerActions, TriggerIcon } from '../TriggerActions';\n\nimport type { KeyboardEvent as RAKeyboardEvent } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\nexport interface CubePickerProps<T>\n extends Omit<\n CubeListBoxProps<T>,\n 'size' | 'shape' | 'emptyLabel' | 'isFocusWithin'\n >,\n // `tooltip` is the trigger's, and on a picker the trigger's is spelled\n // `triggerTooltip`; the label's info badge is `labelTooltip`.\n Omit<CubeItemProps, 'children' | 'size' | 'tooltip'>,\n BasePropsWithoutChildren,\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n >,\n Pick<\n CubeItemButtonProps,\n | 'type'\n | 'theme'\n | 'icon'\n | 'rightIcon'\n | 'prefix'\n | 'suffix'\n | 'hotkeys'\n | 'shape'\n > {\n /** Accessible name for the picker trigger when there is no visible label. */\n 'aria-label'?: string;\n /** Ids of elements that also describe the trigger, beside the displayed value and the field's own description and message. */\n 'aria-describedby'?: string;\n /** Placeholder text when no selection is made */\n placeholder?: string;\n /** Size of the picker component */\n size?: 'small' | 'medium' | 'large';\n /** Custom styles for the list box popover */\n listBoxStyles?: Styles;\n /** Custom styles for the popover container */\n popoverStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Whether to show checkboxes for multiple selection mode */\n isCheckable?: boolean;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /**\n * The ref of the element the popover should visually attach itself to.\n * Defaults to the trigger button.\n *\n * Forwarded to `DialogTrigger`, so the anchor also becomes what outside-click\n * dismissal treats as the trigger. The popover's `minWidth` stays tied to the\n * trigger button, not to this element.\n */\n targetRef?: RefObject<HTMLElement | null>;\n /**\n * Placement of the popover relative to the anchor.\n * Accepts React Aria's `Placement` strings (e.g. `'bottom start'`,\n * `'top start'`, `'right top'`, `'left top'`).\n * @default 'bottom start'\n */\n placement?: Placement;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /** Tooltip for the trigger button (separate from `labelTooltip`) */\n triggerTooltip?: CubeItemProps['tooltip'];\n /** Description for the trigger button (separate from field description) */\n triggerDescription?: CubeItemProps['description'];\n\n /**\n * Custom renderer for the summary shown inside the trigger when there is a selection.\n *\n * For `selectionMode=\"multiple\"` the function receives:\n * - `selectedLabels`: array of labels of the selected items.\n * - `selectedKeys`: array of keys of the selected items or \"all\".\n *\n * For `selectionMode=\"single\"` the function receives:\n * - `selectedLabel`: label of the selected item.\n * - `selectedKey`: key of the selected item.\n *\n * The function should return a `ReactNode` that will be rendered inside the trigger.\n * Set to `false` to hide the summary text completely.\n */\n renderSummary?:\n | ((args: {\n selectedLabels?: string[];\n selectedKeys?: 'all' | (string | number)[];\n selectedLabel?: string;\n selectedKey?: string | number | null;\n selectionMode?: 'single' | 'multiple';\n }) => ReactNode)\n | false;\n\n /** Ref to access internal ListBox state */\n listStateRef?: MutableRefObject<ListState<T>>;\n /** Additional modifiers for styling the Picker */\n mods?: Record<string, boolean>;\n /** Whether the picker is clearable using a clear button in the rightIcon slot */\n isClearable?: boolean;\n /** Accessible name for the built-in clear button. Defaults to a localized \"Clear value\". */\n clearLabel?: string;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n /**\n * Custom actions rendered inside the trigger, to the left of the built-in\n * clear button and dropdown caret. Use `Picker.Action` so they match the\n * trigger's size and theme.\n *\n * Pressing one runs its handler without opening or closing the popover —\n * including while the popover is open. Actions follow the trigger's disabled\n * state but NOT `isReadOnly`, since a read-only field can still host an\n * action that does not change the value; pass `isDisabled` yourself for one\n * that does.\n */\n actions?: ReactNode;\n /**\n * Sort selected item(s) to the top when the popover opens.\n * Only works when using the `items` prop (data-driven mode).\n * Supports both single and multiple selection modes.\n * @default true when items are provided, false when using JSX children\n */\n sortSelectedToTop?: boolean;\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nconst PROP_STYLES = [...BASE_STYLES, ...OUTER_STYLES, ...COLOR_STYLES];\n\nconst PickerWrapper = tasty({\n qa: 'PickerWrapper',\n styles: {\n display: 'inline-grid',\n flow: 'column',\n gridRows: '1sf',\n placeContent: 'stretch',\n placeItems: 'stretch',\n },\n});\n\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: CubePickerProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: Record<string, unknown> = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: Key | null | 'all' | Key[]) => {\n if (props.selectionMode === 'multiple') {\n // Handle \"all\" selection and array selections\n if (key === 'all') {\n onChange('all');\n } else {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n }\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n let {\n id,\n qa,\n label,\n 'aria-label': ariaLabel,\n // The field's description and message describe the trigger, which is the\n // control, not the wrapper the rest of these props land on.\n 'aria-describedby': ariaDescribedBy,\n extra,\n icon,\n rightIcon,\n prefix,\n suffix,\n actions,\n hotkeys,\n triggerTooltip,\n triggerDescription,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n message,\n mods: externalMods,\n description,\n descriptionPlacement,\n placeholder,\n size = 'medium',\n styles,\n listBoxStyles,\n popoverStyles,\n type = 'outline',\n theme = 'default',\n shape,\n labelSuffix,\n shouldFocusWrap,\n children,\n shouldFlip = true,\n targetRef,\n placement = 'bottom start',\n containerPadding = 8,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n selectionMode = 'single',\n listStateRef,\n focusOnHover,\n showSelectAll,\n selectAllLabel = t('picker.all', 'All'),\n items,\n header,\n footer,\n headerStyles,\n footerStyles,\n triggerStyles,\n renderSummary,\n isCheckable,\n allValueProps,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n disallowEmptySelection,\n shouldUseVirtualFocus,\n onEscape,\n onOptionClick,\n isClearable,\n clearLabel,\n onClear,\n sortSelectedToTop,\n onOpenChange,\n listStateRef: externalListStateRef,\n ...otherProps\n } = props;\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n // Warn if isCheckable is false in single selection mode\n useWarn(isCheckable === false && selectionMode === 'single', {\n key: ['picker-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n // Internal selection state (uncontrolled scenario)\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(\n defaultSelectedKey ?? null,\n );\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n 'all' | Key[]\n >(defaultSelectedKeys ?? []);\n\n // Popover state — used as controlled prop for DialogTrigger\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const triggerRef = useRef<FocusableRefValue<HTMLButtonElement>>(null);\n const valueId = useId();\n const { labelProps, fieldProps: triggerLabelProps } = useLabel({\n id: props.id,\n label,\n labelElementType: 'span',\n 'aria-label':\n ariaLabel ?? (!label ? t('picker.pickerAriaLabel', 'Picker') : undefined),\n 'aria-labelledby': props['aria-labelledby'],\n });\n const pickerAriaLabel =\n `${ariaLabel ?? (isTextOnly(label) ? String(label ?? '') : '')} ${t('picker.pickerAriaLabel', 'Picker')}`.trim();\n\n // Measured lazily on popover open instead of on every render\n const triggerWidthRef = useRef<number | undefined>(undefined);\n\n const isControlledSingle = selectedKey !== undefined;\n const isControlledMultiple = selectedKeys !== undefined;\n\n const effectiveSelectedKey = isControlledSingle\n ? selectedKey\n : internalSelectedKey;\n const effectiveSelectedKeys = isControlledMultiple\n ? selectedKeys\n : internalSelectedKeys;\n\n // Ref to access internal ListBox state for collection API\n const internalListStateRef = useRef<ListState<T>>(null);\n\n // Sync internal ref with external ref if provided\n useEffect(() => {\n if (externalListStateRef && internalListStateRef.current) {\n externalListStateRef.current = internalListStateRef.current;\n }\n }, [externalListStateRef]);\n\n // Cache for sorted items array when using `items` prop\n const cachedItemsOrder = useRef<T[] | null>(null);\n\n const latestSelectionRef = useRef<{\n single: string | null;\n multiple: string[];\n }>({\n single: effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n });\n\n useEffect(() => {\n latestSelectionRef.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }, [effectiveSelectedKey, effectiveSelectedKeys, selectionMode]);\n\n const selectionWhenClosed = useRef<{\n single: string | null;\n multiple: string[];\n }>({ single: null, multiple: [] });\n\n const sortSelectedToTopExplicit = sortSelectedToTop !== undefined;\n const shouldSortSelectedToTop = sortSelectedToTop ?? (items ? true : false);\n\n useWarn(sortSelectedToTopExplicit && shouldSortSelectedToTop && !items, {\n key: ['picker-sort-selected-to-top-children'],\n args: [\n 'Picker: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.',\n ],\n });\n\n useEffect(() => {\n cachedItemsOrder.current = null;\n }, [items]);\n\n useEffect(() => {\n if (!isPopoverOpen) {\n selectionWhenClosed.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : [],\n };\n }\n }, [\n effectiveSelectedKey,\n effectiveSelectedKeys,\n isPopoverOpen,\n selectionMode,\n ]);\n\n const finalItems = useMemo(() => {\n if (!items || !shouldSortSelectedToTop) return items;\n if (!isPopoverOpen) return items;\n if (cachedItemsOrder.current) return cachedItemsOrder.current;\n\n const selectedKeySet = new Set<string>();\n\n if (selectionMode === 'multiple') {\n if (\n selectionWhenClosed.current.multiple.length === 0 ||\n effectiveSelectedKeys === 'all'\n ) {\n return items;\n }\n selectionWhenClosed.current.multiple.forEach((k) =>\n selectedKeySet.add(k),\n );\n } else if (selectionWhenClosed.current.single) {\n selectedKeySet.add(selectionWhenClosed.current.single);\n }\n\n if (selectedKeySet.size === 0) return items;\n\n const itemsArray = Array.isArray(items) ? items : Array.from(items);\n const selectedItems: T[] = [];\n const unselectedItems: T[] = [];\n\n itemsArray.forEach((item) => {\n const key = (item as any)?.key ?? (item as any)?.id;\n if (key != null && selectedKeySet.has(String(key))) {\n selectedItems.push(item);\n } else {\n unselectedItems.push(item);\n }\n });\n\n const sorted = [...selectedItems, ...unselectedItems];\n\n cachedItemsOrder.current = sorted;\n\n return sorted;\n }, [items, shouldSortSelectedToTop, selectionMode, isPopoverOpen]);\n\n // Create local collection state for reading item data (labels, etc.)\n // This allows us to read item labels even before the popover opens\n const localCollectionState = useListState({\n children,\n items: finalItems, // Use sorted items to match what's shown in popover\n selectionMode: 'none', // Don't manage selection in this state\n });\n\n const selectedLabels = useMemo(() => {\n const collection = localCollectionState?.collection;\n\n if (selectionMode === 'multiple' && effectiveSelectedKeys === 'all') {\n if (!collection) return [];\n const labels: string[] = [];\n for (const item of collection) {\n if (item.type === 'item') {\n labels.push(item.textValue || String(item.key));\n }\n }\n return labels;\n }\n\n const keysToGet =\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? effectiveSelectedKeys || []\n : effectiveSelectedKey != null\n ? [effectiveSelectedKey]\n : [];\n\n return keysToGet\n .map((key) => {\n const item = collection?.getItem(key);\n return item?.textValue || String(key);\n })\n .filter(Boolean);\n }, [\n selectionMode,\n effectiveSelectedKeys,\n effectiveSelectedKey,\n localCollectionState?.collection,\n ]);\n\n const hasSelection = selectedLabels.length > 0;\n\n // ---------------------------------------------------------------------------\n // Popover lifecycle — all effects moved out of the inline renderTrigger\n // function so they have a stable component identity and don't tear\n // down/setup on every parent re-render.\n // DialogTrigger is controlled via isOpen/onOpenChange.\n // ---------------------------------------------------------------------------\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (isOpen === isPopoverOpen) return;\n\n if (isOpen) {\n triggerWidthRef.current =\n triggerRef?.current?.UNSAFE_getDOMNode()?.offsetWidth;\n }\n setIsPopoverOpen(isOpen);\n if (!isOpen) {\n selectionWhenClosed.current = { ...latestSelectionRef.current };\n cachedItemsOrder.current = null;\n }\n onOpenChange?.(isOpen);\n });\n\n // Popover sync is handled by the inner `DialogTrigger` (type=\"popover\").\n\n // Keyboard handler for arrow keys to open popover\n // Deliberately NOT `useKeyboard`. `ItemButton` already runs whatever\n // `onKeyDown` it is given through `useFocusable`'s own `useKeyboard`, and a\n // second wrapper here would leave `continuePropagation()` releasing only the\n // inner one while the outer still stopped the event — `Escape` reached the\n // trigger and died there (CUB-4839). Handed over plain, this IS the outer\n // wrapper's handler, so the opt-out applies to the event that travels.\n const keyboardProps = {\n onKeyDown: (e: RAKeyboardEvent) => {\n allowOverlayKeysToPropagate(e);\n\n if ((e.key === 'ArrowUp' || e.key === 'ArrowDown') && !isPopoverOpen) {\n e.preventDefault();\n handleOpenChange(true);\n\n return;\n }\n },\n };\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (selectionMode === 'multiple') {\n if (!isControlledMultiple) {\n setInternalSelectedKeys([]);\n }\n onSelectionChange?.([]);\n } else {\n if (!isControlledSingle) {\n setInternalSelectedKey(null);\n }\n onSelectionChange?.(null);\n }\n\n handleOpenChange(false);\n triggerRef?.current?.focus?.();\n onClear?.();\n\n return false;\n });\n\n // ---------------------------------------------------------------------------\n // Trigger content\n // ---------------------------------------------------------------------------\n\n const triggerContent = useMemo((): ReactNode => {\n if (typeof renderSummary === 'function') {\n if (selectionMode === 'single') {\n return renderSummary({\n selectedLabel: selectedLabels[0],\n selectedKey: effectiveSelectedKey ?? null,\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'single',\n });\n }\n\n return renderSummary({\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'multiple',\n });\n } else if (renderSummary === false) {\n return null;\n }\n\n if (!hasSelection) {\n return <Text.Placeholder>{placeholder}</Text.Placeholder>;\n } else if (selectionMode === 'single') {\n return selectedLabels[0] || null;\n } else if (effectiveSelectedKeys === 'all') {\n return selectAllLabel;\n } else {\n return selectedLabels.join(', ') || null;\n }\n }, [\n renderSummary,\n selectionMode,\n selectedLabels,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n hasSelection,\n placeholder,\n selectAllLabel,\n ]);\n\n const showClearButton =\n isClearable && hasSelection && !isDisabled && !props.isReadOnly;\n\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n // Must be the SAME expression the trigger is painted with, not the raw\n // `theme`: this tells an action which surface it sits on, and validation\n // overrides the theme. With `theme=\"special\"` on an invalid field the trigger\n // renders `danger` — a light surface — so forwarding `special` would hand the\n // action the strong dark-purple alpha ramp and make hover/press read far too\n // heavy.\n const paintedTheme = getValidationTheme(theme, { isInvalid, isValid });\n //\n // It reaches the trailing actions through `ItemButton`'s wrapper, which is\n // what provides `ItemActionContext` for a run rendered outside the button —\n // so passing it as the trigger's `theme` is all that is needed.\n\n if (validationIcon) {\n suffix = (\n <>\n {suffix}\n {validationIcon}\n </>\n );\n }\n\n // A caller's `rightIcon` keeps the `rightIcon` slot: it accepts a render\n // function resolved against the trigger's mods, which only that slot does, and\n // it is also what a caller's `RightIcon` styles target. It replaces the\n // built-in control, exactly as before — including under `isLoading`, where the\n // spinner replaces it in turn.\n const hasCustomRightIcon = rightIcon !== undefined;\n const triggerRightIcon = hasCustomRightIcon ? (\n isLoading ? (\n <LoadingIcon />\n ) : (\n rightIcon\n )\n ) : undefined;\n\n // With a caller's own `rightIcon` the built-in control moves into that slot,\n // leaving the run with whatever the caller passed — possibly nothing. `null`\n // rather than nothing at all: the run stays in the markup, so the trigger does\n // not restructure if actions arrive later, but the row stops counting it as\n // end content. That is what keeps an icon-only trigger with `rightIcon={null}`\n // square, as it was before the run existed.\n const hasTriggerActions = !hasCustomRightIcon || !!actions;\n\n // Everything trailing that is NOT the caller's own icon goes into the actions\n // run — a sibling of the `<button>`, so the clear button is no longer nested\n // inside one. See `TriggerActions`.\n const triggerActions = (\n <TriggerActions\n actions={actions}\n builtIn={\n hasCustomRightIcon ? null : isLoading ? (\n <TriggerIcon>\n <LoadingIcon />\n </TriggerIcon>\n ) : showClearButton ? (\n <ItemAction\n icon={<CloseIcon />}\n size={size}\n qa=\"PickerClearButton\"\n // See `Select`: `ItemAction` names itself from `aria-label` or a\n // string `tooltip`, and warns for neither.\n aria-label={clearLabel ?? t('picker.clearValue', 'Clear value')}\n // No explicit `type`/`theme` — the default `current` type inherits\n // the trigger's own text color, which already carries validation\n // state here, so this renders exactly as the explicit theme did\n // while also following a custom theme.\n mods={{ pressed: false }}\n onPress={clearValue}\n />\n ) : (\n <TriggerIcon>\n <DirectionIcon to={isPopoverOpen ? 'top' : 'bottom'} />\n </TriggerIcon>\n )\n }\n />\n );\n\n // The trigger keeps the field label as its name, so queries by name stay\n // stable, and the value it shows (or the placeholder) is its description.\n const triggerValueId = triggerContent ? valueId : undefined;\n const triggerDescribedBy =\n [triggerValueId, ariaDescribedBy].filter(Boolean).join(' ') || undefined;\n\n // Trigger element — plain JSX with no hooks.\n const triggerElement = (\n <ItemButton\n ref={triggerRef as any}\n data-popover-trigger\n qa={qa || 'PickerTrigger'}\n type={type}\n theme={paintedTheme}\n size={size}\n shape={shape}\n isDisabled={isDisabled || isLoading}\n data-input-type=\"picker\"\n mods={{\n placeholder: !hasSelection,\n ...externalMods,\n }}\n icon={icon}\n rightIcon={triggerRightIcon}\n actions={hasTriggerActions ? triggerActions : null}\n prefix={prefix}\n suffix={suffix}\n hotkeys={hotkeys}\n tooltip={triggerTooltip}\n description={triggerDescription}\n descriptionPlacement={descriptionPlacement}\n styles={triggerStyles}\n {...keyboardProps}\n {...mergeProps(triggerLabelProps, { id })}\n labelProps={triggerValueId ? { id: triggerValueId } : undefined}\n // `DialogTrigger` leaves `aria-haspopup` out for dialogs; the popup the\n // trigger controls is the `Dialog` that holds the list.\n aria-haspopup=\"dialog\"\n aria-describedby={triggerDescribedBy}\n >\n {triggerContent}\n </ItemButton>\n );\n\n // ---------------------------------------------------------------------------\n // Selection change handler\n // ---------------------------------------------------------------------------\n\n const handleSelectionChange = useEvent((selection: any) => {\n if (selectionMode === 'single') {\n // With `disallowEmptySelection`, re-selecting the current item emits a\n // duplicate event (see `allowDuplicateSelectionEvents` below). Close the\n // popover but don't propagate the unchanged selection.\n if (\n disallowEmptySelection &&\n selection != null &&\n effectiveSelectedKey != null &&\n String(selection) === String(effectiveSelectedKey)\n ) {\n handleOpenChange(false);\n return;\n }\n\n if (!isControlledSingle) {\n setInternalSelectedKey(selection as Key | null);\n }\n } else {\n if (!isControlledMultiple) {\n let normalized: 'all' | Key[] = selection;\n\n if (selection === 'all') {\n normalized = 'all';\n } else if (Array.isArray(selection)) {\n normalized = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n normalized = processSelectionArray(selection as Set<Key>);\n }\n\n setInternalSelectedKeys(normalized);\n }\n }\n\n if (selectionMode === 'single') {\n latestSelectionRef.current.single =\n selection != null ? String(selection) : null;\n } else {\n if (selection === 'all') {\n latestSelectionRef.current.multiple = [];\n } else if (Array.isArray(selection)) {\n latestSelectionRef.current.multiple = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n latestSelectionRef.current.multiple = processSelectionArray(\n selection as Set<Key>,\n );\n } else {\n latestSelectionRef.current.multiple = [];\n }\n }\n\n onSelectionChange?.(selection);\n\n if (selectionMode === 'single') {\n handleOpenChange(false);\n }\n });\n\n const handleEscape = useEvent(() => {\n handleOpenChange(false);\n });\n\n const handleOptionClick = useEvent((key: Key) => {\n if ((selectionMode === 'multiple' && isCheckable) || key === '__ALL__') {\n handleOpenChange(false);\n }\n });\n\n const pickerField = (\n <PickerWrapper\n styles={styles}\n {...(filterBaseProps(otherProps, { eventProps: true }) as Record<\n string,\n unknown\n >)}\n >\n <DialogTrigger\n type=\"popover\"\n placement={placement}\n targetRef={targetRef}\n isOpen={isPopoverOpen}\n containerPadding={containerPadding}\n shouldFlip={shouldFlip}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {() => (\n <Dialog\n qa=\"PickerOverlay\"\n aria-label={pickerAriaLabel}\n display=\"grid\"\n styles={mergeStyleLayers(\n {\n gridRows: '1sf',\n width: 'max($overlay-min-width, 30x) max-content 50vw',\n '$overlay-min-width': '30x',\n },\n popoverStyles,\n )}\n style={\n triggerWidthRef.current\n ? ({\n '--overlay-min-width': `${triggerWidthRef.current}px`,\n } as any)\n : undefined\n }\n >\n <FocusScope restoreFocus>\n <ListBox\n isBare\n autoFocus\n items={items ? (finalItems as typeof props.items) : undefined}\n aria-label={pickerAriaLabel}\n selectedKey={\n selectionMode === 'single' ? effectiveSelectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple'\n ? effectiveSelectedKeys\n : undefined\n }\n listStyles={listStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n listRef={listRef}\n disallowEmptySelection={disallowEmptySelection}\n allowDuplicateSelectionEvents={\n selectionMode === 'single' && !!disallowEmptySelection\n }\n disabledKeys={disabledKeys}\n focusOnHover={focusOnHover}\n shouldFocusWrap={shouldFocusWrap}\n selectionMode={selectionMode}\n isInvalid={isInvalid}\n isValid={isValid}\n isDisabled={isDisabled}\n isLoading={isLoading}\n stateRef={internalListStateRef}\n isCheckable={isCheckable}\n shape=\"popover\"\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n header={header}\n footer={footer}\n headerStyles={headerStyles}\n footerStyles={footerStyles}\n qa={`${props.qa || 'Picker'}ListBox`}\n allValueProps={allValueProps}\n onEscape={handleEscape}\n onOptionClick={handleOptionClick}\n onSelectionChange={handleSelectionChange}\n >\n {children as CollectionChildren<T>}\n </ListBox>\n </FocusScope>\n </Dialog>\n )}\n </DialogTrigger>\n </PickerWrapper>\n );\n\n return wrapWithField<Omit<CubePickerProps<T>, 'children'>>(\n pickerField,\n ref as any,\n { ...props, labelProps: mergeProps(labelProps, props.labelProps) },\n );\n}) as unknown as (<T>(\n props: CubePickerProps<T> & { ref?: ForwardedRef<HTMLElement> },\n) => ReactElement) & {\n Item: typeof ListBox.Item;\n Section: typeof BaseSection;\n Action: typeof ItemAction;\n};\n\nPicker.Item = ListBox.Item;\n\nPicker.Section = BaseSection;\n\nPicker.Action = ItemAction;\n\nObject.defineProperty(Picker, 'cubeInputType', {\n value: 'Picker',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,MAAM+F,cAAc;CAAC,GAAG7F;CAAa,GAAGM;CAAc,GAAGH;CAAa;AAEtE,MAAM2F,gBAAgBrF,MAAM;CAC1BsF,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC,YAAY;EACd;CACD,CAAC;AAEF,MAAaC,SAAS3F,WAAW,SAAS2F,OACxCC,OACAC,KACA;CACA,MAAM,EAAEC,MAAMzE,SAAS;AAEvBuE,SAAQvD,cAAcuD,OAAO,EAC3BG,mBAAmB,EAAEC,OAAOC,eAAe;EACzC,MAAMC,aAAsC,EAAE;AAE9C,MAAIN,MAAMrB,kBAAkB,WAC1B2B,YAAW9B,eAAe4B,SAAS,EAAE;MAErCE,YAAW5B,cAAc0B,SAAS;AAGpCE,aAAWC,qBAAqBC,QAAoC;AAClE,OAAIR,MAAMrB,kBAAkB,WAE1B,KAAI6B,QAAQ,MACVH,UAAS,MAAM;OAEfA,UAASG,MAAOC,MAAMC,QAAQF,IAAI,GAAGA,MAAM,CAACA,IAAI,GAAI,EAAE,CAAC;OAGzDH,UAASI,MAAMC,QAAQF,IAAI,GA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