@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
@@ -10,237 +10,72 @@ import { useState } from "react";
10
10
  import { mergeRefs, useLabels } from "@react-aria/utils";
11
11
  import { Controller } from "react-hook-form";
12
12
  //#region src/components/inputs/File/InputUpload.tsx
13
- var InputUploadBase = (t0) => {
14
- const $ = c(78);
15
- let acceptedFileTypes;
16
- let className;
17
- let defaultValue;
18
- let error;
19
- let errorClassName;
20
- let headerClassName;
21
- let helperText;
22
- let hideLabel;
23
- let isDisabled;
24
- let isHeaderHidden;
25
- let isRequired;
26
- let label;
27
- let onChange;
28
- let onInvalidFileType;
29
- let rest;
30
- let size;
31
- let t1;
32
- let tooltipText;
33
- let value;
34
- let variant;
35
- if ($[0] !== t0) {
36
- const { ref: _ref, label: t2, tooltipText: t3, variant: t4, helperText: t5, isRequired: t6, isDisabled: t7, headerClassName: t8, errorClassName: t9, isHeaderHidden: t10, error: t11, className: t12, onChange: t13, onInvalidFileType: t14, value: t15, defaultValue: t16, allowsMultiple: t17, hideLabel: t18, acceptedFileTypes: t19, size: t20, ...t21 } = t0;
37
- label = t2;
38
- tooltipText = t3;
39
- variant = t4;
40
- helperText = t5;
41
- isRequired = t6;
42
- isDisabled = t7;
43
- headerClassName = t8;
44
- errorClassName = t9;
45
- isHeaderHidden = t10;
46
- error = t11;
47
- className = t12;
48
- onChange = t13;
49
- onInvalidFileType = t14;
50
- value = t15;
51
- defaultValue = t16;
52
- t1 = t17;
53
- hideLabel = t18;
54
- acceptedFileTypes = t19;
55
- size = t20;
56
- rest = t21;
57
- $[0] = t0;
58
- $[1] = acceptedFileTypes;
59
- $[2] = className;
60
- $[3] = defaultValue;
61
- $[4] = error;
62
- $[5] = errorClassName;
63
- $[6] = headerClassName;
64
- $[7] = helperText;
65
- $[8] = hideLabel;
66
- $[9] = isDisabled;
67
- $[10] = isHeaderHidden;
68
- $[11] = isRequired;
69
- $[12] = label;
70
- $[13] = onChange;
71
- $[14] = onInvalidFileType;
72
- $[15] = rest;
73
- $[16] = size;
74
- $[17] = t1;
75
- $[18] = tooltipText;
76
- $[19] = value;
77
- $[20] = variant;
78
- } else {
79
- acceptedFileTypes = $[1];
80
- className = $[2];
81
- defaultValue = $[3];
82
- error = $[4];
83
- errorClassName = $[5];
84
- headerClassName = $[6];
85
- helperText = $[7];
86
- hideLabel = $[8];
87
- isDisabled = $[9];
88
- isHeaderHidden = $[10];
89
- isRequired = $[11];
90
- label = $[12];
91
- onChange = $[13];
92
- onInvalidFileType = $[14];
93
- rest = $[15];
94
- size = $[16];
95
- t1 = $[17];
96
- tooltipText = $[18];
97
- value = $[19];
98
- variant = $[20];
99
- }
100
- const allowsMultiple = t1 === void 0 ? false : t1;
13
+ var InputUploadBase = ({ ref: _ref, label, tooltipText, variant, helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, onChange, onInvalidFileType, value, defaultValue, allowsMultiple = false, hideLabel, acceptedFileTypes, size, ...rest }) => {
101
14
  const ui = UIConfig.useConfig();
102
- let t2;
103
- if ($[21] !== allowsMultiple || $[22] !== defaultValue || $[23] !== value) {
104
- t2 = () => {
105
- if (value !== void 0) {
106
- if (allowsMultiple) return value || [];
107
- return value ? [value] : [];
108
- }
109
- if (defaultValue !== void 0) {
110
- if (allowsMultiple) return defaultValue || [];
111
- return defaultValue ? [defaultValue] : [];
112
- }
113
- return [];
114
- };
115
- $[21] = allowsMultiple;
116
- $[22] = defaultValue;
117
- $[23] = value;
118
- $[24] = t2;
119
- } else t2 = $[24];
120
- const [internalFiles, setInternalFiles] = useState(t2);
121
- let t3;
122
- if ($[25] !== allowsMultiple || $[26] !== internalFiles || $[27] !== value) {
123
- t3 = value !== void 0 ? (() => {
15
+ const [internalFiles, setInternalFiles] = useState(() => {
16
+ if (value !== void 0) {
124
17
  if (allowsMultiple) return value || [];
125
18
  return value ? [value] : [];
126
- })() : internalFiles;
127
- $[25] = allowsMultiple;
128
- $[26] = internalFiles;
129
- $[27] = value;
130
- $[28] = t3;
131
- } else t3 = $[28];
132
- const files = t3;
133
- const t4 = hideLabel ?? ui.input.hideLabel;
134
- let t5;
135
- if ($[29] !== error || $[30] !== errorClassName || $[31] !== headerClassName || $[32] !== helperText || $[33] !== isDisabled || $[34] !== isHeaderHidden || $[35] !== isRequired || $[36] !== label || $[37] !== t4 || $[38] !== tooltipText) {
136
- t5 = {
137
- error,
138
- label,
139
- tooltipText,
140
- helperText,
141
- isRequired,
142
- isHeaderHidden,
143
- hideLabel: t4,
144
- isDisabled,
145
- headerClassName,
146
- errorClassName
147
- };
148
- $[29] = error;
149
- $[30] = errorClassName;
150
- $[31] = headerClassName;
151
- $[32] = helperText;
152
- $[33] = isDisabled;
153
- $[34] = isHeaderHidden;
154
- $[35] = isRequired;
155
- $[36] = label;
156
- $[37] = t4;
157
- $[38] = tooltipText;
158
- $[39] = t5;
159
- } else t5 = $[39];
160
- const formFieldProps = t5;
161
- let t6;
162
- if ($[40] !== label) {
163
- t6 = { "aria-label": label };
164
- $[40] = label;
165
- $[41] = t6;
166
- } else t6 = $[41];
167
- const labelProps = useLabels(t6);
168
- let t7;
169
- if ($[42] !== allowsMultiple || $[43] !== onChange || $[44] !== value) {
170
- t7 = (newFiles) => {
171
- if (value === void 0) setInternalFiles(newFiles);
172
- if (allowsMultiple) onChange?.(newFiles);
173
- else onChange?.(newFiles[0] || null);
174
- };
175
- $[42] = allowsMultiple;
176
- $[43] = onChange;
177
- $[44] = value;
178
- $[45] = t7;
179
- } else t7 = $[45];
180
- const updateFiles = t7;
181
- let t8;
182
- if ($[46] !== acceptedFileTypes || $[47] !== allowsMultiple || $[48] !== files || $[49] !== onInvalidFileType || $[50] !== updateFiles) {
183
- t8 = (inputFiles) => {
184
- const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
185
- const invalidFiles = inputFiles.filter((file_0) => !FileUtils.isFileTypeAccepted(file_0, acceptedFileTypes));
186
- if (allowsMultiple) {
187
- updateFiles([...files, ...acceptedFiles]);
188
- if (invalidFiles.length > 0) onInvalidFileType?.(invalidFiles.map(_temp));
189
- } else {
190
- if (acceptedFiles.length > 0) updateFiles([acceptedFiles[0]]);
191
- if (invalidFiles.length > 0) onInvalidFileType?.(invalidFiles[0].name);
192
- }
193
- };
194
- $[46] = acceptedFileTypes;
195
- $[47] = allowsMultiple;
196
- $[48] = files;
197
- $[49] = onInvalidFileType;
198
- $[50] = updateFiles;
199
- $[51] = t8;
200
- } else t8 = $[51];
201
- const handleFileSelect = t8;
202
- let t9;
203
- if ($[52] !== handleFileSelect) {
204
- t9 = (inputFiles_0) => {
205
- if (!inputFiles_0) return;
206
- handleFileSelect(Array.from(inputFiles_0));
207
- };
208
- $[52] = handleFileSelect;
209
- $[53] = t9;
210
- } else t9 = $[53];
211
- const handleSelect = t9;
212
- let t10;
213
- if ($[54] !== handleFileSelect) {
214
- t10 = async (e) => {
215
- if (!e.items) return;
216
- const promises = [];
217
- e.items.forEach((item) => {
218
- if (item.kind === "file") promises.push(item.getFile());
219
- });
220
- handleFileSelect(await Promise.all(promises));
221
- };
222
- $[54] = handleFileSelect;
223
- $[55] = t10;
224
- } else t10 = $[55];
225
- const handleDrop = t10;
226
- let t11;
227
- if ($[56] !== updateFiles) {
228
- t11 = () => {
229
- updateFiles([]);
230
- };
231
- $[56] = updateFiles;
232
- $[57] = t11;
233
- } else t11 = $[57];
234
- const handleRemove = t11;
235
- let t12;
236
- if ($[58] !== className) {
237
- t12 = clsx("group w-full", className);
238
- $[58] = className;
239
- $[59] = t12;
240
- } else t12 = $[59];
241
- let t13;
242
- if ($[60] !== acceptedFileTypes || $[61] !== allowsMultiple || $[62] !== error || $[63] !== files || $[64] !== handleDrop || $[65] !== handleRemove || $[66] !== handleSelect || $[67] !== isDisabled || $[68] !== label || $[69] !== rest || $[70] !== size || $[71] !== variant) {
243
- t13 = files.length > 0 ? /* @__PURE__ */ jsx(InputUploadFilled, {
19
+ }
20
+ if (defaultValue !== void 0) {
21
+ if (allowsMultiple) return defaultValue || [];
22
+ return defaultValue ? [defaultValue] : [];
23
+ }
24
+ return [];
25
+ });
26
+ const files = value !== void 0 ? (() => {
27
+ if (allowsMultiple) return value || [];
28
+ return value ? [value] : [];
29
+ })() : internalFiles;
30
+ const formFieldProps = {
31
+ error,
32
+ label,
33
+ tooltipText,
34
+ helperText,
35
+ isRequired,
36
+ isHeaderHidden,
37
+ hideLabel: hideLabel ?? ui.input.hideLabel,
38
+ isDisabled,
39
+ headerClassName,
40
+ errorClassName
41
+ };
42
+ const labelProps = useLabels({ "aria-label": label });
43
+ const updateFiles = (newFiles) => {
44
+ if (value === void 0) setInternalFiles(newFiles);
45
+ if (allowsMultiple) onChange?.(newFiles);
46
+ else onChange?.(newFiles[0] || null);
47
+ };
48
+ const handleFileSelect = (inputFiles) => {
49
+ const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
50
+ const invalidFiles = inputFiles.filter((file_0) => !FileUtils.isFileTypeAccepted(file_0, acceptedFileTypes));
51
+ if (allowsMultiple) {
52
+ updateFiles([...files, ...acceptedFiles]);
53
+ if (invalidFiles.length > 0) onInvalidFileType?.(invalidFiles.map((file_1) => file_1.name));
54
+ } else {
55
+ if (acceptedFiles.length > 0) updateFiles([acceptedFiles[0]]);
56
+ if (invalidFiles.length > 0) onInvalidFileType?.(invalidFiles[0].name);
57
+ }
58
+ };
59
+ const handleSelect = (inputFiles_0) => {
60
+ if (!inputFiles_0) return;
61
+ handleFileSelect(Array.from(inputFiles_0));
62
+ };
63
+ const handleDrop = async (e) => {
64
+ if (!e.items) return;
65
+ const promises = [];
66
+ e.items.forEach((item) => {
67
+ if (item.kind === "file") promises.push(item.getFile());
68
+ });
69
+ handleFileSelect(await Promise.all(promises));
70
+ };
71
+ const handleRemove = () => {
72
+ updateFiles([]);
73
+ };
74
+ return /* @__PURE__ */ jsx(FormField, {
75
+ ...formFieldProps,
76
+ labelProps,
77
+ className: clsx("group w-full", className),
78
+ children: files.length > 0 ? /* @__PURE__ */ jsx(InputUploadFilled, {
244
79
  files,
245
80
  onRemove: handleRemove,
246
81
  isDisabled,
@@ -256,36 +91,8 @@ var InputUploadBase = (t0) => {
256
91
  onSelect: handleSelect,
257
92
  onDrop: handleDrop,
258
93
  size
259
- });
260
- $[60] = acceptedFileTypes;
261
- $[61] = allowsMultiple;
262
- $[62] = error;
263
- $[63] = files;
264
- $[64] = handleDrop;
265
- $[65] = handleRemove;
266
- $[66] = handleSelect;
267
- $[67] = isDisabled;
268
- $[68] = label;
269
- $[69] = rest;
270
- $[70] = size;
271
- $[71] = variant;
272
- $[72] = t13;
273
- } else t13 = $[72];
274
- let t14;
275
- if ($[73] !== formFieldProps || $[74] !== labelProps || $[75] !== t12 || $[76] !== t13) {
276
- t14 = /* @__PURE__ */ jsx(FormField, {
277
- ...formFieldProps,
278
- labelProps,
279
- className: t12,
280
- children: t13
281
- });
282
- $[73] = formFieldProps;
283
- $[74] = labelProps;
284
- $[75] = t12;
285
- $[76] = t13;
286
- $[77] = t14;
287
- } else t14 = $[77];
288
- return t14;
94
+ })
95
+ });
289
96
  };
290
97
  var InputUpload = (props) => {
291
98
  const $ = c(15);
@@ -346,8 +153,5 @@ var InputUpload = (props) => {
346
153
  } else t0 = $[14];
347
154
  return t0;
348
155
  };
349
- function _temp(file_1) {
350
- return file_1.name;
351
- }
352
156
  //#endregion
353
157
  export { InputUpload };
@@ -2,189 +2,57 @@ import { Typography } from "../../../text/Typography/Typography.js";
2
2
  import { Button } from "../../../buttons/Button/Button.js";
3
3
  import { TextButton } from "../../../buttons/TextButton/TextButton.js";
4
4
  import { UploadIcon } from "../../../../assets/icons/Upload.js";
5
- import { c } from "react/compiler-runtime";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { clsx } from "clsx";
8
7
  //#region src/components/inputs/File/shared/FileUploadContentEmpty.tsx
9
- var FileUploadContentEmpty = (t0) => {
10
- const $ = c(52);
11
- const { variant, as, isDisabled, title, browseText, uploadText, singleFile, hideButton: t1, className, browseButtonProps } = t0;
12
- const hideButton = t1 === void 0 ? false : t1;
13
- let t2;
14
- if ($[0] !== browseButtonProps) {
15
- t2 = browseButtonProps ?? {};
16
- $[0] = browseButtonProps;
17
- $[1] = t2;
18
- } else t2 = $[1];
19
- let browseButtonRestProps;
20
- let t3;
21
- let t4;
22
- let t5;
23
- if ($[2] !== t2) {
24
- ({size: t3, variant: t4, width: t5, ...browseButtonRestProps} = t2);
25
- $[2] = t2;
26
- $[3] = browseButtonRestProps;
27
- $[4] = t3;
28
- $[5] = t4;
29
- $[6] = t5;
30
- } else {
31
- browseButtonRestProps = $[3];
32
- t3 = $[4];
33
- t4 = $[5];
34
- t5 = $[6];
35
- }
36
- const browseButtonSize = t3 === void 0 ? "xs" : t3;
37
- const browseButtonVariant = t4 === void 0 ? "outlined" : t4;
38
- const browseButtonWidth = t5 === void 0 ? "hug" : t5;
39
- const t6 = variant === "vertical";
40
- const t7 = variant === "horizontal";
41
- let t8;
42
- if ($[7] !== className || $[8] !== t6 || $[9] !== t7) {
43
- t8 = clsx("flex w-full items-center gap-file-upload-content-gap-text-to-text", className, {
44
- "flex-col": t6,
45
- "min-h-11 flex-row justify-between": t7
46
- });
47
- $[7] = className;
48
- $[8] = t6;
49
- $[9] = t7;
50
- $[10] = t8;
51
- } else t8 = $[10];
52
- const t9 = variant === "vertical";
53
- const t10 = variant === "horizontal";
54
- let t11;
55
- if ($[11] !== isDisabled || $[12] !== t10 || $[13] !== t9) {
56
- t11 = clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
57
- "flex-col": t9,
58
- "flex-row": t10,
59
- "opacity-50": isDisabled
60
- });
61
- $[11] = isDisabled;
62
- $[12] = t10;
63
- $[13] = t9;
64
- $[14] = t11;
65
- } else t11 = $[14];
66
- let t12;
67
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
68
- t12 = /* @__PURE__ */ jsx(UploadIcon, { className: "h-6 w-6 text-text-default-1" });
69
- $[15] = t12;
70
- } else t12 = $[15];
71
- const t13 = variant === "vertical";
72
- let t14;
73
- if ($[16] !== t13) {
74
- t14 = clsx("self-stretch text-text-default-1", { "text-center": t13 });
75
- $[16] = t13;
76
- $[17] = t14;
77
- } else t14 = $[17];
78
- let t15;
79
- if ($[18] !== t14 || $[19] !== title) {
80
- t15 = /* @__PURE__ */ jsx(Typography, {
81
- variant: "prominent-1",
82
- size: "label-1",
83
- as: "span",
84
- className: t14,
85
- children: title
86
- });
87
- $[18] = t14;
88
- $[19] = title;
89
- $[20] = t15;
90
- } else t15 = $[20];
91
- let t16;
92
- if ($[21] !== t11 || $[22] !== t15) {
93
- t16 = /* @__PURE__ */ jsxs("div", {
94
- className: t11,
95
- children: [t12, t15]
96
- });
97
- $[21] = t11;
98
- $[22] = t15;
99
- $[23] = t16;
100
- } else t16 = $[23];
101
- const t17 = variant === "vertical" && as === "button";
102
- const t18 = as === "link";
103
- const t19 = as === "button";
104
- let t20;
105
- if ($[24] !== t17 || $[25] !== t18 || $[26] !== t19) {
106
- t20 = clsx("flex items-center justify-center", {
107
- "flex-col": t17,
108
- "gap-file-upload-content-gap-text-to-text": t18,
109
- "gap-file-upload-content-gap-content-to-button": t19
110
- });
111
- $[24] = t17;
112
- $[25] = t18;
113
- $[26] = t19;
114
- $[27] = t20;
115
- } else t20 = $[27];
116
- const t21 = singleFile ? "label-2" : "label-3";
117
- const t22 = variant === "vertical";
118
- let t23;
119
- if ($[28] !== isDisabled || $[29] !== t22) {
120
- t23 = clsx("text-text-default-2", {
121
- "text-center": t22,
122
- "opacity-50": isDisabled
123
- });
124
- $[28] = isDisabled;
125
- $[29] = t22;
126
- $[30] = t23;
127
- } else t23 = $[30];
128
- let t24;
129
- if ($[31] !== t21 || $[32] !== t23 || $[33] !== uploadText) {
130
- t24 = /* @__PURE__ */ jsx(Typography, {
131
- variant: "default",
132
- size: t21,
133
- as: "span",
134
- className: t23,
135
- children: uploadText
136
- });
137
- $[31] = t21;
138
- $[32] = t23;
139
- $[33] = uploadText;
140
- $[34] = t24;
141
- } else t24 = $[34];
142
- let t25;
143
- if ($[35] !== as || $[36] !== browseButtonRestProps || $[37] !== browseButtonSize || $[38] !== browseButtonVariant || $[39] !== browseButtonWidth || $[40] !== browseText || $[41] !== hideButton || $[42] !== isDisabled) {
144
- t25 = !hideButton && browseText && (as === "link" ? /* @__PURE__ */ jsx(TextButton, {
145
- className: "text-interactive-text-primary-idle lowercase",
146
- children: browseText
147
- }) : /* @__PURE__ */ jsx(Button, {
148
- variant: browseButtonVariant,
149
- size: browseButtonSize,
150
- width: browseButtonWidth,
151
- ...browseButtonRestProps,
152
- isDisabled,
153
- children: browseText
154
- }));
155
- $[35] = as;
156
- $[36] = browseButtonRestProps;
157
- $[37] = browseButtonSize;
158
- $[38] = browseButtonVariant;
159
- $[39] = browseButtonWidth;
160
- $[40] = browseText;
161
- $[41] = hideButton;
162
- $[42] = isDisabled;
163
- $[43] = t25;
164
- } else t25 = $[43];
165
- let t26;
166
- if ($[44] !== t20 || $[45] !== t24 || $[46] !== t25) {
167
- t26 = /* @__PURE__ */ jsxs("div", {
168
- className: t20,
169
- children: [t24, t25]
170
- });
171
- $[44] = t20;
172
- $[45] = t24;
173
- $[46] = t25;
174
- $[47] = t26;
175
- } else t26 = $[47];
176
- let t27;
177
- if ($[48] !== t16 || $[49] !== t26 || $[50] !== t8) {
178
- t27 = /* @__PURE__ */ jsxs("div", {
179
- className: t8,
180
- children: [t16, t26]
181
- });
182
- $[48] = t16;
183
- $[49] = t26;
184
- $[50] = t8;
185
- $[51] = t27;
186
- } else t27 = $[51];
187
- return t27;
8
+ var FileUploadContentEmpty = ({ variant, as, isDisabled, title, browseText, uploadText, singleFile, hideButton = false, className, browseButtonProps }) => {
9
+ const { size: browseButtonSize = "xs", variant: browseButtonVariant = "outlined", width: browseButtonWidth = "hug", ...browseButtonRestProps } = browseButtonProps ?? {};
10
+ return /* @__PURE__ */ jsxs("div", {
11
+ className: clsx("flex w-full items-center gap-file-upload-content-gap-text-to-text", className, {
12
+ "flex-col": variant === "vertical",
13
+ "min-h-11 flex-row justify-between": variant === "horizontal"
14
+ }),
15
+ children: [/* @__PURE__ */ jsxs("div", {
16
+ className: clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
17
+ "flex-col": variant === "vertical",
18
+ "flex-row": variant === "horizontal",
19
+ "opacity-50": isDisabled
20
+ }),
21
+ children: [/* @__PURE__ */ jsx(UploadIcon, { className: "h-6 w-6 text-text-default-1" }), /* @__PURE__ */ jsx(Typography, {
22
+ variant: "prominent-1",
23
+ size: "label-1",
24
+ as: "span",
25
+ className: clsx("self-stretch text-text-default-1", { "text-center": variant === "vertical" }),
26
+ children: title
27
+ })]
28
+ }), /* @__PURE__ */ jsxs("div", {
29
+ className: clsx("flex items-center justify-center", {
30
+ "flex-col": variant === "vertical" && as === "button",
31
+ "gap-file-upload-content-gap-text-to-text": as === "link",
32
+ "gap-file-upload-content-gap-content-to-button": as === "button"
33
+ }),
34
+ children: [/* @__PURE__ */ jsx(Typography, {
35
+ variant: "default",
36
+ size: singleFile ? "label-2" : "label-3",
37
+ as: "span",
38
+ className: clsx("text-text-default-2", {
39
+ "text-center": variant === "vertical",
40
+ "opacity-50": isDisabled
41
+ }),
42
+ children: uploadText
43
+ }), !hideButton && browseText && (as === "link" ? /* @__PURE__ */ jsx(TextButton, {
44
+ className: "text-interactive-text-primary-idle lowercase",
45
+ children: browseText
46
+ }) : /* @__PURE__ */ jsx(Button, {
47
+ variant: browseButtonVariant,
48
+ size: browseButtonSize,
49
+ width: browseButtonWidth,
50
+ ...browseButtonRestProps,
51
+ isDisabled,
52
+ children: browseText
53
+ }))]
54
+ })]
55
+ });
188
56
  };
189
57
  //#endregion
190
58
  export { FileUploadContentEmpty };