@povio/ui 2.3.0-rc.4 → 2.3.0-rc.40

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