@povio/ui 2.3.0-rc.9 → 2.3.1

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 (282) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  48. package/dist/components/Menu/Menu.js +2 -18
  49. package/dist/components/Menu/MenuDesktop.js +7 -41
  50. package/dist/components/Menu/MenuItem.js +9 -32
  51. package/dist/components/Menu/MenuMobile.js +38 -97
  52. package/dist/components/Menu/MenuPopover.js +29 -105
  53. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  56. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  57. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  58. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  60. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  61. package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  81. package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  95. package/dist/components/inputs/File/FileUpload.js +44 -87
  96. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  97. package/dist/components/inputs/File/InputUpload.js +79 -317
  98. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  99. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  100. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  101. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  102. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  103. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  104. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  105. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  106. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  107. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  108. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  109. package/dist/components/inputs/FormField/FormField.js +37 -119
  110. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  111. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  112. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  113. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  114. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  115. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  116. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  117. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  118. package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
  119. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  120. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  121. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  122. package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
  123. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  124. package/dist/components/inputs/Inputs/Form.js +11 -40
  125. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
  126. package/dist/components/inputs/Inputs/InputItem.js +14 -71
  127. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  128. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  129. package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
  130. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  131. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  132. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  133. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
  134. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  135. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
  136. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  137. package/dist/components/inputs/Selection/Select/Select.js +5 -132
  138. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  139. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  140. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  141. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  142. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  143. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
  144. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  145. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  146. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  147. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  148. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  149. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  150. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  151. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  152. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  153. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  154. package/dist/components/inputs/Selection/shared/select.context.js +34 -57
  155. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  157. package/dist/components/inputs/Slider/Slider.js +74 -250
  158. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  159. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  160. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  161. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  162. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  163. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  164. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  165. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  166. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  167. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  168. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  169. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  170. package/dist/components/inputs/Toggle/Toggle.js +37 -189
  171. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  172. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  173. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  174. package/dist/components/inputs/shared/CheckContent.js +11 -21
  175. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  176. package/dist/components/inputs/shared/InputClear.js +13 -79
  177. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  178. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  179. package/dist/components/inputs/shared/input.cva.js +4 -32
  180. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  181. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  182. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  183. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  184. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  185. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  186. package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
  187. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  188. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  189. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  190. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  191. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  192. package/dist/components/segment/Segment.js +57 -218
  193. package/dist/components/segment/SegmentItem.js +10 -67
  194. package/dist/components/shared/pagination/Pagination.js +22 -108
  195. package/dist/components/shared/pagination/PaginationList.js +64 -167
  196. package/dist/components/status/Alert/Alert.js +30 -97
  197. package/dist/components/status/Loader/Loader.js +22 -77
  198. package/dist/components/status/Toast/Toast.js +13 -21
  199. package/dist/components/status/Toast/useToast.js +57 -62
  200. package/dist/components/table/ColumnConfig.js +54 -158
  201. package/dist/components/table/InfiniteTable.js +16 -67
  202. package/dist/components/table/PaginatedTable.js +18 -84
  203. package/dist/components/table/Table.js +27 -28
  204. package/dist/components/text/Link/Link.js +7 -19
  205. package/dist/components/text/Typography/Typography.js +8 -23
  206. package/dist/config/confirmation.context.js +1 -1
  207. package/dist/config/link.context.js +9 -23
  208. package/dist/config/router.context.js +16 -42
  209. package/dist/config/theme.context.js +45 -98
  210. package/dist/config/uiConfig.context.d.ts +6 -16
  211. package/dist/config/uiConfig.context.js +13 -56
  212. package/dist/config/uiStyle.context.d.ts +4 -27
  213. package/dist/config/uiStyle.context.js +5 -15
  214. package/dist/helpers/dynamicInputs.d.ts +5 -5
  215. package/dist/helpers/dynamicInputs.js +0 -3
  216. package/dist/hooks/useBreakpoint.js +3 -16
  217. package/dist/hooks/useDebounceCallback.js +17 -51
  218. package/dist/hooks/useFilters.js +64 -125
  219. package/dist/hooks/useForm.js +8 -42
  220. package/dist/hooks/useFormAutosave.js +30 -101
  221. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  222. package/dist/hooks/useIntersectionObserver.js +24 -91
  223. package/dist/hooks/useLocalStorage.js +10 -43
  224. package/dist/hooks/useLongPressRepeat.js +20 -55
  225. package/dist/hooks/usePagination.js +19 -49
  226. package/dist/hooks/useScrollableListBox.js +16 -37
  227. package/dist/hooks/useSorting.js +28 -69
  228. package/dist/hooks/useStateAndRef.js +7 -21
  229. package/dist/hooks/useTableColumnConfig.js +31 -124
  230. package/dist/hooks/useTranslationMemo.js +5 -25
  231. package/dist/index.d.ts +0 -7
  232. package/dist/index.js +3 -5
  233. package/dist/tw-ui-plugin.js +0 -2
  234. package/dist/utils/date-time.utils.d.ts +10 -31
  235. package/dist/utils/date-time.utils.js +22 -123
  236. package/dist/utils/dom.utils.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
  239. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  240. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  241. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
  242. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
  243. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  244. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  245. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
  246. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
  247. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  248. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  249. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  250. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  251. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  252. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
  254. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  255. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  256. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  257. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  258. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  259. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  260. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
  261. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  262. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  263. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
  264. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
  265. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  266. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  267. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  268. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  269. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  270. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  271. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  272. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
  273. package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
  274. package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
  275. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  276. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  277. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  278. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  279. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  280. package/dist/hooks/useQueryAutocomplete.js +0 -57
  281. package/dist/utils/query.utils.d.ts +0 -4
  282. package/dist/utils/query.utils.js +0 -8
@@ -3,41 +3,24 @@ import { UIConfig } from "../../../../config/uiConfig.context.js";
3
3
  import { inputBase } from "../../shared/input.cva.js";
4
4
  import { FormField } from "../../FormField/FormField.js";
5
5
  import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
6
- import { InputFrame } from "../../Skeleton/InputFrame.js";
7
- import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
8
6
  import { InputContent } from "../shared/InputContent.js";
9
- import { getStaticNumberDisplayValue } from "../shared/numberStatic.utils.js";
10
- import { c } from "react/compiler-runtime";
11
7
  import { jsx } from "react/jsx-runtime";
12
8
  import { clsx } from "clsx";
13
- import { useEffect, useRef, useState } from "react";
9
+ import { useCallback, useRef } from "react";
14
10
  import { Input, useLocale } from "react-aria-components";
15
11
  import { useFocusVisible, useNumberField } from "react-aria";
16
12
  import { mergeRefs } from "@react-aria/utils";
17
- import { Controller, useWatch } from "react-hook-form";
13
+ import { Controller } from "react-hook-form";
18
14
  import { useNumberFieldState } from "react-stately";
19
15
  //#region src/components/inputs/Input/NumberInput/NumberInput.tsx
20
16
  var NumberInputBase = (props) => {
21
- const $ = c(85);
22
17
  const ui = UIConfig.useConfig();
23
18
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
24
19
  const inputRef = useRef(null);
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;
20
+ 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, ...rest } = props;
32
21
  const numberFieldRef = useRef(null);
33
22
  const { isFocusVisible } = useFocusVisible();
34
23
  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];
41
24
  const numberProps = {
42
25
  ...rest,
43
26
  value: value ?? void 0,
@@ -46,320 +29,96 @@ var NumberInputBase = (props) => {
46
29
  isInvalid: !!error,
47
30
  isRequired,
48
31
  onChange,
49
- onBlur: t0,
32
+ onBlur: (e) => onBlur?.({ target: e.target }),
50
33
  locale,
51
34
  formatOptions
52
35
  };
53
- const { labelProps, inputProps } = useNumberField(numberProps, useNumberFieldState(numberProps), numberFieldRef);
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;
105
- onBlur?.({ target });
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,
36
+ const state = useNumberFieldState(numberProps);
37
+ const { labelProps, inputProps } = useNumberField(numberProps, state, numberFieldRef);
38
+ const formFieldProps = {
39
+ error,
40
+ label,
41
+ tooltipText,
42
+ helperText,
43
+ isRequired,
44
+ rightContent,
45
+ isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
46
+ hideLabel,
47
+ isDisabled,
48
+ headerClassName,
49
+ errorClassName
50
+ };
51
+ const handleInputBlur = useCallback((e) => {
52
+ const target = numberFieldRef.current ?? e?.target;
53
+ onBlur?.({ target });
54
+ }, [onBlur]);
55
+ const inputContentProps = {
56
+ unit,
57
+ isLoading,
58
+ isDisabled,
59
+ action,
60
+ leadingIcon,
61
+ trailingIcon,
62
+ isClearable,
63
+ onChange: (val) => {
64
+ if (val === "") state.setInputValue("");
65
+ onChange?.(val === "" ? null : Number(val));
66
+ },
67
+ value: state.inputValue,
68
+ onBlur: handleInputBlur
69
+ };
70
+ const headerProps = {
71
+ label,
72
+ tooltipText,
73
+ helperText,
74
+ isRequired,
75
+ rightContent,
76
+ isHeaderHidden: hideLabel || isHeaderHidden,
77
+ isDisabled,
78
+ className: headerClassName,
79
+ labelProps
80
+ };
81
+ return /* @__PURE__ */ jsx(TooltipWrapper, {
182
82
  as,
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, {
83
+ error,
84
+ triggerTabIndex: as === "inline" ? -1 : void 0,
85
+ children: /* @__PURE__ */ jsx(FormField, {
270
86
  ...formFieldProps,
271
87
  as,
272
88
  labelProps,
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;
302
- };
303
- var NumberInput = ({ renderStaticInput, ...props }) => {
304
- const ui = UIConfig.useConfig();
305
- const { locale } = useLocale();
306
- const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
307
- const inputRef = useRef(null);
308
- const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
309
- inputRef,
310
- renderInput,
311
- setRenderInput
312
- });
313
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
314
- control: props.formControl.control,
315
- name: props.formControl.name
316
- }) : props.value;
317
- let isFormControlDisabled = false;
318
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
319
- if (!renderInput) {
320
- const staticValue = watchedValue ?? props.value ?? props.defaultValue;
321
- const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
322
- const displayValue = getStaticNumberDisplayValue(staticValue, new Intl.NumberFormat(locale, formatOptions)) ?? "";
323
- const hasValue = displayValue !== "";
324
- const as = props.as ?? ui.input.as;
325
- let isDisabled = !!props.isDisabled;
326
- if (isFormControlDisabled) isDisabled = true;
327
- const dataAttributes = {
328
- dataIsEmpty: !hasValue,
329
- dataIsFilled: hasValue,
330
- dataIsDirty: props.isDirty,
331
- dataIsRequired: props.isRequired,
332
- dataIsDisabled: isDisabled,
333
- dataDisabled: isDisabled,
334
- dataInvalid: !!props.error,
335
- dataHasSelection: hasValue
336
- };
337
- return /* @__PURE__ */ jsx(InputFrame, {
338
- ...props,
339
- isDisabled,
340
- className: clsx("group w-full", as === "inline" && "h-full", props.className),
341
- dataAttributes,
342
- renderStatic: true,
343
- onStaticInteract: renderRealInput,
344
- inputClassName: props.inputClassName,
345
- contentClassName: clsx(as === "inline" && "h-full", "pr-0!"),
346
- trailingClassName: "py-0! pl-0!",
347
- wrapContentAndTrailing: true,
348
- children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
349
- type: "text",
350
- ref: inputRef,
351
- disabled: isDisabled,
352
- inputMode: "numeric",
353
- tabIndex: -1,
354
- value: displayValue,
355
- placeholder: as === "floating" ? "" : props.placeholder,
356
- className: "w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
357
- onChange: (event) => replayStaticInputChange(event.target.value),
358
- ...dataAttributeProps,
359
- "data-rac": true
89
+ className: clsx("group w-full", className),
90
+ tabIndex: as === "inline" ? -1 : void 0,
91
+ children: /* @__PURE__ */ jsx("div", {
92
+ className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
93
+ variant,
94
+ as,
95
+ ...rest
96
+ }), inputClassName),
97
+ onClick: () => inputRef.current?.focus(),
98
+ children: /* @__PURE__ */ jsx(InputContent, {
99
+ ...inputContentProps,
100
+ headerProps,
101
+ as,
102
+ size,
103
+ children: /* @__PURE__ */ jsx(Input, {
104
+ ...inputProps,
105
+ ref: mergeRefs(ref, inputRef, numberFieldRef),
106
+ "data-is-dirty": isDirty || void 0,
107
+ "data-is-required": isRequired || void 0,
108
+ "data-is-empty": state.inputValue === "" || state.inputValue === void 0 || state.inputValue === null || void 0,
109
+ placeholder: as === "floating" ? "\xA0" : inputProps.placeholder,
110
+ className: "w-full outline-none",
111
+ onFocus: (e) => {
112
+ inputProps.onFocus?.(e);
113
+ if (isFocusVisible) e.target.select();
114
+ }
115
+ })
116
+ })
360
117
  })
361
- });
362
- }
118
+ })
119
+ });
120
+ };
121
+ var NumberInput = (props) => {
363
122
  if ("formControl" in props && props.formControl) {
364
123
  const { formControl, ref, ...innerProps } = props;
365
124
  return /* @__PURE__ */ jsx(Controller, {
@@ -367,22 +126,17 @@ var NumberInput = ({ renderStaticInput, ...props }) => {
367
126
  name: formControl.name,
368
127
  render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(NumberInputBase, {
369
128
  ...innerProps,
370
- ref: mergeRefs(ref, field.ref, inputRef),
129
+ ref: mergeRefs(ref, field.ref),
371
130
  value: field.value,
372
131
  onChange: field.onChange,
373
132
  onBlur: field.onBlur,
374
133
  isDirty,
375
134
  isDisabled: field.disabled || props.isDisabled,
376
- error: props.error ?? error?.message,
377
- autoFocusOnMount: shouldFocus
135
+ error: props.error ?? error?.message
378
136
  }, field.value === null || field.value === void 0 ? "empty" : "filled")
379
137
  });
380
138
  }
381
- return /* @__PURE__ */ jsx(NumberInputBase, {
382
- ...props,
383
- ref: mergeRefs(props.ref, inputRef),
384
- autoFocusOnMount: shouldFocus
385
- }, props.value === null || props.value === void 0 ? "empty" : "filled");
139
+ return /* @__PURE__ */ jsx(NumberInputBase, { ...props }, props.value === null || props.value === void 0 ? "empty" : "filled");
386
140
  };
387
141
  //#endregion
388
142
  export { NumberInput };
@@ -2,61 +2,22 @@ import { VisibilityIcon } from "../../../../assets/icons/Visibility.js";
2
2
  import { VisibilityOffIcon } from "../../../../assets/icons/VisibilityOff.js";
3
3
  import "../../../../config/i18n.js";
4
4
  import { TextInput } from "../TextInput/TextInput.js";
5
- import { c } from "react/compiler-runtime";
6
5
  import { jsx } from "react/jsx-runtime";
7
6
  import { useState } from "react";
8
7
  import { useTranslation } from "react-i18next";
9
8
  //#region src/components/inputs/Input/PasswordInput/PasswordInput.tsx
10
9
  var PasswordInput = (props) => {
11
- const $0 = c(15);
12
10
  const { t } = useTranslation("ui");
13
11
  const [isRevealed, setIsRevealed] = useState(false);
14
- const t0 = isRevealed ? "text" : "password";
15
- const t1 = isRevealed ? VisibilityIcon : VisibilityOffIcon;
16
- let t2;
17
- if ($0[0] !== isRevealed) {
18
- t2 = ($) => isRevealed ? $.ui.password.hide : $.ui.password.reveal;
19
- $0[0] = isRevealed;
20
- $0[1] = t2;
21
- } else t2 = $0[1];
22
- let t3;
23
- if ($0[2] !== t || $0[3] !== t2) {
24
- t3 = t(t2);
25
- $0[2] = t;
26
- $0[3] = t2;
27
- $0[4] = t3;
28
- } else t3 = $0[4];
29
- let t4;
30
- if ($0[5] !== isRevealed) {
31
- t4 = () => setIsRevealed(!isRevealed);
32
- $0[5] = isRevealed;
33
- $0[6] = t4;
34
- } else t4 = $0[6];
35
- let t5;
36
- if ($0[7] !== t1 || $0[8] !== t3 || $0[9] !== t4) {
37
- t5 = {
38
- icon: t1,
39
- altText: t3,
40
- onClick: t4
41
- };
42
- $0[7] = t1;
43
- $0[8] = t3;
44
- $0[9] = t4;
45
- $0[10] = t5;
46
- } else t5 = $0[10];
47
- let t6;
48
- if ($0[11] !== props || $0[12] !== t0 || $0[13] !== t5) {
49
- t6 = /* @__PURE__ */ jsx(TextInput, {
50
- ...props,
51
- type: t0,
52
- action: t5
53
- });
54
- $0[11] = props;
55
- $0[12] = t0;
56
- $0[13] = t5;
57
- $0[14] = t6;
58
- } else t6 = $0[14];
59
- return t6;
12
+ return /* @__PURE__ */ jsx(TextInput, {
13
+ ...props,
14
+ type: isRevealed ? "text" : "password",
15
+ action: {
16
+ icon: isRevealed ? VisibilityIcon : VisibilityOffIcon,
17
+ altText: t(($) => isRevealed ? $.ui.password.hide : $.ui.password.reveal),
18
+ onClick: () => setIsRevealed(!isRevealed)
19
+ }
20
+ });
60
21
  };
61
22
  //#endregion
62
23
  export { PasswordInput };