@povio/ui 2.2.12 → 2.3.0-rc.10

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 (284) 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.d.ts +2 -1
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  56. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  57. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  58. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  60. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  61. package/dist/components/inputs/Checkbox/Checkbox.js +172 -35
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +10 -5
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +121 -20
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +10 -5
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +215 -111
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +11 -5
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +123 -19
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +5 -3
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +448 -104
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +330 -119
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  81. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -3
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +355 -135
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +14 -0
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +97 -11
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +207 -65
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  95. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
  96. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
  97. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
  98. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +6 -0
  99. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +21 -0
  100. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
  101. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
  102. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +31 -0
  103. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +80 -0
  104. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  105. package/dist/components/inputs/File/FileUpload.js +87 -44
  106. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  107. package/dist/components/inputs/File/InputUpload.js +317 -79
  108. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  109. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  110. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  111. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  112. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  113. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  114. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  115. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
  116. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  117. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  118. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  119. package/dist/components/inputs/FormField/FormField.js +119 -37
  120. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  121. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  122. package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
  123. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  124. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  125. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  126. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  127. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
  128. package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
  129. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
  130. package/dist/components/inputs/Input/NumberInput/NumberInput.js +332 -81
  131. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
  132. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
  133. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
  134. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +479 -0
  135. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  136. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -0
  137. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
  138. package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
  139. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
  140. package/dist/components/inputs/Input/TextInput/TextInput.js +321 -80
  141. package/dist/components/inputs/Input/shared/InputContent.js +192 -59
  142. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
  143. package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
  144. package/dist/components/inputs/Inputs/Form.js +40 -11
  145. package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
  146. package/dist/components/inputs/Inputs/InputItem.js +69 -14
  147. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  148. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
  149. package/dist/components/inputs/RadioGroup/RadioGroup.js +352 -60
  150. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
  151. package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
  152. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
  153. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +109 -7
  154. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
  155. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +34 -8
  156. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
  157. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
  158. package/dist/components/inputs/Selection/Select/QuerySelect.js +122 -0
  159. package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
  160. package/dist/components/inputs/Selection/Select/Select.js +132 -5
  161. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
  162. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
  163. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  164. package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
  165. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  166. package/dist/components/inputs/Selection/shared/SelectInput.js +337 -115
  167. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  168. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  169. package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
  170. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  171. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  172. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  173. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  174. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  175. package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
  176. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  177. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  178. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +6 -0
  179. package/dist/components/inputs/Selection/shared/querySelect.utils.js +13 -0
  180. package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
  181. package/dist/components/inputs/Selection/shared/select.context.js +57 -34
  182. package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
  183. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
  184. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
  185. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  186. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  187. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
  188. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
  189. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
  190. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  191. package/dist/components/inputs/Skeleton/InputFrame.d.ts +79 -0
  192. package/dist/components/inputs/Skeleton/InputFrame.js +526 -0
  193. package/dist/components/inputs/Slider/Slider.js +250 -74
  194. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
  195. package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
  196. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  197. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  198. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  199. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  200. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  201. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  202. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  203. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  204. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  205. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  206. package/dist/components/inputs/Toggle/Toggle.js +189 -37
  207. package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
  208. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  209. package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
  210. package/dist/components/inputs/shared/CheckContent.js +21 -11
  211. package/dist/components/inputs/shared/InputClear.d.ts +2 -1
  212. package/dist/components/inputs/shared/InputClear.js +79 -10
  213. package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
  214. package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
  215. package/dist/components/inputs/shared/input.cva.d.ts +10 -0
  216. package/dist/components/inputs/shared/input.cva.js +32 -4
  217. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
  218. package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
  219. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
  220. package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
  221. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  222. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  223. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  224. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  225. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  226. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  227. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  228. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  229. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  230. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  231. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  232. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  233. package/dist/components/segment/Segment.js +218 -57
  234. package/dist/components/segment/SegmentItem.js +67 -10
  235. package/dist/components/shared/pagination/Pagination.js +108 -22
  236. package/dist/components/shared/pagination/PaginationList.js +167 -64
  237. package/dist/components/status/Alert/Alert.js +97 -30
  238. package/dist/components/status/Loader/Loader.js +77 -22
  239. package/dist/components/status/Toast/Toast.js +21 -13
  240. package/dist/components/status/Toast/useToast.js +62 -57
  241. package/dist/components/table/ColumnConfig.js +158 -54
  242. package/dist/components/table/InfiniteTable.js +67 -16
  243. package/dist/components/table/PaginatedTable.js +84 -18
  244. package/dist/components/table/Table.js +28 -27
  245. package/dist/components/text/Link/Link.js +19 -7
  246. package/dist/components/text/Typography/Typography.js +23 -8
  247. package/dist/config/confirmation.context.js +1 -1
  248. package/dist/config/link.context.js +23 -9
  249. package/dist/config/router.context.d.ts +3 -4
  250. package/dist/config/router.context.js +42 -18
  251. package/dist/config/theme.context.js +98 -45
  252. package/dist/config/uiConfig.context.d.ts +15 -3
  253. package/dist/config/uiConfig.context.js +55 -11
  254. package/dist/config/uiStyle.context.d.ts +27 -4
  255. package/dist/config/uiStyle.context.js +15 -5
  256. package/dist/helpers/dynamicInputs.d.ts +5 -5
  257. package/dist/helpers/dynamicInputs.js +3 -0
  258. package/dist/hooks/useBreakpoint.js +16 -3
  259. package/dist/hooks/useDebounceCallback.js +51 -17
  260. package/dist/hooks/useFilters.js +145 -80
  261. package/dist/hooks/useForm.js +42 -8
  262. package/dist/hooks/useFormAutosave.js +101 -30
  263. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  264. package/dist/hooks/useIntersectionObserver.js +91 -24
  265. package/dist/hooks/useLocalStorage.js +43 -10
  266. package/dist/hooks/useLongPressRepeat.js +55 -20
  267. package/dist/hooks/usePagination.js +51 -17
  268. package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
  269. package/dist/hooks/useQueryAutocomplete.js +57 -0
  270. package/dist/hooks/useScrollableListBox.js +37 -16
  271. package/dist/hooks/useSorting.js +71 -27
  272. package/dist/hooks/useStateAndRef.js +21 -7
  273. package/dist/hooks/useTableColumnConfig.js +124 -31
  274. package/dist/hooks/useTranslationMemo.js +25 -5
  275. package/dist/index.d.ts +7 -0
  276. package/dist/index.js +5 -3
  277. package/dist/tw-ui-plugin.js +2 -0
  278. package/dist/utils/date-time.utils.d.ts +31 -10
  279. package/dist/utils/date-time.utils.js +117 -22
  280. package/dist/utils/query.utils.d.ts +4 -0
  281. package/dist/utils/query.utils.js +8 -0
  282. package/dist/utils/routing.utils.d.ts +1 -0
  283. package/dist/utils/routing.utils.js +14 -0
  284. package/package.json +2 -2
@@ -0,0 +1,479 @@
1
+ import { UIStyle } from "../../../../config/uiStyle.context.js";
2
+ import { UIConfig } from "../../../../config/uiConfig.context.js";
3
+ import { InputClear } from "../../shared/InputClear.js";
4
+ import { inputBase, inputSize } from "../../shared/input.cva.js";
5
+ import { InputFrame } from "../../Skeleton/InputFrame.js";
6
+ import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
7
+ import { getStaticNumberDisplayValue } from "../shared/numberStatic.utils.js";
8
+ import { NumberRangeField } from "./NumberRangeField.js";
9
+ import { c } from "react/compiler-runtime";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { clsx } from "clsx";
12
+ import { useRef, useState } from "react";
13
+ import { useLocale } from "react-aria-components";
14
+ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
15
+ import { Controller, useWatch } from "react-hook-form";
16
+ //#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
17
+ var EMPTY_RANGE = {
18
+ min: null,
19
+ max: null
20
+ };
21
+ var normalizeRangeValue = (value, minValue, maxValue) => {
22
+ if (value) return value;
23
+ return {
24
+ min: minValue ?? null,
25
+ max: maxValue ?? null
26
+ };
27
+ };
28
+ var NumberRangeInputBase = (props) => {
29
+ const $ = c(114);
30
+ const ui = UIConfig.useConfig();
31
+ const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
32
+ const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
33
+ let asProp;
34
+ let autoFocusOnMount;
35
+ let className;
36
+ let error;
37
+ let errorClassName;
38
+ let headerClassName;
39
+ let helperText;
40
+ let hideLabelProps;
41
+ let inputClassName;
42
+ let isClearableProps;
43
+ let isDirty;
44
+ let isDisabled;
45
+ let isHeaderHidden;
46
+ let isRequired;
47
+ let label;
48
+ let maxInputClassName;
49
+ let maxValue;
50
+ let minInputClassName;
51
+ let minValue;
52
+ let onBlur;
53
+ let onChange;
54
+ let onMaxChange;
55
+ let onMinChange;
56
+ let ref;
57
+ let rest;
58
+ let rightContent;
59
+ let sizeProps;
60
+ let t0;
61
+ let t1;
62
+ let t2;
63
+ let t3;
64
+ let t4;
65
+ let t5;
66
+ let tooltipText;
67
+ let value;
68
+ let variantProps;
69
+ if ($[0] !== props) {
70
+ ({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder: t0, maxPlaceholder: t1, minLabel: t2, maxLabel: t3, invalidRangeError: t4, hideInnerLabels: t5, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest} = props);
71
+ $[0] = props;
72
+ $[1] = asProp;
73
+ $[2] = autoFocusOnMount;
74
+ $[3] = className;
75
+ $[4] = error;
76
+ $[5] = errorClassName;
77
+ $[6] = headerClassName;
78
+ $[7] = helperText;
79
+ $[8] = hideLabelProps;
80
+ $[9] = inputClassName;
81
+ $[10] = isClearableProps;
82
+ $[11] = isDirty;
83
+ $[12] = isDisabled;
84
+ $[13] = isHeaderHidden;
85
+ $[14] = isRequired;
86
+ $[15] = label;
87
+ $[16] = maxInputClassName;
88
+ $[17] = maxValue;
89
+ $[18] = minInputClassName;
90
+ $[19] = minValue;
91
+ $[20] = onBlur;
92
+ $[21] = onChange;
93
+ $[22] = onMaxChange;
94
+ $[23] = onMinChange;
95
+ $[24] = ref;
96
+ $[25] = rest;
97
+ $[26] = rightContent;
98
+ $[27] = sizeProps;
99
+ $[28] = t0;
100
+ $[29] = t1;
101
+ $[30] = t2;
102
+ $[31] = t3;
103
+ $[32] = t4;
104
+ $[33] = t5;
105
+ $[34] = tooltipText;
106
+ $[35] = value;
107
+ $[36] = variantProps;
108
+ } else {
109
+ asProp = $[1];
110
+ autoFocusOnMount = $[2];
111
+ className = $[3];
112
+ error = $[4];
113
+ errorClassName = $[5];
114
+ headerClassName = $[6];
115
+ helperText = $[7];
116
+ hideLabelProps = $[8];
117
+ inputClassName = $[9];
118
+ isClearableProps = $[10];
119
+ isDirty = $[11];
120
+ isDisabled = $[12];
121
+ isHeaderHidden = $[13];
122
+ isRequired = $[14];
123
+ label = $[15];
124
+ maxInputClassName = $[16];
125
+ maxValue = $[17];
126
+ minInputClassName = $[18];
127
+ minValue = $[19];
128
+ onBlur = $[20];
129
+ onChange = $[21];
130
+ onMaxChange = $[22];
131
+ onMinChange = $[23];
132
+ ref = $[24];
133
+ rest = $[25];
134
+ rightContent = $[26];
135
+ sizeProps = $[27];
136
+ t0 = $[28];
137
+ t1 = $[29];
138
+ t2 = $[30];
139
+ t3 = $[31];
140
+ t4 = $[32];
141
+ t5 = $[33];
142
+ tooltipText = $[34];
143
+ value = $[35];
144
+ variantProps = $[36];
145
+ }
146
+ const minPlaceholder = t0 === void 0 ? "Min" : t0;
147
+ const maxPlaceholder = t1 === void 0 ? "Max" : t1;
148
+ const minLabel = t2 === void 0 ? "Minimum" : t2;
149
+ const maxLabel = t3 === void 0 ? "Maximum" : t3;
150
+ const invalidRangeError = t4 === void 0 ? "Minimum cannot be greater than maximum" : t4;
151
+ const hideInnerLabels = t5 === void 0 ? true : t5;
152
+ const isClearable = isClearableProps ?? ui.input.isClearable;
153
+ const as = asProp ?? ui.input.as;
154
+ const variant = variantProps ?? ui.input.variant;
155
+ const size = sizeProps ?? ui.input.size;
156
+ const hideLabel = hideLabelProps ?? ui.input.hideLabel;
157
+ let t6;
158
+ if ($[37] !== maxValue || $[38] !== minValue || $[39] !== value) {
159
+ t6 = normalizeRangeValue(value, minValue, maxValue);
160
+ $[37] = maxValue;
161
+ $[38] = minValue;
162
+ $[39] = value;
163
+ $[40] = t6;
164
+ } else t6 = $[40];
165
+ const rangeValue = t6;
166
+ const isEmpty = rangeValue.min === null && rangeValue.max === null;
167
+ const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
168
+ const effectiveError = error || rangeError;
169
+ let t7;
170
+ if ($[41] !== isDisabled) {
171
+ t7 = { isDisabled };
172
+ $[41] = isDisabled;
173
+ $[42] = t7;
174
+ } else t7 = $[42];
175
+ const { hoverProps, isHovered } = useHover(t7);
176
+ const { isFocusVisible } = useFocusVisible();
177
+ const [isFocused, setIsFocused] = useState(false);
178
+ let t8;
179
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
180
+ t8 = { onFocusWithinChange: setIsFocused };
181
+ $[43] = t8;
182
+ } else t8 = $[43];
183
+ const { focusWithinProps } = useFocusWithin(t8);
184
+ const t9 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
185
+ let t10;
186
+ if ($[44] !== effectiveError || $[45] !== errorClassName || $[46] !== headerClassName || $[47] !== helperText || $[48] !== hideLabel || $[49] !== isDisabled || $[50] !== isRequired || $[51] !== label || $[52] !== rightContent || $[53] !== t9 || $[54] !== tooltipText) {
187
+ t10 = {
188
+ error: effectiveError,
189
+ label,
190
+ tooltipText,
191
+ helperText,
192
+ isRequired,
193
+ rightContent,
194
+ isHeaderHidden: t9,
195
+ hideLabel,
196
+ isDisabled,
197
+ headerClassName,
198
+ errorClassName
199
+ };
200
+ $[44] = effectiveError;
201
+ $[45] = errorClassName;
202
+ $[46] = headerClassName;
203
+ $[47] = helperText;
204
+ $[48] = hideLabel;
205
+ $[49] = isDisabled;
206
+ $[50] = isRequired;
207
+ $[51] = label;
208
+ $[52] = rightContent;
209
+ $[53] = t9;
210
+ $[54] = tooltipText;
211
+ $[55] = t10;
212
+ } else t10 = $[55];
213
+ const formFieldProps = t10;
214
+ const t11 = hideLabel || isHeaderHidden;
215
+ let t12;
216
+ if ($[56] !== headerClassName || $[57] !== helperText || $[58] !== isDisabled || $[59] !== isRequired || $[60] !== label || $[61] !== rightContent || $[62] !== t11 || $[63] !== tooltipText) {
217
+ t12 = {
218
+ label,
219
+ tooltipText,
220
+ helperText,
221
+ isRequired,
222
+ rightContent,
223
+ isHeaderHidden: t11,
224
+ isDisabled,
225
+ className: headerClassName
226
+ };
227
+ $[56] = headerClassName;
228
+ $[57] = helperText;
229
+ $[58] = isDisabled;
230
+ $[59] = isRequired;
231
+ $[60] = label;
232
+ $[61] = rightContent;
233
+ $[62] = t11;
234
+ $[63] = tooltipText;
235
+ $[64] = t12;
236
+ } else t12 = $[64];
237
+ const headerProps = t12;
238
+ let t13;
239
+ if ($[65] !== onChange || $[66] !== onMaxChange || $[67] !== onMinChange || $[68] !== rangeValue) {
240
+ t13 = (side, nextValue) => {
241
+ const nextRange = {
242
+ ...rangeValue,
243
+ [side]: nextValue
244
+ };
245
+ onChange?.(nextRange);
246
+ if (side === "min") onMinChange?.(nextValue);
247
+ else onMaxChange?.(nextValue);
248
+ };
249
+ $[65] = onChange;
250
+ $[66] = onMaxChange;
251
+ $[67] = onMinChange;
252
+ $[68] = rangeValue;
253
+ $[69] = t13;
254
+ } else t13 = $[69];
255
+ const updateRange = t13;
256
+ let t14;
257
+ if ($[70] !== onBlur || $[71] !== updateRange) {
258
+ t14 = (side_0) => {
259
+ updateRange(side_0, null);
260
+ onBlur?.({ target: { value: "" } });
261
+ };
262
+ $[70] = onBlur;
263
+ $[71] = updateRange;
264
+ $[72] = t14;
265
+ } else t14 = $[72];
266
+ const clearRangeSide = t14;
267
+ let t15;
268
+ if ($[73] !== as || $[74] !== inputBaseCva || $[75] !== variant) {
269
+ t15 = inputBaseCva({
270
+ variant,
271
+ as
272
+ });
273
+ $[73] = as;
274
+ $[74] = inputBaseCva;
275
+ $[75] = variant;
276
+ $[76] = t15;
277
+ } else t15 = $[76];
278
+ let t16;
279
+ if ($[77] !== as || $[78] !== inputSizeCva || $[79] !== size) {
280
+ t16 = inputSizeCva({
281
+ size,
282
+ as
283
+ });
284
+ $[77] = as;
285
+ $[78] = inputSizeCva;
286
+ $[79] = size;
287
+ $[80] = t16;
288
+ } else t16 = $[80];
289
+ let t17;
290
+ if ($[81] !== as || $[82] !== autoFocusOnMount || $[83] !== className || $[84] !== clearRangeSide || $[85] !== effectiveError || $[86] !== focusWithinProps || $[87] !== formFieldProps || $[88] !== headerProps || $[89] !== hideInnerLabels || $[90] !== hoverProps || $[91] !== inputClassName || $[92] !== isClearable || $[93] !== isDirty || $[94] !== isDisabled || $[95] !== isEmpty || $[96] !== isFocusVisible || $[97] !== isFocused || $[98] !== isHovered || $[99] !== isRequired || $[100] !== maxInputClassName || $[101] !== maxLabel || $[102] !== maxPlaceholder || $[103] !== minInputClassName || $[104] !== minLabel || $[105] !== minPlaceholder || $[106] !== onBlur || $[107] !== rangeValue || $[108] !== ref || $[109] !== rest || $[110] !== t15 || $[111] !== t16 || $[112] !== updateRange) {
291
+ t17 = /* @__PURE__ */ jsx(NumberRangeField, {
292
+ ...rest,
293
+ ref,
294
+ as,
295
+ className,
296
+ inputClassName,
297
+ minInputClassName,
298
+ maxInputClassName,
299
+ inputBaseClassName: t15,
300
+ inputSizeClassName: t16,
301
+ formFieldProps,
302
+ headerProps,
303
+ rangeValue,
304
+ effectiveError,
305
+ minPlaceholder,
306
+ maxPlaceholder,
307
+ minLabel,
308
+ maxLabel,
309
+ hideInnerLabels,
310
+ isDirty,
311
+ isClearable,
312
+ autoFocusOnMount,
313
+ isDisabled,
314
+ isRequired,
315
+ isEmpty,
316
+ isHovered,
317
+ isFocused,
318
+ isFocusVisible,
319
+ focusWithinProps,
320
+ hoverProps,
321
+ onRangeSideChange: updateRange,
322
+ onRangeSideClear: clearRangeSide,
323
+ onBlur
324
+ });
325
+ $[81] = as;
326
+ $[82] = autoFocusOnMount;
327
+ $[83] = className;
328
+ $[84] = clearRangeSide;
329
+ $[85] = effectiveError;
330
+ $[86] = focusWithinProps;
331
+ $[87] = formFieldProps;
332
+ $[88] = headerProps;
333
+ $[89] = hideInnerLabels;
334
+ $[90] = hoverProps;
335
+ $[91] = inputClassName;
336
+ $[92] = isClearable;
337
+ $[93] = isDirty;
338
+ $[94] = isDisabled;
339
+ $[95] = isEmpty;
340
+ $[96] = isFocusVisible;
341
+ $[97] = isFocused;
342
+ $[98] = isHovered;
343
+ $[99] = isRequired;
344
+ $[100] = maxInputClassName;
345
+ $[101] = maxLabel;
346
+ $[102] = maxPlaceholder;
347
+ $[103] = minInputClassName;
348
+ $[104] = minLabel;
349
+ $[105] = minPlaceholder;
350
+ $[106] = onBlur;
351
+ $[107] = rangeValue;
352
+ $[108] = ref;
353
+ $[109] = rest;
354
+ $[110] = t15;
355
+ $[111] = t16;
356
+ $[112] = updateRange;
357
+ $[113] = t17;
358
+ } else t17 = $[113];
359
+ return t17;
360
+ };
361
+ var NumberRangeInput = ({ renderStaticInput, ...props }) => {
362
+ const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
363
+ const ui = UIConfig.useConfig();
364
+ const { locale } = useLocale();
365
+ const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
366
+ const { shouldFocus, renderRealInput } = useStaticInputHandoff({
367
+ inputRef: useRef(null),
368
+ renderInput,
369
+ setRenderInput
370
+ });
371
+ const watchedValue = "formControl" in props && props.formControl ? useWatch({
372
+ control: props.formControl.control,
373
+ name: props.formControl.name
374
+ }) : props.value;
375
+ let isFormControlDisabled = false;
376
+ if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
377
+ if (!renderInput) {
378
+ const staticValue = normalizeRangeValue(watchedValue, props.minValue, props.maxValue);
379
+ const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
380
+ const formatter = new Intl.NumberFormat(locale, formatOptions);
381
+ const minDisplay = getStaticNumberDisplayValue(staticValue.min, formatter);
382
+ const maxDisplay = getStaticNumberDisplayValue(staticValue.max, formatter);
383
+ const hasValue = minDisplay !== null || maxDisplay !== null;
384
+ const rangeError = staticValue.min !== null && staticValue.max !== null && staticValue.min > staticValue.max ? props.invalidRangeError ?? "Minimum cannot be greater than maximum" : void 0;
385
+ const effectiveError = props.error || rangeError;
386
+ const as = props.as ?? ui.input.as;
387
+ const size = props.size ?? ui.input.size;
388
+ let isDisabled = !!props.isDisabled;
389
+ if (isFormControlDisabled) isDisabled = true;
390
+ const isClearable = props.isClearable ?? ui.input.isClearable;
391
+ const dataAttributes = {
392
+ dataIsEmpty: !hasValue,
393
+ dataIsFilled: hasValue,
394
+ dataIsDirty: props.isDirty,
395
+ dataIsRequired: props.isRequired,
396
+ dataIsDisabled: isDisabled,
397
+ dataDisabled: isDisabled,
398
+ dataInvalid: !!effectiveError,
399
+ dataHasSelection: hasValue
400
+ };
401
+ return /* @__PURE__ */ jsx(InputFrame, {
402
+ ...props,
403
+ error: effectiveError,
404
+ isDisabled,
405
+ className: clsx("group w-full", as === "inline" && "h-full", props.className),
406
+ inputClassName: props.inputClassName,
407
+ contentClassName: "pr-0!",
408
+ trailingClassName: "py-0! pl-0!",
409
+ contentWrapperClassName: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0! py-0! px-0!", inputSizeCva({
410
+ size,
411
+ as
412
+ })),
413
+ dataAttributes,
414
+ renderStatic: true,
415
+ onStaticInteract: renderRealInput,
416
+ isClearable: false,
417
+ labelPlacement: "content-wrapper",
418
+ children: ({ id, ...dataAttributeProps }) => /* @__PURE__ */ jsxs(Fragment, { children: [
419
+ /* @__PURE__ */ jsx("input", {
420
+ id,
421
+ readOnly: true,
422
+ disabled: isDisabled,
423
+ tabIndex: -1,
424
+ value: minDisplay ?? "",
425
+ placeholder: props.minPlaceholder ?? "Min",
426
+ className: clsx("w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.minInputClassName),
427
+ ...dataAttributeProps,
428
+ "data-rac": true
429
+ }),
430
+ isClearable && /* @__PURE__ */ jsx(InputClear, {
431
+ onClear: () => {},
432
+ renderStatic: true
433
+ }),
434
+ /* @__PURE__ */ jsx("span", {
435
+ className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
436
+ children: "-"
437
+ }),
438
+ /* @__PURE__ */ jsx("input", {
439
+ id: `${id}-max`,
440
+ readOnly: true,
441
+ disabled: isDisabled,
442
+ tabIndex: -1,
443
+ value: maxDisplay ?? "",
444
+ placeholder: props.maxPlaceholder ?? "Max",
445
+ className: clsx("w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.maxInputClassName),
446
+ ...dataAttributeProps,
447
+ "data-rac": true
448
+ }),
449
+ isClearable && /* @__PURE__ */ jsx(InputClear, {
450
+ onClear: () => {},
451
+ renderStatic: true
452
+ })
453
+ ] })
454
+ });
455
+ }
456
+ if ("formControl" in props && props.formControl) {
457
+ const { formControl, ref, ...innerProps } = props;
458
+ return /* @__PURE__ */ jsx(Controller, {
459
+ control: formControl.control,
460
+ name: formControl.name,
461
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(NumberRangeInputBase, {
462
+ ...innerProps,
463
+ ref,
464
+ value: field.value ?? EMPTY_RANGE,
465
+ onChange: field.onChange,
466
+ onBlur: field.onBlur,
467
+ isDisabled: field.disabled || props.isDisabled,
468
+ error: props.error ?? error?.message,
469
+ autoFocusOnMount: shouldFocus
470
+ })
471
+ });
472
+ }
473
+ return /* @__PURE__ */ jsx(NumberRangeInputBase, {
474
+ ...props,
475
+ autoFocusOnMount: shouldFocus
476
+ });
477
+ };
478
+ //#endregion
479
+ export { NumberRangeInput };
@@ -2,22 +2,61 @@ 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";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { useState } from "react";
7
8
  import { useTranslation } from "react-i18next";
8
9
  //#region src/components/inputs/Input/PasswordInput/PasswordInput.tsx
9
10
  var PasswordInput = (props) => {
11
+ const $0 = c(15);
10
12
  const { t } = useTranslation("ui");
11
13
  const [isRevealed, setIsRevealed] = useState(false);
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
- });
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;
21
60
  };
22
61
  //#endregion
23
62
  export { PasswordInput };
@@ -0,0 +1,4 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const textAreaWrapper: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
3
+ export interface TextAreaWrapperVariantProps extends VariantProps<typeof textAreaWrapper> {
4
+ }
@@ -0,0 +1,5 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/components/inputs/Input/TextArea/TextArea.cva.ts
3
+ var textAreaWrapper = cva("group/text-area relative h-full");
4
+ //#endregion
5
+ export { textAreaWrapper };