@object-ui/types 0.3.0
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/LICENSE +21 -0
- package/README.md +304 -0
- package/dist/api-types.d.ts +451 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +10 -0
- package/dist/app.d.ts +120 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +7 -0
- package/dist/base.d.ts +360 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +10 -0
- package/dist/complex.d.ts +433 -0
- package/dist/complex.d.ts.map +1 -0
- package/dist/complex.js +9 -0
- package/dist/crud.d.ts +457 -0
- package/dist/crud.d.ts.map +1 -0
- package/dist/crud.js +10 -0
- package/dist/data-display.d.ts +599 -0
- package/dist/data-display.d.ts.map +1 -0
- package/dist/data-display.js +9 -0
- package/dist/data.d.ts +295 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +10 -0
- package/dist/disclosure.d.ts +107 -0
- package/dist/disclosure.d.ts.map +1 -0
- package/dist/disclosure.js +9 -0
- package/dist/feedback.d.ts +159 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +9 -0
- package/dist/form.d.ts +932 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +9 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/layout.d.ts +418 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +10 -0
- package/dist/navigation.d.ts +224 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +9 -0
- package/dist/objectql.d.ts +254 -0
- package/dist/objectql.d.ts.map +1 -0
- package/dist/objectql.js +10 -0
- package/dist/overlay.d.ts +396 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +9 -0
- package/dist/registry.d.ts +85 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +1 -0
- package/package.json +82 -0
- package/src/api-types.ts +464 -0
- package/src/app.ts +138 -0
- package/src/base.ts +416 -0
- package/src/complex.ts +465 -0
- package/src/crud.ts +467 -0
- package/src/data-display.ts +630 -0
- package/src/data.ts +341 -0
- package/src/disclosure.ts +113 -0
- package/src/feedback.ts +170 -0
- package/src/form.ts +954 -0
- package/src/index.ts +350 -0
- package/src/layout.ts +451 -0
- package/src/navigation.ts +235 -0
- package/src/objectql.ts +301 -0
- package/src/overlay.ts +418 -0
- package/src/registry.ts +182 -0
package/src/objectql.ts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @object-ui/types - ObjectQL Component Schemas
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for ObjectQL-specific components.
|
|
5
|
+
* These schemas enable building ObjectQL-aware interfaces directly from object metadata.
|
|
6
|
+
*
|
|
7
|
+
* @module objectql
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { BaseSchema } from './base';
|
|
12
|
+
import type { TableColumn } from './data-display';
|
|
13
|
+
import type { FormField } from './form';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* ObjectTable Schema
|
|
17
|
+
* A specialized table component that automatically fetches and displays data from ObjectQL objects.
|
|
18
|
+
* It reads the object schema from ObjectQL and generates columns automatically.
|
|
19
|
+
*/
|
|
20
|
+
export interface ObjectTableSchema extends BaseSchema {
|
|
21
|
+
type: 'object-table';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* ObjectQL object name (e.g., 'users', 'accounts', 'contacts')
|
|
25
|
+
*/
|
|
26
|
+
objectName: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optional title for the table
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Optional description
|
|
35
|
+
*/
|
|
36
|
+
description?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Field names to display as columns
|
|
40
|
+
* If not specified, uses all visible fields from object schema
|
|
41
|
+
*/
|
|
42
|
+
fields?: string[];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Custom column configurations
|
|
46
|
+
* Overrides auto-generated columns for specific fields
|
|
47
|
+
*/
|
|
48
|
+
columns?: TableColumn[];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Enable/disable built-in operations
|
|
52
|
+
*/
|
|
53
|
+
operations?: {
|
|
54
|
+
/**
|
|
55
|
+
* Enable create operation
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
create?: boolean;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Enable read/view operation
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
read?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Enable update operation
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
update?: boolean;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Enable delete operation
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
delete?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Enable export operation
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
export?: boolean;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Enable import operation
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
import?: boolean;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Default filters to apply
|
|
93
|
+
*/
|
|
94
|
+
defaultFilters?: Record<string, any>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Default sort configuration
|
|
98
|
+
*/
|
|
99
|
+
defaultSort?: {
|
|
100
|
+
field: string;
|
|
101
|
+
order: 'asc' | 'desc';
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Page size
|
|
106
|
+
* @default 10
|
|
107
|
+
*/
|
|
108
|
+
pageSize?: number;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Enable row selection
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
selectable?: boolean | 'single' | 'multiple';
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Show search box
|
|
118
|
+
* @default true
|
|
119
|
+
*/
|
|
120
|
+
showSearch?: boolean;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Show filters
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
showFilters?: boolean;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Show pagination
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
showPagination?: boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Custom row actions
|
|
136
|
+
*/
|
|
137
|
+
rowActions?: string[];
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Custom batch actions
|
|
141
|
+
*/
|
|
142
|
+
batchActions?: string[];
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Custom CSS class
|
|
146
|
+
*/
|
|
147
|
+
className?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* ObjectForm Schema
|
|
152
|
+
* A smart form component that generates forms from ObjectQL object schemas.
|
|
153
|
+
* It automatically creates form fields based on object metadata.
|
|
154
|
+
*/
|
|
155
|
+
export interface ObjectFormSchema extends BaseSchema {
|
|
156
|
+
type: 'object-form';
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* ObjectQL object name (e.g., 'users', 'accounts', 'contacts')
|
|
160
|
+
*/
|
|
161
|
+
objectName: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Form mode
|
|
165
|
+
*/
|
|
166
|
+
mode: 'create' | 'edit' | 'view';
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Record ID (required for edit/view modes)
|
|
170
|
+
*/
|
|
171
|
+
recordId?: string | number;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Optional title for the form
|
|
175
|
+
*/
|
|
176
|
+
title?: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Optional description
|
|
180
|
+
*/
|
|
181
|
+
description?: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Field names to include in the form
|
|
185
|
+
* If not specified, uses all editable fields from object schema
|
|
186
|
+
*/
|
|
187
|
+
fields?: string[];
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Custom field configurations
|
|
191
|
+
* Overrides auto-generated fields for specific fields
|
|
192
|
+
*/
|
|
193
|
+
customFields?: FormField[];
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Field groups for organized layout
|
|
197
|
+
*/
|
|
198
|
+
groups?: Array<{
|
|
199
|
+
title?: string;
|
|
200
|
+
description?: string;
|
|
201
|
+
fields: string[];
|
|
202
|
+
collapsible?: boolean;
|
|
203
|
+
defaultCollapsed?: boolean;
|
|
204
|
+
}>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Form layout.
|
|
208
|
+
*
|
|
209
|
+
* Supported layouts:
|
|
210
|
+
* - `vertical` – label above field (default)
|
|
211
|
+
* - `horizontal` – label and field in a row
|
|
212
|
+
* - `inline` – compact inline layout, typically used in toolbars
|
|
213
|
+
* - `grid` – **experimental** grid layout
|
|
214
|
+
*
|
|
215
|
+
* Note: As of the current implementation, the underlying form renderer does not yet
|
|
216
|
+
* support a native `grid` layout and will internally treat `layout: "grid"` as
|
|
217
|
+
* `layout: "vertical"`. This value is exposed in the schema for forward compatibility,
|
|
218
|
+
* and behavior may change once grid support is implemented.
|
|
219
|
+
*
|
|
220
|
+
* @default 'vertical'
|
|
221
|
+
*/
|
|
222
|
+
layout?: 'vertical' | 'horizontal' | 'inline' | 'grid';
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Grid columns (for grid layout).
|
|
226
|
+
*
|
|
227
|
+
* Intended number of columns when using a `grid` layout. Current renderers that do
|
|
228
|
+
* not implement true grid support may ignore this value and fall back to a vertical
|
|
229
|
+
* layout. When grid layout is supported, this value should control how many form
|
|
230
|
+
* fields are placed per row.
|
|
231
|
+
*
|
|
232
|
+
* @default 2
|
|
233
|
+
*/
|
|
234
|
+
columns?: number;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Show submit button
|
|
238
|
+
* @default true
|
|
239
|
+
*/
|
|
240
|
+
showSubmit?: boolean;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Submit button text
|
|
244
|
+
*/
|
|
245
|
+
submitText?: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Show cancel button
|
|
249
|
+
* @default true
|
|
250
|
+
*/
|
|
251
|
+
showCancel?: boolean;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Cancel button text
|
|
255
|
+
*/
|
|
256
|
+
cancelText?: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Show reset button
|
|
260
|
+
* @default false
|
|
261
|
+
*/
|
|
262
|
+
showReset?: boolean;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Initial values (for create mode)
|
|
266
|
+
*/
|
|
267
|
+
initialValues?: Record<string, any>;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Callback on successful submission
|
|
271
|
+
*/
|
|
272
|
+
onSuccess?: (data: any) => void | Promise<void>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Callback on error
|
|
276
|
+
*/
|
|
277
|
+
onError?: (error: Error) => void;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Callback on cancel
|
|
281
|
+
*/
|
|
282
|
+
onCancel?: () => void;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Read-only mode
|
|
286
|
+
* @default false
|
|
287
|
+
*/
|
|
288
|
+
readOnly?: boolean;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Custom CSS class
|
|
292
|
+
*/
|
|
293
|
+
className?: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Union type of all ObjectQL component schemas
|
|
298
|
+
*/
|
|
299
|
+
export type ObjectQLComponentSchema =
|
|
300
|
+
| ObjectTableSchema
|
|
301
|
+
| ObjectFormSchema;
|
package/src/overlay.ts
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @object-ui/types - Overlay Component Schemas
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for modal, dialog, and overlay components.
|
|
5
|
+
*
|
|
6
|
+
* @module overlay
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { BaseSchema, SchemaNode } from './base';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Position type for overlays
|
|
14
|
+
*/
|
|
15
|
+
export type OverlayPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Alignment type for overlays
|
|
19
|
+
*/
|
|
20
|
+
export type OverlayAlignment = 'start' | 'center' | 'end';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Dialog component
|
|
24
|
+
*/
|
|
25
|
+
export interface DialogSchema extends BaseSchema {
|
|
26
|
+
type: 'dialog';
|
|
27
|
+
/**
|
|
28
|
+
* Dialog title
|
|
29
|
+
*/
|
|
30
|
+
title?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Dialog description
|
|
33
|
+
*/
|
|
34
|
+
description?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Dialog content
|
|
37
|
+
*/
|
|
38
|
+
content?: SchemaNode | SchemaNode[];
|
|
39
|
+
/**
|
|
40
|
+
* Dialog trigger (button or element that opens the dialog)
|
|
41
|
+
*/
|
|
42
|
+
trigger?: SchemaNode;
|
|
43
|
+
/**
|
|
44
|
+
* Default open state
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
defaultOpen?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Controlled open state
|
|
50
|
+
*/
|
|
51
|
+
open?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Dialog footer content
|
|
54
|
+
*/
|
|
55
|
+
footer?: SchemaNode | SchemaNode[];
|
|
56
|
+
/**
|
|
57
|
+
* Whether dialog is modal (prevents interaction with background)
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
modal?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Open state change handler
|
|
63
|
+
*/
|
|
64
|
+
onOpenChange?: (open: boolean) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Alert dialog (confirmation dialog)
|
|
69
|
+
*/
|
|
70
|
+
export interface AlertDialogSchema extends BaseSchema {
|
|
71
|
+
type: 'alert-dialog';
|
|
72
|
+
/**
|
|
73
|
+
* Dialog title
|
|
74
|
+
*/
|
|
75
|
+
title?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Dialog description
|
|
78
|
+
*/
|
|
79
|
+
description?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Dialog trigger
|
|
82
|
+
*/
|
|
83
|
+
trigger?: SchemaNode;
|
|
84
|
+
/**
|
|
85
|
+
* Default open state
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
defaultOpen?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Controlled open state
|
|
91
|
+
*/
|
|
92
|
+
open?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Cancel button label
|
|
95
|
+
* @default 'Cancel'
|
|
96
|
+
*/
|
|
97
|
+
cancelLabel?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Confirm button label
|
|
100
|
+
* @default 'Confirm'
|
|
101
|
+
*/
|
|
102
|
+
confirmLabel?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Confirm button variant
|
|
105
|
+
* @default 'default'
|
|
106
|
+
*/
|
|
107
|
+
confirmVariant?: 'default' | 'destructive';
|
|
108
|
+
/**
|
|
109
|
+
* Confirm handler
|
|
110
|
+
*/
|
|
111
|
+
onConfirm?: () => void | Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Cancel handler
|
|
114
|
+
*/
|
|
115
|
+
onCancel?: () => void;
|
|
116
|
+
/**
|
|
117
|
+
* Open state change handler
|
|
118
|
+
*/
|
|
119
|
+
onOpenChange?: (open: boolean) => void;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sheet/Drawer side panel
|
|
124
|
+
*/
|
|
125
|
+
export interface SheetSchema extends BaseSchema {
|
|
126
|
+
type: 'sheet';
|
|
127
|
+
/**
|
|
128
|
+
* Sheet title
|
|
129
|
+
*/
|
|
130
|
+
title?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Sheet description
|
|
133
|
+
*/
|
|
134
|
+
description?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Sheet content
|
|
137
|
+
*/
|
|
138
|
+
content?: SchemaNode | SchemaNode[];
|
|
139
|
+
/**
|
|
140
|
+
* Sheet trigger
|
|
141
|
+
*/
|
|
142
|
+
trigger?: SchemaNode;
|
|
143
|
+
/**
|
|
144
|
+
* Default open state
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
147
|
+
defaultOpen?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Controlled open state
|
|
150
|
+
*/
|
|
151
|
+
open?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Sheet side
|
|
154
|
+
* @default 'right'
|
|
155
|
+
*/
|
|
156
|
+
side?: OverlayPosition;
|
|
157
|
+
/**
|
|
158
|
+
* Sheet footer content
|
|
159
|
+
*/
|
|
160
|
+
footer?: SchemaNode | SchemaNode[];
|
|
161
|
+
/**
|
|
162
|
+
* Open state change handler
|
|
163
|
+
*/
|
|
164
|
+
onOpenChange?: (open: boolean) => void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Drawer component (alternative name for Sheet)
|
|
169
|
+
*/
|
|
170
|
+
export interface DrawerSchema extends BaseSchema {
|
|
171
|
+
type: 'drawer';
|
|
172
|
+
/**
|
|
173
|
+
* Drawer title
|
|
174
|
+
*/
|
|
175
|
+
title?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Drawer description
|
|
178
|
+
*/
|
|
179
|
+
description?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Drawer content
|
|
182
|
+
*/
|
|
183
|
+
content?: SchemaNode | SchemaNode[];
|
|
184
|
+
/**
|
|
185
|
+
* Drawer trigger
|
|
186
|
+
*/
|
|
187
|
+
trigger?: SchemaNode;
|
|
188
|
+
/**
|
|
189
|
+
* Default open state
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
defaultOpen?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Controlled open state
|
|
195
|
+
*/
|
|
196
|
+
open?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Drawer direction
|
|
199
|
+
* @default 'right'
|
|
200
|
+
*/
|
|
201
|
+
direction?: OverlayPosition;
|
|
202
|
+
/**
|
|
203
|
+
* Open state change handler
|
|
204
|
+
*/
|
|
205
|
+
onOpenChange?: (open: boolean) => void;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Popover component
|
|
210
|
+
*/
|
|
211
|
+
export interface PopoverSchema extends BaseSchema {
|
|
212
|
+
type: 'popover';
|
|
213
|
+
/**
|
|
214
|
+
* Popover content
|
|
215
|
+
*/
|
|
216
|
+
content: SchemaNode | SchemaNode[];
|
|
217
|
+
/**
|
|
218
|
+
* Popover trigger
|
|
219
|
+
*/
|
|
220
|
+
trigger: SchemaNode;
|
|
221
|
+
/**
|
|
222
|
+
* Default open state
|
|
223
|
+
* @default false
|
|
224
|
+
*/
|
|
225
|
+
defaultOpen?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Controlled open state
|
|
228
|
+
*/
|
|
229
|
+
open?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Popover side
|
|
232
|
+
* @default 'bottom'
|
|
233
|
+
*/
|
|
234
|
+
side?: OverlayPosition;
|
|
235
|
+
/**
|
|
236
|
+
* Popover alignment
|
|
237
|
+
* @default 'center'
|
|
238
|
+
*/
|
|
239
|
+
align?: OverlayAlignment;
|
|
240
|
+
/**
|
|
241
|
+
* Open state change handler
|
|
242
|
+
*/
|
|
243
|
+
onOpenChange?: (open: boolean) => void;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Tooltip component
|
|
248
|
+
*/
|
|
249
|
+
export interface TooltipSchema extends BaseSchema {
|
|
250
|
+
type: 'tooltip';
|
|
251
|
+
/**
|
|
252
|
+
* Tooltip content/text
|
|
253
|
+
*/
|
|
254
|
+
content: string | SchemaNode;
|
|
255
|
+
/**
|
|
256
|
+
* Element to attach tooltip to
|
|
257
|
+
*/
|
|
258
|
+
children: SchemaNode;
|
|
259
|
+
/**
|
|
260
|
+
* Tooltip side
|
|
261
|
+
* @default 'top'
|
|
262
|
+
*/
|
|
263
|
+
side?: OverlayPosition;
|
|
264
|
+
/**
|
|
265
|
+
* Tooltip alignment
|
|
266
|
+
* @default 'center'
|
|
267
|
+
*/
|
|
268
|
+
align?: OverlayAlignment;
|
|
269
|
+
/**
|
|
270
|
+
* Delay before showing (ms)
|
|
271
|
+
* @default 200
|
|
272
|
+
*/
|
|
273
|
+
delayDuration?: number;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Hover card component
|
|
278
|
+
*/
|
|
279
|
+
export interface HoverCardSchema extends BaseSchema {
|
|
280
|
+
type: 'hover-card';
|
|
281
|
+
/**
|
|
282
|
+
* Hover card content
|
|
283
|
+
*/
|
|
284
|
+
content: SchemaNode | SchemaNode[];
|
|
285
|
+
/**
|
|
286
|
+
* Hover trigger element
|
|
287
|
+
*/
|
|
288
|
+
trigger: SchemaNode;
|
|
289
|
+
/**
|
|
290
|
+
* Default open state
|
|
291
|
+
* @default false
|
|
292
|
+
*/
|
|
293
|
+
defaultOpen?: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Controlled open state
|
|
296
|
+
*/
|
|
297
|
+
open?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Hover card side
|
|
300
|
+
* @default 'bottom'
|
|
301
|
+
*/
|
|
302
|
+
side?: OverlayPosition;
|
|
303
|
+
/**
|
|
304
|
+
* Open delay (ms)
|
|
305
|
+
* @default 200
|
|
306
|
+
*/
|
|
307
|
+
openDelay?: number;
|
|
308
|
+
/**
|
|
309
|
+
* Close delay (ms)
|
|
310
|
+
* @default 300
|
|
311
|
+
*/
|
|
312
|
+
closeDelay?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Open state change handler
|
|
315
|
+
*/
|
|
316
|
+
onOpenChange?: (open: boolean) => void;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Menu item
|
|
321
|
+
*/
|
|
322
|
+
export interface MenuItem {
|
|
323
|
+
/**
|
|
324
|
+
* Menu item label
|
|
325
|
+
*/
|
|
326
|
+
label: string;
|
|
327
|
+
/**
|
|
328
|
+
* Menu item icon
|
|
329
|
+
*/
|
|
330
|
+
icon?: string;
|
|
331
|
+
/**
|
|
332
|
+
* Whether item is disabled
|
|
333
|
+
*/
|
|
334
|
+
disabled?: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Click handler
|
|
337
|
+
*/
|
|
338
|
+
onClick?: () => void;
|
|
339
|
+
/**
|
|
340
|
+
* Keyboard shortcut
|
|
341
|
+
*/
|
|
342
|
+
shortcut?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Submenu items
|
|
345
|
+
*/
|
|
346
|
+
children?: MenuItem[];
|
|
347
|
+
/**
|
|
348
|
+
* Separator (renders as divider)
|
|
349
|
+
*/
|
|
350
|
+
separator?: boolean;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Dropdown menu component
|
|
355
|
+
*/
|
|
356
|
+
export interface DropdownMenuSchema extends BaseSchema {
|
|
357
|
+
type: 'dropdown-menu';
|
|
358
|
+
/**
|
|
359
|
+
* Menu items
|
|
360
|
+
*/
|
|
361
|
+
items: MenuItem[];
|
|
362
|
+
/**
|
|
363
|
+
* Menu trigger
|
|
364
|
+
*/
|
|
365
|
+
trigger: SchemaNode;
|
|
366
|
+
/**
|
|
367
|
+
* Default open state
|
|
368
|
+
* @default false
|
|
369
|
+
*/
|
|
370
|
+
defaultOpen?: boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Controlled open state
|
|
373
|
+
*/
|
|
374
|
+
open?: boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Menu side
|
|
377
|
+
* @default 'bottom'
|
|
378
|
+
*/
|
|
379
|
+
side?: OverlayPosition;
|
|
380
|
+
/**
|
|
381
|
+
* Menu alignment
|
|
382
|
+
* @default 'start'
|
|
383
|
+
*/
|
|
384
|
+
align?: OverlayAlignment;
|
|
385
|
+
/**
|
|
386
|
+
* Open state change handler
|
|
387
|
+
*/
|
|
388
|
+
onOpenChange?: (open: boolean) => void;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Context menu component
|
|
393
|
+
*/
|
|
394
|
+
export interface ContextMenuSchema extends BaseSchema {
|
|
395
|
+
type: 'context-menu';
|
|
396
|
+
/**
|
|
397
|
+
* Menu items
|
|
398
|
+
*/
|
|
399
|
+
items: MenuItem[];
|
|
400
|
+
/**
|
|
401
|
+
* Element to attach context menu to
|
|
402
|
+
*/
|
|
403
|
+
children: SchemaNode | SchemaNode[];
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Union type of all overlay schemas
|
|
408
|
+
*/
|
|
409
|
+
export type OverlaySchema =
|
|
410
|
+
| DialogSchema
|
|
411
|
+
| AlertDialogSchema
|
|
412
|
+
| SheetSchema
|
|
413
|
+
| DrawerSchema
|
|
414
|
+
| PopoverSchema
|
|
415
|
+
| TooltipSchema
|
|
416
|
+
| HoverCardSchema
|
|
417
|
+
| DropdownMenuSchema
|
|
418
|
+
| ContextMenuSchema;
|