@studiolxd/brand 49.25.0 → 49.27.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.
@@ -1 +1 @@
1
- .file-upload{width:100%}.file-upload__dropzone{--_drop-color:var(--file-upload-border-color);--_drop-bg:var(--file-upload-bg);--_dash:var(--file-upload-border-dash-length);--_gap:var(--file-upload-border-dash-gap)}.file-upload.file-upload--sm{--file-upload-padding-block:var(--file-upload-sm-padding-block);--file-upload-padding-inline:var(--file-upload-sm-padding-inline);--file-upload-text-font-size:var(--file-upload-sm-text-font-size);--file-upload-subtext-font-size:var(--file-upload-sm-subtext-font-size);--file-upload-thumb-size:var(--file-upload-sm-thumb-size);--file-upload-item-name-font-size:var(--file-upload-sm-item-name-font-size)}.file-upload.file-upload--lg{--file-upload-padding-block:var(--file-upload-lg-padding-block);--file-upload-padding-inline:var(--file-upload-lg-padding-inline);--file-upload-text-font-size:var(--file-upload-lg-text-font-size);--file-upload-subtext-font-size:var(--file-upload-lg-subtext-font-size);--file-upload-thumb-size:var(--file-upload-lg-thumb-size);--file-upload-item-name-font-size:var(--file-upload-lg-item-name-font-size)}.file-upload__dropzone{justify-content:center;align-items:center;gap:var(--file-upload-gap);width:100%;padding-block:var(--file-upload-padding-block);padding-inline:var(--file-upload-padding-inline);background-image:repeating-linear-gradient(90deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap))), repeating-linear-gradient(90deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap))), repeating-linear-gradient(180deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap))), repeating-linear-gradient(180deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap)));background-size:100% var(--file-upload-border-width), 100% var(--file-upload-border-width), var(--file-upload-border-width) 100%, var(--file-upload-border-width) 100%;background-position:0 0,0 100%,0 0,100% 0;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;background-color:var(--_drop-bg);color:var(--file-upload-text-color);cursor:pointer;transition:background-image var(--file-upload-transition-duration) var(--file-upload-transition-easing), background-color var(--file-upload-transition-duration) var(--file-upload-transition-easing);text-align:center;box-sizing:border-box;outline:none;flex-direction:column;display:flex}.file-upload:has(input[type=file]:focus-visible) .file-upload__dropzone{outline:var(--input-focus-ring-width) solid var(--input-focus-ring-color);outline-offset:var(--file-upload-remove-focus-ring-offset)}.file-upload.file-upload--dragging .file-upload__dropzone{--_drop-color:var(--file-upload-drag-border-color);--_drop-bg:var(--file-upload-drag-bg)}.file-upload.file-upload--error .file-upload__dropzone{--_drop-color:var(--file-upload-error-border-color);--_drop-bg:var(--file-upload-error-bg)}.file-upload.file-upload--disabled .file-upload__dropzone{opacity:var(--file-upload-disabled-opacity);cursor:var(--file-upload-disabled-cursor);pointer-events:none}.file-upload__icon{color:var(--file-upload-icon-color);flex-shrink:0;margin-block-end:var(--file-upload-gap)}.file-upload__text{font-family:var(--file-upload-text-font-family);font-size:var(--file-upload-text-font-size);font-weight:var(--file-upload-text-font-weight);color:var(--file-upload-text-color)}.file-upload__text--secondary{color:var(--file-upload-subtext-color);font-weight:var(--file-upload-subtext-font-weight)}.file-upload__subtext{font-family:var(--file-upload-text-font-family);font-size:var(--file-upload-subtext-font-size);color:var(--file-upload-subtext-color);margin-block-start:var(--file-upload-gap)}.file-upload__list{gap:var(--file-upload-list-gap);flex-direction:column;margin:0;margin-block-start:var(--file-upload-list-margin-block-start);padding:0;list-style:none;display:flex}.file-upload__item{align-items:center;gap:var(--file-upload-item-gap);padding-block:var(--file-upload-item-padding-block);padding-inline:var(--file-upload-item-padding-inline);border-width:var(--file-upload-item-border-width);border-style:solid;border-color:var(--file-upload-item-border-color);border-radius:var(--file-upload-item-border-radius);background-color:var(--file-upload-item-bg);display:flex}.file-upload__item.file-upload__item--error{border-color:var(--file-upload-item-error-border-color);background-color:var(--file-upload-item-error-bg)}.file-upload__item-thumb{width:var(--file-upload-thumb-size);height:var(--file-upload-thumb-size);border-radius:var(--file-upload-thumb-border-radius);background-color:var(--file-upload-thumb-bg);color:var(--file-upload-thumb-icon-color);flex-shrink:0;justify-content:center;align-items:center;display:flex;overflow:hidden}.file-upload__item-thumb img{object-fit:cover;width:100%;height:100%}.file-upload__item-info{gap:var(--file-upload-item-info-gap);flex-direction:column;flex:1;min-width:0;display:flex}.file-upload__item-name{font-family:var(--file-upload-item-name-font-family);font-size:var(--file-upload-item-name-font-size);font-weight:var(--file-upload-item-name-font-weight);color:var(--file-upload-item-name-color);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.file-upload__item-size{font-family:var(--file-upload-item-name-font-family);font-size:var(--file-upload-item-size-font-size);color:var(--file-upload-item-size-color)}.file-upload__item-error-msg{font-family:var(--file-upload-item-name-font-family);font-size:var(--file-upload-item-error-font-size);color:var(--file-upload-item-error-color)}.file-upload__item-remove{cursor:pointer;color:var(--file-upload-remove-color);transition:color var(--file-upload-transition-duration) var(--file-upload-transition-easing);background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;line-height:1;display:flex}.file-upload__item-remove:hover{color:var(--file-upload-remove-color-hover)}.file-upload__item-remove:focus-visible{outline:var(--input-focus-ring-width) solid var(--input-focus-ring-color);outline-offset:var(--file-upload-remove-focus-ring-offset);border-radius:var(--file-upload-remove-border-radius)}.file-upload__progress{margin-block-start:var(--file-upload-progress-margin-block-start)}
1
+ .file-upload{width:100%}.file-upload__dropzone{--_drop-color:var(--file-upload-border-color);--_drop-bg:var(--file-upload-bg);--_dash:var(--file-upload-border-dash-length);--_gap:var(--file-upload-border-dash-gap)}.file-upload.file-upload--sm{--file-upload-padding-block:var(--file-upload-sm-padding-block);--file-upload-padding-inline:var(--file-upload-sm-padding-inline);--file-upload-text-font-size:var(--file-upload-sm-text-font-size);--file-upload-subtext-font-size:var(--file-upload-sm-subtext-font-size);--file-upload-thumb-size:var(--file-upload-sm-thumb-size);--file-upload-item-name-font-size:var(--file-upload-sm-item-name-font-size)}.file-upload.file-upload--lg{--file-upload-padding-block:var(--file-upload-lg-padding-block);--file-upload-padding-inline:var(--file-upload-lg-padding-inline);--file-upload-text-font-size:var(--file-upload-lg-text-font-size);--file-upload-subtext-font-size:var(--file-upload-lg-subtext-font-size);--file-upload-thumb-size:var(--file-upload-lg-thumb-size);--file-upload-item-name-font-size:var(--file-upload-lg-item-name-font-size)}.file-upload__dropzone{justify-content:center;align-items:center;gap:var(--file-upload-gap);width:100%;padding-block:var(--file-upload-padding-block);padding-inline:var(--file-upload-padding-inline);background-image:repeating-linear-gradient(90deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap))), repeating-linear-gradient(90deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap))), repeating-linear-gradient(180deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap))), repeating-linear-gradient(180deg, var(--_drop-color) 0, var(--_drop-color) var(--_dash), transparent var(--_dash), transparent calc(var(--_dash) + var(--_gap)));background-size:100% var(--file-upload-border-width), 100% var(--file-upload-border-width), var(--file-upload-border-width) 100%, var(--file-upload-border-width) 100%;background-position:0 0,0 100%,0 0,100% 0;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;background-color:var(--_drop-bg);color:var(--file-upload-text-color);cursor:pointer;transition:background-image var(--file-upload-transition-duration) var(--file-upload-transition-easing), background-color var(--file-upload-transition-duration) var(--file-upload-transition-easing);text-align:center;box-sizing:border-box;outline:none;flex-direction:column;display:flex}.file-upload:has(input[type=file]:focus-visible) .file-upload__dropzone{outline:var(--input-focus-ring-width) solid var(--input-focus-ring-color);outline-offset:var(--file-upload-remove-focus-ring-offset)}.file-upload.file-upload--dragging .file-upload__dropzone{--_drop-color:var(--file-upload-drag-border-color);--_drop-bg:var(--file-upload-drag-bg)}.file-upload.file-upload--error .file-upload__dropzone{--_drop-color:var(--file-upload-error-border-color);--_drop-bg:var(--file-upload-error-bg)}.file-upload.file-upload--disabled .file-upload__dropzone{opacity:var(--file-upload-disabled-opacity);cursor:var(--file-upload-disabled-cursor);pointer-events:none}.file-upload.file-upload--uploading .file-upload__dropzone{cursor:progress;pointer-events:none}.file-upload.file-upload--uploading span.file-upload__icon{display:flex}.file-upload.file-upload--uploading .file-upload__item-remove{pointer-events:none}.file-upload__icon{color:var(--file-upload-icon-color);flex-shrink:0;margin-block-end:var(--file-upload-gap)}.file-upload__text{font-family:var(--file-upload-text-font-family);font-size:var(--file-upload-text-font-size);font-weight:var(--file-upload-text-font-weight);color:var(--file-upload-text-color)}.file-upload__text--secondary{color:var(--file-upload-subtext-color);font-weight:var(--file-upload-subtext-font-weight)}.file-upload__subtext{font-family:var(--file-upload-text-font-family);font-size:var(--file-upload-subtext-font-size);color:var(--file-upload-subtext-color);margin-block-start:var(--file-upload-gap)}.file-upload__list{gap:var(--file-upload-list-gap);flex-direction:column;margin:0;margin-block-start:var(--file-upload-list-margin-block-start);padding:0;list-style:none;display:flex}.file-upload__item{align-items:center;gap:var(--file-upload-item-gap);padding-block:var(--file-upload-item-padding-block);padding-inline:var(--file-upload-item-padding-inline);border-width:var(--file-upload-item-border-width);border-style:solid;border-color:var(--file-upload-item-border-color);border-radius:var(--file-upload-item-border-radius);background-color:var(--file-upload-item-bg);display:flex}.file-upload__item.file-upload__item--error{border-color:var(--file-upload-item-error-border-color);background-color:var(--file-upload-item-error-bg)}.file-upload__item-thumb{width:var(--file-upload-thumb-size);height:var(--file-upload-thumb-size);border-radius:var(--file-upload-thumb-border-radius);background-color:var(--file-upload-thumb-bg);color:var(--file-upload-thumb-icon-color);flex-shrink:0;justify-content:center;align-items:center;display:flex;overflow:hidden}.file-upload__item-thumb img{object-fit:cover;width:100%;height:100%}.file-upload__item-info{gap:var(--file-upload-item-info-gap);flex-direction:column;flex:1;min-width:0;display:flex}.file-upload__item-name{font-family:var(--file-upload-item-name-font-family);font-size:var(--file-upload-item-name-font-size);font-weight:var(--file-upload-item-name-font-weight);color:var(--file-upload-item-name-color);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.file-upload__item-size{font-family:var(--file-upload-item-name-font-family);font-size:var(--file-upload-item-size-font-size);color:var(--file-upload-item-size-color)}.file-upload__item-error-msg{font-family:var(--file-upload-item-name-font-family);font-size:var(--file-upload-item-error-font-size);color:var(--file-upload-item-error-color)}.file-upload__item-remove{cursor:pointer;color:var(--file-upload-remove-color);transition:color var(--file-upload-transition-duration) var(--file-upload-transition-easing);background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;line-height:1;display:flex}.file-upload__item-remove:hover{color:var(--file-upload-remove-color-hover)}.file-upload__item-remove:focus-visible{outline:var(--input-focus-ring-width) solid var(--input-focus-ring-color);outline-offset:var(--file-upload-remove-focus-ring-offset);border-radius:var(--file-upload-remove-border-radius)}.file-upload__progress{margin-block-start:var(--file-upload-progress-margin-block-start)}
@@ -3,184 +3,208 @@ import './file-upload.css';
3
3
  import { n as e } from "./_shared/brandmessagescontext.js";
4
4
  import { Icon as t } from "./icon.js";
5
5
  import { VisuallyHidden as n } from "./visually-hidden.js";
6
- import { n as r } from "./_shared/form-size.js";
7
- import { t as i } from "./_shared/progressbar.js";
8
- import { i as a, n as o, t as s } from "./_shared/validate.js";
9
- import { forwardRef as c, useCallback as l, useEffect as u, useId as d, useRef as f, useState as p } from "react";
10
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ import { Spinner as r } from "./spinner.js";
7
+ import { n as i } from "./_shared/form-size.js";
8
+ import { t as ee } from "./_shared/progressbar.js";
9
+ import { i as te, n as a, t as ne } from "./_shared/validate.js";
10
+ import { forwardRef as o, useCallback as s, useEffect as c, useId as re, useRef as l, useState as u } from "react";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
11
12
  //#region src/stories/atoms/FileUpload/FileUpload.tsx
12
- var g = /* @__PURE__ */ new WeakMap();
13
- function ee(e) {
13
+ var m = /* @__PURE__ */ new WeakMap();
14
+ function h(e) {
14
15
  if (!e.type.startsWith("image/")) return;
15
- let t = g.get(e);
16
- return t || (t = URL.createObjectURL(e), g.set(e, t)), t;
16
+ let t = m.get(e);
17
+ return t || (t = URL.createObjectURL(e), m.set(e, t)), t;
17
18
  }
18
- function _(e) {
19
- let t = g.get(e);
20
- t && (URL.revokeObjectURL(t), g.delete(e));
19
+ function g(e) {
20
+ let t = m.get(e);
21
+ t && (URL.revokeObjectURL(t), m.delete(e));
21
22
  }
22
- function v(e, t) {
23
+ function ie(e, t) {
23
24
  typeof e == "function" ? e(t) : e && (e.current = t);
24
25
  }
25
- var y = c(function({ multiple: c = !1, accept: g, maxSize: y, maxFiles: b, value: x, defaultValue: S = [], onChange: C, progress: w, disabled: T = !1, error: E = !1, id: D, name: te, describedBy: ne, ariaLabel: re, "aria-describedby": ie, "aria-label": ae, required: oe, onBlur: se, className: ce, locale: O = s, dropzoneLabel: le, dropzoneActiveLabel: ue, dropzoneHintLabel: de, maxSizeHint: fe, maxFilesHint: pe, filesLabel: me, progressLabel: he, removeFileLabel: k, tooLargeError: A, invalidTypeError: j, size: M }, N) {
26
- let P = e("fileUpload"), F = r(M), I = F === "sm" ? "sm" : F === "lg" ? "lg" : "md", L = x !== void 0, [R, z] = p(S), [B, V] = p(/* @__PURE__ */ new Map()), [H, U] = p(!1), W = f(/* @__PURE__ */ new Set()), G = f(null), ge = d(), K = D ?? `file-upload-${ge}`, q = L ? x : R;
27
- u(() => {
28
- q.forEach((e) => W.current.add(e));
29
- }, [q]), u(() => {
30
- let e = W.current;
26
+ var _ = o(function({ multiple: o = !1, accept: m, maxSize: _, maxFiles: v, value: y, defaultValue: b = [], onChange: x, progress: S, uploading: C = !1, uploadingLabel: ae, uploadingLabelVisible: oe = !1, disabled: w = !1, error: T = !1, id: se, name: ce, describedBy: le, ariaLabel: ue, "aria-describedby": de, "aria-label": fe, required: pe, onBlur: me, className: he, locale: E = ne, dropzoneLabel: ge, dropzoneActiveLabel: _e, dropzoneHintLabel: ve, maxSizeHint: ye, maxFilesHint: be, filesLabel: xe, progressLabel: D, removeFileLabel: O, tooLargeError: k, invalidTypeError: A, size: j }, M) {
27
+ let N = e("fileUpload"), P = i(j), F = P === "sm" ? "sm" : P === "lg" ? "lg" : "md", I = y !== void 0, [L, R] = u(b), [z, B] = u(/* @__PURE__ */ new Map()), [V, H] = u(!1), U = l(/* @__PURE__ */ new Set()), W = l(null), Se = re(), G = se ?? `file-upload-${Se}`, K = I ? y : L;
28
+ c(() => {
29
+ K.forEach((e) => U.current.add(e));
30
+ }, [K]), c(() => {
31
+ let e = U.current;
31
32
  return () => {
32
- e.forEach(_);
33
+ e.forEach(g);
33
34
  };
34
35
  }, []);
35
- let J = l((e) => {
36
- if (T) return;
37
- let t = Array.from(e), n = L ? x ?? [] : R, r = new Map(B), i = [...n];
36
+ let q = s((e) => {
37
+ if (w || C) return;
38
+ let t = Array.from(e), n = I ? y ?? [] : L, r = new Map(z), i = [...n];
38
39
  for (let e of t) {
39
- if (b !== void 0 && i.filter((e) => !r.has(e)).length >= b) break;
40
- let t = a(e, g, y, P("tooLarge", A), P("invalidType", j), O);
40
+ if (v !== void 0 && i.filter((e) => !r.has(e)).length >= v) break;
41
+ let t = te(e, m, _, N("tooLarge", k), N("invalidType", A), E);
41
42
  t && r.set(e, t), i.push(e);
42
43
  }
43
- V(r), L || z(i), C?.(i.filter((e) => !r.has(e)));
44
+ B(r), I || R(i), x?.(i.filter((e) => !r.has(e)));
44
45
  }, [
45
- T,
46
- g,
46
+ w,
47
+ C,
48
+ m,
49
+ _,
50
+ v,
51
+ I,
47
52
  y,
48
- b,
49
53
  L,
54
+ z,
50
55
  x,
51
- R,
52
- B,
53
- C,
54
- P,
56
+ N,
57
+ k,
55
58
  A,
56
- j,
57
- O
58
- ]), _e = l((e) => {
59
- let t = (L ? x ?? [] : R).filter((t) => t !== e), n = new Map(B);
60
- n.delete(e), _(e), V(n), L || z(t), C?.(t.filter((e) => !n.has(e))), G.current && (G.current.value = "");
59
+ E
60
+ ]), Ce = s((e) => {
61
+ if (C) return;
62
+ let t = (I ? y ?? [] : L).filter((t) => t !== e), n = new Map(z);
63
+ n.delete(e), g(e), B(n), I || R(t), x?.(t.filter((e) => !n.has(e))), W.current && (W.current.value = "");
61
64
  }, [
65
+ C,
66
+ I,
67
+ y,
62
68
  L,
63
- x,
64
- R,
65
- B,
66
- C
67
- ]), ve = (e) => {
68
- e.target.files && J(e.target.files);
69
- }, ye = (e) => {
70
- e.preventDefault(), T || U(!0);
71
- }, be = (e) => {
72
- e.preventDefault(), U(!1);
73
- }, Y = (e) => {
74
- e.preventDefault(), U(!1), !T && e.dataTransfer.files && J(e.dataTransfer.files);
75
- }, xe = () => {
76
- T || G.current?.click();
77
- }, Se = [
69
+ z,
70
+ x
71
+ ]), we = (e) => {
72
+ e.target.files && q(e.target.files);
73
+ }, Te = (e) => {
74
+ e.preventDefault(), !w && !C && H(!0);
75
+ }, Ee = (e) => {
76
+ e.preventDefault(), H(!1);
77
+ }, De = (e) => {
78
+ e.preventDefault(), H(!1), !w && !C && e.dataTransfer.files && q(e.dataTransfer.files);
79
+ }, Oe = () => {
80
+ !w && !C && W.current?.click();
81
+ }, J = [
78
82
  "file-upload",
79
- F === "md" ? "" : `file-upload--${F}`,
80
- H ? "file-upload--dragging" : "",
81
- E ? "file-upload--error" : "",
82
- T ? "file-upload--disabled" : "",
83
- q.length > 0 ? "file-upload--has-files" : "",
84
- ce ?? ""
85
- ].filter(Boolean).join(" "), X = `${K}-hint`, Ce = [ne ?? ie, X].filter(Boolean).join(" "), Z = P("dropzone", le), Q = P("dropzoneHint", de), $ = [];
86
- return g && $.push(g), y && $.push(P("maxSize", fe)(o(y, O))), c && b && $.push(P("maxFiles", pe)(b)), /* @__PURE__ */ h("div", {
87
- className: Se,
83
+ P === "md" ? "" : `file-upload--${P}`,
84
+ V ? "file-upload--dragging" : "",
85
+ T ? "file-upload--error" : "",
86
+ w ? "file-upload--disabled" : "",
87
+ C ? "file-upload--uploading" : "",
88
+ K.length > 0 ? "file-upload--has-files" : "",
89
+ he ?? ""
90
+ ].filter(Boolean).join(" "), Y = `${G}-hint`, ke = [le ?? de, Y].filter(Boolean).join(" "), X = N("dropzone", ge), Z = N("dropzoneHint", ve), Q = C ? N("uploading", ae) : "", Ae = C && oe, $ = [];
91
+ return m && $.push(m), _ && $.push(N("maxSize", ye)(a(_, E))), o && v && $.push(N("maxFiles", be)(v)), /* @__PURE__ */ p("div", {
92
+ className: J,
88
93
  children: [
89
- /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m("input", {
94
+ /* @__PURE__ */ f(n, { children: /* @__PURE__ */ f("input", {
90
95
  ref: (e) => {
91
- G.current = e, v(N, e);
96
+ W.current = e, ie(M, e);
92
97
  },
93
98
  type: "file",
94
- id: K,
95
- name: te,
96
- multiple: c,
97
- accept: g,
98
- disabled: T,
99
- required: oe,
100
- "aria-label": re ?? ae,
101
- "aria-describedby": Ce,
102
- "aria-invalid": E || void 0,
103
- onChange: ve,
104
- onBlur: se
99
+ id: G,
100
+ name: ce,
101
+ multiple: o,
102
+ accept: m,
103
+ disabled: w,
104
+ required: pe,
105
+ "aria-label": ue ?? fe,
106
+ "aria-describedby": ke,
107
+ "aria-invalid": T || void 0,
108
+ "aria-busy": C || void 0,
109
+ "aria-disabled": C || void 0,
110
+ onClick: C ? (e) => e.preventDefault() : void 0,
111
+ onChange: we,
112
+ onBlur: me
105
113
  }) }),
106
- /* @__PURE__ */ h("div", {
114
+ /* @__PURE__ */ f("div", {
107
115
  className: "file-upload__dropzone",
108
- onClick: xe,
109
- onDragOver: ye,
110
- onDragLeave: be,
111
- onDrop: Y,
116
+ onClick: Oe,
117
+ onDragOver: Te,
118
+ onDragLeave: Ee,
119
+ onDrop: De,
112
120
  "aria-hidden": "true",
113
- children: [
114
- /* @__PURE__ */ m(t, {
121
+ children: C ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
122
+ className: "file-upload__icon",
123
+ children: /* @__PURE__ */ f(r, {
124
+ size: F,
125
+ "aria-hidden": !0
126
+ })
127
+ }), Ae && /* @__PURE__ */ f("span", {
128
+ className: "file-upload__text",
129
+ children: Q
130
+ })] }) : /* @__PURE__ */ p(d, { children: [
131
+ /* @__PURE__ */ f(t, {
115
132
  name: "upload",
116
- size: I,
133
+ size: F,
117
134
  className: "file-upload__icon"
118
135
  }),
119
- /* @__PURE__ */ m("span", {
136
+ /* @__PURE__ */ f("span", {
120
137
  className: "file-upload__text",
121
- children: H ? P("dropzoneActive", ue) : Z
138
+ children: V ? N("dropzoneActive", _e) : X
122
139
  }),
123
- /* @__PURE__ */ m("span", {
140
+ /* @__PURE__ */ f("span", {
124
141
  className: "file-upload__text file-upload__text--secondary",
125
- children: Q
142
+ children: Z
126
143
  }),
127
- $.length > 0 && /* @__PURE__ */ m("span", {
144
+ $.length > 0 && /* @__PURE__ */ f("span", {
128
145
  className: "file-upload__subtext",
129
146
  children: $.join(" · ")
130
147
  })
131
- ]
148
+ ] })
132
149
  }),
133
- /* @__PURE__ */ m(n, {
134
- id: X,
150
+ /* @__PURE__ */ f(n, {
151
+ id: Y,
135
152
  children: [
153
+ X,
136
154
  Z,
137
- Q,
138
155
  ...$
139
156
  ].join(". ")
140
157
  }),
141
- q.length > 0 && /* @__PURE__ */ m("ul", {
158
+ C && /* @__PURE__ */ f(n, {
159
+ role: "status",
160
+ "aria-live": "polite",
161
+ "aria-atomic": "false",
162
+ children: Q
163
+ }),
164
+ K.length > 0 && /* @__PURE__ */ f("ul", {
142
165
  className: "file-upload__list",
143
- "aria-label": P("files", me),
144
- children: q.map((e, n) => {
145
- let r = B.get(e), i = ee(e);
146
- return /* @__PURE__ */ h("li", {
166
+ "aria-label": N("files", xe),
167
+ children: K.map((e, n) => {
168
+ let r = z.get(e), i = h(e);
169
+ return /* @__PURE__ */ p("li", {
147
170
  className: `file-upload__item${r ? " file-upload__item--error" : ""}`,
148
171
  children: [
149
- /* @__PURE__ */ m("div", {
172
+ /* @__PURE__ */ f("div", {
150
173
  className: "file-upload__item-thumb",
151
174
  "aria-hidden": "true",
152
- children: i ? /* @__PURE__ */ m("img", {
175
+ children: i ? /* @__PURE__ */ f("img", {
153
176
  src: i,
154
177
  alt: ""
155
- }) : /* @__PURE__ */ m(t, {
178
+ }) : /* @__PURE__ */ f(t, {
156
179
  name: "file-text",
157
180
  size: "sm"
158
181
  })
159
182
  }),
160
- /* @__PURE__ */ h("div", {
183
+ /* @__PURE__ */ p("div", {
161
184
  className: "file-upload__item-info",
162
185
  children: [
163
- /* @__PURE__ */ m("span", {
186
+ /* @__PURE__ */ f("span", {
164
187
  className: "file-upload__item-name",
165
188
  children: e.name
166
189
  }),
167
- /* @__PURE__ */ m("span", {
190
+ /* @__PURE__ */ f("span", {
168
191
  className: "file-upload__item-size",
169
- children: o(e.size, O)
192
+ children: a(e.size, E)
170
193
  }),
171
- r && /* @__PURE__ */ m("span", {
194
+ r && /* @__PURE__ */ f("span", {
172
195
  className: "file-upload__item-error-msg",
173
196
  role: "alert",
174
197
  children: r
175
198
  })
176
199
  ]
177
200
  }),
178
- /* @__PURE__ */ m("button", {
201
+ /* @__PURE__ */ f("button", {
179
202
  className: "file-upload__item-remove",
180
203
  type: "button",
181
- onClick: () => _e(e),
182
- "aria-label": P("removeFile", k)(e.name),
183
- children: /* @__PURE__ */ m(t, {
204
+ onClick: () => Ce(e),
205
+ "aria-disabled": C || void 0,
206
+ "aria-label": N("removeFile", O)(e.name),
207
+ children: /* @__PURE__ */ f(t, {
184
208
  name: "close",
185
209
  size: "sm"
186
210
  })
@@ -189,9 +213,9 @@ var y = c(function({ multiple: c = !1, accept: g, maxSize: y, maxFiles: b, value
189
213
  }, `${e.name}-${e.size}-${n}`);
190
214
  })
191
215
  }),
192
- w !== void 0 && /* @__PURE__ */ m(i, {
193
- value: w,
194
- label: P("progress", he),
216
+ S !== void 0 && /* @__PURE__ */ f(ee, {
217
+ value: S,
218
+ label: N("progress", D),
195
219
  size: "sm",
196
220
  className: "file-upload__progress"
197
221
  })
@@ -199,4 +223,4 @@ var y = c(function({ multiple: c = !1, accept: g, maxSize: y, maxFiles: b, value
199
223
  });
200
224
  });
201
225
  //#endregion
202
- export { y as FileUpload };
226
+ export { _ as FileUpload };
@@ -1 +1 @@
1
- .loading-state{justify-content:center;align-items:center;gap:var(--loading-state-gap);block-size:100%;min-block-size:var(--loading-state-min-block-size);padding-block:var(--loading-state-padding-block);padding-inline:var(--loading-state-padding-inline);text-align:center;flex-direction:column;flex:auto;display:flex}.loading-state__spinner{color:var(--loading-state-spinner-color);display:flex}.loading-state.loading-state--sm{min-block-size:var(--loading-state-sm-min-block-size);padding-block:var(--loading-state-sm-padding-block)}.loading-state.loading-state--fill{min-block-size:calc(100dvh - var(--app-shell-chrome-block-start,0px) - 2 * var(--section-padding-block-lg))}
1
+ .loading-state{justify-content:center;align-items:center;gap:var(--loading-state-gap);block-size:100%;min-block-size:var(--loading-state-min-block-size);padding-block:var(--loading-state-padding-block);padding-inline:var(--loading-state-padding-inline);text-align:center;flex-direction:column;flex:auto;display:flex}.loading-state__spinner{color:var(--loading-state-spinner-color);display:flex}.loading-state__label{font-family:var(--loading-state-label-font-family);font-size:var(--loading-state-label-font-size);color:var(--loading-state-label-color);margin-block:0;margin-inline:0}.loading-state.loading-state--sm .loading-state__label{font-size:var(--loading-state-sm-label-font-size)}.loading-state.loading-state--sm{min-block-size:var(--loading-state-sm-min-block-size);padding-block:var(--loading-state-sm-padding-block)}.loading-state.loading-state--fill{min-block-size:calc(100dvh - var(--app-shell-chrome-block-start,0px) - 2 * var(--section-padding-block-lg))}
@@ -7,37 +7,43 @@ import { Button as r } from "./button.js";
7
7
  import { useId as i } from "react";
8
8
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
9
9
  //#region src/stories/molecules/LoadingState/LoadingState.tsx
10
- function s({ label: s, size: c = "md", fill: l = !1, action: u, className: d, ...f }) {
11
- let p = e("spinner"), m = i(), h = p("label", s);
10
+ function s({ label: s, labelVisible: c = !1, size: l = "md", fill: u = !1, action: d, className: f, ...p }) {
11
+ let m = e("spinner"), h = i(), g = m("label", s), _ = c && !!s;
12
12
  return /* @__PURE__ */ o("div", {
13
13
  className: [
14
14
  "loading-state",
15
- c === "sm" ? "loading-state--sm" : "",
16
- l ? "loading-state--fill" : "",
17
- d
15
+ l === "sm" ? "loading-state--sm" : "",
16
+ u ? "loading-state--fill" : "",
17
+ f
18
18
  ].filter(Boolean).join(" "),
19
19
  role: "status",
20
20
  "aria-busy": "true",
21
- "aria-labelledby": m,
22
- ...f,
21
+ "aria-labelledby": h,
22
+ "aria-live": "polite",
23
+ "aria-atomic": "false",
24
+ ...p,
23
25
  children: [
24
26
  /* @__PURE__ */ a("span", {
25
27
  className: "loading-state__spinner",
26
28
  children: /* @__PURE__ */ a(n, {
27
- size: c === "sm" ? "md" : "lg",
29
+ size: l === "sm" ? "md" : "lg",
28
30
  "aria-hidden": !0
29
31
  })
30
32
  }),
31
- /* @__PURE__ */ a(t, {
32
- id: m,
33
- children: h
33
+ _ ? /* @__PURE__ */ a("p", {
34
+ id: h,
35
+ className: "loading-state__label",
36
+ children: g
37
+ }) : /* @__PURE__ */ a(t, {
38
+ id: h,
39
+ children: g
34
40
  }),
35
- u && /* @__PURE__ */ a(r, {
41
+ d && /* @__PURE__ */ a(r, {
36
42
  variant: "outline",
37
- size: c === "sm" ? "sm" : "md",
38
- onClick: u.onClick,
39
- href: u.href,
40
- children: u.label
43
+ size: l === "sm" ? "sm" : "md",
44
+ onClick: d.onClick,
45
+ href: d.href,
46
+ children: d.label
41
47
  })
42
48
  ]
43
49
  });