@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.
- package/README.md +19 -11
- package/dist/api-types.d.ts +7 -0
- package/dist/api-types.d.ts.map +1 -1
- package/dist/api-types.js +4 -6
- package/dist/app.d.ts +7 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +4 -3
- package/dist/base.d.ts +7 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +4 -6
- package/dist/complex.d.ts +68 -1
- package/dist/complex.d.ts.map +1 -1
- package/dist/complex.js +4 -5
- package/dist/crud.d.ts +7 -0
- package/dist/crud.d.ts.map +1 -1
- package/dist/crud.js +4 -6
- package/dist/data-display.d.ts +54 -2
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +4 -5
- package/dist/data.d.ts +16 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +4 -6
- package/dist/disclosure.d.ts +70 -1
- package/dist/disclosure.d.ts.map +1 -1
- package/dist/disclosure.js +4 -5
- package/dist/feedback.d.ts +68 -1
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +4 -5
- package/dist/field-types.d.ts +386 -0
- package/dist/field-types.d.ts.map +1 -0
- package/dist/field-types.js +8 -0
- package/dist/form.d.ts +123 -1
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +4 -5
- package/dist/index.d.ts +21 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -37
- package/dist/layout.d.ts +66 -16
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +4 -6
- package/dist/navigation.d.ts +102 -2
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +4 -5
- package/dist/objectql.d.ts +484 -54
- package/dist/objectql.d.ts.map +1 -1
- package/dist/objectql.js +4 -6
- package/dist/overlay.d.ts +31 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +4 -5
- package/dist/registry.d.ts +7 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +7 -0
- package/dist/zod/base.zod.d.ts +202 -0
- package/dist/zod/base.zod.d.ts.map +1 -0
- package/dist/zod/base.zod.js +198 -0
- package/dist/zod/complex.zod.d.ts +742 -0
- package/dist/zod/complex.zod.d.ts.map +1 -0
- package/dist/zod/complex.zod.js +233 -0
- package/dist/zod/data-display.zod.d.ts +996 -0
- package/dist/zod/data-display.zod.d.ts.map +1 -0
- package/dist/zod/data-display.zod.js +266 -0
- package/dist/zod/disclosure.zod.d.ts +267 -0
- package/dist/zod/disclosure.zod.d.ts.map +1 -0
- package/dist/zod/disclosure.zod.js +84 -0
- package/dist/zod/feedback.zod.d.ts +538 -0
- package/dist/zod/feedback.zod.d.ts.map +1 -0
- package/dist/zod/feedback.zod.js +127 -0
- package/dist/zod/form.zod.d.ts +1308 -0
- package/dist/zod/form.zod.d.ts.map +1 -0
- package/dist/zod/form.zod.js +406 -0
- package/dist/zod/index.zod.d.ts +3174 -0
- package/dist/zod/index.zod.d.ts.map +1 -0
- package/dist/zod/index.zod.js +106 -0
- package/dist/zod/layout.zod.d.ts +1048 -0
- package/dist/zod/layout.zod.d.ts.map +1 -0
- package/dist/zod/layout.zod.js +241 -0
- package/dist/zod/navigation.zod.d.ts +486 -0
- package/dist/zod/navigation.zod.d.ts.map +1 -0
- package/dist/zod/navigation.zod.js +142 -0
- package/dist/zod/objectql.zod.d.ts +1261 -0
- package/dist/zod/objectql.zod.d.ts.map +1 -0
- package/dist/zod/objectql.zod.js +248 -0
- package/dist/zod/overlay.zod.d.ts +691 -0
- package/dist/zod/overlay.zod.d.ts.map +1 -0
- package/dist/zod/overlay.zod.js +179 -0
- package/package.json +9 -1
- package/src/api-types.ts +8 -0
- package/src/app.ts +8 -0
- package/src/base.ts +8 -0
- package/src/complex.ts +69 -1
- package/src/crud.ts +8 -0
- package/src/data-display.ts +60 -2
- package/src/data.ts +18 -0
- package/src/disclosure.ts +74 -1
- package/src/feedback.ts +76 -2
- package/src/field-types.ts +465 -0
- package/src/form.ts +131 -1
- package/src/index.ts +91 -8
- package/src/layout.ts +70 -15
- package/src/navigation.ts +109 -2
- package/src/objectql.ts +555 -59
- package/src/overlay.ts +35 -1
- package/src/registry.ts +8 -0
- package/src/zod/README.md +329 -0
- package/src/zod/base.zod.ts +229 -0
- package/src/zod/complex.zod.ts +258 -0
- package/src/zod/data-display.zod.ts +290 -0
- package/src/zod/disclosure.zod.ts +92 -0
- package/src/zod/feedback.zod.ts +138 -0
- package/src/zod/form.zod.ts +434 -0
- package/src/zod/index.zod.ts +277 -0
- package/src/zod/layout.zod.ts +262 -0
- package/src/zod/navigation.zod.ts +159 -0
- package/src/zod/objectql.zod.ts +268 -0
- package/src/zod/overlay.zod.ts +196 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.zod.d.ts","sourceRoot":"","sources":["../../src/zod/overlay.zod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAUzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iBAI5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;iBAGxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAWxB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* @object-ui/types/zod - Overlay Component Zod Validators
|
|
10
|
+
*
|
|
11
|
+
* Zod validation schemas for overlay, modal, and popup components.
|
|
12
|
+
* Following @objectstack/spec UI specification format.
|
|
13
|
+
*
|
|
14
|
+
* @module zod/overlay
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import { BaseSchema, SchemaNodeSchema } from './base.zod';
|
|
19
|
+
/**
|
|
20
|
+
* Dialog Schema - Dialog/modal component
|
|
21
|
+
*/
|
|
22
|
+
export const DialogSchema = BaseSchema.extend({
|
|
23
|
+
type: z.literal('dialog'),
|
|
24
|
+
title: z.string().optional().describe('Dialog title'),
|
|
25
|
+
description: z.string().optional().describe('Dialog description'),
|
|
26
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Dialog content'),
|
|
27
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Dialog trigger'),
|
|
28
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
29
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
30
|
+
footer: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Dialog footer'),
|
|
31
|
+
modal: z.boolean().optional().describe('Whether dialog is modal'),
|
|
32
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Alert Dialog Schema - Alert dialog component
|
|
36
|
+
*/
|
|
37
|
+
export const AlertDialogSchema = BaseSchema.extend({
|
|
38
|
+
type: z.literal('alert-dialog'),
|
|
39
|
+
title: z.string().optional().describe('Alert dialog title'),
|
|
40
|
+
description: z.string().optional().describe('Alert dialog description'),
|
|
41
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Dialog trigger'),
|
|
42
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
43
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
44
|
+
cancelLabel: z.string().optional().describe('Cancel button label'),
|
|
45
|
+
confirmLabel: z.string().optional().describe('Confirm button label'),
|
|
46
|
+
confirmVariant: z.enum(['default', 'destructive']).optional().describe('Confirm button variant'),
|
|
47
|
+
onConfirm: z.function().optional().describe('Confirm handler'),
|
|
48
|
+
onCancel: z.function().optional().describe('Cancel handler'),
|
|
49
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Sheet Schema - Sheet/side panel component
|
|
53
|
+
*/
|
|
54
|
+
export const SheetSchema = BaseSchema.extend({
|
|
55
|
+
type: z.literal('sheet'),
|
|
56
|
+
title: z.string().optional().describe('Sheet title'),
|
|
57
|
+
description: z.string().optional().describe('Sheet description'),
|
|
58
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Sheet content'),
|
|
59
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Sheet trigger'),
|
|
60
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
61
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
62
|
+
side: z.enum(['top', 'right', 'bottom', 'left']).optional().describe('Sheet position'),
|
|
63
|
+
footer: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Sheet footer'),
|
|
64
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Drawer Schema - Drawer component
|
|
68
|
+
*/
|
|
69
|
+
export const DrawerSchema = BaseSchema.extend({
|
|
70
|
+
type: z.literal('drawer'),
|
|
71
|
+
title: z.string().optional().describe('Drawer title'),
|
|
72
|
+
description: z.string().optional().describe('Drawer description'),
|
|
73
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Drawer content'),
|
|
74
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Drawer trigger'),
|
|
75
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
76
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
77
|
+
direction: z.enum(['top', 'right', 'bottom', 'left']).optional().describe('Drawer direction'),
|
|
78
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Popover Schema - Popover component
|
|
82
|
+
*/
|
|
83
|
+
export const PopoverSchema = BaseSchema.extend({
|
|
84
|
+
type: z.literal('popover'),
|
|
85
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Popover content'),
|
|
86
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Popover trigger'),
|
|
87
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
88
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
89
|
+
side: z.enum(['top', 'right', 'bottom', 'left']).optional().describe('Popover side'),
|
|
90
|
+
align: z.enum(['start', 'center', 'end']).optional().describe('Popover alignment'),
|
|
91
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Tooltip Schema - Tooltip component
|
|
95
|
+
*/
|
|
96
|
+
export const TooltipSchema = BaseSchema.extend({
|
|
97
|
+
type: z.literal('tooltip'),
|
|
98
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Tooltip content'),
|
|
99
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Tooltip children'),
|
|
100
|
+
side: z.enum(['top', 'right', 'bottom', 'left']).optional().describe('Tooltip side'),
|
|
101
|
+
align: z.enum(['start', 'center', 'end']).optional().describe('Tooltip alignment'),
|
|
102
|
+
delayDuration: z.number().optional().describe('Delay before showing (ms)'),
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Hover Card Schema - Hover card component
|
|
106
|
+
*/
|
|
107
|
+
export const HoverCardSchema = BaseSchema.extend({
|
|
108
|
+
type: z.literal('hover-card'),
|
|
109
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Hover card content'),
|
|
110
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Hover card trigger'),
|
|
111
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
112
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
113
|
+
side: z.enum(['top', 'right', 'bottom', 'left']).optional().describe('Hover card side'),
|
|
114
|
+
openDelay: z.number().optional().describe('Delay before opening (ms)'),
|
|
115
|
+
closeDelay: z.number().optional().describe('Delay before closing (ms)'),
|
|
116
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Menu Item Schema
|
|
120
|
+
*/
|
|
121
|
+
export const MenuItemSchema = z.lazy(() => z.object({
|
|
122
|
+
label: z.string().describe('Menu item label'),
|
|
123
|
+
icon: z.string().optional().describe('Menu item icon'),
|
|
124
|
+
disabled: z.boolean().optional().describe('Whether item is disabled'),
|
|
125
|
+
onClick: z.function().optional().describe('Click handler'),
|
|
126
|
+
shortcut: z.string().optional().describe('Keyboard shortcut'),
|
|
127
|
+
children: z.array(MenuItemSchema).optional().describe('Submenu items'),
|
|
128
|
+
separator: z.boolean().optional().describe('Whether this is a separator'),
|
|
129
|
+
}));
|
|
130
|
+
/**
|
|
131
|
+
* Dropdown Menu Schema - Dropdown menu component
|
|
132
|
+
*/
|
|
133
|
+
export const DropdownMenuSchema = BaseSchema.extend({
|
|
134
|
+
type: z.literal('dropdown-menu'),
|
|
135
|
+
items: z.array(MenuItemSchema).describe('Menu items'),
|
|
136
|
+
trigger: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Menu trigger'),
|
|
137
|
+
defaultOpen: z.boolean().optional().describe('Default open state'),
|
|
138
|
+
open: z.boolean().optional().describe('Controlled open state'),
|
|
139
|
+
side: z.enum(['top', 'right', 'bottom', 'left']).optional().describe('Menu side'),
|
|
140
|
+
align: z.enum(['start', 'center', 'end']).optional().describe('Menu alignment'),
|
|
141
|
+
onOpenChange: z.function().optional().describe('Open change handler'),
|
|
142
|
+
});
|
|
143
|
+
/**
|
|
144
|
+
* Context Menu Schema - Context menu component
|
|
145
|
+
*/
|
|
146
|
+
export const ContextMenuSchema = BaseSchema.extend({
|
|
147
|
+
type: z.literal('context-menu'),
|
|
148
|
+
items: z.array(MenuItemSchema).describe('Menu items'),
|
|
149
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Context menu children'),
|
|
150
|
+
});
|
|
151
|
+
/**
|
|
152
|
+
* Menubar Menu Schema
|
|
153
|
+
*/
|
|
154
|
+
export const MenubarMenuSchema = z.object({
|
|
155
|
+
label: z.string().describe('Menu label'),
|
|
156
|
+
items: z.array(MenuItemSchema).describe('Menu items'),
|
|
157
|
+
});
|
|
158
|
+
/**
|
|
159
|
+
* Menubar Schema - Menubar component
|
|
160
|
+
*/
|
|
161
|
+
export const MenubarSchema = BaseSchema.extend({
|
|
162
|
+
type: z.literal('menubar'),
|
|
163
|
+
menus: z.array(MenubarMenuSchema).optional().describe('Menubar menus'),
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* Overlay Schema Union - All overlay component schemas
|
|
167
|
+
*/
|
|
168
|
+
export const OverlaySchema = z.union([
|
|
169
|
+
DialogSchema,
|
|
170
|
+
AlertDialogSchema,
|
|
171
|
+
SheetSchema,
|
|
172
|
+
DrawerSchema,
|
|
173
|
+
PopoverSchema,
|
|
174
|
+
TooltipSchema,
|
|
175
|
+
HoverCardSchema,
|
|
176
|
+
DropdownMenuSchema,
|
|
177
|
+
ContextMenuSchema,
|
|
178
|
+
MenubarSchema,
|
|
179
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/types",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Pure TypeScript type definitions for Object UI - The Protocol Layer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
"./data": {
|
|
48
48
|
"types": "./dist/data.d.ts",
|
|
49
49
|
"import": "./dist/data.js"
|
|
50
|
+
},
|
|
51
|
+
"./zod": {
|
|
52
|
+
"types": "./dist/zod/index.zod.d.ts",
|
|
53
|
+
"import": "./dist/zod/index.zod.js"
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
"files": [
|
|
@@ -70,6 +74,10 @@
|
|
|
70
74
|
"url": "https://github.com/objectstack-ai/objectui.git",
|
|
71
75
|
"directory": "packages/types"
|
|
72
76
|
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@objectstack/spec": "^0.3.3",
|
|
79
|
+
"zod": "^4.3.6"
|
|
80
|
+
},
|
|
73
81
|
"devDependencies": {
|
|
74
82
|
"typescript": "^5.9.3"
|
|
75
83
|
},
|
package/src/api-types.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 - API and Event Schemas
|
|
3
11
|
*
|
package/src/app.ts
CHANGED
package/src/base.ts
CHANGED
package/src/complex.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 - Complex Component Schemas
|
|
3
11
|
*
|
|
@@ -9,6 +17,35 @@
|
|
|
9
17
|
|
|
10
18
|
import type { BaseSchema, SchemaNode } from './base';
|
|
11
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Dashboard Component Schema
|
|
22
|
+
* (Report / BI View)
|
|
23
|
+
*/
|
|
24
|
+
export interface DashboardSchema extends BaseSchema {
|
|
25
|
+
type: 'dashboard';
|
|
26
|
+
/**
|
|
27
|
+
* Layout Grid Configuration (e.g. 12 column grid)
|
|
28
|
+
*/
|
|
29
|
+
columns?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Widget gap
|
|
32
|
+
*/
|
|
33
|
+
gap?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Dashboard Widgets
|
|
36
|
+
*/
|
|
37
|
+
widgets: Array<{
|
|
38
|
+
/** Unique Widget ID */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Widget Title */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Widget Component (Chart, Statistic, List, etc) */
|
|
43
|
+
component: SchemaNode;
|
|
44
|
+
/** Grid Position: x, y, w, h */
|
|
45
|
+
layout?: { x: number; y: number; w: number; h: number };
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
|
|
12
49
|
/**
|
|
13
50
|
* Kanban column
|
|
14
51
|
*/
|
|
@@ -454,6 +491,36 @@ export interface ChatbotSchema extends BaseSchema {
|
|
|
454
491
|
height?: string | number;
|
|
455
492
|
}
|
|
456
493
|
|
|
494
|
+
/**
|
|
495
|
+
* Dashboard Widget Layout
|
|
496
|
+
*/
|
|
497
|
+
export interface DashboardWidgetLayout {
|
|
498
|
+
x: number;
|
|
499
|
+
y: number;
|
|
500
|
+
w: number;
|
|
501
|
+
h: number;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Dashboard Widget
|
|
506
|
+
*/
|
|
507
|
+
export interface DashboardWidgetSchema {
|
|
508
|
+
id: string;
|
|
509
|
+
title?: string;
|
|
510
|
+
component: SchemaNode;
|
|
511
|
+
layout?: DashboardWidgetLayout;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Dashboard Schema
|
|
516
|
+
*/
|
|
517
|
+
export interface DashboardSchema extends BaseSchema {
|
|
518
|
+
type: 'dashboard';
|
|
519
|
+
columns?: number;
|
|
520
|
+
gap?: number;
|
|
521
|
+
widgets: DashboardWidgetSchema[];
|
|
522
|
+
}
|
|
523
|
+
|
|
457
524
|
/**
|
|
458
525
|
* Union type of all complex schemas
|
|
459
526
|
*/
|
|
@@ -462,4 +529,5 @@ export type ComplexSchema =
|
|
|
462
529
|
| CalendarViewSchema
|
|
463
530
|
| FilterBuilderSchema
|
|
464
531
|
| CarouselSchema
|
|
465
|
-
| ChatbotSchema
|
|
532
|
+
| ChatbotSchema
|
|
533
|
+
| DashboardSchema;
|
package/src/crud.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 - CRUD Component Schemas
|
|
3
11
|
*
|
package/src/data-display.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 - Data Display Component Schemas
|
|
3
11
|
*
|
|
@@ -322,9 +330,12 @@ export interface DataTableSchema extends BaseSchema {
|
|
|
322
330
|
searchable?: boolean;
|
|
323
331
|
/**
|
|
324
332
|
* Enable row selection
|
|
333
|
+
* - boolean: Enable/disable selection (true = multiple selection)
|
|
334
|
+
* - 'single': Single row selection
|
|
335
|
+
* - 'multiple': Multiple row selection
|
|
325
336
|
* @default false
|
|
326
337
|
*/
|
|
327
|
-
selectable?: boolean;
|
|
338
|
+
selectable?: boolean | 'single' | 'multiple';
|
|
328
339
|
/**
|
|
329
340
|
* Enable column sorting
|
|
330
341
|
* @default true
|
|
@@ -601,6 +612,51 @@ export interface TimelineSchema extends BaseSchema {
|
|
|
601
612
|
position?: 'left' | 'right' | 'alternate';
|
|
602
613
|
}
|
|
603
614
|
|
|
615
|
+
/**
|
|
616
|
+
* Breadcrumb item
|
|
617
|
+
*/
|
|
618
|
+
export interface BreadcrumbItem {
|
|
619
|
+
/**
|
|
620
|
+
* Item label
|
|
621
|
+
*/
|
|
622
|
+
label: string;
|
|
623
|
+
/**
|
|
624
|
+
* Item href/link
|
|
625
|
+
*/
|
|
626
|
+
href?: string;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Breadcrumb component
|
|
631
|
+
*/
|
|
632
|
+
export interface BreadcrumbSchema extends BaseSchema {
|
|
633
|
+
type: 'breadcrumb';
|
|
634
|
+
/**
|
|
635
|
+
* Breadcrumb items
|
|
636
|
+
*/
|
|
637
|
+
items: BreadcrumbItem[];
|
|
638
|
+
/**
|
|
639
|
+
* Separator character
|
|
640
|
+
* @default '/'
|
|
641
|
+
*/
|
|
642
|
+
separator?: string;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Keyboard key component
|
|
647
|
+
*/
|
|
648
|
+
export interface KbdSchema extends BaseSchema {
|
|
649
|
+
type: 'kbd';
|
|
650
|
+
/**
|
|
651
|
+
* Key label (single key)
|
|
652
|
+
*/
|
|
653
|
+
label?: string;
|
|
654
|
+
/**
|
|
655
|
+
* Key labels (multiple keys)
|
|
656
|
+
*/
|
|
657
|
+
keys?: string | string[];
|
|
658
|
+
}
|
|
659
|
+
|
|
604
660
|
/**
|
|
605
661
|
* Union type of all data display schemas
|
|
606
662
|
*/
|
|
@@ -616,7 +672,9 @@ export type DataDisplaySchema =
|
|
|
616
672
|
| ChartSchema
|
|
617
673
|
| TimelineSchema
|
|
618
674
|
| HtmlSchema
|
|
619
|
-
| StatisticSchema
|
|
675
|
+
| StatisticSchema
|
|
676
|
+
| BreadcrumbSchema
|
|
677
|
+
| KbdSchema;
|
|
620
678
|
|
|
621
679
|
/**
|
|
622
680
|
* Raw HTML component
|
package/src/data.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 - Data Source Types
|
|
3
11
|
*
|
|
@@ -185,6 +193,16 @@ export interface DataSource<T = any> {
|
|
|
185
193
|
* @returns Promise resolving to operation result
|
|
186
194
|
*/
|
|
187
195
|
bulk?(resource: string, operation: 'create' | 'update' | 'delete', data: Partial<T>[]): Promise<T[]>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Get object schema/metadata.
|
|
199
|
+
* Used by ObjectQL-aware components to auto-generate UI from object metadata.
|
|
200
|
+
* Required for all DataSource implementations to support schema-aware components.
|
|
201
|
+
*
|
|
202
|
+
* @param objectName - Object name
|
|
203
|
+
* @returns Promise resolving to the object schema
|
|
204
|
+
*/
|
|
205
|
+
getObjectSchema(objectName: string): Promise<any>;
|
|
188
206
|
}
|
|
189
207
|
|
|
190
208
|
/**
|
package/src/disclosure.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 - Disclosure Component Schemas
|
|
3
11
|
*
|
|
@@ -105,9 +113,74 @@ export interface CollapsibleSchema extends BaseSchema {
|
|
|
105
113
|
onOpenChange?: (open: boolean) => void;
|
|
106
114
|
}
|
|
107
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Toggle group item
|
|
118
|
+
*/
|
|
119
|
+
export interface ToggleGroupItem {
|
|
120
|
+
/**
|
|
121
|
+
* Item value
|
|
122
|
+
*/
|
|
123
|
+
value: string;
|
|
124
|
+
/**
|
|
125
|
+
* Item label
|
|
126
|
+
*/
|
|
127
|
+
label: string;
|
|
128
|
+
/**
|
|
129
|
+
* Item icon
|
|
130
|
+
*/
|
|
131
|
+
icon?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Whether item is disabled
|
|
134
|
+
*/
|
|
135
|
+
disabled?: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Toggle group component
|
|
140
|
+
*/
|
|
141
|
+
export interface ToggleGroupSchema extends BaseSchema {
|
|
142
|
+
type: 'toggle-group';
|
|
143
|
+
/**
|
|
144
|
+
* Toggle group selection mode
|
|
145
|
+
* @default 'single'
|
|
146
|
+
*/
|
|
147
|
+
selectionType?: 'single' | 'multiple';
|
|
148
|
+
/**
|
|
149
|
+
* Toggle group variant
|
|
150
|
+
* @default 'default'
|
|
151
|
+
*/
|
|
152
|
+
variant?: 'default' | 'outline';
|
|
153
|
+
/**
|
|
154
|
+
* Toggle group size
|
|
155
|
+
* @default 'default'
|
|
156
|
+
*/
|
|
157
|
+
size?: 'default' | 'sm' | 'lg';
|
|
158
|
+
/**
|
|
159
|
+
* Toggle group items
|
|
160
|
+
*/
|
|
161
|
+
items?: ToggleGroupItem[];
|
|
162
|
+
/**
|
|
163
|
+
* Default selected value(s)
|
|
164
|
+
*/
|
|
165
|
+
defaultValue?: string | string[];
|
|
166
|
+
/**
|
|
167
|
+
* Controlled selected value(s)
|
|
168
|
+
*/
|
|
169
|
+
value?: string | string[];
|
|
170
|
+
/**
|
|
171
|
+
* Whether toggle group is disabled
|
|
172
|
+
*/
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Change handler
|
|
176
|
+
*/
|
|
177
|
+
onValueChange?: (value: string | string[]) => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
108
180
|
/**
|
|
109
181
|
* Union type of all disclosure schemas
|
|
110
182
|
*/
|
|
111
183
|
export type DisclosureSchema =
|
|
112
184
|
| AccordionSchema
|
|
113
|
-
| CollapsibleSchema
|
|
185
|
+
| CollapsibleSchema
|
|
186
|
+
| ToggleGroupSchema;
|
package/src/feedback.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 - Feedback Component Schemas
|
|
3
11
|
*
|
|
@@ -7,7 +15,7 @@
|
|
|
7
15
|
* @packageDocumentation
|
|
8
16
|
*/
|
|
9
17
|
|
|
10
|
-
import type { BaseSchema
|
|
18
|
+
import type { BaseSchema } from './base';
|
|
11
19
|
|
|
12
20
|
/**
|
|
13
21
|
* Loading/Spinner component
|
|
@@ -159,6 +167,69 @@ export interface ToasterSchema extends BaseSchema {
|
|
|
159
167
|
limit?: number;
|
|
160
168
|
}
|
|
161
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Spinner component
|
|
172
|
+
*/
|
|
173
|
+
export interface SpinnerSchema extends BaseSchema {
|
|
174
|
+
type: 'spinner';
|
|
175
|
+
/**
|
|
176
|
+
* Spinner size
|
|
177
|
+
* @default 'md'
|
|
178
|
+
*/
|
|
179
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Empty state component
|
|
184
|
+
*/
|
|
185
|
+
export interface EmptySchema extends BaseSchema {
|
|
186
|
+
type: 'empty';
|
|
187
|
+
/**
|
|
188
|
+
* Empty state title
|
|
189
|
+
*/
|
|
190
|
+
title?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Empty state description
|
|
193
|
+
*/
|
|
194
|
+
description?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Icon to display
|
|
197
|
+
*/
|
|
198
|
+
icon?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Sonner toast component (using sonner library)
|
|
203
|
+
*/
|
|
204
|
+
export interface SonnerSchema extends BaseSchema {
|
|
205
|
+
type: 'sonner';
|
|
206
|
+
/**
|
|
207
|
+
* Toast message/title
|
|
208
|
+
*/
|
|
209
|
+
message?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Toast title (alias for message)
|
|
212
|
+
*/
|
|
213
|
+
title?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Toast description
|
|
216
|
+
*/
|
|
217
|
+
description?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Toast variant
|
|
220
|
+
* @default 'default'
|
|
221
|
+
*/
|
|
222
|
+
variant?: 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
223
|
+
/**
|
|
224
|
+
* Button label to trigger toast
|
|
225
|
+
*/
|
|
226
|
+
buttonLabel?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Button variant
|
|
229
|
+
*/
|
|
230
|
+
buttonVariant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link';
|
|
231
|
+
}
|
|
232
|
+
|
|
162
233
|
/**
|
|
163
234
|
* Union type of all feedback schemas
|
|
164
235
|
*/
|
|
@@ -167,4 +238,7 @@ export type FeedbackSchema =
|
|
|
167
238
|
| ProgressSchema
|
|
168
239
|
| SkeletonSchema
|
|
169
240
|
| ToastSchema
|
|
170
|
-
| ToasterSchema
|
|
241
|
+
| ToasterSchema
|
|
242
|
+
| SpinnerSchema
|
|
243
|
+
| EmptySchema
|
|
244
|
+
| SonnerSchema;
|