@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,17 +1,19 @@
1
1
  import { UIStyle } from "../../../../config/uiStyle.context.js";
2
2
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
+ import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
3
4
  import { InputClear } from "../../shared/InputClear.js";
4
5
  import { inputBase, inputSize } from "../../shared/input.cva.js";
5
6
  import { InputFrame } from "../../Skeleton/InputFrame.js";
6
7
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
7
8
  import { getStaticNumberDisplayValue } from "../shared/numberStatic.utils.js";
8
9
  import { NumberRangeField } from "./NumberRangeField.js";
10
+ import { c } from "react/compiler-runtime";
9
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
12
  import { clsx } from "clsx";
11
13
  import { useRef, useState } from "react";
12
14
  import { useLocale } from "react-aria-components";
13
15
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
14
- import { Controller, useWatch } from "react-hook-form";
16
+ import { Controller } from "react-hook-form";
15
17
  //#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
16
18
  var EMPTY_RANGE = {
17
19
  min: null,
@@ -25,117 +27,359 @@ var normalizeRangeValue = (value, minValue, maxValue) => {
25
27
  };
26
28
  };
27
29
  var NumberRangeInputBase = (props) => {
30
+ const $ = c(114);
28
31
  const ui = UIConfig.useConfig();
29
32
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
30
33
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
31
- const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder = "Min", maxPlaceholder = "Max", minLabel = "Minimum", maxLabel = "Maximum", invalidRangeError = "Minimum cannot be greater than maximum", hideInnerLabels = true, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest } = props;
34
+ let asProp;
35
+ let autoFocusOnMount;
36
+ let className;
37
+ let error;
38
+ let errorClassName;
39
+ let headerClassName;
40
+ let helperText;
41
+ let hideLabelProps;
42
+ let inputClassName;
43
+ let isClearableProps;
44
+ let isDirty;
45
+ let isDisabled;
46
+ let isHeaderHidden;
47
+ let isRequired;
48
+ let label;
49
+ let maxInputClassName;
50
+ let maxValue;
51
+ let minInputClassName;
52
+ let minValue;
53
+ let onBlur;
54
+ let onChange;
55
+ let onMaxChange;
56
+ let onMinChange;
57
+ let ref;
58
+ let rest;
59
+ let rightContent;
60
+ let sizeProps;
61
+ let t0;
62
+ let t1;
63
+ let t2;
64
+ let t3;
65
+ let t4;
66
+ let t5;
67
+ let tooltipText;
68
+ let value;
69
+ let variantProps;
70
+ if ($[0] !== props) {
71
+ ({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder: t0, maxPlaceholder: t1, minLabel: t2, maxLabel: t3, invalidRangeError: t4, hideInnerLabels: t5, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest} = props);
72
+ $[0] = props;
73
+ $[1] = asProp;
74
+ $[2] = autoFocusOnMount;
75
+ $[3] = className;
76
+ $[4] = error;
77
+ $[5] = errorClassName;
78
+ $[6] = headerClassName;
79
+ $[7] = helperText;
80
+ $[8] = hideLabelProps;
81
+ $[9] = inputClassName;
82
+ $[10] = isClearableProps;
83
+ $[11] = isDirty;
84
+ $[12] = isDisabled;
85
+ $[13] = isHeaderHidden;
86
+ $[14] = isRequired;
87
+ $[15] = label;
88
+ $[16] = maxInputClassName;
89
+ $[17] = maxValue;
90
+ $[18] = minInputClassName;
91
+ $[19] = minValue;
92
+ $[20] = onBlur;
93
+ $[21] = onChange;
94
+ $[22] = onMaxChange;
95
+ $[23] = onMinChange;
96
+ $[24] = ref;
97
+ $[25] = rest;
98
+ $[26] = rightContent;
99
+ $[27] = sizeProps;
100
+ $[28] = t0;
101
+ $[29] = t1;
102
+ $[30] = t2;
103
+ $[31] = t3;
104
+ $[32] = t4;
105
+ $[33] = t5;
106
+ $[34] = tooltipText;
107
+ $[35] = value;
108
+ $[36] = variantProps;
109
+ } else {
110
+ asProp = $[1];
111
+ autoFocusOnMount = $[2];
112
+ className = $[3];
113
+ error = $[4];
114
+ errorClassName = $[5];
115
+ headerClassName = $[6];
116
+ helperText = $[7];
117
+ hideLabelProps = $[8];
118
+ inputClassName = $[9];
119
+ isClearableProps = $[10];
120
+ isDirty = $[11];
121
+ isDisabled = $[12];
122
+ isHeaderHidden = $[13];
123
+ isRequired = $[14];
124
+ label = $[15];
125
+ maxInputClassName = $[16];
126
+ maxValue = $[17];
127
+ minInputClassName = $[18];
128
+ minValue = $[19];
129
+ onBlur = $[20];
130
+ onChange = $[21];
131
+ onMaxChange = $[22];
132
+ onMinChange = $[23];
133
+ ref = $[24];
134
+ rest = $[25];
135
+ rightContent = $[26];
136
+ sizeProps = $[27];
137
+ t0 = $[28];
138
+ t1 = $[29];
139
+ t2 = $[30];
140
+ t3 = $[31];
141
+ t4 = $[32];
142
+ t5 = $[33];
143
+ tooltipText = $[34];
144
+ value = $[35];
145
+ variantProps = $[36];
146
+ }
147
+ const minPlaceholder = t0 === void 0 ? "Min" : t0;
148
+ const maxPlaceholder = t1 === void 0 ? "Max" : t1;
149
+ const minLabel = t2 === void 0 ? "Minimum" : t2;
150
+ const maxLabel = t3 === void 0 ? "Maximum" : t3;
151
+ const invalidRangeError = t4 === void 0 ? "Minimum cannot be greater than maximum" : t4;
152
+ const hideInnerLabels = t5 === void 0 ? true : t5;
32
153
  const isClearable = isClearableProps ?? ui.input.isClearable;
33
154
  const as = asProp ?? ui.input.as;
34
155
  const variant = variantProps ?? ui.input.variant;
35
156
  const size = sizeProps ?? ui.input.size;
36
157
  const hideLabel = hideLabelProps ?? ui.input.hideLabel;
37
- const rangeValue = normalizeRangeValue(value, minValue, maxValue);
158
+ let t6;
159
+ if ($[37] !== maxValue || $[38] !== minValue || $[39] !== value) {
160
+ t6 = normalizeRangeValue(value, minValue, maxValue);
161
+ $[37] = maxValue;
162
+ $[38] = minValue;
163
+ $[39] = value;
164
+ $[40] = t6;
165
+ } else t6 = $[40];
166
+ const rangeValue = t6;
38
167
  const isEmpty = rangeValue.min === null && rangeValue.max === null;
39
168
  const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
40
169
  const effectiveError = error || rangeError;
41
- const { hoverProps, isHovered } = useHover({ isDisabled });
170
+ let t7;
171
+ if ($[41] !== isDisabled) {
172
+ t7 = { isDisabled };
173
+ $[41] = isDisabled;
174
+ $[42] = t7;
175
+ } else t7 = $[42];
176
+ const { hoverProps, isHovered } = useHover(t7);
42
177
  const { isFocusVisible } = useFocusVisible();
43
178
  const [isFocused, setIsFocused] = useState(false);
44
- const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
45
- const formFieldProps = {
46
- error: effectiveError,
47
- label,
48
- tooltipText,
49
- helperText,
50
- isRequired,
51
- rightContent,
52
- isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
53
- hideLabel,
54
- isDisabled,
55
- headerClassName,
56
- errorClassName
57
- };
58
- const headerProps = {
59
- label,
60
- tooltipText,
61
- helperText,
62
- isRequired,
63
- rightContent,
64
- isHeaderHidden: hideLabel || isHeaderHidden,
65
- isDisabled,
66
- className: headerClassName
67
- };
68
- const updateRange = (side, nextValue) => {
69
- const nextRange = {
70
- ...rangeValue,
71
- [side]: nextValue
179
+ let t8;
180
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
181
+ t8 = { onFocusWithinChange: setIsFocused };
182
+ $[43] = t8;
183
+ } else t8 = $[43];
184
+ const { focusWithinProps } = useFocusWithin(t8);
185
+ const t9 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
186
+ let t10;
187
+ if ($[44] !== effectiveError || $[45] !== errorClassName || $[46] !== headerClassName || $[47] !== helperText || $[48] !== hideLabel || $[49] !== isDisabled || $[50] !== isRequired || $[51] !== label || $[52] !== rightContent || $[53] !== t9 || $[54] !== tooltipText) {
188
+ t10 = {
189
+ error: effectiveError,
190
+ label,
191
+ tooltipText,
192
+ helperText,
193
+ isRequired,
194
+ rightContent,
195
+ isHeaderHidden: t9,
196
+ hideLabel,
197
+ isDisabled,
198
+ headerClassName,
199
+ errorClassName
72
200
  };
73
- onChange?.(nextRange);
74
- if (side === "min") onMinChange?.(nextValue);
75
- else onMaxChange?.(nextValue);
76
- };
77
- const clearRangeSide = (side) => {
78
- updateRange(side, null);
79
- onBlur?.({ target: { value: "" } });
80
- };
81
- return /* @__PURE__ */ jsx(NumberRangeField, {
82
- ...rest,
83
- ref,
84
- as,
85
- className,
86
- inputClassName,
87
- minInputClassName,
88
- maxInputClassName,
89
- inputBaseClassName: inputBaseCva({
201
+ $[44] = effectiveError;
202
+ $[45] = errorClassName;
203
+ $[46] = headerClassName;
204
+ $[47] = helperText;
205
+ $[48] = hideLabel;
206
+ $[49] = isDisabled;
207
+ $[50] = isRequired;
208
+ $[51] = label;
209
+ $[52] = rightContent;
210
+ $[53] = t9;
211
+ $[54] = tooltipText;
212
+ $[55] = t10;
213
+ } else t10 = $[55];
214
+ const formFieldProps = t10;
215
+ const t11 = hideLabel || isHeaderHidden;
216
+ let t12;
217
+ if ($[56] !== headerClassName || $[57] !== helperText || $[58] !== isDisabled || $[59] !== isRequired || $[60] !== label || $[61] !== rightContent || $[62] !== t11 || $[63] !== tooltipText) {
218
+ t12 = {
219
+ label,
220
+ tooltipText,
221
+ helperText,
222
+ isRequired,
223
+ rightContent,
224
+ isHeaderHidden: t11,
225
+ isDisabled,
226
+ className: headerClassName
227
+ };
228
+ $[56] = headerClassName;
229
+ $[57] = helperText;
230
+ $[58] = isDisabled;
231
+ $[59] = isRequired;
232
+ $[60] = label;
233
+ $[61] = rightContent;
234
+ $[62] = t11;
235
+ $[63] = tooltipText;
236
+ $[64] = t12;
237
+ } else t12 = $[64];
238
+ const headerProps = t12;
239
+ let t13;
240
+ if ($[65] !== onChange || $[66] !== onMaxChange || $[67] !== onMinChange || $[68] !== rangeValue) {
241
+ t13 = (side, nextValue) => {
242
+ const nextRange = {
243
+ ...rangeValue,
244
+ [side]: nextValue
245
+ };
246
+ onChange?.(nextRange);
247
+ if (side === "min") onMinChange?.(nextValue);
248
+ else onMaxChange?.(nextValue);
249
+ };
250
+ $[65] = onChange;
251
+ $[66] = onMaxChange;
252
+ $[67] = onMinChange;
253
+ $[68] = rangeValue;
254
+ $[69] = t13;
255
+ } else t13 = $[69];
256
+ const updateRange = t13;
257
+ let t14;
258
+ if ($[70] !== onBlur || $[71] !== updateRange) {
259
+ t14 = (side_0) => {
260
+ updateRange(side_0, null);
261
+ onBlur?.({ target: { value: "" } });
262
+ };
263
+ $[70] = onBlur;
264
+ $[71] = updateRange;
265
+ $[72] = t14;
266
+ } else t14 = $[72];
267
+ const clearRangeSide = t14;
268
+ let t15;
269
+ if ($[73] !== as || $[74] !== inputBaseCva || $[75] !== variant) {
270
+ t15 = inputBaseCva({
90
271
  variant,
91
272
  as
92
- }),
93
- inputSizeClassName: inputSizeCva({
273
+ });
274
+ $[73] = as;
275
+ $[74] = inputBaseCva;
276
+ $[75] = variant;
277
+ $[76] = t15;
278
+ } else t15 = $[76];
279
+ let t16;
280
+ if ($[77] !== as || $[78] !== inputSizeCva || $[79] !== size) {
281
+ t16 = inputSizeCva({
94
282
  size,
95
283
  as
96
- }),
97
- formFieldProps,
98
- headerProps,
99
- rangeValue,
100
- effectiveError,
101
- minPlaceholder,
102
- maxPlaceholder,
103
- minLabel,
104
- maxLabel,
105
- hideInnerLabels,
106
- isDirty,
107
- isClearable,
108
- autoFocusOnMount,
109
- isDisabled,
110
- isRequired,
111
- isEmpty,
112
- isHovered,
113
- isFocused,
114
- isFocusVisible,
115
- focusWithinProps,
116
- hoverProps,
117
- onRangeSideChange: updateRange,
118
- onRangeSideClear: clearRangeSide,
119
- onBlur
120
- });
284
+ });
285
+ $[77] = as;
286
+ $[78] = inputSizeCva;
287
+ $[79] = size;
288
+ $[80] = t16;
289
+ } else t16 = $[80];
290
+ let t17;
291
+ if ($[81] !== as || $[82] !== autoFocusOnMount || $[83] !== className || $[84] !== clearRangeSide || $[85] !== effectiveError || $[86] !== focusWithinProps || $[87] !== formFieldProps || $[88] !== headerProps || $[89] !== hideInnerLabels || $[90] !== hoverProps || $[91] !== inputClassName || $[92] !== isClearable || $[93] !== isDirty || $[94] !== isDisabled || $[95] !== isEmpty || $[96] !== isFocusVisible || $[97] !== isFocused || $[98] !== isHovered || $[99] !== isRequired || $[100] !== maxInputClassName || $[101] !== maxLabel || $[102] !== maxPlaceholder || $[103] !== minInputClassName || $[104] !== minLabel || $[105] !== minPlaceholder || $[106] !== onBlur || $[107] !== rangeValue || $[108] !== ref || $[109] !== rest || $[110] !== t15 || $[111] !== t16 || $[112] !== updateRange) {
292
+ t17 = /* @__PURE__ */ jsx(NumberRangeField, {
293
+ ...rest,
294
+ ref,
295
+ as,
296
+ className,
297
+ inputClassName,
298
+ minInputClassName,
299
+ maxInputClassName,
300
+ inputBaseClassName: t15,
301
+ inputSizeClassName: t16,
302
+ formFieldProps,
303
+ headerProps,
304
+ rangeValue,
305
+ effectiveError,
306
+ minPlaceholder,
307
+ maxPlaceholder,
308
+ minLabel,
309
+ maxLabel,
310
+ hideInnerLabels,
311
+ isDirty,
312
+ isClearable,
313
+ autoFocusOnMount,
314
+ isDisabled,
315
+ isRequired,
316
+ isEmpty,
317
+ isHovered,
318
+ isFocused,
319
+ isFocusVisible,
320
+ focusWithinProps,
321
+ hoverProps,
322
+ onRangeSideChange: updateRange,
323
+ onRangeSideClear: clearRangeSide,
324
+ onBlur
325
+ });
326
+ $[81] = as;
327
+ $[82] = autoFocusOnMount;
328
+ $[83] = className;
329
+ $[84] = clearRangeSide;
330
+ $[85] = effectiveError;
331
+ $[86] = focusWithinProps;
332
+ $[87] = formFieldProps;
333
+ $[88] = headerProps;
334
+ $[89] = hideInnerLabels;
335
+ $[90] = hoverProps;
336
+ $[91] = inputClassName;
337
+ $[92] = isClearable;
338
+ $[93] = isDirty;
339
+ $[94] = isDisabled;
340
+ $[95] = isEmpty;
341
+ $[96] = isFocusVisible;
342
+ $[97] = isFocused;
343
+ $[98] = isHovered;
344
+ $[99] = isRequired;
345
+ $[100] = maxInputClassName;
346
+ $[101] = maxLabel;
347
+ $[102] = maxPlaceholder;
348
+ $[103] = minInputClassName;
349
+ $[104] = minLabel;
350
+ $[105] = minPlaceholder;
351
+ $[106] = onBlur;
352
+ $[107] = rangeValue;
353
+ $[108] = ref;
354
+ $[109] = rest;
355
+ $[110] = t15;
356
+ $[111] = t16;
357
+ $[112] = updateRange;
358
+ $[113] = t17;
359
+ } else t17 = $[113];
360
+ return t17;
121
361
  };
122
- var NumberRangeInput = ({ renderStaticInput, ...props }) => {
362
+ var NumberRangeInputInner = (t0) => {
363
+ const $ = c(5);
364
+ const { renderStaticInput, isFormControlDisabled, ...props } = t0;
365
+ const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
123
366
  const ui = UIConfig.useConfig();
124
367
  const { locale } = useLocale();
125
368
  const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
126
- const { shouldFocus, renderRealInput } = useStaticInputHandoff({
127
- inputRef: useRef(null),
128
- renderInput,
129
- setRenderInput
130
- });
131
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
132
- control: props.formControl.control,
133
- name: props.formControl.name
134
- }) : props.value;
135
- let isFormControlDisabled = false;
136
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
369
+ const inputRef = useRef(null);
370
+ let t1;
371
+ if ($[0] !== renderInput) {
372
+ t1 = {
373
+ inputRef,
374
+ renderInput,
375
+ setRenderInput
376
+ };
377
+ $[0] = renderInput;
378
+ $[1] = t1;
379
+ } else t1 = $[1];
380
+ const { shouldFocus, renderRealInput } = useStaticInputHandoff(t1);
137
381
  if (!renderInput) {
138
- const staticValue = normalizeRangeValue(watchedValue, props.minValue, props.maxValue);
382
+ const staticValue = normalizeRangeValue(props.value, props.minValue, props.maxValue);
139
383
  const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
140
384
  const formatter = new Intl.NumberFormat(locale, formatOptions);
141
385
  const minDisplay = getStaticNumberDisplayValue(staticValue.min, formatter);
@@ -144,6 +388,7 @@ var NumberRangeInput = ({ renderStaticInput, ...props }) => {
144
388
  const rangeError = staticValue.min !== null && staticValue.max !== null && staticValue.min > staticValue.max ? props.invalidRangeError ?? "Minimum cannot be greater than maximum" : void 0;
145
389
  const effectiveError = props.error || rangeError;
146
390
  const as = props.as ?? ui.input.as;
391
+ const size = props.size ?? ui.input.size;
147
392
  let isDisabled = !!props.isDisabled;
148
393
  if (isFormControlDisabled) isDisabled = true;
149
394
  const isClearable = props.isClearable ?? ui.input.isClearable;
@@ -165,71 +410,166 @@ var NumberRangeInput = ({ renderStaticInput, ...props }) => {
165
410
  inputClassName: props.inputClassName,
166
411
  contentClassName: "pr-0!",
167
412
  trailingClassName: "py-0! pl-0!",
168
- contentWrapperClassName: "flex w-full items-center gap-input-gap-input-text-to-elements",
413
+ contentWrapperClassName: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0! py-0! px-0!", inputSizeCva({
414
+ size,
415
+ as
416
+ })),
169
417
  dataAttributes,
170
418
  renderStatic: true,
171
419
  onStaticInteract: renderRealInput,
172
420
  isClearable: false,
173
- labelPlacement: "content-row",
174
- children: ({ id, ...dataAttributeProps }) => /* @__PURE__ */ jsxs(Fragment, { children: [
175
- /* @__PURE__ */ jsx("input", {
176
- id,
177
- readOnly: true,
178
- disabled: isDisabled,
179
- tabIndex: -1,
180
- value: minDisplay ?? "",
181
- placeholder: props.minPlaceholder ?? "Min",
182
- className: clsx("w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.minInputClassName),
183
- ...dataAttributeProps,
184
- "data-rac": true
185
- }),
186
- isClearable && /* @__PURE__ */ jsx(InputClear, {
187
- onClear: () => {},
188
- renderStatic: true
189
- }),
190
- /* @__PURE__ */ jsx("span", {
191
- className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
192
- children: "-"
193
- }),
194
- /* @__PURE__ */ jsx("input", {
195
- id: `${id}-max`,
196
- readOnly: true,
197
- disabled: isDisabled,
198
- tabIndex: -1,
199
- value: maxDisplay ?? "",
200
- placeholder: props.maxPlaceholder ?? "Max",
201
- className: clsx("w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.maxInputClassName),
202
- ...dataAttributeProps,
203
- "data-rac": true
204
- }),
205
- isClearable && /* @__PURE__ */ jsx(InputClear, {
206
- onClear: () => {},
207
- renderStatic: true
208
- })
209
- ] })
421
+ labelPlacement: "content-wrapper",
422
+ children: (t2) => {
423
+ const { id, ...dataAttributeProps } = t2;
424
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
425
+ /* @__PURE__ */ jsxs("div", {
426
+ className: "min-w-0 flex-1",
427
+ children: [/* @__PURE__ */ jsx(FormFieldLabel, {
428
+ label: props.minLabel ?? "Minimum",
429
+ isRequired: props.isRequired,
430
+ isDisabled,
431
+ className: clsx((props.hideInnerLabels ?? true) && "sr-only")
432
+ }), /* @__PURE__ */ jsxs("div", {
433
+ className: "flex items-center gap-input-gap-trailing-elements",
434
+ children: [/* @__PURE__ */ jsx("input", {
435
+ id,
436
+ readOnly: true,
437
+ disabled: isDisabled,
438
+ tabIndex: -1,
439
+ value: minDisplay ?? "",
440
+ placeholder: props.minPlaceholder ?? "Min",
441
+ className: clsx("w-full min-w-0 bg-transparent outline-none", props.minInputClassName),
442
+ ...dataAttributeProps,
443
+ "data-rac": true
444
+ }), isClearable && /* @__PURE__ */ jsx(InputClear, {
445
+ onClear: _temp,
446
+ show: staticValue.min !== null,
447
+ renderStatic: true
448
+ })]
449
+ })]
450
+ }),
451
+ /* @__PURE__ */ jsx("span", {
452
+ className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
453
+ children: "-"
454
+ }),
455
+ /* @__PURE__ */ jsxs("div", {
456
+ className: "min-w-0 flex-1",
457
+ children: [/* @__PURE__ */ jsx(FormFieldLabel, {
458
+ label: props.maxLabel ?? "Maximum",
459
+ isRequired: props.isRequired,
460
+ isDisabled,
461
+ className: clsx((props.hideInnerLabels ?? true) && "sr-only")
462
+ }), /* @__PURE__ */ jsxs("div", {
463
+ className: "flex items-center gap-input-gap-trailing-elements",
464
+ children: [/* @__PURE__ */ jsx("input", {
465
+ id: `${id}-max`,
466
+ readOnly: true,
467
+ disabled: isDisabled,
468
+ tabIndex: -1,
469
+ value: maxDisplay ?? "",
470
+ placeholder: props.maxPlaceholder ?? "Max",
471
+ className: clsx("w-full min-w-0 bg-transparent outline-none", props.maxInputClassName),
472
+ ...dataAttributeProps,
473
+ "data-rac": true
474
+ }), isClearable && /* @__PURE__ */ jsx(InputClear, {
475
+ onClear: _temp2,
476
+ show: staticValue.max !== null,
477
+ renderStatic: true
478
+ })]
479
+ })]
480
+ })
481
+ ] });
482
+ }
210
483
  });
211
484
  }
212
- if ("formControl" in props && props.formControl) {
213
- const { formControl, ref, ...innerProps } = props;
214
- return /* @__PURE__ */ jsx(Controller, {
215
- control: formControl.control,
216
- name: formControl.name,
217
- render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(NumberRangeInputBase, {
218
- ...innerProps,
219
- ref,
220
- value: field.value ?? EMPTY_RANGE,
221
- onChange: field.onChange,
222
- onBlur: field.onBlur,
223
- isDisabled: field.disabled || props.isDisabled,
224
- error: props.error ?? error?.message,
225
- autoFocusOnMount: shouldFocus
226
- })
485
+ let t2;
486
+ if ($[2] !== props || $[3] !== shouldFocus) {
487
+ t2 = /* @__PURE__ */ jsx(NumberRangeInputBase, {
488
+ ...props,
489
+ autoFocusOnMount: shouldFocus
227
490
  });
491
+ $[2] = props;
492
+ $[3] = shouldFocus;
493
+ $[4] = t2;
494
+ } else t2 = $[4];
495
+ return t2;
496
+ };
497
+ var NumberRangeInput = (t0) => {
498
+ const $ = c(19);
499
+ let props;
500
+ let renderStaticInput;
501
+ if ($[0] !== t0) {
502
+ ({renderStaticInput, ...props} = t0);
503
+ $[0] = t0;
504
+ $[1] = props;
505
+ $[2] = renderStaticInput;
506
+ } else {
507
+ props = $[1];
508
+ renderStaticInput = $[2];
509
+ }
510
+ if ("formControl" in props && props.formControl) {
511
+ let formControl;
512
+ let innerProps;
513
+ if ($[3] !== props) {
514
+ ({formControl, ...innerProps} = props);
515
+ $[3] = props;
516
+ $[4] = formControl;
517
+ $[5] = innerProps;
518
+ } else {
519
+ formControl = $[4];
520
+ innerProps = $[5];
521
+ }
522
+ const controlWithOptions = formControl.control;
523
+ let t1;
524
+ if ($[6] !== controlWithOptions._options?.disabled || $[7] !== innerProps || $[8] !== props.error || $[9] !== props.isDisabled || $[10] !== renderStaticInput) {
525
+ t1 = (t2) => {
526
+ const { field, fieldState: t3 } = t2;
527
+ const { error } = t3;
528
+ return /* @__PURE__ */ jsx(NumberRangeInputInner, {
529
+ ...innerProps,
530
+ value: field.value ?? EMPTY_RANGE,
531
+ onChange: field.onChange,
532
+ onBlur: field.onBlur,
533
+ isDisabled: field.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
534
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
535
+ error: props.error ?? error?.message,
536
+ renderStaticInput
537
+ });
538
+ };
539
+ $[6] = controlWithOptions._options?.disabled;
540
+ $[7] = innerProps;
541
+ $[8] = props.error;
542
+ $[9] = props.isDisabled;
543
+ $[10] = renderStaticInput;
544
+ $[11] = t1;
545
+ } else t1 = $[11];
546
+ let t2;
547
+ if ($[12] !== formControl.control || $[13] !== formControl.name || $[14] !== t1) {
548
+ t2 = /* @__PURE__ */ jsx(Controller, {
549
+ control: formControl.control,
550
+ name: formControl.name,
551
+ render: t1
552
+ });
553
+ $[12] = formControl.control;
554
+ $[13] = formControl.name;
555
+ $[14] = t1;
556
+ $[15] = t2;
557
+ } else t2 = $[15];
558
+ return t2;
228
559
  }
229
- return /* @__PURE__ */ jsx(NumberRangeInputBase, {
230
- ...props,
231
- autoFocusOnMount: shouldFocus
232
- });
560
+ let t1;
561
+ if ($[16] !== props || $[17] !== renderStaticInput) {
562
+ t1 = /* @__PURE__ */ jsx(NumberRangeInputInner, {
563
+ ...props,
564
+ renderStaticInput
565
+ });
566
+ $[16] = props;
567
+ $[17] = renderStaticInput;
568
+ $[18] = t1;
569
+ } else t1 = $[18];
570
+ return t1;
233
571
  };
572
+ function _temp() {}
573
+ function _temp2() {}
234
574
  //#endregion
235
575
  export { NumberRangeInput };