@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/alert.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './alert.css';
|
|
3
3
|
import { CloseButton as e } from "./close-button.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t, useState as n } from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/molecules/Alert/Alert.tsx
|
|
7
7
|
var a = {
|
|
8
8
|
default: "status",
|
|
9
9
|
success: "status",
|
|
10
10
|
error: "alert",
|
|
11
11
|
warning: "alert"
|
|
12
|
-
}, o =
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
}, o = t(function({ className: e, children: t, ...n }, i) {
|
|
13
|
+
return /* @__PURE__ */ r("p", {
|
|
14
14
|
ref: i,
|
|
15
15
|
className: ["alert__title", e ?? ""].filter(Boolean).join(" "),
|
|
16
|
-
...
|
|
17
|
-
children:
|
|
16
|
+
...n,
|
|
17
|
+
children: t
|
|
18
18
|
});
|
|
19
|
-
}), s =
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
}), s = t(function({ className: e, children: t, ...n }, i) {
|
|
20
|
+
return /* @__PURE__ */ r("div", {
|
|
21
21
|
ref: i,
|
|
22
22
|
className: ["alert__description", e ?? ""].filter(Boolean).join(" "),
|
|
23
|
-
...
|
|
24
|
-
children:
|
|
23
|
+
...n,
|
|
24
|
+
children: t
|
|
25
25
|
});
|
|
26
|
-
}), c =
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
}), c = t(function({ className: e, children: t, ...n }, i) {
|
|
27
|
+
return /* @__PURE__ */ r("div", {
|
|
28
28
|
ref: i,
|
|
29
29
|
className: ["alert__actions", e ?? ""].filter(Boolean).join(" "),
|
|
30
|
-
...
|
|
31
|
-
children:
|
|
30
|
+
...n,
|
|
31
|
+
children: t
|
|
32
32
|
});
|
|
33
|
-
}), l =
|
|
34
|
-
let [v, y] =
|
|
33
|
+
}), l = t(function({ variant: t = "default", title: o, description: s, actions: c, dismissible: l = !1, onDismiss: u, finalFocus: d, closeLabel: f = "Cerrar", className: p, children: m, role: h, ...g }, _) {
|
|
34
|
+
let [v, y] = n(!1);
|
|
35
35
|
if (v) return null;
|
|
36
36
|
let b = [
|
|
37
37
|
"alert",
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
t === "default" ? "" : `alert--${t}`,
|
|
39
|
+
t === "success" || t === "error" ? "surface-dark" : "",
|
|
40
40
|
l ? "alert--dismissible" : "",
|
|
41
41
|
p ?? ""
|
|
42
|
-
].filter(Boolean).join(" "), x =
|
|
42
|
+
].filter(Boolean).join(" "), x = t === "default" ? " surface-invert" : "";
|
|
43
43
|
function S() {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
45
|
let e = d?.current;
|
|
@@ -53,29 +53,29 @@ var a = {
|
|
|
53
53
|
function C() {
|
|
54
54
|
S(), u ? u() : y(!0);
|
|
55
55
|
}
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ i("div", {
|
|
57
57
|
ref: _,
|
|
58
|
-
role: h ?? a[
|
|
58
|
+
role: h ?? a[t],
|
|
59
59
|
className: b,
|
|
60
60
|
...g,
|
|
61
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ i("div", {
|
|
62
62
|
className: `alert__content${x}`,
|
|
63
63
|
children: [
|
|
64
|
-
o && /* @__PURE__ */
|
|
64
|
+
o && /* @__PURE__ */ r("p", {
|
|
65
65
|
className: "alert__title",
|
|
66
66
|
children: o
|
|
67
67
|
}),
|
|
68
|
-
s && /* @__PURE__ */
|
|
68
|
+
s && /* @__PURE__ */ r("div", {
|
|
69
69
|
className: "alert__description",
|
|
70
70
|
children: s
|
|
71
71
|
}),
|
|
72
72
|
m,
|
|
73
|
-
c && /* @__PURE__ */
|
|
73
|
+
c && /* @__PURE__ */ r("div", {
|
|
74
74
|
className: "alert__actions",
|
|
75
75
|
children: c
|
|
76
76
|
})
|
|
77
77
|
]
|
|
78
|
-
}), l && /* @__PURE__ */
|
|
78
|
+
}), l && /* @__PURE__ */ r(e, {
|
|
79
79
|
className: `alert__close${x}`,
|
|
80
80
|
label: f,
|
|
81
81
|
onClick: C
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './annotation-thread.css';
|
|
2
2
|
import { Tag as e } from "./tag.js";
|
|
3
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
3
|
import "react";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
5
|
//#region src/stories/organisms/AnnotationThread/AnnotationThread.tsx
|
|
6
6
|
var r = {
|
|
7
7
|
day: "numeric",
|
package/dist/app-header.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import './app-header.css';
|
|
3
3
|
import { MenuButton as e } from "./menu-button.js";
|
|
4
4
|
import { t } from "./_shared/appshellcontext.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useContext as n, useState as r } from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
//#region src/stories/sections/AppHeader/AppHeader.tsx
|
|
8
8
|
function o({ start: o, notifications: s, end: c, menuLabel: l = "Menú de navegación", menuCloseLabel: u, sidebarId: d }) {
|
|
9
|
-
let f =
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
let f = n(t), [p, m] = r(!1), h = f ? f.sidebar === "open" : p;
|
|
10
|
+
return /* @__PURE__ */ a("header", {
|
|
11
11
|
className: "app-header",
|
|
12
12
|
children: [
|
|
13
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ i(e, {
|
|
14
14
|
isOpen: h,
|
|
15
15
|
onClick: f ? f.toggleSidebar : () => m((e) => !e),
|
|
16
16
|
label: l,
|
|
@@ -18,15 +18,15 @@ function o({ start: o, notifications: s, end: c, menuLabel: l = "Menú de navega
|
|
|
18
18
|
"aria-controls": d,
|
|
19
19
|
"aria-expanded": h
|
|
20
20
|
}),
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ i("div", {
|
|
22
22
|
className: "app-header__start",
|
|
23
23
|
children: o
|
|
24
24
|
}),
|
|
25
|
-
s && /* @__PURE__ */
|
|
25
|
+
s && /* @__PURE__ */ i("div", {
|
|
26
26
|
className: "app-header__notifications",
|
|
27
27
|
children: s
|
|
28
28
|
}),
|
|
29
|
-
c && /* @__PURE__ */
|
|
29
|
+
c && /* @__PURE__ */ i("div", {
|
|
30
30
|
className: "app-header__end",
|
|
31
31
|
children: c
|
|
32
32
|
})
|
package/dist/app-launcher.js
CHANGED
|
@@ -3,19 +3,19 @@ import './app-launcher.css';
|
|
|
3
3
|
import { Icon as e } from "./icon.js";
|
|
4
4
|
import { Tag as t } from "./tag.js";
|
|
5
5
|
import { Modal as n } from "./modal.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useState as r } from "react";
|
|
7
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
8
|
import { Popover as s } from "@base-ui/react/popover";
|
|
9
9
|
//#region src/stories/molecules/AppLauncher/AppLauncher.tsx
|
|
10
10
|
function c({ app: e, isCurrent: n, newLabel: r }) {
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ o("a", {
|
|
12
12
|
href: e.url,
|
|
13
13
|
className: `app-launcher__tile${n ? " app-launcher__tile--active" : ""}`,
|
|
14
14
|
"aria-current": n ? "page" : void 0,
|
|
15
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ a("span", {
|
|
16
16
|
className: "app-launcher__tile-name",
|
|
17
17
|
children: e.name
|
|
18
|
-
}), e.isNew && /* @__PURE__ */
|
|
18
|
+
}), e.isNew && /* @__PURE__ */ a(t, {
|
|
19
19
|
variant: "info",
|
|
20
20
|
className: "app-launcher__tile-badge",
|
|
21
21
|
children: r
|
|
@@ -23,46 +23,46 @@ function c({ app: e, isCurrent: n, newLabel: r }) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function l({ apps: e, currentAppId: t, newLabel: n }) {
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ a("ul", {
|
|
27
27
|
className: "app-launcher__grid",
|
|
28
28
|
role: "list",
|
|
29
|
-
children: e.map((e) => /* @__PURE__ */
|
|
29
|
+
children: e.map((e) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(c, {
|
|
30
30
|
app: e,
|
|
31
31
|
isCurrent: e.id === t,
|
|
32
32
|
newLabel: n
|
|
33
33
|
}) }, e.id))
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function u({ apps: t, labels: n, currentAppId: r, open:
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
open:
|
|
36
|
+
function u({ apps: t, labels: n, currentAppId: r, open: i, defaultOpen: c, onOpenChange: u }) {
|
|
37
|
+
return /* @__PURE__ */ o(s.Root, {
|
|
38
|
+
open: i,
|
|
39
39
|
defaultOpen: c,
|
|
40
40
|
onOpenChange: (e) => u?.(e),
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ a(s.Trigger, { render: n.trigger ? /* @__PURE__ */ o("button", {
|
|
42
42
|
type: "button",
|
|
43
43
|
className: "app-launcher__trigger app-launcher__trigger--label",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ a(e, {
|
|
45
45
|
name: "grid",
|
|
46
46
|
size: "md"
|
|
47
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ a("span", {
|
|
48
48
|
className: "app-launcher__trigger-label",
|
|
49
49
|
children: n.trigger
|
|
50
50
|
})]
|
|
51
|
-
}) : /* @__PURE__ */
|
|
51
|
+
}) : /* @__PURE__ */ a("button", {
|
|
52
52
|
type: "button",
|
|
53
53
|
className: "app-launcher__trigger",
|
|
54
54
|
"aria-label": n.open,
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ a(e, {
|
|
56
56
|
name: "grid",
|
|
57
57
|
size: "md"
|
|
58
58
|
})
|
|
59
|
-
}) }), /* @__PURE__ */
|
|
59
|
+
}) }), /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(s.Positioner, {
|
|
60
60
|
className: "app-launcher__positioner",
|
|
61
61
|
sideOffset: 4,
|
|
62
62
|
align: "end",
|
|
63
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ a(s.Popup, {
|
|
64
64
|
className: "app-launcher__content",
|
|
65
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ a(l, {
|
|
66
66
|
apps: t,
|
|
67
67
|
currentAppId: r,
|
|
68
68
|
newLabel: n.new
|
|
@@ -72,48 +72,48 @@ function u({ apps: t, labels: n, currentAppId: r, open: o, defaultOpen: c, onOpe
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
function d(e, t, n) {
|
|
75
|
-
let [
|
|
76
|
-
return [e ??
|
|
77
|
-
e === void 0 &&
|
|
75
|
+
let [i, a] = r(t ?? !1);
|
|
76
|
+
return [e ?? i, (t) => {
|
|
77
|
+
e === void 0 && a(t), n?.(t);
|
|
78
78
|
}];
|
|
79
79
|
}
|
|
80
|
-
function f({ apps: t, labels:
|
|
80
|
+
function f({ apps: t, labels: r, currentAppId: s, open: c, defaultOpen: u, onOpenChange: f }) {
|
|
81
81
|
let [p, m] = d(c, u, f);
|
|
82
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ o(i, { children: [r.trigger ? /* @__PURE__ */ o("button", {
|
|
83
83
|
type: "button",
|
|
84
84
|
className: "app-launcher__trigger app-launcher__trigger--label",
|
|
85
85
|
"aria-haspopup": "dialog",
|
|
86
86
|
onClick: () => m(!0),
|
|
87
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ a(e, {
|
|
88
88
|
name: "grid",
|
|
89
89
|
size: "md"
|
|
90
|
-
}), /* @__PURE__ */
|
|
90
|
+
}), /* @__PURE__ */ a("span", {
|
|
91
91
|
className: "app-launcher__trigger-label",
|
|
92
|
-
children:
|
|
92
|
+
children: r.trigger
|
|
93
93
|
})]
|
|
94
|
-
}) : /* @__PURE__ */
|
|
94
|
+
}) : /* @__PURE__ */ a("button", {
|
|
95
95
|
type: "button",
|
|
96
96
|
className: "app-launcher__trigger",
|
|
97
|
-
"aria-label":
|
|
97
|
+
"aria-label": r.open,
|
|
98
98
|
"aria-haspopup": "dialog",
|
|
99
99
|
onClick: () => m(!0),
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ a(e, {
|
|
101
101
|
name: "grid",
|
|
102
102
|
size: "md"
|
|
103
103
|
})
|
|
104
|
-
}), /* @__PURE__ */
|
|
104
|
+
}), /* @__PURE__ */ a(n, {
|
|
105
105
|
open: p,
|
|
106
106
|
onClose: () => m(!1),
|
|
107
|
-
title:
|
|
108
|
-
children: /* @__PURE__ */
|
|
107
|
+
title: r.title ?? "Aplicaciones",
|
|
108
|
+
children: /* @__PURE__ */ a(l, {
|
|
109
109
|
apps: t,
|
|
110
110
|
currentAppId: s,
|
|
111
|
-
newLabel:
|
|
111
|
+
newLabel: r.new
|
|
112
112
|
})
|
|
113
113
|
})] });
|
|
114
114
|
}
|
|
115
115
|
function p({ presentation: e = "modal", ...t }) {
|
|
116
|
-
return
|
|
116
|
+
return a(e === "popover" ? u : f, { ...t });
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
119
|
export { p as AppLauncher };
|
package/dist/app-shell.js
CHANGED
|
@@ -4,24 +4,24 @@ import { SkipLink as e } from "./skip-link.js";
|
|
|
4
4
|
import { TooltipProvider as t } from "./tooltip.js";
|
|
5
5
|
import { t as n } from "./_shared/css-properties.js";
|
|
6
6
|
import { n as r, t as i } from "./_shared/appshellcontext.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
//#region src/stories/sections/AppShell/AppShell.tsx
|
|
10
10
|
var d = "(min-width: 1024px)";
|
|
11
11
|
function f() {
|
|
12
|
-
let [e, t] =
|
|
13
|
-
return
|
|
12
|
+
let [e, t] = c(() => typeof window > "u" ? !0 : window.matchMedia(d).matches);
|
|
13
|
+
return o(() => {
|
|
14
14
|
let e = window.matchMedia(d), n = () => t(e.matches);
|
|
15
15
|
return n(), e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
16
16
|
}, []), e;
|
|
17
17
|
}
|
|
18
18
|
function p({ header: r, sidebar: d, children: p, defaultSidebar: m = "open", sidebarState: h, onSidebarChange: g, defaultSidebarWidth: _, onSidebarWidthChange: v, skipLabel: y = "Saltar al contenido principal" }) {
|
|
19
|
-
let b = f(), [x, S] =
|
|
19
|
+
let b = f(), [x, S] = c(m), [C, w] = c(!1), [T, E] = c(_), D = b ? h ?? x : C ? "open" : "closed", O = a((e) => {
|
|
20
20
|
b ? (S(e), g?.(e)) : w(e === "open");
|
|
21
|
-
}, [b, g]), k =
|
|
21
|
+
}, [b, g]), k = a(() => O(D === "open" ? "closed" : "open"), [O, D]), A = a(() => O("closed"), [O]), j = a((e) => {
|
|
22
22
|
E(e), v?.(e);
|
|
23
23
|
}, [v]);
|
|
24
|
-
|
|
24
|
+
o(() => {
|
|
25
25
|
if (b || !C) return;
|
|
26
26
|
let e = (e) => {
|
|
27
27
|
e.key === "Escape" && w(!1);
|
|
@@ -32,7 +32,7 @@ function p({ header: r, sidebar: d, children: p, defaultSidebar: m = "open", sid
|
|
|
32
32
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
33
33
|
};
|
|
34
34
|
}, [b, C]);
|
|
35
|
-
let M =
|
|
35
|
+
let M = s(() => ({
|
|
36
36
|
sidebar: D,
|
|
37
37
|
setSidebar: O,
|
|
38
38
|
sidebarWidth: T ?? 0,
|
|
@@ -49,25 +49,25 @@ function p({ header: r, sidebar: d, children: p, defaultSidebar: m = "open", sid
|
|
|
49
49
|
A,
|
|
50
50
|
b
|
|
51
51
|
]), N = n({ "--app-shell-sidebar-width": T ? `${T}px` : void 0 }), P = !b && C;
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ l(i.Provider, {
|
|
53
53
|
value: M,
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ l(e, {
|
|
55
55
|
href: "#main-content",
|
|
56
56
|
children: y
|
|
57
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ u("div", {
|
|
58
58
|
ref: N,
|
|
59
59
|
className: "app-shell",
|
|
60
60
|
"data-sidebar": D,
|
|
61
|
-
children: [r, /* @__PURE__ */
|
|
61
|
+
children: [r, /* @__PURE__ */ u("div", {
|
|
62
62
|
className: "app-shell__body",
|
|
63
63
|
children: [
|
|
64
64
|
d,
|
|
65
|
-
P && /* @__PURE__ */
|
|
65
|
+
P && /* @__PURE__ */ l("div", {
|
|
66
66
|
className: "app-shell__backdrop",
|
|
67
67
|
onClick: A,
|
|
68
68
|
"aria-hidden": "true"
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ l("main", {
|
|
71
71
|
id: "main-content",
|
|
72
72
|
tabIndex: -1,
|
|
73
73
|
className: "app-shell__content",
|
|
@@ -2,25 +2,25 @@ import './assistant-message.css';
|
|
|
2
2
|
import { MessageBubble as e } from "./message-bubble.js";
|
|
3
3
|
import { TypingIndicator as t } from "./typing-indicator.js";
|
|
4
4
|
import { t as n } from "./_shared/messagetimestamp.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { forwardRef as r } from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
//#region src/stories/molecules/AssistantMessage/AssistantMessage.tsx
|
|
8
|
-
var o =
|
|
8
|
+
var o = r(function({ children: r, model: o, timestamp: s, locale: c, timestampFormat: l, isStreaming: u = !1, streamingLabel: d, className: f, ...p }, m) {
|
|
9
9
|
let h = n(s, c, l);
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ a("div", {
|
|
11
11
|
ref: m,
|
|
12
12
|
className: `assistant-message${f ? ` ${f}` : ""}`,
|
|
13
13
|
...p,
|
|
14
14
|
children: [
|
|
15
|
-
o && /* @__PURE__ */
|
|
15
|
+
o && /* @__PURE__ */ i("span", {
|
|
16
16
|
className: "assistant-message__model",
|
|
17
17
|
children: o
|
|
18
18
|
}),
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ i(e, {
|
|
20
20
|
role: "assistant",
|
|
21
|
-
children: u ? /* @__PURE__ */
|
|
21
|
+
children: u ? /* @__PURE__ */ i(t, { label: d }) : r
|
|
22
22
|
}),
|
|
23
|
-
h && !u && /* @__PURE__ */
|
|
23
|
+
h && !u && /* @__PURE__ */ i("time", {
|
|
24
24
|
className: "assistant-message__timestamp",
|
|
25
25
|
dateTime: h.dateTime,
|
|
26
26
|
children: h.label
|
|
@@ -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/AsyncMultiSelectField/AsyncMultiSelectField.tsx
|
|
11
|
-
var l =
|
|
12
|
-
let N = i(u), P = t(b), F =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var l = a(function({ id: a, label: l, labelHidden: u, onSearch: d, value: f, defaultValue: p, onValueChange: m, selectedOptions: h, placeholder: g, name: _, disabled: v, readOnly: y, size: b, debounceMs: x, required: S, error: C = !1, errorMessage: w, helperText: T, className: E, emptyMessage: D, removeLabel: O, loadingLabel: k, container: A, onBlur: j }, M) {
|
|
12
|
+
let N = i(u), P = t(b), F = o(), I = a ?? F, L = w ? `${I}-error` : void 0, R = T ? `${I}-helper` : void 0, z = [L, R].filter(Boolean).join(" ") || void 0, B = C || !!w;
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
14
|
className: ["async-multi-select-field", E].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ s(r, {
|
|
17
17
|
htmlFor: I,
|
|
18
18
|
hidden: N,
|
|
19
19
|
size: P,
|
|
20
20
|
children: l
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ s(e, {
|
|
23
23
|
ref: M,
|
|
24
24
|
id: I,
|
|
25
25
|
name: _,
|
|
@@ -42,11 +42,11 @@ var l = s(function({ id: s, label: l, labelHidden: u, onSearch: d, value: f, def
|
|
|
42
42
|
"aria-describedby": z,
|
|
43
43
|
onBlur: j
|
|
44
44
|
}),
|
|
45
|
-
w && /* @__PURE__ */
|
|
45
|
+
w && /* @__PURE__ */ s(n, {
|
|
46
46
|
id: L,
|
|
47
47
|
children: w
|
|
48
48
|
}),
|
|
49
|
-
T && /* @__PURE__ */
|
|
49
|
+
T && /* @__PURE__ */ s("span", {
|
|
50
50
|
id: R,
|
|
51
51
|
className: "async-multi-select-field__helper",
|
|
52
52
|
children: T
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
import './async-multi-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 ee, useId as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
import { Popover as l } from "@base-ui/react/popover";
|
|
8
8
|
//#region src/stories/atoms/AsyncMultiSelect/AsyncMultiSelect.tsx
|
|
9
|
-
function
|
|
9
|
+
function te(e, t) {
|
|
10
10
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
11
11
|
}
|
|
12
|
-
var
|
|
13
|
-
let [k, A] =
|
|
12
|
+
var u = n(function({ onSearch: n, value: u, defaultValue: d = [], onValueChange: f, selectedOptions: 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": ne, removeLabel: re = (e) => `Quitar ${e}`, emptyMessage: ie = "Sin resultados", loadingLabel: E = "Buscando…", container: D }, O) {
|
|
13
|
+
let [k, A] = o(!1), [j, M] = o(""), [N, P] = o(!1), [F, I] = o([]), [L, R] = o(!1), [z, B] = o(-1), [V, H] = o(d), [U, W] = o([]), G = a(null), K = a(0), q = a(null), J = a(null), Y = i(), ae = i(), X = u === void 0 ? V : u, oe = X.map((e) => p?.find((t) => t.value === e) ?? U.find((t) => t.value === e) ?? {
|
|
14
14
|
value: e,
|
|
15
15
|
label: e
|
|
16
|
-
}), Z = (e) => `${ae}-opt-${e}`, Q =
|
|
16
|
+
}), Z = (e) => `${ae}-opt-${e}`, Q = r(async (e) => {
|
|
17
17
|
let t = ++K.current;
|
|
18
18
|
P(!0), R(!1);
|
|
19
19
|
try {
|
|
20
|
-
let
|
|
20
|
+
let r = await n(e);
|
|
21
21
|
if (t !== K.current) return;
|
|
22
|
-
I(
|
|
22
|
+
I(r), B(-1);
|
|
23
23
|
} catch {
|
|
24
24
|
if (t !== K.current) return;
|
|
25
25
|
I([]), B(-1);
|
|
26
26
|
} finally {
|
|
27
27
|
t === K.current && (P(!1), R(!0));
|
|
28
28
|
}
|
|
29
|
-
}, [
|
|
29
|
+
}, [n]);
|
|
30
30
|
ee(() => () => {
|
|
31
31
|
K.current += 1, G.current && clearTimeout(G.current);
|
|
32
32
|
}, []);
|
|
@@ -39,7 +39,7 @@ var d = i(function({ onSearch: i, value: d, defaultValue: f = [], onValueChange:
|
|
|
39
39
|
}
|
|
40
40
|
function $(e, t) {
|
|
41
41
|
let n = X.includes(e) ? X.filter((t) => t !== e) : [...X, e];
|
|
42
|
-
t && W((e) => e.some((e) => e.value === t.value) ? e : [...e, t]),
|
|
42
|
+
t && W((e) => e.some((e) => e.value === t.value) ? e : [...e, t]), u === void 0 && H(n), f?.(n);
|
|
43
43
|
}
|
|
44
44
|
function le(e) {
|
|
45
45
|
if (e.key === "ArrowDown") e.preventDefault(), k ? B((e) => Math.min(e + 1, F.length - 1)) : (A(!0), Q(j));
|
|
@@ -69,22 +69,22 @@ var d = i(function({ onSearch: i, value: d, defaultValue: f = [], onValueChange:
|
|
|
69
69
|
x ? "async-multi-select--error" : "",
|
|
70
70
|
w ?? ""
|
|
71
71
|
].filter(Boolean).join(" "), fe = ["async-multi-select__content", _ === "md" ? "" : `async-multi-select__content--${_}`].filter(Boolean).join(" ");
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ c(l.Root, {
|
|
73
73
|
open: k,
|
|
74
74
|
onOpenChange: ue,
|
|
75
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ c("div", {
|
|
76
76
|
ref: J,
|
|
77
77
|
className: de,
|
|
78
78
|
"data-popup-open": k || void 0,
|
|
79
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ c("div", {
|
|
80
80
|
className: "async-multi-select__input-area",
|
|
81
81
|
children: [
|
|
82
|
-
oe.map((t) => /* @__PURE__ */
|
|
82
|
+
oe.map((t) => /* @__PURE__ */ c("span", {
|
|
83
83
|
className: "async-multi-select__pill",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
84
|
+
children: [/* @__PURE__ */ s("span", {
|
|
85
85
|
className: "async-multi-select__pill-label",
|
|
86
86
|
children: t.label
|
|
87
|
-
}), !h && !g && /* @__PURE__ */
|
|
87
|
+
}), !h && !g && /* @__PURE__ */ s("button", {
|
|
88
88
|
type: "button",
|
|
89
89
|
className: "async-multi-select__pill-remove",
|
|
90
90
|
"aria-label": re(t.label),
|
|
@@ -92,15 +92,15 @@ var d = i(function({ onSearch: i, value: d, defaultValue: f = [], onValueChange:
|
|
|
92
92
|
onMouseDown: (e) => {
|
|
93
93
|
e.preventDefault(), $(t.value);
|
|
94
94
|
},
|
|
95
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ s(e, {
|
|
96
96
|
name: "close",
|
|
97
97
|
size: "xs"
|
|
98
98
|
})
|
|
99
99
|
})]
|
|
100
100
|
}, t.value)),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ s("input", {
|
|
102
102
|
ref: (e) => {
|
|
103
|
-
q.current = e,
|
|
103
|
+
q.current = e, te(O, e);
|
|
104
104
|
},
|
|
105
105
|
id: y,
|
|
106
106
|
type: "text",
|
|
@@ -125,64 +125,64 @@ var d = i(function({ onSearch: i, value: d, defaultValue: f = [], onValueChange:
|
|
|
125
125
|
"aria-autocomplete": "list",
|
|
126
126
|
onBlur: C
|
|
127
127
|
}),
|
|
128
|
-
b && X.map((e) => /* @__PURE__ */
|
|
128
|
+
b && X.map((e) => /* @__PURE__ */ s("input", {
|
|
129
129
|
type: "hidden",
|
|
130
130
|
name: b,
|
|
131
131
|
value: e
|
|
132
132
|
}, e))
|
|
133
133
|
]
|
|
134
|
-
}), N && /* @__PURE__ */
|
|
134
|
+
}), N && /* @__PURE__ */ s(t, {
|
|
135
135
|
size: "sm",
|
|
136
136
|
"aria-hidden": !0
|
|
137
137
|
})]
|
|
138
|
-
}), /* @__PURE__ */
|
|
139
|
-
container:
|
|
140
|
-
children: /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ s(l.Portal, {
|
|
139
|
+
container: D,
|
|
140
|
+
children: /* @__PURE__ */ s(l.Positioner, {
|
|
141
141
|
className: "async-multi-select__positioner",
|
|
142
142
|
anchor: J,
|
|
143
143
|
align: "start",
|
|
144
144
|
sideOffset: -1,
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ s(l.Popup, {
|
|
146
146
|
className: fe,
|
|
147
147
|
initialFocus: !1,
|
|
148
148
|
finalFocus: !1,
|
|
149
|
-
children: /* @__PURE__ */
|
|
149
|
+
children: /* @__PURE__ */ c("div", {
|
|
150
150
|
role: "listbox",
|
|
151
151
|
"aria-multiselectable": "true",
|
|
152
152
|
"aria-label": T ?? m,
|
|
153
153
|
id: Y,
|
|
154
154
|
children: [
|
|
155
|
-
N && /* @__PURE__ */
|
|
155
|
+
N && /* @__PURE__ */ s("div", {
|
|
156
156
|
className: "async-multi-select__loading",
|
|
157
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ s(t, {
|
|
158
158
|
size: "sm",
|
|
159
|
-
label:
|
|
159
|
+
label: E
|
|
160
160
|
})
|
|
161
161
|
}),
|
|
162
|
-
!N && L && F.length === 0 && /* @__PURE__ */
|
|
162
|
+
!N && L && F.length === 0 && /* @__PURE__ */ s("div", {
|
|
163
163
|
className: "async-multi-select__empty",
|
|
164
|
-
children:
|
|
164
|
+
children: ie
|
|
165
165
|
}),
|
|
166
166
|
!N && F.map((e, t) => {
|
|
167
|
-
let
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
let n = X.includes(e.value), r = z === t;
|
|
168
|
+
return /* @__PURE__ */ c("div", {
|
|
169
169
|
id: Z(t),
|
|
170
170
|
role: "option",
|
|
171
|
-
"aria-selected":
|
|
171
|
+
"aria-selected": n,
|
|
172
172
|
className: [
|
|
173
173
|
"async-multi-select__item",
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
n ? "async-multi-select__item--selected" : "",
|
|
175
|
+
r ? "async-multi-select__item--active" : ""
|
|
176
176
|
].filter(Boolean).join(" "),
|
|
177
177
|
onPointerDown: (e) => e.preventDefault(),
|
|
178
178
|
onClick: () => {
|
|
179
179
|
$(e.value, e), q.current?.focus();
|
|
180
180
|
},
|
|
181
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ s("span", {
|
|
182
182
|
className: "async-multi-select__item-check",
|
|
183
183
|
"aria-hidden": "true",
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
}), /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ s("span", { className: "async-multi-select__item-check-mark" })
|
|
185
|
+
}), /* @__PURE__ */ s("span", { children: e.label })]
|
|
186
186
|
}, e.value);
|
|
187
187
|
})
|
|
188
188
|
]
|
|
@@ -193,4 +193,4 @@ var d = i(function({ onSearch: i, value: d, defaultValue: f = [], onValueChange:
|
|
|
193
193
|
});
|
|
194
194
|
});
|
|
195
195
|
//#endregion
|
|
196
|
-
export {
|
|
196
|
+
export { u as AsyncMultiSelect };
|