@alepha/ui 0.13.2 → 0.13.3

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.
Files changed (116) hide show
  1. package/dist/admin/AdminLayout-JakF7ESb.js +388 -0
  2. package/dist/admin/AdminLayout-JakF7ESb.js.map +1 -0
  3. package/dist/admin/AdminLayout-qNsIyl30.js +3 -0
  4. package/dist/admin/AdminNotifications-BPrxALdS.js +154 -0
  5. package/dist/admin/AdminNotifications-BPrxALdS.js.map +1 -0
  6. package/dist/admin/AdminNotifications-DV-35Fi3.js +3 -0
  7. package/dist/admin/{AdminSessions-CmDVneE2.js → AdminSessions-CMmBtbSw.js} +36 -9
  8. package/dist/admin/AdminSessions-CMmBtbSw.js.map +1 -0
  9. package/dist/admin/AdminSessions-Df2VYzlE.js +3 -0
  10. package/dist/admin/AdminUserCreate-Coa_yi6m.js +103 -0
  11. package/dist/admin/AdminUserCreate-Coa_yi6m.js.map +1 -0
  12. package/dist/admin/AdminUserCreate-DjiCcAk0.js +3 -0
  13. package/dist/admin/AdminUserDetails-BCFwOm9w.js +221 -0
  14. package/dist/admin/AdminUserDetails-BCFwOm9w.js.map +1 -0
  15. package/dist/admin/AdminUserDetails-C5yeJNa3.js +3 -0
  16. package/dist/admin/AdminUserLayout-B8ga5QvP.js +3 -0
  17. package/dist/admin/AdminUserLayout-CR2OqV9Z.js +153 -0
  18. package/dist/admin/AdminUserLayout-CR2OqV9Z.js.map +1 -0
  19. package/dist/admin/AdminUserSessions-A_5KkqTY.js +3 -0
  20. package/dist/admin/AdminUserSessions-Bcf6-rjG.js +129 -0
  21. package/dist/admin/AdminUserSessions-Bcf6-rjG.js.map +1 -0
  22. package/dist/admin/AdminUserSettings-DAsAhFjX.js +3 -0
  23. package/dist/admin/AdminUserSettings-DRYVdW6S.js +164 -0
  24. package/dist/admin/AdminUserSettings-DRYVdW6S.js.map +1 -0
  25. package/dist/admin/AdminUsers-Dd9a5UqO.js +3 -0
  26. package/dist/admin/{AdminUsers-88De5pev.js → AdminUsers-IN_2yHKt.js} +32 -14
  27. package/dist/admin/AdminUsers-IN_2yHKt.js.map +1 -0
  28. package/dist/admin/index.d.ts +5560 -416
  29. package/dist/admin/index.js +299 -41
  30. package/dist/admin/index.js.map +1 -1
  31. package/dist/auth/AuthLayout-BSL8ZHgr.js +19 -0
  32. package/dist/auth/AuthLayout-BSL8ZHgr.js.map +1 -0
  33. package/dist/auth/Login-DDsyCNAA.js +4 -0
  34. package/dist/auth/{Login-OCrvjs9U.js → Login-kBfaRgKG.js} +5 -4
  35. package/dist/auth/Login-kBfaRgKG.js.map +1 -0
  36. package/dist/auth/{Register-Ei34GSba.js → Register-BxJmOqpF.js} +9 -6
  37. package/dist/auth/Register-BxJmOqpF.js.map +1 -0
  38. package/dist/auth/Register-D10MnlQc.js +4 -0
  39. package/dist/auth/{ResetPassword-tO0oMzfo.js → ResetPassword-BhyZ9ek4.js} +3 -3
  40. package/dist/auth/ResetPassword-BhyZ9ek4.js.map +1 -0
  41. package/dist/auth/ResetPassword-llBG-STp.js +3 -0
  42. package/dist/auth/VerifyEmail-BvOG-IUC.js +3 -0
  43. package/dist/auth/VerifyEmail-DeLct3oQ.js +131 -0
  44. package/dist/auth/VerifyEmail-DeLct3oQ.js.map +1 -0
  45. package/dist/auth/index.d.ts +2412 -2254
  46. package/dist/auth/index.js +96 -20
  47. package/dist/auth/index.js.map +1 -1
  48. package/dist/core/index.d.ts +280 -95
  49. package/dist/core/index.js +1381 -392
  50. package/dist/core/index.js.map +1 -1
  51. package/package.json +5 -5
  52. package/src/admin/AdminRouter.ts +116 -29
  53. package/src/admin/MainRouter.ts +23 -0
  54. package/src/admin/components/AdminLayout.tsx +86 -103
  55. package/src/admin/components/AdminNotifications.tsx +196 -12
  56. package/src/admin/components/AdminSessions.tsx +43 -7
  57. package/src/admin/components/AdminUserCreate.tsx +84 -0
  58. package/src/admin/components/AdminUserDetails.tsx +180 -0
  59. package/src/admin/components/AdminUserLayout.tsx +172 -0
  60. package/src/admin/components/AdminUserSessions.tsx +158 -0
  61. package/src/admin/components/AdminUserSettings.tsx +165 -0
  62. package/src/admin/components/AdminUsers.tsx +29 -9
  63. package/src/admin/index.ts +12 -3
  64. package/src/auth/AuthI18n.ts +22 -0
  65. package/src/auth/AuthRouter.ts +82 -8
  66. package/src/auth/components/AuthLayout.tsx +12 -0
  67. package/src/auth/components/Login.tsx +13 -11
  68. package/src/auth/components/Register.tsx +6 -5
  69. package/src/auth/components/ResetPassword.tsx +1 -1
  70. package/src/auth/components/VerifyEmail.tsx +102 -0
  71. package/src/auth/components/buttons/UserButton.tsx +6 -2
  72. package/src/auth/index.ts +1 -0
  73. package/src/core/components/buttons/ActionButton.tsx +11 -4
  74. package/src/core/components/buttons/DarkModeButton.tsx +1 -1
  75. package/src/core/components/buttons/ThemeButton.tsx +31 -0
  76. package/src/core/components/layout/AdminShell.tsx +4 -2
  77. package/src/core/components/layout/AlephaMantineProvider.tsx +10 -4
  78. package/src/core/components/layout/Omnibar.tsx +27 -15
  79. package/src/core/components/layout/Sidebar.tsx +33 -15
  80. package/src/core/components/table/DataTable.tsx +9 -5
  81. package/src/core/hooks/useTheme.ts +25 -0
  82. package/src/core/index.ts +8 -3
  83. package/src/core/providers/ThemeProvider.ts +87 -0
  84. package/src/core/themes/aurora.ts +107 -0
  85. package/src/core/themes/crystal.ts +107 -0
  86. package/src/core/themes/default.ts +7 -0
  87. package/src/core/themes/ember.ts +107 -0
  88. package/src/core/themes/index.ts +7 -0
  89. package/src/core/themes/midnight.ts +104 -0
  90. package/src/core/themes/remoraid.ts +278 -0
  91. package/src/core/themes/slate.ts +81 -0
  92. package/dist/admin/AdminJobs-BOq6AZOW.js +0 -3
  93. package/dist/admin/AdminJobs-CDnVxEv6.js +0 -125
  94. package/dist/admin/AdminJobs-CDnVxEv6.js.map +0 -1
  95. package/dist/admin/AdminLayout-Bgx25J8m.js +0 -3
  96. package/dist/admin/AdminLayout-CervL8LV.js +0 -88
  97. package/dist/admin/AdminLayout-CervL8LV.js.map +0 -1
  98. package/dist/admin/AdminNotifications-BDQXt3-e.js +0 -3
  99. package/dist/admin/AdminNotifications-DvI2989x.js +0 -40
  100. package/dist/admin/AdminNotifications-DvI2989x.js.map +0 -1
  101. package/dist/admin/AdminParameters-D_v0GAvI.js +0 -3
  102. package/dist/admin/AdminParameters-P1LB6ZI1.js +0 -40
  103. package/dist/admin/AdminParameters-P1LB6ZI1.js.map +0 -1
  104. package/dist/admin/AdminSessions-CmDVneE2.js.map +0 -1
  105. package/dist/admin/AdminSessions-Dkk_fzWK.js +0 -3
  106. package/dist/admin/AdminUsers-88De5pev.js.map +0 -1
  107. package/dist/admin/AdminUsers-oyAXqZ5l.js +0 -3
  108. package/dist/admin/AdminVerifications-D93TKymL.js +0 -3
  109. package/dist/admin/AdminVerifications-DBVEoqJe.js +0 -40
  110. package/dist/admin/AdminVerifications-DBVEoqJe.js.map +0 -1
  111. package/dist/auth/Login-BC2jTczq.js +0 -4
  112. package/dist/auth/Login-OCrvjs9U.js.map +0 -1
  113. package/dist/auth/Register-Dh0lsQmI.js +0 -4
  114. package/dist/auth/Register-Ei34GSba.js.map +0 -1
  115. package/dist/auth/ResetPassword-BnlAQAOE.js +0 -3
  116. package/dist/auth/ResetPassword-tO0oMzfo.js.map +0 -1
@@ -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,956 @@ 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
+ fontSizes: {
462
+ xs: "0.75rem",
463
+ sm: "0.875rem",
464
+ md: "0.875rem",
465
+ lg: "1rem",
466
+ xl: "1.25rem"
467
+ },
468
+ radius: {
469
+ xs: "3px",
470
+ sm: "6px",
471
+ md: "6px",
472
+ lg: "8px",
473
+ xl: "12px"
474
+ },
475
+ defaultRadius: "sm",
476
+ colors: {
477
+ dark: [
478
+ "#d0d7de",
479
+ "#8b949e",
480
+ "#6e7681",
481
+ "#484f58",
482
+ "#30363d",
483
+ "#21262d",
484
+ "#161b22",
485
+ "#151b23",
486
+ "#0d1117",
487
+ "#010409"
488
+ ],
489
+ gray: [
490
+ "#f6f8fa",
491
+ "#eaeef2",
492
+ "#d0d7de",
493
+ "#afb8c1",
494
+ "#8c959f",
495
+ "#6e7781",
496
+ "#57606a",
497
+ "#424a53",
498
+ "#32383f",
499
+ "#24292f"
500
+ ],
501
+ blue: [
502
+ "#ddf4ff",
503
+ "#b6e3ff",
504
+ "#80ccff",
505
+ "#54aeff",
506
+ "#218bff",
507
+ "#0969da",
508
+ "#0550ae",
509
+ "#033d8b",
510
+ "#0a3069",
511
+ "#002155"
512
+ ],
513
+ green: [
514
+ "#dafbe1",
515
+ "#aceebb",
516
+ "#6fdd8b",
517
+ "#4ac26b",
518
+ "#2da44e",
519
+ "#1a7f37",
520
+ "#116329",
521
+ "#044f1e",
522
+ "#003d16",
523
+ "#002d11"
524
+ ],
525
+ red: [
526
+ "#ffebe9",
527
+ "#ffcecb",
528
+ "#ffaba8",
529
+ "#ff8182",
530
+ "#fa4549",
531
+ "#cf222e",
532
+ "#a40e26",
533
+ "#82071e",
534
+ "#660018",
535
+ "#4c0014"
536
+ ]
537
+ }
538
+ };
539
+
540
+ //#endregion
541
+ //#region src/core/themes/remoraid.ts
542
+ const remoraidTheme = {
543
+ id: "remoraid",
544
+ label: "Remoraid",
545
+ description: "Soft, nature-inspired with green tones",
546
+ colors: {
547
+ dark: [
548
+ "#fafcff",
549
+ "#cad5e8",
550
+ "#8697b5",
551
+ "#4c5d7d",
552
+ "#222833",
553
+ "#222938",
554
+ "#0b0f14",
555
+ "#0b0f14",
556
+ "#030405",
557
+ "#000000"
558
+ ],
559
+ gray: [
560
+ "#e3e7f1",
561
+ "#d8ddeb",
562
+ "#ced4e5",
563
+ "#c3cadf",
564
+ "#b8c1d9",
565
+ "#b8c1d9",
566
+ "#7b8cb8",
567
+ "#4b5c8b",
568
+ "#2a334d",
569
+ "#090b10"
570
+ ],
571
+ blue: [
572
+ "#ddf4ff",
573
+ "#b6e3ff",
574
+ "#80ccff",
575
+ "#54aeff",
576
+ "#218bff",
577
+ "#0969da",
578
+ "#0550ae",
579
+ "#033d8b",
580
+ "#0a3069",
581
+ "#002155"
582
+ ],
583
+ green: [
584
+ "#dafbe1",
585
+ "#aceebb",
586
+ "#6fdd8b",
587
+ "#4ac26b",
588
+ "#2da44e",
589
+ "#1a7f37",
590
+ "#116329",
591
+ "#044f1e",
592
+ "#003d16",
593
+ "#002d11"
594
+ ],
595
+ yellow: [
596
+ "#fff8c5",
597
+ "#fae17d",
598
+ "#eac54f",
599
+ "#d4a72c",
600
+ "#bf8700",
601
+ "#9a6700",
602
+ "#7d4e00",
603
+ "#633c01",
604
+ "#4d2d00",
605
+ "#3b2300"
606
+ ],
607
+ orange: [
608
+ "#fff1e5",
609
+ "#ffd8b5",
610
+ "#ffb77c",
611
+ "#fb8f44",
612
+ "#e16f24",
613
+ "#bc4c00",
614
+ "#953800",
615
+ "#762c00",
616
+ "#5c2200",
617
+ "#471700"
618
+ ],
619
+ red: [
620
+ "#fff5f5",
621
+ "#ffe3e3",
622
+ "#ffc9c9",
623
+ "#ffa8a8",
624
+ "#ff8787",
625
+ "#ff6b6b",
626
+ "#fa5252",
627
+ "#f03e3e",
628
+ "#e03131",
629
+ "#c92a2a"
630
+ ],
631
+ pink: [
632
+ "#fff0f6",
633
+ "#ffdeeb",
634
+ "#fcc2d7",
635
+ "#faa2c1",
636
+ "#f783ac",
637
+ "#f06595",
638
+ "#e64980",
639
+ "#d6336c",
640
+ "#c2255c",
641
+ "#a61e4d"
642
+ ],
643
+ grape: [
644
+ "#f8f0fc",
645
+ "#f3d9fa",
646
+ "#eebefa",
647
+ "#e599f7",
648
+ "#da77f2",
649
+ "#cc5de8",
650
+ "#be4bdb",
651
+ "#ae3ec9",
652
+ "#9c36b5",
653
+ "#862e9c"
654
+ ],
655
+ violet: [
656
+ "#f3f0ff",
657
+ "#e5dbff",
658
+ "#d0bfff",
659
+ "#b197fc",
660
+ "#9775fa",
661
+ "#845ef7",
662
+ "#7950f2",
663
+ "#7048e8",
664
+ "#6741d9",
665
+ "#5f3dc4"
666
+ ],
667
+ indigo: [
668
+ "#edf2ff",
669
+ "#dbe4ff",
670
+ "#bac8ff",
671
+ "#91a7ff",
672
+ "#748ffc",
673
+ "#5c7cfa",
674
+ "#4c6ef5",
675
+ "#4263eb",
676
+ "#3b5bdb",
677
+ "#364fc7"
678
+ ],
679
+ cyan: [
680
+ "#e3fafc",
681
+ "#c5f6fa",
682
+ "#99e9f2",
683
+ "#66d9e8",
684
+ "#3bc9db",
685
+ "#22b8cf",
686
+ "#15aabf",
687
+ "#1098ad",
688
+ "#0c8599",
689
+ "#0b7285"
690
+ ],
691
+ teal: [
692
+ "#e6fcf5",
693
+ "#c3fae8",
694
+ "#96f2d7",
695
+ "#63e6be",
696
+ "#38d9a9",
697
+ "#20c997",
698
+ "#12b886",
699
+ "#0ca678",
700
+ "#099268",
701
+ "#087f5b"
702
+ ],
703
+ lime: [
704
+ "#f4fce3",
705
+ "#e9fac8",
706
+ "#d8f5a2",
707
+ "#c0eb75",
708
+ "#a9e34b",
709
+ "#94d82d",
710
+ "#82c91e",
711
+ "#74b816",
712
+ "#66a80f",
713
+ "#5c940d"
714
+ ],
715
+ Remoraid: [
716
+ "#dcf2de",
717
+ "#c7eccc",
718
+ "#b2e6b9",
719
+ "#9de1a6",
720
+ "#88db93",
721
+ "#88db93",
722
+ "#5fc26d",
723
+ "#479454",
724
+ "#296133",
725
+ "#19361d"
726
+ ]
727
+ },
728
+ primaryColor: "Remoraid",
729
+ primaryShade: {
730
+ light: 6,
731
+ dark: 7
732
+ },
733
+ white: "#ffffff",
734
+ black: "#24292f",
735
+ autoContrast: true,
736
+ luminanceThreshold: .3,
737
+ fontFamily: "Open Sans",
738
+ fontFamilyMonospace: "Roboto Mono",
739
+ headings: {
740
+ fontFamily: "Open Sans",
741
+ fontWeight: "500",
742
+ sizes: {
743
+ h1: {
744
+ fontSize: "3.125rem",
745
+ lineHeight: "1.3",
746
+ fontWeight: "700"
747
+ },
748
+ h2: {
749
+ fontSize: "1.625rem",
750
+ lineHeight: "1.35",
751
+ fontWeight: "0"
752
+ },
753
+ h3: {
754
+ fontSize: "1.375rem",
755
+ lineHeight: "1.4",
756
+ fontWeight: "0"
757
+ },
758
+ h4: {
759
+ fontSize: "1.125rem",
760
+ lineHeight: "1.45",
761
+ fontWeight: "0"
762
+ },
763
+ h5: {
764
+ fontSize: "1rem",
765
+ lineHeight: "1.5",
766
+ fontWeight: "0"
767
+ },
768
+ h6: {
769
+ fontSize: "0.875rem",
770
+ lineHeight: "1.5",
771
+ fontWeight: "0"
772
+ }
773
+ }
774
+ },
775
+ scale: 1,
776
+ radius: {
777
+ xs: "0.325rem",
778
+ sm: "0.75rem",
779
+ md: "0.7rem",
780
+ lg: "1.2rem",
781
+ xl: "2.4rem"
782
+ },
783
+ spacing: {
784
+ xs: "0.525rem",
785
+ sm: "0.65rem",
786
+ md: "0.9rem",
787
+ lg: "1.35rem",
788
+ xl: "2.2rem"
789
+ },
790
+ defaultRadius: "md",
791
+ breakpoints: {
792
+ xs: "36em",
793
+ sm: "48em",
794
+ md: "62em",
795
+ lg: "75em",
796
+ xl: "88em"
797
+ },
798
+ fontSmoothing: true,
799
+ respectReducedMotion: false,
800
+ focusRing: "auto",
801
+ cursorType: "default",
802
+ components: {
803
+ Input: {
804
+ defaultProps: {
805
+ variant: "default",
806
+ radius: "xl"
807
+ },
808
+ styles: {}
809
+ },
810
+ Card: {
811
+ defaultProps: { withBorder: true },
812
+ styles: {}
813
+ }
814
+ }
815
+ };
816
+
817
+ //#endregion
818
+ //#region src/core/themes/slate.ts
819
+ const slateTheme = {
820
+ id: "slate",
821
+ label: "Slate",
822
+ description: "Professional, minimal zinc palette",
823
+ primaryColor: "dark",
824
+ primaryShade: {
825
+ light: 9,
826
+ dark: 7
827
+ },
828
+ fontFamily: "\"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
829
+ fontFamilyMonospace: "\"JetBrains Mono\", \"Fira Code\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
830
+ headings: {
831
+ fontFamily: "\"Inter\", -apple-system, BlinkMacSystemFont, sans-serif",
832
+ fontWeight: "600",
833
+ textWrap: "wrap",
834
+ sizes: {
835
+ h1: {
836
+ fontSize: "2rem",
837
+ lineHeight: "1.2"
838
+ },
839
+ h2: {
840
+ fontSize: "1.5rem",
841
+ lineHeight: "1.25"
842
+ },
843
+ h3: {
844
+ fontSize: "1.25rem",
845
+ lineHeight: "1.3"
846
+ },
847
+ h4: {
848
+ fontSize: "1rem",
849
+ lineHeight: "1.4"
850
+ },
851
+ h5: {
852
+ fontSize: "0.875rem",
853
+ lineHeight: "1.5"
854
+ },
855
+ h6: {
856
+ fontSize: "0.75rem",
857
+ lineHeight: "1.5"
858
+ }
859
+ }
860
+ },
861
+ fontSizes: {
862
+ xs: "0.75rem",
863
+ sm: "0.875rem",
864
+ md: "0.875rem",
865
+ lg: "1rem",
866
+ xl: "1.125rem"
867
+ },
868
+ lineHeights: {
869
+ xs: "1.4",
870
+ sm: "1.45",
871
+ md: "1.5",
872
+ lg: "1.55",
873
+ xl: "1.6"
874
+ },
875
+ radius: {
876
+ xs: "0.125rem",
877
+ sm: "0.25rem",
878
+ md: "0.375rem",
879
+ lg: "0.5rem",
880
+ xl: "0.75rem"
881
+ },
882
+ defaultRadius: "md",
883
+ shadows: {
884
+ xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
885
+ sm: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
886
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
887
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
888
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"
889
+ },
890
+ colors: {
891
+ dark: [
892
+ "#f4f4f5",
893
+ "#a1a1aa",
894
+ "#71717a",
895
+ "#52525b",
896
+ "#3f3f46",
897
+ "#27272a",
898
+ "#18181b",
899
+ "#0f0f10",
900
+ "#09090b",
901
+ "#000000"
902
+ ],
903
+ gray: [
904
+ "#fafafa",
905
+ "#f4f4f5",
906
+ "#e4e4e7",
907
+ "#d4d4d8",
908
+ "#a1a1aa",
909
+ "#71717a",
910
+ "#52525b",
911
+ "#3f3f46",
912
+ "#27272a",
913
+ "#18181b"
914
+ ]
915
+ }
916
+ };
917
+
918
+ //#endregion
919
+ //#region src/core/providers/ThemeProvider.ts
920
+ const themeAtom = $atom({
921
+ name: "alepha.ui.theme",
922
+ schema: t.object({ id: t.string() }),
923
+ default: { id: "default" }
924
+ });
925
+ var ThemeProvider = class {
926
+ alepha = $inject(Alepha);
927
+ themeCookie = $cookie(themeAtom);
928
+ themes = [
929
+ defaultTheme,
930
+ remoraidTheme,
931
+ midnightTheme,
932
+ slateTheme,
933
+ auroraTheme,
934
+ emberTheme,
935
+ crystalTheme
936
+ ];
937
+ themeHead = $head(() => {
938
+ return { htmlAttributes: { "data-theme": this.getTheme().id } };
939
+ });
940
+ setTheme(theme) {
941
+ this.themeCookie.set(theme);
942
+ this.alepha.store.set(themeAtom, theme);
943
+ if (typeof document === "undefined") return;
944
+ document.documentElement.removeAttribute("data-theme");
945
+ if (theme.id !== "default") document.documentElement.setAttribute("data-theme", theme.id);
946
+ }
947
+ getTheme() {
948
+ try {
949
+ return this.themeCookie.get() ?? this.alepha.store.get(themeAtom) ?? themeAtom.options.default;
950
+ } catch {
951
+ return this.alepha.store.get(themeAtom) ?? themeAtom.options.default;
952
+ }
953
+ }
954
+ };
955
+
956
+ //#endregion
957
+ //#region src/core/hooks/useTheme.ts
958
+ const useTheme = () => {
959
+ useStore(themeAtom);
960
+ const themeService = useInject(ThemeProvider);
961
+ const currentTheme = themeService.getTheme();
962
+ const fullTheme = themeService.themes.find((t$1) => t$1.id === currentTheme.id) ?? themeService.themes[0];
963
+ const applyTheme = (theme) => {
964
+ themeService.setTheme({ id: theme.id });
965
+ };
966
+ return [fullTheme, applyTheme];
967
+ };
968
+
969
+ //#endregion
19
970
  //#region src/core/services/ToastService.tsx
20
971
  var ToastService = class {
21
972
  raw = notifications;
@@ -81,13 +1032,311 @@ var ToastService = class {
81
1032
  *
82
1033
  * @example
83
1034
  * ```tsx
84
- * const toast = useToast();
85
- * toast.success({ message: "Operation completed successfully!" });
86
- * toast.error({ title: "Error", message: "Something went wrong" });
1035
+ * const toast = useToast();
1036
+ * toast.success({ message: "Operation completed successfully!" });
1037
+ * toast.error({ title: "Error", message: "Something went wrong" });
1038
+ * ```
1039
+ */
1040
+ const useToast = () => {
1041
+ return useInject(ToastService);
1042
+ };
1043
+
1044
+ //#endregion
1045
+ //#region src/core/constants/ui.ts
1046
+ const ui = {
1047
+ colors: {
1048
+ transparent: "transparent",
1049
+ background: "var(--alepha-background)",
1050
+ surface: "var(--alepha-surface)",
1051
+ elevated: "var(--alepha-elevated)",
1052
+ border: "var(--alepha-border)"
1053
+ },
1054
+ sizes: { icon: {
1055
+ xs: 12,
1056
+ sm: 16,
1057
+ md: 20,
1058
+ lg: 24,
1059
+ xl: 32
1060
+ } }
1061
+ };
1062
+
1063
+ //#endregion
1064
+ //#region src/core/components/buttons/ActionButton.tsx
1065
+ const ActionMenuItem = (props) => {
1066
+ const { item, index } = props;
1067
+ const router = useRouter();
1068
+ const action = useAction({ handler: async (e) => {
1069
+ await item.onClick?.();
1070
+ } }, [item.onClick]);
1071
+ if (item.type === "divider") return /* @__PURE__ */ jsx(Menu.Divider, {}, index);
1072
+ if (item.type === "label") return /* @__PURE__ */ jsx(Menu.Label, { children: item.label }, index);
1073
+ if (item.children && item.children.length > 0) return /* @__PURE__ */ jsxs(Menu, {
1074
+ trigger: "hover",
1075
+ position: "right-start",
1076
+ offset: 2,
1077
+ children: [/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(Menu.Item, {
1078
+ leftSection: item.icon,
1079
+ rightSection: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }),
1080
+ children: item.label
1081
+ }) }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: item.children.map((child, childIndex) => /* @__PURE__ */ jsx(ActionMenuItem, {
1082
+ item: child,
1083
+ index: childIndex
1084
+ }, childIndex)) })]
1085
+ }, index);
1086
+ const menuItemProps = {};
1087
+ if (props.item.onClick) menuItemProps.onClick = action.run;
1088
+ else if (props.item.href) Object.assign(menuItemProps, router.anchor(props.item.href));
1089
+ return /* @__PURE__ */ jsx(Menu.Item, {
1090
+ leftSection: item.icon,
1091
+ onClick: item.onClick,
1092
+ color: item.color,
1093
+ rightSection: item.active ? /* @__PURE__ */ jsx(ThemeIcon, {
1094
+ size: "xs",
1095
+ variant: "transparent",
1096
+ children: /* @__PURE__ */ jsx(IconCheck, {})
1097
+ }) : void 0,
1098
+ ...menuItemProps,
1099
+ children: item.label
1100
+ }, index);
1101
+ };
1102
+ const ActionButton = (_props) => {
1103
+ const props = {
1104
+ variant: "subtle",
1105
+ ..._props
1106
+ };
1107
+ const { tooltip, menu, icon, ...restProps } = props;
1108
+ restProps.color ??= "gray";
1109
+ if (props.icon) {
1110
+ const icon$1 = isComponentType(props.icon) ? /* @__PURE__ */ jsx(props.icon, { size: ui.sizes.icon.md }) : /* @__PURE__ */ jsx(ThemeIcon, {
1111
+ w: 24,
1112
+ variant: "transparent",
1113
+ size: "sm",
1114
+ c: "var(--mantine-color-text)",
1115
+ ...props.themeIconProps,
1116
+ children: props.icon
1117
+ });
1118
+ if (!props.children) {
1119
+ restProps.children = Children.only(icon$1);
1120
+ restProps.px ??= "xs";
1121
+ } else restProps.leftSection = icon$1;
1122
+ }
1123
+ if (props.leftSection && !props.children) restProps.px ??= "xs";
1124
+ if (props.textVisibleFrom) {
1125
+ const { children, textVisibleFrom, leftSection, ...rest } = restProps;
1126
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Flex$1, {
1127
+ w: "100%",
1128
+ visibleFrom: textVisibleFrom,
1129
+ children: /* @__PURE__ */ jsx(ActionButton, {
1130
+ flex: 1,
1131
+ ...rest,
1132
+ leftSection,
1133
+ tooltip,
1134
+ menu,
1135
+ children
1136
+ })
1137
+ }), /* @__PURE__ */ jsx(Flex$1, {
1138
+ w: "100%",
1139
+ hiddenFrom: textVisibleFrom,
1140
+ children: /* @__PURE__ */ jsx(ActionButton, {
1141
+ px: "xs",
1142
+ ...rest,
1143
+ tooltip,
1144
+ menu,
1145
+ children: leftSection
1146
+ })
1147
+ })] });
1148
+ }
1149
+ const renderAction = () => {
1150
+ if ("href" in restProps && restProps.href) {
1151
+ if (restProps.href.startsWith("http") || restProps.target) return /* @__PURE__ */ jsx(ActionHrefButton, {
1152
+ ...restProps,
1153
+ href: restProps.href,
1154
+ children: restProps.children
1155
+ });
1156
+ return /* @__PURE__ */ jsx(ActionNavigationButton, {
1157
+ ...restProps,
1158
+ href: restProps.href,
1159
+ children: restProps.children
1160
+ });
1161
+ }
1162
+ delete restProps.classNameActive;
1163
+ delete restProps.variantActive;
1164
+ if ("action" in restProps && restProps.action) return /* @__PURE__ */ jsx(ActionHookButton, {
1165
+ ...restProps,
1166
+ action: restProps.action,
1167
+ children: restProps.children
1168
+ });
1169
+ if ("onClick" in restProps && restProps.onClick) return /* @__PURE__ */ jsx(ActionClickButton, {
1170
+ ...restProps,
1171
+ onClick: restProps.onClick,
1172
+ children: restProps.children
1173
+ });
1174
+ if ("form" in restProps && restProps.form) {
1175
+ if (restProps.type === "reset") return /* @__PURE__ */ jsx(ActionResetButton, {
1176
+ ...restProps,
1177
+ form: restProps.form,
1178
+ children: restProps.children
1179
+ });
1180
+ return /* @__PURE__ */ jsx(ActionSubmitButton, {
1181
+ ...restProps,
1182
+ form: restProps.form,
1183
+ children: restProps.children
1184
+ });
1185
+ }
1186
+ return /* @__PURE__ */ jsx(Button, {
1187
+ ...restProps,
1188
+ children: restProps.children
1189
+ });
1190
+ };
1191
+ let actionElement = renderAction();
1192
+ if (menu) actionElement = /* @__PURE__ */ jsxs(Menu, {
1193
+ position: menu.position || "bottom-start",
1194
+ width: menu.width || 200,
1195
+ shadow: menu.shadow || "md",
1196
+ trigger: menu.on === "hover" ? "hover" : "click",
1197
+ ...menu.menuProps,
1198
+ children: [/* @__PURE__ */ jsx(Menu.Target, {
1199
+ ...menu.targetProps,
1200
+ children: actionElement
1201
+ }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: menu.items.map((item, index) => /* @__PURE__ */ jsx(ActionMenuItem, {
1202
+ item,
1203
+ index
1204
+ }, index)) })]
1205
+ });
1206
+ if (tooltip) {
1207
+ const defaultTooltipProps = { openDelay: 1e3 };
1208
+ return /* @__PURE__ */ jsx(Tooltip, { ...typeof tooltip === "string" ? {
1209
+ ...defaultTooltipProps,
1210
+ label: tooltip,
1211
+ children: actionElement
1212
+ } : {
1213
+ ...defaultTooltipProps,
1214
+ ...tooltip,
1215
+ children: actionElement
1216
+ } });
1217
+ }
1218
+ return actionElement;
1219
+ };
1220
+ var ActionButton_default = ActionButton;
1221
+ /**
1222
+ * Action button that submits a form with loading and disabled state handling.
1223
+ */
1224
+ const ActionSubmitButton = (props) => {
1225
+ const { form, ...buttonProps } = props;
1226
+ const state = useFormState(form);
1227
+ return /* @__PURE__ */ jsx(Button, {
1228
+ ...buttonProps,
1229
+ loading: state.loading,
1230
+ disabled: state.loading,
1231
+ type: "submit",
1232
+ children: props.children
1233
+ });
1234
+ };
1235
+ const ActionResetButton = (props) => {
1236
+ const { form, ...buttonProps } = props;
1237
+ const state = useFormState(form);
1238
+ return /* @__PURE__ */ jsx(Button, {
1239
+ ...buttonProps,
1240
+ disabled: state.loading,
1241
+ type: "reset",
1242
+ children: props.children
1243
+ });
1244
+ };
1245
+ /**
1246
+ * Action button that integrates with useAction hook return value.
1247
+ * Automatically handles loading state and executes the action on click.
1248
+ *
1249
+ * @example
1250
+ * ```tsx
1251
+ * const saveAction = useAction({
1252
+ * handler: async (data) => {
1253
+ * await api.save(data);
1254
+ * }
1255
+ * }, []);
1256
+ *
1257
+ * <ActionButton action={saveAction}>
1258
+ * Save
1259
+ * </ActionButton>
1260
+ * ```
1261
+ */
1262
+ const ActionHookButton = (props) => {
1263
+ const { action, ...buttonProps } = props;
1264
+ return /* @__PURE__ */ jsx(Button, {
1265
+ ...buttonProps,
1266
+ disabled: action.loading || props.disabled,
1267
+ loading: action.loading,
1268
+ onClick: () => action.run(),
1269
+ children: props.children
1270
+ });
1271
+ };
1272
+ /**
1273
+ * Basic action button that handles click events with loading and error handling.
1274
+ *
1275
+ * @example
1276
+ * ```tsx
1277
+ * <ActionButton onClick={() => api.doSomething()}>
1278
+ * Do Something
1279
+ * </ActionButton>
87
1280
  * ```
88
1281
  */
89
- const useToast = () => {
90
- return useInject(ToastService);
1282
+ const ActionClickButton = (props) => {
1283
+ const action = useAction({ handler: async (e) => {
1284
+ await props.onClick(e);
1285
+ } }, [props.onClick]);
1286
+ return /* @__PURE__ */ jsx(Button, {
1287
+ ...props,
1288
+ disabled: action.loading || props.disabled,
1289
+ loading: action.loading,
1290
+ onClick: action.run,
1291
+ children: props.children
1292
+ });
1293
+ };
1294
+ /**
1295
+ * Action for navigation with active state support.
1296
+ */
1297
+ const ActionNavigationButton = (props) => {
1298
+ const { active: options, classNameActive, variantActive, routerGoOptions, ...buttonProps } = props;
1299
+ const router = useRouter();
1300
+ const { isPending, isActive } = useActive(options ? {
1301
+ href: props.href,
1302
+ ...options
1303
+ } : { href: props.href });
1304
+ const anchorProps = router.anchor(props.href, routerGoOptions);
1305
+ const className = buttonProps.className || "";
1306
+ if (isActive && options !== false && classNameActive) buttonProps.className = `${className} ${classNameActive}`.trim();
1307
+ if (props.anchorProps) return /* @__PURE__ */ jsx(Anchor, {
1308
+ component: "a",
1309
+ ...anchorProps,
1310
+ ...props.anchorProps,
1311
+ children: props.children
1312
+ });
1313
+ return /* @__PURE__ */ jsx(Button, {
1314
+ component: "a",
1315
+ loading: isPending,
1316
+ ...buttonProps,
1317
+ ...anchorProps,
1318
+ variant: isActive && options !== false ? variantActive ?? "filled" : buttonProps.variant ?? "subtle",
1319
+ children: props.children
1320
+ });
1321
+ };
1322
+ const ActionHrefButton = (props) => {
1323
+ const { active: options, classNameActive, variantActive, routerGoOptions, target, ...buttonProps } = props;
1324
+ return /* @__PURE__ */ jsx(Button, {
1325
+ component: "a",
1326
+ target,
1327
+ ...buttonProps,
1328
+ children: props.children
1329
+ });
1330
+ };
1331
+ function isComponentType(param) {
1332
+ if (isValidElement(param)) return false;
1333
+ return typeof param === "function" || typeof param === "object" && param !== null && "$$typeof" in param;
1334
+ }
1335
+ const renderIcon = (icon) => {
1336
+ if (!icon) return null;
1337
+ if (isValidElement(icon)) return icon;
1338
+ if (isComponentType(icon)) return /* @__PURE__ */ jsx(icon, { size: ui.sizes.icon.md });
1339
+ return icon;
91
1340
  };
92
1341
 
93
1342
  //#endregion
@@ -97,8 +1346,12 @@ const Omnibar = (props) => {
97
1346
  const searchPlaceholder = props.searchPlaceholder ?? "Search...";
98
1347
  const nothingFound = props.nothingFound ?? "Nothing found...";
99
1348
  const router = useRouter();
1349
+ const [user] = useStore("alepha.server.request.user");
100
1350
  return /* @__PURE__ */ jsx(Spotlight, {
101
- actions: useMemo(() => router.concretePages.map((page) => ({
1351
+ actions: useMemo(() => router.concretePages.filter((page) => {
1352
+ if (page.can && !page.can()) return false;
1353
+ return true;
1354
+ }).map((page) => ({
102
1355
  id: page.name,
103
1356
  label: page.label ?? page.name,
104
1357
  description: page.description,
@@ -106,12 +1359,12 @@ const Omnibar = (props) => {
106
1359
  if (page.staticName) return router.go(page.staticName, { params: page.params });
107
1360
  return router.go(page.name);
108
1361
  },
109
- leftSection: page.icon
110
- })), []),
1362
+ leftSection: renderIcon(page.icon)
1363
+ })), [user]),
111
1364
  shortcut,
112
1365
  limit: 10,
113
1366
  searchProps: {
114
- leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 20 }),
1367
+ leftSection: /* @__PURE__ */ jsx(IconSearch, { size: ui.sizes.icon.md }),
115
1368
  placeholder: searchPlaceholder
116
1369
  },
117
1370
  nothingFound
@@ -123,6 +1376,7 @@ var Omnibar_default = Omnibar;
123
1376
  //#region src/core/components/layout/AlephaMantineProvider.tsx
124
1377
  const AlephaMantineProvider = (props) => {
125
1378
  const toast = useToast();
1379
+ const [theme] = useTheme();
126
1380
  useEvents({
127
1381
  "react:transition:begin": () => {
128
1382
  nprogress.start();
@@ -143,7 +1397,10 @@ const AlephaMantineProvider = (props) => {
143
1397
  ...props.colorSchemeScript
144
1398
  }), /* @__PURE__ */ jsxs(MantineProvider, {
145
1399
  ...props.mantine,
146
- theme: { ...props.mantine?.theme },
1400
+ theme: {
1401
+ ...theme,
1402
+ ...props.mantine?.theme
1403
+ },
147
1404
  children: [
148
1405
  /* @__PURE__ */ jsx(Notifications, { ...props.notifications }),
149
1406
  /* @__PURE__ */ jsx(NavigationProgress, { ...props.navigationProgress }),
@@ -531,25 +1788,6 @@ const PromptDialog = ({ options, onSubmit }) => {
531
1788
  };
532
1789
  var PromptDialog_default = PromptDialog;
533
1790
 
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
1791
  //#endregion
554
1792
  //#region src/core/services/DialogService.tsx
555
1793
  var DialogService = class {
@@ -603,360 +1841,79 @@ var DialogService = class {
603
1841
  })
604
1842
  });
605
1843
  });
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
1844
+ }
1845
+ /**
1846
+ * Show a prompt dialog to get user input
1847
+ */
1848
+ prompt(options) {
1849
+ return new Promise((resolve) => {
1850
+ const modalId = this.open({
1851
+ ...options,
1852
+ title: options?.title || "Input",
1853
+ closeOnClickOutside: false,
1854
+ closeOnEscape: false,
1855
+ content: /* @__PURE__ */ jsx(PromptDialog_default, {
1856
+ options,
1857
+ onSubmit: (value) => {
1858
+ this.close(modalId);
1859
+ resolve(value);
1860
+ }
1861
+ })
780
1862
  });
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
1863
  });
789
- if ("onClick" in restProps && restProps.onClick) return /* @__PURE__ */ jsx(ActionClickButton, {
790
- ...restProps,
791
- onClick: restProps.onClick,
792
- children: restProps.children
1864
+ }
1865
+ /**
1866
+ * Open a custom dialog with provided content
1867
+ */
1868
+ open(options) {
1869
+ return modals.open({
1870
+ ...this.options.default,
1871
+ ...options,
1872
+ children: options?.content || options?.message
793
1873
  });
794
- if ("form" in restProps && restProps.form) {
795
- if (restProps.type === "reset") return /* @__PURE__ */ jsx(ActionResetButton, {
796
- ...restProps,
797
- form: restProps.form,
798
- children: restProps.children
799
- });
800
- return /* @__PURE__ */ jsx(ActionSubmitButton, {
801
- ...restProps,
802
- form: restProps.form,
803
- children: restProps.children
804
- });
805
- }
806
- return /* @__PURE__ */ jsx(Button, {
807
- ...restProps,
808
- children: restProps.children
1874
+ }
1875
+ /**
1876
+ * Close the currently open dialog or a specific dialog by ID
1877
+ */
1878
+ close(modalId) {
1879
+ if (modalId) modals.close(modalId);
1880
+ else modals.closeAll();
1881
+ }
1882
+ /**
1883
+ * Show a JSON editor/viewer dialog
1884
+ */
1885
+ json(data, options) {
1886
+ this.open({
1887
+ size: "lg",
1888
+ title: options?.title || "Json Viewer",
1889
+ ...options,
1890
+ content: /* @__PURE__ */ jsx(Flex$1, {
1891
+ bdrs: "md",
1892
+ w: "100%",
1893
+ flex: 1,
1894
+ p: "sm",
1895
+ bg: ui.colors.surface,
1896
+ children: /* @__PURE__ */ jsx(JsonViewer_default, {
1897
+ size: "xs",
1898
+ data
1899
+ })
1900
+ })
809
1901
  });
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
1902
  }
838
- return actionElement;
839
- };
840
- var ActionButton_default = ActionButton;
841
- /**
842
- * Action button that submits a form with loading and disabled state handling.
843
- */
844
- const ActionSubmitButton = (props) => {
845
- const { form, ...buttonProps } = props;
846
- const state = useFormState(form);
847
- return /* @__PURE__ */ jsx(Button, {
848
- ...buttonProps,
849
- loading: state.loading,
850
- disabled: state.loading,
851
- type: "submit",
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;
1903
+ /**
1904
+ * Show a form dialog for structured input
1905
+ */
1906
+ form(options) {
1907
+ return Promise.resolve(null);
1908
+ }
1909
+ /**
1910
+ * Show a loading/progress dialog with optional progress percentage
1911
+ */
1912
+ loading(options) {}
1913
+ /**
1914
+ * Show an image viewer/gallery dialog
1915
+ */
1916
+ image(src, options) {}
960
1917
  };
961
1918
 
962
1919
  //#endregion
@@ -1033,7 +1990,7 @@ const DarkModeButton = (props) => {
1033
1990
  });
1034
1991
  return /* @__PURE__ */ jsx(ActionButton_default, {
1035
1992
  onClick: toggleColorScheme,
1036
- variant: props.variant ?? "default",
1993
+ variant: props.variant ?? "subtle",
1037
1994
  size: props.size ?? "sm",
1038
1995
  "aria-label": "Toggle color scheme",
1039
1996
  px: "xs",
@@ -1096,6 +2053,24 @@ const OmnibarButton = (props) => {
1096
2053
  };
1097
2054
  var OmnibarButton_default = OmnibarButton;
1098
2055
 
2056
+ //#endregion
2057
+ //#region src/core/components/buttons/ThemeButton.tsx
2058
+ const ThemeButton = (props) => {
2059
+ const [theme, setTheme] = useTheme();
2060
+ const themes = useInject(ThemeProvider).themes;
2061
+ return /* @__PURE__ */ jsx(ActionButton_default, {
2062
+ variant: "subtle",
2063
+ icon: IconPalette,
2064
+ menu: { items: themes.map((it) => ({
2065
+ label: it.label,
2066
+ onClick: () => setTheme(it),
2067
+ active: theme.id === it.id
2068
+ })) },
2069
+ ...props.actionProps
2070
+ });
2071
+ };
2072
+ var ThemeButton_default = ThemeButton;
2073
+
1099
2074
  //#endregion
1100
2075
  //#region src/core/utils/icons.tsx
1101
2076
  /**
@@ -2119,6 +3094,7 @@ const Sidebar = (props) => {
2119
3094
  }
2120
3095
  }
2121
3096
  if ("element" in item) return /* @__PURE__ */ jsx(Flex$1, { children: item.element }, key);
3097
+ if (item.can && !item.can()) return null;
2122
3098
  if (props.collapsed) return /* @__PURE__ */ jsx(SidebarCollapsedItem, {
2123
3099
  item,
2124
3100
  level: 0,
@@ -2237,7 +3213,7 @@ const SidebarItem = (props) => {
2237
3213
  top: 48,
2238
3214
  left: 20 + 32 * level,
2239
3215
  bottom: 16
2240
- } }), item.children.map((child, index) => /* @__PURE__ */ jsx(SidebarItem, {
3216
+ } }), item.children.filter((child) => !child.can || child.can()).map((child, index) => /* @__PURE__ */ jsx(SidebarItem, {
2241
3217
  item: child,
2242
3218
  level: level + 1,
2243
3219
  onItemClick: props.onItemClick,
@@ -2273,6 +3249,10 @@ const SidebarCollapsedItem = (props) => {
2273
3249
  color: "var(--alepha-text)",
2274
3250
  variant: "subtle",
2275
3251
  variantActive: "default",
3252
+ tooltip: item.children ? void 0 : {
3253
+ label: item.label,
3254
+ position: "right"
3255
+ },
2276
3256
  radius: props.item.theme?.radius ?? props.theme.button?.radius ?? "md",
2277
3257
  onClick: handleItemClick,
2278
3258
  icon: renderIcon(item.icon) ?? /* @__PURE__ */ jsx(IconSquareRounded, {}),
@@ -2281,11 +3261,11 @@ const SidebarCollapsedItem = (props) => {
2281
3261
  menu: item.children ? {
2282
3262
  position: "right",
2283
3263
  on: "hover",
2284
- items: item.children.map((child) => ({
3264
+ items: item.children.filter((child) => !child.can || child.can()).map((child) => ({
2285
3265
  label: child.label,
2286
3266
  href: child.href,
2287
3267
  icon: renderIcon(child.icon),
2288
- children: child.children
3268
+ children: child.children?.filter((c) => !c.can || c.can())
2289
3269
  }))
2290
3270
  } : void 0,
2291
3271
  ...props.item.actionProps
@@ -2319,14 +3299,16 @@ const AdminShell = (props) => {
2319
3299
  }];
2320
3300
  const hasSidebar = showSidebar && props.sidebarProps !== void 0;
2321
3301
  return /* @__PURE__ */ jsxs(AppShell, {
3302
+ w: "100%",
3303
+ flex: 1,
2322
3304
  padding: "md",
2323
3305
  header: hasSidebar || props.appBarProps || props.header ? { height: 60 } : void 0,
2324
3306
  navbar: hasSidebar ? {
2325
- width: collapsed ? { base: 72 } : { base: 300 },
3307
+ width: collapsed ? { base: 78 } : { base: 300 },
2326
3308
  breakpoint: "sm",
2327
3309
  collapsed: { mobile: !opened }
2328
3310
  } : void 0,
2329
- footer: props.footer ? { height: 60 } : void 0,
3311
+ footer: props.footer ? { height: 24 } : void 0,
2330
3312
  ...props.appShellProps,
2331
3313
  children: [
2332
3314
  /* @__PURE__ */ jsx(AppShell.Header, {
@@ -2476,10 +3458,15 @@ const DataTable = (props) => {
2476
3458
  gap: "sm",
2477
3459
  flex: 1,
2478
3460
  children: [
2479
- props.filters ? /* @__PURE__ */ jsx(TypeForm_default, {
2480
- ...props.typeFormProps,
2481
- form,
2482
- schema
3461
+ props.filters ? /* @__PURE__ */ jsx(Card, {
3462
+ withBorder: true,
3463
+ p: "lg",
3464
+ bg: ui.colors.elevated,
3465
+ children: /* @__PURE__ */ jsx(TypeForm_default, {
3466
+ ...props.typeFormProps,
3467
+ form,
3468
+ schema
3469
+ })
2483
3470
  }) : null,
2484
3471
  /* @__PURE__ */ jsx(Flex$1, {
2485
3472
  className: "overflow-auto",
@@ -2566,17 +3553,19 @@ const AlephaUI = $module({
2566
3553
  services: [
2567
3554
  DialogService,
2568
3555
  ToastService,
3556
+ ThemeProvider,
2569
3557
  RootRouter
2570
3558
  ],
2571
3559
  register: (alepha) => {
2572
3560
  alepha.with(AlephaReactI18n);
2573
3561
  alepha.with(AlephaReactHead);
2574
3562
  alepha.with(AlephaReactForm);
3563
+ alepha.with(ThemeProvider);
2575
3564
  alepha.with(DialogService);
2576
3565
  alepha.with(ToastService);
2577
3566
  }
2578
3567
  });
2579
3568
 
2580
3569
  //#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 };
3570
+ 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, prettyName, themeAtom, ui, useDialog, useToast };
2582
3571
  //# sourceMappingURL=index.js.map