@object-ui/types 0.3.0 → 0.3.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 (115) hide show
  1. package/README.md +19 -11
  2. package/dist/api-types.d.ts +7 -0
  3. package/dist/api-types.d.ts.map +1 -1
  4. package/dist/api-types.js +4 -6
  5. package/dist/app.d.ts +7 -0
  6. package/dist/app.d.ts.map +1 -1
  7. package/dist/app.js +4 -3
  8. package/dist/base.d.ts +7 -0
  9. package/dist/base.d.ts.map +1 -1
  10. package/dist/base.js +4 -6
  11. package/dist/complex.d.ts +68 -1
  12. package/dist/complex.d.ts.map +1 -1
  13. package/dist/complex.js +4 -5
  14. package/dist/crud.d.ts +7 -0
  15. package/dist/crud.d.ts.map +1 -1
  16. package/dist/crud.js +4 -6
  17. package/dist/data-display.d.ts +54 -2
  18. package/dist/data-display.d.ts.map +1 -1
  19. package/dist/data-display.js +4 -5
  20. package/dist/data.d.ts +16 -0
  21. package/dist/data.d.ts.map +1 -1
  22. package/dist/data.js +4 -6
  23. package/dist/disclosure.d.ts +70 -1
  24. package/dist/disclosure.d.ts.map +1 -1
  25. package/dist/disclosure.js +4 -5
  26. package/dist/feedback.d.ts +68 -1
  27. package/dist/feedback.d.ts.map +1 -1
  28. package/dist/feedback.js +4 -5
  29. package/dist/field-types.d.ts +386 -0
  30. package/dist/field-types.d.ts.map +1 -0
  31. package/dist/field-types.js +8 -0
  32. package/dist/form.d.ts +123 -1
  33. package/dist/form.d.ts.map +1 -1
  34. package/dist/form.js +4 -5
  35. package/dist/index.d.ts +21 -13
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +4 -37
  38. package/dist/layout.d.ts +66 -16
  39. package/dist/layout.d.ts.map +1 -1
  40. package/dist/layout.js +4 -6
  41. package/dist/navigation.d.ts +102 -2
  42. package/dist/navigation.d.ts.map +1 -1
  43. package/dist/navigation.js +4 -5
  44. package/dist/objectql.d.ts +484 -54
  45. package/dist/objectql.d.ts.map +1 -1
  46. package/dist/objectql.js +4 -6
  47. package/dist/overlay.d.ts +31 -1
  48. package/dist/overlay.d.ts.map +1 -1
  49. package/dist/overlay.js +4 -5
  50. package/dist/registry.d.ts +7 -0
  51. package/dist/registry.d.ts.map +1 -1
  52. package/dist/registry.js +7 -0
  53. package/dist/zod/base.zod.d.ts +202 -0
  54. package/dist/zod/base.zod.d.ts.map +1 -0
  55. package/dist/zod/base.zod.js +198 -0
  56. package/dist/zod/complex.zod.d.ts +742 -0
  57. package/dist/zod/complex.zod.d.ts.map +1 -0
  58. package/dist/zod/complex.zod.js +233 -0
  59. package/dist/zod/data-display.zod.d.ts +996 -0
  60. package/dist/zod/data-display.zod.d.ts.map +1 -0
  61. package/dist/zod/data-display.zod.js +266 -0
  62. package/dist/zod/disclosure.zod.d.ts +267 -0
  63. package/dist/zod/disclosure.zod.d.ts.map +1 -0
  64. package/dist/zod/disclosure.zod.js +84 -0
  65. package/dist/zod/feedback.zod.d.ts +538 -0
  66. package/dist/zod/feedback.zod.d.ts.map +1 -0
  67. package/dist/zod/feedback.zod.js +127 -0
  68. package/dist/zod/form.zod.d.ts +1308 -0
  69. package/dist/zod/form.zod.d.ts.map +1 -0
  70. package/dist/zod/form.zod.js +406 -0
  71. package/dist/zod/index.zod.d.ts +3174 -0
  72. package/dist/zod/index.zod.d.ts.map +1 -0
  73. package/dist/zod/index.zod.js +106 -0
  74. package/dist/zod/layout.zod.d.ts +1048 -0
  75. package/dist/zod/layout.zod.d.ts.map +1 -0
  76. package/dist/zod/layout.zod.js +241 -0
  77. package/dist/zod/navigation.zod.d.ts +486 -0
  78. package/dist/zod/navigation.zod.d.ts.map +1 -0
  79. package/dist/zod/navigation.zod.js +142 -0
  80. package/dist/zod/objectql.zod.d.ts +1261 -0
  81. package/dist/zod/objectql.zod.d.ts.map +1 -0
  82. package/dist/zod/objectql.zod.js +248 -0
  83. package/dist/zod/overlay.zod.d.ts +691 -0
  84. package/dist/zod/overlay.zod.d.ts.map +1 -0
  85. package/dist/zod/overlay.zod.js +179 -0
  86. package/package.json +9 -1
  87. package/src/api-types.ts +8 -0
  88. package/src/app.ts +8 -0
  89. package/src/base.ts +8 -0
  90. package/src/complex.ts +69 -1
  91. package/src/crud.ts +8 -0
  92. package/src/data-display.ts +60 -2
  93. package/src/data.ts +18 -0
  94. package/src/disclosure.ts +74 -1
  95. package/src/feedback.ts +76 -2
  96. package/src/field-types.ts +465 -0
  97. package/src/form.ts +131 -1
  98. package/src/index.ts +91 -8
  99. package/src/layout.ts +70 -15
  100. package/src/navigation.ts +109 -2
  101. package/src/objectql.ts +555 -59
  102. package/src/overlay.ts +35 -1
  103. package/src/registry.ts +8 -0
  104. package/src/zod/README.md +329 -0
  105. package/src/zod/base.zod.ts +229 -0
  106. package/src/zod/complex.zod.ts +258 -0
  107. package/src/zod/data-display.zod.ts +290 -0
  108. package/src/zod/disclosure.zod.ts +92 -0
  109. package/src/zod/feedback.zod.ts +138 -0
  110. package/src/zod/form.zod.ts +434 -0
  111. package/src/zod/index.zod.ts +277 -0
  112. package/src/zod/layout.zod.ts +262 -0
  113. package/src/zod/navigation.zod.ts +159 -0
  114. package/src/zod/objectql.zod.ts +268 -0
  115. package/src/zod/overlay.zod.ts +196 -0
package/src/index.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * @object-ui/types
3
11
  *
@@ -75,6 +83,7 @@ export type {
75
83
  SeparatorSchema,
76
84
  ContainerSchema,
77
85
  FlexSchema,
86
+ StackSchema,
78
87
  GridSchema,
79
88
  CardSchema,
80
89
  TabsSchema,
@@ -82,6 +91,7 @@ export type {
82
91
  ScrollAreaSchema,
83
92
  ResizableSchema,
84
93
  ResizablePanel,
94
+ AspectRatioSchema,
85
95
  LayoutSchema,
86
96
  PageSchema,
87
97
  } from './layout';
@@ -99,15 +109,17 @@ export type {
99
109
  RadioGroupSchema,
100
110
  RadioOption,
101
111
  SwitchSchema,
102
- ToggleSchema,
103
112
  SliderSchema,
104
113
  FileUploadSchema,
105
114
  DatePickerSchema,
106
115
  CalendarSchema,
107
- InputOTPSchema,
108
116
  ValidationRule,
109
117
  FieldCondition,
110
118
  FormField,
119
+ ComboboxSchema,
120
+ CommandSchema,
121
+ InputOTPSchema,
122
+ ToggleSchema,
111
123
  FormSchema,
112
124
  LabelSchema,
113
125
  FormComponentSchema,
@@ -133,6 +145,7 @@ export type {
133
145
  ChartSchema,
134
146
  TimelineEvent,
135
147
  TimelineSchema,
148
+ KbdSchema,
136
149
  HtmlSchema,
137
150
  StatisticSchema,
138
151
  DataDisplaySchema,
@@ -142,10 +155,13 @@ export type {
142
155
  // Feedback Components - Status & Progress Indication
143
156
  // ============================================================================
144
157
  export type {
158
+ SpinnerSchema,
145
159
  LoadingSchema,
146
160
  ProgressSchema,
147
161
  SkeletonSchema,
148
162
  ToastSchema,
163
+ EmptySchema,
164
+ SonnerSchema,
149
165
  ToasterSchema,
150
166
  FeedbackSchema,
151
167
  } from './feedback';
@@ -155,6 +171,7 @@ export type {
155
171
  // ============================================================================
156
172
  export type {
157
173
  AccordionItem,
174
+ ToggleGroupSchema,
158
175
  AccordionSchema,
159
176
  CollapsibleSchema,
160
177
  DisclosureSchema,
@@ -174,6 +191,7 @@ export type {
174
191
  TooltipSchema,
175
192
  HoverCardSchema,
176
193
  MenuItem,
194
+ MenubarSchema,
177
195
  DropdownMenuSchema,
178
196
  ContextMenuSchema,
179
197
  OverlaySchema,
@@ -188,8 +206,10 @@ export type {
188
206
  SidebarSchema,
189
207
  BreadcrumbItem,
190
208
  BreadcrumbSchema,
191
- PaginationSchema,
209
+ ButtonGroupSchema,
210
+ NavigationMenuSchema,
192
211
  NavigationSchema,
212
+ PaginationSchema,
193
213
  } from './navigation';
194
214
 
195
215
  // ============================================================================
@@ -209,6 +229,9 @@ export type {
209
229
  FilterField,
210
230
  CarouselItem,
211
231
  CarouselSchema,
232
+ DashboardWidgetLayout,
233
+ DashboardWidgetSchema,
234
+ DashboardSchema,
212
235
  ChatMessage,
213
236
  ChatbotSchema,
214
237
  ComplexSchema,
@@ -247,11 +270,68 @@ export type {
247
270
  // ObjectQL Components - ObjectQL-specific components
248
271
  // ============================================================================
249
272
  export type {
250
- ObjectTableSchema,
273
+ // Schema types aligned with @objectstack/spec
274
+ HttpMethod,
275
+ HttpRequest,
276
+ ViewData,
277
+ ListColumn,
278
+ SelectionConfig,
279
+ PaginationConfig,
280
+ KanbanConfig,
281
+ CalendarConfig,
282
+ GanttConfig,
283
+ SortConfig,
284
+ // Component schemas
285
+ ObjectMapSchema,
286
+ ObjectGanttSchema,
287
+ ObjectCalendarSchema,
288
+ ObjectKanbanSchema,
289
+ ObjectChartSchema,
290
+ ListViewSchema,
291
+ ObjectGridSchema,
251
292
  ObjectFormSchema,
293
+ ObjectViewSchema,
252
294
  ObjectQLComponentSchema,
253
295
  } from './objectql';
254
296
 
297
+ // ============================================================================
298
+ // Field Types - ObjectQL Field Type System
299
+ // ============================================================================
300
+ export type {
301
+ BaseFieldMetadata,
302
+ TextFieldMetadata,
303
+ TextareaFieldMetadata,
304
+ MarkdownFieldMetadata,
305
+ HtmlFieldMetadata,
306
+ NumberFieldMetadata,
307
+ CurrencyFieldMetadata,
308
+ PercentFieldMetadata,
309
+ BooleanFieldMetadata,
310
+ DateFieldMetadata,
311
+ DateTimeFieldMetadata,
312
+ TimeFieldMetadata,
313
+ SelectFieldMetadata,
314
+ SelectOptionMetadata,
315
+ EmailFieldMetadata,
316
+ PhoneFieldMetadata,
317
+ UrlFieldMetadata,
318
+ PasswordFieldMetadata,
319
+ FileFieldMetadata,
320
+ FileMetadata,
321
+ ImageFieldMetadata,
322
+ LocationFieldMetadata,
323
+ LookupFieldMetadata,
324
+ FormulaFieldMetadata,
325
+ SummaryFieldMetadata,
326
+ AutoNumberFieldMetadata,
327
+ UserFieldMetadata,
328
+ ObjectFieldMetadata,
329
+ VectorFieldMetadata,
330
+ GridFieldMetadata,
331
+ FieldMetadata,
332
+ ObjectSchemaMetadata,
333
+ } from './field-types';
334
+
255
335
  // ============================================================================
256
336
  // API and Events - API Integration and Event Handling
257
337
  // ============================================================================
@@ -273,16 +353,16 @@ export type {
273
353
  // ============================================================================
274
354
 
275
355
  import type { BaseSchema, SchemaNode } from './base';
276
- import type { LayoutSchema } from './layout';
356
+ import type { LayoutSchema, PageSchema } from './layout';
277
357
  import type { FormComponentSchema } from './form';
278
358
  import type { DataDisplaySchema } from './data-display';
279
359
  import type { FeedbackSchema } from './feedback';
280
360
  import type { DisclosureSchema } from './disclosure';
281
361
  import type { OverlaySchema } from './overlay';
282
362
  import type { NavigationSchema } from './navigation';
283
- import type { ComplexSchema } from './complex';
363
+ import type { ComplexSchema, DashboardSchema } from './complex';
284
364
  import type { CRUDComponentSchema } from './crud';
285
- import type { ObjectQLComponentSchema } from './objectql';
365
+ import type { ObjectQLComponentSchema, ListViewSchema } from './objectql';
286
366
  import type { AppSchema } from './app';
287
367
 
288
368
  /**
@@ -293,6 +373,7 @@ export type AnySchema =
293
373
  | AppSchema
294
374
  | BaseSchema
295
375
  | LayoutSchema
376
+ | PageSchema
296
377
  | FormComponentSchema
297
378
  | DataDisplaySchema
298
379
  | FeedbackSchema
@@ -300,8 +381,10 @@ export type AnySchema =
300
381
  | OverlaySchema
301
382
  | NavigationSchema
302
383
  | ComplexSchema
384
+ | DashboardSchema
303
385
  | CRUDComponentSchema
304
- | ObjectQLComponentSchema;
386
+ | ObjectQLComponentSchema
387
+ | ListViewSchema;
305
388
 
306
389
  /**
307
390
  * Utility type to extract the schema type from a type string.
package/src/layout.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * @object-ui/types - Layout Component Schemas
3
11
  *
@@ -388,6 +396,60 @@ export interface ResizablePanel {
388
396
  content: SchemaNode | SchemaNode[];
389
397
  }
390
398
 
399
+ /**
400
+ * Aspect ratio component
401
+ */
402
+ export interface AspectRatioSchema extends BaseSchema {
403
+ type: 'aspect-ratio';
404
+ /**
405
+ * Aspect ratio (width / height)
406
+ * @default 16/9
407
+ */
408
+ ratio?: number;
409
+ /**
410
+ * Image URL to display
411
+ */
412
+ image?: string;
413
+ /**
414
+ * Image alt text
415
+ */
416
+ alt?: string;
417
+ /**
418
+ * Child components (alternative to image)
419
+ */
420
+ body?: SchemaNode | SchemaNode[];
421
+ /**
422
+ * Child components (alternative syntax)
423
+ */
424
+ children?: SchemaNode | SchemaNode[];
425
+ }
426
+
427
+ /**
428
+ * Page Region (Header, Sidebar, Main, etc)
429
+ */
430
+ export interface PageRegion {
431
+ /**
432
+ * Region name/id
433
+ */
434
+ name: string;
435
+ /**
436
+ * Region type
437
+ */
438
+ type?: 'header' | 'sidebar' | 'main' | 'footer' | 'aside';
439
+ /**
440
+ * Width (flex basis)
441
+ */
442
+ width?: string;
443
+ /**
444
+ * Components in this region
445
+ */
446
+ components: SchemaNode[];
447
+ /**
448
+ * CSS class
449
+ */
450
+ className?: string;
451
+ }
452
+
391
453
  /**
392
454
  * Page layout component
393
455
  * Top-level container for a page route
@@ -407,7 +469,12 @@ export interface PageSchema extends BaseSchema {
407
469
  */
408
470
  description?: string;
409
471
  /**
410
- * Main content array
472
+ * Page layout regions
473
+ * (Aligned with @objectstack/spec Page.regions)
474
+ */
475
+ regions?: PageRegion[];
476
+ /**
477
+ * Main content array (Legacy/Simple mode)
411
478
  */
412
479
  body?: SchemaNode[];
413
480
  /**
@@ -428,24 +495,12 @@ export type LayoutSchema =
428
495
  | SeparatorSchema
429
496
  | ContainerSchema
430
497
  | FlexSchema
498
+ | StackSchema
431
499
  | GridSchema
432
500
  | CardSchema
433
501
  | TabsSchema
434
502
  | ScrollAreaSchema
435
503
  | ResizableSchema
504
+ | AspectRatioSchema
436
505
  | PageSchema;
437
506
 
438
- /**
439
- * Page container component
440
- */
441
- export interface PageSchema extends BaseSchema {
442
- type: 'page';
443
- /**
444
- * Page title
445
- */
446
- title?: string;
447
- /**
448
- * Child components
449
- */
450
- children?: SchemaNode | SchemaNode[];
451
- }
package/src/navigation.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * @object-ui/types - Navigation Component Schemas
3
11
  *
@@ -199,7 +207,11 @@ export interface PaginationSchema extends BaseSchema {
199
207
  /**
200
208
  * Current page (1-indexed)
201
209
  */
202
- page: number;
210
+ currentPage?: number;
211
+ /**
212
+ * Legacy page property
213
+ */
214
+ page?: number;
203
215
  /**
204
216
  * Total number of pages
205
217
  */
@@ -225,6 +237,99 @@ export interface PaginationSchema extends BaseSchema {
225
237
  onPageChange?: (page: number) => void;
226
238
  }
227
239
 
240
+ /**
241
+ * Navigation menu item
242
+ */
243
+ export interface NavigationMenuItem {
244
+ /**
245
+ * Item label
246
+ */
247
+ label: string;
248
+ /**
249
+ * Item href/link
250
+ */
251
+ href?: string;
252
+ /**
253
+ * Item description
254
+ */
255
+ description?: string;
256
+ /**
257
+ * Item icon
258
+ */
259
+ icon?: string;
260
+ /**
261
+ * Child items
262
+ */
263
+ children?: NavigationMenuItem[];
264
+ }
265
+
266
+ /**
267
+ * Navigation menu component
268
+ */
269
+ export interface NavigationMenuSchema extends BaseSchema {
270
+ type: 'navigation-menu';
271
+ /**
272
+ * Navigation menu items
273
+ */
274
+ items?: NavigationMenuItem[];
275
+ /**
276
+ * Navigation menu orientation
277
+ * @default 'horizontal'
278
+ */
279
+ orientation?: 'horizontal' | 'vertical';
280
+ }
281
+
282
+ /**
283
+ * Button group button
284
+ */
285
+ export interface ButtonGroupButton {
286
+ /**
287
+ * Button label
288
+ */
289
+ label: string;
290
+ /**
291
+ * Button variant
292
+ */
293
+ variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link';
294
+ /**
295
+ * Button size
296
+ */
297
+ size?: 'default' | 'sm' | 'lg' | 'icon';
298
+ /**
299
+ * Whether button is disabled
300
+ */
301
+ disabled?: boolean;
302
+ /**
303
+ * Click handler
304
+ */
305
+ onClick?: () => void;
306
+ /**
307
+ * Button CSS class
308
+ */
309
+ className?: string;
310
+ }
311
+
312
+ /**
313
+ * Button group component
314
+ */
315
+ export interface ButtonGroupSchema extends BaseSchema {
316
+ type: 'button-group';
317
+ /**
318
+ * Button group buttons
319
+ */
320
+ buttons?: ButtonGroupButton[];
321
+ /**
322
+ * Default button variant
323
+ * @default 'default'
324
+ */
325
+ variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link';
326
+ /**
327
+ * Default button size
328
+ * @default 'default'
329
+ */
330
+ size?: 'default' | 'sm' | 'lg' | 'icon';
331
+ }
332
+
228
333
  /**
229
334
  * Union type of all navigation schemas
230
335
  */
@@ -232,4 +337,6 @@ export type NavigationSchema =
232
337
  | HeaderBarSchema
233
338
  | SidebarSchema
234
339
  | BreadcrumbSchema
235
- | PaginationSchema;
340
+ | PaginationSchema
341
+ | NavigationMenuSchema
342
+ | ButtonGroupSchema;