@alea-design/ui 0.5.1 → 0.6.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 (100) hide show
  1. package/dist/components/button/Button.d.ts +3 -1
  2. package/dist/components/button/Button.js +64 -63
  3. package/dist/components/card/Card.d.ts +6 -2
  4. package/dist/components/card/Card.js +20 -20
  5. package/dist/components/combobox/Autocomplete.d.ts +4 -0
  6. package/dist/components/combobox/Autocomplete.js +89 -87
  7. package/dist/components/command/CommandPalette.d.ts +10 -0
  8. package/dist/components/command/CommandPalette.js +76 -52
  9. package/dist/components/data/Data.d.ts +6 -4
  10. package/dist/components/data/Data.js +66 -56
  11. package/dist/components/date/Date.d.ts +16 -2
  12. package/dist/components/date/Date.js +80 -69
  13. package/dist/components/display/Display.d.ts +3 -1
  14. package/dist/components/display/Display.js +27 -27
  15. package/dist/components/display/Display2.d.ts +2 -2
  16. package/dist/components/display/Display2.js +28 -27
  17. package/dist/components/feedback/Feedback.d.ts +3 -1
  18. package/dist/components/feedback/Feedback.js +102 -102
  19. package/dist/components/feedback/PageSkeleton.d.ts +19 -0
  20. package/dist/components/feedback/PageSkeleton.js +58 -0
  21. package/dist/components/field/Field.d.ts +3 -1
  22. package/dist/components/field/Field.js +82 -82
  23. package/dist/components/filter/FilterBar.d.ts +5 -2
  24. package/dist/components/filter/FilterBar.js +97 -66
  25. package/dist/components/form/Form.d.ts +8 -2
  26. package/dist/components/form/Form.js +53 -40
  27. package/dist/components/icon/icon-names.d.ts +2 -2
  28. package/dist/components/icon/icon-names.js +4 -2
  29. package/dist/components/list/List.d.ts +6 -2
  30. package/dist/components/list/List.js +65 -62
  31. package/dist/components/list/Lists2.d.ts +4 -0
  32. package/dist/components/list/Lists2.js +35 -35
  33. package/dist/components/media/Media.js +27 -27
  34. package/dist/components/more/More.d.ts +2 -2
  35. package/dist/components/more/More.js +46 -45
  36. package/dist/components/navigation/Navigation.d.ts +7 -5
  37. package/dist/components/navigation/Navigation.js +91 -74
  38. package/dist/components/navigation/Navigation2.d.ts +9 -3
  39. package/dist/components/navigation/Navigation2.js +209 -195
  40. package/dist/components/notification/NotificationCenter.js +70 -70
  41. package/dist/components/overlay/Drawer.d.ts +6 -1
  42. package/dist/components/overlay/Drawer.js +27 -25
  43. package/dist/components/overlay/Modal.d.ts +5 -0
  44. package/dist/components/overlay/Modal.js +16 -15
  45. package/dist/components/overlay/Overlay.d.ts +10 -1
  46. package/dist/components/overlay/Overlay.js +54 -52
  47. package/dist/components/overlay/Sheet.d.ts +2 -0
  48. package/dist/components/overlay/Sheet.js +30 -30
  49. package/dist/components/page/PageParts.js +20 -20
  50. package/dist/components/select/Select.js +75 -70
  51. package/dist/components/settings/Settings.d.ts +29 -0
  52. package/dist/components/settings/Settings.js +31 -0
  53. package/dist/components/shell/AccountMenu.d.ts +20 -0
  54. package/dist/components/shell/AccountMenu.js +32 -0
  55. package/dist/components/shell/AppShell.d.ts +9 -2
  56. package/dist/components/shell/AppShell.js +37 -37
  57. package/dist/components/shell/AppSidebar.d.ts +9 -3
  58. package/dist/components/shell/AppSidebar.js +45 -39
  59. package/dist/components/table/Table.d.ts +18 -4
  60. package/dist/components/table/Table.js +70 -46
  61. package/dist/components/tabs/Tabs.js +105 -94
  62. package/dist/components/theme/Theme.d.ts +7 -4
  63. package/dist/components/theme/Theme.js +127 -130
  64. package/dist/components/upload/Upload.js +62 -54
  65. package/dist/css/base.css +1 -1
  66. package/dist/css/button.css +1 -1
  67. package/dist/css/card.css +1 -1
  68. package/dist/css/command.css +1 -1
  69. package/dist/css/date.css +1 -1
  70. package/dist/css/display.css +1 -1
  71. package/dist/css/feedback.css +1 -1
  72. package/dist/css/field.css +1 -1
  73. package/dist/css/form.css +1 -1
  74. package/dist/css/groups.json +36 -20
  75. package/dist/css/list.css +1 -1
  76. package/dist/css/menu.css +1 -1
  77. package/dist/css/navigation.css +1 -1
  78. package/dist/css/notification.css +1 -1
  79. package/dist/css/overlay.css +1 -1
  80. package/dist/css/page.css +1 -1
  81. package/dist/css/select.css +1 -1
  82. package/dist/css/settings.css +1 -0
  83. package/dist/css/shell.css +1 -1
  84. package/dist/css/table.css +1 -1
  85. package/dist/css/tabs.css +1 -1
  86. package/dist/css/upload.css +1 -1
  87. package/dist/i18n/strings.d.ts +7 -0
  88. package/dist/i18n/strings.js +14 -0
  89. package/dist/index.d.ts +4 -0
  90. package/dist/index.js +318 -306
  91. package/dist/styles.css +1 -1
  92. package/dist/utils/animateRows.d.ts +11 -0
  93. package/dist/utils/animateRows.js +23 -0
  94. package/dist/utils/decimal.d.ts +12 -0
  95. package/dist/utils/decimal.js +48 -0
  96. package/dist/utils/initialFocus.d.ts +6 -0
  97. package/dist/utils/initialFocus.js +24 -0
  98. package/dist/utils/refs.d.ts +2 -0
  99. package/dist/utils/refs.js +14 -6
  100. package/package.json +3 -3
@@ -7,11 +7,11 @@ import { useScrollEdges as L } from "../../utils/scrollEdges.js";
7
7
  import { cx as g, withBase as A } from "../../utils/cx.js";
8
8
  import { chipIcon as v } from "../icon/icon-contexts.js";
9
9
  import { useStrings as b } from "../../i18n/strings.js";
10
- function R({ tone: a = "neutral", appearance: e = "soft", dot: t, icon: l, size: n = "md", shape: s, className: i, children: d, ...o }) {
11
- return /* @__PURE__ */ m("span", { ...o, className: g("alea-badge", i), "data-tone": a, "data-appearance": e, "data-size": n, "data-shape": s, children: [
10
+ function R({ tone: a = "neutral", appearance: e = "soft", dot: t, icon: l, size: n = "md", shape: o, wrap: i, className: d, children: c, ...s }) {
11
+ return /* @__PURE__ */ m("span", { ...s, className: g("alea-badge", d), "data-tone": a, "data-appearance": e, "data-size": n, "data-shape": o, "data-wrap": i || void 0, children: [
12
12
  t && /* @__PURE__ */ r("span", { className: "alea-badge-dot", "data-pulse": t === "pulse" || void 0, "aria-hidden": "true" }),
13
13
  l && /* @__PURE__ */ r("span", { className: "alea-badge-icon", "aria-hidden": "true", ...v("badge", e, a), children: l }),
14
- d
14
+ c
15
15
  ] });
16
16
  }
17
17
  const M = Object.fromEntries([
@@ -20,35 +20,35 @@ const M = Object.fromEntries([
20
20
  ...["failed", "error", "canceled", "cancelled", "refunded", "out of stock", "down", "blocked", "overdue", "rejected", "expired", "firing", "rolled back", "disconnected"].map((a) => [a, "danger"]),
21
21
  ...["open", "todo", "new", "running", "invited"].map((a) => [a, "info"])
22
22
  ]);
23
- function J({ status: a, tones: e, tone: t, size: l = "sm", dot: n = !0, ...s }) {
23
+ function J({ status: a, tones: e, tone: t, size: l = "sm", dot: n = !0, ...o }) {
24
24
  const i = a.trim().toLowerCase(), d = t ?? (e == null ? void 0 : e[i]) ?? M[i] ?? "neutral";
25
- return /* @__PURE__ */ r(R, { ...s, size: l, dot: n, tone: d, children: a });
25
+ return /* @__PURE__ */ r(R, { ...o, size: l, dot: n, tone: d, children: a });
26
26
  }
27
- function K({ count: a, max: e = 99, label: t, tone: l = "accent", appearance: n = "solid", showZero: s, dot: i, size: d, className: o, ...c }) {
27
+ function K({ count: a, max: e = 99, label: t, tone: l = "accent", appearance: n = "solid", showZero: o, dot: i, size: d, className: c, ...s }) {
28
28
  const u = f(!0);
29
29
  return h(() => {
30
30
  u.current = !1;
31
- }, []), a <= 0 && !s ? null : /* @__PURE__ */ r("span", { ...c, className: g("alea-count", o), "data-tone": l, "data-appearance": n === "solid" ? void 0 : n, "data-dot": i || void 0, "data-size": d, role: t || i ? "img" : void 0, "aria-label": t || i ? `${a}${t ? ` ${t}` : ""}` : void 0, children: !i && /* @__PURE__ */ r("span", { className: u.current ? void 0 : "alea-badge-pop", "aria-hidden": t ? !0 : void 0, children: a > e ? `${e}+` : a }, a) });
31
+ }, []), a <= 0 && !o ? null : /* @__PURE__ */ r("span", { ...s, className: g("alea-count", c), "data-tone": l, "data-appearance": n === "solid" ? void 0 : n, "data-dot": i || void 0, "data-size": d, role: t || i ? "img" : void 0, "aria-label": t || i ? `${a}${t ? ` ${t}` : ""}` : void 0, children: !i && /* @__PURE__ */ r("span", { className: u.current ? void 0 : "alea-badge-pop", "aria-hidden": t ? !0 : void 0, children: a > e ? `${e}+` : a }, a) });
32
32
  }
33
33
  const N = y({ current: !1 });
34
- function Q({ label: a, items: e, children: t, renderEmptyState: l, overflow: n = "wrap", className: s, ...i }) {
35
- const d = f(null), o = f(!1);
36
- h(() => (o.current = !0, () => {
37
- o.current = !1;
34
+ function Q({ label: a, items: e, children: t, renderEmptyState: l, overflow: n = "wrap", className: o, ...i }) {
35
+ const d = f(null), c = f(!1);
36
+ h(() => (c.current = !0, () => {
37
+ c.current = !1;
38
38
  }), []);
39
- const { edges: c, scroll: u } = L(d, ".alea-tag-list", n === "scroll");
40
- return /* @__PURE__ */ r(N.Provider, { value: o, children: /* @__PURE__ */ m(z, { ...i, ref: d, "data-overflow": n, "data-overflow-start": c.start || void 0, "data-overflow-end": c.end || void 0, className: g("alea-tag-group", s), children: [
39
+ const { edges: s, scroll: u } = L(d, ".alea-tag-list", n === "scroll");
40
+ return /* @__PURE__ */ r(N.Provider, { value: c, children: /* @__PURE__ */ m(z, { ...i, ref: d, "data-overflow": n, "data-overflow-start": s.start || void 0, "data-overflow-end": s.end || void 0, className: g("alea-tag-group", o), children: [
41
41
  a && /* @__PURE__ */ r(B, { className: "alea-label", children: a }),
42
42
  /* @__PURE__ */ m("div", { className: "alea-tag-scroller", children: [
43
- c.start && /* @__PURE__ */ r("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "alea-tab-scroll", "data-side": "start", onClick: () => u(-1), children: /* @__PURE__ */ r(j, { size: 16 }) }),
43
+ s.start && /* @__PURE__ */ r("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "alea-tab-scroll", "data-side": "start", onClick: () => u(-1), children: /* @__PURE__ */ r(j, { size: 16 }) }),
44
44
  /* @__PURE__ */ r(E, { items: e, renderEmptyState: l, className: "alea-tag-list", children: t }),
45
- c.end && /* @__PURE__ */ r("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "alea-tab-scroll", "data-side": "end", onClick: () => u(1), children: /* @__PURE__ */ r(I, { size: 16 }) })
45
+ s.end && /* @__PURE__ */ r("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "alea-tab-scroll", "data-side": "end", onClick: () => u(1), children: /* @__PURE__ */ r(I, { size: 16 }) })
46
46
  ] })
47
47
  ] }) });
48
48
  }
49
- function W({ tone: a = "neutral", appearance: e, size: t, icon: l, children: n, className: s, ...i }) {
50
- const d = b(), o = i.textValue ?? (typeof n == "string" ? n : void 0), c = C(N), u = f(c.current).current;
51
- return /* @__PURE__ */ r(S, { ...i, textValue: o, "data-added": u || void 0, "data-tone": a, "data-appearance": e, "data-size": t, className: A("alea-tag alea-focus-ring", s), children: (p) => /* @__PURE__ */ m(T, { children: [
49
+ function W({ tone: a = "neutral", appearance: e, size: t, icon: l, children: n, className: o, ...i }) {
50
+ const d = b(), c = i.textValue ?? (typeof n == "string" ? n : void 0), s = C(N), u = f(s.current).current;
51
+ return /* @__PURE__ */ r(S, { ...i, textValue: c, "data-added": u || void 0, "data-tone": a, "data-appearance": e, "data-size": t, className: A("alea-tag alea-focus-ring", o), children: (p) => /* @__PURE__ */ m(T, { children: [
52
52
  l && /* @__PURE__ */ r("span", { className: "alea-tag-icon", "aria-hidden": "true", ...v("tag", e, a, p.isSelected), children: l }),
53
53
  typeof n == "function" ? n(p) : n,
54
54
  p.allowsRemoving && /* @__PURE__ */ r($, { slot: "remove", className: "alea-tag-remove", "aria-label": d.remove, children: /* @__PURE__ */ r(G, { size: 12 }) })
@@ -59,21 +59,21 @@ function O(a) {
59
59
  const e = a.trim().split(/\s+/).filter(Boolean);
60
60
  return ((((t = e[0]) == null ? void 0 : t[0]) || "") + (e.length > 1 ? e[e.length - 1][0] : "")).toUpperCase() || "?";
61
61
  }
62
- function U({ src: a, name: e, size: t = "md", status: l, shape: n = "circle", fallback: s, ring: i, count: d, className: o, style: c, ...u }) {
62
+ function U({ src: a, name: e, size: t = "md", status: l, shape: n = "circle", fallback: o, ring: i, count: d, className: c, style: s, ...u }) {
63
63
  const [p, w] = k(!1), x = a && !p;
64
- return /* @__PURE__ */ m("span", { ...u, className: g("alea-avatar", o), "data-size": t, "data-shape": n, "data-ring": i === !0 ? "accent" : i || void 0, role: "img", "aria-label": e + (l ? ` (${l})` : "") + (d ? `, ${d}` : ""), style: c, children: [
65
- x ? /* @__PURE__ */ r("img", { src: a, alt: "", onError: () => w(!0) }) : s ? /* @__PURE__ */ r("span", { className: "alea-avatar-fallback", "aria-hidden": "true", children: s }) : /* @__PURE__ */ r("span", { className: "alea-avatar-initials", "aria-hidden": "true", "data-initials": O(e) }),
64
+ return /* @__PURE__ */ m("span", { ...u, className: g("alea-avatar", c), "data-size": t, "data-shape": n, "data-ring": i === !0 ? "accent" : i || void 0, role: "img", "aria-label": e + (l ? ` (${l})` : "") + (d ? `, ${d}` : ""), style: s, children: [
65
+ x ? /* @__PURE__ */ r("img", { src: a, alt: "", onError: () => w(!0) }) : o ? /* @__PURE__ */ r("span", { className: "alea-avatar-fallback", "aria-hidden": "true", children: o }) : /* @__PURE__ */ r("span", { className: "alea-avatar-initials", "aria-hidden": "true", "data-initials": O(e) }),
66
66
  l && /* @__PURE__ */ r("span", { className: "alea-avatar-status", "data-status": l, "aria-hidden": "true" }),
67
67
  d ? /* @__PURE__ */ r("span", { className: "alea-avatar-count", "aria-hidden": "true", children: d > 99 ? "99+" : d }) : null
68
68
  ] });
69
69
  }
70
- function Y({ people: a, max: e = 4, size: t = "md", fan: l, spacing: n, className: s, ...i }) {
71
- const d = b(), o = a.slice(0, e), c = a.length - o.length;
72
- return /* @__PURE__ */ m("div", { ...i, className: g("alea-avatar-group", s), "data-fan": l || void 0, "data-spacing": n, role: "group", "aria-label": d.people(a.length), children: [
73
- o.map((u) => /* @__PURE__ */ r(U, { name: u.name, src: u.src, size: t }, u.name)),
74
- c > 0 && /* @__PURE__ */ r("span", { className: "alea-avatar alea-avatar-more", "data-size": t, role: "img", "aria-label": d.andMore(c), children: /* @__PURE__ */ m("span", { "aria-hidden": "true", children: [
70
+ function Y({ people: a, max: e = 4, size: t = "md", fan: l, spacing: n, className: o, ...i }) {
71
+ const d = b(), c = a.slice(0, e), s = a.length - c.length;
72
+ return /* @__PURE__ */ m("div", { ...i, className: g("alea-avatar-group", o), "data-fan": l || void 0, "data-spacing": n, role: "group", "aria-label": d.people(a.length), children: [
73
+ c.map((u) => /* @__PURE__ */ r(U, { name: u.name, src: u.src, size: t }, u.name)),
74
+ s > 0 && /* @__PURE__ */ r("span", { className: "alea-avatar alea-avatar-more", "data-size": t, role: "img", "aria-label": d.andMore(s), children: /* @__PURE__ */ m("span", { "aria-hidden": "true", children: [
75
75
  "+",
76
- c
76
+ s
77
77
  ] }) })
78
78
  ] });
79
79
  }
@@ -39,8 +39,8 @@ export interface PaymentCardProps {
39
39
  /** A bank card as a picture: issuer, number ending, holder and expiry on a gradient. One image for screen readers ("Physical card for Ana, ending 4410"). */
40
40
  export declare function PaymentCard({ holder, last4, kind, expiry, brand, frozen, tone, href, className }: PaymentCardProps): import("react").JSX.Element;
41
41
  export interface AmountProps {
42
- /** The amount: positive is money in, negative money out. */
43
- value: number;
42
+ /** The amount: positive is money in, negative money out. A decimal string ("1234.50", "-0.07") is formatted exactly, without going through a float: use it for money that comes from a ledger. */
43
+ value: number | string;
44
44
  /** ISO currency code. Default USD. */
45
45
  currency?: string;
46
46
  /** Show the in/out arrow before it. Default false. */
@@ -1,37 +1,38 @@
1
1
  "use client";
2
- import { jsxs as e, jsx as a, Fragment as y } from "react/jsx-runtime";
3
- import { ArrowDownLeft as f, ArrowUpRight as v, Snowflake as u } from "lucide-react";
2
+ import { jsxs as e, jsx as a, Fragment as N } from "react/jsx-runtime";
3
+ import { ArrowDownLeft as f, ArrowUpRight as g, Snowflake as u } from "lucide-react";
4
4
  import { cx as o } from "../../utils/cx.js";
5
- import { useLocale as b, Link as g } from "react-aria-components";
6
- import { useStrings as w } from "../../i18n/strings.js";
7
- import { renamed as z } from "../../utils/vocabulary.js";
8
- function S({ icon: n, tone: l = "accent", appearance: c, variant: s, size: i = "md", shape: r = "square", className: t }) {
9
- const d = z("IconTile", "variant", s, "appearance", c) ?? "soft";
10
- return /* @__PURE__ */ a("span", { className: o("alea-icon-tile", t), "data-tone": l, "data-variant": d, "data-size": i, "data-shape": r, "aria-hidden": "true", children: n });
5
+ import { formatDecimal as v, isDecimalString as b, isZeroDecimal as D, isNegativeDecimal as z } from "../../utils/decimal.js";
6
+ import { useLocale as w, Link as S } from "react-aria-components";
7
+ import { useStrings as x } from "../../i18n/strings.js";
8
+ import { renamed as A } from "../../utils/vocabulary.js";
9
+ function U({ icon: n, tone: s = "accent", appearance: c, variant: i, size: t = "md", shape: r = "square", className: l }) {
10
+ const d = A("IconTile", "variant", i, "appearance", c) ?? "soft";
11
+ return /* @__PURE__ */ a("span", { className: o("alea-icon-tile", l), "data-tone": s, "data-variant": d, "data-size": t, "data-shape": r, "aria-hidden": "true", children: n });
11
12
  }
12
- function j({ holder: n, last4: l, kind: c, expiry: s, brand: i, frozen: r, tone: t = "accent", href: d, className: m }) {
13
- const h = w(), N = h.paymentCard(c, n, l, !!r);
13
+ function Z({ holder: n, last4: s, kind: c, expiry: i, brand: t, frozen: r, tone: l = "accent", href: d, className: m }) {
14
+ const h = x(), y = h.paymentCard(c, n, s, !!r);
14
15
  if (!d)
15
- return /* @__PURE__ */ e("div", { className: o("alea-payment-card", m), "data-tone": t, "data-frozen": r || void 0, role: "img", "aria-label": N, children: [
16
+ return /* @__PURE__ */ e("div", { className: o("alea-payment-card", m), "data-tone": l, "data-frozen": r || void 0, role: "img", "aria-label": y, children: [
16
17
  /* @__PURE__ */ e("span", { className: "alea-payment-card-top", "aria-hidden": "true", children: [
17
- /* @__PURE__ */ a("span", { className: "alea-payment-card-brand", children: i }),
18
+ /* @__PURE__ */ a("span", { className: "alea-payment-card-brand", children: t }),
18
19
  /* @__PURE__ */ a("span", { className: "alea-payment-card-kind", children: r ? /* @__PURE__ */ a(u, { size: 16 }) : c })
19
20
  ] }),
20
21
  /* @__PURE__ */ e("span", { className: "alea-payment-card-number", "aria-hidden": "true", children: [
21
22
  "•••• •••• •••• ",
22
- l
23
+ s
23
24
  ] }),
24
25
  /* @__PURE__ */ e("span", { className: "alea-payment-card-bottom", "aria-hidden": "true", children: [
25
26
  /* @__PURE__ */ a("span", { children: n }),
26
- s && /* @__PURE__ */ a("span", { children: s })
27
+ i && /* @__PURE__ */ a("span", { children: i })
27
28
  ] })
28
29
  ] });
29
30
  const p = h.paymentCardParts;
30
- return /* @__PURE__ */ e(g, { className: o("alea-payment-card alea-focus-ring", m), "data-tone": t, "data-frozen": r || void 0, href: d, children: [
31
+ return /* @__PURE__ */ e(S, { className: o("alea-payment-card alea-focus-ring", m), "data-tone": l, "data-frozen": r || void 0, href: d, children: [
31
32
  /* @__PURE__ */ e("span", { className: "alea-payment-card-top", children: [
32
- /* @__PURE__ */ a("span", { className: "alea-payment-card-brand", children: i }),
33
+ /* @__PURE__ */ a("span", { className: "alea-payment-card-brand", children: t }),
33
34
  /* @__PURE__ */ e("span", { className: "alea-payment-card-kind", children: [
34
- r ? /* @__PURE__ */ e(y, { children: [
35
+ r ? /* @__PURE__ */ e(N, { children: [
35
36
  /* @__PURE__ */ a(u, { size: 16, "aria-hidden": "true" }),
36
37
  /* @__PURE__ */ a("span", { className: "alea-visually-hidden", children: p.frozen })
37
38
  ] }) : c,
@@ -47,29 +48,29 @@ function j({ holder: n, last4: l, kind: c, expiry: s, brand: i, frozen: r, tone:
47
48
  p.ending,
48
49
  " "
49
50
  ] }),
50
- l
51
+ s
51
52
  ] }),
52
53
  /* @__PURE__ */ e("span", { className: "alea-payment-card-bottom", children: [
53
54
  /* @__PURE__ */ e("span", { children: [
54
55
  /* @__PURE__ */ a("span", { className: "alea-visually-hidden", children: ", " }),
55
56
  n
56
57
  ] }),
57
- s && /* @__PURE__ */ e("span", { children: [
58
+ i && /* @__PURE__ */ e("span", { children: [
58
59
  /* @__PURE__ */ a("span", { className: "alea-visually-hidden", children: ", " }),
59
- s
60
+ i
60
61
  ] })
61
62
  ] })
62
63
  ] });
63
64
  }
64
- function k({ value: n, currency: l = "USD", icon: c, colorIn: s = !0, formatOptions: i, className: r }) {
65
- const { locale: t } = b(), d = new Intl.NumberFormat(t, { style: "currency", currency: l, signDisplay: "exceptZero", ...i }).format(n), m = n > 0 ? "in" : n < 0 ? "out" : "zero";
66
- return /* @__PURE__ */ e("span", { className: o("alea-amount", r), "data-dir": m, "data-color": s || void 0, children: [
67
- c && m !== "zero" && /* @__PURE__ */ a("span", { className: "alea-amount-icon", "aria-hidden": "true", children: m === "in" ? /* @__PURE__ */ a(f, {}) : /* @__PURE__ */ a(v, {}) }),
65
+ function q({ value: n, currency: s = "USD", icon: c, colorIn: i = !0, formatOptions: t, className: r }) {
66
+ const { locale: l } = w(), d = v(n, l, { style: "currency", currency: s, signDisplay: "exceptZero", ...t }), m = typeof n == "string" ? !b(n) || D(n) ? "zero" : z(n) ? "out" : "in" : n > 0 ? "in" : n < 0 ? "out" : "zero";
67
+ return /* @__PURE__ */ e("span", { className: o("alea-amount", r), "data-dir": m, "data-color": i || void 0, children: [
68
+ c && m !== "zero" && /* @__PURE__ */ a("span", { className: "alea-amount-icon", "aria-hidden": "true", children: m === "in" ? /* @__PURE__ */ a(f, {}) : /* @__PURE__ */ a(g, {}) }),
68
69
  /* @__PURE__ */ a("span", { className: "alea-amount-value", children: d })
69
70
  ] });
70
71
  }
71
72
  export {
72
- k as Amount,
73
- S as IconTile,
74
- j as PaymentCard
73
+ q as Amount,
74
+ U as IconTile,
75
+ Z as PaymentCard
75
76
  };
@@ -131,9 +131,11 @@ export interface ToastProviderProps extends SurfaceProps {
131
131
  motion?: MotionProp;
132
132
  /** Toasts pile up behind the newest and fan out on hover or focus (the stack pattern). */
133
133
  stacked?: boolean;
134
+ /** Extra distance from the screen edge the toasts stack against, so they clear a bottom bar (BottomNavigation, a SaveBar) or a top bar: a number in px or any CSS length ("4rem", "calc(3.5rem + 1px)"). The device safe area (notch, home indicator) is always added on top of it. */
135
+ offset?: number | string;
134
136
  }
135
137
  /** Shows toasts anywhere below it; put it once near the root. */
136
- export declare function ToastProvider({ children, placement, motion, stacked, surface, radius }: ToastProviderProps): import("react").JSX.Element;
138
+ export declare function ToastProvider({ children, placement, motion, stacked, offset, surface, radius }: ToastProviderProps): import("react").JSX.Element;
137
139
  /** show({ title, tone, description, action, timeout }) and close(id). Needs a ToastProvider above. */
138
140
  export declare function useToast(): ToastApi;
139
141
  export {};
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsxs as x, jsx as a, Fragment as M } from "react/jsx-runtime";
2
+ import { jsxs as y, jsx as a, Fragment as M } from "react/jsx-runtime";
3
3
  import { forwardRef as D, useState as S, useRef as B, useCallback as k, useContext as F, createContext as R, useEffect as j } from "react";
4
4
  import { motionStyle as G } from "@alea-design/motion";
5
- import { Meter as O, Label as E, ProgressBar as I } from "react-aria-components";
6
- import { CircleAlert as V, TriangleAlert as W, CircleCheck as H, Info as A, X } from "lucide-react";
5
+ import { Meter as O, Label as E, ProgressBar as $ } from "react-aria-components";
6
+ import { CircleAlert as V, TriangleAlert as W, CircleCheck as H, Info as A, X as I } from "lucide-react";
7
7
  import { cx as w, withBase as C } from "../../utils/cx.js";
8
8
  import { alertIcon as z } from "../icon/icon-contexts.js";
9
- import { IconButton as $ } from "../button/Button.js";
9
+ import { IconButton as X } from "../button/Button.js";
10
10
  import { useStrings as T } from "../../i18n/strings.js";
11
11
  import { surfaceAttrs as U } from "../surface/Surface.js";
12
12
  import { Spinner as q } from "./Spinner.js";
@@ -14,157 +14,157 @@ import { DotField as J } from "../../utils/DotField.js";
14
14
  import { SkeletonBlueprint as K } from "../../utils/Blueprint.js";
15
15
  import { inertProps as Q } from "../../utils/inert.js";
16
16
  import { renamed as Y } from "../../utils/vocabulary.js";
17
- function ha({ label: e, showValue: r, size: p = "md", tone: m, striped: i, valuePosition: s = "top", description: f, className: c, ...n }) {
18
- const d = r ?? (!!e || s === "end");
19
- return /* @__PURE__ */ a(I, { ...n, className: C("alea-progress", c), "data-size": p, "data-tone": m, "data-striped": i || void 0, "data-value-position": s !== "top" ? s : void 0, children: ({ percentage: u, valueText: g, isIndeterminate: h }) => /* @__PURE__ */ x(M, { children: [
20
- (e || d && s === "top") && /* @__PURE__ */ x("div", { className: "alea-progress-head", children: [
17
+ function ga({ label: e, showValue: r, size: p = "md", tone: f, striped: l, valuePosition: n = "top", description: h, className: c, ...i }) {
18
+ const o = r ?? (!!e || n === "end");
19
+ return /* @__PURE__ */ a($, { ...i, className: C("alea-progress", c), "data-size": p, "data-tone": f, "data-striped": l || void 0, "data-value-position": n !== "top" ? n : void 0, children: ({ percentage: g, valueText: u, isIndeterminate: v }) => /* @__PURE__ */ y(M, { children: [
20
+ (e || o && n === "top") && /* @__PURE__ */ y("div", { className: "alea-progress-head", children: [
21
21
  e && /* @__PURE__ */ a(E, { className: "alea-label", children: e }),
22
- d && s === "top" && !h && /* @__PURE__ */ a("span", { className: "alea-progress-value", children: g })
22
+ o && n === "top" && !v && /* @__PURE__ */ a("span", { className: "alea-progress-value", children: u })
23
23
  ] }),
24
- /* @__PURE__ */ x("div", { className: "alea-progress-row", children: [
25
- /* @__PURE__ */ a("div", { className: "alea-progress-track", children: /* @__PURE__ */ a("div", { className: "alea-progress-fill", "data-indeterminate": h || void 0, style: h ? void 0 : { width: `${u}%` } }) }),
26
- d && s === "end" && !h && /* @__PURE__ */ a("span", { className: "alea-progress-value", children: g })
24
+ /* @__PURE__ */ y("div", { className: "alea-progress-row", children: [
25
+ /* @__PURE__ */ a("div", { className: "alea-progress-track", children: /* @__PURE__ */ a("div", { className: "alea-progress-fill", "data-indeterminate": v || void 0, style: v ? void 0 : { width: `${g}%` } }) }),
26
+ o && n === "end" && !v && /* @__PURE__ */ a("span", { className: "alea-progress-value", children: u })
27
27
  ] }),
28
- f && /* @__PURE__ */ a("span", { className: "alea-description", children: f })
28
+ h && /* @__PURE__ */ a("span", { className: "alea-description", children: h })
29
29
  ] }) });
30
30
  }
31
- function va({ size: e = "md", showValue: r, tone: p, thickness: m = 5, children: i, className: s, ...f }) {
32
- return /* @__PURE__ */ a(I, { ...f, className: C("alea-progress-circle", s), "data-size": e, "data-tone": p, children: ({ percentage: c = 0, valueText: n, isIndeterminate: d }) => {
33
- const u = 24 - m / 2 - 1, g = 2 * Math.PI * u;
34
- return /* @__PURE__ */ x(M, { children: [
35
- /* @__PURE__ */ x("svg", { viewBox: "0 0 48 48", "aria-hidden": "true", "data-indeterminate": d || void 0, children: [
36
- /* @__PURE__ */ a("circle", { cx: "24", cy: "24", r: u, fill: "none", stroke: "var(--alea-surface-raised)", strokeWidth: m }),
37
- /* @__PURE__ */ a("circle", { cx: "24", cy: "24", r: u, fill: "none", stroke: "var(--alea-progress-tone, var(--alea-accent))", strokeWidth: m, strokeLinecap: "round", strokeDasharray: g, strokeDashoffset: d ? g * 0.7 : g * (1 - c / 100), transform: "rotate(-90 24 24)", className: "alea-progress-circle-arc" })
31
+ function va({ size: e = "md", showValue: r, tone: p, thickness: f = 5, children: l, className: n, ...h }) {
32
+ return /* @__PURE__ */ a($, { ...h, className: C("alea-progress-circle", n), "data-size": e, "data-tone": p, children: ({ percentage: c = 0, valueText: i, isIndeterminate: o }) => {
33
+ const g = 24 - f / 2 - 1, u = 2 * Math.PI * g;
34
+ return /* @__PURE__ */ y(M, { children: [
35
+ /* @__PURE__ */ y("svg", { viewBox: "0 0 48 48", "aria-hidden": "true", "data-indeterminate": o || void 0, children: [
36
+ /* @__PURE__ */ a("circle", { cx: "24", cy: "24", r: g, fill: "none", stroke: "var(--alea-surface-raised)", strokeWidth: f }),
37
+ /* @__PURE__ */ a("circle", { cx: "24", cy: "24", r: g, fill: "none", stroke: "var(--alea-progress-tone, var(--alea-accent))", strokeWidth: f, strokeLinecap: "round", strokeDasharray: u, strokeDashoffset: o ? u * 0.7 : u * (1 - c / 100), transform: "rotate(-90 24 24)", className: "alea-progress-circle-arc" })
38
38
  ] }),
39
- i ? /* @__PURE__ */ a("span", { className: "alea-progress-circle-value", children: i }) : r && !d && /* @__PURE__ */ a("span", { className: "alea-progress-circle-value", children: n })
39
+ l ? /* @__PURE__ */ a("span", { className: "alea-progress-circle-value", children: l }) : r && !o && /* @__PURE__ */ a("span", { className: "alea-progress-circle-value", children: i })
40
40
  ] });
41
41
  } });
42
42
  }
43
- function Na({ label: e, showValue: r = !0, tone: p = "accent", className: m, ...i }) {
44
- return /* @__PURE__ */ a(O, { ...i, className: C("alea-progress alea-meter", m), children: ({ percentage: s, valueText: f }) => {
45
- const c = p === "auto" ? s > 90 ? "danger" : s > 70 ? "warning" : "success" : p;
46
- return /* @__PURE__ */ x(M, { children: [
47
- (e || r) && /* @__PURE__ */ x("div", { className: "alea-progress-head", children: [
43
+ function Na({ label: e, showValue: r = !0, tone: p = "accent", className: f, ...l }) {
44
+ return /* @__PURE__ */ a(O, { ...l, className: C("alea-progress alea-meter", f), children: ({ percentage: n, valueText: h }) => {
45
+ const c = p === "auto" ? n > 90 ? "danger" : n > 70 ? "warning" : "success" : p;
46
+ return /* @__PURE__ */ y(M, { children: [
47
+ (e || r) && /* @__PURE__ */ y("div", { className: "alea-progress-head", children: [
48
48
  e && /* @__PURE__ */ a(E, { className: "alea-label", children: e }),
49
- r && /* @__PURE__ */ a("span", { className: "alea-progress-value", children: f })
49
+ r && /* @__PURE__ */ a("span", { className: "alea-progress-value", children: h })
50
50
  ] }),
51
- /* @__PURE__ */ a("div", { className: "alea-progress-track", children: /* @__PURE__ */ a("div", { className: "alea-progress-fill", "data-tone": c, style: { width: `${s}%` } }) })
51
+ /* @__PURE__ */ a("div", { className: "alea-progress-track", children: /* @__PURE__ */ a("div", { className: "alea-progress-fill", "data-tone": c, style: { width: `${n}%` } }) })
52
52
  ] });
53
53
  } });
54
54
  }
55
- function xa({ shape: e = "text", width: r, height: p, lines: m = 1, isLoaded: i, animation: s, rows: f, cols: c, children: n, className: d, style: u, ...g }) {
56
- const h = T();
57
- if (s === "blueprint") return /* @__PURE__ */ a(K, { ...g, shape: e, width: r, height: p, rows: f, isLoaded: i, className: d, style: u, children: n });
58
- if (s === "matrix") {
59
- const N = n != null && n !== !1, { "aria-label": y, ...o } = g, t = f != null || c != null;
60
- return /* @__PURE__ */ x(
55
+ function xa({ shape: e = "text", width: r, height: p, lines: f = 1, isLoaded: l, animation: n, rows: h, cols: c, children: i, className: o, style: g, ...u }) {
56
+ const v = T();
57
+ if (n === "blueprint") return /* @__PURE__ */ a(K, { ...u, shape: e, width: r, height: p, rows: h, isLoaded: l, className: o, style: g, children: i });
58
+ if (n === "matrix") {
59
+ const N = i != null && i !== !1, { "aria-label": x, ...b } = u, t = h != null || c != null;
60
+ return /* @__PURE__ */ y(
61
61
  "span",
62
62
  {
63
- ...o,
64
- className: w("alea-skeleton-matrix", d),
63
+ ...b,
64
+ className: w("alea-skeleton-matrix", o),
65
65
  "data-shape": e,
66
- "data-state": i ? "loaded" : "loading",
66
+ "data-state": l ? "loaded" : "loading",
67
67
  "data-content": N || void 0,
68
68
  "data-sized": t || void 0,
69
- "aria-busy": !i,
70
- style: { width: r, ...N ? { minHeight: p } : { height: p ?? (e === "circle" ? r : void 0) }, ...c != null ? { "--alea-dots-cols": c } : null, ...f != null ? { "--alea-dots-rows": f } : null, ...u },
69
+ "aria-busy": !l,
70
+ style: { width: r, ...N ? { minHeight: p } : { height: p ?? (e === "circle" ? r : void 0) }, ...c != null ? { "--alea-dots-cols": c } : null, ...h != null ? { "--alea-dots-rows": h } : null, ...g },
71
71
  children: [
72
- /* @__PURE__ */ a(J, { rows: f, cols: c }),
73
- N && /* @__PURE__ */ a("span", { className: "alea-skeleton-matrix-content", ...Q(!i), children: n }),
74
- /* @__PURE__ */ a("span", { role: "status", className: "alea-visually-hidden", children: i ? "" : y ?? h.loading })
72
+ /* @__PURE__ */ a(J, { rows: h, cols: c }),
73
+ N && /* @__PURE__ */ a("span", { className: "alea-skeleton-matrix-content", ...Q(!l), children: i }),
74
+ /* @__PURE__ */ a("span", { role: "status", className: "alea-visually-hidden", children: l ? "" : x ?? v.loading })
75
75
  ]
76
76
  }
77
77
  );
78
78
  }
79
- return i ? /* @__PURE__ */ a("span", { className: "alea-skeleton-reveal", children: n }) : e === "text" && m > 1 ? /* @__PURE__ */ a("span", { className: w("alea-skeleton-lines", d), "aria-hidden": "true", children: Array.from({ length: m }, (N, y) => /* @__PURE__ */ a("span", { className: "alea-skeleton", "data-shape": "text", "data-animation": s, style: { width: y === m - 1 ? "60%" : r } }, y)) }) : /* @__PURE__ */ a("span", { ...g, "aria-hidden": "true", className: w("alea-skeleton", d), "data-shape": e, "data-animation": s, style: { width: r, height: p ?? (e === "circle" ? r : void 0), ...u } });
79
+ return l ? /* @__PURE__ */ a("span", { className: "alea-skeleton-reveal", children: i }) : e === "text" && f > 1 ? /* @__PURE__ */ a("span", { className: w("alea-skeleton-lines", o), "aria-hidden": "true", children: Array.from({ length: f }, (N, x) => /* @__PURE__ */ a("span", { className: "alea-skeleton", "data-shape": "text", "data-animation": n, style: { width: x === f - 1 ? "60%" : r } }, x)) }) : /* @__PURE__ */ a("span", { ...u, "aria-hidden": "true", className: w("alea-skeleton", o), "data-shape": e, "data-animation": n, style: { width: r, height: p ?? (e === "circle" ? r : void 0), ...g } });
80
80
  }
81
- const L = { neutral: A, accent: A, info: A, success: H, warning: W, danger: V }, ya = D(function({ tone: r = "info", title: p, children: m, actions: i, onDismiss: s, live: f, hideIcon: c, icon: n, appearance: d, variant: u, size: g, className: h, ...N }, y) {
82
- const o = T(), t = Y("Alert", "variant", u, "appearance", d) ?? "soft", l = L[r];
83
- return /* @__PURE__ */ x("div", { ref: y, ...N, className: w("alea-alert", h), "data-tone": r, "data-variant": t !== "soft" ? t : void 0, "data-size": g, role: f ? r === "danger" ? "alert" : "status" : N.role, children: [
84
- !c && (n ? /* @__PURE__ */ a("span", { className: "alea-alert-icon", "aria-hidden": "true", ...z(r, t === "solid"), children: n }) : /* @__PURE__ */ a(l, { className: "alea-alert-icon", size: g === "sm" ? 16 : 20, "aria-hidden": "true", ...z(r, t === "solid") })),
85
- /* @__PURE__ */ x("div", { className: "alea-alert-body", children: [
81
+ const L = { neutral: A, accent: A, info: A, success: H, warning: W, danger: V }, ya = D(function({ tone: r = "info", title: p, children: f, actions: l, onDismiss: n, live: h, hideIcon: c, icon: i, appearance: o, variant: g, size: u, className: v, ...N }, x) {
82
+ const b = T(), t = Y("Alert", "variant", g, "appearance", o) ?? "soft", s = L[r];
83
+ return /* @__PURE__ */ y("div", { ref: x, ...N, className: w("alea-alert", v), "data-tone": r, "data-variant": t !== "soft" ? t : void 0, "data-size": u, role: h ? r === "danger" ? "alert" : "status" : N.role, children: [
84
+ !c && (i ? /* @__PURE__ */ a("span", { className: "alea-alert-icon", "aria-hidden": "true", ...z(r, t === "solid"), children: i }) : /* @__PURE__ */ a(s, { className: "alea-alert-icon", size: u === "sm" ? 16 : 20, "aria-hidden": "true", ...z(r, t === "solid") })),
85
+ /* @__PURE__ */ y("div", { className: "alea-alert-body", children: [
86
86
  p && /* @__PURE__ */ a("p", { className: "alea-alert-title", children: p }),
87
- m && /* @__PURE__ */ a("div", { className: "alea-alert-text", children: m })
87
+ f && /* @__PURE__ */ a("div", { className: "alea-alert-text", children: f })
88
88
  ] }),
89
- i && /* @__PURE__ */ a("div", { className: "alea-alert-actions", children: i }),
90
- s && /* @__PURE__ */ a($, { "aria-label": o.dismiss, size: "sm", variant: "ghost", onPress: s, className: "alea-alert-x", children: /* @__PURE__ */ a(X, {}) })
89
+ l && /* @__PURE__ */ a("div", { className: "alea-alert-actions", children: l }),
90
+ n && /* @__PURE__ */ a(X, { "aria-label": b.dismiss, size: "sm", variant: "ghost", onPress: n, className: "alea-alert-x", children: /* @__PURE__ */ a(I, {}) })
91
91
  ] });
92
92
  }), Z = 600, _ = R(null);
93
- function ba({ children: e, placement: r = "bottom-end", motion: p, stacked: m, surface: i, radius: s }) {
94
- const f = T(), [c, n] = S([]), d = B(1), u = k((o) => n((t) => t.filter((l) => l.id !== o)), []), g = k((o) => {
95
- n((t) => t.map((l) => l.id === o ? { ...l, exiting: !0 } : l)), setTimeout(() => u(o), Z);
96
- }, [u]), h = k((o) => {
97
- const t = d.current++;
98
- return n((l) => [...l.slice(-4), { ...o, id: t }]), t;
99
- }, []), N = k((o, t) => n((l) => l.map((v) => v.id === o ? { ...v, ...t, version: (v.version ?? 0) + 1 } : v)), []), y = k((o, t) => {
100
- const l = h({ title: t.loading, isLoading: !0, tone: "neutral" });
101
- return o.then(
102
- (v) => N(l, { title: typeof t.success == "function" ? t.success(v) : t.success, tone: "success", isLoading: !1 }),
103
- (v) => N(l, { title: typeof t.error == "function" ? t.error(v) : t.error, tone: "danger", isLoading: !1 })
104
- ), o;
105
- }, [h, N]);
106
- return /* @__PURE__ */ x(_.Provider, { value: { show: h, close: g, update: N, promise: y }, children: [
93
+ function ba({ children: e, placement: r = "bottom-end", motion: p, stacked: f, offset: l, surface: n, radius: h }) {
94
+ const c = T(), [i, o] = S([]), g = B(1), u = k((t) => o((s) => s.filter((d) => d.id !== t)), []), v = k((t) => {
95
+ o((s) => s.map((d) => d.id === t ? { ...d, exiting: !0 } : d)), setTimeout(() => u(t), Z);
96
+ }, [u]), N = k((t) => {
97
+ const s = g.current++;
98
+ return o((d) => [...d.slice(-4), { ...t, id: s }]), s;
99
+ }, []), x = k((t, s) => o((d) => d.map((m) => m.id === t ? { ...m, ...s, version: (m.version ?? 0) + 1 } : m)), []), b = k((t, s) => {
100
+ const d = N({ title: s.loading, isLoading: !0, tone: "neutral" });
101
+ return t.then(
102
+ (m) => x(d, { title: typeof s.success == "function" ? s.success(m) : s.success, tone: "success", isLoading: !1 }),
103
+ (m) => x(d, { title: typeof s.error == "function" ? s.error(m) : s.error, tone: "danger", isLoading: !1 })
104
+ ), t;
105
+ }, [N, x]);
106
+ return /* @__PURE__ */ y(_.Provider, { value: { show: N, close: v, update: x, promise: b }, children: [
107
107
  e,
108
- /* @__PURE__ */ a("section", { className: "alea-toast-region", "data-placement": r, "data-stacked": m || void 0, "aria-label": f.notifications, tabIndex: -1, children: /* @__PURE__ */ a("ol", { children: c.map((o) => /* @__PURE__ */ a(aa, { item: o, motion: p, surface: i, radius: s, onClose: () => g(o.id), onExited: () => u(o.id) }, o.id)) }) })
108
+ /* @__PURE__ */ a("section", { className: "alea-toast-region", hidden: i.length === 0, "data-placement": r, "data-stacked": f || void 0, style: l === void 0 ? void 0 : { "--alea-toast-offset": typeof l == "number" ? `${l / 16}rem` : l }, "aria-label": c.notifications, tabIndex: -1, children: /* @__PURE__ */ a("div", { className: "alea-toast-list", children: i.map((t) => /* @__PURE__ */ a(aa, { item: t, motion: p, surface: n, radius: h, onClose: () => v(t.id), onExited: () => u(t.id) }, t.id)) }) })
109
109
  ] });
110
110
  }
111
- function aa({ item: e, onClose: r, onExited: p, motion: m, surface: i, radius: s }) {
112
- const f = T(), c = e.tone || "neutral", n = e.isLoading ? 0 : e.timeout ?? (c === "danger" ? 0 : 5e3), [d, u] = S(!1);
111
+ function aa({ item: e, onClose: r, onExited: p, motion: f, surface: l, radius: n }) {
112
+ const h = T(), c = e.tone || "neutral", i = e.isLoading ? 0 : e.timeout ?? (c === "danger" ? 0 : 5e3), [o, g] = S(!1);
113
113
  j(() => {
114
- if (!n || d) return;
115
- const t = setTimeout(r, n);
114
+ if (!i || o) return;
115
+ const t = setTimeout(r, i);
116
116
  return () => clearTimeout(t);
117
- }, [n, d, r, e.version]);
118
- const g = L[c], h = B(null), N = (t) => {
119
- t.button !== 0 || t.target.closest("button, a") || (h.current = { x: t.clientX, t: performance.now(), id: t.pointerId });
120
- }, y = (t) => {
117
+ }, [i, o, r, e.version]);
118
+ const u = L[c], v = B(null), N = (t) => {
119
+ t.button !== 0 || t.target.closest("button, a") || (v.current = { x: t.clientX, t: performance.now(), id: t.pointerId });
120
+ }, x = (t) => {
121
121
  var P;
122
- const l = h.current;
123
- if (!l || l.id !== t.pointerId) return;
124
- const v = t.clientX - l.x;
125
- if (Math.abs(v) < 4) return;
126
- const b = t.currentTarget;
127
- b.setAttribute("data-swiping", ""), (P = b.setPointerCapture) == null || P.call(b, t.pointerId), b.style.setProperty("--alea-swipe-x", `${v}px`), b.style.setProperty("--alea-swipe-n", String(v / 160));
128
- }, o = (t) => {
129
- const l = h.current;
130
- if (h.current = null, !l) return;
131
- const v = t.currentTarget, b = t.clientX - l.x, P = Math.abs(b) / Math.max(1, performance.now() - l.t) > 0.6;
132
- v.removeAttribute("data-swiping"), Math.abs(b) > 80 || P && Math.abs(b) > 24 ? r() : (v.style.removeProperty("--alea-swipe-x"), v.style.removeProperty("--alea-swipe-n"));
122
+ const s = v.current;
123
+ if (!s || s.id !== t.pointerId) return;
124
+ const d = t.clientX - s.x;
125
+ if (Math.abs(d) < 4) return;
126
+ const m = t.currentTarget;
127
+ m.setAttribute("data-swiping", ""), (P = m.setPointerCapture) == null || P.call(m, t.pointerId), m.style.setProperty("--alea-swipe-x", `${d}px`), m.style.setProperty("--alea-swipe-n", String(d / 160));
128
+ }, b = (t) => {
129
+ const s = v.current;
130
+ if (v.current = null, !s) return;
131
+ const d = t.currentTarget, m = t.clientX - s.x, P = Math.abs(m) / Math.max(1, performance.now() - s.t) > 0.6;
132
+ d.removeAttribute("data-swiping"), Math.abs(m) > 80 || P && Math.abs(m) > 24 ? r() : (d.style.removeProperty("--alea-swipe-x"), d.style.removeProperty("--alea-swipe-n"));
133
133
  };
134
- return /* @__PURE__ */ x(
135
- "li",
134
+ return /* @__PURE__ */ y(
135
+ "div",
136
136
  {
137
137
  className: "alea-toast",
138
- ...U({ surface: i, radius: s }),
138
+ ...U({ surface: l, radius: n }),
139
139
  "data-tone": c,
140
140
  "data-exiting": e.exiting || void 0,
141
- "data-paused": d || void 0,
141
+ "data-paused": o || void 0,
142
142
  role: c === "danger" ? "alert" : "status",
143
143
  "aria-atomic": "true",
144
144
  "aria-busy": e.isLoading || void 0,
145
- style: { ...G(m), "--alea-toast-ms": `${n}ms` },
145
+ style: { ...G(f), "--alea-toast-ms": `${i}ms` },
146
146
  onAnimationEnd: (t) => {
147
147
  e.exiting && t.target === t.currentTarget && p();
148
148
  },
149
149
  onPointerDown: N,
150
- onPointerMove: y,
151
- onPointerUp: o,
152
- onPointerCancel: o,
153
- onMouseEnter: () => u(!0),
154
- onMouseLeave: () => u(!1),
155
- onFocus: () => u(!0),
156
- onBlur: () => u(!1),
150
+ onPointerMove: x,
151
+ onPointerUp: b,
152
+ onPointerCancel: b,
153
+ onMouseEnter: () => g(!0),
154
+ onMouseLeave: () => g(!1),
155
+ onFocus: () => g(!0),
156
+ onBlur: () => g(!1),
157
157
  children: [
158
- e.isLoading ? /* @__PURE__ */ a("span", { className: "alea-alert-icon", children: /* @__PURE__ */ a(q, { size: "sm", "aria-label": "" }) }) : e.icon ? /* @__PURE__ */ a("span", { className: "alea-alert-icon", "aria-hidden": "true", children: e.icon }) : /* @__PURE__ */ a(g, { className: "alea-alert-icon", size: 18, "aria-hidden": "true" }, c),
159
- e.showProgress && n > 0 && /* @__PURE__ */ a("span", { className: "alea-toast-progress", "aria-hidden": "true" }, e.version),
160
- /* @__PURE__ */ x("div", { className: "alea-alert-body", children: [
158
+ e.isLoading ? /* @__PURE__ */ a("span", { className: "alea-alert-icon", children: /* @__PURE__ */ a(q, { size: "sm", "aria-label": "" }) }) : e.icon ? /* @__PURE__ */ a("span", { className: "alea-alert-icon", "aria-hidden": "true", children: e.icon }) : /* @__PURE__ */ a(u, { className: "alea-alert-icon", size: 18, "aria-hidden": "true" }, c),
159
+ e.showProgress && i > 0 && /* @__PURE__ */ a("span", { className: "alea-toast-progress", "aria-hidden": "true" }, e.version),
160
+ /* @__PURE__ */ y("div", { className: "alea-alert-body", children: [
161
161
  /* @__PURE__ */ a("p", { className: "alea-alert-title", children: e.title }),
162
162
  e.description && /* @__PURE__ */ a("div", { className: "alea-alert-text", children: e.description })
163
163
  ] }),
164
164
  e.action && /* @__PURE__ */ a("button", { type: "button", className: "alea-toast-action alea-focus-ring", onClick: () => {
165
165
  e.action.onAction(), r();
166
166
  }, children: e.action.label }),
167
- /* @__PURE__ */ a($, { "aria-label": f.closeNotification, size: "sm", variant: "ghost", onPress: r, className: "alea-alert-x", children: /* @__PURE__ */ a(X, {}) })
167
+ /* @__PURE__ */ a(X, { "aria-label": h.closeNotification, size: "sm", variant: "ghost", onPress: r, className: "alea-alert-x", children: /* @__PURE__ */ a(I, {}) })
168
168
  ]
169
169
  }
170
170
  );
@@ -177,7 +177,7 @@ function ka() {
177
177
  export {
178
178
  ya as Alert,
179
179
  Na as Meter,
180
- ha as ProgressBar,
180
+ ga as ProgressBar,
181
181
  va as ProgressCircle,
182
182
  xa as Skeleton,
183
183
  ba as ToastProvider,
@@ -0,0 +1,19 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export interface PageSkeletonProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ /** The shape of the page it stands for: cards (a grid of cards), table (a header row and rows), list (rows with a round picture), detail (a title, a picture and text blocks) or form (labelled fields and a button). Default cards. */
4
+ variant?: 'cards' | 'table' | 'list' | 'detail' | 'form';
5
+ /** Shows a title and a line under it before the body. Default true. */
6
+ header?: boolean;
7
+ /** How many cards, rows or fields. Default 6 for cards, 5 for the rest. */
8
+ count?: number;
9
+ /** The loading animation of every part: shimmer (default), pulse or none. */
10
+ animation?: 'shimmer' | 'pulse' | 'none';
11
+ /** The accessible name of the loading region. Default "Loading". */
12
+ 'aria-label'?: string;
13
+ /** Once true, the real page (children) takes its place with the reveal pattern (blur in), and the skeleton is gone. Leave it out when you use the skeleton as a Suspense fallback. */
14
+ isLoaded?: boolean;
15
+ /** The real page. */
16
+ children?: ReactNode;
17
+ }
18
+ /** A skeleton for a whole page, built from Skeleton parts: pick the layout closest to the page and use it as the fallback of a lazy route, or wrap the page with isLoaded so it reveals itself. Announces "Loading" once; the parts are hidden from screen readers. */
19
+ export declare function PageSkeleton({ variant, header, count, animation, 'aria-label': label, isLoaded, children, className, ...props }: PageSkeletonProps): import("react").JSX.Element;