@studiolxd/brand 47.0.0 → 48.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 +170 -0
- package/dist/_shared/progressbar.js +19 -18
- 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/EmptyState/EmptyState.d.ts +2 -0
- package/dist/_types/molecules/LanguageSwitcher/LanguageSwitcher.d.ts +13 -1
- package/dist/_types/molecules/NotificationList/NotificationList.d.ts +33 -3
- package/dist/_types/molecules/PageIntro/PageIntro.d.ts +12 -7
- 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/Hero/Hero.d.ts +4 -1
- package/dist/_types/sections/LegalFooter/LegalFooter.d.ts +13 -1
- package/dist/_types/templates/PublicPageShell/PublicPageShell.d.ts +15 -1
- package/dist/brand.css +12 -2
- 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/language-switcher.js +43 -41
- package/dist/legal-footer.js +21 -18
- package/dist/link.css +1 -1
- package/dist/notification-list.js +40 -38
- package/dist/page-intro.css +1 -1
- package/dist/page-intro.js +23 -17
- 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 -2
- package/dist/tree-view.js +86 -85
- package/dist/uptime-bars.js +54 -53
- package/package.json +1 -1
- package/src/tokens/molecules/page-intro.css +1 -1
- package/src/tokens/scss/molecules/_page-intro.scss +1 -1
package/dist/calendar-planner.js
CHANGED
|
@@ -6,62 +6,62 @@ import { Tag as n } from "./tag.js";
|
|
|
6
6
|
import { Modal as r } from "./modal.js";
|
|
7
7
|
import { c as i, i as a, l as o, n as s, o as c, r as l, s as u, t as d } from "./_shared/calendargrid.js";
|
|
8
8
|
import { useCallback as f, useId as ee, useState as p } from "react";
|
|
9
|
-
import { Fragment as
|
|
9
|
+
import { Fragment as te, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
10
|
//#region src/stories/molecules/CalendarPlanner/CalendarPlanner.tsx
|
|
11
|
-
function
|
|
12
|
-
let [
|
|
13
|
-
|
|
14
|
-
}, [
|
|
11
|
+
function g({ events: g = [], renderDay: _, maxItemsPerDay: v = 3, onMoreClick: y, showMoreDialog: b, onDayClick: x, month: S, defaultMonth: C, onMonthChange: w, navigable: T = !0, locale: E = "es-ES", previousMonthLabel: D, nextMonthLabel: O, gridLabel: k, moreLabel: ne, size: A = "md", className: j }) {
|
|
12
|
+
let [M, N] = p(() => S ?? C ?? /* @__PURE__ */ new Date()), [P, F] = p(null), I = b ?? !y, L = f(() => F(null), []), R = S ?? M, z = f((e) => {
|
|
13
|
+
N(e), w?.(e);
|
|
14
|
+
}, [w]), B = e("calendar"), V = e("calendarPlanner"), H = /* @__PURE__ */ new Date(), U = A === "sm" ? "xs" : A === "lg" ? "md" : "sm", W = new Intl.DateTimeFormat(E, {
|
|
15
15
|
month: "long",
|
|
16
16
|
year: "numeric"
|
|
17
|
-
}).format(
|
|
17
|
+
}).format(R), G = new Intl.DateTimeFormat(E, {
|
|
18
18
|
weekday: "long",
|
|
19
19
|
day: "numeric",
|
|
20
20
|
month: "long",
|
|
21
21
|
year: "numeric"
|
|
22
|
-
}), K = new Intl.DateTimeFormat(
|
|
22
|
+
}), K = new Intl.DateTimeFormat(E, {
|
|
23
23
|
weekday: "long",
|
|
24
24
|
day: "numeric",
|
|
25
25
|
month: "long",
|
|
26
26
|
year: "numeric"
|
|
27
|
-
}), q = l(
|
|
28
|
-
month:
|
|
29
|
-
onMonthChange:
|
|
30
|
-
onActivate:
|
|
31
|
-
}), $ = `${ee()}-planner-title-${
|
|
32
|
-
return /* @__PURE__ */
|
|
27
|
+
}), q = l(E, "short"), J = d(s(R)), Y = i(R, -1), X = i(R, 1), Z = (e) => g.filter((t) => a(t.date, e)), Q = o({
|
|
28
|
+
month: R,
|
|
29
|
+
onMonthChange: z,
|
|
30
|
+
onActivate: x ? (e) => x(e, Z(e)) : void 0
|
|
31
|
+
}), $ = `${ee()}-planner-title-${R.getFullYear()}-${R.getMonth()}`;
|
|
32
|
+
return /* @__PURE__ */ h("div", {
|
|
33
33
|
className: [
|
|
34
34
|
"calendar-planner",
|
|
35
|
-
`calendar-planner--${
|
|
36
|
-
|
|
35
|
+
`calendar-planner--${A}`,
|
|
36
|
+
j
|
|
37
37
|
].filter(Boolean).join(" "),
|
|
38
38
|
children: [
|
|
39
39
|
c({
|
|
40
40
|
block: "calendar-planner",
|
|
41
41
|
title: W,
|
|
42
42
|
titleId: $,
|
|
43
|
-
navigable:
|
|
44
|
-
previousLabel:
|
|
45
|
-
nextLabel:
|
|
46
|
-
onPrev: () =>
|
|
47
|
-
onNext: () =>
|
|
43
|
+
navigable: T,
|
|
44
|
+
previousLabel: T ? B("previousMonth", D) : void 0,
|
|
45
|
+
nextLabel: T ? B("nextMonth", O) : void 0,
|
|
46
|
+
onPrev: () => z(Y),
|
|
47
|
+
onNext: () => z(X),
|
|
48
48
|
chevronSize: U
|
|
49
49
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ h("div", {
|
|
51
51
|
className: "calendar-planner__grid",
|
|
52
52
|
role: "grid",
|
|
53
|
-
"aria-label":
|
|
54
|
-
"aria-labelledby":
|
|
55
|
-
onKeyDown:
|
|
53
|
+
"aria-label": k,
|
|
54
|
+
"aria-labelledby": k ? void 0 : $,
|
|
55
|
+
onKeyDown: x ? Q.onKeyDown : void 0,
|
|
56
56
|
children: [u({
|
|
57
57
|
block: "calendar-planner",
|
|
58
58
|
rowModifier: "header",
|
|
59
59
|
weekdays: q
|
|
60
|
-
}), J.map((e, r) => /* @__PURE__ */
|
|
60
|
+
}), J.map((e, r) => /* @__PURE__ */ m("div", {
|
|
61
61
|
role: "row",
|
|
62
62
|
className: "calendar-planner__row",
|
|
63
63
|
children: e.map(({ date: e, outside: r }) => {
|
|
64
|
-
let i = a(e, H), o = Z(e), s = o.slice(0,
|
|
64
|
+
let i = a(e, H), o = Z(e), s = o.slice(0, v), c = o.length - s.length, l = [
|
|
65
65
|
"calendar-planner__cell",
|
|
66
66
|
r && "calendar-planner__cell--outside",
|
|
67
67
|
i && "calendar-planner__cell--today"
|
|
@@ -70,48 +70,48 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
70
70
|
i && "calendar-planner__day-number--today",
|
|
71
71
|
r && "calendar-planner__day-number--outside"
|
|
72
72
|
].filter(Boolean).join(" ");
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
ref:
|
|
73
|
+
return /* @__PURE__ */ h("div", {
|
|
74
|
+
ref: x ? Q.cellRef(e) : void 0,
|
|
75
75
|
role: "gridcell",
|
|
76
|
-
className: [l,
|
|
76
|
+
className: [l, x ? "calendar-planner__cell--clickable" : ""].filter(Boolean).join(" "),
|
|
77
77
|
"aria-current": i ? "date" : void 0,
|
|
78
|
-
tabIndex:
|
|
79
|
-
onFocus:
|
|
80
|
-
onClick:
|
|
81
|
-
children: [/* @__PURE__ */
|
|
78
|
+
tabIndex: x ? Q.isTabbable(e) ? 0 : -1 : void 0,
|
|
79
|
+
onFocus: x ? () => Q.onCellFocus(e) : void 0,
|
|
80
|
+
onClick: x ? () => x(e, o) : void 0,
|
|
81
|
+
children: [/* @__PURE__ */ h("span", {
|
|
82
82
|
className: u,
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ m(t, { children: G.format(e) }), /* @__PURE__ */ m("span", {
|
|
84
84
|
"aria-hidden": "true",
|
|
85
85
|
children: e.getDate()
|
|
86
86
|
})]
|
|
87
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ m("div", {
|
|
88
88
|
className: "calendar-planner__cell-body",
|
|
89
|
-
children:
|
|
89
|
+
children: _ ? _(e, o) : /* @__PURE__ */ h(te, { children: [s.map((e) => /* @__PURE__ */ m(n, {
|
|
90
90
|
variant: e.variant ?? "neutral",
|
|
91
91
|
children: e.label
|
|
92
|
-
}, e.id)), c > 0 && /* @__PURE__ */
|
|
92
|
+
}, e.id)), c > 0 && /* @__PURE__ */ m("button", {
|
|
93
93
|
type: "button",
|
|
94
94
|
className: "calendar-planner__more",
|
|
95
95
|
onClick: (t) => {
|
|
96
|
-
t.stopPropagation(),
|
|
96
|
+
t.stopPropagation(), I && F({
|
|
97
97
|
date: e,
|
|
98
98
|
events: o
|
|
99
|
-
}),
|
|
99
|
+
}), y?.(e, o);
|
|
100
100
|
},
|
|
101
|
-
children:
|
|
101
|
+
children: V("more", ne)(c)
|
|
102
102
|
})] })
|
|
103
103
|
})]
|
|
104
104
|
}, e.toISOString());
|
|
105
105
|
})
|
|
106
106
|
}, r))]
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
open:
|
|
110
|
-
onClose:
|
|
111
|
-
title:
|
|
112
|
-
children: /* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ m(r, {
|
|
109
|
+
open: P !== null,
|
|
110
|
+
onClose: L,
|
|
111
|
+
title: P ? K.format(P.date) : void 0,
|
|
112
|
+
children: /* @__PURE__ */ m("div", {
|
|
113
113
|
className: "calendar-planner__modal-events",
|
|
114
|
-
children:
|
|
114
|
+
children: P?.events.map((e) => /* @__PURE__ */ m(n, {
|
|
115
115
|
variant: e.variant ?? "neutral",
|
|
116
116
|
children: e.label
|
|
117
117
|
}, e.id))
|
|
@@ -121,4 +121,4 @@ function _({ events: _ = [], renderDay: v, maxItemsPerDay: y = 3, onMoreClick: b
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
|
-
export {
|
|
124
|
+
export { g as CalendarPlanner };
|
package/dist/calendar-roster.js
CHANGED
|
@@ -23,48 +23,51 @@ var u = {
|
|
|
23
23
|
}, d = [
|
|
24
24
|
{
|
|
25
25
|
type: "holiday",
|
|
26
|
-
|
|
26
|
+
key: "holiday"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
type: "vacation",
|
|
30
|
-
|
|
30
|
+
key: "vacation"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
type: "absence",
|
|
34
|
-
|
|
34
|
+
key: "absence"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: "recovery",
|
|
38
|
-
|
|
38
|
+
key: "recovery"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
type: "birthday",
|
|
42
|
-
|
|
42
|
+
key: "birthday"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
type: "non-working",
|
|
46
|
-
|
|
46
|
+
key: "nonWorking"
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
|
-
function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent: g, renderCell: _, nameLabel: v
|
|
50
|
-
let D = e("calendar"), O =
|
|
49
|
+
function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent: g, renderCell: _, nameLabel: v, birthdayPrefix: y = "🎂 ", showLegend: b = !0, locale: x = "es-ES", legendItems: S, legendLabel: C, previousMonthLabel: w, nextMonthLabel: T, className: E }) {
|
|
50
|
+
let D = e("calendar"), O = e("calendarRoster"), k = S ?? (b ? d.map(({ type: e, key: t }) => ({
|
|
51
|
+
type: e,
|
|
52
|
+
label: O(t)
|
|
53
|
+
})) : []), A = /* @__PURE__ */ new Date(), j = l(p), M = r(p, -1), N = r(p, 1), P = new Intl.DateTimeFormat(x, {
|
|
51
54
|
month: "long",
|
|
52
55
|
year: "numeric"
|
|
53
|
-
}).format(p),
|
|
56
|
+
}).format(p), F = new Intl.DateTimeFormat(x, { weekday: "narrow" }), I = new Intl.DateTimeFormat(x, { weekday: "long" }), L = m ? (e) => (t) => {
|
|
54
57
|
h && t.preventDefault(), m(e);
|
|
55
|
-
} : void 0,
|
|
58
|
+
} : void 0, R = `roster-title-${p.getFullYear()}-${p.getMonth()}`;
|
|
56
59
|
return /* @__PURE__ */ s("div", {
|
|
57
60
|
className: ["calendar-roster", E].filter(Boolean).join(" "),
|
|
58
61
|
children: [
|
|
59
62
|
/* @__PURE__ */ o("div", {
|
|
60
63
|
className: "calendar-roster__nav",
|
|
61
64
|
children: /* @__PURE__ */ o(n, {
|
|
62
|
-
label:
|
|
63
|
-
labelId:
|
|
64
|
-
prevHref: h?.(
|
|
65
|
-
nextHref: h?.(
|
|
66
|
-
prevOnClick:
|
|
67
|
-
nextOnClick:
|
|
65
|
+
label: P,
|
|
66
|
+
labelId: R,
|
|
67
|
+
prevHref: h?.(M),
|
|
68
|
+
nextHref: h?.(N),
|
|
69
|
+
prevOnClick: L?.(M),
|
|
70
|
+
nextOnClick: L?.(N),
|
|
68
71
|
prevLabel: D("previousMonth", w),
|
|
69
72
|
nextLabel: D("nextMonth", T),
|
|
70
73
|
linkComponent: g
|
|
@@ -74,17 +77,17 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
74
77
|
className: "calendar-roster__wrap",
|
|
75
78
|
children: /* @__PURE__ */ s("table", {
|
|
76
79
|
className: "calendar-roster__table",
|
|
77
|
-
"aria-labelledby":
|
|
80
|
+
"aria-labelledby": R,
|
|
78
81
|
children: [/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ s("tr", { children: [/* @__PURE__ */ o("th", {
|
|
79
82
|
className: "calendar-roster__th-name",
|
|
80
83
|
scope: "col",
|
|
81
|
-
children: v
|
|
82
|
-
}),
|
|
83
|
-
let t = i(e,
|
|
84
|
+
children: O("name", v)
|
|
85
|
+
}), j.map((e) => {
|
|
86
|
+
let t = i(e, A), n = [
|
|
84
87
|
"calendar-roster__th-day",
|
|
85
88
|
c(e) && "calendar-roster__th-day--weekend",
|
|
86
89
|
t && "calendar-roster__th-day--today"
|
|
87
|
-
].filter(Boolean).join(" "), r = String(e.getDate()).padStart(2, "0"), a =
|
|
90
|
+
].filter(Boolean).join(" "), r = String(e.getDate()).padStart(2, "0"), a = F.format(e), l = I.format(e);
|
|
88
91
|
return /* @__PURE__ */ s("th", {
|
|
89
92
|
className: n,
|
|
90
93
|
scope: "col",
|
|
@@ -104,8 +107,8 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
104
107
|
className: "calendar-roster__th-name-row",
|
|
105
108
|
title: e.name,
|
|
106
109
|
children: e.name
|
|
107
|
-
}),
|
|
108
|
-
let r = n.getDate(), l = e.cells[r] ?? null, d = c(n), f = i(n,
|
|
110
|
+
}), j.map((n) => {
|
|
111
|
+
let r = n.getDate(), l = e.cells[r] ?? null, d = c(n), f = i(n, A), p = l?.type === "holiday", m = l?.type === "non-working";
|
|
109
112
|
return /* @__PURE__ */ o("td", {
|
|
110
113
|
className: [
|
|
111
114
|
"calendar-roster__cell",
|
|
@@ -128,8 +131,8 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
128
131
|
b && /* @__PURE__ */ o("div", {
|
|
129
132
|
className: "calendar-roster__legend",
|
|
130
133
|
role: "group",
|
|
131
|
-
"aria-label": C,
|
|
132
|
-
children:
|
|
134
|
+
"aria-label": O("legend", C),
|
|
135
|
+
children: k.map(({ type: e, label: n }) => /* @__PURE__ */ o("span", {
|
|
133
136
|
className: "calendar-roster__legend-item",
|
|
134
137
|
children: e === "non-working" ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", { className: "calendar-roster__legend-swatch calendar-roster__legend-swatch--non-working" }), n] }) : /* @__PURE__ */ o(t, {
|
|
135
138
|
variant: u[e],
|
package/dist/carousel.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './carousel.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
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 { t as i } from "./_shared/css-properties.js";
|
|
8
|
+
import { Children as a, useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
9
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
10
|
//#region src/stories/molecules/Carousel/Carousel.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
let t =
|
|
11
|
+
function p({ children: p, label: m, roleDescription: h, trackLabel: g, slideSize: _, controls: v = !0, indicators: y = !1, autoplay: b, prevLabel: x, nextLabel: S, indicatorLabel: C, pauseLabel: w, playLabel: T, slideStatusLabel: E, className: D, id: O }) {
|
|
12
|
+
let k = e("carousel"), A = c(null), [j, M] = l(0), N = c(0), [P, F] = l(!1), [I, L] = l(!1), R = a.count(p), z = b !== void 0 && !I, B = (e) => Array.from(e.children), V = o((e) => {
|
|
13
|
+
let t = A.current;
|
|
13
14
|
if (!t) return;
|
|
14
|
-
let n =
|
|
15
|
+
let n = B(t);
|
|
15
16
|
if (n.length === 0) return;
|
|
16
17
|
let r = n[(e + n.length) % n.length], i = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
17
18
|
t.scrollTo({
|
|
@@ -19,106 +20,107 @@ function f({ children: f, label: p = "Carrusel", roleDescription: m = "carrusel"
|
|
|
19
20
|
behavior: i ? "auto" : "smooth"
|
|
20
21
|
});
|
|
21
22
|
}, []);
|
|
22
|
-
|
|
23
|
-
let e =
|
|
23
|
+
s(() => {
|
|
24
|
+
let e = A.current;
|
|
24
25
|
if (!e) return;
|
|
25
26
|
let t = () => {
|
|
26
|
-
let t =
|
|
27
|
+
let t = B(e);
|
|
27
28
|
if (t.length === 0) return;
|
|
28
29
|
let n = t[0].offsetLeft, r = 0, i = Infinity;
|
|
29
30
|
t.forEach((t, a) => {
|
|
30
31
|
let o = Math.abs(t.offsetLeft - n - e.scrollLeft);
|
|
31
32
|
o < i && (i = o, r = a);
|
|
32
|
-
}),
|
|
33
|
+
}), N.current = r, M(r);
|
|
33
34
|
};
|
|
34
35
|
return t(), e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
35
|
-
}, [
|
|
36
|
-
if (!
|
|
37
|
-
let e = window.setInterval(() =>
|
|
36
|
+
}, [p]), s(() => {
|
|
37
|
+
if (!b || I || P || R < 2 || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
38
|
+
let e = window.setInterval(() => V(N.current + 1), b);
|
|
38
39
|
return () => window.clearInterval(e);
|
|
39
40
|
}, [
|
|
40
|
-
|
|
41
|
-
P,
|
|
42
|
-
M,
|
|
41
|
+
b,
|
|
43
42
|
I,
|
|
44
|
-
|
|
43
|
+
P,
|
|
44
|
+
R,
|
|
45
|
+
V
|
|
45
46
|
]);
|
|
46
|
-
let
|
|
47
|
-
e.key === "ArrowRight" ? (e.preventDefault(),
|
|
47
|
+
let H = (e) => {
|
|
48
|
+
e.key === "ArrowRight" ? (e.preventDefault(), V(j + 1)) : e.key === "ArrowLeft" && (e.preventDefault(), V(j - 1));
|
|
48
49
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
id:
|
|
51
|
-
ref:
|
|
52
|
-
className: ["carousel",
|
|
50
|
+
return /* @__PURE__ */ f("div", {
|
|
51
|
+
id: O,
|
|
52
|
+
ref: i({ "--carousel-slide-size": _ }),
|
|
53
|
+
className: ["carousel", D].filter(Boolean).join(" "),
|
|
53
54
|
role: "region",
|
|
54
|
-
"aria-roledescription":
|
|
55
|
-
"aria-label":
|
|
56
|
-
onMouseEnter: () =>
|
|
57
|
-
onMouseLeave: () =>
|
|
58
|
-
onFocus: () =>
|
|
59
|
-
onBlur: () =>
|
|
55
|
+
"aria-roledescription": k("roleDescription", h),
|
|
56
|
+
"aria-label": k("label", m),
|
|
57
|
+
onMouseEnter: () => F(!0),
|
|
58
|
+
onMouseLeave: () => F(!1),
|
|
59
|
+
onFocus: () => F(!0),
|
|
60
|
+
onBlur: () => F(!1),
|
|
60
61
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
ref:
|
|
62
|
+
/* @__PURE__ */ d("div", {
|
|
63
|
+
ref: A,
|
|
63
64
|
className: "carousel__track",
|
|
64
65
|
tabIndex: 0,
|
|
65
66
|
role: "group",
|
|
66
|
-
"aria-label":
|
|
67
|
-
onKeyDown:
|
|
68
|
-
children:
|
|
67
|
+
"aria-label": k("track", g),
|
|
68
|
+
onKeyDown: H,
|
|
69
|
+
children: p
|
|
69
70
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ d(n, {
|
|
71
72
|
as: "div",
|
|
72
73
|
role: "status",
|
|
73
|
-
"aria-live":
|
|
74
|
+
"aria-live": z ? "off" : "polite",
|
|
74
75
|
"aria-atomic": "true",
|
|
75
|
-
children:
|
|
76
|
+
children: k("slideStatus", E)(j, R)
|
|
76
77
|
}),
|
|
77
|
-
(
|
|
78
|
+
(v || y || b !== void 0) && /* @__PURE__ */ f("div", {
|
|
78
79
|
className: "carousel__controls",
|
|
79
|
-
children: [
|
|
80
|
+
children: [y && /* @__PURE__ */ d("div", {
|
|
80
81
|
className: "carousel__indicators",
|
|
81
|
-
children: Array.from({ length:
|
|
82
|
+
children: Array.from({ length: R }, (e, t) => /* @__PURE__ */ d("button", {
|
|
82
83
|
type: "button",
|
|
83
84
|
className: "carousel__indicator",
|
|
84
|
-
"aria-label":
|
|
85
|
-
"aria-current": t ===
|
|
86
|
-
onClick: () =>
|
|
85
|
+
"aria-label": k("indicator", C)(t),
|
|
86
|
+
"aria-current": t === j ? "true" : void 0,
|
|
87
|
+
onClick: () => V(t)
|
|
87
88
|
}, t))
|
|
88
|
-
}), (
|
|
89
|
+
}), (v || b !== void 0) && /* @__PURE__ */ f("div", {
|
|
89
90
|
className: "carousel__buttons",
|
|
90
|
-
children: [
|
|
91
|
+
children: [b !== void 0 && /* @__PURE__ */ d(r, {
|
|
91
92
|
variant: "ghost",
|
|
92
93
|
iconOnly: !0,
|
|
93
|
-
"aria-label":
|
|
94
|
-
onClick: () =>
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
}),
|
|
94
|
+
"aria-label": z ? k("pause", w) : k("play", T),
|
|
95
|
+
onClick: () => L((e) => !e),
|
|
96
|
+
children: /* @__PURE__ */ d(t, { name: z ? "pause" : "play" })
|
|
97
|
+
}), v && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(r, {
|
|
97
98
|
variant: "ghost",
|
|
98
99
|
iconOnly: !0,
|
|
99
|
-
"aria-label":
|
|
100
|
-
onClick: () =>
|
|
101
|
-
children: /* @__PURE__ */
|
|
102
|
-
}), /* @__PURE__ */
|
|
100
|
+
"aria-label": k("previous", x),
|
|
101
|
+
onClick: () => V(j - 1),
|
|
102
|
+
children: /* @__PURE__ */ d(t, { name: "arrow-left" })
|
|
103
|
+
}), /* @__PURE__ */ d(r, {
|
|
103
104
|
variant: "ghost",
|
|
104
105
|
iconOnly: !0,
|
|
105
|
-
"aria-label":
|
|
106
|
-
onClick: () =>
|
|
107
|
-
children: /* @__PURE__ */
|
|
106
|
+
"aria-label": k("next", S),
|
|
107
|
+
onClick: () => V(j + 1),
|
|
108
|
+
children: /* @__PURE__ */ d(t, { name: "arrow" })
|
|
108
109
|
})] })]
|
|
109
110
|
})]
|
|
110
111
|
})
|
|
111
112
|
]
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
function m({ roleDescription: t, className: n, children: r, ...i }) {
|
|
116
|
+
let a = e("carousel");
|
|
117
|
+
return /* @__PURE__ */ d("div", {
|
|
118
|
+
className: ["carousel__slide", n].filter(Boolean).join(" "),
|
|
117
119
|
role: "group",
|
|
118
|
-
"aria-roledescription":
|
|
119
|
-
...
|
|
120
|
-
children:
|
|
120
|
+
"aria-roledescription": a("slideRoleDescription", t),
|
|
121
|
+
...i,
|
|
122
|
+
children: r
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
125
|
//#endregion
|
|
124
|
-
export {
|
|
126
|
+
export { p as Carousel, m as CarouselSlide };
|