@alepha/ui 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +2 -30
  2. package/dist/admin/AdminFiles-BM6_7_5A.cjs +4 -0
  3. package/dist/admin/AdminFiles-BaCIMeNt.js +4 -0
  4. package/dist/admin/AdminFiles-CllAxb1B.js +117 -0
  5. package/dist/admin/AdminFiles-CllAxb1B.js.map +1 -0
  6. package/dist/admin/AdminFiles-DC3T8uWZ.cjs +122 -0
  7. package/dist/admin/AdminFiles-DC3T8uWZ.cjs.map +1 -0
  8. package/dist/admin/AdminJobs-BXkFtlVo.js +125 -0
  9. package/dist/admin/AdminJobs-BXkFtlVo.js.map +1 -0
  10. package/dist/admin/AdminJobs-C428qrNQ.cjs +130 -0
  11. package/dist/admin/AdminJobs-C428qrNQ.cjs.map +1 -0
  12. package/dist/admin/AdminJobs-DCPPaJ4i.cjs +4 -0
  13. package/dist/admin/AdminJobs-yC6DarGO.js +4 -0
  14. package/dist/admin/AdminLayout-Bqo4cd33.cjs +4 -0
  15. package/dist/admin/AdminLayout-CQpxfko6.js +4 -0
  16. package/dist/admin/AdminLayout-CiLlywAQ.cjs +93 -0
  17. package/dist/admin/AdminLayout-CiLlywAQ.cjs.map +1 -0
  18. package/dist/admin/AdminLayout-CtkVYk-u.js +88 -0
  19. package/dist/admin/AdminLayout-CtkVYk-u.js.map +1 -0
  20. package/dist/admin/AdminNotifications-DNUeJ-PW.cjs +44 -0
  21. package/dist/admin/AdminNotifications-DNUeJ-PW.cjs.map +1 -0
  22. package/dist/admin/AdminNotifications-DaMu1AQ4.js +4 -0
  23. package/dist/admin/AdminNotifications-DnnulNNV.js +40 -0
  24. package/dist/admin/AdminNotifications-DnnulNNV.js.map +1 -0
  25. package/dist/admin/AdminNotifications-ihgbKVCx.cjs +4 -0
  26. package/dist/admin/AdminParameters-B3hvpLpu.js +40 -0
  27. package/dist/admin/AdminParameters-B3hvpLpu.js.map +1 -0
  28. package/dist/admin/AdminParameters-U4lU1rUF.cjs +4 -0
  29. package/dist/admin/AdminParameters-gdf7036N.cjs +44 -0
  30. package/dist/admin/AdminParameters-gdf7036N.cjs.map +1 -0
  31. package/dist/admin/AdminParameters-prMcCgxf.js +4 -0
  32. package/dist/admin/AdminSessions-BF_P4lHs.cjs +128 -0
  33. package/dist/admin/AdminSessions-BF_P4lHs.cjs.map +1 -0
  34. package/dist/admin/AdminSessions-CATIU61I.cjs +4 -0
  35. package/dist/admin/AdminSessions-DqOXOpYR.js +4 -0
  36. package/dist/admin/AdminSessions-Pjdz-iZx.js +123 -0
  37. package/dist/admin/AdminSessions-Pjdz-iZx.js.map +1 -0
  38. package/dist/admin/AdminUsers-BgTL-zSY.js +4 -0
  39. package/dist/admin/AdminUsers-C1HsrRxn.js +104 -0
  40. package/dist/admin/AdminUsers-C1HsrRxn.js.map +1 -0
  41. package/dist/admin/AdminUsers-HqvxwNGZ.cjs +4 -0
  42. package/dist/admin/AdminUsers-M2uEQbp5.cjs +109 -0
  43. package/dist/admin/AdminUsers-M2uEQbp5.cjs.map +1 -0
  44. package/dist/admin/AdminVerifications-BVssbtfU.cjs +44 -0
  45. package/dist/admin/AdminVerifications-BVssbtfU.cjs.map +1 -0
  46. package/dist/admin/AdminVerifications-Df6DRgNo.js +4 -0
  47. package/dist/admin/AdminVerifications-DxAtcYUR.cjs +4 -0
  48. package/dist/admin/AdminVerifications-VMpm30mS.js +40 -0
  49. package/dist/admin/AdminVerifications-VMpm30mS.js.map +1 -0
  50. package/dist/admin/core-CzO6aavT.js +2507 -0
  51. package/dist/admin/core-CzO6aavT.js.map +1 -0
  52. package/dist/{index.cjs → admin/core-aFtK4l9I.cjs} +287 -204
  53. package/dist/admin/core-aFtK4l9I.cjs.map +1 -0
  54. package/dist/admin/index.cjs +87 -0
  55. package/dist/admin/index.cjs.map +1 -0
  56. package/dist/admin/index.d.cts +1739 -0
  57. package/dist/admin/index.d.ts +1745 -0
  58. package/dist/admin/index.js +78 -0
  59. package/dist/admin/index.js.map +1 -0
  60. package/dist/auth/IconGoogle-B17BTQyD.cjs +69 -0
  61. package/dist/auth/IconGoogle-B17BTQyD.cjs.map +1 -0
  62. package/dist/auth/IconGoogle-Bfmuv9Rv.js +58 -0
  63. package/dist/auth/IconGoogle-Bfmuv9Rv.js.map +1 -0
  64. package/dist/auth/Login-BTBmbnWl.cjs +181 -0
  65. package/dist/auth/Login-BTBmbnWl.cjs.map +1 -0
  66. package/dist/auth/Login-BcQOtG3v.js +5 -0
  67. package/dist/auth/Login-Btmd70Um.cjs +5 -0
  68. package/dist/auth/Login-JeXFsUf5.js +176 -0
  69. package/dist/auth/Login-JeXFsUf5.js.map +1 -0
  70. package/dist/auth/Register-CPQnvXCZ.js +318 -0
  71. package/dist/auth/Register-CPQnvXCZ.js.map +1 -0
  72. package/dist/auth/Register-CbesZal3.cjs +5 -0
  73. package/dist/auth/Register-DpI_JdyO.js +5 -0
  74. package/dist/auth/Register-HP3rP71B.cjs +323 -0
  75. package/dist/auth/Register-HP3rP71B.cjs.map +1 -0
  76. package/dist/auth/ResetPassword-B-tkzV7g.cjs +248 -0
  77. package/dist/auth/ResetPassword-B-tkzV7g.cjs.map +1 -0
  78. package/dist/auth/ResetPassword-BlK3xEpU.js +4 -0
  79. package/dist/auth/ResetPassword-BzUjGG_-.js +243 -0
  80. package/dist/auth/ResetPassword-BzUjGG_-.js.map +1 -0
  81. package/dist/auth/ResetPassword-W3xjOnWy.cjs +4 -0
  82. package/dist/auth/chunk-DhGyd7sr.js +28 -0
  83. package/dist/auth/core-D1MHij1j.js +1795 -0
  84. package/dist/auth/core-D1MHij1j.js.map +1 -0
  85. package/dist/auth/core-rDZ9d92K.cjs +1824 -0
  86. package/dist/auth/core-rDZ9d92K.cjs.map +1 -0
  87. package/dist/auth/index.cjs +211 -0
  88. package/dist/auth/index.cjs.map +1 -0
  89. package/dist/auth/index.d.cts +6265 -0
  90. package/dist/auth/index.d.ts +6274 -0
  91. package/dist/auth/index.js +206 -0
  92. package/dist/auth/index.js.map +1 -0
  93. package/dist/core/index.cjs +2620 -0
  94. package/dist/core/index.cjs.map +1 -0
  95. package/dist/core/index.d.cts +2737 -0
  96. package/dist/core/index.d.ts +2743 -0
  97. package/dist/{index.js → core/index.js} +298 -126
  98. package/dist/core/index.js.map +1 -0
  99. package/package.json +32 -14
  100. package/src/admin/AdminRouter.ts +58 -0
  101. package/src/admin/components/AdminFiles.tsx +117 -0
  102. package/src/admin/components/AdminJobs.tsx +158 -0
  103. package/src/admin/components/AdminLayout.tsx +114 -0
  104. package/src/admin/components/AdminNotifications.tsx +20 -0
  105. package/src/admin/components/AdminParameters.tsx +24 -0
  106. package/src/admin/components/AdminSessions.tsx +159 -0
  107. package/src/admin/components/AdminUsers.tsx +137 -0
  108. package/src/admin/components/AdminVerifications.tsx +25 -0
  109. package/src/admin/index.ts +29 -0
  110. package/src/auth/AuthI18n.ts +118 -0
  111. package/src/auth/AuthRouter.ts +53 -0
  112. package/src/auth/components/Login.tsx +193 -0
  113. package/src/auth/components/Register.tsx +421 -0
  114. package/src/auth/components/ResetPassword.tsx +259 -0
  115. package/src/auth/components/buttons/UserButton.tsx +118 -0
  116. package/src/auth/components/icons/IconGithub.tsx +21 -0
  117. package/src/auth/components/icons/IconGoogle.tsx +30 -0
  118. package/src/auth/index.ts +27 -0
  119. package/src/{RootRouter.ts → core/RootRouter.ts} +2 -1
  120. package/src/{components → core/components}/buttons/ActionButton.tsx +49 -6
  121. package/src/core/components/buttons/ClipboardButton.tsx +56 -0
  122. package/src/{components → core/components}/buttons/DarkModeButton.tsx +7 -8
  123. package/src/{components → core/components}/buttons/LanguageButton.tsx +2 -2
  124. package/src/{components → core/components}/buttons/OmnibarButton.tsx +1 -1
  125. package/src/{components → core/components}/dialogs/AlertDialog.tsx +1 -1
  126. package/src/{components → core/components}/dialogs/ConfirmDialog.tsx +1 -1
  127. package/src/{components → core/components}/dialogs/PromptDialog.tsx +1 -1
  128. package/src/{components → core/components}/form/Control.tsx +1 -0
  129. package/src/{components → core/components}/layout/AdminShell.tsx +38 -7
  130. package/src/{components → core/components}/layout/AlephaMantineProvider.tsx +12 -8
  131. package/src/{components → core/components}/layout/AppBar.tsx +1 -1
  132. package/src/{components → core/components}/layout/Omnibar.tsx +1 -1
  133. package/src/{components → core/components}/layout/Sidebar.tsx +29 -26
  134. package/src/{components → core/components}/table/DataTable.tsx +1 -1
  135. package/src/{constants → core/constants}/ui.ts +9 -0
  136. package/src/{index.ts → core/index.ts} +3 -0
  137. package/src/{services → core/services}/DialogService.tsx +3 -3
  138. package/src/{services → core/services}/ToastService.tsx +3 -1
  139. package/src/{utils → core/utils}/extractSchemaFields.ts +2 -8
  140. package/src/{utils → core/utils}/icons.tsx +5 -15
  141. package/src/{utils → core/utils}/parseInput.ts +34 -26
  142. package/dist/AlephaMantineProvider-CGpgWDt8.cjs +0 -3
  143. package/dist/AlephaMantineProvider-D8cHYAge.js +0 -152
  144. package/dist/AlephaMantineProvider-D8cHYAge.js.map +0 -1
  145. package/dist/AlephaMantineProvider-DuvZFAuk.cjs +0 -175
  146. package/dist/AlephaMantineProvider-DuvZFAuk.cjs.map +0 -1
  147. package/dist/AlephaMantineProvider-twBqV4IO.js +0 -3
  148. package/dist/index.cjs.map +0 -1
  149. package/dist/index.d.cts +0 -821
  150. package/dist/index.d.cts.map +0 -1
  151. package/dist/index.d.ts +0 -821
  152. package/dist/index.d.ts.map +0 -1
  153. package/dist/index.js.map +0 -1
  154. /package/src/{components → core/components}/buttons/BurgerButton.tsx +0 -0
  155. /package/src/{components → core/components}/buttons/ToggleSidebarButton.tsx +0 -0
  156. /package/src/{components → core/components}/data/JsonViewer.tsx +0 -0
  157. /package/src/{components → core/components}/form/ControlDate.tsx +0 -0
  158. /package/src/{components → core/components}/form/ControlNumber.tsx +0 -0
  159. /package/src/{components → core/components}/form/ControlQueryBuilder.tsx +0 -0
  160. /package/src/{components → core/components}/form/ControlSelect.tsx +0 -0
  161. /package/src/{components → core/components}/form/TypeForm.tsx +0 -0
  162. /package/src/{hooks → core/hooks}/useDialog.ts +0 -0
  163. /package/src/{hooks → core/hooks}/useToast.ts +0 -0
  164. /package/src/{utils → core/utils}/string.ts +0 -0
package/dist/index.d.ts DELETED
@@ -1,821 +0,0 @@
1
- import { FormModel, InputField } from "@alepha/react/form";
2
- import * as alepha0 from "alepha";
3
- import { Alepha, Async, Page, PageMetadata, Static, TObject, TProperties } from "alepha";
4
- import * as _alepha_react0 from "@alepha/react";
5
- import { RouterGoOptions, UseActionReturn, UseActiveOptions } from "@alepha/react";
6
- import { AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarProps, AppShellProps, AutocompleteProps, BurgerProps, ButtonProps, ColorInputProps, ColorSchemeScriptProps, FileInputProps, Flex, FlexProps, MantineBreakpoint, MantineProviderProps, MantineSize, MenuProps, MenuTargetProps, ModalProps, MultiSelectProps, NumberInputProps, PasswordInputProps, SegmentedControlProps, SelectProps, SliderProps, SwitchProps, TableProps, TableTrProps, TagsInputProps, Text, TextInputProps, TextareaProps, ThemeIconProps, TooltipProps } from "@mantine/core";
7
- import { ModalsProviderProps } from "@mantine/modals";
8
- import { ComponentType, ReactNode } from "react";
9
- import * as react_jsx_runtime6 from "react/jsx-runtime";
10
- import * as _mantine_notifications0 from "@mantine/notifications";
11
- import { NotificationData, NotificationsProps } from "@mantine/notifications";
12
- import { DateInputProps, DateTimePickerProps, TimeInputProps } from "@mantine/dates";
13
- import { NavigationProgressProps } from "@mantine/nprogress";
14
- import { DurationLike } from "alepha/datetime";
15
-
16
- //#region src/utils/parseInput.d.ts
17
- interface GenericControlProps {
18
- input: InputField;
19
- title?: string;
20
- description?: string;
21
- icon?: ReactNode;
22
- }
23
- //#endregion
24
- //#region src/components/form/ControlNumber.d.ts
25
- interface ControlNumberProps extends GenericControlProps {
26
- numberInputProps?: Partial<NumberInputProps>;
27
- sliderProps?: Partial<SliderProps>;
28
- }
29
- //#endregion
30
- //#region src/components/form/ControlSelect.d.ts
31
- type SelectValueLabel = string | {
32
- value: string;
33
- label: string;
34
- icon?: string;
35
- };
36
- interface ControlSelectProps extends GenericControlProps {
37
- select?: boolean | SelectProps;
38
- multi?: boolean | MultiSelectProps;
39
- tags?: boolean | TagsInputProps;
40
- autocomplete?: boolean | AutocompleteProps;
41
- segmented?: boolean | Partial<SegmentedControlProps>;
42
- loader?: () => Promise<SelectValueLabel[]>;
43
- }
44
- /**
45
- * ControlSelect component for handling Select, MultiSelect, and TagsInput.
46
- *
47
- * Features:
48
- * - Basic Select with enum support
49
- * - MultiSelect for array of enums
50
- * - TagsInput for array of strings (no enum)
51
- * - Future: Lazy loading
52
- * - Future: Searchable/filterable options
53
- * - Future: Custom option rendering
54
- *
55
- * Automatically detects enum values and array types from schema.
56
- */
57
- declare const ControlSelect: (props: ControlSelectProps) => react_jsx_runtime6.JSX.Element | null;
58
- //#endregion
59
- //#region src/components/form/Control.d.ts
60
- interface ControlProps extends GenericControlProps {
61
- text?: TextInputProps;
62
- area?: boolean | TextareaProps;
63
- select?: boolean | Partial<ControlSelectProps>;
64
- password?: boolean | PasswordInputProps;
65
- switch?: boolean | SwitchProps;
66
- number?: boolean | Partial<ControlNumberProps>;
67
- file?: boolean | FileInputProps;
68
- color?: boolean | ColorInputProps;
69
- date?: boolean | DateInputProps;
70
- datetime?: boolean | DateTimePickerProps;
71
- time?: boolean | TimeInputProps;
72
- query?: any;
73
- custom?: ComponentType<CustomControlProps>;
74
- }
75
- /**
76
- * Generic form control that renders the appropriate input based on the schema and props.
77
- *
78
- * Supports:
79
- * - TextInput (with format detection: email, url, tel)
80
- * - Textarea
81
- * - NumberInput (for number/integer types)
82
- * - FileInput
83
- * - ColorInput (for color format)
84
- * - Select (for enum types)
85
- * - Autocomplete
86
- * - PasswordInput
87
- * - Switch (for boolean types)
88
- * - SegmentedControl (for enum types)
89
- * - DateInput (for date format)
90
- * - DateTimePicker (for date-time format)
91
- * - TimeInput (for time format)
92
- * - QueryBuilder (for building type-safe queries with autocomplete)
93
- * - Custom component
94
- *
95
- * Automatically handles labels, descriptions, error messages, required state, and default icons.
96
- */
97
- declare const Control: (_props: ControlProps) => react_jsx_runtime6.JSX.Element | null;
98
- type CustomControlProps = {
99
- defaultValue: any;
100
- onChange: (value: any) => void;
101
- };
102
- //#endregion
103
- //#region src/components/buttons/ActionButton.d.ts
104
- interface ActionMenuItem {
105
- /**
106
- * Menu item type
107
- */
108
- type?: "item" | "divider" | "label";
109
- /**
110
- * Label text for the menu item
111
- */
112
- label?: string | ReactNode;
113
- /**
114
- * Icon element to display before the label
115
- */
116
- icon?: ReactNode;
117
- /**
118
- * Click handler for menu items
119
- */
120
- onClick?: () => void;
121
- /**
122
- * Href for navigation menu items
123
- */
124
- href?: string;
125
- /**
126
- * Color for the menu item (e.g., "red" for danger actions)
127
- */
128
- color?: string;
129
- /**
130
- * Nested submenu items
131
- */
132
- children?: ActionMenuItem[];
133
- /**
134
- * Whether the menu item is active
135
- */
136
- active?: boolean;
137
- }
138
- interface ActionMenuConfig {
139
- /**
140
- * Array of menu items to display
141
- */
142
- items: ActionMenuItem[];
143
- /**
144
- * Menu position relative to the button
145
- */
146
- position?: "bottom" | "bottom-start" | "bottom-end" | "top" | "top-start" | "top-end" | "left" | "right";
147
- /**
148
- * Menu width
149
- */
150
- width?: number | string;
151
- /**
152
- * Menu shadow
153
- */
154
- shadow?: "xs" | "sm" | "md" | "lg" | "xl";
155
- on?: "hover" | "click";
156
- targetProps?: MenuTargetProps;
157
- menuProps?: MenuProps;
158
- }
159
- interface ActionCommonProps extends ButtonProps {
160
- children?: ReactNode;
161
- textVisibleFrom?: "xs" | "sm" | "md" | "lg" | "xl";
162
- /**
163
- * Tooltip to display on hover. Can be a string for simple tooltips
164
- * or a TooltipProps object for advanced configuration.
165
- */
166
- tooltip?: string | TooltipProps;
167
- /**
168
- * Menu configuration. When provided, the action will display a dropdown menu.
169
- */
170
- menu?: ActionMenuConfig;
171
- /**
172
- * If set, a confirmation dialog will be shown before performing the action.
173
- * If `true`, a default title and message will be used.
174
- * If a string, it will be used as the message with a default title.
175
- * If an object, it can contain `title` and `message` properties to customize the dialog.
176
- */
177
- confirm?: boolean | string | {
178
- title?: string;
179
- message: string;
180
- };
181
- /**
182
- * Icon to display on the left side of the button.
183
- * If no children are provided, the button will be styled as an icon-only button.
184
- */
185
- icon?: ReactNode;
186
- /**
187
- * Additional props to pass to the ThemeIcon wrapping the icon.
188
- */
189
- themeIconProps?: ThemeIconProps;
190
- }
191
- type ActionProps = ActionCommonProps & (ActionNavigationButtonProps | ActionClickButtonProps | ActionSubmitButtonProps | ActionHookButtonProps | {});
192
- declare const ActionButton: (_props: ActionProps) => react_jsx_runtime6.JSX.Element;
193
- interface ActionSubmitButtonProps extends ButtonProps {
194
- form: FormModel<any>;
195
- type?: "submit" | "reset";
196
- }
197
- interface ActionHookButtonProps extends ButtonProps {
198
- action: UseActionReturn<any[], any>;
199
- }
200
- interface ActionClickButtonProps extends ButtonProps {
201
- onClick: (e: any) => any;
202
- }
203
- interface ActionNavigationButtonProps extends ButtonProps {
204
- href: string;
205
- active?: Partial<UseActiveOptions> | false;
206
- routerGoOptions?: RouterGoOptions;
207
- classNameActive?: string;
208
- variantActive?: ButtonProps["variant"];
209
- target?: string;
210
- }
211
- //#endregion
212
- //#region src/components/buttons/BurgerButton.d.ts
213
- interface BurgerButtonProps extends BurgerProps {}
214
- declare const BurgerButton: (props: BurgerButtonProps) => react_jsx_runtime6.JSX.Element;
215
- //#endregion
216
- //#region src/components/buttons/DarkModeButton.d.ts
217
- interface DarkModeButtonProps {
218
- mode?: "minimal" | "segmented";
219
- size?: MantineBreakpoint;
220
- variant?: "filled" | "light" | "outline" | "default" | "subtle" | "transparent";
221
- fullWidth?: boolean;
222
- segmentedProps?: Partial<SegmentedControlProps>;
223
- actionProps?: Partial<ActionProps>;
224
- }
225
- declare const DarkModeButton: (props: DarkModeButtonProps) => react_jsx_runtime6.JSX.Element;
226
- //#endregion
227
- //#region src/components/buttons/OmnibarButton.d.ts
228
- interface OmnibarButtonProps {
229
- actionProps?: ActionProps;
230
- collapsed?: boolean;
231
- }
232
- declare const OmnibarButton: (props: OmnibarButtonProps) => react_jsx_runtime6.JSX.Element;
233
- //#endregion
234
- //#region src/components/data/JsonViewer.d.ts
235
- interface JsonViewerProps {
236
- data: any;
237
- defaultExpanded?: boolean;
238
- maxDepth?: number;
239
- copyable?: boolean;
240
- size?: MantineSize;
241
- }
242
- declare const JsonViewer: ({
243
- data,
244
- defaultExpanded,
245
- maxDepth,
246
- copyable,
247
- size
248
- }: JsonViewerProps) => react_jsx_runtime6.JSX.Element;
249
- //#endregion
250
- //#region src/services/DialogService.d.ts
251
- interface BaseDialogOptions extends Partial<ModalProps> {
252
- title?: ReactNode;
253
- message?: ReactNode;
254
- content?: any;
255
- }
256
- interface AlertDialogOptions extends BaseDialogOptions {
257
- okLabel?: string;
258
- }
259
- interface ConfirmDialogOptions extends BaseDialogOptions {
260
- confirmLabel?: string;
261
- cancelLabel?: string;
262
- confirmColor?: string;
263
- }
264
- interface PromptDialogOptions extends BaseDialogOptions {
265
- placeholder?: string;
266
- defaultValue?: string;
267
- label?: string;
268
- required?: boolean;
269
- submitLabel?: string;
270
- cancelLabel?: string;
271
- }
272
- interface AlertDialogProps {
273
- options?: AlertDialogOptions;
274
- onClose: () => void;
275
- }
276
- interface ConfirmDialogProps {
277
- options?: ConfirmDialogOptions;
278
- onConfirm: (confirmed: boolean) => void;
279
- }
280
- interface PromptDialogProps {
281
- options?: PromptDialogOptions;
282
- onSubmit: (value: string | null) => void;
283
- }
284
- interface DialogServiceOptions {
285
- default?: Partial<BaseDialogOptions>;
286
- }
287
- declare class DialogService {
288
- readonly options: DialogServiceOptions;
289
- /**
290
- * Show an alert dialog with a message
291
- */
292
- alert(options?: AlertDialogOptions): Promise<void>;
293
- /**
294
- * Show a confirmation dialog that returns a promise
295
- */
296
- confirm(options?: ConfirmDialogOptions): Promise<boolean>;
297
- /**
298
- * Show a prompt dialog to get user input
299
- */
300
- prompt(options?: PromptDialogOptions): Promise<string | null>;
301
- /**
302
- * Open a custom dialog with provided content
303
- */
304
- open(options?: BaseDialogOptions): string;
305
- /**
306
- * Close the currently open dialog or a specific dialog by ID
307
- */
308
- close(modalId?: string): void;
309
- /**
310
- * Show a JSON editor/viewer dialog
311
- */
312
- json(data?: any, options?: BaseDialogOptions): void;
313
- /**
314
- * Show a form dialog for structured input
315
- */
316
- form(options?: BaseDialogOptions): Promise<any>;
317
- /**
318
- * Show a loading/progress dialog with optional progress percentage
319
- */
320
- loading(options?: BaseDialogOptions & {
321
- progress?: number;
322
- }): void;
323
- /**
324
- * Show an image viewer/gallery dialog
325
- */
326
- image(src: string | string[], options?: BaseDialogOptions): void;
327
- }
328
- //#endregion
329
- //#region src/components/dialogs/AlertDialog.d.ts
330
- declare const AlertDialog: ({
331
- options,
332
- onClose
333
- }: AlertDialogProps) => react_jsx_runtime6.JSX.Element;
334
- //#endregion
335
- //#region src/components/dialogs/ConfirmDialog.d.ts
336
- declare const ConfirmDialog: ({
337
- options,
338
- onConfirm
339
- }: ConfirmDialogProps) => react_jsx_runtime6.JSX.Element;
340
- //#endregion
341
- //#region src/components/dialogs/PromptDialog.d.ts
342
- declare const PromptDialog: ({
343
- options,
344
- onSubmit
345
- }: PromptDialogProps) => react_jsx_runtime6.JSX.Element;
346
- //#endregion
347
- //#region src/components/form/ControlDate.d.ts
348
- interface ControlDateProps extends GenericControlProps {
349
- date?: boolean | DateInputProps;
350
- datetime?: boolean | DateTimePickerProps;
351
- time?: boolean | TimeInputProps;
352
- }
353
- /**
354
- * ControlDate component for handling date, datetime, and time inputs.
355
- *
356
- * Features:
357
- * - DateInput for date format
358
- * - DateTimePicker for date-time format
359
- * - TimeInput for time format
360
- *
361
- * Automatically detects date formats from schema and renders appropriate picker.
362
- */
363
- declare const ControlDate: (props: ControlDateProps) => react_jsx_runtime6.JSX.Element | null;
364
- //#endregion
365
- //#region src/components/form/ControlQueryBuilder.d.ts
366
- interface ControlQueryBuilderProps extends Omit<TextInputProps, "value" | "onChange"> {
367
- schema?: TObject;
368
- value?: string;
369
- onChange?: (value: string) => void;
370
- placeholder?: string;
371
- }
372
- /**
373
- * Query builder with text input and help popover.
374
- * Generates query strings for parseQueryString syntax.
375
- */
376
- declare const ControlQueryBuilder: ({
377
- schema,
378
- value,
379
- onChange,
380
- placeholder,
381
- ...textInputProps
382
- }: ControlQueryBuilderProps) => react_jsx_runtime6.JSX.Element;
383
- //#endregion
384
- //#region src/components/form/TypeForm.d.ts
385
- interface TypeFormProps<T extends TObject> {
386
- form: FormModel<T>;
387
- columns?: number | {
388
- base?: number;
389
- xs?: number;
390
- sm?: number;
391
- md?: number;
392
- lg?: number;
393
- xl?: number;
394
- };
395
- schema?: TObject;
396
- children?: (input: FormModel<T>["input"]) => ReactNode;
397
- controlProps?: Partial<Omit<ControlProps, "input">>;
398
- skipFormElement?: boolean;
399
- skipSubmitButton?: boolean;
400
- submitButtonProps?: Partial<Omit<ActionSubmitButtonProps, "form">>;
401
- resetButtonProps?: Partial<Omit<ActionSubmitButtonProps, "form">>;
402
- }
403
- /**
404
- * TypeForm component that automatically renders all form inputs based on schema.
405
- * Uses the Control component to render individual fields and Mantine Grid for responsive layout.
406
- *
407
- * @example
408
- * ```tsx
409
- * import { t } from "alepha";
410
- * import { useForm } from "@alepha/react/form";
411
- * import { TypeForm } from "@alepha/ui";
412
- *
413
- * const form = useForm({
414
- * schema: t.object({
415
- * username: t.text(),
416
- * email: t.text(),
417
- * age: t.integer(),
418
- * subscribe: t.boolean(),
419
- * }),
420
- * handler: (values) => {
421
- * console.log(values);
422
- * },
423
- * });
424
- *
425
- * return <TypeForm form={form} columns={2} />;
426
- * ```
427
- */
428
- declare const TypeForm: <T extends TObject>(props: TypeFormProps<T>) => react_jsx_runtime6.JSX.Element | null;
429
- //#endregion
430
- //#region src/components/buttons/LanguageButton.d.ts
431
- interface LanguageButtonProps {
432
- languages?: string[];
433
- actionProps?: ActionProps;
434
- }
435
- //#endregion
436
- //#region src/components/layout/AppBar.d.ts
437
- type AppBarItem = AppBarElement | AppBarBurger | AppBarDark | AppBarSearch | AppBarLang | AppBarSpacer | AppBarDivider;
438
- interface AppBarElement {
439
- position: "left" | "center" | "right";
440
- element: ReactNode;
441
- }
442
- interface AppBarBurger {
443
- position: "left" | "center" | "right";
444
- type: "burger";
445
- }
446
- interface AppBarDark {
447
- position: "left" | "center" | "right";
448
- type: "dark";
449
- props?: DarkModeButtonProps;
450
- }
451
- interface AppBarSearch {
452
- position: "left" | "center" | "right";
453
- type: "search";
454
- props?: OmnibarButtonProps;
455
- }
456
- interface AppBarLang {
457
- position: "left" | "center" | "right";
458
- type: "lang";
459
- props?: LanguageButtonProps;
460
- }
461
- interface AppBarSpacer {
462
- position: "left" | "center" | "right";
463
- type: "spacer";
464
- }
465
- interface AppBarDivider {
466
- position: "left" | "center" | "right";
467
- type: "divider";
468
- }
469
- interface AppBarProps {
470
- flexProps?: FlexProps;
471
- items?: AppBarItem[];
472
- }
473
- declare const AppBar: (props: AppBarProps) => react_jsx_runtime6.JSX.Element;
474
- //#endregion
475
- //#region src/components/layout/Sidebar.d.ts
476
- interface SidebarProps {
477
- menu?: SidebarNode[];
478
- top?: SidebarNode[];
479
- bottom?: SidebarNode[];
480
- onItemClick?: (item: SidebarMenuItem) => void;
481
- onSearchClick?: () => void;
482
- theme?: SidebarTheme;
483
- flexProps?: Partial<FlexProps>;
484
- collapsed?: boolean;
485
- gap?: MantineBreakpoint;
486
- }
487
- declare const Sidebar: (props: SidebarProps) => react_jsx_runtime6.JSX.Element;
488
- interface SidebarItemProps {
489
- item: SidebarMenuItem;
490
- level: number;
491
- onItemClick?: (item: SidebarMenuItem) => void;
492
- theme: SidebarTheme;
493
- }
494
- interface SidebarItemProps {
495
- item: SidebarMenuItem;
496
- level: number;
497
- onItemClick?: (item: SidebarMenuItem) => void;
498
- theme: SidebarTheme;
499
- }
500
- type SidebarNode = SidebarMenuItem | SidebarSpacer | SidebarDivider | SidebarSearch | SidebarElement | SidebarSection;
501
- interface SidebarAbstractItem {
502
- position?: "top" | "bottom";
503
- }
504
- interface SidebarElement extends SidebarAbstractItem {
505
- element: ReactNode;
506
- }
507
- interface SidebarSpacer extends SidebarAbstractItem {
508
- type: "spacer";
509
- }
510
- interface SidebarDivider extends SidebarAbstractItem {
511
- type: "divider";
512
- }
513
- interface SidebarSearch extends SidebarAbstractItem {
514
- type: "search";
515
- }
516
- interface SidebarSection extends SidebarAbstractItem {
517
- type: "section";
518
- label: string;
519
- icon?: ReactNode;
520
- }
521
- interface SidebarMenuItem extends SidebarAbstractItem {
522
- label: string | ReactNode;
523
- description?: string;
524
- icon?: ReactNode;
525
- href?: string;
526
- target?: "_blank" | "_self" | "_parent" | "_top";
527
- activeStartsWith?: boolean;
528
- onClick?: () => void;
529
- children?: SidebarMenuItem[];
530
- rightSection?: ReactNode;
531
- theme?: SidebarButtonTheme;
532
- actionProps?: ActionProps;
533
- }
534
- interface SidebarButtonTheme {
535
- radius?: MantineBreakpoint;
536
- size?: MantineBreakpoint;
537
- }
538
- interface SidebarTheme {
539
- button?: SidebarButtonTheme;
540
- search?: SidebarButtonTheme;
541
- }
542
- //#endregion
543
- //#region src/components/layout/AdminShell.d.ts
544
- interface AdminShellProps {
545
- appShellProps?: Partial<AppShellProps>;
546
- appShellMainProps?: Partial<AppShellMainProps>;
547
- appShellHeaderProps?: Partial<AppShellHeaderProps>;
548
- appShellNavbarProps?: Partial<AppShellNavbarProps>;
549
- appShellFooterProps?: Partial<AppShellFooterProps>;
550
- sidebarProps?: Partial<SidebarProps>;
551
- appBarProps?: Partial<AppBarProps>;
552
- header?: ReactNode;
553
- footer?: ReactNode;
554
- children?: ReactNode;
555
- }
556
- declare module "alepha" {
557
- interface State {
558
- /**
559
- * Whether the sidebar is opened or closed.
560
- */
561
- "alepha.ui.sidebar.opened"?: boolean;
562
- /**
563
- * Whether the sidebar is collapsed (narrow) or expanded (wide).
564
- */
565
- "alepha.ui.sidebar.collapsed"?: boolean;
566
- }
567
- }
568
- declare const AdminShell: (props: AdminShellProps) => react_jsx_runtime6.JSX.Element;
569
- //#endregion
570
- //#region src/components/layout/Omnibar.d.ts
571
- interface OmnibarProps {
572
- shortcut?: string | string[];
573
- searchPlaceholder?: string;
574
- nothingFound?: ReactNode;
575
- }
576
- declare const Omnibar: (props: OmnibarProps) => react_jsx_runtime6.JSX.Element;
577
- //#endregion
578
- //#region src/components/layout/AlephaMantineProvider.d.ts
579
- interface AlephaMantineProviderProps {
580
- children?: ReactNode;
581
- mantine?: MantineProviderProps;
582
- colorSchemeScript?: ColorSchemeScriptProps;
583
- navigationProgress?: NavigationProgressProps;
584
- notifications?: NotificationsProps;
585
- modals?: ModalsProviderProps;
586
- omnibar?: OmnibarProps;
587
- }
588
- declare const AlephaMantineProvider: (props: AlephaMantineProviderProps) => react_jsx_runtime6.JSX.Element;
589
- //#endregion
590
- //#region src/components/table/DataTable.d.ts
591
- interface DataTableColumnContext<Filters extends TObject> {
592
- index: number;
593
- form: FormModel<Filters>;
594
- alepha: Alepha;
595
- }
596
- interface DataTableColumn<T extends object, Filters extends TObject> {
597
- label: string;
598
- value: (item: T, ctx: DataTableColumnContext<Filters>) => ReactNode;
599
- fit?: boolean;
600
- }
601
- type MaybePage<T> = Omit<Page<T>, "page"> & {
602
- page?: Partial<PageMetadata>;
603
- };
604
- interface DataTableSubmitContext<T extends object> {
605
- items: T[];
606
- }
607
- interface DataTableProps<T extends object, Filters extends TObject> {
608
- /**
609
- * The items to display in the table. Can be a static page of items or a function that returns a promise resolving to a page of items.
610
- */
611
- items: MaybePage<T> | ((filters: Static<Filters> & {
612
- page: number;
613
- size: number;
614
- sort?: string;
615
- }, ctx: DataTableSubmitContext<T>) => Async<MaybePage<T>>);
616
- /**
617
- * The columns to display in the table. Each column is defined by a key and a DataTableColumn object.
618
- */
619
- columns: {
620
- [key: string]: DataTableColumn<T, Filters>;
621
- };
622
- defaultSize?: number;
623
- typeFormProps?: Partial<Omit<TypeFormProps<Filters>, "form">>;
624
- onFilterChange?: (key: string, value: unknown, form: FormModel<Filters>) => void;
625
- /**
626
- * Optional filters to apply to the data.
627
- */
628
- filters?: TObject;
629
- panel?: (item: T) => ReactNode;
630
- canPanel?: (item: T) => boolean;
631
- submitOnInit?: boolean;
632
- submitEvery?: DurationLike;
633
- withLineNumbers?: boolean;
634
- withCheckbox?: boolean;
635
- checkboxActions?: any[];
636
- actions?: any[];
637
- /**
638
- * Enable infinity scroll mode. When true, pagination controls are hidden and new items are loaded automatically when scrolling to the bottom.
639
- */
640
- infinityScroll?: boolean;
641
- /**
642
- * Props to pass to the Mantine Table component.
643
- */
644
- tableProps?: TableProps;
645
- /**
646
- * Function to generate props for each table row based on the item.
647
- */
648
- tableTrProps?: (item: T) => TableTrProps;
649
- }
650
- declare const DataTable: <T extends object, Filters extends TObject>(props: DataTableProps<T, Filters>) => react_jsx_runtime6.JSX.Element;
651
- //#endregion
652
- //#region src/constants/ui.d.ts
653
- declare const ui: {
654
- colors: {
655
- transparent: string;
656
- background: string;
657
- surface: string;
658
- elevated: string;
659
- border: string;
660
- };
661
- };
662
- //#endregion
663
- //#region src/hooks/useDialog.d.ts
664
- /**
665
- * Use this hook to access the Dialog Service for showing various dialog types.
666
- *
667
- * @example
668
- * ```tsx
669
- * const dialog = useDialog();
670
- * await dialog.alert({ title: "Alert", message: "This is an alert message" });
671
- * const confirmed = await dialog.confirm({ title: "Confirm", message: "Are you sure?" });
672
- * const input = await dialog.prompt({ title: "Input", message: "Enter your name:" });
673
- * ```
674
- */
675
- declare const useDialog: () => DialogService;
676
- //#endregion
677
- //#region src/services/ToastService.d.ts
678
- interface ToastServiceOptions {
679
- default?: Partial<NotificationData>;
680
- }
681
- declare class ToastService {
682
- protected readonly raw: {
683
- readonly show: typeof _mantine_notifications0.showNotification;
684
- readonly hide: typeof _mantine_notifications0.hideNotification;
685
- readonly update: typeof _mantine_notifications0.updateNotification;
686
- readonly clean: typeof _mantine_notifications0.cleanNotifications;
687
- readonly cleanQueue: typeof _mantine_notifications0.cleanNotificationsQueue;
688
- readonly updateState: typeof _mantine_notifications0.updateNotificationsState;
689
- };
690
- readonly options: ToastServiceOptions;
691
- show(options: NotificationData): void;
692
- info(options: Partial<NotificationData> | string): void;
693
- success(options: Partial<NotificationData> | string): void;
694
- warning(options: Partial<NotificationData> | string): void;
695
- danger(options: Partial<NotificationData> | string): void;
696
- }
697
- //#endregion
698
- //#region src/hooks/useToast.d.ts
699
- /**
700
- * Use this hook to access the Toast Service for showing notifications.
701
- *
702
- * @example
703
- * ```tsx
704
- * const toast = useToast();
705
- * toast.success({ message: "Operation completed successfully!" });
706
- * toast.error({ title: "Error", message: "Something went wrong" });
707
- * ```
708
- */
709
- declare const useToast: () => ToastService;
710
- //#endregion
711
- //#region src/RootRouter.d.ts
712
- declare class RootRouter {
713
- readonly root: _alepha_react0.PageDescriptor<_alepha_react0.PageConfigSchema, any, _alepha_react0.TPropsParentDefault>;
714
- }
715
- //#endregion
716
- //#region src/utils/extractSchemaFields.d.ts
717
- interface SchemaField {
718
- name: string;
719
- path: string;
720
- type: string;
721
- enum?: readonly any[];
722
- format?: string;
723
- description?: string;
724
- nested?: SchemaField[];
725
- }
726
- /**
727
- * Extract field information from a TypeBox schema for query building.
728
- * Supports nested objects and provides field metadata for autocomplete.
729
- */
730
- declare function extractSchemaFields(schema: TObject | TProperties, prefix?: string): SchemaField[];
731
- /**
732
- * Get suggested operators based on field type
733
- */
734
- declare function getOperatorsForField(field: SchemaField): string[];
735
- /**
736
- * Get operator symbol and description
737
- */
738
- declare const OPERATOR_INFO: Record<string, {
739
- symbol: string;
740
- label: string;
741
- example: string;
742
- }>;
743
- //#endregion
744
- //#region src/utils/icons.d.ts
745
- /**
746
- * Icon size presets following Mantine's size conventions
747
- */
748
- declare const ICON_SIZES: {
749
- readonly xs: 12;
750
- readonly sm: 16;
751
- readonly md: 20;
752
- readonly lg: 24;
753
- readonly xl: 28;
754
- };
755
- type IconSize = keyof typeof ICON_SIZES;
756
- /**
757
- * Get the default icon for an input based on its type, format, or name.
758
- */
759
- declare const getDefaultIcon: (params: {
760
- type?: string;
761
- format?: string;
762
- name?: string;
763
- isEnum?: boolean;
764
- isArray?: boolean;
765
- size?: IconSize;
766
- }) => ReactNode;
767
- //#endregion
768
- //#region src/utils/string.d.ts
769
- /**
770
- * Capitalizes the first letter of a string.
771
- *
772
- * @example
773
- * capitalize("hello") // "Hello"
774
- */
775
- declare const capitalize: (str: string) => string;
776
- /**
777
- * Converts a path or identifier string into a pretty display name.
778
- * Removes slashes and capitalizes the first letter.
779
- *
780
- * @example
781
- * prettyName("/userName") // "UserName"
782
- * prettyName("email") // "Email"
783
- */
784
- declare const prettyName: (name: string) => string;
785
- //#endregion
786
- //#region src/index.d.ts
787
- declare module "typebox" {
788
- interface TSchemaOptions {
789
- $control?: Omit<ControlProps, "input">;
790
- }
791
- }
792
- declare module "@alepha/react" {
793
- interface PageDescriptorOptions {
794
- /**
795
- * Human-readable title for the page.
796
- * - for Sidebar navigation
797
- * - for Omnibar navigation
798
- * (soon)
799
- * - for Breadcrumbs
800
- * - for document title (with AlephaReactHead)
801
- */
802
- label?: string;
803
- /**
804
- * Optional description of the page.
805
- */
806
- description?: string;
807
- /**
808
- * Optional icon for the page.
809
- */
810
- icon?: ReactNode;
811
- }
812
- }
813
- /**
814
- * Mantine
815
- *
816
- * @module alepha.ui
817
- */
818
- declare const AlephaUI: alepha0.Service<alepha0.Module>;
819
- //#endregion
820
- export { ActionButton, type ActionClickButtonProps, type ActionCommonProps, type ActionMenuConfig, type ActionMenuItem, type ActionNavigationButtonProps, type ActionProps, type ActionSubmitButtonProps, AdminShell, type AdminShellProps, AlephaMantineProvider, AlephaUI, AlertDialog, type AlertDialogOptions, type AlertDialogProps, AppBar, type AppBarBurger, type AppBarDark, type AppBarDivider, type AppBarElement, type AppBarItem, type AppBarLang, type AppBarProps, type AppBarSearch, type AppBarSpacer, type BaseDialogOptions, BurgerButton, ConfirmDialog, type ConfirmDialogOptions, type ConfirmDialogProps, Control, ControlDate, ControlQueryBuilder, ControlSelect, DarkModeButton, DataTable, type DataTableColumn, type DataTableProps, DialogService, Flex, ICON_SIZES, IconSize, JsonViewer, OPERATOR_INFO, Omnibar, OmnibarButton, PromptDialog, type PromptDialogOptions, type PromptDialogProps, RootRouter, SchemaField, Sidebar, type SidebarAbstractItem, type SidebarButtonTheme, type SidebarDivider, type SidebarElement, type SidebarItemProps, type SidebarMenuItem, type SidebarNode, type SidebarProps, type SidebarSearch, type SidebarSection, type SidebarSpacer, type SidebarTheme, Text, ToastService, TypeForm, capitalize, extractSchemaFields, getDefaultIcon, getOperatorsForField, prettyName, ui, useDialog, useToast };
821
- //# sourceMappingURL=index.d.ts.map