@povio/ui 2.3.2-rc.3 → 2.3.3

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 +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/assets/locales/sl/translation.json.js +2 -2
  48. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  49. package/dist/components/Menu/Menu.js +2 -18
  50. package/dist/components/Menu/MenuDesktop.js +7 -41
  51. package/dist/components/Menu/MenuItem.js +9 -32
  52. package/dist/components/Menu/MenuMobile.js +38 -97
  53. package/dist/components/Menu/MenuPopover.js +29 -105
  54. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  56. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  57. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  58. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  59. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  60. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  61. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  62. package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
  63. package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
  64. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  65. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  66. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  67. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
  68. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -368
  69. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
  70. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +298 -506
  71. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -13
  72. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +56 -273
  73. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -6
  74. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +130 -606
  75. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  76. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -332
  77. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -3
  78. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -301
  79. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -3
  80. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -146
  81. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  82. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  83. package/dist/components/inputs/DateTime/shared/DateField.js +112 -311
  84. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -13
  85. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +139 -383
  86. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
  87. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
  88. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  89. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  90. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  91. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  92. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  93. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  94. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
  95. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
  96. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  97. package/dist/components/inputs/File/FileUpload.js +44 -87
  98. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  99. package/dist/components/inputs/File/InputUpload.js +79 -317
  100. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  101. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  102. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  103. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  104. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  105. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  106. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  107. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  108. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  109. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  110. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  111. package/dist/components/inputs/FormField/FormField.js +37 -119
  112. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  113. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  114. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  115. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  116. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  117. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  118. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  119. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  120. package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
  121. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  122. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  123. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  124. package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
  125. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  126. package/dist/components/inputs/Inputs/Form.js +11 -40
  127. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
  128. package/dist/components/inputs/Inputs/InputItem.js +14 -69
  129. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  130. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
  131. package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
  132. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  133. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  134. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  135. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -214
  136. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  137. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -104
  138. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  139. package/dist/components/inputs/Selection/Select/Select.js +18 -225
  140. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  141. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  142. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  143. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  144. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  145. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -330
  146. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  147. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  148. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  149. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  150. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  151. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  152. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  153. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  154. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  155. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/select.context.js +36 -67
  157. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  158. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  159. package/dist/components/inputs/Slider/Slider.d.ts +1 -2
  160. package/dist/components/inputs/Slider/Slider.js +76 -265
  161. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  162. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  163. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  164. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  165. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  166. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  167. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  168. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  169. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  170. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  171. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  172. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  173. package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
  174. package/dist/components/inputs/Toggle/Toggle.js +37 -214
  175. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  176. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  177. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  178. package/dist/components/inputs/shared/CheckContent.js +11 -21
  179. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  180. package/dist/components/inputs/shared/InputClear.js +12 -88
  181. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  182. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  183. package/dist/components/inputs/shared/input.cva.js +4 -32
  184. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  185. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  186. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  187. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  188. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  189. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  190. package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -96
  191. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  192. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  193. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  194. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  195. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  196. package/dist/components/segment/Segment.js +57 -218
  197. package/dist/components/segment/SegmentItem.js +10 -67
  198. package/dist/components/shared/pagination/Pagination.js +22 -108
  199. package/dist/components/shared/pagination/PaginationList.js +64 -167
  200. package/dist/components/status/Alert/Alert.js +30 -97
  201. package/dist/components/status/Loader/Loader.js +22 -77
  202. package/dist/components/status/Toast/Toast.js +13 -21
  203. package/dist/components/status/Toast/useToast.js +57 -62
  204. package/dist/components/table/ColumnConfig.js +54 -158
  205. package/dist/components/table/InfiniteTable.js +16 -67
  206. package/dist/components/table/PaginatedTable.js +18 -84
  207. package/dist/components/table/Table.js +27 -28
  208. package/dist/components/text/Link/Link.js +7 -19
  209. package/dist/components/text/Typography/Typography.js +8 -23
  210. package/dist/config/confirmation.context.js +1 -1
  211. package/dist/config/link.context.js +9 -23
  212. package/dist/config/router.context.js +16 -42
  213. package/dist/config/theme.context.js +45 -98
  214. package/dist/config/uiConfig.context.d.ts +6 -19
  215. package/dist/config/uiConfig.context.js +14 -67
  216. package/dist/config/uiStyle.context.d.ts +4 -27
  217. package/dist/config/uiStyle.context.js +5 -15
  218. package/dist/helpers/dynamicInputs.d.ts +5 -5
  219. package/dist/helpers/dynamicInputs.js +0 -3
  220. package/dist/hooks/useBreakpoint.js +3 -16
  221. package/dist/hooks/useDebounceCallback.js +17 -51
  222. package/dist/hooks/useFilters.js +64 -125
  223. package/dist/hooks/useForm.js +8 -42
  224. package/dist/hooks/useFormAutosave.js +30 -101
  225. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  226. package/dist/hooks/useIntersectionObserver.js +24 -91
  227. package/dist/hooks/useLocalStorage.js +10 -43
  228. package/dist/hooks/useLongPressRepeat.js +20 -55
  229. package/dist/hooks/usePagination.js +19 -49
  230. package/dist/hooks/useScrollableListBox.js +16 -37
  231. package/dist/hooks/useSorting.js +28 -69
  232. package/dist/hooks/useStateAndRef.js +7 -21
  233. package/dist/hooks/useTableColumnConfig.js +31 -124
  234. package/dist/hooks/useTranslationMemo.js +5 -25
  235. package/dist/index.d.ts +0 -7
  236. package/dist/index.js +2 -4
  237. package/dist/tw-ui-plugin.js +0 -6
  238. package/dist/utils/date-time.utils.d.ts +10 -38
  239. package/dist/utils/date-time.utils.js +22 -134
  240. package/package.json +1 -1
  241. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
  242. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  243. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  244. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
  245. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
  246. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  247. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  248. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -39
  249. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
  250. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  251. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  252. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  254. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  255. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  256. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
  257. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  258. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  259. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  260. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  261. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  262. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  263. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -173
  264. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  265. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  266. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -12
  267. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -36
  268. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  269. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  270. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  271. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  272. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  273. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  274. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  275. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
  276. package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
  277. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  278. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  279. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  280. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  281. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  282. package/dist/hooks/useQueryAutocomplete.js +0 -57
  283. package/dist/utils/query.utils.d.ts +0 -4
  284. package/dist/utils/query.utils.js +0 -8
@@ -3,14 +3,10 @@ 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";
@@ -18,475 +14,129 @@ 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(90);
22
17
  const ui = UIConfig.useConfig();
23
18
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
24
- const hasControlledValue = "value" in props;
25
19
  const inputRef = useRef(null);
26
- 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;
27
- const formatOptions = formatOptionsProp ?? ui.numberInput.formatOptions;
28
- const variant = variantProp ?? ui.input.variant;
29
- const as = asProp ?? ui.input.as;
30
- const size = sizeProp ?? ui.input.size;
31
- const hideLabel = hideLabelProp ?? ui.input.hideLabel;
32
- 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;
33
21
  const numberFieldRef = useRef(null);
34
22
  const { isFocusVisible } = useFocusVisible();
35
23
  const { locale } = useLocale();
36
- let t0;
37
- if ($[0] !== onChange) {
38
- t0 = (nextValue) => onChange?.(Number.isNaN(nextValue) ? null : nextValue);
39
- $[0] = onChange;
40
- $[1] = t0;
41
- } else t0 = $[1];
42
- let t1;
43
- if ($[2] !== onBlur) {
44
- t1 = (e) => onBlur?.({ target: e.target });
45
- $[2] = onBlur;
46
- $[3] = t1;
47
- } else t1 = $[3];
48
24
  const numberProps = {
49
25
  ...rest,
50
- value: hasControlledValue ? value ?? NaN : void 0,
26
+ value: value ?? void 0,
51
27
  label,
52
28
  isDisabled,
53
29
  isInvalid: !!error,
54
30
  isRequired,
55
- onChange: t0,
56
- onBlur: t1,
31
+ onChange,
32
+ onBlur: (e) => onBlur?.({ target: e.target }),
57
33
  locale,
58
34
  formatOptions
59
35
  };
60
36
  const state = useNumberFieldState(numberProps);
61
37
  const { labelProps, inputProps } = useNumberField(numberProps, state, numberFieldRef);
62
- let t2;
63
- let t3;
64
- if ($[4] !== autoFocusOnMount || $[5] !== isDisabled) {
65
- t2 = () => {
66
- if (!autoFocusOnMount || isDisabled) return;
67
- requestAnimationFrame(() => inputRef.current?.focus());
68
- };
69
- t3 = [autoFocusOnMount, isDisabled];
70
- $[4] = autoFocusOnMount;
71
- $[5] = isDisabled;
72
- $[6] = t2;
73
- $[7] = t3;
74
- } else {
75
- t2 = $[6];
76
- t3 = $[7];
77
- }
78
- useEffect(t2, t3);
79
- const t4 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
80
- let t5;
81
- if ($[8] !== error || $[9] !== errorClassName || $[10] !== headerClassName || $[11] !== helperText || $[12] !== hideLabel || $[13] !== isDisabled || $[14] !== isRequired || $[15] !== label || $[16] !== rightContent || $[17] !== t4 || $[18] !== tooltipText) {
82
- t5 = {
83
- error,
84
- label,
85
- tooltipText,
86
- helperText,
87
- isRequired,
88
- rightContent,
89
- isHeaderHidden: t4,
90
- hideLabel,
91
- isDisabled,
92
- headerClassName,
93
- errorClassName
94
- };
95
- $[8] = error;
96
- $[9] = errorClassName;
97
- $[10] = headerClassName;
98
- $[11] = helperText;
99
- $[12] = hideLabel;
100
- $[13] = isDisabled;
101
- $[14] = isRequired;
102
- $[15] = label;
103
- $[16] = rightContent;
104
- $[17] = t4;
105
- $[18] = tooltipText;
106
- $[19] = t5;
107
- } else t5 = $[19];
108
- const formFieldProps = t5;
109
- let t6;
110
- if ($[20] !== onBlur) {
111
- t6 = (e_0) => {
112
- const target = numberFieldRef.current ?? e_0?.target;
113
- onBlur?.({ target });
114
- };
115
- $[20] = onBlur;
116
- $[21] = t6;
117
- } else t6 = $[21];
118
- const handleInputBlur = t6;
119
- let t7;
120
- if ($[22] !== onChange || $[23] !== state) {
121
- t7 = (val) => {
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) => {
122
64
  if (val === "") state.setInputValue("");
123
65
  onChange?.(val === "" ? null : Number(val));
124
- };
125
- $[22] = onChange;
126
- $[23] = state;
127
- $[24] = t7;
128
- } else t7 = $[24];
129
- let t8;
130
- if ($[25] !== action || $[26] !== handleInputBlur || $[27] !== isClearable || $[28] !== isDisabled || $[29] !== isLoading || $[30] !== leadingIcon || $[31] !== state.inputValue || $[32] !== t7 || $[33] !== trailingIcon || $[34] !== unit) {
131
- t8 = {
132
- unit,
133
- isLoading,
134
- isDisabled,
135
- action,
136
- leadingIcon,
137
- trailingIcon,
138
- isClearable,
139
- onChange: t7,
140
- value: state.inputValue,
141
- onBlur: handleInputBlur
142
- };
143
- $[25] = action;
144
- $[26] = handleInputBlur;
145
- $[27] = isClearable;
146
- $[28] = isDisabled;
147
- $[29] = isLoading;
148
- $[30] = leadingIcon;
149
- $[31] = state.inputValue;
150
- $[32] = t7;
151
- $[33] = trailingIcon;
152
- $[34] = unit;
153
- $[35] = t8;
154
- } else t8 = $[35];
155
- const inputContentProps = t8;
156
- const t9 = hideLabel || isHeaderHidden;
157
- let t10;
158
- if ($[36] !== headerClassName || $[37] !== helperText || $[38] !== isDisabled || $[39] !== isRequired || $[40] !== label || $[41] !== labelProps || $[42] !== rightContent || $[43] !== t9 || $[44] !== tooltipText) {
159
- t10 = {
160
- label,
161
- tooltipText,
162
- helperText,
163
- isRequired,
164
- rightContent,
165
- isHeaderHidden: t9,
166
- isDisabled,
167
- className: headerClassName,
168
- labelProps
169
- };
170
- $[36] = headerClassName;
171
- $[37] = helperText;
172
- $[38] = isDisabled;
173
- $[39] = isRequired;
174
- $[40] = label;
175
- $[41] = labelProps;
176
- $[42] = rightContent;
177
- $[43] = t9;
178
- $[44] = tooltipText;
179
- $[45] = t10;
180
- } else t10 = $[45];
181
- const headerProps = t10;
182
- const dataIsDisabled = isDisabled || void 0;
183
- const T0 = TooltipWrapper;
184
- const t11 = as === "inline" ? -1 : void 0;
185
- const T1 = FormField;
186
- let t12;
187
- if ($[46] !== className) {
188
- t12 = clsx("group w-full", className);
189
- $[46] = className;
190
- $[47] = t12;
191
- } else t12 = $[47];
192
- const t13 = as === "inline" ? -1 : void 0;
193
- const t14 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
194
- variant,
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, {
195
82
  as,
196
- ...rest
197
- }), inputClassName);
198
- let t15;
199
- if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
200
- t15 = () => inputRef.current?.focus();
201
- $[48] = t15;
202
- } else t15 = $[48];
203
- const t16 = value === null || value === void 0 || void 0;
204
- const t17 = isRequired || void 0;
205
- let t18;
206
- if ($[49] !== ref) {
207
- t18 = mergeRefs(ref, inputRef, numberFieldRef);
208
- $[49] = ref;
209
- $[50] = t18;
210
- } else t18 = $[50];
211
- const t19 = isDirty || void 0;
212
- const t20 = isRequired || void 0;
213
- const t21 = state.inputValue === "" || state.inputValue === void 0 || state.inputValue === null || void 0;
214
- const t22 = !("" + value === "" || value === null || value === void 0) || void 0;
215
- const t23 = as === "floating" ? "\xA0" : inputProps.placeholder;
216
- let t24;
217
- if ($[51] !== inputProps || $[52] !== isFocusVisible) {
218
- t24 = (e_1) => {
219
- inputProps.onFocus?.(e_1);
220
- if (isFocusVisible) e_1.target.select();
221
- };
222
- $[51] = inputProps;
223
- $[52] = isFocusVisible;
224
- $[53] = t24;
225
- } else t24 = $[53];
226
- let t25;
227
- if ($[54] !== dataIsDisabled || $[55] !== inputProps || $[56] !== t18 || $[57] !== t19 || $[58] !== t20 || $[59] !== t21 || $[60] !== t22 || $[61] !== t23 || $[62] !== t24) {
228
- t25 = /* @__PURE__ */ jsx(Input, {
229
- ...inputProps,
230
- ref: t18,
231
- "data-is-dirty": t19,
232
- "data-is-required": t20,
233
- "data-is-empty": t21,
234
- "data-is-filled": t22,
235
- "data-is-disabled": dataIsDisabled,
236
- placeholder: t23,
237
- className: "w-full bg-transparent outline-none",
238
- onFocus: t24
239
- });
240
- $[54] = dataIsDisabled;
241
- $[55] = inputProps;
242
- $[56] = t18;
243
- $[57] = t19;
244
- $[58] = t20;
245
- $[59] = t21;
246
- $[60] = t22;
247
- $[61] = t23;
248
- $[62] = t24;
249
- $[63] = t25;
250
- } else t25 = $[63];
251
- let t26;
252
- if ($[64] !== as || $[65] !== headerProps || $[66] !== inputContentProps || $[67] !== size || $[68] !== t25) {
253
- t26 = /* @__PURE__ */ jsx(InputContent, {
254
- ...inputContentProps,
255
- headerProps,
256
- as,
257
- size,
258
- children: t25
259
- });
260
- $[64] = as;
261
- $[65] = headerProps;
262
- $[66] = inputContentProps;
263
- $[67] = size;
264
- $[68] = t25;
265
- $[69] = t26;
266
- } else t26 = $[69];
267
- let t27;
268
- if ($[70] !== dataIsDisabled || $[71] !== t14 || $[72] !== t16 || $[73] !== t17 || $[74] !== t26) {
269
- t27 = /* @__PURE__ */ jsx("div", {
270
- className: t14,
271
- onClick: t15,
272
- "data-is-empty": t16,
273
- "data-is-required": t17,
274
- "data-is-disabled": dataIsDisabled,
275
- children: t26
276
- });
277
- $[70] = dataIsDisabled;
278
- $[71] = t14;
279
- $[72] = t16;
280
- $[73] = t17;
281
- $[74] = t26;
282
- $[75] = t27;
283
- } else t27 = $[75];
284
- let t28;
285
- if ($[76] !== T1 || $[77] !== as || $[78] !== formFieldProps || $[79] !== labelProps || $[80] !== t12 || $[81] !== t13 || $[82] !== t27) {
286
- t28 = /* @__PURE__ */ jsx(T1, {
83
+ error,
84
+ triggerTabIndex: as === "inline" ? -1 : void 0,
85
+ children: /* @__PURE__ */ jsx(FormField, {
287
86
  ...formFieldProps,
288
87
  as,
289
88
  labelProps,
290
- className: t12,
291
- tabIndex: t13,
292
- children: t27
293
- });
294
- $[76] = T1;
295
- $[77] = as;
296
- $[78] = formFieldProps;
297
- $[79] = labelProps;
298
- $[80] = t12;
299
- $[81] = t13;
300
- $[82] = t27;
301
- $[83] = t28;
302
- } else t28 = $[83];
303
- let t29;
304
- if ($[84] !== T0 || $[85] !== as || $[86] !== error || $[87] !== t11 || $[88] !== t28) {
305
- t29 = /* @__PURE__ */ jsx(T0, {
306
- as,
307
- error,
308
- triggerTabIndex: t11,
309
- children: t28
310
- });
311
- $[84] = T0;
312
- $[85] = as;
313
- $[86] = error;
314
- $[87] = t11;
315
- $[88] = t28;
316
- $[89] = t29;
317
- } else t29 = $[89];
318
- return t29;
319
- };
320
- var NumberInputInner = (t0) => {
321
- const $ = c(9);
322
- const { renderStaticInput, isFormControlDisabled, ...props } = t0;
323
- const ui = UIConfig.useConfig();
324
- const { locale } = useLocale();
325
- const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
326
- const inputRef = useRef(null);
327
- let t1;
328
- if ($[0] !== renderInput) {
329
- t1 = {
330
- inputRef,
331
- renderInput,
332
- setRenderInput
333
- };
334
- $[0] = renderInput;
335
- $[1] = t1;
336
- } else t1 = $[1];
337
- const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff(t1);
338
- if (!renderInput) {
339
- const staticValue = props.value ?? props.defaultValue;
340
- const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
341
- const displayValue = getStaticNumberDisplayValue(staticValue, new Intl.NumberFormat(locale, formatOptions)) ?? "";
342
- const hasValue = displayValue !== "";
343
- const as = props.as ?? ui.input.as;
344
- let isDisabled = !!props.isDisabled;
345
- if (isFormControlDisabled) isDisabled = true;
346
- const dataAttributes = {
347
- dataIsEmpty: !hasValue,
348
- dataIsFilled: hasValue,
349
- dataIsDirty: props.isDirty,
350
- dataIsRequired: props.isRequired,
351
- dataIsDisabled: isDisabled,
352
- dataDisabled: isDisabled,
353
- dataInvalid: !!props.error,
354
- dataHasSelection: hasValue
355
- };
356
- const t2 = isDisabled;
357
- const t3 = clsx("group w-full", as === "inline" && "h-full", props.className);
358
- const t4 = props.inputClassName;
359
- const t5 = as === "inline" && "h-full";
360
- let t6;
361
- if ($[2] !== t5) {
362
- t6 = clsx(t5, "pr-0!");
363
- $[2] = t5;
364
- $[3] = t6;
365
- } else t6 = $[3];
366
- return /* @__PURE__ */ jsx(InputFrame, {
367
- ...props,
368
- isDisabled: t2,
369
- className: t3,
370
- dataAttributes,
371
- renderStatic: true,
372
- onStaticInteract: renderRealInput,
373
- inputClassName: t4,
374
- contentClassName: t6,
375
- trailingClassName: "py-0! pl-0!",
376
- wrapContentAndTrailing: true,
377
- reserveTrailingContent: true,
378
- children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
379
- type: "text",
380
- ref: inputRef,
381
- disabled: isDisabled,
382
- inputMode: "numeric",
383
- tabIndex: -1,
384
- value: displayValue,
385
- placeholder: as === "floating" ? "" : props.placeholder,
386
- className: "w-full bg-transparent outline-none",
387
- onChange: (event) => replayStaticInputChange(event.target.value),
388
- ...dataAttributeProps,
389
- "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
+ })
390
117
  })
391
- });
392
- }
393
- const T0 = NumberInputBase;
394
- const t2 = mergeRefs(props.ref, inputRef);
395
- let t3;
396
- if ($[4] !== T0 || $[5] !== props || $[6] !== shouldFocus || $[7] !== t2) {
397
- t3 = /* @__PURE__ */ jsx(T0, {
398
- ...props,
399
- ref: t2,
400
- autoFocusOnMount: shouldFocus
401
- });
402
- $[4] = T0;
403
- $[5] = props;
404
- $[6] = shouldFocus;
405
- $[7] = t2;
406
- $[8] = t3;
407
- } else t3 = $[8];
408
- return t3;
118
+ })
119
+ });
409
120
  };
410
- var NumberInput = (t0) => {
411
- const $ = c(21);
412
- let props;
413
- let renderStaticInput;
414
- if ($[0] !== t0) {
415
- ({renderStaticInput, ...props} = t0);
416
- $[0] = t0;
417
- $[1] = props;
418
- $[2] = renderStaticInput;
419
- } else {
420
- props = $[1];
421
- renderStaticInput = $[2];
422
- }
121
+ var NumberInput = (props) => {
423
122
  if ("formControl" in props && props.formControl) {
424
- let formControl;
425
- let innerProps;
426
- let ref;
427
- if ($[3] !== props) {
428
- ({formControl, ref, ...innerProps} = props);
429
- $[3] = props;
430
- $[4] = formControl;
431
- $[5] = innerProps;
432
- $[6] = ref;
433
- } else {
434
- formControl = $[4];
435
- innerProps = $[5];
436
- ref = $[6];
437
- }
438
- const controlWithOptions = formControl.control;
439
- let t1;
440
- if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
441
- t1 = (t2) => {
442
- const { field, fieldState: t3 } = t2;
443
- const { error, isDirty } = t3;
444
- return /* @__PURE__ */ jsx(NumberInputInner, {
445
- ...innerProps,
446
- ref: mergeRefs(ref, field.ref),
447
- value: field.value,
448
- onChange: field.onChange,
449
- onBlur: field.onBlur,
450
- isDirty,
451
- isDisabled: field.disabled || props.isDisabled,
452
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
453
- error: props.error ?? error?.message,
454
- renderStaticInput
455
- });
456
- };
457
- $[7] = controlWithOptions._options?.disabled;
458
- $[8] = innerProps;
459
- $[9] = props.error;
460
- $[10] = props.isDisabled;
461
- $[11] = ref;
462
- $[12] = renderStaticInput;
463
- $[13] = t1;
464
- } else t1 = $[13];
465
- let t2;
466
- if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
467
- t2 = /* @__PURE__ */ jsx(Controller, {
468
- control: formControl.control,
469
- name: formControl.name,
470
- render: t1
471
- });
472
- $[14] = formControl.control;
473
- $[15] = formControl.name;
474
- $[16] = t1;
475
- $[17] = t2;
476
- } else t2 = $[17];
477
- return t2;
478
- }
479
- let t1;
480
- if ($[18] !== props || $[19] !== renderStaticInput) {
481
- t1 = /* @__PURE__ */ jsx(NumberInputInner, {
482
- ...props,
483
- renderStaticInput
123
+ const { formControl, ref, ...innerProps } = props;
124
+ return /* @__PURE__ */ jsx(Controller, {
125
+ control: formControl.control,
126
+ name: formControl.name,
127
+ render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(NumberInputBase, {
128
+ ...innerProps,
129
+ ref: mergeRefs(ref, field.ref),
130
+ value: field.value,
131
+ onChange: field.onChange,
132
+ onBlur: field.onBlur,
133
+ isDirty,
134
+ isDisabled: field.disabled || props.isDisabled,
135
+ error: props.error ?? error?.message
136
+ }, field.value === null || field.value === void 0 ? "empty" : "filled")
484
137
  });
485
- $[18] = props;
486
- $[19] = renderStaticInput;
487
- $[20] = t1;
488
- } else t1 = $[20];
489
- return t1;
138
+ }
139
+ return /* @__PURE__ */ jsx(NumberInputBase, { ...props }, props.value === null || props.value === void 0 ? "empty" : "filled");
490
140
  };
491
141
  //#endregion
492
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 };