@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,138 +1,138 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Children as
|
|
4
|
-
import { Breadcrumb as
|
|
5
|
-
import { ChevronsLeft as
|
|
6
|
-
import { DropdownMenu as
|
|
7
|
-
import { withBase as
|
|
8
|
-
import { useStrings as
|
|
9
|
-
function
|
|
10
|
-
const m =
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
...
|
|
2
|
+
import { jsx as e, jsxs as s, Fragment as E } from "react/jsx-runtime";
|
|
3
|
+
import { Children as O, isValidElement as j, useMemo as P, useRef as W, useState as T, useEffect as _ } from "react";
|
|
4
|
+
import { Breadcrumb as D, Link as q, Button as A, Breadcrumbs as K } from "react-aria-components";
|
|
5
|
+
import { ChevronsLeft as V, ChevronLeft as X, ChevronRight as F, ChevronsRight as G, X as H, Ban as Q, Minus as U, Check as Y } from "lucide-react";
|
|
6
|
+
import { DropdownMenu as Z, MenuItem as J } from "../menu/Menu.js";
|
|
7
|
+
import { withBase as S, cx as R } from "../../utils/cx.js";
|
|
8
|
+
import { useStrings as w } from "../../i18n/strings.js";
|
|
9
|
+
function ce({ separator: a, maxItems: i, size: h, className: t, children: o, ...c }) {
|
|
10
|
+
const m = w();
|
|
11
|
+
let u = o;
|
|
12
|
+
if (i && typeof o != "function") {
|
|
13
|
+
const p = O.toArray(o).filter(j);
|
|
14
|
+
if (p.length > i && i >= 2) {
|
|
15
|
+
const N = p.slice(1, p.length - (i - 1));
|
|
16
|
+
u = [
|
|
17
|
+
p[0],
|
|
18
|
+
/* @__PURE__ */ e(D, { className: "alea-crumb", children: /* @__PURE__ */ e(Z, { "aria-label": m.showMore, trigger: /* @__PURE__ */ e(A, { className: "alea-crumb-link alea-crumb-more alea-focus-ring", "aria-label": m.showMore, children: "…" }), children: N.map((g, v) => /* @__PURE__ */ e(J, { id: `c${v}`, href: g.props.href, children: g.props.children }, v)) }) }, "__more"),
|
|
19
|
+
...p.slice(p.length - (i - 1))
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ e(K, { ...c, className: R("alea-breadcrumbs", t), "data-size": h, "data-separator": a ? void 0 : "chevron", style: { "--alea-crumb-sep": typeof a == "string" ? `"${a}"` : void 0, ...c.style }, children: u });
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
] }) : /* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
function te({ href: a, icon: i, children: h, className: t, ...o }) {
|
|
26
|
+
return /* @__PURE__ */ e(D, { ...o, className: S("alea-crumb", t), children: a ? /* @__PURE__ */ s(q, { href: a, className: "alea-crumb-link alea-focus-ring", children: [
|
|
27
|
+
i && /* @__PURE__ */ e("span", { className: "alea-crumb-icon", "aria-hidden": "true", children: i }),
|
|
28
|
+
h
|
|
29
|
+
] }) : /* @__PURE__ */ s("span", { className: "alea-crumb-link", "data-current": !0, "aria-current": "page", children: [
|
|
30
|
+
i && /* @__PURE__ */ e("span", { className: "alea-crumb-icon", "aria-hidden": "true", children: i }),
|
|
31
|
+
h
|
|
32
32
|
] }) });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const t = [], o = Math.max(2,
|
|
34
|
+
function I(a, i, h) {
|
|
35
|
+
const t = [], o = Math.max(2, a - h), c = Math.min(i - 1, a + h);
|
|
36
36
|
t.push(1), o > 2 && t.push("gap");
|
|
37
|
-
for (let m = o; m <=
|
|
38
|
-
return
|
|
37
|
+
for (let m = o; m <= c; m++) t.push(m);
|
|
38
|
+
return c < i - 1 && t.push("gap"), i > 1 && t.push(i), t;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
m && /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
o === "compact" ? /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
m && /* @__PURE__ */
|
|
40
|
+
function se({ page: a, total: i, onChange: h, siblings: t = 1, appearance: o = "pages", size: c, showFirstLast: m, pageSize: u, pageSizeOptions: p = [10, 25, 50, 100], onPageSizeChange: N, totalItems: g, showJumper: v, className: f, "aria-label": k }) {
|
|
41
|
+
const d = w();
|
|
42
|
+
k ?? (k = d.pagination);
|
|
43
|
+
const y = P(() => I(a, Math.max(1, i), t), [a, i, t]), b = (r) => h(Math.min(Math.max(1, r), i)), C = u ? (a - 1) * u + 1 : 0, z = u && g != null ? Math.min(g, a * u) : 0, B = g != null && u || N || v, n = /* @__PURE__ */ s("nav", { "aria-label": k, className: R("alea-pagination", !B && f), "data-size": c, children: [
|
|
44
|
+
m && /* @__PURE__ */ e("button", { type: "button", className: "alea-page alea-focus-ring", "data-far": !0, "aria-label": d.firstPage, disabled: a <= 1, onClick: () => b(1), children: /* @__PURE__ */ e(V, { size: 16, "aria-hidden": "true" }) }),
|
|
45
|
+
/* @__PURE__ */ e("button", { type: "button", className: "alea-page alea-focus-ring", "aria-label": d.previousPage, disabled: a <= 1, onClick: () => b(a - 1), children: /* @__PURE__ */ e(X, { size: 16, "aria-hidden": "true" }) }),
|
|
46
|
+
o === "compact" ? /* @__PURE__ */ e("span", { className: "alea-page-status", "aria-live": "polite", children: d.nOfTotal(a, i) }) : /* @__PURE__ */ e("ul", { children: y.map((r, l) => r === "gap" ? /* @__PURE__ */ e("li", { className: "alea-page-gap", "aria-hidden": "true", children: "…" }, `g${l}`) : /* @__PURE__ */ e("li", { "data-far": y.length > 5 && Math.abs(r - a) > 1 || void 0, children: /* @__PURE__ */ e("button", { type: "button", className: "alea-page alea-focus-ring", "aria-current": r === a ? "page" : void 0, "aria-label": d.pageN(r), onClick: () => b(r), children: r }) }, r)) }),
|
|
47
|
+
/* @__PURE__ */ e("button", { type: "button", className: "alea-page alea-focus-ring", "aria-label": d.nextPage, disabled: a >= i, onClick: () => b(a + 1), children: /* @__PURE__ */ e(F, { size: 16, "aria-hidden": "true" }) }),
|
|
48
|
+
m && /* @__PURE__ */ e("button", { type: "button", className: "alea-page alea-focus-ring", "data-far": !0, "aria-label": d.lastPage, disabled: a >= i, onClick: () => b(i), children: /* @__PURE__ */ e(G, { size: 16, "aria-hidden": "true" }) })
|
|
49
49
|
] });
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
50
|
+
return B ? /* @__PURE__ */ s("div", { className: R("alea-pagination-bar", f), "data-size": c, children: [
|
|
51
|
+
g != null && u ? /* @__PURE__ */ e("span", { className: "alea-pagination-total", "aria-live": "polite", children: d.itemRange(C, z, g) }) : /* @__PURE__ */ e("span", {}),
|
|
52
|
+
/* @__PURE__ */ s("div", { className: "alea-pagination-controls", children: [
|
|
53
|
+
N && u && /* @__PURE__ */ s("label", { className: "alea-pagination-size", children: [
|
|
54
|
+
/* @__PURE__ */ e("span", { children: d.perPage }),
|
|
55
|
+
/* @__PURE__ */ e("select", { className: "alea-cal-select alea-focus-ring", value: u, onChange: (r) => N(Number(r.target.value)), children: p.map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r)) })
|
|
56
56
|
] }),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
57
|
+
n,
|
|
58
|
+
v && /* @__PURE__ */ s("label", { className: "alea-pagination-jump", children: [
|
|
59
|
+
/* @__PURE__ */ e("span", { children: d.goToPage }),
|
|
60
|
+
/* @__PURE__ */ e(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
63
|
className: "alea-pagination-input alea-focus-ring",
|
|
64
64
|
type: "number",
|
|
65
65
|
inputMode: "numeric",
|
|
66
66
|
min: 1,
|
|
67
|
-
max:
|
|
68
|
-
placeholder: String(
|
|
67
|
+
max: i,
|
|
68
|
+
placeholder: String(a),
|
|
69
69
|
onKeyDown: (r) => {
|
|
70
70
|
if (r.key === "Enter") {
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const l = Number(r.target.value);
|
|
72
|
+
l && (b(l), r.target.value = "");
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] })
|
|
78
78
|
] })
|
|
79
|
-
] }) :
|
|
79
|
+
] }) : n;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
return
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
81
|
+
function oe({ steps: a, current: i, orientation: h = "horizontal", responsive: t = !0, showStatus: o, stateLabels: c, onStepPress: m, size: u, variant: p = "numbers", labelPlacement: N, className: g, "aria-label": v }) {
|
|
82
|
+
const f = w();
|
|
83
|
+
v ?? (v = f.progress);
|
|
84
|
+
const k = Math.max(0, a.findIndex((n) => n.id === i)), d = t === "scroll" && h === "horizontal", y = { error: f.stepError, warning: f.stepWarning, skipped: f.stepSkipped, cancelled: f.stepCancelled }, b = (n) => y[n] && ((c == null ? void 0 : c[n]) ?? y[n]), C = W(null), [z, B] = T(!1);
|
|
85
|
+
return _(() => {
|
|
86
|
+
const n = C.current;
|
|
87
|
+
if (!d || !n) return;
|
|
88
|
+
const r = () => B(n.scrollWidth > n.clientWidth + 1);
|
|
89
|
+
r();
|
|
90
|
+
const l = n.querySelector('[aria-current="step"]');
|
|
91
|
+
if (l) {
|
|
92
|
+
const M = n.getBoundingClientRect(), $ = l.getBoundingClientRect();
|
|
93
|
+
n.scrollLeft += $.left + $.width / 2 - (M.left + M.width / 2);
|
|
94
94
|
}
|
|
95
95
|
if (typeof ResizeObserver > "u") return;
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
}, [
|
|
99
|
-
const
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
const x = new ResizeObserver(r);
|
|
97
|
+
return x.observe(n), () => x.disconnect();
|
|
98
|
+
}, [d, k, a.length]), /* @__PURE__ */ e("ol", { ref: C, tabIndex: d && z ? 0 : void 0, "aria-label": v, className: R("alea-steps", g), "data-orientation": h, "data-responsive": d ? "scroll" : t ? "true" : void 0, "data-size": u, "data-variant": p !== "numbers" ? p : void 0, "data-label-placement": N !== "end" ? N : void 0, children: a.map((n, r) => {
|
|
99
|
+
const l = n.status ?? (r < k ? "done" : r === k ? "current" : "upcoming"), x = l === "error" ? /* @__PURE__ */ e(H, { size: 14 }) : l === "cancelled" ? /* @__PURE__ */ e(Q, { size: 14 }) : l === "skipped" ? /* @__PURE__ */ e(U, { size: 14 }) : l === "warning" ? "!" : l === "done" ? /* @__PURE__ */ e(Y, { size: 14 }) : p === "dots" ? null : p === "icons" && n.icon ? n.icon : r + 1, M = /* @__PURE__ */ s(E, { children: [
|
|
100
|
+
/* @__PURE__ */ e("span", { className: "alea-step-dot", "aria-hidden": "true", children: x }),
|
|
101
|
+
/* @__PURE__ */ s("span", { className: "alea-step-text", children: [
|
|
102
|
+
/* @__PURE__ */ s("span", { className: "alea-step-title", children: [
|
|
103
|
+
n.title,
|
|
104
|
+
n.isOptional && /* @__PURE__ */ s("span", { className: "alea-step-optional", children: [
|
|
105
105
|
" (",
|
|
106
|
-
|
|
106
|
+
f.optional,
|
|
107
107
|
")"
|
|
108
108
|
] })
|
|
109
109
|
] }),
|
|
110
|
-
|
|
111
|
-
o && /* @__PURE__ */
|
|
112
|
-
!o && (
|
|
110
|
+
n.description && /* @__PURE__ */ e("span", { className: "alea-step-desc", children: n.description }),
|
|
111
|
+
o && /* @__PURE__ */ e("span", { className: "alea-step-status", children: (c == null ? void 0 : c[l]) ?? f.stepStatus[l] }),
|
|
112
|
+
!o && b(l) && /* @__PURE__ */ s("span", { className: "alea-visually-hidden", children: [
|
|
113
113
|
" ",
|
|
114
|
-
|
|
114
|
+
b(l)
|
|
115
115
|
] })
|
|
116
116
|
] })
|
|
117
117
|
] });
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
!o && /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ e("li", { className: "alea-step", "data-status": l, "aria-current": l === "current" ? "step" : void 0, children: m && l === "done" ? /* @__PURE__ */ s("button", { type: "button", className: "alea-step-button alea-focus-ring", onClick: () => m(n.id), children: [
|
|
119
|
+
M,
|
|
120
|
+
!o && /* @__PURE__ */ s("span", { className: "alea-visually-hidden", children: [
|
|
121
121
|
" ",
|
|
122
|
-
|
|
122
|
+
f.stepDoneBack
|
|
123
123
|
] })
|
|
124
|
-
] }) : /* @__PURE__ */
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
] }) : /* @__PURE__ */ s("div", { className: "alea-step-button", children: [
|
|
125
|
+
M,
|
|
126
|
+
l === "done" && !o && /* @__PURE__ */ s("span", { className: "alea-visually-hidden", children: [
|
|
127
127
|
" ",
|
|
128
|
-
|
|
128
|
+
(c == null ? void 0 : c.done) ?? f.stepDone
|
|
129
129
|
] })
|
|
130
|
-
] }) },
|
|
130
|
+
] }) }, n.id != null ? String(n.id) : r);
|
|
131
131
|
}) });
|
|
132
132
|
}
|
|
133
133
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
te as Breadcrumb,
|
|
135
|
+
ce as Breadcrumbs,
|
|
136
|
+
se as Pagination,
|
|
137
|
+
oe as Steps
|
|
138
138
|
};
|
|
@@ -119,7 +119,7 @@ export declare function NavigationMenu(props: NavigationMenuProps): import("reac
|
|
|
119
119
|
export interface BottomNavigationProps {
|
|
120
120
|
/** Name of the navigation. Default "Main". */
|
|
121
121
|
'aria-label'?: string;
|
|
122
|
-
/** Three to five destinations: id, label, icon, and an href (
|
|
122
|
+
/** Three to five destinations: id, label, icon, and an href (a link that navigates through the ThemeProvider navigate, like Link, with no page reload) or none (a button, with onChange). More than maxItems fold into a More button. */
|
|
123
123
|
items: Array<{
|
|
124
124
|
id: string;
|
|
125
125
|
label: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as k, jsx as a, Fragment as z } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Popover as H, Menu as j } from "react-aria-components";
|
|
3
|
+
import { useState as A, useRef as S, forwardRef as Y, useId as K, useEffect as R } from "react";
|
|
4
|
+
import { Link as P, Popover as H, Menu as j } from "react-aria-components";
|
|
5
5
|
import { withMotionStyle as I } from "@alea-design/motion";
|
|
6
6
|
import { ChevronDown as q, MoreHorizontal as G } from "lucide-react";
|
|
7
|
-
import { cx as
|
|
8
|
-
import { useMergedRef as
|
|
9
|
-
import { MenuSeparator as
|
|
7
|
+
import { cx as L } from "../../utils/cx.js";
|
|
8
|
+
import { useMergedRef as U } from "../../utils/refs.js";
|
|
9
|
+
import { MenuSeparator as V, MenuItem as J } from "../menu/Menu.js";
|
|
10
10
|
import { useStrings as T } from "../../i18n/strings.js";
|
|
11
|
-
import { Drawer as
|
|
12
|
-
const W = (d) => d.map((i, t) => "separator" in i ? /* @__PURE__ */ a(
|
|
13
|
-
function
|
|
11
|
+
import { Drawer as Q, DrawerContent as Z } from "../overlay/Drawer.js";
|
|
12
|
+
const W = (d) => d.map((i, t) => "separator" in i ? /* @__PURE__ */ a(V, {}, `s${t}`) : /* @__PURE__ */ a(J, { id: i.id, icon: i.icon, shortcut: i.shortcut, description: i.description, tone: i.tone, isDisabled: i.isDisabled, children: i.label }, String(i.id)));
|
|
13
|
+
function de({ motion: d, children: i, items: t, onAction: p, className: x, areaLabel: N, "aria-label": y }) {
|
|
14
14
|
const h = T();
|
|
15
15
|
y ?? (y = h.contextMenu);
|
|
16
|
-
const [m, b] =
|
|
16
|
+
const [m, b] = A(null), f = S(null), g = S(null), r = S(void 0), n = (e, u) => {
|
|
17
17
|
const E = f.current.getBoundingClientRect();
|
|
18
18
|
b({ x: e - E.left, y: u - E.top });
|
|
19
19
|
};
|
|
@@ -21,7 +21,7 @@ function ue({ motion: d, children: i, items: t, onAction: p, className: x, areaL
|
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
23
|
ref: f,
|
|
24
|
-
className:
|
|
24
|
+
className: L("alea-context-area", x),
|
|
25
25
|
tabIndex: 0,
|
|
26
26
|
role: "group",
|
|
27
27
|
"aria-label": `${N}, menu with Shift+F10`,
|
|
@@ -55,8 +55,8 @@ function ue({ motion: d, children: i, items: t, onAction: p, className: x, areaL
|
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const [N, y] =
|
|
58
|
+
function fe({ motion: d, menus: i, onAction: t, className: p, "aria-label": x }) {
|
|
59
|
+
const [N, y] = A(0), [h, m] = A(null), b = S([]), f = (r, n) => {
|
|
60
60
|
var u;
|
|
61
61
|
const e = (r + i.length) % i.length;
|
|
62
62
|
y(e), (u = b.current[e]) == null || u.focus(), m(n ? e : null);
|
|
@@ -70,7 +70,7 @@ function de({ motion: d, menus: i, onAction: t, className: p, "aria-label": x })
|
|
|
70
70
|
else return;
|
|
71
71
|
r.preventDefault();
|
|
72
72
|
};
|
|
73
|
-
return /* @__PURE__ */ a("div", { role: "menubar", "aria-label": x, className:
|
|
73
|
+
return /* @__PURE__ */ a("div", { role: "menubar", "aria-label": x, className: L("alea-menubar", p), children: i.map((r, n) => /* @__PURE__ */ k("span", { className: "alea-menubar-slot", children: [
|
|
74
74
|
/* @__PURE__ */ a(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
@@ -104,8 +104,8 @@ function de({ motion: d, menus: i, onAction: t, className: p, "aria-label": x })
|
|
|
104
104
|
}, children: W(r.items) }) }) })
|
|
105
105
|
] }, r.id)) });
|
|
106
106
|
}
|
|
107
|
-
const
|
|
108
|
-
const [f, g] =
|
|
107
|
+
const me = Y(function({ motion: i, trigger: t, children: p, openDelay: x = 500, closeDelay: N = 200, placement: y = "bottom", className: h, style: m }, b) {
|
|
108
|
+
const [f, g] = A(!1), r = S(null), n = U(b, r), e = S(void 0), u = K(), E = (s, c) => {
|
|
109
109
|
clearTimeout(e.current), e.current = window.setTimeout(() => g(s), c);
|
|
110
110
|
};
|
|
111
111
|
return R(() => () => clearTimeout(e.current), []), R(() => {
|
|
@@ -120,7 +120,7 @@ const fe = Y(function({ motion: i, trigger: t, children: p, openDelay: x = 500,
|
|
|
120
120
|
{
|
|
121
121
|
ref: n,
|
|
122
122
|
style: m,
|
|
123
|
-
className:
|
|
123
|
+
className: L("alea-hovercard-trigger", h),
|
|
124
124
|
"aria-describedby": f ? u : void 0,
|
|
125
125
|
onMouseEnter: () => E(!0, x),
|
|
126
126
|
onMouseLeave: () => E(!1, N),
|
|
@@ -131,11 +131,11 @@ const fe = Y(function({ motion: i, trigger: t, children: p, openDelay: x = 500,
|
|
|
131
131
|
),
|
|
132
132
|
/* @__PURE__ */ a(H, { triggerRef: r, isOpen: f, onOpenChange: g, isNonModal: !0, placement: y, offset: 8, className: "alea-popover alea-hovercard", style: I(void 0, i), children: /* @__PURE__ */ a("div", { id: u, role: "tooltip", onMouseEnter: () => clearTimeout(e.current), onMouseLeave: () => E(!1, N), children: p }) })
|
|
133
133
|
] });
|
|
134
|
-
}),
|
|
135
|
-
function
|
|
136
|
-
const b = K(), f = S(null), [g, r] =
|
|
134
|
+
}), C = (d) => "items" in d, F = (d) => "href" in d, B = (d, i) => !!i && d.items.some((t) => F(t) ? t.href === i : C(t) ? B(t, i) : !1);
|
|
135
|
+
function _({ items: d, current: i, collapsed: t, railLabels: p, accordion: x, size: N = "md", onNavigate: y, className: h, label: m }) {
|
|
136
|
+
const b = K(), f = S(null), [g, r] = A(() => {
|
|
137
137
|
const s = /* @__PURE__ */ new Set(), c = (o, l) => o.forEach((w) => {
|
|
138
|
-
|
|
138
|
+
C(w) && B(w, i) && (s.add(`${l}/${w.label}`), c(w.items, `${l}/${w.label}`));
|
|
139
139
|
});
|
|
140
140
|
return t || c(d, ""), s;
|
|
141
141
|
});
|
|
@@ -193,7 +193,7 @@ function Z({ items: d, current: i, collapsed: t, railLabels: p, accordion: x, si
|
|
|
193
193
|
O != null && /* @__PURE__ */ a("span", { className: "alea-vnav-badge", children: O }),
|
|
194
194
|
X
|
|
195
195
|
] });
|
|
196
|
-
if (
|
|
196
|
+
if (C(l)) {
|
|
197
197
|
const v = `${o}/${l.label}`, M = g.has(v), O = `${b}${v.replace(/[^a-z0-9]/gi, "-")}`;
|
|
198
198
|
return /* @__PURE__ */ k("li", { className: "alea-vnav-li", children: [
|
|
199
199
|
/* @__PURE__ */ a(
|
|
@@ -245,7 +245,7 @@ function Z({ items: d, current: i, collapsed: t, railLabels: p, accordion: x, si
|
|
|
245
245
|
{
|
|
246
246
|
ref: f,
|
|
247
247
|
"aria-label": m,
|
|
248
|
-
className:
|
|
248
|
+
className: L("alea-vnav", h),
|
|
249
249
|
"data-collapsed": t || void 0,
|
|
250
250
|
"data-rail-labels": t && p ? !0 : void 0,
|
|
251
251
|
"data-size": N !== "md" ? N : void 0,
|
|
@@ -258,14 +258,14 @@ function Z({ items: d, current: i, collapsed: t, railLabels: p, accordion: x, si
|
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function ve(d) {
|
|
262
262
|
const i = T();
|
|
263
|
-
return d.orientation === "vertical" ? /* @__PURE__ */ a(
|
|
263
|
+
return d.orientation === "vertical" ? /* @__PURE__ */ a(_, { ...d, label: d["aria-label"] ?? i.mainNav }) : /* @__PURE__ */ a(ee, { ...d });
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function ee({ items: d, current: i, className: t, onNavigate: p, "aria-label": x }) {
|
|
266
266
|
const N = T();
|
|
267
267
|
x ?? (x = N.mainNav);
|
|
268
|
-
const y = d.filter((r) => F(r) ||
|
|
268
|
+
const y = d.filter((r) => F(r) || C(r)), [h, m] = A(null), b = S(null), f = S([]), g = K();
|
|
269
269
|
return R(() => {
|
|
270
270
|
if (h == null) return;
|
|
271
271
|
const r = (n) => {
|
|
@@ -278,7 +278,7 @@ function _({ items: d, current: i, className: t, onNavigate: p, "aria-label": x
|
|
|
278
278
|
{
|
|
279
279
|
ref: b,
|
|
280
280
|
"aria-label": x,
|
|
281
|
-
className:
|
|
281
|
+
className: L("alea-navmenu", t),
|
|
282
282
|
onKeyDown: (r) => {
|
|
283
283
|
var n;
|
|
284
284
|
r.key === "Escape" && h != null && ((n = f.current[h]) == null || n.focus(), m(null));
|
|
@@ -320,10 +320,10 @@ function _({ items: d, current: i, className: t, onNavigate: p, "aria-label": x
|
|
|
320
320
|
}
|
|
321
321
|
);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function he({ items: d, value: i, onChange: t, fixed: p = !0, maxItems: x, moreLabel: N, moreIcon: y, className: h, "aria-label": m }) {
|
|
324
324
|
const b = T();
|
|
325
325
|
m ?? (m = b.mainNav), N ?? (N = b.more);
|
|
326
|
-
const [f, g] =
|
|
326
|
+
const [f, g] = A(!1), r = x === void 0 ? 1 / 0 : Math.max(2, Math.floor(x)), n = d.length > r, e = n ? d.slice(0, r - 1) : d, u = n ? d.slice(r - 1) : [], E = u.reduce((o, l) => o + (l.badge || 0), 0), s = u.some((o) => o.id === i), c = (o) => /* @__PURE__ */ k(z, { children: [
|
|
327
327
|
/* @__PURE__ */ k("span", { className: "alea-bottomnav-icon", "aria-hidden": "true", children: [
|
|
328
328
|
o.icon,
|
|
329
329
|
o.badge ? /* @__PURE__ */ a("span", { className: "alea-bottomnav-badge", children: o.badge > 99 ? "99+" : o.badge }) : null
|
|
@@ -335,35 +335,35 @@ function ve({ items: d, value: i, onChange: t, fixed: p = !0, maxItems: x, moreL
|
|
|
335
335
|
" new"
|
|
336
336
|
] }) : null
|
|
337
337
|
] });
|
|
338
|
-
return /* @__PURE__ */ k("nav", { "aria-label": m, className:
|
|
338
|
+
return /* @__PURE__ */ k("nav", { "aria-label": m, className: L("alea-bottomnav", h), "data-fixed": p || void 0, children: [
|
|
339
339
|
/* @__PURE__ */ k("ul", { children: [
|
|
340
340
|
e.map((o) => {
|
|
341
341
|
const l = c(o), w = o.id === i;
|
|
342
|
-
return /* @__PURE__ */ a("li", { children: o.href ? /* @__PURE__ */ a(
|
|
342
|
+
return /* @__PURE__ */ a("li", { children: o.href ? /* @__PURE__ */ a(P, { href: o.href, className: "alea-bottomnav-item alea-focus-ring", "aria-current": w ? "page" : void 0, onPress: () => t == null ? void 0 : t(o.id), children: l }) : /* @__PURE__ */ a("button", { type: "button", className: "alea-bottomnav-item alea-focus-ring", "aria-current": w ? "page" : void 0, onClick: () => t == null ? void 0 : t(o.id), children: l }) }, o.id);
|
|
343
343
|
}),
|
|
344
344
|
n && /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a("button", { type: "button", className: "alea-bottomnav-item alea-focus-ring", "aria-haspopup": "dialog", "aria-expanded": f, "aria-current": s ? "page" : void 0, onClick: () => g(!0), children: c({ label: N, icon: y ?? /* @__PURE__ */ a(G, {}), badge: E || void 0 }) }) })
|
|
345
345
|
] }),
|
|
346
|
-
n && /* @__PURE__ */ a(
|
|
346
|
+
n && /* @__PURE__ */ a(Q, { isOpen: f, onOpenChange: g, placement: "bottom", children: /* @__PURE__ */ a(Z, { title: N, children: ({ close: o }) => /* @__PURE__ */ a("ul", { className: "alea-bottomnav-more", children: u.map((l) => {
|
|
347
347
|
const w = l.id === i, $ = () => {
|
|
348
348
|
t == null || t(l.id), o();
|
|
349
349
|
};
|
|
350
|
-
return /* @__PURE__ */ a("li", { children: l.href ? /* @__PURE__ */ a(
|
|
350
|
+
return /* @__PURE__ */ a("li", { children: l.href ? /* @__PURE__ */ a(P, { href: l.href, className: "alea-bottomnav-more-item alea-focus-ring", "aria-current": w ? "page" : void 0, onPress: $, children: c(l) }) : /* @__PURE__ */ a("button", { type: "button", className: "alea-bottomnav-more-item alea-focus-ring", "aria-current": w ? "page" : void 0, onClick: $, children: c(l) }) }, l.id);
|
|
351
351
|
}) }) }) })
|
|
352
352
|
] });
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function pe({ isOpen: d, onChange: i, size: t = "md", className: p, "aria-controls": x, "aria-label": N }) {
|
|
355
355
|
const y = T();
|
|
356
|
-
return N ?? (N = y.menu), /* @__PURE__ */ k("button", { type: "button", className:
|
|
356
|
+
return N ?? (N = y.menu), /* @__PURE__ */ k("button", { type: "button", className: L("alea-burger alea-focus-ring", p), "data-size": t, "data-open": d || void 0, "aria-expanded": d, "aria-controls": x, "aria-label": N, onClick: () => i(!d), children: [
|
|
357
357
|
/* @__PURE__ */ a("span", { "aria-hidden": "true" }),
|
|
358
358
|
/* @__PURE__ */ a("span", { "aria-hidden": "true" }),
|
|
359
359
|
/* @__PURE__ */ a("span", { "aria-hidden": "true" })
|
|
360
360
|
] });
|
|
361
361
|
}
|
|
362
362
|
export {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
363
|
+
he as BottomNavigation,
|
|
364
|
+
pe as Burger,
|
|
365
|
+
de as ContextMenu,
|
|
366
|
+
me as HoverCard,
|
|
367
|
+
fe as Menubar,
|
|
368
|
+
ve as NavigationMenu
|
|
369
369
|
};
|
|
@@ -58,6 +58,8 @@ export interface DialogProps extends Omit<RACDialogProps, 'children'> {
|
|
|
58
58
|
}) => ReactNode);
|
|
59
59
|
/** Hides the X button. */
|
|
60
60
|
hideClose?: boolean;
|
|
61
|
+
/** Size of the title: md (24 px display, default) or sm (16 px, semibold). Same as on Modal. */
|
|
62
|
+
titleSize?: 'sm' | 'md';
|
|
61
63
|
}
|
|
62
64
|
/** The dialog content: title, text, body and footer. Put it inside DialogModal. */
|
|
63
65
|
export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -98,6 +100,8 @@ export interface AlertDialogProps {
|
|
|
98
100
|
motion?: MotionProp;
|
|
99
101
|
/** What is behind it: blur (default) or dim (no backdrop-filter). */
|
|
100
102
|
backdrop?: 'blur' | 'dim';
|
|
103
|
+
/** Size of the title: md (24 px display, default) or sm (16 px, semibold), for long questions or large text. */
|
|
104
|
+
titleSize?: 'sm' | 'md';
|
|
101
105
|
/** Which control has focus when it opens: confirm (default), cancel (the safe choice for a destructive action) or content (the dialog itself, so a screen reader reads the title and text first; use it when the dialog has a required field). */
|
|
102
106
|
initialFocus?: 'confirm' | 'cancel' | 'content';
|
|
103
107
|
/** Extra class names for the dialog. */
|