@studiolxd/brand 49.26.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ El paquete sigue [semver](https://semver.org/lang/es/): **patch** para bug fixes
7
7
  regeneración de `dist`, **minor** para componentes/props/variantes/tokens nuevos, **major**
8
8
  para breaking changes.
9
9
 
10
+ ## [49.27.0] — 2026-10-05
11
+
12
+ > **Minor (49.27.0).** «Subiendo…» pasa a ser texto del catálogo de brand. **Atención:** `fileUpload.uploading`
13
+ > es una clave nueva y obligatoria de `BrandMessages`: cada aplicación debe añadirla a su catálogo (es, en, fr…).
14
+
15
+ ### `FileUpload` / `FileUploadField` — texto de la subida por defecto
16
+
17
+ - Clave nueva **`fileUpload.uploading`** («Subiendo…» / «Uploading…»). `uploading` sin `uploadingLabel` anuncia
18
+ ese texto (antes salía de `spinner.label`, «Cargando…»).
19
+ - `uploadingLabelVisible` sin `uploadingLabel` propio **pinta** el texto del catálogo (antes no pintaba nada).
20
+ - Las fixtures de Storybook (es) y de tests (en) llevan la clave nueva.
21
+
10
22
  ## [49.26.0] — 2026-10-05
11
23
 
12
24
  > **Minor (49.26.0).** `LoadingState` puede pintar su texto en esperas largas con pasos. Sin cambios
@@ -34,6 +34,8 @@ export interface FileUploadMessages {
34
34
  tooLarge: (maxSize: string) => string;
35
35
  /** Error de tipo de archivo no admitido. */
36
36
  invalidType: string;
37
+ /** Texto de la subida en curso («Subiendo…»): lo anuncia el lector y, con `uploadingLabelVisible`, se pinta en la zona. */
38
+ uploading: string;
37
39
  }
38
40
  export interface FileUploadProps {
39
41
  multiple?: boolean;
@@ -57,13 +59,13 @@ export interface FileUploadProps {
57
59
  /**
58
60
  * Texto de la subida en curso («Subiendo 2 de 5…»). **No se ve** salvo con
59
61
  * `uploadingLabelVisible`: es lo que anuncia el lector de pantalla. **Sin
60
- * default**: sin él, sale de `spinner.label` del `BrandMessagesProvider`.
62
+ * default**: sin él, sale de `fileUpload.uploading` del `BrandMessagesProvider`.
61
63
  */
62
64
  uploadingLabel?: string;
63
65
  /**
64
66
  * Pinta `uploadingLabel` en la zona, bajo el girador, para subidas largas con
65
- * progreso por pasos. **Sin `uploadingLabel` propio no pinta nada**: el
66
- * texto genérico del catálogo no se ve nunca. Default `false`.
67
+ * progreso por pasos. Sin `uploadingLabel` propio pinta el texto del catálogo
68
+ * (`fileUpload.uploading`, «Subiendo…»). Default `false`.
67
69
  */
68
70
  uploadingLabelVisible?: boolean;
69
71
  disabled?: boolean;
@@ -6,148 +6,148 @@ import { VisuallyHidden as n } from "./visually-hidden.js";
6
6
  import { Spinner as r } from "./spinner.js";
7
7
  import { n as i } from "./_shared/form-size.js";
8
8
  import { t as ee } from "./_shared/progressbar.js";
9
- import { i as te, n as a, t as o } from "./_shared/validate.js";
10
- import { forwardRef as s, useCallback as c, useEffect as l, useId as ne, useRef as u, useState as d } from "react";
11
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
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";
12
12
  //#region src/stories/atoms/FileUpload/FileUpload.tsx
13
- var h = /* @__PURE__ */ new WeakMap();
14
- function g(e) {
13
+ var m = /* @__PURE__ */ new WeakMap();
14
+ function h(e) {
15
15
  if (!e.type.startsWith("image/")) return;
16
- let t = h.get(e);
17
- return t || (t = URL.createObjectURL(e), h.set(e, t)), t;
16
+ let t = m.get(e);
17
+ return t || (t = URL.createObjectURL(e), m.set(e, t)), t;
18
18
  }
19
- function _(e) {
20
- let t = h.get(e);
21
- t && (URL.revokeObjectURL(t), h.delete(e));
19
+ function g(e) {
20
+ let t = m.get(e);
21
+ t && (URL.revokeObjectURL(t), m.delete(e));
22
22
  }
23
- function re(e, t) {
23
+ function ie(e, t) {
24
24
  typeof e == "function" ? e(t) : e && (e.current = t);
25
25
  }
26
- var v = s(function({ multiple: s = !1, accept: h, maxSize: v, maxFiles: y, value: b, defaultValue: ie = [], onChange: x, progress: S, uploading: C = !1, uploadingLabel: w, uploadingLabelVisible: ae = !1, disabled: T = !1, error: E = !1, id: oe, name: se, describedBy: ce, ariaLabel: le, "aria-describedby": ue, "aria-label": de, required: fe, onBlur: pe, className: me, locale: D = o, dropzoneLabel: he, dropzoneActiveLabel: ge, dropzoneHintLabel: _e, maxSizeHint: ve, maxFilesHint: ye, filesLabel: be, progressLabel: xe, removeFileLabel: O, tooLargeError: k, invalidTypeError: A, size: j }, M) {
27
- let N = e("fileUpload"), Se = e("spinner"), P = i(j), F = P === "sm" ? "sm" : P === "lg" ? "lg" : "md", I = b !== void 0, [L, R] = d(ie), [z, B] = d(/* @__PURE__ */ new Map()), [V, H] = d(!1), U = u(/* @__PURE__ */ new Set()), W = u(null), Ce = ne(), G = oe ?? `file-upload-${Ce}`, K = I ? b : L;
28
- l(() => {
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
29
  K.forEach((e) => U.current.add(e));
30
- }, [K]), l(() => {
30
+ }, [K]), c(() => {
31
31
  let e = U.current;
32
32
  return () => {
33
- e.forEach(_);
33
+ e.forEach(g);
34
34
  };
35
35
  }, []);
36
- let q = c((e) => {
37
- if (T || C) return;
38
- let t = Array.from(e), n = I ? b ?? [] : L, r = new Map(z), 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];
39
39
  for (let e of t) {
40
- if (y !== void 0 && i.filter((e) => !r.has(e)).length >= y) break;
41
- let t = te(e, h, v, N("tooLarge", k), N("invalidType", A), D);
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);
42
42
  t && r.set(e, t), i.push(e);
43
43
  }
44
44
  B(r), I || R(i), x?.(i.filter((e) => !r.has(e)));
45
45
  }, [
46
- T,
46
+ w,
47
47
  C,
48
- h,
48
+ m,
49
+ _,
49
50
  v,
50
- y,
51
51
  I,
52
- b,
52
+ y,
53
53
  L,
54
54
  z,
55
55
  x,
56
56
  N,
57
57
  k,
58
58
  A,
59
- D
60
- ]), we = c((e) => {
59
+ E
60
+ ]), Ce = s((e) => {
61
61
  if (C) return;
62
- let t = (I ? b ?? [] : L).filter((t) => t !== e), n = new Map(z);
63
- n.delete(e), _(e), B(n), I || R(t), x?.(t.filter((e) => !n.has(e))), W.current && (W.current.value = "");
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 = "");
64
64
  }, [
65
65
  C,
66
66
  I,
67
- b,
67
+ y,
68
68
  L,
69
69
  z,
70
70
  x
71
- ]), Te = (e) => {
71
+ ]), we = (e) => {
72
72
  e.target.files && q(e.target.files);
73
+ }, Te = (e) => {
74
+ e.preventDefault(), !w && !C && H(!0);
73
75
  }, Ee = (e) => {
74
- e.preventDefault(), !T && !C && H(!0);
75
- }, De = (e) => {
76
76
  e.preventDefault(), H(!1);
77
- }, Oe = (e) => {
78
- e.preventDefault(), H(!1), !T && !C && e.dataTransfer.files && q(e.dataTransfer.files);
79
- }, J = () => {
80
- !T && !C && W.current?.click();
81
- }, ke = [
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 = [
82
82
  "file-upload",
83
83
  P === "md" ? "" : `file-upload--${P}`,
84
84
  V ? "file-upload--dragging" : "",
85
- E ? "file-upload--error" : "",
86
- T ? "file-upload--disabled" : "",
85
+ T ? "file-upload--error" : "",
86
+ w ? "file-upload--disabled" : "",
87
87
  C ? "file-upload--uploading" : "",
88
88
  K.length > 0 ? "file-upload--has-files" : "",
89
- me ?? ""
90
- ].filter(Boolean).join(" "), Y = `${G}-hint`, Ae = [ce ?? ue, Y].filter(Boolean).join(" "), X = N("dropzone", he), Z = N("dropzoneHint", _e), Q = C ? Se("label", w) : "", je = C && ae && !!w, $ = [];
91
- return h && $.push(h), v && $.push(N("maxSize", ve)(a(v, D))), s && y && $.push(N("maxFiles", ye)(y)), /* @__PURE__ */ m("div", {
92
- className: ke,
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,
93
93
  children: [
94
- /* @__PURE__ */ p(n, { children: /* @__PURE__ */ p("input", {
94
+ /* @__PURE__ */ f(n, { children: /* @__PURE__ */ f("input", {
95
95
  ref: (e) => {
96
- W.current = e, re(M, e);
96
+ W.current = e, ie(M, e);
97
97
  },
98
98
  type: "file",
99
99
  id: G,
100
- name: se,
101
- multiple: s,
102
- accept: h,
103
- disabled: T,
104
- required: fe,
105
- "aria-label": le ?? de,
106
- "aria-describedby": Ae,
107
- "aria-invalid": E || void 0,
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
108
  "aria-busy": C || void 0,
109
109
  "aria-disabled": C || void 0,
110
110
  onClick: C ? (e) => e.preventDefault() : void 0,
111
- onChange: Te,
112
- onBlur: pe
111
+ onChange: we,
112
+ onBlur: me
113
113
  }) }),
114
- /* @__PURE__ */ p("div", {
114
+ /* @__PURE__ */ f("div", {
115
115
  className: "file-upload__dropzone",
116
- onClick: J,
117
- onDragOver: Ee,
118
- onDragLeave: De,
119
- onDrop: Oe,
116
+ onClick: Oe,
117
+ onDragOver: Te,
118
+ onDragLeave: Ee,
119
+ onDrop: De,
120
120
  "aria-hidden": "true",
121
- children: C ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
121
+ children: C ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
122
122
  className: "file-upload__icon",
123
- children: /* @__PURE__ */ p(r, {
123
+ children: /* @__PURE__ */ f(r, {
124
124
  size: F,
125
125
  "aria-hidden": !0
126
126
  })
127
- }), je && /* @__PURE__ */ p("span", {
127
+ }), Ae && /* @__PURE__ */ f("span", {
128
128
  className: "file-upload__text",
129
129
  children: Q
130
- })] }) : /* @__PURE__ */ m(f, { children: [
131
- /* @__PURE__ */ p(t, {
130
+ })] }) : /* @__PURE__ */ p(d, { children: [
131
+ /* @__PURE__ */ f(t, {
132
132
  name: "upload",
133
133
  size: F,
134
134
  className: "file-upload__icon"
135
135
  }),
136
- /* @__PURE__ */ p("span", {
136
+ /* @__PURE__ */ f("span", {
137
137
  className: "file-upload__text",
138
- children: V ? N("dropzoneActive", ge) : X
138
+ children: V ? N("dropzoneActive", _e) : X
139
139
  }),
140
- /* @__PURE__ */ p("span", {
140
+ /* @__PURE__ */ f("span", {
141
141
  className: "file-upload__text file-upload__text--secondary",
142
142
  children: Z
143
143
  }),
144
- $.length > 0 && /* @__PURE__ */ p("span", {
144
+ $.length > 0 && /* @__PURE__ */ f("span", {
145
145
  className: "file-upload__subtext",
146
146
  children: $.join(" · ")
147
147
  })
148
148
  ] })
149
149
  }),
150
- /* @__PURE__ */ p(n, {
150
+ /* @__PURE__ */ f(n, {
151
151
  id: Y,
152
152
  children: [
153
153
  X,
@@ -155,56 +155,56 @@ var v = s(function({ multiple: s = !1, accept: h, maxSize: v, maxFiles: y, value
155
155
  ...$
156
156
  ].join(". ")
157
157
  }),
158
- C && /* @__PURE__ */ p(n, {
158
+ C && /* @__PURE__ */ f(n, {
159
159
  role: "status",
160
160
  "aria-live": "polite",
161
161
  "aria-atomic": "false",
162
162
  children: Q
163
163
  }),
164
- K.length > 0 && /* @__PURE__ */ p("ul", {
164
+ K.length > 0 && /* @__PURE__ */ f("ul", {
165
165
  className: "file-upload__list",
166
- "aria-label": N("files", be),
166
+ "aria-label": N("files", xe),
167
167
  children: K.map((e, n) => {
168
- let r = z.get(e), i = g(e);
169
- return /* @__PURE__ */ m("li", {
168
+ let r = z.get(e), i = h(e);
169
+ return /* @__PURE__ */ p("li", {
170
170
  className: `file-upload__item${r ? " file-upload__item--error" : ""}`,
171
171
  children: [
172
- /* @__PURE__ */ p("div", {
172
+ /* @__PURE__ */ f("div", {
173
173
  className: "file-upload__item-thumb",
174
174
  "aria-hidden": "true",
175
- children: i ? /* @__PURE__ */ p("img", {
175
+ children: i ? /* @__PURE__ */ f("img", {
176
176
  src: i,
177
177
  alt: ""
178
- }) : /* @__PURE__ */ p(t, {
178
+ }) : /* @__PURE__ */ f(t, {
179
179
  name: "file-text",
180
180
  size: "sm"
181
181
  })
182
182
  }),
183
- /* @__PURE__ */ m("div", {
183
+ /* @__PURE__ */ p("div", {
184
184
  className: "file-upload__item-info",
185
185
  children: [
186
- /* @__PURE__ */ p("span", {
186
+ /* @__PURE__ */ f("span", {
187
187
  className: "file-upload__item-name",
188
188
  children: e.name
189
189
  }),
190
- /* @__PURE__ */ p("span", {
190
+ /* @__PURE__ */ f("span", {
191
191
  className: "file-upload__item-size",
192
- children: a(e.size, D)
192
+ children: a(e.size, E)
193
193
  }),
194
- r && /* @__PURE__ */ p("span", {
194
+ r && /* @__PURE__ */ f("span", {
195
195
  className: "file-upload__item-error-msg",
196
196
  role: "alert",
197
197
  children: r
198
198
  })
199
199
  ]
200
200
  }),
201
- /* @__PURE__ */ p("button", {
201
+ /* @__PURE__ */ f("button", {
202
202
  className: "file-upload__item-remove",
203
203
  type: "button",
204
- onClick: () => we(e),
204
+ onClick: () => Ce(e),
205
205
  "aria-disabled": C || void 0,
206
206
  "aria-label": N("removeFile", O)(e.name),
207
- children: /* @__PURE__ */ p(t, {
207
+ children: /* @__PURE__ */ f(t, {
208
208
  name: "close",
209
209
  size: "sm"
210
210
  })
@@ -213,9 +213,9 @@ var v = s(function({ multiple: s = !1, accept: h, maxSize: v, maxFiles: y, value
213
213
  }, `${e.name}-${e.size}-${n}`);
214
214
  })
215
215
  }),
216
- S !== void 0 && /* @__PURE__ */ p(ee, {
216
+ S !== void 0 && /* @__PURE__ */ f(ee, {
217
217
  value: S,
218
- label: N("progress", xe),
218
+ label: N("progress", D),
219
219
  size: "sm",
220
220
  className: "file-upload__progress"
221
221
  })
@@ -223,4 +223,4 @@ var v = s(function({ multiple: s = !1, accept: h, maxSize: v, maxFiles: y, value
223
223
  });
224
224
  });
225
225
  //#endregion
226
- export { v as FileUpload };
226
+ export { _ as FileUpload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiolxd/brand",
3
- "version": "49.26.0",
3
+ "version": "49.27.0",
4
4
  "description": "El sistema de diseño de Studio LXD: componentes React, tokens y documentación de la suite SLXD.",
5
5
  "repository": {
6
6
  "type": "git",