@vkzstudio/muza-ui 1.0.44 → 1.0.46
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.
- package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +63 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/Card.js +67 -0
- package/dist/components/Card/Card.stories.d.ts +13 -0
- package/dist/components/Card/Card.stories.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Carousel/Carousel.d.ts +140 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel/Carousel.js +241 -0
- package/dist/components/Carousel/Carousel.stories.d.ts +13 -0
- package/dist/components/Carousel/Carousel.stories.d.ts.map +1 -0
- package/dist/components/Carousel/index.d.ts +2 -0
- package/dist/components/Carousel/index.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +14 -5
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +39 -39
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +38 -7
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +165 -163
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +3 -17
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.d.ts +30 -11
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.js +100 -111
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +3 -1
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.d.ts +6 -0
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +38 -41
- package/dist/components/FileUpload/FileUpload.d.ts +32 -0
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +87 -83
- package/dist/components/FileUpload/FileUpload.stories.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/dist/components/Flex/Flex.d.ts +373 -2
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.js +61 -63
- package/dist/components/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/components/Icons/CustomBadges.d.ts +14 -0
- package/dist/components/Icons/CustomBadges.d.ts.map +1 -0
- package/dist/components/Icons/CustomBadges.js +334 -0
- package/dist/components/Icons/CustomIcons.d.ts +24 -0
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +88 -42
- package/dist/components/Icons/CustomLogos.d.ts +29 -0
- package/dist/components/Icons/CustomLogos.d.ts.map +1 -0
- package/dist/components/Icons/CustomLogos.js +593 -0
- package/dist/components/Icons/Icons.stories.d.ts.map +1 -1
- package/dist/components/Icons/LogosAndBadges.stories.d.ts +7 -0
- package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -0
- package/dist/components/Icons/index.d.ts +2 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +24 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +71 -52
- package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts +2 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +18 -17
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination.stories.d.ts.map +1 -1
- package/dist/components/Progress/Progress.d.ts +49 -0
- package/dist/components/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Progress/Progress.js +64 -0
- package/dist/components/Progress/Progress.stories.d.ts +13 -0
- package/dist/components/Progress/Progress.stories.d.ts.map +1 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/index.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -1
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.d.ts +266 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.d.ts.map +1 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.examples.d.ts +39 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.examples.d.ts.map +1 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +134 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.stories.d.ts +14 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.stories.d.ts.map +1 -0
- package/dist/components/ResponsiveLayoutTable/index.d.ts +2 -0
- package/dist/components/ResponsiveLayoutTable/index.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +20 -7
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +123 -92
- package/dist/components/Select/Select.stories.d.ts +1 -0
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Select/utils.d.ts +1 -0
- package/dist/components/Select/utils.d.ts.map +1 -1
- package/dist/components/Select/utils.js +5 -2
- package/dist/components/Sheet/Sheet.d.ts +89 -0
- package/dist/components/Sheet/Sheet.d.ts.map +1 -0
- package/dist/components/Sheet/Sheet.js +189 -0
- package/dist/components/Sheet/Sheet.stories.d.ts +20 -0
- package/dist/components/Sheet/Sheet.stories.d.ts.map +1 -0
- package/dist/components/Sheet/index.d.ts +2 -0
- package/dist/components/Sheet/index.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +65 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/Slider.js +134 -0
- package/dist/components/Slider/Slider.stories.d.ts +12 -0
- package/dist/components/Slider/Slider.stories.d.ts.map +1 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +1 -1
- package/dist/components/ToggleCheckButton/ToggleCheckButton.d.ts +69 -0
- package/dist/components/ToggleCheckButton/ToggleCheckButton.d.ts.map +1 -0
- package/dist/components/ToggleCheckButton/ToggleCheckButton.js +64 -0
- package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts +8 -0
- package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts.map +1 -0
- package/dist/components/ToggleCheckButton/index.d.ts +2 -0
- package/dist/components/ToggleCheckButton/index.d.ts.map +1 -0
- package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
- package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts +19 -0
- package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts.map +1 -0
- package/dist/components/WebCheckoutNav/WebCheckoutNav.stories.d.ts +8 -0
- package/dist/components/WebCheckoutNav/WebCheckoutNav.stories.d.ts.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/globals.css +1 -0
- package/dist/hooks/use-is-breakpoint.d.ts +11 -0
- package/dist/hooks/use-is-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-is-breakpoint.js +24 -13
- package/dist/index.js +316 -262
- package/dist/muza-ui.css +1 -1
- package/dist/styles/primitives.css +5 -1
- package/dist/styles/token-colors.css +221 -12
- package/dist/styles/token-sizes.css +636 -267
- package/dist/styles/typography.css +36 -7
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +17 -0
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +17 -0
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +19 -2
- package/dist/translations/types.d.ts +42 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +24 -7
- package/package.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,gBAAgB,CAAA;AASlE,QAAA,MAAM,kBAAkB;;;;8EAoCvB,CAAA;AAgBD;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAA;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4GAA4G;IAC5G,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gGAAgG;IAChG,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAChC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4FAA4F;IAC5F,QAAQ,EAAE,OAAO,CAAA;IACjB,kHAAkH;IAClH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CACR,KAAK,CAAC,cAAc,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C,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IAClC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;IAClC,yHAAyH;IACzH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7D;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpD,kHAAkH;IAClH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,QAAA,MAAM,UAAU,wFAmSf,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as n, jsx as a, Fragment as
|
|
1
|
+
import { jsxs as n, jsx as a, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import * as v from "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useDropzone as
|
|
5
|
-
import { FileItem as
|
|
6
|
-
import { useMuzaTranslations as
|
|
7
|
-
import { FormField as
|
|
8
|
-
import { Flex as
|
|
9
|
-
import { cn as
|
|
10
|
-
import { CloudUploadOutline as
|
|
3
|
+
import { cva as O } from "class-variance-authority";
|
|
4
|
+
import { useDropzone as me } from "react-dropzone";
|
|
5
|
+
import { FileItem as Y } from "./FileItem.js";
|
|
6
|
+
import { useMuzaTranslations as ge } from "../../translations/TranslationContext.js";
|
|
7
|
+
import { FormField as xe } from "../FormField/FormField.js";
|
|
8
|
+
import { Flex as Z } from "../Flex/Flex.js";
|
|
9
|
+
import { cn as q } from "../../utils/cn.js";
|
|
10
|
+
import { CloudUploadOutline as he } from "@solar-icons/react-perf";
|
|
11
11
|
import { Typography as M } from "../Typography/Typography.js";
|
|
12
|
-
const
|
|
12
|
+
const be = O(
|
|
13
13
|
[
|
|
14
14
|
"group relative cursor-pointer rounded-xl border-1 border-dashed transition-colors",
|
|
15
15
|
"p-4xl pt-3xl pr-4xl pb-3xl",
|
|
@@ -45,7 +45,7 @@ const xe = Z(
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
),
|
|
48
|
+
), ve = O(
|
|
49
49
|
[
|
|
50
50
|
"text-center transition-colors",
|
|
51
51
|
"text-comp-file-upload-text-dark-secondary"
|
|
@@ -57,137 +57,139 @@ const xe = Z(
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
),
|
|
60
|
+
), Me = v.forwardRef(
|
|
61
61
|
({
|
|
62
|
-
className:
|
|
62
|
+
className: P,
|
|
63
63
|
onDrop: z,
|
|
64
64
|
accept: m,
|
|
65
|
-
multiple:
|
|
65
|
+
multiple: U = !0,
|
|
66
66
|
maxSize: y,
|
|
67
|
-
maxSizeErrorMessage:
|
|
67
|
+
maxSizeErrorMessage: H,
|
|
68
68
|
maxFiles: i,
|
|
69
|
-
maxFilesErrorMessage:
|
|
69
|
+
maxFilesErrorMessage: D,
|
|
70
70
|
size: V = "base",
|
|
71
71
|
disabled: p = !1,
|
|
72
72
|
readOnly: g = !1,
|
|
73
|
-
dropzoneOptions:
|
|
73
|
+
dropzoneOptions: C,
|
|
74
74
|
label: K,
|
|
75
|
-
title:
|
|
75
|
+
title: E,
|
|
76
76
|
subtitle: _,
|
|
77
|
-
preselectedFiles:
|
|
78
|
-
fileStatus:
|
|
77
|
+
preselectedFiles: ee = [],
|
|
78
|
+
fileStatus: oe = [],
|
|
79
79
|
itemErrors: F,
|
|
80
80
|
itemHints: k,
|
|
81
81
|
itemSecondaryTexts: w,
|
|
82
|
-
error:
|
|
82
|
+
error: te,
|
|
83
83
|
required: S,
|
|
84
|
-
disableRequiredAsterisk:
|
|
85
|
-
onError:
|
|
84
|
+
disableRequiredAsterisk: le,
|
|
85
|
+
onError: o,
|
|
86
86
|
onDelete: $,
|
|
87
87
|
onChange: u,
|
|
88
88
|
preselectedUrls: x = [],
|
|
89
89
|
onDeleteUrl: N,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
onDownloadUrl: j,
|
|
91
|
+
onDownloadFile: B,
|
|
92
|
+
labelExtra: se,
|
|
93
|
+
infoTooltip: re,
|
|
94
|
+
...ae
|
|
95
|
+
}, ie) => {
|
|
96
|
+
const f = ge(), [h, G] = v.useState(ee), [J, I] = v.useState(!1), [L, b] = v.useState(!1), R = h.length + x.length, de = E ?? f.fileUpload.title, T = i != null ? f.fileUpload.maxFilesError.replace("{count}", String(i)) : "", A = D ?? T, Q = y ? f.fileUpload.maxSizeError.replace(
|
|
95
97
|
"{size}",
|
|
96
98
|
(y / (1024 * 1024)).toFixed(0)
|
|
97
|
-
) : "",
|
|
99
|
+
) : "", W = H ?? Q, { getRootProps: ce, getInputProps: pe, isDragActive: ue } = me({
|
|
98
100
|
onDrop: (e, s) => {
|
|
99
101
|
try {
|
|
100
102
|
if (I(!1), b(!1), s.length > 0) {
|
|
101
|
-
const
|
|
103
|
+
const t = s.some(
|
|
102
104
|
(l) => l.errors.some((r) => r.code === "file-too-large")
|
|
103
105
|
);
|
|
104
106
|
if (s.some(
|
|
105
107
|
(l) => l.errors.some((r) => r.code === "too-many-files")
|
|
106
108
|
)) {
|
|
107
109
|
b(!0);
|
|
108
|
-
const l =
|
|
109
|
-
|
|
110
|
+
const l = A || T;
|
|
111
|
+
o == null || o(l, s[0].file);
|
|
110
112
|
return;
|
|
111
113
|
}
|
|
112
|
-
if (
|
|
114
|
+
if (t) {
|
|
113
115
|
I(!0);
|
|
114
|
-
const l =
|
|
115
|
-
|
|
116
|
+
const l = W || Q;
|
|
117
|
+
o == null || o(l, s[0].file);
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
if (i != null && R + e.length > i) {
|
|
120
122
|
b(!0);
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
+
const t = A || T;
|
|
124
|
+
o == null || o(t);
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
|
|
127
|
+
G((t) => {
|
|
126
128
|
const c = new Set(
|
|
127
|
-
|
|
129
|
+
t.map((d) => `${d.name}-${d.size}-${d.lastModified}`)
|
|
128
130
|
), l = e.filter(
|
|
129
131
|
(d) => !c.has(`${d.name}-${d.size}-${d.lastModified}`)
|
|
130
|
-
), r = [...
|
|
132
|
+
), r = [...t, ...l];
|
|
131
133
|
return u == null || u(r), r;
|
|
132
134
|
}), z == null || z(e);
|
|
133
|
-
} catch (
|
|
134
|
-
const c =
|
|
135
|
-
|
|
135
|
+
} catch (t) {
|
|
136
|
+
const c = t instanceof Error ? t.message : f.fileUpload.processingError;
|
|
137
|
+
o == null || o(c);
|
|
136
138
|
}
|
|
137
139
|
},
|
|
138
140
|
accept: typeof m == "string" ? { [m]: [] } : m ? Object.fromEntries(m.map((e) => [e, []])) : void 0,
|
|
139
|
-
multiple:
|
|
141
|
+
multiple: U,
|
|
140
142
|
maxSize: y,
|
|
141
143
|
maxFiles: i != null ? i - R : void 0,
|
|
142
144
|
disabled: p,
|
|
143
|
-
...
|
|
144
|
-
}),
|
|
145
|
-
return /* @__PURE__ */ n(
|
|
146
|
-
(!
|
|
147
|
-
|
|
145
|
+
...C
|
|
146
|
+
}), X = g || !U && (h.length > 0 || x.length > 0) || i != null && R >= i;
|
|
147
|
+
return /* @__PURE__ */ n(Z, { direction: "column", gap: "lg", children: [
|
|
148
|
+
(!X || K) && /* @__PURE__ */ a(
|
|
149
|
+
xe,
|
|
148
150
|
{
|
|
149
151
|
label: K,
|
|
150
152
|
required: S,
|
|
151
|
-
disableRequiredAsterisk:
|
|
152
|
-
labelExtra:
|
|
153
|
-
infoTooltip:
|
|
154
|
-
children: !
|
|
153
|
+
disableRequiredAsterisk: le,
|
|
154
|
+
labelExtra: se,
|
|
155
|
+
infoTooltip: re,
|
|
156
|
+
children: !X && /* @__PURE__ */ n(ne, { children: [
|
|
155
157
|
/* @__PURE__ */ n(
|
|
156
158
|
"div",
|
|
157
159
|
{
|
|
158
|
-
ref:
|
|
160
|
+
ref: ie,
|
|
159
161
|
tabIndex: p ? void 0 : 0,
|
|
160
|
-
className:
|
|
161
|
-
|
|
162
|
-
error:
|
|
162
|
+
className: q(
|
|
163
|
+
be({
|
|
164
|
+
error: te || J || L,
|
|
163
165
|
disabled: p,
|
|
164
|
-
className:
|
|
165
|
-
isDragActive:
|
|
166
|
+
className: P,
|
|
167
|
+
isDragActive: ue
|
|
166
168
|
})
|
|
167
169
|
),
|
|
168
|
-
...
|
|
169
|
-
...
|
|
170
|
+
...ce(),
|
|
171
|
+
...ae,
|
|
170
172
|
children: [
|
|
171
173
|
/* @__PURE__ */ a(
|
|
172
174
|
"input",
|
|
173
175
|
{
|
|
174
|
-
...
|
|
176
|
+
...pe({ required: S }),
|
|
175
177
|
"aria-required": S
|
|
176
178
|
}
|
|
177
179
|
),
|
|
178
|
-
/* @__PURE__ */ a(
|
|
180
|
+
/* @__PURE__ */ a(he, { className: "inline size-comp-file-upload-ico-size" }),
|
|
179
181
|
/* @__PURE__ */ n("div", { children: [
|
|
180
|
-
/* @__PURE__ */ a(M, { size: "base", component: "p", weight: "medium", children:
|
|
182
|
+
/* @__PURE__ */ a(M, { size: "base", component: "p", weight: "medium", children: de }),
|
|
181
183
|
_ && /* @__PURE__ */ a(
|
|
182
184
|
M,
|
|
183
185
|
{
|
|
184
186
|
size: "sm",
|
|
185
187
|
component: "p",
|
|
186
188
|
weight: "regular",
|
|
187
|
-
className:
|
|
188
|
-
|
|
189
|
+
className: q(
|
|
190
|
+
ve({
|
|
189
191
|
disabled: p,
|
|
190
|
-
className:
|
|
192
|
+
className: P
|
|
191
193
|
})
|
|
192
194
|
),
|
|
193
195
|
children: _
|
|
@@ -197,7 +199,7 @@ const xe = Z(
|
|
|
197
199
|
]
|
|
198
200
|
}
|
|
199
201
|
),
|
|
200
|
-
|
|
202
|
+
J && /* @__PURE__ */ a(
|
|
201
203
|
M,
|
|
202
204
|
{
|
|
203
205
|
size: "sm",
|
|
@@ -205,10 +207,10 @@ const xe = Z(
|
|
|
205
207
|
component: "p",
|
|
206
208
|
weight: "regular",
|
|
207
209
|
className: "text-comp-file-upload-text-error-def",
|
|
208
|
-
children:
|
|
210
|
+
children: W
|
|
209
211
|
}
|
|
210
212
|
),
|
|
211
|
-
|
|
213
|
+
L && /* @__PURE__ */ a(
|
|
212
214
|
M,
|
|
213
215
|
{
|
|
214
216
|
size: "sm",
|
|
@@ -216,15 +218,15 @@ const xe = Z(
|
|
|
216
218
|
component: "p",
|
|
217
219
|
weight: "regular",
|
|
218
220
|
className: "text-comp-file-upload-text-error-def",
|
|
219
|
-
children:
|
|
221
|
+
children: A
|
|
220
222
|
}
|
|
221
223
|
)
|
|
222
224
|
] })
|
|
223
225
|
}
|
|
224
226
|
),
|
|
225
|
-
(x.length > 0 || h.length > 0) && /* @__PURE__ */ n(
|
|
227
|
+
(x.length > 0 || h.length > 0) && /* @__PURE__ */ n(Z, { component: "ul", direction: "column", gap: "md", children: [
|
|
226
228
|
x.map((e, s) => /* @__PURE__ */ a(
|
|
227
|
-
|
|
229
|
+
Y,
|
|
228
230
|
{
|
|
229
231
|
source: "url",
|
|
230
232
|
url: e.url,
|
|
@@ -235,35 +237,37 @@ const xe = Z(
|
|
|
235
237
|
readOnly: g,
|
|
236
238
|
size: V,
|
|
237
239
|
secondaryText: e.secondaryText,
|
|
238
|
-
onDelete: () => N == null ? void 0 : N(e, s)
|
|
240
|
+
onDelete: () => N == null ? void 0 : N(e, s),
|
|
241
|
+
onDownload: j ? () => j(e, s) : void 0
|
|
239
242
|
},
|
|
240
243
|
`url-${e.url}`
|
|
241
244
|
)),
|
|
242
245
|
h.map((e, s) => {
|
|
243
|
-
const
|
|
246
|
+
const t = oe[s], c = t == null ? void 0 : t.uploaded;
|
|
244
247
|
return g && !c ? null : /* @__PURE__ */ a(
|
|
245
|
-
|
|
248
|
+
Y,
|
|
246
249
|
{
|
|
247
250
|
source: "file",
|
|
248
251
|
file: e,
|
|
249
252
|
uploaded: c,
|
|
250
|
-
progress:
|
|
253
|
+
progress: t == null ? void 0 : t.progress,
|
|
251
254
|
disabled: p,
|
|
252
255
|
readOnly: g,
|
|
253
256
|
error: F == null ? void 0 : F.get(e),
|
|
254
257
|
note: k == null ? void 0 : k.get(e),
|
|
255
258
|
secondaryText: w == null ? void 0 : w.get(e),
|
|
256
|
-
onError:
|
|
259
|
+
onError: o,
|
|
257
260
|
size: V,
|
|
261
|
+
onDownload: B ? () => B(e, s) : void 0,
|
|
258
262
|
onDelete: () => {
|
|
259
263
|
try {
|
|
260
|
-
b(!1), I(!1),
|
|
261
|
-
const r = l.filter((d,
|
|
264
|
+
b(!1), I(!1), G((l) => {
|
|
265
|
+
const r = l.filter((d, fe) => fe !== s);
|
|
262
266
|
return u == null || u(r), r;
|
|
263
267
|
}), $ == null || $(e, s);
|
|
264
268
|
} catch (l) {
|
|
265
269
|
const r = l instanceof Error ? l.message : f.fileUpload.deleteError;
|
|
266
|
-
|
|
270
|
+
o == null || o(r, e);
|
|
267
271
|
}
|
|
268
272
|
}
|
|
269
273
|
},
|
|
@@ -274,7 +278,7 @@ const xe = Z(
|
|
|
274
278
|
] });
|
|
275
279
|
}
|
|
276
280
|
);
|
|
277
|
-
|
|
281
|
+
Me.displayName = "FileUpload";
|
|
278
282
|
export {
|
|
279
|
-
|
|
283
|
+
Me as FileUpload
|
|
280
284
|
};
|
|
@@ -20,6 +20,7 @@ export declare const UploadSimulation: Story;
|
|
|
20
20
|
export declare const WithMaxFiles: Story;
|
|
21
21
|
export declare const WithMaxFilesAndPreselected: Story;
|
|
22
22
|
export declare const PreselectedUrls: Story;
|
|
23
|
+
export declare const WithDownloadCallbacks: Story;
|
|
23
24
|
export declare const MixedFilesAndUrls: Story;
|
|
24
25
|
export declare const WithSecondaryText: Story;
|
|
25
26
|
export declare const SingleFileImportResult: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAuB,MAAM,cAAc,CAAA;AAE9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,
|
|
1
|
+
{"version":3,"file":"FileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUpload.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAuB,MAAM,cAAc,CAAA;AAE9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA4MjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAgBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAmBnB,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAoBpC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAsB9B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAkB3B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAiBxB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAqBjC,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAexB,CAAA;AAED,eAAO,MAAM,aAAa,EA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