@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/layout.ts
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @object-ui/types - Layout Component Schemas
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for layout and container components.
|
|
5
|
+
* These components organize and structure other components.
|
|
6
|
+
*
|
|
7
|
+
* @module layout
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { BaseSchema, SchemaNode } from './base';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Basic HTML div container
|
|
15
|
+
*/
|
|
16
|
+
export interface DivSchema extends BaseSchema {
|
|
17
|
+
type: 'div';
|
|
18
|
+
/**
|
|
19
|
+
* Child components
|
|
20
|
+
*/
|
|
21
|
+
children?: SchemaNode | SchemaNode[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Text span component for inline text
|
|
26
|
+
*/
|
|
27
|
+
export interface SpanSchema extends BaseSchema {
|
|
28
|
+
type: 'span';
|
|
29
|
+
/**
|
|
30
|
+
* Text content
|
|
31
|
+
*/
|
|
32
|
+
value?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Child components
|
|
35
|
+
*/
|
|
36
|
+
children?: SchemaNode | SchemaNode[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Text display component
|
|
41
|
+
*/
|
|
42
|
+
export interface TextSchema extends BaseSchema {
|
|
43
|
+
type: 'text';
|
|
44
|
+
/**
|
|
45
|
+
* Text content to display
|
|
46
|
+
*/
|
|
47
|
+
value?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Text variant/style
|
|
50
|
+
* @default 'body'
|
|
51
|
+
*/
|
|
52
|
+
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'caption' | 'overline';
|
|
53
|
+
/**
|
|
54
|
+
* Text alignment
|
|
55
|
+
*/
|
|
56
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Image component
|
|
61
|
+
*/
|
|
62
|
+
export interface ImageSchema extends BaseSchema {
|
|
63
|
+
type: 'image';
|
|
64
|
+
/**
|
|
65
|
+
* Image source URL
|
|
66
|
+
*/
|
|
67
|
+
src: string;
|
|
68
|
+
/**
|
|
69
|
+
* Alt text for accessibility
|
|
70
|
+
*/
|
|
71
|
+
alt?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Image width
|
|
74
|
+
*/
|
|
75
|
+
width?: string | number;
|
|
76
|
+
/**
|
|
77
|
+
* Image height
|
|
78
|
+
*/
|
|
79
|
+
height?: string | number;
|
|
80
|
+
/**
|
|
81
|
+
* Object fit property
|
|
82
|
+
*/
|
|
83
|
+
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Icon component
|
|
88
|
+
*/
|
|
89
|
+
export interface IconSchema extends BaseSchema {
|
|
90
|
+
type: 'icon';
|
|
91
|
+
/**
|
|
92
|
+
* Icon name (lucide-react icon name)
|
|
93
|
+
*/
|
|
94
|
+
name: string;
|
|
95
|
+
/**
|
|
96
|
+
* Icon size in pixels
|
|
97
|
+
* @default 24
|
|
98
|
+
*/
|
|
99
|
+
size?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Icon color
|
|
102
|
+
*/
|
|
103
|
+
color?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Separator/Divider component
|
|
108
|
+
*/
|
|
109
|
+
export interface SeparatorSchema extends BaseSchema {
|
|
110
|
+
type: 'separator';
|
|
111
|
+
/**
|
|
112
|
+
* Orientation of the separator
|
|
113
|
+
* @default 'horizontal'
|
|
114
|
+
*/
|
|
115
|
+
orientation?: 'horizontal' | 'vertical';
|
|
116
|
+
/**
|
|
117
|
+
* Whether to add decorative content
|
|
118
|
+
*/
|
|
119
|
+
decorative?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Generic container component
|
|
124
|
+
*/
|
|
125
|
+
export interface ContainerSchema extends BaseSchema {
|
|
126
|
+
type: 'container';
|
|
127
|
+
/**
|
|
128
|
+
* Max width constraint
|
|
129
|
+
* @default 'lg'
|
|
130
|
+
*/
|
|
131
|
+
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | 'full' | 'screen' | false;
|
|
132
|
+
/**
|
|
133
|
+
* Center the container
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
centered?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Padding
|
|
139
|
+
*/
|
|
140
|
+
padding?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Child components
|
|
143
|
+
*/
|
|
144
|
+
children?: SchemaNode | SchemaNode[];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Flexbox layout component
|
|
149
|
+
*/
|
|
150
|
+
export interface FlexSchema extends BaseSchema {
|
|
151
|
+
type: 'flex';
|
|
152
|
+
/**
|
|
153
|
+
* Flex direction
|
|
154
|
+
* @default 'row'
|
|
155
|
+
*/
|
|
156
|
+
direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse';
|
|
157
|
+
/**
|
|
158
|
+
* Justify content alignment
|
|
159
|
+
* @default 'start'
|
|
160
|
+
*/
|
|
161
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
162
|
+
/**
|
|
163
|
+
* Align items
|
|
164
|
+
* @default 'center'
|
|
165
|
+
*/
|
|
166
|
+
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
167
|
+
/**
|
|
168
|
+
* Gap between items (Tailwind scale 0-8)
|
|
169
|
+
* @default 2
|
|
170
|
+
*/
|
|
171
|
+
gap?: number;
|
|
172
|
+
/**
|
|
173
|
+
* Allow items to wrap
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
176
|
+
wrap?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Child components
|
|
179
|
+
*/
|
|
180
|
+
children?: SchemaNode | SchemaNode[];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Stack layout component (Vertical Flex shortcut)
|
|
185
|
+
*/
|
|
186
|
+
export interface StackSchema extends Omit<FlexSchema, 'type'> {
|
|
187
|
+
type: 'stack';
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* CSS Grid layout component
|
|
192
|
+
*/
|
|
193
|
+
export interface GridSchema extends BaseSchema {
|
|
194
|
+
type: 'grid';
|
|
195
|
+
/**
|
|
196
|
+
* Number of columns (responsive)
|
|
197
|
+
* Can be number or object: { xs: 1, sm: 2, md: 3, lg: 4 }
|
|
198
|
+
* @default 3
|
|
199
|
+
*/
|
|
200
|
+
columns?: number | Record<string, number>;
|
|
201
|
+
/**
|
|
202
|
+
* Gap between items (Tailwind scale 0-8)
|
|
203
|
+
* @default 4
|
|
204
|
+
*/
|
|
205
|
+
gap?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Child components
|
|
208
|
+
*/
|
|
209
|
+
children?: SchemaNode | SchemaNode[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Card component
|
|
214
|
+
*/
|
|
215
|
+
export interface CardSchema extends BaseSchema {
|
|
216
|
+
type: 'card';
|
|
217
|
+
/**
|
|
218
|
+
* Card title
|
|
219
|
+
*/
|
|
220
|
+
title?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Card description
|
|
223
|
+
*/
|
|
224
|
+
description?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Card header content
|
|
227
|
+
*/
|
|
228
|
+
header?: SchemaNode | SchemaNode[];
|
|
229
|
+
/**
|
|
230
|
+
* Card body/content (Legacy, use children)
|
|
231
|
+
*/
|
|
232
|
+
body?: SchemaNode | SchemaNode[];
|
|
233
|
+
/**
|
|
234
|
+
* Child components
|
|
235
|
+
*/
|
|
236
|
+
children?: SchemaNode | SchemaNode[];
|
|
237
|
+
/**
|
|
238
|
+
* Card footer content
|
|
239
|
+
*/
|
|
240
|
+
footer?: SchemaNode | SchemaNode[];
|
|
241
|
+
/**
|
|
242
|
+
* Variant style
|
|
243
|
+
* @default 'default'
|
|
244
|
+
*/
|
|
245
|
+
variant?: 'default' | 'outline' | 'ghost';
|
|
246
|
+
/**
|
|
247
|
+
* Whether the card is hoverable
|
|
248
|
+
* @default false
|
|
249
|
+
*/
|
|
250
|
+
hoverable?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Whether the card is clickable
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
|
+
clickable?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Click handler
|
|
258
|
+
*/
|
|
259
|
+
onClick?: () => void;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Tabs component
|
|
264
|
+
*/
|
|
265
|
+
export interface TabsSchema extends BaseSchema {
|
|
266
|
+
type: 'tabs';
|
|
267
|
+
/**
|
|
268
|
+
* Default active tab value
|
|
269
|
+
*/
|
|
270
|
+
defaultValue?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Controlled active tab value
|
|
273
|
+
*/
|
|
274
|
+
value?: string;
|
|
275
|
+
/**
|
|
276
|
+
* Tabs orientation
|
|
277
|
+
* @default 'horizontal'
|
|
278
|
+
*/
|
|
279
|
+
orientation?: 'horizontal' | 'vertical';
|
|
280
|
+
/**
|
|
281
|
+
* Tab items configuration
|
|
282
|
+
*/
|
|
283
|
+
items: TabItem[];
|
|
284
|
+
/**
|
|
285
|
+
* Change handler
|
|
286
|
+
*/
|
|
287
|
+
onValueChange?: (value: string) => void;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Individual tab item
|
|
292
|
+
*/
|
|
293
|
+
export interface TabItem {
|
|
294
|
+
/**
|
|
295
|
+
* Unique tab identifier
|
|
296
|
+
*/
|
|
297
|
+
value: string;
|
|
298
|
+
/**
|
|
299
|
+
* Tab label
|
|
300
|
+
*/
|
|
301
|
+
label: string;
|
|
302
|
+
/**
|
|
303
|
+
* Tab icon
|
|
304
|
+
*/
|
|
305
|
+
icon?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Whether tab is disabled
|
|
308
|
+
*/
|
|
309
|
+
disabled?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Tab content
|
|
312
|
+
*/
|
|
313
|
+
content: SchemaNode | SchemaNode[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Scroll area component
|
|
318
|
+
*/
|
|
319
|
+
export interface ScrollAreaSchema extends BaseSchema {
|
|
320
|
+
type: 'scroll-area';
|
|
321
|
+
/**
|
|
322
|
+
* Height of the scroll container
|
|
323
|
+
*/
|
|
324
|
+
height?: string | number;
|
|
325
|
+
/**
|
|
326
|
+
* Width of the scroll container
|
|
327
|
+
*/
|
|
328
|
+
width?: string | number;
|
|
329
|
+
/**
|
|
330
|
+
* Scrollbar orientation
|
|
331
|
+
* @default 'vertical'
|
|
332
|
+
*/
|
|
333
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
334
|
+
/**
|
|
335
|
+
* Child components
|
|
336
|
+
*/
|
|
337
|
+
children?: SchemaNode | SchemaNode[];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Resizable panels component
|
|
342
|
+
*/
|
|
343
|
+
export interface ResizableSchema extends BaseSchema {
|
|
344
|
+
type: 'resizable';
|
|
345
|
+
/**
|
|
346
|
+
* Direction of resizable panels
|
|
347
|
+
* @default 'horizontal'
|
|
348
|
+
*/
|
|
349
|
+
direction?: 'horizontal' | 'vertical';
|
|
350
|
+
/**
|
|
351
|
+
* Minimum Height
|
|
352
|
+
*/
|
|
353
|
+
minHeight?: string | number;
|
|
354
|
+
/**
|
|
355
|
+
* Show resize handle
|
|
356
|
+
* @default true
|
|
357
|
+
*/
|
|
358
|
+
withHandle?: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Resizable panels
|
|
361
|
+
*/
|
|
362
|
+
panels: ResizablePanel[];
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Individual resizable panel
|
|
367
|
+
*/
|
|
368
|
+
export interface ResizablePanel {
|
|
369
|
+
/**
|
|
370
|
+
* Unique panel identifier
|
|
371
|
+
*/
|
|
372
|
+
id: string;
|
|
373
|
+
/**
|
|
374
|
+
* Default size (percentage 0-100)
|
|
375
|
+
*/
|
|
376
|
+
defaultSize?: number;
|
|
377
|
+
/**
|
|
378
|
+
* Minimum size (percentage 0-100)
|
|
379
|
+
*/
|
|
380
|
+
minSize?: number;
|
|
381
|
+
/**
|
|
382
|
+
* Maximum size (percentage 0-100)
|
|
383
|
+
*/
|
|
384
|
+
maxSize?: number;
|
|
385
|
+
/**
|
|
386
|
+
* Panel content
|
|
387
|
+
*/
|
|
388
|
+
content: SchemaNode | SchemaNode[];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Page layout component
|
|
393
|
+
* Top-level container for a page route
|
|
394
|
+
*/
|
|
395
|
+
export interface PageSchema extends BaseSchema {
|
|
396
|
+
type: 'page';
|
|
397
|
+
/**
|
|
398
|
+
* Page title
|
|
399
|
+
*/
|
|
400
|
+
title?: string;
|
|
401
|
+
/**
|
|
402
|
+
* Page icon (Lucide icon name)
|
|
403
|
+
*/
|
|
404
|
+
icon?: string;
|
|
405
|
+
/**
|
|
406
|
+
* Page description
|
|
407
|
+
*/
|
|
408
|
+
description?: string;
|
|
409
|
+
/**
|
|
410
|
+
* Main content array
|
|
411
|
+
*/
|
|
412
|
+
body?: SchemaNode[];
|
|
413
|
+
/**
|
|
414
|
+
* Alternative content prop
|
|
415
|
+
*/
|
|
416
|
+
children?: SchemaNode | SchemaNode[];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Union type of all layout schemas
|
|
421
|
+
*/
|
|
422
|
+
export type LayoutSchema =
|
|
423
|
+
| DivSchema
|
|
424
|
+
| SpanSchema
|
|
425
|
+
| TextSchema
|
|
426
|
+
| ImageSchema
|
|
427
|
+
| IconSchema
|
|
428
|
+
| SeparatorSchema
|
|
429
|
+
| ContainerSchema
|
|
430
|
+
| FlexSchema
|
|
431
|
+
| GridSchema
|
|
432
|
+
| CardSchema
|
|
433
|
+
| TabsSchema
|
|
434
|
+
| ScrollAreaSchema
|
|
435
|
+
| ResizableSchema
|
|
436
|
+
| PageSchema;
|
|
437
|
+
|
|
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
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @object-ui/types - Navigation Component Schemas
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for navigation and menu components.
|
|
5
|
+
*
|
|
6
|
+
* @module navigation
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { BaseSchema, SchemaNode } from './base';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Navigation link
|
|
14
|
+
*/
|
|
15
|
+
export interface NavLink {
|
|
16
|
+
/**
|
|
17
|
+
* Link label
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Link URL/href
|
|
22
|
+
*/
|
|
23
|
+
href: string;
|
|
24
|
+
/**
|
|
25
|
+
* Link icon
|
|
26
|
+
*/
|
|
27
|
+
icon?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether link is active
|
|
30
|
+
*/
|
|
31
|
+
active?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether link is disabled
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Submenu links
|
|
38
|
+
*/
|
|
39
|
+
children?: NavLink[];
|
|
40
|
+
/**
|
|
41
|
+
* Badge content
|
|
42
|
+
*/
|
|
43
|
+
badge?: string | number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Header bar component
|
|
48
|
+
*/
|
|
49
|
+
export interface HeaderBarSchema extends BaseSchema {
|
|
50
|
+
type: 'header-bar';
|
|
51
|
+
/**
|
|
52
|
+
* Header title/brand
|
|
53
|
+
*/
|
|
54
|
+
title?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Brand logo image URL
|
|
57
|
+
*/
|
|
58
|
+
logo?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Navigation links
|
|
61
|
+
*/
|
|
62
|
+
nav?: NavLink[];
|
|
63
|
+
/**
|
|
64
|
+
* Left side content
|
|
65
|
+
*/
|
|
66
|
+
left?: SchemaNode | SchemaNode[];
|
|
67
|
+
/**
|
|
68
|
+
* Center content
|
|
69
|
+
*/
|
|
70
|
+
center?: SchemaNode | SchemaNode[];
|
|
71
|
+
/**
|
|
72
|
+
* Right side content
|
|
73
|
+
*/
|
|
74
|
+
right?: SchemaNode | SchemaNode[];
|
|
75
|
+
/**
|
|
76
|
+
* Whether header is sticky
|
|
77
|
+
* @default true
|
|
78
|
+
*/
|
|
79
|
+
sticky?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Header height
|
|
82
|
+
*/
|
|
83
|
+
height?: string | number;
|
|
84
|
+
/**
|
|
85
|
+
* Header variant
|
|
86
|
+
* @default 'default'
|
|
87
|
+
*/
|
|
88
|
+
variant?: 'default' | 'bordered' | 'floating';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Sidebar component
|
|
93
|
+
*/
|
|
94
|
+
export interface SidebarSchema extends BaseSchema {
|
|
95
|
+
type: 'sidebar';
|
|
96
|
+
/**
|
|
97
|
+
* Sidebar title
|
|
98
|
+
*/
|
|
99
|
+
title?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Navigation links
|
|
102
|
+
*/
|
|
103
|
+
nav?: NavLink[];
|
|
104
|
+
/**
|
|
105
|
+
* Sidebar content (alternative to nav)
|
|
106
|
+
*/
|
|
107
|
+
content?: SchemaNode | SchemaNode[];
|
|
108
|
+
/**
|
|
109
|
+
* Footer content
|
|
110
|
+
*/
|
|
111
|
+
footer?: SchemaNode | SchemaNode[];
|
|
112
|
+
/**
|
|
113
|
+
* Sidebar position
|
|
114
|
+
* @default 'left'
|
|
115
|
+
*/
|
|
116
|
+
position?: 'left' | 'right';
|
|
117
|
+
/**
|
|
118
|
+
* Whether sidebar is collapsible
|
|
119
|
+
* @default true
|
|
120
|
+
*/
|
|
121
|
+
collapsible?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Default collapsed state
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
defaultCollapsed?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Controlled collapsed state
|
|
129
|
+
*/
|
|
130
|
+
collapsed?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Sidebar width when expanded
|
|
133
|
+
* @default '16rem'
|
|
134
|
+
*/
|
|
135
|
+
width?: string | number;
|
|
136
|
+
/**
|
|
137
|
+
* Sidebar width when collapsed
|
|
138
|
+
* @default '4rem'
|
|
139
|
+
*/
|
|
140
|
+
collapsedWidth?: string | number;
|
|
141
|
+
/**
|
|
142
|
+
* Collapsed state change handler
|
|
143
|
+
*/
|
|
144
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Sidebar variant
|
|
147
|
+
* @default 'default'
|
|
148
|
+
*/
|
|
149
|
+
variant?: 'default' | 'bordered' | 'floating';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Breadcrumb item
|
|
154
|
+
*/
|
|
155
|
+
export interface BreadcrumbItem {
|
|
156
|
+
/**
|
|
157
|
+
* Item label
|
|
158
|
+
*/
|
|
159
|
+
label: string;
|
|
160
|
+
/**
|
|
161
|
+
* Item URL/href
|
|
162
|
+
*/
|
|
163
|
+
href?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Item icon
|
|
166
|
+
*/
|
|
167
|
+
icon?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Click handler (if not using href)
|
|
170
|
+
*/
|
|
171
|
+
onClick?: () => void;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Breadcrumb component
|
|
176
|
+
*/
|
|
177
|
+
export interface BreadcrumbSchema extends BaseSchema {
|
|
178
|
+
type: 'breadcrumb';
|
|
179
|
+
/**
|
|
180
|
+
* Breadcrumb items
|
|
181
|
+
*/
|
|
182
|
+
items: BreadcrumbItem[];
|
|
183
|
+
/**
|
|
184
|
+
* Separator character/icon
|
|
185
|
+
* @default '/'
|
|
186
|
+
*/
|
|
187
|
+
separator?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Maximum items to display before collapsing
|
|
190
|
+
*/
|
|
191
|
+
maxItems?: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Pagination component
|
|
196
|
+
*/
|
|
197
|
+
export interface PaginationSchema extends BaseSchema {
|
|
198
|
+
type: 'pagination';
|
|
199
|
+
/**
|
|
200
|
+
* Current page (1-indexed)
|
|
201
|
+
*/
|
|
202
|
+
page: number;
|
|
203
|
+
/**
|
|
204
|
+
* Total number of pages
|
|
205
|
+
*/
|
|
206
|
+
totalPages: number;
|
|
207
|
+
/**
|
|
208
|
+
* Number of sibling pages to show
|
|
209
|
+
* @default 1
|
|
210
|
+
*/
|
|
211
|
+
siblings?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Show first/last buttons
|
|
214
|
+
* @default true
|
|
215
|
+
*/
|
|
216
|
+
showFirstLast?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Show previous/next buttons
|
|
219
|
+
* @default true
|
|
220
|
+
*/
|
|
221
|
+
showPrevNext?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Page change handler
|
|
224
|
+
*/
|
|
225
|
+
onPageChange?: (page: number) => void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Union type of all navigation schemas
|
|
230
|
+
*/
|
|
231
|
+
export type NavigationSchema =
|
|
232
|
+
| HeaderBarSchema
|
|
233
|
+
| SidebarSchema
|
|
234
|
+
| BreadcrumbSchema
|
|
235
|
+
| PaginationSchema;
|