@omnitron-dev/prism 0.1.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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/bin/prism.js +13 -0
  4. package/dist/accessibility/index.d.ts +157 -0
  5. package/dist/accessibility/index.js +186 -0
  6. package/dist/accessibility/index.js.map +1 -0
  7. package/dist/blocks/index.d.ts +1239 -0
  8. package/dist/blocks/index.js +1712 -0
  9. package/dist/blocks/index.js.map +1 -0
  10. package/dist/chunk-77KIJLPP.js +37 -0
  11. package/dist/chunk-77KIJLPP.js.map +1 -0
  12. package/dist/chunk-BTIT7WYH.js +339 -0
  13. package/dist/chunk-BTIT7WYH.js.map +1 -0
  14. package/dist/chunk-BV32OJ2A.js +1409 -0
  15. package/dist/chunk-BV32OJ2A.js.map +1 -0
  16. package/dist/chunk-DDY7TLUI.js +139 -0
  17. package/dist/chunk-DDY7TLUI.js.map +1 -0
  18. package/dist/chunk-DXXZ3ITR.js +4227 -0
  19. package/dist/chunk-DXXZ3ITR.js.map +1 -0
  20. package/dist/chunk-E3XANPTO.js +2319 -0
  21. package/dist/chunk-E3XANPTO.js.map +1 -0
  22. package/dist/chunk-FU52GL2E.js +3 -0
  23. package/dist/chunk-FU52GL2E.js.map +1 -0
  24. package/dist/chunk-GYDT5EKX.js +16505 -0
  25. package/dist/chunk-GYDT5EKX.js.map +1 -0
  26. package/dist/chunk-HO2GKTWJ.js +28 -0
  27. package/dist/chunk-HO2GKTWJ.js.map +1 -0
  28. package/dist/chunk-JDTC2SBY.js +140 -0
  29. package/dist/chunk-JDTC2SBY.js.map +1 -0
  30. package/dist/chunk-JNU4QHJK.js +6 -0
  31. package/dist/chunk-JNU4QHJK.js.map +1 -0
  32. package/dist/chunk-LAEY5USO.js +2621 -0
  33. package/dist/chunk-LAEY5USO.js.map +1 -0
  34. package/dist/chunk-UR6X3W5I.js +530 -0
  35. package/dist/chunk-UR6X3W5I.js.map +1 -0
  36. package/dist/chunk-WC2WM2JD.js +883 -0
  37. package/dist/chunk-WC2WM2JD.js.map +1 -0
  38. package/dist/chunk-XWL6J6IO.js +40 -0
  39. package/dist/chunk-XWL6J6IO.js.map +1 -0
  40. package/dist/cli/index.js +2695 -0
  41. package/dist/cli/index.js.map +1 -0
  42. package/dist/config-BA6IeTq9.d.ts +100 -0
  43. package/dist/core/index.d.ts +454 -0
  44. package/dist/core/index.js +9 -0
  45. package/dist/core/index.js.map +1 -0
  46. package/dist/forms/index.d.ts +562 -0
  47. package/dist/forms/index.js +545 -0
  48. package/dist/forms/index.js.map +1 -0
  49. package/dist/hooks/index.d.ts +7 -0
  50. package/dist/hooks/index.js +10 -0
  51. package/dist/hooks/index.js.map +1 -0
  52. package/dist/http/index.d.ts +233 -0
  53. package/dist/http/index.js +282 -0
  54. package/dist/http/index.js.map +1 -0
  55. package/dist/index-odhPSv9I.d.ts +2491 -0
  56. package/dist/index.css +131 -0
  57. package/dist/index.css.map +1 -0
  58. package/dist/index.d.ts +9109 -0
  59. package/dist/index.js +13280 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/layouts/index.d.ts +854 -0
  62. package/dist/layouts/index.js +6 -0
  63. package/dist/layouts/index.js.map +1 -0
  64. package/dist/netron/index.d.ts +4 -0
  65. package/dist/netron/index.js +4 -0
  66. package/dist/netron/index.js.map +1 -0
  67. package/dist/registry/index.d.ts +352 -0
  68. package/dist/registry/index.js +4 -0
  69. package/dist/registry/index.js.map +1 -0
  70. package/dist/registry-BrDNftd5.d.ts +574 -0
  71. package/dist/settings-plpR26Xk.d.ts +455 -0
  72. package/dist/state/index.d.ts +981 -0
  73. package/dist/state/index.js +5 -0
  74. package/dist/state/index.js.map +1 -0
  75. package/dist/theme/index.d.ts +1049 -0
  76. package/dist/theme/index.js +5 -0
  77. package/dist/theme/index.js.map +1 -0
  78. package/dist/theme-CrXLfP1c.d.ts +389 -0
  79. package/dist/types/index.d.ts +146 -0
  80. package/dist/types/index.js +5 -0
  81. package/dist/types/index.js.map +1 -0
  82. package/dist/use-timeout-D7U3EAtH.d.ts +808 -0
  83. package/package.json +194 -0
@@ -0,0 +1,574 @@
1
+ import { ReactNode } from 'react';
2
+ import { d as ThemePresetDefinition } from './theme-CrXLfP1c.js';
3
+
4
+ /**
5
+ * Block Type Definitions
6
+ *
7
+ * @module @omnitron-dev/prism/types/blocks
8
+ */
9
+
10
+ /**
11
+ * Block categories.
12
+ */
13
+ type BlockCategory = 'layouts' | 'auth' | 'data' | 'forms' | 'communication' | 'productivity' | 'marketing' | 'settings';
14
+ /**
15
+ * Block file type.
16
+ */
17
+ type BlockFileType = 'component' | 'hook' | 'type' | 'schema' | 'util' | 'barrel' | 'style' | 'test';
18
+ /**
19
+ * Block file definition.
20
+ */
21
+ interface BlockFile {
22
+ /** File path relative to block root */
23
+ path: string;
24
+ /** File type */
25
+ type: BlockFileType;
26
+ /** Optional description */
27
+ description?: string;
28
+ }
29
+ /**
30
+ * Block dependencies.
31
+ */
32
+ interface BlockDependencies {
33
+ /** npm package dependencies */
34
+ npm: string[];
35
+ /** Other Prism blocks */
36
+ blocks: string[];
37
+ /** Prism components */
38
+ components: string[];
39
+ }
40
+ /**
41
+ * Block configuration.
42
+ */
43
+ interface BlockConfig {
44
+ /** Block-specific configuration options */
45
+ [key: string]: unknown;
46
+ }
47
+ /**
48
+ * Block definition.
49
+ */
50
+ interface BlockDefinition {
51
+ /** Block name */
52
+ name: string;
53
+ /** Block version */
54
+ version: string;
55
+ /** Block category */
56
+ category: BlockCategory;
57
+ /** Display name */
58
+ displayName: string;
59
+ /** Description */
60
+ description: string;
61
+ /** Block files */
62
+ files: BlockFile[];
63
+ /** Dependencies */
64
+ dependencies: BlockDependencies;
65
+ /** Default configuration */
66
+ defaultConfig: BlockConfig;
67
+ /** Preview image URL */
68
+ preview?: string;
69
+ /** Documentation URL */
70
+ docs?: string;
71
+ }
72
+ /**
73
+ * Dashboard navigation type.
74
+ */
75
+ type DashboardNavType = 'sidebar' | 'topbar' | 'combo';
76
+ /**
77
+ * Sidebar navigation variant.
78
+ */
79
+ type SidebarNavVariant = 'default' | 'slim' | 'stacked';
80
+ /**
81
+ * Topbar navigation variant.
82
+ */
83
+ type TopbarNavVariant = 'default' | 'slim' | 'stacked';
84
+ /**
85
+ * Block navigation item definition.
86
+ * @deprecated Use NavItem from layouts/types instead for layout components.
87
+ */
88
+ interface BlockNavItem {
89
+ /** Item ID */
90
+ id: string;
91
+ /** Display title */
92
+ title: string;
93
+ /** Navigation path */
94
+ path?: string;
95
+ /** Icon component or name */
96
+ icon?: ReactNode | string;
97
+ /** Disabled state */
98
+ disabled?: boolean;
99
+ /** Badge content */
100
+ badge?: string | number;
101
+ /** Children items */
102
+ children?: BlockNavItem[];
103
+ /** External link */
104
+ external?: boolean;
105
+ /** Required roles */
106
+ roles?: string[];
107
+ /** Required permissions */
108
+ permissions?: string[];
109
+ }
110
+ /**
111
+ * Block navigation section definition.
112
+ * @deprecated Use NavSection from layouts/types instead for layout components.
113
+ */
114
+ interface BlockNavSection {
115
+ /** Section ID */
116
+ id: string;
117
+ /** Section title */
118
+ title?: string;
119
+ /** Section items */
120
+ items: BlockNavItem[];
121
+ }
122
+ /**
123
+ * Dashboard block layout props.
124
+ * @deprecated Use DashboardLayoutProps from layouts/types instead for layout components.
125
+ */
126
+ interface DashboardBlockProps {
127
+ /** Navigation type */
128
+ navType?: DashboardNavType;
129
+ /** Sidebar variant (when navType is 'sidebar' or 'combo') */
130
+ sidebarVariant?: SidebarNavVariant;
131
+ /** Topbar variant (when navType is 'topbar' or 'combo') */
132
+ topbarVariant?: TopbarNavVariant;
133
+ /** Navigation sections */
134
+ navigation?: BlockNavSection[];
135
+ /** Logo component */
136
+ logo?: ReactNode;
137
+ /** User menu component */
138
+ userMenu?: ReactNode;
139
+ /** Notification center component */
140
+ notifications?: ReactNode;
141
+ /** Settings panel component */
142
+ settingsPanel?: ReactNode;
143
+ /** Footer component */
144
+ footer?: ReactNode;
145
+ /** Children content */
146
+ children?: ReactNode;
147
+ }
148
+ /**
149
+ * Authentication provider type.
150
+ */
151
+ type AuthProviderType = 'jwt' | 'firebase' | 'supabase' | 'auth0' | 'amplify';
152
+ /**
153
+ * Auth state.
154
+ */
155
+ interface AuthState {
156
+ /** Whether user is authenticated */
157
+ isAuthenticated: boolean;
158
+ /** Whether auth is loading */
159
+ isLoading: boolean;
160
+ /** Current user */
161
+ user: AuthUser | null;
162
+ /** Auth error */
163
+ error: Error | null;
164
+ }
165
+ /**
166
+ * Authenticated user.
167
+ */
168
+ interface AuthUser {
169
+ /** User ID */
170
+ id: string;
171
+ /** Email */
172
+ email: string;
173
+ /** Display name */
174
+ displayName?: string;
175
+ /** Avatar URL */
176
+ avatarUrl?: string;
177
+ /** User roles */
178
+ roles: string[];
179
+ /** User permissions */
180
+ permissions: string[];
181
+ /** Additional metadata */
182
+ metadata?: Record<string, unknown>;
183
+ }
184
+ /**
185
+ * Auth context value.
186
+ */
187
+ interface AuthContextValue extends AuthState {
188
+ /** Sign in with email/password */
189
+ signIn: (email: string, password: string) => Promise<void>;
190
+ /** Sign up with email/password */
191
+ signUp: (email: string, password: string, data?: Record<string, unknown>) => Promise<void>;
192
+ /** Sign out */
193
+ signOut: () => Promise<void>;
194
+ /** Reset password */
195
+ resetPassword: (email: string) => Promise<void>;
196
+ /** Update password */
197
+ updatePassword: (newPassword: string) => Promise<void>;
198
+ /** Update profile */
199
+ updateProfile: (data: Partial<AuthUser>) => Promise<void>;
200
+ /** Verify email */
201
+ verifyEmail: (token: string) => Promise<void>;
202
+ /** Check if user has role */
203
+ hasRole: (role: string) => boolean;
204
+ /** Check if user has permission */
205
+ hasPermission: (permission: string) => boolean;
206
+ }
207
+ /**
208
+ * Column definition for DataGrid.
209
+ */
210
+ interface GridColumn<T = unknown> {
211
+ /** Column ID/key */
212
+ field: string;
213
+ /** Header title */
214
+ headerName: string;
215
+ /** Column width */
216
+ width?: number;
217
+ /** Min width */
218
+ minWidth?: number;
219
+ /** Max width */
220
+ maxWidth?: number;
221
+ /** Flex grow */
222
+ flex?: number;
223
+ /** Sortable */
224
+ sortable?: boolean;
225
+ /** Filterable */
226
+ filterable?: boolean;
227
+ /** Editable */
228
+ editable?: boolean;
229
+ /** Hideable */
230
+ hideable?: boolean;
231
+ /** Cell renderer */
232
+ renderCell?: (params: GridCellParams<T>) => ReactNode;
233
+ /** Header renderer */
234
+ renderHeader?: (params: GridHeaderParams) => ReactNode;
235
+ /** Value formatter */
236
+ valueFormatter?: (value: unknown) => string;
237
+ /** Value getter */
238
+ valueGetter?: (row: T) => unknown;
239
+ /** Column type */
240
+ type?: 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'actions';
241
+ /** Alignment */
242
+ align?: 'left' | 'center' | 'right';
243
+ /** Header alignment */
244
+ headerAlign?: 'left' | 'center' | 'right';
245
+ }
246
+ /**
247
+ * Cell render params.
248
+ */
249
+ interface GridCellParams<T = unknown> {
250
+ /** Row data */
251
+ row: T;
252
+ /** Cell value */
253
+ value: unknown;
254
+ /** Column field */
255
+ field: string;
256
+ /** Row ID */
257
+ id: string | number;
258
+ /** Is cell focused */
259
+ hasFocus: boolean;
260
+ /** Tab index */
261
+ tabIndex: number;
262
+ }
263
+ /**
264
+ * Header render params.
265
+ */
266
+ interface GridHeaderParams {
267
+ /** Column field */
268
+ field: string;
269
+ /** Column definition */
270
+ colDef: GridColumn;
271
+ }
272
+ /**
273
+ * Grid filter model.
274
+ */
275
+ interface GridFilterModel {
276
+ items: GridFilterItem[];
277
+ quickFilterValues?: string[];
278
+ }
279
+ /**
280
+ * Grid filter item.
281
+ */
282
+ interface GridFilterItem {
283
+ field: string;
284
+ operator: string;
285
+ value?: unknown;
286
+ }
287
+ /**
288
+ * Grid sort model.
289
+ */
290
+ interface GridSortModel {
291
+ field: string;
292
+ sort: 'asc' | 'desc' | null;
293
+ }
294
+ /**
295
+ * DataGrid props.
296
+ */
297
+ interface DataGridProps<T = unknown> {
298
+ /** Row data */
299
+ rows: T[];
300
+ /** Column definitions */
301
+ columns: GridColumn<T>[];
302
+ /** Loading state */
303
+ loading?: boolean;
304
+ /** Row ID getter */
305
+ getRowId?: (row: T) => string | number;
306
+ /** Selection model */
307
+ rowSelectionModel?: (string | number)[];
308
+ /** On selection change */
309
+ onRowSelectionModelChange?: (selection: (string | number)[]) => void;
310
+ /** Checkbox selection */
311
+ checkboxSelection?: boolean;
312
+ /** Disable row selection on click */
313
+ disableRowSelectionOnClick?: boolean;
314
+ /** Page size options */
315
+ pageSizeOptions?: number[];
316
+ /** Initial page size */
317
+ initialPageSize?: number;
318
+ /** Sort model */
319
+ sortModel?: GridSortModel[];
320
+ /** On sort change */
321
+ onSortModelChange?: (model: GridSortModel[]) => void;
322
+ /** Filter model */
323
+ filterModel?: GridFilterModel;
324
+ /** On filter change */
325
+ onFilterModelChange?: (model: GridFilterModel) => void;
326
+ /** Density */
327
+ density?: 'compact' | 'standard' | 'comfortable';
328
+ /** Auto height */
329
+ autoHeight?: boolean;
330
+ /** Enable export */
331
+ enableExport?: boolean;
332
+ /** Enable column visibility */
333
+ enableColumnVisibility?: boolean;
334
+ /** Toolbar component */
335
+ toolbar?: ReactNode;
336
+ /** Empty state component */
337
+ emptyContent?: ReactNode;
338
+ }
339
+ /**
340
+ * Form field type.
341
+ */
342
+ type FormFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'multiselect' | 'autocomplete' | 'checkbox' | 'switch' | 'radio' | 'date' | 'time' | 'datetime' | 'daterange' | 'file' | 'upload' | 'editor' | 'code' | 'rating' | 'slider' | 'color';
343
+ /**
344
+ * Form field schema.
345
+ */
346
+ interface FormFieldSchema {
347
+ /** Field name */
348
+ name: string;
349
+ /** Field type */
350
+ type: FormFieldType;
351
+ /** Field label */
352
+ label?: string;
353
+ /** Placeholder */
354
+ placeholder?: string;
355
+ /** Helper text */
356
+ helperText?: string;
357
+ /** Required */
358
+ required?: boolean;
359
+ /** Disabled */
360
+ disabled?: boolean;
361
+ /** Default value */
362
+ defaultValue?: unknown;
363
+ /** Options (for select, radio, etc.) */
364
+ options?: Array<{
365
+ value: string | number;
366
+ label: string;
367
+ }>;
368
+ /** Validation rules */
369
+ validation?: {
370
+ min?: number;
371
+ max?: number;
372
+ minLength?: number;
373
+ maxLength?: number;
374
+ pattern?: string;
375
+ custom?: (value: unknown) => string | true;
376
+ };
377
+ /** Conditional visibility */
378
+ visible?: (formValues: Record<string, unknown>) => boolean;
379
+ /** Grid column span */
380
+ colSpan?: number;
381
+ }
382
+ /**
383
+ * Form section schema.
384
+ */
385
+ interface FormSectionSchema {
386
+ /** Section ID */
387
+ id: string;
388
+ /** Section title */
389
+ title?: string;
390
+ /** Section description */
391
+ description?: string;
392
+ /** Section fields */
393
+ fields: FormFieldSchema[];
394
+ /** Collapsible */
395
+ collapsible?: boolean;
396
+ /** Default collapsed */
397
+ defaultCollapsed?: boolean;
398
+ }
399
+ /**
400
+ * Form schema.
401
+ */
402
+ interface FormSchema {
403
+ /** Form sections */
404
+ sections: FormSectionSchema[];
405
+ /** Submit button label */
406
+ submitLabel?: string;
407
+ /** Cancel button label */
408
+ cancelLabel?: string;
409
+ /** Show cancel button */
410
+ showCancel?: boolean;
411
+ /** Form layout */
412
+ layout?: 'vertical' | 'horizontal' | 'inline';
413
+ /** Columns */
414
+ columns?: number;
415
+ }
416
+
417
+ /**
418
+ * Registry Type Definitions
419
+ *
420
+ * @module @omnitron-dev/prism/types/registry
421
+ */
422
+
423
+ /**
424
+ * Component file type.
425
+ */
426
+ type ComponentFileType = 'component' | 'types' | 'styles' | 'barrel' | 'test';
427
+ /**
428
+ * Component file definition.
429
+ */
430
+ interface ComponentFile {
431
+ /** File path */
432
+ path: string;
433
+ /** File type */
434
+ type: ComponentFileType;
435
+ /** Content hash for comparison (SHA-256 truncated) */
436
+ hash?: string;
437
+ /** Template identifier (for code generation) */
438
+ template?: string;
439
+ }
440
+ /**
441
+ * Component dependencies.
442
+ */
443
+ interface ComponentDependencies {
444
+ /** npm packages */
445
+ npm: string[];
446
+ /** Other components */
447
+ components: string[];
448
+ }
449
+ /**
450
+ * Component definition in registry.
451
+ */
452
+ interface ComponentDefinition {
453
+ /** Component name */
454
+ name: string;
455
+ /** Component version */
456
+ version: string;
457
+ /** Component category */
458
+ category: string;
459
+ /** Display name */
460
+ displayName: string;
461
+ /** Description */
462
+ description: string;
463
+ /** Component files */
464
+ files: ComponentFile[];
465
+ /** Dependencies */
466
+ dependencies: ComponentDependencies;
467
+ /** Whether component has variants */
468
+ hasVariants: boolean;
469
+ /** Preview image URL */
470
+ preview?: string;
471
+ /** Documentation URL */
472
+ docs?: string;
473
+ }
474
+ /**
475
+ * Theme definition in registry.
476
+ */
477
+ interface ThemeRegistryEntry {
478
+ /** Theme preset name */
479
+ name: string;
480
+ /** Theme file path */
481
+ path: string;
482
+ /** Theme definition */
483
+ definition: ThemePresetDefinition;
484
+ }
485
+ /**
486
+ * Registry schema.
487
+ */
488
+ interface RegistrySchema {
489
+ /** Schema version */
490
+ $schema?: string;
491
+ /** Registry name */
492
+ name: string;
493
+ /** Registry version */
494
+ version: string;
495
+ /** Registry description */
496
+ description?: string;
497
+ /** Base URL for registry */
498
+ baseUrl?: string;
499
+ /** Extends another registry */
500
+ extends?: string;
501
+ /** Component definitions */
502
+ components: Record<string, ComponentDefinition>;
503
+ /** Block definitions */
504
+ blocks: Record<string, BlockDefinition>;
505
+ /** Theme definitions */
506
+ themes: Record<string, ThemeRegistryEntry>;
507
+ }
508
+ /**
509
+ * Remote registry configuration.
510
+ */
511
+ interface RemoteRegistryConfig {
512
+ /** Registry URL */
513
+ url: string;
514
+ /** Authentication headers */
515
+ headers?: Record<string, string>;
516
+ /** Cache TTL in seconds */
517
+ cacheTtl?: number;
518
+ }
519
+ /**
520
+ * Registry configuration.
521
+ */
522
+ interface RegistryConfig {
523
+ /** Default registry */
524
+ default: string;
525
+ /** Additional registries */
526
+ registries: Record<string, string | RemoteRegistryConfig>;
527
+ }
528
+ /**
529
+ * Installed component tracking.
530
+ */
531
+ interface InstalledComponent {
532
+ /** Component name */
533
+ name: string;
534
+ /** Installed version */
535
+ version: string;
536
+ /** Registry source */
537
+ registry: string;
538
+ /** Installation date */
539
+ installedAt: string;
540
+ /** File paths */
541
+ files: string[];
542
+ }
543
+ /**
544
+ * Installed block tracking.
545
+ */
546
+ interface InstalledBlock {
547
+ /** Block name */
548
+ name: string;
549
+ /** Installed version */
550
+ version: string;
551
+ /** Registry source */
552
+ registry: string;
553
+ /** Installation date */
554
+ installedAt: string;
555
+ /** File paths */
556
+ files: string[];
557
+ /** Configuration */
558
+ config?: Record<string, unknown>;
559
+ }
560
+ /**
561
+ * Prism lockfile for tracking installations.
562
+ */
563
+ interface PrismLockfile {
564
+ /** Lockfile version */
565
+ version: string;
566
+ /** Installed components */
567
+ components: Record<string, InstalledComponent>;
568
+ /** Installed blocks */
569
+ blocks: Record<string, InstalledBlock>;
570
+ /** Installed themes */
571
+ themes: string[];
572
+ }
573
+
574
+ export type { AuthContextValue as A, BlockDefinition as B, ComponentDefinition as C, DashboardBlockProps as D, TopbarNavVariant as E, FormFieldSchema as F, GridCellParams as G, InstalledComponent as I, PrismLockfile as P, RegistryConfig as R, SidebarNavVariant as S, ThemeRegistryEntry as T, RegistrySchema as a, InstalledBlock as b, AuthProviderType as c, AuthState as d, AuthUser as e, BlockCategory as f, BlockConfig as g, BlockDependencies as h, BlockFile as i, BlockFileType as j, BlockNavItem as k, BlockNavSection as l, ComponentDependencies as m, ComponentFile as n, ComponentFileType as o, DashboardNavType as p, DataGridProps as q, FormFieldType as r, FormSchema as s, FormSectionSchema as t, GridColumn as u, GridFilterItem as v, GridFilterModel as w, GridHeaderParams as x, GridSortModel as y, RemoteRegistryConfig as z };