@povio/ui 2.3.0-rc.5 → 2.3.0-rc.7

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