@studiolxd/brand 39.0.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 +62 -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/_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/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/button.js +7 -7
- package/dist/calendar-planner.js +16 -16
- package/dist/calendar.js +38 -38
- package/dist/card.js +28 -28
- 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.js +10 -10
- 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.js +24 -24
- 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/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
|
@@ -5,21 +5,21 @@ import { n as t } from "./_shared/form-size.js";
|
|
|
5
5
|
import { ErrorText as n } from "./error-text.js";
|
|
6
6
|
import { Label as r } from "./label.js";
|
|
7
7
|
import { n as i } from "./_shared/field-labels.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { forwardRef as a, useId as o } from "react";
|
|
9
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
10
|
//#region src/stories/molecules/AsyncSelectField/AsyncSelectField.tsx
|
|
11
|
-
var l =
|
|
12
|
-
let M = i(u), N = t(y), P =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var l = a(function({ id: a, label: l, labelHidden: u, onSearch: d, value: f, onValueChange: p, selectedOption: m, placeholder: h, name: g, disabled: _, readOnly: v, size: y, debounceMs: b, required: x, error: S = !1, errorMessage: C, helperText: w, className: T, emptyMessage: E, loadingLabel: D, clearLabel: O, container: k, onBlur: A }, j) {
|
|
12
|
+
let M = i(u), N = t(y), P = o(), F = a ?? P, I = C ? `${F}-error` : void 0, L = w ? `${F}-helper` : void 0, R = [I, L].filter(Boolean).join(" ") || void 0, z = S || !!C;
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
14
|
className: ["async-select-field", T].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ s(r, {
|
|
17
17
|
htmlFor: F,
|
|
18
18
|
hidden: M,
|
|
19
19
|
size: N,
|
|
20
20
|
children: l
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ s(e, {
|
|
23
23
|
ref: j,
|
|
24
24
|
id: F,
|
|
25
25
|
name: g,
|
|
@@ -41,11 +41,11 @@ var l = s(function({ id: s, label: l, labelHidden: u, onSearch: d, value: f, onV
|
|
|
41
41
|
"aria-describedby": R,
|
|
42
42
|
onBlur: A
|
|
43
43
|
}),
|
|
44
|
-
C && /* @__PURE__ */
|
|
44
|
+
C && /* @__PURE__ */ s(n, {
|
|
45
45
|
id: I,
|
|
46
46
|
children: C
|
|
47
47
|
}),
|
|
48
|
-
w && /* @__PURE__ */
|
|
48
|
+
w && /* @__PURE__ */ s("span", {
|
|
49
49
|
id: L,
|
|
50
50
|
className: "async-select-field__helper",
|
|
51
51
|
children: w
|
package/dist/async-select.js
CHANGED
|
@@ -2,159 +2,159 @@
|
|
|
2
2
|
import './async-select.css';
|
|
3
3
|
import { Icon as e } from "./icon.js";
|
|
4
4
|
import { Spinner as t } from "./spinner.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { forwardRef as n, useCallback as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
7
|
import { Popover as u } from "@base-ui/react/popover";
|
|
8
8
|
//#region src/stories/atoms/AsyncSelect/AsyncSelect.tsx
|
|
9
9
|
function ee(e, t) {
|
|
10
10
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
11
11
|
}
|
|
12
|
-
var d =
|
|
13
|
-
let [O, k] =
|
|
14
|
-
let t = ++
|
|
15
|
-
N(!0),
|
|
12
|
+
var d = n(function({ onSearch: n, value: d, onValueChange: f, selectedOption: p, placeholder: m = "Buscar…", disabled: h, readOnly: g, size: _ = "md", debounceMs: v = 300, id: y, name: b, error: x = !1, required: S, onBlur: C, className: w, "aria-label": T, "aria-describedby": E, emptyMessage: D = "Sin resultados", loadingLabel: te = "Buscando…", clearLabel: ne = "Limpiar selección", container: re }, ie) {
|
|
13
|
+
let [O, k] = s(!1), [A, j] = s(""), [M, N] = s(!1), [P, F] = s([]), [ae, I] = s(!1), [L, R] = s(-1), [z, B] = s(null), [V, H] = s(null), U = o(null), W = o(0), G = o(null), K = o(null), q = a(), oe = a(), J = d === void 0 ? z : d, se = p === void 0 ? V : p, Y = (e) => `${oe}-opt-${e}`, X = r(async (e) => {
|
|
14
|
+
let t = ++W.current;
|
|
15
|
+
N(!0), I(!1);
|
|
16
16
|
try {
|
|
17
|
-
let
|
|
18
|
-
if (t !==
|
|
19
|
-
F(
|
|
17
|
+
let r = await n(e);
|
|
18
|
+
if (t !== W.current) return;
|
|
19
|
+
F(r), R(-1);
|
|
20
20
|
} catch {
|
|
21
|
-
if (t !==
|
|
22
|
-
F([]),
|
|
21
|
+
if (t !== W.current) return;
|
|
22
|
+
F([]), R(-1);
|
|
23
23
|
} finally {
|
|
24
|
-
t ===
|
|
24
|
+
t === W.current && (N(!1), I(!0));
|
|
25
25
|
}
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}, [n]);
|
|
27
|
+
i(() => () => {
|
|
28
|
+
W.current += 1, U.current && clearTimeout(U.current);
|
|
29
29
|
}, []);
|
|
30
|
-
function
|
|
30
|
+
function ce(e) {
|
|
31
31
|
let t = e.target.value;
|
|
32
|
-
j(t),
|
|
32
|
+
j(t), U.current && clearTimeout(U.current), U.current = setTimeout(() => void X(t), v);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
h || g || O || (e.preventDefault(),
|
|
34
|
+
function Z(e) {
|
|
35
|
+
h || g || O || (e.preventDefault(), G.current?.focus(), R(-1), j(""), F([]), I(!1), k(!0), X(""));
|
|
36
36
|
}
|
|
37
37
|
function Q(e) {
|
|
38
|
-
d === void 0 && (
|
|
38
|
+
d === void 0 && (B(e.value), H(e)), f?.(e.value, e), k(!1), R(-1), j("");
|
|
39
39
|
}
|
|
40
40
|
function $() {
|
|
41
|
-
d === void 0 && (
|
|
41
|
+
d === void 0 && (B(null), H(null)), f?.(null, null), j(""), F([]), I(!1), G.current?.focus();
|
|
42
42
|
}
|
|
43
43
|
function le(e) {
|
|
44
44
|
e.stopPropagation(), $();
|
|
45
45
|
}
|
|
46
46
|
function ue(e) {
|
|
47
|
-
e.key === "ArrowDown" ? (e.preventDefault(), O ?
|
|
47
|
+
e.key === "ArrowDown" ? (e.preventDefault(), O ? R((e) => Math.min(e + 1, P.length - 1)) : (k(!0), X(A))) : e.key === "ArrowUp" ? (e.preventDefault(), R((e) => Math.max(e - 1, -1))) : e.key === "Enter" && L >= 0 && P[L] ? (e.preventDefault(), Q(P[L])) : e.key === "Escape" ? (k(!1), j(""), R(-1)) : e.key === "Tab" ? (k(!1), R(-1)) : (e.key === "Backspace" || e.key === "Delete") && A === "" && J && !h && !g ? (e.preventDefault(), $()) : !O && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), j(e.key), k(!0), F([]), I(!1), U.current && clearTimeout(U.current), U.current = setTimeout(() => void X(e.key), v));
|
|
48
48
|
}
|
|
49
49
|
function de(e, t) {
|
|
50
50
|
if (!e) {
|
|
51
51
|
if (t.reason === "outside-press") {
|
|
52
52
|
let e = t.event?.target;
|
|
53
|
-
if (e instanceof Node &&
|
|
53
|
+
if (e instanceof Node && K.current?.contains(e)) return;
|
|
54
54
|
}
|
|
55
|
-
k(!1), j(""),
|
|
55
|
+
k(!1), j(""), R(-1);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
let fe = O ? A :
|
|
58
|
+
let fe = O ? A : se?.label ?? "", pe = [
|
|
59
59
|
"async-select",
|
|
60
60
|
_ === "md" ? "" : `async-select--${_}`,
|
|
61
61
|
h ? "async-select--disabled" : "",
|
|
62
62
|
x ? "async-select--error" : "",
|
|
63
|
-
|
|
63
|
+
w ?? ""
|
|
64
64
|
].filter(Boolean).join(" "), me = ["async-select__content", _ === "md" ? "" : `async-select__content--${_}`].filter(Boolean).join(" ");
|
|
65
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ l(u.Root, {
|
|
66
66
|
open: O,
|
|
67
67
|
onOpenChange: de,
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
-
ref:
|
|
68
|
+
children: [/* @__PURE__ */ l("div", {
|
|
69
|
+
ref: K,
|
|
70
70
|
className: pe,
|
|
71
71
|
"data-popup-open": O || void 0,
|
|
72
72
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ c("input", {
|
|
74
74
|
ref: (e) => {
|
|
75
|
-
|
|
75
|
+
G.current = e, ee(ie, e);
|
|
76
76
|
},
|
|
77
77
|
id: y,
|
|
78
78
|
type: "text",
|
|
79
79
|
className: "async-select__input",
|
|
80
80
|
value: fe,
|
|
81
|
-
onChange:
|
|
82
|
-
onPointerDown:
|
|
81
|
+
onChange: ce,
|
|
82
|
+
onPointerDown: Z,
|
|
83
83
|
onKeyDown: ue,
|
|
84
84
|
placeholder: m,
|
|
85
85
|
disabled: h,
|
|
86
86
|
readOnly: g,
|
|
87
|
-
"aria-label":
|
|
88
|
-
"aria-describedby":
|
|
87
|
+
"aria-label": T,
|
|
88
|
+
"aria-describedby": E,
|
|
89
89
|
"aria-invalid": x || void 0,
|
|
90
|
-
"aria-required":
|
|
90
|
+
"aria-required": S || void 0,
|
|
91
91
|
"aria-expanded": O,
|
|
92
92
|
"aria-haspopup": "listbox",
|
|
93
|
-
"aria-controls": O ?
|
|
94
|
-
"aria-activedescendant":
|
|
93
|
+
"aria-controls": O ? q : void 0,
|
|
94
|
+
"aria-activedescendant": L >= 0 ? Y(L) : void 0,
|
|
95
95
|
autoComplete: "off",
|
|
96
96
|
role: "combobox",
|
|
97
97
|
"aria-autocomplete": "list",
|
|
98
|
-
onBlur:
|
|
98
|
+
onBlur: C
|
|
99
99
|
}),
|
|
100
|
-
b && /* @__PURE__ */
|
|
100
|
+
b && /* @__PURE__ */ c("input", {
|
|
101
101
|
type: "hidden",
|
|
102
102
|
name: b,
|
|
103
|
-
value:
|
|
103
|
+
value: J ?? ""
|
|
104
104
|
}),
|
|
105
|
-
M && /* @__PURE__ */
|
|
105
|
+
M && /* @__PURE__ */ c(t, {
|
|
106
106
|
size: "sm",
|
|
107
107
|
"aria-hidden": !0
|
|
108
108
|
}),
|
|
109
|
-
!M &&
|
|
109
|
+
!M && J && !h && !g && /* @__PURE__ */ c("button", {
|
|
110
110
|
type: "button",
|
|
111
111
|
className: "async-select__clear",
|
|
112
|
-
"aria-label":
|
|
112
|
+
"aria-label": ne,
|
|
113
113
|
tabIndex: -1,
|
|
114
114
|
onMouseDown: le,
|
|
115
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ c(e, {
|
|
116
116
|
name: "close",
|
|
117
117
|
size: "xs"
|
|
118
118
|
})
|
|
119
119
|
})
|
|
120
120
|
]
|
|
121
|
-
}), /* @__PURE__ */
|
|
122
|
-
container:
|
|
123
|
-
children: /* @__PURE__ */
|
|
121
|
+
}), /* @__PURE__ */ c(u.Portal, {
|
|
122
|
+
container: re,
|
|
123
|
+
children: /* @__PURE__ */ c(u.Positioner, {
|
|
124
124
|
className: "async-select__positioner",
|
|
125
|
-
anchor:
|
|
125
|
+
anchor: K,
|
|
126
126
|
align: "start",
|
|
127
127
|
sideOffset: -1,
|
|
128
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ c(u.Popup, {
|
|
129
129
|
className: me,
|
|
130
130
|
initialFocus: !1,
|
|
131
131
|
finalFocus: !1,
|
|
132
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ l("div", {
|
|
133
133
|
role: "listbox",
|
|
134
|
-
"aria-label":
|
|
135
|
-
id:
|
|
134
|
+
"aria-label": T ?? m,
|
|
135
|
+
id: q,
|
|
136
136
|
children: [
|
|
137
|
-
M && /* @__PURE__ */
|
|
137
|
+
M && /* @__PURE__ */ c("div", {
|
|
138
138
|
className: "async-select__loading",
|
|
139
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ c(t, {
|
|
140
140
|
size: "sm",
|
|
141
|
-
label:
|
|
141
|
+
label: te
|
|
142
142
|
})
|
|
143
143
|
}),
|
|
144
|
-
!M &&
|
|
144
|
+
!M && ae && P.length === 0 && /* @__PURE__ */ c("div", {
|
|
145
145
|
className: "async-select__empty",
|
|
146
|
-
children:
|
|
146
|
+
children: D
|
|
147
147
|
}),
|
|
148
148
|
!M && P.map((e, t) => {
|
|
149
|
-
let
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
id:
|
|
149
|
+
let n = e.value === J, r = L === t;
|
|
150
|
+
return /* @__PURE__ */ c("div", {
|
|
151
|
+
id: Y(t),
|
|
152
152
|
role: "option",
|
|
153
|
-
"aria-selected":
|
|
153
|
+
"aria-selected": n,
|
|
154
154
|
className: [
|
|
155
155
|
"async-select__item",
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
n ? "async-select__item--selected" : "",
|
|
157
|
+
r ? "async-select__item--active" : ""
|
|
158
158
|
].filter(Boolean).join(" "),
|
|
159
159
|
onPointerDown: (e) => e.preventDefault(),
|
|
160
160
|
onClick: () => Q(e),
|
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
|
package/dist/button.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './button.css';
|
|
3
3
|
import { n as e } from "./_shared/form-size.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t } from "react";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
6
|
import { useRender as r } from "@base-ui/react/use-render";
|
|
7
7
|
//#region src/stories/atoms/Button/Button.tsx
|
|
8
|
-
var i =
|
|
8
|
+
var i = t(function({ variant: t = "primary", tone: i = "accent", destructive: a = !1, size: o, block: s = !1, iconOnly: c = !1, children: l, type: u = "button", disabled: d, onClick: f, href: p, external: m = !1, render: h, className: g, ..._ }, v) {
|
|
9
9
|
let y = e(o), b = [
|
|
10
10
|
"button",
|
|
11
|
-
`button--${
|
|
12
|
-
|
|
11
|
+
`button--${t}`,
|
|
12
|
+
t === "text" && i === "ink" ? "button--ink" : "",
|
|
13
13
|
a ? "button--destructive-intent" : "",
|
|
14
14
|
y === "md" ? "" : `button--${y}`,
|
|
15
15
|
s === "mobile" ? "button--block-mobile" : s ? "button--block" : "",
|
|
@@ -33,7 +33,7 @@ var i = n(function({ variant: n = "primary", tone: i = "accent", destructive: a
|
|
|
33
33
|
..._,
|
|
34
34
|
children: l
|
|
35
35
|
}
|
|
36
|
-
}) || (p === void 0 ? /* @__PURE__ */
|
|
36
|
+
}) || (p === void 0 ? /* @__PURE__ */ n("button", {
|
|
37
37
|
ref: v,
|
|
38
38
|
className: b,
|
|
39
39
|
type: u,
|
|
@@ -41,7 +41,7 @@ var i = n(function({ variant: n = "primary", tone: i = "accent", destructive: a
|
|
|
41
41
|
onClick: f,
|
|
42
42
|
..._,
|
|
43
43
|
children: l
|
|
44
|
-
}) : /* @__PURE__ */
|
|
44
|
+
}) : /* @__PURE__ */ n("a", {
|
|
45
45
|
ref: v,
|
|
46
46
|
className: b,
|
|
47
47
|
href: d ? void 0 : p,
|