@alea-design/ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/command/CommandPalette.js +63 -61
- package/dist/components/data/Data.d.ts +5 -3
- package/dist/components/data/Data.js +38 -38
- package/dist/components/media/Media.d.ts +5 -1
- package/dist/components/media/Media.js +113 -111
- package/dist/components/navigation/Navigation.d.ts +7 -3
- package/dist/components/navigation/Navigation.js +94 -94
- package/dist/components/navigation/Navigation2.d.ts +1 -1
- package/dist/components/navigation/Navigation2.js +41 -41
- package/dist/components/overlay/Overlay.d.ts +4 -0
- package/dist/components/overlay/Overlay.js +52 -52
- package/dist/components/page/PageParts.d.ts +6 -2
- package/dist/components/page/PageParts.js +92 -84
- package/dist/css/base.css +1 -1
- package/dist/css/data.css +1 -1
- package/dist/css/groups.json +4 -4
- package/dist/css/navigation.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/i18n/strings.d.ts +3 -1
- package/dist/i18n/strings.js +6 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, jsxs as
|
|
3
|
-
import { forwardRef as g, useId as
|
|
4
|
-
import { Dialog as T, Heading as b, ModalOverlay as
|
|
5
|
-
import { DialogTrigger as
|
|
6
|
-
import { X as
|
|
2
|
+
import { jsx as a, jsxs as u, Fragment as h } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as g, useId as L } from "react";
|
|
4
|
+
import { Dialog as T, Heading as b, ModalOverlay as O, Modal as R, Popover as S, OverlayArrow as x, Button as H, Tooltip as V, TooltipTrigger as X } from "react-aria-components";
|
|
5
|
+
import { DialogTrigger as pa } from "react-aria-components";
|
|
6
|
+
import { X as z } from "lucide-react";
|
|
7
7
|
import { withMotionStyle as f } from "@alea-design/motion";
|
|
8
|
-
import { cx as
|
|
9
|
-
import { Button as P, IconButton as
|
|
8
|
+
import { cx as B, withBase as v } from "../../utils/cx.js";
|
|
9
|
+
import { Button as P, IconButton as q } from "../button/Button.js";
|
|
10
10
|
import { useStrings as N } from "../../i18n/strings.js";
|
|
11
|
-
import { renamedValue as
|
|
12
|
-
import { surfaceAttrs as
|
|
13
|
-
import { useInitialFocus as
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
11
|
+
import { renamedValue as E } from "../../utils/vocabulary.js";
|
|
12
|
+
import { surfaceAttrs as M } from "../surface/Surface.js";
|
|
13
|
+
import { useInitialFocus as G } from "../../utils/initialFocus.js";
|
|
14
|
+
const ra = g(function({ children: e, showArrow: o, className: l, offset: r = 8, motion: i, style: t, size: n, surface: c, radius: p, ...s }, m) {
|
|
15
|
+
return /* @__PURE__ */ u(S, { ...s, ref: m, offset: o ? 12 : r, "data-size": n, ...M({ surface: c, radius: p }), className: v("alea-popover", l), style: f(t, i), children: [
|
|
16
16
|
o && /* @__PURE__ */ a(x, { className: "alea-arrow", children: /* @__PURE__ */ a("svg", { width: 12, height: 12, viewBox: "0 0 12 12", children: /* @__PURE__ */ a("path", { d: "M0 0 L6 6 L12 0" }) }) }),
|
|
17
17
|
e
|
|
18
18
|
] });
|
|
19
|
-
}),
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */ a(T, { ...n, ref: c, className:
|
|
22
|
-
(e ||
|
|
19
|
+
}), ia = g(function({ title: e, description: o, footer: l, showClose: r, children: i, className: t, ...n }, c) {
|
|
20
|
+
const p = N();
|
|
21
|
+
return /* @__PURE__ */ a(T, { ...n, ref: c, className: B("alea-popover-dialog", t), children: (s) => /* @__PURE__ */ u(h, { children: [
|
|
22
|
+
(e || r) && /* @__PURE__ */ u("div", { className: "alea-popover-head", children: [
|
|
23
23
|
e && /* @__PURE__ */ a(b, { slot: "title", className: "alea-popover-title", children: e }),
|
|
24
|
-
|
|
24
|
+
r && /* @__PURE__ */ a(H, { className: "alea-popover-close alea-focus-ring", "aria-label": p.close, onPress: s.close, children: /* @__PURE__ */ a(z, { size: 16, "aria-hidden": "true" }) })
|
|
25
25
|
] }),
|
|
26
26
|
o && /* @__PURE__ */ a("p", { className: "alea-popover-desc", children: o }),
|
|
27
|
-
typeof
|
|
28
|
-
l && /* @__PURE__ */ a("div", { className: "alea-popover-footer", children: typeof l == "function" ? l(
|
|
27
|
+
typeof i == "function" ? i(s) : i,
|
|
28
|
+
l && /* @__PURE__ */ a("div", { className: "alea-popover-footer", children: typeof l == "function" ? l(s.close) : l })
|
|
29
29
|
] }) });
|
|
30
30
|
});
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
function ta({ children: d, title: e, shortcut: o, hideArrow: l, className: r, offset: i = 8, motion: t, style: n, ...c }) {
|
|
32
|
+
return /* @__PURE__ */ u(V, { ...c, offset: i, className: v("alea-tooltip", r), "data-rich": e ? !0 : void 0, style: f(n, t), children: [
|
|
33
33
|
!l && /* @__PURE__ */ a(x, { className: "alea-arrow alea-tooltip-arrow", children: /* @__PURE__ */ a("svg", { width: 8, height: 8, viewBox: "0 0 8 8", children: /* @__PURE__ */ a("path", { d: "M0 0 L4 4 L8 0" }) }) }),
|
|
34
34
|
e && /* @__PURE__ */ a("span", { className: "alea-tooltip-title", children: e }),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
35
|
+
/* @__PURE__ */ u("span", { className: "alea-tooltip-text", children: [
|
|
36
|
+
d,
|
|
37
37
|
o && /* @__PURE__ */ a("kbd", { className: "alea-tooltip-kbd", children: o })
|
|
38
38
|
] })
|
|
39
39
|
] });
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */ a(
|
|
41
|
+
function sa({ delay: d = 600, closeDelay: e = 200, ...o }) {
|
|
42
|
+
return /* @__PURE__ */ a(X, { ...o, delay: d, closeDelay: e });
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return /* @__PURE__ */ a(T, { ...
|
|
47
|
-
(e || !
|
|
48
|
-
e && /* @__PURE__ */ a(b, { slot: "title", className: "alea-dialog-title", children: e }),
|
|
49
|
-
!
|
|
44
|
+
const J = g(function({ title: e, description: o, children: l, footer: r, hideClose: i, titleSize: t = "md", className: n, ...c }, p) {
|
|
45
|
+
const s = N();
|
|
46
|
+
return /* @__PURE__ */ a(T, { ...c, ref: p, className: B("alea-dialog", n), children: ({ close: m }) => /* @__PURE__ */ u(h, { children: [
|
|
47
|
+
(e || !i) && /* @__PURE__ */ u("div", { className: "alea-dialog-head", children: [
|
|
48
|
+
e && /* @__PURE__ */ a(b, { slot: "title", className: "alea-dialog-title", "data-size": t === "sm" ? "sm" : void 0, children: e }),
|
|
49
|
+
!i && /* @__PURE__ */ a(q, { "aria-label": s.close, size: "sm", variant: "ghost", onPress: m, className: "alea-dialog-x", children: /* @__PURE__ */ a(z, {}) })
|
|
50
50
|
] }),
|
|
51
51
|
o && /* @__PURE__ */ a("p", { className: "alea-dialog-description", children: o }),
|
|
52
|
-
l && /* @__PURE__ */ a("div", { className: "alea-dialog-body", children: typeof l == "function" ? l({ close:
|
|
53
|
-
|
|
52
|
+
l && /* @__PURE__ */ a("div", { className: "alea-dialog-body", children: typeof l == "function" ? l({ close: m }) : l }),
|
|
53
|
+
r && /* @__PURE__ */ a("div", { className: "alea-dialog-footer", children: typeof r == "function" ? r({ close: m }) : r })
|
|
54
54
|
] }) });
|
|
55
55
|
});
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
return /* @__PURE__ */ a(
|
|
56
|
+
function K({ children: d, size: e = "md", fullscreenBelow: o, className: l, isDismissable: r = !0, motion: i, backdrop: t, initialFocus: n, surface: c, radius: p, ...s }) {
|
|
57
|
+
const m = G(n);
|
|
58
|
+
return /* @__PURE__ */ a(O, { ...s, isDismissable: r, className: v("alea-modal-overlay", l), "data-backdrop": t, "data-fullscreen-below": o, children: /* @__PURE__ */ a(R, { ref: m, className: "alea-modal", "data-size": e, "data-fullscreen-below": o, ...M({ surface: c, radius: p }), style: f(void 0, i), children: d }) });
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
const y =
|
|
62
|
-
return
|
|
63
|
-
/* @__PURE__ */ a(P, { variant: "ghost", autoFocus: l === "cancel", onPress: w, children:
|
|
64
|
-
/* @__PURE__ */ a(P, { variant:
|
|
65
|
-
await (
|
|
66
|
-
}, children:
|
|
67
|
-
] }), children:
|
|
60
|
+
const na = g(function({ motion: e, backdrop: o, initialFocus: l = "confirm", titleSize: r, title: i, children: t, confirmLabel: n, cancelLabel: c, tone: p, onConfirm: s, isOpen: m, defaultOpen: $, onOpenChange: A, className: I, style: k }, F) {
|
|
61
|
+
const y = L(), j = E("AlertDialog", "tone", p, { default: "neutral" }) ?? "neutral", D = N();
|
|
62
|
+
return n ?? (n = D.confirm), c ?? (c = D.cancel), /* @__PURE__ */ a(K, { isOpen: m, defaultOpen: $, onOpenChange: A, isDismissable: !1, size: "sm", motion: e, backdrop: o, children: /* @__PURE__ */ a(J, { ref: F, className: I, style: k, role: "alertdialog", "aria-describedby": t ? y : void 0, title: i, titleSize: r, hideClose: !0, footer: ({ close: w }) => /* @__PURE__ */ u(h, { children: [
|
|
63
|
+
/* @__PURE__ */ a(P, { variant: "ghost", autoFocus: l === "cancel", onPress: w, children: c }),
|
|
64
|
+
/* @__PURE__ */ a(P, { variant: j === "danger" ? "danger" : "primary", autoFocus: l === "confirm", onPress: async () => {
|
|
65
|
+
await (s == null ? void 0 : s()), w();
|
|
66
|
+
}, children: n })
|
|
67
|
+
] }), children: t ? /* @__PURE__ */ a("div", { id: y, style: { display: "contents" }, children: t }) : null }) });
|
|
68
68
|
});
|
|
69
69
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
na as AlertDialog,
|
|
71
|
+
J as Dialog,
|
|
72
|
+
K as DialogModal,
|
|
73
|
+
pa as DialogTrigger,
|
|
74
|
+
ra as Popover,
|
|
75
|
+
ia as PopoverDialog,
|
|
76
|
+
ta as Tooltip,
|
|
77
|
+
sa as TooltipTrigger
|
|
78
78
|
};
|
|
@@ -9,6 +9,8 @@ export interface PageAction {
|
|
|
9
9
|
href?: string;
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
tone?: 'default' | 'danger';
|
|
12
|
+
/** PageHeader: keep this action inside the More menu even when there is room for it as a button (a destructive one, for example). */
|
|
13
|
+
menuOnly?: boolean;
|
|
12
14
|
}
|
|
13
15
|
export interface PageHeaderProps {
|
|
14
16
|
/** The page title (an h1 by default). */
|
|
@@ -32,6 +34,8 @@ export interface PageHeaderProps {
|
|
|
32
34
|
actions?: ReactNode;
|
|
33
35
|
/** More actions: shown as buttons from 768 px up, folded into a More menu on phones. */
|
|
34
36
|
secondaryActions?: PageAction[];
|
|
37
|
+
/** How many secondary actions show as buttons before the rest move into a More menu (0 puts them all in the menu). Default: all of them. Actions with `menuOnly` always go to the menu. */
|
|
38
|
+
maxVisibleActions?: number;
|
|
35
39
|
/** Tabs or a segmented control under the header. */
|
|
36
40
|
tabs?: ReactNode;
|
|
37
41
|
/** Heading level. Default 1. */
|
|
@@ -43,8 +47,8 @@ export interface PageHeaderProps {
|
|
|
43
47
|
/** Extra class names. */
|
|
44
48
|
className?: string;
|
|
45
49
|
}
|
|
46
|
-
/** The top of a page: breadcrumbs or back, title, subtitle, meta, actions and tabs. Secondary actions fold into a menu on phones
|
|
47
|
-
export declare function PageHeader({ title, subtitle, back, backLabel, breadcrumbs, media, meta, actions, secondaryActions, tabs, headingLevel, sticky, compact, className }: PageHeaderProps): import("react").JSX.Element;
|
|
50
|
+
/** The top of a page: breadcrumbs or back, title, subtitle, meta, actions and tabs. Secondary actions fold into a menu on phones, or past `maxVisibleActions`. */
|
|
51
|
+
export declare function PageHeader({ title, subtitle, back, backLabel, breadcrumbs, media, meta, actions, secondaryActions, maxVisibleActions, tabs, headingLevel, sticky, compact, className }: PageHeaderProps): import("react").JSX.Element;
|
|
48
52
|
export interface SaveBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
49
53
|
/** Show it while there are unsaved changes. */
|
|
50
54
|
isVisible: boolean;
|
|
@@ -1,109 +1,117 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Info as
|
|
5
|
-
import { cx as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Breadcrumbs as
|
|
8
|
-
import { DropdownMenu as
|
|
9
|
-
import { useStrings as
|
|
10
|
-
import { inertProps as
|
|
11
|
-
function
|
|
12
|
-
|
|
2
|
+
import { jsxs as l, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as T, useState as P, useEffect as x, createElement as K, forwardRef as C } from "react";
|
|
4
|
+
import { Info as R, ArrowLeft as S, MoreHorizontal as $ } from "lucide-react";
|
|
5
|
+
import { cx as b } from "../../utils/cx.js";
|
|
6
|
+
import { Button as D, IconButton as I } from "../button/Button.js";
|
|
7
|
+
import { Breadcrumbs as q, Breadcrumb as G } from "../navigation/Navigation.js";
|
|
8
|
+
import { DropdownMenu as J, MenuItem as Q } from "../menu/Menu.js";
|
|
9
|
+
import { useStrings as k } from "../../i18n/strings.js";
|
|
10
|
+
import { inertProps as U } from "../../utils/inert.js";
|
|
11
|
+
function L({ actions: o, label: a, className: i }) {
|
|
12
|
+
return /* @__PURE__ */ e("div", { className: i, children: /* @__PURE__ */ e(
|
|
13
|
+
J,
|
|
14
|
+
{
|
|
15
|
+
"aria-label": a,
|
|
16
|
+
placement: "bottom end",
|
|
17
|
+
trigger: /* @__PURE__ */ e(I, { "aria-label": a, size: "sm", children: /* @__PURE__ */ e($, {}) }),
|
|
18
|
+
menuProps: { onAction: (r) => {
|
|
19
|
+
var t, s;
|
|
20
|
+
return (s = (t = o.find((m) => m.id === r)) == null ? void 0 : t.onAction) == null ? void 0 : s.call(t);
|
|
21
|
+
} },
|
|
22
|
+
children: o.map((r) => /* @__PURE__ */ e(Q, { id: r.id, icon: r.icon, href: r.href, isDisabled: r.isDisabled, tone: r.tone, children: r.label }, String(r.id)))
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
}
|
|
26
|
+
function ne({ title: o, subtitle: a, back: i, backLabel: r, breadcrumbs: t, media: s, meta: m, actions: N, secondaryActions: d, maxVisibleActions: h, tabs: v, headingLevel: p = 1, sticky: c, compact: u, className: y }) {
|
|
27
|
+
const f = k(), g = T(null), [H, O] = P(!1);
|
|
13
28
|
x(() => {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
|
|
29
|
+
const n = g.current;
|
|
30
|
+
if (!c || !n || typeof IntersectionObserver > "u") return;
|
|
31
|
+
const w = document.createElement("div");
|
|
32
|
+
n.before(w);
|
|
33
|
+
const M = new IntersectionObserver(([A]) => O(!A.isIntersecting));
|
|
34
|
+
return M.observe(w), () => {
|
|
35
|
+
M.disconnect(), w.remove();
|
|
21
36
|
};
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
menuProps: { onAction: (a) => {
|
|
32
|
-
var t, z;
|
|
33
|
-
return (z = (t = n.find((P) => P.id === a)) == null ? void 0 : t.onAction) == null ? void 0 : z.call(t);
|
|
34
|
-
} },
|
|
35
|
-
children: n.map((a) => /* @__PURE__ */ e($, { id: a.id, icon: a.icon, href: a.href, isDisabled: a.isDisabled, tone: a.tone, children: a.label }, String(a.id)))
|
|
36
|
-
}
|
|
37
|
-
) })
|
|
37
|
+
}, [c]);
|
|
38
|
+
const j = Math.max(0, h ?? 1 / 0), z = [], B = [];
|
|
39
|
+
for (const n of d ?? []) (!n.menuOnly && z.length < j ? z : B).push(n);
|
|
40
|
+
const E = d != null && d.length ? /* @__PURE__ */ l(F, { children: [
|
|
41
|
+
/* @__PURE__ */ l("div", { className: "alea-page-header-secondary", children: [
|
|
42
|
+
z.map((n) => /* @__PURE__ */ e(D, { variant: "ghost", size: "sm", iconStart: n.icon, href: n.href, onPress: n.onAction, isDisabled: n.isDisabled, tone: n.tone === "danger" ? "danger" : void 0, children: n.label }, String(n.id))),
|
|
43
|
+
B.length > 0 && /* @__PURE__ */ e(L, { actions: B, label: f.moreActions })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ e(L, { actions: d, label: f.moreActions, className: "alea-page-header-more" })
|
|
38
46
|
] }) : null;
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
i && (typeof i == "string" ? /* @__PURE__ */ e(
|
|
43
|
-
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
return /* @__PURE__ */ l("header", { ref: g, className: b("alea-page-header", y), "data-sticky": c || void 0, "data-stuck": H || void 0, "data-compact": u || void 0, children: [
|
|
48
|
+
t != null && t.length ? /* @__PURE__ */ e("nav", { "aria-label": f.breadcrumb, children: /* @__PURE__ */ e(q, { className: "alea-page-header-crumbs", children: t.map((n, w) => /* @__PURE__ */ e(G, { href: w === t.length - 1 ? void 0 : n.href, children: n.label }, w)) }) }) : null,
|
|
49
|
+
/* @__PURE__ */ l("div", { className: "alea-page-header-main", children: [
|
|
50
|
+
i && (typeof i == "string" ? /* @__PURE__ */ e(I, { "aria-label": r ?? f.back, variant: "ghost", size: "sm", href: i, className: "alea-page-header-back", children: /* @__PURE__ */ e(S, {}) }) : /* @__PURE__ */ e(I, { "aria-label": r ?? f.back, variant: "ghost", size: "sm", onPress: i, className: "alea-page-header-back", children: /* @__PURE__ */ e(S, {}) })),
|
|
51
|
+
s && /* @__PURE__ */ e("span", { className: "alea-page-header-media", children: s }),
|
|
52
|
+
/* @__PURE__ */ l("div", { className: "alea-page-header-titles", children: [
|
|
53
|
+
/* @__PURE__ */ l("div", { className: "alea-page-header-title-row", children: [
|
|
54
|
+
K(`h${p}`, { className: "alea-page-header-title" }, o),
|
|
55
|
+
m && /* @__PURE__ */ e("div", { className: "alea-page-header-meta", children: m })
|
|
48
56
|
] }),
|
|
49
|
-
|
|
57
|
+
a && /* @__PURE__ */ e("p", { className: "alea-page-header-subtitle", children: a })
|
|
50
58
|
] }),
|
|
51
|
-
(
|
|
59
|
+
(N || E) && /* @__PURE__ */ l("div", { className: "alea-page-header-actions", children: [
|
|
52
60
|
E,
|
|
53
|
-
|
|
61
|
+
N
|
|
54
62
|
] })
|
|
55
63
|
] }),
|
|
56
|
-
|
|
64
|
+
v && /* @__PURE__ */ e("div", { className: "alea-page-header-tabs", children: v })
|
|
57
65
|
] });
|
|
58
66
|
}
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
return
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
64
|
-
(
|
|
67
|
+
const te = C(function({ isVisible: a, message: i, onSave: r, onDiscard: t, isSaving: s, saveLabel: m, discardLabel: N, position: d = "top", saveShortcut: h = !0, className: v, ...p }, c) {
|
|
68
|
+
const u = k(), y = T(r);
|
|
69
|
+
return y.current = r, x(() => {
|
|
70
|
+
if (!a || !h) return;
|
|
71
|
+
const f = (g) => {
|
|
72
|
+
(g.metaKey || g.ctrlKey) && g.key.toLowerCase() === "s" && (g.preventDefault(), y.current());
|
|
65
73
|
};
|
|
66
|
-
return window.addEventListener("keydown",
|
|
67
|
-
}, [
|
|
68
|
-
/* @__PURE__ */ e("p", { className: "alea-savebar-message", "aria-live": "polite", children:
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */ e(
|
|
74
|
+
return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
|
|
75
|
+
}, [a, h]), /* @__PURE__ */ l("div", { ref: c, ...p, className: b("alea-savebar", v), "data-visible": a || void 0, "data-position": d, role: "region", "aria-label": p["aria-label"] ?? u.unsavedChanges, "aria-hidden": !a || void 0, ...U(!a), children: [
|
|
76
|
+
/* @__PURE__ */ e("p", { className: "alea-savebar-message", "aria-live": "polite", children: a ? i ?? u.unsavedChanges : "" }),
|
|
77
|
+
/* @__PURE__ */ l("div", { className: "alea-savebar-actions", children: [
|
|
78
|
+
t && /* @__PURE__ */ e(D, { variant: "ghost", size: "sm", onPress: t, isDisabled: s, children: N ?? u.discard }),
|
|
79
|
+
/* @__PURE__ */ e(D, { size: "sm", variant: "secondary", onPress: r, isLoading: s, shortcut: h ? "⌘S" : void 0, children: m ?? u.save })
|
|
72
80
|
] })
|
|
73
81
|
] });
|
|
74
|
-
}),
|
|
75
|
-
const
|
|
82
|
+
}), ie = C(function({ isLoading: a, value: i, "aria-label": r, className: t, ...s }, m) {
|
|
83
|
+
const N = k(), [d, h] = P(a), [v, p] = P(!1);
|
|
76
84
|
if (x(() => {
|
|
77
|
-
if (
|
|
78
|
-
|
|
85
|
+
if (a) {
|
|
86
|
+
h(!0), p(!1);
|
|
79
87
|
return;
|
|
80
88
|
}
|
|
81
|
-
if (!
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
89
|
+
if (!d) return;
|
|
90
|
+
p(!0);
|
|
91
|
+
const u = setTimeout(() => {
|
|
92
|
+
h(!1), p(!1);
|
|
85
93
|
}, 500);
|
|
86
|
-
return () => clearTimeout(
|
|
87
|
-
}, [
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
94
|
+
return () => clearTimeout(u);
|
|
95
|
+
}, [a]), !d) return null;
|
|
96
|
+
const c = v ? 100 : i;
|
|
97
|
+
return /* @__PURE__ */ e("div", { ref: m, ...s, className: b("alea-top-loading", t), role: "progressbar", "aria-label": r ?? N.loading, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": c, "data-done": v || void 0, "data-indeterminate": c == null || void 0, children: /* @__PURE__ */ e("span", { className: "alea-top-loading-bar", style: c != null ? { width: `${c}%` } : void 0 }) });
|
|
90
98
|
});
|
|
91
|
-
function
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */ e(
|
|
94
|
-
/* @__PURE__ */ e("span", { children:
|
|
99
|
+
function le({ children: o, className: a }) {
|
|
100
|
+
return /* @__PURE__ */ l("p", { className: b("alea-footer-help", a), children: [
|
|
101
|
+
/* @__PURE__ */ e(R, { size: 16, "aria-hidden": "true" }),
|
|
102
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
95
103
|
] });
|
|
96
104
|
}
|
|
97
|
-
function
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */ e("div", { className: "alea-page-actions-secondary", children:
|
|
100
|
-
/* @__PURE__ */ e("div", { className: "alea-page-actions-primary", children:
|
|
105
|
+
function oe({ primary: o, secondary: a, className: i }) {
|
|
106
|
+
return /* @__PURE__ */ l("div", { className: b("alea-page-actions", i), children: [
|
|
107
|
+
/* @__PURE__ */ e("div", { className: "alea-page-actions-secondary", children: a }),
|
|
108
|
+
/* @__PURE__ */ e("div", { className: "alea-page-actions-primary", children: o })
|
|
101
109
|
] });
|
|
102
110
|
}
|
|
103
111
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
le as FooterHelp,
|
|
113
|
+
oe as PageActions,
|
|
114
|
+
ne as PageHeader,
|
|
115
|
+
te as SaveBar,
|
|
116
|
+
ie as TopLoadingBar
|
|
109
117
|
};
|