@povio/ui 3.3.0-rc.3 → 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 (84) hide show
  1. package/README.md +15 -1
  2. package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
  3. package/dist/components/buttons/Button/button.cva.d.ts +1 -1
  4. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  5. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  6. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  7. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +5 -1
  8. package/dist/components/inputs/Checkbox/CheckboxGroup.js +234 -201
  9. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
  10. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  11. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +170 -273
  12. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -147
  13. package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
  14. package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
  15. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
  16. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
  17. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
  18. package/dist/components/inputs/DateTime/shared/DateField.js +135 -301
  19. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +142 -338
  20. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  21. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +144 -134
  22. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +2 -0
  23. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +33 -0
  24. package/dist/components/inputs/File/FileUpload.js +1 -1
  25. package/dist/components/inputs/File/InputUpload.js +65 -261
  26. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
  27. package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
  28. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
  29. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
  30. package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
  31. package/dist/components/inputs/FormField/FormField.js +34 -47
  32. package/dist/components/inputs/Input/NumberInput/NumberInput.js +2 -1
  33. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +77 -314
  34. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
  35. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +56 -2
  36. package/dist/components/inputs/Selection/Select/QuerySelect.js +82 -94
  37. package/dist/components/inputs/Selection/Select/Select.js +3 -3
  38. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
  39. package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
  40. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
  41. package/dist/components/inputs/Selection/shared/querySelect.utils.js +1 -0
  42. package/dist/components/inputs/Selection/shared/select.context.js +19 -9
  43. package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
  44. package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
  45. package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
  46. package/dist/components/inputs/shared/InputClear.js +24 -40
  47. package/dist/components/inputs/shared/input.cva.js +1 -1
  48. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  49. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  50. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  51. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  52. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
  53. package/dist/components/shared/pagination/Pagination.js +22 -108
  54. package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
  55. package/dist/components/status/Alert/Alert.js +30 -97
  56. package/dist/components/table/InfiniteTable.js +16 -67
  57. package/dist/components/table/Table.d.ts +2 -8
  58. package/dist/components/table/Table.js +33 -55
  59. package/dist/components/text/Typography/Typography.js +8 -23
  60. package/dist/config/confirmation.context.js +1 -1
  61. package/dist/config/theme.context.js +45 -98
  62. package/dist/config/uiConfig.context.d.ts +1 -0
  63. package/dist/config/uiConfig.context.js +10 -40
  64. package/dist/config/uiOverrides.context.d.ts +0 -1
  65. package/dist/helpers/dynamicColumns.js +2 -1
  66. package/dist/hooks/useDebounceCallback.js +17 -51
  67. package/dist/hooks/useFormAutosave.js +33 -120
  68. package/dist/hooks/useLongPressRepeat.js +20 -55
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.js +2 -2
  71. package/dist/utils/date-time.utils.d.ts +0 -1
  72. package/dist/utils/date-time.utils.js +21 -45
  73. package/dist/utils/intl.utils.d.ts +7 -0
  74. package/dist/utils/intl.utils.js +38 -0
  75. package/dist/utils/intl.utils.spec.d.ts +1 -0
  76. package/package.json +2 -2
  77. package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
  78. package/dist/components/inputs/FormField/formField.cva.js +0 -16
  79. package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
  80. package/dist/components/table/TableColumnFilterInput.js +0 -108
  81. package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
  82. package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
  83. package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
  84. package/dist/components/table/TableColumnFilterRow.js +0 -68
@@ -6,275 +6,113 @@ import "../../../../config/i18n.js";
6
6
  import { TextButton } from "../../../buttons/TextButton/TextButton.js";
7
7
  import { FileUtils } from "../../../../utils/file.utils.js";
8
8
  import { CheckCircleIcon } from "../../../../assets/icons/CheckCircle.js";
9
- import { c } from "react/compiler-runtime";
10
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
10
  import { clsx } from "clsx";
12
11
  import { FileTrigger } from "react-aria-components";
13
12
  import { useTranslation } from "react-i18next";
14
13
  //#region src/components/inputs/File/shared/FileUploadContentFilled.tsx
15
- var FileUploadContentFilled = (t0) => {
16
- const $ = c(61);
17
- const { variant, as, isDisabled, state, browseText, fileTriggerProps, removeWithIcon: t1, singleFile, onRemove, browseButtonProps } = t0;
18
- const removeWithIcon = t1 === void 0 ? false : t1;
14
+ var FileUploadContentFilled = ({ variant, as, isDisabled, state, browseText, fileTriggerProps, removeWithIcon = false, singleFile, onRemove, browseButtonProps }) => {
19
15
  const { t } = useTranslation("ui");
20
- let t2;
21
- if ($[0] !== browseButtonProps) {
22
- t2 = browseButtonProps ?? {};
23
- $[0] = browseButtonProps;
24
- $[1] = t2;
25
- } else t2 = $[1];
26
- let browseButtonRestProps;
27
- let t3;
28
- let t4;
29
- let t5;
30
- if ($[2] !== t2) {
31
- ({size: t3, variant: t4, width: t5, ...browseButtonRestProps} = t2);
32
- $[2] = t2;
33
- $[3] = browseButtonRestProps;
34
- $[4] = t3;
35
- $[5] = t4;
36
- $[6] = t5;
37
- } else {
38
- browseButtonRestProps = $[3];
39
- t3 = $[4];
40
- t4 = $[5];
41
- t5 = $[6];
42
- }
43
- const browseButtonSize = t3 === void 0 ? "xs" : t3;
44
- const browseButtonVariant = t4 === void 0 ? "outlined" : t4;
45
- const browseButtonWidth = t5 === void 0 ? "hug" : t5;
46
- let t6;
47
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
48
- t6 = clsx("flex w-full flex-fill flex-col items-start");
49
- $[7] = t6;
50
- } else t6 = $[7];
51
- const t7 = variant === "horizontal";
52
- const t8 = variant === "vertical";
53
- const t9 = variant === "vertical" && as === "button";
54
- const t10 = variant === "vertical" && as === "link";
55
- let t11;
56
- if ($[8] !== t10 || $[9] !== t7 || $[10] !== t8 || $[11] !== t9) {
57
- t11 = clsx("flex w-full items-center", {
58
- "flex-row gap-file-upload-content-gap-left-to-right-content": t7,
59
- "flex-col": t8,
60
- "gap-file-upload-content-gap-content-to-button": t9,
61
- "gap-file-upload-content-gap-text-to-text": t10
62
- });
63
- $[8] = t10;
64
- $[9] = t7;
65
- $[10] = t8;
66
- $[11] = t9;
67
- $[12] = t11;
68
- } else t11 = $[12];
69
- const t12 = variant === "vertical";
70
- const t13 = variant === "horizontal";
71
- let t14;
72
- if ($[13] !== isDisabled || $[14] !== t12 || $[15] !== t13) {
73
- t14 = clsx("flex min-w-0 max-w-full grow items-center gap-file-upload-content-gap-icon-to-content", {
74
- "flex-col": t12,
75
- "flex-row": t13,
76
- "opacity-50": isDisabled
77
- });
78
- $[13] = isDisabled;
79
- $[14] = t12;
80
- $[15] = t13;
81
- $[16] = t14;
82
- } else t14 = $[16];
83
- let t15;
84
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
85
- t15 = /* @__PURE__ */ jsx(CheckCircleIcon, { className: "h-6 w-6 text-text-default-1" });
86
- $[17] = t15;
87
- } else t15 = $[17];
88
- const t16 = variant === "vertical";
89
- const t17 = variant === "horizontal";
90
- let t18;
91
- if ($[18] !== t16 || $[19] !== t17) {
92
- t18 = clsx("flex flex-col gap-file-upload-content-gap-text-to-text", {
93
- "max-w-full items-center": t16,
94
- "max-w-[calc(100%-32px)]": t17
95
- });
96
- $[18] = t16;
97
- $[19] = t17;
98
- $[20] = t18;
99
- } else t18 = $[20];
100
- const t19 = state.file?.name ?? state.displayName ?? "";
101
- let t20;
102
- if ($[21] !== t19) {
103
- t20 = /* @__PURE__ */ jsx(Typography, {
104
- variant: "prominent-1",
105
- size: "label-1",
106
- as: "span",
107
- className: "self-stretch truncate text-center text-text-default-1",
108
- children: t19
109
- });
110
- $[21] = t19;
111
- $[22] = t20;
112
- } else t20 = $[22];
113
- const t21 = singleFile ? "label-2" : "label-3";
114
- let t22;
115
- if ($[23] !== state) {
116
- t22 = FileUtils.getFileDisplaySize(state);
117
- $[23] = state;
118
- $[24] = t22;
119
- } else t22 = $[24];
120
- let t23;
121
- if ($[25] !== t21 || $[26] !== t22) {
122
- t23 = /* @__PURE__ */ jsx(Typography, {
123
- variant: "default",
124
- size: t21,
125
- as: "span",
126
- className: "text-text-default-2",
127
- children: t22
128
- });
129
- $[25] = t21;
130
- $[26] = t22;
131
- $[27] = t23;
132
- } else t23 = $[27];
133
- let t24;
134
- if ($[28] !== t18 || $[29] !== t20 || $[30] !== t23) {
135
- t24 = /* @__PURE__ */ jsxs("div", {
136
- className: t18,
137
- children: [t20, t23]
138
- });
139
- $[28] = t18;
140
- $[29] = t20;
141
- $[30] = t23;
142
- $[31] = t24;
143
- } else t24 = $[31];
144
- let t25;
145
- if ($[32] !== t14 || $[33] !== t24) {
146
- t25 = /* @__PURE__ */ jsxs("div", {
147
- className: t14,
148
- children: [t15, t24]
149
- });
150
- $[32] = t14;
151
- $[33] = t24;
152
- $[34] = t25;
153
- } else t25 = $[34];
154
- const t26 = variant === "vertical" && as === "button";
155
- const t27 = as === "link" && variant === "vertical";
156
- const t28 = as === "button" && variant === "vertical";
157
- const t29 = variant === "horizontal";
158
- let t30;
159
- if ($[35] !== t26 || $[36] !== t27 || $[37] !== t28 || $[38] !== t29) {
160
- t30 = clsx("flex flex-none items-center justify-end", {
161
- "flex-col": t26,
162
- "gap-file-upload-content-gap-text-to-text": t27,
163
- "gap-file-upload-content-gap-content-to-button": t28,
164
- "gap-file-upload-content-gap-button-to-button": t29
165
- });
166
- $[35] = t26;
167
- $[36] = t27;
168
- $[37] = t28;
169
- $[38] = t29;
170
- $[39] = t30;
171
- } else t30 = $[39];
172
- let t31;
173
- if ($[40] !== as || $[41] !== browseButtonRestProps || $[42] !== browseButtonSize || $[43] !== browseButtonVariant || $[44] !== browseButtonWidth || $[45] !== browseText || $[46] !== fileTriggerProps || $[47] !== isDisabled || $[48] !== onRemove || $[49] !== removeWithIcon || $[50] !== state.id || $[51] !== t || $[52] !== variant) {
174
- t31 = as === "link" ? /* @__PURE__ */ jsxs(Fragment, { children: [fileTriggerProps && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FileTrigger, {
175
- ...fileTriggerProps,
176
- children: /* @__PURE__ */ jsx(TextButton, {
177
- className: clsx("text-interactive-text-primary-idle", { "[&>span>span]:font-medium!": variant === "vertical" }),
178
- children: browseText ?? ""
179
- })
180
- }), variant === "vertical" && /* @__PURE__ */ jsx(Typography, {
181
- variant: "default",
182
- size: "label-2",
183
- as: "span",
184
- className: "text-text-default-2",
185
- children: t(_temp)
186
- })] }), removeWithIcon ? /* @__PURE__ */ jsx(InlineIconButton, {
187
- label: "Cancel",
188
- color: "secondary",
189
- onPress: () => {
190
- onRemove(state.id ?? "");
191
- },
192
- icon: CloseIcon
193
- }) : /* @__PURE__ */ jsx(TextButton, {
194
- className: clsx(variant === "vertical" && "text-interactive-text-primary-idle lowercase [&>span>span]:font-medium!"),
195
- color: variant === "horizontal" ? "secondary" : "primary",
196
- onPress: () => {
197
- onRemove(state.id ?? "");
198
- },
199
- children: t(_temp2)
200
- })] }) : /* @__PURE__ */ jsxs("div", {
201
- className: "flex items-center justify-center gap-file-upload-content-gap-button-to-button self-stretch",
202
- children: [fileTriggerProps && /* @__PURE__ */ jsx(FileTrigger, {
203
- ...fileTriggerProps,
204
- children: /* @__PURE__ */ jsx(Button$1, {
205
- variant: browseButtonVariant,
206
- size: browseButtonSize,
207
- width: browseButtonWidth,
208
- ...browseButtonRestProps,
209
- isDisabled,
210
- children: browseText ?? ""
16
+ const { size: browseButtonSize = "xs", variant: browseButtonVariant = "outlined", width: browseButtonWidth = "hug", ...browseButtonRestProps } = browseButtonProps ?? {};
17
+ return /* @__PURE__ */ jsx("div", {
18
+ className: clsx("flex w-full flex-fill flex-col items-start"),
19
+ children: /* @__PURE__ */ jsxs("div", {
20
+ className: clsx("flex w-full items-center", {
21
+ "flex-row gap-file-upload-content-gap-left-to-right-content": variant === "horizontal",
22
+ "flex-col": variant === "vertical",
23
+ "gap-file-upload-content-gap-content-to-button": variant === "vertical" && as === "button",
24
+ "gap-file-upload-content-gap-text-to-text": variant === "vertical" && as === "link"
25
+ }),
26
+ children: [/* @__PURE__ */ jsxs("div", {
27
+ className: clsx("flex min-w-0 max-w-full grow items-center gap-file-upload-content-gap-icon-to-content", {
28
+ "flex-col": variant === "vertical",
29
+ "flex-row": variant === "horizontal",
30
+ "opacity-50": isDisabled
31
+ }),
32
+ children: [/* @__PURE__ */ jsx(CheckCircleIcon, { className: "h-6 w-6 text-text-default-1" }), /* @__PURE__ */ jsxs("div", {
33
+ className: clsx("flex flex-col gap-file-upload-content-gap-text-to-text", {
34
+ "max-w-full items-center": variant === "vertical",
35
+ "max-w-[calc(100%-32px)]": variant === "horizontal"
36
+ }),
37
+ children: [/* @__PURE__ */ jsx(Typography, {
38
+ variant: "prominent-1",
39
+ size: "label-1",
40
+ as: "span",
41
+ className: "self-stretch truncate text-center text-text-default-1",
42
+ children: state.file?.name ?? state.displayName ?? ""
43
+ }), /* @__PURE__ */ jsx(Typography, {
44
+ variant: "default",
45
+ size: singleFile ? "label-2" : "label-3",
46
+ as: "span",
47
+ className: "text-text-default-2",
48
+ children: FileUtils.getFileDisplaySize(state)
49
+ })]
50
+ })]
51
+ }), /* @__PURE__ */ jsx("div", {
52
+ className: clsx("flex flex-none items-center justify-end", {
53
+ "flex-col": variant === "vertical" && as === "button",
54
+ "gap-file-upload-content-gap-text-to-text": as === "link" && variant === "vertical",
55
+ "gap-file-upload-content-gap-content-to-button": as === "button" && variant === "vertical",
56
+ "gap-file-upload-content-gap-button-to-button": variant === "horizontal"
57
+ }),
58
+ children: as === "link" ? /* @__PURE__ */ jsxs(Fragment, { children: [fileTriggerProps && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FileTrigger, {
59
+ ...fileTriggerProps,
60
+ children: /* @__PURE__ */ jsx(TextButton, {
61
+ className: clsx("text-interactive-text-primary-idle", { "[&>span>span]:font-medium!": variant === "vertical" }),
62
+ children: browseText ?? ""
63
+ })
64
+ }), variant === "vertical" && /* @__PURE__ */ jsx(Typography, {
65
+ variant: "default",
66
+ size: "label-2",
67
+ as: "span",
68
+ className: "text-text-default-2",
69
+ children: t(($) => $.ui.fileUpload.or)
70
+ })] }), removeWithIcon ? /* @__PURE__ */ jsx(InlineIconButton, {
71
+ label: "Cancel",
72
+ color: "secondary",
73
+ onPress: () => {
74
+ onRemove(state.id ?? "");
75
+ },
76
+ icon: CloseIcon
77
+ }) : /* @__PURE__ */ jsx(TextButton, {
78
+ className: clsx(variant === "vertical" && "text-interactive-text-primary-idle lowercase [&>span>span]:font-medium!"),
79
+ color: variant === "horizontal" ? "secondary" : "primary",
80
+ onPress: () => {
81
+ onRemove(state.id ?? "");
82
+ },
83
+ children: t(($_0) => $_0.ui.fileUpload.removeFile)
84
+ })] }) : /* @__PURE__ */ jsxs("div", {
85
+ className: "flex items-center justify-center gap-file-upload-content-gap-button-to-button self-stretch",
86
+ children: [fileTriggerProps && /* @__PURE__ */ jsx(FileTrigger, {
87
+ ...fileTriggerProps,
88
+ children: /* @__PURE__ */ jsx(Button$1, {
89
+ variant: browseButtonVariant,
90
+ size: browseButtonSize,
91
+ width: browseButtonWidth,
92
+ ...browseButtonRestProps,
93
+ isDisabled,
94
+ children: browseText ?? ""
95
+ })
96
+ }), removeWithIcon ? /* @__PURE__ */ jsx(InlineIconButton, {
97
+ label: "Cancel",
98
+ color: "secondary",
99
+ onPress: () => {
100
+ onRemove(state.id ?? "");
101
+ },
102
+ icon: CloseIcon,
103
+ isDisabled
104
+ }) : /* @__PURE__ */ jsx(TextButton, {
105
+ color: "secondary",
106
+ onPress: () => {
107
+ onRemove(state.id ?? "");
108
+ },
109
+ isDisabled,
110
+ children: t(($_1) => $_1.ui.fileUpload.removeFile)
111
+ })]
211
112
  })
212
- }), removeWithIcon ? /* @__PURE__ */ jsx(InlineIconButton, {
213
- label: "Cancel",
214
- color: "secondary",
215
- onPress: () => {
216
- onRemove(state.id ?? "");
217
- },
218
- icon: CloseIcon,
219
- isDisabled
220
- }) : /* @__PURE__ */ jsx(TextButton, {
221
- color: "secondary",
222
- onPress: () => {
223
- onRemove(state.id ?? "");
224
- },
225
- isDisabled,
226
- children: t(_temp3)
227
113
  })]
228
- });
229
- $[40] = as;
230
- $[41] = browseButtonRestProps;
231
- $[42] = browseButtonSize;
232
- $[43] = browseButtonVariant;
233
- $[44] = browseButtonWidth;
234
- $[45] = browseText;
235
- $[46] = fileTriggerProps;
236
- $[47] = isDisabled;
237
- $[48] = onRemove;
238
- $[49] = removeWithIcon;
239
- $[50] = state.id;
240
- $[51] = t;
241
- $[52] = variant;
242
- $[53] = t31;
243
- } else t31 = $[53];
244
- let t32;
245
- if ($[54] !== t30 || $[55] !== t31) {
246
- t32 = /* @__PURE__ */ jsx("div", {
247
- className: t30,
248
- children: t31
249
- });
250
- $[54] = t30;
251
- $[55] = t31;
252
- $[56] = t32;
253
- } else t32 = $[56];
254
- let t33;
255
- if ($[57] !== t11 || $[58] !== t25 || $[59] !== t32) {
256
- t33 = /* @__PURE__ */ jsx("div", {
257
- className: t6,
258
- children: /* @__PURE__ */ jsxs("div", {
259
- className: t11,
260
- children: [t25, t32]
261
- })
262
- });
263
- $[57] = t11;
264
- $[58] = t25;
265
- $[59] = t32;
266
- $[60] = t33;
267
- } else t33 = $[60];
268
- return t33;
114
+ })
115
+ });
269
116
  };
270
- function _temp($) {
271
- return $.ui.fileUpload.or;
272
- }
273
- function _temp2($_0) {
274
- return $_0.ui.fileUpload.removeFile;
275
- }
276
- function _temp3($_1) {
277
- return $_1.ui.fileUpload.removeFile;
278
- }
279
117
  //#endregion
280
118
  export { FileUploadContentFilled };