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