@povio/ui 2.3.0-rc.5 → 2.3.0-rc.7

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 (195) 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.js +164 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +16 -12
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -107
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +17 -13
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +384 -116
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/File/FileUpload.js +86 -44
  83. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  84. package/dist/components/inputs/File/InputUpload.js +317 -79
  85. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  86. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  87. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  88. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  89. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  90. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  91. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  92. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  93. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  94. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  95. package/dist/components/inputs/FormField/FormField.js +119 -37
  96. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  97. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  98. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  99. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  100. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  101. package/dist/components/inputs/Input/NumberInput/NumberInput.js +253 -82
  102. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  103. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +321 -77
  104. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  105. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  106. package/dist/components/inputs/Input/TextInput/TextInput.js +241 -81
  107. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  108. package/dist/components/inputs/Inputs/Form.js +40 -11
  109. package/dist/components/inputs/Inputs/InputItem.js +65 -14
  110. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  111. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  112. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +9 -3
  113. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  114. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  115. package/dist/components/inputs/Selection/Select/Select.js +9 -3
  116. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  117. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  118. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  119. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  120. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  121. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  122. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  123. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  124. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  125. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  126. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  127. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  128. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  129. package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
  130. package/dist/components/inputs/Skeleton/InputFrame.js +444 -116
  131. package/dist/components/inputs/Slider/Slider.js +247 -74
  132. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  133. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  134. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  135. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  136. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  137. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  138. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  139. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  140. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  141. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  142. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  143. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  144. package/dist/components/inputs/shared/CheckContent.js +21 -10
  145. package/dist/components/inputs/shared/InputClear.js +78 -21
  146. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  147. package/dist/components/inputs/shared/input.cva.js +13 -3
  148. package/dist/components/inputs/shared/useStaticInputHandoff.js +97 -39
  149. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  150. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  151. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  152. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  153. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  154. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  155. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  156. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  157. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  158. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  159. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  160. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  161. package/dist/components/segment/Segment.js +218 -57
  162. package/dist/components/segment/SegmentItem.js +67 -10
  163. package/dist/components/shared/pagination/Pagination.js +108 -22
  164. package/dist/components/shared/pagination/PaginationList.js +167 -64
  165. package/dist/components/status/Alert/Alert.js +97 -30
  166. package/dist/components/status/Loader/Loader.js +77 -22
  167. package/dist/components/status/Toast/Toast.js +21 -13
  168. package/dist/components/status/Toast/useToast.js +62 -57
  169. package/dist/components/table/ColumnConfig.js +158 -54
  170. package/dist/components/table/InfiniteTable.js +67 -16
  171. package/dist/components/table/PaginatedTable.js +84 -18
  172. package/dist/components/table/Table.js +23 -23
  173. package/dist/components/text/Link/Link.js +19 -7
  174. package/dist/components/text/Typography/Typography.js +23 -8
  175. package/dist/config/confirmation.context.js +1 -1
  176. package/dist/config/link.context.js +23 -9
  177. package/dist/config/router.context.js +42 -16
  178. package/dist/config/theme.context.js +98 -45
  179. package/dist/config/uiConfig.context.js +39 -8
  180. package/dist/config/uiStyle.context.js +15 -5
  181. package/dist/hooks/useBreakpoint.js +16 -3
  182. package/dist/hooks/useDebounceCallback.js +51 -17
  183. package/dist/hooks/useFilters.js +125 -64
  184. package/dist/hooks/useForm.js +42 -8
  185. package/dist/hooks/useFormAutosave.js +101 -30
  186. package/dist/hooks/useIntersectionObserver.js +86 -32
  187. package/dist/hooks/useLocalStorage.js +43 -10
  188. package/dist/hooks/useLongPressRepeat.js +55 -20
  189. package/dist/hooks/usePagination.js +49 -19
  190. package/dist/hooks/useScrollableListBox.js +37 -16
  191. package/dist/hooks/useSorting.js +69 -28
  192. package/dist/hooks/useStateAndRef.js +21 -7
  193. package/dist/hooks/useTableColumnConfig.js +124 -31
  194. package/dist/hooks/useTranslationMemo.js +25 -5
  195. package/package.json +1 -1
@@ -1,17 +1,41 @@
1
1
  import { CloseIcon } from "../../../assets/icons/Close.js";
2
2
  import "../../../config/i18n.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  import { Button } from "react-aria-components";
5
6
  import { useTranslation } from "react-i18next";
6
7
  //#region src/components/inputs/FormField/FormFieldHeaderClose.tsx
7
- var FormFieldHeaderClose = ({ onClose }) => {
8
+ var FormFieldHeaderClose = (t0) => {
9
+ const $ = c(6);
10
+ const { onClose } = t0;
8
11
  const { t } = useTranslation("ui");
9
- return /* @__PURE__ */ jsx(Button, {
10
- onPress: onClose,
11
- "aria-label": t(($) => $.ui.closeAlt),
12
- className: "shrink-0 focus-visible:outline-interactive-text-secondary-focus",
13
- children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 text-interactive-text-secondary-idle" })
14
- });
12
+ let t1;
13
+ if ($[0] !== t) {
14
+ t1 = t(_temp);
15
+ $[0] = t;
16
+ $[1] = t1;
17
+ } else t1 = $[1];
18
+ let t2;
19
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
20
+ t2 = /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 text-interactive-text-secondary-idle" });
21
+ $[2] = t2;
22
+ } else t2 = $[2];
23
+ let t3;
24
+ if ($[3] !== onClose || $[4] !== t1) {
25
+ t3 = /* @__PURE__ */ jsx(Button, {
26
+ onPress: onClose,
27
+ "aria-label": t1,
28
+ className: "shrink-0 focus-visible:outline-interactive-text-secondary-focus",
29
+ children: t2
30
+ });
31
+ $[3] = onClose;
32
+ $[4] = t1;
33
+ $[5] = t3;
34
+ } else t3 = $[5];
35
+ return t3;
15
36
  };
37
+ function _temp($) {
38
+ return $.ui.closeAlt;
39
+ }
16
40
  //#endregion
17
41
  export { FormFieldHeaderClose };
@@ -1,14 +1,34 @@
1
1
  import { UIStyle } from "../../../config/uiStyle.context.js";
2
2
  import { formFieldHelper } from "./formFieldHelper.cva.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  import { clsx } from "clsx";
5
6
  //#region src/components/inputs/FormField/FormFieldHelper.tsx
6
- var FormFieldHelper = ({ helperText, isDisabled, isHidden, hasError, className }) => {
7
- return /* @__PURE__ */ jsx("p", {
8
- className: clsx(UIStyle.useCva("formField.helperLabelCva", formFieldHelper)({ visible: !!helperText && !isDisabled && !isHidden && !hasError }), className),
9
- slot: "description",
10
- children: helperText
11
- });
7
+ var FormFieldHelper = (t0) => {
8
+ const $ = c(7);
9
+ const { helperText, isDisabled, isHidden, hasError, className } = t0;
10
+ const formFieldHelperCva = UIStyle.useCva("formField.helperLabelCva", formFieldHelper);
11
+ const visible = !!helperText && !isDisabled && !isHidden && !hasError;
12
+ let t1;
13
+ if ($[0] !== className || $[1] !== formFieldHelperCva || $[2] !== visible) {
14
+ t1 = clsx(formFieldHelperCva({ visible }), className);
15
+ $[0] = className;
16
+ $[1] = formFieldHelperCva;
17
+ $[2] = visible;
18
+ $[3] = t1;
19
+ } else t1 = $[3];
20
+ let t2;
21
+ if ($[4] !== helperText || $[5] !== t1) {
22
+ t2 = /* @__PURE__ */ jsx("p", {
23
+ className: t1,
24
+ slot: "description",
25
+ children: helperText
26
+ });
27
+ $[4] = helperText;
28
+ $[5] = t1;
29
+ $[6] = t2;
30
+ } else t2 = $[6];
31
+ return t2;
12
32
  };
13
33
  //#endregion
14
34
  export { FormFieldHelper };
@@ -1,28 +1,59 @@
1
1
  import { UIStyle } from "../../../config/uiStyle.context.js";
2
2
  import { typography } from "../../text/Typography/typography.cva.js";
3
3
  import { labelBase, labelTypography } from "../shared/label.cva.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { clsx } from "clsx";
6
7
  import { Label } from "react-aria-components";
7
8
  //#region src/components/inputs/FormField/FormFieldLabel.tsx
8
- var FormFieldLabel = ({ ref, as, label, isRequired, isDisabled, labelProps, className }) => {
9
+ var FormFieldLabel = (t0) => {
10
+ const $ = c(16);
11
+ const { ref, as, label, isRequired, isDisabled, labelProps, className } = t0;
9
12
  const typographyCva = UIStyle.useCva("typography.cva", typography);
10
13
  const labelTypographyMap = UIStyle.useMapper("label.typography", labelTypography);
11
14
  const labelBaseCva = UIStyle.useCva("label.cva", labelBase);
12
- return /* @__PURE__ */ jsxs(Label, {
13
- ...labelProps,
14
- ref,
15
- className: clsx(typographyCva({
15
+ let t1;
16
+ if ($[0] !== as || $[1] !== className || $[2] !== labelBaseCva || $[3] !== labelProps?.className || $[4] !== labelTypographyMap || $[5] !== typographyCva) {
17
+ t1 = clsx(typographyCva({
16
18
  size: "label-2",
17
19
  sizeMobile: "label-2",
18
20
  variant: "prominent-1",
19
21
  ...labelTypographyMap({ as })
20
- }), labelBaseCva({ as }), className, labelProps?.className),
21
- children: [label, isRequired && /* @__PURE__ */ jsx("span", {
22
+ }), labelBaseCva({ as }), className, labelProps?.className);
23
+ $[0] = as;
24
+ $[1] = className;
25
+ $[2] = labelBaseCva;
26
+ $[3] = labelProps?.className;
27
+ $[4] = labelTypographyMap;
28
+ $[5] = typographyCva;
29
+ $[6] = t1;
30
+ } else t1 = $[6];
31
+ let t2;
32
+ if ($[7] !== isDisabled || $[8] !== isRequired) {
33
+ t2 = isRequired && /* @__PURE__ */ jsx("span", {
22
34
  className: clsx(!isDisabled && "text-text-error-1"),
23
35
  children: "*"
24
- })]
25
- });
36
+ });
37
+ $[7] = isDisabled;
38
+ $[8] = isRequired;
39
+ $[9] = t2;
40
+ } else t2 = $[9];
41
+ let t3;
42
+ if ($[10] !== label || $[11] !== labelProps || $[12] !== ref || $[13] !== t1 || $[14] !== t2) {
43
+ t3 = /* @__PURE__ */ jsxs(Label, {
44
+ ...labelProps,
45
+ ref,
46
+ className: t1,
47
+ children: [label, t2]
48
+ });
49
+ $[10] = label;
50
+ $[11] = labelProps;
51
+ $[12] = ref;
52
+ $[13] = t1;
53
+ $[14] = t2;
54
+ $[15] = t3;
55
+ } else t3 = $[15];
56
+ return t3;
26
57
  };
27
58
  //#endregion
28
59
  export { FormFieldLabel };
@@ -7,9 +7,10 @@ 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";
@@ -17,6 +18,7 @@ import { Controller, useWatch } 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(85);
20
22
  const ui = UIConfig.useConfig();
21
23
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
22
24
  const inputRef = useRef(null);
@@ -30,6 +32,12 @@ var NumberInputBase = (props) => {
30
32
  const numberFieldRef = useRef(null);
31
33
  const { isFocusVisible } = useFocusVisible();
32
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];
33
41
  const numberProps = {
34
42
  ...rest,
35
43
  value: value ?? void 0,
@@ -38,96 +46,259 @@ var NumberInputBase = (props) => {
38
46
  isInvalid: !!error,
39
47
  isRequired,
40
48
  onChange,
41
- onBlur: (e) => onBlur?.({ target: e.target }),
49
+ onBlur: t0,
42
50
  locale,
43
51
  formatOptions
44
52
  };
45
53
  const { labelProps, inputProps } = useNumberField(numberProps, useNumberFieldState(numberProps), numberFieldRef);
46
- useEffect(() => {
47
- if (!autoFocusOnMount || isDisabled) return;
48
- requestAnimationFrame(() => inputRef.current?.focus());
49
- }, [autoFocusOnMount, isDisabled]);
50
- const formFieldProps = {
51
- error,
52
- label,
53
- tooltipText,
54
- helperText,
55
- isRequired,
56
- rightContent,
57
- isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
58
- hideLabel,
59
- isDisabled,
60
- headerClassName,
61
- errorClassName
62
- };
63
- const inputContentProps = {
64
- unit,
65
- isLoading,
66
- isDisabled,
67
- action,
68
- leadingIcon,
69
- trailingIcon,
70
- isClearable,
71
- value,
72
- onChange: (val) => onChange?.(val === "" ? null : Number(val)),
73
- onBlur: useCallback((e) => {
74
- 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;
75
105
  onBlur?.({ target });
76
- }, [onBlur])
77
- };
78
- const headerProps = {
79
- label,
80
- tooltipText,
81
- helperText,
82
- isRequired,
83
- rightContent,
84
- isHeaderHidden: hideLabel || isHeaderHidden,
85
- isDisabled,
86
- className: headerClassName,
87
- labelProps
88
- };
89
- 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 T0 = TooltipWrapper;
171
+ const t10 = as === "inline" ? -1 : void 0;
172
+ const T1 = FormField;
173
+ let t11;
174
+ if ($[43] !== className) {
175
+ t11 = clsx("group w-full", className);
176
+ $[43] = className;
177
+ $[44] = t11;
178
+ } else t11 = $[44];
179
+ const t12 = as === "inline" ? -1 : void 0;
180
+ const t13 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
181
+ variant,
90
182
  as,
91
- error,
92
- triggerTabIndex: as === "inline" ? -1 : void 0,
93
- children: /* @__PURE__ */ jsx(FormField, {
183
+ ...rest
184
+ }), inputClassName);
185
+ let t14;
186
+ if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
187
+ t14 = () => inputRef.current?.focus();
188
+ $[45] = t14;
189
+ } else t14 = $[45];
190
+ const t15 = value === null || value === void 0 || void 0;
191
+ const t16 = isRequired || void 0;
192
+ let t17;
193
+ if ($[46] !== ref) {
194
+ t17 = mergeRefs(ref, inputRef);
195
+ $[46] = ref;
196
+ $[47] = t17;
197
+ } else t17 = $[47];
198
+ const t18 = isDirty || void 0;
199
+ const t19 = isRequired || void 0;
200
+ const t20 = value === null || value === void 0 || void 0;
201
+ const t21 = !("" + value === "" || value === null || value === void 0) || void 0;
202
+ const t22 = as === "floating" ? "\xA0" : inputProps.placeholder;
203
+ let t23;
204
+ if ($[48] !== inputProps || $[49] !== isFocusVisible) {
205
+ t23 = (e_1) => {
206
+ inputProps.onFocus?.(e_1);
207
+ if (isFocusVisible) e_1.target.select();
208
+ };
209
+ $[48] = inputProps;
210
+ $[49] = isFocusVisible;
211
+ $[50] = t23;
212
+ } else t23 = $[50];
213
+ let t24;
214
+ if ($[51] !== inputProps || $[52] !== t17 || $[53] !== t18 || $[54] !== t19 || $[55] !== t20 || $[56] !== t21 || $[57] !== t22 || $[58] !== t23) {
215
+ t24 = /* @__PURE__ */ jsx(Input, {
216
+ ...inputProps,
217
+ ref: t17,
218
+ "data-is-dirty": t18,
219
+ "data-is-required": t19,
220
+ "data-is-empty": t20,
221
+ "data-is-filled": t21,
222
+ placeholder: t22,
223
+ className: "w-full outline-none",
224
+ onFocus: t23
225
+ });
226
+ $[51] = inputProps;
227
+ $[52] = t17;
228
+ $[53] = t18;
229
+ $[54] = t19;
230
+ $[55] = t20;
231
+ $[56] = t21;
232
+ $[57] = t22;
233
+ $[58] = t23;
234
+ $[59] = t24;
235
+ } else t24 = $[59];
236
+ let t25;
237
+ if ($[60] !== as || $[61] !== headerProps || $[62] !== inputContentProps || $[63] !== size || $[64] !== t24) {
238
+ t25 = /* @__PURE__ */ jsx(InputContent, {
239
+ ...inputContentProps,
240
+ headerProps,
241
+ as,
242
+ size,
243
+ children: t24
244
+ });
245
+ $[60] = as;
246
+ $[61] = headerProps;
247
+ $[62] = inputContentProps;
248
+ $[63] = size;
249
+ $[64] = t24;
250
+ $[65] = t25;
251
+ } else t25 = $[65];
252
+ let t26;
253
+ if ($[66] !== t13 || $[67] !== t15 || $[68] !== t16 || $[69] !== t25) {
254
+ t26 = /* @__PURE__ */ jsx("div", {
255
+ className: t13,
256
+ onClick: t14,
257
+ "data-is-empty": t15,
258
+ "data-is-required": t16,
259
+ children: t25
260
+ });
261
+ $[66] = t13;
262
+ $[67] = t15;
263
+ $[68] = t16;
264
+ $[69] = t25;
265
+ $[70] = t26;
266
+ } else t26 = $[70];
267
+ let t27;
268
+ if ($[71] !== T1 || $[72] !== as || $[73] !== formFieldProps || $[74] !== labelProps || $[75] !== t11 || $[76] !== t12 || $[77] !== t26) {
269
+ t27 = /* @__PURE__ */ jsx(T1, {
94
270
  ...formFieldProps,
95
271
  as,
96
272
  labelProps,
97
- className: clsx("group w-full", className),
98
- tabIndex: as === "inline" ? -1 : void 0,
99
- children: /* @__PURE__ */ jsx("div", {
100
- className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
101
- variant,
102
- as,
103
- ...rest
104
- }), inputClassName),
105
- onClick: () => inputRef.current?.focus(),
106
- "data-is-empty": value === null || value === void 0 || void 0,
107
- "data-is-required": isRequired || void 0,
108
- children: /* @__PURE__ */ jsx(InputContent, {
109
- ...inputContentProps,
110
- headerProps,
111
- as,
112
- size,
113
- children: /* @__PURE__ */ jsx(Input, {
114
- ...inputProps,
115
- ref: mergeRefs(ref, inputRef),
116
- "data-is-dirty": isDirty || void 0,
117
- "data-is-required": isRequired || void 0,
118
- "data-is-empty": value === null || value === void 0 || void 0,
119
- "data-is-filled": !("" + value === "" || value === null || value === void 0) || void 0,
120
- placeholder: as === "floating" ? "\xA0" : inputProps.placeholder,
121
- className: "w-full outline-none",
122
- onFocus: (e) => {
123
- inputProps.onFocus?.(e);
124
- if (isFocusVisible) e.target.select();
125
- }
126
- })
127
- })
128
- })
129
- })
130
- });
273
+ className: t11,
274
+ tabIndex: t12,
275
+ children: t26
276
+ });
277
+ $[71] = T1;
278
+ $[72] = as;
279
+ $[73] = formFieldProps;
280
+ $[74] = labelProps;
281
+ $[75] = t11;
282
+ $[76] = t12;
283
+ $[77] = t26;
284
+ $[78] = t27;
285
+ } else t27 = $[78];
286
+ let t28;
287
+ if ($[79] !== T0 || $[80] !== as || $[81] !== error || $[82] !== t10 || $[83] !== t27) {
288
+ t28 = /* @__PURE__ */ jsx(T0, {
289
+ as,
290
+ error,
291
+ triggerTabIndex: t10,
292
+ children: t27
293
+ });
294
+ $[79] = T0;
295
+ $[80] = as;
296
+ $[81] = error;
297
+ $[82] = t10;
298
+ $[83] = t27;
299
+ $[84] = t28;
300
+ } else t28 = $[84];
301
+ return t28;
131
302
  };
132
303
  var NumberInput = ({ renderStaticInput, ...props }) => {
133
304
  const ui = UIConfig.useConfig();