@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.
- package/dist/components/command/CommandPalette.js +53 -42
- package/dist/components/field/Field.d.ts +7 -1
- package/dist/components/field/Field.js +82 -82
- package/dist/components/media/Media.d.ts +4 -0
- package/dist/components/media/Media.js +76 -76
- package/dist/components/notification/NotificationCenter.d.ts +86 -0
- package/dist/components/notification/NotificationCenter.js +185 -0
- package/dist/components/theme/Theme.js +141 -98
- package/dist/css/command.css +1 -1
- package/dist/css/groups.json +12 -2
- package/dist/css/media.css +1 -1
- package/dist/css/notification.css +1 -0
- package/dist/i18n/strings.d.ts +16 -0
- package/dist/i18n/strings.js +24 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +150 -148
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -1,54 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cx as
|
|
5
|
-
import { useFilter as
|
|
6
|
-
import { Search as
|
|
7
|
-
import { DialogModal as
|
|
8
|
-
import { Kbd as
|
|
9
|
-
import { useStrings as
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
19
|
-
t.key.toLowerCase() === "k" && (t.metaKey || t.ctrlKey) && (t.preventDefault(),
|
|
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",
|
|
32
|
+
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
22
33
|
});
|
|
23
|
-
const { contains:
|
|
24
|
-
const
|
|
25
|
-
for (const t of
|
|
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
|
|
28
|
-
|
|
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
|
|
31
|
-
}, [
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
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__ */
|
|
39
|
-
const e =
|
|
40
|
-
|
|
41
|
-
}, renderEmptyState: () => /* @__PURE__ */
|
|
42
|
-
t.title && /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
e.icon && /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
e.description && /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Minus as
|
|
6
|
-
import { cx as
|
|
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
|
|
9
|
-
import { responsiveAttrs as
|
|
10
|
-
import { Spinner as
|
|
11
|
-
import { FieldSpinner as
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ e(
|
|
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
|
|
16
|
-
return /* @__PURE__ */ e(
|
|
15
|
+
function ue({ className: a, ...l }) {
|
|
16
|
+
return /* @__PURE__ */ e(J, { ...l, slot: "description", className: $("alea-description", a) });
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */ e(
|
|
18
|
+
function oe({ className: a, ...l }) {
|
|
19
|
+
return /* @__PURE__ */ e(K, { ...l, className: $("alea-field-error", a) });
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
...
|
|
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
|
-
...
|
|
26
|
+
...ce(d)
|
|
27
27
|
});
|
|
28
|
-
function
|
|
28
|
+
function q({ label: a, showOptional: l, isRequired: s }) {
|
|
29
29
|
const i = y();
|
|
30
|
-
return a ? /* @__PURE__ */ r(
|
|
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
|
|
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(
|
|
43
|
-
(a || s) && /* @__PURE__ */ r(
|
|
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(
|
|
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
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */ r(
|
|
57
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
62
|
-
f && /* @__PURE__ */ e(
|
|
63
|
-
o &&
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
}, children: /* @__PURE__ */ e(
|
|
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(
|
|
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
|
|
74
|
-
const [
|
|
75
|
-
return /* @__PURE__ */ r(
|
|
76
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
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(
|
|
89
|
+
h && /* @__PURE__ */ e(D, {})
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */ e(
|
|
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
|
|
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 =
|
|
98
|
-
return /* @__PURE__ */ r(
|
|
99
|
-
f.current.trim() &&
|
|
100
|
-
}, className:
|
|
101
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
104
|
-
/* @__PURE__ */ e(
|
|
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 &&
|
|
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(
|
|
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(
|
|
114
|
+
/* @__PURE__ */ e(E, { description: l, errorMessage: s, warningMessage: i })
|
|
115
115
|
] });
|
|
116
116
|
}
|
|
117
|
-
function
|
|
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
|
|
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] =
|
|
124
|
+
const [t, c] = O(!1), [m, p] = B(i, d ?? "", n), o = m ? s(m) : -1;
|
|
125
125
|
return /* @__PURE__ */ e(
|
|
126
|
-
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
157
|
-
/* @__PURE__ */ e(
|
|
158
|
-
/* @__PURE__ */ r(
|
|
159
|
-
b && /* @__PURE__ */ e(
|
|
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(
|
|
162
|
-
o && /* @__PURE__ */ e(
|
|
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(
|
|
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(
|
|
167
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
170
|
+
/* @__PURE__ */ e(E, { description: l, errorMessage: s, warningMessage: i })
|
|
171
171
|
] });
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
return /* @__PURE__ */ e(
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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. */
|