@alea-design/ui 0.6.0 → 0.6.1
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/dist/components/command/CommandPalette.js +63 -61
- package/dist/components/data/Data.d.ts +5 -3
- package/dist/components/data/Data.js +38 -38
- package/dist/components/media/Media.d.ts +5 -1
- package/dist/components/media/Media.js +113 -111
- package/dist/components/navigation/Navigation.d.ts +7 -3
- package/dist/components/navigation/Navigation.js +94 -94
- package/dist/components/navigation/Navigation2.d.ts +1 -1
- package/dist/components/navigation/Navigation2.js +41 -41
- package/dist/components/overlay/Overlay.d.ts +4 -0
- package/dist/components/overlay/Overlay.js +52 -52
- package/dist/components/page/PageParts.d.ts +6 -2
- package/dist/components/page/PageParts.js +92 -84
- package/dist/css/base.css +1 -1
- package/dist/css/data.css +1 -1
- package/dist/css/groups.json +4 -4
- package/dist/css/navigation.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/i18n/strings.d.ts +3 -1
- package/dist/i18n/strings.js +6 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -1,153 +1,155 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Pause as
|
|
5
|
-
import { cx as
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { DialogModal as
|
|
2
|
+
import { jsxs as f, jsx as e, Fragment as B } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as U, useState as x, useId as X, useCallback as _, useEffect as L, forwardRef as O, useMemo as W, useLayoutEffect as G } from "react";
|
|
4
|
+
import { Pause as J, Play as K, ChevronLeft as Y, ChevronRight as V, ImageOff as ee, ZoomOut as ae, ZoomIn as te, X as le } from "lucide-react";
|
|
5
|
+
import { cx as I } from "../../utils/cx.js";
|
|
6
|
+
import { IconButton as z, Button as S } from "../button/Button.js";
|
|
7
|
+
import { DialogModal as j, Dialog as Q } from "../overlay/Overlay.js";
|
|
8
8
|
import { useStrings as R } from "../../i18n/strings.js";
|
|
9
|
-
import { DotField as
|
|
10
|
-
import { inertProps as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { DotField as re } from "../../utils/DotField.js";
|
|
10
|
+
import { inertProps as ne } from "../../utils/inert.js";
|
|
11
|
+
const F = (c) => c.time && (c.dateTime ? /* @__PURE__ */ e("time", { className: "alea-tl-time", dateTime: c.dateTime, children: c.time }) : /* @__PURE__ */ e("span", { className: "alea-tl-time", children: c.time }));
|
|
12
|
+
function pe({ items: c, pending: r, mode: s = "start", reverse: m, size: b, timePlacement: w = "above", className: h, "aria-label": p }) {
|
|
13
|
+
const o = m ? [...c].reverse() : c;
|
|
14
|
+
return /* @__PURE__ */ f("ol", { "aria-label": p, className: I("alea-timeline", h), "data-mode": s !== "start" ? s : void 0, "data-size": b, children: [
|
|
15
|
+
o.map((t) => /* @__PURE__ */ f("li", { className: "alea-tl-item", "data-tone": t.tone || "neutral", "data-active": t.isActive || void 0, children: [
|
|
15
16
|
/* @__PURE__ */ e("span", { className: "alea-tl-dot", "aria-hidden": "true", children: t.dot }),
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
17
|
+
/* @__PURE__ */ f("div", { className: "alea-tl-body", children: [
|
|
18
|
+
w === "above" && F(t),
|
|
18
19
|
t.href ? /* @__PURE__ */ e("p", { className: "alea-tl-title", children: /* @__PURE__ */ e("a", { className: "alea-tl-link alea-focus-ring", href: t.href, children: t.title }) }) : t.onPress ? /* @__PURE__ */ e("p", { className: "alea-tl-title", children: /* @__PURE__ */ e("button", { type: "button", className: "alea-tl-link alea-focus-ring", onClick: t.onPress, children: t.title }) }) : /* @__PURE__ */ e("p", { className: "alea-tl-title", children: t.title }),
|
|
20
|
+
w === "below" && F(t),
|
|
19
21
|
t.description && /* @__PURE__ */ e("div", { className: "alea-tl-desc", children: t.description })
|
|
20
22
|
] })
|
|
21
23
|
] }, t.id)),
|
|
22
|
-
r && /* @__PURE__ */
|
|
24
|
+
r && /* @__PURE__ */ f("li", { className: "alea-tl-item", "data-pending": !0, children: [
|
|
23
25
|
/* @__PURE__ */ e("span", { className: "alea-tl-dot", "aria-hidden": "true" }),
|
|
24
26
|
/* @__PURE__ */ e("div", { className: "alea-tl-body", children: /* @__PURE__ */ e("p", { className: "alea-tl-title alea-tl-pending", children: r }) })
|
|
25
27
|
] })
|
|
26
28
|
] });
|
|
27
29
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
+
function be({ children: c, "aria-label": r, autoplay: s, perView: m = 1, showDots: b = !0, className: w }) {
|
|
31
|
+
const h = R(), p = U(null), [o, t] = x(0), [g, v] = x(!!s), [y, i] = x(!1), N = c.length, u = Math.max(1, Math.ceil(N - m + 1)), n = X(), l = _((d) => {
|
|
30
32
|
var E;
|
|
31
|
-
const a =
|
|
33
|
+
const a = p.current;
|
|
32
34
|
if (!a) return;
|
|
33
|
-
const
|
|
34
|
-
typeof a.scrollTo == "function" ? a.scrollTo({ left: M, behavior: $ ? "auto" : "smooth" }) : a.scrollLeft = M,
|
|
35
|
-
}, [
|
|
35
|
+
const k = (d + u) % u, C = a.children[k], P = getComputedStyle(a).direction === "rtl", M = C ? a.scrollLeft + (P ? C.getBoundingClientRect().right - a.getBoundingClientRect().right : C.getBoundingClientRect().left - a.getBoundingClientRect().left) : 0, $ = ((E = window.matchMedia) == null ? void 0 : E.call(window, "(prefers-reduced-motion: reduce)").matches) && document.documentElement.getAttribute("data-alea-reduced") !== "never" || ["off", "reduced"].includes(document.documentElement.getAttribute("data-alea-motion") || "");
|
|
36
|
+
typeof a.scrollTo == "function" ? a.scrollTo({ left: M, behavior: $ ? "auto" : "smooth" }) : a.scrollLeft = M, t(k);
|
|
37
|
+
}, [u]);
|
|
36
38
|
return L(() => {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
+
const d = p.current;
|
|
40
|
+
if (!d) return;
|
|
39
41
|
const a = () => {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
+
const k = d.clientWidth / m;
|
|
43
|
+
t(Math.min(u - 1, Math.round(Math.abs(d.scrollLeft) / Math.max(1, k))));
|
|
42
44
|
};
|
|
43
|
-
return
|
|
44
|
-
}, [
|
|
45
|
+
return d.addEventListener("scroll", a, { passive: !0 }), () => d.removeEventListener("scroll", a);
|
|
46
|
+
}, [m, u]), L(() => {
|
|
45
47
|
var a;
|
|
46
48
|
if (!s || !g || y || typeof window < "u" && ((a = window.matchMedia) != null && a.call(window, "(prefers-reduced-motion: reduce)").matches)) return;
|
|
47
|
-
const
|
|
48
|
-
return () => clearInterval(
|
|
49
|
-
}, [s, g, y,
|
|
49
|
+
const d = setInterval(() => l(o + 1), s);
|
|
50
|
+
return () => clearInterval(d);
|
|
51
|
+
}, [s, g, y, o, l]), /* @__PURE__ */ f(
|
|
50
52
|
"section",
|
|
51
53
|
{
|
|
52
|
-
className:
|
|
54
|
+
className: I("alea-carousel", w),
|
|
53
55
|
"aria-roledescription": "carousel",
|
|
54
56
|
"aria-label": r,
|
|
55
|
-
onMouseEnter: () =>
|
|
56
|
-
onMouseLeave: () =>
|
|
57
|
-
onFocusCapture: () =>
|
|
58
|
-
onBlurCapture: () =>
|
|
57
|
+
onMouseEnter: () => i(!0),
|
|
58
|
+
onMouseLeave: () => i(!1),
|
|
59
|
+
onFocusCapture: () => i(!0),
|
|
60
|
+
onBlurCapture: () => i(!1),
|
|
59
61
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
s && /* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */ e(
|
|
63
|
-
/* @__PURE__ */ e(
|
|
62
|
+
/* @__PURE__ */ f("div", { className: "alea-carousel-controls", children: [
|
|
63
|
+
s && /* @__PURE__ */ e(z, { size: "sm", "aria-label": g ? h.stopSlides : h.playSlides, onPress: () => v((d) => !d), children: g ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(K, {}) }),
|
|
64
|
+
/* @__PURE__ */ e(z, { size: "sm", "aria-label": h.previousSlide, "aria-controls": `${n}-track`, onPress: () => l(o - 1), children: /* @__PURE__ */ e(Y, {}) }),
|
|
65
|
+
/* @__PURE__ */ e(z, { size: "sm", "aria-label": h.nextSlide, "aria-controls": `${n}-track`, onPress: () => l(o + 1), children: /* @__PURE__ */ e(V, {}) })
|
|
64
66
|
] }),
|
|
65
|
-
/* @__PURE__ */ e("div", { ref:
|
|
66
|
-
b &&
|
|
67
|
+
/* @__PURE__ */ e("div", { ref: p, id: `${n}-track`, className: "alea-carousel-track alea-focus-ring", tabIndex: 0, "aria-label": h.slides, "aria-live": g && !y ? "off" : "polite", style: { "--alea-per-view": m }, children: c.map((d, a) => /* @__PURE__ */ e("div", { className: "alea-carousel-slide", role: "group", "aria-roledescription": "slide", "aria-label": h.nOfTotal(a + 1, N), "aria-hidden": a < o || a >= o + m ? !0 : void 0, ...ne(a < o || a >= o + m), children: d }, a)) }),
|
|
68
|
+
b && u > 1 && /* @__PURE__ */ e("div", { className: "alea-carousel-dots", role: "group", "aria-label": h.chooseSlide, children: Array.from({ length: u }, (d, a) => /* @__PURE__ */ e("button", { type: "button", className: "alea-carousel-dot alea-focus-ring", "aria-label": h.slideN(a + 1), "aria-current": a === o ? "true" : void 0, onClick: () => l(a) }, a)) })
|
|
67
69
|
]
|
|
68
70
|
}
|
|
69
71
|
);
|
|
70
72
|
}
|
|
71
|
-
function
|
|
72
|
-
const n = R(), [l,
|
|
73
|
-
M && l !== "error" && /* @__PURE__ */ e(
|
|
73
|
+
function Ne({ src: c, alt: r, width: s, height: m, preview: b = !0, fallback: w, fit: h = "cover", radius: p = "md", srcSet: o, sizes: t, ratio: g, priority: v, placeholder: y, loadingEffect: i = "shimmer", isLoading: N, className: u }) {
|
|
74
|
+
const n = R(), [l, d] = x("loading"), [a, k] = x(!1), [C, P] = x(1), M = i === "matrix", $ = !!N || l === "loading", E = N ? "loading" : l, Z = c ? /* @__PURE__ */ e("img", { src: c, srcSet: o, sizes: t, alt: r, loading: v ? "eager" : "lazy", decoding: v ? "sync" : "async", fetchPriority: v ? "high" : void 0, onLoad: () => d("ok"), onError: () => d("error"), style: { objectFit: h } }) : null, T = y ? /^(data:|https?:|\/)/.test(y) ? { backgroundImage: `url(${y})`, backgroundSize: "cover" } : { background: y } : null, A = /* @__PURE__ */ f("span", { className: I("alea-image", u), "data-state": E, "data-effect": M ? "matrix" : void 0, "aria-busy": $ || void 0, "data-radius": p, "data-placeholder": T ? !0 : void 0, style: { width: s, height: m, aspectRatio: g ? String(g) : void 0, ...l === "loading" && T ? T : {} }, children: [
|
|
75
|
+
M && l !== "error" && /* @__PURE__ */ e(re, {}),
|
|
74
76
|
M && /* @__PURE__ */ e("span", { role: "status", className: "alea-visually-hidden", children: $ ? n.loading : "" }),
|
|
75
|
-
l === "error" ?
|
|
76
|
-
/* @__PURE__ */ e(
|
|
77
|
+
l === "error" ? w ?? /* @__PURE__ */ f("span", { className: "alea-image-fallback", children: [
|
|
78
|
+
/* @__PURE__ */ e(ee, { size: 22, "aria-hidden": "true" }),
|
|
77
79
|
/* @__PURE__ */ e("span", { children: n.imageFailed(r || "") })
|
|
78
|
-
] }) :
|
|
80
|
+
] }) : Z
|
|
79
81
|
] });
|
|
80
|
-
return !b || l === "error" || N || !
|
|
82
|
+
return !b || l === "error" || N || !c ? A : /* @__PURE__ */ f(B, { children: [
|
|
81
83
|
/* @__PURE__ */ e("button", { type: "button", className: "alea-image-button alea-focus-ring", onClick: () => {
|
|
82
|
-
|
|
83
|
-
}, "aria-label": n.viewLarger(r || n.image.toLowerCase()), style: { width: s, height:
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */
|
|
84
|
+
P(1), k(!0);
|
|
85
|
+
}, "aria-label": n.viewLarger(r || n.image.toLowerCase()), style: { width: s, height: m }, children: A }),
|
|
86
|
+
/* @__PURE__ */ e(j, { isOpen: a, onOpenChange: k, size: "full", className: "alea-image-overlay", children: /* @__PURE__ */ e(Q, { "aria-label": r || n.imagePreview, hideClose: !0, className: "alea-image-dialog", children: ({ close: H }) => /* @__PURE__ */ f(B, { children: [
|
|
87
|
+
/* @__PURE__ */ f("div", { className: "alea-image-tools", children: [
|
|
88
|
+
/* @__PURE__ */ e(z, { "aria-label": n.zoomOut, variant: "secondary", isDisabled: C <= 0.5, onPress: () => P((q) => Math.max(0.5, q - 0.25)), children: /* @__PURE__ */ e(ae, {}) }),
|
|
89
|
+
/* @__PURE__ */ f("span", { className: "alea-image-zoom", "aria-live": "polite", children: [
|
|
88
90
|
Math.round(C * 100),
|
|
89
91
|
"%"
|
|
90
92
|
] }),
|
|
91
|
-
/* @__PURE__ */ e(
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
+
/* @__PURE__ */ e(z, { "aria-label": n.zoomIn, variant: "secondary", isDisabled: C >= 3, onPress: () => P((q) => Math.min(3, q + 0.25)), children: /* @__PURE__ */ e(te, {}) }),
|
|
94
|
+
/* @__PURE__ */ e(z, { "aria-label": n.close, variant: "secondary", onPress: H, children: /* @__PURE__ */ e(le, {}) })
|
|
93
95
|
] }),
|
|
94
|
-
/* @__PURE__ */ e("div", { className: "alea-image-stage", children: /* @__PURE__ */ e("img", { src:
|
|
96
|
+
/* @__PURE__ */ e("div", { className: "alea-image-stage", children: /* @__PURE__ */ e("img", { src: c, alt: r, style: { transform: `scale(${C})` } }) })
|
|
95
97
|
] }) }) })
|
|
96
98
|
] });
|
|
97
99
|
}
|
|
98
|
-
let D = null,
|
|
99
|
-
function
|
|
100
|
-
return
|
|
101
|
-
const r =
|
|
100
|
+
let D = null, se = null;
|
|
101
|
+
function oe() {
|
|
102
|
+
return se ?? (se = import("qrcode-generator").then((c) => {
|
|
103
|
+
const r = c.default ?? c;
|
|
102
104
|
return r.stringToBytes = r.stringToBytesFuncs["UTF-8"], D = r;
|
|
103
105
|
}));
|
|
104
106
|
}
|
|
105
|
-
const
|
|
106
|
-
const y = R(), [
|
|
107
|
+
const ye = O(function({ value: r, size: s = 160, level: m = "M", logo: b, label: w, color: h = "#111011", background: p = "#ffffff", className: o, style: t, ...g }, v) {
|
|
108
|
+
const y = R(), [i, N] = x(D ? { qrcode: D } : null);
|
|
107
109
|
L(() => {
|
|
108
|
-
if (
|
|
110
|
+
if (i) return;
|
|
109
111
|
let n = !0;
|
|
110
|
-
return
|
|
112
|
+
return oe().then((l) => {
|
|
111
113
|
n && N({ qrcode: l });
|
|
112
114
|
}, () => {
|
|
113
115
|
}), () => {
|
|
114
116
|
n = !1;
|
|
115
117
|
};
|
|
116
|
-
}, [
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
const n =
|
|
118
|
+
}, [i]);
|
|
119
|
+
const u = W(() => {
|
|
120
|
+
if (!i) return null;
|
|
121
|
+
const n = i.qrcode(0, m);
|
|
120
122
|
n.addData(r), n.make();
|
|
121
123
|
const l = n.getModuleCount();
|
|
122
|
-
let
|
|
123
|
-
for (let a = 0; a < l; a++) for (let
|
|
124
|
-
return { d
|
|
125
|
-
}, [
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
|
|
128
|
-
/* @__PURE__ */ e("rect", { width:
|
|
129
|
-
/* @__PURE__ */ e("path", { d:
|
|
124
|
+
let d = "";
|
|
125
|
+
for (let a = 0; a < l; a++) for (let k = 0; k < l; k++) n.isDark(a, k) && (d += `M${k + 4} ${a + 4}h1v1h-1z`);
|
|
126
|
+
return { d, n: l + 8 };
|
|
127
|
+
}, [i, r, m]);
|
|
128
|
+
return /* @__PURE__ */ f("span", { ref: v, ...g, className: I("alea-qr", o), style: { width: s, height: s, ...t }, role: "img", "aria-label": w ?? g["aria-label"] ?? y.qrCode(r), children: [
|
|
129
|
+
u && /* @__PURE__ */ f("svg", { viewBox: `0 0 ${u.n} ${u.n}`, width: s, height: s, shapeRendering: "crispEdges", "aria-hidden": "true", children: [
|
|
130
|
+
/* @__PURE__ */ e("rect", { width: u.n, height: u.n, fill: p, rx: u.n * 0.06 }),
|
|
131
|
+
/* @__PURE__ */ e("path", { d: u.d, fill: h })
|
|
130
132
|
] }),
|
|
131
|
-
b &&
|
|
133
|
+
b && u && /* @__PURE__ */ e("span", { className: "alea-qr-logo", "aria-hidden": "true", style: { background: p }, children: b })
|
|
132
134
|
] });
|
|
133
135
|
});
|
|
134
|
-
function
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
return `url("data:image/svg+xml,${encodeURIComponent(
|
|
138
|
-
}, [r, s,
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
|
|
141
|
-
/* @__PURE__ */ e("span", { className: "alea-watermark-layer", "aria-hidden": "true", style: { WebkitMaskImage:
|
|
136
|
+
function we({ children: c, text: r, rotate: s = -22, gap: m = 120, opacity: b = 0.08, className: w }) {
|
|
137
|
+
const h = W(() => {
|
|
138
|
+
const p = m + r.length * 7.5, o = m, t = `<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${o}"><text x="50%" y="50%" fill="currentColor" font-family="Inter, sans-serif" font-size="14" font-weight="600" text-anchor="middle" dominant-baseline="middle" transform="rotate(${s} ${p / 2} ${o / 2})">${r.replace(/[<&>"]/g, (g) => ({ "<": "<", "&": "&", ">": ">", '"': """ })[g])}</text></svg>`;
|
|
139
|
+
return `url("data:image/svg+xml,${encodeURIComponent(t)}")`;
|
|
140
|
+
}, [r, s, m]);
|
|
141
|
+
return /* @__PURE__ */ f("div", { className: I("alea-watermark", w), children: [
|
|
142
|
+
c,
|
|
143
|
+
/* @__PURE__ */ e("span", { className: "alea-watermark-layer", "aria-hidden": "true", style: { WebkitMaskImage: h, maskImage: h, opacity: b } })
|
|
142
144
|
] });
|
|
143
145
|
}
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
+
const ke = O(function({ steps: r, isOpen: s, onOpenChange: m, onFinish: b, className: w, style: h }, p) {
|
|
147
|
+
const o = R(), [t, g] = x(0), [v, y] = x(null), i = r[t];
|
|
146
148
|
if (L(() => {
|
|
147
149
|
s && g(0);
|
|
148
|
-
}, [s]),
|
|
149
|
-
if (!s || !
|
|
150
|
-
const n = typeof
|
|
150
|
+
}, [s]), G(() => {
|
|
151
|
+
if (!s || !i) return;
|
|
152
|
+
const n = typeof i.target == "string" ? document.querySelector(i.target) : i.target || null;
|
|
151
153
|
if (!n) {
|
|
152
154
|
y(null);
|
|
153
155
|
return;
|
|
@@ -155,34 +157,34 @@ const we = F(function({ steps: r, isOpen: s, onOpenChange: d, onFinish: b, class
|
|
|
155
157
|
n.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
156
158
|
const l = () => y(n.getBoundingClientRect());
|
|
157
159
|
l();
|
|
158
|
-
const
|
|
160
|
+
const d = setTimeout(l, 350);
|
|
159
161
|
return window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => {
|
|
160
|
-
clearTimeout(
|
|
162
|
+
clearTimeout(d), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
|
|
161
163
|
};
|
|
162
|
-
}, [s,
|
|
163
|
-
const N = 8,
|
|
164
|
-
return /* @__PURE__ */ e(
|
|
164
|
+
}, [s, t, i]), !i) return null;
|
|
165
|
+
const N = 8, u = v ? { top: Math.min(window.innerHeight - 220, v.bottom + N + 12), left: Math.max(16, Math.min(window.innerWidth - 336, v.left)) } : { top: "50%", left: "50%", transform: "translate(-50%, -50%)", "--alea-pop-x": "-50%", "--alea-pop-y": "-50%" };
|
|
166
|
+
return /* @__PURE__ */ e(j, { isOpen: s, onOpenChange: m, isDismissable: !1, className: "alea-tour-overlay", children: /* @__PURE__ */ e(Q, { ref: p, style: h, "aria-label": typeof i.title == "string" ? i.title : o.stepN(t + 1), hideClose: !0, className: I("alea-tour", w), children: ({ close: n }) => /* @__PURE__ */ f(B, { children: [
|
|
165
167
|
v && /* @__PURE__ */ e("span", { className: "alea-tour-spot", "aria-hidden": "true", style: { top: v.top - N, left: v.left - N, width: v.width + N * 2, height: v.height + N * 2 } }),
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */ e("p", { className: "alea-tour-count", children:
|
|
168
|
-
/* @__PURE__ */ e("h2", { className: "alea-tour-title", children:
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */ e(S, { size: "sm", variant: "ghost", onPress: n, children:
|
|
168
|
+
/* @__PURE__ */ f("div", { className: "alea-tour-card", style: u, "data-centered": v ? void 0 : "", children: [
|
|
169
|
+
/* @__PURE__ */ e("p", { className: "alea-tour-count", children: o.stepNOfTotal(t + 1, r.length) }),
|
|
170
|
+
/* @__PURE__ */ e("h2", { className: "alea-tour-title", children: i.title }),
|
|
171
|
+
i.content && /* @__PURE__ */ e("div", { className: "alea-tour-text", children: i.content }),
|
|
172
|
+
/* @__PURE__ */ f("div", { className: "alea-tour-actions", children: [
|
|
173
|
+
/* @__PURE__ */ e(S, { size: "sm", variant: "ghost", onPress: n, children: o.skip }),
|
|
172
174
|
/* @__PURE__ */ e("span", { className: "alea-tour-spacer" }),
|
|
173
|
-
|
|
175
|
+
t > 0 && /* @__PURE__ */ e(S, { size: "sm", variant: "ghost", onPress: () => g((l) => l - 1), children: o.back }),
|
|
174
176
|
/* @__PURE__ */ e(S, { size: "sm", autoFocus: !0, onPress: () => {
|
|
175
|
-
|
|
176
|
-
}, children:
|
|
177
|
+
t < r.length - 1 ? g((l) => l + 1) : (b == null || b(), n());
|
|
178
|
+
}, children: t < r.length - 1 ? o.next : o.done })
|
|
177
179
|
] })
|
|
178
180
|
] })
|
|
179
181
|
] }) }) });
|
|
180
182
|
});
|
|
181
183
|
export {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
be as Carousel,
|
|
185
|
+
Ne as Image,
|
|
186
|
+
ye as QRCode,
|
|
187
|
+
pe as Timeline,
|
|
188
|
+
ke as Tour,
|
|
189
|
+
we as Watermark
|
|
188
190
|
};
|
|
@@ -51,12 +51,14 @@ export interface PaginationProps {
|
|
|
51
51
|
}
|
|
52
52
|
/** Move through pages of results. The current page is marked for screen readers. */
|
|
53
53
|
export declare function Pagination({ page, total, onChange, siblings, appearance, size, showFirstLast, pageSize, pageSizeOptions, onPageSizeChange, totalItems, showJumper, className, 'aria-label': label }: PaginationProps): import("react").JSX.Element;
|
|
54
|
+
/** Every state a step can show. `done`, `current` and `upcoming` come from `current`; the rest are set on the step. */
|
|
55
|
+
export type StepStatus = 'done' | 'current' | 'upcoming' | 'skipped' | 'cancelled' | 'error' | 'warning';
|
|
54
56
|
export interface Step {
|
|
55
57
|
id: Key;
|
|
56
58
|
title: ReactNode;
|
|
57
59
|
description?: ReactNode;
|
|
58
|
-
/** Overrides the status from current: error (something to fix), warning, or skipped (a step the person passed over on purpose; it shows a dash and counts as left behind). */
|
|
59
|
-
status?: 'error' | 'warning' | 'skipped'
|
|
60
|
+
/** Overrides the status from current: error (something to fix), warning, or skipped (a step the person passed over on purpose; it shows a dash and counts as left behind), or cancelled (a step that will not happen: dotted and muted, with a ban mark). */
|
|
61
|
+
status?: Extract<StepStatus, 'error' | 'warning' | 'skipped' | 'cancelled'>;
|
|
60
62
|
/** An icon instead of the number (with variant="icons"). */
|
|
61
63
|
icon?: ReactNode;
|
|
62
64
|
/** Marks the step as optional. */
|
|
@@ -79,6 +81,8 @@ export interface StepsProps {
|
|
|
79
81
|
responsive?: boolean | 'scroll';
|
|
80
82
|
/** Writes each step's status in words under its title (Done, In progress, Pending, Skipped, Has an error, Needs attention), so the color and icon are never the only signal. */
|
|
81
83
|
showStatus?: boolean;
|
|
84
|
+
/** Your own words for this list's states, for the visible status and the hidden one read by screen readers (for example `{ done: 'Completed', current: 'Current stage', cancelled: 'Cancelled here' }`). A state you leave out keeps its default. */
|
|
85
|
+
stateLabels?: Partial<Record<StepStatus, string>>;
|
|
82
86
|
/** sm (24 px markers) or md (32 px, default). */
|
|
83
87
|
size?: 'sm' | 'md';
|
|
84
88
|
/** numbers (default), dots (small markers, for compact flows) or icons (each step's icon). */
|
|
@@ -87,4 +91,4 @@ export interface StepsProps {
|
|
|
87
91
|
labelPlacement?: 'end' | 'below';
|
|
88
92
|
}
|
|
89
93
|
/** Progress through a known sequence: done, current and upcoming steps. */
|
|
90
|
-
export declare function Steps({ steps, current, orientation, responsive, showStatus, onStepPress, size, variant, labelPlacement, className, 'aria-label': label }: StepsProps): import("react").JSX.Element;
|
|
94
|
+
export declare function Steps({ steps, current, orientation, responsive, showStatus, stateLabels, onStepPress, size, variant, labelPlacement, className, 'aria-label': label }: StepsProps): import("react").JSX.Element;
|