@povio/ui 2.3.0-rc.9 → 2.3.1

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 (282) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  48. package/dist/components/Menu/Menu.js +2 -18
  49. package/dist/components/Menu/MenuDesktop.js +7 -41
  50. package/dist/components/Menu/MenuItem.js +9 -32
  51. package/dist/components/Menu/MenuMobile.js +38 -97
  52. package/dist/components/Menu/MenuPopover.js +29 -105
  53. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  56. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  57. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  58. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  60. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  61. package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  81. package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  95. package/dist/components/inputs/File/FileUpload.js +44 -87
  96. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  97. package/dist/components/inputs/File/InputUpload.js +79 -317
  98. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  99. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  100. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  101. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  102. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  103. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  104. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  105. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  106. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  107. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  108. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  109. package/dist/components/inputs/FormField/FormField.js +37 -119
  110. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  111. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  112. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  113. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  114. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  115. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  116. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  117. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  118. package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
  119. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  120. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  121. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  122. package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
  123. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  124. package/dist/components/inputs/Inputs/Form.js +11 -40
  125. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
  126. package/dist/components/inputs/Inputs/InputItem.js +14 -71
  127. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  128. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  129. package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
  130. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  131. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  132. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  133. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
  134. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  135. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
  136. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  137. package/dist/components/inputs/Selection/Select/Select.js +5 -132
  138. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  139. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  140. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  141. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  142. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  143. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
  144. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  145. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  146. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  147. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  148. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  149. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  150. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  151. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  152. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  153. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  154. package/dist/components/inputs/Selection/shared/select.context.js +34 -57
  155. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  157. package/dist/components/inputs/Slider/Slider.js +74 -250
  158. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  159. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  160. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  161. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  162. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  163. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  164. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  165. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  166. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  167. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  168. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  169. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  170. package/dist/components/inputs/Toggle/Toggle.js +37 -189
  171. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  172. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  173. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  174. package/dist/components/inputs/shared/CheckContent.js +11 -21
  175. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  176. package/dist/components/inputs/shared/InputClear.js +13 -79
  177. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  178. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  179. package/dist/components/inputs/shared/input.cva.js +4 -32
  180. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  181. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  182. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  183. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  184. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  185. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  186. package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
  187. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  188. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  189. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  190. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  191. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  192. package/dist/components/segment/Segment.js +57 -218
  193. package/dist/components/segment/SegmentItem.js +10 -67
  194. package/dist/components/shared/pagination/Pagination.js +22 -108
  195. package/dist/components/shared/pagination/PaginationList.js +64 -167
  196. package/dist/components/status/Alert/Alert.js +30 -97
  197. package/dist/components/status/Loader/Loader.js +22 -77
  198. package/dist/components/status/Toast/Toast.js +13 -21
  199. package/dist/components/status/Toast/useToast.js +57 -62
  200. package/dist/components/table/ColumnConfig.js +54 -158
  201. package/dist/components/table/InfiniteTable.js +16 -67
  202. package/dist/components/table/PaginatedTable.js +18 -84
  203. package/dist/components/table/Table.js +27 -28
  204. package/dist/components/text/Link/Link.js +7 -19
  205. package/dist/components/text/Typography/Typography.js +8 -23
  206. package/dist/config/confirmation.context.js +1 -1
  207. package/dist/config/link.context.js +9 -23
  208. package/dist/config/router.context.js +16 -42
  209. package/dist/config/theme.context.js +45 -98
  210. package/dist/config/uiConfig.context.d.ts +6 -16
  211. package/dist/config/uiConfig.context.js +13 -56
  212. package/dist/config/uiStyle.context.d.ts +4 -27
  213. package/dist/config/uiStyle.context.js +5 -15
  214. package/dist/helpers/dynamicInputs.d.ts +5 -5
  215. package/dist/helpers/dynamicInputs.js +0 -3
  216. package/dist/hooks/useBreakpoint.js +3 -16
  217. package/dist/hooks/useDebounceCallback.js +17 -51
  218. package/dist/hooks/useFilters.js +64 -125
  219. package/dist/hooks/useForm.js +8 -42
  220. package/dist/hooks/useFormAutosave.js +30 -101
  221. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  222. package/dist/hooks/useIntersectionObserver.js +24 -91
  223. package/dist/hooks/useLocalStorage.js +10 -43
  224. package/dist/hooks/useLongPressRepeat.js +20 -55
  225. package/dist/hooks/usePagination.js +19 -49
  226. package/dist/hooks/useScrollableListBox.js +16 -37
  227. package/dist/hooks/useSorting.js +28 -69
  228. package/dist/hooks/useStateAndRef.js +7 -21
  229. package/dist/hooks/useTableColumnConfig.js +31 -124
  230. package/dist/hooks/useTranslationMemo.js +5 -25
  231. package/dist/index.d.ts +0 -7
  232. package/dist/index.js +3 -5
  233. package/dist/tw-ui-plugin.js +0 -2
  234. package/dist/utils/date-time.utils.d.ts +10 -31
  235. package/dist/utils/date-time.utils.js +22 -123
  236. package/dist/utils/dom.utils.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
  239. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  240. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  241. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
  242. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
  243. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  244. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  245. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
  246. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
  247. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  248. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  249. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  250. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  251. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  252. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
  254. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  255. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  256. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  257. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  258. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  259. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  260. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
  261. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  262. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  263. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
  264. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
  265. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  266. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  267. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  268. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  269. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  270. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  271. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  272. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
  273. package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
  274. package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
  275. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  276. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  277. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  278. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  279. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  280. package/dist/hooks/useQueryAutocomplete.js +0 -57
  281. package/dist/utils/query.utils.d.ts +0 -4
  282. package/dist/utils/query.utils.js +0 -8
@@ -4,367 +4,145 @@ import { Typography } from "../../../text/Typography/Typography.js";
4
4
  import "../../../../config/i18n.js";
5
5
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
6
6
  import { InputClear } from "../../shared/InputClear.js";
7
- import { inputBase, inputClearClass, inputSize } from "../../shared/input.cva.js";
7
+ import { inputBase, inputSize } from "../../shared/input.cva.js";
8
8
  import { SelectInputTags } from "./SelectInputTags.js";
9
9
  import { SelectContext } from "./select.context.js";
10
- import { selectInputTagsContentWrapperCva } from "./selectInput.cva.js";
11
- import { c } from "react/compiler-runtime";
12
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
11
  import { clsx } from "clsx";
14
- import { use, useRef, useState } from "react";
12
+ import { use, useMemo, useRef, useState } from "react";
15
13
  import { Button, ComboBoxStateContext, Input } from "react-aria-components";
16
14
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
17
15
  import { useTranslation } from "react-i18next";
18
16
  //#region src/components/inputs/Selection/shared/SelectInput.tsx
19
- var SelectInput = (t0) => {
20
- const $0 = c(111);
21
- const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, fireBlurOnChange, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props } = t0;
17
+ var SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur, ...props }) => {
22
18
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
23
19
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
24
- const inputClearClassCva = UIStyle.useCva("input.clearClassCva", inputClearClass);
25
20
  const { t } = useTranslation("ui");
26
21
  const state = use(ComboBoxStateContext);
27
- let t1;
28
- if ($0[0] !== isDisabled) {
29
- t1 = { isDisabled };
30
- $0[0] = isDisabled;
31
- $0[1] = t1;
32
- } else t1 = $0[1];
33
- const { hoverProps, isHovered } = useHover(t1);
22
+ const { hoverProps, isHovered } = useHover({ isDisabled });
34
23
  const [isFocused, setIsFocused] = useState(false);
35
- let t2;
36
- if ($0[2] === Symbol.for("react.memo_cache_sentinel")) {
37
- t2 = { onFocusWithinChange: setIsFocused };
38
- $0[2] = t2;
39
- } else t2 = $0[2];
40
- const { focusWithinProps } = useFocusWithin(t2);
24
+ const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
41
25
  const { isFocusVisible } = useFocusVisible();
42
26
  const inputRef = useRef(null);
43
27
  const { fieldState, isOpen, setIsOpen, listItems, selectedItems, onChange, onClear, onRemove, isMultiple, isLoading } = SelectContext.useSelect();
44
28
  const isEmpty = selectedItems.length === 0;
45
29
  const showTags = isMultiple && !isEmpty;
46
- const showClearButton = isClearable && isHovered && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
47
- let t3;
48
- bb0: {
49
- let t4;
50
- if ($0[3] !== headerProps) {
51
- t4 = headerProps ?? {};
52
- $0[3] = headerProps;
53
- $0[4] = t4;
54
- } else t4 = $0[4];
55
- const { labelProps: headerLabelProps } = t4;
56
- if (!(as && ["filter", "floating"].includes(as)) || isSearchable) {
57
- t3 = headerLabelProps;
58
- break bb0;
59
- }
60
- const t5 = headerLabelProps?.className;
61
- let t6;
62
- if ($0[5] !== t5) {
63
- t6 = clsx(t5, "pointer-events-none");
64
- $0[5] = t5;
65
- $0[6] = t6;
66
- } else t6 = $0[6];
67
- let t7;
68
- if ($0[7] !== headerLabelProps || $0[8] !== t6) {
69
- t7 = {
70
- ...headerLabelProps,
71
- className: t6
72
- };
73
- $0[7] = headerLabelProps;
74
- $0[8] = t6;
75
- $0[9] = t7;
76
- } else t7 = $0[9];
77
- t3 = t7;
78
- }
79
- const labelProps = t3;
80
- let t4;
81
- if ($0[10] !== fieldState.inputValue || $0[11] !== fieldState.value || $0[12] !== fireBlurOnChange || $0[13] !== isLoading || $0[14] !== isMultiple || $0[15] !== listItems || $0[16] !== onBlur || $0[17] !== onChange || $0[18] !== onCloseComboBox || $0[19] !== state) {
82
- t4 = (e) => {
83
- if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
84
- e.preventDefault();
85
- onChange(listItems[0].id);
86
- if (fireBlurOnChange) onBlur?.({});
87
- onCloseComboBox?.(state);
88
- }
89
- if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) {
90
- onChange(fieldState.value.slice(0, -1));
91
- if (fireBlurOnChange) onBlur?.({});
92
- }
93
- };
94
- $0[10] = fieldState.inputValue;
95
- $0[11] = fieldState.value;
96
- $0[12] = fireBlurOnChange;
97
- $0[13] = isLoading;
98
- $0[14] = isMultiple;
99
- $0[15] = listItems;
100
- $0[16] = onBlur;
101
- $0[17] = onChange;
102
- $0[18] = onCloseComboBox;
103
- $0[19] = state;
104
- $0[20] = t4;
105
- } else t4 = $0[20];
106
- const onKeyDown = t4;
107
- let t5;
108
- if ($0[21] !== isDisabled || $0[22] !== isOpen || $0[23] !== isSearchable || $0[24] !== setIsOpen) {
109
- t5 = () => {
110
- if (isDisabled) return;
111
- if (!isSearchable) {
112
- setIsOpen(!isOpen);
113
- return;
114
- }
115
- inputRef.current?.focus();
30
+ const showClearButton = isClearable && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
31
+ const labelProps = useMemo(() => {
32
+ const { labelProps: headerLabelProps } = headerProps ?? {};
33
+ if (!(as && ["filter", "floating"].includes(as)) || isSearchable) return headerLabelProps;
34
+ return {
35
+ ...headerLabelProps,
36
+ className: clsx(headerLabelProps?.className, "pointer-events-none")
116
37
  };
117
- $0[21] = isDisabled;
118
- $0[22] = isOpen;
119
- $0[23] = isSearchable;
120
- $0[24] = setIsOpen;
121
- $0[25] = t5;
122
- } else t5 = $0[25];
123
- const onClick = t5;
124
- const t6 = inputBaseCva({
125
- variant,
126
- as,
127
- ...props,
128
- className: clsx("group/select-content relative flex px-0!", !isDisabled && isSearchable && "cursor-text", className)
129
- });
130
- const t7 = "";
131
- const t8 = isDisabled || void 0;
132
- const t9 = isDisabled || void 0;
133
- const t10 = isHovered || void 0;
134
- const t11 = isOpen || isFocused || void 0;
135
- const t12 = isFocused || void 0;
136
- const t13 = isFocused && isSearchable || void 0;
137
- const t14 = isFocused && isFocusVisible || void 0;
138
- const t15 = !isEmpty || void 0;
139
- const t16 = fieldState.searchValue !== "" || void 0;
140
- const t17 = isInvalid || void 0;
141
- const t18 = isEmpty || void 0;
142
- const t19 = !isEmpty || void 0;
143
- const t20 = isRequired || void 0;
144
- const t21 = isDirty || void 0;
145
- const t22 = "";
146
- const t23 = clsx("relative flex flex-1 items-center gap-input-gap-input-text-to-elements truncate", !isDisabled && isSearchable && "cursor-text", !isDisabled && !isSearchable && "cursor-pointer", inputSizeCva({
38
+ }, [
147
39
  as,
148
- size,
149
- ...props
150
- }));
151
- let t24;
152
- if ($0[26] !== as || $0[27] !== headerProps || $0[28] !== labelProps) {
153
- t24 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
40
+ headerProps,
41
+ isSearchable
42
+ ]);
43
+ const onKeyDown = (e) => {
44
+ if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
45
+ e.preventDefault();
46
+ onChange(listItems[0].id);
47
+ onCloseComboBox?.(state);
48
+ }
49
+ if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) onChange(fieldState.value.slice(0, -1));
50
+ };
51
+ const onClick = () => {
52
+ if (isDisabled) return;
53
+ if (!isSearchable) {
54
+ setIsOpen(!isOpen);
55
+ return;
56
+ }
57
+ inputRef.current?.focus();
58
+ };
59
+ return /* @__PURE__ */ jsxs("div", {
60
+ ref,
61
+ className: inputBaseCva({
62
+ variant,
154
63
  as,
155
- ...headerProps,
156
- labelProps
157
- });
158
- $0[26] = as;
159
- $0[27] = headerProps;
160
- $0[28] = labelProps;
161
- $0[29] = t24;
162
- } else t24 = $0[29];
163
- let t25;
164
- if ($0[30] !== leadingContent) {
165
- t25 = leadingContent && /* @__PURE__ */ jsx("div", {
166
- className: "ml-input-side-default flex shrink-0 items-center",
167
- children: leadingContent
168
- });
169
- $0[30] = leadingContent;
170
- $0[31] = t25;
171
- } else t25 = $0[31];
172
- let t26;
173
- if ($0[32] !== as || $0[33] !== collapseAfter || $0[34] !== fieldProps || $0[35] !== inputClassName || $0[36] !== isDisabled || $0[37] !== isSearchable || $0[38] !== onBlur || $0[39] !== onKeyDown || $0[40] !== onRemove || $0[41] !== placeholder || $0[42] !== selectedItems || $0[43] !== selectedTagsType || $0[44] !== showTags) {
174
- t26 = (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
175
- className: selectInputTagsContentWrapperCva({ isSearchable }),
176
- children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
177
- selectedItems,
64
+ ...props,
65
+ className: clsx("group/select-content relative flex px-0!", !isDisabled && isSearchable && "cursor-text", className)
66
+ }),
67
+ "data-rac": "",
68
+ "data-disabled": isDisabled || void 0,
69
+ "data-hovered": isHovered || void 0,
70
+ "data-focused": isOpen || isFocused || void 0,
71
+ "data-focus-within": isFocused || void 0,
72
+ "data-searchable-focus-within": isFocused && isSearchable || void 0,
73
+ "data-focus-visible": isFocused && isFocusVisible || void 0,
74
+ "data-has-selection": !isEmpty || void 0,
75
+ "data-has-search": fieldState.searchValue !== "" || void 0,
76
+ "data-invalid": isInvalid || void 0,
77
+ "data-is-empty": isEmpty || void 0,
78
+ "data-select-input": "",
79
+ ...hoverProps,
80
+ ...focusWithinProps,
81
+ children: [
82
+ /* @__PURE__ */ jsxs("div", {
83
+ className: clsx("relative flex flex-1 items-center gap-input-gap-input-text-to-elements truncate", !isDisabled && isSearchable && "cursor-text", !isDisabled && !isSearchable && "cursor-pointer", inputSizeCva({
84
+ as,
85
+ size,
86
+ ...props
87
+ })),
88
+ onClick,
89
+ children: [
90
+ as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
91
+ as,
92
+ ...headerProps,
93
+ labelProps
94
+ }),
95
+ (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
96
+ className: clsx("flex flex-1 flex-wrap gap-input-gap-input-text-to-elements truncate", !isSearchable && "pointer-events-none z-1"),
97
+ children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
98
+ selectedItems,
99
+ isDisabled,
100
+ collapseAfter,
101
+ selectedTagsType,
102
+ onRemove
103
+ }), isSearchable && /* @__PURE__ */ jsx(Input, {
104
+ ref: inputRef,
105
+ placeholder: as === "floating" ? void 0 : placeholder,
106
+ onBlur,
107
+ className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", inputClassName),
108
+ onKeyDown,
109
+ ...fieldProps
110
+ })]
111
+ }),
112
+ !isSearchable && /* @__PURE__ */ jsxs(Button, {
113
+ isDisabled,
114
+ onPress: () => setIsOpen(!isOpen),
115
+ onBlur,
116
+ "data-type": "select-trigger",
117
+ className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0"),
118
+ ...fieldProps,
119
+ children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
120
+ size: "label-1",
121
+ className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
122
+ children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
123
+ })]
124
+ })
125
+ ]
126
+ }),
127
+ isClearable && /* @__PURE__ */ jsx(InputClear, {
128
+ onClear,
129
+ show: showClearButton
130
+ }),
131
+ !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
132
+ excludeFromTabOrder: true,
133
+ "aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
134
+ className: clsx("self-stretch pl-1-5 outline-none", inputSizeCva({ size })),
178
135
  isDisabled,
179
- collapseAfter,
180
- selectedTagsType,
181
- onRemove
182
- }), isSearchable && /* @__PURE__ */ jsx(Input, {
183
- ref: inputRef,
184
- placeholder: as === "floating" ? void 0 : placeholder,
185
- onBlur,
186
- className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", inputClassName),
187
- onKeyDown,
188
- ...fieldProps
189
- })]
190
- });
191
- $0[32] = as;
192
- $0[33] = collapseAfter;
193
- $0[34] = fieldProps;
194
- $0[35] = inputClassName;
195
- $0[36] = isDisabled;
196
- $0[37] = isSearchable;
197
- $0[38] = onBlur;
198
- $0[39] = onKeyDown;
199
- $0[40] = onRemove;
200
- $0[41] = placeholder;
201
- $0[42] = selectedItems;
202
- $0[43] = selectedTagsType;
203
- $0[44] = showTags;
204
- $0[45] = t26;
205
- } else t26 = $0[45];
206
- let t27;
207
- if ($0[46] !== as || $0[47] !== fieldProps || $0[48] !== isDisabled || $0[49] !== isEmpty || $0[50] !== isMultiple || $0[51] !== isOpen || $0[52] !== isSearchable || $0[53] !== onBlur || $0[54] !== placeholder || $0[55] !== selectedItems[0] || $0[56] !== setIsOpen || $0[57] !== showSelectionContent || $0[58] !== showTags) {
208
- t27 = !isSearchable && /* @__PURE__ */ jsxs(Button, {
209
- isDisabled,
210
- onPress: () => setIsOpen(!isOpen),
211
- onBlur,
212
- "data-type": "select-trigger",
213
- className: clsx("w-full truncate text-start outline-none disabled:text-interactive-text-secondary-disabled", showTags && "absolute inset-0 z-0"),
214
- ...fieldProps,
215
- children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
216
- size: "label-1",
217
- className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
218
- children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
219
- })]
220
- });
221
- $0[46] = as;
222
- $0[47] = fieldProps;
223
- $0[48] = isDisabled;
224
- $0[49] = isEmpty;
225
- $0[50] = isMultiple;
226
- $0[51] = isOpen;
227
- $0[52] = isSearchable;
228
- $0[53] = onBlur;
229
- $0[54] = placeholder;
230
- $0[55] = selectedItems[0];
231
- $0[56] = setIsOpen;
232
- $0[57] = showSelectionContent;
233
- $0[58] = showTags;
234
- $0[59] = t27;
235
- } else t27 = $0[59];
236
- let t28;
237
- if ($0[60] !== onClick || $0[61] !== t23 || $0[62] !== t24 || $0[63] !== t25 || $0[64] !== t26 || $0[65] !== t27) {
238
- t28 = /* @__PURE__ */ jsxs("div", {
239
- className: t23,
240
- onClick,
241
- children: [
242
- t24,
243
- t25,
244
- t26,
245
- t27
246
- ]
247
- });
248
- $0[60] = onClick;
249
- $0[61] = t23;
250
- $0[62] = t24;
251
- $0[63] = t25;
252
- $0[64] = t26;
253
- $0[65] = t27;
254
- $0[66] = t28;
255
- } else t28 = $0[66];
256
- let t29;
257
- if ($0[67] !== as || $0[68] !== fireBlurOnChange || $0[69] !== inputClearClassCva || $0[70] !== isClearable || $0[71] !== onBlur || $0[72] !== onClear || $0[73] !== showClearButton) {
258
- t29 = isClearable && /* @__PURE__ */ jsx(InputClear, {
259
- onClear: () => {
260
- onClear();
261
- if (fireBlurOnChange) onBlur?.({});
262
- },
263
- className: inputClearClassCva({ as }),
264
- show: showClearButton
265
- });
266
- $0[67] = as;
267
- $0[68] = fireBlurOnChange;
268
- $0[69] = inputClearClassCva;
269
- $0[70] = isClearable;
270
- $0[71] = onBlur;
271
- $0[72] = onClear;
272
- $0[73] = showClearButton;
273
- $0[74] = t29;
274
- } else t29 = $0[74];
275
- let t30;
276
- if ($0[75] !== trailingContent) {
277
- t30 = trailingContent && /* @__PURE__ */ jsx("div", {
278
- className: "flex shrink-0 items-center",
279
- children: trailingContent
280
- });
281
- $0[75] = trailingContent;
282
- $0[76] = t30;
283
- } else t30 = $0[76];
284
- let t31;
285
- if ($0[77] !== hideDropdownIcon || $0[78] !== inputSizeCva || $0[79] !== isDisabled || $0[80] !== isOpen || $0[81] !== isSearchable || $0[82] !== setIsOpen || $0[83] !== size || $0[84] !== t) {
286
- t31 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
287
- excludeFromTabOrder: true,
288
- "aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
289
- className: clsx("self-stretch pl-1-5 outline-none", inputSizeCva({ size })),
290
- isDisabled,
291
- onPress: () => {
292
- if (!isSearchable) setIsOpen(!isOpen);
293
- },
294
- children: /* @__PURE__ */ jsx(ArrowDropDownIcon, {
295
- className: clsx("size-6 shrink-0", isOpen && "rotate-180", isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle"),
296
- "aria-hidden": "true"
136
+ onPress: () => {
137
+ if (!isSearchable) setIsOpen(!isOpen);
138
+ },
139
+ children: /* @__PURE__ */ jsx(ArrowDropDownIcon, {
140
+ className: clsx("size-6 shrink-0", isOpen && "rotate-180", isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle"),
141
+ "aria-hidden": "true"
142
+ })
297
143
  })
298
- });
299
- $0[77] = hideDropdownIcon;
300
- $0[78] = inputSizeCva;
301
- $0[79] = isDisabled;
302
- $0[80] = isOpen;
303
- $0[81] = isSearchable;
304
- $0[82] = setIsOpen;
305
- $0[83] = size;
306
- $0[84] = t;
307
- $0[85] = t31;
308
- } else t31 = $0[85];
309
- let t32;
310
- if ($0[86] !== focusWithinProps || $0[87] !== hoverProps || $0[88] !== onFocusCapture || $0[89] !== onMouseEnter || $0[90] !== ref || $0[91] !== t10 || $0[92] !== t11 || $0[93] !== t12 || $0[94] !== t13 || $0[95] !== t14 || $0[96] !== t15 || $0[97] !== t16 || $0[98] !== t17 || $0[99] !== t18 || $0[100] !== t19 || $0[101] !== t20 || $0[102] !== t21 || $0[103] !== t28 || $0[104] !== t29 || $0[105] !== t30 || $0[106] !== t31 || $0[107] !== t6 || $0[108] !== t8 || $0[109] !== t9) {
311
- t32 = /* @__PURE__ */ jsxs("div", {
312
- ref,
313
- className: t6,
314
- "data-rac": t7,
315
- "data-disabled": t8,
316
- "data-is-disabled": t9,
317
- "data-hovered": t10,
318
- "data-focused": t11,
319
- "data-focus-within": t12,
320
- "data-searchable-focus-within": t13,
321
- "data-focus-visible": t14,
322
- "data-has-selection": t15,
323
- "data-has-search": t16,
324
- "data-invalid": t17,
325
- "data-is-empty": t18,
326
- "data-is-filled": t19,
327
- "data-is-required": t20,
328
- "data-is-dirty": t21,
329
- "data-select-input": t22,
330
- onMouseEnter,
331
- onFocusCapture,
332
- ...hoverProps,
333
- ...focusWithinProps,
334
- children: [
335
- t28,
336
- t29,
337
- t30,
338
- t31
339
- ]
340
- });
341
- $0[86] = focusWithinProps;
342
- $0[87] = hoverProps;
343
- $0[88] = onFocusCapture;
344
- $0[89] = onMouseEnter;
345
- $0[90] = ref;
346
- $0[91] = t10;
347
- $0[92] = t11;
348
- $0[93] = t12;
349
- $0[94] = t13;
350
- $0[95] = t14;
351
- $0[96] = t15;
352
- $0[97] = t16;
353
- $0[98] = t17;
354
- $0[99] = t18;
355
- $0[100] = t19;
356
- $0[101] = t20;
357
- $0[102] = t21;
358
- $0[103] = t28;
359
- $0[104] = t29;
360
- $0[105] = t30;
361
- $0[106] = t31;
362
- $0[107] = t6;
363
- $0[108] = t8;
364
- $0[109] = t9;
365
- $0[110] = t32;
366
- } else t32 = $0[110];
367
- return t32;
144
+ ]
145
+ });
368
146
  };
369
147
  //#endregion
370
148
  export { SelectInput };
@@ -1,105 +1,31 @@
1
1
  import { Tag } from "../../../text/Tag/Tag.js";
2
- import { c } from "react/compiler-runtime";
3
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
4
  //#region src/components/inputs/Selection/shared/SelectInputTags.tsx
5
- var SelectInputTags = (t0) => {
6
- const $ = c(25);
7
- const { selectedItems, isDisabled, selectedTagsType, collapseAfter, onRemove } = t0;
8
- let t1;
9
- bb0: {
10
- if (!collapseAfter || selectedItems.length <= collapseAfter) {
11
- let t2;
12
- if ($[0] !== selectedItems) {
13
- t2 = {
14
- displayedItems: selectedItems,
15
- remainingCount: 0
16
- };
17
- $[0] = selectedItems;
18
- $[1] = t2;
19
- } else t2 = $[1];
20
- t1 = t2;
21
- break bb0;
22
- }
23
- let t2;
24
- if ($[2] !== collapseAfter || $[3] !== selectedItems) {
25
- t2 = selectedItems.slice(0, collapseAfter - 1);
26
- $[2] = collapseAfter;
27
- $[3] = selectedItems;
28
- $[4] = t2;
29
- } else t2 = $[4];
30
- const t3 = selectedItems.length - (collapseAfter - 1);
31
- let t4;
32
- if ($[5] !== t2 || $[6] !== t3) {
33
- t4 = {
34
- displayedItems: t2,
35
- remainingCount: t3
36
- };
37
- $[5] = t2;
38
- $[6] = t3;
39
- $[7] = t4;
40
- } else t4 = $[7];
41
- t1 = t4;
42
- }
43
- const { displayedItems, remainingCount } = t1;
44
- if (selectedTagsType === "tags") {
45
- let t2;
46
- if ($[8] !== displayedItems || $[9] !== isDisabled || $[10] !== onRemove) {
47
- let t3;
48
- if ($[12] !== isDisabled || $[13] !== onRemove) {
49
- t3 = (item) => /* @__PURE__ */ jsx(Tag, {
50
- dismissable: true,
51
- isDisabled,
52
- onDismiss: () => onRemove(item.id),
53
- excludeFromTabOrder: true,
54
- className: "z-1",
55
- children: item.label
56
- }, item.id);
57
- $[12] = isDisabled;
58
- $[13] = onRemove;
59
- $[14] = t3;
60
- } else t3 = $[14];
61
- t2 = displayedItems.map(t3);
62
- $[8] = displayedItems;
63
- $[9] = isDisabled;
64
- $[10] = onRemove;
65
- $[11] = t2;
66
- } else t2 = $[11];
67
- let t3;
68
- if ($[15] !== isDisabled || $[16] !== remainingCount) {
69
- t3 = remainingCount > 0 && /* @__PURE__ */ jsx(Tag, {
70
- isDisabled,
71
- excludeFromTabOrder: true,
72
- children: `+${remainingCount} more`
73
- }, "remaining-count");
74
- $[15] = isDisabled;
75
- $[16] = remainingCount;
76
- $[17] = t3;
77
- } else t3 = $[17];
78
- let t4;
79
- if ($[18] !== t2 || $[19] !== t3) {
80
- t4 = /* @__PURE__ */ jsxs(Fragment, { children: [t2, t3] });
81
- $[18] = t2;
82
- $[19] = t3;
83
- $[20] = t4;
84
- } else t4 = $[20];
85
- return t4;
86
- }
87
- let t2;
88
- if ($[21] !== selectedItems) {
89
- t2 = selectedItems.map(_temp).join(", ");
90
- $[21] = selectedItems;
91
- $[22] = t2;
92
- } else t2 = $[22];
93
- let t3;
94
- if ($[23] !== t2) {
95
- t3 = /* @__PURE__ */ jsx("p", { children: t2 });
96
- $[23] = t2;
97
- $[24] = t3;
98
- } else t3 = $[24];
99
- return t3;
5
+ var SelectInputTags = ({ selectedItems, isDisabled, selectedTagsType, collapseAfter, onRemove }) => {
6
+ const { displayedItems, remainingCount } = useMemo(() => {
7
+ if (!collapseAfter || selectedItems.length <= collapseAfter) return {
8
+ displayedItems: selectedItems,
9
+ remainingCount: 0
10
+ };
11
+ return {
12
+ displayedItems: selectedItems.slice(0, collapseAfter - 1),
13
+ remainingCount: selectedItems.length - (collapseAfter - 1)
14
+ };
15
+ }, [selectedItems, collapseAfter]);
16
+ if (selectedTagsType === "tags") return /* @__PURE__ */ jsxs(Fragment, { children: [displayedItems.map((item) => /* @__PURE__ */ jsx(Tag, {
17
+ dismissable: true,
18
+ isDisabled,
19
+ onDismiss: () => onRemove(item.id),
20
+ excludeFromTabOrder: true,
21
+ className: "z-1",
22
+ children: item.label
23
+ }, item.id)), remainingCount > 0 && /* @__PURE__ */ jsx(Tag, {
24
+ isDisabled,
25
+ excludeFromTabOrder: true,
26
+ children: `+${remainingCount} more`
27
+ }, "remaining-count")] });
28
+ return /* @__PURE__ */ jsx("p", { children: selectedItems.map((item) => item.label).join(", ") });
100
29
  };
101
- function _temp(item_0) {
102
- return item_0.label;
103
- }
104
30
  //#endregion
105
31
  export { SelectInputTags };
@@ -1,9 +1,9 @@
1
1
  import { AriaListBoxProps } from 'react-aria';
2
2
  import { SelectBaseProps } from './SelectBase';
3
3
  import { SelectItem } from './select.types';
4
- export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable" | "virtualizerOptions" | "totalItems" | "hasLoadMore">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
4
+ export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable" | "virtualizerOptions">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
5
5
  className?: string;
6
6
  isScrollable?: boolean;
7
7
  onClose?: () => void;
8
8
  }
9
- export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, virtualizerOptions, totalItems, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, virtualizerOptions, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;