@alepha/ui 0.13.1 → 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 (118) 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 +6052 -908
  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 +3773 -3568
  46. package/dist/auth/index.js +96 -20
  47. package/dist/auth/index.js.map +1 -1
  48. package/dist/core/index.d.ts +340 -155
  49. package/dist/core/index.js +1391 -395
  50. package/dist/core/index.js.map +1 -1
  51. package/package.json +11 -8
  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/AdminParameters.tsx +1 -1
  57. package/src/admin/components/AdminSessions.tsx +43 -7
  58. package/src/admin/components/AdminUserCreate.tsx +84 -0
  59. package/src/admin/components/AdminUserDetails.tsx +180 -0
  60. package/src/admin/components/AdminUserLayout.tsx +172 -0
  61. package/src/admin/components/AdminUserSessions.tsx +158 -0
  62. package/src/admin/components/AdminUserSettings.tsx +165 -0
  63. package/src/admin/components/AdminUsers.tsx +29 -9
  64. package/src/admin/index.ts +12 -3
  65. package/src/auth/AuthI18n.ts +22 -0
  66. package/src/auth/AuthRouter.ts +82 -8
  67. package/src/auth/components/AuthLayout.tsx +12 -0
  68. package/src/auth/components/Login.tsx +13 -11
  69. package/src/auth/components/Register.tsx +6 -5
  70. package/src/auth/components/ResetPassword.tsx +1 -1
  71. package/src/auth/components/VerifyEmail.tsx +102 -0
  72. package/src/auth/components/buttons/UserButton.tsx +6 -2
  73. package/src/auth/index.ts +1 -0
  74. package/src/core/components/buttons/ActionButton.tsx +11 -4
  75. package/src/core/components/buttons/DarkModeButton.tsx +1 -1
  76. package/src/core/components/buttons/OmnibarButton.tsx +10 -5
  77. package/src/core/components/buttons/ThemeButton.tsx +31 -0
  78. package/src/core/components/layout/AdminShell.tsx +4 -2
  79. package/src/core/components/layout/AlephaMantineProvider.tsx +10 -4
  80. package/src/core/components/layout/Omnibar.tsx +27 -10
  81. package/src/core/components/layout/Sidebar.tsx +33 -15
  82. package/src/core/components/table/DataTable.tsx +9 -5
  83. package/src/core/hooks/useTheme.ts +25 -0
  84. package/src/core/index.ts +9 -4
  85. package/src/core/providers/ThemeProvider.ts +87 -0
  86. package/src/core/themes/aurora.ts +107 -0
  87. package/src/core/themes/crystal.ts +107 -0
  88. package/src/core/themes/default.ts +7 -0
  89. package/src/core/themes/ember.ts +107 -0
  90. package/src/core/themes/index.ts +7 -0
  91. package/src/core/themes/midnight.ts +104 -0
  92. package/src/core/themes/remoraid.ts +278 -0
  93. package/src/core/themes/slate.ts +81 -0
  94. package/dist/admin/AdminJobs-BOq6AZOW.js +0 -3
  95. package/dist/admin/AdminJobs-CDnVxEv6.js +0 -125
  96. package/dist/admin/AdminJobs-CDnVxEv6.js.map +0 -1
  97. package/dist/admin/AdminLayout-Bgx25J8m.js +0 -3
  98. package/dist/admin/AdminLayout-CervL8LV.js +0 -88
  99. package/dist/admin/AdminLayout-CervL8LV.js.map +0 -1
  100. package/dist/admin/AdminNotifications-BDQXt3-e.js +0 -3
  101. package/dist/admin/AdminNotifications-DvI2989x.js +0 -40
  102. package/dist/admin/AdminNotifications-DvI2989x.js.map +0 -1
  103. package/dist/admin/AdminParameters-CWi7crdn.js +0 -40
  104. package/dist/admin/AdminParameters-CWi7crdn.js.map +0 -1
  105. package/dist/admin/AdminParameters-DKRAVen3.js +0 -3
  106. package/dist/admin/AdminSessions-CmDVneE2.js.map +0 -1
  107. package/dist/admin/AdminSessions-Dkk_fzWK.js +0 -3
  108. package/dist/admin/AdminUsers-88De5pev.js.map +0 -1
  109. package/dist/admin/AdminUsers-oyAXqZ5l.js +0 -3
  110. package/dist/admin/AdminVerifications-D93TKymL.js +0 -3
  111. package/dist/admin/AdminVerifications-DBVEoqJe.js +0 -40
  112. package/dist/admin/AdminVerifications-DBVEoqJe.js.map +0 -1
  113. package/dist/auth/Login-BC2jTczq.js +0 -4
  114. package/dist/auth/Login-OCrvjs9U.js.map +0 -1
  115. package/dist/auth/Register-Dh0lsQmI.js +0 -4
  116. package/dist/auth/Register-Ei34GSba.js.map +0 -1
  117. package/dist/auth/ResetPassword-BnlAQAOE.js +0 -3
  118. 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;
@@ -77,17 +1028,315 @@ var ToastService = class {
77
1028
  //#endregion
78
1029
  //#region src/core/hooks/useToast.ts
79
1030
  /**
80
- * Use this hook to access the Toast Service for showing notifications.
1031
+ * Use this hook to access the Toast Service for showing notifications.
1032
+ *
1033
+ * @example
1034
+ * ```tsx
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.
81
1274
  *
82
1275
  * @example
83
1276
  * ```tsx
84
- * const toast = useToast();
85
- * toast.success({ message: "Operation completed successfully!" });
86
- * toast.error({ title: "Error", message: "Something went wrong" });
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,18 +1346,25 @@ 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,
105
- onClick: () => router.go(page.name),
106
- leftSection: page.icon
107
- })), []),
1358
+ onClick: () => {
1359
+ if (page.staticName) return router.go(page.staticName, { params: page.params });
1360
+ return router.go(page.name);
1361
+ },
1362
+ leftSection: renderIcon(page.icon)
1363
+ })), [user]),
108
1364
  shortcut,
109
1365
  limit: 10,
110
1366
  searchProps: {
111
- leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 20 }),
1367
+ leftSection: /* @__PURE__ */ jsx(IconSearch, { size: ui.sizes.icon.md }),
112
1368
  placeholder: searchPlaceholder
113
1369
  },
114
1370
  nothingFound
@@ -120,6 +1376,7 @@ var Omnibar_default = Omnibar;
120
1376
  //#region src/core/components/layout/AlephaMantineProvider.tsx
121
1377
  const AlephaMantineProvider = (props) => {
122
1378
  const toast = useToast();
1379
+ const [theme] = useTheme();
123
1380
  useEvents({
124
1381
  "react:transition:begin": () => {
125
1382
  nprogress.start();
@@ -140,7 +1397,10 @@ const AlephaMantineProvider = (props) => {
140
1397
  ...props.colorSchemeScript
141
1398
  }), /* @__PURE__ */ jsxs(MantineProvider, {
142
1399
  ...props.mantine,
143
- theme: { ...props.mantine?.theme },
1400
+ theme: {
1401
+ ...theme,
1402
+ ...props.mantine?.theme
1403
+ },
144
1404
  children: [
145
1405
  /* @__PURE__ */ jsx(Notifications, { ...props.notifications }),
146
1406
  /* @__PURE__ */ jsx(NavigationProgress, { ...props.navigationProgress }),
@@ -528,25 +1788,6 @@ const PromptDialog = ({ options, onSubmit }) => {
528
1788
  };
529
1789
  var PromptDialog_default = PromptDialog;
530
1790
 
531
- //#endregion
532
- //#region src/core/constants/ui.ts
533
- const ui = {
534
- colors: {
535
- transparent: "transparent",
536
- background: "var(--alepha-background)",
537
- surface: "var(--alepha-surface)",
538
- elevated: "var(--alepha-elevated)",
539
- border: "var(--alepha-border)"
540
- },
541
- sizes: { icon: {
542
- xs: 12,
543
- sm: 16,
544
- md: 20,
545
- lg: 24,
546
- xl: 32
547
- } }
548
- };
549
-
550
1791
  //#endregion
551
1792
  //#region src/core/services/DialogService.tsx
552
1793
  var DialogService = class {
@@ -604,356 +1845,75 @@ var DialogService = class {
604
1845
  /**
605
1846
  * Show a prompt dialog to get user input
606
1847
  */
607
- prompt(options) {
608
- return new Promise((resolve) => {
609
- const modalId = this.open({
610
- ...options,
611
- title: options?.title || "Input",
612
- closeOnClickOutside: false,
613
- closeOnEscape: false,
614
- content: /* @__PURE__ */ jsx(PromptDialog_default, {
615
- options,
616
- onSubmit: (value) => {
617
- this.close(modalId);
618
- resolve(value);
619
- }
620
- })
621
- });
622
- });
623
- }
624
- /**
625
- * Open a custom dialog with provided content
626
- */
627
- open(options) {
628
- return modals.open({
629
- ...this.options.default,
630
- ...options,
631
- children: options?.content || options?.message
632
- });
633
- }
634
- /**
635
- * Close the currently open dialog or a specific dialog by ID
636
- */
637
- close(modalId) {
638
- if (modalId) modals.close(modalId);
639
- else modals.closeAll();
640
- }
641
- /**
642
- * Show a JSON editor/viewer dialog
643
- */
644
- json(data, options) {
645
- this.open({
646
- size: "lg",
647
- title: options?.title || "Json Viewer",
648
- ...options,
649
- content: /* @__PURE__ */ jsx(Flex$1, {
650
- bdrs: "md",
651
- w: "100%",
652
- flex: 1,
653
- p: "sm",
654
- bg: ui.colors.surface,
655
- children: /* @__PURE__ */ jsx(JsonViewer_default, {
656
- size: "xs",
657
- data
658
- })
659
- })
660
- });
661
- }
662
- /**
663
- * Show a form dialog for structured input
664
- */
665
- form(options) {
666
- return Promise.resolve(null);
667
- }
668
- /**
669
- * Show a loading/progress dialog with optional progress percentage
670
- */
671
- loading(options) {}
672
- /**
673
- * Show an image viewer/gallery dialog
674
- */
675
- image(src, options) {}
676
- };
677
-
678
- //#endregion
679
- //#region src/core/components/buttons/ActionButton.tsx
680
- const ActionMenuItem = (props) => {
681
- const { item, index } = props;
682
- const router = useRouter();
683
- const action = useAction({ handler: async (e) => {
684
- await item.onClick?.();
685
- } }, [item.onClick]);
686
- if (item.type === "divider") return /* @__PURE__ */ jsx(Menu.Divider, {}, index);
687
- if (item.type === "label") return /* @__PURE__ */ jsx(Menu.Label, { children: item.label }, index);
688
- if (item.children && item.children.length > 0) return /* @__PURE__ */ jsxs(Menu, {
689
- trigger: "hover",
690
- position: "right-start",
691
- offset: 2,
692
- children: [/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(Menu.Item, {
693
- leftSection: item.icon,
694
- rightSection: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }),
695
- children: item.label
696
- }) }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: item.children.map((child, childIndex) => /* @__PURE__ */ jsx(ActionMenuItem, {
697
- item: child,
698
- index: childIndex
699
- }, childIndex)) })]
700
- }, index);
701
- const menuItemProps = {};
702
- if (props.item.onClick) menuItemProps.onClick = action.run;
703
- else if (props.item.href) Object.assign(menuItemProps, router.anchor(props.item.href));
704
- return /* @__PURE__ */ jsx(Menu.Item, {
705
- leftSection: item.icon,
706
- onClick: item.onClick,
707
- color: item.color,
708
- rightSection: item.active ? /* @__PURE__ */ jsx(ThemeIcon, {
709
- size: "xs",
710
- variant: "transparent",
711
- children: /* @__PURE__ */ jsx(IconCheck, {})
712
- }) : void 0,
713
- ...menuItemProps,
714
- children: item.label
715
- }, index);
716
- };
717
- const ActionButton = (_props) => {
718
- const props = {
719
- variant: "default",
720
- ..._props
721
- };
722
- const { tooltip, menu, icon, ...restProps } = props;
723
- if (props.icon) {
724
- const icon$1 = isComponentType(props.icon) ? /* @__PURE__ */ jsx(props.icon, { size: ui.sizes.icon.md }) : /* @__PURE__ */ jsx(ThemeIcon, {
725
- w: 24,
726
- variant: "transparent",
727
- size: "sm",
728
- c: "var(--mantine-color-text)",
729
- ...props.themeIconProps,
730
- children: props.icon
731
- });
732
- if (!props.children) {
733
- restProps.children = Children.only(icon$1);
734
- restProps.p ??= "xs";
735
- } else restProps.leftSection = icon$1;
736
- }
737
- if (props.leftSection && !props.children) {
738
- restProps.className ??= "mantine-Action-iconOnly";
739
- restProps.p ??= "xs";
740
- }
741
- if (props.textVisibleFrom) {
742
- const { children, textVisibleFrom, leftSection, ...rest } = restProps;
743
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Flex$1, {
744
- w: "100%",
745
- visibleFrom: textVisibleFrom,
746
- children: /* @__PURE__ */ jsx(ActionButton, {
747
- flex: 1,
748
- ...rest,
749
- leftSection,
750
- tooltip,
751
- menu,
752
- children
753
- })
754
- }), /* @__PURE__ */ jsx(Flex$1, {
755
- w: "100%",
756
- hiddenFrom: textVisibleFrom,
757
- children: /* @__PURE__ */ jsx(ActionButton, {
758
- px: "xs",
759
- ...rest,
760
- tooltip,
761
- menu,
762
- children: leftSection
763
- })
764
- })] });
765
- }
766
- const renderAction = () => {
767
- if ("href" in restProps && restProps.href) {
768
- if (restProps.href.startsWith("http") || restProps.target) return /* @__PURE__ */ jsx(ActionHrefButton, {
769
- ...restProps,
770
- href: restProps.href,
771
- children: restProps.children
772
- });
773
- return /* @__PURE__ */ jsx(ActionNavigationButton, {
774
- ...restProps,
775
- href: restProps.href,
776
- children: restProps.children
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
+ })
777
1862
  });
778
- }
779
- delete restProps.classNameActive;
780
- delete restProps.variantActive;
781
- if ("action" in restProps && restProps.action) return /* @__PURE__ */ jsx(ActionHookButton, {
782
- ...restProps,
783
- action: restProps.action,
784
- children: restProps.children
785
1863
  });
786
- if ("onClick" in restProps && restProps.onClick) return /* @__PURE__ */ jsx(ActionClickButton, {
787
- ...restProps,
788
- onClick: restProps.onClick,
789
- 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
790
1873
  });
791
- if ("form" in restProps && restProps.form) {
792
- if (restProps.type === "reset") return /* @__PURE__ */ jsx(ActionResetButton, {
793
- ...restProps,
794
- form: restProps.form,
795
- children: restProps.children
796
- });
797
- return /* @__PURE__ */ jsx(ActionSubmitButton, {
798
- ...restProps,
799
- form: restProps.form,
800
- children: restProps.children
801
- });
802
- }
803
- return /* @__PURE__ */ jsx(Button, {
804
- ...restProps,
805
- 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
+ })
806
1901
  });
807
- };
808
- let actionElement = renderAction();
809
- if (menu) actionElement = /* @__PURE__ */ jsxs(Menu, {
810
- position: menu.position || "bottom-start",
811
- width: menu.width || 200,
812
- shadow: menu.shadow || "md",
813
- trigger: menu.on === "hover" ? "hover" : "click",
814
- ...menu.menuProps,
815
- children: [/* @__PURE__ */ jsx(Menu.Target, {
816
- ...menu.targetProps,
817
- children: actionElement
818
- }), /* @__PURE__ */ jsx(Menu.Dropdown, { children: menu.items.map((item, index) => /* @__PURE__ */ jsx(ActionMenuItem, {
819
- item,
820
- index
821
- }, index)) })]
822
- });
823
- if (tooltip) {
824
- const defaultTooltipProps = { openDelay: 1e3 };
825
- return /* @__PURE__ */ jsx(Tooltip, { ...typeof tooltip === "string" ? {
826
- ...defaultTooltipProps,
827
- label: tooltip,
828
- children: actionElement
829
- } : {
830
- ...defaultTooltipProps,
831
- ...tooltip,
832
- children: actionElement
833
- } });
834
1902
  }
835
- return actionElement;
836
- };
837
- var ActionButton_default = ActionButton;
838
- /**
839
- * Action button that submits a form with loading and disabled state handling.
840
- */
841
- const ActionSubmitButton = (props) => {
842
- const { form, ...buttonProps } = props;
843
- const state = useFormState(form);
844
- return /* @__PURE__ */ jsx(Button, {
845
- ...buttonProps,
846
- loading: state.loading,
847
- disabled: state.loading,
848
- type: "submit",
849
- children: props.children
850
- });
851
- };
852
- const ActionResetButton = (props) => {
853
- const { form, ...buttonProps } = props;
854
- const state = useFormState(form);
855
- return /* @__PURE__ */ jsx(Button, {
856
- ...buttonProps,
857
- disabled: state.loading,
858
- type: "reset",
859
- children: props.children
860
- });
861
- };
862
- /**
863
- * Action button that integrates with useAction hook return value.
864
- * Automatically handles loading state and executes the action on click.
865
- *
866
- * @example
867
- * ```tsx
868
- * const saveAction = useAction({
869
- * handler: async (data) => {
870
- * await api.save(data);
871
- * }
872
- * }, []);
873
- *
874
- * <ActionButton action={saveAction}>
875
- * Save
876
- * </ActionButton>
877
- * ```
878
- */
879
- const ActionHookButton = (props) => {
880
- const { action, ...buttonProps } = props;
881
- return /* @__PURE__ */ jsx(Button, {
882
- ...buttonProps,
883
- disabled: action.loading || props.disabled,
884
- loading: action.loading,
885
- onClick: () => action.run(),
886
- children: props.children
887
- });
888
- };
889
- /**
890
- * Basic action button that handles click events with loading and error handling.
891
- *
892
- * @example
893
- * ```tsx
894
- * <ActionButton onClick={() => api.doSomething()}>
895
- * Do Something
896
- * </ActionButton>
897
- * ```
898
- */
899
- const ActionClickButton = (props) => {
900
- const action = useAction({ handler: async (e) => {
901
- await props.onClick(e);
902
- } }, [props.onClick]);
903
- return /* @__PURE__ */ jsx(Button, {
904
- ...props,
905
- disabled: action.loading || props.disabled,
906
- loading: action.loading,
907
- onClick: action.run,
908
- children: props.children
909
- });
910
- };
911
- /**
912
- * Action for navigation with active state support.
913
- */
914
- const ActionNavigationButton = (props) => {
915
- const { active: options, classNameActive, variantActive, routerGoOptions, ...buttonProps } = props;
916
- const router = useRouter();
917
- const { isPending, isActive } = useActive(options ? {
918
- href: props.href,
919
- ...options
920
- } : { href: props.href });
921
- const anchorProps = router.anchor(props.href, routerGoOptions);
922
- const className = buttonProps.className || "";
923
- if (isActive && options !== false && classNameActive) buttonProps.className = `${className} ${classNameActive}`.trim();
924
- if (props.anchorProps) return /* @__PURE__ */ jsx(Anchor, {
925
- component: "a",
926
- ...anchorProps,
927
- ...props.anchorProps,
928
- children: props.children
929
- });
930
- return /* @__PURE__ */ jsx(Button, {
931
- component: "a",
932
- loading: isPending,
933
- ...buttonProps,
934
- ...anchorProps,
935
- variant: isActive && options !== false ? variantActive ?? "filled" : buttonProps.variant ?? "subtle",
936
- children: props.children
937
- });
938
- };
939
- const ActionHrefButton = (props) => {
940
- const { active: options, classNameActive, variantActive, routerGoOptions, target, ...buttonProps } = props;
941
- return /* @__PURE__ */ jsx(Button, {
942
- component: "a",
943
- target,
944
- ...buttonProps,
945
- children: props.children
946
- });
947
- };
948
- function isComponentType(param) {
949
- if (isValidElement(param)) return false;
950
- return typeof param === "function" || typeof param === "object" && param !== null && "$$typeof" in param;
951
- }
952
- const renderIcon = (icon) => {
953
- if (!icon) return null;
954
- if (isValidElement(icon)) return icon;
955
- if (isComponentType(icon)) return /* @__PURE__ */ jsx(icon, { size: ui.sizes.icon.md });
956
- 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) {}
957
1917
  };
958
1918
 
959
1919
  //#endregion
@@ -1030,7 +1990,7 @@ const DarkModeButton = (props) => {
1030
1990
  });
1031
1991
  return /* @__PURE__ */ jsx(ActionButton_default, {
1032
1992
  onClick: toggleColorScheme,
1033
- variant: props.variant ?? "default",
1993
+ variant: props.variant ?? "subtle",
1034
1994
  size: props.size ?? "sm",
1035
1995
  "aria-label": "Toggle color scheme",
1036
1996
  px: "xs",
@@ -1064,10 +2024,10 @@ var LanguageButton_default = LanguageButton;
1064
2024
  const OmnibarButton = (props) => {
1065
2025
  return /* @__PURE__ */ jsx(ActionButton_default, {
1066
2026
  variant: "default",
1067
- miw: 256,
1068
2027
  onClick: spotlight.open,
1069
2028
  justify: "space-between",
1070
2029
  rightSection: /* @__PURE__ */ jsx(Kbd, {
2030
+ visibleFrom: "sm",
1071
2031
  size: "sm",
1072
2032
  children: "⌘+K"
1073
2033
  }),
@@ -1079,16 +2039,38 @@ const OmnibarButton = (props) => {
1079
2039
  children: [/* @__PURE__ */ jsx(IconSearch, {
1080
2040
  size: 16,
1081
2041
  color: "gray"
1082
- }), /* @__PURE__ */ jsx(Text$1, {
1083
- size: "xs",
1084
- c: "dimmed",
1085
- children: "Search..."
2042
+ }), /* @__PURE__ */ jsx(Flex$1, {
2043
+ visibleFrom: "sm",
2044
+ miw: 192,
2045
+ children: /* @__PURE__ */ jsx(Text$1, {
2046
+ size: "xs",
2047
+ c: "dimmed",
2048
+ children: "Search..."
2049
+ })
1086
2050
  })]
1087
2051
  })
1088
2052
  });
1089
2053
  };
1090
2054
  var OmnibarButton_default = OmnibarButton;
1091
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
+
1092
2074
  //#endregion
1093
2075
  //#region src/core/utils/icons.tsx
1094
2076
  /**
@@ -2112,6 +3094,7 @@ const Sidebar = (props) => {
2112
3094
  }
2113
3095
  }
2114
3096
  if ("element" in item) return /* @__PURE__ */ jsx(Flex$1, { children: item.element }, key);
3097
+ if (item.can && !item.can()) return null;
2115
3098
  if (props.collapsed) return /* @__PURE__ */ jsx(SidebarCollapsedItem, {
2116
3099
  item,
2117
3100
  level: 0,
@@ -2230,7 +3213,7 @@ const SidebarItem = (props) => {
2230
3213
  top: 48,
2231
3214
  left: 20 + 32 * level,
2232
3215
  bottom: 16
2233
- } }), item.children.map((child, index) => /* @__PURE__ */ jsx(SidebarItem, {
3216
+ } }), item.children.filter((child) => !child.can || child.can()).map((child, index) => /* @__PURE__ */ jsx(SidebarItem, {
2234
3217
  item: child,
2235
3218
  level: level + 1,
2236
3219
  onItemClick: props.onItemClick,
@@ -2266,6 +3249,10 @@ const SidebarCollapsedItem = (props) => {
2266
3249
  color: "var(--alepha-text)",
2267
3250
  variant: "subtle",
2268
3251
  variantActive: "default",
3252
+ tooltip: item.children ? void 0 : {
3253
+ label: item.label,
3254
+ position: "right"
3255
+ },
2269
3256
  radius: props.item.theme?.radius ?? props.theme.button?.radius ?? "md",
2270
3257
  onClick: handleItemClick,
2271
3258
  icon: renderIcon(item.icon) ?? /* @__PURE__ */ jsx(IconSquareRounded, {}),
@@ -2274,11 +3261,11 @@ const SidebarCollapsedItem = (props) => {
2274
3261
  menu: item.children ? {
2275
3262
  position: "right",
2276
3263
  on: "hover",
2277
- items: item.children.map((child) => ({
3264
+ items: item.children.filter((child) => !child.can || child.can()).map((child) => ({
2278
3265
  label: child.label,
2279
3266
  href: child.href,
2280
3267
  icon: renderIcon(child.icon),
2281
- children: child.children
3268
+ children: child.children?.filter((c) => !c.can || c.can())
2282
3269
  }))
2283
3270
  } : void 0,
2284
3271
  ...props.item.actionProps
@@ -2312,14 +3299,16 @@ const AdminShell = (props) => {
2312
3299
  }];
2313
3300
  const hasSidebar = showSidebar && props.sidebarProps !== void 0;
2314
3301
  return /* @__PURE__ */ jsxs(AppShell, {
3302
+ w: "100%",
3303
+ flex: 1,
2315
3304
  padding: "md",
2316
3305
  header: hasSidebar || props.appBarProps || props.header ? { height: 60 } : void 0,
2317
3306
  navbar: hasSidebar ? {
2318
- width: collapsed ? { base: 72 } : { base: 300 },
3307
+ width: collapsed ? { base: 78 } : { base: 300 },
2319
3308
  breakpoint: "sm",
2320
3309
  collapsed: { mobile: !opened }
2321
3310
  } : void 0,
2322
- footer: props.footer ? { height: 60 } : void 0,
3311
+ footer: props.footer ? { height: 24 } : void 0,
2323
3312
  ...props.appShellProps,
2324
3313
  children: [
2325
3314
  /* @__PURE__ */ jsx(AppShell.Header, {
@@ -2469,10 +3458,15 @@ const DataTable = (props) => {
2469
3458
  gap: "sm",
2470
3459
  flex: 1,
2471
3460
  children: [
2472
- props.filters ? /* @__PURE__ */ jsx(TypeForm_default, {
2473
- ...props.typeFormProps,
2474
- form,
2475
- 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
+ })
2476
3470
  }) : null,
2477
3471
  /* @__PURE__ */ jsx(Flex$1, {
2478
3472
  className: "overflow-auto",
@@ -2559,17 +3553,19 @@ const AlephaUI = $module({
2559
3553
  services: [
2560
3554
  DialogService,
2561
3555
  ToastService,
3556
+ ThemeProvider,
2562
3557
  RootRouter
2563
3558
  ],
2564
3559
  register: (alepha) => {
2565
3560
  alepha.with(AlephaReactI18n);
2566
3561
  alepha.with(AlephaReactHead);
2567
3562
  alepha.with(AlephaReactForm);
3563
+ alepha.with(ThemeProvider);
2568
3564
  alepha.with(DialogService);
2569
3565
  alepha.with(ToastService);
2570
3566
  }
2571
3567
  });
2572
3568
 
2573
3569
  //#endregion
2574
- 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 };
2575
3571
  //# sourceMappingURL=index.js.map