@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.
@@ -1,138 +1,138 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as c, Fragment as z } from "react/jsx-runtime";
3
- import { Children as $, isValidElement as D, useMemo as E, useRef as O, useState as j, useEffect as L } from "react";
4
- import { Breadcrumb as w, Link as P, Button as W, Breadcrumbs as T } from "react-aria-components";
5
- import { ChevronsLeft as _, ChevronLeft as q, ChevronRight as A, ChevronsRight as K, X as V, Minus as X, Check as F } from "lucide-react";
6
- import { DropdownMenu as G, MenuItem as H } from "../menu/Menu.js";
7
- import { withBase as Q, cx as B } from "../../utils/cx.js";
8
- import { useStrings as R } from "../../i18n/strings.js";
9
- function na({ separator: e, maxItems: n, size: p, className: t, children: o, ...h }) {
10
- const m = R();
11
- let s = o;
12
- if (n && typeof o != "function") {
13
- const f = $.toArray(o).filter(D);
14
- if (f.length > n && n >= 2) {
15
- const v = f.slice(1, f.length - (n - 1));
16
- s = [
17
- f[0],
18
- /* @__PURE__ */ a(w, { className: "alea-crumb", children: /* @__PURE__ */ a(G, { "aria-label": m.showMore, trigger: /* @__PURE__ */ a(W, { className: "alea-crumb-link alea-crumb-more alea-focus-ring", "aria-label": m.showMore, children: "…" }), children: v.map((b, d) => /* @__PURE__ */ a(H, { id: `c${d}`, href: b.props.href, children: b.props.children }, d)) }) }, "__more"),
19
- ...f.slice(f.length - (n - 1))
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__ */ a(T, { ...h, className: B("alea-breadcrumbs", t), "data-size": p, "data-separator": e ? void 0 : "chevron", style: { "--alea-crumb-sep": typeof e == "string" ? `"${e}"` : void 0, ...h.style }, children: s });
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 ra({ href: e, icon: n, children: p, className: t, ...o }) {
26
- return /* @__PURE__ */ a(w, { ...o, className: Q("alea-crumb", t), children: e ? /* @__PURE__ */ c(P, { href: e, className: "alea-crumb-link alea-focus-ring", children: [
27
- n && /* @__PURE__ */ a("span", { className: "alea-crumb-icon", "aria-hidden": "true", children: n }),
28
- p
29
- ] }) : /* @__PURE__ */ c("span", { className: "alea-crumb-link", "data-current": !0, "aria-current": "page", children: [
30
- n && /* @__PURE__ */ a("span", { className: "alea-crumb-icon", "aria-hidden": "true", children: n }),
31
- p
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 U(e, n, p) {
35
- const t = [], o = Math.max(2, e - p), h = Math.min(n - 1, e + p);
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 <= h; m++) t.push(m);
38
- return h < n - 1 && t.push("gap"), n > 1 && t.push(n), t;
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 la({ page: e, total: n, onChange: p, siblings: t = 1, appearance: o = "pages", size: h, showFirstLast: m, pageSize: s, pageSizeOptions: f = [10, 25, 50, 100], onPageSizeChange: v, totalItems: b, showJumper: d, className: C, "aria-label": y }) {
41
- const u = R();
42
- y ?? (y = u.pagination);
43
- const x = E(() => U(e, Math.max(1, n), t), [e, n, t]), N = (r) => p(Math.min(Math.max(1, r), n)), l = s ? (e - 1) * s + 1 : 0, g = s && b != null ? Math.min(b, e * s) : 0, i = b != null && s || v || d, k = /* @__PURE__ */ c("nav", { "aria-label": y, className: B("alea-pagination", !i && C), "data-size": h, children: [
44
- m && /* @__PURE__ */ a("button", { type: "button", className: "alea-page alea-focus-ring", "data-far": !0, "aria-label": u.firstPage, disabled: e <= 1, onClick: () => N(1), children: /* @__PURE__ */ a(_, { size: 16, "aria-hidden": "true" }) }),
45
- /* @__PURE__ */ a("button", { type: "button", className: "alea-page alea-focus-ring", "aria-label": u.previousPage, disabled: e <= 1, onClick: () => N(e - 1), children: /* @__PURE__ */ a(q, { size: 16, "aria-hidden": "true" }) }),
46
- o === "compact" ? /* @__PURE__ */ a("span", { className: "alea-page-status", "aria-live": "polite", children: u.nOfTotal(e, n) }) : /* @__PURE__ */ a("ul", { children: x.map((r, M) => r === "gap" ? /* @__PURE__ */ a("li", { className: "alea-page-gap", "aria-hidden": "true", children: "…" }, `g${M}`) : /* @__PURE__ */ a("li", { "data-far": x.length > 5 && Math.abs(r - e) > 1 || void 0, children: /* @__PURE__ */ a("button", { type: "button", className: "alea-page alea-focus-ring", "aria-current": r === e ? "page" : void 0, "aria-label": u.pageN(r), onClick: () => N(r), children: r }) }, r)) }),
47
- /* @__PURE__ */ a("button", { type: "button", className: "alea-page alea-focus-ring", "aria-label": u.nextPage, disabled: e >= n, onClick: () => N(e + 1), children: /* @__PURE__ */ a(A, { size: 16, "aria-hidden": "true" }) }),
48
- m && /* @__PURE__ */ a("button", { type: "button", className: "alea-page alea-focus-ring", "data-far": !0, "aria-label": u.lastPage, disabled: e >= n, onClick: () => N(n), children: /* @__PURE__ */ a(K, { size: 16, "aria-hidden": "true" }) })
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 i ? /* @__PURE__ */ c("div", { className: B("alea-pagination-bar", C), "data-size": h, children: [
51
- b != null && s ? /* @__PURE__ */ a("span", { className: "alea-pagination-total", "aria-live": "polite", children: u.itemRange(l, g, b) }) : /* @__PURE__ */ a("span", {}),
52
- /* @__PURE__ */ c("div", { className: "alea-pagination-controls", children: [
53
- v && s && /* @__PURE__ */ c("label", { className: "alea-pagination-size", children: [
54
- /* @__PURE__ */ a("span", { children: u.perPage }),
55
- /* @__PURE__ */ a("select", { className: "alea-cal-select alea-focus-ring", value: s, onChange: (r) => v(Number(r.target.value)), children: f.map((r) => /* @__PURE__ */ a("option", { value: r, children: r }, r)) })
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
- k,
58
- d && /* @__PURE__ */ c("label", { className: "alea-pagination-jump", children: [
59
- /* @__PURE__ */ a("span", { children: u.goToPage }),
60
- /* @__PURE__ */ a(
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: n,
68
- placeholder: String(e),
67
+ max: i,
68
+ placeholder: String(a),
69
69
  onKeyDown: (r) => {
70
70
  if (r.key === "Enter") {
71
- const M = Number(r.target.value);
72
- M && (N(M), r.target.value = "");
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
- ] }) : k;
79
+ ] }) : n;
80
80
  }
81
- function ia({ steps: e, current: n, orientation: p = "horizontal", responsive: t = !0, showStatus: o, onStepPress: h, size: m, variant: s = "numbers", labelPlacement: f, className: v, "aria-label": b }) {
82
- const d = R();
83
- b ?? (b = d.progress);
84
- const C = Math.max(0, e.findIndex((l) => l.id === n)), y = t === "scroll" && p === "horizontal", u = O(null), [x, N] = j(!1);
85
- return L(() => {
86
- const l = u.current;
87
- if (!y || !l) return;
88
- const g = () => N(l.scrollWidth > l.clientWidth + 1);
89
- g();
90
- const i = l.querySelector('[aria-current="step"]');
91
- if (i) {
92
- const r = l.getBoundingClientRect(), M = i.getBoundingClientRect();
93
- l.scrollLeft += M.left + M.width / 2 - (r.left + r.width / 2);
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 k = new ResizeObserver(g);
97
- return k.observe(l), () => k.disconnect();
98
- }, [y, C, e.length]), /* @__PURE__ */ a("ol", { ref: u, tabIndex: y && x ? 0 : void 0, "aria-label": b, className: B("alea-steps", v), "data-orientation": p, "data-responsive": y ? "scroll" : t ? "true" : void 0, "data-size": m, "data-variant": s !== "numbers" ? s : void 0, "data-label-placement": f !== "end" ? f : void 0, children: e.map((l, g) => {
99
- const i = l.status ?? (g < C ? "done" : g === C ? "current" : "upcoming"), k = i === "error" ? /* @__PURE__ */ a(V, { size: 14 }) : i === "skipped" ? /* @__PURE__ */ a(X, { size: 14 }) : i === "warning" ? "!" : i === "done" ? /* @__PURE__ */ a(F, { size: 14 }) : s === "dots" ? null : s === "icons" && l.icon ? l.icon : g + 1, r = /* @__PURE__ */ c(z, { children: [
100
- /* @__PURE__ */ a("span", { className: "alea-step-dot", "aria-hidden": "true", children: k }),
101
- /* @__PURE__ */ c("span", { className: "alea-step-text", children: [
102
- /* @__PURE__ */ c("span", { className: "alea-step-title", children: [
103
- l.title,
104
- l.isOptional && /* @__PURE__ */ c("span", { className: "alea-step-optional", children: [
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
- d.optional,
106
+ f.optional,
107
107
  ")"
108
108
  ] })
109
109
  ] }),
110
- l.description && /* @__PURE__ */ a("span", { className: "alea-step-desc", children: l.description }),
111
- o && /* @__PURE__ */ a("span", { className: "alea-step-status", children: d.stepStatus[i] }),
112
- !o && (i === "error" || i === "warning" || i === "skipped") && /* @__PURE__ */ c("span", { className: "alea-visually-hidden", children: [
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
- i === "error" ? d.stepError : i === "warning" ? d.stepWarning : d.stepSkipped
114
+ b(l)
115
115
  ] })
116
116
  ] })
117
117
  ] });
118
- return /* @__PURE__ */ a("li", { className: "alea-step", "data-status": i, "aria-current": i === "current" ? "step" : void 0, children: h && i === "done" ? /* @__PURE__ */ c("button", { type: "button", className: "alea-step-button alea-focus-ring", onClick: () => h(l.id), children: [
119
- r,
120
- !o && /* @__PURE__ */ c("span", { className: "alea-visually-hidden", children: [
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
- d.stepDoneBack
122
+ f.stepDoneBack
123
123
  ] })
124
- ] }) : /* @__PURE__ */ c("div", { className: "alea-step-button", children: [
125
- r,
126
- i === "done" && !o && /* @__PURE__ */ c("span", { className: "alea-visually-hidden", children: [
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
- d.stepDone
128
+ (c == null ? void 0 : c.done) ?? f.stepDone
129
129
  ] })
130
- ] }) }, l.id != null ? String(l.id) : g);
130
+ ] }) }, n.id != null ? String(n.id) : r);
131
131
  }) });
132
132
  }
133
133
  export {
134
- ra as Breadcrumb,
135
- na as Breadcrumbs,
136
- la as Pagination,
137
- ia as Steps
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 (links) or none (buttons with onChange). More than maxItems fold into a More button. */
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 C, useRef as S, forwardRef as Y, useId as K, useEffect as R } from "react";
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 A } from "../../utils/cx.js";
8
- import { useMergedRef as P } from "../../utils/refs.js";
9
- import { MenuSeparator as U, MenuItem as V } from "../menu/Menu.js";
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 J, DrawerContent as Q } from "../overlay/Drawer.js";
12
- const W = (d) => d.map((i, t) => "separator" in i ? /* @__PURE__ */ a(U, {}, `s${t}`) : /* @__PURE__ */ a(V, { 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 ue({ motion: d, children: i, items: t, onAction: p, className: x, areaLabel: N, "aria-label": y }) {
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] = C(null), f = S(null), g = S(null), r = S(void 0), n = (e, u) => {
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: A("alea-context-area", x),
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 de({ motion: d, menus: i, onAction: t, className: p, "aria-label": x }) {
59
- const [N, y] = C(0), [h, m] = C(null), b = S([]), f = (r, n) => {
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: A("alea-menubar", p), children: i.map((r, n) => /* @__PURE__ */ k("span", { className: "alea-menubar-slot", children: [
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 fe = 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] = C(!1), r = S(null), n = P(b, r), e = S(void 0), u = K(), E = (s, c) => {
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: A("alea-hovercard-trigger", h),
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
- }), L = (d) => "items" in d, F = (d) => "href" in d, B = (d, i) => !!i && d.items.some((t) => F(t) ? t.href === i : L(t) ? B(t, i) : !1);
135
- function Z({ 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] = C(() => {
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
- L(w) && B(w, i) && (s.add(`${l}/${w.label}`), c(w.items, `${l}/${w.label}`));
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 (L(l)) {
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: A("alea-vnav", h),
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 me(d) {
261
+ function ve(d) {
262
262
  const i = T();
263
- return d.orientation === "vertical" ? /* @__PURE__ */ a(Z, { ...d, label: d["aria-label"] ?? i.mainNav }) : /* @__PURE__ */ a(_, { ...d });
263
+ return d.orientation === "vertical" ? /* @__PURE__ */ a(_, { ...d, label: d["aria-label"] ?? i.mainNav }) : /* @__PURE__ */ a(ee, { ...d });
264
264
  }
265
- function _({ items: d, current: i, className: t, onNavigate: p, "aria-label": x }) {
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) || L(r)), [h, m] = C(null), b = S(null), f = S([]), g = K();
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: A("alea-navmenu", t),
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 ve({ items: d, value: i, onChange: t, fixed: p = !0, maxItems: x, moreLabel: N, moreIcon: y, className: h, "aria-label": m }) {
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] = C(!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: [
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: A("alea-bottomnav", h), "data-fixed": p || void 0, children: [
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("a", { href: o.href, className: "alea-bottomnav-item alea-focus-ring", "aria-current": w ? "page" : void 0, onClick: () => 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);
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(J, { isOpen: f, onOpenChange: g, placement: "bottom", children: /* @__PURE__ */ a(Q, { title: N, children: ({ close: o }) => /* @__PURE__ */ a("ul", { className: "alea-bottomnav-more", children: u.map((l) => {
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("a", { href: l.href, className: "alea-bottomnav-more-item alea-focus-ring", "aria-current": w ? "page" : void 0, onClick: $, 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);
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 he({ isOpen: d, onChange: i, size: t = "md", className: p, "aria-controls": x, "aria-label": N }) {
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: A("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: [
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
- ve as BottomNavigation,
364
- he as Burger,
365
- ue as ContextMenu,
366
- fe as HoverCard,
367
- de as Menubar,
368
- me as NavigationMenu
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. */