@wire-dsl/language-support 0.0.3 → 0.2.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 +1 -1
- package/dist/completions.d.ts +1 -1
- package/dist/completions.d.ts.map +1 -1
- package/dist/completions.js +55 -95
- package/dist/completions.js.map +1 -1
- package/dist/components.d.ts +14 -12
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +342 -169
- package/dist/components.js.map +1 -1
- package/dist/context-detection.d.ts.map +1 -1
- package/dist/context-detection.js +8 -9
- package/dist/context-detection.js.map +1 -1
- package/dist/documentation.d.ts.map +1 -1
- package/dist/documentation.js +25 -20
- package/dist/documentation.js.map +1 -1
- package/dist/generate-grammar.d.ts.map +1 -1
- package/dist/generate-grammar.js +31 -4
- package/dist/generate-grammar.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,267 +1,440 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wire DSL Component Metadata
|
|
3
|
-
* Used for autocompletion and
|
|
3
|
+
* Used for autocompletion, validation, and code intelligence.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* 1. Built-in components: Check packages/engine/src/renderer/index.ts renderComponent() method
|
|
7
|
-
* for latest component implementations. Update this file when new components are added.
|
|
8
|
-
* 2. User-defined components: Syntax is `define Component "Name" { ... }`
|
|
9
|
-
* These are parsed and resolved before IR generation.
|
|
10
|
-
*
|
|
11
|
-
* Total components: 32 built-in + unlimited user-defined
|
|
12
|
-
* Last synced: February 2, 2026
|
|
5
|
+
* Last synced: February 16, 2026
|
|
13
6
|
*/
|
|
7
|
+
// Reusable Enum Definitions
|
|
8
|
+
const sizeEnum = { name: 'size', type: 'enum', options: ['sm', 'md', 'lg'] };
|
|
9
|
+
const spacingEnum = {
|
|
10
|
+
name: 'spacing',
|
|
11
|
+
type: 'enum',
|
|
12
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
13
|
+
};
|
|
14
|
+
const variantEnum = {
|
|
15
|
+
name: 'variant',
|
|
16
|
+
type: 'enum',
|
|
17
|
+
options: ['primary', 'secondary', 'success', 'warning', 'danger', 'info'],
|
|
18
|
+
};
|
|
19
|
+
const variantWithDefaultEnum = {
|
|
20
|
+
name: 'variant',
|
|
21
|
+
type: 'enum',
|
|
22
|
+
options: ['default', 'primary', 'secondary', 'success', 'warning', 'danger', 'info'],
|
|
23
|
+
};
|
|
24
|
+
const headingLevelEnum = {
|
|
25
|
+
name: 'level',
|
|
26
|
+
type: 'enum',
|
|
27
|
+
options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
28
|
+
};
|
|
29
|
+
const headingSpacingEnum = {
|
|
30
|
+
name: 'spacing',
|
|
31
|
+
type: 'enum',
|
|
32
|
+
options: spacingEnum.options,
|
|
33
|
+
};
|
|
34
|
+
const imagePlaceholderEnum = {
|
|
35
|
+
name: 'placeholder',
|
|
36
|
+
type: 'enum',
|
|
37
|
+
options: ['landscape', 'portrait', 'square', 'icon', 'avatar'],
|
|
38
|
+
};
|
|
14
39
|
export const COMPONENTS = {
|
|
15
|
-
// Text Components
|
|
16
40
|
Heading: {
|
|
17
41
|
name: 'Heading',
|
|
18
|
-
description: 'Large heading
|
|
19
|
-
|
|
20
|
-
|
|
42
|
+
description: 'Large heading text with level-based typography.',
|
|
43
|
+
category: 'Text',
|
|
44
|
+
properties: {
|
|
45
|
+
text: { name: 'text', type: 'string' },
|
|
46
|
+
level: headingLevelEnum,
|
|
47
|
+
spacing: headingSpacingEnum,
|
|
48
|
+
},
|
|
49
|
+
example: 'component Heading text: "Users" level: h2 spacing: sm',
|
|
21
50
|
},
|
|
22
51
|
Text: {
|
|
23
52
|
name: 'Text',
|
|
24
|
-
description: '
|
|
25
|
-
|
|
26
|
-
|
|
53
|
+
description: 'Body text content.',
|
|
54
|
+
category: 'Text',
|
|
55
|
+
properties: {
|
|
56
|
+
content: { name: 'content', type: 'string' },
|
|
57
|
+
},
|
|
58
|
+
example: 'component Text content: "Lorem ipsum dolor sit amet"',
|
|
27
59
|
},
|
|
28
60
|
Label: {
|
|
29
61
|
name: 'Label',
|
|
30
|
-
description: 'Small label text',
|
|
31
|
-
|
|
62
|
+
description: 'Small label text.',
|
|
63
|
+
category: 'Text',
|
|
64
|
+
properties: {
|
|
65
|
+
text: { name: 'text', type: 'string' },
|
|
66
|
+
},
|
|
32
67
|
example: 'component Label text: "Field label"',
|
|
33
68
|
},
|
|
34
|
-
|
|
35
|
-
name: '
|
|
36
|
-
description: '
|
|
37
|
-
|
|
38
|
-
|
|
69
|
+
Button: {
|
|
70
|
+
name: 'Button',
|
|
71
|
+
description: 'Clickable action button.',
|
|
72
|
+
category: 'Action',
|
|
73
|
+
properties: {
|
|
74
|
+
text: { name: 'text', type: 'string' },
|
|
75
|
+
variant: variantWithDefaultEnum,
|
|
76
|
+
},
|
|
77
|
+
example: 'component Button text: "Save" variant: primary',
|
|
78
|
+
},
|
|
79
|
+
Link: {
|
|
80
|
+
name: 'Link',
|
|
81
|
+
description: 'Underlined text action without button background.',
|
|
82
|
+
category: 'Action',
|
|
83
|
+
properties: {
|
|
84
|
+
text: { name: 'text', type: 'string' },
|
|
85
|
+
variant: variantEnum,
|
|
86
|
+
},
|
|
87
|
+
example: 'component Link text: "Learn more" variant: info',
|
|
39
88
|
},
|
|
40
|
-
// Input Components
|
|
41
89
|
Input: {
|
|
42
90
|
name: 'Input',
|
|
43
|
-
description: '
|
|
44
|
-
|
|
45
|
-
|
|
91
|
+
description: 'Single-line input field.',
|
|
92
|
+
category: 'Input',
|
|
93
|
+
properties: {
|
|
94
|
+
label: { name: 'label', type: 'string' },
|
|
95
|
+
placeholder: { name: 'placeholder', type: 'string' },
|
|
96
|
+
},
|
|
97
|
+
example: 'component Input label: "Email" placeholder: "you@example.com"',
|
|
46
98
|
},
|
|
47
99
|
Textarea: {
|
|
48
100
|
name: 'Textarea',
|
|
49
|
-
description: 'Multi-line
|
|
50
|
-
|
|
51
|
-
|
|
101
|
+
description: 'Multi-line input field.',
|
|
102
|
+
category: 'Input',
|
|
103
|
+
properties: {
|
|
104
|
+
label: { name: 'label', type: 'string' },
|
|
105
|
+
placeholder: { name: 'placeholder', type: 'string' },
|
|
106
|
+
rows: { name: 'rows', type: 'number' },
|
|
107
|
+
},
|
|
108
|
+
example: 'component Textarea label: "Notes" rows: 4',
|
|
52
109
|
},
|
|
53
110
|
Select: {
|
|
54
111
|
name: 'Select',
|
|
55
|
-
description: '
|
|
56
|
-
|
|
57
|
-
|
|
112
|
+
description: 'Select-style input control.',
|
|
113
|
+
category: 'Input',
|
|
114
|
+
properties: {
|
|
115
|
+
label: { name: 'label', type: 'string' },
|
|
116
|
+
placeholder: { name: 'placeholder', type: 'string' },
|
|
117
|
+
items: { name: 'items', type: 'string' },
|
|
118
|
+
},
|
|
119
|
+
example: 'component Select label: "Role" items: "Admin,User,Guest"',
|
|
58
120
|
},
|
|
59
121
|
Checkbox: {
|
|
60
122
|
name: 'Checkbox',
|
|
61
|
-
description: '
|
|
62
|
-
|
|
63
|
-
|
|
123
|
+
description: 'Checkbox control.',
|
|
124
|
+
category: 'Input',
|
|
125
|
+
properties: {
|
|
126
|
+
label: { name: 'label', type: 'string' },
|
|
127
|
+
checked: { name: 'checked', type: 'boolean' },
|
|
128
|
+
},
|
|
129
|
+
example: 'component Checkbox label: "I agree" checked: true',
|
|
64
130
|
},
|
|
65
131
|
Radio: {
|
|
66
132
|
name: 'Radio',
|
|
67
|
-
description: '
|
|
68
|
-
|
|
69
|
-
|
|
133
|
+
description: 'Radio control.',
|
|
134
|
+
category: 'Input',
|
|
135
|
+
properties: {
|
|
136
|
+
label: { name: 'label', type: 'string' },
|
|
137
|
+
checked: { name: 'checked', type: 'boolean' },
|
|
138
|
+
},
|
|
139
|
+
example: 'component Radio label: "Option A" checked: true',
|
|
70
140
|
},
|
|
71
141
|
Toggle: {
|
|
72
142
|
name: 'Toggle',
|
|
73
|
-
description: 'Toggle switch
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Button: {
|
|
79
|
-
name: 'Button',
|
|
80
|
-
description: 'Clickable button element',
|
|
81
|
-
properties: ['text', 'variant'],
|
|
82
|
-
propertyValues: {
|
|
83
|
-
variant: ['primary', 'secondary', 'ghost'],
|
|
143
|
+
description: 'Toggle switch control.',
|
|
144
|
+
category: 'Input',
|
|
145
|
+
properties: {
|
|
146
|
+
label: { name: 'label', type: 'string' },
|
|
147
|
+
enabled: { name: 'enabled', type: 'boolean' },
|
|
84
148
|
},
|
|
85
|
-
example: 'component
|
|
149
|
+
example: 'component Toggle label: "Dark mode" enabled: true',
|
|
86
150
|
},
|
|
87
|
-
|
|
88
|
-
name: '
|
|
89
|
-
description: '
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
151
|
+
Topbar: {
|
|
152
|
+
name: 'Topbar',
|
|
153
|
+
description: 'Top navigation/header bar.',
|
|
154
|
+
category: 'Navigation',
|
|
155
|
+
properties: {
|
|
156
|
+
title: { name: 'title', type: 'string' },
|
|
157
|
+
subtitle: { name: 'subtitle', type: 'string' },
|
|
158
|
+
icon: { name: 'icon', type: 'string' },
|
|
159
|
+
avatar: { name: 'avatar', type: 'boolean' },
|
|
160
|
+
actions: { name: 'actions', type: 'string' },
|
|
161
|
+
user: { name: 'user', type: 'string' },
|
|
94
162
|
},
|
|
95
|
-
example: 'component
|
|
163
|
+
example: 'component Topbar title: "Dashboard" subtitle: "Overview" icon: "menu" user: "john_doe" avatar: true',
|
|
96
164
|
},
|
|
97
|
-
// Navigation Components
|
|
98
165
|
SidebarMenu: {
|
|
99
166
|
name: 'SidebarMenu',
|
|
100
|
-
description: 'Vertical
|
|
101
|
-
|
|
102
|
-
|
|
167
|
+
description: 'Vertical menu list.',
|
|
168
|
+
category: 'Navigation',
|
|
169
|
+
properties: {
|
|
170
|
+
items: { name: 'items', type: 'string' },
|
|
171
|
+
icons: { name: 'icons', type: 'string' },
|
|
172
|
+
active: { name: 'active', type: 'number' },
|
|
173
|
+
},
|
|
174
|
+
example: 'component SidebarMenu items: "Home,Users,Settings" active: 0',
|
|
103
175
|
},
|
|
104
|
-
|
|
105
|
-
name: '
|
|
106
|
-
description: '
|
|
107
|
-
|
|
108
|
-
|
|
176
|
+
Sidebar: {
|
|
177
|
+
name: 'Sidebar',
|
|
178
|
+
description: 'Sidebar panel with title and items.',
|
|
179
|
+
category: 'Navigation',
|
|
180
|
+
properties: {
|
|
181
|
+
title: { name: 'title', type: 'string' },
|
|
182
|
+
items: { name: 'items', type: 'string' },
|
|
183
|
+
active: { name: 'active', type: 'string' },
|
|
184
|
+
itemsMock: { name: 'itemsMock', type: 'number' },
|
|
185
|
+
},
|
|
186
|
+
example: 'component Sidebar title: "Menu" items: "Home,Reports,Settings"',
|
|
109
187
|
},
|
|
110
188
|
Breadcrumbs: {
|
|
111
189
|
name: 'Breadcrumbs',
|
|
112
|
-
description: '
|
|
113
|
-
|
|
114
|
-
|
|
190
|
+
description: 'Navigation path component.',
|
|
191
|
+
category: 'Navigation',
|
|
192
|
+
properties: {
|
|
193
|
+
items: { name: 'items', type: 'string' },
|
|
194
|
+
separator: { name: 'separator', type: 'string' },
|
|
195
|
+
},
|
|
196
|
+
example: 'component Breadcrumbs items: "Home,Users,Detail" separator: ">"',
|
|
115
197
|
},
|
|
116
198
|
Tabs: {
|
|
117
199
|
name: 'Tabs',
|
|
118
|
-
description: 'Tabbed
|
|
119
|
-
|
|
120
|
-
|
|
200
|
+
description: 'Tabbed navigation component.',
|
|
201
|
+
category: 'Navigation',
|
|
202
|
+
properties: {
|
|
203
|
+
items: { name: 'items', type: 'string' },
|
|
204
|
+
active: { name: 'active', type: 'number' },
|
|
205
|
+
},
|
|
206
|
+
example: 'component Tabs items: "Overview,Details,Activity" active: 1',
|
|
121
207
|
},
|
|
122
|
-
// Data Components
|
|
123
208
|
Table: {
|
|
124
209
|
name: 'Table',
|
|
125
|
-
description: '
|
|
126
|
-
|
|
127
|
-
|
|
210
|
+
description: 'Tabular data placeholder.',
|
|
211
|
+
category: 'Data',
|
|
212
|
+
properties: {
|
|
213
|
+
title: { name: 'title', type: 'string' },
|
|
214
|
+
columns: { name: 'columns', type: 'string' },
|
|
215
|
+
rows: { name: 'rows', type: 'number' },
|
|
216
|
+
rowsMock: { name: 'rowsMock', type: 'number' },
|
|
217
|
+
mock: { name: 'mock', type: 'string' },
|
|
218
|
+
random: { name: 'random', type: 'boolean' },
|
|
219
|
+
pagination: { name: 'pagination', type: 'boolean' },
|
|
220
|
+
pages: { name: 'pages', type: 'number' },
|
|
221
|
+
paginationAlign: { name: 'paginationAlign', type: 'enum', options: ['left', 'center', 'right'] },
|
|
222
|
+
},
|
|
223
|
+
example: 'component Table columns: "User,City,Amount" rows: 8 mock: "name,city,amount"',
|
|
128
224
|
},
|
|
129
225
|
List: {
|
|
130
226
|
name: 'List',
|
|
131
|
-
description: 'Vertical list
|
|
132
|
-
|
|
133
|
-
|
|
227
|
+
description: 'Vertical list component.',
|
|
228
|
+
category: 'Data',
|
|
229
|
+
properties: {
|
|
230
|
+
title: { name: 'title', type: 'string' },
|
|
231
|
+
items: { name: 'items', type: 'string' },
|
|
232
|
+
itemsMock: { name: 'itemsMock', type: 'number' },
|
|
233
|
+
mock: { name: 'mock', type: 'string' },
|
|
234
|
+
random: { name: 'random', type: 'boolean' },
|
|
235
|
+
},
|
|
236
|
+
example: 'component List title: "Cities" itemsMock: 6 mock: "city"',
|
|
134
237
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
properties:
|
|
140
|
-
|
|
141
|
-
|
|
238
|
+
StatCard: {
|
|
239
|
+
name: 'StatCard',
|
|
240
|
+
description: 'Metric card with optional caption and icon.',
|
|
241
|
+
category: 'Data',
|
|
242
|
+
properties: {
|
|
243
|
+
title: { name: 'title', type: 'string' },
|
|
244
|
+
value: { name: 'value', type: 'string' },
|
|
245
|
+
caption: { name: 'caption', type: 'string' },
|
|
246
|
+
icon: { name: 'icon', type: 'string' },
|
|
142
247
|
},
|
|
143
|
-
example: 'component
|
|
248
|
+
example: 'component StatCard title: "Users" value: "1,234" icon: "users"',
|
|
249
|
+
},
|
|
250
|
+
Card: {
|
|
251
|
+
name: 'Card',
|
|
252
|
+
description: 'Generic content card placeholder.',
|
|
253
|
+
category: 'Layout',
|
|
254
|
+
properties: {
|
|
255
|
+
title: { name: 'title', type: 'string' },
|
|
256
|
+
text: { name: 'text', type: 'string' },
|
|
257
|
+
},
|
|
258
|
+
example: 'component Card title: "Summary" text: "Card content"',
|
|
259
|
+
},
|
|
260
|
+
Chart: {
|
|
261
|
+
name: 'Chart',
|
|
262
|
+
description: 'Chart placeholder with deterministic trend data.',
|
|
263
|
+
category: 'Data',
|
|
264
|
+
properties: {
|
|
265
|
+
type: { name: 'type', type: 'enum', options: ['bar', 'line', 'pie', 'area'] },
|
|
266
|
+
height: { name: 'height', type: 'number' },
|
|
267
|
+
},
|
|
268
|
+
example: 'component Chart type: "line" height: 240',
|
|
144
269
|
},
|
|
145
|
-
|
|
146
|
-
name: '
|
|
147
|
-
description: '
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
270
|
+
ChartPlaceholder: {
|
|
271
|
+
name: 'ChartPlaceholder',
|
|
272
|
+
description: 'Backward-compatible alias of Chart.',
|
|
273
|
+
category: 'Data',
|
|
274
|
+
properties: {
|
|
275
|
+
type: { name: 'type', type: 'enum', options: ['bar', 'line', 'pie', 'area'] },
|
|
276
|
+
height: { name: 'height', type: 'number' },
|
|
151
277
|
},
|
|
152
|
-
example: 'component
|
|
278
|
+
example: 'component ChartPlaceholder type: "bar" height: 240',
|
|
279
|
+
},
|
|
280
|
+
Code: {
|
|
281
|
+
name: 'Code',
|
|
282
|
+
description: 'Code snippet display.',
|
|
283
|
+
category: 'Text',
|
|
284
|
+
properties: {
|
|
285
|
+
code: { name: 'code', type: 'string' },
|
|
286
|
+
},
|
|
287
|
+
example: 'component Code code: "const x = 42;"',
|
|
288
|
+
},
|
|
289
|
+
Image: {
|
|
290
|
+
name: 'Image',
|
|
291
|
+
description: 'Image placeholder block.',
|
|
292
|
+
category: 'Media',
|
|
293
|
+
properties: {
|
|
294
|
+
placeholder: imagePlaceholderEnum,
|
|
295
|
+
icon: { name: 'icon', type: 'string' },
|
|
296
|
+
height: { name: 'height', type: 'number' },
|
|
297
|
+
},
|
|
298
|
+
example: 'component Image placeholder: "icon" icon: "search" height: 220',
|
|
153
299
|
},
|
|
154
|
-
// Visual Components
|
|
155
300
|
Icon: {
|
|
156
301
|
name: 'Icon',
|
|
157
|
-
description: '
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
302
|
+
description: 'Standalone icon component.',
|
|
303
|
+
category: 'Media',
|
|
304
|
+
properties: {
|
|
305
|
+
type: { name: 'type', type: 'string' },
|
|
306
|
+
size: sizeEnum,
|
|
307
|
+
},
|
|
308
|
+
example: 'component Icon type: "home" size: md',
|
|
309
|
+
},
|
|
310
|
+
IconButton: {
|
|
311
|
+
name: 'IconButton',
|
|
312
|
+
description: 'Button that renders an icon.',
|
|
313
|
+
category: 'Action',
|
|
314
|
+
properties: {
|
|
315
|
+
icon: { name: 'icon', type: 'string' },
|
|
316
|
+
size: sizeEnum,
|
|
317
|
+
variant: variantWithDefaultEnum,
|
|
318
|
+
disabled: { name: 'disabled', type: 'boolean' },
|
|
161
319
|
},
|
|
162
|
-
example: 'component
|
|
320
|
+
example: 'component IconButton icon: "search" variant: default size: md',
|
|
163
321
|
},
|
|
164
322
|
Divider: {
|
|
165
323
|
name: 'Divider',
|
|
166
|
-
description: 'Horizontal
|
|
167
|
-
|
|
324
|
+
description: 'Horizontal separator line.',
|
|
325
|
+
category: 'Layout',
|
|
326
|
+
properties: {},
|
|
168
327
|
example: 'component Divider',
|
|
169
328
|
},
|
|
170
|
-
|
|
171
|
-
name: '
|
|
172
|
-
description: '
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
329
|
+
Separate: {
|
|
330
|
+
name: 'Separate',
|
|
331
|
+
description: 'Invisible spacing separator.',
|
|
332
|
+
category: 'Layout',
|
|
333
|
+
properties: {
|
|
334
|
+
size: { name: 'size', type: 'enum', options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'] },
|
|
176
335
|
},
|
|
177
|
-
example: 'component
|
|
336
|
+
example: 'component Separate size: md',
|
|
178
337
|
},
|
|
179
|
-
|
|
180
|
-
name: '
|
|
181
|
-
description: '
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
338
|
+
Badge: {
|
|
339
|
+
name: 'Badge',
|
|
340
|
+
description: 'Small status label.',
|
|
341
|
+
category: 'Feedback',
|
|
342
|
+
properties: {
|
|
343
|
+
text: { name: 'text', type: 'string' },
|
|
344
|
+
variant: variantWithDefaultEnum,
|
|
185
345
|
},
|
|
186
|
-
example: 'component
|
|
346
|
+
example: 'component Badge text: "Active" variant: success',
|
|
187
347
|
},
|
|
188
|
-
|
|
189
|
-
name: '
|
|
190
|
-
description: '
|
|
191
|
-
|
|
192
|
-
|
|
348
|
+
Alert: {
|
|
349
|
+
name: 'Alert',
|
|
350
|
+
description: 'Alert/message box.',
|
|
351
|
+
category: 'Feedback',
|
|
352
|
+
properties: {
|
|
353
|
+
variant: variantEnum,
|
|
354
|
+
title: { name: 'title', type: 'string' },
|
|
355
|
+
text: { name: 'text', type: 'string' },
|
|
356
|
+
},
|
|
357
|
+
example: 'component Alert variant: warning title: "Warning" text: "Review this action"',
|
|
193
358
|
},
|
|
194
|
-
// Feedback Components
|
|
195
359
|
Modal: {
|
|
196
360
|
name: 'Modal',
|
|
197
|
-
description: 'Modal
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
properties: ['title', 'value'],
|
|
205
|
-
example: 'component StatCard title: "Total Users" value: "1,234"',
|
|
206
|
-
},
|
|
207
|
-
Spinner: {
|
|
208
|
-
name: 'Spinner',
|
|
209
|
-
description: 'Loading spinner/indicator',
|
|
210
|
-
properties: [],
|
|
211
|
-
example: 'component Spinner',
|
|
361
|
+
description: 'Modal overlay container.',
|
|
362
|
+
category: 'Feedback',
|
|
363
|
+
properties: {
|
|
364
|
+
title: { name: 'title', type: 'string' },
|
|
365
|
+
visible: { name: 'visible', type: 'boolean', defaultValue: true },
|
|
366
|
+
},
|
|
367
|
+
example: 'component Modal title: "Confirm action" visible: false',
|
|
212
368
|
},
|
|
213
369
|
};
|
|
214
370
|
export const LAYOUTS = {
|
|
215
371
|
stack: {
|
|
216
372
|
name: 'stack',
|
|
217
|
-
description: '
|
|
218
|
-
properties:
|
|
219
|
-
|
|
220
|
-
|
|
373
|
+
description: 'Linear layout container.',
|
|
374
|
+
properties: {
|
|
375
|
+
direction: { name: 'direction', type: 'enum', options: ['horizontal', 'vertical'] },
|
|
376
|
+
align: { name: 'align', type: 'enum', options: ['justify', 'left', 'center', 'right'] },
|
|
377
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
378
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
379
|
+
},
|
|
380
|
+
example: 'layout stack(direction: vertical, gap: md, padding: md) { ... }',
|
|
221
381
|
},
|
|
222
382
|
grid: {
|
|
223
383
|
name: 'grid',
|
|
224
|
-
description: 'Grid layout
|
|
225
|
-
properties:
|
|
226
|
-
|
|
227
|
-
|
|
384
|
+
description: 'Grid layout container.',
|
|
385
|
+
properties: {
|
|
386
|
+
columns: { name: 'columns', type: 'number' },
|
|
387
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
388
|
+
align: { name: 'align', type: 'enum', options: ['justify', 'left', 'center', 'right'] },
|
|
389
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
390
|
+
},
|
|
391
|
+
example: 'layout grid(columns: 12, gap: md) { ... }',
|
|
228
392
|
},
|
|
229
393
|
split: {
|
|
230
394
|
name: 'split',
|
|
231
|
-
description: '
|
|
232
|
-
properties:
|
|
395
|
+
description: 'Two-column split layout.',
|
|
396
|
+
properties: {
|
|
397
|
+
sidebar: { name: 'sidebar', type: 'number' },
|
|
398
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
399
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
400
|
+
},
|
|
233
401
|
example: 'layout split(sidebar: 260, gap: md) { ... }',
|
|
234
|
-
requiredProperties: ['sidebar'],
|
|
235
402
|
},
|
|
236
403
|
panel: {
|
|
237
404
|
name: 'panel',
|
|
238
|
-
description: 'Panel
|
|
239
|
-
properties:
|
|
240
|
-
|
|
241
|
-
|
|
405
|
+
description: 'Panel container with border/background support.',
|
|
406
|
+
properties: {
|
|
407
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
408
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
409
|
+
background: { name: 'background', type: 'string' },
|
|
410
|
+
},
|
|
411
|
+
example: 'layout panel(padding: md) { ... }',
|
|
242
412
|
},
|
|
243
413
|
card: {
|
|
244
414
|
name: 'card',
|
|
245
|
-
description: 'Card
|
|
246
|
-
properties:
|
|
247
|
-
|
|
248
|
-
|
|
415
|
+
description: 'Card container with spacing/radius options.',
|
|
416
|
+
properties: {
|
|
417
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
418
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
419
|
+
radius: { name: 'radius', type: 'enum', options: ['none', 'sm', 'md', 'lg'] },
|
|
420
|
+
border: { name: 'border', type: 'boolean' },
|
|
421
|
+
background: { name: 'background', type: 'string' },
|
|
422
|
+
},
|
|
423
|
+
example: 'layout card(padding: md, gap: md, radius: md, border: true) { ... }',
|
|
249
424
|
},
|
|
250
425
|
};
|
|
251
|
-
// Property values for specific properties (layout-related)
|
|
252
426
|
export const PROPERTY_VALUES = {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
spacing:
|
|
427
|
+
size: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
428
|
+
variant: variantWithDefaultEnum.options,
|
|
429
|
+
align: ['justify', 'left', 'center', 'right'],
|
|
430
|
+
padding: spacingEnum.options,
|
|
431
|
+
gap: spacingEnum.options,
|
|
432
|
+
direction: ['horizontal', 'vertical'],
|
|
433
|
+
level: headingLevelEnum.options,
|
|
434
|
+
spacing: spacingEnum.options,
|
|
261
435
|
};
|
|
262
|
-
// Keywords
|
|
263
436
|
export const KEYWORDS = {
|
|
264
|
-
topLevel: ['project', '
|
|
437
|
+
topLevel: ['project', 'style', 'colors', 'mocks', 'define'],
|
|
265
438
|
screen: ['screen'],
|
|
266
439
|
layout: ['layout'],
|
|
267
440
|
component: ['component'],
|