@studiolxd/brand 39.0.0 → 40.1.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 +107 -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 +1 -0
- 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/AnnotationThread/AnnotationThread.d.ts +27 -5
- 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.css +1 -1
- package/dist/annotation-thread.js +37 -26
- 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 +2 -1
- 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/tokens.css +2 -1
- 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/molecules/annotation-thread.css +1 -0
- package/src/tokens/scss/molecules/_annotation-thread.scss +1 -0
- package/src/tokens/tokens.json +1 -0
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,
|
package/dist/calendar-planner.js
CHANGED
|
@@ -4,11 +4,11 @@ import { VisuallyHidden as e } from "./visually-hidden.js";
|
|
|
4
4
|
import { Tag as t } from "./tag.js";
|
|
5
5
|
import { Modal as n } from "./modal.js";
|
|
6
6
|
import { c as r, i, l as a, n as o, o as s, r as c, s as l, t as u } from "./_shared/calendargrid.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCallback as d, useId as f, useState as p } from "react";
|
|
8
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
9
|
//#region src/stories/molecules/CalendarPlanner/CalendarPlanner.tsx
|
|
10
10
|
function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b, showMoreDialog: x, onDayClick: S, month: C, defaultMonth: w, onMonthChange: T, navigable: E = !0, locale: D = "es-ES", previousMonthLabel: O = "Mes anterior", nextMonthLabel: k = "Mes siguiente", gridLabel: A, moreLabel: j = (e) => `+${e} más`, size: M = "md", className: N }) {
|
|
11
|
-
let [P, F] =
|
|
11
|
+
let [P, F] = p(() => C ?? w ?? /* @__PURE__ */ new Date()), [I, L] = p(null), R = x ?? !b, z = d(() => L(null), []), B = C ?? P, V = d((e) => {
|
|
12
12
|
F(e), T?.(e);
|
|
13
13
|
}, [T]), H = /* @__PURE__ */ new Date(), U = M === "sm" ? "xs" : M === "lg" ? "md" : "sm", W = new Intl.DateTimeFormat(D, {
|
|
14
14
|
month: "long",
|
|
@@ -27,8 +27,8 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
27
27
|
month: B,
|
|
28
28
|
onMonthChange: V,
|
|
29
29
|
onActivate: S ? (e) => S(e, Z(e)) : void 0
|
|
30
|
-
}), $ = `${
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
}), $ = `${f()}-planner-title-${B.getFullYear()}-${B.getMonth()}`;
|
|
31
|
+
return /* @__PURE__ */ g("div", {
|
|
32
32
|
className: [
|
|
33
33
|
"calendar-planner",
|
|
34
34
|
`calendar-planner--${M}`,
|
|
@@ -46,7 +46,7 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
46
46
|
onNext: () => V(X),
|
|
47
47
|
chevronSize: U
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ g("div", {
|
|
50
50
|
className: "calendar-planner__grid",
|
|
51
51
|
role: "grid",
|
|
52
52
|
"aria-label": A,
|
|
@@ -56,7 +56,7 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
56
56
|
block: "calendar-planner",
|
|
57
57
|
rowModifier: "header",
|
|
58
58
|
weekdays: q
|
|
59
|
-
}), J.map((n, r) => /* @__PURE__ */
|
|
59
|
+
}), J.map((n, r) => /* @__PURE__ */ h("div", {
|
|
60
60
|
role: "row",
|
|
61
61
|
className: "calendar-planner__row",
|
|
62
62
|
children: n.map(({ date: n, outside: r }) => {
|
|
@@ -69,7 +69,7 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
69
69
|
a && "calendar-planner__day-number--today",
|
|
70
70
|
r && "calendar-planner__day-number--outside"
|
|
71
71
|
].filter(Boolean).join(" ");
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ g("div", {
|
|
73
73
|
ref: S ? Q.cellRef(n) : void 0,
|
|
74
74
|
role: "gridcell",
|
|
75
75
|
className: [l, S ? "calendar-planner__cell--clickable" : ""].filter(Boolean).join(" "),
|
|
@@ -77,18 +77,18 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
77
77
|
tabIndex: S ? Q.isTabbable(n) ? 0 : -1 : void 0,
|
|
78
78
|
onFocus: S ? () => Q.onCellFocus(n) : void 0,
|
|
79
79
|
onClick: S ? () => S(n, o) : void 0,
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ g("span", {
|
|
81
81
|
className: u,
|
|
82
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ h(e, { children: G.format(n) }), /* @__PURE__ */ h("span", {
|
|
83
83
|
"aria-hidden": "true",
|
|
84
84
|
children: n.getDate()
|
|
85
85
|
})]
|
|
86
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ h("div", {
|
|
87
87
|
className: "calendar-planner__cell-body",
|
|
88
|
-
children: v ? v(n, o) : /* @__PURE__ */
|
|
88
|
+
children: v ? v(n, o) : /* @__PURE__ */ g(m, { children: [s.map((e) => /* @__PURE__ */ h(t, {
|
|
89
89
|
variant: e.variant ?? "neutral",
|
|
90
90
|
children: e.label
|
|
91
|
-
}, e.id)), c > 0 && /* @__PURE__ */
|
|
91
|
+
}, e.id)), c > 0 && /* @__PURE__ */ h("button", {
|
|
92
92
|
type: "button",
|
|
93
93
|
className: "calendar-planner__more",
|
|
94
94
|
onClick: (e) => {
|
|
@@ -104,13 +104,13 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
104
104
|
})
|
|
105
105
|
}, r))]
|
|
106
106
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ h(n, {
|
|
108
108
|
open: I !== null,
|
|
109
109
|
onClose: z,
|
|
110
110
|
title: I ? K.format(I.date) : void 0,
|
|
111
|
-
children: /* @__PURE__ */
|
|
111
|
+
children: /* @__PURE__ */ h("div", {
|
|
112
112
|
className: "calendar-planner__modal-events",
|
|
113
|
-
children: I?.events.map((e) => /* @__PURE__ */
|
|
113
|
+
children: I?.events.map((e) => /* @__PURE__ */ h(t, {
|
|
114
114
|
variant: e.variant ?? "neutral",
|
|
115
115
|
children: e.label
|
|
116
116
|
}, e.id))
|
package/dist/calendar.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './calendar.css';
|
|
3
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s as ee, t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s as ee, t as te } from "./_shared/calendargrid.js";
|
|
4
|
+
import { useCallback as s, useEffect as c, useId as ne, useRef as l, useState as u } from "react";
|
|
5
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/molecules/Calendar/Calendar.tsx
|
|
7
7
|
var p = 12, m = 4;
|
|
8
8
|
function h(e) {
|
|
9
9
|
return Math.floor(e / p) * p;
|
|
10
10
|
}
|
|
11
|
-
function g({ value: g, onChange: _, defaultMonth: v, month: y, onMonthChange: b, navigable: re = !0, disabledDates: x, minDate: S, maxDate: C, locale: w = "es-ES", previousMonthLabel:
|
|
12
|
-
let [
|
|
13
|
-
|
|
14
|
-
}, [b]), N = /* @__PURE__ */ new Date(), ce =
|
|
11
|
+
function g({ value: g, onChange: _, defaultMonth: v, month: y, onMonthChange: b, navigable: re = !0, disabledDates: x, minDate: S, maxDate: C, locale: w = "es-ES", previousMonthLabel: T = "Mes anterior", nextMonthLabel: ie = "Mes siguiente", previousYearsLabel: ae = "Años anteriores", nextYearsLabel: oe = "Años siguientes", yearGridLabel: se = "Elegir año", gridLabel: E, size: D = "md", className: O }) {
|
|
12
|
+
let [k, A] = u(() => y ?? v ?? (g instanceof Date ? g : /* @__PURE__ */ new Date())), j = y ?? k, M = s((e) => {
|
|
13
|
+
A(e), b?.(e);
|
|
14
|
+
}, [b]), N = /* @__PURE__ */ new Date(), ce = s((e) => S && e < S || C && e > C ? !0 : Array.isArray(x) ? x.some((t) => n(t, e)) : typeof x == "function" ? x(e) : !1, [
|
|
15
15
|
x,
|
|
16
16
|
S,
|
|
17
17
|
C
|
|
@@ -21,32 +21,32 @@ function g({ value: g, onChange: _, defaultMonth: v, month: y, onMonthChange: b,
|
|
|
21
21
|
selected: g ?? null,
|
|
22
22
|
minDate: S,
|
|
23
23
|
maxDate: C
|
|
24
|
-
}), [F, I] =
|
|
24
|
+
}), [F, I] = u("days"), [L, R] = u(() => h(j.getFullYear())), [z, B] = u(() => j.getFullYear()), V = l(null), H = l(/* @__PURE__ */ new Map()), U = l(null), W = s(() => {
|
|
25
25
|
let e = j.getFullYear();
|
|
26
26
|
R(h(e)), B(e), U.current = "year", I("years");
|
|
27
|
-
}, [j]), G =
|
|
27
|
+
}, [j]), G = s(() => {
|
|
28
28
|
U.current = "title", I("days");
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), le = s((e) => {
|
|
30
30
|
M(new Date(e, j.getMonth(), 1)), G();
|
|
31
31
|
}, [
|
|
32
32
|
G,
|
|
33
33
|
j,
|
|
34
34
|
M
|
|
35
35
|
]);
|
|
36
|
-
|
|
36
|
+
c(() => {
|
|
37
37
|
if (!U.current) return;
|
|
38
38
|
let e = U.current;
|
|
39
39
|
U.current = null, e === "title" ? V.current?.focus() : H.current.get(z)?.focus();
|
|
40
40
|
}, [F, z]);
|
|
41
|
-
let
|
|
41
|
+
let ue = D === "sm" ? "xs" : D === "lg" ? "md" : "sm", de = new Intl.DateTimeFormat(w, {
|
|
42
42
|
month: "long",
|
|
43
43
|
year: "numeric"
|
|
44
|
-
}).format(j),
|
|
44
|
+
}).format(j), fe = new Intl.DateTimeFormat(w, { year: "numeric" }), K = (e) => fe.format(new Date(e, 0, 1)), pe = Array.from({ length: p }, (e, t) => L + t), me = `${K(L)}–${K(L + p - 1)}`, he = new Intl.DateTimeFormat(w, {
|
|
45
45
|
weekday: "long",
|
|
46
46
|
day: "numeric",
|
|
47
47
|
month: "long",
|
|
48
48
|
year: "numeric"
|
|
49
|
-
}),
|
|
49
|
+
}), ge = o(w, "narrow"), _e = te(i(j)), q = t(j, -1), J = t(j, 1), Y = S ? !e(q, S) && q < S : !1, ve = C ? !e(J, C) && J > C : !1, ye = (e) => (S ? e < S.getFullYear() : !1) || (C ? e > C.getFullYear() : !1), be = S ? L - 1 < S.getFullYear() : !1, xe = C ? L + p > C.getFullYear() : !1, X = F === "years", Z = z >= L && z <= L + p - 1 ? z : L, Se = (e) => {
|
|
50
50
|
(e < L || e > L + p - 1) && R(h(e)), U.current = "year", B(e);
|
|
51
51
|
}, Ce = (e) => {
|
|
52
52
|
let t = null;
|
|
@@ -82,38 +82,38 @@ function g({ value: g, onChange: _, defaultMonth: v, month: y, onMonthChange: b,
|
|
|
82
82
|
}
|
|
83
83
|
e.preventDefault(), Se(t);
|
|
84
84
|
}, Q = ne(), $ = X ? `${Q}-calendar-title-${L}` : `${Q}-calendar-title-${j.getFullYear()}-${j.getMonth()}`;
|
|
85
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ f("div", {
|
|
86
86
|
className: [
|
|
87
87
|
"calendar",
|
|
88
|
-
`calendar--${
|
|
89
|
-
|
|
88
|
+
`calendar--${D}`,
|
|
89
|
+
O
|
|
90
90
|
].filter(Boolean).join(" "),
|
|
91
91
|
children: [a({
|
|
92
92
|
block: "calendar",
|
|
93
|
-
title: X ?
|
|
93
|
+
title: X ? me : de,
|
|
94
94
|
titleId: $,
|
|
95
95
|
navigable: re,
|
|
96
|
-
previousLabel: X ?
|
|
97
|
-
nextLabel: X ?
|
|
98
|
-
prevDisabled: X ? be :
|
|
96
|
+
previousLabel: X ? ae : T,
|
|
97
|
+
nextLabel: X ? oe : ie,
|
|
98
|
+
prevDisabled: X ? be : Y,
|
|
99
99
|
nextDisabled: X ? xe : ve,
|
|
100
|
-
onPrev: X ? () => R(L - p) : () => M(
|
|
101
|
-
onNext: X ? () => R(L + p) : () => M(
|
|
102
|
-
chevronSize:
|
|
100
|
+
onPrev: X ? () => R(L - p) : () => M(q),
|
|
101
|
+
onNext: X ? () => R(L + p) : () => M(J),
|
|
102
|
+
chevronSize: ue,
|
|
103
103
|
onTitleClick: X ? G : W,
|
|
104
104
|
titleExpanded: X,
|
|
105
105
|
titleRef: V
|
|
106
|
-
}), X ? /* @__PURE__ */
|
|
106
|
+
}), X ? /* @__PURE__ */ d("div", {
|
|
107
107
|
className: "calendar__years",
|
|
108
108
|
role: "grid",
|
|
109
|
-
"aria-label":
|
|
109
|
+
"aria-label": se,
|
|
110
110
|
onKeyDown: Ce,
|
|
111
|
-
children: Array.from({ length: p / m }, (e, t) => /* @__PURE__ */
|
|
111
|
+
children: Array.from({ length: p / m }, (e, t) => /* @__PURE__ */ d("div", {
|
|
112
112
|
role: "row",
|
|
113
113
|
className: "calendar__row",
|
|
114
|
-
children:
|
|
114
|
+
children: pe.slice(t * m, t * m + m).map((e) => {
|
|
115
115
|
let t = ye(e), n = e === N.getFullYear(), r = g instanceof Date ? g.getFullYear() === e : !1;
|
|
116
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ d("button", {
|
|
117
117
|
ref: (t) => {
|
|
118
118
|
t ? H.current.set(e, t) : H.current.delete(e);
|
|
119
119
|
},
|
|
@@ -130,21 +130,21 @@ function g({ value: g, onChange: _, defaultMonth: v, month: y, onMonthChange: b,
|
|
|
130
130
|
"aria-current": n ? "date" : void 0,
|
|
131
131
|
tabIndex: e === Z ? 0 : -1,
|
|
132
132
|
onFocus: () => B(e),
|
|
133
|
-
onClick: t ? void 0 : () =>
|
|
134
|
-
children:
|
|
133
|
+
onClick: t ? void 0 : () => le(e),
|
|
134
|
+
children: K(e)
|
|
135
135
|
}, e);
|
|
136
136
|
})
|
|
137
137
|
}, t))
|
|
138
|
-
}) : /* @__PURE__ */
|
|
138
|
+
}) : /* @__PURE__ */ f("div", {
|
|
139
139
|
className: "calendar__grid",
|
|
140
140
|
role: "grid",
|
|
141
|
-
"aria-label":
|
|
142
|
-
"aria-labelledby":
|
|
141
|
+
"aria-label": E,
|
|
142
|
+
"aria-labelledby": E ? void 0 : $,
|
|
143
143
|
onKeyDown: P.onKeyDown,
|
|
144
144
|
children: [ee({
|
|
145
145
|
block: "calendar",
|
|
146
|
-
weekdays:
|
|
147
|
-
}),
|
|
146
|
+
weekdays: ge
|
|
147
|
+
}), _e.map((e, t) => /* @__PURE__ */ d("div", {
|
|
148
148
|
role: "row",
|
|
149
149
|
className: "calendar__row",
|
|
150
150
|
children: e.map(({ date: e, outside: t }) => {
|
|
@@ -155,12 +155,12 @@ function g({ value: g, onChange: _, defaultMonth: v, month: y, onMonthChange: b,
|
|
|
155
155
|
a && "calendar__day--selected",
|
|
156
156
|
r && "calendar__day--disabled"
|
|
157
157
|
].filter(Boolean).join(" ");
|
|
158
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ d("button", {
|
|
159
159
|
ref: P.cellRef(e),
|
|
160
160
|
type: "button",
|
|
161
161
|
role: "gridcell",
|
|
162
162
|
className: o,
|
|
163
|
-
"aria-label":
|
|
163
|
+
"aria-label": he.format(e),
|
|
164
164
|
"aria-selected": a,
|
|
165
165
|
"aria-disabled": r ? "true" : void 0,
|
|
166
166
|
"aria-current": i ? "date" : void 0,
|
package/dist/card.js
CHANGED
|
@@ -4,11 +4,11 @@ import { VisuallyHidden as e } from "./visually-hidden.js";
|
|
|
4
4
|
import { Arrow as t } from "./arrow.js";
|
|
5
5
|
import { Heading as n } from "./heading.js";
|
|
6
6
|
import { Paragraph as r } from "./paragraph.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { forwardRef as i } from "react";
|
|
8
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
import { useRender as c } from "@base-ui/react/use-render";
|
|
10
10
|
//#region src/stories/molecules/Card/Card.tsx
|
|
11
|
-
var l =
|
|
11
|
+
var l = i(function({ href: r, render: i, external: l = !1, title: u, description: d, ctaLabel: f, color: p = "outline", variant: m = "default", media: h, selectable: g = !1, selected: _ = !1, className: v, children: y, ...b }, x) {
|
|
12
12
|
let S = [
|
|
13
13
|
"card",
|
|
14
14
|
`card--${p}`,
|
|
@@ -16,40 +16,40 @@ var l = s(function({ href: r, render: s, external: l = !1, title: u, description
|
|
|
16
16
|
g ? "card--selectable" : "",
|
|
17
17
|
g && _ ? "card--selected" : "",
|
|
18
18
|
v ?? ""
|
|
19
|
-
].filter(Boolean).join(" "), C = /* @__PURE__ */
|
|
20
|
-
u !== void 0 && /* @__PURE__ */
|
|
19
|
+
].filter(Boolean).join(" "), C = /* @__PURE__ */ s(a, { children: [
|
|
20
|
+
u !== void 0 && /* @__PURE__ */ o(n, {
|
|
21
21
|
level: 2,
|
|
22
22
|
size: 8,
|
|
23
23
|
children: u
|
|
24
24
|
}),
|
|
25
|
-
d && (typeof d == "string" ? /* @__PURE__ */
|
|
25
|
+
d && (typeof d == "string" ? /* @__PURE__ */ o("p", { children: d }) : d),
|
|
26
26
|
y,
|
|
27
|
-
f !== void 0 && /* @__PURE__ */
|
|
28
|
-
] }), w = h && /* @__PURE__ */
|
|
27
|
+
f !== void 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, { children: f }), /* @__PURE__ */ o(t, { size: "lg" })] })
|
|
28
|
+
] }), w = h && /* @__PURE__ */ o("div", {
|
|
29
29
|
className: "card__media",
|
|
30
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ o("img", {
|
|
31
31
|
src: h.src,
|
|
32
32
|
alt: h.alt
|
|
33
33
|
})
|
|
34
|
-
}), T = m === "default" && !h ? C : /* @__PURE__ */
|
|
34
|
+
}), T = m === "default" && !h ? C : /* @__PURE__ */ s(a, { children: [w, /* @__PURE__ */ o("div", {
|
|
35
35
|
className: "card__body",
|
|
36
36
|
children: C
|
|
37
37
|
})] });
|
|
38
38
|
return c({
|
|
39
|
-
render:
|
|
39
|
+
render: i,
|
|
40
40
|
ref: x,
|
|
41
|
-
enabled:
|
|
41
|
+
enabled: i !== void 0,
|
|
42
42
|
props: {
|
|
43
43
|
className: S,
|
|
44
44
|
...b,
|
|
45
45
|
children: T
|
|
46
46
|
}
|
|
47
|
-
}) || (r === void 0 ? /* @__PURE__ */
|
|
47
|
+
}) || (r === void 0 ? /* @__PURE__ */ o("div", {
|
|
48
48
|
ref: x,
|
|
49
49
|
className: S,
|
|
50
50
|
...b,
|
|
51
51
|
children: y
|
|
52
|
-
}) : /* @__PURE__ */
|
|
52
|
+
}) : /* @__PURE__ */ o("a", {
|
|
53
53
|
ref: x,
|
|
54
54
|
href: r,
|
|
55
55
|
className: S,
|
|
@@ -60,23 +60,23 @@ var l = s(function({ href: r, render: s, external: l = !1, title: u, description
|
|
|
60
60
|
...b,
|
|
61
61
|
children: T
|
|
62
62
|
}));
|
|
63
|
-
}), u =
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
}), u = i(function({ className: e, ...t }, n) {
|
|
64
|
+
return /* @__PURE__ */ o("div", {
|
|
65
65
|
ref: n,
|
|
66
66
|
className: ["card__header", e].filter(Boolean).join(" "),
|
|
67
67
|
...t
|
|
68
68
|
});
|
|
69
|
-
}), d =
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
}), d = i(function({ level: e = 3, size: t = 4, className: r, children: i, ...a }, s) {
|
|
70
|
+
return /* @__PURE__ */ o(n, {
|
|
71
71
|
ref: s,
|
|
72
72
|
level: e,
|
|
73
73
|
size: t,
|
|
74
74
|
className: ["card__title", r].filter(Boolean).join(" "),
|
|
75
|
-
...
|
|
75
|
+
...a,
|
|
76
76
|
children: i
|
|
77
77
|
});
|
|
78
|
-
}), f =
|
|
79
|
-
return /* @__PURE__ */
|
|
78
|
+
}), f = i(function({ size: e = "small", lines: t, className: n, children: i, ...a }, s) {
|
|
79
|
+
return /* @__PURE__ */ o(r, {
|
|
80
80
|
ref: s,
|
|
81
81
|
size: e,
|
|
82
82
|
className: [
|
|
@@ -84,23 +84,23 @@ var l = s(function({ href: r, render: s, external: l = !1, title: u, description
|
|
|
84
84
|
t ? `card__description--lines-${t}` : "",
|
|
85
85
|
n
|
|
86
86
|
].filter(Boolean).join(" "),
|
|
87
|
-
...
|
|
87
|
+
...a,
|
|
88
88
|
children: i
|
|
89
89
|
});
|
|
90
|
-
}), p =
|
|
91
|
-
return /* @__PURE__ */
|
|
90
|
+
}), p = i(function({ className: e, ...t }, n) {
|
|
91
|
+
return /* @__PURE__ */ o("div", {
|
|
92
92
|
ref: n,
|
|
93
93
|
className: ["card__action", e].filter(Boolean).join(" "),
|
|
94
94
|
...t
|
|
95
95
|
});
|
|
96
|
-
}), m =
|
|
97
|
-
return /* @__PURE__ */
|
|
96
|
+
}), m = i(function({ className: e, ...t }, n) {
|
|
97
|
+
return /* @__PURE__ */ o("div", {
|
|
98
98
|
ref: n,
|
|
99
99
|
className: ["card__content", e].filter(Boolean).join(" "),
|
|
100
100
|
...t
|
|
101
101
|
});
|
|
102
|
-
}), h =
|
|
103
|
-
return /* @__PURE__ */
|
|
102
|
+
}), h = i(function({ direction: e = "row", className: t, ...n }, r) {
|
|
103
|
+
return /* @__PURE__ */ o("div", {
|
|
104
104
|
ref: r,
|
|
105
105
|
className: [
|
|
106
106
|
"card__footer",
|
package/dist/carousel.js
CHANGED
|
@@ -4,11 +4,11 @@ import { Icon as e } from "./icon.js";
|
|
|
4
4
|
import { VisuallyHidden as t } from "./visually-hidden.js";
|
|
5
5
|
import { Button as n } from "./button.js";
|
|
6
6
|
import { t as r } from "./_shared/css-properties.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Children as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
8
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
9
|
//#region src/stories/molecules/Carousel/Carousel.tsx
|
|
10
10
|
function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel", trackLabel: h = "Diapositivas", slideSize: g, controls: _ = !0, indicators: v = !1, autoplay: y, prevLabel: b = "Anterior", nextLabel: x = "Siguiente", indicatorLabel: S = (e) => `Ir a la diapositiva ${e + 1}`, pauseLabel: C = "Pausar", playLabel: w = "Reproducir", slideStatusLabel: T = (e, t) => `Diapositiva ${e + 1} de ${t}`, className: E, id: D }) {
|
|
11
|
-
let O =
|
|
11
|
+
let O = s(null), [k, A] = c(0), j = s(0), [M, N] = c(!1), [P, F] = c(!1), I = i.count(f), L = y !== void 0 && !P, R = (e) => Array.from(e.children), z = a((e) => {
|
|
12
12
|
let t = O.current;
|
|
13
13
|
if (!t) return;
|
|
14
14
|
let n = R(t);
|
|
@@ -19,7 +19,7 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
19
19
|
behavior: i ? "auto" : "smooth"
|
|
20
20
|
});
|
|
21
21
|
}, []);
|
|
22
|
-
|
|
22
|
+
o(() => {
|
|
23
23
|
let e = O.current;
|
|
24
24
|
if (!e) return;
|
|
25
25
|
let t = () => {
|
|
@@ -32,7 +32,7 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
32
32
|
}), j.current = r, A(r);
|
|
33
33
|
};
|
|
34
34
|
return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
35
|
-
}, [f]),
|
|
35
|
+
}, [f]), o(() => {
|
|
36
36
|
if (!y || P || M || I < 2 || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
37
37
|
let e = window.setInterval(() => z(j.current + 1), y);
|
|
38
38
|
return () => window.clearInterval(e);
|
|
@@ -46,7 +46,7 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
46
46
|
let B = (e) => {
|
|
47
47
|
e.key === "ArrowRight" ? (e.preventDefault(), z(k + 1)) : e.key === "ArrowLeft" && (e.preventDefault(), z(k - 1));
|
|
48
48
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ d("div", {
|
|
50
50
|
id: D,
|
|
51
51
|
ref: r({ "--carousel-slide-size": g }),
|
|
52
52
|
className: ["carousel", E].filter(Boolean).join(" "),
|
|
@@ -58,7 +58,7 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
58
58
|
onFocus: () => N(!0),
|
|
59
59
|
onBlur: () => N(!1),
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ u("div", {
|
|
62
62
|
ref: O,
|
|
63
63
|
className: "carousel__track",
|
|
64
64
|
tabIndex: 0,
|
|
@@ -67,44 +67,44 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
67
67
|
onKeyDown: B,
|
|
68
68
|
children: f
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ u(t, {
|
|
71
71
|
as: "div",
|
|
72
72
|
role: "status",
|
|
73
73
|
"aria-live": L ? "off" : "polite",
|
|
74
74
|
"aria-atomic": "true",
|
|
75
75
|
children: T(k, I)
|
|
76
76
|
}),
|
|
77
|
-
(_ || v || y !== void 0) && /* @__PURE__ */
|
|
77
|
+
(_ || v || y !== void 0) && /* @__PURE__ */ d("div", {
|
|
78
78
|
className: "carousel__controls",
|
|
79
|
-
children: [v && /* @__PURE__ */
|
|
79
|
+
children: [v && /* @__PURE__ */ u("div", {
|
|
80
80
|
className: "carousel__indicators",
|
|
81
|
-
children: Array.from({ length: I }, (e, t) => /* @__PURE__ */
|
|
81
|
+
children: Array.from({ length: I }, (e, t) => /* @__PURE__ */ u("button", {
|
|
82
82
|
type: "button",
|
|
83
83
|
className: "carousel__indicator",
|
|
84
84
|
"aria-label": S(t),
|
|
85
85
|
"aria-current": t === k ? "true" : void 0,
|
|
86
86
|
onClick: () => z(t)
|
|
87
87
|
}, t))
|
|
88
|
-
}), (_ || y !== void 0) && /* @__PURE__ */
|
|
88
|
+
}), (_ || y !== void 0) && /* @__PURE__ */ d("div", {
|
|
89
89
|
className: "carousel__buttons",
|
|
90
|
-
children: [y !== void 0 && /* @__PURE__ */
|
|
90
|
+
children: [y !== void 0 && /* @__PURE__ */ u(n, {
|
|
91
91
|
variant: "ghost",
|
|
92
92
|
iconOnly: !0,
|
|
93
93
|
"aria-label": L ? C : w,
|
|
94
94
|
onClick: () => F((e) => !e),
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
}), _ && /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ u(e, { name: L ? "pause" : "play" })
|
|
96
|
+
}), _ && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(n, {
|
|
97
97
|
variant: "ghost",
|
|
98
98
|
iconOnly: !0,
|
|
99
99
|
"aria-label": b,
|
|
100
100
|
onClick: () => z(k - 1),
|
|
101
|
-
children: /* @__PURE__ */
|
|
102
|
-
}), /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ u(e, { name: "arrow-left" })
|
|
102
|
+
}), /* @__PURE__ */ u(n, {
|
|
103
103
|
variant: "ghost",
|
|
104
104
|
iconOnly: !0,
|
|
105
105
|
"aria-label": x,
|
|
106
106
|
onClick: () => z(k + 1),
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ u(e, { name: "arrow" })
|
|
108
108
|
})] })]
|
|
109
109
|
})]
|
|
110
110
|
})
|
|
@@ -112,7 +112,7 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
function p({ roleDescription: e = "diapositiva", className: t, children: n, ...r }) {
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ u("div", {
|
|
116
116
|
className: ["carousel__slide", t].filter(Boolean).join(" "),
|
|
117
117
|
role: "group",
|
|
118
118
|
"aria-roledescription": e,
|