@povio/ui 2.3.0-rc.3 → 2.3.0-rc.31

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 (218) 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.d.ts +1 -0
  61. package/dist/components/inputs/Checkbox/Checkbox.js +188 -34
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  63. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
  64. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +267 -87
  65. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  66. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +347 -182
  67. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  68. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +177 -69
  69. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
  70. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +530 -157
  71. package/dist/components/inputs/DateTime/shared/Calendar.js +333 -137
  72. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
  73. package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
  74. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
  75. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
  76. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  77. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  78. package/dist/components/inputs/DateTime/shared/DateField.js +295 -112
  79. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -1
  80. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +375 -146
  81. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  82. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  83. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  84. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  85. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  86. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  87. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  88. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +3 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +208 -70
  90. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  91. package/dist/components/inputs/File/FileUpload.js +86 -44
  92. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  93. package/dist/components/inputs/File/InputUpload.js +317 -79
  94. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  95. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  96. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  97. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  98. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  99. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  100. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  101. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  102. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  103. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  104. package/dist/components/inputs/FormField/FormField.js +119 -37
  105. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  106. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  107. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  108. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  109. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  110. package/dist/components/inputs/Input/NumberInput/NumberInput.js +392 -123
  111. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  112. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +463 -146
  113. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  114. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  115. package/dist/components/inputs/Input/TextInput/TextInput.js +370 -121
  116. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  117. package/dist/components/inputs/Inputs/Form.js +40 -11
  118. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
  119. package/dist/components/inputs/Inputs/InputItem.js +65 -16
  120. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  121. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -0
  122. package/dist/components/inputs/RadioGroup/RadioGroup.js +333 -107
  123. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +145 -50
  124. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
  125. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  126. package/dist/components/inputs/Selection/Select/Select.js +139 -44
  127. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  128. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  129. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  130. package/dist/components/inputs/Selection/shared/SelectInput.js +326 -136
  131. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  132. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  133. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  134. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  135. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  136. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  137. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  138. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  139. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  140. package/dist/components/inputs/Selection/shared/select.context.js +44 -38
  141. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  142. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  143. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  144. package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
  145. package/dist/components/inputs/Skeleton/InputFrame.js +444 -124
  146. package/dist/components/inputs/Slider/Slider.js +247 -74
  147. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  148. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  149. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  150. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  151. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  152. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  153. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  154. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  155. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  156. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  157. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  158. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
  159. package/dist/components/inputs/Toggle/Toggle.js +206 -41
  160. package/dist/components/inputs/shared/CheckContent.js +21 -10
  161. package/dist/components/inputs/shared/InputClear.js +78 -21
  162. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  163. package/dist/components/inputs/shared/input.cva.js +13 -3
  164. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
  165. package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
  166. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  167. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  168. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  169. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  170. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  171. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  172. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  173. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  174. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  175. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  176. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  177. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  178. package/dist/components/segment/Segment.js +218 -57
  179. package/dist/components/segment/SegmentItem.js +67 -10
  180. package/dist/components/shared/pagination/Pagination.js +108 -22
  181. package/dist/components/shared/pagination/PaginationList.js +167 -64
  182. package/dist/components/status/Alert/Alert.js +97 -30
  183. package/dist/components/status/Loader/Loader.js +77 -22
  184. package/dist/components/status/Toast/Toast.js +21 -13
  185. package/dist/components/status/Toast/useToast.js +62 -57
  186. package/dist/components/table/ColumnConfig.js +158 -54
  187. package/dist/components/table/InfiniteTable.js +67 -16
  188. package/dist/components/table/PaginatedTable.js +84 -18
  189. package/dist/components/table/Table.js +28 -27
  190. package/dist/components/text/Link/Link.js +19 -7
  191. package/dist/components/text/Typography/Typography.js +23 -8
  192. package/dist/config/confirmation.context.js +1 -1
  193. package/dist/config/link.context.js +23 -9
  194. package/dist/config/router.context.js +42 -16
  195. package/dist/config/theme.context.js +98 -45
  196. package/dist/config/uiConfig.context.d.ts +4 -4
  197. package/dist/config/uiConfig.context.js +50 -11
  198. package/dist/config/uiStyle.context.js +15 -5
  199. package/dist/helpers/dynamicInputs.d.ts +1 -1
  200. package/dist/hooks/useBreakpoint.js +16 -3
  201. package/dist/hooks/useDebounceCallback.js +51 -17
  202. package/dist/hooks/useFilters.js +125 -64
  203. package/dist/hooks/useForm.js +42 -8
  204. package/dist/hooks/useFormAutosave.js +101 -30
  205. package/dist/hooks/useIntersectionObserver.js +86 -32
  206. package/dist/hooks/useLocalStorage.js +43 -10
  207. package/dist/hooks/useLongPressRepeat.js +55 -20
  208. package/dist/hooks/usePagination.js +49 -19
  209. package/dist/hooks/useQueryAutocomplete.js +1 -0
  210. package/dist/hooks/useScrollableListBox.js +37 -16
  211. package/dist/hooks/useSorting.js +69 -28
  212. package/dist/hooks/useStateAndRef.js +21 -7
  213. package/dist/hooks/useTableColumnConfig.js +124 -31
  214. package/dist/hooks/useTranslationMemo.js +25 -5
  215. package/dist/index.js +2 -2
  216. package/dist/utils/date-time.utils.d.ts +2 -0
  217. package/dist/utils/date-time.utils.js +17 -13
  218. package/package.json +1 -1
@@ -1,59 +1,40 @@
1
- import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
2
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
2
  import { InputFrame } from "../../Skeleton/InputFrame.js";
4
3
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
4
+ import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
5
5
  import { SelectBase } from "../shared/SelectBase.js";
6
+ import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
6
7
  import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
8
+ import { c } from "react/compiler-runtime";
7
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
10
  import { clsx } from "clsx";
9
11
  import { useRef, useState } from "react";
10
12
  import { mergeRefs } from "@react-aria/utils";
11
- import { Controller, useWatch } from "react-hook-form";
13
+ import { Controller } from "react-hook-form";
12
14
  //#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
13
- function _Autocomplete(props) {
14
- if ("formControl" in props && props.formControl) {
15
- const { ignoreInputValueFiltering = true, formControl, ref, ...innerProps } = props;
16
- return /* @__PURE__ */ jsx(Controller, {
17
- control: formControl.control,
18
- name: formControl.name,
19
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(SelectBase, {
20
- ...innerProps,
21
- ref: mergeRefs(ref, field.ref),
22
- value: field.value,
23
- onChange: field.onChange,
24
- onBlur: field.onBlur,
25
- isDirty,
26
- isDisabled: field.disabled || props.isDisabled,
27
- error: props.error ?? error?.message,
28
- isSearchable: true,
29
- ignoreInputValueFiltering
30
- })
31
- });
32
- }
33
- return /* @__PURE__ */ jsx(SelectBase, {
34
- ...props,
35
- isSearchable: true
36
- });
37
- }
38
- function Autocomplete({ renderStaticInput, ...props }) {
15
+ function AutocompleteInner(t0) {
16
+ const $ = c(7);
17
+ const { renderStaticInput, isFormControlDisabled, ...props } = t0;
39
18
  const ui = UIConfig.useConfig();
40
19
  const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
41
20
  const rootRef = useRef(null);
42
- const { renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
43
- inputRef: rootRef,
44
- renderInput,
45
- setRenderInput,
46
- getFocusTarget: (root) => root.querySelector("input, [data-type='select-trigger'], button, [tabindex]")
47
- });
48
- const currentValue = ("formControl" in props && props.formControl ? useWatch({
49
- control: props.formControl.control,
50
- name: props.formControl.name
51
- }) : props.value) ?? props.value;
52
- let isFormControlDisabled = false;
53
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
21
+ let t1;
22
+ if ($[0] !== renderInput) {
23
+ t1 = {
24
+ inputRef: rootRef,
25
+ renderInput,
26
+ setRenderInput,
27
+ getFocusTarget: _temp
28
+ };
29
+ $[0] = renderInput;
30
+ $[1] = t1;
31
+ } else t1 = $[1];
32
+ const { renderRealInput, replayStaticInputChange } = useStaticInputHandoff(t1);
33
+ const currentValue = props.value;
54
34
  if (!renderInput && !!props.customTrigger) setRenderInput(true);
55
35
  if (!renderInput) {
56
36
  const as = props.as ?? ui.input.as;
37
+ const size = props.size ?? ui.input.size;
57
38
  let isDisabled = !!props.isDisabled;
58
39
  if (isFormControlDisabled) isDisabled = true;
59
40
  const mode = props.selectionMode ?? ui.select.selectionMode;
@@ -69,7 +50,12 @@ function Autocomplete({ renderStaticInput, ...props }) {
69
50
  selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
70
51
  });
71
52
  const isMultiple = mode === "multiple";
72
- const trailingContent = props.trailingContent || !props.hideDropdownIcon ? /* @__PURE__ */ jsxs(Fragment, { children: [props.trailingContent, !props.hideDropdownIcon ? /* @__PURE__ */ jsx(ArrowDropDownIcon, { className: "size-6 shrink-0 text-interactive-text-secondary-idle" }) : void 0] }) : void 0;
53
+ const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
54
+ trailingContent: props.trailingContent,
55
+ hideDropdownIcon: props.hideDropdownIcon,
56
+ isDisabled,
57
+ size
58
+ });
73
59
  const placeholder = as === "floating" ? null : props.placeholder;
74
60
  const shouldRenderPlaceholderAfterValue = mode !== "single" && props.placeholder && !isEmpty;
75
61
  const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
@@ -84,17 +70,25 @@ function Autocomplete({ renderStaticInput, ...props }) {
84
70
  dataHasSelection: !isEmpty,
85
71
  dataHasSearch: false
86
72
  };
73
+ const t2 = isDisabled;
74
+ const t3 = clsx("w-full", props.containerClassName);
75
+ const t4 = clsx(props.className, props.inputClassName);
76
+ let t5;
77
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
78
+ t5 = selectInputTagsContentWrapperCva({ isSearchable: true });
79
+ $[2] = t5;
80
+ } else t5 = $[2];
87
81
  return /* @__PURE__ */ jsx(InputFrame, {
88
82
  ...props,
89
- isDisabled,
90
- className: clsx("w-full", props.containerClassName),
91
- inputClassName: clsx(props.className, props.inputClassName),
92
- contentWrapperClassName: "flex flex-1 flex-wrap gap-input-gap-input-text-to-elements truncate",
83
+ isDisabled: t2,
84
+ className: t3,
85
+ inputClassName: t4,
86
+ contentWrapperClassName: t5,
93
87
  labelPlacement: "content-row",
94
88
  dataAttributes,
95
89
  renderStatic: true,
96
90
  onStaticInteract: renderRealInput,
97
- trailingClassName: "pl-1-5 gap-0!",
91
+ wrapTrailingContent: false,
98
92
  leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
99
93
  className: "ml-input-side-default flex shrink-0 items-center",
100
94
  children: props.leadingContent
@@ -116,10 +110,111 @@ function Autocomplete({ renderStaticInput, ...props }) {
116
110
  })] })
117
111
  });
118
112
  }
119
- return /* @__PURE__ */ jsx(_Autocomplete, {
120
- ...props,
121
- ref: mergeRefs(props.ref, rootRef)
122
- });
113
+ const T0 = SelectBase;
114
+ const t2 = mergeRefs(props.ref, rootRef);
115
+ let t3;
116
+ if ($[3] !== T0 || $[4] !== props || $[5] !== t2) {
117
+ t3 = /* @__PURE__ */ jsx(T0, {
118
+ ...props,
119
+ ref: t2,
120
+ isSearchable: true
121
+ });
122
+ $[3] = T0;
123
+ $[4] = props;
124
+ $[5] = t2;
125
+ $[6] = t3;
126
+ } else t3 = $[6];
127
+ return t3;
128
+ }
129
+ function _temp(root) {
130
+ return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
131
+ }
132
+ function Autocomplete(t0) {
133
+ const $ = c(23);
134
+ let props;
135
+ let renderStaticInput;
136
+ if ($[0] !== t0) {
137
+ ({renderStaticInput, ...props} = t0);
138
+ $[0] = t0;
139
+ $[1] = props;
140
+ $[2] = renderStaticInput;
141
+ } else {
142
+ props = $[1];
143
+ renderStaticInput = $[2];
144
+ }
145
+ if ("formControl" in props && props.formControl) {
146
+ let formControl;
147
+ let innerProps;
148
+ let ref;
149
+ let t1;
150
+ if ($[3] !== props) {
151
+ ({ignoreInputValueFiltering: t1, formControl, ref, ...innerProps} = props);
152
+ $[3] = props;
153
+ $[4] = formControl;
154
+ $[5] = innerProps;
155
+ $[6] = ref;
156
+ $[7] = t1;
157
+ } else {
158
+ formControl = $[4];
159
+ innerProps = $[5];
160
+ ref = $[6];
161
+ t1 = $[7];
162
+ }
163
+ const ignoreInputValueFiltering = t1 === void 0 ? true : t1;
164
+ const controlWithOptions = formControl.control;
165
+ let t2;
166
+ if ($[8] !== controlWithOptions._options?.disabled || $[9] !== ignoreInputValueFiltering || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
167
+ t2 = (t3) => {
168
+ const { field, fieldState: t4 } = t3;
169
+ const { error, isDirty } = t4;
170
+ return /* @__PURE__ */ jsx(AutocompleteInner, {
171
+ ...innerProps,
172
+ ref: mergeRefs(ref, field.ref),
173
+ value: field.value,
174
+ onChange: field.onChange,
175
+ onBlur: field.onBlur,
176
+ isDirty,
177
+ isDisabled: field.disabled || props.isDisabled,
178
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
179
+ error: props.error ?? error?.message,
180
+ ignoreInputValueFiltering,
181
+ renderStaticInput
182
+ });
183
+ };
184
+ $[8] = controlWithOptions._options?.disabled;
185
+ $[9] = ignoreInputValueFiltering;
186
+ $[10] = innerProps;
187
+ $[11] = props.error;
188
+ $[12] = props.isDisabled;
189
+ $[13] = ref;
190
+ $[14] = renderStaticInput;
191
+ $[15] = t2;
192
+ } else t2 = $[15];
193
+ let t3;
194
+ if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
195
+ t3 = /* @__PURE__ */ jsx(Controller, {
196
+ control: formControl.control,
197
+ name: formControl.name,
198
+ render: t2
199
+ });
200
+ $[16] = formControl.control;
201
+ $[17] = formControl.name;
202
+ $[18] = t2;
203
+ $[19] = t3;
204
+ } else t3 = $[19];
205
+ return t3;
206
+ }
207
+ let t1;
208
+ if ($[20] !== props || $[21] !== renderStaticInput) {
209
+ t1 = /* @__PURE__ */ jsx(AutocompleteInner, {
210
+ ...props,
211
+ renderStaticInput
212
+ });
213
+ $[20] = props;
214
+ $[21] = renderStaticInput;
215
+ $[22] = t1;
216
+ } else t1 = $[22];
217
+ return t1;
123
218
  }
124
219
  //#endregion
125
220
  export { Autocomplete };
@@ -6,6 +6,7 @@ import { jsx } from "react/jsx-runtime";
6
6
  import { useState } from "react";
7
7
  //#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
8
8
  var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }) => {
9
+ "use no memo";
9
10
  const ui = UIConfig.useConfig();
10
11
  const [search, setSearch] = useState("");
11
12
  const { onChange, ...restProps } = props;
@@ -22,8 +23,8 @@ var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingCo
22
23
  props.onBlur?.({ target: { value: null } });
23
24
  };
24
25
  const { isInitialQueryDisabled: _, ...autocompleteProps } = restProps;
25
- const onSearchChange = (value) => {
26
- setSearch(value);
26
+ const onSearchChange = (value_0) => {
27
+ setSearch(value_0);
27
28
  handleEnableQuery();
28
29
  };
29
30
  return /* @__PURE__ */ jsx(Autocomplete, {
@@ -2,41 +2,121 @@ import { UIConfig } from "../../../../config/uiConfig.context.js";
2
2
  import { Select } from "./Select.js";
3
3
  import { getQueryItems } from "../shared/querySelect.utils.js";
4
4
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { useState } from "react";
7
8
  //#region src/components/inputs/Selection/Select/QuerySelect.tsx
8
- var QuerySelect = ({ query, queryParams, queryOptions, queryMap, ...props }) => {
9
+ var QuerySelect = (t0) => {
10
+ const $ = c(33);
11
+ let props;
12
+ let query;
13
+ let queryMap;
14
+ let queryOptions;
15
+ let queryParams;
16
+ if ($[0] !== t0) {
17
+ ({query, queryParams, queryOptions, queryMap, ...props} = t0);
18
+ $[0] = t0;
19
+ $[1] = props;
20
+ $[2] = query;
21
+ $[3] = queryMap;
22
+ $[4] = queryOptions;
23
+ $[5] = queryParams;
24
+ } else {
25
+ props = $[1];
26
+ query = $[2];
27
+ queryMap = $[3];
28
+ queryOptions = $[4];
29
+ queryParams = $[5];
30
+ }
9
31
  const ui = UIConfig.useConfig();
10
32
  const [search, setSearch] = useState("");
11
33
  const isSearchable = props.isSearchable ?? ui.select.isSearchable;
12
- const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete({
13
- query,
14
- queryParams,
15
- queryOptions,
16
- mapItems: (data) => getQueryItems(data, queryMap),
17
- search: isSearchable ? search : void 0,
18
- initialQueryState: props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled
19
- });
20
- const { isInitialQueryDisabled: _, onSearchChange, ...selectProps } = props;
21
- const handleSearchChange = (value) => {
22
- setSearch(value);
23
- handleEnableQuery();
24
- onSearchChange?.(value);
25
- };
26
- return /* @__PURE__ */ jsx(Select, {
27
- ...selectProps,
28
- items,
29
- isLoading,
30
- totalItems,
31
- hasLoadMore: hasNextPage,
32
- onLoadMore: fetchNextPage,
33
- onMouseEnter: handleEnableQuery,
34
- onFocusCapture: handleEnableQuery,
35
- ...isSearchable && {
34
+ let t1;
35
+ if ($[6] !== queryMap) {
36
+ t1 = (data) => getQueryItems(data, queryMap);
37
+ $[6] = queryMap;
38
+ $[7] = t1;
39
+ } else t1 = $[7];
40
+ const t2 = isSearchable ? search : void 0;
41
+ const t3 = props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
42
+ let t4;
43
+ if ($[8] !== query || $[9] !== queryOptions || $[10] !== queryParams || $[11] !== t1 || $[12] !== t2 || $[13] !== t3) {
44
+ t4 = {
45
+ query,
46
+ queryParams,
47
+ queryOptions,
48
+ mapItems: t1,
49
+ search: t2,
50
+ initialQueryState: t3
51
+ };
52
+ $[8] = query;
53
+ $[9] = queryOptions;
54
+ $[10] = queryParams;
55
+ $[11] = t1;
56
+ $[12] = t2;
57
+ $[13] = t3;
58
+ $[14] = t4;
59
+ } else t4 = $[14];
60
+ const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete(t4);
61
+ let onSearchChange;
62
+ let selectProps;
63
+ if ($[15] !== props) {
64
+ const { isInitialQueryDisabled: _, onSearchChange: t5, ...t6 } = props;
65
+ onSearchChange = t5;
66
+ selectProps = t6;
67
+ $[15] = props;
68
+ $[16] = onSearchChange;
69
+ $[17] = selectProps;
70
+ } else {
71
+ onSearchChange = $[16];
72
+ selectProps = $[17];
73
+ }
74
+ let t5;
75
+ if ($[18] !== handleEnableQuery || $[19] !== onSearchChange) {
76
+ t5 = (value) => {
77
+ setSearch(value);
78
+ handleEnableQuery();
79
+ onSearchChange?.(value);
80
+ };
81
+ $[18] = handleEnableQuery;
82
+ $[19] = onSearchChange;
83
+ $[20] = t5;
84
+ } else t5 = $[20];
85
+ const handleSearchChange = t5;
86
+ let t6;
87
+ if ($[21] !== handleSearchChange || $[22] !== isSearchable) {
88
+ t6 = isSearchable && {
36
89
  isClientSearchDisabled: true,
37
90
  onSearchChange: handleSearchChange
38
- }
39
- });
91
+ };
92
+ $[21] = handleSearchChange;
93
+ $[22] = isSearchable;
94
+ $[23] = t6;
95
+ } else t6 = $[23];
96
+ let t7;
97
+ if ($[24] !== fetchNextPage || $[25] !== handleEnableQuery || $[26] !== hasNextPage || $[27] !== isLoading || $[28] !== items || $[29] !== selectProps || $[30] !== t6 || $[31] !== totalItems) {
98
+ t7 = /* @__PURE__ */ jsx(Select, {
99
+ ...selectProps,
100
+ items,
101
+ isLoading,
102
+ totalItems,
103
+ hasLoadMore: hasNextPage,
104
+ onLoadMore: fetchNextPage,
105
+ onMouseEnter: handleEnableQuery,
106
+ onFocusCapture: handleEnableQuery,
107
+ ...t6
108
+ });
109
+ $[24] = fetchNextPage;
110
+ $[25] = handleEnableQuery;
111
+ $[26] = hasNextPage;
112
+ $[27] = isLoading;
113
+ $[28] = items;
114
+ $[29] = selectProps;
115
+ $[30] = t6;
116
+ $[31] = totalItems;
117
+ $[32] = t7;
118
+ } else t7 = $[32];
119
+ return t7;
40
120
  };
41
121
  //#endregion
42
122
  export { QuerySelect };
@@ -1,55 +1,42 @@
1
- import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
1
+ import { Typography } from "../../../text/Typography/Typography.js";
2
2
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
3
  import { InputFrame } from "../../Skeleton/InputFrame.js";
4
4
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
5
+ import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
5
6
  import { SelectBase } from "../shared/SelectBase.js";
7
+ import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
6
8
  import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
9
+ import { c } from "react/compiler-runtime";
7
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
11
  import { clsx } from "clsx";
9
12
  import { useRef, useState } from "react";
10
13
  import { mergeRefs } from "@react-aria/utils";
11
- import { Controller, useWatch } from "react-hook-form";
14
+ import { Controller } from "react-hook-form";
12
15
  //#region src/components/inputs/Selection/Select/Select.tsx
13
- function _Select(props) {
14
- if ("formControl" in props && props.formControl) {
15
- const { formControl, ref, ...innerProps } = props;
16
- return /* @__PURE__ */ jsx(Controller, {
17
- control: formControl.control,
18
- name: formControl.name,
19
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(SelectBase, {
20
- ...innerProps,
21
- ref: mergeRefs(ref, field.ref),
22
- value: field.value,
23
- onChange: field.onChange,
24
- onBlur: field.onBlur,
25
- isDirty,
26
- isDisabled: field.disabled || props.isDisabled,
27
- error: props.error ?? error?.message
28
- })
29
- });
30
- }
31
- return /* @__PURE__ */ jsx(SelectBase, { ...props });
32
- }
33
- function Select({ renderStaticInput, ...props }) {
16
+ function SelectInner(t0) {
17
+ const $ = c(6);
18
+ const { renderStaticInput, isFormControlDisabled, ...props } = t0;
34
19
  const ui = UIConfig.useConfig();
35
20
  const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
36
21
  const rootRef = useRef(null);
37
- const { renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
38
- inputRef: rootRef,
39
- renderInput,
40
- setRenderInput,
41
- getFocusTarget: (root) => root.querySelector("[data-type='select-trigger'], input, button, [tabindex]")
42
- });
43
- const currentValue = ("formControl" in props && props.formControl ? useWatch({
44
- control: props.formControl.control,
45
- name: props.formControl.name
46
- }) : props.value) ?? props.value;
47
- let isFormControlDisabled = false;
48
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
22
+ let t1;
23
+ if ($[0] !== renderInput) {
24
+ t1 = {
25
+ inputRef: rootRef,
26
+ renderInput,
27
+ setRenderInput,
28
+ getFocusTarget: _temp
29
+ };
30
+ $[0] = renderInput;
31
+ $[1] = t1;
32
+ } else t1 = $[1];
33
+ const { renderRealInput, replayStaticInputChange, replayStaticInputPress } = useStaticInputHandoff(t1);
34
+ const currentValue = props.value;
49
35
  if (!renderInput && props.selectionMode !== "multiple" && !!props.showSelectionContent && currentValue != null) setRenderInput(true);
50
36
  if (!renderInput && !!props.customTrigger) setRenderInput(true);
51
37
  if (!renderInput) {
52
38
  const as = props.as ?? ui.input.as;
39
+ const size = props.size ?? ui.input.size;
53
40
  let isDisabled = !!props.isDisabled;
54
41
  if (isFormControlDisabled) isDisabled = true;
55
42
  const mode = props.selectionMode ?? ui.select.selectionMode;
@@ -66,7 +53,12 @@ function Select({ renderStaticInput, ...props }) {
66
53
  selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
67
54
  });
68
55
  const isSearchable = props.isSearchable ?? ui.select.isSearchable;
69
- const trailingContent = props.trailingContent || !props.hideDropdownIcon ? /* @__PURE__ */ jsxs(Fragment, { children: [props.trailingContent, !props.hideDropdownIcon ? /* @__PURE__ */ jsx(ArrowDropDownIcon, { className: `size-6 shrink-0 ${isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle"}` }) : void 0] }) : void 0;
56
+ const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
57
+ trailingContent: props.trailingContent,
58
+ hideDropdownIcon: props.hideDropdownIcon,
59
+ isDisabled,
60
+ size
61
+ });
70
62
  const placeholder = as === "floating" ? null : props.placeholder;
71
63
  const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
72
64
  const shouldRenderPlaceholderAfterValue = isMultiple && props.placeholder && !isEmpty;
@@ -81,20 +73,28 @@ function Select({ renderStaticInput, ...props }) {
81
73
  dataHasSelection: !isEmpty,
82
74
  dataHasSearch: false
83
75
  };
84
- const buttonContent = isMultiple && !isEmpty ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : isEmpty ? /* @__PURE__ */ jsx("span", {
85
- className: "text-text-default-3",
76
+ const buttonContent = isMultiple && !isEmpty ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : isEmpty ? /* @__PURE__ */ jsx(Typography, {
77
+ size: "label-1",
78
+ as: "span",
79
+ className: "block truncate text-text-default-3",
86
80
  children: placeholder
87
- }) : displayValue;
81
+ }) : /* @__PURE__ */ jsx(Typography, {
82
+ size: "label-1",
83
+ as: "span",
84
+ className: "block truncate",
85
+ children: displayValue
86
+ });
88
87
  return /* @__PURE__ */ jsx(InputFrame, {
89
88
  ...props,
90
89
  isDisabled,
91
90
  className: clsx("w-full", props.containerClassName),
92
91
  inputClassName: clsx(props.className, props.inputClassName),
92
+ contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
93
93
  typographySize: "label-1",
94
94
  labelPlacement: "content-row",
95
95
  dataAttributes,
96
96
  renderStatic: true,
97
- trailingClassName: "pl-1-5 gap-0!",
97
+ wrapTrailingContent: false,
98
98
  onStaticInteract: renderRealInput,
99
99
  leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
100
100
  className: "ml-input-side-default flex shrink-0 items-center",
@@ -121,16 +121,111 @@ function Select({ renderStaticInput, ...props }) {
121
121
  tabIndex: -1,
122
122
  "data-type": "select-trigger",
123
123
  className: clsx("w-full truncate bg-transparent text-start outline-none disabled:text-interactive-text-secondary-disabled", isMultiple && !isEmpty && "absolute inset-0 z-0"),
124
+ onClick: replayStaticInputPress,
124
125
  ...dataAttributeProps,
125
126
  "data-rac": true,
126
127
  children: buttonContent
127
128
  })] })
128
129
  });
129
130
  }
130
- return /* @__PURE__ */ jsx(_Select, {
131
- ...props,
132
- ref: mergeRefs(props.ref, rootRef)
133
- });
131
+ const T0 = SelectBase;
132
+ const t2 = mergeRefs(props.ref, rootRef);
133
+ let t3;
134
+ if ($[2] !== T0 || $[3] !== props || $[4] !== t2) {
135
+ t3 = /* @__PURE__ */ jsx(T0, {
136
+ ...props,
137
+ ref: t2
138
+ });
139
+ $[2] = T0;
140
+ $[3] = props;
141
+ $[4] = t2;
142
+ $[5] = t3;
143
+ } else t3 = $[5];
144
+ return t3;
145
+ }
146
+ function _temp(root) {
147
+ return root.querySelector("[data-type='select-trigger'], input, button, [tabindex]");
148
+ }
149
+ function Select(t0) {
150
+ const $ = c(21);
151
+ let props;
152
+ let renderStaticInput;
153
+ if ($[0] !== t0) {
154
+ ({renderStaticInput, ...props} = t0);
155
+ $[0] = t0;
156
+ $[1] = props;
157
+ $[2] = renderStaticInput;
158
+ } else {
159
+ props = $[1];
160
+ renderStaticInput = $[2];
161
+ }
162
+ if ("formControl" in props && props.formControl) {
163
+ let formControl;
164
+ let innerProps;
165
+ let ref;
166
+ if ($[3] !== props) {
167
+ ({formControl, ref, ...innerProps} = props);
168
+ $[3] = props;
169
+ $[4] = formControl;
170
+ $[5] = innerProps;
171
+ $[6] = ref;
172
+ } else {
173
+ formControl = $[4];
174
+ innerProps = $[5];
175
+ ref = $[6];
176
+ }
177
+ const controlWithOptions = formControl.control;
178
+ let t1;
179
+ if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
180
+ t1 = (t2) => {
181
+ const { field, fieldState: t3 } = t2;
182
+ const { error, isDirty } = t3;
183
+ return /* @__PURE__ */ jsx(SelectInner, {
184
+ ...innerProps,
185
+ ref: mergeRefs(ref, field.ref),
186
+ value: field.value,
187
+ onChange: field.onChange,
188
+ onBlur: field.onBlur,
189
+ isDirty,
190
+ isDisabled: field.disabled || props.isDisabled,
191
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
192
+ error: props.error ?? error?.message,
193
+ renderStaticInput
194
+ });
195
+ };
196
+ $[7] = controlWithOptions._options?.disabled;
197
+ $[8] = innerProps;
198
+ $[9] = props.error;
199
+ $[10] = props.isDisabled;
200
+ $[11] = ref;
201
+ $[12] = renderStaticInput;
202
+ $[13] = t1;
203
+ } else t1 = $[13];
204
+ let t2;
205
+ if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
206
+ t2 = /* @__PURE__ */ jsx(Controller, {
207
+ control: formControl.control,
208
+ name: formControl.name,
209
+ render: t1
210
+ });
211
+ $[14] = formControl.control;
212
+ $[15] = formControl.name;
213
+ $[16] = t1;
214
+ $[17] = t2;
215
+ } else t2 = $[17];
216
+ return t2;
217
+ }
218
+ let t1;
219
+ if ($[18] !== props || $[19] !== renderStaticInput) {
220
+ t1 = /* @__PURE__ */ jsx(SelectInner, {
221
+ ...props,
222
+ renderStaticInput
223
+ });
224
+ $[18] = props;
225
+ $[19] = renderStaticInput;
226
+ $[20] = t1;
227
+ } else t1 = $[20];
228
+ return t1;
134
229
  }
135
230
  //#endregion
136
231
  export { Select };