@alea-design/ui 0.3.1 → 0.5.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.
@@ -1,54 +1,65 @@
1
1
  "use client";
2
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
3
- import { forwardRef as A, useState as C, useEffect as D, useMemo as h } from "react";
4
- import { cx as F } from "../../utils/cx.js";
5
- import { useFilter as I, Autocomplete as L, SearchField as g, Input as z, Menu as R, MenuSection as H, Header as V, Collection as q, MenuItem as B, Keyboard as G } from "react-aria-components";
6
- import { Search as J } from "lucide-react";
7
- import { DialogModal as Q, Dialog as U } from "../overlay/Overlay.js";
8
- import { Kbd as W } from "../typography/Typography.js";
9
- import { useStrings as X } from "../../i18n/strings.js";
10
- const oe = A(function({ commands: s, isOpen: c, defaultOpen: f, onOpenChange: l, motion: N, hotkey: w = !0, placeholder: m, emptyText: d, className: y, style: b, surface: v, radius: M }, S) {
11
- const i = X();
12
- m ?? (m = i.commandPlaceholder), d ?? (d = i.noResults);
13
- const [k, x] = C(f ?? !1), u = c ?? k, p = (a) => {
14
- c === void 0 && x(a), l == null || l(a);
2
+ import { jsx as n, jsxs as l } from "react/jsx-runtime";
3
+ import { forwardRef as L, useState as w, useEffect as y, useMemo as v, useRef as P } from "react";
4
+ import { cx as j } from "../../utils/cx.js";
5
+ import { useFilter as A, Autocomplete as D, SearchField as F, Input as H, Menu as O, MenuSection as V, Header as q, Collection as B, MenuItem as G, Keyboard as J } from "react-aria-components";
6
+ import { Search as Q } from "lucide-react";
7
+ import { DialogModal as U, Dialog as W } from "../overlay/Overlay.js";
8
+ import { Kbd as X } from "../typography/Typography.js";
9
+ import { useStrings as Y } from "../../i18n/strings.js";
10
+ function Z({ children: f }) {
11
+ const o = P(null), [c, m] = w(!1);
12
+ return y(() => {
13
+ const i = o.current;
14
+ if (!i) return;
15
+ const d = () => m(i.scrollHeight > i.clientHeight + 1);
16
+ if (d(), typeof ResizeObserver > "u") return;
17
+ const a = new ResizeObserver(d);
18
+ return a.observe(i), i.firstElementChild && a.observe(i.firstElementChild), () => a.disconnect();
19
+ }, []), /* @__PURE__ */ n("div", { ref: o, className: "alea-command-scroll", tabIndex: c ? 0 : void 0, children: f });
20
+ }
21
+ const oe = L(function({ commands: o, isOpen: c, defaultOpen: m, onOpenChange: i, motion: d, hotkey: a = !0, placeholder: h, emptyText: p, className: S, style: k, surface: x, radius: E }, M) {
22
+ const r = Y();
23
+ h ?? (h = r.commandPlaceholder), p ?? (p = r.noResults);
24
+ const [g, C] = w(m ?? !1), b = c ?? g, N = (s) => {
25
+ c === void 0 && C(s), i == null || i(s);
15
26
  };
16
- D(() => {
17
- if (!w) return;
18
- const a = (t) => {
19
- t.key.toLowerCase() === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(), p(!u));
27
+ y(() => {
28
+ if (!a) return;
29
+ const s = (t) => {
30
+ t.key.toLowerCase() === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(), N(!b));
20
31
  };
21
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
32
+ return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
22
33
  });
23
- const { contains: E } = I({ sensitivity: "base" }), K = h(() => {
24
- const a = [];
25
- for (const t of s) {
34
+ const { contains: R } = A({ sensitivity: "base" }), z = v(() => {
35
+ const s = [];
36
+ for (const t of o) {
26
37
  const e = t.group || "";
27
- let r = a.find((j) => j.id === e);
28
- r || a.push(r = { id: e, title: e, items: [] }), r.items.push(t);
38
+ let u = s.find((K) => K.id === e);
39
+ u || s.push(u = { id: e, title: e, items: [] }), u.items.push(t);
29
40
  }
30
- return a;
31
- }, [s]), P = h(() => new Map(s.map((a) => [a.id, a])), [s]);
32
- return /* @__PURE__ */ o(Q, { isOpen: u, onOpenChange: p, size: "md", className: "alea-command-overlay", motion: N, surface: v, radius: M, children: /* @__PURE__ */ o(U, { ref: S, style: b, "aria-label": i.commandPalette, hideClose: !0, className: F("alea-command", y), children: ({ close: a }) => /* @__PURE__ */ n(L, { filter: (t, e) => E(t, e), children: [
33
- /* @__PURE__ */ n(g, { "aria-label": i.searchCommands, autoFocus: !0, className: "alea-command-search", children: [
34
- /* @__PURE__ */ o(J, { size: 18, "aria-hidden": "true" }),
35
- /* @__PURE__ */ o(z, { placeholder: m, className: "alea-command-input" }),
36
- /* @__PURE__ */ o(W, { children: i.esc })
41
+ return s;
42
+ }, [o]), I = v(() => new Map(o.map((s) => [s.id, s])), [o]);
43
+ return /* @__PURE__ */ n(U, { isOpen: b, onOpenChange: N, size: "md", className: "alea-command-overlay", motion: d, surface: x, radius: E, children: /* @__PURE__ */ n(W, { ref: M, style: k, "aria-label": r.commandPalette, hideClose: !0, className: j("alea-command", S), children: ({ close: s }) => /* @__PURE__ */ l(D, { filter: (t, e) => R(t, e), children: [
44
+ /* @__PURE__ */ l(F, { "aria-label": r.searchCommands, autoFocus: !0, className: "alea-command-search", children: [
45
+ /* @__PURE__ */ n(Q, { size: 18, "aria-hidden": "true" }),
46
+ /* @__PURE__ */ n(H, { placeholder: h, className: "alea-command-input" }),
47
+ /* @__PURE__ */ n(X, { children: r.esc })
37
48
  ] }),
38
- /* @__PURE__ */ o(R, { items: K, className: "alea-command-list", onAction: (t) => {
39
- const e = P.get(t);
40
- a(), e == null || e.onAction();
41
- }, renderEmptyState: () => /* @__PURE__ */ o("p", { className: "alea-command-empty", children: d }), children: (t) => /* @__PURE__ */ n(H, { id: t.id, className: "alea-option-section", children: [
42
- t.title && /* @__PURE__ */ o(V, { className: "alea-option-header", children: t.title }),
43
- /* @__PURE__ */ o(q, { items: t.items, children: (e) => /* @__PURE__ */ n(B, { id: e.id, textValue: [e.label, ...e.keywords || []].join(" "), className: "alea-option alea-command-item", children: [
44
- e.icon && /* @__PURE__ */ o("span", { className: "alea-option-icon", "aria-hidden": "true", children: e.icon }),
45
- /* @__PURE__ */ n("span", { className: "alea-option-text", children: [
46
- /* @__PURE__ */ o("span", { slot: "label", children: e.label }),
47
- e.description && /* @__PURE__ */ o("span", { className: "alea-option-desc", slot: "description", children: e.description })
49
+ /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(O, { items: z, className: "alea-command-list", onAction: (t) => {
50
+ const e = I.get(t);
51
+ s(), e == null || e.onAction();
52
+ }, renderEmptyState: () => /* @__PURE__ */ n("p", { className: "alea-command-empty", children: p }), children: (t) => /* @__PURE__ */ l(V, { id: t.id, className: "alea-option-section", children: [
53
+ t.title && /* @__PURE__ */ n(q, { className: "alea-option-header", children: t.title }),
54
+ /* @__PURE__ */ n(B, { items: t.items, children: (e) => /* @__PURE__ */ l(G, { id: e.id, textValue: [e.label, ...e.keywords || []].join(" "), className: "alea-option alea-command-item", children: [
55
+ e.icon && /* @__PURE__ */ n("span", { className: "alea-option-icon", "aria-hidden": "true", children: e.icon }),
56
+ /* @__PURE__ */ l("span", { className: "alea-option-text", children: [
57
+ /* @__PURE__ */ n("span", { slot: "label", children: e.label }),
58
+ e.description && /* @__PURE__ */ n("span", { className: "alea-option-desc", slot: "description", children: e.description })
48
59
  ] }),
49
- e.shortcut && /* @__PURE__ */ o(G, { className: "alea-menu-shortcut", children: e.shortcut })
60
+ e.shortcut && /* @__PURE__ */ n(J, { className: "alea-menu-shortcut", children: e.shortcut })
50
61
  ] }) })
51
- ] }) })
62
+ ] }) }) })
52
63
  ] }) }) });
53
64
  });
54
65
  export {
@@ -58,9 +58,15 @@ export interface TextFieldProps extends Omit<RACTextFieldProps, 'children'>, Fie
58
58
  showCount?: boolean;
59
59
  /** Shows a spinner at the end of the text, for a value being checked or looked up. It takes no room, the field stays editable, and screen readers hear it as busy. */
60
60
  isLoading?: boolean;
61
+ /** For type date, time, number and similar: the lowest value allowed (a yyyy-mm-dd date, an hh:mm time, a number). */
62
+ min?: string | number;
63
+ /** For type date, time, number and similar: the highest value allowed. */
64
+ max?: string | number;
65
+ /** For type number, date and time: the step between values (seconds for time). */
66
+ step?: string | number;
61
67
  }
62
68
  /** A single-line text input: label (top or side), help, warning and error, prefix and suffix, addons, a clear button, a character count, four variants and five sizes. */
63
- export declare function TextField({ label, description, errorMessage, warningMessage, showOptional, size, variant, labelPosition, placeholder, prefix, suffix, addonStart, addonEnd, isClearable, showCount, isLoading, className, value, defaultValue, onChange, ...props }: TextFieldProps): import("react").JSX.Element;
69
+ export declare function TextField({ label, description, errorMessage, warningMessage, showOptional, size, variant, labelPosition, placeholder, prefix, suffix, addonStart, addonEnd, isClearable, showCount, isLoading, min, max, step, className, value, defaultValue, onChange, ...props }: TextFieldProps): import("react").JSX.Element;
64
70
  export interface TextAreaProps extends Omit<RACTextFieldProps, 'children'>, FieldBits {
65
71
  /** An example of what to type. */
66
72
  placeholder?: string;
@@ -1,33 +1,33 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as r, Fragment as P } from "react/jsx-runtime";
3
- import { useState as j, useRef as O } from "react";
4
- import { Text as U, FieldError as X, Group as Z, Label as H, NumberField as J, Button as g, Input as C, SearchField as K, TextField as G, TextArea as Q } from "react-aria-components";
5
- import { Minus as W, Plus as Y, ChevronUp as _, ChevronDown as M, EyeOff as ee, Eye as ae, Search as le, X as L } from "lucide-react";
6
- import { cx as S, withBase as $ } from "../../utils/cx.js";
2
+ import { jsx as e, jsxs as r, Fragment as j } from "react/jsx-runtime";
3
+ import { useState as O, useRef as Z } from "react";
4
+ import { Text as J, FieldError as K, Group as G, Label as Q, NumberField as W, Button as F, Input as k, SearchField as Y, TextField as L, TextArea as _ } from "react-aria-components";
5
+ import { Minus as M, Plus as ee, ChevronUp as ae, ChevronDown as le, EyeOff as ie, Eye as se, Search as te, X as U } from "lucide-react";
6
+ import { cx as $, withBase as A } from "../../utils/cx.js";
7
7
  import { useStrings as y } from "../../i18n/strings.js";
8
- import { useControlled as k } from "../../utils/controlled.js";
9
- import { responsiveAttrs as ie } from "../../utils/responsive.js";
10
- import { Spinner as se } from "../feedback/Spinner.js";
11
- import { FieldSpinner as B, loadingAttrs as te } from "./FieldLoading.js";
12
- function re({ className: a, ...l }) {
13
- return /* @__PURE__ */ e(H, { ...l, className: S("alea-label", a) });
8
+ import { useControlled as B } from "../../utils/controlled.js";
9
+ import { responsiveAttrs as re } from "../../utils/responsive.js";
10
+ import { Spinner as ne } from "../feedback/Spinner.js";
11
+ import { FieldSpinner as D, loadingAttrs as ce } from "./FieldLoading.js";
12
+ function de({ className: a, ...l }) {
13
+ return /* @__PURE__ */ e(Q, { ...l, className: $("alea-label", a) });
14
14
  }
15
- function ne({ className: a, ...l }) {
16
- return /* @__PURE__ */ e(U, { ...l, slot: "description", className: S("alea-description", a) });
15
+ function ue({ className: a, ...l }) {
16
+ return /* @__PURE__ */ e(J, { ...l, slot: "description", className: $("alea-description", a) });
17
17
  }
18
- function ce({ className: a, ...l }) {
19
- return /* @__PURE__ */ e(X, { ...l, className: S("alea-field-error", a) });
18
+ function oe({ className: a, ...l }) {
19
+ return /* @__PURE__ */ e(K, { ...l, className: $("alea-field-error", a) });
20
20
  }
21
- const A = (a, l, s, i, d) => ({
22
- ...ie("size", a, "md"),
21
+ const R = (a, l, s, i, d) => ({
22
+ ...re("size", a, "md"),
23
23
  "data-variant": l !== "outline" ? l : void 0,
24
24
  "data-label-position": s !== "top" ? s : void 0,
25
25
  "data-warning": i ? !0 : void 0,
26
- ...te(d)
26
+ ...ce(d)
27
27
  });
28
- function R({ label: a, showOptional: l, isRequired: s }) {
28
+ function q({ label: a, showOptional: l, isRequired: s }) {
29
29
  const i = y();
30
- return a ? /* @__PURE__ */ r(re, { children: [
30
+ return a ? /* @__PURE__ */ r(de, { children: [
31
31
  a,
32
32
  s && /* @__PURE__ */ e("span", { className: "alea-label-required", "aria-hidden": "true", children: " *" }),
33
33
  l && !s && /* @__PURE__ */ r("span", { className: "alea-label-optional", children: [
@@ -37,46 +37,46 @@ function R({ label: a, showOptional: l, isRequired: s }) {
37
37
  ] })
38
38
  ] }) : null;
39
39
  }
40
- function q({ description: a, errorMessage: l, warningMessage: s, count: i }) {
40
+ function E({ description: a, errorMessage: l, warningMessage: s, count: i }) {
41
41
  const d = y(), n = (i == null ? void 0 : i.max) != null ? i.max - i.n : void 0;
42
- return /* @__PURE__ */ r(P, { children: [
43
- (a || s) && /* @__PURE__ */ r(ne, { children: [
42
+ return /* @__PURE__ */ r(j, { children: [
43
+ (a || s) && /* @__PURE__ */ r(ue, { children: [
44
44
  a,
45
45
  s && /* @__PURE__ */ e("span", { className: "alea-field-warning", children: s })
46
46
  ] }),
47
- /* @__PURE__ */ e(ce, { children: l }),
47
+ /* @__PURE__ */ e(oe, { children: l }),
48
48
  i && /* @__PURE__ */ r("span", { className: "alea-field-count", "data-over": n != null && n < 0 ? !0 : void 0, children: [
49
49
  /* @__PURE__ */ e("span", { "aria-hidden": "true", children: i.max != null ? `${i.n} / ${i.max}` : i.n }),
50
50
  /* @__PURE__ */ e("span", { className: "alea-visually-hidden", "aria-live": "polite", children: n != null && n <= 10 ? n < 0 ? d.overLimit(-n) : d.charactersLeft(n) : "" })
51
51
  ] })
52
52
  ] });
53
53
  }
54
- function de({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, prefix: t, suffix: c, addonStart: m, addonEnd: p, isClearable: o, showCount: h, isLoading: f, className: b, value: w, defaultValue: z, onChange: N, ...F }) {
55
- const E = y(), [T, D] = k(w, z ?? "", N), V = O(null);
56
- return /* @__PURE__ */ r(G, { ...F, value: T, onChange: D, className: $("alea-field", b), ...A(n, v, x, i, f), children: [
57
- /* @__PURE__ */ e(R, { label: a, showOptional: d, isRequired: F.isRequired }),
54
+ function me({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, prefix: t, suffix: c, addonStart: m, addonEnd: p, isClearable: o, showCount: h, isLoading: f, min: b, max: g, step: z, className: N, value: S, defaultValue: T, onChange: X, ...w }) {
55
+ const H = y(), [C, V] = B(S, T ?? "", X), I = Z(null);
56
+ return /* @__PURE__ */ r(L, { ...w, value: C, onChange: V, className: A("alea-field", N), ...R(n, v, x, i, f), children: [
57
+ /* @__PURE__ */ e(q, { label: a, showOptional: d, isRequired: w.isRequired }),
58
58
  /* @__PURE__ */ r("div", { className: "alea-input-wrap", children: [
59
59
  m && /* @__PURE__ */ e("span", { className: "alea-input-addon", "data-side": "start", children: m }),
60
60
  t && /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "start", children: t }),
61
- /* @__PURE__ */ e(C, { ref: V, className: "alea-input", placeholder: u, "aria-busy": f || void 0 }),
62
- f && /* @__PURE__ */ e(B, {}),
63
- o && T && !F.isDisabled && !F.isReadOnly && /* @__PURE__ */ e(g, { className: "alea-input-clear alea-focus-ring", "aria-label": E.clear, onPress: () => {
64
- var I;
65
- D(""), (I = V.current) == null || I.focus();
66
- }, children: /* @__PURE__ */ e(L, { size: 14 }) }),
61
+ /* @__PURE__ */ e(k, { ref: I, className: "alea-input", placeholder: u, min: b, max: g, step: z, "aria-busy": f || void 0 }),
62
+ f && /* @__PURE__ */ e(D, {}),
63
+ o && C && !w.isDisabled && !w.isReadOnly && /* @__PURE__ */ e(F, { className: "alea-input-clear alea-focus-ring", "aria-label": H.clear, onPress: () => {
64
+ var P;
65
+ V(""), (P = I.current) == null || P.focus();
66
+ }, children: /* @__PURE__ */ e(U, { size: 14 }) }),
67
67
  c && /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "end", children: c }),
68
68
  p && /* @__PURE__ */ e("span", { className: "alea-input-addon", "data-side": "end", children: p })
69
69
  ] }),
70
- /* @__PURE__ */ e(q, { description: l, errorMessage: s, warningMessage: i, count: h ? { n: T.length, max: F.maxLength } : void 0 })
70
+ /* @__PURE__ */ e(E, { description: l, errorMessage: s, warningMessage: i, count: h ? { n: C.length, max: w.maxLength } : void 0 })
71
71
  ] });
72
72
  }
73
- function Fe({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, rows: t = 4, autoGrow: c, maxRows: m = 12, resize: p = "vertical", showCount: o, isLoading: h, className: f, value: b, defaultValue: w, onChange: z, ...N }) {
74
- const [F, E] = k(b, w ?? "", z);
75
- return /* @__PURE__ */ r(G, { ...N, value: F, onChange: E, className: $("alea-field", f), ...A(n, v, x, i, h), children: [
76
- /* @__PURE__ */ e(R, { label: a, showOptional: d, isRequired: N.isRequired }),
73
+ function ye({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, rows: t = 4, autoGrow: c, maxRows: m = 12, resize: p = "vertical", showCount: o, isLoading: h, className: f, value: b, defaultValue: g, onChange: z, ...N }) {
74
+ const [S, T] = B(b, g ?? "", z);
75
+ return /* @__PURE__ */ r(L, { ...N, value: S, onChange: T, className: A("alea-field", f), ...R(n, v, x, i, h), children: [
76
+ /* @__PURE__ */ e(q, { label: a, showOptional: d, isRequired: N.isRequired }),
77
77
  /* @__PURE__ */ r("div", { className: "alea-input-wrap alea-textarea-wrap", children: [
78
78
  /* @__PURE__ */ e(
79
- Q,
79
+ _,
80
80
  {
81
81
  className: "alea-input alea-textarea",
82
82
  placeholder: u,
@@ -86,44 +86,44 @@ function Fe({ label: a, description: l, errorMessage: s, warningMessage: i, show
86
86
  style: { resize: c ? "none" : p, ...c ? { fieldSizing: "content", minBlockSize: `calc(${t} * 1.5em + var(--alea-space-6))`, maxBlockSize: `calc(${m} * 1.5em + var(--alea-space-6))` } : {} }
87
87
  }
88
88
  ),
89
- h && /* @__PURE__ */ e(B, {})
89
+ h && /* @__PURE__ */ e(D, {})
90
90
  ] }),
91
- /* @__PURE__ */ e(q, { description: l, errorMessage: s, warningMessage: i, count: o ? { n: F.length, max: N.maxLength } : void 0 })
91
+ /* @__PURE__ */ e(E, { description: l, errorMessage: s, warningMessage: i, count: o ? { n: S.length, max: N.maxLength } : void 0 })
92
92
  ] });
93
93
  }
94
- function ge({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, isLoading: t, shortcut: c, className: m, onClear: p, ...o }) {
94
+ function Se({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, isLoading: t, shortcut: c, className: m, onClear: p, ...o }) {
95
95
  const h = y();
96
96
  u ?? (u = h.search);
97
- const f = O(""), [b, w] = j(null);
98
- return /* @__PURE__ */ r(K, { ...o, onClear: () => {
99
- f.current.trim() && w({ id: Date.now(), words: f.current.split(/(\s+)/) }), f.current = "", p == null || p();
100
- }, className: $("alea-field alea-search-field", m), ...A(n, v, x, i, t), children: [
101
- /* @__PURE__ */ e(R, { label: a, showOptional: d, isRequired: o.isRequired }),
97
+ const f = Z(""), [b, g] = O(null);
98
+ return /* @__PURE__ */ r(Y, { ...o, onClear: () => {
99
+ f.current.trim() && g({ id: Date.now(), words: f.current.split(/(\s+)/) }), f.current = "", p == null || p();
100
+ }, className: A("alea-field alea-search-field", m), ...R(n, v, x, i, t), children: [
101
+ /* @__PURE__ */ e(q, { label: a, showOptional: d, isRequired: o.isRequired }),
102
102
  /* @__PURE__ */ r("div", { className: "alea-input-wrap", children: [
103
- /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "start", "aria-hidden": t ? void 0 : !0, children: t ? /* @__PURE__ */ e(se, { size: "sm", "aria-label": h.searching }) : /* @__PURE__ */ e(le, { size: 16 }) }),
104
- /* @__PURE__ */ e(C, { className: "alea-input", placeholder: u, "aria-busy": t || void 0, onInput: (z) => {
103
+ /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "start", "aria-hidden": t ? void 0 : !0, children: t ? /* @__PURE__ */ e(ne, { size: "sm", "aria-label": h.searching }) : /* @__PURE__ */ e(te, { size: 16 }) }),
104
+ /* @__PURE__ */ e(k, { className: "alea-input", placeholder: u, "aria-busy": t || void 0, onInput: (z) => {
105
105
  f.current = z.target.value;
106
106
  } }),
107
107
  b && /* @__PURE__ */ e("span", { className: "alea-input-ghost", "aria-hidden": "true", onAnimationEnd: (z) => {
108
108
  var N;
109
- ((N = z.target.parentElement) == null ? void 0 : N.lastElementChild) === z.target && w(null);
109
+ ((N = z.target.parentElement) == null ? void 0 : N.lastElementChild) === z.target && g(null);
110
110
  }, children: b.words.map((z, N) => /* @__PURE__ */ e("span", { style: { "--alea-i": N }, children: z }, N)) }, b.id),
111
111
  c && /* @__PURE__ */ e("kbd", { className: "alea-input-kbd", "aria-hidden": "true", children: c }),
112
- /* @__PURE__ */ e(g, { className: "alea-input-clear alea-focus-ring", "aria-label": h.clearSearch, children: /* @__PURE__ */ e(L, { size: 14 }) })
112
+ /* @__PURE__ */ e(F, { className: "alea-input-clear alea-focus-ring", "aria-label": h.clearSearch, children: /* @__PURE__ */ e(U, { size: 14 }) })
113
113
  ] }),
114
- /* @__PURE__ */ e(q, { description: l, errorMessage: s, warningMessage: i })
114
+ /* @__PURE__ */ e(E, { description: l, errorMessage: s, warningMessage: i })
115
115
  ] });
116
116
  }
117
- function ue(a) {
117
+ function pe(a) {
118
118
  let l = 0;
119
119
  return a.length >= 8 && l++, a.length >= 12 && l++, /[a-z]/.test(a) && /[A-Z]/.test(a) && l++, /\d/.test(a) && l++, /[^A-Za-z0-9]/.test(a) && l++, l <= 1 ? 0 : l === 2 ? 1 : l === 3 ? 2 : 3;
120
120
  }
121
- function we({ label: a, showStrength: l, strength: s = ue, value: i, defaultValue: d, onChange: n, description: v, ...x }) {
121
+ function $e({ label: a, showStrength: l, strength: s = pe, value: i, defaultValue: d, onChange: n, description: v, ...x }) {
122
122
  const u = y();
123
123
  a ?? (a = u.password);
124
- const [t, c] = j(!1), [m, p] = k(i, d ?? "", n), o = m ? s(m) : -1;
124
+ const [t, c] = O(!1), [m, p] = B(i, d ?? "", n), o = m ? s(m) : -1;
125
125
  return /* @__PURE__ */ e(
126
- de,
126
+ me,
127
127
  {
128
128
  ...x,
129
129
  label: a,
@@ -131,7 +131,7 @@ function we({ label: a, showStrength: l, strength: s = ue, value: i, defaultValu
131
131
  onChange: p,
132
132
  type: t ? "text" : "password",
133
133
  autoComplete: x.autoComplete || "current-password",
134
- description: l && o >= 0 ? /* @__PURE__ */ r(P, { children: [
134
+ description: l && o >= 0 ? /* @__PURE__ */ r(j, { children: [
135
135
  v,
136
136
  /* @__PURE__ */ r("span", { className: "alea-strength", "data-score": o, children: [
137
137
  /* @__PURE__ */ r("span", { className: "alea-strength-bars", "aria-hidden": "true", children: [
@@ -147,41 +147,41 @@ function we({ label: a, showStrength: l, strength: s = ue, value: i, defaultValu
147
147
  ] })
148
148
  ] })
149
149
  ] }) : v,
150
- suffix: /* @__PURE__ */ e(g, { className: "alea-input-clear alea-focus-ring", "aria-label": t ? u.hidePassword : u.showPassword, "aria-pressed": t, onPress: () => c((h) => !h), children: t ? /* @__PURE__ */ e(ee, { size: 16 }) : /* @__PURE__ */ e(ae, { size: 16 }) })
150
+ suffix: /* @__PURE__ */ e(F, { className: "alea-input-clear alea-focus-ring", "aria-label": t ? u.hidePassword : u.showPassword, "aria-pressed": t, onPress: () => c((h) => !h), children: t ? /* @__PURE__ */ e(ie, { size: 16 }) : /* @__PURE__ */ e(se, { size: 16 }) })
151
151
  }
152
152
  );
153
153
  }
154
- function ye({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, showStepper: t = !0, stepperPosition: c = "sides", prefix: m, suffix: p, isLoading: o, className: h, ...f }) {
154
+ function Ae({ label: a, description: l, errorMessage: s, warningMessage: i, showOptional: d, size: n, variant: v = "outline", labelPosition: x = "top", placeholder: u, showStepper: t = !0, stepperPosition: c = "sides", prefix: m, suffix: p, isLoading: o, className: h, ...f }) {
155
155
  const b = t && c === "sides";
156
- return /* @__PURE__ */ r(J, { ...f, className: $("alea-field", h), ...A(n, v, x, i, o), children: [
157
- /* @__PURE__ */ e(R, { label: a, showOptional: d, isRequired: f.isRequired }),
158
- /* @__PURE__ */ r(Z, { className: "alea-input-wrap alea-number", "data-stepper": t ? c : void 0, children: [
159
- b && /* @__PURE__ */ e(g, { slot: "decrement", className: "alea-stepper alea-focus-ring", children: /* @__PURE__ */ e(W, { size: 14 }) }),
156
+ return /* @__PURE__ */ r(W, { ...f, className: A("alea-field", h), ...R(n, v, x, i, o), children: [
157
+ /* @__PURE__ */ e(q, { label: a, showOptional: d, isRequired: f.isRequired }),
158
+ /* @__PURE__ */ r(G, { className: "alea-input-wrap alea-number", "data-stepper": t ? c : void 0, children: [
159
+ b && /* @__PURE__ */ e(F, { slot: "decrement", className: "alea-stepper alea-focus-ring", children: /* @__PURE__ */ e(M, { size: 14 }) }),
160
160
  m && /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "start", children: m }),
161
- /* @__PURE__ */ e(C, { className: "alea-input", placeholder: u, "aria-busy": o || void 0 }),
162
- o && /* @__PURE__ */ e(B, {}),
161
+ /* @__PURE__ */ e(k, { className: "alea-input", placeholder: u, "aria-busy": o || void 0 }),
162
+ o && /* @__PURE__ */ e(D, {}),
163
163
  p && /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "end", children: p }),
164
- b && /* @__PURE__ */ e(g, { slot: "increment", className: "alea-stepper alea-focus-ring", children: /* @__PURE__ */ e(Y, { size: 14 }) }),
164
+ b && /* @__PURE__ */ e(F, { slot: "increment", className: "alea-stepper alea-focus-ring", children: /* @__PURE__ */ e(ee, { size: 14 }) }),
165
165
  t && c === "end" && /* @__PURE__ */ r("span", { className: "alea-stepper-col", children: [
166
- /* @__PURE__ */ e(g, { slot: "increment", className: "alea-stepper-mini alea-focus-ring", children: /* @__PURE__ */ e(_, { size: 14 }) }),
167
- /* @__PURE__ */ e(g, { slot: "decrement", className: "alea-stepper-mini alea-focus-ring", children: /* @__PURE__ */ e(M, { size: 14 }) })
166
+ /* @__PURE__ */ e(F, { slot: "increment", className: "alea-stepper-mini alea-focus-ring", children: /* @__PURE__ */ e(ae, { size: 14 }) }),
167
+ /* @__PURE__ */ e(F, { slot: "decrement", className: "alea-stepper-mini alea-focus-ring", children: /* @__PURE__ */ e(le, { size: 14 }) })
168
168
  ] })
169
169
  ] }),
170
- /* @__PURE__ */ e(q, { description: l, errorMessage: s, warningMessage: i })
170
+ /* @__PURE__ */ e(E, { description: l, errorMessage: s, warningMessage: i })
171
171
  ] });
172
172
  }
173
- function Se({ children: a, className: l, ...s }) {
174
- return /* @__PURE__ */ e(Z, { ...s, className: S("alea-input-group", l), children: a });
173
+ function Re({ children: a, className: l, ...s }) {
174
+ return /* @__PURE__ */ e(G, { ...s, className: $("alea-input-group", l), children: a });
175
175
  }
176
176
  export {
177
- ne as Description,
178
- ce as FieldError,
179
- Se as InputGroup,
180
- re as Label,
181
- ye as NumberField,
182
- we as PasswordField,
183
- ge as SearchField,
184
- Fe as TextArea,
185
- de as TextField,
186
- ue as passwordScore
177
+ ue as Description,
178
+ oe as FieldError,
179
+ Re as InputGroup,
180
+ de as Label,
181
+ Ae as NumberField,
182
+ $e as PasswordField,
183
+ Se as SearchField,
184
+ ye as TextArea,
185
+ me as TextField,
186
+ pe as passwordScore
187
187
  };
@@ -11,6 +11,10 @@ export interface TimelineItem {
11
11
  dot?: ReactNode;
12
12
  /** Marks the item happening now: its dot pulses. */
13
13
  isActive?: boolean;
14
+ /** Makes the title a link to this address. */
15
+ href?: string;
16
+ /** Makes the title a button that calls this (for opening a record without leaving the page). Ignored when href is set. */
17
+ onPress?: () => void;
14
18
  }
15
19
  export interface TimelineProps {
16
20
  /** The entries: id, title, optional time, dateTime, description, tone, icon. */