@cube-dev/ui-kit 0.216.2 → 0.217.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 (644) hide show
  1. package/dist/CHANGELOG.md +28 -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.js +1 -1
  16. package/dist/components/actions/Action/Action.js +1 -1
  17. package/dist/components/actions/Banner/Banner.js +2 -1
  18. package/dist/components/actions/Banner/Banner.js.map +1 -1
  19. package/dist/components/actions/Button/AutoCollapseObserver.js +1 -1
  20. package/dist/components/actions/Button/Button.js +1 -1
  21. package/dist/components/actions/Button/index.js +1 -1
  22. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  23. package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
  24. package/dist/components/actions/ButtonSplit/context.js +1 -1
  25. package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
  26. package/dist/components/actions/CommandMenu/styled.js +1 -1
  27. package/dist/components/actions/ItemAction/ItemAction.js +1 -1
  28. package/dist/components/actions/ItemActionContext.js +1 -1
  29. package/dist/components/actions/ItemActionsWrapper.js +1 -1
  30. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  31. package/dist/components/actions/Link/Link.js +1 -1
  32. package/dist/components/actions/Menu/Menu.js +1 -1
  33. package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
  34. package/dist/components/actions/Menu/MenuItem.js +1 -1
  35. package/dist/components/actions/Menu/MenuSection.js +1 -1
  36. package/dist/components/actions/Menu/MenuTrigger.js +1 -1
  37. package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
  38. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  39. package/dist/components/actions/Menu/context.js +1 -1
  40. package/dist/components/actions/Menu/styled.js +1 -1
  41. package/dist/components/actions/actions-run.js +1 -1
  42. package/dist/components/actions/use-action.js +1 -1
  43. package/dist/components/actions/use-anchored-menu.js +1 -1
  44. package/dist/components/actions/use-context-menu.js +1 -1
  45. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  46. package/dist/components/content/Alert/Alert.js +14 -5
  47. package/dist/components/content/Alert/Alert.js.map +1 -1
  48. package/dist/components/content/Alert/types.d.ts +9 -2
  49. package/dist/components/content/Alert/use-alert.js +37 -33
  50. package/dist/components/content/Alert/use-alert.js.map +1 -1
  51. package/dist/components/content/Avatar/Avatar.js +1 -1
  52. package/dist/components/content/Badge/Badge.js +1 -1
  53. package/dist/components/content/Card/Card.js +1 -1
  54. package/dist/components/content/Content.js +1 -1
  55. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  56. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  57. package/dist/components/content/Disclosure/Disclosure.js +1 -1
  58. package/dist/components/content/Divider/Divider.js +1 -1
  59. package/dist/components/content/Footer.js +1 -1
  60. package/dist/components/content/Header.js +1 -1
  61. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  62. package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
  63. package/dist/components/content/InlineInput/InlineInput.js +1 -1
  64. package/dist/components/content/Item/Item.js +1 -1
  65. package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
  66. package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
  67. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  68. package/dist/components/content/Layout/GridLayout.js +1 -1
  69. package/dist/components/content/Layout/Layout.js +1 -1
  70. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  71. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  72. package/dist/components/content/Layout/LayoutContainer.js +1 -1
  73. package/dist/components/content/Layout/LayoutContent.js +1 -1
  74. package/dist/components/content/Layout/LayoutContext.js +1 -1
  75. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  76. package/dist/components/content/Layout/LayoutFooter.js +1 -1
  77. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  78. package/dist/components/content/Layout/LayoutHeader.js +1 -1
  79. package/dist/components/content/Layout/LayoutPane.js +1 -1
  80. package/dist/components/content/Layout/LayoutPanel.js +1 -1
  81. package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
  82. package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
  83. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  84. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  85. package/dist/components/content/Layout/index.js +1 -1
  86. package/dist/components/content/Layout/utils.js +1 -1
  87. package/dist/components/content/Paragraph.js +1 -1
  88. package/dist/components/content/Placeholder/Placeholder.js +1 -1
  89. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  90. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  91. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  92. package/dist/components/content/Result/Result.d.ts +3 -1
  93. package/dist/components/content/Result/Result.js +9 -7
  94. package/dist/components/content/Result/Result.js.map +1 -1
  95. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  96. package/dist/components/content/Tag/Tag.js +1 -1
  97. package/dist/components/content/Text.js +1 -1
  98. package/dist/components/content/TextItem/TextItem.js +1 -1
  99. package/dist/components/content/Title.js +1 -1
  100. package/dist/components/content/Tree/Tree.js +1 -1
  101. package/dist/components/content/Tree/TreeNode.js +1 -1
  102. package/dist/components/content/Tree/checked-keys.js +1 -1
  103. package/dist/components/content/Tree/rowId.js +1 -1
  104. package/dist/components/content/Tree/styled.js +1 -1
  105. package/dist/components/content/Tree/tree-index.js +1 -1
  106. package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
  107. package/dist/components/content/Tree/use-load-data.js +1 -1
  108. package/dist/components/content/highlightText.js +1 -1
  109. package/dist/components/content/use-auto-tooltip.js +1 -1
  110. package/dist/components/data/DataTable/DataTable.js +1 -1
  111. package/dist/components/data/ItemTable/ItemTable.js +1 -1
  112. package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
  113. package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
  114. package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
  115. package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
  116. package/dist/components/data/ItemTable/item-table-sections.js +1 -1
  117. package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
  118. package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
  119. package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
  120. package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
  121. package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
  122. package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
  123. package/dist/components/data/TableBase/ColumnResizer.js +1 -1
  124. package/dist/components/data/TableBase/RowCollection.js +1 -1
  125. package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
  126. package/dist/components/data/TableBase/TableRow.js +1 -1
  127. package/dist/components/data/TableBase/TableRowLink.js +1 -1
  128. package/dist/components/data/TableBase/TableView.js +1 -1
  129. package/dist/components/data/TableBase/TreeGridTable.js +1 -1
  130. package/dist/components/data/TableBase/column-header.js +1 -1
  131. package/dist/components/data/TableBase/column-menu.js +1 -1
  132. package/dist/components/data/TableBase/column-styles.js +1 -1
  133. package/dist/components/data/TableBase/column-tint.js +1 -1
  134. package/dist/components/data/TableBase/row-menu.js +1 -1
  135. package/dist/components/data/TableBase/styled.js +1 -1
  136. package/dist/components/data/TableBase/table-body-sections.js +1 -1
  137. package/dist/components/data/TableBase/table-tree.js +1 -1
  138. package/dist/components/data/TableBase/types.js +1 -1
  139. package/dist/components/data/TableBase/use-cell-selection.js +0 -0
  140. package/dist/components/data/TableBase/use-column-menu.js +1 -1
  141. package/dist/components/data/TableBase/use-column-order.js +1 -1
  142. package/dist/components/data/TableBase/use-column-window.js +1 -1
  143. package/dist/components/data/TableBase/use-container-width.js +1 -1
  144. package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
  145. package/dist/components/data/TableBase/use-scrollability.js +1 -1
  146. package/dist/components/data/TableBase/use-table-columns.js +1 -1
  147. package/dist/components/data/TableBase/use-table-search.js +1 -1
  148. package/dist/components/data/TableBase/use-table-selection.js +1 -1
  149. package/dist/components/data/TableBase/use-table-sort.js +1 -1
  150. package/dist/components/data/TableBase/use-table-sorts.js +1 -1
  151. package/dist/components/data/TableBase/use-table-storage.js +1 -1
  152. package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
  153. package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
  154. package/dist/components/fields/Checkbox/Checkbox.js +1 -1
  155. package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
  156. package/dist/components/fields/Checkbox/context.js +1 -1
  157. package/dist/components/fields/ColorInput/ColorInput.js +1 -1
  158. package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
  159. package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
  160. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
  161. package/dist/components/fields/ComboBox/ComboBox.js +1 -1
  162. package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
  163. package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
  164. package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
  165. package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
  166. package/dist/components/fields/DatePicker/CalendarPopover.js +1 -1
  167. package/dist/components/fields/DatePicker/DateInput.js +1 -1
  168. package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
  169. package/dist/components/fields/DatePicker/DatePicker.js +1 -1
  170. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  171. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  172. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  173. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  174. package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
  175. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
  176. package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
  177. package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
  178. package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
  179. package/dist/components/fields/DatePicker/TimeInput.js +1 -1
  180. package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
  181. package/dist/components/fields/DatePicker/YearPicker.js +1 -1
  182. package/dist/components/fields/DatePicker/parseDate.js +1 -1
  183. package/dist/components/fields/DatePicker/period.js +1 -1
  184. package/dist/components/fields/DatePicker/props.js +1 -1
  185. package/dist/components/fields/DatePicker/utils.js +1 -1
  186. package/dist/components/fields/FileInput/FileInput.js +1 -1
  187. package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
  188. package/dist/components/fields/FilterListBox/styled.js +1 -1
  189. package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
  190. package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
  191. package/dist/components/fields/Input/Input.js +1 -1
  192. package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
  193. package/dist/components/fields/ListBox/ListBox.js +1 -1
  194. package/dist/components/fields/ListBox/empty-row.js +1 -1
  195. package/dist/components/fields/ListBox/optionId.js +1 -1
  196. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
  197. package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
  198. package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
  199. package/dist/components/fields/NumberInput/NumberInput.d.ts +8 -0
  200. package/dist/components/fields/NumberInput/NumberInput.js +204 -131
  201. package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
  202. package/dist/components/fields/NumberInput/StepButton.js +1 -1
  203. package/dist/components/fields/PasswordInput/PasswordInput.d.ts +2 -2
  204. package/dist/components/fields/PasswordInput/PasswordInput.js +14 -12
  205. package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
  206. package/dist/components/fields/Picker/Picker.js +1 -1
  207. package/dist/components/fields/RadioGroup/Radio.js +1 -1
  208. package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
  209. package/dist/components/fields/RadioGroup/context.js +1 -1
  210. package/dist/components/fields/RadioGroup/joined-styles.js +1 -1
  211. package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
  212. package/dist/components/fields/SearchInput/SearchInput.js +1 -1
  213. package/dist/components/fields/Select/Select.js +1 -1
  214. package/dist/components/fields/Slider/Gradation.js +1 -1
  215. package/dist/components/fields/Slider/HueSlider.js +1 -1
  216. package/dist/components/fields/Slider/RangeSlider.js +1 -1
  217. package/dist/components/fields/Slider/Slider.js +1 -1
  218. package/dist/components/fields/Slider/SliderBase.js +1 -1
  219. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  220. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  221. package/dist/components/fields/Slider/elements.js +1 -1
  222. package/dist/components/fields/Slider/index.js +1 -1
  223. package/dist/components/fields/Switch/Switch.js +1 -1
  224. package/dist/components/fields/TagInput/TagInput.d.ts +2 -1
  225. package/dist/components/fields/TagInput/TagInput.js +7 -2
  226. package/dist/components/fields/TagInput/TagInput.js.map +1 -1
  227. package/dist/components/fields/TagInput/TagList.js +1 -1
  228. package/dist/components/fields/TagInput/useActiveOption.js +1 -1
  229. package/dist/components/fields/TagInput/useSuffixSpace.js +1 -1
  230. package/dist/components/fields/TagInput/useTagError.js +1 -1
  231. package/dist/components/fields/TextArea/TextArea.d.ts +2 -2
  232. package/dist/components/fields/TextArea/TextArea.js +27 -23
  233. package/dist/components/fields/TextArea/TextArea.js.map +1 -1
  234. package/dist/components/fields/TextInput/TextInput.d.ts +3 -3
  235. package/dist/components/fields/TextInput/TextInput.js +23 -19
  236. package/dist/components/fields/TextInput/TextInput.js.map +1 -1
  237. package/dist/components/fields/TextInput/TextInputBase.d.ts +31 -0
  238. package/dist/components/fields/TextInput/TextInputBase.js +1 -1
  239. package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
  240. package/dist/components/fields/TextInput/displayed-validation.js +1 -1
  241. package/dist/components/fields/TextInput/identifier-text-services.js +20 -0
  242. package/dist/components/fields/TextInput/identifier-text-services.js.map +1 -0
  243. package/dist/components/fields/TextInput/index.d.ts +2 -2
  244. package/dist/components/fields/TextInput/password-manager-ignore.js +21 -0
  245. package/dist/components/fields/TextInput/password-manager-ignore.js.map +1 -0
  246. package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
  247. package/dist/components/fields/TextInputMapper/TextInputMapper.d.ts +7 -0
  248. package/dist/components/fields/TextInputMapper/TextInputMapper.js +14 -12
  249. package/dist/components/fields/TextInputMapper/TextInputMapper.js.map +1 -1
  250. package/dist/components/fields/ToggleGroup/ToggleGroup.js +1 -1
  251. package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +1 -1
  252. package/dist/components/fields/ToggleGroup/context.js +1 -1
  253. package/dist/components/fields/TriggerActions.js +1 -1
  254. package/dist/components/fields/color/ColorPanel.js +1 -1
  255. package/dist/components/fields/color/channels.js +1 -1
  256. package/dist/components/fields/color/color.js +1 -1
  257. package/dist/components/fields/color/context.js +1 -1
  258. package/dist/components/fields/index.d.ts +2 -2
  259. package/dist/components/fields/option-origin-press.js +1 -1
  260. package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
  261. package/dist/components/form/FieldWrapper/field-description.js +1 -1
  262. package/dist/components/form/Form/Field.js +1 -1
  263. package/dist/components/form/Form/Form.js +1 -1
  264. package/dist/components/form/Form/FormContext.js +1 -1
  265. package/dist/components/form/Form/FormElement.js +1 -1
  266. package/dist/components/form/Form/ModernFormRoot.js +1 -1
  267. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  268. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  269. package/dist/components/form/Form/SubmitError.js +1 -1
  270. package/dist/components/form/Form/backend.js +1 -1
  271. package/dist/components/form/Form/index.js +1 -1
  272. package/dist/components/form/Form/modern/actions.js +1 -1
  273. package/dist/components/form/Form/modern/context.js +1 -1
  274. package/dist/components/form/Form/modern/controller.js +1 -1
  275. package/dist/components/form/Form/modern/field-binding.js +1 -1
  276. package/dist/components/form/Form/modern/field.js +1 -1
  277. package/dist/components/form/Form/modern/react.js +1 -1
  278. package/dist/components/form/Form/modern/store.js +1 -1
  279. package/dist/components/form/Form/modern/validation.js +1 -1
  280. package/dist/components/form/Form/modern/values.js +1 -1
  281. package/dist/components/form/Form/reset-unbound-controls.js +1 -1
  282. package/dist/components/form/Form/use-field/use-field-binding.js +3 -2
  283. package/dist/components/form/Form/use-field/use-field-binding.js.map +1 -1
  284. package/dist/components/form/Form/use-field/use-field-props.d.ts +8 -1
  285. package/dist/components/form/Form/use-field/use-field-props.js +67 -57
  286. package/dist/components/form/Form/use-field/use-field-props.js.map +1 -1
  287. package/dist/components/form/Form/use-field/use-field.js +1 -1
  288. package/dist/components/form/Form/use-form.js +1 -1
  289. package/dist/components/form/Form/validation.js +1 -1
  290. package/dist/components/form/Label.js +1 -1
  291. package/dist/components/form/field-chrome.js +1 -1
  292. package/dist/components/form/field-layout.js +1 -1
  293. package/dist/components/form/legacy-tooltip.js +1 -1
  294. package/dist/components/form/validation/ValidationIndicator.js +1 -1
  295. package/dist/components/form/validation/resolve-validation-props.js +1 -1
  296. package/dist/components/form/validation/use-validation-props.js +1 -1
  297. package/dist/components/form/wrapper.js +1 -1
  298. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  299. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  300. package/dist/components/layout/Flex.js +1 -1
  301. package/dist/components/layout/Flow.js +1 -1
  302. package/dist/components/layout/Grid.js +1 -1
  303. package/dist/components/layout/Panel.js +1 -1
  304. package/dist/components/layout/Prefix.js +1 -1
  305. package/dist/components/layout/ResizablePanel.js +1 -1
  306. package/dist/components/layout/Space.js +1 -1
  307. package/dist/components/layout/Suffix.js +1 -1
  308. package/dist/components/navigation/NavTabs/NavTabs.js +1 -1
  309. package/dist/components/navigation/Pagination/Pagination.js +1 -1
  310. package/dist/components/navigation/Pagination/use-pagination.js +1 -1
  311. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
  312. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  313. package/dist/components/navigation/Tabs/TabButton.js +1 -3
  314. package/dist/components/navigation/Tabs/TabButton.js.map +1 -1
  315. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  316. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  317. package/dist/components/navigation/Tabs/TabPicker.js +1 -1
  318. package/dist/components/navigation/Tabs/Tabs.js +1 -1
  319. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  320. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  321. package/dist/components/navigation/Tabs/popover-placement.js +1 -1
  322. package/dist/components/navigation/Tabs/scroll-tab-into-strip.js +1 -1
  323. package/dist/components/navigation/Tabs/segmented-styles.js +1 -1
  324. package/dist/components/navigation/Tabs/styled.js +1 -1
  325. package/dist/components/navigation/Tabs/types.js +1 -1
  326. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  327. package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
  328. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  329. package/dist/components/other/Calendar/Calendar.js +1 -1
  330. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  331. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  332. package/dist/components/other/Calendar/CalendarHeader.js +1 -1
  333. package/dist/components/other/Calendar/CalendarPanel.js +1 -1
  334. package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
  335. package/dist/components/other/Calendar/PeriodGrid.js +1 -1
  336. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  337. package/dist/components/other/Calendar/styled.js +1 -1
  338. package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
  339. package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
  340. package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
  341. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
  342. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  343. package/dist/components/overlays/Dialog/Dialog.js +1 -1
  344. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  345. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  346. package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
  347. package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
  348. package/dist/components/overlays/Dialog/context.js +1 -1
  349. package/dist/components/overlays/Dialog/default-button-text.js +1 -1
  350. package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
  351. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  352. package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
  353. package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
  354. package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
  355. package/dist/components/overlays/Modal/Modal.js +1 -1
  356. package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
  357. package/dist/components/overlays/Modal/Overlay.js +1 -1
  358. package/dist/components/overlays/Modal/Popover.js +1 -1
  359. package/dist/components/overlays/Modal/Tray.js +1 -1
  360. package/dist/components/overlays/Modal/Underlay.js +1 -1
  361. package/dist/components/overlays/Modal/modal-containment.js +1 -1
  362. package/dist/components/overlays/Notifications/Notification.js +1 -1
  363. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  364. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  365. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  366. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  367. package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
  368. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  369. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  370. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  371. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  372. package/dist/components/overlays/Notifications/index.js +1 -1
  373. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  374. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  375. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  376. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  377. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  378. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  379. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  380. package/dist/components/overlays/Toast/index.js +1 -1
  381. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  382. package/dist/components/overlays/Toast/useToast.js +1 -1
  383. package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
  384. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  385. package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
  386. package/dist/components/overlays/Tooltip/context.js +1 -1
  387. package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
  388. package/dist/components/portal/Portal.js +1 -1
  389. package/dist/components/portal/PortalProvider.js +1 -1
  390. package/dist/components/portal/usePortal.js +1 -1
  391. package/dist/components/shared/DraggableCollection.js +1 -1
  392. package/dist/components/shared/InvalidIcon.js +1 -1
  393. package/dist/components/shared/ValidIcon.js +1 -1
  394. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  395. package/dist/components/status/Spin/Cube.js +1 -1
  396. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  397. package/dist/components/status/Spin/Spin.js +1 -1
  398. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  399. package/dist/data/item-themes.js +1 -1
  400. package/dist/data/themes.js +1 -1
  401. package/dist/eslint-plugin/defaults.generated.js +33 -5
  402. package/dist/eslint-plugin/defaults.generated.js.map +1 -1
  403. package/dist/eslint-plugin/index.js +1 -1
  404. package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
  405. package/dist/i18n/I18nProvider.js +1 -1
  406. package/dist/i18n/createFormatter.js +1 -1
  407. package/dist/i18n/index.js +1 -1
  408. package/dist/i18n/instance.js +1 -1
  409. package/dist/i18n/locales/de-DE/uikit.js +3 -2
  410. package/dist/i18n/locales/en-US/uikit.js +3 -2
  411. package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -0
  412. package/dist/i18n/locales/es-ES/uikit.js +3 -2
  413. package/dist/i18n/locales/es-MX/uikit.js +3 -2
  414. package/dist/i18n/locales/fr-FR/uikit.js +3 -2
  415. package/dist/i18n/locales/it-IT/uikit.js +3 -2
  416. package/dist/i18n/locales/ja-JP/uikit.js +3 -2
  417. package/dist/i18n/locales/nb-NO/uikit.js +3 -2
  418. package/dist/i18n/locales/pt-BR/uikit.js +3 -2
  419. package/dist/i18n/locales/pt-PT/uikit.js +3 -2
  420. package/dist/i18n/locales/sv-SE/uikit.js +3 -2
  421. package/dist/i18n/locales/vi-VN/uikit.js +3 -2
  422. package/dist/i18n/locales.js +1 -1
  423. package/dist/i18n/namespace.js +1 -1
  424. package/dist/i18n/useFormatter.js +1 -1
  425. package/dist/i18n/useI18n.js +1 -1
  426. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  427. package/dist/icons/AdjustmentsIcon.js +1 -1
  428. package/dist/icons/AiIcon.js +1 -1
  429. package/dist/icons/AreaChartIcon.js +1 -1
  430. package/dist/icons/ArrowNarrowDownIcon.js +1 -1
  431. package/dist/icons/ArrowNarrowUpIcon.js +1 -1
  432. package/dist/icons/BackwardIcon.js +1 -1
  433. package/dist/icons/BarChartIcon.js +1 -1
  434. package/dist/icons/BellFilledIcon.js +1 -1
  435. package/dist/icons/BellIcon.js +1 -1
  436. package/dist/icons/BooleanIcon.js +1 -1
  437. package/dist/icons/CalendarEditIcon.js +1 -1
  438. package/dist/icons/CalendarIcon.js +1 -1
  439. package/dist/icons/CaretDownIcon.js +1 -1
  440. package/dist/icons/CaretUpIcon.js +1 -1
  441. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  442. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  443. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  444. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  445. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  446. package/dist/icons/ChartBarLineIcon.js +1 -1
  447. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  448. package/dist/icons/ChartBarStackedIcon.js +1 -1
  449. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  450. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  451. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  452. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  453. package/dist/icons/ChartBubbleIcon.js +1 -1
  454. package/dist/icons/ChartDonut2Icon.js +1 -1
  455. package/dist/icons/ChartFunnelIcon.js +1 -1
  456. package/dist/icons/ChartHeatmapIcon.js +1 -1
  457. package/dist/icons/ChartKPIIcon.js +1 -1
  458. package/dist/icons/ChartPie2Icon.js +1 -1
  459. package/dist/icons/ChartScatterIcon.js +1 -1
  460. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  461. package/dist/icons/CheckCircleIcon.js +1 -1
  462. package/dist/icons/CheckIcon.js +1 -1
  463. package/dist/icons/CircleFilledIcon.js +1 -1
  464. package/dist/icons/ClearIcon.js +1 -1
  465. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  466. package/dist/icons/CloseCircleIcon.js +1 -1
  467. package/dist/icons/CloseIcon.js +1 -1
  468. package/dist/icons/CodeIcon.js +1 -1
  469. package/dist/icons/ColumnTotalIcon.js +1 -1
  470. package/dist/icons/CopyIcon.js +1 -1
  471. package/dist/icons/CountIcon.js +1 -1
  472. package/dist/icons/CubeIcon.js +1 -1
  473. package/dist/icons/CubePauseIcon.js +1 -1
  474. package/dist/icons/CubePlayIcon.js +1 -1
  475. package/dist/icons/CurrencyDollarIcon.js +1 -1
  476. package/dist/icons/DangerIcon.js +1 -1
  477. package/dist/icons/DashboardIcon.js +1 -1
  478. package/dist/icons/DatabaseIcon.js +1 -1
  479. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  480. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  481. package/dist/icons/DirectionIcon.js +1 -1
  482. package/dist/icons/DonutIcon.js +1 -1
  483. package/dist/icons/DownIcon.js +1 -1
  484. package/dist/icons/EditIcon.js +1 -1
  485. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  486. package/dist/icons/ExclamationCircleIcon.js +1 -1
  487. package/dist/icons/ExclamationIcon.js +1 -1
  488. package/dist/icons/EyeIcon.js +1 -1
  489. package/dist/icons/EyeInvisibleIcon.js +1 -1
  490. package/dist/icons/FilterIcon.js +1 -1
  491. package/dist/icons/FolderFilledIcon.js +1 -1
  492. package/dist/icons/FolderIcon.js +1 -1
  493. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  494. package/dist/icons/FolderOpenIcon.js +1 -1
  495. package/dist/icons/ForwardIcon.js +1 -1
  496. package/dist/icons/GripVerticalIcon.js +1 -1
  497. package/dist/icons/HierarchyIcon.js +1 -1
  498. package/dist/icons/HierarchyOpenIcon.js +1 -1
  499. package/dist/icons/Icon.js +1 -1
  500. package/dist/icons/InfoCircleIcon.js +1 -1
  501. package/dist/icons/InfoIcon.js +1 -1
  502. package/dist/icons/KeyIcon.js +1 -1
  503. package/dist/icons/LeftIcon.js +1 -1
  504. package/dist/icons/LineChartIcon.js +1 -1
  505. package/dist/icons/LoadingIcon.js +1 -1
  506. package/dist/icons/LockFilledIcon.js +1 -1
  507. package/dist/icons/LockIcon.js +1 -1
  508. package/dist/icons/MoreIcon.js +1 -1
  509. package/dist/icons/NotAllowedIcon.js +1 -1
  510. package/dist/icons/Number123Icon.js +1 -1
  511. package/dist/icons/NumberIcon.js +1 -1
  512. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  513. package/dist/icons/PauseCircleIcon.js +1 -1
  514. package/dist/icons/PauseIcon.js +1 -1
  515. package/dist/icons/PercentageIcon.js +1 -1
  516. package/dist/icons/PieChartIcon.js +1 -1
  517. package/dist/icons/PipetteIcon.js +1 -1
  518. package/dist/icons/PlayCircleIcon.js +1 -1
  519. package/dist/icons/PlayIcon.js +1 -1
  520. package/dist/icons/PlusIcon.js +1 -1
  521. package/dist/icons/ProgressBarIcon.js +1 -1
  522. package/dist/icons/ReloadIcon.js +1 -1
  523. package/dist/icons/ReportIcon.js +1 -1
  524. package/dist/icons/ReturnIcon.js +1 -1
  525. package/dist/icons/RightIcon.js +1 -1
  526. package/dist/icons/RowTotalsIcon.js +1 -1
  527. package/dist/icons/SchemeIcon.js +1 -1
  528. package/dist/icons/SearchIcon.js +1 -1
  529. package/dist/icons/SemanticQueryIcon.js +1 -1
  530. package/dist/icons/SettingsIcon.js +1 -1
  531. package/dist/icons/ShieldFilledIcon.js +1 -1
  532. package/dist/icons/ShieldIcon.js +1 -1
  533. package/dist/icons/SlashIcon.js +1 -1
  534. package/dist/icons/SparklesIcon.js +1 -1
  535. package/dist/icons/SqlIcon.js +1 -1
  536. package/dist/icons/StatsIcon.js +1 -1
  537. package/dist/icons/StopIcon.js +1 -1
  538. package/dist/icons/StringIcon.js +1 -1
  539. package/dist/icons/SubtotalsIcon.js +1 -1
  540. package/dist/icons/SwitchIcon.js +1 -1
  541. package/dist/icons/TableIcon.js +1 -1
  542. package/dist/icons/ThumbsDownIcon.js +1 -1
  543. package/dist/icons/ThumbsUpIcon.js +1 -1
  544. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  545. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  546. package/dist/icons/ThunderboltIcon.js +1 -1
  547. package/dist/icons/TimeIcon.js +1 -1
  548. package/dist/icons/TrashIcon.js +1 -1
  549. package/dist/icons/UnlockIcon.js +1 -1
  550. package/dist/icons/UpIcon.js +1 -1
  551. package/dist/icons/UserGroupIcon.js +1 -1
  552. package/dist/icons/UserIcon.js +1 -1
  553. package/dist/icons/UserLockIcon.js +1 -1
  554. package/dist/icons/ViewIcon.js +1 -1
  555. package/dist/icons/WarningFilledIcon.js +1 -1
  556. package/dist/icons/WarningIcon.js +1 -1
  557. package/dist/icons/wrap-icon.js +1 -1
  558. package/dist/index.d.ts +2 -2
  559. package/dist/index.js +1 -1
  560. package/dist/probe/canonicalize.js +1 -1
  561. package/dist/probe/css.js +1 -1
  562. package/dist/probe/index.js +1 -1
  563. package/dist/provider.js +1 -1
  564. package/dist/providers/TrackingProvider.js +1 -1
  565. package/dist/providers/navigation-url.js +1 -1
  566. package/dist/providers/navigationAdapter.default.js +1 -1
  567. package/dist/providers/use-navigation.js +1 -1
  568. package/dist/tokens/all-tokens.js +1 -1
  569. package/dist/tokens/base.js +1 -1
  570. package/dist/tokens/color-seed.js +1 -1
  571. package/dist/tokens/color-theme.js +1 -1
  572. package/dist/tokens/colors.js +1 -1
  573. package/dist/tokens/layout.js +1 -1
  574. package/dist/tokens/lazy-styles.js +1 -1
  575. package/dist/tokens/legacy-color.js +1 -1
  576. package/dist/tokens/palette-config.js +1 -1
  577. package/dist/tokens/palette.js +1 -1
  578. package/dist/tokens/resolve.js +1 -1
  579. package/dist/tokens/shadows.js +1 -1
  580. package/dist/tokens/sizes.js +1 -1
  581. package/dist/tokens/spacing.js +1 -1
  582. package/dist/tokens/typography.js +1 -1
  583. package/dist/utils/ResizeSensor.js +1 -1
  584. package/dist/utils/colors.js +1 -1
  585. package/dist/utils/dotize.js +1 -1
  586. package/dist/utils/is-dev-env.js +1 -1
  587. package/dist/utils/layout-scale.js +1 -1
  588. package/dist/utils/modules.js +1 -1
  589. package/dist/utils/promise.js +1 -1
  590. package/dist/utils/raf.js +1 -1
  591. package/dist/utils/random.js +1 -1
  592. package/dist/utils/range.js +1 -1
  593. package/dist/utils/react/RenderCache.js +1 -1
  594. package/dist/utils/react/Slots.js +1 -1
  595. package/dist/utils/react/chain.js +1 -1
  596. package/dist/utils/react/componentBaseProps.js +1 -1
  597. package/dist/utils/react/disabledProps.js +1 -1
  598. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  599. package/dist/utils/react/index.js +1 -1
  600. package/dist/utils/react/interactions.js +1 -1
  601. package/dist/utils/react/isTextOnly.js +1 -1
  602. package/dist/utils/react/mapProps.js +1 -1
  603. package/dist/utils/react/mergeProps.js +1 -1
  604. package/dist/utils/react/nullableValue.js +1 -1
  605. package/dist/utils/react/overlayKeyPropagation.js +1 -1
  606. package/dist/utils/react/pickBaseCustomizationProps.js +1 -1
  607. package/dist/utils/react/programmaticFocus.js +1 -1
  608. package/dist/utils/react/resolveIcon.js +1 -1
  609. package/dist/utils/react/sharedStore.js +1 -1
  610. package/dist/utils/react/useBufferedValue.js +1 -1
  611. package/dist/utils/react/useCombinedRefs.js +1 -1
  612. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  613. package/dist/utils/react/useEventBus.js +1 -1
  614. package/dist/utils/react/useId.js +1 -1
  615. package/dist/utils/react/useIsDarwin.js +1 -1
  616. package/dist/utils/react/useKeySymbols.js +1 -1
  617. package/dist/utils/react/useLayoutEffect.js +1 -1
  618. package/dist/utils/react/useLocalStorage.js +1 -1
  619. package/dist/utils/react/useMergeStyles.js +1 -1
  620. package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
  621. package/dist/utils/react/useOverlayPosition.js +1 -1
  622. package/dist/utils/react/usePopoverSync.js +1 -1
  623. package/dist/utils/react/useQaProps.js +1 -1
  624. package/dist/utils/react/useScheme.js +1 -1
  625. package/dist/utils/react/useViewportSize.js +1 -1
  626. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  627. package/dist/utils/selection.js +1 -1
  628. package/dist/utils/styles.js +1 -1
  629. package/dist/utils/tree.js +1 -1
  630. package/dist/utils/warnings.js +1 -1
  631. package/dist/version.js +2 -2
  632. package/package.json +1 -1
  633. package/src/components/actions/Banner/Banner.docs.mdx +1 -1
  634. package/src/components/content/Alert/Alert.docs.mdx +13 -4
  635. package/src/components/content/Result/Result.docs.mdx +27 -8
  636. package/src/components/fields/NumberInput/NumberInput.docs.mdx +35 -3
  637. package/src/components/fields/PasswordInput/PasswordInput.docs.mdx +12 -0
  638. package/src/components/fields/TagInput/TagInput.docs.mdx +9 -0
  639. package/src/components/fields/TextArea/TextArea.docs.mdx +10 -0
  640. package/src/components/fields/TextInput/TextInput.docs.mdx +10 -0
  641. package/src/components/fields/TextInputMapper/TextInputMapper.docs.mdx +8 -0
  642. package/src/components/form/Form/modern-form-guide.md +2 -2
  643. package/src/components/form/Form/modern-form-migration.md +1 -1
  644. package/src/stories/CreateComponent.docs.mdx +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TagInput.js","names":["useControlledState","Node","CollectionNode","Key","mergeStyles","Styles","tasty","ClipboardEvent","cloneElement","FocusEvent","ForwardedRef","forwardRef","isValidElement","KeyboardEvent","PointerEvent","ReactElement","ReactNode","RefObject","useEffect","useMemo","useRef","useState","useFilter","useId","useLocale","useTextField","VisuallyHidden","Section","BaseSection","useListState","useEvent","useFormatter","useI18n","CloseIcon","DirectionIcon","generateRandomId","mergeProps","castNullableArrayValue","WithNullableValue","settleOverlayKey","pickBaseCustomizationProps","useCombinedRefs","ItemAction","CollectionItem","Item","withFieldChrome","FieldLayoutStyleProps","splitFieldLayout","useFieldProps","rendersFieldChrome","wrapWithField","getListBoxOptionId","ListBoxPopover","collectVisibleKeys","filterCollectionNodes","getEdgeVisibleKey","getNextVisibleKey","ListStateLike","useCompositeFocus","TextInputBase","TagList","TagListEntry","useActiveOption","useSuffixSpace","useTagError","FieldBaseProps","ComponentBasePropsWithoutChildren","CubeTagProps","CompositeBlurInfo","FilterFn","textValue","inputValue","showEveryOption","TagInputPopoverTrigger","INTERACTIVE_ELEMENTS","TagValidationResult","CubeTagInputProps","value","defaultValue","onChange","defaultInputValue","onInputChange","placeholder","hidePlaceholderWithTags","autoComplete","inputMode","enterKeyHint","onFocus","onBlur","onKeyDown","e","HTMLInputElement","delimiters","validateTag","normalizeTag","maxTags","shouldCommitOnBlur","isClearable","onClear","items","Iterable","T","children","item","allowsCustomValue","filter","disabledKeys","popoverTrigger","emptyLabel","onOpenChange","isOpen","hideTrigger","direction","shouldFlip","overlayOffset","containerPadding","tagProps","Partial","icon","prefix","suffix","suffixPosition","size","tagPlacement","inputRef","wrapperRef","HTMLDivElement","popoverRef","listBoxRef","wrapperStyles","inputStyles","tagListStyles","tagStyles","triggerStyles","overlayStyles","listBoxStyles","optionStyles","sectionStyles","headingStyles","listGap","TagInputElement","qa","styles","display","flow","gap","TAG_SIZES","Record","small","medium","large","INSIDE_WRAPPER_STYLES","placeItems","height","padding","backgroundClip","Prefix","Suffix","position","alignSelf","margin","marginLeft","INSIDE_INPUT_STYLES","flexGrow","flexBasis","fieldSizing","textOverflow","width","INSIDE_TAG_LIST_STYLES","INSIDE_TAG_STYLES","$size","PartStyles","wrapper","input","tagList","tag","getPlacementStyles","placement","own","shownPlaceholder","hideWithTags","tagCount","undefined","isListShown","hasResults","term","isLoading","resolveEmptyLabel","t","ReturnType","placeTagList","below","DEFAULT_DELIMITERS","LINE_BREAK","escapeRegExp","text","replace","delimiterPattern","RegExp","separators","Boolean","map","length","join","splitTagText","pattern","source","split","part","trim","textLabel","node","textCollator","Intl","Collator","sensitivity","textSorter","numeric","isSameText","a","b","compare","compareText","OptionMatch","exact","loose","matchOptionText","collection","byKey","nodes","type","childNodes","child","key","String","label","withCustomOptions","customKeys","customTerm","hasOptionRows","hasSections","optionsLabel","customValuesLabel","customOptions","push","customSection","Array","isArray","CustomRows","keys","visibleKeys","typedKey","NO_CUSTOM_ROWS","getCustomRows","values","unpicked","isOption","isFiltering","matches","termOptionKey","Set","sort","includes","getExactRowKey","customValueKeys","some","getPreferredRowKey","rows","exactKey","firstNew","find","isComposingKey","nativeEvent","isComposing","keyCode","isArrowPastStart","selectionStart","selectionEnd","currentTarget","shiftKey","altKey","ctrlKey","metaKey","RejectionReason","Rejection","reason","message","CommitSource","TagRules","ReadonlySet","isOptionOnly","getRejection","optionKey","present","Omit","has","result","getComboboxProps","listBoxId","activeKey","role","FieldButtonProps","id","ariaLabel","fieldLabelledby","onPress","TagInputTrigger","t0","$","_c","isDisabled","t1","t2","t3","t4","pressed","loading","t5","t6","t7","TagInputClearButton","Symbol","for","TagInput","props","ref","defaultValidationTrigger","valuePropsMapper","_temp","formatList","textDirection","valueProp","onChange_0","inputValueProp","autoFocus","renderChildren","t8","t9","t10","t11","isReadOnly","isRequired","isInvalid","isValid","errorMessage","inputRefProp","wrapperRefProp","popoverRefProp","listBoxRefProp","labelProps","userLabelProps","mods","name","form","otherProps","field","rootRef","tagListRef","listStateRef","t12","tagInputId","tagListId","summaryId","hintId","triggerId","clearId","setValues","uniqueValues","draft","setDraftState","tagError","setTagError","clearTagErrorAfterPress","cancelPendingClear","t13","announcement","setAnnouncement","from","index","rendered","hasOptions","localCollectionState","selectionMode","t14","getItem","getOption","t15","contains","textFilterFn","isFilterActive","setIsFilterActive","knownLabels","setKnownLabels","_temp2","t16","key_0","get","getOptionLabel","getTagLabel","key_1","isTagLocked","key_2","disabledKeySet","t17","next","key_3","label_0","Map","set","rememberLabels","findOptionKey","match","resolveTypedText","text_0","typed","resolvePart","t18","optionFilterFn","keep","node_0","visibleOptionKeys","t19","unpickedCustomValues","setUnpickedCustomValues","visibleCustomKeys","value_0","popoverChildren","_temp3","visibleOptionsSignature","isPopoverOpen","setIsPopoverOpen","isInteractive","shouldShowPopover","notifiedOpenRef","current","visibleTargetKeys","preferredOptionKey","activeOption","setActiveOption","moveVirtualFocus","popoverMinWidth","activeOptionKey","t20","next_0","setDraft","t21","text_1","prev","announce","rejectionMessage","rejection","count","joinDelimiter","_temp4","joiner","hasFieldMessage","commitParts","parts","source_0","rules","accepted","rejected","part_0","optionKey_0","typed_0","nextValue","rejection_0","add","returned","_temp5","kept","slice","shown","error","messages","_temp6","commitDraft","rest","t22","querySelectorAll","focus","focusLastTag","removeValues","requested","keys_0","key_4","removed","next_1","value_1","value_2","toggleOption","key_5","source_1","prev_0","handlePopoverSelection","selection","next_2","changed","key_6","value_3","forEach","clicked","selectionManager","setFocusedKey","setTimeout","isTabbingRef","handleArrowKey","preventDefault","listState","handleEdgeKey","e_0","listState_0","t23","e_1","repeat","handleToTagsKey","handleEnterKey","e_2","isCurrent","targetKey","key_7","handleDelimiterKey","e_3","el","start","end","rejected_0","trimStart","handleEscapeKey","e_4","stopPropagation","handleKeyDown","e_5","defaultPrevented","value_4","handleInputChange","next_3","parts_0","nextDraft","rest_0","pop","rejected_1","_temp7","handlePaste","e_6","pasted","clipboardData","getData","el_0","start_0","end_0","settleDraft","handleCompositeFocus","handleCompositeBlur","t24","isPressing","wasShowingMessage","compositeFocusProps","HTMLElement","t25","e_7","isTabbing","next_4","relatedTarget","handleInputBlur","handleInputFocus","pressStartedInBoxRef","t26","e_8","box","target","Element","interactive","closest","handleBoxPointerDown","handleBoxClick","isBoxPress","tags","value_5","ownProps","label_1","invalidMessage","effectiveIsInvalid","hasRemovableTags","_temp8","hasBackspaceHint","lockedKeys","_temp9","_temp0","optionDisabledKeys","inputProps","ariaLabelledby","labelId","describedBy","tagInputProps","onPaste","handleTriggerPress","willOpen","trigger","clearAll","canClear","clearButton","hasActions","partStyles","placed","t27","onPointerDown","onClick","t28","t29","_temp1","t30","t31","t32","t33","tagInputField","_children","fieldProps","tag_2","tag_1","tag_0","part_1","rejection_2","rejection_1","delimiter","test","node_1","_TagInput","Object","assign","displayName","defineProperty","enumerable","configurable","Item","BaseSection","_c","tagInputId","useId","mergeProps","TextInputBase"],"sources":["../../../../src/components/fields/TagInput/TagInput.tsx"],"sourcesContent":["import { useControlledState } from '@react-stately/utils';\nimport { Node as CollectionNode, Key } from '@react-types/shared';\nimport { mergeStyles, Styles, tasty } from '@tenphi/tasty';\nimport {\n ClipboardEvent,\n cloneElement,\n FocusEvent,\n ForwardedRef,\n forwardRef,\n isValidElement,\n KeyboardEvent,\n PointerEvent,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n useFilter,\n useId,\n useLocale,\n useTextField,\n VisuallyHidden,\n} from 'react-aria';\nimport { Section as BaseSection, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useFormatter } from '../../../i18n/useFormatter';\nimport { useI18n } from '../../../i18n/useI18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { generateRandomId } from '../../../utils/random';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport {\n castNullableArrayValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { settleOverlayKey } from '../../../utils/react/overlayKeyPropagation';\nimport { pickBaseCustomizationProps } from '../../../utils/react/pickBaseCustomizationProps';\nimport { useCombinedRefs } from '../../../utils/react/useCombinedRefs';\nimport { ItemAction } from '../../actions/ItemAction/ItemAction';\nimport { CollectionItem as Item } from '../../CollectionItem';\nimport { withFieldChrome } from '../../form/field-chrome';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { useFieldProps } from '../../form/Form/use-field/use-field-props';\nimport { rendersFieldChrome, wrapWithField } from '../../form/wrapper';\nimport { getListBoxOptionId } from '../ListBox/optionId';\nimport { ListBoxPopover } from '../ListBoxPopover/ListBoxPopover';\nimport {\n collectVisibleKeys,\n filterCollectionNodes,\n getEdgeVisibleKey,\n getNextVisibleKey,\n ListStateLike,\n} from '../ListBoxPopover/listNavigation';\nimport { useCompositeFocus } from '../ListBoxPopover/useCompositeFocus';\nimport { TextInputBase } from '../TextInput/TextInputBase';\n\nimport { TagList, TagListEntry } from './TagList';\nimport { useActiveOption } from './useActiveOption';\nimport { useSuffixSpace } from './useSuffixSpace';\nimport { useTagError } from './useTagError';\n\nimport type { FieldBaseProps } from '../../../shared';\nimport type { ComponentBasePropsWithoutChildren } from '../../../utils/react/componentBaseProps';\nimport type { CubeTagProps } from '../../content/Tag/Tag';\nimport type { CompositeBlurInfo } from '../ListBoxPopover';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\n/**\n * `filter={false}`: the options come filtered already, as from a server.\n * Named rather than inline in the ternary that picks it: SonarJS charges a\n * function in a ternary branch to every later line of the component.\n */\nconst showEveryOption: FilterFn = () => true;\n\nexport type TagInputPopoverTrigger = 'focus' | 'input' | 'manual';\n\n// What a press in the input box goes to instead of the input, as in\n// `TextInputBase`: a chip, its remove button, the clear button, the chevron.\nconst INTERACTIVE_ELEMENTS =\n 'a[href], button, input, select, textarea, [tabindex], [contenteditable]';\n\n/**\n * What `validateTag` returns: `true` (or nothing) accepts the value, `false`\n * rejects it with the default message, and a string rejects it with that\n * message.\n */\nexport type TagValidationResult = boolean | string | null | undefined;\n\nexport interface CubeTagInputProps<T = object>\n extends\n ComponentBasePropsWithoutChildren,\n FieldLayoutStyleProps,\n FieldBaseProps<readonly string[] | null | undefined> {\n /** The values in controlled mode. */\n value?: readonly string[];\n /** The initial values in uncontrolled mode. */\n defaultValue?: readonly string[];\n /** Called with the whole new list whenever a value is added or removed. */\n onChange?: (value: string[]) => void;\n\n /** The text being typed, in controlled mode. */\n inputValue?: string;\n /** The initial text in uncontrolled mode. */\n defaultInputValue?: string;\n /** Called when the text being typed changes. */\n onInputChange?: (value: string) => void;\n /** Placeholder text for the input. */\n placeholder?: string;\n /**\n * Whether the placeholder hides once there is a tag, so it only prompts for\n * the first value.\n */\n hidePlaceholderWithTags?: boolean;\n /** HTML `autocomplete` attribute for the input. */\n autoComplete?: string;\n /**\n * Which virtual keyboard the input asks for: `'email'` for addresses,\n * `'decimal'` for numbers. The input stays a text input, so the browser does\n * not validate what is typed.\n */\n inputMode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n /** The label of the virtual keyboard's Enter key. */\n enterKeyHint?:\n 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n /** Called when focus enters the component (input, chips or popover). Receives no event. */\n onFocus?: () => void;\n /**\n * Called when focus leaves the component entirely, after the typed text is\n * committed and before the press that moved focus is handled. Receives no\n * event.\n */\n onBlur?: () => void;\n /**\n * Called when a key is pressed in the input, before the component handles it.\n * Call `e.preventDefault()` to stop the component from handling the key.\n * `Escape` and `Tab` go on to a surrounding dialog unless TagInput acts on\n * them or the handler prevents them.\n */\n onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;\n\n /**\n * Characters that commit the typed text, and that pasted text is split on.\n * Pasted text is also always split on line breaks. Pass `[]` for values that\n * may contain the default separator; only the first of several refused\n * values then stays in the input.\n * @default [',']\n */\n delimiters?: string[];\n /**\n * Checks one value before it becomes a chip. Return `true` or nothing to\n * accept it, `false` to reject it with the default message, or a string to\n * reject it with that message. Also paints existing chips that fail it in the\n * danger theme. Values picked from the options are not checked.\n */\n validateTag?: (value: string) => TagValidationResult;\n /**\n * Rewrites a typed value before it is checked and added: lowercase an\n * address, write a number one way. Duplicates are found after it runs.\n * Return an empty string to drop the value. Values picked from the options\n * are not rewritten.\n */\n normalizeTag?: (value: string) => string;\n /**\n * The most values the field holds. Values past it are refused with a\n * message and stay in the input.\n */\n maxTags?: number;\n /** Whether leaving the field commits the typed text. @default true */\n shouldCommitOnBlur?: boolean;\n /**\n * Whether a button in the input clears the field: the typed text and every\n * chip but the locked ones. It shows while there is something to clear.\n */\n isClearable?: boolean;\n /** Called when the clear button is pressed. */\n onClear?: () => void;\n\n /** Options to suggest, as data. Pair with a render function in `children`. */\n items?: Iterable<T>;\n /**\n * Options to suggest: `TagInput.Item` elements or a render function for\n * `items`. Without options the field accepts any typed value.\n */\n children?: ReactNode | ((item: T) => ReactElement);\n /**\n * Whether typed values that are not among the options are accepted. Only\n * applies when options are given; without options every value is custom.\n * Text that matches an option only in case or accents is then added as\n * typed; without it, that text picks the option.\n * @default false\n */\n allowsCustomValue?: boolean;\n /**\n * Custom filter for the options, or `false` to show every option (for\n * server-side filtering).\n */\n filter?: FilterFn | false;\n /** Keys of options that cannot be picked. */\n disabledKeys?: Iterable<Key>;\n /**\n * When the suggestions popover opens on its own, as in `ComboBox`: `'input'`\n * on typing or a press in the input, `'focus'` on focus as well, `'manual'`\n * only from the chevron and the arrow keys.\n * @default 'input'\n */\n popoverTrigger?: TagInputPopoverTrigger;\n /**\n * What the popover says when no option matches the typed text, or while\n * `isLoading` with no option to show. Defaults to \"No results found\", and\n * to \"Loading…\" while loading.\n */\n emptyLabel?: ReactNode;\n /** Called when the suggestions popover opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Whether to hide the button that toggles the suggestions popover. */\n hideTrigger?: boolean;\n /** Where the suggestions popover opens. @default 'bottom' */\n direction?: 'bottom' | 'top';\n /** Whether the popover flips when there is no room. @default true */\n shouldFlip?: boolean;\n /** Distance between the input and the popover, in pixels. @default 8 */\n overlayOffset?: number;\n /** Minimum space between the popover and the viewport edge, in pixels. @default 8 */\n containerPadding?: number;\n\n /**\n * Props for each chip's `Tag` (theme, icon, label, …), by value. A string\n * `children` also names the value to screen readers. `isDisabled` locks the\n * chip: it cannot be removed.\n */\n tagProps?: (value: string) => Partial<CubeTagProps> | undefined;\n\n /** Left input icon. */\n icon?: ReactElement;\n /** Input decoration before the main input. */\n prefix?: ReactNode;\n /** Input decoration after the main input. */\n suffix?: ReactNode;\n /** Whether the suffix goes before or after the validation and loading icons. */\n suffixPosition?: 'before' | 'after';\n /** Size of the input. The chips follow it. @default 'medium' */\n size?: 'small' | 'medium' | 'large' | (string & {});\n /**\n * Where the chips go. `below`: a list under a fixed single-line input.\n * `inside`: in the input box, in one wrapping row with the text, so the box\n * grows a line at a time; for a row with no room below the field.\n * @default 'below'\n */\n tagPlacement?: 'below' | 'inside';\n\n /** Ref to the input element. */\n inputRef?: RefObject<HTMLInputElement>;\n /** Ref to the bordered input box. */\n wrapperRef?: RefObject<HTMLDivElement>;\n /** Ref to the popover element. */\n popoverRef?: RefObject<HTMLDivElement>;\n /** Ref to the listbox in the popover. */\n listBoxRef?: RefObject<HTMLDivElement>;\n\n /** Styles for the bordered input box. */\n wrapperStyles?: Styles;\n /** Styles for the input element. */\n inputStyles?: Styles;\n /** Styles for the list of chips. */\n tagListStyles?: Styles;\n /** Styles for every chip. */\n tagStyles?: Styles;\n /** Styles for the button that toggles the popover. */\n triggerStyles?: Styles;\n /** Styles for the popover. */\n overlayStyles?: Styles;\n /** Styles for the listbox in the popover. */\n listBoxStyles?: Styles;\n /** Styles for each option. */\n optionStyles?: Styles;\n /** Styles for option sections. */\n sectionStyles?: Styles;\n /** Styles for option section headings. */\n headingStyles?: Styles;\n /** Space between options, in pixels. Defaults to a hairline (`$item-gap`, `1px`). */\n listGap?: number;\n}\n\nconst TagInputElement = tasty({\n qa: 'TagInputContainer',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: '1x',\n },\n});\n\n// The chips sit a step below the input, so a row of them reads as the field's\n// value rather than as a second row of controls. Never below `xsmall`: the\n// `inline` tag is set in the bold badge type, which reads as a label.\nconst TAG_SIZES: Record<string, CubeTagProps['size']> = {\n small: 'xsmall',\n medium: 'xsmall',\n large: 'small',\n};\n\n// Chips inside the box: one wrapping row of chips and text. The padding is the\n// same on every side and comes from the chip height, so one row is exactly the\n// input's height. The prefix box steps aside (`contents`) so the icon and the\n// chips are items of that row, and the caret follows the last chip.\nconst INSIDE_WRAPPER_STYLES: Styles = {\n display: 'flex',\n flow: 'row wrap',\n placeItems: 'center start',\n gap: '.5x',\n height: 'min $size',\n padding: '$tag-inset',\n // The fill reaches under the padding, which the default `content-box` clip\n // would leave bare.\n backgroundClip: 'padding-box',\n\n '$tag-size': {\n '': '$size-xs',\n 'size=small': '2.5x',\n 'size=large': '$size-sm',\n },\n '$tag-inset': '(($size - $tag-size - 2bw) / 2)',\n // The suffix's width and the gap before it, measured by `useSuffixSpace`.\n '$suffix-space': '0px',\n\n Prefix: {\n display: 'contents',\n },\n\n // On the end of the text, which reserves its room: the suffix takes none of\n // its own in the row, so the two wrap together. The block margins let a\n // full-height action sit in a chip-high row without growing it, flush with\n // the edge as in a plain input.\n Suffix: {\n position: 'relative',\n alignSelf: 'stretch',\n margin: '(-1 * $tag-inset)',\n marginLeft: '(-1 * $suffix-space)',\n },\n};\n\n// The text takes what the last row leaves. It is as wide as what is typed,\n// never under 6x, so text that does not fit the rest of the row moves to a row\n// of its own, and is cut only past the full width. The placeholder is a hint:\n// it does not size the field, so it never takes a row of its own (which the\n// first typed letter would take back) and is cut with an ellipsis instead.\n// Without `field-sizing` the text keeps a fixed share of the row and scrolls.\n// With no chips it lines up with a plain input.\nconst INSIDE_INPUT_STYLES: Styles = {\n flexGrow: 1,\n flexBasis: {\n '': 0,\n '@supports(field-sizing: content) & !:placeholder-shown': 'auto',\n },\n fieldSizing: {\n '': 'content',\n ':placeholder-shown': 'fixed',\n },\n textOverflow: 'ellipsis',\n // `auto`, or a width would override `field-sizing`. The suffix's room counts\n // toward the minimum, so typing room stays 6x beside it.\n width: '(6x + $suffix-space) auto 100%',\n // Its own line box would make the row taller than the chips.\n height: '$tag-size',\n padding:\n '0 (1x - 1bw - $tag-inset + $suffix-space) 0 (1x - 1bw - $tag-inset)',\n};\n\n// The chips are items of the box's row, not a box of their own, and each one\n// fits the row height.\nconst INSIDE_TAG_LIST_STYLES: Styles = {\n display: 'contents',\n // Off a flex box, tasty's `gap` turns into child margins; the box's own gap\n // spaces the chips.\n gap: 0,\n};\n\nconst INSIDE_TAG_STYLES: Styles = {\n $size: '$tag-size',\n // The height comes from `$size` alone, the label centered in it, so a small\n // field's chip can be shorter than the label's padded line.\n '$block-padding': 0,\n};\n\ninterface PartStyles {\n wrapper?: Styles;\n input?: Styles;\n tagList?: Styles;\n tag?: Styles;\n}\n\n/** What each part is styled with for a placement. The consumer's own win. */\nfunction getPlacementStyles(\n placement: CubeTagInputProps['tagPlacement'],\n own: PartStyles,\n): PartStyles {\n if (placement !== 'inside') return own;\n\n return {\n wrapper: mergeStyles(INSIDE_WRAPPER_STYLES, own.wrapper),\n input: mergeStyles(INSIDE_INPUT_STYLES, own.input),\n tagList: mergeStyles(INSIDE_TAG_LIST_STYLES, own.tagList),\n tag: mergeStyles(INSIDE_TAG_STYLES, own.tag),\n };\n}\n\n/** The placeholder, unless it hides once there is a tag. */\nfunction shownPlaceholder(\n placeholder: string | undefined,\n hideWithTags: boolean | undefined,\n tagCount: number,\n) {\n return hideWithTags && tagCount > 0 ? undefined : placeholder;\n}\n\n/**\n * Whether the popover shows: with an option to list, or to say there is none\n * for the typed text, or none yet while loading (`emptyLabel`), rather than\n * disappear under the user. With no options at all and nothing typed, it\n * hides but stays open, so it comes back as soon as there is something.\n */\nfunction isListShown({\n isOpen,\n hasResults,\n term,\n isLoading,\n}: {\n isOpen: boolean;\n hasResults: boolean;\n term: string;\n isLoading: boolean | undefined;\n}) {\n return isOpen && (hasResults || term !== '' || !!isLoading);\n}\n\n/** What the popover says when it has no option to list. */\nfunction resolveEmptyLabel(\n emptyLabel: ReactNode,\n isLoading: boolean | undefined,\n t: ReturnType<typeof useI18n>['t'],\n) {\n if (emptyLabel !== undefined) return emptyLabel;\n\n return isLoading\n ? t('tagInput.loading', 'Loading…')\n : t('tagInput.noResults', 'No results found');\n}\n\n/**\n * Where the list of chips renders: inside, after the icon and the prefix and\n * before the text; below, under the box.\n */\nfunction placeTagList(\n placement: CubeTagInputProps['tagPlacement'],\n prefix: ReactNode,\n tagList: ReactNode,\n) {\n if (placement !== 'inside' || !tagList) return { prefix, below: tagList };\n\n return {\n prefix: (\n <>\n {prefix}\n {tagList}\n </>\n ),\n below: null,\n };\n}\n\nconst DEFAULT_DELIMITERS = [','];\nconst LINE_BREAK = /\\r\\n|\\r|\\n/;\n\nfunction escapeRegExp(text: string) {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction delimiterPattern(delimiters: string[]): RegExp | null {\n const separators = delimiters.filter(Boolean).map(escapeRegExp);\n\n return separators.length ? new RegExp(separators.join('|')) : null;\n}\n\n/** Splits `text` on the delimiters and line breaks into trimmed, non-empty parts. */\nexport function splitTagText(text: string, delimiters: string[]): string[] {\n const separators = delimiters.filter(Boolean).map(escapeRegExp);\n const pattern = new RegExp([LINE_BREAK.source, ...separators].join('|'), 'g');\n\n return text\n .split(pattern)\n .map((part) => part.trim())\n .filter(Boolean);\n}\n\n/** A chip's own label, when `tagProps` gives it one as plain text. */\nfunction textLabel(node: ReactNode): string | undefined {\n return typeof node === 'string' && node !== '' ? node : undefined;\n}\n\n// Safari reports the Enter that confirms an IME composition with\n// `isComposing: false`, but still with the composition key code.\nconst textCollator = new Intl.Collator(undefined, { sensitivity: 'base' });\n// Numbers in order: 2 before 10.\nconst textSorter = new Intl.Collator(undefined, { numeric: true });\n\nfunction isSameText(a: string, b: string) {\n return textCollator.compare(a, b) === 0;\n}\n\nfunction compareText(a: string, b: string) {\n return textSorter.compare(a, b);\n}\n\ninterface OptionMatch {\n /** The first option whose label is the text, or else the one whose key is. */\n exact: string | null;\n /** The first option whose label is the text ignoring case and accents. */\n loose: string | null;\n}\n\n/**\n * The options typed text names. The label comes first, since it is what the\n * user sees, then the key. An exact match is looked for in the whole list\n * before a loose one counts, so `active` finds `active` even after `Active`.\n */\nfunction matchOptionText(\n collection: Iterable<CollectionNode<unknown>>,\n text: string,\n): OptionMatch {\n let byKey: string | null = null;\n let loose: string | null = null;\n\n for (const node of collection) {\n const nodes = node.type === 'section' ? [...node.childNodes] : [node];\n\n for (const child of nodes) {\n if (child.type !== 'item') continue;\n\n const key = String(child.key);\n const label = child.textValue || '';\n\n if (label === text) return { exact: key, loose };\n\n if (byKey == null && key === text) byKey = key;\n if (loose == null && isSameText(label, text)) loose = key;\n }\n }\n\n return { exact: byKey, loose };\n}\n\n/**\n * The popover's rows: the options, then the user's own values and the typed\n * text. Those go in a section of their own when there are options to set them\n * apart from.\n */\nfunction withCustomOptions(\n children: ReactNode,\n {\n customKeys,\n customTerm,\n hasOptionRows,\n hasSections,\n optionsLabel,\n customValuesLabel,\n }: {\n customKeys: readonly string[];\n customTerm: string | null;\n hasOptionRows: boolean;\n hasSections: boolean;\n optionsLabel: string;\n customValuesLabel: string;\n },\n) {\n if (!customTerm && !customKeys.length) return children;\n\n const customOptions = customKeys.map((key) => (\n <Item key={key} textValue={key}>\n {key}\n </Item>\n ));\n\n if (customTerm) {\n customOptions.push(\n <Item key={customTerm} textValue={customTerm}>\n {customTerm}\n </Item>,\n );\n }\n\n if (!hasOptionRows) {\n return customOptions;\n }\n\n const customSection = (\n <BaseSection key=\"__custom_values__\" aria-label={customValuesLabel}>\n {customOptions}\n </BaseSection>\n );\n\n // A section cannot nest in another one, so options that already come in\n // sections only get the custom section appended.\n if (hasSections) {\n return [\n ...(Array.isArray(children) ? children : [children]),\n customSection,\n ];\n }\n\n return [\n <BaseSection key=\"__options__\" aria-label={optionsLabel}>\n {children as never}\n </BaseSection>,\n customSection,\n ];\n}\n\ninterface CustomRows {\n /** The user's own values, as rows. */\n keys: readonly string[];\n /** The ones the typed text leaves listed. */\n visibleKeys: readonly string[];\n /** The typed text as a pickable row, when it would add something new. */\n typedKey: string | null;\n}\n\nconst NO_CUSTOM_ROWS: CustomRows = {\n keys: [],\n visibleKeys: [],\n typedKey: null,\n};\n\n/**\n * The rows listed after the options: the user's own values, so they can be\n * unpicked where they were picked, and the typed text. `unpicked` holds the\n * custom values unpicked during this visit, which stay listed.\n */\nfunction getCustomRows({\n values,\n unpicked,\n isOption,\n term,\n isFiltering,\n matches,\n termOptionKey,\n}: {\n values: readonly string[];\n unpicked: readonly string[];\n /** Whether a value is an option, or was one when it was picked. */\n isOption: (value: string) => boolean;\n term: string;\n /** Whether the typed text narrows the rows. */\n isFiltering: boolean;\n matches: FilterFn;\n /** The option the typed text names, if any. */\n termOptionKey: string | null;\n}): CustomRows {\n // Sorted, so toggling one does not move it.\n const keys = [\n ...new Set([...values, ...unpicked].filter((value) => !isOption(value))),\n ].sort(compareText);\n\n return {\n keys,\n visibleKeys:\n isFiltering && term ? keys.filter((key) => matches(key, term)) : keys,\n typedKey:\n term &&\n termOptionKey == null &&\n !values.includes(term) &&\n !keys.includes(term)\n ? term\n : null,\n };\n}\n\n/**\n * The row the typed text names: the option it stands for, or else a custom\n * value it spells. Text that names a row only in another case is a value of\n * its own, so its own row wins over that one: Enter adds `paris` as typed, not\n * `Paris`.\n */\nfunction getExactRowKey(\n collection: Iterable<CollectionNode<unknown>>,\n {\n term,\n termOptionKey,\n customTerm,\n customValueKeys,\n }: {\n term: string;\n termOptionKey: string | null;\n customTerm: string | null;\n customValueKeys: readonly string[];\n },\n): string | null {\n if (termOptionKey != null) return termOptionKey;\n if (term && customValueKeys.includes(term)) return term;\n\n if (\n customTerm &&\n (matchOptionText(collection, customTerm).loose != null ||\n customValueKeys.some((key) => isSameText(key, customTerm)))\n ) {\n return customTerm;\n }\n\n return null;\n}\n\n/**\n * The row the focus pass lands on, and Enter with it. The row the typed text\n * names wins over the first match, so typing \"build\" and pressing Enter picks\n * \"build\", not \"rebuild\". Typed text means \"add\", so past an exact match the\n * first row that is not added yet wins: typing \"def\" next to a picked\n * \"undefined\" lands on \"def\".\n */\nfunction getPreferredRowKey(\n rows: readonly Key[],\n exactKey: Key | null,\n term: string,\n values: readonly string[],\n): Key | null {\n if (exactKey != null && rows.includes(exactKey)) return exactKey;\n\n const firstNew = term\n ? rows.find((key) => !values.includes(String(key)))\n : undefined;\n\n return firstNew ?? rows[0] ?? null;\n}\n\nfunction isComposingKey(e: KeyboardEvent<HTMLInputElement>) {\n return e.nativeEvent.isComposing || e.keyCode === 229;\n}\n\n/**\n * The arrow toward the start of the line, with the caret already there and\n * nothing selected: the caret has nowhere to go, so it steps out to the chip\n * before it. Modified arrows stay text editing.\n */\nfunction isArrowPastStart(\n e: KeyboardEvent<HTMLInputElement>,\n direction: 'ltr' | 'rtl',\n) {\n const { selectionStart, selectionEnd } = e.currentTarget;\n\n return (\n e.key === (direction === 'rtl' ? 'ArrowRight' : 'ArrowLeft') &&\n !(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) &&\n selectionStart === 0 &&\n selectionEnd === 0\n );\n}\n\ntype RejectionReason =\n 'invalid' | 'duplicate' | 'unknown' | 'unavailable' | 'limit';\n\ninterface Rejection {\n text: string;\n reason: RejectionReason;\n message?: string;\n}\n\n/**\n * Where a committed part comes from: typed text, which may name an option, an\n * option row's key, or a custom value's row, which is only ever itself.\n */\ntype CommitSource = 'text' | 'option' | 'custom';\n\n/** What a value must pass to become a chip. */\ninterface TagRules {\n /** Keys of options that cannot be picked. */\n disabledKeys: ReadonlySet<string>;\n /** Only options are accepted: there are options, and no custom values. */\n isOptionOnly: boolean;\n maxTags?: number;\n validateTag?: (value: string) => TagValidationResult;\n}\n\n/**\n * Why a value is refused, or `null` when it may be added. `optionKey` is the\n * option the part resolved to, if any: an option is not validated. `present`\n * holds the values already there, the ones this commit accepted so far among\n * them.\n */\nfunction getRejection(\n value: string,\n optionKey: string | null,\n present: ReadonlySet<string>,\n { disabledKeys, isOptionOnly, maxTags, validateTag }: TagRules,\n): Omit<Rejection, 'text'> | null {\n if (optionKey != null && disabledKeys.has(optionKey)) {\n return { reason: 'unavailable' };\n }\n\n if (optionKey == null && isOptionOnly) return { reason: 'unknown' };\n if (present.has(value)) return { reason: 'duplicate' };\n if (maxTags != null && present.size >= maxTags) return { reason: 'limit' };\n\n if (optionKey == null && validateTag) {\n const result = validateTag(value);\n\n if (result === false || typeof result === 'string') {\n return {\n reason: 'invalid',\n message: typeof result === 'string' ? result : undefined,\n };\n }\n }\n\n return null;\n}\n\n/** The input's combobox wiring, for a field with options to suggest. */\nfunction getComboboxProps(\n listBoxId: string,\n isOpen: boolean,\n activeKey: Key | null,\n) {\n return {\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-haspopup': 'listbox',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? listBoxId : undefined,\n 'aria-activedescendant':\n isOpen && activeKey != null\n ? getListBoxOptionId(listBoxId, activeKey)\n : undefined,\n };\n}\n\ninterface FieldButtonProps {\n id: string;\n size: CubeTagInputProps['size'];\n /** The field's `aria-label`, joined into the button's own name. */\n ariaLabel?: string;\n /** The ids that label the field, read after the button's own name. */\n fieldLabelledby?: string;\n onPress: () => void;\n}\n\n/** The button in the input that toggles the suggestions popover. */\nfunction TagInputTrigger({\n id,\n size,\n ariaLabel,\n fieldLabelledby,\n onPress,\n isOpen,\n isDisabled,\n isLoading,\n styles,\n}: FieldButtonProps & {\n isOpen: boolean;\n isDisabled: boolean;\n isLoading?: boolean;\n styles?: Styles;\n}) {\n const { t } = useI18n();\n\n return (\n <ItemAction\n data-popover-trigger\n id={id}\n qa=\"TagInputTrigger\"\n icon={<DirectionIcon to={isOpen ? 'up' : 'down'} />}\n size={size}\n isDisabled={isDisabled}\n styles={styles}\n mods={{ pressed: isOpen, loading: !!isLoading }}\n // Arrow keys open the list from the input, so the button stays out of\n // the Tab order and Tab goes from the input straight to the chips.\n tabIndex={-1}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-label={\n ariaLabel\n ? t('tagInput.showOptionsFor', 'Show options, {{label}}', {\n label: ariaLabel,\n })\n : t('tagInput.showOptions', 'Show options')\n }\n aria-labelledby={fieldLabelledby ? `${id} ${fieldLabelledby}` : undefined}\n onPress={onPress}\n />\n );\n}\n\n/** The button in the input that clears the typed text and the chips. */\nfunction TagInputClearButton({\n id,\n size,\n ariaLabel,\n fieldLabelledby,\n onPress,\n}: FieldButtonProps) {\n const { t } = useI18n();\n\n return (\n <ItemAction\n id={id}\n qa=\"TagInputClearButton\"\n icon={<CloseIcon />}\n size={size}\n // As a Tab stop it would take focus just as tabbing away commits the\n // text, and with the text gone it could be the only thing left to clear.\n tabIndex={-1}\n aria-label={\n ariaLabel\n ? t('tagInput.clearAllFor', 'Clear all, {{label}}', {\n label: ariaLabel,\n })\n : t('tagInput.clearAll', 'Clear all')\n }\n aria-labelledby={fieldLabelledby ? `${id} ${fieldLabelledby}` : undefined}\n onPress={onPress}\n />\n );\n}\n\nfunction TagInput<T extends object>(\n props: WithNullableValue<CubeTagInputProps<T>>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n props = castNullableArrayValue(props);\n props = useFieldProps(props, {\n defaultValidationTrigger: 'onChange',\n valuePropsMapper: ({ value, onChange }) => ({\n value: value ?? [],\n onChange,\n }),\n });\n // Its refusals are messages of its own, with or without a label or a form,\n // so it asks for the field chrome that shows them. `isBare` still opts out.\n props = withFieldChrome(props);\n\n const { t } = useI18n();\n const { formatList } = useFormatter();\n // The text direction; `direction` is where the popover opens.\n const { direction: textDirection } = useLocale();\n\n let {\n qa,\n id,\n label,\n value: valueProp,\n defaultValue,\n onChange,\n inputValue: inputValueProp,\n defaultInputValue,\n onInputChange,\n placeholder,\n hidePlaceholderWithTags,\n autoFocus,\n autoComplete = 'off',\n onFocus,\n onBlur,\n onKeyDown,\n delimiters = DEFAULT_DELIMITERS,\n validateTag,\n normalizeTag,\n maxTags,\n shouldCommitOnBlur = true,\n isClearable,\n onClear,\n items,\n children: renderChildren,\n allowsCustomValue,\n filter,\n disabledKeys,\n popoverTrigger = 'input',\n emptyLabel,\n onOpenChange,\n hideTrigger,\n direction = 'bottom',\n shouldFlip = true,\n overlayOffset = 8,\n containerPadding = 8,\n tagProps,\n icon,\n prefix,\n suffix,\n suffixPosition,\n size = 'medium',\n tagPlacement = 'below',\n isDisabled,\n isReadOnly,\n isRequired,\n isLoading,\n isInvalid,\n isValid,\n message,\n errorMessage,\n inputRef: inputRefProp,\n wrapperRef: wrapperRefProp,\n popoverRef: popoverRefProp,\n listBoxRef: listBoxRefProp,\n wrapperStyles,\n inputStyles,\n tagListStyles,\n tagStyles,\n triggerStyles,\n overlayStyles,\n listBoxStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n labelProps: userLabelProps,\n mods,\n // The input holds the text being typed, not the field's value: a native\n // form must not submit it under the field's name.\n name,\n form,\n ...otherProps\n } = props;\n\n const { styles, field } = splitFieldLayout(props);\n\n const rootRef = useCombinedRefs(ref);\n const inputRef = useCombinedRefs(inputRefProp);\n const wrapperRef = useCombinedRefs(wrapperRefProp);\n const popoverRef = useCombinedRefs(popoverRefProp);\n const listBoxRef = useCombinedRefs(listBoxRefProp);\n const tagListRef = useRef<HTMLDivElement>(null);\n const listStateRef = useRef<ListStateLike | null>(null);\n\n const tagInputId = useMemo(() => generateRandomId(), []);\n const listBoxId = `TagInputListBox-${tagInputId}`;\n const tagListId = useId();\n const summaryId = useId();\n const hintId = useId();\n const triggerId = useId();\n const clearId = useId();\n\n // ---- values -------------------------------------------------------------\n const [values, setValues] = useControlledState<readonly string[]>(\n valueProp as readonly string[] | undefined,\n (defaultValue as readonly string[] | undefined) ?? [],\n onChange as ((value: readonly string[]) => void) | undefined,\n );\n // A controlled value may repeat an entry; the chips are keyed by value, so\n // render each one once.\n const uniqueValues = [...new Set((values ?? []).map(String))];\n\n // ---- typed text ---------------------------------------------------------\n const [draft, setDraftState] = useControlledState<string>(\n inputValueProp as string | undefined,\n defaultInputValue ?? '',\n onInputChange,\n );\n const { tagError, setTagError, clearTagErrorAfterPress, cancelPendingClear } =\n useTagError();\n const [announcement, setAnnouncement] = useState({ id: 0, text: '' });\n\n // ---- options ------------------------------------------------------------\n let children: ReactNode = renderChildren as ReactNode;\n\n if (items && typeof renderChildren === 'function') {\n children = Array.from(items).map((item, index) => {\n const rendered = (renderChildren as (item: T) => ReactNode)(item);\n\n if (isValidElement(rendered) && rendered.key == null) {\n return cloneElement(rendered, {\n key:\n (item as { key?: Key })?.key ?? (item as { id?: Key })?.id ?? index,\n });\n }\n\n return rendered;\n });\n }\n\n const hasOptions = children != null && children !== false;\n\n // Reads option labels, and matches typed text to an option, whether or not\n // the popover is open.\n const localCollectionState = useListState({\n children: children as never,\n selectionMode: 'none',\n });\n const collection = localCollectionState.collection;\n\n // An option's node. Sections are in the collection too, under keys of their\n // own, but a value that shares one is still the user's own text.\n const getOption = (key: string) => {\n const node = collection.getItem(key);\n\n return node?.type === 'item' ? node : null;\n };\n\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const textFilterFn: FilterFn =\n filter === false ? showEveryOption : filter || contains;\n\n const [isFilterActive, setIsFilterActive] = useState(false);\n const term = draft.trim();\n\n // Labels of picked options, kept after the option leaves the collection, as\n // it does with server-side filtering (`items` + `filter={false}`).\n const [knownLabels, setKnownLabels] = useState<ReadonlyMap<string, string>>(\n () => new Map(),\n );\n\n const getOptionLabel = (key: string) =>\n getOption(key)?.textValue || knownLabels.get(key) || key;\n\n // What a chip reads as, and what announcements name it by: a string label\n // the chip is given, then the option's own.\n const getTagLabel = (key: string) =>\n textLabel(tagProps?.(key)?.children) ?? getOptionLabel(key);\n\n // A locked chip stays put: no remove button, Delete or unpick.\n const isTagLocked = (key: string) => !!tagProps?.(key)?.isDisabled;\n\n const disabledKeySet = new Set([...(disabledKeys ?? [])].map(String));\n\n // Called before the text changes (and the options with it) and when values\n // are added, while the options still hold the labels.\n const rememberLabels = useEvent((keys: readonly string[]) => {\n let next: Map<string, string> | null = null;\n\n for (const key of keys) {\n const label = getOption(key)?.textValue;\n\n if (label && knownLabels.get(key) !== label) {\n if (!next) next = new Map(knownLabels);\n next.set(key, label);\n }\n }\n\n if (next) setKnownLabels(next);\n });\n\n /**\n * The option typed text stands for, if any. Without `allowsCustomValue` a\n * label in another case or without its accents counts, so `production`\n * finds `Production`. With it, such text is a value of its own and is added\n * as typed: `paris` is not `Paris` to a case-sensitive filter.\n */\n const findOptionKey = (text: string): string | null => {\n if (!hasOptions) return null;\n\n const match = matchOptionText(collection, text);\n\n return match.exact ?? (allowsCustomValue ? null : match.loose);\n };\n\n /**\n * What typed text commits as: the option it names, or else the text itself,\n * rewritten by `normalizeTag`, and the option that names if any. Enter, a\n * delimiter, a paste and blur all go through this, so they agree.\n */\n const resolveTypedText = (text: string) => {\n const optionKey = findOptionKey(text);\n\n if (optionKey != null || !normalizeTag) return { optionKey, typed: text };\n\n const typed = normalizeTag(text).trim();\n\n return { optionKey: typed ? findOptionKey(typed) : null, typed };\n };\n\n /**\n * What a part commits as. Only typed text is matched to an option. An option\n * row commits its own key; a custom value's row is the user's own text, so\n * `normalizeTag` still rewrites it, but it never turns into an option.\n */\n const resolvePart = (part: string, source: CommitSource = 'text') => {\n if (source === 'text') return resolveTypedText(part);\n if (source === 'option') return { optionKey: part, typed: part };\n\n return {\n optionKey: null,\n typed: normalizeTag ? normalizeTag(part).trim() : part,\n };\n };\n\n const termOptionKey = term ? resolveTypedText(term).optionKey : null;\n\n // The option the text names stays listed even when the filter would hide\n // it (a key typed, a custom filter), so Enter can land on it.\n const optionFilterFn = (nodes: Iterable<any>) => {\n if (!isFilterActive || !term) return nodes;\n\n return filterCollectionNodes(nodes, term, textFilterFn, {\n keep:\n termOptionKey == null\n ? undefined\n : (node) => String(node.key) === termOptionKey,\n });\n };\n\n const visibleOptionKeys: Key[] = [];\n\n if (hasOptions) {\n collectVisibleKeys(\n optionFilterFn(collection),\n visibleOptionKeys,\n disabledKeys ? new Set(disabledKeys) : undefined,\n );\n }\n\n // Custom values unpicked in the list during this visit. They stay listed,\n // unchecked, until focus leaves the field: the row does not vanish under the\n // pointer, and it can be picked back.\n const [unpickedCustomValues, setUnpickedCustomValues] = useState<\n readonly string[]\n >([]);\n\n // The user's own values and the typed text, listed after the options. Only\n // with `allowsCustomValue`: without it an unpicked value could not be added\n // back.\n const {\n keys: customValueKeys,\n visibleKeys: visibleCustomKeys,\n typedKey: customTerm,\n } = hasOptions && allowsCustomValue\n ? getCustomRows({\n values: uniqueValues,\n unpicked: unpickedCustomValues,\n isOption: (value) => getOption(value) != null || knownLabels.has(value),\n term,\n isFiltering: isFilterActive,\n // The typed text narrows them as it narrows the options, even when\n // the options are filtered on the server (`filter={false}`): these\n // rows are this component's own.\n matches: typeof filter === 'function' ? filter : contains,\n termOptionKey,\n })\n : NO_CUSTOM_ROWS;\n\n const popoverChildren = withCustomOptions(children, {\n customKeys: visibleCustomKeys,\n customTerm,\n hasOptionRows: visibleOptionKeys.length > 0,\n hasSections: [...collection].some((node) => node.type === 'section'),\n optionsLabel: t('tagInput.options', 'Options'),\n customValuesLabel: t('tagInput.customValues', 'Custom values'),\n });\n\n const hasResults =\n visibleOptionKeys.length > 0 ||\n visibleCustomKeys.length > 0 ||\n customTerm != null;\n // Options rebuild on every render when they come from `items`, so effects\n // follow what is visible rather than the collection's identity.\n const visibleOptionsSignature = [\n ...visibleOptionKeys,\n ...visibleCustomKeys,\n ].join('\\u0000');\n\n // ---- popover ------------------------------------------------------------\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const isInteractive = !isDisabled && !isReadOnly;\n const shouldShowPopover =\n hasOptions &&\n isInteractive &&\n isListShown({ isOpen: isPopoverOpen, hasResults, term, isLoading });\n\n const notifiedOpenRef = useRef(false);\n\n useEffect(() => {\n if (notifiedOpenRef.current === shouldShowPopover) return;\n\n notifiedOpenRef.current = shouldShowPopover;\n onOpenChange?.(shouldShowPopover);\n }, [shouldShowPopover, onOpenChange]);\n\n const visibleTargetKeys: Key[] = [...visibleOptionKeys, ...visibleCustomKeys];\n\n if (customTerm) visibleTargetKeys.push(customTerm);\n\n const preferredOptionKey = getPreferredRowKey(\n visibleTargetKeys,\n getExactRowKey(collection, {\n term,\n termOptionKey,\n customTerm,\n customValueKeys,\n }),\n term,\n uniqueValues,\n );\n\n const { activeOption, setActiveOption, moveVirtualFocus, popoverMinWidth } =\n useActiveOption({\n listStateRef,\n wrapperRef,\n isOpen: shouldShowPopover,\n visibleOptionsSignature,\n customTerm,\n term,\n preferredOptionKey,\n });\n const activeOptionKey = activeOption?.key ?? null;\n\n const setDraft = useEvent((next: string) => {\n setDraftState(next);\n setIsFilterActive(!!next.trim());\n });\n\n // A fresh node per message, so a repeated one (\"Added a\", remove, \"Added a\")\n // is announced again.\n const announce = useEvent((text: string) => {\n setAnnouncement((prev) => ({ id: prev.id + 1, text }));\n });\n\n // ---- commit -------------------------------------------------------------\n const rejectionMessage = useEvent((rejection: Rejection) => {\n if (rejection.message) return rejection.message;\n\n switch (rejection.reason) {\n case 'duplicate':\n return t('tagInput.duplicateValue', '\"{{value}}\" is already added', {\n value: rejection.text,\n });\n case 'unknown':\n return t('tagInput.unknownValue', '\"{{value}}\" is not in the list', {\n value: rejection.text,\n });\n case 'unavailable':\n return t('tagInput.unavailableValue', '\"{{value}}\" is not available', {\n value: rejection.text,\n });\n case 'limit':\n return t('tagInput.limitReached', 'You can add up to {{count}}', {\n count: maxTags,\n });\n default:\n return t('tagInput.invalidValue', '\"{{value}}\" is not a valid value', {\n value: rejection.text,\n });\n }\n });\n\n // Refused parts go back to the input joined by a delimiter, so they split\n // back into the same values. A line break cannot join them: the input drops\n // it. Typing a delimiter always leaves one to join with.\n const joinDelimiter = delimiters.find(\n (delimiter) => delimiter && !LINE_BREAK.test(delimiter),\n );\n const joiner = joinDelimiter ? `${joinDelimiter} ` : ' ';\n\n // Without the field chrome there is no field wrapper to show the message, so\n // a rejection is announced instead.\n const hasFieldMessage = rendersFieldChrome(props);\n\n /**\n * Turns typed parts into values. Accepted parts become chips. Refused ones\n * come back as text for the input, with a message, except a duplicate: it is\n * a chip already, and the message says so. With no delimiter to join them,\n * only the first refused part comes back, since glued together they would\n * commit as one value nobody typed. A row picked from the list says where it\n * comes from (`source`), so it is never matched to another option.\n */\n const commitParts = useEvent((parts: string[], source?: CommitSource) => {\n if (!parts.length) return '';\n\n const rules: TagRules = {\n disabledKeys: disabledKeySet,\n isOptionOnly: hasOptions && !allowsCustomValue,\n maxTags,\n validateTag,\n };\n const present = new Set(uniqueValues);\n const accepted: string[] = [];\n const rejected: Rejection[] = [];\n\n for (const part of parts) {\n // Only text of its own is rewritten; an option keeps its key.\n const { optionKey, typed } = resolvePart(part, source);\n\n if (!typed) continue;\n\n const nextValue = optionKey ?? typed;\n const rejection = getRejection(nextValue, optionKey, present, rules);\n\n if (rejection) {\n rejected.push({ text: part, ...rejection });\n continue;\n }\n\n present.add(nextValue);\n accepted.push(nextValue);\n }\n\n const returned = rejected.filter(\n (rejection) => rejection.reason !== 'duplicate',\n );\n const kept = joinDelimiter ? returned : returned.slice(0, 1);\n // The message is about the text left in the input, if there is any.\n const shown = kept[0] ?? rejected[0];\n const error = shown ? rejectionMessage(shown) : null;\n const messages: string[] = [];\n\n if (accepted.length) {\n rememberLabels(accepted);\n setValues([...uniqueValues, ...accepted]);\n messages.push(\n t('tagInput.added', 'Added {{value}}', {\n value: formatList(accepted.map(getTagLabel)),\n }),\n );\n }\n\n if (error && !hasFieldMessage) messages.push(error);\n if (messages.length) announce(messages.join(' '));\n\n setTagError(error);\n\n return kept.map((rejection) => rejection.text).join(joiner);\n });\n\n /** Commits the typed text and returns what is left in the input. */\n const commitDraft = useEvent(() => {\n const rest = commitParts(splitTagText(draft, delimiters));\n\n setDraft(rest);\n\n return rest;\n });\n\n // Focusing the row itself tells the tag group which chip is focused, as a\n // click would.\n const focusLastTag = useEvent(() => {\n const rows = tagListRef.current?.querySelectorAll<HTMLElement>(\n '[role=\"row\"]:not([aria-disabled=\"true\"])',\n );\n\n rows?.[rows.length - 1]?.focus();\n });\n\n const removeValues = useEvent((requested: string[]) => {\n const keys = requested.filter((key) => !isTagLocked(key));\n\n if (!keys.length) return;\n\n const removed = new Set(keys);\n const next = uniqueValues.filter((value) => !removed.has(value));\n\n // Focus leaves the list before the last chip it can land on unmounts under\n // it; locked chips take no focus.\n if (!next.some((value) => !isTagLocked(value))) {\n inputRef.current?.focus();\n }\n\n setValues(next);\n setTagError(null);\n announce(\n t('tagInput.removed', 'Removed {{value}}', {\n value: formatList(keys.map(getTagLabel)),\n }),\n );\n });\n\n /**\n * Picks an option in the popover, or unpicks one that already is a chip. The\n * popover stays open for the next pick, and the query is cleared so the full\n * list is back. A picked row is never swapped for an option with a similar\n * or the same text. A custom value's row is still the user's own text, so\n * `normalizeTag` and `validateTag` apply to it. The typed text's row is the\n * typed text, so it commits as a delimiter would.\n */\n const toggleOption = useEvent((key: string) => {\n if (isTagLocked(key)) return;\n\n const source: CommitSource =\n getOption(key) != null\n ? 'option'\n : customValueKeys.includes(key)\n ? 'custom'\n : 'text';\n\n setTagError(null);\n\n if (uniqueValues.includes(key)) {\n removeValues([key]);\n setDraft('');\n\n if (customValueKeys.includes(key)) {\n setUnpickedCustomValues((prev) =>\n prev.includes(key) ? prev : [...prev, key],\n );\n }\n } else if (!commitParts([key], source)) {\n // An accepted pick clears the query. A refused one (past `maxTags`)\n // keeps it, next to the message saying why.\n setDraft('');\n }\n });\n\n // A click in the popover list. The list reports its whole new selection, so\n // compare it with the chips to find the option that changed.\n const handlePopoverSelection = useEvent(\n (selection: Key | Key[] | null | 'all') => {\n if (!Array.isArray(selection)) return;\n\n const next = new Set(selection.map(String));\n const changed = [\n ...[...next].filter((key) => !uniqueValues.includes(key)),\n ...uniqueValues.filter(\n (value) =>\n !next.has(value) &&\n (getOption(value) != null || visibleCustomKeys.includes(value)),\n ),\n ];\n\n changed.forEach(toggleOption);\n\n // The click moved the list's focus to the option; the input's\n // `aria-activedescendant` follows it.\n const clicked = changed[changed.length - 1];\n\n if (clicked != null) {\n listStateRef.current?.selectionManager.setFocusedKey(clicked);\n // The pick clears the text.\n setActiveOption({ key: clicked, term: '', source: 'user' });\n }\n\n // A click can take DOM focus off the input; keep typing where it was.\n setTimeout(() => inputRef.current?.focus(), 0);\n },\n );\n\n // ---- keyboard -----------------------------------------------------------\n // Set while Tab moves focus out of the input, so the blur can tell a Tab to\n // the chips (commit the text) from a click on a remove button (keep it).\n const isTabbingRef = useRef(false);\n\n const handleArrowKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (!hasOptions) return;\n\n e.preventDefault();\n\n // A closed list, or one that only says nothing matches, opens with every\n // option.\n if (!shouldShowPopover || !hasResults) {\n if (!hasResults) setIsFilterActive(false);\n setIsPopoverOpen(true);\n\n return;\n }\n\n const listState = listStateRef.current;\n\n if (listState) {\n moveVirtualFocus(\n getNextVisibleKey(listState, e.key === 'ArrowDown' ? 1 : -1),\n 'user',\n term,\n );\n }\n });\n\n const handleEdgeKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const listState = listStateRef.current;\n\n if (listState) {\n moveVirtualFocus(\n getEdgeVisibleKey(listState, e.key === 'Home' ? 'first' : 'last'),\n 'user',\n term,\n );\n }\n });\n\n // Backspace in an empty input moves to the last chip instead of removing it,\n // which below the input would be out of view. The chip comes into view with\n // focus and says it is removable; the next Backspace removes it and moves to\n // the one before. Inside the box, the arrow past the start of the text goes\n // there too.\n const handleToTagsKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingKey(e)) return;\n\n e.preventDefault();\n\n // A held key that just emptied the input, or brought the caret to its\n // start, stops there, so it does not run on into the chips.\n if (e.repeat) return;\n\n setIsPopoverOpen(false);\n focusLastTag();\n });\n\n const handleEnterKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingKey(e)) return;\n\n // The announced option, unless the text changed since it was chosen and\n // its focus pass has not run yet: then the best match for this text.\n const isCurrent = activeOption != null && activeOption.term === term;\n const targetKey = shouldShowPopover\n ? isCurrent\n ? activeOption.key\n : preferredOptionKey\n : null;\n\n if (targetKey != null) {\n e.preventDefault();\n\n const key = String(targetKey);\n\n // Typed text means \"add\". An option that is already a chip is refused\n // as a duplicate and the text cleared, as a comma or blur would;\n // unpicking one takes the arrows, a click, or an empty input.\n if (\n term &&\n uniqueValues.includes(key) &&\n !(isCurrent && activeOption.source === 'user')\n ) {\n setDraft('');\n setTagError(\n rejectionMessage({\n text: getTagLabel(key),\n reason: 'duplicate',\n }),\n );\n\n return;\n }\n\n toggleOption(key);\n\n return;\n }\n\n // Enter is for adding values and never submits a form, even with nothing\n // typed: pressing it once more after the last value must not send a\n // half-filled dialog.\n e.preventDefault();\n\n if (term) commitDraft();\n });\n\n const handleDelimiterKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingKey(e)) return;\n\n e.preventDefault();\n\n // The separator splits the text where it is typed: what comes before the\n // caret is committed, what comes after stays in the input.\n const el = e.currentTarget;\n const start = el.selectionStart ?? draft.length;\n const end = el.selectionEnd ?? start;\n const rejected = commitParts(\n splitTagText(draft.slice(0, start), delimiters),\n );\n\n setDraft(\n [rejected, draft.slice(end).trimStart()].filter(Boolean).join(joiner),\n );\n });\n\n // Escape takes back one thing at a time: the list, then the text. A message\n // goes with either, or on its own when the input is already empty, as after\n // a refused duplicate.\n const handleEscapeKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (shouldShowPopover) {\n e.preventDefault();\n e.stopPropagation();\n setIsPopoverOpen(false);\n setTagError(null);\n } else if (draft || tagError) {\n e.preventDefault();\n e.stopPropagation();\n setDraft('');\n setTagError(null);\n // It may be open but hidden with nothing to list; options that arrive\n // later must not open it once the text is gone.\n setIsPopoverOpen(false);\n }\n });\n\n const handleKeyDown = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n\n if (!e.defaultPrevented && isInteractive) {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n handleArrowKey(e);\n } else if ((e.key === 'Home' || e.key === 'End') && shouldShowPopover) {\n handleEdgeKey(e);\n } else if (\n (e.key === 'Backspace'\n ? !draft\n : tagPlacement === 'inside' && isArrowPastStart(e, textDirection)) &&\n uniqueValues.some((value) => !isTagLocked(value))\n ) {\n handleToTagsKey(e);\n } else if (e.key === 'Enter') {\n handleEnterKey(e);\n } else if (delimiters.includes(e.key)) {\n handleDelimiterKey(e);\n } else if (e.key === 'Escape') {\n handleEscapeKey(e);\n }\n }\n\n // A Tab the consumer or a delimiter prevented moves no focus.\n isTabbingRef.current = e.key === 'Tab' && !e.defaultPrevented;\n\n // A prevented `Escape` or `Tab`, the caller's or a delimiter's, stays\n // here, so a surrounding dialog neither closes nor moves focus on it.\n settleOverlayKey(e);\n });\n\n // A separator can also arrive without a key press: autocorrect, IME, drag and\n // drop. Commit everything before the last separator and keep the rest typed.\n const handleInputChange = useEvent((next: string) => {\n setTagError(null);\n rememberLabels(uniqueValues);\n\n const pattern = delimiterPattern(delimiters);\n const parts = pattern ? next.split(pattern) : [next];\n\n let nextDraft = next;\n\n if (parts.length > 1) {\n const rest = (parts.pop() ?? '').trimStart();\n const rejected = commitParts(\n parts.map((part) => part.trim()).filter(Boolean),\n );\n\n nextDraft = [rejected, rest].filter(Boolean).join(joiner);\n }\n\n setDraft(nextDraft);\n\n if (hasOptions && popoverTrigger !== 'manual' && nextDraft.trim()) {\n setIsPopoverOpen(true);\n }\n });\n\n // An `<input>` drops line breaks from pasted text, so split a pasted list\n // here, where they are still visible.\n const handlePaste = useEvent((e: ClipboardEvent<HTMLInputElement>) => {\n if (!isInteractive) return;\n\n const pasted = e.clipboardData.getData('text');\n\n if (!pasted || splitTagText(pasted, delimiters).length < 2) return;\n\n e.preventDefault();\n\n const el = e.currentTarget;\n const start = el.selectionStart ?? draft.length;\n const end = el.selectionEnd ?? draft.length;\n\n setTagError(null);\n setDraft(\n commitParts(\n splitTagText(\n `${draft.slice(0, start)}\\n${pasted}\\n${draft.slice(end)}`,\n delimiters,\n ),\n ),\n );\n });\n\n // ---- focus --------------------------------------------------------------\n // What leaving the input does to the typed text. Returns the text left.\n const settleDraft = useEvent((): string => {\n if (!term) return '';\n if (!shouldCommitOnBlur || !isInteractive) return draft;\n\n if (hasOptions && !allowsCustomValue && termOptionKey == null) {\n // Leaving a filter query behind is not an entry: drop it, as ComboBox\n // does with text that matches no option.\n setDraft('');\n setTagError(null);\n\n return '';\n }\n\n return commitDraft();\n });\n\n const handleCompositeFocus = useEvent(() => {\n cancelPendingClear();\n onFocus?.();\n });\n\n const handleCompositeBlur = useEvent(({ isPressing }: CompositeBlurInfo) => {\n setIsPopoverOpen(false);\n setUnpickedCustomValues([]);\n\n const wasShowingMessage = tagError != null;\n\n // A message can only be about text in the input. Once none is left, as\n // after a refused duplicate, the field does not stay marked invalid.\n if (!settleDraft()) {\n // One set while settling is cleared in the same render, and never shows.\n if (isPressing && wasShowingMessage) clearTagErrorAfterPress();\n else setTagError(null);\n }\n\n onBlur?.();\n });\n\n const { compositeFocusProps } = useCompositeFocus({\n wrapperRef: rootRef as RefObject<HTMLElement>,\n popoverRef: popoverRef as RefObject<HTMLElement>,\n onFocus: handleCompositeFocus,\n onBlur: handleCompositeBlur,\n isDisabled,\n });\n\n // Moving from the input to the chips stays inside the component, so the\n // composite blur never fires: close the popover on the way, as Backspace\n // does. A press on a chip or its remove button needs this too: inside the\n // box the chips are part of the popover's trigger, so the press is not an\n // outside one. Tab also settles the text; a press keeps it. The clear button\n // and the chevron hand focus back to the input, and are left alone.\n const handleInputBlur = useEvent((e: FocusEvent<HTMLInputElement>) => {\n const isTabbing = isTabbingRef.current;\n const next = e.relatedTarget as Node | null;\n\n isTabbingRef.current = false;\n\n if (!next || !rootRef.current?.contains(next)) return;\n if (!isTabbing && !tagListRef.current?.contains(next)) return;\n\n setIsPopoverOpen(false);\n\n if (isTabbing) settleDraft();\n });\n\n const handleInputFocus = useEvent(() => {\n if (hasOptions && popoverTrigger === 'focus' && isInteractive) {\n setIsPopoverOpen(true);\n }\n });\n\n // A press in the input opens a closed list, as in ComboBox, focused or not:\n // after Tab, or after Escape closed it. So does a press on the box around\n // the input, which the box hands to the input; one on a chip or a button\n // stays theirs. The field's label forwards its own click to the input with\n // no pointerdown in the box, and that click only focuses. The list shows the\n // options the typed text leaves, and text that matches nothing keeps it\n // closed, so a press that moves the caret does not change what Enter adds.\n const pressStartedInBoxRef = useRef(false);\n\n const handleBoxPointerDown = (e: PointerEvent<HTMLElement>) => {\n const box = e.currentTarget;\n const target = e.target as Element;\n const interactive = target.closest(INTERACTIVE_ELEMENTS);\n\n pressStartedInBoxRef.current =\n box.contains(target) &&\n (!interactive ||\n interactive === inputRef.current ||\n !box.contains(interactive));\n };\n\n const handleBoxClick = () => {\n const isBoxPress = pressStartedInBoxRef.current;\n\n pressStartedInBoxRef.current = false;\n\n if (!isBoxPress || popoverTrigger === 'manual') return;\n\n if (hasOptions && isInteractive && !shouldShowPopover && hasResults) {\n setIsPopoverOpen(true);\n }\n };\n\n // ---- chips --------------------------------------------------------------\n const tags: TagListEntry[] = uniqueValues.map((value) => {\n const ownProps = tagProps?.(value);\n const isOption = getOption(value) != null || knownLabels.has(value);\n const result = !isOption && validateTag ? validateTag(value) : true;\n const label = textLabel(ownProps?.children) ?? getOptionLabel(value);\n\n return {\n key: value,\n label,\n // Put in words as well as in color, for the chip's description.\n invalidMessage:\n typeof result === 'string'\n ? result\n : result === false\n ? t('tagInput.invalidValue', '\"{{value}}\" is not a valid value', {\n value: label,\n })\n : undefined,\n tagProps: ownProps,\n isDisabled: !!ownProps?.isDisabled,\n };\n });\n\n const effectiveIsInvalid = tagError ? true : isInvalid;\n const hasRemovableTags = tags.some((tag) => !tag.isDisabled);\n // Backspace in an empty input is how the keyboard gets to the chips without\n // Tab; nothing on screen says so.\n const hasBackspaceHint = isInteractive && hasRemovableTags;\n\n // A locked value's option stays checked but cannot be unpicked.\n const lockedKeys = tags.filter((tag) => tag.isDisabled).map((tag) => tag.key);\n const optionDisabledKeys = lockedKeys.length\n ? [...disabledKeySet, ...lockedKeys]\n : disabledKeys;\n\n // ---- input --------------------------------------------------------------\n const { labelProps, inputProps } = useTextField(\n {\n ...otherProps,\n id,\n label,\n value: draft,\n placeholder: shownPlaceholder(\n placeholder,\n hidePlaceholderWithTags,\n tags.length,\n ),\n isDisabled,\n isReadOnly,\n isRequired,\n isInvalid: effectiveIsInvalid,\n autoFocus,\n onChange: handleInputChange,\n } as never,\n inputRef,\n );\n // Names the chips, the buttons and the options after the field: \"Selected\n // values Also send to\", rather than the same words for every field on the\n // page. The ids go in the order the input reads them: the visible label,\n // then `aria-labelledby`.\n const ariaLabel = (props as { 'aria-label'?: string })['aria-label'];\n const ariaLabelledby = (props as { 'aria-labelledby'?: string })[\n 'aria-labelledby'\n ];\n const labelId = label ? (labelProps.id as string | undefined) : undefined;\n const fieldLabelledby =\n [labelId, ariaLabelledby].filter(Boolean).join(' ') || undefined;\n // An `aria-label` has no element to point at, so its words are joined into\n // each part's own name instead, ahead of the ids. That is the input's order\n // too: given `aria-label` with a `label` or `aria-labelledby`, React Aria\n // puts the input's own id first in its `aria-labelledby`, so it reads\n // \"Values Primary key\" and the chips \"Selected values, Values Primary key\".\n\n // Joined, not replaced: the input keeps any description it already has.\n const describedBy: string[] = [];\n\n if (inputProps['aria-describedby']) {\n describedBy.push(inputProps['aria-describedby']);\n }\n if (tags.length) describedBy.push(summaryId);\n if (hasBackspaceHint) describedBy.push(hintId);\n\n const tagInputProps = mergeProps(\n inputProps,\n {\n onKeyDown: handleKeyDown,\n onPaste: handlePaste,\n onBlur: handleInputBlur,\n onFocus: handleInputFocus,\n autoComplete,\n 'data-input-type': 'taginput',\n 'aria-describedby': describedBy.join(' ') || undefined,\n },\n hasOptions\n ? getComboboxProps(listBoxId, shouldShowPopover, activeOptionKey)\n : undefined,\n );\n\n const handleTriggerPress = useEvent(() => {\n const willOpen = !shouldShowPopover;\n\n // Focus first: a press that took focus to the button brings it back to the\n // input, and with `popoverTrigger=\"focus\"` that focus opens the list. The\n // button's own choice is set after it, so it wins.\n inputRef.current?.focus();\n\n if (willOpen && !hasResults) setIsFilterActive(false);\n\n setIsPopoverOpen(willOpen);\n });\n\n const trigger =\n hasOptions && !hideTrigger ? (\n <TagInputTrigger\n id={triggerId}\n size={size}\n ariaLabel={ariaLabel}\n fieldLabelledby={fieldLabelledby}\n isOpen={shouldShowPopover}\n isDisabled={!isInteractive}\n isLoading={isLoading}\n styles={triggerStyles}\n onPress={handleTriggerPress}\n />\n ) : null;\n\n // Clears the whole field: the typed text and every chip but the locked ones.\n // Escape clears only the text, so a stray key press never loses the values.\n const clearAll = useEvent(() => {\n // The button goes away with what it clears; keep focus in the field.\n // Focus first, so a `popoverTrigger=\"focus\"` open does not outlast it.\n inputRef.current?.focus();\n setDraft('');\n setIsPopoverOpen(false);\n removeValues(uniqueValues);\n setTagError(null);\n onClear?.();\n });\n\n const canClear =\n !!isClearable && isInteractive && (draft !== '' || hasRemovableTags);\n const clearButton = canClear ? (\n <TagInputClearButton\n id={clearId}\n size={size}\n ariaLabel={ariaLabel}\n fieldLabelledby={fieldLabelledby}\n onPress={clearAll}\n />\n ) : null;\n\n // Not a bare fragment: an empty one would still mark the input as having a\n // suffix.\n const hasActions = clearButton != null || trigger != null;\n\n useSuffixSpace(wrapperRef, tagPlacement === 'inside');\n\n const partStyles = getPlacementStyles(tagPlacement, {\n wrapper: wrapperStyles,\n input: inputStyles,\n tagList: tagListStyles,\n tag: tagStyles,\n });\n\n const tagList = tags.length ? (\n <TagList\n id={tagListId}\n listRef={tagListRef}\n inputRef={inputRef}\n aria-label={\n ariaLabel\n ? t('tagInput.selectedValuesFor', 'Selected values, {{label}}', {\n label: ariaLabel,\n })\n : t('tagInput.selectedValues', 'Selected values')\n }\n aria-labelledby={fieldLabelledby}\n tags={tags}\n size={TAG_SIZES[size] ?? 'xsmall'}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInline={tagPlacement === 'inside'}\n styles={partStyles.tagList}\n tagStyles={partStyles.tag}\n onRemove={removeValues}\n />\n ) : null;\n\n const placed = placeTagList(tagPlacement, prefix, tagList);\n\n const tagInputField = (\n <TagInputElement\n ref={rootRef}\n {...pickBaseCustomizationProps(props)}\n mods={mods}\n styles={styles}\n {...compositeFocusProps}\n >\n <TextInputBase\n isBare\n qa={qa || 'TagInput'}\n inputRef={inputRef}\n wrapperRef={wrapperRef}\n wrapperProps={{\n onPointerDown: handleBoxPointerDown,\n onClick: handleBoxClick,\n }}\n inputProps={tagInputProps}\n mods={mods}\n icon={icon}\n prefix={placed.prefix}\n suffix={suffix}\n suffixPosition={suffixPosition}\n actions={\n hasActions ? (\n <>\n {clearButton}\n {trigger}\n </>\n ) : null\n }\n size={size}\n autoFocus={autoFocus}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isLoading={isLoading}\n isInvalid={effectiveIsInvalid}\n isValid={isValid}\n styles={partStyles.wrapper}\n inputStyles={partStyles.input}\n />\n {placed.below}\n {/* Read only as the input's description, never on its own in browse mode. */}\n <span hidden id={summaryId}>\n {tags.length\n ? t('tagInput.summary', 'Selected: {{values}}.', {\n values: formatList(tags.map((tag) => tag.label)),\n })\n : null}\n </span>\n <span hidden id={hintId}>\n {hasBackspaceHint\n ? t(\n 'tagInput.backspaceHint',\n 'Press Backspace to go to the selected values.',\n )\n : null}\n </span>\n <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n <span key={announcement.id}>{announcement.text}</span>\n </VisuallyHidden>\n {hasOptions ? (\n <ListBoxPopover\n isOpen={shouldShowPopover}\n triggerRef={wrapperRef as RefObject<HTMLElement>}\n popoverRef={popoverRef}\n listBoxRef={listBoxRef}\n direction={direction}\n shouldFlip={shouldFlip}\n overlayOffset={overlayOffset}\n containerPadding={containerPadding}\n comboBoxWidth={popoverMinWidth}\n listBoxId={listBoxId}\n overlayStyles={overlayStyles}\n listBoxStyles={listBoxStyles}\n optionStyles={optionStyles}\n optionHighlight={isFilterActive ? term : undefined}\n emptyLabel={resolveEmptyLabel(emptyLabel, isLoading, t)}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n selectionMode=\"multiple\"\n selectedKeys={uniqueValues}\n isCheckable\n // Clicking back into the input keeps the list open for the next pick.\n shouldCloseOnTriggerInteraction={false}\n isDisabled={isDisabled}\n disabledKeys={optionDisabledKeys}\n listStateRef={listStateRef}\n // The ids the input reads, the visible label's among them, so the\n // list reads as the input does, a label that is not a string too.\n ariaLabel={ariaLabel}\n ariaLabelledby={fieldLabelledby}\n compositeFocusProps={compositeFocusProps}\n filter={optionFilterFn}\n size={size}\n onSelectionChange={handlePopoverSelection}\n onClose={() => setIsPopoverOpen(false)}\n >\n {popoverChildren}\n </ListBoxPopover>\n ) : null}\n </TagInputElement>\n );\n\n const { children: _children, ...fieldProps } = props;\n\n return wrapWithField(tagInputField, {\n ...(fieldProps as Omit<CubeTagInputProps<T>, 'children'>),\n ...field,\n labelProps: mergeProps(labelProps, userLabelProps),\n isInvalid: effectiveIsInvalid,\n // A rejected entry speaks for itself until the text is edited. Keyed, so\n // the same rejection twice in a row is announced twice.\n message: tagError ? (\n <span key={tagError.id}>{tagError.text}</span>\n ) : (\n message\n ),\n errorMessage: tagError ? undefined : errorMessage,\n });\n}\n\n/**\n * A field for a list of values, shown as removable chips below a single-line\n * input. Values are typed (Enter or a separator commits them) or picked from\n * suggested options.\n */\nconst _TagInput = forwardRef(TagInput) as unknown as (<T extends object>(\n props: WithNullableValue<CubeTagInputProps<T>> & {\n ref?: ForwardedRef<HTMLDivElement>;\n },\n) => ReactElement) & {\n Item: typeof Item;\n Section: typeof BaseSection;\n};\n\nObject.assign(_TagInput, {\n Item,\n Section: BaseSection,\n displayName: 'TagInput',\n});\n\n// The legacy `<Field>` picks its value mapper from this. The `CheckboxGroup`\n// mapper is the one for an array value: `[]` when empty, validated on change.\nObject.defineProperty(_TagInput, 'cubeInputType', {\n value: 'CheckboxGroup',\n enumerable: false,\n configurable: false,\n});\n\nexport { _TagInput as TagInput };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,MAAMwE,wBAAkC;AAMxC,MAAME,uBACJ;AAoNF,MAAMkE,kBAAkBtI,MAAM;CAC5BuI,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,KAAK;CACP;AACF,CAAC;AAKD,MAAMC,YAAkD;CACtDE,OAAO;CACPC,QAAQ;CACRC,OAAO;AACT;AAMA,MAAMC,wBAAgC;CACp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A;CAAA,uBAsLU,IAAIc,IAAI;AAAC;AAtLnB,SAAA/E,MAAArB,IAAA;CAOuB,MAAA,EAAAtO,OAAAE,aAAAoO;CAAmB,OAAM;EAAAtO,OACnCA,SAAA,CAAA;EAAWE;CAEpB;AAAC;AAyuCL,MAAMoiB,YAAYxmB,WAAWwT,QAAQ;AASrCiT,OAAOC,OAAOF,WAAW;CACvBvkB,MAAAA;CACShB;CACT0lB,aAAa;AACf,CAAC;AAIDF,OAAOG,eAAeJ,WAAW,iBAAiB;CAChDtiB,OAAO;CACP2iB,YAAY;CACZC,cAAc;AAChB,CAAC"}
1
+ {"version":3,"file":"TagInput.js","names":["useControlledState","Node","CollectionNode","Key","mergeStyles","Styles","tasty","ClipboardEvent","cloneElement","FocusEvent","ForwardedRef","forwardRef","isValidElement","KeyboardEvent","PointerEvent","ReactElement","ReactNode","RefObject","useEffect","useMemo","useRef","useState","useFilter","useId","useLocale","useTextField","VisuallyHidden","Section","BaseSection","useListState","useEvent","useFormatter","useI18n","CloseIcon","DirectionIcon","generateRandomId","mergeProps","castNullableArrayValue","WithNullableValue","settleOverlayKey","pickBaseCustomizationProps","useCombinedRefs","ItemAction","CollectionItem","Item","withFieldChrome","FieldLayoutStyleProps","splitFieldLayout","useFieldProps","rendersFieldChrome","wrapWithField","getListBoxOptionId","ListBoxPopover","collectVisibleKeys","filterCollectionNodes","getEdgeVisibleKey","getNextVisibleKey","ListStateLike","useCompositeFocus","getIdentifierTextServices","CubeIdentifierInputProps","TextInputBase","TagList","TagListEntry","useActiveOption","useSuffixSpace","useTagError","FieldBaseProps","ComponentBasePropsWithoutChildren","CubeTagProps","CompositeBlurInfo","FilterFn","textValue","inputValue","showEveryOption","TagInputPopoverTrigger","INTERACTIVE_ELEMENTS","TagValidationResult","CubeTagInputProps","value","defaultValue","onChange","defaultInputValue","onInputChange","placeholder","hidePlaceholderWithTags","autoComplete","inputMode","enterKeyHint","onFocus","onBlur","onKeyDown","e","HTMLInputElement","delimiters","validateTag","normalizeTag","maxTags","shouldCommitOnBlur","isClearable","onClear","items","Iterable","T","children","item","allowsCustomValue","filter","disabledKeys","popoverTrigger","emptyLabel","onOpenChange","isOpen","hideTrigger","direction","shouldFlip","overlayOffset","containerPadding","tagProps","Partial","icon","prefix","suffix","suffixPosition","size","tagPlacement","inputRef","wrapperRef","HTMLDivElement","popoverRef","listBoxRef","wrapperStyles","inputStyles","tagListStyles","tagStyles","triggerStyles","overlayStyles","listBoxStyles","optionStyles","sectionStyles","headingStyles","listGap","TagInputElement","qa","styles","display","flow","gap","TAG_SIZES","Record","small","medium","large","INSIDE_WRAPPER_STYLES","placeItems","height","padding","backgroundClip","Prefix","Suffix","position","alignSelf","margin","marginLeft","INSIDE_INPUT_STYLES","flexGrow","flexBasis","fieldSizing","textOverflow","width","INSIDE_TAG_LIST_STYLES","INSIDE_TAG_STYLES","$size","PartStyles","wrapper","input","tagList","tag","getPlacementStyles","placement","own","shownPlaceholder","hideWithTags","tagCount","undefined","isListShown","hasResults","term","isLoading","resolveEmptyLabel","t","ReturnType","placeTagList","below","DEFAULT_DELIMITERS","LINE_BREAK","escapeRegExp","text","replace","delimiterPattern","RegExp","separators","Boolean","map","length","join","splitTagText","pattern","source","split","part","trim","textLabel","node","textCollator","Intl","Collator","sensitivity","textSorter","numeric","isSameText","a","b","compare","compareText","OptionMatch","exact","loose","matchOptionText","collection","byKey","nodes","type","childNodes","child","key","String","label","withCustomOptions","customKeys","customTerm","hasOptionRows","hasSections","optionsLabel","customValuesLabel","customOptions","push","customSection","Array","isArray","CustomRows","keys","visibleKeys","typedKey","NO_CUSTOM_ROWS","getCustomRows","values","unpicked","isOption","isFiltering","matches","termOptionKey","Set","sort","includes","getExactRowKey","customValueKeys","some","getPreferredRowKey","rows","exactKey","firstNew","find","isComposingKey","nativeEvent","isComposing","keyCode","isArrowPastStart","selectionStart","selectionEnd","currentTarget","shiftKey","altKey","ctrlKey","metaKey","RejectionReason","Rejection","reason","message","CommitSource","TagRules","ReadonlySet","isOptionOnly","getRejection","optionKey","present","Omit","has","result","getComboboxProps","listBoxId","activeKey","role","FieldButtonProps","id","ariaLabel","fieldLabelledby","onPress","TagInputTrigger","t0","$","_c","isDisabled","t1","t2","t3","t4","pressed","loading","t5","t6","t7","TagInputClearButton","Symbol","for","TagInput","props","ref","defaultValidationTrigger","valuePropsMapper","_temp","formatList","textDirection","valueProp","onChange_0","inputValueProp","autoFocus","isIdentifier","renderChildren","t8","t9","t10","t11","isReadOnly","isRequired","isInvalid","isValid","errorMessage","inputRefProp","wrapperRefProp","popoverRefProp","listBoxRefProp","labelProps","userLabelProps","mods","name","form","otherProps","field","rootRef","tagListRef","listStateRef","t12","tagInputId","tagListId","summaryId","hintId","triggerId","clearId","setValues","uniqueValues","draft","setDraftState","tagError","setTagError","clearTagErrorAfterPress","cancelPendingClear","t13","announcement","setAnnouncement","from","index","rendered","hasOptions","localCollectionState","selectionMode","t14","getItem","getOption","t15","contains","textFilterFn","isFilterActive","setIsFilterActive","knownLabels","setKnownLabels","_temp2","t16","key_0","get","getOptionLabel","getTagLabel","key_1","isTagLocked","key_2","disabledKeySet","t17","next","key_3","label_0","Map","set","rememberLabels","findOptionKey","match","resolveTypedText","text_0","typed","resolvePart","t18","optionFilterFn","keep","node_0","visibleOptionKeys","t19","unpickedCustomValues","setUnpickedCustomValues","visibleCustomKeys","value_0","popoverChildren","_temp3","visibleOptionsSignature","isPopoverOpen","setIsPopoverOpen","isInteractive","shouldShowPopover","notifiedOpenRef","current","visibleTargetKeys","preferredOptionKey","activeOption","setActiveOption","moveVirtualFocus","popoverMinWidth","activeOptionKey","t20","next_0","setDraft","t21","text_1","prev","announce","rejectionMessage","rejection","count","joinDelimiter","_temp4","joiner","hasFieldMessage","commitParts","parts","source_0","rules","accepted","rejected","part_0","optionKey_0","typed_0","nextValue","rejection_0","add","returned","_temp5","kept","slice","shown","error","messages","_temp6","commitDraft","rest","t22","querySelectorAll","focus","focusLastTag","removeValues","requested","keys_0","key_4","removed","next_1","value_1","value_2","toggleOption","key_5","source_1","prev_0","handlePopoverSelection","selection","next_2","changed","key_6","value_3","forEach","clicked","selectionManager","setFocusedKey","setTimeout","isTabbingRef","handleArrowKey","preventDefault","listState","handleEdgeKey","e_0","listState_0","t23","e_1","repeat","handleToTagsKey","handleEnterKey","e_2","isCurrent","targetKey","key_7","handleDelimiterKey","e_3","el","start","end","rejected_0","trimStart","handleEscapeKey","e_4","stopPropagation","handleKeyDown","e_5","defaultPrevented","value_4","handleInputChange","next_3","parts_0","nextDraft","rest_0","pop","rejected_1","_temp7","handlePaste","e_6","pasted","clipboardData","getData","el_0","start_0","end_0","settleDraft","handleCompositeFocus","handleCompositeBlur","t24","isPressing","wasShowingMessage","compositeFocusProps","HTMLElement","t25","e_7","isTabbing","next_4","relatedTarget","handleInputBlur","handleInputFocus","pressStartedInBoxRef","t26","e_8","box","target","Element","interactive","closest","handleBoxPointerDown","handleBoxClick","isBoxPress","tags","value_5","ownProps","label_1","invalidMessage","effectiveIsInvalid","hasRemovableTags","_temp8","hasBackspaceHint","lockedKeys","_temp9","_temp0","optionDisabledKeys","inputProps","ariaLabelledby","labelId","describedBy","tagInputProps","onPaste","handleTriggerPress","willOpen","trigger","clearAll","canClear","clearButton","hasActions","partStyles","placed","t27","onPointerDown","onClick","t28","t29","_temp1","t30","t31","t32","t33","tagInputField","_children","fieldProps","tag_2","tag_1","tag_0","part_1","rejection_2","rejection_1","delimiter","test","node_1","_TagInput","Object","assign","displayName","defineProperty","enumerable","configurable","Item","BaseSection","_c","tagInputId","useId","mergeProps","TextInputBase"],"sources":["../../../../src/components/fields/TagInput/TagInput.tsx"],"sourcesContent":["import { useControlledState } from '@react-stately/utils';\nimport { Node as CollectionNode, Key } from '@react-types/shared';\nimport { mergeStyles, Styles, tasty } from '@tenphi/tasty';\nimport {\n ClipboardEvent,\n cloneElement,\n FocusEvent,\n ForwardedRef,\n forwardRef,\n isValidElement,\n KeyboardEvent,\n PointerEvent,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n useFilter,\n useId,\n useLocale,\n useTextField,\n VisuallyHidden,\n} from 'react-aria';\nimport { Section as BaseSection, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useFormatter } from '../../../i18n/useFormatter';\nimport { useI18n } from '../../../i18n/useI18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { generateRandomId } from '../../../utils/random';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport {\n castNullableArrayValue,\n WithNullableValue,\n} from '../../../utils/react/nullableValue';\nimport { settleOverlayKey } from '../../../utils/react/overlayKeyPropagation';\nimport { pickBaseCustomizationProps } from '../../../utils/react/pickBaseCustomizationProps';\nimport { useCombinedRefs } from '../../../utils/react/useCombinedRefs';\nimport { ItemAction } from '../../actions/ItemAction/ItemAction';\nimport { CollectionItem as Item } from '../../CollectionItem';\nimport { withFieldChrome } from '../../form/field-chrome';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { useFieldProps } from '../../form/Form/use-field/use-field-props';\nimport { rendersFieldChrome, wrapWithField } from '../../form/wrapper';\nimport { getListBoxOptionId } from '../ListBox/optionId';\nimport { ListBoxPopover } from '../ListBoxPopover/ListBoxPopover';\nimport {\n collectVisibleKeys,\n filterCollectionNodes,\n getEdgeVisibleKey,\n getNextVisibleKey,\n ListStateLike,\n} from '../ListBoxPopover/listNavigation';\nimport { useCompositeFocus } from '../ListBoxPopover/useCompositeFocus';\nimport { getIdentifierTextServices } from '../TextInput/identifier-text-services';\nimport {\n CubeIdentifierInputProps,\n TextInputBase,\n} from '../TextInput/TextInputBase';\n\nimport { TagList, TagListEntry } from './TagList';\nimport { useActiveOption } from './useActiveOption';\nimport { useSuffixSpace } from './useSuffixSpace';\nimport { useTagError } from './useTagError';\n\nimport type { FieldBaseProps } from '../../../shared';\nimport type { ComponentBasePropsWithoutChildren } from '../../../utils/react/componentBaseProps';\nimport type { CubeTagProps } from '../../content/Tag/Tag';\nimport type { CompositeBlurInfo } from '../ListBoxPopover';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\n/**\n * `filter={false}`: the options come filtered already, as from a server.\n * Named rather than inline in the ternary that picks it: SonarJS charges a\n * function in a ternary branch to every later line of the component.\n */\nconst showEveryOption: FilterFn = () => true;\n\nexport type TagInputPopoverTrigger = 'focus' | 'input' | 'manual';\n\n// What a press in the input box goes to instead of the input, as in\n// `TextInputBase`: a chip, its remove button, the clear button, the chevron.\nconst INTERACTIVE_ELEMENTS =\n 'a[href], button, input, select, textarea, [tabindex], [contenteditable]';\n\n/**\n * What `validateTag` returns: `true` (or nothing) accepts the value, `false`\n * rejects it with the default message, and a string rejects it with that\n * message.\n */\nexport type TagValidationResult = boolean | string | null | undefined;\n\nexport interface CubeTagInputProps<T = object>\n extends\n ComponentBasePropsWithoutChildren,\n FieldLayoutStyleProps,\n FieldBaseProps<readonly string[] | null | undefined>,\n CubeIdentifierInputProps {\n /** The values in controlled mode. */\n value?: readonly string[];\n /** The initial values in uncontrolled mode. */\n defaultValue?: readonly string[];\n /** Called with the whole new list whenever a value is added or removed. */\n onChange?: (value: string[]) => void;\n\n /** The text being typed, in controlled mode. */\n inputValue?: string;\n /** The initial text in uncontrolled mode. */\n defaultInputValue?: string;\n /** Called when the text being typed changes. */\n onInputChange?: (value: string) => void;\n /** Placeholder text for the input. */\n placeholder?: string;\n /**\n * Whether the placeholder hides once there is a tag, so it only prompts for\n * the first value.\n */\n hidePlaceholderWithTags?: boolean;\n /** HTML `autocomplete` attribute for the input. */\n autoComplete?: string;\n /**\n * Which virtual keyboard the input asks for: `'email'` for addresses,\n * `'decimal'` for numbers. The input stays a text input, so the browser does\n * not validate what is typed.\n */\n inputMode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n /** The label of the virtual keyboard's Enter key. */\n enterKeyHint?:\n 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n /** Called when focus enters the component (input, chips or popover). Receives no event. */\n onFocus?: () => void;\n /**\n * Called when focus leaves the component entirely, after the typed text is\n * committed and before the press that moved focus is handled. Receives no\n * event.\n */\n onBlur?: () => void;\n /**\n * Called when a key is pressed in the input, before the component handles it.\n * Call `e.preventDefault()` to stop the component from handling the key.\n * `Escape` and `Tab` go on to a surrounding dialog unless TagInput acts on\n * them or the handler prevents them.\n */\n onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;\n\n /**\n * Characters that commit the typed text, and that pasted text is split on.\n * Pasted text is also always split on line breaks. Pass `[]` for values that\n * may contain the default separator; only the first of several refused\n * values then stays in the input.\n * @default [',']\n */\n delimiters?: string[];\n /**\n * Checks one value before it becomes a chip. Return `true` or nothing to\n * accept it, `false` to reject it with the default message, or a string to\n * reject it with that message. Also paints existing chips that fail it in the\n * danger theme. Values picked from the options are not checked.\n */\n validateTag?: (value: string) => TagValidationResult;\n /**\n * Rewrites a typed value before it is checked and added: lowercase an\n * address, write a number one way. Duplicates are found after it runs.\n * Return an empty string to drop the value. Values picked from the options\n * are not rewritten.\n */\n normalizeTag?: (value: string) => string;\n /**\n * The most values the field holds. Values past it are refused with a\n * message and stay in the input.\n */\n maxTags?: number;\n /** Whether leaving the field commits the typed text. @default true */\n shouldCommitOnBlur?: boolean;\n /**\n * Whether a button in the input clears the field: the typed text and every\n * chip but the locked ones. It shows while there is something to clear.\n */\n isClearable?: boolean;\n /** Called when the clear button is pressed. */\n onClear?: () => void;\n\n /** Options to suggest, as data. Pair with a render function in `children`. */\n items?: Iterable<T>;\n /**\n * Options to suggest: `TagInput.Item` elements or a render function for\n * `items`. Without options the field accepts any typed value.\n */\n children?: ReactNode | ((item: T) => ReactElement);\n /**\n * Whether typed values that are not among the options are accepted. Only\n * applies when options are given; without options every value is custom.\n * Text that matches an option only in case or accents is then added as\n * typed; without it, that text picks the option.\n * @default false\n */\n allowsCustomValue?: boolean;\n /**\n * Custom filter for the options, or `false` to show every option (for\n * server-side filtering).\n */\n filter?: FilterFn | false;\n /** Keys of options that cannot be picked. */\n disabledKeys?: Iterable<Key>;\n /**\n * When the suggestions popover opens on its own, as in `ComboBox`: `'input'`\n * on typing or a press in the input, `'focus'` on focus as well, `'manual'`\n * only from the chevron and the arrow keys.\n * @default 'input'\n */\n popoverTrigger?: TagInputPopoverTrigger;\n /**\n * What the popover says when no option matches the typed text, or while\n * `isLoading` with no option to show. Defaults to \"No results found\", and\n * to \"Loading…\" while loading.\n */\n emptyLabel?: ReactNode;\n /** Called when the suggestions popover opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Whether to hide the button that toggles the suggestions popover. */\n hideTrigger?: boolean;\n /** Where the suggestions popover opens. @default 'bottom' */\n direction?: 'bottom' | 'top';\n /** Whether the popover flips when there is no room. @default true */\n shouldFlip?: boolean;\n /** Distance between the input and the popover, in pixels. @default 8 */\n overlayOffset?: number;\n /** Minimum space between the popover and the viewport edge, in pixels. @default 8 */\n containerPadding?: number;\n\n /**\n * Props for each chip's `Tag` (theme, icon, label, …), by value. A string\n * `children` also names the value to screen readers. `isDisabled` locks the\n * chip: it cannot be removed.\n */\n tagProps?: (value: string) => Partial<CubeTagProps> | undefined;\n\n /** Left input icon. */\n icon?: ReactElement;\n /** Input decoration before the main input. */\n prefix?: ReactNode;\n /** Input decoration after the main input. */\n suffix?: ReactNode;\n /** Whether the suffix goes before or after the validation and loading icons. */\n suffixPosition?: 'before' | 'after';\n /** Size of the input. The chips follow it. @default 'medium' */\n size?: 'small' | 'medium' | 'large' | (string & {});\n /**\n * Where the chips go. `below`: a list under a fixed single-line input.\n * `inside`: in the input box, in one wrapping row with the text, so the box\n * grows a line at a time; for a row with no room below the field.\n * @default 'below'\n */\n tagPlacement?: 'below' | 'inside';\n\n /** Ref to the input element. */\n inputRef?: RefObject<HTMLInputElement>;\n /** Ref to the bordered input box. */\n wrapperRef?: RefObject<HTMLDivElement>;\n /** Ref to the popover element. */\n popoverRef?: RefObject<HTMLDivElement>;\n /** Ref to the listbox in the popover. */\n listBoxRef?: RefObject<HTMLDivElement>;\n\n /** Styles for the bordered input box. */\n wrapperStyles?: Styles;\n /** Styles for the input element. */\n inputStyles?: Styles;\n /** Styles for the list of chips. */\n tagListStyles?: Styles;\n /** Styles for every chip. */\n tagStyles?: Styles;\n /** Styles for the button that toggles the popover. */\n triggerStyles?: Styles;\n /** Styles for the popover. */\n overlayStyles?: Styles;\n /** Styles for the listbox in the popover. */\n listBoxStyles?: Styles;\n /** Styles for each option. */\n optionStyles?: Styles;\n /** Styles for option sections. */\n sectionStyles?: Styles;\n /** Styles for option section headings. */\n headingStyles?: Styles;\n /** Space between options, in pixels. Defaults to a hairline (`$item-gap`, `1px`). */\n listGap?: number;\n}\n\nconst TagInputElement = tasty({\n qa: 'TagInputContainer',\n styles: {\n display: 'flex',\n flow: 'column',\n gap: '1x',\n },\n});\n\n// The chips sit a step below the input, so a row of them reads as the field's\n// value rather than as a second row of controls. Never below `xsmall`: the\n// `inline` tag is set in the bold badge type, which reads as a label.\nconst TAG_SIZES: Record<string, CubeTagProps['size']> = {\n small: 'xsmall',\n medium: 'xsmall',\n large: 'small',\n};\n\n// Chips inside the box: one wrapping row of chips and text. The padding is the\n// same on every side and comes from the chip height, so one row is exactly the\n// input's height. The prefix box steps aside (`contents`) so the icon and the\n// chips are items of that row, and the caret follows the last chip.\nconst INSIDE_WRAPPER_STYLES: Styles = {\n display: 'flex',\n flow: 'row wrap',\n placeItems: 'center start',\n gap: '.5x',\n height: 'min $size',\n padding: '$tag-inset',\n // The fill reaches under the padding, which the default `content-box` clip\n // would leave bare.\n backgroundClip: 'padding-box',\n\n '$tag-size': {\n '': '$size-xs',\n 'size=small': '2.5x',\n 'size=large': '$size-sm',\n },\n '$tag-inset': '(($size - $tag-size - 2bw) / 2)',\n // The suffix's width and the gap before it, measured by `useSuffixSpace`.\n '$suffix-space': '0px',\n\n Prefix: {\n display: 'contents',\n },\n\n // On the end of the text, which reserves its room: the suffix takes none of\n // its own in the row, so the two wrap together. The block margins let a\n // full-height action sit in a chip-high row without growing it, flush with\n // the edge as in a plain input.\n Suffix: {\n position: 'relative',\n alignSelf: 'stretch',\n margin: '(-1 * $tag-inset)',\n marginLeft: '(-1 * $suffix-space)',\n },\n};\n\n// The text takes what the last row leaves. It is as wide as what is typed,\n// never under 6x, so text that does not fit the rest of the row moves to a row\n// of its own, and is cut only past the full width. The placeholder is a hint:\n// it does not size the field, so it never takes a row of its own (which the\n// first typed letter would take back) and is cut with an ellipsis instead.\n// Without `field-sizing` the text keeps a fixed share of the row and scrolls.\n// With no chips it lines up with a plain input.\nconst INSIDE_INPUT_STYLES: Styles = {\n flexGrow: 1,\n flexBasis: {\n '': 0,\n '@supports(field-sizing: content) & !:placeholder-shown': 'auto',\n },\n fieldSizing: {\n '': 'content',\n ':placeholder-shown': 'fixed',\n },\n textOverflow: 'ellipsis',\n // `auto`, or a width would override `field-sizing`. The suffix's room counts\n // toward the minimum, so typing room stays 6x beside it.\n width: '(6x + $suffix-space) auto 100%',\n // Its own line box would make the row taller than the chips.\n height: '$tag-size',\n padding:\n '0 (1x - 1bw - $tag-inset + $suffix-space) 0 (1x - 1bw - $tag-inset)',\n};\n\n// The chips are items of the box's row, not a box of their own, and each one\n// fits the row height.\nconst INSIDE_TAG_LIST_STYLES: Styles = {\n display: 'contents',\n // Off a flex box, tasty's `gap` turns into child margins; the box's own gap\n // spaces the chips.\n gap: 0,\n};\n\nconst INSIDE_TAG_STYLES: Styles = {\n $size: '$tag-size',\n // The height comes from `$size` alone, the label centered in it, so a small\n // field's chip can be shorter than the label's padded line.\n '$block-padding': 0,\n};\n\ninterface PartStyles {\n wrapper?: Styles;\n input?: Styles;\n tagList?: Styles;\n tag?: Styles;\n}\n\n/** What each part is styled with for a placement. The consumer's own win. */\nfunction getPlacementStyles(\n placement: CubeTagInputProps['tagPlacement'],\n own: PartStyles,\n): PartStyles {\n if (placement !== 'inside') return own;\n\n return {\n wrapper: mergeStyles(INSIDE_WRAPPER_STYLES, own.wrapper),\n input: mergeStyles(INSIDE_INPUT_STYLES, own.input),\n tagList: mergeStyles(INSIDE_TAG_LIST_STYLES, own.tagList),\n tag: mergeStyles(INSIDE_TAG_STYLES, own.tag),\n };\n}\n\n/** The placeholder, unless it hides once there is a tag. */\nfunction shownPlaceholder(\n placeholder: string | undefined,\n hideWithTags: boolean | undefined,\n tagCount: number,\n) {\n return hideWithTags && tagCount > 0 ? undefined : placeholder;\n}\n\n/**\n * Whether the popover shows: with an option to list, or to say there is none\n * for the typed text, or none yet while loading (`emptyLabel`), rather than\n * disappear under the user. With no options at all and nothing typed, it\n * hides but stays open, so it comes back as soon as there is something.\n */\nfunction isListShown({\n isOpen,\n hasResults,\n term,\n isLoading,\n}: {\n isOpen: boolean;\n hasResults: boolean;\n term: string;\n isLoading: boolean | undefined;\n}) {\n return isOpen && (hasResults || term !== '' || !!isLoading);\n}\n\n/** What the popover says when it has no option to list. */\nfunction resolveEmptyLabel(\n emptyLabel: ReactNode,\n isLoading: boolean | undefined,\n t: ReturnType<typeof useI18n>['t'],\n) {\n if (emptyLabel !== undefined) return emptyLabel;\n\n return isLoading\n ? t('tagInput.loading', 'Loading…')\n : t('tagInput.noResults', 'No results found');\n}\n\n/**\n * Where the list of chips renders: inside, after the icon and the prefix and\n * before the text; below, under the box.\n */\nfunction placeTagList(\n placement: CubeTagInputProps['tagPlacement'],\n prefix: ReactNode,\n tagList: ReactNode,\n) {\n if (placement !== 'inside' || !tagList) return { prefix, below: tagList };\n\n return {\n prefix: (\n <>\n {prefix}\n {tagList}\n </>\n ),\n below: null,\n };\n}\n\nconst DEFAULT_DELIMITERS = [','];\nconst LINE_BREAK = /\\r\\n|\\r|\\n/;\n\nfunction escapeRegExp(text: string) {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction delimiterPattern(delimiters: string[]): RegExp | null {\n const separators = delimiters.filter(Boolean).map(escapeRegExp);\n\n return separators.length ? new RegExp(separators.join('|')) : null;\n}\n\n/** Splits `text` on the delimiters and line breaks into trimmed, non-empty parts. */\nexport function splitTagText(text: string, delimiters: string[]): string[] {\n const separators = delimiters.filter(Boolean).map(escapeRegExp);\n const pattern = new RegExp([LINE_BREAK.source, ...separators].join('|'), 'g');\n\n return text\n .split(pattern)\n .map((part) => part.trim())\n .filter(Boolean);\n}\n\n/** A chip's own label, when `tagProps` gives it one as plain text. */\nfunction textLabel(node: ReactNode): string | undefined {\n return typeof node === 'string' && node !== '' ? node : undefined;\n}\n\n// Safari reports the Enter that confirms an IME composition with\n// `isComposing: false`, but still with the composition key code.\nconst textCollator = new Intl.Collator(undefined, { sensitivity: 'base' });\n// Numbers in order: 2 before 10.\nconst textSorter = new Intl.Collator(undefined, { numeric: true });\n\nfunction isSameText(a: string, b: string) {\n return textCollator.compare(a, b) === 0;\n}\n\nfunction compareText(a: string, b: string) {\n return textSorter.compare(a, b);\n}\n\ninterface OptionMatch {\n /** The first option whose label is the text, or else the one whose key is. */\n exact: string | null;\n /** The first option whose label is the text ignoring case and accents. */\n loose: string | null;\n}\n\n/**\n * The options typed text names. The label comes first, since it is what the\n * user sees, then the key. An exact match is looked for in the whole list\n * before a loose one counts, so `active` finds `active` even after `Active`.\n */\nfunction matchOptionText(\n collection: Iterable<CollectionNode<unknown>>,\n text: string,\n): OptionMatch {\n let byKey: string | null = null;\n let loose: string | null = null;\n\n for (const node of collection) {\n const nodes = node.type === 'section' ? [...node.childNodes] : [node];\n\n for (const child of nodes) {\n if (child.type !== 'item') continue;\n\n const key = String(child.key);\n const label = child.textValue || '';\n\n if (label === text) return { exact: key, loose };\n\n if (byKey == null && key === text) byKey = key;\n if (loose == null && isSameText(label, text)) loose = key;\n }\n }\n\n return { exact: byKey, loose };\n}\n\n/**\n * The popover's rows: the options, then the user's own values and the typed\n * text. Those go in a section of their own when there are options to set them\n * apart from.\n */\nfunction withCustomOptions(\n children: ReactNode,\n {\n customKeys,\n customTerm,\n hasOptionRows,\n hasSections,\n optionsLabel,\n customValuesLabel,\n }: {\n customKeys: readonly string[];\n customTerm: string | null;\n hasOptionRows: boolean;\n hasSections: boolean;\n optionsLabel: string;\n customValuesLabel: string;\n },\n) {\n if (!customTerm && !customKeys.length) return children;\n\n const customOptions = customKeys.map((key) => (\n <Item key={key} textValue={key}>\n {key}\n </Item>\n ));\n\n if (customTerm) {\n customOptions.push(\n <Item key={customTerm} textValue={customTerm}>\n {customTerm}\n </Item>,\n );\n }\n\n if (!hasOptionRows) {\n return customOptions;\n }\n\n const customSection = (\n <BaseSection key=\"__custom_values__\" aria-label={customValuesLabel}>\n {customOptions}\n </BaseSection>\n );\n\n // A section cannot nest in another one, so options that already come in\n // sections only get the custom section appended.\n if (hasSections) {\n return [\n ...(Array.isArray(children) ? children : [children]),\n customSection,\n ];\n }\n\n return [\n <BaseSection key=\"__options__\" aria-label={optionsLabel}>\n {children as never}\n </BaseSection>,\n customSection,\n ];\n}\n\ninterface CustomRows {\n /** The user's own values, as rows. */\n keys: readonly string[];\n /** The ones the typed text leaves listed. */\n visibleKeys: readonly string[];\n /** The typed text as a pickable row, when it would add something new. */\n typedKey: string | null;\n}\n\nconst NO_CUSTOM_ROWS: CustomRows = {\n keys: [],\n visibleKeys: [],\n typedKey: null,\n};\n\n/**\n * The rows listed after the options: the user's own values, so they can be\n * unpicked where they were picked, and the typed text. `unpicked` holds the\n * custom values unpicked during this visit, which stay listed.\n */\nfunction getCustomRows({\n values,\n unpicked,\n isOption,\n term,\n isFiltering,\n matches,\n termOptionKey,\n}: {\n values: readonly string[];\n unpicked: readonly string[];\n /** Whether a value is an option, or was one when it was picked. */\n isOption: (value: string) => boolean;\n term: string;\n /** Whether the typed text narrows the rows. */\n isFiltering: boolean;\n matches: FilterFn;\n /** The option the typed text names, if any. */\n termOptionKey: string | null;\n}): CustomRows {\n // Sorted, so toggling one does not move it.\n const keys = [\n ...new Set([...values, ...unpicked].filter((value) => !isOption(value))),\n ].sort(compareText);\n\n return {\n keys,\n visibleKeys:\n isFiltering && term ? keys.filter((key) => matches(key, term)) : keys,\n typedKey:\n term &&\n termOptionKey == null &&\n !values.includes(term) &&\n !keys.includes(term)\n ? term\n : null,\n };\n}\n\n/**\n * The row the typed text names: the option it stands for, or else a custom\n * value it spells. Text that names a row only in another case is a value of\n * its own, so its own row wins over that one: Enter adds `paris` as typed, not\n * `Paris`.\n */\nfunction getExactRowKey(\n collection: Iterable<CollectionNode<unknown>>,\n {\n term,\n termOptionKey,\n customTerm,\n customValueKeys,\n }: {\n term: string;\n termOptionKey: string | null;\n customTerm: string | null;\n customValueKeys: readonly string[];\n },\n): string | null {\n if (termOptionKey != null) return termOptionKey;\n if (term && customValueKeys.includes(term)) return term;\n\n if (\n customTerm &&\n (matchOptionText(collection, customTerm).loose != null ||\n customValueKeys.some((key) => isSameText(key, customTerm)))\n ) {\n return customTerm;\n }\n\n return null;\n}\n\n/**\n * The row the focus pass lands on, and Enter with it. The row the typed text\n * names wins over the first match, so typing \"build\" and pressing Enter picks\n * \"build\", not \"rebuild\". Typed text means \"add\", so past an exact match the\n * first row that is not added yet wins: typing \"def\" next to a picked\n * \"undefined\" lands on \"def\".\n */\nfunction getPreferredRowKey(\n rows: readonly Key[],\n exactKey: Key | null,\n term: string,\n values: readonly string[],\n): Key | null {\n if (exactKey != null && rows.includes(exactKey)) return exactKey;\n\n const firstNew = term\n ? rows.find((key) => !values.includes(String(key)))\n : undefined;\n\n return firstNew ?? rows[0] ?? null;\n}\n\nfunction isComposingKey(e: KeyboardEvent<HTMLInputElement>) {\n return e.nativeEvent.isComposing || e.keyCode === 229;\n}\n\n/**\n * The arrow toward the start of the line, with the caret already there and\n * nothing selected: the caret has nowhere to go, so it steps out to the chip\n * before it. Modified arrows stay text editing.\n */\nfunction isArrowPastStart(\n e: KeyboardEvent<HTMLInputElement>,\n direction: 'ltr' | 'rtl',\n) {\n const { selectionStart, selectionEnd } = e.currentTarget;\n\n return (\n e.key === (direction === 'rtl' ? 'ArrowRight' : 'ArrowLeft') &&\n !(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) &&\n selectionStart === 0 &&\n selectionEnd === 0\n );\n}\n\ntype RejectionReason =\n 'invalid' | 'duplicate' | 'unknown' | 'unavailable' | 'limit';\n\ninterface Rejection {\n text: string;\n reason: RejectionReason;\n message?: string;\n}\n\n/**\n * Where a committed part comes from: typed text, which may name an option, an\n * option row's key, or a custom value's row, which is only ever itself.\n */\ntype CommitSource = 'text' | 'option' | 'custom';\n\n/** What a value must pass to become a chip. */\ninterface TagRules {\n /** Keys of options that cannot be picked. */\n disabledKeys: ReadonlySet<string>;\n /** Only options are accepted: there are options, and no custom values. */\n isOptionOnly: boolean;\n maxTags?: number;\n validateTag?: (value: string) => TagValidationResult;\n}\n\n/**\n * Why a value is refused, or `null` when it may be added. `optionKey` is the\n * option the part resolved to, if any: an option is not validated. `present`\n * holds the values already there, the ones this commit accepted so far among\n * them.\n */\nfunction getRejection(\n value: string,\n optionKey: string | null,\n present: ReadonlySet<string>,\n { disabledKeys, isOptionOnly, maxTags, validateTag }: TagRules,\n): Omit<Rejection, 'text'> | null {\n if (optionKey != null && disabledKeys.has(optionKey)) {\n return { reason: 'unavailable' };\n }\n\n if (optionKey == null && isOptionOnly) return { reason: 'unknown' };\n if (present.has(value)) return { reason: 'duplicate' };\n if (maxTags != null && present.size >= maxTags) return { reason: 'limit' };\n\n if (optionKey == null && validateTag) {\n const result = validateTag(value);\n\n if (result === false || typeof result === 'string') {\n return {\n reason: 'invalid',\n message: typeof result === 'string' ? result : undefined,\n };\n }\n }\n\n return null;\n}\n\n/** The input's combobox wiring, for a field with options to suggest. */\nfunction getComboboxProps(\n listBoxId: string,\n isOpen: boolean,\n activeKey: Key | null,\n) {\n return {\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-haspopup': 'listbox',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? listBoxId : undefined,\n 'aria-activedescendant':\n isOpen && activeKey != null\n ? getListBoxOptionId(listBoxId, activeKey)\n : undefined,\n };\n}\n\ninterface FieldButtonProps {\n id: string;\n size: CubeTagInputProps['size'];\n /** The field's `aria-label`, joined into the button's own name. */\n ariaLabel?: string;\n /** The ids that label the field, read after the button's own name. */\n fieldLabelledby?: string;\n onPress: () => void;\n}\n\n/** The button in the input that toggles the suggestions popover. */\nfunction TagInputTrigger({\n id,\n size,\n ariaLabel,\n fieldLabelledby,\n onPress,\n isOpen,\n isDisabled,\n isLoading,\n styles,\n}: FieldButtonProps & {\n isOpen: boolean;\n isDisabled: boolean;\n isLoading?: boolean;\n styles?: Styles;\n}) {\n const { t } = useI18n();\n\n return (\n <ItemAction\n data-popover-trigger\n id={id}\n qa=\"TagInputTrigger\"\n icon={<DirectionIcon to={isOpen ? 'up' : 'down'} />}\n size={size}\n isDisabled={isDisabled}\n styles={styles}\n mods={{ pressed: isOpen, loading: !!isLoading }}\n // Arrow keys open the list from the input, so the button stays out of\n // the Tab order and Tab goes from the input straight to the chips.\n tabIndex={-1}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-label={\n ariaLabel\n ? t('tagInput.showOptionsFor', 'Show options, {{label}}', {\n label: ariaLabel,\n })\n : t('tagInput.showOptions', 'Show options')\n }\n aria-labelledby={fieldLabelledby ? `${id} ${fieldLabelledby}` : undefined}\n onPress={onPress}\n />\n );\n}\n\n/** The button in the input that clears the typed text and the chips. */\nfunction TagInputClearButton({\n id,\n size,\n ariaLabel,\n fieldLabelledby,\n onPress,\n}: FieldButtonProps) {\n const { t } = useI18n();\n\n return (\n <ItemAction\n id={id}\n qa=\"TagInputClearButton\"\n icon={<CloseIcon />}\n size={size}\n // As a Tab stop it would take focus just as tabbing away commits the\n // text, and with the text gone it could be the only thing left to clear.\n tabIndex={-1}\n aria-label={\n ariaLabel\n ? t('tagInput.clearAllFor', 'Clear all, {{label}}', {\n label: ariaLabel,\n })\n : t('tagInput.clearAll', 'Clear all')\n }\n aria-labelledby={fieldLabelledby ? `${id} ${fieldLabelledby}` : undefined}\n onPress={onPress}\n />\n );\n}\n\nfunction TagInput<T extends object>(\n props: WithNullableValue<CubeTagInputProps<T>>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n props = castNullableArrayValue(props);\n props = useFieldProps(props, {\n defaultValidationTrigger: 'onChange',\n valuePropsMapper: ({ value, onChange }) => ({\n value: value ?? [],\n onChange,\n }),\n });\n // Its refusals are messages of its own, with or without a label or a form,\n // so it asks for the field chrome that shows them. `isBare` still opts out.\n props = withFieldChrome(props);\n\n const { t } = useI18n();\n const { formatList } = useFormatter();\n // The text direction; `direction` is where the popover opens.\n const { direction: textDirection } = useLocale();\n\n let {\n qa,\n id,\n label,\n value: valueProp,\n defaultValue,\n onChange,\n inputValue: inputValueProp,\n defaultInputValue,\n onInputChange,\n placeholder,\n hidePlaceholderWithTags,\n autoFocus,\n autoComplete = 'off',\n isIdentifier,\n onFocus,\n onBlur,\n onKeyDown,\n delimiters = DEFAULT_DELIMITERS,\n validateTag,\n normalizeTag,\n maxTags,\n shouldCommitOnBlur = true,\n isClearable,\n onClear,\n items,\n children: renderChildren,\n allowsCustomValue,\n filter,\n disabledKeys,\n popoverTrigger = 'input',\n emptyLabel,\n onOpenChange,\n hideTrigger,\n direction = 'bottom',\n shouldFlip = true,\n overlayOffset = 8,\n containerPadding = 8,\n tagProps,\n icon,\n prefix,\n suffix,\n suffixPosition,\n size = 'medium',\n tagPlacement = 'below',\n isDisabled,\n isReadOnly,\n isRequired,\n isLoading,\n isInvalid,\n isValid,\n message,\n errorMessage,\n inputRef: inputRefProp,\n wrapperRef: wrapperRefProp,\n popoverRef: popoverRefProp,\n listBoxRef: listBoxRefProp,\n wrapperStyles,\n inputStyles,\n tagListStyles,\n tagStyles,\n triggerStyles,\n overlayStyles,\n listBoxStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n labelProps: userLabelProps,\n mods,\n // The input holds the text being typed, not the field's value: a native\n // form must not submit it under the field's name.\n name,\n form,\n ...otherProps\n } = props;\n\n const { styles, field } = splitFieldLayout(props);\n\n const rootRef = useCombinedRefs(ref);\n const inputRef = useCombinedRefs(inputRefProp);\n const wrapperRef = useCombinedRefs(wrapperRefProp);\n const popoverRef = useCombinedRefs(popoverRefProp);\n const listBoxRef = useCombinedRefs(listBoxRefProp);\n const tagListRef = useRef<HTMLDivElement>(null);\n const listStateRef = useRef<ListStateLike | null>(null);\n\n const tagInputId = useMemo(() => generateRandomId(), []);\n const listBoxId = `TagInputListBox-${tagInputId}`;\n const tagListId = useId();\n const summaryId = useId();\n const hintId = useId();\n const triggerId = useId();\n const clearId = useId();\n\n // ---- values -------------------------------------------------------------\n const [values, setValues] = useControlledState<readonly string[]>(\n valueProp as readonly string[] | undefined,\n (defaultValue as readonly string[] | undefined) ?? [],\n onChange as ((value: readonly string[]) => void) | undefined,\n );\n // A controlled value may repeat an entry; the chips are keyed by value, so\n // render each one once.\n const uniqueValues = [...new Set((values ?? []).map(String))];\n\n // ---- typed text ---------------------------------------------------------\n const [draft, setDraftState] = useControlledState<string>(\n inputValueProp as string | undefined,\n defaultInputValue ?? '',\n onInputChange,\n );\n const { tagError, setTagError, clearTagErrorAfterPress, cancelPendingClear } =\n useTagError();\n const [announcement, setAnnouncement] = useState({ id: 0, text: '' });\n\n // ---- options ------------------------------------------------------------\n let children: ReactNode = renderChildren as ReactNode;\n\n if (items && typeof renderChildren === 'function') {\n children = Array.from(items).map((item, index) => {\n const rendered = (renderChildren as (item: T) => ReactNode)(item);\n\n if (isValidElement(rendered) && rendered.key == null) {\n return cloneElement(rendered, {\n key:\n (item as { key?: Key })?.key ?? (item as { id?: Key })?.id ?? index,\n });\n }\n\n return rendered;\n });\n }\n\n const hasOptions = children != null && children !== false;\n\n // Reads option labels, and matches typed text to an option, whether or not\n // the popover is open.\n const localCollectionState = useListState({\n children: children as never,\n selectionMode: 'none',\n });\n const collection = localCollectionState.collection;\n\n // An option's node. Sections are in the collection too, under keys of their\n // own, but a value that shares one is still the user's own text.\n const getOption = (key: string) => {\n const node = collection.getItem(key);\n\n return node?.type === 'item' ? node : null;\n };\n\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const textFilterFn: FilterFn =\n filter === false ? showEveryOption : filter || contains;\n\n const [isFilterActive, setIsFilterActive] = useState(false);\n const term = draft.trim();\n\n // Labels of picked options, kept after the option leaves the collection, as\n // it does with server-side filtering (`items` + `filter={false}`).\n const [knownLabels, setKnownLabels] = useState<ReadonlyMap<string, string>>(\n () => new Map(),\n );\n\n const getOptionLabel = (key: string) =>\n getOption(key)?.textValue || knownLabels.get(key) || key;\n\n // What a chip reads as, and what announcements name it by: a string label\n // the chip is given, then the option's own.\n const getTagLabel = (key: string) =>\n textLabel(tagProps?.(key)?.children) ?? getOptionLabel(key);\n\n // A locked chip stays put: no remove button, Delete or unpick.\n const isTagLocked = (key: string) => !!tagProps?.(key)?.isDisabled;\n\n const disabledKeySet = new Set([...(disabledKeys ?? [])].map(String));\n\n // Called before the text changes (and the options with it) and when values\n // are added, while the options still hold the labels.\n const rememberLabels = useEvent((keys: readonly string[]) => {\n let next: Map<string, string> | null = null;\n\n for (const key of keys) {\n const label = getOption(key)?.textValue;\n\n if (label && knownLabels.get(key) !== label) {\n if (!next) next = new Map(knownLabels);\n next.set(key, label);\n }\n }\n\n if (next) setKnownLabels(next);\n });\n\n /**\n * The option typed text stands for, if any. Without `allowsCustomValue` a\n * label in another case or without its accents counts, so `production`\n * finds `Production`. With it, such text is a value of its own and is added\n * as typed: `paris` is not `Paris` to a case-sensitive filter.\n */\n const findOptionKey = (text: string): string | null => {\n if (!hasOptions) return null;\n\n const match = matchOptionText(collection, text);\n\n return match.exact ?? (allowsCustomValue ? null : match.loose);\n };\n\n /**\n * What typed text commits as: the option it names, or else the text itself,\n * rewritten by `normalizeTag`, and the option that names if any. Enter, a\n * delimiter, a paste and blur all go through this, so they agree.\n */\n const resolveTypedText = (text: string) => {\n const optionKey = findOptionKey(text);\n\n if (optionKey != null || !normalizeTag) return { optionKey, typed: text };\n\n const typed = normalizeTag(text).trim();\n\n return { optionKey: typed ? findOptionKey(typed) : null, typed };\n };\n\n /**\n * What a part commits as. Only typed text is matched to an option. An option\n * row commits its own key; a custom value's row is the user's own text, so\n * `normalizeTag` still rewrites it, but it never turns into an option.\n */\n const resolvePart = (part: string, source: CommitSource = 'text') => {\n if (source === 'text') return resolveTypedText(part);\n if (source === 'option') return { optionKey: part, typed: part };\n\n return {\n optionKey: null,\n typed: normalizeTag ? normalizeTag(part).trim() : part,\n };\n };\n\n const termOptionKey = term ? resolveTypedText(term).optionKey : null;\n\n // The option the text names stays listed even when the filter would hide\n // it (a key typed, a custom filter), so Enter can land on it.\n const optionFilterFn = (nodes: Iterable<any>) => {\n if (!isFilterActive || !term) return nodes;\n\n return filterCollectionNodes(nodes, term, textFilterFn, {\n keep:\n termOptionKey == null\n ? undefined\n : (node) => String(node.key) === termOptionKey,\n });\n };\n\n const visibleOptionKeys: Key[] = [];\n\n if (hasOptions) {\n collectVisibleKeys(\n optionFilterFn(collection),\n visibleOptionKeys,\n disabledKeys ? new Set(disabledKeys) : undefined,\n );\n }\n\n // Custom values unpicked in the list during this visit. They stay listed,\n // unchecked, until focus leaves the field: the row does not vanish under the\n // pointer, and it can be picked back.\n const [unpickedCustomValues, setUnpickedCustomValues] = useState<\n readonly string[]\n >([]);\n\n // The user's own values and the typed text, listed after the options. Only\n // with `allowsCustomValue`: without it an unpicked value could not be added\n // back.\n const {\n keys: customValueKeys,\n visibleKeys: visibleCustomKeys,\n typedKey: customTerm,\n } = hasOptions && allowsCustomValue\n ? getCustomRows({\n values: uniqueValues,\n unpicked: unpickedCustomValues,\n isOption: (value) => getOption(value) != null || knownLabels.has(value),\n term,\n isFiltering: isFilterActive,\n // The typed text narrows them as it narrows the options, even when\n // the options are filtered on the server (`filter={false}`): these\n // rows are this component's own.\n matches: typeof filter === 'function' ? filter : contains,\n termOptionKey,\n })\n : NO_CUSTOM_ROWS;\n\n const popoverChildren = withCustomOptions(children, {\n customKeys: visibleCustomKeys,\n customTerm,\n hasOptionRows: visibleOptionKeys.length > 0,\n hasSections: [...collection].some((node) => node.type === 'section'),\n optionsLabel: t('tagInput.options', 'Options'),\n customValuesLabel: t('tagInput.customValues', 'Custom values'),\n });\n\n const hasResults =\n visibleOptionKeys.length > 0 ||\n visibleCustomKeys.length > 0 ||\n customTerm != null;\n // Options rebuild on every render when they come from `items`, so effects\n // follow what is visible rather than the collection's identity.\n const visibleOptionsSignature = [\n ...visibleOptionKeys,\n ...visibleCustomKeys,\n ].join('\\u0000');\n\n // ---- popover ------------------------------------------------------------\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const isInteractive = !isDisabled && !isReadOnly;\n const shouldShowPopover =\n hasOptions &&\n isInteractive &&\n isListShown({ isOpen: isPopoverOpen, hasResults, term, isLoading });\n\n const notifiedOpenRef = useRef(false);\n\n useEffect(() => {\n if (notifiedOpenRef.current === shouldShowPopover) return;\n\n notifiedOpenRef.current = shouldShowPopover;\n onOpenChange?.(shouldShowPopover);\n }, [shouldShowPopover, onOpenChange]);\n\n const visibleTargetKeys: Key[] = [...visibleOptionKeys, ...visibleCustomKeys];\n\n if (customTerm) visibleTargetKeys.push(customTerm);\n\n const preferredOptionKey = getPreferredRowKey(\n visibleTargetKeys,\n getExactRowKey(collection, {\n term,\n termOptionKey,\n customTerm,\n customValueKeys,\n }),\n term,\n uniqueValues,\n );\n\n const { activeOption, setActiveOption, moveVirtualFocus, popoverMinWidth } =\n useActiveOption({\n listStateRef,\n wrapperRef,\n isOpen: shouldShowPopover,\n visibleOptionsSignature,\n customTerm,\n term,\n preferredOptionKey,\n });\n const activeOptionKey = activeOption?.key ?? null;\n\n const setDraft = useEvent((next: string) => {\n setDraftState(next);\n setIsFilterActive(!!next.trim());\n });\n\n // A fresh node per message, so a repeated one (\"Added a\", remove, \"Added a\")\n // is announced again.\n const announce = useEvent((text: string) => {\n setAnnouncement((prev) => ({ id: prev.id + 1, text }));\n });\n\n // ---- commit -------------------------------------------------------------\n const rejectionMessage = useEvent((rejection: Rejection) => {\n if (rejection.message) return rejection.message;\n\n switch (rejection.reason) {\n case 'duplicate':\n return t('tagInput.duplicateValue', '\"{{value}}\" is already added', {\n value: rejection.text,\n });\n case 'unknown':\n return t('tagInput.unknownValue', '\"{{value}}\" is not in the list', {\n value: rejection.text,\n });\n case 'unavailable':\n return t('tagInput.unavailableValue', '\"{{value}}\" is not available', {\n value: rejection.text,\n });\n case 'limit':\n return t('tagInput.limitReached', 'You can add up to {{count}}', {\n count: maxTags,\n });\n default:\n return t('tagInput.invalidValue', '\"{{value}}\" is not a valid value', {\n value: rejection.text,\n });\n }\n });\n\n // Refused parts go back to the input joined by a delimiter, so they split\n // back into the same values. A line break cannot join them: the input drops\n // it. Typing a delimiter always leaves one to join with.\n const joinDelimiter = delimiters.find(\n (delimiter) => delimiter && !LINE_BREAK.test(delimiter),\n );\n const joiner = joinDelimiter ? `${joinDelimiter} ` : ' ';\n\n // Without the field chrome there is no field wrapper to show the message, so\n // a rejection is announced instead.\n const hasFieldMessage = rendersFieldChrome(props);\n\n /**\n * Turns typed parts into values. Accepted parts become chips. Refused ones\n * come back as text for the input, with a message, except a duplicate: it is\n * a chip already, and the message says so. With no delimiter to join them,\n * only the first refused part comes back, since glued together they would\n * commit as one value nobody typed. A row picked from the list says where it\n * comes from (`source`), so it is never matched to another option.\n */\n const commitParts = useEvent((parts: string[], source?: CommitSource) => {\n if (!parts.length) return '';\n\n const rules: TagRules = {\n disabledKeys: disabledKeySet,\n isOptionOnly: hasOptions && !allowsCustomValue,\n maxTags,\n validateTag,\n };\n const present = new Set(uniqueValues);\n const accepted: string[] = [];\n const rejected: Rejection[] = [];\n\n for (const part of parts) {\n // Only text of its own is rewritten; an option keeps its key.\n const { optionKey, typed } = resolvePart(part, source);\n\n if (!typed) continue;\n\n const nextValue = optionKey ?? typed;\n const rejection = getRejection(nextValue, optionKey, present, rules);\n\n if (rejection) {\n rejected.push({ text: part, ...rejection });\n continue;\n }\n\n present.add(nextValue);\n accepted.push(nextValue);\n }\n\n const returned = rejected.filter(\n (rejection) => rejection.reason !== 'duplicate',\n );\n const kept = joinDelimiter ? returned : returned.slice(0, 1);\n // The message is about the text left in the input, if there is any.\n const shown = kept[0] ?? rejected[0];\n const error = shown ? rejectionMessage(shown) : null;\n const messages: string[] = [];\n\n if (accepted.length) {\n rememberLabels(accepted);\n setValues([...uniqueValues, ...accepted]);\n messages.push(\n t('tagInput.added', 'Added {{value}}', {\n value: formatList(accepted.map(getTagLabel)),\n }),\n );\n }\n\n if (error && !hasFieldMessage) messages.push(error);\n if (messages.length) announce(messages.join(' '));\n\n setTagError(error);\n\n return kept.map((rejection) => rejection.text).join(joiner);\n });\n\n /** Commits the typed text and returns what is left in the input. */\n const commitDraft = useEvent(() => {\n const rest = commitParts(splitTagText(draft, delimiters));\n\n setDraft(rest);\n\n return rest;\n });\n\n // Focusing the row itself tells the tag group which chip is focused, as a\n // click would.\n const focusLastTag = useEvent(() => {\n const rows = tagListRef.current?.querySelectorAll<HTMLElement>(\n '[role=\"row\"]:not([aria-disabled=\"true\"])',\n );\n\n rows?.[rows.length - 1]?.focus();\n });\n\n const removeValues = useEvent((requested: string[]) => {\n const keys = requested.filter((key) => !isTagLocked(key));\n\n if (!keys.length) return;\n\n const removed = new Set(keys);\n const next = uniqueValues.filter((value) => !removed.has(value));\n\n // Focus leaves the list before the last chip it can land on unmounts under\n // it; locked chips take no focus.\n if (!next.some((value) => !isTagLocked(value))) {\n inputRef.current?.focus();\n }\n\n setValues(next);\n setTagError(null);\n announce(\n t('tagInput.removed', 'Removed {{value}}', {\n value: formatList(keys.map(getTagLabel)),\n }),\n );\n });\n\n /**\n * Picks an option in the popover, or unpicks one that already is a chip. The\n * popover stays open for the next pick, and the query is cleared so the full\n * list is back. A picked row is never swapped for an option with a similar\n * or the same text. A custom value's row is still the user's own text, so\n * `normalizeTag` and `validateTag` apply to it. The typed text's row is the\n * typed text, so it commits as a delimiter would.\n */\n const toggleOption = useEvent((key: string) => {\n if (isTagLocked(key)) return;\n\n const source: CommitSource =\n getOption(key) != null\n ? 'option'\n : customValueKeys.includes(key)\n ? 'custom'\n : 'text';\n\n setTagError(null);\n\n if (uniqueValues.includes(key)) {\n removeValues([key]);\n setDraft('');\n\n if (customValueKeys.includes(key)) {\n setUnpickedCustomValues((prev) =>\n prev.includes(key) ? prev : [...prev, key],\n );\n }\n } else if (!commitParts([key], source)) {\n // An accepted pick clears the query. A refused one (past `maxTags`)\n // keeps it, next to the message saying why.\n setDraft('');\n }\n });\n\n // A click in the popover list. The list reports its whole new selection, so\n // compare it with the chips to find the option that changed.\n const handlePopoverSelection = useEvent(\n (selection: Key | Key[] | null | 'all') => {\n if (!Array.isArray(selection)) return;\n\n const next = new Set(selection.map(String));\n const changed = [\n ...[...next].filter((key) => !uniqueValues.includes(key)),\n ...uniqueValues.filter(\n (value) =>\n !next.has(value) &&\n (getOption(value) != null || visibleCustomKeys.includes(value)),\n ),\n ];\n\n changed.forEach(toggleOption);\n\n // The click moved the list's focus to the option; the input's\n // `aria-activedescendant` follows it.\n const clicked = changed[changed.length - 1];\n\n if (clicked != null) {\n listStateRef.current?.selectionManager.setFocusedKey(clicked);\n // The pick clears the text.\n setActiveOption({ key: clicked, term: '', source: 'user' });\n }\n\n // A click can take DOM focus off the input; keep typing where it was.\n setTimeout(() => inputRef.current?.focus(), 0);\n },\n );\n\n // ---- keyboard -----------------------------------------------------------\n // Set while Tab moves focus out of the input, so the blur can tell a Tab to\n // the chips (commit the text) from a click on a remove button (keep it).\n const isTabbingRef = useRef(false);\n\n const handleArrowKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (!hasOptions) return;\n\n e.preventDefault();\n\n // A closed list, or one that only says nothing matches, opens with every\n // option.\n if (!shouldShowPopover || !hasResults) {\n if (!hasResults) setIsFilterActive(false);\n setIsPopoverOpen(true);\n\n return;\n }\n\n const listState = listStateRef.current;\n\n if (listState) {\n moveVirtualFocus(\n getNextVisibleKey(listState, e.key === 'ArrowDown' ? 1 : -1),\n 'user',\n term,\n );\n }\n });\n\n const handleEdgeKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const listState = listStateRef.current;\n\n if (listState) {\n moveVirtualFocus(\n getEdgeVisibleKey(listState, e.key === 'Home' ? 'first' : 'last'),\n 'user',\n term,\n );\n }\n });\n\n // Backspace in an empty input moves to the last chip instead of removing it,\n // which below the input would be out of view. The chip comes into view with\n // focus and says it is removable; the next Backspace removes it and moves to\n // the one before. Inside the box, the arrow past the start of the text goes\n // there too.\n const handleToTagsKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingKey(e)) return;\n\n e.preventDefault();\n\n // A held key that just emptied the input, or brought the caret to its\n // start, stops there, so it does not run on into the chips.\n if (e.repeat) return;\n\n setIsPopoverOpen(false);\n focusLastTag();\n });\n\n const handleEnterKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingKey(e)) return;\n\n // The announced option, unless the text changed since it was chosen and\n // its focus pass has not run yet: then the best match for this text.\n const isCurrent = activeOption != null && activeOption.term === term;\n const targetKey = shouldShowPopover\n ? isCurrent\n ? activeOption.key\n : preferredOptionKey\n : null;\n\n if (targetKey != null) {\n e.preventDefault();\n\n const key = String(targetKey);\n\n // Typed text means \"add\". An option that is already a chip is refused\n // as a duplicate and the text cleared, as a comma or blur would;\n // unpicking one takes the arrows, a click, or an empty input.\n if (\n term &&\n uniqueValues.includes(key) &&\n !(isCurrent && activeOption.source === 'user')\n ) {\n setDraft('');\n setTagError(\n rejectionMessage({\n text: getTagLabel(key),\n reason: 'duplicate',\n }),\n );\n\n return;\n }\n\n toggleOption(key);\n\n return;\n }\n\n // Enter is for adding values and never submits a form, even with nothing\n // typed: pressing it once more after the last value must not send a\n // half-filled dialog.\n e.preventDefault();\n\n if (term) commitDraft();\n });\n\n const handleDelimiterKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (isComposingKey(e)) return;\n\n e.preventDefault();\n\n // The separator splits the text where it is typed: what comes before the\n // caret is committed, what comes after stays in the input.\n const el = e.currentTarget;\n const start = el.selectionStart ?? draft.length;\n const end = el.selectionEnd ?? start;\n const rejected = commitParts(\n splitTagText(draft.slice(0, start), delimiters),\n );\n\n setDraft(\n [rejected, draft.slice(end).trimStart()].filter(Boolean).join(joiner),\n );\n });\n\n // Escape takes back one thing at a time: the list, then the text. A message\n // goes with either, or on its own when the input is already empty, as after\n // a refused duplicate.\n const handleEscapeKey = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n if (shouldShowPopover) {\n e.preventDefault();\n e.stopPropagation();\n setIsPopoverOpen(false);\n setTagError(null);\n } else if (draft || tagError) {\n e.preventDefault();\n e.stopPropagation();\n setDraft('');\n setTagError(null);\n // It may be open but hidden with nothing to list; options that arrive\n // later must not open it once the text is gone.\n setIsPopoverOpen(false);\n }\n });\n\n const handleKeyDown = useEvent((e: KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(e);\n\n if (!e.defaultPrevented && isInteractive) {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n handleArrowKey(e);\n } else if ((e.key === 'Home' || e.key === 'End') && shouldShowPopover) {\n handleEdgeKey(e);\n } else if (\n (e.key === 'Backspace'\n ? !draft\n : tagPlacement === 'inside' && isArrowPastStart(e, textDirection)) &&\n uniqueValues.some((value) => !isTagLocked(value))\n ) {\n handleToTagsKey(e);\n } else if (e.key === 'Enter') {\n handleEnterKey(e);\n } else if (delimiters.includes(e.key)) {\n handleDelimiterKey(e);\n } else if (e.key === 'Escape') {\n handleEscapeKey(e);\n }\n }\n\n // A Tab the consumer or a delimiter prevented moves no focus.\n isTabbingRef.current = e.key === 'Tab' && !e.defaultPrevented;\n\n // A prevented `Escape` or `Tab`, the caller's or a delimiter's, stays\n // here, so a surrounding dialog neither closes nor moves focus on it.\n settleOverlayKey(e);\n });\n\n // A separator can also arrive without a key press: autocorrect, IME, drag and\n // drop. Commit everything before the last separator and keep the rest typed.\n const handleInputChange = useEvent((next: string) => {\n setTagError(null);\n rememberLabels(uniqueValues);\n\n const pattern = delimiterPattern(delimiters);\n const parts = pattern ? next.split(pattern) : [next];\n\n let nextDraft = next;\n\n if (parts.length > 1) {\n const rest = (parts.pop() ?? '').trimStart();\n const rejected = commitParts(\n parts.map((part) => part.trim()).filter(Boolean),\n );\n\n nextDraft = [rejected, rest].filter(Boolean).join(joiner);\n }\n\n setDraft(nextDraft);\n\n if (hasOptions && popoverTrigger !== 'manual' && nextDraft.trim()) {\n setIsPopoverOpen(true);\n }\n });\n\n // An `<input>` drops line breaks from pasted text, so split a pasted list\n // here, where they are still visible.\n const handlePaste = useEvent((e: ClipboardEvent<HTMLInputElement>) => {\n if (!isInteractive) return;\n\n const pasted = e.clipboardData.getData('text');\n\n if (!pasted || splitTagText(pasted, delimiters).length < 2) return;\n\n e.preventDefault();\n\n const el = e.currentTarget;\n const start = el.selectionStart ?? draft.length;\n const end = el.selectionEnd ?? draft.length;\n\n setTagError(null);\n setDraft(\n commitParts(\n splitTagText(\n `${draft.slice(0, start)}\\n${pasted}\\n${draft.slice(end)}`,\n delimiters,\n ),\n ),\n );\n });\n\n // ---- focus --------------------------------------------------------------\n // What leaving the input does to the typed text. Returns the text left.\n const settleDraft = useEvent((): string => {\n if (!term) return '';\n if (!shouldCommitOnBlur || !isInteractive) return draft;\n\n if (hasOptions && !allowsCustomValue && termOptionKey == null) {\n // Leaving a filter query behind is not an entry: drop it, as ComboBox\n // does with text that matches no option.\n setDraft('');\n setTagError(null);\n\n return '';\n }\n\n return commitDraft();\n });\n\n const handleCompositeFocus = useEvent(() => {\n cancelPendingClear();\n onFocus?.();\n });\n\n const handleCompositeBlur = useEvent(({ isPressing }: CompositeBlurInfo) => {\n setIsPopoverOpen(false);\n setUnpickedCustomValues([]);\n\n const wasShowingMessage = tagError != null;\n\n // A message can only be about text in the input. Once none is left, as\n // after a refused duplicate, the field does not stay marked invalid.\n if (!settleDraft()) {\n // One set while settling is cleared in the same render, and never shows.\n if (isPressing && wasShowingMessage) clearTagErrorAfterPress();\n else setTagError(null);\n }\n\n onBlur?.();\n });\n\n const { compositeFocusProps } = useCompositeFocus({\n wrapperRef: rootRef as RefObject<HTMLElement>,\n popoverRef: popoverRef as RefObject<HTMLElement>,\n onFocus: handleCompositeFocus,\n onBlur: handleCompositeBlur,\n isDisabled,\n });\n\n // Moving from the input to the chips stays inside the component, so the\n // composite blur never fires: close the popover on the way, as Backspace\n // does. A press on a chip or its remove button needs this too: inside the\n // box the chips are part of the popover's trigger, so the press is not an\n // outside one. Tab also settles the text; a press keeps it. The clear button\n // and the chevron hand focus back to the input, and are left alone.\n const handleInputBlur = useEvent((e: FocusEvent<HTMLInputElement>) => {\n const isTabbing = isTabbingRef.current;\n const next = e.relatedTarget as Node | null;\n\n isTabbingRef.current = false;\n\n if (!next || !rootRef.current?.contains(next)) return;\n if (!isTabbing && !tagListRef.current?.contains(next)) return;\n\n setIsPopoverOpen(false);\n\n if (isTabbing) settleDraft();\n });\n\n const handleInputFocus = useEvent(() => {\n if (hasOptions && popoverTrigger === 'focus' && isInteractive) {\n setIsPopoverOpen(true);\n }\n });\n\n // A press in the input opens a closed list, as in ComboBox, focused or not:\n // after Tab, or after Escape closed it. So does a press on the box around\n // the input, which the box hands to the input; one on a chip or a button\n // stays theirs. The field's label forwards its own click to the input with\n // no pointerdown in the box, and that click only focuses. The list shows the\n // options the typed text leaves, and text that matches nothing keeps it\n // closed, so a press that moves the caret does not change what Enter adds.\n const pressStartedInBoxRef = useRef(false);\n\n const handleBoxPointerDown = (e: PointerEvent<HTMLElement>) => {\n const box = e.currentTarget;\n const target = e.target as Element;\n const interactive = target.closest(INTERACTIVE_ELEMENTS);\n\n pressStartedInBoxRef.current =\n box.contains(target) &&\n (!interactive ||\n interactive === inputRef.current ||\n !box.contains(interactive));\n };\n\n const handleBoxClick = () => {\n const isBoxPress = pressStartedInBoxRef.current;\n\n pressStartedInBoxRef.current = false;\n\n if (!isBoxPress || popoverTrigger === 'manual') return;\n\n if (hasOptions && isInteractive && !shouldShowPopover && hasResults) {\n setIsPopoverOpen(true);\n }\n };\n\n // ---- chips --------------------------------------------------------------\n const tags: TagListEntry[] = uniqueValues.map((value) => {\n const ownProps = tagProps?.(value);\n const isOption = getOption(value) != null || knownLabels.has(value);\n const result = !isOption && validateTag ? validateTag(value) : true;\n const label = textLabel(ownProps?.children) ?? getOptionLabel(value);\n\n return {\n key: value,\n label,\n // Put in words as well as in color, for the chip's description.\n invalidMessage:\n typeof result === 'string'\n ? result\n : result === false\n ? t('tagInput.invalidValue', '\"{{value}}\" is not a valid value', {\n value: label,\n })\n : undefined,\n tagProps: ownProps,\n isDisabled: !!ownProps?.isDisabled,\n };\n });\n\n const effectiveIsInvalid = tagError ? true : isInvalid;\n const hasRemovableTags = tags.some((tag) => !tag.isDisabled);\n // Backspace in an empty input is how the keyboard gets to the chips without\n // Tab; nothing on screen says so.\n const hasBackspaceHint = isInteractive && hasRemovableTags;\n\n // A locked value's option stays checked but cannot be unpicked.\n const lockedKeys = tags.filter((tag) => tag.isDisabled).map((tag) => tag.key);\n const optionDisabledKeys = lockedKeys.length\n ? [...disabledKeySet, ...lockedKeys]\n : disabledKeys;\n\n // ---- input --------------------------------------------------------------\n const { labelProps, inputProps } = useTextField(\n {\n ...otherProps,\n ...getIdentifierTextServices(isIdentifier, {\n ...otherProps,\n autoComplete,\n }),\n id,\n label,\n value: draft,\n placeholder: shownPlaceholder(\n placeholder,\n hidePlaceholderWithTags,\n tags.length,\n ),\n isDisabled,\n isReadOnly,\n isRequired,\n isInvalid: effectiveIsInvalid,\n autoFocus,\n onChange: handleInputChange,\n } as never,\n inputRef,\n );\n // Names the chips, the buttons and the options after the field: \"Selected\n // values Also send to\", rather than the same words for every field on the\n // page. The ids go in the order the input reads them: the visible label,\n // then `aria-labelledby`.\n const ariaLabel = (props as { 'aria-label'?: string })['aria-label'];\n const ariaLabelledby = (props as { 'aria-labelledby'?: string })[\n 'aria-labelledby'\n ];\n const labelId = label ? (labelProps.id as string | undefined) : undefined;\n const fieldLabelledby =\n [labelId, ariaLabelledby].filter(Boolean).join(' ') || undefined;\n // An `aria-label` has no element to point at, so its words are joined into\n // each part's own name instead, ahead of the ids. That is the input's order\n // too: given `aria-label` with a `label` or `aria-labelledby`, React Aria\n // puts the input's own id first in its `aria-labelledby`, so it reads\n // \"Values Primary key\" and the chips \"Selected values, Values Primary key\".\n\n // Joined, not replaced: the input keeps any description it already has.\n const describedBy: string[] = [];\n\n if (inputProps['aria-describedby']) {\n describedBy.push(inputProps['aria-describedby']);\n }\n if (tags.length) describedBy.push(summaryId);\n if (hasBackspaceHint) describedBy.push(hintId);\n\n const tagInputProps = mergeProps(\n inputProps,\n {\n onKeyDown: handleKeyDown,\n onPaste: handlePaste,\n onBlur: handleInputBlur,\n onFocus: handleInputFocus,\n autoComplete,\n 'data-input-type': 'taginput',\n 'aria-describedby': describedBy.join(' ') || undefined,\n },\n hasOptions\n ? getComboboxProps(listBoxId, shouldShowPopover, activeOptionKey)\n : undefined,\n );\n\n const handleTriggerPress = useEvent(() => {\n const willOpen = !shouldShowPopover;\n\n // Focus first: a press that took focus to the button brings it back to the\n // input, and with `popoverTrigger=\"focus\"` that focus opens the list. The\n // button's own choice is set after it, so it wins.\n inputRef.current?.focus();\n\n if (willOpen && !hasResults) setIsFilterActive(false);\n\n setIsPopoverOpen(willOpen);\n });\n\n const trigger =\n hasOptions && !hideTrigger ? (\n <TagInputTrigger\n id={triggerId}\n size={size}\n ariaLabel={ariaLabel}\n fieldLabelledby={fieldLabelledby}\n isOpen={shouldShowPopover}\n isDisabled={!isInteractive}\n isLoading={isLoading}\n styles={triggerStyles}\n onPress={handleTriggerPress}\n />\n ) : null;\n\n // Clears the whole field: the typed text and every chip but the locked ones.\n // Escape clears only the text, so a stray key press never loses the values.\n const clearAll = useEvent(() => {\n // The button goes away with what it clears; keep focus in the field.\n // Focus first, so a `popoverTrigger=\"focus\"` open does not outlast it.\n inputRef.current?.focus();\n setDraft('');\n setIsPopoverOpen(false);\n removeValues(uniqueValues);\n setTagError(null);\n onClear?.();\n });\n\n const canClear =\n !!isClearable && isInteractive && (draft !== '' || hasRemovableTags);\n const clearButton = canClear ? (\n <TagInputClearButton\n id={clearId}\n size={size}\n ariaLabel={ariaLabel}\n fieldLabelledby={fieldLabelledby}\n onPress={clearAll}\n />\n ) : null;\n\n // Not a bare fragment: an empty one would still mark the input as having a\n // suffix.\n const hasActions = clearButton != null || trigger != null;\n\n useSuffixSpace(wrapperRef, tagPlacement === 'inside');\n\n const partStyles = getPlacementStyles(tagPlacement, {\n wrapper: wrapperStyles,\n input: inputStyles,\n tagList: tagListStyles,\n tag: tagStyles,\n });\n\n const tagList = tags.length ? (\n <TagList\n id={tagListId}\n listRef={tagListRef}\n inputRef={inputRef}\n aria-label={\n ariaLabel\n ? t('tagInput.selectedValuesFor', 'Selected values, {{label}}', {\n label: ariaLabel,\n })\n : t('tagInput.selectedValues', 'Selected values')\n }\n aria-labelledby={fieldLabelledby}\n tags={tags}\n size={TAG_SIZES[size] ?? 'xsmall'}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInline={tagPlacement === 'inside'}\n styles={partStyles.tagList}\n tagStyles={partStyles.tag}\n onRemove={removeValues}\n />\n ) : null;\n\n const placed = placeTagList(tagPlacement, prefix, tagList);\n\n const tagInputField = (\n <TagInputElement\n ref={rootRef}\n {...pickBaseCustomizationProps(props)}\n mods={mods}\n styles={styles}\n {...compositeFocusProps}\n >\n <TextInputBase\n isBare\n qa={qa || 'TagInput'}\n inputRef={inputRef}\n wrapperRef={wrapperRef}\n wrapperProps={{\n onPointerDown: handleBoxPointerDown,\n onClick: handleBoxClick,\n }}\n inputProps={tagInputProps}\n mods={mods}\n icon={icon}\n prefix={placed.prefix}\n suffix={suffix}\n suffixPosition={suffixPosition}\n actions={\n hasActions ? (\n <>\n {clearButton}\n {trigger}\n </>\n ) : null\n }\n size={size}\n autoFocus={autoFocus}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isLoading={isLoading}\n isInvalid={effectiveIsInvalid}\n isValid={isValid}\n styles={partStyles.wrapper}\n inputStyles={partStyles.input}\n />\n {placed.below}\n {/* Read only as the input's description, never on its own in browse mode. */}\n <span hidden id={summaryId}>\n {tags.length\n ? t('tagInput.summary', 'Selected: {{values}}.', {\n values: formatList(tags.map((tag) => tag.label)),\n })\n : null}\n </span>\n <span hidden id={hintId}>\n {hasBackspaceHint\n ? t(\n 'tagInput.backspaceHint',\n 'Press Backspace to go to the selected values.',\n )\n : null}\n </span>\n <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n <span key={announcement.id}>{announcement.text}</span>\n </VisuallyHidden>\n {hasOptions ? (\n <ListBoxPopover\n isOpen={shouldShowPopover}\n triggerRef={wrapperRef as RefObject<HTMLElement>}\n popoverRef={popoverRef}\n listBoxRef={listBoxRef}\n direction={direction}\n shouldFlip={shouldFlip}\n overlayOffset={overlayOffset}\n containerPadding={containerPadding}\n comboBoxWidth={popoverMinWidth}\n listBoxId={listBoxId}\n overlayStyles={overlayStyles}\n listBoxStyles={listBoxStyles}\n optionStyles={optionStyles}\n optionHighlight={isFilterActive ? term : undefined}\n emptyLabel={resolveEmptyLabel(emptyLabel, isLoading, t)}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n selectionMode=\"multiple\"\n selectedKeys={uniqueValues}\n isCheckable\n // Clicking back into the input keeps the list open for the next pick.\n shouldCloseOnTriggerInteraction={false}\n isDisabled={isDisabled}\n disabledKeys={optionDisabledKeys}\n listStateRef={listStateRef}\n // The ids the input reads, the visible label's among them, so the\n // list reads as the input does, a label that is not a string too.\n ariaLabel={ariaLabel}\n ariaLabelledby={fieldLabelledby}\n compositeFocusProps={compositeFocusProps}\n filter={optionFilterFn}\n size={size}\n onSelectionChange={handlePopoverSelection}\n onClose={() => setIsPopoverOpen(false)}\n >\n {popoverChildren}\n </ListBoxPopover>\n ) : null}\n </TagInputElement>\n );\n\n const { children: _children, ...fieldProps } = props;\n\n return wrapWithField(tagInputField, {\n ...(fieldProps as Omit<CubeTagInputProps<T>, 'children'>),\n ...field,\n labelProps: mergeProps(labelProps, userLabelProps),\n isInvalid: effectiveIsInvalid,\n // A rejected entry speaks for itself until the text is edited. Keyed, so\n // the same rejection twice in a row is announced twice.\n message: tagError ? (\n <span key={tagError.id}>{tagError.text}</span>\n ) : (\n message\n ),\n errorMessage: tagError ? undefined : errorMessage,\n });\n}\n\n/**\n * A field for a list of values, shown as removable chips below a single-line\n * input. Values are typed (Enter or a separator commits them) or picked from\n * suggested options.\n */\nconst _TagInput = forwardRef(TagInput) as unknown as (<T extends object>(\n props: WithNullableValue<CubeTagInputProps<T>> & {\n ref?: ForwardedRef<HTMLDivElement>;\n },\n) => ReactElement) & {\n Item: typeof Item;\n Section: typeof BaseSection;\n};\n\nObject.assign(_TagInput, {\n Item,\n Section: BaseSection,\n displayName: 'TagInput',\n});\n\n// The legacy `<Field>` picks its value mapper from this. The `CheckboxGroup`\n// mapper is the one for an array value: `[]` when empty, validated on change.\nObject.defineProperty(_TagInput, 'cubeInputType', {\n value: 'CheckboxGroup',\n enumerable: false,\n configurable: false,\n});\n\nexport { _TagInput as TagInput };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,MAAM0E,wBAAkC;AAMxC,MAAME,uBACJ;AAqNF,MAAMkE,kBAAkBxI,MAAM;CAC5ByI,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,KAAK;CACP;AACF,CAAC;AAKD,MAAMC,YAAkD;CACtDE,OAAO;CACPC,QAAQ;CACRC,OAAO;AACT;AAMA,MAAMC,wBAAgC;CACpCR,SAAS;CACTC,MAAM;CACNQ,YAAY;CACZP,KAAK;CACLQ,QAAQ;CACRC,SAAS;CAGTC,gBAAgB;CAEhB,aAAa;EACX,IAAI;EACJ,cAAc;EACd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AOuB,MAAA,EAAAtO,OAAAE,aAAAoO;CAAmB,OAAM;EAAAtO,OACnCA,SAAA,CAAA;EAAWE;CAEpB;AAAC;AA8uCL,MAAMqiB,YAAY3mB,WAAW0T,QAAQ;AASrCkT,OAAOC,OAAOF,WAAW;CACvB1kB,MAAAA;CACShB;CACT6lB,aAAa;AACf,CAAC;AAIDF,OAAOG,eAAeJ,WAAW,iBAAiB;CAChDviB,OAAO;CACP4iB,YAAY;CACZC,cAAc;AAChB,CAAC"}
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.216.2 | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.217.0 | Cube Dev Team */
2
2
  import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
3
3
  import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
4
4
  import { useI18n } from "../../../i18n/useI18n.js";