@alepha/ui 0.13.5 → 0.13.7
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/admin/AdminAudits-CwvH8e8c.js +215 -0
- package/dist/admin/AdminAudits-CwvH8e8c.js.map +1 -0
- package/dist/admin/AdminAudits-Dv8Vk_6r.js +3 -0
- package/dist/admin/AdminFiles-5CPA3lQk.js +3 -0
- package/dist/admin/{AdminFiles-B_jfB_Py.js → AdminFiles-C_w1tb_x.js} +4 -3
- package/dist/admin/AdminFiles-C_w1tb_x.js.map +1 -0
- package/dist/admin/AdminLayout-BnSmtA4x.js +3 -0
- package/dist/admin/AdminLayout-XiSivwWH.js +39 -0
- package/dist/admin/AdminLayout-XiSivwWH.js.map +1 -0
- package/dist/admin/AdminNotifications-DLjmZWtf.js +3 -0
- package/dist/admin/{AdminNotifications-BFEjqpqx.js → AdminNotifications-DuYy74AN.js} +3 -3
- package/dist/admin/AdminNotifications-DuYy74AN.js.map +1 -0
- package/dist/admin/AdminParameters-DYg48Jwe.js +3 -0
- package/dist/admin/AdminParameters-YagqWTG3.js +575 -0
- package/dist/admin/AdminParameters-YagqWTG3.js.map +1 -0
- package/dist/admin/{AdminSessions-D7DESfWK.js → AdminSessions-BCjgJ-93.js} +4 -4
- package/dist/admin/AdminSessions-BCjgJ-93.js.map +1 -0
- package/dist/admin/AdminSessions-DEh2uN-4.js +3 -0
- package/dist/admin/AdminUserAudits-B_PUXCKC.js +177 -0
- package/dist/admin/AdminUserAudits-B_PUXCKC.js.map +1 -0
- package/dist/admin/AdminUserAudits-D7cTcElL.js +3 -0
- package/dist/admin/{AdminUserCreate-Bhxsn92l.js → AdminUserCreate-DzfRbGZ4.js} +4 -4
- package/dist/admin/AdminUserCreate-DzfRbGZ4.js.map +1 -0
- package/dist/admin/{AdminUserCreate-CYI_xW5T.js → AdminUserCreate-oUA1KDIl.js} +1 -1
- package/dist/admin/{AdminUserDetails-C2y1Ig4n.js → AdminUserDetails-DeTrJm-t.js} +5 -5
- package/dist/admin/AdminUserDetails-DeTrJm-t.js.map +1 -0
- package/dist/admin/{AdminUserDetails-Cmzx9HxH.js → AdminUserDetails-y1H5DW8Y.js} +1 -1
- package/dist/admin/{AdminUserLayout-sW6cjZL0.js → AdminUserLayout-CsfrrZkD.js} +4 -7
- package/dist/admin/AdminUserLayout-CsfrrZkD.js.map +1 -0
- package/dist/admin/{AdminUserLayout-DGSf612u.js → AdminUserLayout-Dejnz13m.js} +1 -1
- package/dist/admin/AdminUserSessions-Bbhcpz4k.js +3 -0
- package/dist/admin/{AdminUserSessions-CvN15wPe.js → AdminUserSessions-DO9H85O-.js} +4 -4
- package/dist/admin/AdminUserSessions-DO9H85O-.js.map +1 -0
- package/dist/admin/{AdminUserSettings-DvaaxgcV.js → AdminUserSettings-B3jA8g3p.js} +4 -4
- package/dist/admin/AdminUserSettings-B3jA8g3p.js.map +1 -0
- package/dist/admin/AdminUserSettings-CE0xpbQc.js +3 -0
- package/dist/admin/AdminUsers-CegGZDhW.js +3 -0
- package/dist/admin/{AdminUsers-BR3C-jrg.js → AdminUsers-ebbrJBT0.js} +13 -17
- package/dist/admin/AdminUsers-ebbrJBT0.js.map +1 -0
- package/dist/admin/index.d.ts +2044 -1044
- package/dist/admin/index.js +65 -62
- package/dist/admin/index.js.map +1 -1
- package/dist/auth/AuthLayout-BAZJHzDG.js +23 -0
- package/dist/auth/AuthLayout-BAZJHzDG.js.map +1 -0
- package/dist/auth/{Login-7HlBjDeV.js → Login-CeNZZjrr.js} +80 -44
- package/dist/auth/Login-CeNZZjrr.js.map +1 -0
- package/dist/auth/Login-hQcu1nlu.js +4 -0
- package/dist/auth/Register-B6HBNVHS.js +4 -0
- package/dist/auth/{Register-CuQr3kgi.js → Register-s4ENeyiE.js} +131 -91
- package/dist/auth/Register-s4ENeyiE.js.map +1 -0
- package/dist/auth/ResetPassword-Cjd-W-Nu.js +3 -0
- package/dist/auth/ResetPassword-GLIFkJT7.js +278 -0
- package/dist/auth/ResetPassword-GLIFkJT7.js.map +1 -0
- package/dist/auth/index.d.ts +471 -426
- package/dist/auth/index.js +26 -18
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +400 -130
- package/dist/core/index.js +1751 -1369
- package/dist/core/index.js.map +1 -1
- package/package.json +15 -11
- package/src/admin/AdminRouter.ts +70 -16
- package/src/admin/components/AdminLayout.tsx +41 -61
- package/src/admin/components/audits/AdminAudits.tsx +240 -0
- package/src/admin/components/{AdminFiles.tsx → files/AdminFiles.tsx} +1 -1
- package/src/admin/components/{AdminJobs.tsx → jobs/AdminJobs.tsx} +1 -1
- package/src/admin/components/parameters/AdminParameters.tsx +137 -0
- package/src/admin/components/parameters/ParameterDetails.tsx +228 -0
- package/src/admin/components/parameters/ParameterHistory.tsx +146 -0
- package/src/admin/components/parameters/ParameterTree.tsx +146 -0
- package/src/admin/components/parameters/types.ts +35 -0
- package/src/admin/components/{AdminSessions.tsx → sessions/AdminSessions.tsx} +1 -1
- package/src/admin/components/users/AdminUserAudits.tsx +183 -0
- package/src/admin/components/{AdminUserCreate.tsx → users/AdminUserCreate.tsx} +1 -1
- package/src/admin/components/{AdminUserLayout.tsx → users/AdminUserLayout.tsx} +1 -4
- package/src/admin/components/{AdminUserSettings.tsx → users/AdminUserSettings.tsx} +1 -1
- package/src/admin/components/{AdminUsers.tsx → users/AdminUsers.tsx} +10 -12
- package/src/admin/index.ts +24 -16
- package/src/auth/AuthRouter.ts +23 -17
- package/src/auth/components/AuthLayout.tsx +6 -3
- package/src/auth/components/Login.tsx +109 -47
- package/src/auth/components/Register.tsx +158 -94
- package/src/auth/components/ResetPassword.tsx +51 -5
- package/src/auth/components/buttons/UserButton.tsx +2 -0
- package/src/core/atoms/alephaThemeAtom.ts +13 -0
- package/src/core/atoms/alephaThemeListAtom.ts +10 -0
- package/src/core/atoms/themes/default.ts +6 -0
- package/src/core/{themes → atoms/themes}/midnight.ts +3 -5
- package/src/core/components/buttons/ActionButton.tsx +33 -26
- package/src/core/components/buttons/DarkModeButton.tsx +0 -1
- package/src/core/components/buttons/ThemeButton.tsx +10 -7
- package/src/core/components/buttons/ToggleSidebarButton.tsx +19 -16
- package/src/core/components/data/ErrorViewer.tsx +171 -0
- package/src/core/components/data/JsonViewer.tsx +147 -138
- package/src/core/components/form/Control.tsx +95 -18
- package/src/core/components/form/ControlArray.tsx +377 -0
- package/src/core/components/form/ControlObject.tsx +127 -0
- package/src/core/components/form/TypeForm.tsx +99 -37
- package/src/core/components/layout/AdminShell.tsx +14 -1
- package/src/core/components/layout/AlephaMantineProvider.tsx +7 -3
- package/src/core/components/layout/Omnibar.tsx +1 -1
- package/src/core/components/layout/Sidebar.tsx +47 -14
- package/src/core/components/table/ColumnPicker.tsx +126 -0
- package/src/core/components/table/DataTable.tsx +354 -181
- package/src/core/components/table/DataTableFilters.tsx +64 -0
- package/src/core/components/table/DataTablePagination.tsx +59 -0
- package/src/core/components/table/DataTableToolbar.tsx +126 -0
- package/src/core/components/table/FilterPicker.tsx +138 -0
- package/src/core/components/table/types.ts +199 -0
- package/src/core/helpers/isComponentType.ts +9 -0
- package/src/core/helpers/renderIcon.tsx +13 -0
- package/src/core/hooks/useTheme.ts +24 -18
- package/src/core/index.ts +24 -3
- package/src/core/interfaces/AlephaTheme.ts +8 -0
- package/src/core/providers/ThemeProvider.ts +44 -62
- package/src/core/services/DialogService.tsx +24 -0
- package/src/core/utils/parseInput.ts +2 -2
- package/styles.css +1 -1
- package/dist/admin/AdminFiles-B-0UcHVV.js +0 -3
- package/dist/admin/AdminFiles-B_jfB_Py.js.map +0 -1
- package/dist/admin/AdminLayout-BMtiXAzS.js +0 -396
- package/dist/admin/AdminLayout-BMtiXAzS.js.map +0 -1
- package/dist/admin/AdminLayout-BNo3GoHR.js +0 -3
- package/dist/admin/AdminNotifications-BFEjqpqx.js.map +0 -1
- package/dist/admin/AdminNotifications-DJs2ZjNj.js +0 -3
- package/dist/admin/AdminSessions-D7DESfWK.js.map +0 -1
- package/dist/admin/AdminSessions-PS2M8iXi.js +0 -3
- package/dist/admin/AdminUserCreate-Bhxsn92l.js.map +0 -1
- package/dist/admin/AdminUserDetails-C2y1Ig4n.js.map +0 -1
- package/dist/admin/AdminUserLayout-sW6cjZL0.js.map +0 -1
- package/dist/admin/AdminUserSessions-CvN15wPe.js.map +0 -1
- package/dist/admin/AdminUserSessions-D-aOcZgV.js +0 -3
- package/dist/admin/AdminUserSettings-CEMhIYrI.js +0 -3
- package/dist/admin/AdminUserSettings-DvaaxgcV.js.map +0 -1
- package/dist/admin/AdminUsers-BR3C-jrg.js.map +0 -1
- package/dist/admin/AdminUsers-CMW9vN09.js +0 -3
- package/dist/auth/AuthLayout-CzwUKD9y.js +0 -19
- package/dist/auth/AuthLayout-CzwUKD9y.js.map +0 -1
- package/dist/auth/Login-7HlBjDeV.js.map +0 -1
- package/dist/auth/Login-C-e27DGb.js +0 -4
- package/dist/auth/Register-CuQr3kgi.js.map +0 -1
- package/dist/auth/Register-DbvXwgbG.js +0 -4
- package/dist/auth/ResetPassword-BzU-cdd4.js +0 -243
- package/dist/auth/ResetPassword-BzU-cdd4.js.map +0 -1
- package/dist/auth/ResetPassword-DSvrdpaA.js +0 -3
- package/src/admin/AdminSidebar.ts +0 -31
- package/src/admin/components/AdminParameters.tsx +0 -24
- package/src/core/themes/aurora.ts +0 -107
- package/src/core/themes/crystal.ts +0 -107
- package/src/core/themes/default.ts +0 -7
- package/src/core/themes/ember.ts +0 -107
- package/src/core/themes/index.ts +0 -7
- package/src/core/themes/remoraid.ts +0 -278
- package/src/core/themes/slate.ts +0 -81
- /package/src/admin/components/{AdminNotifications.tsx → notifications/AdminNotifications.tsx} +0 -0
- /package/src/admin/components/{AdminUserDetails.tsx → users/AdminUserDetails.tsx} +0 -0
- /package/src/admin/components/{AdminUserSessions.tsx → users/AdminUserSessions.tsx} +0 -0
- /package/src/admin/components/{AdminVerifications.tsx → verifications/AdminVerifications.tsx} +0 -0
|
@@ -1,90 +1,72 @@
|
|
|
1
1
|
import { $head } from "@alepha/react/head";
|
|
2
|
-
import
|
|
3
|
-
import { $atom, $inject, Alepha, type Static, t } from "alepha";
|
|
2
|
+
import { $inject, Alepha, AlephaError } from "alepha";
|
|
4
3
|
import { $cookie } from "alepha/server/cookies";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
emberTheme,
|
|
10
|
-
midnightTheme,
|
|
11
|
-
remoraidTheme,
|
|
12
|
-
slateTheme,
|
|
13
|
-
} from "../themes/index.ts";
|
|
14
|
-
|
|
15
|
-
export const mantineThemeAtom = $atom({
|
|
16
|
-
name: "alepha.ui.theme",
|
|
17
|
-
schema: t.object({
|
|
18
|
-
id: t.string(),
|
|
19
|
-
}),
|
|
20
|
-
default: {
|
|
21
|
-
id: "default",
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export type Theme = Static<typeof mantineThemeAtom.schema>;
|
|
26
|
-
|
|
27
|
-
declare module "alepha" {
|
|
28
|
-
interface State {
|
|
29
|
-
[mantineThemeAtom.key]?: Theme;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type AlephaTheme = MantineThemeOverride & {
|
|
34
|
-
id: string;
|
|
35
|
-
label: string;
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
4
|
+
import { alephaThemeAtom } from "../atoms/alephaThemeAtom.ts";
|
|
5
|
+
import { alephaThemeListAtom } from "../atoms/alephaThemeListAtom.ts";
|
|
6
|
+
import { defaultTheme } from "../atoms/themes/default.ts";
|
|
7
|
+
import type { AlephaTheme } from "../interfaces/AlephaTheme.ts";
|
|
38
8
|
|
|
39
9
|
export class ThemeProvider {
|
|
40
10
|
protected readonly alepha = $inject(Alepha);
|
|
41
|
-
protected
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
midnightTheme,
|
|
47
|
-
slateTheme,
|
|
48
|
-
auroraTheme,
|
|
49
|
-
emberTheme,
|
|
50
|
-
crystalTheme,
|
|
51
|
-
];
|
|
11
|
+
protected readonly cookie = $cookie({
|
|
12
|
+
name: "theme",
|
|
13
|
+
schema: alephaThemeAtom.schema,
|
|
14
|
+
ttl: [1, "year"],
|
|
15
|
+
});
|
|
52
16
|
|
|
53
|
-
protected
|
|
17
|
+
protected readonly head = $head(() => {
|
|
18
|
+
const theme = this.getTheme();
|
|
19
|
+
if (!theme || !theme.name) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
54
22
|
return {
|
|
55
23
|
htmlAttributes: {
|
|
56
|
-
"data-theme":
|
|
24
|
+
"data-theme": theme.name,
|
|
57
25
|
},
|
|
58
26
|
};
|
|
59
27
|
});
|
|
60
28
|
|
|
61
|
-
public setTheme(
|
|
62
|
-
this.
|
|
63
|
-
|
|
29
|
+
public setTheme(index: number) {
|
|
30
|
+
const newTheme = this.alepha.store.get(alephaThemeListAtom)[
|
|
31
|
+
index
|
|
32
|
+
] as AlephaTheme;
|
|
64
33
|
|
|
65
|
-
if (
|
|
34
|
+
if (!newTheme) {
|
|
35
|
+
throw new AlephaError(`Theme with index ${index} not found`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
this.cookie.set({ index });
|
|
39
|
+
this.alepha.store.set(alephaThemeAtom, { index });
|
|
40
|
+
|
|
41
|
+
if (typeof document === "undefined") {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
66
44
|
|
|
67
45
|
document.documentElement.removeAttribute("data-theme");
|
|
68
46
|
|
|
69
|
-
if (
|
|
70
|
-
document.documentElement.setAttribute("data-theme",
|
|
47
|
+
if (newTheme.name) {
|
|
48
|
+
document.documentElement.setAttribute("data-theme", newTheme.name);
|
|
71
49
|
}
|
|
72
50
|
}
|
|
73
51
|
|
|
74
52
|
public getTheme() {
|
|
53
|
+
const index = this.getThemeIndex();
|
|
54
|
+
const list = this.alepha.store.get(
|
|
55
|
+
alephaThemeListAtom,
|
|
56
|
+
) as Array<AlephaTheme>;
|
|
57
|
+
return list[index] || list[0] || defaultTheme;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected getThemeIndex() {
|
|
75
61
|
// TODO: make a safe cookie getter, today it crash when Cookie Server is called inside vite pre-render
|
|
76
62
|
try {
|
|
77
63
|
return (
|
|
78
|
-
this.
|
|
79
|
-
this.alepha.store.get(
|
|
80
|
-
|
|
64
|
+
this.cookie.get()?.index ??
|
|
65
|
+
this.alepha.store.get(alephaThemeAtom)?.index ??
|
|
66
|
+
0
|
|
81
67
|
);
|
|
82
68
|
} catch {
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
this.alepha.store.get(mantineThemeAtom) ??
|
|
86
|
-
mantineThemeAtom.options.default
|
|
87
|
-
);
|
|
69
|
+
return this.alepha.store.get(alephaThemeAtom)?.index ?? 0;
|
|
88
70
|
}
|
|
89
71
|
}
|
|
90
72
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Flex, type ModalProps } from "@mantine/core";
|
|
2
2
|
import { modals } from "@mantine/modals";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
+
import ErrorViewer from "../components/data/ErrorViewer.tsx";
|
|
4
5
|
import JsonViewer from "../components/data/JsonViewer.tsx";
|
|
5
6
|
import AlertDialog from "../components/dialogs/AlertDialog.tsx";
|
|
6
7
|
import ConfirmDialog from "../components/dialogs/ConfirmDialog.tsx";
|
|
@@ -175,6 +176,29 @@ export class DialogService {
|
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Show an error viewer dialog
|
|
181
|
+
*/
|
|
182
|
+
public error(
|
|
183
|
+
error: Error | unknown,
|
|
184
|
+
options?: BaseDialogOptions & { showStack?: boolean },
|
|
185
|
+
): void {
|
|
186
|
+
this.open({
|
|
187
|
+
size: "lg",
|
|
188
|
+
title: options?.title || "Error",
|
|
189
|
+
...options,
|
|
190
|
+
content: (
|
|
191
|
+
<Flex bdrs={"md"} w={"100%"} flex={1} p={"sm"} bg={ui.colors.surface}>
|
|
192
|
+
<ErrorViewer
|
|
193
|
+
size={"xs"}
|
|
194
|
+
error={error}
|
|
195
|
+
showStack={options?.showStack ?? true}
|
|
196
|
+
/>
|
|
197
|
+
</Flex>
|
|
198
|
+
),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
178
202
|
/**
|
|
179
203
|
* Show a form dialog for structured input
|
|
180
204
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseInputField } from "@alepha/react/form";
|
|
2
2
|
import { type TObject, TypeBoxError } from "alepha";
|
|
3
3
|
import {
|
|
4
4
|
createElement,
|
|
@@ -105,7 +105,7 @@ export const parseInput = (
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
export interface GenericControlProps {
|
|
108
|
-
input:
|
|
108
|
+
input: BaseInputField;
|
|
109
109
|
title?: string;
|
|
110
110
|
description?: string;
|
|
111
111
|
icon?: ReactElement | ((props: { size: number }) => ReactNode);
|
package/styles.css
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
--alepha-elevated: var(--alepha-elevated-light);
|
|
21
21
|
--alepha-elevated-hover: var(--alepha-elevated-hover-light);
|
|
22
22
|
|
|
23
|
-
--alepha-border-light:
|
|
23
|
+
--alepha-border-light: var(--mantine-color-gray-3);
|
|
24
24
|
--alepha-border-dark: var(--mantine-color-dark-4);
|
|
25
25
|
--alepha-border: var(--alepha-border-light);
|
|
26
26
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdminFiles-B_jfB_Py.js","names":["filters"],"sources":["../../src/admin/components/AdminFiles.tsx"],"sourcesContent":["import { useClient } from \"@alepha/react\";\nimport { useI18n } from \"@alepha/react/i18n\";\nimport { DataTable, Flex, Text } from \"@alepha/ui\";\nimport { Badge } from \"@mantine/core\";\nimport { type Page, t } from \"alepha\";\nimport { type FileController, type FileEntity, files } from \"alepha/api/files\";\n\nconst AdminFiles = () => {\n const client = useClient<FileController>();\n const { l } = useI18n();\n\n const filters = t.object({\n bucket: t.optional(t.string()),\n name: t.optional(\n t.string({\n $control: {\n query: t.pick(files.schema, [\"name\", \"bucket\", \"mimeType\"]),\n },\n }),\n ),\n });\n\n const formatFileSize = (bytes: number) => {\n if (bytes === 0) return \"0 B\";\n const k = 1024;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${Number.parseFloat((bytes / k ** i).toFixed(1))} ${sizes[i]}`;\n };\n\n return (\n <Flex flex={1}>\n <DataTable<FileEntity, typeof filters>\n submitOnInit\n defaultSize={10}\n typeFormProps={{\n skipSubmitButton: true,\n columns: 3,\n }}\n tableProps={{\n horizontalSpacing: \"xs\",\n verticalSpacing: \"xs\",\n }}\n onFilterChange={(key, _value, form) => {\n if (key === \"name\" || key === \"bucket\") {\n return form.submit();\n }\n }}\n filters={filters}\n items={async (filters) => {\n const response = await client.findFiles({\n query: filters,\n });\n\n return response as Page<FileEntity>;\n }}\n columns={{\n name: {\n label: \"Name\",\n value: (item) => (\n <Text size=\"sm\" fw={500} lineClamp={1}>\n {item.name}\n </Text>\n ),\n },\n bucket: {\n label: \"Bucket\",\n fit: true,\n value: (item) => (\n <Badge size=\"sm\" variant=\"light\" color=\"blue\">\n {item.bucket}\n </Badge>\n ),\n },\n mimeType: {\n label: \"Type\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {item.mimeType}\n </Text>\n ),\n },\n size: {\n label: \"Size\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {formatFileSize(item.size)}\n </Text>\n ),\n },\n creatorName: {\n label: \"Creator\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {item.creatorName || \"-\"}\n </Text>\n ),\n },\n createdAt: {\n label: \"Created\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n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AAM;gBACpC,KAAK;OACA;KAEX;IACD,UAAU;KACR,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAAC;MAAK,MAAK;MAAK,GAAE;gBACf,KAAK;OACD;KAEV;IACD,MAAM;KACJ,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAAC;MAAK,MAAK;MAAK,GAAE;gBACf,eAAe,KAAK,KAAK;OACrB;KAEV;IACD,aAAa;KACX,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAAC;MAAK,MAAK;MAAK,GAAE;gBACf,KAAK,eAAe;OAChB;KAEV;IACD,WAAW;KACT,OAAO;KACP,KAAK;KACL,QAAQ,SACN,oBAAC;MAAK,MAAK;MAAK,GAAE;gBACf,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;OAClC;KAEV;IACF;IACD;GACG;;AAIX,yBAAe"}
|
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
import { ActionButton, AdminShell, OmnibarButton, ThemeButton } from "@alepha/ui";
|
|
2
|
-
import { UserButton } from "@alepha/ui/auth";
|
|
3
|
-
import { NestedView, useAction, useActive, useInject, useRouter, useStore } from "@alepha/react";
|
|
4
|
-
import { IconArrowLeft, IconCheck, IconChevronRight, IconLayoutSidebarLeftCollapse, IconLayoutSidebarRightCollapse } from "@tabler/icons-react";
|
|
5
|
-
import { Children, createElement, isValidElement } from "react";
|
|
6
|
-
import { useFormState } from "@alepha/react/form";
|
|
7
|
-
import { Anchor, Button, Flex as Flex$1, Menu, ThemeIcon, Tooltip } from "@mantine/core";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
|
|
10
|
-
//#region ../../src/core/constants/ui.ts
|
|
11
|
-
const ui = {
|
|
12
|
-
colors: {
|
|
13
|
-
transparent: "transparent",
|
|
14
|
-
background: "var(--alepha-background)",
|
|
15
|
-
surface: "var(--alepha-surface)",
|
|
16
|
-
elevated: "var(--alepha-elevated)",
|
|
17
|
-
border: "var(--alepha-border)"
|
|
18
|
-
},
|
|
19
|
-
sizes: { icon: {
|
|
20
|
-
xs: 12,
|
|
21
|
-
sm: 16,
|
|
22
|
-
md: 20,
|
|
23
|
-
lg: 24,
|
|
24
|
-
xl: 32
|
|
25
|
-
} }
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region ../../src/core/components/buttons/ActionButton.tsx
|
|
30
|
-
const ActionMenuItem = (props) => {
|
|
31
|
-
const { item, index } = props;
|
|
32
|
-
const router = useRouter();
|
|
33
|
-
const action = useAction({ handler: async (e) => {
|
|
34
|
-
await item.onClick?.();
|
|
35
|
-
} }, [item.onClick]);
|
|
36
|
-
if (item.type === "divider") return /* @__PURE__ */ jsx(Menu.Divider, {}, index);
|
|
37
|
-
if (item.type === "label") return /* @__PURE__ */ jsx(Menu.Label, { children: item.label }, index);
|
|
38
|
-
if (item.children && item.children.length > 0) return /* @__PURE__ */ jsxs(Menu, {
|
|
39
|
-
trigger: "hover",
|
|
40
|
-
position: "right-start",
|
|
41
|
-
offset: 2,
|
|
42
|
-
children: [/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(Menu.Item, {
|
|
43
|
-
leftSection: item.icon,
|
|
44
|
-
rightSection: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }),
|
|
45
|
-
children: item.label
|
|
46
|
-
}) }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: item.children.map((child, childIndex) => /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
47
|
-
item: child,
|
|
48
|
-
index: childIndex
|
|
49
|
-
}, childIndex)) })]
|
|
50
|
-
}, index);
|
|
51
|
-
const menuItemProps = {};
|
|
52
|
-
if (props.item.onClick) menuItemProps.onClick = action.run;
|
|
53
|
-
else if (props.item.href) Object.assign(menuItemProps, router.anchor(props.item.href));
|
|
54
|
-
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
55
|
-
leftSection: item.icon,
|
|
56
|
-
onClick: item.onClick,
|
|
57
|
-
color: item.color,
|
|
58
|
-
rightSection: item.active ? /* @__PURE__ */ jsx(ThemeIcon, {
|
|
59
|
-
size: "xs",
|
|
60
|
-
variant: "transparent",
|
|
61
|
-
children: /* @__PURE__ */ jsx(IconCheck, {})
|
|
62
|
-
}) : void 0,
|
|
63
|
-
...menuItemProps,
|
|
64
|
-
children: item.label
|
|
65
|
-
}, index);
|
|
66
|
-
};
|
|
67
|
-
const ActionButton$1 = (_props) => {
|
|
68
|
-
const props = {
|
|
69
|
-
variant: "subtle",
|
|
70
|
-
..._props
|
|
71
|
-
};
|
|
72
|
-
const { tooltip, menu, icon, ...restProps } = props;
|
|
73
|
-
restProps.color ??= "gray";
|
|
74
|
-
restProps.c ??= "var(--mantine-color-text)";
|
|
75
|
-
if (props.icon) {
|
|
76
|
-
const icon$1 = isComponentType(props.icon) ? /* @__PURE__ */ jsx(props.icon, { size: ui.sizes.icon.md }) : /* @__PURE__ */ jsx(ThemeIcon, {
|
|
77
|
-
w: 24,
|
|
78
|
-
variant: "transparent",
|
|
79
|
-
size: "sm",
|
|
80
|
-
c: "var(--mantine-color-text)",
|
|
81
|
-
...props.themeIconProps,
|
|
82
|
-
children: props.icon
|
|
83
|
-
});
|
|
84
|
-
if (!props.children) {
|
|
85
|
-
restProps.children = Children.only(icon$1);
|
|
86
|
-
restProps.px ??= "xs";
|
|
87
|
-
} else restProps.leftSection = icon$1;
|
|
88
|
-
}
|
|
89
|
-
if (props.leftSection && !props.children) restProps.px ??= "xs";
|
|
90
|
-
if (props.textVisibleFrom) {
|
|
91
|
-
const { children, textVisibleFrom, leftSection, ...rest } = restProps;
|
|
92
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Flex$1, {
|
|
93
|
-
w: "100%",
|
|
94
|
-
visibleFrom: textVisibleFrom,
|
|
95
|
-
children: /* @__PURE__ */ jsx(ActionButton$1, {
|
|
96
|
-
flex: 1,
|
|
97
|
-
...rest,
|
|
98
|
-
leftSection,
|
|
99
|
-
tooltip,
|
|
100
|
-
menu,
|
|
101
|
-
children
|
|
102
|
-
})
|
|
103
|
-
}), /* @__PURE__ */ jsx(Flex$1, {
|
|
104
|
-
w: "100%",
|
|
105
|
-
hiddenFrom: textVisibleFrom,
|
|
106
|
-
children: /* @__PURE__ */ jsx(ActionButton$1, {
|
|
107
|
-
px: "xs",
|
|
108
|
-
...rest,
|
|
109
|
-
tooltip,
|
|
110
|
-
menu,
|
|
111
|
-
children: leftSection
|
|
112
|
-
})
|
|
113
|
-
})] });
|
|
114
|
-
}
|
|
115
|
-
const renderAction = () => {
|
|
116
|
-
if ("href" in restProps && restProps.href) {
|
|
117
|
-
if (restProps.href.startsWith("http") || restProps.target) return /* @__PURE__ */ jsx(ActionHrefButton, {
|
|
118
|
-
...restProps,
|
|
119
|
-
href: restProps.href,
|
|
120
|
-
children: restProps.children
|
|
121
|
-
});
|
|
122
|
-
return /* @__PURE__ */ jsx(ActionNavigationButton, {
|
|
123
|
-
...restProps,
|
|
124
|
-
href: restProps.href,
|
|
125
|
-
children: restProps.children
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
delete restProps.classNameActive;
|
|
129
|
-
delete restProps.variantActive;
|
|
130
|
-
if ("action" in restProps && restProps.action) return /* @__PURE__ */ jsx(ActionHookButton, {
|
|
131
|
-
...restProps,
|
|
132
|
-
action: restProps.action,
|
|
133
|
-
children: restProps.children
|
|
134
|
-
});
|
|
135
|
-
if ("onClick" in restProps && restProps.onClick) return /* @__PURE__ */ jsx(ActionClickButton, {
|
|
136
|
-
...restProps,
|
|
137
|
-
onClick: restProps.onClick,
|
|
138
|
-
children: restProps.children
|
|
139
|
-
});
|
|
140
|
-
if ("form" in restProps && restProps.form) {
|
|
141
|
-
if (restProps.type === "reset") return /* @__PURE__ */ jsx(ActionResetButton, {
|
|
142
|
-
...restProps,
|
|
143
|
-
form: restProps.form,
|
|
144
|
-
children: restProps.children
|
|
145
|
-
});
|
|
146
|
-
return /* @__PURE__ */ jsx(ActionSubmitButton, {
|
|
147
|
-
...restProps,
|
|
148
|
-
form: restProps.form,
|
|
149
|
-
children: restProps.children
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
153
|
-
...restProps,
|
|
154
|
-
children: restProps.children
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
let actionElement = renderAction();
|
|
158
|
-
if (menu) actionElement = /* @__PURE__ */ jsxs(Menu, {
|
|
159
|
-
position: menu.position || "bottom-start",
|
|
160
|
-
width: menu.width || 200,
|
|
161
|
-
shadow: menu.shadow || "md",
|
|
162
|
-
trigger: menu.on === "hover" ? "hover" : "click",
|
|
163
|
-
...menu.menuProps,
|
|
164
|
-
children: [/* @__PURE__ */ jsx(Menu.Target, {
|
|
165
|
-
...menu.targetProps,
|
|
166
|
-
children: actionElement
|
|
167
|
-
}), /* @__PURE__ */ jsx(Menu.Dropdown, { children: menu.items.map((item, index) => /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
168
|
-
item,
|
|
169
|
-
index
|
|
170
|
-
}, index)) })]
|
|
171
|
-
});
|
|
172
|
-
if (tooltip) {
|
|
173
|
-
const defaultTooltipProps = { openDelay: 1e3 };
|
|
174
|
-
return /* @__PURE__ */ jsx(Tooltip, { ...typeof tooltip === "string" ? {
|
|
175
|
-
...defaultTooltipProps,
|
|
176
|
-
label: tooltip,
|
|
177
|
-
children: actionElement
|
|
178
|
-
} : {
|
|
179
|
-
...defaultTooltipProps,
|
|
180
|
-
...tooltip,
|
|
181
|
-
children: actionElement
|
|
182
|
-
} });
|
|
183
|
-
}
|
|
184
|
-
return actionElement;
|
|
185
|
-
};
|
|
186
|
-
var ActionButton_default = ActionButton$1;
|
|
187
|
-
/**
|
|
188
|
-
* Action button that submits a form with loading and disabled state handling.
|
|
189
|
-
*/
|
|
190
|
-
const ActionSubmitButton = (props) => {
|
|
191
|
-
const { form, ...buttonProps } = props;
|
|
192
|
-
const state = useFormState(form);
|
|
193
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
194
|
-
...buttonProps,
|
|
195
|
-
loading: state.loading,
|
|
196
|
-
disabled: state.loading,
|
|
197
|
-
type: "submit",
|
|
198
|
-
children: props.children
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
const ActionResetButton = (props) => {
|
|
202
|
-
const { form, ...buttonProps } = props;
|
|
203
|
-
const state = useFormState(form);
|
|
204
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
205
|
-
...buttonProps,
|
|
206
|
-
disabled: state.loading,
|
|
207
|
-
type: "reset",
|
|
208
|
-
children: props.children
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
212
|
-
* Action button that integrates with useAction hook return value.
|
|
213
|
-
* Automatically handles loading state and executes the action on click.
|
|
214
|
-
*
|
|
215
|
-
* @example
|
|
216
|
-
* ```tsx
|
|
217
|
-
* const saveAction = useAction({
|
|
218
|
-
* handler: async (data) => {
|
|
219
|
-
* await api.save(data);
|
|
220
|
-
* }
|
|
221
|
-
* }, []);
|
|
222
|
-
*
|
|
223
|
-
* <ActionButton action={saveAction}>
|
|
224
|
-
* Save
|
|
225
|
-
* </ActionButton>
|
|
226
|
-
* ```
|
|
227
|
-
*/
|
|
228
|
-
const ActionHookButton = (props) => {
|
|
229
|
-
const { action, ...buttonProps } = props;
|
|
230
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
231
|
-
...buttonProps,
|
|
232
|
-
disabled: action.loading || props.disabled,
|
|
233
|
-
loading: action.loading,
|
|
234
|
-
onClick: () => action.run(),
|
|
235
|
-
children: props.children
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
/**
|
|
239
|
-
* Basic action button that handles click events with loading and error handling.
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* ```tsx
|
|
243
|
-
* <ActionButton onClick={() => api.doSomething()}>
|
|
244
|
-
* Do Something
|
|
245
|
-
* </ActionButton>
|
|
246
|
-
* ```
|
|
247
|
-
*/
|
|
248
|
-
const ActionClickButton = (props) => {
|
|
249
|
-
const action = useAction({ handler: async (e) => {
|
|
250
|
-
await props.onClick(e);
|
|
251
|
-
} }, [props.onClick]);
|
|
252
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
253
|
-
...props,
|
|
254
|
-
disabled: action.loading || props.disabled,
|
|
255
|
-
loading: action.loading,
|
|
256
|
-
onClick: action.run,
|
|
257
|
-
children: props.children
|
|
258
|
-
});
|
|
259
|
-
};
|
|
260
|
-
/**
|
|
261
|
-
* Action for navigation with active state support.
|
|
262
|
-
*/
|
|
263
|
-
const ActionNavigationButton = (props) => {
|
|
264
|
-
const { active: options, classNameActive, variantActive, routerGoOptions, ...buttonProps } = props;
|
|
265
|
-
const router = useRouter();
|
|
266
|
-
const { isPending, isActive } = useActive(options ? {
|
|
267
|
-
href: props.href,
|
|
268
|
-
...options
|
|
269
|
-
} : { href: props.href });
|
|
270
|
-
const anchorProps = router.anchor(props.href, routerGoOptions);
|
|
271
|
-
const className = buttonProps.className || "";
|
|
272
|
-
if (isActive && options !== false && classNameActive) buttonProps.className = `${className} ${classNameActive}`.trim();
|
|
273
|
-
if (props.anchorProps) return /* @__PURE__ */ jsx(Anchor, {
|
|
274
|
-
component: "a",
|
|
275
|
-
...anchorProps,
|
|
276
|
-
...props.anchorProps,
|
|
277
|
-
children: props.children
|
|
278
|
-
});
|
|
279
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
280
|
-
component: "a",
|
|
281
|
-
loading: isPending,
|
|
282
|
-
...buttonProps,
|
|
283
|
-
...anchorProps,
|
|
284
|
-
variant: isActive && options !== false ? variantActive ?? "filled" : buttonProps.variant ?? "subtle",
|
|
285
|
-
children: props.children
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
const ActionHrefButton = (props) => {
|
|
289
|
-
const { active: options, classNameActive, variantActive, routerGoOptions, target, ...buttonProps } = props;
|
|
290
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
291
|
-
component: "a",
|
|
292
|
-
target,
|
|
293
|
-
...buttonProps,
|
|
294
|
-
children: props.children
|
|
295
|
-
});
|
|
296
|
-
};
|
|
297
|
-
function isComponentType(param) {
|
|
298
|
-
if (isValidElement(param)) return false;
|
|
299
|
-
return typeof param === "function" || typeof param === "object" && param !== null && "$$typeof" in param;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region ../../src/core/components/buttons/ToggleSidebarButton.tsx
|
|
304
|
-
const ToggleSidebarButton = () => {
|
|
305
|
-
const [collapsed, setCollapsed] = useStore("alepha.ui.sidebar.collapsed");
|
|
306
|
-
return /* @__PURE__ */ jsx(ActionButton_default, {
|
|
307
|
-
icon: collapsed ? /* @__PURE__ */ jsx(IconLayoutSidebarRightCollapse, {}) : /* @__PURE__ */ jsx(IconLayoutSidebarLeftCollapse, {}),
|
|
308
|
-
variant: "subtle",
|
|
309
|
-
size: "md",
|
|
310
|
-
onClick: () => setCollapsed(!collapsed),
|
|
311
|
-
tooltip: {
|
|
312
|
-
position: "right",
|
|
313
|
-
label: collapsed ? "Show sidebar" : "Hide sidebar"
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
var ToggleSidebarButton_default = ToggleSidebarButton;
|
|
318
|
-
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region ../../src/admin/AdminSidebar.ts
|
|
321
|
-
var AdminSidebar = class {
|
|
322
|
-
menu = (router) => [
|
|
323
|
-
{ element: createElement(ToggleSidebarButton_default) },
|
|
324
|
-
{ type: "spacer" },
|
|
325
|
-
{
|
|
326
|
-
...router.node("adminUsers"),
|
|
327
|
-
description: void 0
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
...router.node("adminSessions"),
|
|
331
|
-
description: void 0
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
...router.node("adminNotifications"),
|
|
335
|
-
description: void 0
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
...router.node("adminFiles"),
|
|
339
|
-
description: void 0
|
|
340
|
-
}
|
|
341
|
-
];
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
//#endregion
|
|
345
|
-
//#region ../../src/admin/components/AdminLayout.tsx
|
|
346
|
-
const AdminLayout = () => {
|
|
347
|
-
const router = useRouter();
|
|
348
|
-
const sidebar = useInject(AdminSidebar);
|
|
349
|
-
return /* @__PURE__ */ jsx(AdminShell, {
|
|
350
|
-
appShellMainProps: { bg: "var(--alepha-surface)" },
|
|
351
|
-
appShellHeaderProps: { bg: "var(--alepha-background)" },
|
|
352
|
-
appShellNavbarProps: {},
|
|
353
|
-
appShellProps: {},
|
|
354
|
-
appShellFooterProps: { bg: "var(--alepha-background)" },
|
|
355
|
-
footer: /* @__PURE__ */ jsx(Flex$1, { h: 12 }),
|
|
356
|
-
appBarProps: { items: [
|
|
357
|
-
{
|
|
358
|
-
element: /* @__PURE__ */ jsx(ActionButton, {
|
|
359
|
-
icon: IconArrowLeft,
|
|
360
|
-
href: "/"
|
|
361
|
-
}),
|
|
362
|
-
position: "left"
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
element: /* @__PURE__ */ jsx(OmnibarButton, { actionProps: { variant: "outline" } }),
|
|
366
|
-
position: "right"
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
element: /* @__PURE__ */ jsx(UserButton, {}),
|
|
370
|
-
position: "right"
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
element: /* @__PURE__ */ jsx(ThemeButton, {}),
|
|
374
|
-
position: "right"
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
type: "dark",
|
|
378
|
-
position: "right"
|
|
379
|
-
}
|
|
380
|
-
] },
|
|
381
|
-
sidebarProps: {
|
|
382
|
-
gap: "xs",
|
|
383
|
-
menu: sidebar.menu(router)
|
|
384
|
-
},
|
|
385
|
-
children: /* @__PURE__ */ jsx(Flex$1, {
|
|
386
|
-
flex: 1,
|
|
387
|
-
bg: "var(--alepha-surface)",
|
|
388
|
-
children: /* @__PURE__ */ jsx(NestedView, {})
|
|
389
|
-
})
|
|
390
|
-
});
|
|
391
|
-
};
|
|
392
|
-
var AdminLayout_default = AdminLayout;
|
|
393
|
-
|
|
394
|
-
//#endregion
|
|
395
|
-
export { AdminSidebar as n, AdminLayout_default as t };
|
|
396
|
-
//# sourceMappingURL=AdminLayout-BMtiXAzS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdminLayout-BMtiXAzS.js","names":["menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown>","ActionButton","icon","Flex","defaultTooltipProps: Partial<TooltipProps>","ActionButton","ToggleSidebarButton","Flex"],"sources":["../../src/core/constants/ui.ts","../../src/core/components/buttons/ActionButton.tsx","../../src/core/components/buttons/ToggleSidebarButton.tsx","../../src/admin/AdminSidebar.ts","../../src/admin/components/AdminLayout.tsx"],"sourcesContent":["export const ui = {\n colors: {\n transparent: \"transparent\",\n background: \"var(--alepha-background)\",\n surface: \"var(--alepha-surface)\",\n elevated: \"var(--alepha-elevated)\",\n border: \"var(--alepha-border)\",\n },\n sizes: {\n icon: {\n xs: 12,\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n },\n },\n};\n","import {\n type RouterGoOptions,\n type UseActionReturn,\n type UseActiveOptions,\n useAction,\n useActive,\n useRouter,\n} from \"@alepha/react\";\nimport { type FormModel, useFormState } from \"@alepha/react/form\";\nimport {\n Anchor,\n type AnchorProps,\n Button,\n type ButtonProps,\n Flex,\n Menu,\n type MenuItemProps,\n type MenuProps,\n type MenuTargetProps,\n ThemeIcon,\n type ThemeIconProps,\n Tooltip,\n type TooltipProps,\n} from \"@mantine/core\";\nimport { IconCheck, IconChevronRight } from \"@tabler/icons-react\";\nimport {\n type ButtonHTMLAttributes,\n Children,\n type ComponentType,\n isValidElement,\n type ReactNode,\n} from \"react\";\nimport { ui } from \"../../constants/ui.ts\";\n\nexport interface ActionMenuItem {\n /**\n * Menu item type\n */\n type?: \"item\" | \"divider\" | \"label\";\n\n /**\n * Label text for the menu item\n */\n label?: string | ReactNode;\n\n /**\n * Icon element to display before the label\n */\n icon?: ReactNode;\n\n /**\n * Click handler for menu items\n */\n onClick?: () => void;\n\n /**\n * Href for navigation menu items\n */\n href?: string;\n\n /**\n * Color for the menu item (e.g., \"red\" for danger actions)\n */\n color?: string;\n\n /**\n * Nested submenu items\n */\n children?: ActionMenuItem[];\n\n /**\n * Whether the menu item is active\n */\n active?: boolean;\n}\n\nexport interface ActionMenuConfig {\n /**\n * Array of menu items to display\n */\n items: ActionMenuItem[];\n\n /**\n * Menu position relative to the button\n */\n position?:\n | \"bottom\"\n | \"bottom-start\"\n | \"bottom-end\"\n | \"top\"\n | \"top-start\"\n | \"top-end\"\n | \"left\"\n | \"right\";\n\n /**\n * Menu width\n */\n width?: number | string;\n\n /**\n * Menu shadow\n */\n shadow?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n on?: \"hover\" | \"click\";\n\n targetProps?: MenuTargetProps;\n\n menuProps?: MenuProps;\n}\n\nexport interface ActionCommonProps extends ButtonProps {\n children?: ReactNode;\n\n textVisibleFrom?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n /**\n * Tooltip to display on hover. Can be a string for simple tooltips\n * or a TooltipProps object for advanced configuration.\n */\n tooltip?: string | TooltipProps;\n\n /**\n * Menu configuration. When provided, the action will display a dropdown menu.\n */\n menu?: ActionMenuConfig;\n\n /**\n * If set, a confirmation dialog will be shown before performing the action.\n * If `true`, a default title and message will be used.\n * If a string, it will be used as the message with a default title.\n * If an object, it can contain `title` and `message` properties to customize the dialog.\n */\n confirm?: boolean | string | { title?: string; message: string };\n\n /**\n * Icon to display on the left side of the button.\n * If no children are provided, the button will be styled as an icon-only button.\n */\n icon?: ReactNode | ComponentType;\n\n /**\n * Additional props to pass to the ThemeIcon wrapping the icon.\n */\n themeIconProps?: ThemeIconProps;\n\n /**\n * Visual intent of the action button.\n */\n intent?: \"primary\" | \"success\" | \"danger\" | \"warning\" | \"info\";\n}\n\nexport type ActionProps = ActionCommonProps &\n (\n | ActionNavigationButtonProps\n | ActionClickButtonProps\n | ActionSubmitButtonProps\n | ActionHookButtonProps\n | {}\n );\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Helper function to render menu items recursively\nconst ActionMenuItem = (props: {\n item: ActionMenuItem;\n index: number;\n}): ReactNode => {\n const { item, index } = props;\n\n const router = useRouter();\n const action = useAction(\n {\n handler: async (e: any) => {\n await item.onClick?.();\n },\n },\n [item.onClick],\n );\n\n // Render divider\n if (item.type === \"divider\") {\n return <Menu.Divider key={index} />;\n }\n\n // Render label\n if (item.type === \"label\") {\n return <Menu.Label key={index}>{item.label}</Menu.Label>;\n }\n\n // Render submenu if it has children\n if (item.children && item.children.length > 0) {\n return (\n <Menu key={index} trigger=\"hover\" position=\"right-start\" offset={2}>\n <Menu.Target>\n <Menu.Item\n leftSection={item.icon}\n rightSection={<IconChevronRight size={14} />}\n >\n {item.label}\n </Menu.Item>\n </Menu.Target>\n <Menu.Dropdown>\n {item.children.map((child, childIndex) => (\n <ActionMenuItem item={child} index={childIndex} key={childIndex} />\n ))}\n </Menu.Dropdown>\n </Menu>\n );\n }\n\n const menuItemProps: MenuItemProps & ButtonHTMLAttributes<unknown> = {};\n if (props.item.onClick) {\n menuItemProps.onClick = action.run;\n } else if (props.item.href) {\n Object.assign(menuItemProps, router.anchor(props.item.href));\n }\n\n // render regular menu item\n return (\n <Menu.Item\n key={index}\n leftSection={item.icon}\n onClick={item.onClick}\n color={item.color}\n rightSection={\n item.active ? (\n <ThemeIcon size={\"xs\"} variant={\"transparent\"}>\n <IconCheck />\n </ThemeIcon>\n ) : undefined\n }\n {...menuItemProps}\n >\n {item.label}\n </Menu.Item>\n );\n};\n\nconst ActionButton = (_props: ActionProps) => {\n const props = { variant: \"subtle\", ..._props };\n const { tooltip, menu, icon, ...restProps } = props;\n\n // set default color to gray (not colored)\n restProps.color ??= \"gray\";\n restProps.c ??= \"var(--mantine-color-text)\";\n\n if (props.icon) {\n const icon = isComponentType(props.icon) ? (\n <props.icon size={ui.sizes.icon.md} />\n ) : (\n <ThemeIcon\n w={24} // TODO: make size configurable\n variant={\"transparent\"}\n size={\"sm\"}\n c={\"var(--mantine-color-text)\"}\n {...props.themeIconProps}\n >\n {props.icon as ReactNode}\n </ThemeIcon>\n );\n\n if (!props.children) {\n restProps.children = Children.only(icon);\n restProps.px ??= \"xs\";\n } else {\n restProps.leftSection = icon;\n }\n }\n\n if (props.leftSection && !props.children) {\n restProps.px ??= \"xs\";\n }\n\n if (props.textVisibleFrom) {\n const { children, textVisibleFrom, leftSection, ...rest } = restProps;\n return (\n <>\n <Flex w={\"100%\"} visibleFrom={textVisibleFrom}>\n <ActionButton\n flex={1}\n {...rest}\n leftSection={leftSection}\n tooltip={tooltip}\n menu={menu}\n >\n {children}\n </ActionButton>\n </Flex>\n <Flex w={\"100%\"} hiddenFrom={textVisibleFrom}>\n <ActionButton px={\"xs\"} {...rest} tooltip={tooltip} menu={menu}>\n {leftSection}\n </ActionButton>\n </Flex>\n </>\n );\n }\n\n const renderAction = () => {\n if (\"href\" in restProps && restProps.href) {\n if (restProps.href.startsWith(\"http\") || restProps.target) {\n return (\n <ActionHrefButton {...restProps} href={restProps.href}>\n {restProps.children}\n </ActionHrefButton>\n );\n }\n return (\n <ActionNavigationButton {...restProps} href={restProps.href}>\n {restProps.children}\n </ActionNavigationButton>\n );\n }\n\n delete (restProps as any).classNameActive;\n delete (restProps as any).variantActive;\n\n if (\"action\" in restProps && restProps.action) {\n return (\n <ActionHookButton {...restProps} action={restProps.action}>\n {restProps.children}\n </ActionHookButton>\n );\n }\n\n if (\"onClick\" in restProps && restProps.onClick) {\n return (\n <ActionClickButton {...restProps} onClick={restProps.onClick}>\n {restProps.children}\n </ActionClickButton>\n );\n }\n\n if (\"form\" in restProps && restProps.form) {\n if (restProps.type === \"reset\") {\n return (\n <ActionResetButton {...restProps} form={restProps.form}>\n {restProps.children}\n </ActionResetButton>\n );\n }\n return (\n <ActionSubmitButton {...restProps} form={restProps.form}>\n {restProps.children}\n </ActionSubmitButton>\n );\n }\n\n return <Button {...(restProps as any)}>{restProps.children}</Button>;\n };\n\n let actionElement = renderAction();\n\n // wrap with Menu if provided\n if (menu) {\n actionElement = (\n <Menu\n position={menu.position || \"bottom-start\"}\n width={menu.width || 200}\n shadow={menu.shadow || \"md\"}\n trigger={menu.on === \"hover\" ? \"hover\" : \"click\"}\n {...menu.menuProps}\n >\n <Menu.Target {...menu.targetProps}>{actionElement}</Menu.Target>\n <Menu.Dropdown>\n {menu.items.map((item, index) => (\n <ActionMenuItem item={item} index={index} key={index} />\n ))}\n </Menu.Dropdown>\n </Menu>\n );\n }\n\n // Wrap with Tooltip if provided\n if (tooltip) {\n // openDelay: 1000 -> like HTML title attribute\n const defaultTooltipProps: Partial<TooltipProps> = {\n openDelay: 1000,\n };\n const tooltipProps: TooltipProps =\n typeof tooltip === \"string\"\n ? {\n ...defaultTooltipProps,\n label: tooltip,\n children: actionElement,\n }\n : { ...defaultTooltipProps, ...tooltip, children: actionElement };\n\n return <Tooltip {...tooltipProps} />;\n }\n\n return actionElement;\n};\n\nexport default ActionButton;\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Submit\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionSubmitButtonProps extends ButtonProps {\n form: FormModel<any>;\n type?: \"submit\" | \"reset\";\n}\n\n/**\n * Action button that submits a form with loading and disabled state handling.\n */\nconst ActionSubmitButton = (props: ActionSubmitButtonProps) => {\n const { form, ...buttonProps } = props;\n const state = useFormState(form);\n return (\n <Button\n {...buttonProps}\n loading={state.loading}\n disabled={state.loading}\n type={\"submit\"}\n >\n {props.children}\n </Button>\n );\n};\n\nconst ActionResetButton = (props: ActionSubmitButtonProps) => {\n const { form, ...buttonProps } = props;\n const state = useFormState(form);\n return (\n <Button {...buttonProps} disabled={state.loading} type={\"reset\"}>\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action with useAction Hook\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionHookButtonProps extends ButtonProps {\n action: UseActionReturn<any[], any>;\n}\n\n/**\n * Action button that integrates with useAction hook return value.\n * Automatically handles loading state and executes the action on click.\n *\n * @example\n * ```tsx\n * const saveAction = useAction({\n * handler: async (data) => {\n * await api.save(data);\n * }\n * }, []);\n *\n * <ActionButton action={saveAction}>\n * Save\n * </ActionButton>\n * ```\n */\nconst ActionHookButton = (props: ActionHookButtonProps) => {\n const { action, ...buttonProps } = props;\n\n return (\n <Button\n {...buttonProps}\n disabled={action.loading || props.disabled}\n loading={action.loading}\n onClick={() => action.run()}\n >\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Click\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionClickButtonProps extends ButtonProps {\n onClick: (e: any) => any;\n}\n\n/**\n * Basic action button that handles click events with loading and error handling.\n *\n * @example\n * ```tsx\n * <ActionButton onClick={() => api.doSomething()}>\n * Do Something\n * </ActionButton>\n * ```\n */\nconst ActionClickButton = (props: ActionClickButtonProps) => {\n const action = useAction(\n {\n handler: async (e: any) => {\n await props.onClick(e);\n },\n },\n [props.onClick],\n );\n\n return (\n <Button\n {...props}\n disabled={action.loading || props.disabled}\n loading={action.loading}\n onClick={action.run}\n >\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n// Action Navigation\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ActionNavigationButtonProps extends ButtonProps {\n href: string;\n active?: Partial<UseActiveOptions> | false;\n routerGoOptions?: RouterGoOptions;\n classNameActive?: string;\n variantActive?: ButtonProps[\"variant\"];\n target?: string;\n anchorProps?: AnchorProps;\n}\n\n/**\n * Action for navigation with active state support.\n */\nconst ActionNavigationButton = (props: ActionNavigationButtonProps) => {\n const {\n active: options,\n classNameActive,\n variantActive,\n routerGoOptions,\n ...buttonProps\n } = props;\n const router = useRouter();\n const { isPending, isActive } = useActive(\n options ? { href: props.href, ...options } : { href: props.href },\n );\n const anchorProps = router.anchor(props.href, routerGoOptions);\n\n const className = buttonProps.className || \"\";\n if (isActive && options !== false && classNameActive) {\n buttonProps.className = `${className} ${classNameActive}`.trim();\n }\n\n if (props.anchorProps) {\n return (\n <Anchor component={\"a\"} {...anchorProps} {...props.anchorProps}>\n {props.children}\n </Anchor>\n );\n }\n\n return (\n <Button\n component={\"a\"}\n loading={isPending}\n {...buttonProps}\n {...anchorProps}\n variant={\n isActive && options !== false\n ? (variantActive ?? \"filled\")\n : (buttonProps.variant ?? \"subtle\")\n }\n >\n {props.children}\n </Button>\n );\n};\n\nconst ActionHrefButton = (props: ActionNavigationButtonProps) => {\n const {\n active: options,\n classNameActive,\n variantActive,\n routerGoOptions,\n target,\n ...buttonProps\n } = props;\n\n return (\n <Button component={\"a\"} target={target} {...buttonProps}>\n {props.children}\n </Button>\n );\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport function isComponentType(param: any): param is ComponentType<any> {\n if (isValidElement(param)) return false;\n return (\n typeof param === \"function\" ||\n (typeof param === \"object\" && param !== null && \"$$typeof\" in param)\n );\n}\n\nexport const renderIcon = (icon: ReactNode | ComponentType): ReactNode => {\n if (!icon) return null;\n if (isValidElement(icon)) return icon;\n if (isComponentType(icon)) {\n const IconComponent = icon;\n return <IconComponent size={ui.sizes.icon.md} />;\n }\n return icon as ReactNode;\n};\n","import { useStore } from \"@alepha/react\";\nimport {\n IconLayoutSidebarLeftCollapse,\n IconLayoutSidebarRightCollapse,\n} from \"@tabler/icons-react\";\nimport ActionButton from \"./ActionButton.tsx\";\n\nconst ToggleSidebarButton = () => {\n const [collapsed, setCollapsed] = useStore(\"alepha.ui.sidebar.collapsed\");\n\n return (\n <ActionButton\n icon={\n collapsed ? (\n <IconLayoutSidebarRightCollapse />\n ) : (\n <IconLayoutSidebarLeftCollapse />\n )\n }\n variant={\"subtle\"}\n size={\"md\"}\n onClick={() => setCollapsed(!collapsed)}\n tooltip={{\n position: \"right\",\n label: collapsed ? \"Show sidebar\" : \"Hide sidebar\",\n }}\n />\n );\n};\n\nexport default ToggleSidebarButton;\n","import type { ReactRouter } from \"@alepha/react\";\nimport type { SidebarNode } from \"@alepha/ui\";\nimport { createElement } from \"react\";\nimport ToggleSidebarButton from \"../core/components/buttons/ToggleSidebarButton.tsx\";\n\nexport class AdminSidebar {\n public menu = (router: ReactRouter<any>): SidebarNode[] => [\n {\n element: createElement(ToggleSidebarButton),\n },\n {\n type: \"spacer\",\n },\n {\n ...router.node(\"adminUsers\"),\n description: undefined,\n },\n {\n ...router.node(\"adminSessions\"),\n description: undefined,\n },\n {\n ...router.node(\"adminNotifications\"),\n description: undefined,\n },\n {\n ...router.node(\"adminFiles\"),\n description: undefined,\n },\n ];\n}\n","import { NestedView, useInject, useRouter } from \"@alepha/react\";\nimport {\n ActionButton,\n AdminShell,\n OmnibarButton,\n ThemeButton,\n} from \"@alepha/ui\";\nimport { UserButton } from \"@alepha/ui/auth\";\nimport { Flex } from \"@mantine/core\";\nimport { IconArrowLeft } from \"@tabler/icons-react\";\nimport type { AdminRouter } from \"../AdminRouter.ts\";\nimport { AdminSidebar } from \"../AdminSidebar.ts\";\n\nconst AdminLayout = () => {\n const router = useRouter<AdminRouter>();\n const sidebar = useInject(AdminSidebar);\n\n return (\n <AdminShell\n appShellMainProps={{\n bg: \"var(--alepha-surface)\",\n }}\n appShellHeaderProps={{\n bg: \"var(--alepha-background)\",\n }}\n appShellNavbarProps={\n {\n // bg: \"var(--alepha-background)\",\n }\n }\n appShellProps={\n {\n // withBorder: false,\n }\n }\n appShellFooterProps={{\n bg: \"var(--alepha-background)\",\n }}\n footer={<Flex h={12} />}\n appBarProps={{\n items: [\n {\n element: <ActionButton icon={IconArrowLeft} href={\"/\"} />,\n position: \"left\",\n },\n {\n element: <OmnibarButton actionProps={{ variant: \"outline\" }} />,\n position: \"right\",\n },\n {\n element: <UserButton />,\n position: \"right\",\n },\n {\n element: <ThemeButton />,\n position: \"right\",\n },\n {\n type: \"dark\",\n position: \"right\",\n },\n ],\n }}\n sidebarProps={{\n gap: \"xs\",\n menu: sidebar.menu(router),\n }}\n >\n <Flex flex={1} bg={\"var(--alepha-surface)\"}>\n <NestedView />\n </Flex>\n </AdminShell>\n );\n};\n\nexport default AdminLayout;\n"],"mappings":";;;;;;;;;;AAAA,MAAa,KAAK;CAChB,QAAQ;EACN,aAAa;EACb,YAAY;EACZ,SAAS;EACT,UAAU;EACV,QAAQ;EACT;CACD,OAAO,EACL,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACF;;;;ACoJD,MAAM,kBAAkB,UAGP;CACf,MAAM,EAAE,MAAM,UAAU;CAExB,MAAM,SAAS,WAAW;CAC1B,MAAM,SAAS,UACb,EACE,SAAS,OAAO,MAAW;AACzB,QAAM,KAAK,WAAW;IAEzB,EACD,CAAC,KAAK,QAAQ,CACf;AAGD,KAAI,KAAK,SAAS,UAChB,QAAO,oBAAC,KAAK,aAAa,MAAS;AAIrC,KAAI,KAAK,SAAS,QAChB,QAAO,oBAAC,KAAK,mBAAmB,KAAK,SAAb,MAAgC;AAI1D,KAAI,KAAK,YAAY,KAAK,SAAS,SAAS,EAC1C,QACE,qBAAC;EAAiB,SAAQ;EAAQ,UAAS;EAAc,QAAQ;aAC/D,oBAAC,KAAK,oBACJ,oBAAC,KAAK;GACJ,aAAa,KAAK;GAClB,cAAc,oBAAC,oBAAiB,MAAM,KAAM;aAE3C,KAAK;IACI,GACA,EACd,oBAAC,KAAK,sBACH,KAAK,SAAS,KAAK,OAAO,eACzB,oBAAC;GAAe,MAAM;GAAO,OAAO;KAAiB,WAAc,CACnE,GACY;IAbP,MAcJ;CAIX,MAAMA,gBAA+D,EAAE;AACvE,KAAI,MAAM,KAAK,QACb,eAAc,UAAU,OAAO;UACtB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