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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +164 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +8 -8
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +103 -103
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +9 -9
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +384 -116
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/File/FileUpload.js +86 -44
  83. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  84. package/dist/components/inputs/File/InputUpload.js +317 -79
  85. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  86. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  87. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  88. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  89. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  90. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  91. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  92. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  93. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  94. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  95. package/dist/components/inputs/FormField/FormField.js +119 -37
  96. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  97. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  98. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  99. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  100. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  101. package/dist/components/inputs/Input/NumberInput/NumberInput.js +253 -82
  102. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  103. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +314 -75
  104. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  105. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  106. package/dist/components/inputs/Input/TextInput/TextInput.js +241 -81
  107. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  108. package/dist/components/inputs/Inputs/Form.js +40 -11
  109. package/dist/components/inputs/Inputs/InputItem.js +65 -14
  110. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  111. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  112. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  113. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  114. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  115. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  116. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  117. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  118. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  119. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  120. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  121. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  122. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  123. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +36 -11
  124. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  125. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  126. package/dist/components/inputs/Skeleton/InputFrame.js +472 -145
  127. package/dist/components/inputs/Slider/Slider.js +247 -74
  128. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  129. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  130. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  131. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  132. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  133. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  134. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  135. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  136. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  137. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  138. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  139. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  140. package/dist/components/inputs/shared/CheckContent.js +21 -10
  141. package/dist/components/inputs/shared/InputClear.js +78 -21
  142. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  143. package/dist/components/inputs/shared/input.cva.js +13 -3
  144. package/dist/components/inputs/shared/useStaticInputHandoff.js +93 -50
  145. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  146. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  147. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  148. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  149. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  150. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  151. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  152. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  153. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  154. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  155. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  156. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  157. package/dist/components/segment/Segment.js +218 -57
  158. package/dist/components/segment/SegmentItem.js +67 -10
  159. package/dist/components/shared/pagination/Pagination.js +108 -22
  160. package/dist/components/shared/pagination/PaginationList.js +167 -64
  161. package/dist/components/status/Alert/Alert.js +97 -30
  162. package/dist/components/status/Loader/Loader.js +77 -22
  163. package/dist/components/status/Toast/Toast.js +21 -13
  164. package/dist/components/status/Toast/useToast.js +62 -57
  165. package/dist/components/table/ColumnConfig.js +158 -54
  166. package/dist/components/table/InfiniteTable.js +67 -16
  167. package/dist/components/table/PaginatedTable.js +84 -18
  168. package/dist/components/table/Table.js +23 -23
  169. package/dist/components/text/Link/Link.js +19 -7
  170. package/dist/components/text/Typography/Typography.js +23 -8
  171. package/dist/config/confirmation.context.js +1 -1
  172. package/dist/config/link.context.js +23 -9
  173. package/dist/config/router.context.js +42 -16
  174. package/dist/config/theme.context.js +98 -45
  175. package/dist/config/uiConfig.context.js +39 -8
  176. package/dist/config/uiStyle.context.js +15 -5
  177. package/dist/hooks/useBreakpoint.js +16 -3
  178. package/dist/hooks/useDebounceCallback.js +51 -17
  179. package/dist/hooks/useFilters.js +125 -64
  180. package/dist/hooks/useForm.js +42 -8
  181. package/dist/hooks/useFormAutosave.js +101 -30
  182. package/dist/hooks/useIntersectionObserver.js +86 -32
  183. package/dist/hooks/useLocalStorage.js +43 -10
  184. package/dist/hooks/useLongPressRepeat.js +55 -20
  185. package/dist/hooks/usePagination.js +49 -19
  186. package/dist/hooks/useScrollableListBox.js +37 -16
  187. package/dist/hooks/useSorting.js +69 -28
  188. package/dist/hooks/useStateAndRef.js +21 -7
  189. package/dist/hooks/useTableColumnConfig.js +124 -31
  190. package/dist/hooks/useTranslationMemo.js +25 -5
  191. package/package.json +1 -1
@@ -6,6 +6,7 @@ import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
6
6
  import { InputFrame } from "../../Skeleton/InputFrame.js";
7
7
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
8
8
  import { InputContent } from "../shared/InputContent.js";
9
+ import { c } from "react/compiler-runtime";
9
10
  import { jsx } from "react/jsx-runtime";
10
11
  import { clsx } from "clsx";
11
12
  import { useEffect, useRef, useState } from "react";
@@ -15,6 +16,7 @@ import { mergeRefs } from "@react-aria/utils";
15
16
  import { Controller, useWatch } from "react-hook-form";
16
17
  //#region src/components/inputs/Input/TextInput/TextInput.tsx
17
18
  var TextInputBase = (props) => {
19
+ const $ = c(83);
18
20
  const ui = UIConfig.useConfig();
19
21
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
20
22
  const inputRef = useRef(null);
@@ -37,91 +39,249 @@ var TextInputBase = (props) => {
37
39
  onChange,
38
40
  onBlur
39
41
  }, textFieldRef);
40
- useEffect(() => {
41
- if (!autoFocusOnMount || isDisabled) return;
42
- requestAnimationFrame(() => inputRef.current?.focus());
43
- }, [autoFocusOnMount, isDisabled]);
44
- const formFieldProps = {
45
- error,
46
- label,
47
- tooltipText,
48
- helperText,
49
- isRequired,
50
- rightContent,
51
- isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
52
- hideLabel,
53
- isDisabled,
54
- headerClassName,
55
- errorClassName
56
- };
57
- const inputContentProps = {
58
- unit,
59
- isLoading,
60
- isDisabled,
61
- action,
62
- leadingIcon,
63
- trailingIcon,
64
- isClearable,
65
- value: inputValue,
66
- onChange,
67
- onBlur
68
- };
69
- const headerProps = {
70
- label,
71
- tooltipText,
72
- helperText,
73
- isRequired,
74
- rightContent,
75
- isHeaderHidden: hideLabel || isHeaderHidden,
76
- isDisabled,
77
- className: headerClassName,
78
- labelProps
79
- };
80
- return /* @__PURE__ */ jsx(TooltipWrapper, {
42
+ let t0;
43
+ let t1;
44
+ if ($[0] !== autoFocusOnMount || $[1] !== isDisabled) {
45
+ t0 = () => {
46
+ if (!autoFocusOnMount || isDisabled) return;
47
+ requestAnimationFrame(() => inputRef.current?.focus());
48
+ };
49
+ t1 = [autoFocusOnMount, isDisabled];
50
+ $[0] = autoFocusOnMount;
51
+ $[1] = isDisabled;
52
+ $[2] = t0;
53
+ $[3] = t1;
54
+ } else {
55
+ t0 = $[2];
56
+ t1 = $[3];
57
+ }
58
+ useEffect(t0, t1);
59
+ const t2 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
60
+ let t3;
61
+ if ($[4] !== error || $[5] !== errorClassName || $[6] !== headerClassName || $[7] !== helperText || $[8] !== hideLabel || $[9] !== isDisabled || $[10] !== isRequired || $[11] !== label || $[12] !== rightContent || $[13] !== t2 || $[14] !== tooltipText) {
62
+ t3 = {
63
+ error,
64
+ label,
65
+ tooltipText,
66
+ helperText,
67
+ isRequired,
68
+ rightContent,
69
+ isHeaderHidden: t2,
70
+ hideLabel,
71
+ isDisabled,
72
+ headerClassName,
73
+ errorClassName
74
+ };
75
+ $[4] = error;
76
+ $[5] = errorClassName;
77
+ $[6] = headerClassName;
78
+ $[7] = helperText;
79
+ $[8] = hideLabel;
80
+ $[9] = isDisabled;
81
+ $[10] = isRequired;
82
+ $[11] = label;
83
+ $[12] = rightContent;
84
+ $[13] = t2;
85
+ $[14] = tooltipText;
86
+ $[15] = t3;
87
+ } else t3 = $[15];
88
+ const formFieldProps = t3;
89
+ let t4;
90
+ if ($[16] !== action || $[17] !== inputValue || $[18] !== isClearable || $[19] !== isDisabled || $[20] !== isLoading || $[21] !== leadingIcon || $[22] !== onBlur || $[23] !== onChange || $[24] !== trailingIcon || $[25] !== unit) {
91
+ t4 = {
92
+ unit,
93
+ isLoading,
94
+ isDisabled,
95
+ action,
96
+ leadingIcon,
97
+ trailingIcon,
98
+ isClearable,
99
+ value: inputValue,
100
+ onChange,
101
+ onBlur
102
+ };
103
+ $[16] = action;
104
+ $[17] = inputValue;
105
+ $[18] = isClearable;
106
+ $[19] = isDisabled;
107
+ $[20] = isLoading;
108
+ $[21] = leadingIcon;
109
+ $[22] = onBlur;
110
+ $[23] = onChange;
111
+ $[24] = trailingIcon;
112
+ $[25] = unit;
113
+ $[26] = t4;
114
+ } else t4 = $[26];
115
+ const inputContentProps = t4;
116
+ const t5 = hideLabel || isHeaderHidden;
117
+ let t6;
118
+ if ($[27] !== headerClassName || $[28] !== helperText || $[29] !== isDisabled || $[30] !== isRequired || $[31] !== label || $[32] !== labelProps || $[33] !== rightContent || $[34] !== t5 || $[35] !== tooltipText) {
119
+ t6 = {
120
+ label,
121
+ tooltipText,
122
+ helperText,
123
+ isRequired,
124
+ rightContent,
125
+ isHeaderHidden: t5,
126
+ isDisabled,
127
+ className: headerClassName,
128
+ labelProps
129
+ };
130
+ $[27] = headerClassName;
131
+ $[28] = helperText;
132
+ $[29] = isDisabled;
133
+ $[30] = isRequired;
134
+ $[31] = label;
135
+ $[32] = labelProps;
136
+ $[33] = rightContent;
137
+ $[34] = t5;
138
+ $[35] = tooltipText;
139
+ $[36] = t6;
140
+ } else t6 = $[36];
141
+ const headerProps = t6;
142
+ const T0 = TooltipWrapper;
143
+ const t7 = as === "inline" ? -1 : void 0;
144
+ const T1 = FormField;
145
+ const t8 = as === "inline" && "h-full";
146
+ let t9;
147
+ if ($[37] !== className || $[38] !== t8) {
148
+ t9 = clsx("group w-full", t8, className);
149
+ $[37] = className;
150
+ $[38] = t8;
151
+ $[39] = t9;
152
+ } else t9 = $[39];
153
+ const t10 = as === "inline" ? -1 : void 0;
154
+ const t11 = value === "" || value === null || value === void 0 || void 0;
155
+ const t12 = isRequired || void 0;
156
+ const t13 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
157
+ variant,
81
158
  as,
82
- error,
83
- triggerTabIndex: as === "inline" ? -1 : void 0,
84
- children: /* @__PURE__ */ jsx(FormField, {
159
+ ...rest
160
+ }), inputClassName);
161
+ let t14;
162
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
163
+ t14 = () => inputRef.current?.focus();
164
+ $[40] = t14;
165
+ } else t14 = $[40];
166
+ const t15 = value === "" || value === null || value === void 0 || void 0;
167
+ const t16 = isRequired || void 0;
168
+ let t17;
169
+ if ($[41] !== ref) {
170
+ t17 = mergeRefs(ref, inputRef);
171
+ $[41] = ref;
172
+ $[42] = t17;
173
+ } else t17 = $[42];
174
+ const t18 = value === "" || value === null || value === void 0 || void 0;
175
+ const t19 = !(value === "" || value === null || value === void 0) || void 0;
176
+ const t20 = isDirty || void 0;
177
+ const t21 = isRequired || void 0;
178
+ const t22 = isDisabled || void 0;
179
+ const t23 = as === "floating" ? "\xA0" : inputProps.placeholder;
180
+ let t24;
181
+ if ($[43] !== inputProps || $[44] !== isFocusVisible) {
182
+ t24 = (e) => {
183
+ inputProps.onFocus?.(e);
184
+ if (isFocusVisible) e.target.select();
185
+ };
186
+ $[43] = inputProps;
187
+ $[44] = isFocusVisible;
188
+ $[45] = t24;
189
+ } else t24 = $[45];
190
+ let t25;
191
+ if ($[46] !== inputProps || $[47] !== t17 || $[48] !== t18 || $[49] !== t19 || $[50] !== t20 || $[51] !== t21 || $[52] !== t22 || $[53] !== t23 || $[54] !== t24) {
192
+ t25 = /* @__PURE__ */ jsx(Input, {
193
+ ...inputProps,
194
+ ref: t17,
195
+ "data-is-empty": t18,
196
+ "data-is-filled": t19,
197
+ "data-is-dirty": t20,
198
+ "data-is-required": t21,
199
+ "data-is-disabled": t22,
200
+ placeholder: t23,
201
+ className: "w-full outline-none",
202
+ onFocus: t24
203
+ });
204
+ $[46] = inputProps;
205
+ $[47] = t17;
206
+ $[48] = t18;
207
+ $[49] = t19;
208
+ $[50] = t20;
209
+ $[51] = t21;
210
+ $[52] = t22;
211
+ $[53] = t23;
212
+ $[54] = t24;
213
+ $[55] = t25;
214
+ } else t25 = $[55];
215
+ let t26;
216
+ if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t25) {
217
+ t26 = /* @__PURE__ */ jsx(InputContent, {
218
+ ...inputContentProps,
219
+ headerProps,
220
+ as,
221
+ size,
222
+ children: t25
223
+ });
224
+ $[56] = as;
225
+ $[57] = headerProps;
226
+ $[58] = inputContentProps;
227
+ $[59] = size;
228
+ $[60] = t25;
229
+ $[61] = t26;
230
+ } else t26 = $[61];
231
+ let t27;
232
+ if ($[62] !== t13 || $[63] !== t15 || $[64] !== t16 || $[65] !== t26) {
233
+ t27 = /* @__PURE__ */ jsx("div", {
234
+ className: t13,
235
+ onClick: t14,
236
+ "data-is-empty": t15,
237
+ "data-is-required": t16,
238
+ children: t26
239
+ });
240
+ $[62] = t13;
241
+ $[63] = t15;
242
+ $[64] = t16;
243
+ $[65] = t26;
244
+ $[66] = t27;
245
+ } else t27 = $[66];
246
+ let t28;
247
+ if ($[67] !== T1 || $[68] !== as || $[69] !== formFieldProps || $[70] !== labelProps || $[71] !== t10 || $[72] !== t11 || $[73] !== t12 || $[74] !== t27 || $[75] !== t9) {
248
+ t28 = /* @__PURE__ */ jsx(T1, {
85
249
  ...formFieldProps,
86
250
  as,
87
251
  labelProps,
88
- className: clsx("group w-full", as === "inline" && "h-full", className),
89
- tabIndex: as === "inline" ? -1 : void 0,
90
- "data-is-empty": value === "" || value === null || value === void 0 || void 0,
91
- "data-is-required": isRequired || void 0,
92
- children: /* @__PURE__ */ jsx("div", {
93
- className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
94
- variant,
95
- as,
96
- ...rest
97
- }), inputClassName),
98
- onClick: () => inputRef.current?.focus(),
99
- "data-is-empty": value === "" || value === null || value === void 0 || void 0,
100
- "data-is-required": isRequired || void 0,
101
- children: /* @__PURE__ */ jsx(InputContent, {
102
- ...inputContentProps,
103
- headerProps,
104
- as,
105
- size,
106
- children: /* @__PURE__ */ jsx(Input, {
107
- ...inputProps,
108
- ref: mergeRefs(ref, inputRef),
109
- "data-is-empty": value === "" || value === null || value === void 0 || void 0,
110
- "data-is-filled": !(value === "" || value === null || value === void 0) || void 0,
111
- "data-is-dirty": isDirty || void 0,
112
- "data-is-required": isRequired || void 0,
113
- "data-is-disabled": isDisabled || void 0,
114
- placeholder: as === "floating" ? "\xA0" : inputProps.placeholder,
115
- className: "w-full outline-none",
116
- onFocus: (e) => {
117
- inputProps.onFocus?.(e);
118
- if (isFocusVisible) e.target.select();
119
- }
120
- })
121
- })
122
- })
123
- })
124
- });
252
+ className: t9,
253
+ tabIndex: t10,
254
+ "data-is-empty": t11,
255
+ "data-is-required": t12,
256
+ children: t27
257
+ });
258
+ $[67] = T1;
259
+ $[68] = as;
260
+ $[69] = formFieldProps;
261
+ $[70] = labelProps;
262
+ $[71] = t10;
263
+ $[72] = t11;
264
+ $[73] = t12;
265
+ $[74] = t27;
266
+ $[75] = t9;
267
+ $[76] = t28;
268
+ } else t28 = $[76];
269
+ let t29;
270
+ if ($[77] !== T0 || $[78] !== as || $[79] !== error || $[80] !== t28 || $[81] !== t7) {
271
+ t29 = /* @__PURE__ */ jsx(T0, {
272
+ as,
273
+ error,
274
+ triggerTabIndex: t7,
275
+ children: t28
276
+ });
277
+ $[77] = T0;
278
+ $[78] = as;
279
+ $[79] = error;
280
+ $[80] = t28;
281
+ $[81] = t7;
282
+ $[82] = t29;
283
+ } else t29 = $[82];
284
+ return t29;
125
285
  };
126
286
  var TextInput = ({ renderStaticInput, ...props }) => {
127
287
  const ui = UIConfig.useConfig();
@@ -5,74 +5,206 @@ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconBu
5
5
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
6
6
  import { InputClear } from "../../shared/InputClear.js";
7
7
  import { inputContentWrapper, inputSize } from "../../shared/input.cva.js";
8
+ import { c } from "react/compiler-runtime";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  import { clsx } from "clsx";
10
11
  import { isValidElement } from "react";
11
12
  //#region src/components/inputs/Input/shared/InputContent.tsx
12
- var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size }) => {
13
+ var InputContent = (t0) => {
14
+ const $ = c(64);
15
+ const { leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size } = t0;
13
16
  const typographyCva = UIStyle.useCva("typography.cva", typography);
14
17
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
15
18
  const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
16
- const isLeadingIconElement = LeadingIcon && isValidElement(LeadingIcon);
17
- const isTrailingIconElement = TrailingIcon && isValidElement(TrailingIcon);
19
+ let t1;
20
+ if ($[0] !== LeadingIcon) {
21
+ t1 = LeadingIcon && isValidElement(LeadingIcon);
22
+ $[0] = LeadingIcon;
23
+ $[1] = t1;
24
+ } else t1 = $[1];
25
+ const isLeadingIconElement = t1;
26
+ let t2;
27
+ if ($[2] !== TrailingIcon) {
28
+ t2 = TrailingIcon && isValidElement(TrailingIcon);
29
+ $[2] = TrailingIcon;
30
+ $[3] = t2;
31
+ } else t2 = $[3];
32
+ const isTrailingIconElement = t2;
18
33
  const showClear = value != null && value !== "" && !isDisabled;
19
- return /* @__PURE__ */ jsxs("div", {
20
- className: "flex w-full items-center gap-input-gap-input-text-to-elements",
21
- children: [/* @__PURE__ */ jsxs("div", {
22
- className: clsx("group/input-content flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", as === "inline" && "h-full", inputSizeCva({
23
- size,
24
- as
25
- })),
26
- children: [LeadingIcon && /* @__PURE__ */ jsx("div", {
27
- className: clsx(!isLeadingIconElement && "pointer-events-none"),
28
- children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
29
- }), /* @__PURE__ */ jsxs("div", {
30
- className: inputContentWrapperCva({ as }),
31
- children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
32
- as,
33
- size,
34
- ...headerProps
35
- }), children]
36
- })]
37
- }), /* @__PURE__ */ jsxs("div", {
38
- className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
39
- size,
40
- as
41
- }), !isTrailingIconElement && !action && !(isClearable && showClear) && "pointer-events-none"),
34
+ const t3 = as === "inline" && "h-full";
35
+ let t4;
36
+ if ($[4] !== as || $[5] !== inputSizeCva || $[6] !== size || $[7] !== t3) {
37
+ t4 = clsx("group/input-content flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", t3, inputSizeCva({
38
+ size,
39
+ as
40
+ }));
41
+ $[4] = as;
42
+ $[5] = inputSizeCva;
43
+ $[6] = size;
44
+ $[7] = t3;
45
+ $[8] = t4;
46
+ } else t4 = $[8];
47
+ let t5;
48
+ if ($[9] !== LeadingIcon || $[10] !== isLeadingIconElement) {
49
+ t5 = LeadingIcon && /* @__PURE__ */ jsx("div", {
50
+ className: clsx(!isLeadingIconElement && "pointer-events-none"),
51
+ children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
52
+ });
53
+ $[9] = LeadingIcon;
54
+ $[10] = isLeadingIconElement;
55
+ $[11] = t5;
56
+ } else t5 = $[11];
57
+ let t6;
58
+ if ($[12] !== as || $[13] !== inputContentWrapperCva) {
59
+ t6 = inputContentWrapperCva({ as });
60
+ $[12] = as;
61
+ $[13] = inputContentWrapperCva;
62
+ $[14] = t6;
63
+ } else t6 = $[14];
64
+ let t7;
65
+ if ($[15] !== as || $[16] !== headerProps || $[17] !== size) {
66
+ t7 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
67
+ as,
68
+ size,
69
+ ...headerProps
70
+ });
71
+ $[15] = as;
72
+ $[16] = headerProps;
73
+ $[17] = size;
74
+ $[18] = t7;
75
+ } else t7 = $[18];
76
+ let t8;
77
+ if ($[19] !== children || $[20] !== t6 || $[21] !== t7) {
78
+ t8 = /* @__PURE__ */ jsxs("div", {
79
+ className: t6,
80
+ children: [t7, children]
81
+ });
82
+ $[19] = children;
83
+ $[20] = t6;
84
+ $[21] = t7;
85
+ $[22] = t8;
86
+ } else t8 = $[22];
87
+ let t9;
88
+ if ($[23] !== t4 || $[24] !== t5 || $[25] !== t8) {
89
+ t9 = /* @__PURE__ */ jsxs("div", {
90
+ className: t4,
91
+ children: [t5, t8]
92
+ });
93
+ $[23] = t4;
94
+ $[24] = t5;
95
+ $[25] = t8;
96
+ $[26] = t9;
97
+ } else t9 = $[26];
98
+ let t10;
99
+ if ($[27] !== action || $[28] !== as || $[29] !== inputSizeCva || $[30] !== isClearable || $[31] !== isTrailingIconElement || $[32] !== showClear || $[33] !== size) {
100
+ t10 = clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
101
+ size,
102
+ as
103
+ }), !isTrailingIconElement && !action && !(isClearable && showClear) && "pointer-events-none");
104
+ $[27] = action;
105
+ $[28] = as;
106
+ $[29] = inputSizeCva;
107
+ $[30] = isClearable;
108
+ $[31] = isTrailingIconElement;
109
+ $[32] = showClear;
110
+ $[33] = size;
111
+ $[34] = t10;
112
+ } else t10 = $[34];
113
+ let t11;
114
+ if ($[35] !== isClearable || $[36] !== onBlur || $[37] !== onChange || $[38] !== showClear) {
115
+ t11 = isClearable && /* @__PURE__ */ jsx(InputClear, {
116
+ onClear: () => {
117
+ onChange?.("");
118
+ onBlur?.({ target: { value: "" } });
119
+ },
120
+ show: showClear
121
+ });
122
+ $[35] = isClearable;
123
+ $[36] = onBlur;
124
+ $[37] = onChange;
125
+ $[38] = showClear;
126
+ $[39] = t11;
127
+ } else t11 = $[39];
128
+ let t12;
129
+ if ($[40] !== typographyCva || $[41] !== unit) {
130
+ t12 = unit && /* @__PURE__ */ jsx("span", {
131
+ className: typographyCva({
132
+ size: "label-2",
133
+ sizeMobile: "label-2",
134
+ variant: "prominent-1",
135
+ className: "text-text-default-3"
136
+ }),
137
+ children: unit
138
+ });
139
+ $[40] = typographyCva;
140
+ $[41] = unit;
141
+ $[42] = t12;
142
+ } else t12 = $[42];
143
+ let t13;
144
+ if ($[43] !== isLoading) {
145
+ t13 = isLoading && /* @__PURE__ */ jsx("div", {
146
+ className: "inline-flex",
147
+ children: /* @__PURE__ */ jsx(Loader, {})
148
+ });
149
+ $[43] = isLoading;
150
+ $[44] = t13;
151
+ } else t13 = $[44];
152
+ let t14;
153
+ if ($[45] !== action || $[46] !== isDisabled || $[47] !== isLoading) {
154
+ t14 = !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
155
+ color: "secondary",
156
+ icon: action.icon,
157
+ isDisabled,
158
+ onPress: action.onClick,
159
+ excludeFromTabOrder: true,
160
+ label: action.altText,
161
+ className: clsx("border-0!", action.className)
162
+ });
163
+ $[45] = action;
164
+ $[46] = isDisabled;
165
+ $[47] = isLoading;
166
+ $[48] = t14;
167
+ } else t14 = $[48];
168
+ let t15;
169
+ if ($[49] !== TrailingIcon || $[50] !== action || $[51] !== isLoading || $[52] !== isTrailingIconElement) {
170
+ t15 = !isLoading && !action && TrailingIcon && (isTrailingIconElement ? TrailingIcon : /* @__PURE__ */ jsx(TrailingIcon, { className: "size-6 text-interactive-text-secondary-idle" }));
171
+ $[49] = TrailingIcon;
172
+ $[50] = action;
173
+ $[51] = isLoading;
174
+ $[52] = isTrailingIconElement;
175
+ $[53] = t15;
176
+ } else t15 = $[53];
177
+ let t16;
178
+ if ($[54] !== t10 || $[55] !== t11 || $[56] !== t12 || $[57] !== t13 || $[58] !== t14 || $[59] !== t15) {
179
+ t16 = /* @__PURE__ */ jsxs("div", {
180
+ className: t10,
42
181
  children: [
43
- isClearable && /* @__PURE__ */ jsx(InputClear, {
44
- onClear: () => {
45
- onChange?.("");
46
- onBlur?.({ target: { value: "" } });
47
- },
48
- show: showClear
49
- }),
50
- unit && /* @__PURE__ */ jsx("span", {
51
- className: typographyCva({
52
- size: "label-2",
53
- sizeMobile: "label-2",
54
- variant: "prominent-1",
55
- className: "text-text-default-3"
56
- }),
57
- children: unit
58
- }),
59
- isLoading && /* @__PURE__ */ jsx("div", {
60
- className: "inline-flex",
61
- children: /* @__PURE__ */ jsx(Loader, {})
62
- }),
63
- !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
64
- color: "secondary",
65
- icon: action.icon,
66
- isDisabled,
67
- onPress: action.onClick,
68
- excludeFromTabOrder: true,
69
- label: action.altText,
70
- className: clsx("border-0!", action.className)
71
- }),
72
- !isLoading && !action && TrailingIcon && (isTrailingIconElement ? TrailingIcon : /* @__PURE__ */ jsx(TrailingIcon, { className: "size-6 text-interactive-text-secondary-idle" }))
182
+ t11,
183
+ t12,
184
+ t13,
185
+ t14,
186
+ t15
73
187
  ]
74
- })]
75
- });
188
+ });
189
+ $[54] = t10;
190
+ $[55] = t11;
191
+ $[56] = t12;
192
+ $[57] = t13;
193
+ $[58] = t14;
194
+ $[59] = t15;
195
+ $[60] = t16;
196
+ } else t16 = $[60];
197
+ let t17;
198
+ if ($[61] !== t16 || $[62] !== t9) {
199
+ t17 = /* @__PURE__ */ jsxs("div", {
200
+ className: "flex w-full items-center gap-input-gap-input-text-to-elements",
201
+ children: [t9, t16]
202
+ });
203
+ $[61] = t16;
204
+ $[62] = t9;
205
+ $[63] = t17;
206
+ } else t17 = $[63];
207
+ return t17;
76
208
  };
77
209
  //#endregion
78
210
  export { InputContent };
@@ -2,8 +2,8 @@ import { InputItem } from "./InputItem.js";
2
2
  import { StringUtils } from "../../../utils/string.utils.js";
3
3
  import { ZodUtils } from "../../../utils/zod.utils.js";
4
4
  import { getDefaultInputComponentType } from "../../../helpers/dynamicInputs.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { jsx } from "react/jsx-runtime";
6
- import { useMemo } from "react";
7
7
  import { z } from "zod";
8
8
  //#region src/components/inputs/Inputs/Form.tsx
9
9
  var createFieldComponent = (field, schemaKeyType, form) => {
@@ -23,22 +23,51 @@ var createFieldComponent = (field, schemaKeyType, form) => {
23
23
  });
24
24
  };
25
25
  };
26
- function Form({ form, schema, onSubmit, onError, className, children }) {
27
- const components = useMemo(() => {
28
- const fieldComponents = {};
26
+ function Form(t0) {
27
+ const $ = c(14);
28
+ const { form, schema, onSubmit, onError, className, children } = t0;
29
+ let fieldComponents;
30
+ if ($[0] !== form || $[1] !== schema.shape) {
31
+ fieldComponents = {};
29
32
  const fields = Object.keys(schema.shape);
30
33
  for (const field of fields) {
31
34
  const componentName = StringUtils.capitalize(String(field));
32
35
  const schemaKeyType = schema.shape[field];
33
36
  fieldComponents[componentName] = createFieldComponent(field, schemaKeyType, form);
34
37
  }
35
- return fieldComponents;
36
- }, [schema.shape, form]);
37
- return /* @__PURE__ */ jsx("form", {
38
- onSubmit: form.handleSubmit(onSubmit, onError),
39
- className,
40
- children: children(components)
41
- });
38
+ $[0] = form;
39
+ $[1] = schema.shape;
40
+ $[2] = fieldComponents;
41
+ } else fieldComponents = $[2];
42
+ const components = fieldComponents;
43
+ let t1;
44
+ if ($[3] !== form || $[4] !== onError || $[5] !== onSubmit) {
45
+ t1 = form.handleSubmit(onSubmit, onError);
46
+ $[3] = form;
47
+ $[4] = onError;
48
+ $[5] = onSubmit;
49
+ $[6] = t1;
50
+ } else t1 = $[6];
51
+ let t2;
52
+ if ($[7] !== children || $[8] !== components) {
53
+ t2 = children(components);
54
+ $[7] = children;
55
+ $[8] = components;
56
+ $[9] = t2;
57
+ } else t2 = $[9];
58
+ let t3;
59
+ if ($[10] !== className || $[11] !== t1 || $[12] !== t2) {
60
+ t3 = /* @__PURE__ */ jsx("form", {
61
+ onSubmit: t1,
62
+ className,
63
+ children: t2
64
+ });
65
+ $[10] = className;
66
+ $[11] = t1;
67
+ $[12] = t2;
68
+ $[13] = t3;
69
+ } else t3 = $[13];
70
+ return t3;
42
71
  }
43
72
  //#endregion
44
73
  export { Form };