@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
package/dist/time-field.js
CHANGED
|
@@ -5,22 +5,22 @@ import { ErrorText as t } from "./error-text.js";
|
|
|
5
5
|
import { Label as n } from "./label.js";
|
|
6
6
|
import { TimeSelect as r } from "./time-select.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/TimeField/TimeField.tsx
|
|
11
|
-
var l =
|
|
12
|
-
let D = i(u), O = e(m), k =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var l = a(function({ id: a, label: l, labelHidden: u, value: d, step: f, name: p, size: m, disabled: h, readOnly: g, required: _, error: v = !1, errorMessage: y, helperText: b, className: x, hoursLabel: S, minutesLabel: C, onChange: w, onBlur: T }, E) {
|
|
12
|
+
let D = i(u), O = e(m), k = o(), A = a ?? k, j = y ? `${A}-error` : void 0, M = b ? `${A}-helper` : void 0, N = [j, M].filter(Boolean).join(" ") || void 0, P = v || !!y;
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
14
|
className: ["time-field", x].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ s(n, {
|
|
17
17
|
id: `${A}-label`,
|
|
18
18
|
htmlFor: A,
|
|
19
19
|
hidden: D,
|
|
20
20
|
size: O,
|
|
21
21
|
children: l
|
|
22
22
|
}),
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ s(r, {
|
|
24
24
|
ref: E,
|
|
25
25
|
id: A,
|
|
26
26
|
name: p,
|
|
@@ -38,11 +38,11 @@ var l = s(function({ id: s, label: l, labelHidden: u, value: d, step: f, name: p
|
|
|
38
38
|
onChange: w,
|
|
39
39
|
onBlur: T
|
|
40
40
|
}),
|
|
41
|
-
y && /* @__PURE__ */
|
|
41
|
+
y && /* @__PURE__ */ s(t, {
|
|
42
42
|
id: j,
|
|
43
43
|
children: y
|
|
44
44
|
}),
|
|
45
|
-
b && /* @__PURE__ */
|
|
45
|
+
b && /* @__PURE__ */ s("span", {
|
|
46
46
|
id: M,
|
|
47
47
|
className: "time-field__helper",
|
|
48
48
|
children: b
|
package/dist/time-select.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './time-select.css';
|
|
3
3
|
import { Select as e } from "./select.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t, useMemo as n } from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/atoms/TimeSelect/TimeSelect.tsx
|
|
7
7
|
function a(e) {
|
|
8
8
|
return String(e).padStart(2, "0");
|
|
9
9
|
}
|
|
10
|
-
var o =
|
|
11
|
-
let w =
|
|
10
|
+
var o = t(function({ value: t, onChange: o, step: s = 5, size: c = "md", disabled: l, readOnly: u, error: d, id: f, name: p, required: m, "aria-labelledby": h, "aria-describedby": g, onBlur: _, className: v, hoursLabel: y = "Horas", minutesLabel: b = "Minutos", hoursPlaceholder: x = "HH", minutesPlaceholder: S = "MM" }, C) {
|
|
11
|
+
let w = n(() => Array.from({ length: 24 }, (e, t) => ({
|
|
12
12
|
value: String(t),
|
|
13
13
|
label: a(t)
|
|
14
|
-
})), []), T =
|
|
14
|
+
})), []), T = n(() => {
|
|
15
15
|
let e = [];
|
|
16
16
|
for (let t = 0; t < 60; t += s) e.push({
|
|
17
17
|
value: String(t),
|
|
@@ -19,19 +19,19 @@ var o = r(function({ value: r, onChange: o, step: s = 5, size: c = "md", disable
|
|
|
19
19
|
});
|
|
20
20
|
return e;
|
|
21
21
|
}, [s]), E = (e) => {
|
|
22
|
-
let
|
|
22
|
+
let n = parseInt(e, 10), r = t?.m ?? 0;
|
|
23
23
|
o?.({
|
|
24
|
-
h:
|
|
25
|
-
m:
|
|
24
|
+
h: n,
|
|
25
|
+
m: r
|
|
26
26
|
});
|
|
27
27
|
}, D = (e) => {
|
|
28
|
-
let
|
|
28
|
+
let n = t?.h ?? 0;
|
|
29
29
|
o?.({
|
|
30
|
-
h:
|
|
30
|
+
h: n,
|
|
31
31
|
m: parseInt(e, 10)
|
|
32
32
|
});
|
|
33
|
-
}, O = ["time-select", v ?? ""].filter(Boolean).join(" "), k =
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
}, O = ["time-select", v ?? ""].filter(Boolean).join(" "), k = t == null ? "" : String(t.h), A = t == null ? "" : String(t.m);
|
|
34
|
+
return /* @__PURE__ */ i("div", {
|
|
35
35
|
className: O,
|
|
36
36
|
role: "group",
|
|
37
37
|
"aria-labelledby": h,
|
|
@@ -39,7 +39,7 @@ var o = r(function({ value: r, onChange: o, step: s = 5, size: c = "md", disable
|
|
|
39
39
|
"aria-invalid": d || void 0,
|
|
40
40
|
"aria-required": m || void 0,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r(e, {
|
|
43
43
|
ref: C,
|
|
44
44
|
id: f,
|
|
45
45
|
options: w,
|
|
@@ -54,12 +54,12 @@ var o = r(function({ value: r, onChange: o, step: s = 5, size: c = "md", disable
|
|
|
54
54
|
onValueChange: E,
|
|
55
55
|
onBlur: _
|
|
56
56
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ r("span", {
|
|
58
58
|
className: "time-select__sep",
|
|
59
59
|
"aria-hidden": "true",
|
|
60
60
|
children: ":"
|
|
61
61
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ r(e, {
|
|
63
63
|
options: T,
|
|
64
64
|
value: A,
|
|
65
65
|
placeholder: S,
|
|
@@ -72,10 +72,10 @@ var o = r(function({ value: r, onChange: o, step: s = 5, size: c = "md", disable
|
|
|
72
72
|
onValueChange: D,
|
|
73
73
|
onBlur: _
|
|
74
74
|
}),
|
|
75
|
-
p && /* @__PURE__ */
|
|
75
|
+
p && /* @__PURE__ */ r("input", {
|
|
76
76
|
type: "hidden",
|
|
77
77
|
name: p,
|
|
78
|
-
value:
|
|
78
|
+
value: t == null ? "" : `${a(t.h)}:${a(t.m)}`
|
|
79
79
|
})
|
|
80
80
|
]
|
|
81
81
|
});
|
package/dist/toaster.js
CHANGED
|
@@ -4,8 +4,8 @@ import { Button as e } from "./button.js";
|
|
|
4
4
|
import { CloseButton as t } from "./close-button.js";
|
|
5
5
|
import { t as n } from "./_shared/css-properties.js";
|
|
6
6
|
import { TOAST_DURATION as r, setToastDefaultDuration as i, syncLiveToasts as a, toastManager as o } from "./toast.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useEffect as s } from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { Toast as u } from "@base-ui/react/toast";
|
|
10
10
|
//#region src/stories/molecules/Toast/Toaster.tsx
|
|
11
11
|
var d = 8, f = {
|
|
@@ -24,7 +24,7 @@ function p(e, t) {
|
|
|
24
24
|
}
|
|
25
25
|
function m({ position: r, containerAriaLabel: i, closeLabel: o, closeButton: d, gap: f, expand: m }) {
|
|
26
26
|
let { toasts: h } = u.useToastManager(), [g, _] = r.split("-"), v = h.map((e) => e.id).join(",");
|
|
27
|
-
|
|
27
|
+
s(() => {
|
|
28
28
|
a(v ? v.split(",") : []);
|
|
29
29
|
}, [v]);
|
|
30
30
|
let y = n({ "--toast-gap": `${f}px` }), b = [
|
|
@@ -33,40 +33,40 @@ function m({ position: r, containerAriaLabel: i, closeLabel: o, closeButton: d,
|
|
|
33
33
|
_ === "right" ? "" : `toaster--${_}`,
|
|
34
34
|
m ? "toaster--expanded" : ""
|
|
35
35
|
].filter(Boolean).join(" ");
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ c(u.Portal, { children: /* @__PURE__ */ c(u.Viewport, {
|
|
37
37
|
ref: y,
|
|
38
38
|
className: b,
|
|
39
39
|
"aria-label": i,
|
|
40
|
-
children: h.map((n) => /* @__PURE__ */
|
|
40
|
+
children: h.map((n) => /* @__PURE__ */ l(u.Root, {
|
|
41
41
|
toast: n,
|
|
42
42
|
className: p(n.type, d),
|
|
43
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ l("div", {
|
|
44
44
|
className: "alert__content",
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ c(u.Title, { className: "alert__title" }),
|
|
47
|
+
/* @__PURE__ */ c(u.Description, { className: "alert__description" }),
|
|
48
|
+
/* @__PURE__ */ c(u.Action, {
|
|
49
49
|
className: "toast__action",
|
|
50
|
-
render: /* @__PURE__ */
|
|
50
|
+
render: /* @__PURE__ */ c(e, {
|
|
51
51
|
variant: "ghost",
|
|
52
52
|
size: "sm"
|
|
53
53
|
})
|
|
54
54
|
})
|
|
55
55
|
]
|
|
56
|
-
}), d && /* @__PURE__ */
|
|
56
|
+
}), d && /* @__PURE__ */ c(u.Close, {
|
|
57
57
|
className: "alert__close",
|
|
58
|
-
render: /* @__PURE__ */
|
|
58
|
+
render: /* @__PURE__ */ c(t, { label: o })
|
|
59
59
|
})]
|
|
60
60
|
}, n.id))
|
|
61
61
|
}) });
|
|
62
62
|
}
|
|
63
|
-
function h({ position: e = "bottom-right", containerAriaLabel: t = "Notificaciones", closeLabel: n = "Cerrar", closeButton: a = !0, duration:
|
|
64
|
-
let g = Number.isFinite(
|
|
65
|
-
return
|
|
63
|
+
function h({ position: e = "bottom-right", containerAriaLabel: t = "Notificaciones", closeLabel: n = "Cerrar", closeButton: a = !0, duration: l = r, gap: f = d, visibleToasts: p = 3, expand: h = !1 }) {
|
|
64
|
+
let g = Number.isFinite(l) ? l : 0;
|
|
65
|
+
return s(() => i(g), [g]), /* @__PURE__ */ c(u.Provider, {
|
|
66
66
|
toastManager: o,
|
|
67
67
|
timeout: g,
|
|
68
68
|
limit: p,
|
|
69
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ c(m, {
|
|
70
70
|
position: e,
|
|
71
71
|
containerAriaLabel: t,
|
|
72
72
|
closeLabel: n,
|
package/dist/toggle-group.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './toggle-group.css';
|
|
3
3
|
import { t as e } from "./_shared/togglegroupcontext.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t, useMemo as n } from "react";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
import { ToggleGroup as i } from "@base-ui/react/toggle-group";
|
|
7
7
|
//#region src/stories/atoms/ToggleGroup/ToggleGroup.tsx
|
|
8
|
-
var a =
|
|
8
|
+
var a = t(function({ value: t, defaultValue: a, onValueChange: o, multiple: s = !1, size: c, orientation: l = "horizontal", children: u, className: d, ...f }, p) {
|
|
9
9
|
let m = [
|
|
10
10
|
"toggle-group",
|
|
11
11
|
l === "vertical" ? "toggle-group--vertical" : "",
|
|
12
12
|
d ?? ""
|
|
13
|
-
].filter(Boolean).join(" "), h =
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
].filter(Boolean).join(" "), h = n(() => ({ size: c }), [c]);
|
|
14
|
+
return /* @__PURE__ */ r(e.Provider, {
|
|
15
15
|
value: h,
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ r(i, {
|
|
17
17
|
ref: p,
|
|
18
18
|
className: m,
|
|
19
|
-
value:
|
|
19
|
+
value: t,
|
|
20
20
|
defaultValue: a,
|
|
21
21
|
multiple: s,
|
|
22
22
|
orientation: l,
|
package/dist/toggle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './toggle.css';
|
|
3
3
|
import { n as e } from "./_shared/togglegroupcontext.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t } from "react";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
6
|
import { Toggle as r } from "@base-ui/react/toggle";
|
|
7
7
|
//#region src/stories/atoms/Toggle/Toggle.tsx
|
|
8
|
-
var i =
|
|
9
|
-
let l = e(), u =
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
var i = t(function({ size: t, iconOnly: i = !1, className: a, onPressedChange: o, ...s }, c) {
|
|
9
|
+
let l = e(), u = t ?? l?.size ?? "md";
|
|
10
|
+
return /* @__PURE__ */ n(r, {
|
|
11
11
|
ref: c,
|
|
12
12
|
className: [
|
|
13
13
|
"toggle",
|
package/dist/tooltip.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './tooltip.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { forwardRef as e, useId as t, useState as n } from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { Tooltip as a } from "@base-ui/react/tooltip";
|
|
6
6
|
//#region src/stories/atoms/Tooltip/Tooltip.tsx
|
|
7
|
-
function o({ children:
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
delay:
|
|
10
|
-
...
|
|
11
|
-
children:
|
|
7
|
+
function o({ children: e, delayDuration: t = 0, skipDelayDuration: n }) {
|
|
8
|
+
return /* @__PURE__ */ r(a.Provider, {
|
|
9
|
+
delay: t,
|
|
10
|
+
...n === void 0 ? {} : { timeout: n },
|
|
11
|
+
children: e
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function s(e, t) {
|
|
@@ -19,37 +19,37 @@ function c() {
|
|
|
19
19
|
let e = document.documentElement;
|
|
20
20
|
return s(getComputedStyle(e).getPropertyValue("--tooltip-offset").trim(), e);
|
|
21
21
|
}
|
|
22
|
-
var l =
|
|
23
|
-
let y =
|
|
24
|
-
return /* @__PURE__ */
|
|
22
|
+
var l = e(function({ label: e, children: o, side: s = "top", align: l = "center", sideOffset: u, open: d, defaultOpen: f, onOpenChange: p, delayDuration: m, describe: h = !0, className: g, ..._ }, v) {
|
|
23
|
+
let y = t(), [b, x] = n(f ?? !1), S = d ?? b;
|
|
24
|
+
return /* @__PURE__ */ i(a.Root, {
|
|
25
25
|
open: d,
|
|
26
26
|
defaultOpen: f,
|
|
27
27
|
onOpenChange: (e) => {
|
|
28
28
|
d === void 0 && x(e), p?.(e);
|
|
29
29
|
},
|
|
30
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ r(a.Trigger, {
|
|
31
31
|
ref: v,
|
|
32
32
|
render: o,
|
|
33
33
|
"aria-describedby": S && h ? y : void 0,
|
|
34
34
|
...m === void 0 ? {} : { delay: m },
|
|
35
35
|
..._
|
|
36
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ r(a.Portal, { children: /* @__PURE__ */ r(a.Positioner, {
|
|
37
37
|
className: "tooltip__positioner",
|
|
38
38
|
side: s,
|
|
39
39
|
align: l,
|
|
40
40
|
sideOffset: u ?? c,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ i(a.Popup, {
|
|
42
42
|
id: y,
|
|
43
43
|
role: "tooltip",
|
|
44
44
|
className: ["tooltip", g].filter(Boolean).join(" "),
|
|
45
|
-
children: [
|
|
45
|
+
children: [e, /* @__PURE__ */ r(a.Arrow, {
|
|
46
46
|
className: "tooltip__arrow",
|
|
47
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ r("svg", {
|
|
48
48
|
width: "10",
|
|
49
49
|
height: "5",
|
|
50
50
|
viewBox: "0 0 30 10",
|
|
51
51
|
preserveAspectRatio: "none",
|
|
52
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ r("polygon", { points: "0,0 30,0 15,10" })
|
|
53
53
|
})
|
|
54
54
|
})]
|
|
55
55
|
})
|
package/dist/tree-view.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './tree-view.css';
|
|
3
3
|
import { Icon as e } from "./icon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useCallback as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/molecules/TreeView/TreeView.tsx
|
|
7
7
|
var c = 500;
|
|
8
8
|
function l(e, t, n = 1, r) {
|
|
@@ -13,18 +13,18 @@ function l(e, t, n = 1, r) {
|
|
|
13
13
|
}, ...e.children && t.has(e.id) ? l(e.children, t, n + 1, e.id) : []]);
|
|
14
14
|
}
|
|
15
15
|
function u({ items: u, expanded: d, defaultExpanded: f, onExpandedChange: p, selected: m, defaultSelected: h, onSelectedChange: g, label: _ = "Árbol", truncateFromLevel: v = 4, nodeRef: y, className: b, ...x }) {
|
|
16
|
-
let S =
|
|
16
|
+
let S = n(), C = i(null), [w, T] = a(f ?? []), E = d !== void 0, D = E ? d : w, [O, k] = a(h), A = m !== void 0, j = A ? m : O, M = r(() => new Set(D), [D]), N = r(() => l(u, M), [u, M]), [P, F] = a(void 0), I = P && N.some((e) => e.node.id === P) ? P : j && N.some((e) => e.node.id === j) ? j : N[0]?.node.id, L = i(""), R = i(0), z = t((e) => {
|
|
17
17
|
E || T(e), p?.(e);
|
|
18
|
-
}, [E, p]), B =
|
|
18
|
+
}, [E, p]), B = t((e, t) => {
|
|
19
19
|
let n = M.has(e), r = t ?? !n;
|
|
20
20
|
r !== n && z(r ? [...D, e] : D.filter((t) => t !== e));
|
|
21
21
|
}, [
|
|
22
22
|
D,
|
|
23
23
|
M,
|
|
24
24
|
z
|
|
25
|
-
]), V =
|
|
25
|
+
]), V = t((e) => {
|
|
26
26
|
A || k(e), g?.(e);
|
|
27
|
-
}, [A, g]), H =
|
|
27
|
+
}, [A, g]), H = t((e) => {
|
|
28
28
|
let t = N.filter((t) => t.parentId === e.parentId && t.node.children?.length).map((e) => e.node.id).filter((e) => !M.has(e));
|
|
29
29
|
t.length !== 0 && z([...D, ...t]);
|
|
30
30
|
}, [
|
|
@@ -32,9 +32,9 @@ function u({ items: u, expanded: d, defaultExpanded: f, onExpandedChange: p, sel
|
|
|
32
32
|
N,
|
|
33
33
|
M,
|
|
34
34
|
z
|
|
35
|
-
]), U =
|
|
35
|
+
]), U = t((e) => `${S}-${e}`, [S]), W = t((e) => {
|
|
36
36
|
e && (F(e), C.current?.querySelector(`[data-tree-item="${CSS.escape(e)}"]`)?.focus());
|
|
37
|
-
}, []), G =
|
|
37
|
+
}, []), G = t((e, t) => {
|
|
38
38
|
let n = Date.now(), r = n - R.current > c ? e : L.current + e;
|
|
39
39
|
L.current = r, R.current = n;
|
|
40
40
|
let i = r.length === 1 ? t + 1 : Math.max(t, 0), a = r.toLowerCase();
|
|
@@ -79,80 +79,80 @@ function u({ items: u, expanded: d, defaultExpanded: f, onExpandedChange: p, sel
|
|
|
79
79
|
break;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function q(
|
|
83
|
-
return
|
|
84
|
-
let
|
|
85
|
-
return /* @__PURE__ */
|
|
82
|
+
function q(t, n, r) {
|
|
83
|
+
return t.map((t) => {
|
|
84
|
+
let i = !!t.children?.length, a = i && M.has(t.id), c = j === t.id, l = a && t.iconExpanded || t.icon, u = n >= v, d = u && typeof t.label == "string" ? t.label : void 0, f = t.dropTarget ? "target" : t.dropDisabled ? "disabled" : void 0;
|
|
85
|
+
return /* @__PURE__ */ s("li", {
|
|
86
86
|
role: "treeitem",
|
|
87
|
-
"data-tree-item":
|
|
88
|
-
"aria-labelledby": U(
|
|
89
|
-
"aria-expanded":
|
|
87
|
+
"data-tree-item": t.id,
|
|
88
|
+
"aria-labelledby": U(t.id),
|
|
89
|
+
"aria-expanded": i ? a : void 0,
|
|
90
90
|
"aria-selected": c,
|
|
91
|
-
"aria-level":
|
|
92
|
-
"aria-disabled":
|
|
91
|
+
"aria-level": n,
|
|
92
|
+
"aria-disabled": t.disabled || void 0,
|
|
93
93
|
"data-drop": f,
|
|
94
|
-
tabIndex: I ===
|
|
94
|
+
tabIndex: I === t.id ? 0 : -1,
|
|
95
95
|
className: [
|
|
96
96
|
"tree-view__item",
|
|
97
97
|
c ? "tree-view__item--selected" : "",
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
t.disabled ? "tree-view__item--disabled" : "",
|
|
99
|
+
t.dropTarget ? "tree-view__item--drop-target" : "",
|
|
100
|
+
t.dropDisabled ? "tree-view__item--drop-disabled" : ""
|
|
101
101
|
].filter(Boolean).join(" "),
|
|
102
102
|
onKeyDown: (e) => {
|
|
103
103
|
e.target === e.currentTarget && K(e, {
|
|
104
|
-
node:
|
|
105
|
-
level:
|
|
106
|
-
parentId:
|
|
104
|
+
node: t,
|
|
105
|
+
level: n,
|
|
106
|
+
parentId: r
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
109
|
onFocus: (e) => {
|
|
110
|
-
e.target === e.currentTarget && F(
|
|
110
|
+
e.target === e.currentTarget && F(t.id);
|
|
111
111
|
},
|
|
112
|
-
onClick:
|
|
113
|
-
e.stopPropagation(),
|
|
112
|
+
onClick: t.disabled ? void 0 : (e) => {
|
|
113
|
+
e.stopPropagation(), i && B(t.id), V(t.id), W(t.id);
|
|
114
114
|
},
|
|
115
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ s("span", {
|
|
116
116
|
className: "tree-view__row",
|
|
117
|
-
ref: y ? (e) => y(
|
|
117
|
+
ref: y ? (e) => y(t.id, e) : void 0,
|
|
118
118
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ o("span", {
|
|
120
120
|
className: "tree-view__chevron-slot",
|
|
121
121
|
"aria-hidden": "true",
|
|
122
|
-
children:
|
|
122
|
+
children: i && /* @__PURE__ */ o(e, {
|
|
123
123
|
name: "chevron",
|
|
124
124
|
className: "tree-view__chevron",
|
|
125
125
|
size: "sm"
|
|
126
126
|
})
|
|
127
127
|
}),
|
|
128
|
-
l && /* @__PURE__ */
|
|
128
|
+
l && /* @__PURE__ */ o("span", {
|
|
129
129
|
className: "tree-view__icon",
|
|
130
130
|
"aria-hidden": "true",
|
|
131
131
|
children: l
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ o("span", {
|
|
134
134
|
className: ["tree-view__label", u ? "tree-view__label--truncated" : ""].filter(Boolean).join(" "),
|
|
135
|
-
id: U(
|
|
135
|
+
id: U(t.id),
|
|
136
136
|
title: d,
|
|
137
|
-
children:
|
|
137
|
+
children: t.label
|
|
138
138
|
}),
|
|
139
|
-
|
|
139
|
+
t.actions && /* @__PURE__ */ o("span", {
|
|
140
140
|
className: "tree-view__actions",
|
|
141
141
|
onClick: (e) => e.stopPropagation(),
|
|
142
142
|
onKeyDown: (e) => e.stopPropagation(),
|
|
143
143
|
onKeyUp: (e) => e.stopPropagation(),
|
|
144
|
-
children:
|
|
144
|
+
children: t.actions
|
|
145
145
|
})
|
|
146
146
|
]
|
|
147
|
-
}),
|
|
147
|
+
}), i && a && /* @__PURE__ */ o("ul", {
|
|
148
148
|
role: "group",
|
|
149
149
|
className: "tree-view__group",
|
|
150
|
-
children: q(
|
|
150
|
+
children: q(t.children, n + 1, t.id)
|
|
151
151
|
})]
|
|
152
|
-
},
|
|
152
|
+
}, t.id);
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ o("ul", {
|
|
156
156
|
ref: C,
|
|
157
157
|
role: "tree",
|
|
158
158
|
"aria-label": _,
|
package/dist/uptime-bars.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './uptime-bars.css';
|
|
3
3
|
import { Tooltip as e } from "./tooltip.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t, useRef as n, useState as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/molecules/UptimeBars/uptimeStatus.ts
|
|
7
7
|
var o = {
|
|
8
8
|
ok: 99.65,
|
|
@@ -13,11 +13,11 @@ function s(e, t) {
|
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/stories/molecules/UptimeBars/UptimeBars.tsx
|
|
16
|
-
var c =
|
|
16
|
+
var c = t(function({ points: t, summary: c, label: l = "Disponibilidad", startLabel: u, endLabel: d, thresholds: f, locale: p = "es-ES", maximumFractionDigits: m = 2, pointLabel: h, noDataLabel: g = "sin datos", tooltips: _ = !0, className: v, ...y }, b) {
|
|
17
17
|
let x = {
|
|
18
18
|
...o,
|
|
19
19
|
...f
|
|
20
|
-
}, S =
|
|
20
|
+
}, S = n([]), [C, w] = r(0), T = new Intl.NumberFormat(p, {
|
|
21
21
|
style: "percent",
|
|
22
22
|
maximumFractionDigits: m
|
|
23
23
|
}), E = (e) => e === null || !Number.isFinite(e) ? null : T.format(e / 100), D = (e, t) => {
|
|
@@ -25,70 +25,70 @@ var c = r(function({ points: r, summary: c, label: l = "Disponibilidad", startLa
|
|
|
25
25
|
let n = `${e.label}: ${t ?? g}`;
|
|
26
26
|
return e.detail ? `${n}. ${e.detail}` : n;
|
|
27
27
|
}, O = (e) => {
|
|
28
|
-
let
|
|
29
|
-
w(
|
|
30
|
-
}, k = (e,
|
|
31
|
-
let
|
|
28
|
+
let n = Math.max(0, Math.min(t.length - 1, e));
|
|
29
|
+
w(n), S.current[n]?.focus();
|
|
30
|
+
}, k = (e, n) => {
|
|
31
|
+
let r = {
|
|
32
32
|
ArrowRight: 1,
|
|
33
33
|
ArrowDown: 1,
|
|
34
34
|
ArrowLeft: -1,
|
|
35
35
|
ArrowUp: -1
|
|
36
36
|
}[e.key];
|
|
37
|
-
if (
|
|
38
|
-
e.preventDefault(), O(
|
|
37
|
+
if (r) {
|
|
38
|
+
e.preventDefault(), O(n + r);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
e.key === "Home" ? (e.preventDefault(), O(0)) : e.key === "End" && (e.preventDefault(), O(
|
|
42
|
-
}, A = Math.max(0, Math.min(C,
|
|
43
|
-
return /* @__PURE__ */
|
|
41
|
+
e.key === "Home" ? (e.preventDefault(), O(0)) : e.key === "End" && (e.preventDefault(), O(t.length - 1));
|
|
42
|
+
}, A = Math.max(0, Math.min(C, t.length - 1));
|
|
43
|
+
return /* @__PURE__ */ a("div", {
|
|
44
44
|
ref: b,
|
|
45
45
|
className: ["uptime-bars", v].filter(Boolean).join(" "),
|
|
46
46
|
...y,
|
|
47
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ i("ol", {
|
|
48
48
|
className: "uptime-bars__list",
|
|
49
49
|
"aria-label": l,
|
|
50
|
-
children:
|
|
51
|
-
let
|
|
52
|
-
className: `uptime-bars__bar uptime-bars__bar--${s(
|
|
50
|
+
children: t.map((t, n) => {
|
|
51
|
+
let r = E(t.value), o = /* @__PURE__ */ i("span", {
|
|
52
|
+
className: `uptime-bars__bar uptime-bars__bar--${s(t.value, x)}`,
|
|
53
53
|
role: "img",
|
|
54
|
-
"aria-label": D(
|
|
55
|
-
tabIndex: _ ?
|
|
56
|
-
onKeyDown: _ ? (e) => k(e,
|
|
57
|
-
onFocus: _ ? () => w(
|
|
54
|
+
"aria-label": D(t, r),
|
|
55
|
+
tabIndex: _ ? n === A ? 0 : -1 : void 0,
|
|
56
|
+
onKeyDown: _ ? (e) => k(e, n) : void 0,
|
|
57
|
+
onFocus: _ ? () => w(n) : void 0
|
|
58
58
|
});
|
|
59
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ i("li", {
|
|
60
60
|
className: "uptime-bars__item",
|
|
61
|
-
children: _ ? /* @__PURE__ */
|
|
61
|
+
children: _ ? /* @__PURE__ */ i(e, {
|
|
62
62
|
ref: (e) => {
|
|
63
|
-
S.current[
|
|
63
|
+
S.current[n] = e;
|
|
64
64
|
},
|
|
65
|
-
label: /* @__PURE__ */
|
|
65
|
+
label: /* @__PURE__ */ a("span", {
|
|
66
66
|
className: "uptime-bars__tooltip",
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ i("span", {
|
|
69
69
|
className: "uptime-bars__tooltip-label",
|
|
70
|
-
children:
|
|
70
|
+
children: t.label
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
72
|
+
/* @__PURE__ */ i("span", { children: r ?? g }),
|
|
73
|
+
t.detail ? /* @__PURE__ */ i("span", { children: t.detail }) : null
|
|
74
74
|
]
|
|
75
75
|
}),
|
|
76
76
|
children: o
|
|
77
77
|
}) : o
|
|
78
|
-
}, `${
|
|
78
|
+
}, `${t.label}-${n}`);
|
|
79
79
|
})
|
|
80
|
-
}), /* @__PURE__ */
|
|
80
|
+
}), /* @__PURE__ */ a("p", {
|
|
81
81
|
className: "uptime-bars__footer",
|
|
82
82
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ i("span", {
|
|
84
84
|
className: "uptime-bars__edge",
|
|
85
85
|
children: u
|
|
86
86
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ i("span", {
|
|
88
88
|
className: "uptime-bars__summary",
|
|
89
89
|
children: c
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ i("span", {
|
|
92
92
|
className: "uptime-bars__edge uptime-bars__edge--end",
|
|
93
93
|
children: d
|
|
94
94
|
})
|
package/dist/user-message.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import './user-message.css';
|
|
2
2
|
import { MessageBubble as e } from "./message-bubble.js";
|
|
3
3
|
import { t } from "./_shared/messagetimestamp.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as n } from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/molecules/UserMessage/UserMessage.tsx
|
|
7
|
-
var a =
|
|
7
|
+
var a = n(function({ children: n, author: a, timestamp: o, locale: s, timestampFormat: c, className: l, ...u }, d) {
|
|
8
8
|
let f = t(o, s, c);
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
10
|
ref: d,
|
|
11
11
|
className: `user-message${l ? ` ${l}` : ""}`,
|
|
12
12
|
...u,
|
|
13
13
|
children: [
|
|
14
|
-
a && /* @__PURE__ */
|
|
14
|
+
a && /* @__PURE__ */ r("span", {
|
|
15
15
|
className: "user-message__author",
|
|
16
16
|
children: a
|
|
17
17
|
}),
|
|
18
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ r(e, {
|
|
19
19
|
role: "user",
|
|
20
|
-
children:
|
|
20
|
+
children: n
|
|
21
21
|
}),
|
|
22
|
-
f && /* @__PURE__ */
|
|
22
|
+
f && /* @__PURE__ */ r("time", {
|
|
23
23
|
className: "user-message__timestamp",
|
|
24
24
|
dateTime: f.dateTime,
|
|
25
25
|
children: f.label
|