@povio/ui 3.3.0-rc.4 → 3.3.0

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 (63) hide show
  1. package/README.md +15 -1
  2. package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
  3. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  4. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  5. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +84 -202
  8. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -132
  9. package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
  10. package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
  11. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
  12. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
  13. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
  14. package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
  15. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +140 -338
  16. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  17. package/dist/components/inputs/File/FileUpload.js +1 -1
  18. package/dist/components/inputs/File/InputUpload.js +65 -261
  19. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
  20. package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
  21. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
  22. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
  23. package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
  24. package/dist/components/inputs/FormField/FormField.js +34 -47
  25. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +75 -313
  26. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
  27. package/dist/components/inputs/Selection/Select/QuerySelect.js +30 -96
  28. package/dist/components/inputs/Selection/Select/Select.js +3 -3
  29. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
  30. package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
  31. package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
  32. package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
  33. package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
  34. package/dist/components/inputs/shared/InputClear.js +24 -40
  35. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  36. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  37. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  38. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  39. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
  40. package/dist/components/shared/pagination/Pagination.js +22 -108
  41. package/dist/components/status/Alert/Alert.js +30 -97
  42. package/dist/components/table/InfiniteTable.js +16 -67
  43. package/dist/components/table/Table.d.ts +2 -8
  44. package/dist/components/table/Table.js +33 -55
  45. package/dist/components/text/Typography/Typography.js +8 -23
  46. package/dist/config/confirmation.context.js +1 -1
  47. package/dist/config/theme.context.js +45 -98
  48. package/dist/config/uiConfig.context.js +8 -39
  49. package/dist/config/uiOverrides.context.d.ts +0 -1
  50. package/dist/hooks/useDebounceCallback.js +17 -51
  51. package/dist/hooks/useFormAutosave.js +33 -120
  52. package/dist/hooks/useLongPressRepeat.js +20 -55
  53. package/dist/index.d.ts +0 -1
  54. package/dist/index.js +1 -2
  55. package/package.json +2 -2
  56. package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
  57. package/dist/components/inputs/FormField/formField.cva.js +0 -16
  58. package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
  59. package/dist/components/table/TableColumnFilterInput.js +0 -108
  60. package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
  61. package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
  62. package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
  63. package/dist/components/table/TableColumnFilterRow.js +0 -68
@@ -6,216 +6,64 @@ import "../../../../config/i18n.js";
6
6
  import { FileUtils } from "../../../../utils/file.utils.js";
7
7
  import { FileIcon } from "../../../../assets/icons/File.js";
8
8
  import { ProgressBar } from "./ProgressBar.js";
9
- import { c } from "react/compiler-runtime";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
11
10
  import { clsx } from "clsx";
12
11
  import { useTranslation } from "react-i18next";
13
12
  //#region src/components/inputs/File/shared/FileUploadContentLoading.tsx
14
- var FileUploadContentLoading = (t0) => {
15
- const $ = c(70);
16
- const { index, variant, as, state, isDisabled, singleFile, onCancel, cancelButtonProps } = t0;
13
+ var FileUploadContentLoading = ({ index, variant, as, state, isDisabled, singleFile, onCancel, cancelButtonProps }) => {
17
14
  const { t } = useTranslation("ui");
18
- let t1;
19
- if ($[0] !== cancelButtonProps) {
20
- t1 = cancelButtonProps ?? {};
21
- $[0] = cancelButtonProps;
22
- $[1] = t1;
23
- } else t1 = $[1];
24
- let cancelButtonRestProps;
25
- let t2;
26
- let t3;
27
- let t4;
28
- let t5;
29
- if ($[2] !== t1) {
30
- ({color: t2, size: t3, variant: t4, width: t5, ...cancelButtonRestProps} = t1);
31
- $[2] = t1;
32
- $[3] = cancelButtonRestProps;
33
- $[4] = t2;
34
- $[5] = t3;
35
- $[6] = t4;
36
- $[7] = t5;
37
- } else {
38
- cancelButtonRestProps = $[3];
39
- t2 = $[4];
40
- t3 = $[5];
41
- t4 = $[6];
42
- t5 = $[7];
43
- }
44
- const cancelButtonColor = t2 === void 0 ? "secondary" : t2;
45
- const cancelButtonSize = t3 === void 0 ? "xs" : t3;
46
- const cancelButtonVariant = t4 === void 0 ? "outlined" : t4;
47
- const cancelButtonWidth = t5 === void 0 ? "hug" : t5;
48
- const t6 = variant === "vertical";
49
- const t7 = variant === "horizontal";
50
- const t8 = as === "button";
51
- let t9;
52
- if ($[8] !== t6 || $[9] !== t7 || $[10] !== t8) {
53
- t9 = clsx("flex w-full flex-col items-center", {
54
- "flex-col": t6,
55
- "flex-row": t7,
56
- "gap-file-upload-content-gap-content-to-button": t8
57
- });
58
- $[8] = t6;
59
- $[9] = t7;
60
- $[10] = t8;
61
- $[11] = t9;
62
- } else t9 = $[11];
63
- const t10 = variant === "vertical";
64
- const t11 = variant === "horizontal";
65
- let t12;
66
- if ($[12] !== isDisabled || $[13] !== t10 || $[14] !== t11) {
67
- t12 = clsx("flex w-full items-center justify-between", {
68
- "flex-col gap-file-upload-content-gap-text-to-progress": t10,
69
- "flex-row gap-file-upload-content-gap-left-to-right-content": t11,
70
- "opacity-50": isDisabled
71
- });
72
- $[12] = isDisabled;
73
- $[13] = t10;
74
- $[14] = t11;
75
- $[15] = t12;
76
- } else t12 = $[15];
77
- const t13 = variant === "vertical";
78
- const t14 = variant === "horizontal";
79
- let t15;
80
- if ($[16] !== t13 || $[17] !== t14) {
81
- t15 = clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
82
- "w-full flex-col": t13,
83
- "w-1/2": t14
84
- });
85
- $[16] = t13;
86
- $[17] = t14;
87
- $[18] = t15;
88
- } else t15 = $[18];
89
- let t16;
90
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
91
- t16 = /* @__PURE__ */ jsx(FileIcon, { className: "h-6 w-6 text-text-default-1" });
92
- $[19] = t16;
93
- } else t16 = $[19];
94
- const t17 = variant === "vertical";
95
- const t18 = variant === "horizontal";
96
- let t19;
97
- if ($[20] !== t17 || $[21] !== t18) {
98
- t19 = clsx("flex flex-col", {
99
- "max-w-full gap-file-upload-content-gap-icon-to-content text-center": t17,
100
- "max-w-[calc(100%-32px)] gap-file-upload-content-gap-text-to-text": t18
101
- });
102
- $[20] = t17;
103
- $[21] = t18;
104
- $[22] = t19;
105
- } else t19 = $[22];
106
- const t20 = state.file?.name ?? state.displayName ?? "";
107
- let t21;
108
- if ($[23] !== t20) {
109
- t21 = /* @__PURE__ */ jsx(Typography, {
110
- variant: "prominent-1",
111
- size: "label-1",
112
- as: "span",
113
- className: "self-stretch truncate text-center text-text-default-1",
114
- children: t20
115
- });
116
- $[23] = t20;
117
- $[24] = t21;
118
- } else t21 = $[24];
119
- const t22 = singleFile ? "label-2" : "label-3";
120
- let t23;
121
- if ($[25] !== state) {
122
- t23 = FileUtils.getFileDisplaySize(state);
123
- $[25] = state;
124
- $[26] = t23;
125
- } else t23 = $[26];
126
- let t24;
127
- if ($[27] !== t22 || $[28] !== t23) {
128
- t24 = /* @__PURE__ */ jsx(Typography, {
129
- variant: "default",
130
- size: t22,
131
- as: "span",
132
- className: "text-text-default-2",
133
- children: t23
134
- });
135
- $[27] = t22;
136
- $[28] = t23;
137
- $[29] = t24;
138
- } else t24 = $[29];
139
- let t25;
140
- if ($[30] !== t19 || $[31] !== t21 || $[32] !== t24) {
141
- t25 = /* @__PURE__ */ jsxs("div", {
142
- className: t19,
143
- children: [t21, t24]
144
- });
145
- $[30] = t19;
146
- $[31] = t21;
147
- $[32] = t24;
148
- $[33] = t25;
149
- } else t25 = $[33];
150
- let t26;
151
- if ($[34] !== t15 || $[35] !== t25) {
152
- t26 = /* @__PURE__ */ jsxs("div", {
153
- className: t15,
154
- children: [t16, t25]
155
- });
156
- $[34] = t15;
157
- $[35] = t25;
158
- $[36] = t26;
159
- } else t26 = $[36];
160
- const t27 = variant === "horizontal";
161
- const t28 = variant === "vertical";
162
- let t29;
163
- if ($[37] !== t27 || $[38] !== t28) {
164
- t29 = clsx("flex items-center gap-1", {
165
- "w-1/2": t27,
166
- "w-full": t28
167
- });
168
- $[37] = t27;
169
- $[38] = t28;
170
- $[39] = t29;
171
- } else t29 = $[39];
172
- let t30;
173
- if ($[40] !== state.progress) {
174
- t30 = /* @__PURE__ */ jsx(ProgressBar, { progress: state.progress });
175
- $[40] = state.progress;
176
- $[41] = t30;
177
- } else t30 = $[41];
178
- let t31;
179
- if ($[42] !== as || $[43] !== index || $[44] !== onCancel || $[45] !== variant) {
180
- t31 = (as === "link" || variant === "horizontal") && /* @__PURE__ */ jsx(InlineIconButton, {
181
- label: "Cancel",
182
- color: "secondary",
183
- onPress: () => {
184
- onCancel(index);
185
- },
186
- icon: CloseIcon
187
- });
188
- $[42] = as;
189
- $[43] = index;
190
- $[44] = onCancel;
191
- $[45] = variant;
192
- $[46] = t31;
193
- } else t31 = $[46];
194
- let t32;
195
- if ($[47] !== t29 || $[48] !== t30 || $[49] !== t31) {
196
- t32 = /* @__PURE__ */ jsxs("div", {
197
- className: t29,
198
- children: [t30, t31]
199
- });
200
- $[47] = t29;
201
- $[48] = t30;
202
- $[49] = t31;
203
- $[50] = t32;
204
- } else t32 = $[50];
205
- let t33;
206
- if ($[51] !== t12 || $[52] !== t26 || $[53] !== t32) {
207
- t33 = /* @__PURE__ */ jsxs("div", {
208
- className: t12,
209
- children: [t26, t32]
210
- });
211
- $[51] = t12;
212
- $[52] = t26;
213
- $[53] = t32;
214
- $[54] = t33;
215
- } else t33 = $[54];
216
- let t34;
217
- if ($[55] !== as || $[56] !== cancelButtonColor || $[57] !== cancelButtonRestProps || $[58] !== cancelButtonSize || $[59] !== cancelButtonVariant || $[60] !== cancelButtonWidth || $[61] !== index || $[62] !== onCancel || $[63] !== t || $[64] !== variant) {
218
- t34 = as === "button" && variant === "vertical" && /* @__PURE__ */ jsx(Button, {
15
+ const { color: cancelButtonColor = "secondary", size: cancelButtonSize = "xs", variant: cancelButtonVariant = "outlined", width: cancelButtonWidth = "hug", ...cancelButtonRestProps } = cancelButtonProps ?? {};
16
+ return /* @__PURE__ */ jsxs("div", {
17
+ className: clsx("flex w-full flex-col items-center", {
18
+ "flex-col": variant === "vertical",
19
+ "flex-row": variant === "horizontal",
20
+ "gap-file-upload-content-gap-content-to-button": as === "button"
21
+ }),
22
+ children: [/* @__PURE__ */ jsxs("div", {
23
+ className: clsx("flex w-full items-center justify-between", {
24
+ "flex-col gap-file-upload-content-gap-text-to-progress": variant === "vertical",
25
+ "flex-row gap-file-upload-content-gap-left-to-right-content": variant === "horizontal",
26
+ "opacity-50": isDisabled
27
+ }),
28
+ children: [/* @__PURE__ */ jsxs("div", {
29
+ className: clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
30
+ "w-full flex-col": variant === "vertical",
31
+ "w-1/2": variant === "horizontal"
32
+ }),
33
+ children: [/* @__PURE__ */ jsx(FileIcon, { className: "h-6 w-6 text-text-default-1" }), /* @__PURE__ */ jsxs("div", {
34
+ className: clsx("flex flex-col", {
35
+ "max-w-full gap-file-upload-content-gap-icon-to-content text-center": variant === "vertical",
36
+ "max-w-[calc(100%-32px)] gap-file-upload-content-gap-text-to-text": variant === "horizontal"
37
+ }),
38
+ children: [/* @__PURE__ */ jsx(Typography, {
39
+ variant: "prominent-1",
40
+ size: "label-1",
41
+ as: "span",
42
+ className: "self-stretch truncate text-center text-text-default-1",
43
+ children: state.file?.name ?? state.displayName ?? ""
44
+ }), /* @__PURE__ */ jsx(Typography, {
45
+ variant: "default",
46
+ size: singleFile ? "label-2" : "label-3",
47
+ as: "span",
48
+ className: "text-text-default-2",
49
+ children: FileUtils.getFileDisplaySize(state)
50
+ })]
51
+ })]
52
+ }), /* @__PURE__ */ jsxs("div", {
53
+ className: clsx("flex items-center gap-1", {
54
+ "w-1/2": variant === "horizontal",
55
+ "w-full": variant === "vertical"
56
+ }),
57
+ children: [/* @__PURE__ */ jsx(ProgressBar, { progress: state.progress }), (as === "link" || variant === "horizontal") && /* @__PURE__ */ jsx(InlineIconButton, {
58
+ label: "Cancel",
59
+ color: "secondary",
60
+ onPress: () => {
61
+ onCancel(index);
62
+ },
63
+ icon: CloseIcon
64
+ })]
65
+ })]
66
+ }), as === "button" && variant === "vertical" && /* @__PURE__ */ jsx(Button, {
219
67
  variant: cancelButtonVariant,
220
68
  size: cancelButtonSize,
221
69
  color: cancelButtonColor,
@@ -224,35 +72,9 @@ var FileUploadContentLoading = (t0) => {
224
72
  onPress: () => {
225
73
  onCancel(index);
226
74
  },
227
- children: t(_temp)
228
- });
229
- $[55] = as;
230
- $[56] = cancelButtonColor;
231
- $[57] = cancelButtonRestProps;
232
- $[58] = cancelButtonSize;
233
- $[59] = cancelButtonVariant;
234
- $[60] = cancelButtonWidth;
235
- $[61] = index;
236
- $[62] = onCancel;
237
- $[63] = t;
238
- $[64] = variant;
239
- $[65] = t34;
240
- } else t34 = $[65];
241
- let t35;
242
- if ($[66] !== t33 || $[67] !== t34 || $[68] !== t9) {
243
- t35 = /* @__PURE__ */ jsxs("div", {
244
- className: t9,
245
- children: [t33, t34]
246
- });
247
- $[66] = t33;
248
- $[67] = t34;
249
- $[68] = t9;
250
- $[69] = t35;
251
- } else t35 = $[69];
252
- return t35;
75
+ children: t(($) => $.ui.fileUpload.cancel)
76
+ })]
77
+ });
253
78
  };
254
- function _temp($) {
255
- return $.ui.fileUpload.cancel;
256
- }
257
79
  //#endregion
258
80
  export { FileUploadContentLoading };
@@ -1,120 +1,33 @@
1
1
  import { UIOverrides } from "../../../../config/uiOverrides.context.js";
2
2
  import { Typography } from "../../../text/Typography/Typography.js";
3
3
  import { progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition } from "./progressBar.cva.js";
4
- import { c } from "react/compiler-runtime";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
6
5
  //#region src/components/inputs/File/shared/ProgressBar.tsx
7
- var ProgressBar = (t0) => {
8
- const $ = c(33);
9
- const { progress: t1, valueLabel: t2 } = t0;
10
- const progress = t1 === void 0 ? 0 : t1;
11
- const valueLabel = t2 === void 0 ? "trailing" : t2;
6
+ var ProgressBar = ({ progress = 0, valueLabel = "trailing" }) => {
12
7
  const progressBarCva = UIOverrides.useCva("progressBar.cva", progressBarDefinition);
13
8
  const progressBarTrackWrapperCva = UIOverrides.useCva("progressBar.trackWrapperCva", progressBarTrackWrapperDefinition);
14
9
  const progressBarTrackCva = UIOverrides.useCva("progressBar.trackCva", progressBarTrackDefinition);
15
10
  const progressBarFillCva = UIOverrides.useCva("progressBar.fillCva", progressBarFillDefinition);
16
11
  const progressBarValueCva = UIOverrides.useCva("progressBar.valueCva", progressBarValueDefinition);
17
- let t3;
18
- if ($[0] !== progressBarCva || $[1] !== valueLabel) {
19
- t3 = progressBarCva({ valueLabel });
20
- $[0] = progressBarCva;
21
- $[1] = valueLabel;
22
- $[2] = t3;
23
- } else t3 = $[2];
24
- let t4;
25
- if ($[3] !== progressBarTrackWrapperCva) {
26
- t4 = progressBarTrackWrapperCva();
27
- $[3] = progressBarTrackWrapperCva;
28
- $[4] = t4;
29
- } else t4 = $[4];
30
- let t5;
31
- if ($[5] !== progressBarTrackCva) {
32
- t5 = progressBarTrackCva({ part: "container" });
33
- $[5] = progressBarTrackCva;
34
- $[6] = t5;
35
- } else t5 = $[6];
36
- let t6;
37
- if ($[7] !== progressBarTrackCva) {
38
- t6 = progressBarTrackCva({ part: "background" });
39
- $[7] = progressBarTrackCva;
40
- $[8] = t6;
41
- } else t6 = $[8];
42
- let t7;
43
- if ($[9] !== t6) {
44
- t7 = /* @__PURE__ */ jsx("div", { className: t6 });
45
- $[9] = t6;
46
- $[10] = t7;
47
- } else t7 = $[10];
48
- let t8;
49
- if ($[11] !== progressBarFillCva) {
50
- t8 = progressBarFillCva();
51
- $[11] = progressBarFillCva;
52
- $[12] = t8;
53
- } else t8 = $[12];
54
- const t9 = `${progress}%`;
55
- let t10;
56
- if ($[13] !== t9) {
57
- t10 = { width: t9 };
58
- $[13] = t9;
59
- $[14] = t10;
60
- } else t10 = $[14];
61
- let t11;
62
- if ($[15] !== t10 || $[16] !== t8) {
63
- t11 = /* @__PURE__ */ jsx("div", {
64
- className: t8,
65
- style: t10
66
- });
67
- $[15] = t10;
68
- $[16] = t8;
69
- $[17] = t11;
70
- } else t11 = $[17];
71
- let t12;
72
- if ($[18] !== t11 || $[19] !== t5 || $[20] !== t7) {
73
- t12 = /* @__PURE__ */ jsxs("div", {
74
- className: t5,
75
- children: [t7, t11]
76
- });
77
- $[18] = t11;
78
- $[19] = t5;
79
- $[20] = t7;
80
- $[21] = t12;
81
- } else t12 = $[21];
82
- let t13;
83
- if ($[22] !== t12 || $[23] !== t4) {
84
- t13 = /* @__PURE__ */ jsx("div", {
85
- className: t4,
86
- children: t12
87
- });
88
- $[22] = t12;
89
- $[23] = t4;
90
- $[24] = t13;
91
- } else t13 = $[24];
92
- let t14;
93
- if ($[25] !== progress || $[26] !== progressBarValueCva || $[27] !== valueLabel) {
94
- t14 = valueLabel !== "none" && /* @__PURE__ */ jsxs(Typography, {
12
+ return /* @__PURE__ */ jsxs("div", {
13
+ className: progressBarCva({ valueLabel }),
14
+ children: [/* @__PURE__ */ jsx("div", {
15
+ className: progressBarTrackWrapperCva(),
16
+ children: /* @__PURE__ */ jsxs("div", {
17
+ className: progressBarTrackCva({ part: "container" }),
18
+ children: [/* @__PURE__ */ jsx("div", { className: progressBarTrackCva({ part: "background" }) }), /* @__PURE__ */ jsx("div", {
19
+ className: progressBarFillCva(),
20
+ style: { width: `${progress}%` }
21
+ })]
22
+ })
23
+ }), valueLabel !== "none" && /* @__PURE__ */ jsxs(Typography, {
95
24
  variant: "default",
96
25
  size: "label-2",
97
26
  as: "span",
98
27
  className: progressBarValueCva(),
99
28
  children: [progress, "%"]
100
- });
101
- $[25] = progress;
102
- $[26] = progressBarValueCva;
103
- $[27] = valueLabel;
104
- $[28] = t14;
105
- } else t14 = $[28];
106
- let t15;
107
- if ($[29] !== t13 || $[30] !== t14 || $[31] !== t3) {
108
- t15 = /* @__PURE__ */ jsxs("div", {
109
- className: t3,
110
- children: [t13, t14]
111
- });
112
- $[29] = t13;
113
- $[30] = t14;
114
- $[31] = t3;
115
- $[32] = t15;
116
- } else t15 = $[32];
117
- return t15;
29
+ })]
30
+ });
118
31
  };
119
32
  //#endregion
120
33
  export { ProgressBar };
@@ -1,16 +1,12 @@
1
- import { UIOverrides } from "../../../config/uiOverrides.context.js";
2
1
  import { FormFieldError } from "./FormFieldError.js";
3
2
  import { FormFieldHeader } from "./FormFieldHeader.js";
4
3
  import { FormFieldHelper } from "./FormFieldHelper.js";
5
- import { formFieldDefinition } from "./formField.cva.js";
6
4
  import { c } from "react/compiler-runtime";
7
5
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { clsx } from "clsx";
9
6
  //#region src/components/inputs/FormField/FormField.tsx
10
7
  var FormField = (t0) => {
11
- const $ = c(43);
8
+ const $ = c(39);
12
9
  const { ref, as, label, tooltipText, helperText, isRequired, rightContent, isDisabled, error, hideLabel, headerClassName, errorClassName, children, className, labelProps, isHeaderHidden, tabIndex, onMouseEnter, onFocusCapture } = t0;
13
- const formFieldCva = UIOverrides.useCva("formField.cva", formFieldDefinition);
14
10
  const t1 = hideLabel || isHeaderHidden;
15
11
  let t2;
16
12
  if ($[0] !== headerClassName || $[1] !== helperText || $[2] !== isDisabled || $[3] !== isRequired || $[4] !== label || $[5] !== labelProps || $[6] !== rightContent || $[7] !== t1 || $[8] !== tooltipText) {
@@ -80,61 +76,52 @@ var FormField = (t0) => {
80
76
  $[21] = t9;
81
77
  } else t9 = $[21];
82
78
  const errorProps = t9;
83
- const t10 = as ?? "default";
84
- let t11;
85
- if ($[22] !== className || $[23] !== formFieldCva || $[24] !== t10) {
86
- t11 = clsx(formFieldCva({ as: t10 }), className);
87
- $[22] = className;
88
- $[23] = formFieldCva;
79
+ let t10;
80
+ if ($[22] !== as || $[23] !== headerProps) {
81
+ t10 = !["filter", "floating"].includes(as ?? "") && /* @__PURE__ */ jsx(FormFieldHeader, { ...headerProps });
82
+ $[22] = as;
83
+ $[23] = headerProps;
89
84
  $[24] = t10;
90
- $[25] = t11;
91
- } else t11 = $[25];
85
+ } else t10 = $[24];
86
+ let t11;
87
+ if ($[25] !== helperProps) {
88
+ t11 = /* @__PURE__ */ jsx(FormFieldHelper, { ...helperProps });
89
+ $[25] = helperProps;
90
+ $[26] = t11;
91
+ } else t11 = $[26];
92
92
  let t12;
93
- if ($[26] !== as || $[27] !== headerProps) {
94
- t12 = !["filter", "floating"].includes(as ?? "") && /* @__PURE__ */ jsx(FormFieldHeader, { ...headerProps });
95
- $[26] = as;
96
- $[27] = headerProps;
93
+ if ($[27] !== errorProps) {
94
+ t12 = /* @__PURE__ */ jsx(FormFieldError, { ...errorProps });
95
+ $[27] = errorProps;
97
96
  $[28] = t12;
98
97
  } else t12 = $[28];
99
98
  let t13;
100
- if ($[29] !== helperProps) {
101
- t13 = /* @__PURE__ */ jsx(FormFieldHelper, { ...helperProps });
102
- $[29] = helperProps;
103
- $[30] = t13;
104
- } else t13 = $[30];
105
- let t14;
106
- if ($[31] !== errorProps) {
107
- t14 = /* @__PURE__ */ jsx(FormFieldError, { ...errorProps });
108
- $[31] = errorProps;
109
- $[32] = t14;
110
- } else t14 = $[32];
111
- let t15;
112
- if ($[33] !== children || $[34] !== onFocusCapture || $[35] !== onMouseEnter || $[36] !== ref || $[37] !== t11 || $[38] !== t12 || $[39] !== t13 || $[40] !== t14 || $[41] !== tabIndex) {
113
- t15 = /* @__PURE__ */ jsxs("div", {
99
+ if ($[29] !== children || $[30] !== className || $[31] !== onFocusCapture || $[32] !== onMouseEnter || $[33] !== ref || $[34] !== t10 || $[35] !== t11 || $[36] !== t12 || $[37] !== tabIndex) {
100
+ t13 = /* @__PURE__ */ jsxs("div", {
114
101
  ref,
115
- className: t11,
102
+ className,
116
103
  tabIndex,
117
104
  onMouseEnter,
118
105
  onFocusCapture,
119
106
  children: [
120
- t12,
107
+ t10,
121
108
  children,
122
- t13,
123
- t14
109
+ t11,
110
+ t12
124
111
  ]
125
112
  });
126
- $[33] = children;
127
- $[34] = onFocusCapture;
128
- $[35] = onMouseEnter;
129
- $[36] = ref;
130
- $[37] = t11;
131
- $[38] = t12;
132
- $[39] = t13;
133
- $[40] = t14;
134
- $[41] = tabIndex;
135
- $[42] = t15;
136
- } else t15 = $[42];
137
- return t15;
113
+ $[29] = children;
114
+ $[30] = className;
115
+ $[31] = onFocusCapture;
116
+ $[32] = onMouseEnter;
117
+ $[33] = ref;
118
+ $[34] = t10;
119
+ $[35] = t11;
120
+ $[36] = t12;
121
+ $[37] = tabIndex;
122
+ $[38] = t13;
123
+ } else t13 = $[38];
124
+ return t13;
138
125
  };
139
126
  //#endregion
140
127
  export { FormField };