@povio/ui 2.3.0-rc.2 → 2.3.0-rc.21

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 +190 -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 +258 -76
  65. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  66. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +342 -177
  67. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  68. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +173 -63
  69. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
  70. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +522 -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 +249 -93
  77. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  78. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  79. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
  80. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +352 -145
  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 +2 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +206 -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 -122
  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 +303 -90
  115. package/dist/components/inputs/Input/TextInput/TextInput.js +376 -122
  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 +140 -45
  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 +442 -116
  146. package/dist/components/inputs/Slider/Slider.js +250 -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 -40
  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
@@ -7,23 +7,37 @@ import { InputFrame } from "../../Skeleton/InputFrame.js";
7
7
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
8
8
  import { InputContent } from "../shared/InputContent.js";
9
9
  import { getStaticNumberDisplayValue } from "../shared/numberStatic.utils.js";
10
+ import { c } from "react/compiler-runtime";
10
11
  import { jsx } from "react/jsx-runtime";
11
12
  import { clsx } from "clsx";
12
- import { useCallback, useEffect, useRef, useState } from "react";
13
+ import { useEffect, useRef, useState } from "react";
13
14
  import { Input, useLocale } from "react-aria-components";
14
15
  import { useFocusVisible, useNumberField } from "react-aria";
15
16
  import { mergeRefs } from "@react-aria/utils";
16
- import { Controller, useWatch } from "react-hook-form";
17
+ import { Controller } from "react-hook-form";
17
18
  import { useNumberFieldState } from "react-stately";
18
19
  //#region src/components/inputs/Input/NumberInput/NumberInput.tsx
19
20
  var NumberInputBase = (props) => {
21
+ const $ = c(87);
20
22
  const ui = UIConfig.useConfig();
21
23
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
22
24
  const inputRef = useRef(null);
23
- const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, formatOptions = ui.numberInput.formatOptions, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, hideLabel = ui.input.hideLabel, isClearable = ui.input.isClearable, autoFocusOnMount, ...rest } = props;
25
+ const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, formatOptions: formatOptionsProp, variant: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, autoFocusOnMount, ...rest } = props;
26
+ const formatOptions = formatOptionsProp ?? ui.numberInput.formatOptions;
27
+ const variant = variantProp ?? ui.input.variant;
28
+ const as = asProp ?? ui.input.as;
29
+ const size = sizeProp ?? ui.input.size;
30
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
31
+ const isClearable = isClearableProp ?? ui.input.isClearable;
24
32
  const numberFieldRef = useRef(null);
25
33
  const { isFocusVisible } = useFocusVisible();
26
34
  const { locale } = useLocale();
35
+ let t0;
36
+ if ($[0] !== onBlur) {
37
+ t0 = (e) => onBlur?.({ target: e.target });
38
+ $[0] = onBlur;
39
+ $[1] = t0;
40
+ } else t0 = $[1];
27
41
  const numberProps = {
28
42
  ...rest,
29
43
  value: value ?? void 0,
@@ -32,115 +46,285 @@ var NumberInputBase = (props) => {
32
46
  isInvalid: !!error,
33
47
  isRequired,
34
48
  onChange,
35
- onBlur: (e) => onBlur?.({ target: e.target }),
49
+ onBlur: t0,
36
50
  locale,
37
51
  formatOptions
38
52
  };
39
53
  const { labelProps, inputProps } = useNumberField(numberProps, useNumberFieldState(numberProps), numberFieldRef);
40
- useEffect(() => {
41
- if (!autoFocusOnMount || isDisabled) return;
42
- requestAnimationFrame(() => inputRef.current?.focus());
43
- }, [autoFocusOnMount, isDisabled]);
44
- const formFieldProps = {
45
- error,
46
- label,
47
- tooltipText,
48
- helperText,
49
- isRequired,
50
- rightContent,
51
- isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
52
- hideLabel,
53
- isDisabled,
54
- headerClassName,
55
- errorClassName
56
- };
57
- const inputContentProps = {
58
- unit,
59
- isLoading,
60
- isDisabled,
61
- action,
62
- leadingIcon,
63
- trailingIcon,
64
- isClearable,
65
- value,
66
- onChange: (val) => onChange?.(val === "" ? null : Number(val)),
67
- onBlur: useCallback((e) => {
68
- const target = numberFieldRef.current ?? e?.target;
54
+ let t1;
55
+ let t2;
56
+ if ($[2] !== autoFocusOnMount || $[3] !== isDisabled) {
57
+ t1 = () => {
58
+ if (!autoFocusOnMount || isDisabled) return;
59
+ requestAnimationFrame(() => inputRef.current?.focus());
60
+ };
61
+ t2 = [autoFocusOnMount, isDisabled];
62
+ $[2] = autoFocusOnMount;
63
+ $[3] = isDisabled;
64
+ $[4] = t1;
65
+ $[5] = t2;
66
+ } else {
67
+ t1 = $[4];
68
+ t2 = $[5];
69
+ }
70
+ useEffect(t1, t2);
71
+ const t3 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
72
+ let t4;
73
+ if ($[6] !== error || $[7] !== errorClassName || $[8] !== headerClassName || $[9] !== helperText || $[10] !== hideLabel || $[11] !== isDisabled || $[12] !== isRequired || $[13] !== label || $[14] !== rightContent || $[15] !== t3 || $[16] !== tooltipText) {
74
+ t4 = {
75
+ error,
76
+ label,
77
+ tooltipText,
78
+ helperText,
79
+ isRequired,
80
+ rightContent,
81
+ isHeaderHidden: t3,
82
+ hideLabel,
83
+ isDisabled,
84
+ headerClassName,
85
+ errorClassName
86
+ };
87
+ $[6] = error;
88
+ $[7] = errorClassName;
89
+ $[8] = headerClassName;
90
+ $[9] = helperText;
91
+ $[10] = hideLabel;
92
+ $[11] = isDisabled;
93
+ $[12] = isRequired;
94
+ $[13] = label;
95
+ $[14] = rightContent;
96
+ $[15] = t3;
97
+ $[16] = tooltipText;
98
+ $[17] = t4;
99
+ } else t4 = $[17];
100
+ const formFieldProps = t4;
101
+ let t5;
102
+ if ($[18] !== onBlur) {
103
+ t5 = (e_0) => {
104
+ const target = numberFieldRef.current ?? e_0?.target;
69
105
  onBlur?.({ target });
70
- }, [onBlur])
71
- };
72
- const headerProps = {
73
- label,
74
- tooltipText,
75
- helperText,
76
- isRequired,
77
- rightContent,
78
- isHeaderHidden: hideLabel || isHeaderHidden,
79
- isDisabled,
80
- className: headerClassName,
81
- labelProps
82
- };
83
- return /* @__PURE__ */ jsx(TooltipWrapper, {
106
+ };
107
+ $[18] = onBlur;
108
+ $[19] = t5;
109
+ } else t5 = $[19];
110
+ const handleInputBlur = t5;
111
+ let t6;
112
+ if ($[20] !== onChange) {
113
+ t6 = (val) => onChange?.(val === "" ? null : Number(val));
114
+ $[20] = onChange;
115
+ $[21] = t6;
116
+ } else t6 = $[21];
117
+ let t7;
118
+ if ($[22] !== action || $[23] !== handleInputBlur || $[24] !== isClearable || $[25] !== isDisabled || $[26] !== isLoading || $[27] !== leadingIcon || $[28] !== t6 || $[29] !== trailingIcon || $[30] !== unit || $[31] !== value) {
119
+ t7 = {
120
+ unit,
121
+ isLoading,
122
+ isDisabled,
123
+ action,
124
+ leadingIcon,
125
+ trailingIcon,
126
+ isClearable,
127
+ value,
128
+ onChange: t6,
129
+ onBlur: handleInputBlur
130
+ };
131
+ $[22] = action;
132
+ $[23] = handleInputBlur;
133
+ $[24] = isClearable;
134
+ $[25] = isDisabled;
135
+ $[26] = isLoading;
136
+ $[27] = leadingIcon;
137
+ $[28] = t6;
138
+ $[29] = trailingIcon;
139
+ $[30] = unit;
140
+ $[31] = value;
141
+ $[32] = t7;
142
+ } else t7 = $[32];
143
+ const inputContentProps = t7;
144
+ const t8 = hideLabel || isHeaderHidden;
145
+ let t9;
146
+ if ($[33] !== headerClassName || $[34] !== helperText || $[35] !== isDisabled || $[36] !== isRequired || $[37] !== label || $[38] !== labelProps || $[39] !== rightContent || $[40] !== t8 || $[41] !== tooltipText) {
147
+ t9 = {
148
+ label,
149
+ tooltipText,
150
+ helperText,
151
+ isRequired,
152
+ rightContent,
153
+ isHeaderHidden: t8,
154
+ isDisabled,
155
+ className: headerClassName,
156
+ labelProps
157
+ };
158
+ $[33] = headerClassName;
159
+ $[34] = helperText;
160
+ $[35] = isDisabled;
161
+ $[36] = isRequired;
162
+ $[37] = label;
163
+ $[38] = labelProps;
164
+ $[39] = rightContent;
165
+ $[40] = t8;
166
+ $[41] = tooltipText;
167
+ $[42] = t9;
168
+ } else t9 = $[42];
169
+ const headerProps = t9;
170
+ const dataIsDisabled = isDisabled || void 0;
171
+ const T0 = TooltipWrapper;
172
+ const t10 = as === "inline" ? -1 : void 0;
173
+ const T1 = FormField;
174
+ let t11;
175
+ if ($[43] !== className) {
176
+ t11 = clsx("group w-full", className);
177
+ $[43] = className;
178
+ $[44] = t11;
179
+ } else t11 = $[44];
180
+ const t12 = as === "inline" ? -1 : void 0;
181
+ const t13 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
182
+ variant,
84
183
  as,
85
- error,
86
- triggerTabIndex: as === "inline" ? -1 : void 0,
87
- children: /* @__PURE__ */ jsx(FormField, {
184
+ ...rest
185
+ }), inputClassName);
186
+ let t14;
187
+ if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
188
+ t14 = () => inputRef.current?.focus();
189
+ $[45] = t14;
190
+ } else t14 = $[45];
191
+ const t15 = value === null || value === void 0 || void 0;
192
+ const t16 = isRequired || void 0;
193
+ let t17;
194
+ if ($[46] !== ref) {
195
+ t17 = mergeRefs(ref, inputRef);
196
+ $[46] = ref;
197
+ $[47] = t17;
198
+ } else t17 = $[47];
199
+ const t18 = isDirty || void 0;
200
+ const t19 = isRequired || void 0;
201
+ const t20 = value === null || value === void 0 || void 0;
202
+ const t21 = !("" + value === "" || value === null || value === void 0) || void 0;
203
+ const t22 = as === "floating" ? "\xA0" : inputProps.placeholder;
204
+ let t23;
205
+ if ($[48] !== inputProps || $[49] !== isFocusVisible) {
206
+ t23 = (e_1) => {
207
+ inputProps.onFocus?.(e_1);
208
+ if (isFocusVisible) e_1.target.select();
209
+ };
210
+ $[48] = inputProps;
211
+ $[49] = isFocusVisible;
212
+ $[50] = t23;
213
+ } else t23 = $[50];
214
+ let t24;
215
+ if ($[51] !== dataIsDisabled || $[52] !== inputProps || $[53] !== t17 || $[54] !== t18 || $[55] !== t19 || $[56] !== t20 || $[57] !== t21 || $[58] !== t22 || $[59] !== t23) {
216
+ t24 = /* @__PURE__ */ jsx(Input, {
217
+ ...inputProps,
218
+ ref: t17,
219
+ "data-is-dirty": t18,
220
+ "data-is-required": t19,
221
+ "data-is-empty": t20,
222
+ "data-is-filled": t21,
223
+ "data-is-disabled": dataIsDisabled,
224
+ placeholder: t22,
225
+ className: "w-full bg-transparent outline-none",
226
+ onFocus: t23
227
+ });
228
+ $[51] = dataIsDisabled;
229
+ $[52] = inputProps;
230
+ $[53] = t17;
231
+ $[54] = t18;
232
+ $[55] = t19;
233
+ $[56] = t20;
234
+ $[57] = t21;
235
+ $[58] = t22;
236
+ $[59] = t23;
237
+ $[60] = t24;
238
+ } else t24 = $[60];
239
+ let t25;
240
+ if ($[61] !== as || $[62] !== headerProps || $[63] !== inputContentProps || $[64] !== size || $[65] !== t24) {
241
+ t25 = /* @__PURE__ */ jsx(InputContent, {
242
+ ...inputContentProps,
243
+ headerProps,
244
+ as,
245
+ size,
246
+ children: t24
247
+ });
248
+ $[61] = as;
249
+ $[62] = headerProps;
250
+ $[63] = inputContentProps;
251
+ $[64] = size;
252
+ $[65] = t24;
253
+ $[66] = t25;
254
+ } else t25 = $[66];
255
+ let t26;
256
+ if ($[67] !== dataIsDisabled || $[68] !== t13 || $[69] !== t15 || $[70] !== t16 || $[71] !== t25) {
257
+ t26 = /* @__PURE__ */ jsx("div", {
258
+ className: t13,
259
+ onClick: t14,
260
+ "data-is-empty": t15,
261
+ "data-is-required": t16,
262
+ "data-is-disabled": dataIsDisabled,
263
+ children: t25
264
+ });
265
+ $[67] = dataIsDisabled;
266
+ $[68] = t13;
267
+ $[69] = t15;
268
+ $[70] = t16;
269
+ $[71] = t25;
270
+ $[72] = t26;
271
+ } else t26 = $[72];
272
+ let t27;
273
+ if ($[73] !== T1 || $[74] !== as || $[75] !== formFieldProps || $[76] !== labelProps || $[77] !== t11 || $[78] !== t12 || $[79] !== t26) {
274
+ t27 = /* @__PURE__ */ jsx(T1, {
88
275
  ...formFieldProps,
89
276
  as,
90
277
  labelProps,
91
- className: clsx("group w-full", className),
92
- tabIndex: as === "inline" ? -1 : void 0,
93
- children: /* @__PURE__ */ jsx("div", {
94
- className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
95
- variant,
96
- as,
97
- ...rest
98
- }), inputClassName),
99
- onClick: () => inputRef.current?.focus(),
100
- "data-is-empty": value === null || value === void 0 || void 0,
101
- "data-is-required": isRequired || void 0,
102
- children: /* @__PURE__ */ jsx(InputContent, {
103
- ...inputContentProps,
104
- headerProps,
105
- as,
106
- size,
107
- children: /* @__PURE__ */ jsx(Input, {
108
- ...inputProps,
109
- ref: mergeRefs(ref, inputRef),
110
- "data-is-dirty": isDirty || void 0,
111
- "data-is-required": isRequired || void 0,
112
- "data-is-empty": value === null || value === void 0 || void 0,
113
- "data-is-filled": !("" + value === "" || value === null || value === void 0) || void 0,
114
- placeholder: as === "floating" ? "\xA0" : inputProps.placeholder,
115
- className: "w-full outline-none",
116
- onFocus: (e) => {
117
- inputProps.onFocus?.(e);
118
- if (isFocusVisible) e.target.select();
119
- }
120
- })
121
- })
122
- })
123
- })
124
- });
278
+ className: t11,
279
+ tabIndex: t12,
280
+ children: t26
281
+ });
282
+ $[73] = T1;
283
+ $[74] = as;
284
+ $[75] = formFieldProps;
285
+ $[76] = labelProps;
286
+ $[77] = t11;
287
+ $[78] = t12;
288
+ $[79] = t26;
289
+ $[80] = t27;
290
+ } else t27 = $[80];
291
+ let t28;
292
+ if ($[81] !== T0 || $[82] !== as || $[83] !== error || $[84] !== t10 || $[85] !== t27) {
293
+ t28 = /* @__PURE__ */ jsx(T0, {
294
+ as,
295
+ error,
296
+ triggerTabIndex: t10,
297
+ children: t27
298
+ });
299
+ $[81] = T0;
300
+ $[82] = as;
301
+ $[83] = error;
302
+ $[84] = t10;
303
+ $[85] = t27;
304
+ $[86] = t28;
305
+ } else t28 = $[86];
306
+ return t28;
125
307
  };
126
- var NumberInput = ({ renderStaticInput, ...props }) => {
308
+ var NumberInputInner = (t0) => {
309
+ const $ = c(10);
310
+ const { renderStaticInput, isFormControlDisabled, ...props } = t0;
127
311
  const ui = UIConfig.useConfig();
128
312
  const { locale } = useLocale();
129
313
  const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
130
314
  const inputRef = useRef(null);
131
- const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
132
- inputRef,
133
- renderInput,
134
- setRenderInput
135
- });
136
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
137
- control: props.formControl.control,
138
- name: props.formControl.name
139
- }) : props.value;
140
- let isFormControlDisabled = false;
141
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
315
+ let t1;
316
+ if ($[0] !== renderInput) {
317
+ t1 = {
318
+ inputRef,
319
+ renderInput,
320
+ setRenderInput
321
+ };
322
+ $[0] = renderInput;
323
+ $[1] = t1;
324
+ } else t1 = $[1];
325
+ const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff(t1);
142
326
  if (!renderInput) {
143
- const staticValue = watchedValue ?? props.value ?? props.defaultValue;
327
+ const staticValue = props.value ?? props.defaultValue;
144
328
  const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
145
329
  const displayValue = getStaticNumberDisplayValue(staticValue, new Intl.NumberFormat(locale, formatOptions)) ?? "";
146
330
  const hasValue = displayValue !== "";
@@ -157,15 +341,25 @@ var NumberInput = ({ renderStaticInput, ...props }) => {
157
341
  dataInvalid: !!props.error,
158
342
  dataHasSelection: hasValue
159
343
  };
344
+ const t2 = isDisabled;
345
+ const t3 = clsx("group w-full", as === "inline" && "h-full", props.className);
346
+ const t4 = props.inputClassName;
347
+ const t5 = as === "inline" && "h-full";
348
+ let t6;
349
+ if ($[2] !== t5) {
350
+ t6 = clsx(t5, "pr-0!");
351
+ $[2] = t5;
352
+ $[3] = t6;
353
+ } else t6 = $[3];
160
354
  return /* @__PURE__ */ jsx(InputFrame, {
161
355
  ...props,
162
- isDisabled,
163
- className: clsx("group w-full", as === "inline" && "h-full", props.className),
356
+ isDisabled: t2,
357
+ className: t3,
164
358
  dataAttributes,
165
359
  renderStatic: true,
166
360
  onStaticInteract: renderRealInput,
167
- inputClassName: props.inputClassName,
168
- contentClassName: "pr-0!",
361
+ inputClassName: t4,
362
+ contentClassName: t6,
169
363
  trailingClassName: "py-0! pl-0!",
170
364
  wrapContentAndTrailing: true,
171
365
  children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
@@ -183,29 +377,105 @@ var NumberInput = ({ renderStaticInput, ...props }) => {
183
377
  })
184
378
  });
185
379
  }
380
+ const T0 = NumberInputBase;
381
+ const t2 = props.value === null || props.value === void 0 ? "empty" : "filled";
382
+ const t3 = mergeRefs(props.ref, inputRef);
383
+ let t4;
384
+ if ($[4] !== T0 || $[5] !== props || $[6] !== shouldFocus || $[7] !== t2 || $[8] !== t3) {
385
+ t4 = /* @__PURE__ */ jsx(T0, {
386
+ ...props,
387
+ ref: t3,
388
+ autoFocusOnMount: shouldFocus
389
+ }, t2);
390
+ $[4] = T0;
391
+ $[5] = props;
392
+ $[6] = shouldFocus;
393
+ $[7] = t2;
394
+ $[8] = t3;
395
+ $[9] = t4;
396
+ } else t4 = $[9];
397
+ return t4;
398
+ };
399
+ var NumberInput = (t0) => {
400
+ const $ = c(21);
401
+ let props;
402
+ let renderStaticInput;
403
+ if ($[0] !== t0) {
404
+ ({renderStaticInput, ...props} = t0);
405
+ $[0] = t0;
406
+ $[1] = props;
407
+ $[2] = renderStaticInput;
408
+ } else {
409
+ props = $[1];
410
+ renderStaticInput = $[2];
411
+ }
186
412
  if ("formControl" in props && props.formControl) {
187
- const { formControl, ref, ...innerProps } = props;
188
- return /* @__PURE__ */ jsx(Controller, {
189
- control: formControl.control,
190
- name: formControl.name,
191
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(NumberInputBase, {
192
- ...innerProps,
193
- ref: mergeRefs(ref, field.ref, inputRef),
194
- value: field.value,
195
- onChange: field.onChange,
196
- onBlur: field.onBlur,
197
- isDirty,
198
- isDisabled: field.disabled || props.isDisabled,
199
- error: props.error ?? error?.message,
200
- autoFocusOnMount: shouldFocus
201
- }, field.value === null || field.value === void 0 ? "empty" : "filled")
202
- });
413
+ let formControl;
414
+ let innerProps;
415
+ let ref;
416
+ if ($[3] !== props) {
417
+ ({formControl, ref, ...innerProps} = props);
418
+ $[3] = props;
419
+ $[4] = formControl;
420
+ $[5] = innerProps;
421
+ $[6] = ref;
422
+ } else {
423
+ formControl = $[4];
424
+ innerProps = $[5];
425
+ ref = $[6];
426
+ }
427
+ const controlWithOptions = formControl.control;
428
+ let t1;
429
+ if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
430
+ t1 = (t2) => {
431
+ const { field, fieldState: t3 } = t2;
432
+ const { error, isDirty } = t3;
433
+ return /* @__PURE__ */ jsx(NumberInputInner, {
434
+ ...innerProps,
435
+ ref: mergeRefs(ref, field.ref),
436
+ value: field.value,
437
+ onChange: field.onChange,
438
+ onBlur: field.onBlur,
439
+ isDirty,
440
+ isDisabled: field.disabled || props.isDisabled,
441
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
442
+ error: props.error ?? error?.message,
443
+ renderStaticInput
444
+ });
445
+ };
446
+ $[7] = controlWithOptions._options?.disabled;
447
+ $[8] = innerProps;
448
+ $[9] = props.error;
449
+ $[10] = props.isDisabled;
450
+ $[11] = ref;
451
+ $[12] = renderStaticInput;
452
+ $[13] = t1;
453
+ } else t1 = $[13];
454
+ let t2;
455
+ if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
456
+ t2 = /* @__PURE__ */ jsx(Controller, {
457
+ control: formControl.control,
458
+ name: formControl.name,
459
+ render: t1
460
+ });
461
+ $[14] = formControl.control;
462
+ $[15] = formControl.name;
463
+ $[16] = t1;
464
+ $[17] = t2;
465
+ } else t2 = $[17];
466
+ return t2;
203
467
  }
204
- return /* @__PURE__ */ jsx(NumberInputBase, {
205
- ...props,
206
- ref: mergeRefs(props.ref, inputRef),
207
- autoFocusOnMount: shouldFocus
208
- }, props.value === null || props.value === void 0 ? "empty" : "filled");
468
+ let t1;
469
+ if ($[18] !== props || $[19] !== renderStaticInput) {
470
+ t1 = /* @__PURE__ */ jsx(NumberInputInner, {
471
+ ...props,
472
+ renderStaticInput
473
+ });
474
+ $[18] = props;
475
+ $[19] = renderStaticInput;
476
+ $[20] = t1;
477
+ } else t1 = $[20];
478
+ return t1;
209
479
  };
210
480
  //#endregion
211
481
  export { NumberInput };