@vkzstudio/muza-ui 1.0.33 → 1.0.35

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.
@@ -1,12 +1,12 @@
1
1
  import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import * as m from "react";
2
+ import * as l from "react";
3
3
  import * as d from "@radix-ui/react-dropdown-menu";
4
4
  import { cva as k } from "class-variance-authority";
5
- import { Button as N } from "../Button/Button.js";
5
+ import { Button as y } from "../Button/Button.js";
6
6
  import { cn as i } from "../../utils/cn.js";
7
7
  import { Typography as b } from "../Typography/Typography.js";
8
8
  import { UnreadOutline as x } from "@solar-icons/react-perf";
9
- const h = m.createContext(null), y = () => m.useContext(h), T = ({ ...o }) => /* @__PURE__ */ e(d.Root, { "data-slot": "dropdown-menu", ...o }), P = ({ ...o }) => /* @__PURE__ */ e(d.Portal, { "data-slot": "dropdown-menu-portal", ...o }), G = ({ ...o }) => /* @__PURE__ */ e(
9
+ const h = l.createContext(null), N = () => l.useContext(h), T = ({ ...o }) => /* @__PURE__ */ e(d.Root, { "data-slot": "dropdown-menu", ...o }), P = ({ ...o }) => /* @__PURE__ */ e(d.Portal, { "data-slot": "dropdown-menu-portal", ...o }), G = ({ ...o }) => /* @__PURE__ */ e(
10
10
  d.Trigger,
11
11
  {
12
12
  "data-slot": "dropdown-menu-trigger",
@@ -18,14 +18,14 @@ const h = m.createContext(null), y = () => m.useContext(h), T = ({ ...o }) => /*
18
18
  align: r = "start",
19
19
  ...n
20
20
  }) => {
21
- const [s, c] = m.useState(!1), a = m.useRef(null);
22
- return m.useEffect(() => {
23
- const l = () => {
21
+ const [s, c] = l.useState(!1), a = l.useRef(null);
22
+ return l.useEffect(() => {
23
+ const m = () => {
24
24
  if (a.current) {
25
25
  const { scrollHeight: g, clientHeight: v } = a.current;
26
26
  c(g > v);
27
27
  }
28
- }, u = setTimeout(l, 10), w = new ResizeObserver(l);
28
+ }, u = setTimeout(m, 10), w = new ResizeObserver(m);
29
29
  return a.current && w.observe(a.current), () => {
30
30
  clearTimeout(u), w.disconnect();
31
31
  };
@@ -132,14 +132,14 @@ const h = m.createContext(null), y = () => m.useContext(h), T = ({ ...o }) => /*
132
132
  buttonProps: t,
133
133
  className: r,
134
134
  ...n
135
- }) => /* @__PURE__ */ e("div", { className: "px-lg", children: /* @__PURE__ */ e(
135
+ }) => /* @__PURE__ */ e("div", { className: "my-md px-lg", children: /* @__PURE__ */ e(
136
136
  d.Item,
137
137
  {
138
138
  "data-slot": "dropdown-menu-item",
139
139
  asChild: !0,
140
140
  ...n,
141
141
  children: /* @__PURE__ */ e(
142
- N,
142
+ y,
143
143
  {
144
144
  fullWidth: !0,
145
145
  ...t,
@@ -211,8 +211,8 @@ const h = m.createContext(null), y = () => m.useContext(h), T = ({ ...o }) => /*
211
211
  onValueChange: t,
212
212
  ...r
213
213
  }
214
- ) }), I = m.forwardRef(({ className: o, children: t, variant: r, icon: n, value: s, ...c }, a) => {
215
- const l = y(), u = (l == null ? void 0 : l.value) === s;
214
+ ) }), I = l.forwardRef(({ className: o, children: t, variant: r, icon: n, value: s, ...c }, a) => {
215
+ const m = N(), u = (m == null ? void 0 : m.value) === s;
216
216
  return /* @__PURE__ */ p(
217
217
  d.RadioItem,
218
218
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandableTable.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAgBd;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,iDAAiD;IACjD,KAAK,EAAE,SAAS,CAAA;IAChB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAA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,eAAe,GAAI,CAAC,EAAG,uDAKjC,oBAAoB,CAAC,CAAC,CAAC,4CAuXzB,CAAA"}
1
+ {"version":3,"file":"ExpandableTable.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAgBd;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,iDAAiD;IACjD,KAAK,EAAE,SAAS,CAAA;IAChB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,SAAS,CAAA;IACrD;;;;OAIG;IACH,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,EAAE,SAAS,CAAA;IAChB,kGAAkG;IAClG,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,SAAS,CAAA;CACtD;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,4FAA4F;IAC5F,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,sEAAsE;IACtE,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,sFAAsF;IACtF,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACrB;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CAAC,EAClB,0BAA0B,CAAC,CAAC,CAAC,EAAE,GAC/B,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACjD;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;QACnB,0GAA0G;QAC1G,mBAAmB,EAAE,MAAM,CAAA;QAC3B,yFAAyF;QACzF,YAAY,EAAE,MAAM,CAAA;QACpB,0GAA0G;QAC1G,SAAS,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;CACH;AAgCD,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,uDAKjC,oBAAoB,CAAC,CAAC,CAAC,4CAwXzB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { jsxs as p, jsx as s, Fragment as _ } from "react/jsx-runtime";
2
- import { useState as x, useRef as O, useEffect as W, useCallback as q, useMemo as M, Fragment as J } from "react";
1
+ import { jsxs as m, jsx as s, Fragment as _ } from "react/jsx-runtime";
2
+ import { useState as L, useRef as O, useEffect as W, useCallback as q, useMemo as M, Fragment as J } from "react";
3
3
  import { cva as Q } from "class-variance-authority";
4
4
  import { useIsMinSm as U, useIsMinMd as X, useIsMinLg as Y } from "../../hooks/use-is-breakpoint.js";
5
5
  import { Table as Z, TableHeader as D, TableRow as $, TableHead as S, TableRowGroup as R, TableCell as j } from "./Table.js";
@@ -28,7 +28,7 @@ const F = Q("", {
28
28
  expandableRowSections: t,
29
29
  classNames: d
30
30
  }) => {
31
- const [b, A] = x(/* @__PURE__ */ new Set()), [B, C] = x(/* @__PURE__ */ new Set()), u = O(
31
+ const [b, A] = L(/* @__PURE__ */ new Set()), [B, N] = L(/* @__PURE__ */ new Set()), u = O(
32
32
  /* @__PURE__ */ new Map()
33
33
  );
34
34
  W(() => {
@@ -41,16 +41,16 @@ const F = Q("", {
41
41
  A((i) => {
42
42
  const l = new Set(i);
43
43
  if (l.has(e)) {
44
- l.delete(e), C((m) => {
45
- const r = new Set(m);
44
+ l.delete(e), N((c) => {
45
+ const r = new Set(c);
46
46
  return r.add(e), r;
47
47
  });
48
48
  const n = u.current.get(e);
49
49
  n && clearTimeout(n), u.current.set(
50
50
  e,
51
51
  setTimeout(() => {
52
- C((m) => {
53
- const r = new Set(m);
52
+ N((c) => {
53
+ const r = new Set(c);
54
54
  return r.delete(e), r;
55
55
  }), u.current.delete(e);
56
56
  }, 150)
@@ -58,8 +58,8 @@ const F = Q("", {
58
58
  } else {
59
59
  l.add(e);
60
60
  const n = u.current.get(e);
61
- n && (clearTimeout(n), u.current.delete(e), C((m) => {
62
- const r = new Set(m);
61
+ n && (clearTimeout(n), u.current.delete(e), N((c) => {
62
+ const r = new Set(c);
63
63
  return r.delete(e), r;
64
64
  }));
65
65
  }
@@ -73,8 +73,8 @@ const F = Q("", {
73
73
  return a.forEach((l, n) => {
74
74
  I(l.responsive, y, k, T) && (e === -1 && (e = n), i = n);
75
75
  }), { firstVisibleIndex: e, lastVisibleIndex: i };
76
- }, [a, y, k, T]), E = !t && !!f && !V, L = !!t || E;
77
- return /* @__PURE__ */ p(Z, { children: [
76
+ }, [a, y, k, T]), C = !t && !!f && !V, x = !!t || C;
77
+ return /* @__PURE__ */ m(Z, { children: [
78
78
  /* @__PURE__ */ s(D, { children: /* @__PURE__ */ s($, { className: "[&>th]:border-0 [&>th]:bg-transparent", children: a.map((e, i) => /* @__PURE__ */ s(
79
79
  S,
80
80
  {
@@ -87,19 +87,19 @@ const F = Q("", {
87
87
  i
88
88
  )) }) }),
89
89
  h.map((e, i) => {
90
- var m;
91
- const l = b.has(i) || E, n = B.has(i);
92
- return /* @__PURE__ */ p(
90
+ var c;
91
+ const l = b.has(i) || C, n = B.has(i);
92
+ return /* @__PURE__ */ m(
93
93
  R,
94
94
  {
95
95
  className: o({
96
96
  "group hover:[&_td]:border-stroke-brand-hover": t
97
97
  }),
98
98
  children: [
99
- /* @__PURE__ */ p(
99
+ /* @__PURE__ */ m(
100
100
  $,
101
101
  {
102
- expandablePosition: t && (b.has(i) || n) || E ? "top" : "none",
102
+ expandablePosition: t && (b.has(i) || n) || C ? "top" : "none",
103
103
  className: o("focus-visible-default", {
104
104
  "cursor-pointer": t
105
105
  }),
@@ -111,12 +111,12 @@ const F = Q("", {
111
111
  role: t ? "button" : void 0,
112
112
  "aria-expanded": t ? b.has(i) : void 0,
113
113
  children: [
114
- a.map((r, c) => /* @__PURE__ */ s(
114
+ a.map((r, p) => /* @__PURE__ */ s(
115
115
  j,
116
116
  {
117
- isFirst: c === H,
118
- isLast: c === P && !t,
119
- expandablePosition: (l || n) && L ? "top" : "none",
117
+ isFirst: p === H,
118
+ isLast: p === P && !t,
119
+ expandablePosition: (l || n) && x ? "top" : "none",
120
120
  className: o(
121
121
  r.className,
122
122
  F({ responsive: r.responsive })
@@ -132,7 +132,7 @@ const F = Q("", {
132
132
  }
133
133
  )
134
134
  },
135
- c
135
+ p
136
136
  )),
137
137
  t && /* @__PURE__ */ s(
138
138
  j,
@@ -157,7 +157,7 @@ const F = Q("", {
157
157
  ]
158
158
  }
159
159
  ),
160
- L && /* @__PURE__ */ s("tr", { "aria-hidden": !l, children: /* @__PURE__ */ s(
160
+ x && /* @__PURE__ */ s("tr", { "aria-hidden": !l, children: /* @__PURE__ */ s(
161
161
  "td",
162
162
  {
163
163
  colSpan: a.length + (t ? 1 : 0),
@@ -169,136 +169,139 @@ const F = Q("", {
169
169
  "grid transition-[grid-template-rows] duration-300 ease-in-out",
170
170
  l ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
171
171
  ),
172
- children: /* @__PURE__ */ s("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ s(
172
+ children: /* @__PURE__ */ s("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ m(
173
173
  "div",
174
174
  {
175
175
  className: o(
176
176
  "rounded-b-xl border-x-1 border-b-1 border-stroke-base-secondary bg-surface-base-secondary transition-colors group-hover:border-stroke-brand-hover"
177
177
  ),
178
- children: /* @__PURE__ */ p(
179
- "div",
180
- {
181
- className: o(
182
- "grid grid-cols-1 gap-2xl px-comp-table-p py-2xl md:grid-cols-[auto_1fr]",
183
- d == null ? void 0 : d.expandedContentGrid
184
- ),
185
- children: [
186
- !V && /* @__PURE__ */ p(_, { children: [
187
- /* @__PURE__ */ s(
188
- z,
189
- {
190
- gap: "md",
191
- direction: "column",
192
- className: "col-span-full",
193
- children: a.map((r, c) => /* @__PURE__ */ p(
194
- z,
178
+ children: [
179
+ /* @__PURE__ */ s("div", { className: "mx-comp-table-p border-t-1 border-stroke-base-secondary" }),
180
+ /* @__PURE__ */ m(
181
+ "div",
182
+ {
183
+ className: o(
184
+ "grid grid-cols-1 gap-2xl px-comp-table-p py-2xl md:grid-cols-[auto_1fr]",
185
+ d == null ? void 0 : d.expandedContentGrid
186
+ ),
187
+ children: [
188
+ !V && /* @__PURE__ */ m(_, { children: [
189
+ /* @__PURE__ */ s(
190
+ z,
191
+ {
192
+ gap: "md",
193
+ direction: "column",
194
+ className: "col-span-full",
195
+ children: a.map((r, p) => /* @__PURE__ */ m(
196
+ z,
197
+ {
198
+ align: "center",
199
+ justify: "between",
200
+ direction: "row",
201
+ className: F({
202
+ reverse: r.responsive
203
+ }),
204
+ children: [
205
+ /* @__PURE__ */ s(g, { variant: "body", component: "span", children: r.title }),
206
+ r.render ? r.render(
207
+ e[r.dataKey],
208
+ e
209
+ ) : /* @__PURE__ */ s(
210
+ g,
211
+ {
212
+ variant: "body",
213
+ weight: "medium",
214
+ size: "base",
215
+ component: "span",
216
+ children: e[r.dataKey]
217
+ }
218
+ )
219
+ ]
220
+ },
221
+ p
222
+ ))
223
+ }
224
+ ),
225
+ t && /* @__PURE__ */ s("hr", { className: "col-span-full text-stroke-base-secondary md:col-span-2" })
226
+ ] }),
227
+ (c = typeof t == "function" ? t(e) : t) == null ? void 0 : c.map((r, p) => {
228
+ if (!t) return null;
229
+ const G = typeof t == "function" ? t(e).length : t.length;
230
+ return /* @__PURE__ */ m(J, { children: [
231
+ /* @__PURE__ */ m(
232
+ "div",
195
233
  {
196
- align: "center",
197
- justify: "between",
198
- direction: "row",
199
- className: F({
200
- reverse: r.responsive
201
- }),
234
+ className: o(
235
+ "col-span-full grid grid-cols-1 gap-y-xl md:col-span-2 md:grid-cols-subgrid",
236
+ d == null ? void 0 : d.sectionTitle
237
+ ),
202
238
  children: [
203
- /* @__PURE__ */ s(g, { variant: "body", component: "span", children: r.title }),
204
- r.render ? r.render(
205
- e[r.dataKey],
206
- e
207
- ) : /* @__PURE__ */ s(
239
+ r.title && /* @__PURE__ */ s(
208
240
  g,
209
241
  {
210
242
  variant: "body",
243
+ uppercase: !0,
244
+ size: "sm",
211
245
  weight: "medium",
212
- size: "base",
213
- component: "span",
214
- children: e[r.dataKey]
246
+ component: "p",
247
+ className: "text-text-brand-def md:col-span-2",
248
+ children: r.title
249
+ }
250
+ ),
251
+ /* @__PURE__ */ s(
252
+ "div",
253
+ {
254
+ className: o(
255
+ "col-span-full grid grid-cols-1 gap-x-3xl md:col-span-2 md:grid-cols-subgrid md:gap-y-md",
256
+ d == null ? void 0 : d.cellsWrap
257
+ ),
258
+ children: r.cells.flatMap(
259
+ (v, E) => [
260
+ /* @__PURE__ */ s(
261
+ g,
262
+ {
263
+ component: "span",
264
+ variant: "body",
265
+ className: "mb-xs text-text-dark-primary-def md:mb-0",
266
+ children: v.title
267
+ },
268
+ `${E}-label`
269
+ ),
270
+ v.render ? /* @__PURE__ */ s(
271
+ "div",
272
+ {
273
+ className: "mb-md block last-of-type:mb-0 md:mb-0",
274
+ children: v.render(
275
+ e[v.dataKey],
276
+ e
277
+ )
278
+ },
279
+ `${E}-value`
280
+ ) : /* @__PURE__ */ s(
281
+ g,
282
+ {
283
+ variant: "body",
284
+ weight: "medium",
285
+ component: "span",
286
+ className: "mb-md block last-of-type:mb-0 md:mb-0",
287
+ children: e[v.dataKey]
288
+ },
289
+ `${E}-value`
290
+ )
291
+ ]
292
+ )
215
293
  }
216
294
  )
217
295
  ]
218
- },
219
- c
220
- ))
221
- }
222
- ),
223
- t && /* @__PURE__ */ s("hr", { className: "col-span-full text-stroke-base-secondary md:col-span-2" })
224
- ] }),
225
- (m = typeof t == "function" ? t(e) : t) == null ? void 0 : m.map((r, c) => {
226
- if (!t) return null;
227
- const G = typeof t == "function" ? t(e).length : t.length;
228
- return /* @__PURE__ */ p(J, { children: [
229
- /* @__PURE__ */ p(
230
- "div",
231
- {
232
- className: o(
233
- "col-span-full grid grid-cols-1 gap-y-xl md:col-span-2 md:grid-cols-subgrid",
234
- d == null ? void 0 : d.sectionTitle
235
- ),
236
- children: [
237
- r.title && /* @__PURE__ */ s(
238
- g,
239
- {
240
- variant: "body",
241
- uppercase: !0,
242
- size: "sm",
243
- weight: "medium",
244
- component: "p",
245
- className: "text-text-brand-def md:col-span-2",
246
- children: r.title
247
- }
248
- ),
249
- /* @__PURE__ */ s(
250
- "div",
251
- {
252
- className: o(
253
- "col-span-full grid grid-cols-1 gap-x-3xl md:col-span-2 md:grid-cols-subgrid md:gap-y-md",
254
- d == null ? void 0 : d.cellsWrap
255
- ),
256
- children: r.cells.flatMap(
257
- (v, N) => [
258
- /* @__PURE__ */ s(
259
- g,
260
- {
261
- component: "span",
262
- variant: "body",
263
- className: "mb-xs text-text-dark-primary-def md:mb-0",
264
- children: v.title
265
- },
266
- `${N}-label`
267
- ),
268
- v.render ? /* @__PURE__ */ s(
269
- "div",
270
- {
271
- className: "mb-md block last-of-type:mb-0 md:mb-0",
272
- children: v.render(
273
- e[v.dataKey],
274
- e
275
- )
276
- },
277
- `${N}-value`
278
- ) : /* @__PURE__ */ s(
279
- g,
280
- {
281
- variant: "body",
282
- weight: "medium",
283
- component: "span",
284
- className: "mb-md block last-of-type:mb-0 md:mb-0",
285
- children: e[v.dataKey]
286
- },
287
- `${N}-value`
288
- )
289
- ]
290
- )
291
- }
292
- )
293
- ]
294
- }
295
- ),
296
- c < G - 1 && /* @__PURE__ */ s("hr", { className: "col-span-full text-stroke-base-secondary md:col-span-2" })
297
- ] }, c);
298
- })
299
- ]
300
- }
301
- )
296
+ }
297
+ ),
298
+ p < G - 1 && /* @__PURE__ */ s("hr", { className: "col-span-full text-stroke-base-secondary md:col-span-2" })
299
+ ] }, p);
300
+ })
301
+ ]
302
+ }
303
+ )
304
+ ]
302
305
  }
303
306
  ) })
304
307
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8C9B,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,sEAAsE;IACtE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/C;AAED,UAAU,iBAAkB,SAAQ,iBAAiB;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,IAAI,CAAA;CACX;AAED,UAAU,gBAAiB,SAAQ,iBAAiB;IAClD,MAAM,EAAE,KAAK,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA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10
10
  let n = null, o = null;
11
11
  try {
12
12
  n = URL.createObjectURL(e), o = document.createElement("a"), o.href = n, o.download = e.name, o.style.display = "none", document.body.appendChild(o), o.click();
13
- } catch (d) {
14
- const c = d instanceof Error ? d.message : i ?? "Download failed";
15
- console.error("Download failed:", d), l == null || l(c, e);
13
+ } catch (r) {
14
+ const c = r instanceof Error ? r.message : i ?? "Download failed";
15
+ console.error("Download failed:", r), l == null || l(c, e);
16
16
  } finally {
17
17
  o && document.body.contains(o) && document.body.removeChild(o), n && URL.revokeObjectURL(n);
18
18
  }
@@ -28,26 +28,22 @@ const D = (e, l, i) => {
28
28
  default: [
29
29
  "border-comp-file-upload-stroke-def-def",
30
30
  "bg-comp-input-fill-def leading-[140%]",
31
- "text-comp-file-upload-text-dark-primary",
32
- "font-medium"
31
+ "text-comp-file-upload-text-dark-primary"
33
32
  ],
34
33
  loading: [
35
34
  "border-comp-file-upload-stroke-def-def",
36
35
  "bg-comp-input-fill-def leading-[140%]",
37
- "text-comp-file-upload-text-dark-secondary",
38
- "font-medium"
36
+ "text-comp-file-upload-text-dark-secondary"
39
37
  ],
40
38
  error: [
41
39
  "border-comp-file-upload-stroke-error-def",
42
40
  "bg-comp-input-fill-def",
43
- "text-comp-file-upload-text-dark-primary",
44
- "font-medium"
41
+ "text-comp-file-upload-text-dark-primary"
45
42
  ],
46
43
  disabled: [
47
44
  "border-comp-file-upload-stroke-dashed-disabled",
48
45
  "bg-comp-file-upload-fill-disabled",
49
- "text-comp-file-upload-text-dark-disabled",
50
- "font-medium"
46
+ "text-comp-file-upload-text-dark-disabled"
51
47
  ]
52
48
  },
53
49
  size: {
@@ -86,17 +82,17 @@ const D = (e, l, i) => {
86
82
  progress: i,
87
83
  size: n,
88
84
  disabled: o,
89
- readOnly: d = !1,
85
+ readOnly: r = !1,
90
86
  note: c,
91
87
  error: s,
92
88
  secondaryText: g,
93
89
  onDelete: y,
94
90
  onError: L
95
- } = e, m = _(), [v, w] = p.useState(!1), N = e.source === "file" ? e.file.name : e.name, b = e.source === "url" ? (e.type ?? "").startsWith("image/") || A.test(e.name) : e.file.type.startsWith("image/"), T = e.source === "url" ? E.includes(e.type ?? "") || z.test(e.name) : E.includes(e.file.type) || z.test(e.file.name), r = e.source === "file" ? e.file : e.url, C = p.useMemo(() => o ? "disabled" : s ? "error" : typeof i == "number" && i > 0 ? "loading" : "default", [o, s, i]), x = p.useMemo(() => {
91
+ } = e, m = _(), [v, w] = p.useState(!1), N = e.source === "file" ? e.file.name : e.name, b = e.source === "url" ? (e.type ?? "").startsWith("image/") || A.test(e.name) : e.file.type.startsWith("image/"), T = e.source === "url" ? E.includes(e.type ?? "") || z.test(e.name) : E.includes(e.file.type) || z.test(e.file.name), d = e.source === "file" ? e.file : e.url, C = p.useMemo(() => o ? "disabled" : s ? "error" : typeof i == "number" && i > 0 ? "loading" : "default", [o, s, i]), x = p.useMemo(() => {
96
92
  if (b)
97
- return typeof r == "string" ? r : URL.createObjectURL(r);
98
- }, [b, r]);
99
- return p.useEffect(() => w(!1), [r]), /* @__PURE__ */ f(U, { gap: "sm", direction: "column", component: "li", children: [
93
+ return typeof d == "string" ? d : URL.createObjectURL(d);
94
+ }, [b, d]);
95
+ return p.useEffect(() => w(!1), [d]), /* @__PURE__ */ f(U, { gap: "sm", direction: "column", component: "li", children: [
100
96
  /* @__PURE__ */ f(
101
97
  "div",
102
98
  {
@@ -217,7 +213,7 @@ const D = (e, l, i) => {
217
213
  children: /* @__PURE__ */ t(I, { className: "size-icon-medium" })
218
214
  }
219
215
  ),
220
- !d && /* @__PURE__ */ t(
216
+ !r && /* @__PURE__ */ t(
221
217
  "button",
222
218
  {
223
219
  disabled: o,
@@ -22,5 +22,6 @@ export declare const WithMaxFilesAndPreselected: Story;
22
22
  export declare const PreselectedUrls: Story;
23
23
  export declare const MixedFilesAndUrls: Story;
24
24
  export declare const WithSecondaryText: Story;
25
+ export declare const SingleFileImportResult: Story;
25
26
  export declare const SingleFileWithUrl: Story;
26
27
  //# sourceMappingURL=FileUpload.stories.d.ts.map
@@ -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,CAgMjC,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,EAAE,KAiB3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KA0ChC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA0F9B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAiB1B,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAuBxC,CAAA;AAmBD,eAAO,MAAM,eAAe,EAAE,KA0B7B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAoC/B,CAAA;AAED,eAAO,MAAM,iBAAi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