@skiddph/prui 0.4.0 → 0.4.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/app/app.d.ts
CHANGED
|
@@ -72,6 +72,8 @@ export interface AppProps {
|
|
|
72
72
|
pages?: "auth" | "utility" | "auth+utility";
|
|
73
73
|
/** Props passed to the auto-routed pre-made pages (per page name). */
|
|
74
74
|
pagesConfig?: Partial<Record<PageSetName, Record<string, unknown>>>;
|
|
75
|
+
/** A pathname (e.g. "/") on which every nav group starts expanded. */
|
|
76
|
+
expandAllOn?: string;
|
|
75
77
|
children?: React.ReactNode;
|
|
76
78
|
}
|
|
77
79
|
export declare function useThemeState(config?: boolean | ThemeConfig): {
|
|
@@ -79,9 +81,10 @@ export declare function useThemeState(config?: boolean | ThemeConfig): {
|
|
|
79
81
|
state: AppliedTheme;
|
|
80
82
|
setTheme: (next: AppliedTheme) => void;
|
|
81
83
|
};
|
|
82
|
-
export declare function SidebarNav({ nav, onNavigate }: {
|
|
84
|
+
export declare function SidebarNav({ nav, onNavigate, expandAllOn }: {
|
|
83
85
|
nav: NavItem[];
|
|
84
86
|
onNavigate?: () => void;
|
|
87
|
+
expandAllOn?: string;
|
|
85
88
|
}): React.JSX.Element;
|
|
86
89
|
export interface PaletteEntry {
|
|
87
90
|
label: string;
|
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Link as e, NavLink as t, Navigate as o, Outlet as r, Route as p, Routes as u } from "react-router-dom";
|
|
2
|
-
import { A as m, a as P, b as S, c as l, C as h, F as n, R as M, S as R, d as g, e as A, f, g as c, h as d, i as k, r as v, s as N, j as T, k as b, u as w } from "./chunks/auth-shell-
|
|
2
|
+
import { A as m, a as P, b as S, c as l, C as h, F as n, R as M, S as R, d as g, e as A, f, g as c, h as d, i as k, r as v, s as N, j as T, k as b, u as w } from "./chunks/auth-shell-BYG_ozPZ.js";
|
|
3
3
|
export {
|
|
4
4
|
m as App,
|
|
5
5
|
P as AppShell,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d, Fragment as je } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { Routes as Me, Route as
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Routes as Me, Route as ee, Navigate as $e, MemoryRouter as Oe, BrowserRouter as ze, useLocation as se, useNavigate as Ae, Outlet as De, Link as Fe, NavLink as Le } from "react-router-dom";
|
|
4
4
|
import { X as Ie, Menu as _e, Search as qe, Palette as Be, ChevronDown as Ke, Pencil as Ve, Trash2 as Ue, Plus as Je, Clock as Ye } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as E } from "../core/cn.js";
|
|
6
6
|
import { Dropdown as He } from "../core/dropdown.js";
|
|
7
|
-
import { Button as
|
|
8
|
-
import { resolveThemeName as We, themeMode as Xe, readPersistedTheme as Ge, applyTheme as
|
|
9
|
-
import { Modal as
|
|
7
|
+
import { Button as A } from "../core/button.js";
|
|
8
|
+
import { resolveThemeName as We, themeMode as Xe, readPersistedTheme as Ge, applyTheme as te, listThemes as Qe } from "../theme.js";
|
|
9
|
+
import { Modal as ie, confirmModal as Ze } from "../core/modal.js";
|
|
10
10
|
import { b as et, D as tt, a as rt } from "./data-table-toolbar-BUy2EWPy.js";
|
|
11
|
-
import { Textarea as at, Input as
|
|
11
|
+
import { Textarea as at, Input as V } from "../core/input.js";
|
|
12
12
|
import { Label as nt } from "../core/label.js";
|
|
13
|
-
import { Select as
|
|
14
|
-
import { Switch as
|
|
15
|
-
import { Card as
|
|
13
|
+
import { Select as oe } from "../core/select.js";
|
|
14
|
+
import { Switch as ue } from "../core/switch.js";
|
|
15
|
+
import { Card as ce, CardHeader as de, CardDescription as me, CardTitle as pe, CardContent as fe } from "../core/card.js";
|
|
16
16
|
const lt = [
|
|
17
17
|
{ path: "/login", name: "login" },
|
|
18
18
|
{ path: "/register", name: "register" },
|
|
@@ -28,39 +28,39 @@ const lt = [
|
|
|
28
28
|
{ path: "/admin-setup", name: "adminSetup" }
|
|
29
29
|
];
|
|
30
30
|
function it({ mode: t, config: a, children: n }) {
|
|
31
|
-
const r = t === "auth" || t === "auth+utility", l = t === "utility" || t === "auth+utility",
|
|
31
|
+
const r = t === "auth" || t === "auth+utility", l = t === "utility" || t === "auth+utility", m = [
|
|
32
32
|
...r ? lt : [],
|
|
33
33
|
...l ? st : []
|
|
34
|
-
], [
|
|
35
|
-
return
|
|
36
|
-
let
|
|
37
|
-
return import("../pages.js").then((
|
|
38
|
-
|
|
34
|
+
], [p, v] = i.useState(null);
|
|
35
|
+
return i.useEffect(() => {
|
|
36
|
+
let h = !1;
|
|
37
|
+
return import("../pages.js").then((f) => {
|
|
38
|
+
h || v(f.PagesRegistry);
|
|
39
39
|
}), () => {
|
|
40
|
-
|
|
40
|
+
h = !0;
|
|
41
41
|
};
|
|
42
|
-
}, []),
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
return
|
|
42
|
+
}, []), p ? /* @__PURE__ */ d(Me, { children: [
|
|
43
|
+
m.map(({ path: h, name: f }) => {
|
|
44
|
+
const k = p[f];
|
|
45
|
+
return k ? /* @__PURE__ */ e(ee, { path: h, element: /* @__PURE__ */ e(k, { ...(a == null ? void 0 : a[f]) ?? {} }) }, h) : null;
|
|
46
46
|
}),
|
|
47
47
|
n,
|
|
48
|
-
r ? /* @__PURE__ */ e(
|
|
48
|
+
r ? /* @__PURE__ */ e(ee, { path: "*", element: /* @__PURE__ */ e($e, { to: "/login", replace: !0 }) }) : null
|
|
49
49
|
] }) : /* @__PURE__ */ e("div", { className: "p-8 text-center text-sm text-[var(--prui-dim)]", children: "Loading…" });
|
|
50
50
|
}
|
|
51
|
-
const ot =
|
|
51
|
+
const ot = i.lazy(
|
|
52
52
|
() => Promise.resolve().then(() => Ct).then((t) => ({ default: t.SessionTimeout }))
|
|
53
53
|
);
|
|
54
54
|
function ut(t) {
|
|
55
|
-
const a = t !== !1, n = typeof t == "object" ? t : {}, r = n.persist !== !1, l = We(n.default ?? "control"),
|
|
56
|
-
(
|
|
57
|
-
f
|
|
55
|
+
const a = t !== !1, n = typeof t == "object" ? t : {}, r = n.persist !== !1, l = We(n.default ?? "control"), m = Xe(l), [p, v] = i.useState(() => (r ? Ge() : null) ?? { theme: l, mode: m }), h = i.useCallback(
|
|
56
|
+
(f) => {
|
|
57
|
+
v(f), te({ theme: f.theme, mode: f.mode, storageKey: r ? "prui:theme" : null });
|
|
58
58
|
},
|
|
59
59
|
[r]
|
|
60
60
|
);
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
}, [
|
|
61
|
+
return i.useEffect(() => {
|
|
62
|
+
te({ theme: p.theme, mode: p.mode, storageKey: r ? "prui:theme" : null });
|
|
63
|
+
}, [p, r]), { enabled: a, state: p, setTheme: h };
|
|
64
64
|
}
|
|
65
65
|
function ct({ config: t }) {
|
|
66
66
|
const { enabled: a, state: n, setTheme: r } = ut(t);
|
|
@@ -86,51 +86,51 @@ function ct({ config: t }) {
|
|
|
86
86
|
}
|
|
87
87
|
) : null;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function re(t, a) {
|
|
90
90
|
return a === "/" ? t === "/" : t === a || t.startsWith(a + "/");
|
|
91
91
|
}
|
|
92
|
-
function dt({ item: t, onNavigate: a }) {
|
|
93
|
-
const { pathname:
|
|
94
|
-
(
|
|
95
|
-
), [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
const
|
|
92
|
+
function dt({ item: t, onNavigate: a, expandAllOn: n }) {
|
|
93
|
+
const { pathname: r } = se(), l = (t.items ?? []).some(
|
|
94
|
+
(h) => h.href ? re(r, h.href) : (h.items ?? []).some((f) => f.href && re(r, f.href))
|
|
95
|
+
), [m, p] = i.useState(l || n !== void 0 && r === n);
|
|
96
|
+
i.useEffect(() => {
|
|
97
|
+
l && p(!0);
|
|
98
|
+
}, [l]);
|
|
99
|
+
const v = t.icon;
|
|
100
100
|
return /* @__PURE__ */ d("li", { "data-testid": "nav-group", children: [
|
|
101
101
|
/* @__PURE__ */ d(
|
|
102
102
|
"button",
|
|
103
103
|
{
|
|
104
104
|
type: "button",
|
|
105
|
-
"aria-expanded":
|
|
106
|
-
onClick: () => p((
|
|
107
|
-
className:
|
|
105
|
+
"aria-expanded": m,
|
|
106
|
+
onClick: () => p((h) => !h),
|
|
107
|
+
className: E(
|
|
108
108
|
"flex w-full items-center gap-2 rounded-[var(--prui-radius)] px-2.5 py-1.5 text-sm cursor-pointer",
|
|
109
|
-
|
|
109
|
+
l ? "text-[var(--prui-fg)]" : "text-[var(--prui-dim)] hover:text-[var(--prui-fg)]"
|
|
110
110
|
),
|
|
111
111
|
children: [
|
|
112
|
-
|
|
112
|
+
v ? /* @__PURE__ */ e(v, { className: "h-4 w-4 shrink-0", "aria-hidden": !0 }) : null,
|
|
113
113
|
/* @__PURE__ */ e("span", { className: "flex-1 text-left truncate", children: t.label }),
|
|
114
|
-
/* @__PURE__ */ e(Ke, { className:
|
|
114
|
+
/* @__PURE__ */ e(Ke, { className: E("h-4 w-4 transition-transform", !m && "-rotate-90"), "aria-hidden": !0 })
|
|
115
115
|
]
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
|
-
|
|
118
|
+
m ? /* @__PURE__ */ e("ul", { className: "ml-4 mt-0.5 flex flex-col gap-0.5 border-l border-[var(--prui-line)] pl-2", children: (t.items ?? []).map((h) => /* @__PURE__ */ e(he, { item: h, onNavigate: a, nested: !0, expandAllOn: n }, h.href ?? h.label)) }) : null
|
|
119
119
|
] });
|
|
120
120
|
}
|
|
121
121
|
function mt({ label: t }) {
|
|
122
122
|
return /* @__PURE__ */ e("li", { className: "px-2.5 pb-1 pt-3 text-[10px] font-semibold uppercase tracking-[0.1em] text-[var(--prui-dim)]", "data-testid": "nav-subgroup", children: t });
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
return t.items && t.items.length > 0 ? /* @__PURE__ */ e(dt, { item: t, onNavigate: a }) : t.heading || !t.href && !t.items ? /* @__PURE__ */ e(mt, { label: t.label }) : t.href ? /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
124
|
+
function he({ item: t, onNavigate: a, nested: n, expandAllOn: r }) {
|
|
125
|
+
return t.items && t.items.length > 0 ? /* @__PURE__ */ e(dt, { item: t, onNavigate: a, expandAllOn: r }) : t.heading || !t.href && !t.items ? /* @__PURE__ */ e(mt, { label: t.label }) : t.href ? /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
126
126
|
Le,
|
|
127
127
|
{
|
|
128
128
|
to: t.href,
|
|
129
129
|
onClick: a,
|
|
130
|
-
className: ({ isActive:
|
|
130
|
+
className: ({ isActive: l }) => E(
|
|
131
131
|
"flex items-center gap-2 rounded-[var(--prui-radius)] px-2.5 py-1.5 text-sm",
|
|
132
132
|
n && "pl-2.5",
|
|
133
|
-
|
|
133
|
+
l ? "bg-[var(--prui-brand)]/15 text-[var(--prui-brand)] font-medium" : "text-[var(--prui-dim)] hover:text-[var(--prui-fg)] hover:bg-[var(--prui-raise)]"
|
|
134
134
|
),
|
|
135
135
|
children: [
|
|
136
136
|
t.icon && !n ? /* @__PURE__ */ e(t.icon, { className: "h-4 w-4 shrink-0", "aria-hidden": !0 }) : null,
|
|
@@ -139,8 +139,8 @@ function fe({ item: t, onNavigate: a, nested: n }) {
|
|
|
139
139
|
}
|
|
140
140
|
) }) : null;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
return /* @__PURE__ */ e("nav", { "aria-label": "Main", className: "prui-app-nav", children: /* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.map((
|
|
142
|
+
function ae({ nav: t, onNavigate: a, expandAllOn: n }) {
|
|
143
|
+
return /* @__PURE__ */ e("nav", { "aria-label": "Main", className: "prui-app-nav", children: /* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.map((r) => /* @__PURE__ */ e(he, { item: r, onNavigate: a, expandAllOn: n }, r.href ?? r.label)) }) });
|
|
144
144
|
}
|
|
145
145
|
function pt({ brand: t }) {
|
|
146
146
|
if (!t) return null;
|
|
@@ -157,21 +157,21 @@ function ft({
|
|
|
157
157
|
placeholder: r = "Type a command or search...",
|
|
158
158
|
onNavigate: l
|
|
159
159
|
}) {
|
|
160
|
-
const [
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
}, [n,
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
a(!1),
|
|
160
|
+
const [m, p] = i.useState(""), [v, h] = i.useState(0), f = i.useMemo(() => {
|
|
161
|
+
const u = m.trim().toLowerCase();
|
|
162
|
+
return u ? n.filter((b) => b.label.toLowerCase().includes(u)) : n;
|
|
163
|
+
}, [n, m]);
|
|
164
|
+
if (i.useEffect(() => h(0), [m]), !t) return null;
|
|
165
|
+
const k = (u) => {
|
|
166
|
+
a(!1), u.onSelect ? u.onSelect() : u.href && (l == null || l(u.href));
|
|
167
167
|
};
|
|
168
168
|
return /* @__PURE__ */ e(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
className: "fixed inset-0 z-50 flex items-start justify-center pt-24",
|
|
172
172
|
style: { backgroundColor: "rgba(0,0,0,0.55)" },
|
|
173
|
-
onMouseDown: (
|
|
174
|
-
|
|
173
|
+
onMouseDown: (u) => {
|
|
174
|
+
u.target === u.currentTarget && a(!1);
|
|
175
175
|
},
|
|
176
176
|
children: /* @__PURE__ */ d(
|
|
177
177
|
"div",
|
|
@@ -190,37 +190,37 @@ function ft({
|
|
|
190
190
|
role: "combobox",
|
|
191
191
|
"aria-expanded": "true",
|
|
192
192
|
"aria-label": "Command palette search",
|
|
193
|
-
"aria-activedescendant":
|
|
193
|
+
"aria-activedescendant": f[v] ? `palette-option-${v}` : void 0,
|
|
194
194
|
placeholder: r,
|
|
195
|
-
value:
|
|
196
|
-
onChange: (
|
|
197
|
-
onKeyDown: (
|
|
198
|
-
if (
|
|
199
|
-
const b =
|
|
195
|
+
value: m,
|
|
196
|
+
onChange: (u) => p(u.target.value),
|
|
197
|
+
onKeyDown: (u) => {
|
|
198
|
+
if (u.key === "Escape" && a(!1), u.key === "ArrowDown" && (u.preventDefault(), h((b) => Math.min(b + 1, f.length - 1))), u.key === "ArrowUp" && (u.preventDefault(), h((b) => Math.max(b - 1, 0))), u.key === "Enter") {
|
|
199
|
+
const b = f[v];
|
|
200
200
|
b && (a(!1), b.onSelect ? b.onSelect() : b.href && (l == null || l(b.href)));
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
className: "w-full bg-transparent px-4 py-3 text-sm text-[var(--prui-fg)] placeholder:text-[var(--prui-dim)] outline-none border-b border-[var(--prui-line)] rounded-t-[var(--prui-radius)]"
|
|
204
204
|
}
|
|
205
205
|
),
|
|
206
|
-
/* @__PURE__ */ e("ul", { role: "listbox", className: "max-h-64 overflow-auto p-1", children:
|
|
206
|
+
/* @__PURE__ */ e("ul", { role: "listbox", className: "max-h-64 overflow-auto p-1", children: f.length === 0 ? /* @__PURE__ */ e("li", { className: "px-3 py-2 text-sm text-[var(--prui-dim)]", children: "No matches." }) : f.map((u, b) => /* @__PURE__ */ d(
|
|
207
207
|
"li",
|
|
208
208
|
{
|
|
209
209
|
id: `palette-option-${b}`,
|
|
210
210
|
role: "option",
|
|
211
|
-
"aria-selected": b ===
|
|
212
|
-
onMouseEnter: () =>
|
|
213
|
-
onClick: () =>
|
|
214
|
-
className:
|
|
211
|
+
"aria-selected": b === v,
|
|
212
|
+
onMouseEnter: () => h(b),
|
|
213
|
+
onClick: () => k(u),
|
|
214
|
+
className: E(
|
|
215
215
|
"cursor-pointer rounded-[calc(var(--prui-radius)-1px)] px-3 py-2 text-sm text-[var(--prui-fg)]",
|
|
216
|
-
b ===
|
|
216
|
+
b === v && "bg-[var(--prui-raise)]"
|
|
217
217
|
),
|
|
218
218
|
children: [
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
u.group ? /* @__PURE__ */ e("span", { className: "mr-2 text-xs text-[var(--prui-dim)]", children: u.group }) : null,
|
|
220
|
+
u.label
|
|
221
221
|
]
|
|
222
222
|
},
|
|
223
|
-
`${
|
|
223
|
+
`${u.label}-${b}`
|
|
224
224
|
)) })
|
|
225
225
|
]
|
|
226
226
|
}
|
|
@@ -234,62 +234,63 @@ function ht(t) {
|
|
|
234
234
|
nav: n = [],
|
|
235
235
|
search: r = !0,
|
|
236
236
|
theme: l = !0,
|
|
237
|
-
auth:
|
|
238
|
-
sidebar:
|
|
239
|
-
header:
|
|
240
|
-
pages:
|
|
241
|
-
pagesConfig:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
237
|
+
auth: m = !1,
|
|
238
|
+
sidebar: p = {},
|
|
239
|
+
header: v,
|
|
240
|
+
pages: h,
|
|
241
|
+
pagesConfig: f,
|
|
242
|
+
expandAllOn: k,
|
|
243
|
+
children: u
|
|
244
|
+
} = t, b = typeof r == "object" ? r : { enabled: r !== !1 }, M = b.enabled !== !1, P = b.hotkey ?? "/", O = p.collapsible !== !1, [y, T] = i.useState(p.defaultOpen === !0), [R, C] = i.useState(!1), $ = se(), w = Ae(), s = i.useMemo(
|
|
245
|
+
() => m === !1 ? null : m === !0 ? {} : m,
|
|
246
|
+
[m]
|
|
247
|
+
), g = i.useCallback(() => {
|
|
248
|
+
s != null && s.onTimeout ? s.onTimeout() : w((s == null ? void 0 : s.loginPath) ?? "/login");
|
|
249
|
+
}, [s, w]), x = i.useMemo(() => {
|
|
250
|
+
const N = [];
|
|
251
|
+
for (const S of n)
|
|
252
|
+
if (S.items)
|
|
253
|
+
for (const j of S.items)
|
|
254
|
+
j.href && N.push({ label: `${S.label} / ${j.label}`, href: j.href, group: S.label });
|
|
255
|
+
else S.href && N.push({ label: S.label, href: S.href });
|
|
256
|
+
return N;
|
|
256
257
|
}, [n]);
|
|
257
|
-
|
|
258
|
-
if (!
|
|
259
|
-
const
|
|
260
|
-
const j =
|
|
261
|
-
|
|
258
|
+
i.useEffect(() => {
|
|
259
|
+
if (!M) return;
|
|
260
|
+
const N = (S) => {
|
|
261
|
+
const j = S.target, q = j && (j.tagName === "INPUT" || j.tagName === "TEXTAREA" || j.isContentEditable);
|
|
262
|
+
S.key === P && !q && !S.metaKey && !S.ctrlKey && !S.altKey && (S.preventDefault(), C(!0));
|
|
262
263
|
};
|
|
263
|
-
return document.addEventListener("keydown",
|
|
264
|
-
}, [
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}, [
|
|
269
|
-
if (!
|
|
270
|
-
const
|
|
264
|
+
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
265
|
+
}, [P, M]);
|
|
266
|
+
const c = i.useRef($.pathname);
|
|
267
|
+
i.useEffect(() => {
|
|
268
|
+
c.current !== $.pathname && (c.current = $.pathname, T(!1));
|
|
269
|
+
}, [$.pathname]), i.useEffect(() => {
|
|
270
|
+
if (!y) return;
|
|
271
|
+
const N = document.body.style.overflow;
|
|
271
272
|
return document.body.style.overflow = "hidden", () => {
|
|
272
|
-
document.body.style.overflow =
|
|
273
|
+
document.body.style.overflow = N;
|
|
273
274
|
};
|
|
274
|
-
}, [
|
|
275
|
-
const
|
|
275
|
+
}, [y]);
|
|
276
|
+
const z = p.width ?? 240;
|
|
276
277
|
return /* @__PURE__ */ d("div", { className: "prui-app flex min-h-screen bg-[var(--prui-background)] text-[var(--prui-fg)]", children: [
|
|
277
278
|
/* @__PURE__ */ e(
|
|
278
279
|
"aside",
|
|
279
280
|
{
|
|
280
281
|
"data-testid": "sidebar",
|
|
281
282
|
className: "hidden md:block md:fixed md:inset-y-0 md:left-0 md:z-30 md:w-[var(--prui-sidebar-width)] md:border-r md:border-[var(--prui-line)] md:bg-[var(--prui-surface)]",
|
|
282
|
-
style: { "--prui-sidebar-width": `${
|
|
283
|
-
children: /* @__PURE__ */ e("div", { className: "h-full overflow-y-auto p-2 pt-4 scrollbar-thin", children: /* @__PURE__ */ e(
|
|
283
|
+
style: { "--prui-sidebar-width": `${z}px` },
|
|
284
|
+
children: /* @__PURE__ */ e("div", { className: "h-full overflow-y-auto p-2 pt-4 scrollbar-thin", children: /* @__PURE__ */ e(ae, { nav: n, expandAllOn: k }) })
|
|
284
285
|
}
|
|
285
286
|
),
|
|
286
|
-
|
|
287
|
+
y ? /* @__PURE__ */ d("div", { className: "md:hidden fixed inset-0 z-40", "data-testid": "mobile-drawer", children: [
|
|
287
288
|
/* @__PURE__ */ e(
|
|
288
289
|
"div",
|
|
289
290
|
{
|
|
290
291
|
className: "absolute inset-0",
|
|
291
292
|
style: { backgroundColor: "rgba(0,0,0,0.55)" },
|
|
292
|
-
onClick: () =>
|
|
293
|
+
onClick: () => T(!1),
|
|
293
294
|
"data-testid": "drawer-backdrop"
|
|
294
295
|
}
|
|
295
296
|
),
|
|
@@ -306,37 +307,37 @@ function ht(t) {
|
|
|
306
307
|
{
|
|
307
308
|
type: "button",
|
|
308
309
|
"aria-label": "Close navigation",
|
|
309
|
-
onClick: () =>
|
|
310
|
+
onClick: () => T(!1),
|
|
310
311
|
className: "rounded-[var(--prui-radius)] p-1 text-[var(--prui-dim)] hover:text-[var(--prui-fg)] cursor-pointer",
|
|
311
312
|
children: /* @__PURE__ */ e(Ie, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
312
313
|
}
|
|
313
314
|
) }),
|
|
314
|
-
/* @__PURE__ */ e(
|
|
315
|
+
/* @__PURE__ */ e(ae, { nav: n, onNavigate: () => T(!1), expandAllOn: k })
|
|
315
316
|
]
|
|
316
317
|
}
|
|
317
318
|
)
|
|
318
319
|
] }) : null,
|
|
319
|
-
/* @__PURE__ */ d("div", { className: "flex min-w-0 flex-1 flex-col md:ml-[var(--prui-sidebar-width)]", style: { "--prui-sidebar-width": `${
|
|
320
|
+
/* @__PURE__ */ d("div", { className: "flex min-w-0 flex-1 flex-col md:ml-[var(--prui-sidebar-width)]", style: { "--prui-sidebar-width": `${z}px` }, children: [
|
|
320
321
|
/* @__PURE__ */ d(
|
|
321
322
|
"header",
|
|
322
323
|
{
|
|
323
324
|
"data-testid": "app-header",
|
|
324
325
|
className: "sticky top-0 z-30 grid h-14 grid-cols-[1fr_auto_1fr] items-center gap-4 border-b border-[var(--prui-line)] bg-[var(--prui-surface)] px-4 md:px-6",
|
|
325
326
|
children: [
|
|
326
|
-
|
|
327
|
-
|
|
327
|
+
O ? /* @__PURE__ */ e(
|
|
328
|
+
A,
|
|
328
329
|
{
|
|
329
330
|
variant: "ghost",
|
|
330
331
|
size: "icon",
|
|
331
332
|
"aria-label": "Open navigation",
|
|
332
333
|
className: "md:hidden",
|
|
333
|
-
onClick: () =>
|
|
334
|
+
onClick: () => T(!0),
|
|
334
335
|
"data-testid": "drawer-toggle",
|
|
335
336
|
children: /* @__PURE__ */ e(_e, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
336
337
|
}
|
|
337
338
|
) : null,
|
|
338
339
|
/* @__PURE__ */ e("div", { className: "min-w-0 justify-self-start", children: /* @__PURE__ */ e(pt, { brand: a }) }),
|
|
339
|
-
|
|
340
|
+
M ? /* @__PURE__ */ d(
|
|
340
341
|
"button",
|
|
341
342
|
{
|
|
342
343
|
type: "button",
|
|
@@ -345,29 +346,29 @@ function ht(t) {
|
|
|
345
346
|
className: "hidden h-8 w-[min(420px,34vw)] items-center gap-2 rounded-[var(--prui-radius)] border border-[var(--prui-line)] bg-[var(--prui-background)] px-3.5 text-sm text-[var(--prui-dim)] hover:border-[var(--prui-dim)] cursor-pointer md:flex",
|
|
346
347
|
children: [
|
|
347
348
|
/* @__PURE__ */ e(qe, { className: "h-4 w-4", "aria-hidden": !0 }),
|
|
348
|
-
/* @__PURE__ */ e("span", { className: "flex-1 text-left", children:
|
|
349
|
-
/* @__PURE__ */ e("kbd", { className: "ml-auto rounded-[var(--prui-radius-1)] border border-[var(--prui-line)] bg-[var(--prui-raise)] px-1.5 py-0.5 text-xs", children:
|
|
349
|
+
/* @__PURE__ */ e("span", { className: "flex-1 text-left", children: b.placeholder ?? "Search..." }),
|
|
350
|
+
/* @__PURE__ */ e("kbd", { className: "ml-auto rounded-[var(--prui-radius-1)] border border-[var(--prui-line)] bg-[var(--prui-raise)] px-1.5 py-0.5 text-xs", children: P })
|
|
350
351
|
]
|
|
351
352
|
}
|
|
352
353
|
) : null,
|
|
353
354
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 justify-self-end", children: [
|
|
354
|
-
|
|
355
|
+
v,
|
|
355
356
|
/* @__PURE__ */ e(ct, { config: l })
|
|
356
357
|
] })
|
|
357
358
|
]
|
|
358
359
|
}
|
|
359
360
|
),
|
|
360
|
-
/* @__PURE__ */ e("main", { className: "flex-1 p-4 md:p-6", children:
|
|
361
|
+
/* @__PURE__ */ e("main", { className: "flex-1 p-4 md:p-6", children: h ? /* @__PURE__ */ e(it, { mode: h, config: f, children: u }) : u ?? /* @__PURE__ */ e(De, {}) })
|
|
361
362
|
] }),
|
|
362
|
-
|
|
363
|
+
s ? /* @__PURE__ */ e(i.Suspense, { fallback: null, children: /* @__PURE__ */ e(
|
|
363
364
|
ot,
|
|
364
365
|
{
|
|
365
|
-
timeout:
|
|
366
|
-
warningTime:
|
|
367
|
-
onTimeout:
|
|
366
|
+
timeout: s.sessionTimeout,
|
|
367
|
+
warningTime: s.warningTime,
|
|
368
|
+
onTimeout: g
|
|
368
369
|
}
|
|
369
370
|
) }) : null,
|
|
370
|
-
|
|
371
|
+
M ? /* @__PURE__ */ e(ft, { open: R, onOpenChange: C, entries: x, placeholder: b.placeholder, onNavigate: w }) : null
|
|
371
372
|
] });
|
|
372
373
|
}
|
|
373
374
|
function _t(t) {
|
|
@@ -386,6 +387,7 @@ const qt = {
|
|
|
386
387
|
{ name: "router", type: "'browser' | 'memory'", default: "'browser'", control: "select", options: ["browser", "memory", "react-router"] },
|
|
387
388
|
{ name: "initialEntries", type: "string[]", default: "undefined", control: "object" },
|
|
388
389
|
{ name: "pages", type: "'auth' | 'utility' | 'auth+utility'", default: "undefined", control: "select", options: ["auth", "utility", "auth+utility"] },
|
|
390
|
+
{ name: "expandAllOn", type: "string (pathname)", default: "undefined", control: "text" },
|
|
389
391
|
{ name: "header", type: "ReactNode", default: null, control: "none" },
|
|
390
392
|
{ name: "children", type: "ReactNode", default: "Outlet", control: "none" }
|
|
391
393
|
]
|
|
@@ -397,7 +399,7 @@ function gt(t) {
|
|
|
397
399
|
if (t)
|
|
398
400
|
return t.map((a) => typeof a == "string" || typeof a == "number" ? { label: String(a), value: String(a) } : a);
|
|
399
401
|
}
|
|
400
|
-
function
|
|
402
|
+
function ne(t, a) {
|
|
401
403
|
const n = {};
|
|
402
404
|
for (const r of t.fields)
|
|
403
405
|
a && r.name in a ? n[r.name] = a[r.name] : r.defaultValue !== void 0 ? n[r.name] = r.defaultValue : r.type === "boolean" ? n[r.name] = !1 : n[r.name] = "";
|
|
@@ -409,112 +411,112 @@ function vt({
|
|
|
409
411
|
defaultValues: n,
|
|
410
412
|
onSubmit: r,
|
|
411
413
|
onCancel: l,
|
|
412
|
-
cancelLabel:
|
|
413
|
-
submitting:
|
|
414
|
-
error:
|
|
415
|
-
className:
|
|
414
|
+
cancelLabel: m = "Cancel",
|
|
415
|
+
submitting: p = !1,
|
|
416
|
+
error: v,
|
|
417
|
+
className: h
|
|
416
418
|
}) {
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
b(
|
|
420
|
-
}, [JSON.stringify(
|
|
421
|
-
const
|
|
422
|
-
b((
|
|
423
|
-
if (!
|
|
424
|
-
const c = { ...
|
|
425
|
-
return delete c[
|
|
419
|
+
const f = i.useMemo(() => bt(t), [t]), k = a ?? n, [u, b] = i.useState(() => ne(f, k)), [M, P] = i.useState({}), [O, y] = i.useState(null), [T, R] = i.useState(!1);
|
|
420
|
+
i.useEffect(() => {
|
|
421
|
+
b(ne(f, k));
|
|
422
|
+
}, [JSON.stringify(f), JSON.stringify(k ?? {})]);
|
|
423
|
+
const C = (s, g) => {
|
|
424
|
+
b((x) => ({ ...x, [s]: g })), P((x) => {
|
|
425
|
+
if (!x[s]) return x;
|
|
426
|
+
const c = { ...x };
|
|
427
|
+
return delete c[s], c;
|
|
426
428
|
});
|
|
427
|
-
},
|
|
428
|
-
var
|
|
429
|
-
|
|
429
|
+
}, $ = async (s) => {
|
|
430
|
+
var x;
|
|
431
|
+
s.preventDefault();
|
|
430
432
|
const g = {};
|
|
431
|
-
for (const c of
|
|
433
|
+
for (const c of f.fields) {
|
|
432
434
|
if (c.required) {
|
|
433
|
-
const N =
|
|
435
|
+
const N = u[c.name];
|
|
434
436
|
(N === "" || N == null || Array.isArray(N) && N.length === 0) && (g[c.name] = c.name === void 0 ? "Required" : `${c.label} is required.`);
|
|
435
437
|
}
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
+
const z = (x = c.validate) == null ? void 0 : x.call(c, u[c.name], u);
|
|
439
|
+
z && (g[c.name] = z);
|
|
438
440
|
}
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
+
if (P(g), !(Object.keys(g).length > 0)) {
|
|
442
|
+
y(null);
|
|
441
443
|
try {
|
|
442
|
-
const c = r == null ? void 0 : r({ ...
|
|
443
|
-
c && typeof c.then == "function" && (
|
|
444
|
+
const c = r == null ? void 0 : r({ ...u });
|
|
445
|
+
c && typeof c.then == "function" && (R(!0), await c);
|
|
444
446
|
} catch (c) {
|
|
445
|
-
|
|
447
|
+
y(c instanceof Error ? c.message : String(c));
|
|
446
448
|
} finally {
|
|
447
|
-
|
|
449
|
+
R(!1);
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
|
-
},
|
|
451
|
-
return /* @__PURE__ */ d("form", { onSubmit:
|
|
452
|
-
/* @__PURE__ */ e("div", { className:
|
|
453
|
-
const g = M[
|
|
454
|
-
id: `prui-form-${
|
|
452
|
+
}, w = p || T;
|
|
453
|
+
return /* @__PURE__ */ d("form", { onSubmit: $, className: E("prui-form flex flex-col gap-4", h), noValidate: !0, children: [
|
|
454
|
+
/* @__PURE__ */ e("div", { className: E("grid gap-4", f.columns === 2 && "md:grid-cols-2"), children: f.fields.map((s) => {
|
|
455
|
+
const g = M[s.name], x = {
|
|
456
|
+
id: `prui-form-${s.name}`,
|
|
455
457
|
"aria-invalid": g ? !0 : void 0,
|
|
456
|
-
"aria-describedby": g ? `prui-form-${
|
|
458
|
+
"aria-describedby": g ? `prui-form-${s.name}-error` : void 0
|
|
457
459
|
};
|
|
458
|
-
return /* @__PURE__ */ d("div", { className:
|
|
459
|
-
/* @__PURE__ */ d(nt, { htmlFor:
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
return /* @__PURE__ */ d("div", { className: E("flex flex-col gap-1.5", s.colSpan === 2 && "md:col-span-2", s.className), children: [
|
|
461
|
+
/* @__PURE__ */ d(nt, { htmlFor: x.id, children: [
|
|
462
|
+
s.label,
|
|
463
|
+
s.required ? /* @__PURE__ */ e("span", { className: "ml-0.5 text-[var(--prui-danger)]", children: "*" }) : null
|
|
462
464
|
] }),
|
|
463
|
-
|
|
465
|
+
s.type === "textarea" ? /* @__PURE__ */ e(
|
|
464
466
|
at,
|
|
465
467
|
{
|
|
466
|
-
...
|
|
467
|
-
placeholder:
|
|
468
|
-
disabled:
|
|
469
|
-
value: String(
|
|
470
|
-
onChange: (c) =>
|
|
468
|
+
...x,
|
|
469
|
+
placeholder: s.placeholder,
|
|
470
|
+
disabled: s.disabled || w,
|
|
471
|
+
value: String(u[s.name] ?? ""),
|
|
472
|
+
onChange: (c) => C(s.name, c.target.value)
|
|
471
473
|
}
|
|
472
|
-
) :
|
|
473
|
-
|
|
474
|
+
) : s.type === "select" ? /* @__PURE__ */ e(
|
|
475
|
+
oe,
|
|
474
476
|
{
|
|
475
|
-
...
|
|
476
|
-
options: gt(
|
|
477
|
-
placeholder:
|
|
478
|
-
disabled:
|
|
479
|
-
value: String(
|
|
480
|
-
onChange: (c) =>
|
|
477
|
+
...x,
|
|
478
|
+
options: gt(s.options),
|
|
479
|
+
placeholder: s.placeholder,
|
|
480
|
+
disabled: s.disabled || w,
|
|
481
|
+
value: String(u[s.name] ?? ""),
|
|
482
|
+
onChange: (c) => C(s.name, c)
|
|
481
483
|
}
|
|
482
|
-
) :
|
|
483
|
-
|
|
484
|
+
) : s.type === "date" ? /* @__PURE__ */ e(
|
|
485
|
+
V,
|
|
484
486
|
{
|
|
485
|
-
...
|
|
487
|
+
...x,
|
|
486
488
|
type: "date",
|
|
487
|
-
placeholder:
|
|
488
|
-
disabled:
|
|
489
|
-
value: String(
|
|
490
|
-
onChange: (c) =>
|
|
489
|
+
placeholder: s.placeholder,
|
|
490
|
+
disabled: s.disabled || w,
|
|
491
|
+
value: String(u[s.name] ?? ""),
|
|
492
|
+
onChange: (c) => C(s.name, c.target.value)
|
|
491
493
|
}
|
|
492
|
-
) :
|
|
493
|
-
|
|
494
|
+
) : s.type === "boolean" ? /* @__PURE__ */ e(
|
|
495
|
+
ue,
|
|
494
496
|
{
|
|
495
|
-
...
|
|
496
|
-
disabled:
|
|
497
|
-
checked: !!
|
|
498
|
-
onChange: (c) =>
|
|
497
|
+
...x,
|
|
498
|
+
disabled: s.disabled || w,
|
|
499
|
+
checked: !!u[s.name],
|
|
500
|
+
onChange: (c) => C(s.name, c)
|
|
499
501
|
}
|
|
500
502
|
) : /* @__PURE__ */ e(
|
|
501
|
-
|
|
503
|
+
V,
|
|
502
504
|
{
|
|
503
|
-
...
|
|
504
|
-
type:
|
|
505
|
-
placeholder:
|
|
506
|
-
disabled:
|
|
507
|
-
value: String(
|
|
508
|
-
onChange: (c) =>
|
|
505
|
+
...x,
|
|
506
|
+
type: s.type ?? "text",
|
|
507
|
+
placeholder: s.placeholder,
|
|
508
|
+
disabled: s.disabled || w,
|
|
509
|
+
value: String(u[s.name] ?? ""),
|
|
510
|
+
onChange: (c) => C(s.name, s.type === "number" ? c.target.value === "" ? "" : Number(c.target.value) : c.target.value)
|
|
509
511
|
}
|
|
510
512
|
),
|
|
511
|
-
g ? /* @__PURE__ */ e("p", { id: `prui-form-${
|
|
512
|
-
] },
|
|
513
|
+
g ? /* @__PURE__ */ e("p", { id: `prui-form-${s.name}-error`, role: "alert", className: "text-xs text-[var(--prui-danger)]", children: g }) : null
|
|
514
|
+
] }, s.name);
|
|
513
515
|
}) }),
|
|
514
|
-
|
|
516
|
+
v ?? O ? /* @__PURE__ */ e("p", { role: "alert", "data-testid": "form-error", className: "rounded-[var(--prui-radius)] border border-[var(--prui-danger)]/40 bg-[var(--prui-danger)]/10 px-3 py-2 text-sm text-[var(--prui-danger)]", children: v ?? O }) : null,
|
|
515
517
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-end gap-2", children: [
|
|
516
|
-
l ? /* @__PURE__ */ e(
|
|
517
|
-
/* @__PURE__ */ e(
|
|
518
|
+
l ? /* @__PURE__ */ e(A, { type: "button", variant: "ghost", onClick: l, disabled: w, children: m }) : null,
|
|
519
|
+
/* @__PURE__ */ e(A, { type: "submit", variant: "primary", loading: w, children: f.submitLabel ?? "Submit" })
|
|
518
520
|
] })
|
|
519
521
|
] });
|
|
520
522
|
}
|
|
@@ -529,7 +531,7 @@ const Bt = {
|
|
|
529
531
|
{ name: "error", type: "string | null", default: "null", control: "text" }
|
|
530
532
|
]
|
|
531
533
|
};
|
|
532
|
-
function
|
|
534
|
+
function be(t) {
|
|
533
535
|
if (t)
|
|
534
536
|
return t.map((a) => typeof a == "string" || typeof a == "number" ? { label: String(a), value: String(a) } : a);
|
|
535
537
|
}
|
|
@@ -540,7 +542,7 @@ function xt(t, a) {
|
|
|
540
542
|
name: r.key,
|
|
541
543
|
label: typeof r.label == "string" ? r.label : r.key,
|
|
542
544
|
type: yt(r, a),
|
|
543
|
-
options: (l =
|
|
545
|
+
options: (l = be(r.filterOptions ?? r.options)) == null ? void 0 : l.map((m) => ({ label: m.label, value: m.value })),
|
|
544
546
|
required: !1
|
|
545
547
|
};
|
|
546
548
|
}), submitLabel: a ? "Save" : "Create" };
|
|
@@ -554,124 +556,124 @@ function Kt({
|
|
|
554
556
|
list: n,
|
|
555
557
|
create: r,
|
|
556
558
|
update: l,
|
|
557
|
-
remove:
|
|
558
|
-
delete:
|
|
559
|
-
actions:
|
|
560
|
-
form:
|
|
561
|
-
formSchema:
|
|
562
|
-
rowKey:
|
|
563
|
-
searchPlaceholder:
|
|
559
|
+
remove: m,
|
|
560
|
+
delete: p,
|
|
561
|
+
actions: v,
|
|
562
|
+
form: h,
|
|
563
|
+
formSchema: f,
|
|
564
|
+
rowKey: k,
|
|
565
|
+
searchPlaceholder: u,
|
|
564
566
|
pageSize: b = 20,
|
|
565
567
|
className: M
|
|
566
568
|
}) {
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
+
const P = m ?? p, O = v ?? ["create", "edit", "delete"], y = (o) => O.includes(o) && (o === "create" ? !!r : o === "edit" ? !!l : !!P), [T, R] = i.useState([]), [C, $] = i.useState(null), [w, s] = i.useState(1), [g, x] = i.useState(b), [c, z] = i.useState([null]), [N, S] = i.useState(""), [j, q] = i.useState({}), [B, ge] = i.useState(null), [ve, U] = i.useState(!0), [J, Y] = i.useState(null), [D, H] = i.useState(null), [xe, L] = i.useState(!1), [ye, W] = i.useState(!1), X = c[w - 1] ?? null, G = JSON.stringify(j), I = i.useCallback(async () => {
|
|
570
|
+
U(!0), Y(null);
|
|
569
571
|
try {
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
} catch (
|
|
573
|
-
|
|
572
|
+
const o = await n({ search: N, cursor: X, pageSize: g, sort: B, filters: j });
|
|
573
|
+
R(o.rows), $(o.nextCursor ?? o.cursor ?? null);
|
|
574
|
+
} catch (o) {
|
|
575
|
+
Y(o instanceof Error ? o.message : String(o)), R([]), $(null);
|
|
574
576
|
} finally {
|
|
575
|
-
|
|
577
|
+
U(!1);
|
|
576
578
|
}
|
|
577
|
-
}, [N,
|
|
578
|
-
|
|
579
|
+
}, [N, X, g, B, G, n]);
|
|
580
|
+
i.useEffect(() => {
|
|
579
581
|
I();
|
|
580
|
-
}, [I]),
|
|
581
|
-
|
|
582
|
-
}, [N, g,
|
|
583
|
-
const Ne = a.filter((
|
|
584
|
-
key:
|
|
585
|
-
label: typeof
|
|
586
|
-
type:
|
|
587
|
-
options:
|
|
588
|
-
})), we = (
|
|
589
|
-
|
|
582
|
+
}, [I]), i.useEffect(() => {
|
|
583
|
+
s(1), z([null]);
|
|
584
|
+
}, [N, g, G]);
|
|
585
|
+
const Ne = a.filter((o) => o.filter).map((o) => ({
|
|
586
|
+
key: o.key,
|
|
587
|
+
label: typeof o.label == "string" ? o.label : o.key,
|
|
588
|
+
type: o.filter === "numberrange" ? "number" : o.filter,
|
|
589
|
+
options: be(o.filterOptions ?? o.options)
|
|
590
|
+
})), we = (o, _) => {
|
|
591
|
+
q((K) => ({ ...K, [o]: _ }));
|
|
590
592
|
}, Se = () => {
|
|
591
|
-
|
|
592
|
-
}, ke = (
|
|
593
|
-
|
|
594
|
-
}, Ce = async (
|
|
593
|
+
H(null), L(!0);
|
|
594
|
+
}, ke = (o) => {
|
|
595
|
+
H(o), L(!0);
|
|
596
|
+
}, Ce = async (o) => {
|
|
595
597
|
if (!(!await Ze({
|
|
596
|
-
title: `Delete ${
|
|
598
|
+
title: `Delete ${F}?`,
|
|
597
599
|
message: "This action cannot be undone.",
|
|
598
600
|
confirmText: "Delete",
|
|
599
601
|
cancelText: "Cancel",
|
|
600
602
|
type: "danger"
|
|
601
|
-
}) || !
|
|
602
|
-
|
|
603
|
+
}) || !P)) {
|
|
604
|
+
W(!0);
|
|
603
605
|
try {
|
|
604
|
-
await
|
|
606
|
+
await P(o), await I();
|
|
605
607
|
} finally {
|
|
606
|
-
|
|
608
|
+
W(!1);
|
|
607
609
|
}
|
|
608
610
|
}
|
|
609
|
-
}, Te = (
|
|
611
|
+
}, Te = (o, _) => {
|
|
610
612
|
if (_ === "next") {
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
const
|
|
614
|
-
return
|
|
613
|
+
const K = C;
|
|
614
|
+
z((Re) => {
|
|
615
|
+
const Z = [...Re];
|
|
616
|
+
return Z[o - 1] = K, Z;
|
|
615
617
|
});
|
|
616
618
|
}
|
|
617
|
-
|
|
619
|
+
s(o);
|
|
618
620
|
}, Pe = [
|
|
619
|
-
...a.filter((
|
|
620
|
-
...
|
|
621
|
+
...a.filter((o) => !o.hidden),
|
|
622
|
+
...y("edit") || y("delete") ? [
|
|
621
623
|
{
|
|
622
624
|
key: "actions",
|
|
623
625
|
label: "",
|
|
624
626
|
align: "right",
|
|
625
|
-
render: (
|
|
626
|
-
|
|
627
|
-
|
|
627
|
+
render: (o) => /* @__PURE__ */ d("div", { className: "flex items-center justify-end gap-1", children: [
|
|
628
|
+
y("edit") ? /* @__PURE__ */ e(A, { variant: "ghost", size: "icon", "aria-label": "Edit", onClick: () => ke(o), "data-testid": "resource-edit", children: /* @__PURE__ */ e(Ve, { className: "h-3.5 w-3.5", "aria-hidden": !0 }) }) : null,
|
|
629
|
+
y("delete") ? /* @__PURE__ */ e(A, { variant: "ghost", size: "icon", "aria-label": "Delete", disabled: ye, onClick: () => void Ce(o), "data-testid": "resource-delete", children: /* @__PURE__ */ e(Ue, { className: "h-3.5 w-3.5 text-[var(--prui-danger)]", "aria-hidden": !0 }) }) : null
|
|
628
630
|
] })
|
|
629
631
|
}
|
|
630
632
|
] : []
|
|
631
|
-
],
|
|
632
|
-
|
|
633
|
-
) : void 0,
|
|
634
|
-
return /* @__PURE__ */ d("div", { className:
|
|
633
|
+
], Q = f ?? xt(a, D), Ee = D ? Object.fromEntries(
|
|
634
|
+
Q.fields.map((o) => [o.name, D[o.name] ?? ""])
|
|
635
|
+
) : void 0, F = t.replace(/s$/, "");
|
|
636
|
+
return /* @__PURE__ */ d("div", { className: E("prui-resource flex flex-col gap-2", M), "data-testid": "resource", children: [
|
|
635
637
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h1", { className: "text-xl font-semibold capitalize text-[var(--prui-fg)]", children: t }) }),
|
|
636
638
|
/* @__PURE__ */ e(
|
|
637
639
|
et,
|
|
638
640
|
{
|
|
639
|
-
searchPlaceholder:
|
|
641
|
+
searchPlaceholder: u ?? `Search ${t}...`,
|
|
640
642
|
searchValue: N,
|
|
641
|
-
onSearchChange:
|
|
643
|
+
onSearchChange: S,
|
|
642
644
|
filters: Ne,
|
|
643
|
-
filterValues:
|
|
645
|
+
filterValues: j,
|
|
644
646
|
onFilterChange: we,
|
|
645
|
-
actions:
|
|
647
|
+
actions: y("create") ? /* @__PURE__ */ d(A, { variant: "primary", size: "sm", onClick: Se, "data-testid": "resource-create", children: [
|
|
646
648
|
/* @__PURE__ */ e(Je, { className: "h-4 w-4", "aria-hidden": !0 }),
|
|
647
649
|
"New ",
|
|
648
|
-
|
|
650
|
+
F
|
|
649
651
|
] }) : void 0
|
|
650
652
|
}
|
|
651
653
|
),
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */ e(tt, { columns: Pe, rows:
|
|
654
|
+
J ? /* @__PURE__ */ e("div", { role: "alert", "data-testid": "resource-error", className: "rounded-[var(--prui-radius)] border border-[var(--prui-danger)]/40 bg-[var(--prui-danger)]/10 px-3 py-2 text-sm text-[var(--prui-danger)]", children: J }) : null,
|
|
655
|
+
/* @__PURE__ */ e(tt, { columns: Pe, rows: T, rowKey: k, sort: B, onSortChange: ge, loading: ve }),
|
|
654
656
|
/* @__PURE__ */ e(
|
|
655
657
|
rt,
|
|
656
658
|
{
|
|
657
|
-
page:
|
|
659
|
+
page: w,
|
|
658
660
|
pageSize: g,
|
|
659
|
-
hasNextPage:
|
|
660
|
-
hasPreviousPage:
|
|
661
|
+
hasNextPage: C != null,
|
|
662
|
+
hasPreviousPage: w > 1,
|
|
661
663
|
onPageChange: Te,
|
|
662
|
-
onPageSizeChange: (
|
|
664
|
+
onPageSizeChange: (o) => x(o)
|
|
663
665
|
}
|
|
664
666
|
),
|
|
665
|
-
/* @__PURE__ */ d(
|
|
666
|
-
/* @__PURE__ */ e("div", { className: "px-8 pt-8 pb-2", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", style: { color: "var(--prui-fg)" }, children:
|
|
667
|
-
/* @__PURE__ */ e("div", { className: "px-8 pb-8", children:
|
|
667
|
+
/* @__PURE__ */ d(ie, { open: xe, onClose: () => L(!1), size: "sm", ariaLabel: D ? `Edit ${F}` : `New ${F}`, noPadding: !0, children: [
|
|
668
|
+
/* @__PURE__ */ e("div", { className: "px-8 pt-8 pb-2", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", style: { color: "var(--prui-fg)" }, children: D ? `Edit ${F}` : `New ${F}` }) }),
|
|
669
|
+
/* @__PURE__ */ e("div", { className: "px-8 pb-8", children: h ?? /* @__PURE__ */ e(
|
|
668
670
|
vt,
|
|
669
671
|
{
|
|
670
|
-
schema:
|
|
672
|
+
schema: Q,
|
|
671
673
|
initialValues: Ee,
|
|
672
674
|
onCancel: () => L(!1),
|
|
673
|
-
onSubmit: async (
|
|
674
|
-
|
|
675
|
+
onSubmit: async (o) => {
|
|
676
|
+
D ? await (l == null ? void 0 : l(D, o)) : await (r == null ? void 0 : r(o)), L(!1), await I();
|
|
675
677
|
}
|
|
676
678
|
}
|
|
677
679
|
) })
|
|
@@ -695,20 +697,20 @@ const Vt = {
|
|
|
695
697
|
]
|
|
696
698
|
};
|
|
697
699
|
function Ut({ items: t, className: a }) {
|
|
698
|
-
return /* @__PURE__ */ e("div", { className:
|
|
700
|
+
return /* @__PURE__ */ e("div", { className: E("prui-stat-row grid gap-3 sm:grid-cols-2 lg:grid-cols-4", a), children: t.map((n, r) => {
|
|
699
701
|
const l = n.icon;
|
|
700
|
-
return /* @__PURE__ */ d(
|
|
701
|
-
/* @__PURE__ */ d(
|
|
702
|
-
/* @__PURE__ */ d(
|
|
702
|
+
return /* @__PURE__ */ d(ce, { "data-testid": "stat-card", children: [
|
|
703
|
+
/* @__PURE__ */ d(de, { className: "pb-2", children: [
|
|
704
|
+
/* @__PURE__ */ d(me, { className: "flex items-center gap-1.5 text-xs", children: [
|
|
703
705
|
l ? /* @__PURE__ */ e(l, { className: "h-3.5 w-3.5", "aria-hidden": !0 }) : null,
|
|
704
706
|
n.label
|
|
705
707
|
] }),
|
|
706
|
-
/* @__PURE__ */ e(
|
|
708
|
+
/* @__PURE__ */ e(pe, { className: "text-2xl", children: n.value })
|
|
707
709
|
] }),
|
|
708
|
-
n.delta ? /* @__PURE__ */ e(
|
|
710
|
+
n.delta ? /* @__PURE__ */ e(fe, { className: "pb-3", children: /* @__PURE__ */ e(
|
|
709
711
|
"span",
|
|
710
712
|
{
|
|
711
|
-
className:
|
|
713
|
+
className: E(
|
|
712
714
|
"text-xs font-medium",
|
|
713
715
|
n.trend === "up" && "text-[var(--prui-ok)]",
|
|
714
716
|
n.trend === "down" && "text-[var(--prui-danger)]",
|
|
@@ -734,39 +736,39 @@ function Nt(t) {
|
|
|
734
736
|
function wt({ field: t }) {
|
|
735
737
|
const { name: a, type: n, value: r, onChange: l } = t;
|
|
736
738
|
if (!n || !a) return null;
|
|
737
|
-
const
|
|
738
|
-
return n === "switch" ? /* @__PURE__ */ e("label", { className: "flex items-center gap-2", htmlFor:
|
|
739
|
-
|
|
739
|
+
const m = `prui-settings-${a}`;
|
|
740
|
+
return n === "switch" ? /* @__PURE__ */ e("label", { className: "flex items-center gap-2", htmlFor: m, children: /* @__PURE__ */ e(
|
|
741
|
+
ue,
|
|
740
742
|
{
|
|
741
|
-
id:
|
|
743
|
+
id: m,
|
|
742
744
|
checked: !!r,
|
|
743
|
-
onChange: (
|
|
745
|
+
onChange: (p) => l == null ? void 0 : l(p),
|
|
744
746
|
"aria-label": t.label
|
|
745
747
|
}
|
|
746
748
|
) }) : n === "select" ? /* @__PURE__ */ e(
|
|
747
|
-
|
|
749
|
+
oe,
|
|
748
750
|
{
|
|
749
|
-
id:
|
|
751
|
+
id: m,
|
|
750
752
|
className: "w-56",
|
|
751
753
|
options: Nt(t.options) ?? [],
|
|
752
754
|
value: String(r ?? ""),
|
|
753
|
-
onChange: (
|
|
755
|
+
onChange: (p) => l == null ? void 0 : l(p),
|
|
754
756
|
"aria-label": t.label
|
|
755
757
|
}
|
|
756
758
|
) : /* @__PURE__ */ e(
|
|
757
|
-
|
|
759
|
+
V,
|
|
758
760
|
{
|
|
759
|
-
id:
|
|
761
|
+
id: m,
|
|
760
762
|
type: n === "number" ? "number" : "text",
|
|
761
763
|
className: "h-8 w-56",
|
|
762
764
|
value: String(r ?? ""),
|
|
763
|
-
onChange: (
|
|
765
|
+
onChange: (p) => l == null ? void 0 : l(n === "number" ? p.target.value === "" ? "" : Number(p.target.value) : p.target.value),
|
|
764
766
|
"aria-label": t.label
|
|
765
767
|
}
|
|
766
768
|
);
|
|
767
769
|
}
|
|
768
770
|
function Yt({ title: t = "Settings", sections: a, className: n }) {
|
|
769
|
-
return /* @__PURE__ */ d("div", { className:
|
|
771
|
+
return /* @__PURE__ */ d("div", { className: E("prui-settings mx-auto flex w-full max-w-4xl flex-col gap-6", n), children: [
|
|
770
772
|
/* @__PURE__ */ e("h1", { className: "text-xl font-semibold text-[var(--prui-fg)]", children: t }),
|
|
771
773
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-6 md:flex-row", children: [
|
|
772
774
|
/* @__PURE__ */ e("nav", { "aria-label": "Settings sections", className: "md:w-56 md:shrink-0", children: /* @__PURE__ */ e("ul", { className: "flex flex-row flex-wrap gap-1 md:flex-col", children: a.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
@@ -777,18 +779,18 @@ function Yt({ title: t = "Settings", sections: a, className: n }) {
|
|
|
777
779
|
children: r.title ?? r.label ?? r.id
|
|
778
780
|
}
|
|
779
781
|
) }, r.id)) }) }),
|
|
780
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 flex-col gap-4", children: a.map((r) => /* @__PURE__ */ d(
|
|
781
|
-
/* @__PURE__ */ d(
|
|
782
|
-
/* @__PURE__ */ e(
|
|
783
|
-
r.description ? /* @__PURE__ */ e(
|
|
782
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 flex-col gap-4", children: a.map((r) => /* @__PURE__ */ d(ce, { id: `settings-${r.id}`, "data-testid": "settings-section", children: [
|
|
783
|
+
/* @__PURE__ */ d(de, { children: [
|
|
784
|
+
/* @__PURE__ */ e(pe, { children: r.title ?? r.label ?? r.id }),
|
|
785
|
+
r.description ? /* @__PURE__ */ e(me, { children: r.description }) : null
|
|
784
786
|
] }),
|
|
785
|
-
/* @__PURE__ */ e(
|
|
787
|
+
/* @__PURE__ */ e(fe, { children: r.content ?? /* @__PURE__ */ e("dl", { className: "flex flex-col divide-y divide-[var(--prui-line)]", children: (r.fields ?? []).map((l, m) => /* @__PURE__ */ d("div", { className: "flex flex-col gap-2 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
786
788
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
787
789
|
/* @__PURE__ */ e("dt", { className: "text-sm font-medium text-[var(--prui-fg)]", children: l.label }),
|
|
788
790
|
l.description ? /* @__PURE__ */ e("dd", { className: "text-xs text-[var(--prui-dim)]", children: l.description }) : null
|
|
789
791
|
] }),
|
|
790
792
|
/* @__PURE__ */ e("div", { className: "shrink-0", children: l.control ?? /* @__PURE__ */ e(wt, { field: l }) })
|
|
791
|
-
] }, `${l.label}-${
|
|
793
|
+
] }, `${l.label}-${m}`)) }) })
|
|
792
794
|
] }, r.id)) })
|
|
793
795
|
] })
|
|
794
796
|
] });
|
|
@@ -799,57 +801,57 @@ const Ht = {
|
|
|
799
801
|
{ name: "title", type: "string", default: "'Settings'", control: "text" },
|
|
800
802
|
{ name: "sections", type: "SettingsSection[]", default: null, control: "object" }
|
|
801
803
|
]
|
|
802
|
-
},
|
|
804
|
+
}, le = ["mousedown", "keydown", "scroll", "touchstart", "click"];
|
|
803
805
|
function St({
|
|
804
806
|
timeout: t = 15,
|
|
805
807
|
warningTime: a = 2,
|
|
806
808
|
onTimeout: n,
|
|
807
809
|
onExtend: r,
|
|
808
810
|
title: l = "Session expiring soon",
|
|
809
|
-
message:
|
|
811
|
+
message: m = "Your session is about to expire due to inactivity."
|
|
810
812
|
}) {
|
|
811
|
-
const
|
|
812
|
-
for (const g of [b, M,
|
|
813
|
+
const p = Math.max(0, t) * 6e4, v = Math.min(Math.max(0, a) * 6e4, p), [h, f] = i.useState(!1), [k, u] = i.useState(v), b = i.useRef(null), M = i.useRef(null), P = i.useRef(null), O = i.useRef(!1), y = i.useCallback(() => {
|
|
814
|
+
for (const g of [b, M, P])
|
|
813
815
|
g.current != null && (clearInterval(g.current), clearTimeout(g.current), g.current = null);
|
|
814
|
-
}, []),
|
|
815
|
-
|
|
816
|
-
}, [
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
816
|
+
}, []), T = i.useCallback(() => {
|
|
817
|
+
y(), f(!1), n == null || n();
|
|
818
|
+
}, [y, n]), R = i.useCallback(() => {
|
|
819
|
+
y(), f(!1), O.current = !1, b.current = window.setTimeout(() => {
|
|
820
|
+
O.current = !0, u(v), f(!0), P.current = window.setInterval(() => {
|
|
821
|
+
u((g) => g <= 1e3 ? (T(), 0) : g - 1e3);
|
|
820
822
|
}, 1e3);
|
|
821
|
-
},
|
|
822
|
-
}, [
|
|
823
|
-
|
|
823
|
+
}, p - v), M.current = window.setTimeout(T, p);
|
|
824
|
+
}, [y, T, p, v]);
|
|
825
|
+
i.useEffect(() => {
|
|
824
826
|
const g = () => {
|
|
825
|
-
|
|
827
|
+
O.current || R();
|
|
826
828
|
};
|
|
827
|
-
for (const
|
|
828
|
-
return
|
|
829
|
-
|
|
830
|
-
for (const
|
|
829
|
+
for (const x of le) document.addEventListener(x, g, { passive: !0 });
|
|
830
|
+
return R(), () => {
|
|
831
|
+
y();
|
|
832
|
+
for (const x of le) document.removeEventListener(x, g);
|
|
831
833
|
};
|
|
832
|
-
}, [
|
|
833
|
-
const
|
|
834
|
-
r == null || r(),
|
|
835
|
-
},
|
|
834
|
+
}, [R, y]);
|
|
835
|
+
const C = () => {
|
|
836
|
+
r == null || r(), R();
|
|
837
|
+
}, $ = Math.floor(k / 6e4), w = Math.floor(k % 6e4 / 1e3), s = `${$}:${String(w).padStart(2, "0")}`;
|
|
836
838
|
return /* @__PURE__ */ d(
|
|
837
|
-
|
|
839
|
+
ie,
|
|
838
840
|
{
|
|
839
|
-
open:
|
|
840
|
-
onClose:
|
|
841
|
+
open: h,
|
|
842
|
+
onClose: C,
|
|
841
843
|
size: "sm",
|
|
842
844
|
ariaLabel: l,
|
|
843
845
|
children: [
|
|
844
846
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-1 px-8 pb-2 pt-8 text-center", children: [
|
|
845
847
|
/* @__PURE__ */ e("div", { className: "mb-2 flex h-12 w-12 items-center justify-center rounded-full bg-[var(--prui-warn)]/15", children: /* @__PURE__ */ e(Ye, { className: "h-6 w-6 text-[var(--prui-warn)]", "aria-hidden": !0 }) }),
|
|
846
848
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-[var(--prui-fg)]", children: l }),
|
|
847
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-[var(--prui-dim)]", children:
|
|
848
|
-
/* @__PURE__ */ e("div", { className: "py-4 font-mono text-4xl font-bold text-[var(--prui-fg)]", "data-testid": "session-countdown", children:
|
|
849
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-[var(--prui-dim)]", children: m }),
|
|
850
|
+
/* @__PURE__ */ e("div", { className: "py-4 font-mono text-4xl font-bold text-[var(--prui-fg)]", "data-testid": "session-countdown", children: s })
|
|
849
851
|
] }),
|
|
850
852
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-2 px-8 pb-8 sm:flex-row", children: [
|
|
851
|
-
/* @__PURE__ */ e(
|
|
852
|
-
/* @__PURE__ */ e(
|
|
853
|
+
/* @__PURE__ */ e(A, { variant: "default", className: "flex-1", onClick: T, "data-testid": "session-logout", children: "Log out now" }),
|
|
854
|
+
/* @__PURE__ */ e(A, { variant: "primary", className: "flex-1", onClick: C, "data-testid": "session-extend", children: "Continue session" })
|
|
853
855
|
] })
|
|
854
856
|
]
|
|
855
857
|
}
|
|
@@ -868,8 +870,8 @@ const kt = {
|
|
|
868
870
|
SessionTimeout: St,
|
|
869
871
|
sessionTimeoutPropsMeta: kt
|
|
870
872
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
871
|
-
function Wt({ title: t, description: a, brand: n, width: r = "max-w-sm", footer: l, children:
|
|
872
|
-
return /* @__PURE__ */ e("div", { className:
|
|
873
|
+
function Wt({ title: t, description: a, brand: n, width: r = "max-w-sm", footer: l, children: m, className: p }) {
|
|
874
|
+
return /* @__PURE__ */ e("div", { className: E("prui-auth-shell flex min-h-[100dvh] items-center justify-center bg-[var(--prui-background)] p-4", p), "data-testid": "auth-shell", children: /* @__PURE__ */ d("div", { className: E("w-full", r), children: [
|
|
873
875
|
n ? /* @__PURE__ */ d("div", { className: "mb-6 flex items-center justify-center gap-2", "data-testid": "auth-shell-brand", children: [
|
|
874
876
|
n.mark ? /* @__PURE__ */ e("img", { src: n.mark, alt: "", className: "h-8 w-8 rounded-[var(--prui-radius-1)] object-cover" }) : null,
|
|
875
877
|
/* @__PURE__ */ e("span", { className: "text-lg font-semibold text-[var(--prui-fg)]", children: n.name })
|
|
@@ -879,7 +881,7 @@ function Wt({ title: t, description: a, brand: n, width: r = "max-w-sm", footer:
|
|
|
879
881
|
/* @__PURE__ */ e("h1", { className: "text-lg font-semibold text-[var(--prui-fg)]", children: t }),
|
|
880
882
|
a ? /* @__PURE__ */ e("p", { className: "text-sm text-[var(--prui-dim)]", children: a }) : null
|
|
881
883
|
] }),
|
|
882
|
-
|
|
884
|
+
m,
|
|
883
885
|
l ? /* @__PURE__ */ e("div", { className: "mt-4 text-center text-sm text-[var(--prui-dim)]", children: l }) : null
|
|
884
886
|
] })
|
|
885
887
|
] }) });
|
|
@@ -905,7 +907,7 @@ export {
|
|
|
905
907
|
Wt as b,
|
|
906
908
|
it as c,
|
|
907
909
|
Yt as d,
|
|
908
|
-
|
|
910
|
+
ae as e,
|
|
909
911
|
Ut as f,
|
|
910
912
|
qt as g,
|
|
911
913
|
Xt as h,
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { ScrollArea as se, scrollAreaPropsMeta as pe } from "./core/scroll-area.
|
|
|
13
13
|
import { Modal as ie, confirmModal as le, confirmModalPropsMeta as ge, modalPropsMeta as me } from "./core/modal.js";
|
|
14
14
|
import { D as Me, a as de, b as Te, c as fe, d as ue, F as Se, N as ce, P as he, T as xe, e as be, f as Fe, g as De } from "./chunks/data-table-toolbar-BUy2EWPy.js";
|
|
15
15
|
import { Link as Ae, NavLink as Ce, Navigate as we, Outlet as Ne, Route as ke, Routes as ve } from "react-router-dom";
|
|
16
|
-
import { A as Ie, a as ye, b as Ee, c as Be, C as He, F as Oe, R as Ge, S as Ue, d as _e, e as je, f as Ke, g as Ve, h as qe, i as ze, r as Je, s as Qe, j as We, k as Xe, u as Ye } from "./chunks/auth-shell-
|
|
16
|
+
import { A as Ie, a as ye, b as Ee, c as Be, C as He, F as Oe, R as Ge, S as Ue, d as _e, e as je, f as Ke, g as Ve, h as qe, i as ze, r as Je, s as Qe, j as We, k as Xe, u as Ye } from "./chunks/auth-shell-BYG_ozPZ.js";
|
|
17
17
|
import { AdminSetup as $e, EmptyState as ea, ErrorPage as aa, ForgotPasswordPage as ta, LoginPage as oa, LogoutPage as ra, NotFoundPage as sa, OtpPage as pa, PagesRegistry as Pa, ProfilePage as ia, RegisterPage as la, ResetPasswordPage as ga, SettingsPage as ma, adminSetupPropsMeta as na, emptyStatePropsMeta as Ma, errorPagePropsMeta as da, forgotPasswordPagePropsMeta as Ta, loginPagePropsMeta as fa, logoutPagePropsMeta as ua, notFoundPagePropsMeta as Sa, otpPagePropsMeta as ca, profilePagePropsMeta as ha, registerPagePropsMeta as xa, resetPasswordPagePropsMeta as ba, settingsPagePropsMeta as Fa } from "./pages.js";
|
|
18
18
|
import { PRUI_THEMES as Ra, PRUI_TOKENS as Aa, applyTheme as Ca, applyThemeTokens as wa, clearAppliedTokens as Na, defineTheme as ka, isDarkTheme as va, isLightTheme as La, listThemes as Ia, nextTheme as ya, readPersistedTheme as Ea, resolveThemeName as Ba, restoreAppliedTokens as Ha, themeMeta as Oa, themeMode as Ga } from "./theme.js";
|
|
19
19
|
import { FormButton as _a, FormGroup as ja, FormInput as Ka, formButtonPropsMeta as Va, formGroupPropsMeta as qa, formInputPropsMeta as za, getFormApi as Ja, registerForm as Qa, useFormApi as Wa } from "./forms.js";
|