@alea-design/ui 0.6.1 → 0.7.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.
Files changed (46) hide show
  1. package/dist/components/button/Button.d.ts +3 -1
  2. package/dist/components/button/Button.js +58 -57
  3. package/dist/components/button/Groups.js +41 -41
  4. package/dist/components/data/Data.d.ts +6 -4
  5. package/dist/components/data/Data.js +49 -49
  6. package/dist/components/date/Date.d.ts +3 -1
  7. package/dist/components/date/Date.js +74 -74
  8. package/dist/components/form/Form.d.ts +3 -1
  9. package/dist/components/form/Form.js +44 -52
  10. package/dist/components/form/validity.d.ts +22 -0
  11. package/dist/components/form/validity.js +38 -0
  12. package/dist/components/list/List.d.ts +3 -2
  13. package/dist/components/navigation/Navigation.d.ts +4 -4
  14. package/dist/components/navigation/Navigation.js +94 -94
  15. package/dist/components/navigation/Navigation2.d.ts +3 -1
  16. package/dist/components/navigation/Navigation2.js +218 -210
  17. package/dist/components/page/PageParts.d.ts +3 -1
  18. package/dist/components/page/PageParts.js +86 -86
  19. package/dist/components/shell/AppShell.d.ts +3 -1
  20. package/dist/components/shell/AppShell.js +33 -32
  21. package/dist/components/table/Table.d.ts +6 -3
  22. package/dist/components/table/Table.js +45 -45
  23. package/dist/components/theme/Theme.d.ts +5 -1
  24. package/dist/components/theme/Theme.js +63 -63
  25. package/dist/css/base.css +1 -1
  26. package/dist/css/button.css +1 -1
  27. package/dist/css/data.css +1 -1
  28. package/dist/css/date.css +1 -1
  29. package/dist/css/feedback.css +1 -1
  30. package/dist/css/groups.json +11 -11
  31. package/dist/css/more.css +1 -1
  32. package/dist/css/navigation.css +1 -1
  33. package/dist/css/page.css +1 -1
  34. package/dist/css/shell.css +1 -1
  35. package/dist/css/table.css +1 -1
  36. package/dist/css/typography.css +1 -1
  37. package/dist/i18n/strings.d.ts +1 -0
  38. package/dist/i18n/strings.js +2 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +279 -275
  41. package/dist/styles.css +1 -1
  42. package/dist/utils/animateRows.d.ts +3 -2
  43. package/dist/utils/animateRows.js +15 -15
  44. package/dist/utils/measure.d.ts +12 -0
  45. package/dist/utils/measure.js +20 -0
  46. package/package.json +3 -3
@@ -44,11 +44,13 @@ export interface PageHeaderProps {
44
44
  sticky?: boolean;
45
45
  /** Tighter spacing and a smaller title, for dense apps. */
46
46
  compact?: boolean;
47
+ /** Keeps the title for screen readers and the document outline but does not draw it, for a page whose title is already shown elsewhere (the app bar, a tab). The rest of the header stays. */
48
+ hideTitle?: boolean;
47
49
  /** Extra class names. */
48
50
  className?: string;
49
51
  }
50
52
  /** The top of a page: breadcrumbs or back, title, subtitle, meta, actions and tabs. Secondary actions fold into a menu on phones, or past `maxVisibleActions`. */
51
- export declare function PageHeader({ title, subtitle, back, backLabel, breadcrumbs, media, meta, actions, secondaryActions, maxVisibleActions, tabs, headingLevel, sticky, compact, className }: PageHeaderProps): import("react").JSX.Element;
53
+ export declare function PageHeader({ title, subtitle, back, backLabel, breadcrumbs, media, meta, actions, secondaryActions, maxVisibleActions, tabs, headingLevel, sticky, compact, hideTitle, className }: PageHeaderProps): import("react").JSX.Element;
52
54
  export interface SaveBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
53
55
  /** Show it while there are unsaved changes. */
54
56
  isVisible: boolean;
@@ -1,117 +1,117 @@
1
1
  "use client";
2
- import { jsxs as l, jsx as e, Fragment as F } from "react/jsx-runtime";
3
- import { useRef as T, useState as P, useEffect as x, createElement as K, forwardRef as C } from "react";
4
- import { Info as R, ArrowLeft as S, MoreHorizontal as $ } from "lucide-react";
5
- import { cx as b } from "../../utils/cx.js";
6
- import { Button as D, IconButton as I } from "../button/Button.js";
7
- import { Breadcrumbs as q, Breadcrumb as G } from "../navigation/Navigation.js";
8
- import { DropdownMenu as J, MenuItem as Q } from "../menu/Menu.js";
9
- import { useStrings as k } from "../../i18n/strings.js";
10
- import { inertProps as U } from "../../utils/inert.js";
11
- function L({ actions: o, label: a, className: i }) {
12
- return /* @__PURE__ */ e("div", { className: i, children: /* @__PURE__ */ e(
13
- J,
2
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
+ import { useRef as L, useState as E, useEffect as I, createElement as $, forwardRef as O } from "react";
4
+ import { Info as F, ArrowLeft as A, MoreHorizontal as q } from "lucide-react";
5
+ import { cx as w } from "../../utils/cx.js";
6
+ import { Button as M, IconButton as x } from "../button/Button.js";
7
+ import { Breadcrumbs as G, Breadcrumb as J } from "../navigation/Navigation.js";
8
+ import { DropdownMenu as Q, MenuItem as U } from "../menu/Menu.js";
9
+ import { useStrings as R } from "../../i18n/strings.js";
10
+ import { inertProps as X } from "../../utils/inert.js";
11
+ import { useMeasured as Y, remPx as Z } from "../../utils/measure.js";
12
+ function H({ actions: t, label: a }) {
13
+ return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
14
+ Q,
14
15
  {
15
16
  "aria-label": a,
16
17
  placement: "bottom end",
17
- trigger: /* @__PURE__ */ e(I, { "aria-label": a, size: "sm", children: /* @__PURE__ */ e($, {}) }),
18
- menuProps: { onAction: (r) => {
19
- var t, s;
20
- return (s = (t = o.find((m) => m.id === r)) == null ? void 0 : t.onAction) == null ? void 0 : s.call(t);
18
+ trigger: /* @__PURE__ */ e(x, { "aria-label": a, size: "sm", children: /* @__PURE__ */ e(q, {}) }),
19
+ menuProps: { onAction: (n) => {
20
+ var i, l;
21
+ return (l = (i = t.find((h) => h.id === n)) == null ? void 0 : i.onAction) == null ? void 0 : l.call(i);
21
22
  } },
22
- children: o.map((r) => /* @__PURE__ */ e(Q, { id: r.id, icon: r.icon, href: r.href, isDisabled: r.isDisabled, tone: r.tone, children: r.label }, String(r.id)))
23
+ children: t.map((n) => /* @__PURE__ */ e(U, { id: n.id, icon: n.icon, href: n.href, isDisabled: n.isDisabled, tone: n.tone, children: n.label }, String(n.id)))
23
24
  }
24
25
  ) });
25
26
  }
26
- function ne({ title: o, subtitle: a, back: i, backLabel: r, breadcrumbs: t, media: s, meta: m, actions: N, secondaryActions: d, maxVisibleActions: h, tabs: v, headingLevel: p = 1, sticky: c, compact: u, className: y }) {
27
- const f = k(), g = T(null), [H, O] = P(!1);
28
- x(() => {
29
- const n = g.current;
30
- if (!c || !n || typeof IntersectionObserver > "u") return;
31
- const w = document.createElement("div");
32
- n.before(w);
33
- const M = new IntersectionObserver(([A]) => O(!A.isIntersecting));
34
- return M.observe(w), () => {
35
- M.disconnect(), w.remove();
27
+ const V = 45, ee = (t) => t.clientWidth > 0 && t.clientWidth < V * Z();
28
+ function he({ title: t, subtitle: a, back: n, backLabel: i, breadcrumbs: l, media: h, meta: v, actions: g, secondaryActions: o, maxVisibleActions: m, tabs: f, headingLevel: u = 1, sticky: s, compact: p, hideTitle: b, className: y }) {
29
+ const d = R(), P = L(null), [T, C] = E(!1);
30
+ I(() => {
31
+ const r = P.current;
32
+ if (!s || !r || typeof IntersectionObserver > "u") return;
33
+ const N = document.createElement("div");
34
+ r.before(N);
35
+ const k = new IntersectionObserver(([_]) => C(!_.isIntersecting));
36
+ return k.observe(N), () => {
37
+ k.disconnect(), N.remove();
36
38
  };
37
- }, [c]);
38
- const j = Math.max(0, h ?? 1 / 0), z = [], B = [];
39
- for (const n of d ?? []) (!n.menuOnly && z.length < j ? z : B).push(n);
40
- const E = d != null && d.length ? /* @__PURE__ */ l(F, { children: [
41
- /* @__PURE__ */ l("div", { className: "alea-page-header-secondary", children: [
42
- z.map((n) => /* @__PURE__ */ e(D, { variant: "ghost", size: "sm", iconStart: n.icon, href: n.href, onPress: n.onAction, isDisabled: n.isDisabled, tone: n.tone === "danger" ? "danger" : void 0, children: n.label }, String(n.id))),
43
- B.length > 0 && /* @__PURE__ */ e(L, { actions: B, label: f.moreActions })
44
- ] }),
45
- /* @__PURE__ */ e(L, { actions: d, label: f.moreActions, className: "alea-page-header-more" })
46
- ] }) : null;
47
- return /* @__PURE__ */ l("header", { ref: g, className: b("alea-page-header", y), "data-sticky": c || void 0, "data-stuck": H || void 0, "data-compact": u || void 0, children: [
48
- t != null && t.length ? /* @__PURE__ */ e("nav", { "aria-label": f.breadcrumb, children: /* @__PURE__ */ e(q, { className: "alea-page-header-crumbs", children: t.map((n, w) => /* @__PURE__ */ e(G, { href: w === t.length - 1 ? void 0 : n.href, children: n.label }, w)) }) }) : null,
49
- /* @__PURE__ */ l("div", { className: "alea-page-header-main", children: [
50
- i && (typeof i == "string" ? /* @__PURE__ */ e(I, { "aria-label": r ?? f.back, variant: "ghost", size: "sm", href: i, className: "alea-page-header-back", children: /* @__PURE__ */ e(S, {}) }) : /* @__PURE__ */ e(I, { "aria-label": r ?? f.back, variant: "ghost", size: "sm", onPress: i, className: "alea-page-header-back", children: /* @__PURE__ */ e(S, {}) })),
51
- s && /* @__PURE__ */ e("span", { className: "alea-page-header-media", children: s }),
52
- /* @__PURE__ */ l("div", { className: "alea-page-header-titles", children: [
53
- /* @__PURE__ */ l("div", { className: "alea-page-header-title-row", children: [
54
- K(`h${p}`, { className: "alea-page-header-title" }, o),
55
- m && /* @__PURE__ */ e("div", { className: "alea-page-header-meta", children: m })
39
+ }, [s]);
40
+ const S = Y(P, ee, !1), W = Math.max(0, m ?? 1 / 0), z = [], B = [];
41
+ for (const r of o ?? []) (!r.menuOnly && z.length < W ? z : B).push(r);
42
+ const D = !!(o != null && o.length), j = D && !S ? /* @__PURE__ */ c("div", { className: "alea-page-header-secondary", children: [
43
+ z.map((r) => /* @__PURE__ */ e(M, { variant: "ghost", size: "sm", iconStart: r.icon, href: r.href, onPress: r.onAction, isDisabled: r.isDisabled, tone: r.tone === "danger" ? "danger" : void 0, children: r.label }, String(r.id))),
44
+ B.length > 0 && /* @__PURE__ */ e(H, { actions: B, label: d.moreActions })
45
+ ] }) : null, K = D && S ? /* @__PURE__ */ e(H, { actions: o, label: d.moreActions }) : null;
46
+ return /* @__PURE__ */ c("header", { ref: P, className: w("alea-page-header", y), "data-sticky": s || void 0, "data-stuck": T || void 0, "data-compact": p || void 0, children: [
47
+ l != null && l.length ? /* @__PURE__ */ e("nav", { "aria-label": d.breadcrumb, children: /* @__PURE__ */ e(G, { className: "alea-page-header-crumbs", children: l.map((r, N) => /* @__PURE__ */ e(J, { href: N === l.length - 1 ? void 0 : r.href, children: r.label }, N)) }) }) : null,
48
+ /* @__PURE__ */ c("div", { className: "alea-page-header-main", children: [
49
+ n && (typeof n == "string" ? /* @__PURE__ */ e(x, { "aria-label": i ?? d.back, variant: "ghost", size: "sm", href: n, className: "alea-page-header-back", children: /* @__PURE__ */ e(A, {}) }) : /* @__PURE__ */ e(x, { "aria-label": i ?? d.back, variant: "ghost", size: "sm", onPress: n, className: "alea-page-header-back", children: /* @__PURE__ */ e(A, {}) })),
50
+ h && /* @__PURE__ */ e("span", { className: "alea-page-header-media", children: h }),
51
+ /* @__PURE__ */ c("div", { className: "alea-page-header-titles", children: [
52
+ /* @__PURE__ */ c("div", { className: "alea-page-header-title-row", children: [
53
+ $(`h${u}`, { className: w("alea-page-header-title", b && "alea-visually-hidden") }, t),
54
+ v && /* @__PURE__ */ e("div", { className: "alea-page-header-meta", children: v })
56
55
  ] }),
57
56
  a && /* @__PURE__ */ e("p", { className: "alea-page-header-subtitle", children: a })
58
57
  ] }),
59
- (N || E) && /* @__PURE__ */ l("div", { className: "alea-page-header-actions", children: [
60
- E,
61
- N
58
+ (g || D) && /* @__PURE__ */ c("div", { className: "alea-page-header-actions", children: [
59
+ j,
60
+ g,
61
+ K
62
62
  ] })
63
63
  ] }),
64
- v && /* @__PURE__ */ e("div", { className: "alea-page-header-tabs", children: v })
64
+ f && /* @__PURE__ */ e("div", { className: "alea-page-header-tabs", children: f })
65
65
  ] });
66
66
  }
67
- const te = C(function({ isVisible: a, message: i, onSave: r, onDiscard: t, isSaving: s, saveLabel: m, discardLabel: N, position: d = "top", saveShortcut: h = !0, className: v, ...p }, c) {
68
- const u = k(), y = T(r);
69
- return y.current = r, x(() => {
70
- if (!a || !h) return;
71
- const f = (g) => {
72
- (g.metaKey || g.ctrlKey) && g.key.toLowerCase() === "s" && (g.preventDefault(), y.current());
67
+ const me = O(function({ isVisible: a, message: n, onSave: i, onDiscard: l, isSaving: h, saveLabel: v, discardLabel: g, position: o = "top", saveShortcut: m = !0, className: f, ...u }, s) {
68
+ const p = R(), b = L(i);
69
+ return b.current = i, I(() => {
70
+ if (!a || !m) return;
71
+ const y = (d) => {
72
+ (d.metaKey || d.ctrlKey) && d.key.toLowerCase() === "s" && (d.preventDefault(), b.current());
73
73
  };
74
- return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
75
- }, [a, h]), /* @__PURE__ */ l("div", { ref: c, ...p, className: b("alea-savebar", v), "data-visible": a || void 0, "data-position": d, role: "region", "aria-label": p["aria-label"] ?? u.unsavedChanges, "aria-hidden": !a || void 0, ...U(!a), children: [
76
- /* @__PURE__ */ e("p", { className: "alea-savebar-message", "aria-live": "polite", children: a ? i ?? u.unsavedChanges : "" }),
77
- /* @__PURE__ */ l("div", { className: "alea-savebar-actions", children: [
78
- t && /* @__PURE__ */ e(D, { variant: "ghost", size: "sm", onPress: t, isDisabled: s, children: N ?? u.discard }),
79
- /* @__PURE__ */ e(D, { size: "sm", variant: "secondary", onPress: r, isLoading: s, shortcut: h ? "⌘S" : void 0, children: m ?? u.save })
74
+ return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
75
+ }, [a, m]), /* @__PURE__ */ c("div", { ref: s, ...u, className: w("alea-savebar", f), "data-visible": a || void 0, "data-position": o, role: "region", "aria-label": u["aria-label"] ?? p.unsavedChanges, "aria-hidden": !a || void 0, ...X(!a), children: [
76
+ /* @__PURE__ */ e("p", { className: "alea-savebar-message", "aria-live": "polite", children: a ? n ?? p.unsavedChanges : "" }),
77
+ /* @__PURE__ */ c("div", { className: "alea-savebar-actions", children: [
78
+ l && /* @__PURE__ */ e(M, { variant: "ghost", size: "sm", onPress: l, isDisabled: h, children: g ?? p.discard }),
79
+ /* @__PURE__ */ e(M, { size: "sm", variant: "secondary", onPress: i, isLoading: h, shortcut: m ? "⌘S" : void 0, children: v ?? p.save })
80
80
  ] })
81
81
  ] });
82
- }), ie = C(function({ isLoading: a, value: i, "aria-label": r, className: t, ...s }, m) {
83
- const N = k(), [d, h] = P(a), [v, p] = P(!1);
84
- if (x(() => {
82
+ }), ue = O(function({ isLoading: a, value: n, "aria-label": i, className: l, ...h }, v) {
83
+ const g = R(), [o, m] = E(a), [f, u] = E(!1);
84
+ if (I(() => {
85
85
  if (a) {
86
- h(!0), p(!1);
86
+ m(!0), u(!1);
87
87
  return;
88
88
  }
89
- if (!d) return;
90
- p(!0);
91
- const u = setTimeout(() => {
92
- h(!1), p(!1);
89
+ if (!o) return;
90
+ u(!0);
91
+ const p = setTimeout(() => {
92
+ m(!1), u(!1);
93
93
  }, 500);
94
- return () => clearTimeout(u);
95
- }, [a]), !d) return null;
96
- const c = v ? 100 : i;
97
- return /* @__PURE__ */ e("div", { ref: m, ...s, className: b("alea-top-loading", t), role: "progressbar", "aria-label": r ?? N.loading, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": c, "data-done": v || void 0, "data-indeterminate": c == null || void 0, children: /* @__PURE__ */ e("span", { className: "alea-top-loading-bar", style: c != null ? { width: `${c}%` } : void 0 }) });
94
+ return () => clearTimeout(p);
95
+ }, [a]), !o) return null;
96
+ const s = f ? 100 : n;
97
+ return /* @__PURE__ */ e("div", { ref: v, ...h, className: w("alea-top-loading", l), role: "progressbar", "aria-label": i ?? g.loading, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": s, "data-done": f || void 0, "data-indeterminate": s == null || void 0, children: /* @__PURE__ */ e("span", { className: "alea-top-loading-bar", style: s != null ? { width: `${s}%` } : void 0 }) });
98
98
  });
99
- function le({ children: o, className: a }) {
100
- return /* @__PURE__ */ l("p", { className: b("alea-footer-help", a), children: [
101
- /* @__PURE__ */ e(R, { size: 16, "aria-hidden": "true" }),
102
- /* @__PURE__ */ e("span", { children: o })
99
+ function pe({ children: t, className: a }) {
100
+ return /* @__PURE__ */ c("p", { className: w("alea-footer-help", a), children: [
101
+ /* @__PURE__ */ e(F, { size: 16, "aria-hidden": "true" }),
102
+ /* @__PURE__ */ e("span", { children: t })
103
103
  ] });
104
104
  }
105
- function oe({ primary: o, secondary: a, className: i }) {
106
- return /* @__PURE__ */ l("div", { className: b("alea-page-actions", i), children: [
105
+ function fe({ primary: t, secondary: a, className: n }) {
106
+ return /* @__PURE__ */ c("div", { className: w("alea-page-actions", n), children: [
107
107
  /* @__PURE__ */ e("div", { className: "alea-page-actions-secondary", children: a }),
108
- /* @__PURE__ */ e("div", { className: "alea-page-actions-primary", children: o })
108
+ /* @__PURE__ */ e("div", { className: "alea-page-actions-primary", children: t })
109
109
  ] });
110
110
  }
111
111
  export {
112
- le as FooterHelp,
113
- oe as PageActions,
114
- ne as PageHeader,
115
- te as SaveBar,
116
- ie as TopLoadingBar
112
+ pe as FooterHelp,
113
+ fe as PageActions,
114
+ he as PageHeader,
115
+ me as SaveBar,
116
+ ue as TopLoadingBar
117
117
  };
@@ -24,11 +24,13 @@ export interface AppShellProps {
24
24
  target?: string;
25
25
  label?: ReactNode;
26
26
  };
27
+ /** A bar along the bottom of the screen, usually a BottomNavigation on phones (render it only where it applies). It sticks to the bottom edge and takes its own space under the content, so the end of the page is never hidden behind it, at any text size. A fixed BottomNavigation is laid out in flow here; no extra spacing is needed. */
28
+ bottomBar?: ReactNode;
27
29
  /** Extra class names for the root element. */
28
30
  className?: string;
29
31
  }
30
32
  /** The app frame: sticky header, sidebar, scrollable content and a skip link. */
31
- export declare function AppShell({ brand, headerEnd, sidebar, children, sidebarWidth, collapseBelow, mainAs, layout, contentSize, skipLink, className }: AppShellProps): import("react").JSX.Element;
33
+ export declare function AppShell({ brand, headerEnd, sidebar, children, sidebarWidth, collapseBelow, mainAs, layout, contentSize, skipLink, bottomBar, className }: AppShellProps): import("react").JSX.Element;
32
34
  export interface SidebarNavProps {
33
35
  children: ReactNode;
34
36
  /** Name of the navigation. Default "Sidebar". */
@@ -1,56 +1,57 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as a, Fragment as w } from "react/jsx-runtime";
3
- import { useState as y, forwardRef as M } from "react";
4
- import { Link as O } from "react-aria-components";
5
- import { Menu as j } from "lucide-react";
6
- import { cx as u, withBase as D } from "../../utils/cx.js";
7
- import { useMediaQuery as G } from "../layout/Responsive.js";
8
- import { IconButton as I } from "../button/Button.js";
9
- import { Drawer as $ } from "../overlay/Drawer.js";
10
- import { Dialog as A } from "../overlay/Overlay.js";
11
- import { useStrings as N } from "../../i18n/strings.js";
12
- import { SkipLink as F } from "../more/More.js";
13
- function V({ brand: s, headerEnd: l, sidebar: e, children: r, sidebarWidth: d = 248, collapseBelow: n = 900, mainAs: c = "main", layout: o = "header", contentSize: m, skipLink: i, className: g }) {
14
- const p = N(), b = c, [x, h] = y(!1), S = G(`(max-width: ${n - 0.02}px)`), f = /* @__PURE__ */ t("header", { className: "alea-shell-header", children: [
15
- e && /* @__PURE__ */ a(I, { "aria-label": p.openNavigation, className: "alea-shell-menu", onPress: () => h(!0), children: /* @__PURE__ */ a(j, {}) }),
2
+ import { jsxs as t, jsx as a, Fragment as y } from "react/jsx-runtime";
3
+ import { useState as M, forwardRef as O } from "react";
4
+ import { Link as j } from "react-aria-components";
5
+ import { Menu as D } from "lucide-react";
6
+ import { cx as u, withBase as G } from "../../utils/cx.js";
7
+ import { useMediaQuery as I } from "../layout/Responsive.js";
8
+ import { IconButton as $ } from "../button/Button.js";
9
+ import { Drawer as A } from "../overlay/Drawer.js";
10
+ import { Dialog as F } from "../overlay/Overlay.js";
11
+ import { useStrings as g } from "../../i18n/strings.js";
12
+ import { SkipLink as P } from "../more/More.js";
13
+ function X({ brand: s, headerEnd: l, sidebar: e, children: r, sidebarWidth: d = 248, collapseBelow: n = 900, mainAs: c = "main", layout: o = "header", contentSize: m, skipLink: i, bottomBar: p, className: b }) {
14
+ const f = g(), x = c, [S, h] = M(!1), C = I(`(max-width: ${n - 0.02}px)`), v = /* @__PURE__ */ t("header", { className: "alea-shell-header", children: [
15
+ e && /* @__PURE__ */ a($, { "aria-label": f.openNavigation, className: "alea-shell-menu", onPress: () => h(!0), children: /* @__PURE__ */ a(D, {}) }),
16
16
  s && /* @__PURE__ */ a("div", { className: "alea-shell-brand", children: s }),
17
17
  l && /* @__PURE__ */ a("div", { className: "alea-shell-end", children: l })
18
- ] }), v = /* @__PURE__ */ a(b, { id: "alea-main", className: "alea-shell-main", tabIndex: -1, children: m && m !== "full" ? /* @__PURE__ */ a("div", { className: "alea-shell-content", "data-size": m, children: r }) : r });
19
- return /* @__PURE__ */ t("div", { className: u("alea-shell", g), style: { "--alea-shell-sidebar": `${d}px` }, "data-layout": o, "data-collapse": n, "data-collapsed": S || void 0, "data-custom-collapse": n !== 900 || void 0, children: [
20
- i !== !1 && /* @__PURE__ */ a(F, { target: (i == null ? void 0 : i.target) ?? "alea-main", children: i == null ? void 0 : i.label }),
21
- o === "header" && f,
18
+ ] }), N = /* @__PURE__ */ a(x, { id: "alea-main", className: "alea-shell-main", tabIndex: -1, children: m && m !== "full" ? /* @__PURE__ */ a("div", { className: "alea-shell-content", "data-size": m, children: r }) : r });
19
+ return /* @__PURE__ */ t("div", { className: u("alea-shell", b), style: { "--alea-shell-sidebar": `${d}px` }, "data-layout": o, "data-collapse": n, "data-collapsed": C || void 0, "data-custom-collapse": n !== 900 || void 0, children: [
20
+ i !== !1 && /* @__PURE__ */ a(P, { target: (i == null ? void 0 : i.target) ?? "alea-main", children: i == null ? void 0 : i.label }),
21
+ o === "header" && v,
22
22
  /* @__PURE__ */ t("div", { className: "alea-shell-body", children: [
23
23
  e && /* @__PURE__ */ a("aside", { className: "alea-shell-sidebar", children: e }),
24
24
  o === "sidebar" ? /* @__PURE__ */ t("div", { className: "alea-shell-panel", children: [
25
- f,
26
- v
27
- ] }) : v
25
+ v,
26
+ N
27
+ ] }) : N
28
28
  ] }),
29
- e && /* @__PURE__ */ a($, { isOpen: x, onOpenChange: h, placement: "start", size: 300, children: /* @__PURE__ */ a(A, { "aria-label": p.navigation, hideClose: !0, className: "alea-shell-drawer", children: () => /* @__PURE__ */ a("div", { onClickCapture: (C) => {
30
- C.target.closest("a") && h(!1);
29
+ p && /* @__PURE__ */ a("div", { className: "alea-shell-bottom", children: p }),
30
+ e && /* @__PURE__ */ a(A, { isOpen: S, onOpenChange: h, placement: "start", size: 300, children: /* @__PURE__ */ a(F, { "aria-label": f.navigation, hideClose: !0, className: "alea-shell-drawer", children: () => /* @__PURE__ */ a("div", { onClickCapture: (w) => {
31
+ w.target.closest("a") && h(!1);
31
32
  }, children: e }) }) })
32
33
  ] });
33
34
  }
34
- function W({ children: s, className: l, "aria-label": e }) {
35
- const r = N();
35
+ function Y({ children: s, className: l, "aria-label": e }) {
36
+ const r = g();
36
37
  return e ?? (e = r.mainNav), /* @__PURE__ */ a("nav", { "aria-label": e, className: u("alea-sidenav", l), children: s });
37
38
  }
38
- const X = M(function({ title: l, children: e, className: r, ...d }, n) {
39
+ const Z = O(function({ title: l, children: e, className: r, ...d }, n) {
39
40
  return /* @__PURE__ */ t("div", { ref: n, ...d, className: u("alea-sidenav-group", r), children: [
40
41
  l && /* @__PURE__ */ a("p", { className: "alea-sidenav-title", children: l }),
41
42
  /* @__PURE__ */ a("ul", { children: e })
42
43
  ] });
43
44
  });
44
- function Y({ isCurrent: s, icon: l, end: e, children: r, className: d, ...n }) {
45
- return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(O, { ...n, "aria-current": s ? "page" : void 0, className: D("alea-sidenav-link alea-focus-ring", d), children: (c) => /* @__PURE__ */ t(w, { children: [
45
+ function _({ isCurrent: s, icon: l, end: e, children: r, className: d, ...n }) {
46
+ return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(j, { ...n, "aria-current": s ? "page" : void 0, className: G("alea-sidenav-link alea-focus-ring", d), children: (c) => /* @__PURE__ */ t(y, { children: [
46
47
  l && /* @__PURE__ */ a("span", { className: "alea-sidenav-icon", "aria-hidden": "true", children: l }),
47
48
  /* @__PURE__ */ a("span", { className: "alea-sidenav-label", children: typeof r == "function" ? r(c) : r }),
48
49
  e && /* @__PURE__ */ a("span", { className: "alea-sidenav-end", children: e })
49
50
  ] }) }) });
50
51
  }
51
52
  export {
52
- V as AppShell,
53
- X as SidebarGroup,
54
- Y as SidebarLink,
55
- W as SidebarNav
53
+ X as AppShell,
54
+ Z as SidebarGroup,
55
+ _ as SidebarLink,
56
+ Y as SidebarNav
56
57
  };
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type TableProps as RACTableProps, type TableHeaderProps, type ColumnProps as RACColumnProps, type TableBodyProps, type TableFooterProps as RACTableFooterProps, type RowProps, type CellProps } from 'react-aria-components';
3
3
  import { type SurfaceProps } from '../surface/Surface.js';
4
+ import type { RowMotion } from '@alea-design/motion';
4
5
  export interface TableProps extends RACTableProps, SurfaceProps {
5
6
  /** Header stays visible while the body scrolls (needs a height on the container). */
6
7
  stickyHeader?: boolean;
@@ -18,6 +19,8 @@ export interface TableProps extends RACTableProps, SurfaceProps {
18
19
  stackHideEmpty?: boolean;
19
20
  /** With a TableFooter, keeps the footer (the totals row) visible while the body scrolls. Needs a height on the container (maxHeight), like stickyHeader. */
20
21
  stickyFooter?: boolean;
22
+ /** Keeps every cell and header on one line, so a column is as wide as its longest value and the table scrolls sideways when it does not fit (a ledger of references, dates and amounts). Default: text wraps inside its cell. */
23
+ noWrap?: boolean;
21
24
  /** Names the table's scroll area when the table is wider than its container (a narrow screen). The area then becomes a labelled region that takes focus, so the keyboard can scroll it sideways. Nothing changes while the table fits. */
22
25
  scrollLabel?: string;
23
26
  /** Renders only the rows on screen, for thousands of rows: fixed row height in px (needs maxHeight). */
@@ -26,7 +29,7 @@ export interface TableProps extends RACTableProps, SurfaceProps {
26
29
  headingHeight?: number;
27
30
  };
28
31
  }
29
- export declare function Table({ stickyHeader, density: densityRaw, maxHeight, resizable, variant, stackBelow, stackHideEmpty, stickyFooter, scrollLabel, virtualized, surface, radius, className, ...props }: TableProps): import("react").JSX.Element;
32
+ export declare function Table({ stickyHeader, density: densityRaw, maxHeight, resizable, variant, stackBelow, stackHideEmpty, stickyFooter, scrollLabel, noWrap, virtualized, surface, radius, className, ...props }: TableProps): import("react").JSX.Element;
30
33
  /** The header row. Adds the select-all checkbox when the table selects multiple rows. */
31
34
  export declare function TableHeader<T extends object>({ columns, children, className, ...props }: TableHeaderProps<T>): import("react").JSX.Element;
32
35
  export interface ColumnProps extends RACColumnProps {
@@ -37,8 +40,8 @@ export interface ColumnProps extends RACColumnProps {
37
40
  /** A column header; allowsSorting shows the sort arrow and makes it pressable. */
38
41
  export declare function Column({ children, align, className, ...props }: ColumnProps): import("react").JSX.Element;
39
42
  export interface AnimatedTableBodyProps<T extends object> extends TableBodyProps<T> {
40
- /** Rows added to `items` rise in (staggered), and rows removed dissolve before they leave. Needs items with an id and a render function as children. The removed row is disabled while it leaves. Off by default; reduced motion keeps only the fades. */
41
- animateRows?: boolean;
43
+ /** Rows added to `items` rise in (staggered), and rows removed dissolve before they leave. Needs items with an id and a render function as children. The removed row is disabled while it leaves. Off by default; reduced motion keeps only the fades. Pass an object to decide when: `max` rows above which nothing animates, `resetOn` values (search, filter, page) whose change is not news, `enter` and `leave` to animate only one of the two. */
44
+ animateRows?: RowMotion;
42
45
  }
43
46
  /** The rows. renderEmptyState shows when there are none. */
44
47
  export declare function TableBody<T extends object>({ className, animateRows, items: itemsIn, children: childrenIn, dependencies: depsIn, ...props }: AnimatedTableBodyProps<T>): import("react").JSX.Element;
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as h } from "react/jsx-runtime";
3
- import { useContext as w, createContext as H, useRef as S, useEffect as D } from "react";
4
- import { Cell as u, Column as b, useTableOptions as A, Row as F, Collection as x, Table as M, Virtualizer as O, TableLayout as W, ResizableTableContainer as E, TableBody as P, TableFooter as j, TableHeader as V, TableColumnResizeStateContext as L, ColumnResizer as U, Checkbox as q } from "react-aria-components";
5
- import { ArrowUp as G, Minus as I, Check as J } from "lucide-react";
3
+ import { useContext as A, createContext as S, useRef as D, useEffect as F } from "react";
4
+ import { Cell as u, Column as b, useTableOptions as x, Row as M, Collection as R, Table as O, Virtualizer as W, TableLayout as E, ResizableTableContainer as P, TableBody as j, TableFooter as V, TableHeader as L, TableColumnResizeStateContext as U, ColumnResizer as q, Checkbox as G } from "react-aria-components";
5
+ import { ArrowUp as I, Minus as J, Check as K } from "lucide-react";
6
6
  import { surfaceAttrs as T } from "../surface/Surface.js";
7
7
  import { withBase as m, cx as f } from "../../utils/cx.js";
8
- import { DragHandle as K } from "../list/List.js";
9
- import { useStrings as Q } from "../../i18n/strings.js";
10
- import { renamedValue as X } from "../../utils/vocabulary.js";
11
- import { useAnimatedRows as Y } from "../../utils/animateRows.js";
12
- function R({ slot: a }) {
13
- return /* @__PURE__ */ t(q, { slot: a, className: "alea-check alea-table-check", children: ({ isIndeterminate: r }) => /* @__PURE__ */ t("span", { className: "alea-check-box", "aria-hidden": "true", children: r ? /* @__PURE__ */ t(I, { size: 14, strokeWidth: 3 }) : /* @__PURE__ */ t(J, { size: 14, strokeWidth: 3 }) }) });
8
+ import { DragHandle as Q } from "../list/List.js";
9
+ import { useStrings as X } from "../../i18n/strings.js";
10
+ import { renamedValue as Y } from "../../utils/vocabulary.js";
11
+ import { useAnimatedRows as Z } from "../../utils/animateRows.js";
12
+ function k({ slot: a }) {
13
+ return /* @__PURE__ */ t(G, { slot: a, className: "alea-check alea-table-check", children: ({ isIndeterminate: r }) => /* @__PURE__ */ t("span", { className: "alea-check-box", "aria-hidden": "true", children: r ? /* @__PURE__ */ t(J, { size: 14, strokeWidth: 3 }) : /* @__PURE__ */ t(K, { size: 14, strokeWidth: 3 }) }) });
14
14
  }
15
- function Z(a) {
16
- const r = S(null);
17
- return D(() => {
15
+ function _(a) {
16
+ const r = D(null);
17
+ return F(() => {
18
18
  const e = r.current;
19
19
  if (!a || !e) return;
20
20
  const o = () => {
@@ -29,54 +29,54 @@ function Z(a) {
29
29
  };
30
30
  }, [a]), r;
31
31
  }
32
- function me({ stickyHeader: a, density: r = "comfy", maxHeight: e, resizable: o, variant: l = "default", stackBelow: n, stackHideEmpty: i, stickyFooter: d, scrollLabel: c, virtualized: s, surface: p, radius: v, className: z, ...$ }) {
33
- const B = X("Table", "density", r, { comfortable: "comfy" }) === "compact" ? "compact" : "comfy", g = /* @__PURE__ */ t(M, { ...$, className: m("alea-table", z), "data-density": B, "data-sticky": a || s ? !0 : void 0, "data-variant": l !== "default" ? l : void 0, "data-stack": n, "data-stack-hide-empty": n && i ? !0 : void 0, "data-sticky-footer": d ? !0 : void 0, "data-virtualized": s ? !0 : void 0 }), y = s ? /* @__PURE__ */ t(O, { layout: W, layoutOptions: { rowHeight: s.rowHeight, headingHeight: s.headingHeight ?? 44 }, children: g }) : g, N = e ? { maxHeight: e, ...s ? { height: e } : {} } : void 0, C = Z(c);
34
- return o ? /* @__PURE__ */ t(E, { ref: C, className: "alea-table-wrap", style: N, ...T({ surface: p, radius: v }), children: y }) : /* @__PURE__ */ t("div", { ref: C, className: "alea-table-wrap", style: N, ...T({ surface: p, radius: v }), children: y });
32
+ function ue({ stickyHeader: a, density: r = "comfy", maxHeight: e, resizable: o, variant: l = "default", stackBelow: n, stackHideEmpty: i, stickyFooter: d, scrollLabel: s, noWrap: p, virtualized: c, surface: v, radius: g, className: $, ...B }) {
33
+ const H = Y("Table", "density", r, { comfortable: "comfy" }) === "compact" ? "compact" : "comfy", y = /* @__PURE__ */ t(O, { ...B, className: m("alea-table", $), "data-density": H, "data-sticky": a || c ? !0 : void 0, "data-variant": l !== "default" ? l : void 0, "data-stack": n, "data-stack-hide-empty": n && i ? !0 : void 0, "data-sticky-footer": d ? !0 : void 0, "data-virtualized": c ? !0 : void 0, "data-nowrap": p || void 0 }), N = c ? /* @__PURE__ */ t(W, { layout: E, layoutOptions: { rowHeight: c.rowHeight, headingHeight: c.headingHeight ?? 44 }, children: y }) : y, w = e ? { maxHeight: e, ...c ? { height: e } : {} } : void 0, C = _(s);
34
+ return o ? /* @__PURE__ */ t(P, { ref: C, className: "alea-table-wrap", style: w, ...T({ surface: v, radius: g }), children: N }) : /* @__PURE__ */ t("div", { ref: C, className: "alea-table-wrap", style: w, ...T({ surface: v, radius: g }), children: N });
35
35
  }
36
- function ue({ columns: a, children: r, className: e, ...o }) {
37
- const l = Q(), { selectionBehavior: n, selectionMode: i, allowsDragging: d } = A();
38
- return /* @__PURE__ */ h(V, { ...o, className: f("alea-thead", e), children: [
36
+ function be({ columns: a, children: r, className: e, ...o }) {
37
+ const l = X(), { selectionBehavior: n, selectionMode: i, allowsDragging: d } = x();
38
+ return /* @__PURE__ */ h(L, { ...o, className: f("alea-thead", e), children: [
39
39
  d && /* @__PURE__ */ t(b, { className: "alea-th alea-th-narrow", children: /* @__PURE__ */ t("span", { className: "alea-visually-hidden", children: l.dragToMove }) }),
40
- n === "toggle" && /* @__PURE__ */ t(b, { className: "alea-th alea-th-narrow", children: i === "multiple" && /* @__PURE__ */ t(R, { slot: "selection" }) }),
41
- /* @__PURE__ */ t(x, { items: a, children: r })
40
+ n === "toggle" && /* @__PURE__ */ t(b, { className: "alea-th alea-th-narrow", children: i === "multiple" && /* @__PURE__ */ t(k, { slot: "selection" }) }),
41
+ /* @__PURE__ */ t(R, { items: a, children: r })
42
42
  ] });
43
43
  }
44
- function be({ children: a, align: r = "start", className: e, ...o }) {
44
+ function he({ children: a, align: r = "start", className: e, ...o }) {
45
45
  return /* @__PURE__ */ t(b, { ...o, className: m("alea-th", e), "data-align": r, children: ({ allowsSorting: l, sortDirection: n }) => /* @__PURE__ */ h("div", { className: "alea-th-inner", children: [
46
46
  /* @__PURE__ */ t("span", { className: "alea-th-label", children: a }),
47
- l && /* @__PURE__ */ t(G, { size: 14, "aria-hidden": "true", className: "alea-sort", "data-direction": n }),
48
- /* @__PURE__ */ t(_, {})
47
+ l && /* @__PURE__ */ t(I, { size: 14, "aria-hidden": "true", className: "alea-sort", "data-direction": n }),
48
+ /* @__PURE__ */ t(ee, {})
49
49
  ] }) });
50
50
  }
51
- function _() {
52
- return w(L) ? /* @__PURE__ */ t(U, { className: "alea-col-resizer" }) : null;
51
+ function ee() {
52
+ return A(U) ? /* @__PURE__ */ t(q, { className: "alea-col-resizer" }) : null;
53
53
  }
54
- function he({ className: a, animateRows: r, items: e, children: o, dependencies: l, ...n }) {
55
- const i = Y(e, o, r);
56
- return /* @__PURE__ */ t(P, { ...n, items: i.items, dependencies: i.dependencies ? [...l ?? [], ...i.dependencies] : l, className: f("alea-tbody", a), children: i.children });
54
+ function fe({ className: a, animateRows: r, items: e, children: o, dependencies: l, ...n }) {
55
+ const i = Z(e, o, r);
56
+ return /* @__PURE__ */ t(j, { ...n, items: i.items, dependencies: i.dependencies ? [...l ?? [], ...i.dependencies] : l, className: f("alea-tbody", a), children: i.children });
57
57
  }
58
- const k = H(!1);
59
- function fe({ className: a, children: r, ...e }) {
60
- return /* @__PURE__ */ t(j, { ...e, className: f("alea-tfoot", a), children: /* @__PURE__ */ t(k.Provider, { value: !0, children: r }) });
58
+ const z = S(!1);
59
+ function pe({ className: a, children: r, ...e }) {
60
+ return /* @__PURE__ */ t(V, { ...e, className: f("alea-tfoot", a), children: /* @__PURE__ */ t(z.Provider, { value: !0, children: r }) });
61
61
  }
62
- function pe({ id: a, columns: r, children: e, className: o, ...l }) {
63
- const { selectionBehavior: n, allowsDragging: i, selectionMode: d } = A(), c = w(k);
64
- return /* @__PURE__ */ h(F, { id: a, ...c && d !== "none" ? { isDisabled: !0 } : {}, ...l, className: m("alea-tr", o), "data-footer": c ? !0 : void 0, children: [
65
- i && /* @__PURE__ */ t(u, { className: "alea-td alea-td-narrow", children: c ? null : /* @__PURE__ */ t(K, {}) }),
66
- n === "toggle" && /* @__PURE__ */ t(u, { className: "alea-td alea-td-narrow", children: c ? null : /* @__PURE__ */ t(R, { slot: "selection" }) }),
67
- /* @__PURE__ */ t(x, { items: r, dependencies: l.dependencies, children: e })
62
+ function ve({ id: a, columns: r, children: e, className: o, ...l }) {
63
+ const { selectionBehavior: n, allowsDragging: i, selectionMode: d } = x(), s = A(z);
64
+ return /* @__PURE__ */ h(M, { id: a, ...s && d !== "none" ? { isDisabled: !0 } : {}, ...l, className: m("alea-tr", o), "data-footer": s ? !0 : void 0, children: [
65
+ i && /* @__PURE__ */ t(u, { className: "alea-td alea-td-narrow", children: s ? null : /* @__PURE__ */ t(Q, {}) }),
66
+ n === "toggle" && /* @__PURE__ */ t(u, { className: "alea-td alea-td-narrow", children: s ? null : /* @__PURE__ */ t(k, { slot: "selection" }) }),
67
+ /* @__PURE__ */ t(R, { items: r, dependencies: l.dependencies, children: e })
68
68
  ] });
69
69
  }
70
- function ve({ className: a, ...r }) {
70
+ function ge({ className: a, ...r }) {
71
71
  const { align: e, label: o, ...l } = r;
72
72
  return /* @__PURE__ */ t(u, { ...l, "data-align": e, "data-label": o, className: m("alea-td", a) });
73
73
  }
74
74
  export {
75
- ve as Cell,
76
- be as Column,
77
- pe as Row,
78
- me as Table,
79
- he as TableBody,
80
- fe as TableFooter,
81
- ue as TableHeader
75
+ ge as Cell,
76
+ he as Column,
77
+ ve as Row,
78
+ ue as Table,
79
+ fe as TableBody,
80
+ pe as TableFooter,
81
+ be as TableHeader
82
82
  };
@@ -70,6 +70,10 @@ export interface ThemeProviderProps {
70
70
  contrast?: 'system' | 'more' | 'normal';
71
71
  /** decorated (default) keeps the background orbs and aurora; plain turns them off for a flat page, in any look and contrast. */
72
72
  background?: 'decorated' | 'plain';
73
+ /** Underline every text link (links, breadcrumbs, side navigation links and menu links), not only on hover, so a link never depends on its color alone. For a "links are underlined" setting or an AAA context. Default false. */
74
+ underlineLinks?: boolean;
75
+ /** Let every Button below break a long label onto lines instead of cutting it with an ellipsis (what `wrap` does on one button). Short labels look the same; a label wider than its container wraps, which keeps 375 px with large text from overflowing. Default false. */
76
+ wrapButtons?: boolean;
73
77
  /** The glass look's liquid edge (Chromium; others keep the frost): how much what is behind a glass surface bends at its edge,
74
78
  * 'off', 'subtle', 'medium' (default) or 'strong', or a multiplier; lensSelector adds your own surfaces (CSS selector).
75
79
  * The lens rests while the page scrolls and comes back ~150 ms after it stops (the frost stays); pauseOnScroll={false} keeps it on always. Surfaces over 400 x 300 px keep the frost only. */
@@ -96,7 +100,7 @@ export declare function ThemeScript({ storageKey, defaultTheme }: {
96
100
  }): import("react").JSX.Element;
97
101
  /** A router's useHref that leaves absolute URLs, protocol-relative URLs and #anchors alone (routers would turn https://… into /current/https:/…). */
98
102
  export declare function keepAbsolute(useHref: (href: string) => string): (href: string) => string;
99
- export declare function ThemeProvider({ children, dir: dirProp, defaultTheme, theme: controlled, onThemeChange, storageKey, scope, className, brand, density, navigate, useHref, locale, motion, preset, surface, contrast, background, strings, glass }: ThemeProviderProps): import("react").JSX.Element;
103
+ export declare function ThemeProvider({ children, dir: dirProp, defaultTheme, theme: controlled, onThemeChange, storageKey, scope, className, brand, density, navigate, useHref, locale, motion, preset, surface, contrast, background, underlineLinks, wrapButtons, strings, glass }: ThemeProviderProps): import("react").JSX.Element;
100
104
  /** The current theme and a setter. Works without a provider (reads the document). */
101
105
  export declare function useTheme(): ThemeContextValue;
102
106
  export {};