@studiolxd/brand 47.1.0 → 48.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 +161 -0
- package/dist/_shared/progressbar.js +19 -18
- package/dist/_shared/tokens.js +0 -1
- package/dist/_types/atoms/CopyableValue/CopyableValue.d.ts +4 -4
- package/dist/_types/atoms/DescriptionList/DescriptionList.d.ts +5 -4
- package/dist/_types/atoms/DotsButton/DotsButton.d.ts +15 -0
- package/dist/_types/atoms/ProgressBar/ProgressBar.d.ts +12 -2
- package/dist/_types/atoms/Slider/Slider.d.ts +19 -2
- package/dist/_types/atoms/Spinner/Spinner.d.ts +15 -1
- package/dist/_types/constants/copy-to-clipboard.d.ts +22 -0
- package/dist/_types/messages/BrandMessages.d.ts +35 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/CalendarPlanner/CalendarPlanner.d.ts +13 -3
- package/dist/_types/molecules/CalendarRoster/CalendarRoster.d.ts +38 -5
- package/dist/_types/molecules/Carousel/Carousel.d.ts +65 -13
- package/dist/_types/molecules/CodeBlock/CodeBlock.d.ts +20 -6
- package/dist/_types/molecules/ContextMenu/ContextMenu.d.ts +5 -1
- package/dist/_types/molecules/CopyButton/CopyButton.d.ts +5 -6
- package/dist/_types/molecules/FilterBar/FilterBar.d.ts +4 -3
- package/dist/_types/molecules/LanguageSwitcher/LanguageSwitcher.d.ts +13 -1
- package/dist/_types/molecules/NotificationList/NotificationList.d.ts +33 -3
- package/dist/_types/molecules/Pagination/Pagination.d.ts +16 -2
- package/dist/_types/molecules/ProjectCard/ProjectCard.d.ts +14 -1
- package/dist/_types/molecules/Stepper/Stepper.d.ts +32 -7
- package/dist/_types/molecules/TreeView/TreeView.d.ts +11 -2
- package/dist/_types/molecules/UptimeBars/UptimeBars.d.ts +20 -2
- package/dist/_types/organisms/Chart/Chart.d.ts +46 -8
- package/dist/_types/sections/LegalFooter/LegalFooter.d.ts +13 -1
- package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +15 -1
- package/dist/brand.css +2 -4
- package/dist/calendar-planner.js +47 -47
- package/dist/calendar-roster.js +28 -25
- package/dist/carousel.js +69 -67
- package/dist/chart.js +250 -249
- package/dist/code-block.js +34 -34
- package/dist/context-menu.js +1 -1
- package/dist/copy-button.js +35 -34
- package/dist/copyable-value.js +43 -42
- package/dist/description-list.js +1 -1
- package/dist/dots-button.js +18 -17
- package/dist/filter-bar.css +1 -1
- package/dist/language-switcher.js +43 -41
- package/dist/legal-footer.js +21 -18
- package/dist/notification-list.js +40 -38
- package/dist/pagination.js +12 -12
- package/dist/progress-bar.js +1 -0
- package/dist/project-card.js +31 -30
- package/dist/public-page-shell.js +12 -11
- package/dist/slider.js +24 -23
- package/dist/spinner.js +19 -14
- package/dist/stepper.js +35 -38
- package/dist/tokens.css +2 -4
- package/dist/tree-view.js +86 -85
- package/dist/uptime-bars.js +54 -53
- package/package.json +1 -1
- package/src/tokens/molecules/filter-bar.css +1 -2
- package/src/tokens/scss/molecules/_filter-bar.scss +1 -2
- package/src/tokens/surface-public.css +0 -1
- package/src/tokens/tokens.json +0 -1
|
@@ -1,71 +1,73 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './notification-list.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { VisuallyHidden as n } from "./visually-hidden.js";
|
|
6
|
+
import { Button as r } from "./button.js";
|
|
7
|
+
import { Text as i } from "./text.js";
|
|
8
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
9
|
//#region src/stories/molecules/NotificationList/NotificationList.tsx
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
function c({ children: e, ...t }) {
|
|
11
|
+
return /* @__PURE__ */ o("a", {
|
|
11
12
|
...t,
|
|
12
13
|
children: e
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
function l({ items: l, renderLink: u = c, renderActions: d, onItemClick: f, onMarkRead: p, label: m, unreadLabel: h, markReadLabel: g, className: _ }) {
|
|
17
|
+
let v = e("notificationList");
|
|
18
|
+
return l.length === 0 ? null : /* @__PURE__ */ o("ul", {
|
|
19
|
+
className: ["notification-list", _].filter(Boolean).join(" "),
|
|
20
|
+
"aria-label": v("label", m),
|
|
21
|
+
children: l.map((e) => {
|
|
22
|
+
let c = e.unread, l = d?.(e);
|
|
23
|
+
return /* @__PURE__ */ s("li", {
|
|
22
24
|
className: "notification-list__item",
|
|
23
25
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ o("span", {
|
|
25
27
|
className: "notification-list__indicator",
|
|
26
|
-
children: c && /* @__PURE__ */
|
|
28
|
+
children: c && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(t, {
|
|
27
29
|
name: "dot",
|
|
28
30
|
size: "sm",
|
|
29
31
|
className: "notification-list__dot"
|
|
30
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ o(n, { children: e.unreadLabel ?? v("unread", h) })] })
|
|
31
33
|
}),
|
|
32
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ s("div", {
|
|
33
35
|
className: "notification-list__text",
|
|
34
|
-
children: [
|
|
35
|
-
href:
|
|
36
|
+
children: [e.href ? u({
|
|
37
|
+
href: e.href,
|
|
36
38
|
className: "notification-list__title",
|
|
37
|
-
onClick:
|
|
38
|
-
children:
|
|
39
|
-
}) : /* @__PURE__ */
|
|
39
|
+
onClick: f ? () => f(e) : void 0,
|
|
40
|
+
children: e.title
|
|
41
|
+
}) : /* @__PURE__ */ o(i, {
|
|
40
42
|
className: "notification-list__title",
|
|
41
|
-
children:
|
|
42
|
-
}),
|
|
43
|
+
children: e.title
|
|
44
|
+
}), e.body && /* @__PURE__ */ o(i, {
|
|
43
45
|
tone: "muted",
|
|
44
46
|
className: "notification-list__body",
|
|
45
|
-
children:
|
|
47
|
+
children: e.body
|
|
46
48
|
})]
|
|
47
49
|
}),
|
|
48
|
-
(
|
|
50
|
+
(p || l) && /* @__PURE__ */ s("div", {
|
|
49
51
|
className: "notification-list__actions",
|
|
50
|
-
children: [
|
|
52
|
+
children: [p && c && /* @__PURE__ */ o(r, {
|
|
51
53
|
variant: "text",
|
|
52
54
|
size: "sm",
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children:
|
|
55
|
-
}),
|
|
55
|
+
onClick: () => p(e.id),
|
|
56
|
+
children: v("markRead", g)
|
|
57
|
+
}), l]
|
|
56
58
|
}),
|
|
57
|
-
|
|
59
|
+
e.timeDateTime ? /* @__PURE__ */ o("time", {
|
|
58
60
|
className: "notification-list__time",
|
|
59
|
-
dateTime:
|
|
60
|
-
children:
|
|
61
|
-
}) : /* @__PURE__ */
|
|
61
|
+
dateTime: e.timeDateTime,
|
|
62
|
+
children: e.time
|
|
63
|
+
}) : /* @__PURE__ */ o("span", {
|
|
62
64
|
className: "notification-list__time",
|
|
63
|
-
children:
|
|
65
|
+
children: e.time
|
|
64
66
|
})
|
|
65
67
|
]
|
|
66
|
-
},
|
|
68
|
+
}, e.id);
|
|
67
69
|
})
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
72
|
//#endregion
|
|
71
|
-
export {
|
|
73
|
+
export { l as NotificationList };
|
package/dist/pagination.js
CHANGED
|
@@ -48,7 +48,7 @@ function o(e, t) {
|
|
|
48
48
|
"..."
|
|
49
49
|
];
|
|
50
50
|
}
|
|
51
|
-
function s({ mode: s = "pages", total: c
|
|
51
|
+
function s({ mode: s = "pages", total: c, pageCount: l, page: u = 1, pageSize: d = 10, hrefs: f, previousHref: p, nextHref: m, onPrevious: h, onNext: g, onPageChange: _, hrefBuilder: v, linkComponent: y, onPageSizeChange: b, pageSizeOptions: x, afterPageSize: S, showTotal: C = !1, size: w = "md", ariaLabel: T, pageLabel: E, previousLabel: D, nextLabel: O, pagesGroupLabel: k, pageSizeLabel: A, totalLabel: j, className: M }) {
|
|
52
52
|
let N = e("pagination"), P = v ?? (f ? (e) => f[e] : void 0), F = y ?? "a";
|
|
53
53
|
if (s === "cursor") {
|
|
54
54
|
let e = w === "sm" ? "xs" : w === "lg" ? "md" : "sm", n = (n) => {
|
|
@@ -86,9 +86,9 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
|
|
|
86
86
|
})
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
if (l ===
|
|
90
|
-
let I = l ?? (d === "all" ? 1 : Math.ceil(
|
|
91
|
-
function
|
|
89
|
+
if (c === 0 || l === 0 || c === void 0 && (l ?? 1) <= 1 && !S) return null;
|
|
90
|
+
let I = c ?? 0, L = l ?? (d === "all" ? 1 : Math.ceil(I / d)), R = L > 1 ? o(u, L) : [];
|
|
91
|
+
function z(e, t) {
|
|
92
92
|
if (e === "...") return /* @__PURE__ */ r("span", {
|
|
93
93
|
className: "pagination__ellipsis",
|
|
94
94
|
"aria-hidden": "true",
|
|
@@ -112,7 +112,7 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
|
|
|
112
112
|
children: e
|
|
113
113
|
}, e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function B(e, n, i) {
|
|
116
116
|
let a = n === "prev" ? N("previous", D) : N("next", O), o = /* @__PURE__ */ r(t, {
|
|
117
117
|
name: "chevron",
|
|
118
118
|
size: w === "sm" ? "xs" : w === "lg" ? "md" : "sm",
|
|
@@ -135,7 +135,7 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
|
|
|
135
135
|
children: o
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
let
|
|
138
|
+
let V = C || !!b || !!S;
|
|
139
139
|
return /* @__PURE__ */ i("nav", {
|
|
140
140
|
className: [
|
|
141
141
|
"pagination",
|
|
@@ -143,12 +143,12 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
|
|
|
143
143
|
M
|
|
144
144
|
].filter(Boolean).join(" "),
|
|
145
145
|
"aria-label": N("label", T),
|
|
146
|
-
children: [
|
|
146
|
+
children: [V && /* @__PURE__ */ i("div", {
|
|
147
147
|
className: "pagination__meta",
|
|
148
148
|
children: [
|
|
149
149
|
C && /* @__PURE__ */ r("span", {
|
|
150
150
|
className: "pagination__summary",
|
|
151
|
-
children: N("total", j)(
|
|
151
|
+
children: N("total", j)(I)
|
|
152
152
|
}),
|
|
153
153
|
b && /* @__PURE__ */ r("div", {
|
|
154
154
|
className: "pagination__size-selector",
|
|
@@ -165,14 +165,14 @@ function s({ mode: s = "pages", total: c = 0, pageCount: l, page: u = 1, pageSiz
|
|
|
165
165
|
children: S
|
|
166
166
|
})
|
|
167
167
|
]
|
|
168
|
-
}),
|
|
168
|
+
}), L > 1 && /* @__PURE__ */ i("div", {
|
|
169
169
|
className: "pagination__controls",
|
|
170
170
|
role: "group",
|
|
171
171
|
"aria-label": N("pagesGroup", k),
|
|
172
172
|
children: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
B(u - 1, "prev", u <= 1),
|
|
174
|
+
R.map((e, t) => z(e, t)),
|
|
175
|
+
B(u + 1, "next", u >= L)
|
|
176
176
|
]
|
|
177
177
|
})]
|
|
178
178
|
});
|
package/dist/progress-bar.js
CHANGED
package/dist/project-card.js
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './project-card.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Heading as t } from "./heading.js";
|
|
5
|
+
import { Paragraph as n } from "./paragraph.js";
|
|
6
|
+
import { Tag as r } from "./tag.js";
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
|
+
import { useRender as o } from "@base-ui/react/use-render";
|
|
8
9
|
//#region src/stories/molecules/ProjectCard/ProjectCard.tsx
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
render:
|
|
12
|
-
enabled:
|
|
10
|
+
function s({ title: s, description: c, media: l, tags: u, href: d, render: f, headingLevel: p = 3, headingSize: m = 5, tagsLabel: h, className: g, id: _ }) {
|
|
11
|
+
let v = e("projectCard"), y = o({
|
|
12
|
+
render: f,
|
|
13
|
+
enabled: f !== void 0,
|
|
13
14
|
props: {
|
|
14
15
|
className: "project-card__link",
|
|
15
|
-
children:
|
|
16
|
+
children: s
|
|
16
17
|
}
|
|
17
|
-
}) ?? (
|
|
18
|
-
href:
|
|
18
|
+
}) ?? (d === void 0 ? s : /* @__PURE__ */ i("a", {
|
|
19
|
+
href: d,
|
|
19
20
|
className: "project-card__link",
|
|
20
|
-
children:
|
|
21
|
+
children: s
|
|
21
22
|
}));
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
id:
|
|
24
|
-
className: ["project-card",
|
|
23
|
+
return /* @__PURE__ */ a("article", {
|
|
24
|
+
id: _,
|
|
25
|
+
className: ["project-card", g].filter(Boolean).join(" "),
|
|
25
26
|
children: [
|
|
26
|
-
|
|
27
|
+
l && /* @__PURE__ */ i("div", {
|
|
27
28
|
className: "project-card__media",
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
src:
|
|
30
|
-
alt:
|
|
29
|
+
children: /* @__PURE__ */ i("img", {
|
|
30
|
+
src: l.src,
|
|
31
|
+
alt: l.alt
|
|
31
32
|
})
|
|
32
33
|
}),
|
|
33
|
-
|
|
34
|
+
u && u.length > 0 && /* @__PURE__ */ i("ul", {
|
|
34
35
|
className: "project-card__tags",
|
|
35
|
-
"aria-label":
|
|
36
|
-
children:
|
|
36
|
+
"aria-label": v("tags", h),
|
|
37
|
+
children: u.map((e) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(r, {
|
|
37
38
|
variant: e.variant ?? "neutral",
|
|
38
39
|
children: e.label
|
|
39
40
|
}) }, e.id ?? e.label))
|
|
40
41
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
level:
|
|
43
|
-
size:
|
|
42
|
+
/* @__PURE__ */ i(t, {
|
|
43
|
+
level: p,
|
|
44
|
+
size: m,
|
|
44
45
|
className: "project-card__title",
|
|
45
|
-
children:
|
|
46
|
+
children: y
|
|
46
47
|
}),
|
|
47
|
-
|
|
48
|
+
c && /* @__PURE__ */ i(n, {
|
|
48
49
|
className: "project-card__description",
|
|
49
|
-
children:
|
|
50
|
+
children: c
|
|
50
51
|
})
|
|
51
52
|
]
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
//#endregion
|
|
55
|
-
export {
|
|
56
|
+
export { s as ProjectCard };
|
|
@@ -7,29 +7,30 @@ import { SiteShell as r } from "./site-shell.js";
|
|
|
7
7
|
import { forwardRef as i } from "react";
|
|
8
8
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
//#region src/stories/templates/PublicPageShell/PublicPageShell.tsx
|
|
10
|
-
var c = i(function({ children: i, header: c, footer: l, preferences: u, preferencesLabel: d,
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
13
|
-
let
|
|
10
|
+
var c = i(function({ children: i, header: c, footer: l, preferences: u, preferencesLabel: d, preferencesWidth: f = "xl", mainWidth: p = "xl", mainSpace: m = "xl", mainFlush: h = !1, id: g = "main-content", shell: _ = !0 }, v) {
|
|
11
|
+
let y = e("publicPageShell");
|
|
12
|
+
if (!_) return /* @__PURE__ */ o(a, { children: i });
|
|
13
|
+
let b = u && /* @__PURE__ */ o(t, {
|
|
14
14
|
as: "section",
|
|
15
|
+
width: f,
|
|
15
16
|
className: "public-page-shell__preferences",
|
|
16
|
-
"aria-label":
|
|
17
|
+
"aria-label": y("preferences", d),
|
|
17
18
|
children: /* @__PURE__ */ o("div", {
|
|
18
19
|
className: "public-page-shell__preferences-row",
|
|
19
20
|
children: u
|
|
20
21
|
})
|
|
21
22
|
});
|
|
22
23
|
return /* @__PURE__ */ o(r, {
|
|
23
|
-
ref:
|
|
24
|
+
ref: v,
|
|
24
25
|
header: c && /* @__PURE__ */ o(n, { children: c }),
|
|
25
|
-
footer: (
|
|
26
|
+
footer: (b || l) && /* @__PURE__ */ s(a, { children: [b && /* @__PURE__ */ o(n, { children: b }), l && /* @__PURE__ */ o(n, { children: l })] }),
|
|
26
27
|
children: /* @__PURE__ */ o(t, {
|
|
27
28
|
as: "main",
|
|
28
|
-
id:
|
|
29
|
+
id: g,
|
|
29
30
|
tabIndex: -1,
|
|
30
|
-
width:
|
|
31
|
-
space:
|
|
32
|
-
flush:
|
|
31
|
+
width: p,
|
|
32
|
+
space: m,
|
|
33
|
+
flush: h,
|
|
33
34
|
children: i
|
|
34
35
|
})
|
|
35
36
|
});
|
package/dist/slider.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './slider.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { Slider as r } from "@base-ui/react/slider";
|
|
5
6
|
//#region src/stories/atoms/Slider/Slider.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
7
|
+
function i({ value: i, defaultValue: a, onValueChange: o, onValueCommitted: s, label: c, thumbLabel: l, showValue: u = !1, orientation: d = "horizontal", className: f, ...p }) {
|
|
8
|
+
let m = e("slider"), h = i ?? a ?? 0, g = Array.isArray(h) ? h.length : 1, _ = l ?? ((e, t) => t === 1 ? m("value", c) : t === 2 ? m(e === 0 ? "min" : "max") : m("valueAt")(e + 1)), v = [
|
|
8
9
|
"slider",
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
d === "vertical" ? "slider--vertical" : "",
|
|
11
|
+
f ?? ""
|
|
11
12
|
].filter(Boolean).join(" ");
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
className:
|
|
14
|
-
orientation:
|
|
15
|
-
value:
|
|
16
|
-
defaultValue:
|
|
17
|
-
"aria-label":
|
|
18
|
-
onValueChange:
|
|
19
|
-
onValueCommitted:
|
|
20
|
-
...
|
|
21
|
-
children: [/* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ n(r.Root, {
|
|
14
|
+
className: v,
|
|
15
|
+
orientation: d,
|
|
16
|
+
value: i,
|
|
17
|
+
defaultValue: a,
|
|
18
|
+
"aria-label": g === 1 ? void 0 : c,
|
|
19
|
+
onValueChange: o ? (e) => o(e) : void 0,
|
|
20
|
+
onValueCommitted: s ? (e) => s(e) : void 0,
|
|
21
|
+
...p,
|
|
22
|
+
children: [/* @__PURE__ */ t(r.Control, {
|
|
22
23
|
className: "slider__control",
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
+
children: /* @__PURE__ */ n(r.Track, {
|
|
24
25
|
className: "slider__track",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
index:
|
|
26
|
+
children: [/* @__PURE__ */ t(r.Indicator, { className: "slider__indicator" }), Array.from({ length: g }, (e, n) => /* @__PURE__ */ t(r.Thumb, {
|
|
27
|
+
index: n,
|
|
27
28
|
className: "slider__thumb",
|
|
28
|
-
getAriaLabel: () =>
|
|
29
|
-
},
|
|
29
|
+
getAriaLabel: () => _(n, g)
|
|
30
|
+
}, n))]
|
|
30
31
|
})
|
|
31
|
-
}),
|
|
32
|
+
}), u && /* @__PURE__ */ t(r.Value, { className: "slider__value" })]
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
//#endregion
|
|
35
|
-
export {
|
|
36
|
+
export { i as Slider };
|
package/dist/spinner.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import './spinner.css';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { VisuallyHidden as t } from "./visually-hidden.js";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
6
|
//#region src/stories/atoms/Spinner/Spinner.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
function i() {
|
|
8
|
+
return /* @__PURE__ */ n("svg", {
|
|
7
9
|
className: "spinner__square",
|
|
8
10
|
viewBox: "0 0 24 24",
|
|
9
11
|
"aria-hidden": "true",
|
|
10
12
|
focusable: "false",
|
|
11
|
-
children: /* @__PURE__ */
|
|
13
|
+
children: /* @__PURE__ */ n("rect", {
|
|
12
14
|
className: "spinner__stroke",
|
|
13
15
|
x: "2",
|
|
14
16
|
y: "2",
|
|
@@ -18,17 +20,20 @@ function r() {
|
|
|
18
20
|
})
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
function a({ size: a = "md", label: o, "aria-hidden": s }) {
|
|
24
|
+
let c = e("spinner");
|
|
25
|
+
if (s) return /* @__PURE__ */ n("span", {
|
|
26
|
+
className: `spinner spinner--${a}`,
|
|
24
27
|
"aria-hidden": "true",
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
+
children: /* @__PURE__ */ n(i, {})
|
|
29
|
+
});
|
|
30
|
+
let l = c("label", o);
|
|
31
|
+
return /* @__PURE__ */ r("span", {
|
|
32
|
+
className: `spinner spinner--${a}`,
|
|
28
33
|
role: "status",
|
|
29
|
-
"aria-label":
|
|
30
|
-
children: [/* @__PURE__ */
|
|
34
|
+
"aria-label": l,
|
|
35
|
+
children: [/* @__PURE__ */ n(i, {}), /* @__PURE__ */ n(t, { children: l })]
|
|
31
36
|
});
|
|
32
37
|
}
|
|
33
38
|
//#endregion
|
|
34
|
-
export {
|
|
39
|
+
export { a as Spinner };
|
package/dist/stepper.js
CHANGED
|
@@ -1,67 +1,64 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './stepper.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { VisuallyHidden as t } from "./visually-hidden.js";
|
|
5
|
+
import { StepMarker as n } from "./step-marker.js";
|
|
6
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
7
|
//#region src/stories/molecules/Stepper/Stepper.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /* @__PURE__ */ i("div", {
|
|
16
|
-
id: f,
|
|
17
|
-
className: ["stepper", d].filter(Boolean).join(" "),
|
|
18
|
-
children: [/* @__PURE__ */ i("p", {
|
|
8
|
+
function o({ steps: o, current: s, onStepSelect: c, label: l, compactLabel: u, labels: d, className: f, id: p }) {
|
|
9
|
+
let m = e("stepper");
|
|
10
|
+
if (o.length < 2) return null;
|
|
11
|
+
let h = (e) => m(e, d?.[e]), g = o.length, _ = Math.min(Math.max(s, 0), g - 1), v = o[_];
|
|
12
|
+
return /* @__PURE__ */ a("div", {
|
|
13
|
+
id: p,
|
|
14
|
+
className: ["stepper", f].filter(Boolean).join(" "),
|
|
15
|
+
children: [/* @__PURE__ */ a("p", {
|
|
19
16
|
className: "stepper__compact",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
17
|
+
children: [/* @__PURE__ */ i("span", {
|
|
21
18
|
className: "stepper__compact-count",
|
|
22
|
-
children:
|
|
23
|
-
}), /* @__PURE__ */
|
|
19
|
+
children: m("compact", u)(_ + 1, g)
|
|
20
|
+
}), /* @__PURE__ */ i("span", {
|
|
24
21
|
className: "stepper__compact-label",
|
|
25
|
-
children:
|
|
22
|
+
children: v.label
|
|
26
23
|
})]
|
|
27
|
-
}), /* @__PURE__ */
|
|
24
|
+
}), /* @__PURE__ */ i("ol", {
|
|
28
25
|
className: "stepper__list",
|
|
29
|
-
"aria-label":
|
|
30
|
-
children:
|
|
31
|
-
let
|
|
32
|
-
state:
|
|
26
|
+
"aria-label": m("label", l),
|
|
27
|
+
children: o.map((e, o) => {
|
|
28
|
+
let s = o < _ ? "completed" : o === _ ? "current" : "pending", l = c !== void 0 && s !== "current" && (e.reachable ?? s === "completed"), u = /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i(n, {
|
|
29
|
+
state: s === "completed" ? "done" : s === "current" ? "current" : "pending",
|
|
33
30
|
count: o + 1,
|
|
34
31
|
className: "stepper__marker"
|
|
35
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ a("span", {
|
|
36
33
|
className: "stepper__text",
|
|
37
34
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ a(t, { children: [h(s), ": "] }),
|
|
36
|
+
/* @__PURE__ */ i("span", {
|
|
40
37
|
className: "stepper__label",
|
|
41
|
-
children:
|
|
38
|
+
children: e.label
|
|
42
39
|
}),
|
|
43
|
-
|
|
40
|
+
e.description && /* @__PURE__ */ i("span", {
|
|
44
41
|
className: "stepper__description",
|
|
45
|
-
children:
|
|
42
|
+
children: e.description
|
|
46
43
|
})
|
|
47
44
|
]
|
|
48
45
|
})] });
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
className: `stepper__step stepper__step--${
|
|
51
|
-
children: l ? /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ i("li", {
|
|
47
|
+
className: `stepper__step stepper__step--${s}`,
|
|
48
|
+
children: l ? /* @__PURE__ */ i("button", {
|
|
52
49
|
type: "button",
|
|
53
50
|
className: "stepper__item stepper__item--action",
|
|
54
|
-
onClick: () =>
|
|
51
|
+
onClick: () => c(o, e),
|
|
55
52
|
children: u
|
|
56
|
-
}) : /* @__PURE__ */
|
|
53
|
+
}) : /* @__PURE__ */ i("span", {
|
|
57
54
|
className: "stepper__item",
|
|
58
|
-
"aria-current":
|
|
55
|
+
"aria-current": s === "current" ? "step" : void 0,
|
|
59
56
|
children: u
|
|
60
57
|
})
|
|
61
|
-
},
|
|
58
|
+
}, e.id ?? o);
|
|
62
59
|
})
|
|
63
60
|
})]
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
63
|
//#endregion
|
|
67
|
-
export {
|
|
64
|
+
export { o as Stepper };
|