@alea-design/ui 0.8.1 → 0.9.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 +85 -60
- package/dist/components/overlay/Drawer.d.ts +2 -0
- package/dist/components/overlay/Drawer.js +32 -29
- package/dist/components/overlay/Modal.js +20 -19
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +57 -54
- package/dist/components/shell/AppShell.d.ts +3 -1
- package/dist/components/shell/AppShell.js +66 -46
- package/dist/css/base.css +1 -1
- package/dist/css/button.css +1 -1
- package/dist/css/card.css +1 -1
- package/dist/css/choice.css +1 -1
- package/dist/css/groups.json +11 -11
- package/dist/css/list.css +1 -1
- package/dist/css/more.css +1 -1
- package/dist/css/rating.css +1 -1
- package/dist/css/select.css +1 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/upload.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/modalLayer.d.ts +5 -0
- package/dist/utils/modalLayer.js +13 -0
- package/package.json +3 -3
|
@@ -1,57 +1,77 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Menu as
|
|
6
|
-
import { cx as
|
|
7
|
-
import { useMediaQuery as
|
|
8
|
-
import { IconButton as
|
|
9
|
-
import { Drawer as
|
|
10
|
-
import { Dialog as
|
|
11
|
-
import { useStrings as
|
|
12
|
-
import { SkipLink as
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
import { jsxs as c, jsx as e, Fragment as R } from "react/jsx-runtime";
|
|
3
|
+
import { useState as $, useRef as D, useEffect as P, forwardRef as Q } from "react";
|
|
4
|
+
import { Link as z } from "react-aria-components";
|
|
5
|
+
import { Menu as E } from "lucide-react";
|
|
6
|
+
import { cx as g, withBase as H } from "../../utils/cx.js";
|
|
7
|
+
import { useMediaQuery as J } from "../layout/Responsive.js";
|
|
8
|
+
import { IconButton as K } from "../button/Button.js";
|
|
9
|
+
import { Drawer as T } from "../overlay/Drawer.js";
|
|
10
|
+
import { Dialog as U } from "../overlay/Overlay.js";
|
|
11
|
+
import { useStrings as M } from "../../i18n/strings.js";
|
|
12
|
+
import { SkipLink as V } from "../more/More.js";
|
|
13
|
+
function re({ brand: n, headerEnd: l, sidebar: a, children: r, sidebarWidth: o = 248, collapseBelow: s = 900, mainAs: u = "main", layout: h = "header", contentSize: f, skipLink: t, bottomBar: x, focusAfterNavigate: S = "heading", className: O }) {
|
|
14
|
+
const q = M(), j = u, [p, v] = $(!1), N = D(null), b = D(!1);
|
|
15
|
+
P(() => {
|
|
16
|
+
if (p || !b.current || (b.current = !1, S !== "heading")) return;
|
|
17
|
+
let i = 0, I = 0;
|
|
18
|
+
const w = () => {
|
|
19
|
+
var F;
|
|
20
|
+
if ((F = N.current) != null && F.ownerDocument.querySelector(".alea-drawer") && I++ < 90) {
|
|
21
|
+
i = requestAnimationFrame(w);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
i = requestAnimationFrame(() => {
|
|
25
|
+
i = requestAnimationFrame(() => {
|
|
26
|
+
var C;
|
|
27
|
+
const d = (C = N.current) == null ? void 0 : C.querySelector(".alea-shell-main"), m = (d == null ? void 0 : d.querySelector("h1")) ?? d;
|
|
28
|
+
m && (m.hasAttribute("tabindex") || m.setAttribute("tabindex", "-1"), m.focus());
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return i = requestAnimationFrame(w), () => cancelAnimationFrame(i);
|
|
33
|
+
}, [p, S]);
|
|
34
|
+
const G = J(`(max-width: ${s - 0.02}px)`), y = /* @__PURE__ */ c("header", { className: "alea-shell-header", children: [
|
|
35
|
+
a && /* @__PURE__ */ e(K, { "aria-label": q.openNavigation, className: "alea-shell-menu", onPress: () => v(!0), children: /* @__PURE__ */ e(E, {}) }),
|
|
36
|
+
n && /* @__PURE__ */ e("div", { className: "alea-shell-brand", children: n }),
|
|
37
|
+
l && /* @__PURE__ */ e("div", { className: "alea-shell-end", children: l })
|
|
38
|
+
] }), A = /* @__PURE__ */ e(j, { id: "alea-main", className: "alea-shell-main", tabIndex: -1, children: f && f !== "full" ? /* @__PURE__ */ e("div", { className: "alea-shell-content", "data-size": f, children: r }) : r });
|
|
39
|
+
return /* @__PURE__ */ c("div", { ref: N, className: g("alea-shell", O), style: { "--alea-shell-sidebar": `${o}px` }, "data-layout": h, "data-collapse": s, "data-collapsed": G || void 0, "data-custom-collapse": s !== 900 || void 0, children: [
|
|
40
|
+
t !== !1 && /* @__PURE__ */ e(V, { target: (t == null ? void 0 : t.target) ?? "alea-main", children: t == null ? void 0 : t.label }),
|
|
41
|
+
h === "header" && y,
|
|
42
|
+
/* @__PURE__ */ c("div", { className: "alea-shell-body", children: [
|
|
43
|
+
a && /* @__PURE__ */ e("aside", { className: "alea-shell-sidebar", children: a }),
|
|
44
|
+
h === "sidebar" ? /* @__PURE__ */ c("div", { className: "alea-shell-panel", children: [
|
|
45
|
+
y,
|
|
46
|
+
A
|
|
47
|
+
] }) : A
|
|
28
48
|
] }),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, children:
|
|
49
|
+
x && /* @__PURE__ */ e("div", { className: "alea-shell-bottom", children: x }),
|
|
50
|
+
a && /* @__PURE__ */ e(T, { isOpen: p, onOpenChange: v, placement: "start", size: 300, children: /* @__PURE__ */ e(U, { "aria-label": q.navigation, hideClose: !0, className: "alea-shell-drawer", children: () => /* @__PURE__ */ e("div", { className: "alea-shell-drawer-body", onClickCapture: (i) => {
|
|
51
|
+
i.target.closest("a") && (b.current = !0, v(!1));
|
|
52
|
+
}, children: a }) }) })
|
|
33
53
|
] });
|
|
34
54
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
return
|
|
55
|
+
function ne({ children: n, className: l, "aria-label": a }) {
|
|
56
|
+
const r = M();
|
|
57
|
+
return a ?? (a = r.mainNav), /* @__PURE__ */ e("nav", { "aria-label": a, className: g("alea-sidenav", l), children: n });
|
|
38
58
|
}
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
l && /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
59
|
+
const se = Q(function({ title: l, children: a, className: r, ...o }, s) {
|
|
60
|
+
return /* @__PURE__ */ c("div", { ref: s, ...o, className: g("alea-sidenav-group", r), children: [
|
|
61
|
+
l && /* @__PURE__ */ e("p", { className: "alea-sidenav-title", children: l }),
|
|
62
|
+
/* @__PURE__ */ e("ul", { children: a })
|
|
43
63
|
] });
|
|
44
64
|
});
|
|
45
|
-
function
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
l && /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
65
|
+
function te({ isCurrent: n, icon: l, end: a, children: r, className: o, ...s }) {
|
|
66
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(z, { ...s, "aria-current": n ? "page" : void 0, className: H("alea-sidenav-link alea-focus-ring", o), children: (u) => /* @__PURE__ */ c(R, { children: [
|
|
67
|
+
l && /* @__PURE__ */ e("span", { className: "alea-sidenav-icon", "aria-hidden": "true", children: l }),
|
|
68
|
+
/* @__PURE__ */ e("span", { className: "alea-sidenav-label", children: typeof r == "function" ? r(u) : r }),
|
|
69
|
+
a && /* @__PURE__ */ e("span", { className: "alea-sidenav-end", children: a })
|
|
50
70
|
] }) }) });
|
|
51
71
|
}
|
|
52
72
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
re as AppShell,
|
|
74
|
+
se as SidebarGroup,
|
|
75
|
+
te as SidebarLink,
|
|
76
|
+
ne as SidebarNav
|
|
57
77
|
};
|