@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/multi-select.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './multi-select.css';
|
|
3
3
|
import { Icon as e } from "./icon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t, useEffect as n, useId as r, useRef as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
import { Popover as c } from "@base-ui/react/popover";
|
|
7
7
|
//#region src/stories/atoms/MultiSelect/MultiSelect.tsx
|
|
8
8
|
function l(e, t) {
|
|
9
9
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
10
10
|
}
|
|
11
|
-
var u = 500, d =
|
|
12
|
-
let [k, A] =
|
|
11
|
+
var u = 500, d = t(function({ options: t, value: d, defaultValue: f = [], placeholder: p = "Seleccionar…", disabled: m, readOnly: h, size: g = "md", onValueChange: _, id: v, name: y, error: b = !1, onBlur: x, className: S, "aria-label": C, "aria-labelledby": w, "aria-describedby": T, removeLabel: E = (e) => `Quitar ${e}`, container: D }, O) {
|
|
12
|
+
let [k, A] = a(!1), [j, M] = a(f), [N, P] = a(-1), F = i(null), I = i(null), L = r(), R = r(), z = i(""), B = i(0), V = d === void 0 ? j : d, H = (e) => `${R}-opt-${e}`;
|
|
13
13
|
function U(e) {
|
|
14
14
|
let t = V.includes(e) ? V.filter((t) => t !== e) : [...V, e];
|
|
15
15
|
d === void 0 && M(t), _?.(t);
|
|
16
16
|
}
|
|
17
17
|
function W(e) {
|
|
18
|
-
m || h || (A(!0), P(
|
|
18
|
+
m || h || (A(!0), P(t.length === 0 ? -1 : e));
|
|
19
19
|
}
|
|
20
20
|
function G() {
|
|
21
21
|
A(!1), P(-1), z.current = "";
|
|
@@ -30,26 +30,26 @@ var u = 500, d = r(function({ options: r, value: d, defaultValue: f = [], placeh
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
function q(e) {
|
|
33
|
-
if (
|
|
34
|
-
let
|
|
35
|
-
z.current =
|
|
36
|
-
let i =
|
|
37
|
-
for (let e = 0; e <
|
|
38
|
-
let
|
|
39
|
-
if (
|
|
40
|
-
P(
|
|
33
|
+
if (t.length === 0) return;
|
|
34
|
+
let n = Date.now(), r = n - B.current > u ? e : z.current + e;
|
|
35
|
+
z.current = r, B.current = n;
|
|
36
|
+
let i = r.length === 1 ? N + 1 : Math.max(N, 0), a = r.toLowerCase();
|
|
37
|
+
for (let e = 0; e < t.length; e++) {
|
|
38
|
+
let n = (i + e) % t.length;
|
|
39
|
+
if (t[n].label.toLowerCase().startsWith(a)) {
|
|
40
|
+
P(n), k || A(!0);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
function J(e) {
|
|
46
46
|
if (m || h) return;
|
|
47
|
-
let
|
|
48
|
-
if (e.key === "ArrowDown") e.preventDefault(), k ? P((e) => Math.min(e + 1,
|
|
49
|
-
else if (e.key === "ArrowUp") e.preventDefault(), k ? P((e) => Math.max(e - 1, 0)) : W(
|
|
50
|
-
else if (e.key === "Home") e.preventDefault(), k ? P(
|
|
51
|
-
else if (e.key === "End") e.preventDefault(), k ? P(
|
|
52
|
-
else if (e.key === "Enter" || e.key === " ") e.preventDefault(), k ? N >= 0 && N <
|
|
47
|
+
let n = t.length - 1;
|
|
48
|
+
if (e.key === "ArrowDown") e.preventDefault(), k ? P((e) => Math.min(e + 1, n)) : W(0);
|
|
49
|
+
else if (e.key === "ArrowUp") e.preventDefault(), k ? P((e) => Math.max(e - 1, 0)) : W(n);
|
|
50
|
+
else if (e.key === "Home") e.preventDefault(), k ? P(t.length === 0 ? -1 : 0) : W(0);
|
|
51
|
+
else if (e.key === "End") e.preventDefault(), k ? P(n) : W(n);
|
|
52
|
+
else if (e.key === "Enter" || e.key === " ") e.preventDefault(), k ? N >= 0 && N < t.length && U(t[N].value) : W(0);
|
|
53
53
|
else if (e.key === "Escape") {
|
|
54
54
|
if (!k) return;
|
|
55
55
|
e.preventDefault(), G();
|
|
@@ -58,7 +58,7 @@ var u = 500, d = r(function({ options: r, value: d, defaultValue: f = [], placeh
|
|
|
58
58
|
function Y(e) {
|
|
59
59
|
m || h || e.target instanceof Element && e.target.closest(".multi-select__pill-remove") || (e.preventDefault(), I.current?.focus(), k ? G() : W(0));
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
n(() => {
|
|
62
62
|
!k || N < 0 || document.getElementById(H(N))?.scrollIntoView({ block: "nearest" });
|
|
63
63
|
}, [
|
|
64
64
|
k,
|
|
@@ -72,39 +72,39 @@ var u = 500, d = r(function({ options: r, value: d, defaultValue: f = [], placeh
|
|
|
72
72
|
b ? "multi-select--error" : "",
|
|
73
73
|
S ?? ""
|
|
74
74
|
].filter(Boolean).join(" "), Z = ["multi-select__content", g === "md" ? "" : `multi-select__content--${g}`].filter(Boolean).join(" ");
|
|
75
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ s(c.Root, {
|
|
76
76
|
open: k,
|
|
77
77
|
onOpenChange: K,
|
|
78
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ s("div", {
|
|
79
79
|
ref: F,
|
|
80
80
|
className: X,
|
|
81
81
|
"data-popup-open": k || void 0,
|
|
82
82
|
onPointerDown: Y,
|
|
83
83
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ s("div", {
|
|
85
85
|
className: "multi-select__values",
|
|
86
|
-
children: [V.map((
|
|
87
|
-
let
|
|
88
|
-
return
|
|
86
|
+
children: [V.map((n) => {
|
|
87
|
+
let r = t.find((e) => e.value === n);
|
|
88
|
+
return r ? /* @__PURE__ */ s("span", {
|
|
89
89
|
className: "multi-select__pill",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ o("span", {
|
|
91
91
|
className: "multi-select__pill-label",
|
|
92
|
-
children:
|
|
93
|
-
}), !m && !h && /* @__PURE__ */
|
|
92
|
+
children: r.label
|
|
93
|
+
}), !m && !h && /* @__PURE__ */ o("button", {
|
|
94
94
|
type: "button",
|
|
95
95
|
className: "multi-select__pill-remove",
|
|
96
|
-
"aria-label": E(
|
|
96
|
+
"aria-label": E(r.label),
|
|
97
97
|
tabIndex: -1,
|
|
98
98
|
onClick: (e) => {
|
|
99
|
-
e.stopPropagation(), U(
|
|
99
|
+
e.stopPropagation(), U(n), I.current?.focus();
|
|
100
100
|
},
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ o(e, {
|
|
102
102
|
name: "close",
|
|
103
103
|
size: "xs"
|
|
104
104
|
})
|
|
105
105
|
})]
|
|
106
|
-
},
|
|
107
|
-
}), /* @__PURE__ */
|
|
106
|
+
}, n) : null;
|
|
107
|
+
}), /* @__PURE__ */ o("div", {
|
|
108
108
|
ref: (e) => {
|
|
109
109
|
I.current = e, l(O, e);
|
|
110
110
|
},
|
|
@@ -124,62 +124,62 @@ var u = 500, d = r(function({ options: r, value: d, defaultValue: f = [], placeh
|
|
|
124
124
|
id: v,
|
|
125
125
|
onKeyDown: J,
|
|
126
126
|
onBlur: x,
|
|
127
|
-
children: V.length === 0 && /* @__PURE__ */
|
|
127
|
+
children: V.length === 0 && /* @__PURE__ */ o("span", {
|
|
128
128
|
className: "multi-select__placeholder",
|
|
129
129
|
children: p
|
|
130
130
|
})
|
|
131
131
|
})]
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ o(e, {
|
|
134
134
|
name: "chevron",
|
|
135
135
|
className: "multi-select__icon",
|
|
136
136
|
size: g === "sm" ? "xs" : g === "lg" ? "md" : "sm"
|
|
137
137
|
}),
|
|
138
|
-
y && V.map((e) => /* @__PURE__ */
|
|
138
|
+
y && V.map((e) => /* @__PURE__ */ o("input", {
|
|
139
139
|
type: "hidden",
|
|
140
140
|
name: y,
|
|
141
141
|
value: e
|
|
142
142
|
}, e))
|
|
143
143
|
]
|
|
144
|
-
}), /* @__PURE__ */
|
|
144
|
+
}), /* @__PURE__ */ o(c.Portal, {
|
|
145
145
|
container: D,
|
|
146
|
-
children: /* @__PURE__ */
|
|
146
|
+
children: /* @__PURE__ */ o(c.Positioner, {
|
|
147
147
|
className: "multi-select__positioner",
|
|
148
148
|
anchor: F,
|
|
149
149
|
align: "start",
|
|
150
150
|
sideOffset: -1,
|
|
151
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ o(c.Popup, {
|
|
152
152
|
className: Z,
|
|
153
153
|
initialFocus: !1,
|
|
154
154
|
finalFocus: !1,
|
|
155
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ o("div", {
|
|
156
156
|
role: "listbox",
|
|
157
157
|
"aria-multiselectable": "true",
|
|
158
158
|
"aria-label": C ?? p,
|
|
159
159
|
id: L,
|
|
160
|
-
children:
|
|
161
|
-
let
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
id: H(
|
|
160
|
+
children: t.map((e, t) => {
|
|
161
|
+
let n = V.includes(e.value), r = N === t;
|
|
162
|
+
return /* @__PURE__ */ s("div", {
|
|
163
|
+
id: H(t),
|
|
164
164
|
role: "option",
|
|
165
|
-
"aria-selected":
|
|
165
|
+
"aria-selected": n,
|
|
166
166
|
"aria-label": e["aria-label"] ?? e.label,
|
|
167
167
|
className: [
|
|
168
168
|
"multi-select__item",
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
n ? "multi-select__item--selected" : "",
|
|
170
|
+
r ? "multi-select__item--active" : ""
|
|
171
171
|
].filter(Boolean).join(" "),
|
|
172
172
|
onPointerDown: (e) => {
|
|
173
173
|
e.preventDefault(), e.stopPropagation();
|
|
174
174
|
},
|
|
175
175
|
onClick: () => {
|
|
176
|
-
U(e.value), P(
|
|
176
|
+
U(e.value), P(t), I.current?.focus();
|
|
177
177
|
},
|
|
178
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ o("span", {
|
|
179
179
|
className: "multi-select__item-check",
|
|
180
180
|
"aria-hidden": "true",
|
|
181
|
-
children: /* @__PURE__ */
|
|
182
|
-
}), /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ o("span", { className: "multi-select__item-check-mark" })
|
|
182
|
+
}), /* @__PURE__ */ o("span", { children: e.label })]
|
|
183
183
|
}, e.value);
|
|
184
184
|
})
|
|
185
185
|
})
|
|
@@ -3,12 +3,12 @@ import './notification-button.css';
|
|
|
3
3
|
import { Icon as e } from "./icon.js";
|
|
4
4
|
import { Button as t } from "./button.js";
|
|
5
5
|
import { NumberBadge as n } from "./number-badge.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { forwardRef as r } from "react";
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
8
|
//#region src/stories/molecules/NotificationButton/NotificationButton.tsx
|
|
9
|
-
var o =
|
|
10
|
-
let f =
|
|
11
|
-
return /* @__PURE__ */
|
|
9
|
+
var o = r(function({ count: r = 0, max: o = 99, label: s = "Notificaciones", countLabel: c = (e) => `Notificaciones: ${e} sin leer`, className: l, ...u }, d) {
|
|
10
|
+
let f = r > 0 ? c(r) : s;
|
|
11
|
+
return /* @__PURE__ */ a(t, {
|
|
12
12
|
ref: d,
|
|
13
13
|
variant: "ghost",
|
|
14
14
|
iconOnly: !0,
|
|
@@ -16,11 +16,11 @@ var o = a(function({ count: a = 0, max: o = 99, label: s = "Notificaciones", cou
|
|
|
16
16
|
"aria-label": f,
|
|
17
17
|
className: ["notification-button", l].filter(Boolean).join(" "),
|
|
18
18
|
...u,
|
|
19
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ i(e, {
|
|
20
20
|
name: "bell",
|
|
21
21
|
size: "md"
|
|
22
|
-
}),
|
|
23
|
-
count:
|
|
22
|
+
}), r > 0 && /* @__PURE__ */ i(n, {
|
|
23
|
+
count: r,
|
|
24
24
|
max: o,
|
|
25
25
|
variant: "danger",
|
|
26
26
|
"aria-hidden": "true",
|
|
@@ -8,8 +8,8 @@ import { Paragraph as i } from "./paragraph.js";
|
|
|
8
8
|
import { Popover as a } from "./popover.js";
|
|
9
9
|
import { Text as o } from "./text.js";
|
|
10
10
|
import { NotificationButton as s } from "./notification-button.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { useCallback as c, useId as l, useRef as u, useState as d } from "react";
|
|
12
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
13
|
//#region src/stories/molecules/NotificationPanel/NotificationPanel.tsx
|
|
14
14
|
function h(e) {
|
|
15
15
|
let t = parseFloat(e);
|
|
@@ -20,25 +20,25 @@ function g() {
|
|
|
20
20
|
return h(getComputedStyle(e).getPropertyValue("--notification-panel-offset").trim());
|
|
21
21
|
}
|
|
22
22
|
function _({ children: e, ...t }) {
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ p("a", {
|
|
24
24
|
...t,
|
|
25
25
|
children: e
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
var v = "button, a[href]", y = "notification-panel__footer-link";
|
|
29
29
|
function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, allHref: w, preferencesHref: T, renderLink: E = _, label: D, countLabel: O, panelLabel: k = "Notificaciones", unreadLabel: A = "Sin leer", emptyLabel: j = "Estás al día", allLabel: M = "Ver todas las notificaciones", preferencesLabel: N = "Preferencias de notificaciones", markAllReadLabel: P = "Marcar todas como leídas", open: F, defaultOpen: I, onOpenChange: L, className: R }) {
|
|
30
|
-
let z =
|
|
30
|
+
let z = l(), B = u(null), [V, H] = d([]), U = (e) => e.unread && !V.includes(e.id), W = h.some(U), G = (e) => {
|
|
31
31
|
U(e) && (H((t) => [...t, e.id]), S(e.id));
|
|
32
32
|
}, K = () => {
|
|
33
33
|
H(h.map((e) => e.id)), C?.();
|
|
34
|
-
}, q =
|
|
34
|
+
}, q = c(() => {
|
|
35
35
|
let e = B.current;
|
|
36
36
|
return e ? e.querySelector(".notification-panel__item-action") ?? e.querySelector(v) : null;
|
|
37
37
|
}, []), J = (e, t) => {
|
|
38
38
|
e || H([]), L?.(e, t);
|
|
39
39
|
}, Y = `${z}-title`;
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
trigger: /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ p(a, {
|
|
41
|
+
trigger: /* @__PURE__ */ p(s, {
|
|
42
42
|
count: b,
|
|
43
43
|
max: x,
|
|
44
44
|
label: D,
|
|
@@ -52,56 +52,56 @@ function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, a
|
|
|
52
52
|
onOpenChange: J,
|
|
53
53
|
initialFocus: q,
|
|
54
54
|
className: ["notification-panel", R].filter(Boolean).join(" "),
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ m("div", {
|
|
56
56
|
className: "notification-panel__body",
|
|
57
57
|
ref: B,
|
|
58
58
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ p(t, { children: /* @__PURE__ */ p(r, {
|
|
60
60
|
level: 2,
|
|
61
61
|
size: 3,
|
|
62
62
|
id: Y,
|
|
63
63
|
children: k
|
|
64
64
|
}) }),
|
|
65
|
-
h.length === 0 ? /* @__PURE__ */
|
|
65
|
+
h.length === 0 ? /* @__PURE__ */ p("div", {
|
|
66
66
|
className: "notification-panel__empty",
|
|
67
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ p(i, {
|
|
68
68
|
size: "small",
|
|
69
69
|
children: j
|
|
70
70
|
})
|
|
71
|
-
}) : /* @__PURE__ */
|
|
71
|
+
}) : /* @__PURE__ */ p("ul", {
|
|
72
72
|
className: "notification-panel__list",
|
|
73
73
|
"aria-labelledby": Y,
|
|
74
74
|
children: h.map((n, r) => {
|
|
75
75
|
let i = U(n), a = `${z}-t-${r}`;
|
|
76
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ p("li", {
|
|
77
77
|
className: "notification-panel__item",
|
|
78
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ m("button", {
|
|
79
79
|
type: "button",
|
|
80
80
|
className: "notification-panel__item-action",
|
|
81
81
|
"aria-disabled": i ? void 0 : !0,
|
|
82
82
|
onClick: () => G(n),
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ p("span", {
|
|
84
84
|
className: "notification-panel__indicator",
|
|
85
|
-
children: i && /* @__PURE__ */
|
|
85
|
+
children: i && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(e, {
|
|
86
86
|
name: "dot",
|
|
87
87
|
size: "sm",
|
|
88
88
|
className: "notification-panel__dot"
|
|
89
|
-
}), /* @__PURE__ */
|
|
90
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ p(t, { children: A })] })
|
|
90
|
+
}), /* @__PURE__ */ m("span", {
|
|
91
91
|
className: "notification-panel__item-text",
|
|
92
92
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ p(o, {
|
|
94
94
|
id: a,
|
|
95
95
|
tone: i ? "default" : "muted",
|
|
96
96
|
className: "notification-panel__item-title",
|
|
97
97
|
children: n.title
|
|
98
98
|
}),
|
|
99
|
-
n.body && /* @__PURE__ */
|
|
99
|
+
n.body && /* @__PURE__ */ p(o, {
|
|
100
100
|
tone: "muted",
|
|
101
101
|
className: "notification-panel__item-body",
|
|
102
102
|
children: n.body
|
|
103
103
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ p(o, {
|
|
105
105
|
tone: "muted",
|
|
106
106
|
className: "notification-panel__item-time",
|
|
107
107
|
children: n.time
|
|
@@ -112,9 +112,9 @@ function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, a
|
|
|
112
112
|
}, n.id);
|
|
113
113
|
})
|
|
114
114
|
}),
|
|
115
|
-
C && W && /* @__PURE__ */
|
|
115
|
+
C && W && /* @__PURE__ */ p("div", {
|
|
116
116
|
className: "notification-panel__mark-all",
|
|
117
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ p(n, {
|
|
118
118
|
variant: "outline",
|
|
119
119
|
size: "sm",
|
|
120
120
|
block: !0,
|
|
@@ -122,9 +122,9 @@ function b({ items: h = [], count: b = 0, max: x, onRead: S, onMarkAllRead: C, a
|
|
|
122
122
|
children: P
|
|
123
123
|
})
|
|
124
124
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ p("div", {
|
|
126
126
|
className: "notification-panel__footer",
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ m("div", {
|
|
128
128
|
className: "notification-panel__footer-links",
|
|
129
129
|
children: [E({
|
|
130
130
|
href: w,
|
|
@@ -5,21 +5,21 @@ import { ErrorText as t } from "./error-text.js";
|
|
|
5
5
|
import { Label as n } from "./label.js";
|
|
6
6
|
import { NumberInput as r } from "./number-input.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/NumberInputField/NumberInputField.tsx
|
|
11
|
-
var l =
|
|
12
|
-
let D = i(u), O = e(y), k =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var l = a(function({ id: a, label: l, labelHidden: u, value: d, defaultValue: f, min: p, max: m, step: h = 1, decimal: g, disabled: _, readOnly: v, size: y, error: b = !1, errorMessage: x, helperText: S, className: C, onChange: w, ...T }, E) {
|
|
12
|
+
let D = i(u), O = e(y), k = o(), A = a ?? k, j = x ? `${A}-error` : void 0, M = S ? `${A}-helper` : void 0, N = [j, M].filter(Boolean).join(" ") || void 0, P = b || !!x;
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
14
|
className: ["number-input-field", C].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ s(n, {
|
|
17
17
|
htmlFor: A,
|
|
18
18
|
hidden: D,
|
|
19
19
|
size: O,
|
|
20
20
|
children: l
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ s(r, {
|
|
23
23
|
ref: E,
|
|
24
24
|
...T,
|
|
25
25
|
id: A,
|
|
@@ -36,11 +36,11 @@ var l = s(function({ id: s, label: l, labelHidden: u, value: d, defaultValue: f,
|
|
|
36
36
|
"aria-describedby": N,
|
|
37
37
|
onChange: w
|
|
38
38
|
}),
|
|
39
|
-
x && /* @__PURE__ */
|
|
39
|
+
x && /* @__PURE__ */ s(t, {
|
|
40
40
|
id: j,
|
|
41
41
|
children: x
|
|
42
42
|
}),
|
|
43
|
-
S && /* @__PURE__ */
|
|
43
|
+
S && /* @__PURE__ */ s("span", {
|
|
44
44
|
id: M,
|
|
45
45
|
className: "number-input-field__helper",
|
|
46
46
|
children: S
|
package/dist/number-input.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './number-input.css';
|
|
3
3
|
import { Icon as e } from "./icon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as t, useCallback as n, useState as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
//#region src/stories/atoms/NumberInput/NumberInput.tsx
|
|
7
|
-
var o =
|
|
8
|
-
let D =
|
|
7
|
+
var o = t(function({ value: t, defaultValue: o = 0, min: s, max: c, step: l = 1, decimal: u = !1, disabled: d = !1, readOnly: f = !1, size: p = "md", error: m = !1, id: h, name: g, describedBy: _, ariaLabel: v, decrementLabel: y = "Decrementar", incrementLabel: b = "Incrementar", className: x, onChange: S, onBlur: C, onFocus: w, ...T }, E) {
|
|
8
|
+
let D = t !== void 0, [O, k] = r(o), [A, j] = r(!1), [M, N] = r(null), P = D ? t : O, F = M === null ? String(P) : M, I = n((e) => {
|
|
9
9
|
let t = e;
|
|
10
10
|
return s !== void 0 && (t = Math.max(s, t)), c !== void 0 && (t = Math.min(c, t)), t;
|
|
11
|
-
}, [s, c]), L =
|
|
11
|
+
}, [s, c]), L = n((e) => {
|
|
12
12
|
let t = I(e);
|
|
13
13
|
D || k(t), S?.(t);
|
|
14
14
|
}, [
|
|
@@ -36,22 +36,22 @@ var o = r(function({ value: r, defaultValue: o = 0, min: s, max: c, step: l = 1,
|
|
|
36
36
|
A ? "number-input--focused" : "",
|
|
37
37
|
x ?? ""
|
|
38
38
|
].filter(Boolean).join(" "), W = d || f || s !== void 0 && P <= s, G = d || f || c !== void 0 && P >= c;
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ a("div", {
|
|
40
40
|
className: U,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ i("button", {
|
|
43
43
|
className: "number-input__btn number-input__btn--decrement",
|
|
44
44
|
type: "button",
|
|
45
45
|
onClick: R,
|
|
46
46
|
disabled: W,
|
|
47
47
|
"aria-label": y,
|
|
48
48
|
tabIndex: -1,
|
|
49
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ i(e, {
|
|
50
50
|
name: "minus",
|
|
51
51
|
size: "sm"
|
|
52
52
|
})
|
|
53
53
|
}),
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ i("input", {
|
|
55
55
|
ref: E,
|
|
56
56
|
className: "number-input__field",
|
|
57
57
|
type: "text",
|
|
@@ -70,14 +70,14 @@ var o = r(function({ value: r, defaultValue: o = 0, min: s, max: c, step: l = 1,
|
|
|
70
70
|
onFocus: V,
|
|
71
71
|
onBlur: H
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ i("button", {
|
|
74
74
|
className: "number-input__btn number-input__btn--increment",
|
|
75
75
|
type: "button",
|
|
76
76
|
onClick: z,
|
|
77
77
|
disabled: G,
|
|
78
78
|
"aria-label": b,
|
|
79
79
|
tabIndex: -1,
|
|
80
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ i(e, {
|
|
81
81
|
name: "plus",
|
|
82
82
|
size: "sm"
|
|
83
83
|
})
|
package/dist/otp-field.js
CHANGED
|
@@ -5,22 +5,22 @@ import { ErrorText as t } from "./error-text.js";
|
|
|
5
5
|
import { OtpInput as n } from "./otp-input.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/OtpField/OtpField.tsx
|
|
11
|
-
var l =
|
|
12
|
-
let D = i(u), O = e(b), k =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var l = a(function({ id: a, label: l, labelHidden: u, length: d, value: f, defaultValue: p, name: m, disabled: h, readOnly: g, error: _ = !1, errorMessage: v, helperText: y, size: b, className: x, digitLabel: S, onChange: C, onComplete: w, onBlur: T }, E) {
|
|
12
|
+
let D = i(u), O = e(b), k = o(), A = a ?? k, j = v ? `${A}-error` : void 0, M = y ? `${A}-helper` : void 0, N = [j, M].filter(Boolean).join(" ") || void 0, P = _ || !!v;
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
14
|
className: ["otp-field", x].filter(Boolean).join(" "),
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ s(r, {
|
|
17
17
|
id: `${A}-label`,
|
|
18
18
|
htmlFor: `${A}-0`,
|
|
19
19
|
hidden: D,
|
|
20
20
|
size: O,
|
|
21
21
|
children: l
|
|
22
22
|
}),
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ s(n, {
|
|
24
24
|
ref: E,
|
|
25
25
|
id: A,
|
|
26
26
|
name: m,
|
|
@@ -38,11 +38,11 @@ var l = s(function({ id: s, label: l, labelHidden: u, length: d, value: f, defau
|
|
|
38
38
|
onComplete: w,
|
|
39
39
|
onBlur: T
|
|
40
40
|
}),
|
|
41
|
-
v && /* @__PURE__ */
|
|
41
|
+
v && /* @__PURE__ */ s(t, {
|
|
42
42
|
id: j,
|
|
43
43
|
children: v
|
|
44
44
|
}),
|
|
45
|
-
y && /* @__PURE__ */
|
|
45
|
+
y && /* @__PURE__ */ s("span", {
|
|
46
46
|
id: M,
|
|
47
47
|
className: "otp-field__helper",
|
|
48
48
|
children: y
|