@object-ui/types 0.3.0 → 0.5.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/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 +17 -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/blocks.d.ts +332 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +8 -0
- 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 +181 -3
- 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-protocol.d.ts +1268 -0
- package/dist/data-protocol.d.ts.map +1 -0
- package/dist/data-protocol.js +8 -0
- package/dist/data.d.ts +22 -1
- 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 +728 -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 +48 -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 +491 -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/plugin-scope.d.ts +194 -0
- package/dist/plugin-scope.d.ts.map +1 -0
- package/dist/plugin-scope.js +8 -0
- package/dist/registry.d.ts +7 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +7 -0
- package/dist/reports.d.ts +336 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +8 -0
- package/dist/theme.d.ts +289 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +8 -0
- package/dist/ui-action.d.ts +175 -0
- package/dist/ui-action.d.ts.map +1 -0
- package/dist/ui-action.js +8 -0
- package/dist/views.d.ts +417 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +8 -0
- package/dist/zod/app.zod.d.ts +120 -0
- package/dist/zod/app.zod.d.ts.map +1 -0
- package/dist/zod/app.zod.js +60 -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/blocks.zod.d.ts +834 -0
- package/dist/zod/blocks.zod.d.ts.map +1 -0
- package/dist/zod/blocks.zod.js +145 -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/crud.zod.d.ts +598 -0
- package/dist/zod/crud.zod.d.ts.map +1 -0
- package/dist/zod/crud.zod.js +230 -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 +4985 -0
- package/dist/zod/index.zod.d.ts.map +1 -0
- package/dist/zod/index.zod.js +183 -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/dist/zod/reports.zod.d.ts +1628 -0
- package/dist/zod/reports.zod.d.ts.map +1 -0
- package/dist/zod/reports.zod.js +152 -0
- package/dist/zod/theme.zod.d.ts +611 -0
- package/dist/zod/theme.zod.d.ts.map +1 -0
- package/dist/zod/theme.zod.js +130 -0
- package/dist/zod/views.zod.d.ts +675 -0
- package/dist/zod/views.zod.d.ts.map +1 -0
- package/dist/zod/views.zod.js +159 -0
- package/package.json +9 -1
- package/src/__tests__/namespace-exports.test.ts +80 -0
- package/src/__tests__/phase2-schemas.test.ts +639 -0
- package/src/api-types.ts +8 -0
- package/src/app.ts +20 -0
- package/src/base.ts +8 -0
- package/src/blocks.ts +405 -0
- package/src/complex.ts +69 -1
- package/src/crud.ts +185 -3
- package/src/data-display.ts +60 -2
- package/src/data-protocol.ts +1679 -0
- package/src/data.ts +21 -1
- package/src/disclosure.ts +74 -1
- package/src/feedback.ts +76 -2
- package/src/field-types.ts +846 -0
- package/src/form.ts +131 -1
- package/src/index.ts +305 -8
- package/src/layout.ts +70 -15
- package/src/navigation.ts +109 -2
- package/src/objectql.ts +563 -59
- package/src/overlay.ts +35 -1
- package/src/plugin-scope.ts +210 -0
- package/src/registry.ts +8 -0
- package/src/reports.ts +408 -0
- package/src/theme.ts +351 -0
- package/src/ui-action.ts +276 -0
- package/src/views.ts +429 -0
- package/src/zod/README.md +329 -0
- package/src/zod/app.zod.ts +72 -0
- package/src/zod/base.zod.ts +229 -0
- package/src/zod/blocks.zod.ts +170 -0
- package/src/zod/complex.zod.ts +258 -0
- package/src/zod/crud.zod.ts +259 -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 +425 -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
- package/src/zod/reports.zod.ts +183 -0
- package/src/zod/theme.zod.ts +155 -0
- package/src/zod/views.zod.ts +182 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.zod.d.ts","sourceRoot":"","sources":["../../src/zod/layout.zod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;iBAGpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;iBAIrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;iBAKrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBAI1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;iBAQrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;iBAM/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;iBAO5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;iBAOrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAiBvB,CAAC"}
|
|
@@ -0,0 +1,241 @@
|
|
|
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 - Layout Component Zod Validators
|
|
10
|
+
*
|
|
11
|
+
* Zod validation schemas for layout and container components.
|
|
12
|
+
* Following @objectstack/spec UI specification format.
|
|
13
|
+
*
|
|
14
|
+
* @module zod/layout
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
|
|
19
|
+
/**
|
|
20
|
+
* Div Schema - Basic HTML container
|
|
21
|
+
*/
|
|
22
|
+
export const DivSchema = BaseSchema.extend({
|
|
23
|
+
type: z.literal('div'),
|
|
24
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Span Schema - Inline text container
|
|
28
|
+
*/
|
|
29
|
+
export const SpanSchema = BaseSchema.extend({
|
|
30
|
+
type: z.literal('span'),
|
|
31
|
+
value: z.string().optional().describe('Text content'),
|
|
32
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Text Schema - Text display component
|
|
36
|
+
*/
|
|
37
|
+
export const TextSchema = BaseSchema.extend({
|
|
38
|
+
type: z.literal('text'),
|
|
39
|
+
value: z.string().optional().describe('Text content'),
|
|
40
|
+
variant: z.enum(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'body', 'caption', 'overline'])
|
|
41
|
+
.optional()
|
|
42
|
+
.default('body')
|
|
43
|
+
.describe('Text variant/style'),
|
|
44
|
+
align: z.enum(['left', 'center', 'right', 'justify']).optional().describe('Text alignment'),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Image Schema - Image component
|
|
48
|
+
*/
|
|
49
|
+
export const ImageSchema = BaseSchema.extend({
|
|
50
|
+
type: z.literal('image'),
|
|
51
|
+
src: z.string().describe('Image source URL'),
|
|
52
|
+
alt: z.string().optional().describe('Alt text for accessibility'),
|
|
53
|
+
width: z.union([z.string(), z.number()]).optional().describe('Image width'),
|
|
54
|
+
height: z.union([z.string(), z.number()]).optional().describe('Image height'),
|
|
55
|
+
objectFit: z.enum(['contain', 'cover', 'fill', 'none', 'scale-down']).optional().describe('Object fit property'),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Icon Schema - Icon component (Lucide icons)
|
|
59
|
+
*/
|
|
60
|
+
export const IconSchema = BaseSchema.extend({
|
|
61
|
+
type: z.literal('icon'),
|
|
62
|
+
name: z.string().describe('Icon name (lucide-react)'),
|
|
63
|
+
size: z.number().optional().default(24).describe('Icon size in pixels'),
|
|
64
|
+
color: z.string().optional().describe('Icon color'),
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Separator Schema - Divider component
|
|
68
|
+
*/
|
|
69
|
+
export const SeparatorSchema = BaseSchema.extend({
|
|
70
|
+
type: z.literal('separator'),
|
|
71
|
+
orientation: z.enum(['horizontal', 'vertical']).optional().default('horizontal').describe('Separator orientation'),
|
|
72
|
+
decorative: z.boolean().optional().describe('Whether decorative'),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Container Schema - Generic container component
|
|
76
|
+
*/
|
|
77
|
+
export const ContainerSchema = BaseSchema.extend({
|
|
78
|
+
type: z.literal('container'),
|
|
79
|
+
maxWidth: z.union([
|
|
80
|
+
z.enum(['sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl', 'full', 'screen']),
|
|
81
|
+
z.boolean(),
|
|
82
|
+
]).optional().default('lg').describe('Max width constraint'),
|
|
83
|
+
centered: z.boolean().optional().default(true).describe('Center the container'),
|
|
84
|
+
padding: z.number().optional().describe('Padding value'),
|
|
85
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Flex Schema - Flexbox layout component
|
|
89
|
+
*/
|
|
90
|
+
export const FlexSchema = BaseSchema.extend({
|
|
91
|
+
type: z.literal('flex'),
|
|
92
|
+
direction: z.enum(['row', 'col', 'row-reverse', 'col-reverse'])
|
|
93
|
+
.optional()
|
|
94
|
+
.default('row')
|
|
95
|
+
.describe('Flex direction'),
|
|
96
|
+
justify: z.enum(['start', 'end', 'center', 'between', 'around', 'evenly'])
|
|
97
|
+
.optional()
|
|
98
|
+
.default('start')
|
|
99
|
+
.describe('Justify content alignment'),
|
|
100
|
+
align: z.enum(['start', 'end', 'center', 'baseline', 'stretch'])
|
|
101
|
+
.optional()
|
|
102
|
+
.default('center')
|
|
103
|
+
.describe('Align items'),
|
|
104
|
+
gap: z.number().optional().default(2).describe('Gap between items (Tailwind scale 0-8)'),
|
|
105
|
+
wrap: z.boolean().optional().default(false).describe('Allow items to wrap'),
|
|
106
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Stack Schema - Vertical flex layout (shortcut)
|
|
110
|
+
*/
|
|
111
|
+
export const StackSchema = BaseSchema.extend({
|
|
112
|
+
type: z.literal('stack'),
|
|
113
|
+
direction: z.enum(['row', 'col', 'row-reverse', 'col-reverse']).optional(),
|
|
114
|
+
justify: z.enum(['start', 'end', 'center', 'between', 'around', 'evenly']).optional(),
|
|
115
|
+
align: z.enum(['start', 'end', 'center', 'baseline', 'stretch']).optional(),
|
|
116
|
+
gap: z.number().optional(),
|
|
117
|
+
wrap: z.boolean().optional(),
|
|
118
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* Grid Schema - CSS Grid layout component
|
|
122
|
+
*/
|
|
123
|
+
export const GridSchema = BaseSchema.extend({
|
|
124
|
+
type: z.literal('grid'),
|
|
125
|
+
columns: z.union([
|
|
126
|
+
z.number(),
|
|
127
|
+
z.record(z.string(), z.number()),
|
|
128
|
+
]).optional().default(3).describe('Number of columns (responsive)'),
|
|
129
|
+
gap: z.number().optional().default(4).describe('Gap between items (Tailwind scale 0-8)'),
|
|
130
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* Card Schema - Card component
|
|
134
|
+
*/
|
|
135
|
+
export const CardSchema = BaseSchema.extend({
|
|
136
|
+
type: z.literal('card'),
|
|
137
|
+
title: z.string().optional().describe('Card title'),
|
|
138
|
+
description: z.string().optional().describe('Card description'),
|
|
139
|
+
header: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Card header content'),
|
|
140
|
+
body: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Card body content'),
|
|
141
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Child components'),
|
|
142
|
+
footer: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Card footer content'),
|
|
143
|
+
variant: z.enum(['default', 'outline', 'ghost']).optional().default('default').describe('Card variant style'),
|
|
144
|
+
hoverable: z.boolean().optional().default(false).describe('Whether the card is hoverable'),
|
|
145
|
+
clickable: z.boolean().optional().default(false).describe('Whether the card is clickable'),
|
|
146
|
+
onClick: z.function().optional().describe('Click handler'),
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* Tab Item Schema
|
|
150
|
+
*/
|
|
151
|
+
export const TabItemSchema = z.object({
|
|
152
|
+
value: z.string().describe('Unique tab identifier'),
|
|
153
|
+
label: z.string().describe('Tab label'),
|
|
154
|
+
icon: z.string().optional().describe('Tab icon'),
|
|
155
|
+
disabled: z.boolean().optional().describe('Whether tab is disabled'),
|
|
156
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Tab content'),
|
|
157
|
+
});
|
|
158
|
+
/**
|
|
159
|
+
* Tabs Schema - Tabs component
|
|
160
|
+
*/
|
|
161
|
+
export const TabsSchema = BaseSchema.extend({
|
|
162
|
+
type: z.literal('tabs'),
|
|
163
|
+
defaultValue: z.string().optional().describe('Default active tab value'),
|
|
164
|
+
value: z.string().optional().describe('Controlled active tab value'),
|
|
165
|
+
orientation: z.enum(['horizontal', 'vertical']).optional().default('horizontal').describe('Tabs orientation'),
|
|
166
|
+
items: z.array(TabItemSchema).describe('Tab items configuration'),
|
|
167
|
+
onValueChange: z.function().optional().describe('Change handler'),
|
|
168
|
+
});
|
|
169
|
+
/**
|
|
170
|
+
* Scroll Area Schema
|
|
171
|
+
*/
|
|
172
|
+
export const ScrollAreaSchema = BaseSchema.extend({
|
|
173
|
+
type: z.literal('scroll-area'),
|
|
174
|
+
height: z.union([z.string(), z.number()]).optional().describe('Height of scroll container'),
|
|
175
|
+
width: z.union([z.string(), z.number()]).optional().describe('Width of scroll container'),
|
|
176
|
+
orientation: z.enum(['vertical', 'horizontal', 'both']).optional().default('vertical').describe('Scrollbar orientation'),
|
|
177
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional(),
|
|
178
|
+
});
|
|
179
|
+
/**
|
|
180
|
+
* Resizable Panel Schema
|
|
181
|
+
*/
|
|
182
|
+
export const ResizablePanelSchema = z.object({
|
|
183
|
+
id: z.string().describe('Unique panel identifier'),
|
|
184
|
+
defaultSize: z.number().optional().describe('Default size (percentage 0-100)'),
|
|
185
|
+
minSize: z.number().optional().describe('Minimum size (percentage 0-100)'),
|
|
186
|
+
maxSize: z.number().optional().describe('Maximum size (percentage 0-100)'),
|
|
187
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Panel content'),
|
|
188
|
+
});
|
|
189
|
+
/**
|
|
190
|
+
* Resizable Schema - Resizable panels component
|
|
191
|
+
*/
|
|
192
|
+
export const ResizableSchema = BaseSchema.extend({
|
|
193
|
+
type: z.literal('resizable'),
|
|
194
|
+
direction: z.enum(['horizontal', 'vertical']).optional().default('horizontal').describe('Direction of resizable panels'),
|
|
195
|
+
minHeight: z.union([z.string(), z.number()]).optional().describe('Minimum height'),
|
|
196
|
+
withHandle: z.boolean().optional().default(true).describe('Show resize handle'),
|
|
197
|
+
panels: z.array(ResizablePanelSchema).describe('Resizable panels'),
|
|
198
|
+
});
|
|
199
|
+
/**
|
|
200
|
+
* Aspect Ratio Schema
|
|
201
|
+
*/
|
|
202
|
+
export const AspectRatioSchema = BaseSchema.extend({
|
|
203
|
+
type: z.literal('aspect-ratio'),
|
|
204
|
+
ratio: z.number().optional().default(16 / 9).describe('Aspect ratio (width / height)'),
|
|
205
|
+
image: z.string().optional().describe('Image URL to display'),
|
|
206
|
+
alt: z.string().optional().describe('Image alt text'),
|
|
207
|
+
body: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Child components (alternative to image)'),
|
|
208
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Child components'),
|
|
209
|
+
});
|
|
210
|
+
/**
|
|
211
|
+
* Page Schema - Top-level page layout
|
|
212
|
+
*/
|
|
213
|
+
export const PageSchema = BaseSchema.extend({
|
|
214
|
+
type: z.literal('page'),
|
|
215
|
+
title: z.string().optional().describe('Page title'),
|
|
216
|
+
icon: z.string().optional().describe('Page icon (Lucide icon name)'),
|
|
217
|
+
description: z.string().optional().describe('Page description'),
|
|
218
|
+
body: z.array(SchemaNodeSchema).optional().describe('Main content array'),
|
|
219
|
+
children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Alternative content prop'),
|
|
220
|
+
});
|
|
221
|
+
/**
|
|
222
|
+
* Layout Schema Union - All layout component schemas
|
|
223
|
+
*/
|
|
224
|
+
export const LayoutSchema = z.union([
|
|
225
|
+
DivSchema,
|
|
226
|
+
SpanSchema,
|
|
227
|
+
TextSchema,
|
|
228
|
+
ImageSchema,
|
|
229
|
+
IconSchema,
|
|
230
|
+
SeparatorSchema,
|
|
231
|
+
ContainerSchema,
|
|
232
|
+
FlexSchema,
|
|
233
|
+
StackSchema,
|
|
234
|
+
GridSchema,
|
|
235
|
+
CardSchema,
|
|
236
|
+
TabsSchema,
|
|
237
|
+
ScrollAreaSchema,
|
|
238
|
+
ResizableSchema,
|
|
239
|
+
AspectRatioSchema,
|
|
240
|
+
PageSchema,
|
|
241
|
+
]);
|