@studiolxd/brand 38.17.0 → 40.0.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 +141 -0
- package/dist/_shared/brandmessagescontext.js +15 -0
- package/dist/_shared/calendargrid.js +42 -42
- package/dist/_shared/datepicker.js +41 -41
- package/dist/_shared/imagecropdialog.js +54 -54
- package/dist/_shared/tokens.js +4 -0
- package/dist/_types/atoms/StarRating/StarRating.d.ts +87 -30
- package/dist/_types/messages/BrandMessages.d.ts +26 -0
- package/dist/_types/messages/BrandMessagesContext.d.ts +21 -0
- package/dist/_types/messages/BrandMessagesProvider.d.ts +46 -0
- package/dist/_types/messages/index.d.ts +5 -0
- package/dist/_types/molecules/Card/Card.d.ts +12 -1
- package/dist/_types/molecules/ConfirmDialog/ConfirmDialog.d.ts +42 -2
- package/dist/_types/molecules/Pagination/Pagination.d.ts +40 -23
- package/dist/_types/organisms/DataTable/DataTable.d.ts +3 -2
- package/dist/accordion.js +26 -26
- package/dist/alert.js +26 -26
- package/dist/annotation-thread.js +1 -1
- package/dist/app-header.js +8 -8
- package/dist/app-launcher.js +34 -34
- package/dist/app-shell.js +14 -14
- package/dist/assistant-message.js +8 -8
- package/dist/async-multi-select-field.js +9 -9
- package/dist/async-multi-select.js +40 -40
- package/dist/async-select-field.js +9 -9
- package/dist/async-select.js +64 -64
- package/dist/avatar-upload.js +40 -40
- package/dist/avatar.js +5 -5
- package/dist/banner.js +9 -9
- package/dist/brand.css +11 -2
- package/dist/button.js +7 -7
- package/dist/calendar-planner.js +16 -16
- package/dist/calendar.js +38 -38
- package/dist/card.js +28 -29
- package/dist/carousel.js +19 -19
- package/dist/chart.js +137 -137
- package/dist/chat-shell.js +23 -23
- package/dist/checkbox-field.js +11 -11
- package/dist/checkbox.js +7 -7
- package/dist/close-button.js +6 -6
- package/dist/code-block.js +15 -15
- package/dist/code.js +5 -5
- package/dist/collapsible.js +1 -1
- package/dist/columns.js +7 -7
- package/dist/command-palette.js +14 -14
- package/dist/confirm-dialog.css +1 -1
- package/dist/confirm-dialog.js +65 -42
- package/dist/connector-auth-shell.js +9 -9
- package/dist/consent.js +23 -23
- package/dist/container.js +6 -6
- package/dist/conversation-list.js +19 -19
- package/dist/conversation-thread.js +15 -15
- package/dist/copy-button.js +9 -9
- package/dist/copyable-value.js +17 -17
- package/dist/data-table.js +29 -29
- package/dist/date-picker-field.js +9 -9
- package/dist/date-time-field.js +12 -12
- package/dist/description-list.js +12 -12
- package/dist/docs-search.js +1 -1
- package/dist/dots-button.js +7 -7
- package/dist/dropdown-field.js +13 -13
- package/dist/email.js +44 -44
- package/dist/error-text.js +4 -4
- package/dist/field-row.js +20 -20
- package/dist/figure.js +8 -8
- package/dist/file-upload-field.js +9 -9
- package/dist/file-upload.js +29 -29
- package/dist/filter-bar.js +10 -10
- package/dist/floating-dock.js +17 -17
- package/dist/form-field.js +43 -43
- package/dist/form.js +14 -14
- package/dist/heading.js +5 -5
- package/dist/input-field.js +20 -20
- package/dist/input-phone-field.js +9 -9
- package/dist/input-phone.js +19 -19
- package/dist/input.js +5 -5
- package/dist/kbd.js +5 -5
- package/dist/label.js +5 -5
- package/dist/link.js +7 -7
- package/dist/list.js +7 -7
- package/dist/menu-button.js +7 -7
- package/dist/message-bubble.js +5 -5
- package/dist/message-composer.js +13 -13
- package/dist/messages.js +12 -0
- package/dist/multi-select-field.js +9 -9
- package/dist/multi-select.js +52 -52
- package/dist/notification-button.js +8 -8
- package/dist/notification-panel.js +25 -25
- package/dist/number-input-field.js +9 -9
- package/dist/number-input.js +11 -11
- package/dist/otp-field.js +9 -9
- package/dist/otp-input.js +48 -48
- package/dist/pagination.js +92 -89
- package/dist/paragraph.js +5 -5
- package/dist/password-field.js +15 -15
- package/dist/prose.js +4 -4
- package/dist/public-page-shell.js +11 -11
- package/dist/radio-field.js +11 -11
- package/dist/radio-group.js +5 -5
- package/dist/radio.js +5 -5
- package/dist/scroll-area.js +11 -11
- package/dist/search-form.js +8 -8
- package/dist/select-field.js +9 -9
- package/dist/select.js +85 -85
- package/dist/separator.js +6 -6
- package/dist/sidebar.js +16 -16
- package/dist/site-header.js +14 -14
- package/dist/site-shell.js +6 -6
- package/dist/sparkline.js +9 -9
- package/dist/star-rating.css +1 -1
- package/dist/star-rating.js +55 -41
- package/dist/stat-tile.js +12 -12
- package/dist/steps.js +32 -32
- package/dist/switcher-field.js +13 -13
- package/dist/switcher.js +8 -8
- package/dist/table-of-contents.js +14 -14
- package/dist/tag.js +5 -5
- package/dist/text.js +7 -7
- package/dist/textarea-field.js +11 -11
- package/dist/textarea.js +5 -5
- package/dist/time-field.js +9 -9
- package/dist/time-select.js +17 -17
- package/dist/toaster.js +16 -16
- package/dist/toggle-group.js +7 -7
- package/dist/toggle.js +5 -5
- package/dist/tokens.css +11 -2
- package/dist/tooltip.js +16 -16
- package/dist/tree-view.js +41 -41
- package/dist/uptime-bars.js +34 -34
- package/dist/user-message.js +8 -8
- package/dist/visually-hidden.js +5 -5
- package/package.json +5 -1
- package/src/tokens/components/description-list.css +1 -1
- package/src/tokens/components/star-rating.css +5 -0
- package/src/tokens/molecules/confirm-dialog.css +1 -0
- package/src/tokens/scss/components/_description-list.scss +1 -1
- package/src/tokens/scss/components/_star-rating.scss +3 -0
- package/src/tokens/scss/molecules/_confirm-dialog.scss +1 -0
- package/src/tokens/surface-invert.css +2 -0
- package/src/tokens/surface-public.css +1 -0
- package/src/tokens/tokens.json +4 -0
package/dist/avatar-upload.js
CHANGED
|
@@ -7,30 +7,30 @@ import { Button as r } from "./button.js";
|
|
|
7
7
|
import { Avatar as i } from "./avatar.js";
|
|
8
8
|
import { ErrorText as ee } from "./error-text.js";
|
|
9
9
|
import { n as te, t as a } from "./_shared/validate.js";
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { t as ne } from "./_shared/env.js";
|
|
11
|
+
import { t as re } from "./_shared/imagecropdialog.js";
|
|
12
|
+
import { useCallback as ie, useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
13
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
14
14
|
//#region src/stories/molecules/AvatarUpload/AvatarUpload.tsx
|
|
15
|
-
var
|
|
15
|
+
var ae = {
|
|
16
16
|
sm: "2xl",
|
|
17
17
|
md: "3xl",
|
|
18
18
|
lg: "4xl"
|
|
19
|
-
},
|
|
19
|
+
}, f = {
|
|
20
20
|
sm: "md",
|
|
21
21
|
md: "lg",
|
|
22
22
|
lg: "xl"
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function p(e) {
|
|
25
25
|
return e.split(",").map((e) => e.trim()).filter(Boolean).map((e) => e.startsWith(".") ? e.slice(1) : e.split("/")[1] ?? e).map((e) => e.toUpperCase()).join(", ");
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let I = n(
|
|
29
|
-
|
|
27
|
+
function m({ src: m, name: oe, alt: h, shape: g = "circle", size: se, accept: _ = "image/jpeg,image/png,image/webp", maxSize: v, outputMimeType: y = "image/jpeg", outputSize: b, disabled: x = !1, busy: S = !1, errorMessage: ce, onChange: le, onSelect: C, onError: w, buttonLabel: T = "Subir", buttonAccessibleLabel: ue, hintLabel: de, formatsLabel: fe, maxSizeHint: pe = (e) => `máx. ${e}`, invalidTypeError: E = (e) => `Formato no admitido. Se aceptan ${e}.`, tooLargeError: D = (e) => `El archivo pesa demasiado. El máximo es ${e}.`, dropActiveMessage: me = "Suelta la imagen sobre el avatar para subirla", dropHintLabel: O = "…o arrastra la imagen hasta el avatar", cropTitle: he = "Recortar imagen", cropDescription: k, cropCancelLabel: A = "Cancelar", cropConfirmLabel: j = "Guardar", cropCloseLabel: M = "Cerrar", cropLoadingLabel: N, cropErrorMessage: P, className: F }) {
|
|
28
|
+
let I = n(se), L = c(null), R = c(null), [z, B] = l(null), [V, H] = l(!1), [ge, U] = l(!1), [_e, W] = l(null), G = s(), K = `${G}-hint`, q = `${G}-error`, J = fe ?? p(_), Y = de ?? [J, v === void 0 ? null : pe(a(v))].filter(Boolean).join(" · "), X = _e ?? ce, Z = x || S, Q = ue ?? T;
|
|
29
|
+
ne() && !Q.toLowerCase().includes(T.toLowerCase()) && console.warn(`[AvatarUpload] El nombre accesible del botón ("${Q}") no contiene su texto visible ("${T}"). WCAG 2.5.3 (Label in Name) lo exige: quien navega por voz dice lo que ve, y con estos textos no encontraría el control.`), o(() => {
|
|
30
30
|
R.current = z;
|
|
31
|
-
}, [z]),
|
|
31
|
+
}, [z]), o(() => () => {
|
|
32
32
|
R.current && URL.revokeObjectURL(R.current.url);
|
|
33
|
-
}, []),
|
|
33
|
+
}, []), o(() => {
|
|
34
34
|
if (Z) return;
|
|
35
35
|
let e = 0, t = (e) => Array.from(e.dataTransfer?.types ?? []).includes("Files"), n = (n) => {
|
|
36
36
|
t(n) && (e += 1, H(!0));
|
|
@@ -43,8 +43,8 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
43
43
|
window.removeEventListener("dragenter", n), window.removeEventListener("dragleave", r), window.removeEventListener("drop", i), window.removeEventListener("dragend", i), H(!1);
|
|
44
44
|
};
|
|
45
45
|
}, [Z]);
|
|
46
|
-
let $ =
|
|
47
|
-
let t = te(e,
|
|
46
|
+
let $ = ie((e) => {
|
|
47
|
+
let t = te(e, _, v, D, E(J));
|
|
48
48
|
if (t) {
|
|
49
49
|
W(t), w?.(t);
|
|
50
50
|
return;
|
|
@@ -54,8 +54,8 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
54
54
|
file: e
|
|
55
55
|
});
|
|
56
56
|
}, [
|
|
57
|
+
_,
|
|
57
58
|
v,
|
|
58
|
-
y,
|
|
59
59
|
D,
|
|
60
60
|
E,
|
|
61
61
|
J,
|
|
@@ -66,17 +66,17 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
66
66
|
}, ye = async (e) => {
|
|
67
67
|
z && await le(e, z.file);
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ d("div", {
|
|
70
70
|
className: [
|
|
71
71
|
"avatar-upload",
|
|
72
|
-
|
|
72
|
+
g === "square" ? "avatar-upload--square" : "",
|
|
73
73
|
V ? "avatar-upload--armed" : "",
|
|
74
74
|
ge ? "avatar-upload--over" : "",
|
|
75
75
|
Z ? "avatar-upload--inert" : "",
|
|
76
76
|
F ?? ""
|
|
77
77
|
].filter(Boolean).join(" "),
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ d("div", {
|
|
80
80
|
className: "avatar-upload__target",
|
|
81
81
|
onClick: () => {
|
|
82
82
|
Z || L.current?.click();
|
|
@@ -95,29 +95,29 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
95
95
|
let t = e.dataTransfer.files?.[0];
|
|
96
96
|
t && $(t);
|
|
97
97
|
},
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
-
src:
|
|
100
|
-
name:
|
|
101
|
-
...
|
|
102
|
-
shape:
|
|
103
|
-
size:
|
|
104
|
-
}), /* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ u(i, {
|
|
99
|
+
src: m ?? void 0,
|
|
100
|
+
name: oe,
|
|
101
|
+
...h === void 0 ? {} : { alt: h },
|
|
102
|
+
shape: g,
|
|
103
|
+
size: ae[I]
|
|
104
|
+
}), /* @__PURE__ */ u("span", {
|
|
105
105
|
className: "avatar-upload__overlay",
|
|
106
106
|
"aria-hidden": "true",
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ u(e, {
|
|
108
108
|
name: "upload",
|
|
109
|
-
size:
|
|
109
|
+
size: f[I]
|
|
110
110
|
})
|
|
111
111
|
})]
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ d("div", {
|
|
114
114
|
className: "avatar-upload__body",
|
|
115
115
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ u("input", {
|
|
117
117
|
ref: L,
|
|
118
118
|
type: "file",
|
|
119
119
|
className: "avatar-upload__input",
|
|
120
|
-
accept:
|
|
120
|
+
accept: _,
|
|
121
121
|
tabIndex: -1,
|
|
122
122
|
"aria-hidden": "true",
|
|
123
123
|
disabled: Z,
|
|
@@ -126,7 +126,7 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
126
126
|
t && $(t), e.target.value = "";
|
|
127
127
|
}
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ u(r, {
|
|
130
130
|
variant: "outline",
|
|
131
131
|
size: I,
|
|
132
132
|
disabled: Z,
|
|
@@ -135,31 +135,31 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
135
135
|
"aria-describedby": [Y ? K : null, X ? q : null].filter(Boolean).join(" ") || void 0,
|
|
136
136
|
children: T
|
|
137
137
|
}),
|
|
138
|
-
Y && /* @__PURE__ */
|
|
138
|
+
Y && /* @__PURE__ */ u(t, {
|
|
139
139
|
id: K,
|
|
140
140
|
children: Y
|
|
141
141
|
}),
|
|
142
|
-
O && /* @__PURE__ */
|
|
142
|
+
O && /* @__PURE__ */ u("span", {
|
|
143
143
|
className: "avatar-upload__hint",
|
|
144
144
|
children: O
|
|
145
145
|
}),
|
|
146
|
-
X && /* @__PURE__ */
|
|
146
|
+
X && /* @__PURE__ */ u(ee, {
|
|
147
147
|
id: q,
|
|
148
148
|
children: X
|
|
149
149
|
})
|
|
150
150
|
]
|
|
151
151
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ u(t, {
|
|
153
153
|
role: "status",
|
|
154
154
|
children: V ? me : ""
|
|
155
155
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ u(re, {
|
|
157
157
|
sourceUrl: z?.url ?? null,
|
|
158
158
|
title: he,
|
|
159
159
|
description: k,
|
|
160
|
-
circularCrop:
|
|
161
|
-
outputMimeType:
|
|
162
|
-
...
|
|
160
|
+
circularCrop: g === "circle",
|
|
161
|
+
outputMimeType: y,
|
|
162
|
+
...b === void 0 ? {} : { outputSize: b },
|
|
163
163
|
busy: S,
|
|
164
164
|
cancelLabel: A,
|
|
165
165
|
confirmLabel: j,
|
|
@@ -173,4 +173,4 @@ function h({ src: h, name: ae, alt: g, shape: _ = "circle", size: oe, accept: v
|
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
|
-
export {
|
|
176
|
+
export { m as AvatarUpload };
|
package/dist/avatar.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './avatar.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useState as e } from "react";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
5
|
//#region src/stories/atoms/Avatar/Avatar.tsx
|
|
6
6
|
function n(e) {
|
|
7
7
|
let t = e.trim().split(/\s+/);
|
|
8
8
|
return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
9
9
|
}
|
|
10
10
|
function r({ src: r, alt: i, name: a, size: o = "md", shape: s = "circle", className: c }) {
|
|
11
|
-
let [l, u] =
|
|
11
|
+
let [l, u] = e(!1), d = [
|
|
12
12
|
"avatar",
|
|
13
13
|
`avatar--${o}`,
|
|
14
14
|
s === "square" ? "avatar--square" : "",
|
|
15
15
|
c
|
|
16
16
|
].filter(Boolean).join(" ");
|
|
17
|
-
if (r && !l) return /* @__PURE__ */
|
|
17
|
+
if (r && !l) return /* @__PURE__ */ t("img", {
|
|
18
18
|
src: r,
|
|
19
19
|
alt: i ?? a ?? "",
|
|
20
20
|
className: d,
|
|
21
21
|
onError: () => u(!0)
|
|
22
22
|
});
|
|
23
23
|
let f = i ?? a ?? "";
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ t("span", {
|
|
25
25
|
className: `${d} avatar--initials`,
|
|
26
26
|
...f ? {
|
|
27
27
|
role: "img",
|
package/dist/banner.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './banner.css';
|
|
3
3
|
import { CloseButton as e } from "./close-button.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t } from "react";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/molecules/Banner/Banner.tsx
|
|
7
|
-
var i =
|
|
7
|
+
var i = t(function({ variant: t = "info", children: i, actions: a, onDismiss: o, dismissLabel: s = "Descartar aviso", className: c, role: l, "aria-live": u, ...d }, f) {
|
|
8
8
|
let p = [
|
|
9
9
|
"banner",
|
|
10
|
-
`banner--${
|
|
11
|
-
|
|
10
|
+
`banner--${t}`,
|
|
11
|
+
t === "info" ? "surface-dark" : "",
|
|
12
12
|
o ? "banner--dismissible" : "",
|
|
13
13
|
c ?? ""
|
|
14
14
|
].filter(Boolean).join(" ");
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ r("div", {
|
|
16
16
|
ref: f,
|
|
17
17
|
role: l ?? "status",
|
|
18
18
|
"aria-live": u ?? "polite",
|
|
19
19
|
className: p,
|
|
20
20
|
...d,
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ n("div", {
|
|
23
23
|
className: "banner__content",
|
|
24
24
|
children: i
|
|
25
25
|
}),
|
|
26
|
-
a && /* @__PURE__ */
|
|
26
|
+
a && /* @__PURE__ */ n("div", {
|
|
27
27
|
className: "banner__actions",
|
|
28
28
|
children: a
|
|
29
29
|
}),
|
|
30
|
-
o && /* @__PURE__ */
|
|
30
|
+
o && /* @__PURE__ */ n(e, {
|
|
31
31
|
className: "banner__close",
|
|
32
32
|
label: s,
|
|
33
33
|
onClick: o
|