@alepha/ui 0.13.2 → 0.13.4
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/{AdminFiles-BjofP3OC.js → AdminFiles-8CC9mVsc.js} +3 -3
- package/dist/admin/{AdminFiles-BjofP3OC.js.map → AdminFiles-8CC9mVsc.js.map} +1 -1
- package/dist/admin/AdminFiles-BRLMP_7y.js +3 -0
- package/dist/admin/AdminLayout-Cm-Y4YTQ.js +396 -0
- package/dist/admin/AdminLayout-Cm-Y4YTQ.js.map +1 -0
- package/dist/admin/AdminLayout-D5M9kSiV.js +3 -0
- package/dist/admin/AdminNotifications-DxBKi2RO.js +3 -0
- package/dist/admin/AdminNotifications-d-gw5Uie.js +154 -0
- package/dist/admin/AdminNotifications-d-gw5Uie.js.map +1 -0
- package/dist/admin/{AdminSessions-CmDVneE2.js → AdminSessions-CpVusqmd.js} +37 -10
- package/dist/admin/AdminSessions-CpVusqmd.js.map +1 -0
- package/dist/admin/AdminSessions-DA285-5Q.js +3 -0
- package/dist/admin/AdminUserCreate-CQIrSslj.js +3 -0
- package/dist/admin/AdminUserCreate-DH7u_yJj.js +103 -0
- package/dist/admin/AdminUserCreate-DH7u_yJj.js.map +1 -0
- package/dist/admin/AdminUserDetails-DVmFCDsU.js +221 -0
- package/dist/admin/AdminUserDetails-DVmFCDsU.js.map +1 -0
- package/dist/admin/AdminUserDetails-T3nkXSdz.js +3 -0
- package/dist/admin/AdminUserLayout-DdtZGX8n.js +3 -0
- package/dist/admin/AdminUserLayout-gpOyn0Y7.js +153 -0
- package/dist/admin/AdminUserLayout-gpOyn0Y7.js.map +1 -0
- package/dist/admin/AdminUserSessions-CWYzjB3D.js +3 -0
- package/dist/admin/AdminUserSessions-CdVwoM-h.js +129 -0
- package/dist/admin/AdminUserSessions-CdVwoM-h.js.map +1 -0
- package/dist/admin/AdminUserSettings-S7gZvvjO.js +164 -0
- package/dist/admin/AdminUserSettings-S7gZvvjO.js.map +1 -0
- package/dist/admin/AdminUserSettings-jCzVYw_2.js +3 -0
- package/dist/admin/{AdminUsers-88De5pev.js → AdminUsers-9qEzxqAL.js} +33 -15
- package/dist/admin/AdminUsers-9qEzxqAL.js.map +1 -0
- package/dist/admin/AdminUsers-BcSUxV01.js +3 -0
- package/dist/admin/index.d.ts +5568 -418
- package/dist/admin/index.js +302 -42
- package/dist/admin/index.js.map +1 -1
- package/dist/auth/AuthLayout-BSL8ZHgr.js +19 -0
- package/dist/auth/AuthLayout-BSL8ZHgr.js.map +1 -0
- package/dist/auth/{Login-OCrvjs9U.js → Login-AlVPPqQp.js} +6 -5
- package/dist/auth/Login-AlVPPqQp.js.map +1 -0
- package/dist/auth/Login-otdWVvVU.js +4 -0
- package/dist/auth/{Register-Ei34GSba.js → Register-BxJmOqpF.js} +9 -6
- package/dist/auth/Register-BxJmOqpF.js.map +1 -0
- package/dist/auth/Register-D10MnlQc.js +4 -0
- package/dist/auth/{ResetPassword-tO0oMzfo.js → ResetPassword-BhyZ9ek4.js} +3 -3
- package/dist/auth/ResetPassword-BhyZ9ek4.js.map +1 -0
- package/dist/auth/ResetPassword-llBG-STp.js +3 -0
- package/dist/auth/VerifyEmail-BvOG-IUC.js +3 -0
- package/dist/auth/VerifyEmail-DeLct3oQ.js +131 -0
- package/dist/auth/VerifyEmail-DeLct3oQ.js.map +1 -0
- package/dist/auth/index.d.ts +2412 -2254
- package/dist/auth/index.js +97 -20
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +280 -95
- package/dist/core/index.js +1375 -394
- package/dist/core/index.js.map +1 -1
- package/package.json +7 -6
- package/src/admin/AdminRouter.ts +116 -29
- package/src/admin/AdminSidebar.ts +31 -0
- package/src/admin/MainRouter.ts +23 -0
- package/src/admin/components/AdminLayout.tsx +66 -104
- package/src/admin/components/AdminNotifications.tsx +196 -12
- package/src/admin/components/AdminSessions.tsx +43 -7
- package/src/admin/components/AdminUserCreate.tsx +84 -0
- package/src/admin/components/AdminUserDetails.tsx +180 -0
- package/src/admin/components/AdminUserLayout.tsx +172 -0
- package/src/admin/components/AdminUserSessions.tsx +158 -0
- package/src/admin/components/AdminUserSettings.tsx +165 -0
- package/src/admin/components/AdminUsers.tsx +29 -9
- package/src/admin/index.ts +15 -3
- package/src/auth/AuthI18n.ts +22 -0
- package/src/auth/AuthRouter.ts +82 -8
- package/src/auth/components/AuthLayout.tsx +12 -0
- package/src/auth/components/Login.tsx +14 -12
- package/src/auth/components/Register.tsx +6 -5
- package/src/auth/components/ResetPassword.tsx +1 -1
- package/src/auth/components/VerifyEmail.tsx +102 -0
- package/src/auth/components/buttons/UserButton.tsx +12 -2
- package/src/auth/index.ts +1 -0
- package/src/core/components/buttons/ActionButton.tsx +12 -4
- package/src/core/components/buttons/DarkModeButton.tsx +1 -1
- package/src/core/components/buttons/ThemeButton.tsx +31 -0
- package/src/core/components/layout/AdminShell.tsx +4 -2
- package/src/core/components/layout/AlephaMantineProvider.tsx +10 -4
- package/src/core/components/layout/Omnibar.tsx +27 -15
- package/src/core/components/layout/Sidebar.tsx +33 -17
- package/src/core/components/table/DataTable.tsx +9 -5
- package/src/core/hooks/useTheme.ts +25 -0
- package/src/core/index.ts +8 -3
- package/src/core/providers/ThemeProvider.ts +90 -0
- package/src/core/themes/aurora.ts +107 -0
- package/src/core/themes/crystal.ts +107 -0
- package/src/core/themes/default.ts +7 -0
- package/src/core/themes/ember.ts +107 -0
- package/src/core/themes/index.ts +7 -0
- package/src/core/themes/midnight.ts +98 -0
- package/src/core/themes/remoraid.ts +278 -0
- package/src/core/themes/slate.ts +81 -0
- package/styles.css +84 -0
- package/dist/admin/AdminFiles-DldZB7oo.js +0 -3
- package/dist/admin/AdminJobs-BOq6AZOW.js +0 -3
- package/dist/admin/AdminJobs-CDnVxEv6.js +0 -125
- package/dist/admin/AdminJobs-CDnVxEv6.js.map +0 -1
- package/dist/admin/AdminLayout-Bgx25J8m.js +0 -3
- package/dist/admin/AdminLayout-CervL8LV.js +0 -88
- package/dist/admin/AdminLayout-CervL8LV.js.map +0 -1
- package/dist/admin/AdminNotifications-BDQXt3-e.js +0 -3
- package/dist/admin/AdminNotifications-DvI2989x.js +0 -40
- package/dist/admin/AdminNotifications-DvI2989x.js.map +0 -1
- package/dist/admin/AdminParameters-D_v0GAvI.js +0 -3
- package/dist/admin/AdminParameters-P1LB6ZI1.js +0 -40
- package/dist/admin/AdminParameters-P1LB6ZI1.js.map +0 -1
- package/dist/admin/AdminSessions-CmDVneE2.js.map +0 -1
- package/dist/admin/AdminSessions-Dkk_fzWK.js +0 -3
- package/dist/admin/AdminUsers-88De5pev.js.map +0 -1
- package/dist/admin/AdminUsers-oyAXqZ5l.js +0 -3
- package/dist/admin/AdminVerifications-D93TKymL.js +0 -3
- package/dist/admin/AdminVerifications-DBVEoqJe.js +0 -40
- package/dist/admin/AdminVerifications-DBVEoqJe.js.map +0 -1
- package/dist/auth/Login-BC2jTczq.js +0 -4
- package/dist/auth/Login-OCrvjs9U.js.map +0 -1
- package/dist/auth/Register-Dh0lsQmI.js +0 -4
- package/dist/auth/Register-Ei34GSba.js.map +0 -1
- package/dist/auth/ResetPassword-BnlAQAOE.js +0 -3
- package/dist/auth/ResetPassword-tO0oMzfo.js.map +0 -1
package/dist/core/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AlephaReactForm, FormValidationError, useForm, useFormState } from "@alepha/react/form";
|
|
2
|
-
import { AlephaReactHead } from "@alepha/react/head";
|
|
2
|
+
import { $head, AlephaReactHead } from "@alepha/react/head";
|
|
3
3
|
import { AlephaReactI18n, useI18n } from "@alepha/react/i18n";
|
|
4
|
-
import { $module, Alepha, TypeBoxError, t } from "alepha";
|
|
4
|
+
import { $atom, $inject, $module, Alepha, TypeBoxError, t } from "alepha";
|
|
5
|
+
import { $cookie } from "alepha/server/cookies";
|
|
5
6
|
import { $page, NestedView, useAction, useActive, useEvents, useInject, useRouter, useStore } from "@alepha/react";
|
|
6
|
-
import { ActionIcon, Anchor, AppShell, Autocomplete, Badge, Box, Burger, Button, Collapse, ColorInput, ColorSchemeScript, CopyButton, Divider, FileInput, Flex, Flex as Flex$1, Grid, Group, Input, Kbd, MantineProvider, Menu, MultiSelect, NumberInput, Pagination, PasswordInput, Popover, SegmentedControl, Select, Slider, Stack, Switch, Table, TagsInput, Text, Text as Text$1, TextInput, Textarea, ThemeIcon, Tooltip, useComputedColorScheme, useMantineColorScheme } from "@mantine/core";
|
|
7
|
+
import { ActionIcon, Anchor, AppShell, Autocomplete, Badge, Box, Burger, Button, Card, Collapse, ColorInput, ColorSchemeScript, CopyButton, Divider, FileInput, Flex, Flex as Flex$1, Grid, Group, Input, Kbd, MantineProvider, Menu, MultiSelect, NumberInput, Pagination, PasswordInput, Popover, SegmentedControl, Select, Slider, Stack, Switch, Table, TagsInput, Text, Text as Text$1, TextInput, Textarea, ThemeIcon, Tooltip, useComputedColorScheme, useMantineColorScheme } from "@mantine/core";
|
|
7
8
|
import { ModalsProvider, modals } from "@mantine/modals";
|
|
8
9
|
import { Notifications, notifications } from "@mantine/notifications";
|
|
9
10
|
import { NavigationProgress, nprogress } from "@mantine/nprogress";
|
|
@@ -16,6 +17,949 @@ import { parseQueryString } from "alepha/orm";
|
|
|
16
17
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
17
18
|
import { DateTimeProvider } from "alepha/datetime";
|
|
18
19
|
|
|
20
|
+
//#region src/core/themes/aurora.ts
|
|
21
|
+
const auroraTheme = {
|
|
22
|
+
id: "aurora",
|
|
23
|
+
label: "Aurora",
|
|
24
|
+
description: "Vibrant, playful with gradients and hover effects",
|
|
25
|
+
primaryColor: "violet",
|
|
26
|
+
primaryShade: {
|
|
27
|
+
light: 5,
|
|
28
|
+
dark: 4
|
|
29
|
+
},
|
|
30
|
+
fontFamily: "\"Nunito\", \"Poppins\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif",
|
|
31
|
+
fontFamilyMonospace: "\"Fira Code\", \"JetBrains Mono\", ui-monospace, Consolas, monospace",
|
|
32
|
+
headings: {
|
|
33
|
+
fontFamily: "\"Nunito\", \"Poppins\", -apple-system, BlinkMacSystemFont, sans-serif",
|
|
34
|
+
fontWeight: "700",
|
|
35
|
+
textWrap: "wrap",
|
|
36
|
+
sizes: {
|
|
37
|
+
h1: {
|
|
38
|
+
fontSize: "2.25rem",
|
|
39
|
+
lineHeight: "1.3"
|
|
40
|
+
},
|
|
41
|
+
h2: {
|
|
42
|
+
fontSize: "1.75rem",
|
|
43
|
+
lineHeight: "1.35"
|
|
44
|
+
},
|
|
45
|
+
h3: {
|
|
46
|
+
fontSize: "1.375rem",
|
|
47
|
+
lineHeight: "1.4"
|
|
48
|
+
},
|
|
49
|
+
h4: {
|
|
50
|
+
fontSize: "1.125rem",
|
|
51
|
+
lineHeight: "1.45"
|
|
52
|
+
},
|
|
53
|
+
h5: {
|
|
54
|
+
fontSize: "1rem",
|
|
55
|
+
lineHeight: "1.5"
|
|
56
|
+
},
|
|
57
|
+
h6: {
|
|
58
|
+
fontSize: "0.875rem",
|
|
59
|
+
lineHeight: "1.5"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
fontSizes: {
|
|
64
|
+
xs: "0.8rem",
|
|
65
|
+
sm: "0.9rem",
|
|
66
|
+
md: "1rem",
|
|
67
|
+
lg: "1.125rem",
|
|
68
|
+
xl: "1.3rem"
|
|
69
|
+
},
|
|
70
|
+
lineHeights: {
|
|
71
|
+
xs: "1.5",
|
|
72
|
+
sm: "1.55",
|
|
73
|
+
md: "1.6",
|
|
74
|
+
lg: "1.65",
|
|
75
|
+
xl: "1.7"
|
|
76
|
+
},
|
|
77
|
+
radius: {
|
|
78
|
+
xs: "6px",
|
|
79
|
+
sm: "8px",
|
|
80
|
+
md: "12px",
|
|
81
|
+
lg: "16px",
|
|
82
|
+
xl: "24px"
|
|
83
|
+
},
|
|
84
|
+
defaultRadius: "md",
|
|
85
|
+
shadows: {
|
|
86
|
+
xs: "0 2px 4px rgba(139, 92, 246, 0.08)",
|
|
87
|
+
sm: "0 4px 8px rgba(139, 92, 246, 0.1)",
|
|
88
|
+
md: "0 8px 16px rgba(139, 92, 246, 0.12)",
|
|
89
|
+
lg: "0 16px 32px rgba(139, 92, 246, 0.15)",
|
|
90
|
+
xl: "0 24px 48px rgba(139, 92, 246, 0.18)"
|
|
91
|
+
},
|
|
92
|
+
defaultGradient: {
|
|
93
|
+
from: "violet",
|
|
94
|
+
to: "pink",
|
|
95
|
+
deg: 135
|
|
96
|
+
},
|
|
97
|
+
colors: {
|
|
98
|
+
dark: [
|
|
99
|
+
"#d4d0dc",
|
|
100
|
+
"#a8a3b3",
|
|
101
|
+
"#7c7689",
|
|
102
|
+
"#5c5568",
|
|
103
|
+
"#454050",
|
|
104
|
+
"#302c38",
|
|
105
|
+
"#252129",
|
|
106
|
+
"#1e1b24",
|
|
107
|
+
"#16141a",
|
|
108
|
+
"#0d0c10"
|
|
109
|
+
],
|
|
110
|
+
gray: [
|
|
111
|
+
"#faf9fb",
|
|
112
|
+
"#f3f1f5",
|
|
113
|
+
"#e8e5ed",
|
|
114
|
+
"#d4d0dc",
|
|
115
|
+
"#a8a3b3",
|
|
116
|
+
"#7c7689",
|
|
117
|
+
"#5c5568",
|
|
118
|
+
"#454050",
|
|
119
|
+
"#302c38",
|
|
120
|
+
"#1e1b24"
|
|
121
|
+
],
|
|
122
|
+
violet: [
|
|
123
|
+
"#f5f3ff",
|
|
124
|
+
"#ede9fe",
|
|
125
|
+
"#ddd6fe",
|
|
126
|
+
"#c4b5fd",
|
|
127
|
+
"#a78bfa",
|
|
128
|
+
"#8b5cf6",
|
|
129
|
+
"#7c3aed",
|
|
130
|
+
"#6d28d9",
|
|
131
|
+
"#5b21b6",
|
|
132
|
+
"#4c1d95"
|
|
133
|
+
],
|
|
134
|
+
pink: [
|
|
135
|
+
"#fdf2f8",
|
|
136
|
+
"#fce7f3",
|
|
137
|
+
"#fbcfe8",
|
|
138
|
+
"#f9a8d4",
|
|
139
|
+
"#f472b6",
|
|
140
|
+
"#ec4899",
|
|
141
|
+
"#db2777",
|
|
142
|
+
"#be185d",
|
|
143
|
+
"#9d174d",
|
|
144
|
+
"#831843"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/core/themes/crystal.ts
|
|
151
|
+
const crystalTheme = {
|
|
152
|
+
id: "crystal",
|
|
153
|
+
label: "Crystal",
|
|
154
|
+
description: "Glass-morphism with backdrop blur effects",
|
|
155
|
+
primaryColor: "blue",
|
|
156
|
+
primaryShade: {
|
|
157
|
+
light: 5,
|
|
158
|
+
dark: 4
|
|
159
|
+
},
|
|
160
|
+
fontFamily: "\"SF Pro Display\", \"Helvetica Neue\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif",
|
|
161
|
+
fontFamilyMonospace: "\"SF Mono\", \"Fira Code\", ui-monospace, Menlo, Consolas, monospace",
|
|
162
|
+
headings: {
|
|
163
|
+
fontFamily: "\"SF Pro Display\", \"Helvetica Neue\", -apple-system, BlinkMacSystemFont, sans-serif",
|
|
164
|
+
fontWeight: "600",
|
|
165
|
+
textWrap: "wrap",
|
|
166
|
+
sizes: {
|
|
167
|
+
h1: {
|
|
168
|
+
fontSize: "2rem",
|
|
169
|
+
lineHeight: "1.25"
|
|
170
|
+
},
|
|
171
|
+
h2: {
|
|
172
|
+
fontSize: "1.5rem",
|
|
173
|
+
lineHeight: "1.3"
|
|
174
|
+
},
|
|
175
|
+
h3: {
|
|
176
|
+
fontSize: "1.25rem",
|
|
177
|
+
lineHeight: "1.35"
|
|
178
|
+
},
|
|
179
|
+
h4: {
|
|
180
|
+
fontSize: "1.0625rem",
|
|
181
|
+
lineHeight: "1.4"
|
|
182
|
+
},
|
|
183
|
+
h5: {
|
|
184
|
+
fontSize: "0.9375rem",
|
|
185
|
+
lineHeight: "1.45"
|
|
186
|
+
},
|
|
187
|
+
h6: {
|
|
188
|
+
fontSize: "0.8125rem",
|
|
189
|
+
lineHeight: "1.5"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
fontSizes: {
|
|
194
|
+
xs: "0.75rem",
|
|
195
|
+
sm: "0.8125rem",
|
|
196
|
+
md: "0.9375rem",
|
|
197
|
+
lg: "1.0625rem",
|
|
198
|
+
xl: "1.25rem"
|
|
199
|
+
},
|
|
200
|
+
lineHeights: {
|
|
201
|
+
xs: "1.45",
|
|
202
|
+
sm: "1.5",
|
|
203
|
+
md: "1.55",
|
|
204
|
+
lg: "1.6",
|
|
205
|
+
xl: "1.65"
|
|
206
|
+
},
|
|
207
|
+
radius: {
|
|
208
|
+
xs: "4px",
|
|
209
|
+
sm: "8px",
|
|
210
|
+
md: "10px",
|
|
211
|
+
lg: "14px",
|
|
212
|
+
xl: "20px"
|
|
213
|
+
},
|
|
214
|
+
defaultRadius: "md",
|
|
215
|
+
shadows: {
|
|
216
|
+
xs: "0 2px 8px rgba(59, 130, 246, 0.04)",
|
|
217
|
+
sm: "0 4px 12px rgba(59, 130, 246, 0.06)",
|
|
218
|
+
md: "0 8px 20px rgba(59, 130, 246, 0.08)",
|
|
219
|
+
lg: "0 16px 32px rgba(59, 130, 246, 0.1)",
|
|
220
|
+
xl: "0 24px 48px rgba(59, 130, 246, 0.12)"
|
|
221
|
+
},
|
|
222
|
+
defaultGradient: {
|
|
223
|
+
from: "cyan",
|
|
224
|
+
to: "blue",
|
|
225
|
+
deg: 135
|
|
226
|
+
},
|
|
227
|
+
colors: {
|
|
228
|
+
dark: [
|
|
229
|
+
"#cbd5e1",
|
|
230
|
+
"#94a3b8",
|
|
231
|
+
"#64748b",
|
|
232
|
+
"#475569",
|
|
233
|
+
"#334155",
|
|
234
|
+
"#1e293b",
|
|
235
|
+
"#0f172a",
|
|
236
|
+
"#0c1322",
|
|
237
|
+
"#080e1a",
|
|
238
|
+
"#040711"
|
|
239
|
+
],
|
|
240
|
+
gray: [
|
|
241
|
+
"#f8fafc",
|
|
242
|
+
"#f1f5f9",
|
|
243
|
+
"#e2e8f0",
|
|
244
|
+
"#cbd5e1",
|
|
245
|
+
"#94a3b8",
|
|
246
|
+
"#64748b",
|
|
247
|
+
"#475569",
|
|
248
|
+
"#334155",
|
|
249
|
+
"#1e293b",
|
|
250
|
+
"#0f172a"
|
|
251
|
+
],
|
|
252
|
+
blue: [
|
|
253
|
+
"#f0f9ff",
|
|
254
|
+
"#e0f2fe",
|
|
255
|
+
"#bae6fd",
|
|
256
|
+
"#7dd3fc",
|
|
257
|
+
"#38bdf8",
|
|
258
|
+
"#0ea5e9",
|
|
259
|
+
"#0284c7",
|
|
260
|
+
"#0369a1",
|
|
261
|
+
"#075985",
|
|
262
|
+
"#0c4a6e"
|
|
263
|
+
],
|
|
264
|
+
cyan: [
|
|
265
|
+
"#ecfeff",
|
|
266
|
+
"#cffafe",
|
|
267
|
+
"#a5f3fc",
|
|
268
|
+
"#67e8f9",
|
|
269
|
+
"#22d3ee",
|
|
270
|
+
"#06b6d4",
|
|
271
|
+
"#0891b2",
|
|
272
|
+
"#0e7490",
|
|
273
|
+
"#155e75",
|
|
274
|
+
"#164e63"
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/core/themes/default.ts
|
|
281
|
+
const defaultTheme = {
|
|
282
|
+
id: "default",
|
|
283
|
+
label: "Default",
|
|
284
|
+
description: "Mantine defaults with no customization"
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/core/themes/ember.ts
|
|
289
|
+
const emberTheme = {
|
|
290
|
+
id: "ember",
|
|
291
|
+
label: "Ember",
|
|
292
|
+
description: "Warm, cozy with stone tints",
|
|
293
|
+
primaryColor: "orange",
|
|
294
|
+
primaryShade: {
|
|
295
|
+
light: 5,
|
|
296
|
+
dark: 4
|
|
297
|
+
},
|
|
298
|
+
fontFamily: "\"Source Sans Pro\", \"Open Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif",
|
|
299
|
+
fontFamilyMonospace: "\"Source Code Pro\", \"Fira Code\", ui-monospace, Menlo, Consolas, monospace",
|
|
300
|
+
headings: {
|
|
301
|
+
fontFamily: "\"Source Sans Pro\", \"Open Sans\", -apple-system, BlinkMacSystemFont, sans-serif",
|
|
302
|
+
fontWeight: "600",
|
|
303
|
+
textWrap: "wrap",
|
|
304
|
+
sizes: {
|
|
305
|
+
h1: {
|
|
306
|
+
fontSize: "2rem",
|
|
307
|
+
lineHeight: "1.3"
|
|
308
|
+
},
|
|
309
|
+
h2: {
|
|
310
|
+
fontSize: "1.5rem",
|
|
311
|
+
lineHeight: "1.35"
|
|
312
|
+
},
|
|
313
|
+
h3: {
|
|
314
|
+
fontSize: "1.25rem",
|
|
315
|
+
lineHeight: "1.4"
|
|
316
|
+
},
|
|
317
|
+
h4: {
|
|
318
|
+
fontSize: "1.125rem",
|
|
319
|
+
lineHeight: "1.45"
|
|
320
|
+
},
|
|
321
|
+
h5: {
|
|
322
|
+
fontSize: "1rem",
|
|
323
|
+
lineHeight: "1.5"
|
|
324
|
+
},
|
|
325
|
+
h6: {
|
|
326
|
+
fontSize: "0.875rem",
|
|
327
|
+
lineHeight: "1.5"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
fontSizes: {
|
|
332
|
+
xs: "0.75rem",
|
|
333
|
+
sm: "0.875rem",
|
|
334
|
+
md: "1rem",
|
|
335
|
+
lg: "1.125rem",
|
|
336
|
+
xl: "1.25rem"
|
|
337
|
+
},
|
|
338
|
+
lineHeights: {
|
|
339
|
+
xs: "1.5",
|
|
340
|
+
sm: "1.55",
|
|
341
|
+
md: "1.65",
|
|
342
|
+
lg: "1.7",
|
|
343
|
+
xl: "1.75"
|
|
344
|
+
},
|
|
345
|
+
radius: {
|
|
346
|
+
xs: "4px",
|
|
347
|
+
sm: "6px",
|
|
348
|
+
md: "8px",
|
|
349
|
+
lg: "12px",
|
|
350
|
+
xl: "16px"
|
|
351
|
+
},
|
|
352
|
+
defaultRadius: "md",
|
|
353
|
+
shadows: {
|
|
354
|
+
xs: "0 1px 3px rgba(194, 65, 12, 0.06)",
|
|
355
|
+
sm: "0 2px 6px rgba(194, 65, 12, 0.08)",
|
|
356
|
+
md: "0 4px 12px rgba(194, 65, 12, 0.1)",
|
|
357
|
+
lg: "0 8px 24px rgba(194, 65, 12, 0.12)",
|
|
358
|
+
xl: "0 16px 40px rgba(194, 65, 12, 0.14)"
|
|
359
|
+
},
|
|
360
|
+
defaultGradient: {
|
|
361
|
+
from: "orange",
|
|
362
|
+
to: "yellow",
|
|
363
|
+
deg: 180
|
|
364
|
+
},
|
|
365
|
+
colors: {
|
|
366
|
+
dark: [
|
|
367
|
+
"#d6d3d1",
|
|
368
|
+
"#a8a29e",
|
|
369
|
+
"#78716c",
|
|
370
|
+
"#57534e",
|
|
371
|
+
"#44403c",
|
|
372
|
+
"#292524",
|
|
373
|
+
"#1c1917",
|
|
374
|
+
"#171412",
|
|
375
|
+
"#120f0d",
|
|
376
|
+
"#0c0a09"
|
|
377
|
+
],
|
|
378
|
+
gray: [
|
|
379
|
+
"#fafaf9",
|
|
380
|
+
"#f5f5f4",
|
|
381
|
+
"#e7e5e4",
|
|
382
|
+
"#d6d3d1",
|
|
383
|
+
"#a8a29e",
|
|
384
|
+
"#78716c",
|
|
385
|
+
"#57534e",
|
|
386
|
+
"#44403c",
|
|
387
|
+
"#292524",
|
|
388
|
+
"#1c1917"
|
|
389
|
+
],
|
|
390
|
+
orange: [
|
|
391
|
+
"#fff7ed",
|
|
392
|
+
"#ffedd5",
|
|
393
|
+
"#fed7aa",
|
|
394
|
+
"#fdba74",
|
|
395
|
+
"#fb923c",
|
|
396
|
+
"#f97316",
|
|
397
|
+
"#ea580c",
|
|
398
|
+
"#c2410c",
|
|
399
|
+
"#9a3412",
|
|
400
|
+
"#7c2d12"
|
|
401
|
+
],
|
|
402
|
+
yellow: [
|
|
403
|
+
"#fffbeb",
|
|
404
|
+
"#fef3c7",
|
|
405
|
+
"#fde68a",
|
|
406
|
+
"#fcd34d",
|
|
407
|
+
"#fbbf24",
|
|
408
|
+
"#f59e0b",
|
|
409
|
+
"#d97706",
|
|
410
|
+
"#b45309",
|
|
411
|
+
"#92400e",
|
|
412
|
+
"#78350f"
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/core/themes/midnight.ts
|
|
419
|
+
const midnightTheme = {
|
|
420
|
+
id: "midnight",
|
|
421
|
+
label: "Midnight",
|
|
422
|
+
description: "Clean, developer-focused design",
|
|
423
|
+
primaryColor: "gray",
|
|
424
|
+
primaryShade: {
|
|
425
|
+
light: 7,
|
|
426
|
+
dark: 8
|
|
427
|
+
},
|
|
428
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\"",
|
|
429
|
+
fontFamilyMonospace: "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace",
|
|
430
|
+
headings: {
|
|
431
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif",
|
|
432
|
+
fontWeight: "600",
|
|
433
|
+
textWrap: "wrap",
|
|
434
|
+
sizes: {
|
|
435
|
+
h1: {
|
|
436
|
+
fontSize: "2rem",
|
|
437
|
+
lineHeight: "1.25"
|
|
438
|
+
},
|
|
439
|
+
h2: {
|
|
440
|
+
fontSize: "1.5rem",
|
|
441
|
+
lineHeight: "1.3"
|
|
442
|
+
},
|
|
443
|
+
h3: {
|
|
444
|
+
fontSize: "1.25rem",
|
|
445
|
+
lineHeight: "1.4"
|
|
446
|
+
},
|
|
447
|
+
h4: {
|
|
448
|
+
fontSize: "1rem",
|
|
449
|
+
lineHeight: "1.5"
|
|
450
|
+
},
|
|
451
|
+
h5: {
|
|
452
|
+
fontSize: "0.875rem",
|
|
453
|
+
lineHeight: "1.5"
|
|
454
|
+
},
|
|
455
|
+
h6: {
|
|
456
|
+
fontSize: "0.75rem",
|
|
457
|
+
lineHeight: "1.5"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
radius: {
|
|
462
|
+
xs: "3px",
|
|
463
|
+
sm: "6px",
|
|
464
|
+
md: "6px",
|
|
465
|
+
lg: "8px",
|
|
466
|
+
xl: "12px"
|
|
467
|
+
},
|
|
468
|
+
defaultRadius: "sm",
|
|
469
|
+
colors: {
|
|
470
|
+
dark: [
|
|
471
|
+
"#d0d7de",
|
|
472
|
+
"#8b949e",
|
|
473
|
+
"#6e7681",
|
|
474
|
+
"#484f58",
|
|
475
|
+
"#30363d",
|
|
476
|
+
"#21262d",
|
|
477
|
+
"#161b22",
|
|
478
|
+
"#151b23",
|
|
479
|
+
"#0d1117",
|
|
480
|
+
"#010409"
|
|
481
|
+
],
|
|
482
|
+
gray: [
|
|
483
|
+
"#f6f8fa",
|
|
484
|
+
"#eaeef2",
|
|
485
|
+
"#d0d7de",
|
|
486
|
+
"#afb8c1",
|
|
487
|
+
"#8c959f",
|
|
488
|
+
"#6e7781",
|
|
489
|
+
"#57606a",
|
|
490
|
+
"#424a53",
|
|
491
|
+
"#32383f",
|
|
492
|
+
"#24292f"
|
|
493
|
+
],
|
|
494
|
+
blue: [
|
|
495
|
+
"#ddf4ff",
|
|
496
|
+
"#b6e3ff",
|
|
497
|
+
"#80ccff",
|
|
498
|
+
"#54aeff",
|
|
499
|
+
"#218bff",
|
|
500
|
+
"#0969da",
|
|
501
|
+
"#0550ae",
|
|
502
|
+
"#033d8b",
|
|
503
|
+
"#0a3069",
|
|
504
|
+
"#002155"
|
|
505
|
+
],
|
|
506
|
+
green: [
|
|
507
|
+
"#dafbe1",
|
|
508
|
+
"#aceebb",
|
|
509
|
+
"#6fdd8b",
|
|
510
|
+
"#4ac26b",
|
|
511
|
+
"#2da44e",
|
|
512
|
+
"#1a7f37",
|
|
513
|
+
"#116329",
|
|
514
|
+
"#044f1e",
|
|
515
|
+
"#003d16",
|
|
516
|
+
"#002d11"
|
|
517
|
+
],
|
|
518
|
+
red: [
|
|
519
|
+
"#ffebe9",
|
|
520
|
+
"#ffcecb",
|
|
521
|
+
"#ffaba8",
|
|
522
|
+
"#ff8182",
|
|
523
|
+
"#fa4549",
|
|
524
|
+
"#cf222e",
|
|
525
|
+
"#a40e26",
|
|
526
|
+
"#82071e",
|
|
527
|
+
"#660018",
|
|
528
|
+
"#4c0014"
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/core/themes/remoraid.ts
|
|
535
|
+
const remoraidTheme = {
|
|
536
|
+
id: "remoraid",
|
|
537
|
+
label: "Remoraid",
|
|
538
|
+
description: "Soft, nature-inspired with green tones",
|
|
539
|
+
colors: {
|
|
540
|
+
dark: [
|
|
541
|
+
"#fafcff",
|
|
542
|
+
"#cad5e8",
|
|
543
|
+
"#8697b5",
|
|
544
|
+
"#4c5d7d",
|
|
545
|
+
"#222833",
|
|
546
|
+
"#222938",
|
|
547
|
+
"#0b0f14",
|
|
548
|
+
"#0b0f14",
|
|
549
|
+
"#030405",
|
|
550
|
+
"#000000"
|
|
551
|
+
],
|
|
552
|
+
gray: [
|
|
553
|
+
"#e3e7f1",
|
|
554
|
+
"#d8ddeb",
|
|
555
|
+
"#ced4e5",
|
|
556
|
+
"#c3cadf",
|
|
557
|
+
"#b8c1d9",
|
|
558
|
+
"#b8c1d9",
|
|
559
|
+
"#7b8cb8",
|
|
560
|
+
"#4b5c8b",
|
|
561
|
+
"#2a334d",
|
|
562
|
+
"#090b10"
|
|
563
|
+
],
|
|
564
|
+
blue: [
|
|
565
|
+
"#ddf4ff",
|
|
566
|
+
"#b6e3ff",
|
|
567
|
+
"#80ccff",
|
|
568
|
+
"#54aeff",
|
|
569
|
+
"#218bff",
|
|
570
|
+
"#0969da",
|
|
571
|
+
"#0550ae",
|
|
572
|
+
"#033d8b",
|
|
573
|
+
"#0a3069",
|
|
574
|
+
"#002155"
|
|
575
|
+
],
|
|
576
|
+
green: [
|
|
577
|
+
"#dafbe1",
|
|
578
|
+
"#aceebb",
|
|
579
|
+
"#6fdd8b",
|
|
580
|
+
"#4ac26b",
|
|
581
|
+
"#2da44e",
|
|
582
|
+
"#1a7f37",
|
|
583
|
+
"#116329",
|
|
584
|
+
"#044f1e",
|
|
585
|
+
"#003d16",
|
|
586
|
+
"#002d11"
|
|
587
|
+
],
|
|
588
|
+
yellow: [
|
|
589
|
+
"#fff8c5",
|
|
590
|
+
"#fae17d",
|
|
591
|
+
"#eac54f",
|
|
592
|
+
"#d4a72c",
|
|
593
|
+
"#bf8700",
|
|
594
|
+
"#9a6700",
|
|
595
|
+
"#7d4e00",
|
|
596
|
+
"#633c01",
|
|
597
|
+
"#4d2d00",
|
|
598
|
+
"#3b2300"
|
|
599
|
+
],
|
|
600
|
+
orange: [
|
|
601
|
+
"#fff1e5",
|
|
602
|
+
"#ffd8b5",
|
|
603
|
+
"#ffb77c",
|
|
604
|
+
"#fb8f44",
|
|
605
|
+
"#e16f24",
|
|
606
|
+
"#bc4c00",
|
|
607
|
+
"#953800",
|
|
608
|
+
"#762c00",
|
|
609
|
+
"#5c2200",
|
|
610
|
+
"#471700"
|
|
611
|
+
],
|
|
612
|
+
red: [
|
|
613
|
+
"#fff5f5",
|
|
614
|
+
"#ffe3e3",
|
|
615
|
+
"#ffc9c9",
|
|
616
|
+
"#ffa8a8",
|
|
617
|
+
"#ff8787",
|
|
618
|
+
"#ff6b6b",
|
|
619
|
+
"#fa5252",
|
|
620
|
+
"#f03e3e",
|
|
621
|
+
"#e03131",
|
|
622
|
+
"#c92a2a"
|
|
623
|
+
],
|
|
624
|
+
pink: [
|
|
625
|
+
"#fff0f6",
|
|
626
|
+
"#ffdeeb",
|
|
627
|
+
"#fcc2d7",
|
|
628
|
+
"#faa2c1",
|
|
629
|
+
"#f783ac",
|
|
630
|
+
"#f06595",
|
|
631
|
+
"#e64980",
|
|
632
|
+
"#d6336c",
|
|
633
|
+
"#c2255c",
|
|
634
|
+
"#a61e4d"
|
|
635
|
+
],
|
|
636
|
+
grape: [
|
|
637
|
+
"#f8f0fc",
|
|
638
|
+
"#f3d9fa",
|
|
639
|
+
"#eebefa",
|
|
640
|
+
"#e599f7",
|
|
641
|
+
"#da77f2",
|
|
642
|
+
"#cc5de8",
|
|
643
|
+
"#be4bdb",
|
|
644
|
+
"#ae3ec9",
|
|
645
|
+
"#9c36b5",
|
|
646
|
+
"#862e9c"
|
|
647
|
+
],
|
|
648
|
+
violet: [
|
|
649
|
+
"#f3f0ff",
|
|
650
|
+
"#e5dbff",
|
|
651
|
+
"#d0bfff",
|
|
652
|
+
"#b197fc",
|
|
653
|
+
"#9775fa",
|
|
654
|
+
"#845ef7",
|
|
655
|
+
"#7950f2",
|
|
656
|
+
"#7048e8",
|
|
657
|
+
"#6741d9",
|
|
658
|
+
"#5f3dc4"
|
|
659
|
+
],
|
|
660
|
+
indigo: [
|
|
661
|
+
"#edf2ff",
|
|
662
|
+
"#dbe4ff",
|
|
663
|
+
"#bac8ff",
|
|
664
|
+
"#91a7ff",
|
|
665
|
+
"#748ffc",
|
|
666
|
+
"#5c7cfa",
|
|
667
|
+
"#4c6ef5",
|
|
668
|
+
"#4263eb",
|
|
669
|
+
"#3b5bdb",
|
|
670
|
+
"#364fc7"
|
|
671
|
+
],
|
|
672
|
+
cyan: [
|
|
673
|
+
"#e3fafc",
|
|
674
|
+
"#c5f6fa",
|
|
675
|
+
"#99e9f2",
|
|
676
|
+
"#66d9e8",
|
|
677
|
+
"#3bc9db",
|
|
678
|
+
"#22b8cf",
|
|
679
|
+
"#15aabf",
|
|
680
|
+
"#1098ad",
|
|
681
|
+
"#0c8599",
|
|
682
|
+
"#0b7285"
|
|
683
|
+
],
|
|
684
|
+
teal: [
|
|
685
|
+
"#e6fcf5",
|
|
686
|
+
"#c3fae8",
|
|
687
|
+
"#96f2d7",
|
|
688
|
+
"#63e6be",
|
|
689
|
+
"#38d9a9",
|
|
690
|
+
"#20c997",
|
|
691
|
+
"#12b886",
|
|
692
|
+
"#0ca678",
|
|
693
|
+
"#099268",
|
|
694
|
+
"#087f5b"
|
|
695
|
+
],
|
|
696
|
+
lime: [
|
|
697
|
+
"#f4fce3",
|
|
698
|
+
"#e9fac8",
|
|
699
|
+
"#d8f5a2",
|
|
700
|
+
"#c0eb75",
|
|
701
|
+
"#a9e34b",
|
|
702
|
+
"#94d82d",
|
|
703
|
+
"#82c91e",
|
|
704
|
+
"#74b816",
|
|
705
|
+
"#66a80f",
|
|
706
|
+
"#5c940d"
|
|
707
|
+
],
|
|
708
|
+
Remoraid: [
|
|
709
|
+
"#dcf2de",
|
|
710
|
+
"#c7eccc",
|
|
711
|
+
"#b2e6b9",
|
|
712
|
+
"#9de1a6",
|
|
713
|
+
"#88db93",
|
|
714
|
+
"#88db93",
|
|
715
|
+
"#5fc26d",
|
|
716
|
+
"#479454",
|
|
717
|
+
"#296133",
|
|
718
|
+
"#19361d"
|
|
719
|
+
]
|
|
720
|
+
},
|
|
721
|
+
primaryColor: "Remoraid",
|
|
722
|
+
primaryShade: {
|
|
723
|
+
light: 6,
|
|
724
|
+
dark: 7
|
|
725
|
+
},
|
|
726
|
+
white: "#ffffff",
|
|
727
|
+
black: "#24292f",
|
|
728
|
+
autoContrast: true,
|
|
729
|
+
luminanceThreshold: .3,
|
|
730
|
+
fontFamily: "Open Sans",
|
|
731
|
+
fontFamilyMonospace: "Roboto Mono",
|
|
732
|
+
headings: {
|
|
733
|
+
fontFamily: "Open Sans",
|
|
734
|
+
fontWeight: "500",
|
|
735
|
+
sizes: {
|
|
736
|
+
h1: {
|
|
737
|
+
fontSize: "3.125rem",
|
|
738
|
+
lineHeight: "1.3",
|
|
739
|
+
fontWeight: "700"
|
|
740
|
+
},
|
|
741
|
+
h2: {
|
|
742
|
+
fontSize: "1.625rem",
|
|
743
|
+
lineHeight: "1.35",
|
|
744
|
+
fontWeight: "0"
|
|
745
|
+
},
|
|
746
|
+
h3: {
|
|
747
|
+
fontSize: "1.375rem",
|
|
748
|
+
lineHeight: "1.4",
|
|
749
|
+
fontWeight: "0"
|
|
750
|
+
},
|
|
751
|
+
h4: {
|
|
752
|
+
fontSize: "1.125rem",
|
|
753
|
+
lineHeight: "1.45",
|
|
754
|
+
fontWeight: "0"
|
|
755
|
+
},
|
|
756
|
+
h5: {
|
|
757
|
+
fontSize: "1rem",
|
|
758
|
+
lineHeight: "1.5",
|
|
759
|
+
fontWeight: "0"
|
|
760
|
+
},
|
|
761
|
+
h6: {
|
|
762
|
+
fontSize: "0.875rem",
|
|
763
|
+
lineHeight: "1.5",
|
|
764
|
+
fontWeight: "0"
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
scale: 1,
|
|
769
|
+
radius: {
|
|
770
|
+
xs: "0.325rem",
|
|
771
|
+
sm: "0.75rem",
|
|
772
|
+
md: "0.7rem",
|
|
773
|
+
lg: "1.2rem",
|
|
774
|
+
xl: "2.4rem"
|
|
775
|
+
},
|
|
776
|
+
spacing: {
|
|
777
|
+
xs: "0.525rem",
|
|
778
|
+
sm: "0.65rem",
|
|
779
|
+
md: "0.9rem",
|
|
780
|
+
lg: "1.35rem",
|
|
781
|
+
xl: "2.2rem"
|
|
782
|
+
},
|
|
783
|
+
defaultRadius: "md",
|
|
784
|
+
breakpoints: {
|
|
785
|
+
xs: "36em",
|
|
786
|
+
sm: "48em",
|
|
787
|
+
md: "62em",
|
|
788
|
+
lg: "75em",
|
|
789
|
+
xl: "88em"
|
|
790
|
+
},
|
|
791
|
+
fontSmoothing: true,
|
|
792
|
+
respectReducedMotion: false,
|
|
793
|
+
focusRing: "auto",
|
|
794
|
+
cursorType: "default",
|
|
795
|
+
components: {
|
|
796
|
+
Input: {
|
|
797
|
+
defaultProps: {
|
|
798
|
+
variant: "default",
|
|
799
|
+
radius: "xl"
|
|
800
|
+
},
|
|
801
|
+
styles: {}
|
|
802
|
+
},
|
|
803
|
+
Card: {
|
|
804
|
+
defaultProps: { withBorder: true },
|
|
805
|
+
styles: {}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region src/core/themes/slate.ts
|
|
812
|
+
const slateTheme = {
|
|
813
|
+
id: "slate",
|
|
814
|
+
label: "Slate",
|
|
815
|
+
description: "Professional, minimal zinc palette",
|
|
816
|
+
primaryColor: "dark",
|
|
817
|
+
primaryShade: {
|
|
818
|
+
light: 9,
|
|
819
|
+
dark: 7
|
|
820
|
+
},
|
|
821
|
+
fontFamily: "\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
|
|
822
|
+
fontFamilyMonospace: "\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
823
|
+
headings: {
|
|
824
|
+
fontFamily: "\"Inter\", -apple-system, BlinkMacSystemFont, sans-serif",
|
|
825
|
+
fontWeight: "600",
|
|
826
|
+
textWrap: "wrap",
|
|
827
|
+
sizes: {
|
|
828
|
+
h1: {
|
|
829
|
+
fontSize: "2rem",
|
|
830
|
+
lineHeight: "1.2"
|
|
831
|
+
},
|
|
832
|
+
h2: {
|
|
833
|
+
fontSize: "1.5rem",
|
|
834
|
+
lineHeight: "1.25"
|
|
835
|
+
},
|
|
836
|
+
h3: {
|
|
837
|
+
fontSize: "1.25rem",
|
|
838
|
+
lineHeight: "1.3"
|
|
839
|
+
},
|
|
840
|
+
h4: {
|
|
841
|
+
fontSize: "1rem",
|
|
842
|
+
lineHeight: "1.4"
|
|
843
|
+
},
|
|
844
|
+
h5: {
|
|
845
|
+
fontSize: "0.875rem",
|
|
846
|
+
lineHeight: "1.5"
|
|
847
|
+
},
|
|
848
|
+
h6: {
|
|
849
|
+
fontSize: "0.75rem",
|
|
850
|
+
lineHeight: "1.5"
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
fontSizes: {
|
|
855
|
+
xs: "0.75rem",
|
|
856
|
+
sm: "0.875rem",
|
|
857
|
+
md: "0.875rem",
|
|
858
|
+
lg: "1rem",
|
|
859
|
+
xl: "1.125rem"
|
|
860
|
+
},
|
|
861
|
+
lineHeights: {
|
|
862
|
+
xs: "1.4",
|
|
863
|
+
sm: "1.45",
|
|
864
|
+
md: "1.5",
|
|
865
|
+
lg: "1.55",
|
|
866
|
+
xl: "1.6"
|
|
867
|
+
},
|
|
868
|
+
radius: {
|
|
869
|
+
xs: "0.125rem",
|
|
870
|
+
sm: "0.25rem",
|
|
871
|
+
md: "0.375rem",
|
|
872
|
+
lg: "0.5rem",
|
|
873
|
+
xl: "0.75rem"
|
|
874
|
+
},
|
|
875
|
+
defaultRadius: "md",
|
|
876
|
+
shadows: {
|
|
877
|
+
xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
878
|
+
sm: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
|
|
879
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
880
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
881
|
+
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"
|
|
882
|
+
},
|
|
883
|
+
colors: {
|
|
884
|
+
dark: [
|
|
885
|
+
"#f4f4f5",
|
|
886
|
+
"#a1a1aa",
|
|
887
|
+
"#71717a",
|
|
888
|
+
"#52525b",
|
|
889
|
+
"#3f3f46",
|
|
890
|
+
"#27272a",
|
|
891
|
+
"#18181b",
|
|
892
|
+
"#0f0f10",
|
|
893
|
+
"#09090b",
|
|
894
|
+
"#000000"
|
|
895
|
+
],
|
|
896
|
+
gray: [
|
|
897
|
+
"#fafafa",
|
|
898
|
+
"#f4f4f5",
|
|
899
|
+
"#e4e4e7",
|
|
900
|
+
"#d4d4d8",
|
|
901
|
+
"#a1a1aa",
|
|
902
|
+
"#71717a",
|
|
903
|
+
"#52525b",
|
|
904
|
+
"#3f3f46",
|
|
905
|
+
"#27272a",
|
|
906
|
+
"#18181b"
|
|
907
|
+
]
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region src/core/providers/ThemeProvider.ts
|
|
913
|
+
const mantineThemeAtom = $atom({
|
|
914
|
+
name: "alepha.ui.theme",
|
|
915
|
+
schema: t.object({ id: t.string() }),
|
|
916
|
+
default: { id: "default" }
|
|
917
|
+
});
|
|
918
|
+
var ThemeProvider = class {
|
|
919
|
+
alepha = $inject(Alepha);
|
|
920
|
+
themeCookie = $cookie(mantineThemeAtom);
|
|
921
|
+
themes = [
|
|
922
|
+
defaultTheme,
|
|
923
|
+
remoraidTheme,
|
|
924
|
+
midnightTheme,
|
|
925
|
+
slateTheme,
|
|
926
|
+
auroraTheme,
|
|
927
|
+
emberTheme,
|
|
928
|
+
crystalTheme
|
|
929
|
+
];
|
|
930
|
+
themeHead = $head(() => {
|
|
931
|
+
return { htmlAttributes: { "data-theme": this.getTheme().id } };
|
|
932
|
+
});
|
|
933
|
+
setTheme(theme) {
|
|
934
|
+
this.themeCookie.set(theme);
|
|
935
|
+
this.alepha.store.set(mantineThemeAtom, theme);
|
|
936
|
+
if (typeof document === "undefined") return;
|
|
937
|
+
document.documentElement.removeAttribute("data-theme");
|
|
938
|
+
if (theme.id !== "default") document.documentElement.setAttribute("data-theme", theme.id);
|
|
939
|
+
}
|
|
940
|
+
getTheme() {
|
|
941
|
+
try {
|
|
942
|
+
return this.themeCookie.get() ?? this.alepha.store.get(mantineThemeAtom) ?? mantineThemeAtom.options.default;
|
|
943
|
+
} catch {
|
|
944
|
+
return this.alepha.store.get(mantineThemeAtom) ?? mantineThemeAtom.options.default;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
//#endregion
|
|
950
|
+
//#region src/core/hooks/useTheme.ts
|
|
951
|
+
const useTheme = () => {
|
|
952
|
+
useStore(mantineThemeAtom);
|
|
953
|
+
const themeService = useInject(ThemeProvider);
|
|
954
|
+
const currentTheme = themeService.getTheme();
|
|
955
|
+
const fullTheme = themeService.themes.find((t$1) => t$1.id === currentTheme.id) ?? themeService.themes[0];
|
|
956
|
+
const applyTheme = (theme) => {
|
|
957
|
+
themeService.setTheme({ id: theme.id });
|
|
958
|
+
};
|
|
959
|
+
return [fullTheme, applyTheme];
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
//#endregion
|
|
19
963
|
//#region src/core/services/ToastService.tsx
|
|
20
964
|
var ToastService = class {
|
|
21
965
|
raw = notifications;
|
|
@@ -81,13 +1025,312 @@ var ToastService = class {
|
|
|
81
1025
|
*
|
|
82
1026
|
* @example
|
|
83
1027
|
* ```tsx
|
|
84
|
-
* const toast = useToast();
|
|
85
|
-
* toast.success({ message: "Operation completed successfully!" });
|
|
86
|
-
* toast.error({ title: "Error", message: "Something went wrong" });
|
|
1028
|
+
* const toast = useToast();
|
|
1029
|
+
* toast.success({ message: "Operation completed successfully!" });
|
|
1030
|
+
* toast.error({ title: "Error", message: "Something went wrong" });
|
|
1031
|
+
* ```
|
|
1032
|
+
*/
|
|
1033
|
+
const useToast = () => {
|
|
1034
|
+
return useInject(ToastService);
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
//#endregion
|
|
1038
|
+
//#region src/core/constants/ui.ts
|
|
1039
|
+
const ui = {
|
|
1040
|
+
colors: {
|
|
1041
|
+
transparent: "transparent",
|
|
1042
|
+
background: "var(--alepha-background)",
|
|
1043
|
+
surface: "var(--alepha-surface)",
|
|
1044
|
+
elevated: "var(--alepha-elevated)",
|
|
1045
|
+
border: "var(--alepha-border)"
|
|
1046
|
+
},
|
|
1047
|
+
sizes: { icon: {
|
|
1048
|
+
xs: 12,
|
|
1049
|
+
sm: 16,
|
|
1050
|
+
md: 20,
|
|
1051
|
+
lg: 24,
|
|
1052
|
+
xl: 32
|
|
1053
|
+
} }
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/core/components/buttons/ActionButton.tsx
|
|
1058
|
+
const ActionMenuItem = (props) => {
|
|
1059
|
+
const { item, index } = props;
|
|
1060
|
+
const router = useRouter();
|
|
1061
|
+
const action = useAction({ handler: async (e) => {
|
|
1062
|
+
await item.onClick?.();
|
|
1063
|
+
} }, [item.onClick]);
|
|
1064
|
+
if (item.type === "divider") return /* @__PURE__ */ jsx(Menu.Divider, {}, index);
|
|
1065
|
+
if (item.type === "label") return /* @__PURE__ */ jsx(Menu.Label, { children: item.label }, index);
|
|
1066
|
+
if (item.children && item.children.length > 0) return /* @__PURE__ */ jsxs(Menu, {
|
|
1067
|
+
trigger: "hover",
|
|
1068
|
+
position: "right-start",
|
|
1069
|
+
offset: 2,
|
|
1070
|
+
children: [/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(Menu.Item, {
|
|
1071
|
+
leftSection: item.icon,
|
|
1072
|
+
rightSection: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }),
|
|
1073
|
+
children: item.label
|
|
1074
|
+
}) }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: item.children.map((child, childIndex) => /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1075
|
+
item: child,
|
|
1076
|
+
index: childIndex
|
|
1077
|
+
}, childIndex)) })]
|
|
1078
|
+
}, index);
|
|
1079
|
+
const menuItemProps = {};
|
|
1080
|
+
if (props.item.onClick) menuItemProps.onClick = action.run;
|
|
1081
|
+
else if (props.item.href) Object.assign(menuItemProps, router.anchor(props.item.href));
|
|
1082
|
+
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
1083
|
+
leftSection: item.icon,
|
|
1084
|
+
onClick: item.onClick,
|
|
1085
|
+
color: item.color,
|
|
1086
|
+
rightSection: item.active ? /* @__PURE__ */ jsx(ThemeIcon, {
|
|
1087
|
+
size: "xs",
|
|
1088
|
+
variant: "transparent",
|
|
1089
|
+
children: /* @__PURE__ */ jsx(IconCheck, {})
|
|
1090
|
+
}) : void 0,
|
|
1091
|
+
...menuItemProps,
|
|
1092
|
+
children: item.label
|
|
1093
|
+
}, index);
|
|
1094
|
+
};
|
|
1095
|
+
const ActionButton = (_props) => {
|
|
1096
|
+
const props = {
|
|
1097
|
+
variant: "subtle",
|
|
1098
|
+
..._props
|
|
1099
|
+
};
|
|
1100
|
+
const { tooltip, menu, icon, ...restProps } = props;
|
|
1101
|
+
restProps.color ??= "gray";
|
|
1102
|
+
restProps.c ??= "var(--mantine-color-text)";
|
|
1103
|
+
if (props.icon) {
|
|
1104
|
+
const icon$1 = isComponentType(props.icon) ? /* @__PURE__ */ jsx(props.icon, { size: ui.sizes.icon.md }) : /* @__PURE__ */ jsx(ThemeIcon, {
|
|
1105
|
+
w: 24,
|
|
1106
|
+
variant: "transparent",
|
|
1107
|
+
size: "sm",
|
|
1108
|
+
c: "var(--mantine-color-text)",
|
|
1109
|
+
...props.themeIconProps,
|
|
1110
|
+
children: props.icon
|
|
1111
|
+
});
|
|
1112
|
+
if (!props.children) {
|
|
1113
|
+
restProps.children = Children.only(icon$1);
|
|
1114
|
+
restProps.px ??= "xs";
|
|
1115
|
+
} else restProps.leftSection = icon$1;
|
|
1116
|
+
}
|
|
1117
|
+
if (props.leftSection && !props.children) restProps.px ??= "xs";
|
|
1118
|
+
if (props.textVisibleFrom) {
|
|
1119
|
+
const { children, textVisibleFrom, leftSection, ...rest } = restProps;
|
|
1120
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Flex$1, {
|
|
1121
|
+
w: "100%",
|
|
1122
|
+
visibleFrom: textVisibleFrom,
|
|
1123
|
+
children: /* @__PURE__ */ jsx(ActionButton, {
|
|
1124
|
+
flex: 1,
|
|
1125
|
+
...rest,
|
|
1126
|
+
leftSection,
|
|
1127
|
+
tooltip,
|
|
1128
|
+
menu,
|
|
1129
|
+
children
|
|
1130
|
+
})
|
|
1131
|
+
}), /* @__PURE__ */ jsx(Flex$1, {
|
|
1132
|
+
w: "100%",
|
|
1133
|
+
hiddenFrom: textVisibleFrom,
|
|
1134
|
+
children: /* @__PURE__ */ jsx(ActionButton, {
|
|
1135
|
+
px: "xs",
|
|
1136
|
+
...rest,
|
|
1137
|
+
tooltip,
|
|
1138
|
+
menu,
|
|
1139
|
+
children: leftSection
|
|
1140
|
+
})
|
|
1141
|
+
})] });
|
|
1142
|
+
}
|
|
1143
|
+
const renderAction = () => {
|
|
1144
|
+
if ("href" in restProps && restProps.href) {
|
|
1145
|
+
if (restProps.href.startsWith("http") || restProps.target) return /* @__PURE__ */ jsx(ActionHrefButton, {
|
|
1146
|
+
...restProps,
|
|
1147
|
+
href: restProps.href,
|
|
1148
|
+
children: restProps.children
|
|
1149
|
+
});
|
|
1150
|
+
return /* @__PURE__ */ jsx(ActionNavigationButton, {
|
|
1151
|
+
...restProps,
|
|
1152
|
+
href: restProps.href,
|
|
1153
|
+
children: restProps.children
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
delete restProps.classNameActive;
|
|
1157
|
+
delete restProps.variantActive;
|
|
1158
|
+
if ("action" in restProps && restProps.action) return /* @__PURE__ */ jsx(ActionHookButton, {
|
|
1159
|
+
...restProps,
|
|
1160
|
+
action: restProps.action,
|
|
1161
|
+
children: restProps.children
|
|
1162
|
+
});
|
|
1163
|
+
if ("onClick" in restProps && restProps.onClick) return /* @__PURE__ */ jsx(ActionClickButton, {
|
|
1164
|
+
...restProps,
|
|
1165
|
+
onClick: restProps.onClick,
|
|
1166
|
+
children: restProps.children
|
|
1167
|
+
});
|
|
1168
|
+
if ("form" in restProps && restProps.form) {
|
|
1169
|
+
if (restProps.type === "reset") return /* @__PURE__ */ jsx(ActionResetButton, {
|
|
1170
|
+
...restProps,
|
|
1171
|
+
form: restProps.form,
|
|
1172
|
+
children: restProps.children
|
|
1173
|
+
});
|
|
1174
|
+
return /* @__PURE__ */ jsx(ActionSubmitButton, {
|
|
1175
|
+
...restProps,
|
|
1176
|
+
form: restProps.form,
|
|
1177
|
+
children: restProps.children
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1181
|
+
...restProps,
|
|
1182
|
+
children: restProps.children
|
|
1183
|
+
});
|
|
1184
|
+
};
|
|
1185
|
+
let actionElement = renderAction();
|
|
1186
|
+
if (menu) actionElement = /* @__PURE__ */ jsxs(Menu, {
|
|
1187
|
+
position: menu.position || "bottom-start",
|
|
1188
|
+
width: menu.width || 200,
|
|
1189
|
+
shadow: menu.shadow || "md",
|
|
1190
|
+
trigger: menu.on === "hover" ? "hover" : "click",
|
|
1191
|
+
...menu.menuProps,
|
|
1192
|
+
children: [/* @__PURE__ */ jsx(Menu.Target, {
|
|
1193
|
+
...menu.targetProps,
|
|
1194
|
+
children: actionElement
|
|
1195
|
+
}), /* @__PURE__ */ jsx(Menu.Dropdown, { children: menu.items.map((item, index) => /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1196
|
+
item,
|
|
1197
|
+
index
|
|
1198
|
+
}, index)) })]
|
|
1199
|
+
});
|
|
1200
|
+
if (tooltip) {
|
|
1201
|
+
const defaultTooltipProps = { openDelay: 1e3 };
|
|
1202
|
+
return /* @__PURE__ */ jsx(Tooltip, { ...typeof tooltip === "string" ? {
|
|
1203
|
+
...defaultTooltipProps,
|
|
1204
|
+
label: tooltip,
|
|
1205
|
+
children: actionElement
|
|
1206
|
+
} : {
|
|
1207
|
+
...defaultTooltipProps,
|
|
1208
|
+
...tooltip,
|
|
1209
|
+
children: actionElement
|
|
1210
|
+
} });
|
|
1211
|
+
}
|
|
1212
|
+
return actionElement;
|
|
1213
|
+
};
|
|
1214
|
+
var ActionButton_default = ActionButton;
|
|
1215
|
+
/**
|
|
1216
|
+
* Action button that submits a form with loading and disabled state handling.
|
|
1217
|
+
*/
|
|
1218
|
+
const ActionSubmitButton = (props) => {
|
|
1219
|
+
const { form, ...buttonProps } = props;
|
|
1220
|
+
const state = useFormState(form);
|
|
1221
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1222
|
+
...buttonProps,
|
|
1223
|
+
loading: state.loading,
|
|
1224
|
+
disabled: state.loading,
|
|
1225
|
+
type: "submit",
|
|
1226
|
+
children: props.children
|
|
1227
|
+
});
|
|
1228
|
+
};
|
|
1229
|
+
const ActionResetButton = (props) => {
|
|
1230
|
+
const { form, ...buttonProps } = props;
|
|
1231
|
+
const state = useFormState(form);
|
|
1232
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1233
|
+
...buttonProps,
|
|
1234
|
+
disabled: state.loading,
|
|
1235
|
+
type: "reset",
|
|
1236
|
+
children: props.children
|
|
1237
|
+
});
|
|
1238
|
+
};
|
|
1239
|
+
/**
|
|
1240
|
+
* Action button that integrates with useAction hook return value.
|
|
1241
|
+
* Automatically handles loading state and executes the action on click.
|
|
1242
|
+
*
|
|
1243
|
+
* @example
|
|
1244
|
+
* ```tsx
|
|
1245
|
+
* const saveAction = useAction({
|
|
1246
|
+
* handler: async (data) => {
|
|
1247
|
+
* await api.save(data);
|
|
1248
|
+
* }
|
|
1249
|
+
* }, []);
|
|
1250
|
+
*
|
|
1251
|
+
* <ActionButton action={saveAction}>
|
|
1252
|
+
* Save
|
|
1253
|
+
* </ActionButton>
|
|
1254
|
+
* ```
|
|
1255
|
+
*/
|
|
1256
|
+
const ActionHookButton = (props) => {
|
|
1257
|
+
const { action, ...buttonProps } = props;
|
|
1258
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1259
|
+
...buttonProps,
|
|
1260
|
+
disabled: action.loading || props.disabled,
|
|
1261
|
+
loading: action.loading,
|
|
1262
|
+
onClick: () => action.run(),
|
|
1263
|
+
children: props.children
|
|
1264
|
+
});
|
|
1265
|
+
};
|
|
1266
|
+
/**
|
|
1267
|
+
* Basic action button that handles click events with loading and error handling.
|
|
1268
|
+
*
|
|
1269
|
+
* @example
|
|
1270
|
+
* ```tsx
|
|
1271
|
+
* <ActionButton onClick={() => api.doSomething()}>
|
|
1272
|
+
* Do Something
|
|
1273
|
+
* </ActionButton>
|
|
87
1274
|
* ```
|
|
88
1275
|
*/
|
|
89
|
-
const
|
|
90
|
-
|
|
1276
|
+
const ActionClickButton = (props) => {
|
|
1277
|
+
const action = useAction({ handler: async (e) => {
|
|
1278
|
+
await props.onClick(e);
|
|
1279
|
+
} }, [props.onClick]);
|
|
1280
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1281
|
+
...props,
|
|
1282
|
+
disabled: action.loading || props.disabled,
|
|
1283
|
+
loading: action.loading,
|
|
1284
|
+
onClick: action.run,
|
|
1285
|
+
children: props.children
|
|
1286
|
+
});
|
|
1287
|
+
};
|
|
1288
|
+
/**
|
|
1289
|
+
* Action for navigation with active state support.
|
|
1290
|
+
*/
|
|
1291
|
+
const ActionNavigationButton = (props) => {
|
|
1292
|
+
const { active: options, classNameActive, variantActive, routerGoOptions, ...buttonProps } = props;
|
|
1293
|
+
const router = useRouter();
|
|
1294
|
+
const { isPending, isActive } = useActive(options ? {
|
|
1295
|
+
href: props.href,
|
|
1296
|
+
...options
|
|
1297
|
+
} : { href: props.href });
|
|
1298
|
+
const anchorProps = router.anchor(props.href, routerGoOptions);
|
|
1299
|
+
const className = buttonProps.className || "";
|
|
1300
|
+
if (isActive && options !== false && classNameActive) buttonProps.className = `${className} ${classNameActive}`.trim();
|
|
1301
|
+
if (props.anchorProps) return /* @__PURE__ */ jsx(Anchor, {
|
|
1302
|
+
component: "a",
|
|
1303
|
+
...anchorProps,
|
|
1304
|
+
...props.anchorProps,
|
|
1305
|
+
children: props.children
|
|
1306
|
+
});
|
|
1307
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1308
|
+
component: "a",
|
|
1309
|
+
loading: isPending,
|
|
1310
|
+
...buttonProps,
|
|
1311
|
+
...anchorProps,
|
|
1312
|
+
variant: isActive && options !== false ? variantActive ?? "filled" : buttonProps.variant ?? "subtle",
|
|
1313
|
+
children: props.children
|
|
1314
|
+
});
|
|
1315
|
+
};
|
|
1316
|
+
const ActionHrefButton = (props) => {
|
|
1317
|
+
const { active: options, classNameActive, variantActive, routerGoOptions, target, ...buttonProps } = props;
|
|
1318
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
1319
|
+
component: "a",
|
|
1320
|
+
target,
|
|
1321
|
+
...buttonProps,
|
|
1322
|
+
children: props.children
|
|
1323
|
+
});
|
|
1324
|
+
};
|
|
1325
|
+
function isComponentType(param) {
|
|
1326
|
+
if (isValidElement(param)) return false;
|
|
1327
|
+
return typeof param === "function" || typeof param === "object" && param !== null && "$$typeof" in param;
|
|
1328
|
+
}
|
|
1329
|
+
const renderIcon = (icon) => {
|
|
1330
|
+
if (!icon) return null;
|
|
1331
|
+
if (isValidElement(icon)) return icon;
|
|
1332
|
+
if (isComponentType(icon)) return /* @__PURE__ */ jsx(icon, { size: ui.sizes.icon.md });
|
|
1333
|
+
return icon;
|
|
91
1334
|
};
|
|
92
1335
|
|
|
93
1336
|
//#endregion
|
|
@@ -97,8 +1340,12 @@ const Omnibar = (props) => {
|
|
|
97
1340
|
const searchPlaceholder = props.searchPlaceholder ?? "Search...";
|
|
98
1341
|
const nothingFound = props.nothingFound ?? "Nothing found...";
|
|
99
1342
|
const router = useRouter();
|
|
1343
|
+
const [user] = useStore("alepha.server.request.user");
|
|
100
1344
|
return /* @__PURE__ */ jsx(Spotlight, {
|
|
101
|
-
actions: useMemo(() => router.concretePages.
|
|
1345
|
+
actions: useMemo(() => router.concretePages.filter((page) => {
|
|
1346
|
+
if (page.can && !page.can()) return false;
|
|
1347
|
+
return true;
|
|
1348
|
+
}).map((page) => ({
|
|
102
1349
|
id: page.name,
|
|
103
1350
|
label: page.label ?? page.name,
|
|
104
1351
|
description: page.description,
|
|
@@ -106,12 +1353,12 @@ const Omnibar = (props) => {
|
|
|
106
1353
|
if (page.staticName) return router.go(page.staticName, { params: page.params });
|
|
107
1354
|
return router.go(page.name);
|
|
108
1355
|
},
|
|
109
|
-
leftSection: page.icon
|
|
110
|
-
})), []),
|
|
1356
|
+
leftSection: renderIcon(page.icon)
|
|
1357
|
+
})), [user]),
|
|
111
1358
|
shortcut,
|
|
112
1359
|
limit: 10,
|
|
113
1360
|
searchProps: {
|
|
114
|
-
leftSection: /* @__PURE__ */ jsx(IconSearch, { size:
|
|
1361
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: ui.sizes.icon.md }),
|
|
115
1362
|
placeholder: searchPlaceholder
|
|
116
1363
|
},
|
|
117
1364
|
nothingFound
|
|
@@ -123,6 +1370,7 @@ var Omnibar_default = Omnibar;
|
|
|
123
1370
|
//#region src/core/components/layout/AlephaMantineProvider.tsx
|
|
124
1371
|
const AlephaMantineProvider = (props) => {
|
|
125
1372
|
const toast = useToast();
|
|
1373
|
+
const [theme] = useTheme();
|
|
126
1374
|
useEvents({
|
|
127
1375
|
"react:transition:begin": () => {
|
|
128
1376
|
nprogress.start();
|
|
@@ -143,7 +1391,10 @@ const AlephaMantineProvider = (props) => {
|
|
|
143
1391
|
...props.colorSchemeScript
|
|
144
1392
|
}), /* @__PURE__ */ jsxs(MantineProvider, {
|
|
145
1393
|
...props.mantine,
|
|
146
|
-
theme: {
|
|
1394
|
+
theme: {
|
|
1395
|
+
...theme,
|
|
1396
|
+
...props.mantine?.theme
|
|
1397
|
+
},
|
|
147
1398
|
children: [
|
|
148
1399
|
/* @__PURE__ */ jsx(Notifications, { ...props.notifications }),
|
|
149
1400
|
/* @__PURE__ */ jsx(NavigationProgress, { ...props.navigationProgress }),
|
|
@@ -531,25 +1782,6 @@ const PromptDialog = ({ options, onSubmit }) => {
|
|
|
531
1782
|
};
|
|
532
1783
|
var PromptDialog_default = PromptDialog;
|
|
533
1784
|
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region src/core/constants/ui.ts
|
|
536
|
-
const ui = {
|
|
537
|
-
colors: {
|
|
538
|
-
transparent: "transparent",
|
|
539
|
-
background: "var(--alepha-background)",
|
|
540
|
-
surface: "var(--alepha-surface)",
|
|
541
|
-
elevated: "var(--alepha-elevated)",
|
|
542
|
-
border: "var(--alepha-border)"
|
|
543
|
-
},
|
|
544
|
-
sizes: { icon: {
|
|
545
|
-
xs: 12,
|
|
546
|
-
sm: 16,
|
|
547
|
-
md: 20,
|
|
548
|
-
lg: 24,
|
|
549
|
-
xl: 32
|
|
550
|
-
} }
|
|
551
|
-
};
|
|
552
|
-
|
|
553
1785
|
//#endregion
|
|
554
1786
|
//#region src/core/services/DialogService.tsx
|
|
555
1787
|
var DialogService = class {
|
|
@@ -603,360 +1835,79 @@ var DialogService = class {
|
|
|
603
1835
|
})
|
|
604
1836
|
});
|
|
605
1837
|
});
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
* Show a prompt dialog to get user input
|
|
609
|
-
*/
|
|
610
|
-
prompt(options) {
|
|
611
|
-
return new Promise((resolve) => {
|
|
612
|
-
const modalId = this.open({
|
|
613
|
-
...options,
|
|
614
|
-
title: options?.title || "Input",
|
|
615
|
-
closeOnClickOutside: false,
|
|
616
|
-
closeOnEscape: false,
|
|
617
|
-
content: /* @__PURE__ */ jsx(PromptDialog_default, {
|
|
618
|
-
options,
|
|
619
|
-
onSubmit: (value) => {
|
|
620
|
-
this.close(modalId);
|
|
621
|
-
resolve(value);
|
|
622
|
-
}
|
|
623
|
-
})
|
|
624
|
-
});
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Open a custom dialog with provided content
|
|
629
|
-
*/
|
|
630
|
-
open(options) {
|
|
631
|
-
return modals.open({
|
|
632
|
-
...this.options.default,
|
|
633
|
-
...options,
|
|
634
|
-
children: options?.content || options?.message
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Close the currently open dialog or a specific dialog by ID
|
|
639
|
-
*/
|
|
640
|
-
close(modalId) {
|
|
641
|
-
if (modalId) modals.close(modalId);
|
|
642
|
-
else modals.closeAll();
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Show a JSON editor/viewer dialog
|
|
646
|
-
*/
|
|
647
|
-
json(data, options) {
|
|
648
|
-
this.open({
|
|
649
|
-
size: "lg",
|
|
650
|
-
title: options?.title || "Json Viewer",
|
|
651
|
-
...options,
|
|
652
|
-
content: /* @__PURE__ */ jsx(Flex$1, {
|
|
653
|
-
bdrs: "md",
|
|
654
|
-
w: "100%",
|
|
655
|
-
flex: 1,
|
|
656
|
-
p: "sm",
|
|
657
|
-
bg: ui.colors.surface,
|
|
658
|
-
children: /* @__PURE__ */ jsx(JsonViewer_default, {
|
|
659
|
-
size: "xs",
|
|
660
|
-
data
|
|
661
|
-
})
|
|
662
|
-
})
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
/**
|
|
666
|
-
* Show a form dialog for structured input
|
|
667
|
-
*/
|
|
668
|
-
form(options) {
|
|
669
|
-
return Promise.resolve(null);
|
|
670
|
-
}
|
|
671
|
-
/**
|
|
672
|
-
* Show a loading/progress dialog with optional progress percentage
|
|
673
|
-
*/
|
|
674
|
-
loading(options) {}
|
|
675
|
-
/**
|
|
676
|
-
* Show an image viewer/gallery dialog
|
|
677
|
-
*/
|
|
678
|
-
image(src, options) {}
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
//#endregion
|
|
682
|
-
//#region src/core/components/buttons/ActionButton.tsx
|
|
683
|
-
const ActionMenuItem = (props) => {
|
|
684
|
-
const { item, index } = props;
|
|
685
|
-
const router = useRouter();
|
|
686
|
-
const action = useAction({ handler: async (e) => {
|
|
687
|
-
await item.onClick?.();
|
|
688
|
-
} }, [item.onClick]);
|
|
689
|
-
if (item.type === "divider") return /* @__PURE__ */ jsx(Menu.Divider, {}, index);
|
|
690
|
-
if (item.type === "label") return /* @__PURE__ */ jsx(Menu.Label, { children: item.label }, index);
|
|
691
|
-
if (item.children && item.children.length > 0) return /* @__PURE__ */ jsxs(Menu, {
|
|
692
|
-
trigger: "hover",
|
|
693
|
-
position: "right-start",
|
|
694
|
-
offset: 2,
|
|
695
|
-
children: [/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(Menu.Item, {
|
|
696
|
-
leftSection: item.icon,
|
|
697
|
-
rightSection: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }),
|
|
698
|
-
children: item.label
|
|
699
|
-
}) }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: item.children.map((child, childIndex) => /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
700
|
-
item: child,
|
|
701
|
-
index: childIndex
|
|
702
|
-
}, childIndex)) })]
|
|
703
|
-
}, index);
|
|
704
|
-
const menuItemProps = {};
|
|
705
|
-
if (props.item.onClick) menuItemProps.onClick = action.run;
|
|
706
|
-
else if (props.item.href) Object.assign(menuItemProps, router.anchor(props.item.href));
|
|
707
|
-
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
708
|
-
leftSection: item.icon,
|
|
709
|
-
onClick: item.onClick,
|
|
710
|
-
color: item.color,
|
|
711
|
-
rightSection: item.active ? /* @__PURE__ */ jsx(ThemeIcon, {
|
|
712
|
-
size: "xs",
|
|
713
|
-
variant: "transparent",
|
|
714
|
-
children: /* @__PURE__ */ jsx(IconCheck, {})
|
|
715
|
-
}) : void 0,
|
|
716
|
-
...menuItemProps,
|
|
717
|
-
children: item.label
|
|
718
|
-
}, index);
|
|
719
|
-
};
|
|
720
|
-
const ActionButton = (_props) => {
|
|
721
|
-
const props = {
|
|
722
|
-
variant: "default",
|
|
723
|
-
..._props
|
|
724
|
-
};
|
|
725
|
-
const { tooltip, menu, icon, ...restProps } = props;
|
|
726
|
-
if (props.icon) {
|
|
727
|
-
const icon$1 = isComponentType(props.icon) ? /* @__PURE__ */ jsx(props.icon, { size: ui.sizes.icon.md }) : /* @__PURE__ */ jsx(ThemeIcon, {
|
|
728
|
-
w: 24,
|
|
729
|
-
variant: "transparent",
|
|
730
|
-
size: "sm",
|
|
731
|
-
c: "var(--mantine-color-text)",
|
|
732
|
-
...props.themeIconProps,
|
|
733
|
-
children: props.icon
|
|
734
|
-
});
|
|
735
|
-
if (!props.children) {
|
|
736
|
-
restProps.children = Children.only(icon$1);
|
|
737
|
-
restProps.p ??= "xs";
|
|
738
|
-
} else restProps.leftSection = icon$1;
|
|
739
|
-
}
|
|
740
|
-
if (props.leftSection && !props.children) {
|
|
741
|
-
restProps.className ??= "mantine-Action-iconOnly";
|
|
742
|
-
restProps.p ??= "xs";
|
|
743
|
-
}
|
|
744
|
-
if (props.textVisibleFrom) {
|
|
745
|
-
const { children, textVisibleFrom, leftSection, ...rest } = restProps;
|
|
746
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Flex$1, {
|
|
747
|
-
w: "100%",
|
|
748
|
-
visibleFrom: textVisibleFrom,
|
|
749
|
-
children: /* @__PURE__ */ jsx(ActionButton, {
|
|
750
|
-
flex: 1,
|
|
751
|
-
...rest,
|
|
752
|
-
leftSection,
|
|
753
|
-
tooltip,
|
|
754
|
-
menu,
|
|
755
|
-
children
|
|
756
|
-
})
|
|
757
|
-
}), /* @__PURE__ */ jsx(Flex$1, {
|
|
758
|
-
w: "100%",
|
|
759
|
-
hiddenFrom: textVisibleFrom,
|
|
760
|
-
children: /* @__PURE__ */ jsx(ActionButton, {
|
|
761
|
-
px: "xs",
|
|
762
|
-
...rest,
|
|
763
|
-
tooltip,
|
|
764
|
-
menu,
|
|
765
|
-
children: leftSection
|
|
766
|
-
})
|
|
767
|
-
})] });
|
|
768
|
-
}
|
|
769
|
-
const renderAction = () => {
|
|
770
|
-
if ("href" in restProps && restProps.href) {
|
|
771
|
-
if (restProps.href.startsWith("http") || restProps.target) return /* @__PURE__ */ jsx(ActionHrefButton, {
|
|
772
|
-
...restProps,
|
|
773
|
-
href: restProps.href,
|
|
774
|
-
children: restProps.children
|
|
775
|
-
});
|
|
776
|
-
return /* @__PURE__ */ jsx(ActionNavigationButton, {
|
|
777
|
-
...restProps,
|
|
778
|
-
href: restProps.href,
|
|
779
|
-
children: restProps.children
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Show a prompt dialog to get user input
|
|
1841
|
+
*/
|
|
1842
|
+
prompt(options) {
|
|
1843
|
+
return new Promise((resolve) => {
|
|
1844
|
+
const modalId = this.open({
|
|
1845
|
+
...options,
|
|
1846
|
+
title: options?.title || "Input",
|
|
1847
|
+
closeOnClickOutside: false,
|
|
1848
|
+
closeOnEscape: false,
|
|
1849
|
+
content: /* @__PURE__ */ jsx(PromptDialog_default, {
|
|
1850
|
+
options,
|
|
1851
|
+
onSubmit: (value) => {
|
|
1852
|
+
this.close(modalId);
|
|
1853
|
+
resolve(value);
|
|
1854
|
+
}
|
|
1855
|
+
})
|
|
780
1856
|
});
|
|
781
|
-
}
|
|
782
|
-
delete restProps.classNameActive;
|
|
783
|
-
delete restProps.variantActive;
|
|
784
|
-
if ("action" in restProps && restProps.action) return /* @__PURE__ */ jsx(ActionHookButton, {
|
|
785
|
-
...restProps,
|
|
786
|
-
action: restProps.action,
|
|
787
|
-
children: restProps.children
|
|
788
1857
|
});
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* Open a custom dialog with provided content
|
|
1861
|
+
*/
|
|
1862
|
+
open(options) {
|
|
1863
|
+
return modals.open({
|
|
1864
|
+
...this.options.default,
|
|
1865
|
+
...options,
|
|
1866
|
+
children: options?.content || options?.message
|
|
793
1867
|
});
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Close the currently open dialog or a specific dialog by ID
|
|
1871
|
+
*/
|
|
1872
|
+
close(modalId) {
|
|
1873
|
+
if (modalId) modals.close(modalId);
|
|
1874
|
+
else modals.closeAll();
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* Show a JSON editor/viewer dialog
|
|
1878
|
+
*/
|
|
1879
|
+
json(data, options) {
|
|
1880
|
+
this.open({
|
|
1881
|
+
size: "lg",
|
|
1882
|
+
title: options?.title || "Json Viewer",
|
|
1883
|
+
...options,
|
|
1884
|
+
content: /* @__PURE__ */ jsx(Flex$1, {
|
|
1885
|
+
bdrs: "md",
|
|
1886
|
+
w: "100%",
|
|
1887
|
+
flex: 1,
|
|
1888
|
+
p: "sm",
|
|
1889
|
+
bg: ui.colors.surface,
|
|
1890
|
+
children: /* @__PURE__ */ jsx(JsonViewer_default, {
|
|
1891
|
+
size: "xs",
|
|
1892
|
+
data
|
|
1893
|
+
})
|
|
1894
|
+
})
|
|
809
1895
|
});
|
|
810
|
-
};
|
|
811
|
-
let actionElement = renderAction();
|
|
812
|
-
if (menu) actionElement = /* @__PURE__ */ jsxs(Menu, {
|
|
813
|
-
position: menu.position || "bottom-start",
|
|
814
|
-
width: menu.width || 200,
|
|
815
|
-
shadow: menu.shadow || "md",
|
|
816
|
-
trigger: menu.on === "hover" ? "hover" : "click",
|
|
817
|
-
...menu.menuProps,
|
|
818
|
-
children: [/* @__PURE__ */ jsx(Menu.Target, {
|
|
819
|
-
...menu.targetProps,
|
|
820
|
-
children: actionElement
|
|
821
|
-
}), /* @__PURE__ */ jsx(Menu.Dropdown, { children: menu.items.map((item, index) => /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
822
|
-
item,
|
|
823
|
-
index
|
|
824
|
-
}, index)) })]
|
|
825
|
-
});
|
|
826
|
-
if (tooltip) {
|
|
827
|
-
const defaultTooltipProps = { openDelay: 1e3 };
|
|
828
|
-
return /* @__PURE__ */ jsx(Tooltip, { ...typeof tooltip === "string" ? {
|
|
829
|
-
...defaultTooltipProps,
|
|
830
|
-
label: tooltip,
|
|
831
|
-
children: actionElement
|
|
832
|
-
} : {
|
|
833
|
-
...defaultTooltipProps,
|
|
834
|
-
...tooltip,
|
|
835
|
-
children: actionElement
|
|
836
|
-
} });
|
|
837
1896
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
children: props.children
|
|
853
|
-
});
|
|
854
|
-
};
|
|
855
|
-
const ActionResetButton = (props) => {
|
|
856
|
-
const { form, ...buttonProps } = props;
|
|
857
|
-
const state = useFormState(form);
|
|
858
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
859
|
-
...buttonProps,
|
|
860
|
-
disabled: state.loading,
|
|
861
|
-
type: "reset",
|
|
862
|
-
children: props.children
|
|
863
|
-
});
|
|
864
|
-
};
|
|
865
|
-
/**
|
|
866
|
-
* Action button that integrates with useAction hook return value.
|
|
867
|
-
* Automatically handles loading state and executes the action on click.
|
|
868
|
-
*
|
|
869
|
-
* @example
|
|
870
|
-
* ```tsx
|
|
871
|
-
* const saveAction = useAction({
|
|
872
|
-
* handler: async (data) => {
|
|
873
|
-
* await api.save(data);
|
|
874
|
-
* }
|
|
875
|
-
* }, []);
|
|
876
|
-
*
|
|
877
|
-
* <ActionButton action={saveAction}>
|
|
878
|
-
* Save
|
|
879
|
-
* </ActionButton>
|
|
880
|
-
* ```
|
|
881
|
-
*/
|
|
882
|
-
const ActionHookButton = (props) => {
|
|
883
|
-
const { action, ...buttonProps } = props;
|
|
884
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
885
|
-
...buttonProps,
|
|
886
|
-
disabled: action.loading || props.disabled,
|
|
887
|
-
loading: action.loading,
|
|
888
|
-
onClick: () => action.run(),
|
|
889
|
-
children: props.children
|
|
890
|
-
});
|
|
891
|
-
};
|
|
892
|
-
/**
|
|
893
|
-
* Basic action button that handles click events with loading and error handling.
|
|
894
|
-
*
|
|
895
|
-
* @example
|
|
896
|
-
* ```tsx
|
|
897
|
-
* <ActionButton onClick={() => api.doSomething()}>
|
|
898
|
-
* Do Something
|
|
899
|
-
* </ActionButton>
|
|
900
|
-
* ```
|
|
901
|
-
*/
|
|
902
|
-
const ActionClickButton = (props) => {
|
|
903
|
-
const action = useAction({ handler: async (e) => {
|
|
904
|
-
await props.onClick(e);
|
|
905
|
-
} }, [props.onClick]);
|
|
906
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
907
|
-
...props,
|
|
908
|
-
disabled: action.loading || props.disabled,
|
|
909
|
-
loading: action.loading,
|
|
910
|
-
onClick: action.run,
|
|
911
|
-
children: props.children
|
|
912
|
-
});
|
|
913
|
-
};
|
|
914
|
-
/**
|
|
915
|
-
* Action for navigation with active state support.
|
|
916
|
-
*/
|
|
917
|
-
const ActionNavigationButton = (props) => {
|
|
918
|
-
const { active: options, classNameActive, variantActive, routerGoOptions, ...buttonProps } = props;
|
|
919
|
-
const router = useRouter();
|
|
920
|
-
const { isPending, isActive } = useActive(options ? {
|
|
921
|
-
href: props.href,
|
|
922
|
-
...options
|
|
923
|
-
} : { href: props.href });
|
|
924
|
-
const anchorProps = router.anchor(props.href, routerGoOptions);
|
|
925
|
-
const className = buttonProps.className || "";
|
|
926
|
-
if (isActive && options !== false && classNameActive) buttonProps.className = `${className} ${classNameActive}`.trim();
|
|
927
|
-
if (props.anchorProps) return /* @__PURE__ */ jsx(Anchor, {
|
|
928
|
-
component: "a",
|
|
929
|
-
...anchorProps,
|
|
930
|
-
...props.anchorProps,
|
|
931
|
-
children: props.children
|
|
932
|
-
});
|
|
933
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
934
|
-
component: "a",
|
|
935
|
-
loading: isPending,
|
|
936
|
-
...buttonProps,
|
|
937
|
-
...anchorProps,
|
|
938
|
-
variant: isActive && options !== false ? variantActive ?? "filled" : buttonProps.variant ?? "subtle",
|
|
939
|
-
children: props.children
|
|
940
|
-
});
|
|
941
|
-
};
|
|
942
|
-
const ActionHrefButton = (props) => {
|
|
943
|
-
const { active: options, classNameActive, variantActive, routerGoOptions, target, ...buttonProps } = props;
|
|
944
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
945
|
-
component: "a",
|
|
946
|
-
target,
|
|
947
|
-
...buttonProps,
|
|
948
|
-
children: props.children
|
|
949
|
-
});
|
|
950
|
-
};
|
|
951
|
-
function isComponentType(param) {
|
|
952
|
-
if (isValidElement(param)) return false;
|
|
953
|
-
return typeof param === "function" || typeof param === "object" && param !== null && "$$typeof" in param;
|
|
954
|
-
}
|
|
955
|
-
const renderIcon = (icon) => {
|
|
956
|
-
if (!icon) return null;
|
|
957
|
-
if (isValidElement(icon)) return icon;
|
|
958
|
-
if (isComponentType(icon)) return /* @__PURE__ */ jsx(icon, { size: ui.sizes.icon.md });
|
|
959
|
-
return icon;
|
|
1897
|
+
/**
|
|
1898
|
+
* Show a form dialog for structured input
|
|
1899
|
+
*/
|
|
1900
|
+
form(options) {
|
|
1901
|
+
return Promise.resolve(null);
|
|
1902
|
+
}
|
|
1903
|
+
/**
|
|
1904
|
+
* Show a loading/progress dialog with optional progress percentage
|
|
1905
|
+
*/
|
|
1906
|
+
loading(options) {}
|
|
1907
|
+
/**
|
|
1908
|
+
* Show an image viewer/gallery dialog
|
|
1909
|
+
*/
|
|
1910
|
+
image(src, options) {}
|
|
960
1911
|
};
|
|
961
1912
|
|
|
962
1913
|
//#endregion
|
|
@@ -1033,7 +1984,7 @@ const DarkModeButton = (props) => {
|
|
|
1033
1984
|
});
|
|
1034
1985
|
return /* @__PURE__ */ jsx(ActionButton_default, {
|
|
1035
1986
|
onClick: toggleColorScheme,
|
|
1036
|
-
variant: props.variant ?? "
|
|
1987
|
+
variant: props.variant ?? "subtle",
|
|
1037
1988
|
size: props.size ?? "sm",
|
|
1038
1989
|
"aria-label": "Toggle color scheme",
|
|
1039
1990
|
px: "xs",
|
|
@@ -1096,6 +2047,24 @@ const OmnibarButton = (props) => {
|
|
|
1096
2047
|
};
|
|
1097
2048
|
var OmnibarButton_default = OmnibarButton;
|
|
1098
2049
|
|
|
2050
|
+
//#endregion
|
|
2051
|
+
//#region src/core/components/buttons/ThemeButton.tsx
|
|
2052
|
+
const ThemeButton = (props) => {
|
|
2053
|
+
const [theme, setTheme] = useTheme();
|
|
2054
|
+
const themes = useInject(ThemeProvider).themes;
|
|
2055
|
+
return /* @__PURE__ */ jsx(ActionButton_default, {
|
|
2056
|
+
variant: "subtle",
|
|
2057
|
+
icon: IconPalette,
|
|
2058
|
+
menu: { items: themes.map((it) => ({
|
|
2059
|
+
label: it.label,
|
|
2060
|
+
onClick: () => setTheme(it),
|
|
2061
|
+
active: theme.id === it.id
|
|
2062
|
+
})) },
|
|
2063
|
+
...props.actionProps
|
|
2064
|
+
});
|
|
2065
|
+
};
|
|
2066
|
+
var ThemeButton_default = ThemeButton;
|
|
2067
|
+
|
|
1099
2068
|
//#endregion
|
|
1100
2069
|
//#region src/core/utils/icons.tsx
|
|
1101
2070
|
/**
|
|
@@ -2119,6 +3088,7 @@ const Sidebar = (props) => {
|
|
|
2119
3088
|
}
|
|
2120
3089
|
}
|
|
2121
3090
|
if ("element" in item) return /* @__PURE__ */ jsx(Flex$1, { children: item.element }, key);
|
|
3091
|
+
if (item.can && !item.can()) return null;
|
|
2122
3092
|
if (props.collapsed) return /* @__PURE__ */ jsx(SidebarCollapsedItem, {
|
|
2123
3093
|
item,
|
|
2124
3094
|
level: 0,
|
|
@@ -2207,7 +3177,6 @@ const SidebarItem = (props) => {
|
|
|
2207
3177
|
href: props.item.href,
|
|
2208
3178
|
target: props.item.target,
|
|
2209
3179
|
size: props.item.theme?.size ?? props.theme.button?.size ?? (level === 0 ? "sm" : "xs"),
|
|
2210
|
-
color: "var(--alepha-text)",
|
|
2211
3180
|
variant: "subtle",
|
|
2212
3181
|
variantActive: "default",
|
|
2213
3182
|
radius: props.item.theme?.radius ?? props.theme.button?.radius ?? "md",
|
|
@@ -2237,7 +3206,7 @@ const SidebarItem = (props) => {
|
|
|
2237
3206
|
top: 48,
|
|
2238
3207
|
left: 20 + 32 * level,
|
|
2239
3208
|
bottom: 16
|
|
2240
|
-
} }), item.children.map((child, index) => /* @__PURE__ */ jsx(SidebarItem, {
|
|
3209
|
+
} }), item.children.filter((child) => !child.can || child.can()).map((child, index) => /* @__PURE__ */ jsx(SidebarItem, {
|
|
2241
3210
|
item: child,
|
|
2242
3211
|
level: level + 1,
|
|
2243
3212
|
onItemClick: props.onItemClick,
|
|
@@ -2270,9 +3239,12 @@ const SidebarCollapsedItem = (props) => {
|
|
|
2270
3239
|
};
|
|
2271
3240
|
return /* @__PURE__ */ jsx(ActionButton_default, {
|
|
2272
3241
|
size: props.item.theme?.size ?? props.theme.button?.size ?? (level === 0 ? "sm" : "xs"),
|
|
2273
|
-
color: "var(--alepha-text)",
|
|
2274
3242
|
variant: "subtle",
|
|
2275
3243
|
variantActive: "default",
|
|
3244
|
+
tooltip: item.children ? void 0 : {
|
|
3245
|
+
label: item.label,
|
|
3246
|
+
position: "right"
|
|
3247
|
+
},
|
|
2276
3248
|
radius: props.item.theme?.radius ?? props.theme.button?.radius ?? "md",
|
|
2277
3249
|
onClick: handleItemClick,
|
|
2278
3250
|
icon: renderIcon(item.icon) ?? /* @__PURE__ */ jsx(IconSquareRounded, {}),
|
|
@@ -2281,11 +3253,11 @@ const SidebarCollapsedItem = (props) => {
|
|
|
2281
3253
|
menu: item.children ? {
|
|
2282
3254
|
position: "right",
|
|
2283
3255
|
on: "hover",
|
|
2284
|
-
items: item.children.map((child) => ({
|
|
3256
|
+
items: item.children.filter((child) => !child.can || child.can()).map((child) => ({
|
|
2285
3257
|
label: child.label,
|
|
2286
3258
|
href: child.href,
|
|
2287
3259
|
icon: renderIcon(child.icon),
|
|
2288
|
-
children: child.children
|
|
3260
|
+
children: child.children?.filter((c) => !c.can || c.can())
|
|
2289
3261
|
}))
|
|
2290
3262
|
} : void 0,
|
|
2291
3263
|
...props.item.actionProps
|
|
@@ -2319,14 +3291,16 @@ const AdminShell = (props) => {
|
|
|
2319
3291
|
}];
|
|
2320
3292
|
const hasSidebar = showSidebar && props.sidebarProps !== void 0;
|
|
2321
3293
|
return /* @__PURE__ */ jsxs(AppShell, {
|
|
3294
|
+
w: "100%",
|
|
3295
|
+
flex: 1,
|
|
2322
3296
|
padding: "md",
|
|
2323
3297
|
header: hasSidebar || props.appBarProps || props.header ? { height: 60 } : void 0,
|
|
2324
3298
|
navbar: hasSidebar ? {
|
|
2325
|
-
width: collapsed ? { base:
|
|
3299
|
+
width: collapsed ? { base: 78 } : { base: 300 },
|
|
2326
3300
|
breakpoint: "sm",
|
|
2327
3301
|
collapsed: { mobile: !opened }
|
|
2328
3302
|
} : void 0,
|
|
2329
|
-
footer: props.footer ? { height:
|
|
3303
|
+
footer: props.footer ? { height: 24 } : void 0,
|
|
2330
3304
|
...props.appShellProps,
|
|
2331
3305
|
children: [
|
|
2332
3306
|
/* @__PURE__ */ jsx(AppShell.Header, {
|
|
@@ -2476,10 +3450,15 @@ const DataTable = (props) => {
|
|
|
2476
3450
|
gap: "sm",
|
|
2477
3451
|
flex: 1,
|
|
2478
3452
|
children: [
|
|
2479
|
-
props.filters ? /* @__PURE__ */ jsx(
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
3453
|
+
props.filters ? /* @__PURE__ */ jsx(Card, {
|
|
3454
|
+
withBorder: true,
|
|
3455
|
+
p: "lg",
|
|
3456
|
+
bg: ui.colors.elevated,
|
|
3457
|
+
children: /* @__PURE__ */ jsx(TypeForm_default, {
|
|
3458
|
+
...props.typeFormProps,
|
|
3459
|
+
form,
|
|
3460
|
+
schema
|
|
3461
|
+
})
|
|
2483
3462
|
}) : null,
|
|
2484
3463
|
/* @__PURE__ */ jsx(Flex$1, {
|
|
2485
3464
|
className: "overflow-auto",
|
|
@@ -2566,17 +3545,19 @@ const AlephaUI = $module({
|
|
|
2566
3545
|
services: [
|
|
2567
3546
|
DialogService,
|
|
2568
3547
|
ToastService,
|
|
3548
|
+
ThemeProvider,
|
|
2569
3549
|
RootRouter
|
|
2570
3550
|
],
|
|
2571
3551
|
register: (alepha) => {
|
|
2572
3552
|
alepha.with(AlephaReactI18n);
|
|
2573
3553
|
alepha.with(AlephaReactHead);
|
|
2574
3554
|
alepha.with(AlephaReactForm);
|
|
3555
|
+
alepha.with(ThemeProvider);
|
|
2575
3556
|
alepha.with(DialogService);
|
|
2576
3557
|
alepha.with(ToastService);
|
|
2577
3558
|
}
|
|
2578
3559
|
});
|
|
2579
3560
|
|
|
2580
3561
|
//#endregion
|
|
2581
|
-
export { ActionButton_default as ActionButton, AdminShell_default as AdminShell, AlephaMantineProvider_default as AlephaMantineProvider, AlephaUI, AlertDialog_default as AlertDialog, AppBar_default as AppBar, BurgerButton_default as BurgerButton, ClipboardButton_default as ClipboardButton, ConfirmDialog_default as ConfirmDialog, Control_default as Control, ControlDate_default as ControlDate, ControlQueryBuilder_default as ControlQueryBuilder, ControlSelect_default as ControlSelect, DarkModeButton_default as DarkModeButton, DataTable_default as DataTable, DialogService, Flex, JsonViewer_default as JsonViewer, LanguageButton_default as LanguageButton, OPERATOR_INFO, Omnibar_default as Omnibar, OmnibarButton_default as OmnibarButton, PromptDialog_default as PromptDialog, RootRouter, Sidebar, Text, ToastService, TypeForm_default as TypeForm, capitalize, extractSchemaFields, getDefaultIcon, getOperatorsForField, prettyName, ui, useDialog, useToast };
|
|
3562
|
+
export { ActionButton_default as ActionButton, AdminShell_default as AdminShell, AlephaMantineProvider_default as AlephaMantineProvider, AlephaUI, AlertDialog_default as AlertDialog, AppBar_default as AppBar, BurgerButton_default as BurgerButton, ClipboardButton_default as ClipboardButton, ConfirmDialog_default as ConfirmDialog, Control_default as Control, ControlDate_default as ControlDate, ControlQueryBuilder_default as ControlQueryBuilder, ControlSelect_default as ControlSelect, DarkModeButton_default as DarkModeButton, DataTable_default as DataTable, DialogService, Flex, JsonViewer_default as JsonViewer, LanguageButton_default as LanguageButton, OPERATOR_INFO, Omnibar_default as Omnibar, OmnibarButton_default as OmnibarButton, PromptDialog_default as PromptDialog, RootRouter, Sidebar, Text, ThemeButton_default as ThemeButton, ThemeProvider, ToastService, TypeForm_default as TypeForm, capitalize, extractSchemaFields, getDefaultIcon, getOperatorsForField, mantineThemeAtom, prettyName, ui, useDialog, useToast };
|
|
2582
3563
|
//# sourceMappingURL=index.js.map
|