@wireweave/language-data 1.0.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/dist/index.cjs ADDED
@@ -0,0 +1,672 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ALL_COMPONENTS: () => ALL_COMPONENTS,
24
+ ATTRIBUTES: () => ATTRIBUTES,
25
+ CATEGORY_LABELS: () => CATEGORY_LABELS,
26
+ COMMON_NUMBERS: () => COMMON_NUMBERS,
27
+ SPACING_SCALE: () => SPACING_SCALE,
28
+ VALUE_KEYWORDS: () => VALUE_KEYWORDS,
29
+ formatAttributeValues: () => formatAttributeValues,
30
+ getAttribute: () => getAttribute,
31
+ getAttributeNames: () => getAttributeNames,
32
+ getAttributeTypeLabel: () => getAttributeTypeLabel,
33
+ getComponent: () => getComponent,
34
+ getComponentAttributes: () => getComponentAttributes,
35
+ getComponentNames: () => getComponentNames,
36
+ getComponentsByCategory: () => getComponentsByCategory,
37
+ getValidChildren: () => getValidChildren,
38
+ isAttribute: () => isAttribute,
39
+ isComponent: () => isComponent,
40
+ isValidChild: () => isValidChild
41
+ });
42
+ module.exports = __toCommonJS(index_exports);
43
+
44
+ // src/components.ts
45
+ var ALL_COMPONENTS = [
46
+ // Layout
47
+ {
48
+ name: "page",
49
+ description: "Page root container. Starting point for the entire layout.",
50
+ category: "layout",
51
+ attributes: ["title", "width", "height", "viewport", "device", "centered", "p", "px", "py", "pt", "pr", "pb", "pl", "m", "gap"],
52
+ hasChildren: true,
53
+ validChildren: ["header", "main", "footer", "sidebar", "section", "nav", "row", "col", "card"],
54
+ validParents: [],
55
+ example: 'page "Dashboard" centered { ... }'
56
+ },
57
+ {
58
+ name: "header",
59
+ description: "Page header area. Place navigation, logo, etc.",
60
+ category: "layout",
61
+ attributes: ["p", "px", "py", "border", "gap", "justify", "align"],
62
+ hasChildren: true,
63
+ validParents: ["page"],
64
+ example: "header p=4 border { ... }"
65
+ },
66
+ {
67
+ name: "main",
68
+ description: "Main content area. Place primary content here.",
69
+ category: "layout",
70
+ attributes: ["p", "px", "py", "gap"],
71
+ hasChildren: true,
72
+ validParents: ["page"],
73
+ example: "main p=6 { ... }"
74
+ },
75
+ {
76
+ name: "footer",
77
+ description: "Page footer area. Place copyright, links, etc.",
78
+ category: "layout",
79
+ attributes: ["p", "px", "py", "border", "gap"],
80
+ hasChildren: true,
81
+ validParents: ["page"],
82
+ example: "footer p=4 border { ... }"
83
+ },
84
+ {
85
+ name: "sidebar",
86
+ description: "Sidebar area. Place auxiliary navigation or information.",
87
+ category: "layout",
88
+ attributes: ["position", "w", "p", "px", "py", "gap"],
89
+ hasChildren: true,
90
+ validParents: ["page"],
91
+ example: "sidebar w=240 { ... }"
92
+ },
93
+ {
94
+ name: "section",
95
+ description: "Section area. Logically group content.",
96
+ category: "layout",
97
+ attributes: ["title", "expanded", "p", "px", "py", "gap"],
98
+ hasChildren: true,
99
+ example: 'section "Settings" expanded { ... }'
100
+ },
101
+ // Grid
102
+ {
103
+ name: "row",
104
+ description: "Horizontal flex container. Arrange children horizontally.",
105
+ category: "grid",
106
+ attributes: ["gap", "justify", "align", "wrap", "direction", "flex", "p", "m", "mt", "mb"],
107
+ hasChildren: true,
108
+ example: "row flex gap=4 justify=between { ... }"
109
+ },
110
+ {
111
+ name: "col",
112
+ description: "Vertical flex container or grid column.",
113
+ category: "grid",
114
+ attributes: ["span", "sm", "md", "lg", "xl", "order", "gap", "justify", "align", "p", "m", "w"],
115
+ hasChildren: true,
116
+ example: "col span=6 md=4 { ... }"
117
+ },
118
+ // Container
119
+ {
120
+ name: "card",
121
+ description: "Card component. Group and display content.",
122
+ category: "container",
123
+ attributes: ["title", "p", "shadow", "border", "gap"],
124
+ hasChildren: true,
125
+ example: 'card "Settings" p=4 shadow=md { ... }'
126
+ },
127
+ {
128
+ name: "modal",
129
+ description: "Modal dialog. Display content on an overlay.",
130
+ category: "container",
131
+ attributes: ["title", "w", "h", "p"],
132
+ hasChildren: true,
133
+ example: 'modal "Confirm" w=400 { ... }'
134
+ },
135
+ {
136
+ name: "drawer",
137
+ description: "Drawer panel. Slides in from the edge of the screen.",
138
+ category: "container",
139
+ attributes: ["title", "position", "p"],
140
+ hasChildren: true,
141
+ example: 'drawer "Menu" position=left { ... }'
142
+ },
143
+ {
144
+ name: "accordion",
145
+ description: "Accordion. Collapsible content panel.",
146
+ category: "container",
147
+ attributes: ["title", "p"],
148
+ hasChildren: true,
149
+ example: 'accordion { section "FAQ 1" { ... } }'
150
+ },
151
+ // Text
152
+ {
153
+ name: "text",
154
+ description: "Text element. Display plain text.",
155
+ category: "text",
156
+ attributes: ["size", "weight", "align", "muted", "m", "mt", "mb"],
157
+ hasChildren: false,
158
+ example: 'text "Hello World" size=lg weight=bold'
159
+ },
160
+ {
161
+ name: "title",
162
+ description: "Title element. Display h1-h6 headings.",
163
+ category: "text",
164
+ attributes: ["level", "size", "align", "m", "mt", "mb"],
165
+ hasChildren: false,
166
+ example: 'title "Welcome" level=2'
167
+ },
168
+ {
169
+ name: "link",
170
+ description: "Link element. Display clickable hyperlink.",
171
+ category: "text",
172
+ attributes: ["href", "external"],
173
+ hasChildren: false,
174
+ example: 'link "Learn more" href="/docs" external'
175
+ },
176
+ // Input
177
+ {
178
+ name: "input",
179
+ description: "Input field. Accept text, email, password, etc.",
180
+ category: "input",
181
+ attributes: ["label", "inputType", "placeholder", "value", "disabled", "required", "readonly", "icon", "m", "mb"],
182
+ hasChildren: false,
183
+ example: 'input "Email" inputType=email placeholder="user@example.com" required'
184
+ },
185
+ {
186
+ name: "textarea",
187
+ description: "Multi-line input field. Accept long text.",
188
+ category: "input",
189
+ attributes: ["label", "placeholder", "value", "rows", "disabled", "required", "m", "mb"],
190
+ hasChildren: false,
191
+ example: 'textarea "Description" rows=4 placeholder="Enter description..."'
192
+ },
193
+ {
194
+ name: "select",
195
+ description: "Dropdown select. Choose one from multiple options.",
196
+ category: "input",
197
+ attributes: ["label", "placeholder", "value", "disabled", "required", "m", "mb"],
198
+ hasChildren: false,
199
+ example: 'select "Country" ["USA", "Canada", "UK"] placeholder="Select..."'
200
+ },
201
+ {
202
+ name: "checkbox",
203
+ description: "Checkbox. Select true/false value.",
204
+ category: "input",
205
+ attributes: ["label", "checked", "disabled", "m", "mb"],
206
+ hasChildren: false,
207
+ example: 'checkbox "I agree to terms" checked'
208
+ },
209
+ {
210
+ name: "radio",
211
+ description: "Radio button. Select one within a group.",
212
+ category: "input",
213
+ attributes: ["label", "name", "checked", "disabled", "m", "mb"],
214
+ hasChildren: false,
215
+ example: 'radio "Option A" name="choice" checked'
216
+ },
217
+ {
218
+ name: "switch",
219
+ description: "Toggle switch. Switch on/off state.",
220
+ category: "input",
221
+ attributes: ["label", "checked", "disabled", "m", "mb"],
222
+ hasChildren: false,
223
+ example: 'switch "Dark mode" checked'
224
+ },
225
+ {
226
+ name: "slider",
227
+ description: "Slider. Select a value within a range.",
228
+ category: "input",
229
+ attributes: ["label", "min", "max", "value", "step", "disabled", "m", "mb"],
230
+ hasChildren: false,
231
+ example: 'slider "Volume" min=0 max=100 value=50'
232
+ },
233
+ // Button
234
+ {
235
+ name: "button",
236
+ description: "Button element. Display clickable button.",
237
+ category: "input",
238
+ attributes: ["primary", "secondary", "outline", "ghost", "danger", "size", "icon", "disabled", "loading", "w"],
239
+ hasChildren: false,
240
+ example: 'button "Submit" primary icon=send'
241
+ },
242
+ // Display
243
+ {
244
+ name: "image",
245
+ description: "Image element. Display an image.",
246
+ category: "display",
247
+ attributes: ["src", "alt", "w", "h"],
248
+ hasChildren: false,
249
+ example: "image w=200 h=150"
250
+ },
251
+ {
252
+ name: "placeholder",
253
+ description: "Placeholder. Image or content placeholder.",
254
+ category: "display",
255
+ attributes: ["label", "w", "h"],
256
+ hasChildren: false,
257
+ example: 'placeholder "Banner Image" w=full h=200'
258
+ },
259
+ {
260
+ name: "avatar",
261
+ description: "Avatar element. Display user profile image.",
262
+ category: "display",
263
+ attributes: ["name", "src", "size"],
264
+ hasChildren: false,
265
+ example: 'avatar "John Doe" size=lg'
266
+ },
267
+ {
268
+ name: "badge",
269
+ description: "Badge element. Display status or count as a small label.",
270
+ category: "display",
271
+ attributes: ["variant", "pill", "icon", "size"],
272
+ hasChildren: false,
273
+ example: 'badge "New" variant=success pill'
274
+ },
275
+ {
276
+ name: "icon",
277
+ description: "Icon element. Display a Lucide icon.",
278
+ category: "display",
279
+ attributes: ["name", "size", "muted"],
280
+ hasChildren: false,
281
+ example: 'icon "settings" size=lg'
282
+ },
283
+ // Data
284
+ {
285
+ name: "table",
286
+ description: "Table component. Display data in tabular format.",
287
+ category: "data",
288
+ attributes: ["striped", "bordered", "hover"],
289
+ hasChildren: false,
290
+ example: 'table striped bordered { columns ["Name", "Email"] row ["John", "john@example.com"] }'
291
+ },
292
+ {
293
+ name: "list",
294
+ description: "List component. Display items as a list.",
295
+ category: "data",
296
+ attributes: ["ordered", "none", "gap"],
297
+ hasChildren: false,
298
+ example: 'list ordered ["First", "Second", "Third"]'
299
+ },
300
+ // Feedback
301
+ {
302
+ name: "alert",
303
+ description: "Alert element. Display a message to the user.",
304
+ category: "feedback",
305
+ attributes: ["variant", "dismissible", "icon"],
306
+ hasChildren: false,
307
+ example: 'alert "Changes saved!" variant=success'
308
+ },
309
+ {
310
+ name: "toast",
311
+ description: "Toast notification. Display a temporary message.",
312
+ category: "feedback",
313
+ attributes: ["position", "variant"],
314
+ hasChildren: false,
315
+ example: 'toast "Item deleted" position=bottom-right variant=danger'
316
+ },
317
+ {
318
+ name: "progress",
319
+ description: "Progress bar. Display progress status.",
320
+ category: "feedback",
321
+ attributes: ["value", "max", "label", "indeterminate"],
322
+ hasChildren: false,
323
+ example: 'progress value=75 label="Uploading..."'
324
+ },
325
+ {
326
+ name: "spinner",
327
+ description: "Loading spinner. Display loading status.",
328
+ category: "feedback",
329
+ attributes: ["label", "size"],
330
+ hasChildren: false,
331
+ example: "spinner size=lg"
332
+ },
333
+ // Overlay
334
+ {
335
+ name: "tooltip",
336
+ description: "Tooltip element. Show additional info on hover.",
337
+ category: "overlay",
338
+ attributes: ["position"],
339
+ hasChildren: true,
340
+ example: 'tooltip "More info" position=top { icon "help-circle" }'
341
+ },
342
+ {
343
+ name: "popover",
344
+ description: "Popover. Show additional content on click.",
345
+ category: "overlay",
346
+ attributes: ["title"],
347
+ hasChildren: true,
348
+ example: 'popover "Details" { ... }'
349
+ },
350
+ {
351
+ name: "dropdown",
352
+ description: "Dropdown menu. Expand menu on click.",
353
+ category: "overlay",
354
+ attributes: [],
355
+ hasChildren: false,
356
+ example: 'dropdown { item "Edit" icon=edit item "Delete" icon=trash danger }'
357
+ },
358
+ // Navigation
359
+ {
360
+ name: "nav",
361
+ description: "Navigation area. Place menu items.",
362
+ category: "navigation",
363
+ attributes: ["vertical", "gap"],
364
+ hasChildren: false,
365
+ example: 'nav [{ label="Home" icon=home active }, { label="Settings" icon=settings }] vertical'
366
+ },
367
+ {
368
+ name: "tabs",
369
+ description: "Tabs component. Switch between multiple panels.",
370
+ category: "navigation",
371
+ attributes: ["active"],
372
+ hasChildren: true,
373
+ example: 'tabs { tab "General" active { ... } tab "Advanced" { ... } }'
374
+ },
375
+ {
376
+ name: "breadcrumb",
377
+ description: "Breadcrumb. Display current location as a path.",
378
+ category: "navigation",
379
+ attributes: [],
380
+ hasChildren: false,
381
+ example: 'breadcrumb [{ label="Home" href="/" }, { label="Products" }, { label="Details" }]'
382
+ },
383
+ // Divider
384
+ {
385
+ name: "divider",
386
+ description: "Divider element. Visually separate content.",
387
+ category: "display",
388
+ attributes: ["m", "my", "mx"],
389
+ hasChildren: false,
390
+ example: "divider my=4"
391
+ }
392
+ ];
393
+
394
+ // src/attributes.ts
395
+ var ATTRIBUTES = [
396
+ // Spacing
397
+ { name: "p", description: "Padding. Set inner spacing.", values: "number", example: "p=4" },
398
+ { name: "px", description: "Horizontal padding.", values: "number", example: "px=4" },
399
+ { name: "py", description: "Vertical padding.", values: "number", example: "py=4" },
400
+ { name: "pt", description: "Top padding.", values: "number", example: "pt=4" },
401
+ { name: "pr", description: "Right padding.", values: "number", example: "pr=4" },
402
+ { name: "pb", description: "Bottom padding.", values: "number", example: "pb=4" },
403
+ { name: "pl", description: "Left padding.", values: "number", example: "pl=4" },
404
+ { name: "m", description: "Margin. Set outer spacing.", values: "number", example: "m=4" },
405
+ { name: "mx", description: 'Horizontal margin. Can be "auto" for centering.', values: "number", example: "mx=auto" },
406
+ { name: "my", description: "Vertical margin.", values: "number", example: "my=4" },
407
+ { name: "mt", description: "Top margin.", values: "number", example: "mt=4" },
408
+ { name: "mr", description: "Right margin.", values: "number", example: "mr=4" },
409
+ { name: "mb", description: "Bottom margin.", values: "number", example: "mb=4" },
410
+ { name: "ml", description: "Left margin.", values: "number", example: "ml=4" },
411
+ { name: "gap", description: "Gap between child elements.", values: "number", example: "gap=4" },
412
+ // Grid Layout
413
+ { name: "span", description: "Grid column width (1-12).", values: "number", example: "span=6" },
414
+ { name: "sm", description: "Column width at 576px and above.", values: "number", example: "sm=6" },
415
+ { name: "md", description: "Column width at 768px and above.", values: "number", example: "md=4" },
416
+ { name: "lg", description: "Column width at 992px and above.", values: "number", example: "lg=3" },
417
+ { name: "xl", description: "Column width at 1200px and above.", values: "number", example: "xl=2" },
418
+ { name: "order", description: "Order within flex container.", values: "number", example: "order=1" },
419
+ // Flex Layout
420
+ { name: "flex", description: "Enable flexbox layout.", values: "boolean", example: "flex" },
421
+ { name: "direction", description: "Flex direction.", values: ["row", "column", "row-reverse", "column-reverse"], example: "direction=column" },
422
+ { name: "justify", description: "Main axis alignment.", values: ["start", "center", "end", "between", "around", "evenly"], example: "justify=center" },
423
+ { name: "align", description: "Cross axis alignment.", values: ["start", "center", "end", "stretch", "baseline"], example: "align=center" },
424
+ { name: "wrap", description: "Allow child elements to wrap.", values: "boolean", example: "wrap" },
425
+ // Size
426
+ { name: "width", description: "Width in pixels.", values: "number", example: "width=400" },
427
+ { name: "height", description: "Height in pixels.", values: "number", example: "height=300" },
428
+ { name: "w", description: "Width (full, auto, screen, fit, or number).", values: ["full", "auto", "screen", "fit"], example: "w=full" },
429
+ { name: "h", description: "Height (full, auto, screen, or number).", values: ["full", "auto", "screen"], example: "h=full" },
430
+ { name: "minW", description: "Minimum width.", values: "number", example: "minW=200" },
431
+ { name: "maxW", description: "Maximum width.", values: "number", example: "maxW=600" },
432
+ { name: "minH", description: "Minimum height.", values: "number", example: "minH=100" },
433
+ { name: "maxH", description: "Maximum height.", values: "number", example: "maxH=400" },
434
+ { name: "size", description: "Size preset.", values: ["xs", "sm", "md", "lg", "xl"], example: "size=lg" },
435
+ { name: "viewport", description: 'Viewport size (e.g., "1440x900").', values: "string", example: 'viewport="1440x900"' },
436
+ { name: "device", description: "Device preset.", values: ["iphone14", "iphone14pro", "desktop", "tablet"], example: 'device="iphone14"' },
437
+ // Visual
438
+ { name: "border", description: "Show border.", values: "boolean", example: "border" },
439
+ { name: "shadow", description: "Box shadow.", values: ["none", "sm", "md", "lg", "xl"], example: "shadow=md" },
440
+ { name: "position", description: "Position setting.", values: ["left", "right", "top", "bottom", "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"], example: "position=left" },
441
+ // Text
442
+ { name: "level", description: "Heading level (1-6).", values: "number", example: "level=2" },
443
+ { name: "weight", description: "Font weight.", values: ["normal", "medium", "semibold", "bold"], example: "weight=bold" },
444
+ { name: "muted", description: "Muted style.", values: "boolean", example: "muted" },
445
+ // Button variants
446
+ { name: "primary", description: "Primary emphasis style.", values: "boolean", example: "primary" },
447
+ { name: "secondary", description: "Secondary style.", values: "boolean", example: "secondary" },
448
+ { name: "outline", description: "Outline style.", values: "boolean", example: "outline" },
449
+ { name: "ghost", description: "Ghost/transparent style.", values: "boolean", example: "ghost" },
450
+ { name: "danger", description: "Danger/delete style.", values: "boolean", example: "danger" },
451
+ // Status variants
452
+ { name: "variant", description: "Variant style.", values: ["default", "primary", "secondary", "success", "warning", "danger", "info"], example: "variant=success" },
453
+ // Form
454
+ { name: "inputType", description: "Input field type.", values: ["text", "email", "password", "number", "tel", "url", "search", "date"], example: "inputType=email" },
455
+ { name: "placeholder", description: "Placeholder text.", values: "string", example: 'placeholder="Enter text"' },
456
+ { name: "value", description: "Default value.", values: "string", example: 'value="default"' },
457
+ { name: "label", description: "Label text.", values: "string", example: 'label="Name"' },
458
+ { name: "required", description: "Required field.", values: "boolean", example: "required" },
459
+ { name: "disabled", description: "Disabled state.", values: "boolean", example: "disabled" },
460
+ { name: "readonly", description: "Read-only.", values: "boolean", example: "readonly" },
461
+ { name: "checked", description: "Checked state.", values: "boolean", example: "checked" },
462
+ { name: "loading", description: "Loading state.", values: "boolean", example: "loading" },
463
+ { name: "name", description: "Form element name attribute.", values: "string", example: 'name="field"' },
464
+ { name: "rows", description: "Number of textarea rows.", values: "number", example: "rows=4" },
465
+ { name: "min", description: "Minimum value.", values: "number", example: "min=0" },
466
+ { name: "max", description: "Maximum value.", values: "number", example: "max=100" },
467
+ { name: "step", description: "Step increment.", values: "number", example: "step=1" },
468
+ // Other
469
+ { name: "title", description: "Title text.", values: "string", example: 'title="Title"' },
470
+ { name: "centered", description: "Center alignment.", values: "boolean", example: "centered" },
471
+ { name: "vertical", description: "Vertical orientation.", values: "boolean", example: "vertical" },
472
+ { name: "expanded", description: "Expanded state.", values: "boolean", example: "expanded" },
473
+ { name: "active", description: "Active state/index.", values: "number", example: "active=0" },
474
+ { name: "href", description: "Link URL.", values: "string", example: 'href="/path"' },
475
+ { name: "external", description: "External link.", values: "boolean", example: "external" },
476
+ { name: "src", description: "Image source URL.", values: "string", example: 'src="/image.png"' },
477
+ { name: "alt", description: "Alternative text.", values: "string", example: 'alt="Image"' },
478
+ { name: "icon", description: "Icon name (Lucide icons).", values: "string", example: 'icon="home"' },
479
+ { name: "pill", description: "Rounded pill badge.", values: "boolean", example: "pill" },
480
+ { name: "dismissible", description: "Can be dismissed.", values: "boolean", example: "dismissible" },
481
+ { name: "indeterminate", description: "Indeterminate state.", values: "boolean", example: "indeterminate" },
482
+ { name: "striped", description: "Striped style.", values: "boolean", example: "striped" },
483
+ { name: "bordered", description: "Bordered style.", values: "boolean", example: "bordered" },
484
+ { name: "hover", description: "Hover effect.", values: "boolean", example: "hover" },
485
+ { name: "ordered", description: "Ordered list.", values: "boolean", example: "ordered" },
486
+ { name: "none", description: "No list style.", values: "boolean", example: "none" }
487
+ ];
488
+
489
+ // src/keywords.ts
490
+ var CATEGORY_LABELS = {
491
+ layout: "Layout",
492
+ container: "Container",
493
+ grid: "Grid",
494
+ text: "Text",
495
+ input: "Input",
496
+ display: "Display",
497
+ data: "Data",
498
+ feedback: "Feedback",
499
+ overlay: "Overlay",
500
+ navigation: "Navigation"
501
+ };
502
+ var VALUE_KEYWORDS = [
503
+ // Booleans
504
+ "true",
505
+ "false",
506
+ // Button variants
507
+ "primary",
508
+ "secondary",
509
+ "outline",
510
+ "ghost",
511
+ // Status variants
512
+ "success",
513
+ "danger",
514
+ "warning",
515
+ "info",
516
+ "default",
517
+ // Sizes
518
+ "xs",
519
+ "sm",
520
+ "md",
521
+ "lg",
522
+ "xl",
523
+ "base",
524
+ "2xl",
525
+ "3xl",
526
+ // Flex alignment
527
+ "start",
528
+ "center",
529
+ "end",
530
+ "between",
531
+ "around",
532
+ "evenly",
533
+ "stretch",
534
+ "baseline",
535
+ // Positions
536
+ "left",
537
+ "right",
538
+ "top",
539
+ "bottom",
540
+ "top-left",
541
+ "top-center",
542
+ "top-right",
543
+ "bottom-left",
544
+ "bottom-center",
545
+ "bottom-right",
546
+ // Sizing
547
+ "full",
548
+ "auto",
549
+ "screen",
550
+ "fit",
551
+ // Font weights
552
+ "normal",
553
+ "medium",
554
+ "semibold",
555
+ "bold",
556
+ // Input types
557
+ "text",
558
+ "email",
559
+ "password",
560
+ "number",
561
+ "tel",
562
+ "url",
563
+ "search",
564
+ "date",
565
+ // Flex direction
566
+ "row",
567
+ "column",
568
+ "row-reverse",
569
+ "column-reverse",
570
+ // List
571
+ "none",
572
+ "nowrap"
573
+ ];
574
+ var COMMON_NUMBERS = [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 48, 64];
575
+ var SPACING_SCALE = {
576
+ 0: "0px",
577
+ 1: "4px",
578
+ 2: "8px",
579
+ 3: "12px",
580
+ 4: "16px",
581
+ 5: "20px",
582
+ 6: "24px",
583
+ 8: "32px",
584
+ 10: "40px",
585
+ 12: "48px",
586
+ 16: "64px",
587
+ 20: "80px",
588
+ 24: "96px"
589
+ };
590
+
591
+ // src/utils.ts
592
+ function getComponent(name) {
593
+ return ALL_COMPONENTS.find((c) => c.name === name.toLowerCase());
594
+ }
595
+ function getAttribute(name) {
596
+ return ATTRIBUTES.find((a) => a.name === name);
597
+ }
598
+ function getValidChildren(componentName) {
599
+ const component = getComponent(componentName);
600
+ if (!component || !component.hasChildren) return [];
601
+ if (component.validChildren === void 0) {
602
+ return ALL_COMPONENTS.filter((c) => c.name !== "page");
603
+ }
604
+ return component.validChildren.map((name) => getComponent(name)).filter((c) => c !== void 0);
605
+ }
606
+ function isValidChild(childName, parentName) {
607
+ const parent = getComponent(parentName);
608
+ if (!parent || !parent.hasChildren) return false;
609
+ if (parent.validChildren === void 0) return true;
610
+ return parent.validChildren.includes(childName.toLowerCase());
611
+ }
612
+ function getComponentAttributes(componentName) {
613
+ const component = getComponent(componentName);
614
+ if (!component) return ATTRIBUTES;
615
+ return ATTRIBUTES.filter((attr) => component.attributes.includes(attr.name));
616
+ }
617
+ function getComponentsByCategory(category) {
618
+ return ALL_COMPONENTS.filter((c) => c.category === category);
619
+ }
620
+ function getAttributeTypeLabel(attr) {
621
+ if (attr.values === "number") return "number";
622
+ if (attr.values === "string") return "string";
623
+ if (attr.values === "boolean") return "boolean";
624
+ if (Array.isArray(attr.values)) {
625
+ const preview = attr.values.slice(0, 3).join(" | ");
626
+ return attr.values.length > 3 ? `${preview}...` : preview;
627
+ }
628
+ return "";
629
+ }
630
+ function formatAttributeValues(attr) {
631
+ if (attr.values === "number") return "Type: number";
632
+ if (attr.values === "string") return "Type: string";
633
+ if (attr.values === "boolean") return "Type: boolean (can be omitted)";
634
+ if (Array.isArray(attr.values)) {
635
+ return `Values: ${attr.values.join(" | ")}`;
636
+ }
637
+ return "";
638
+ }
639
+ function isComponent(word) {
640
+ return ALL_COMPONENTS.some((c) => c.name === word.toLowerCase());
641
+ }
642
+ function isAttribute(word) {
643
+ return ATTRIBUTES.some((a) => a.name === word);
644
+ }
645
+ function getComponentNames() {
646
+ return ALL_COMPONENTS.map((c) => c.name);
647
+ }
648
+ function getAttributeNames() {
649
+ return ATTRIBUTES.map((a) => a.name);
650
+ }
651
+ // Annotate the CommonJS export names for ESM import in node:
652
+ 0 && (module.exports = {
653
+ ALL_COMPONENTS,
654
+ ATTRIBUTES,
655
+ CATEGORY_LABELS,
656
+ COMMON_NUMBERS,
657
+ SPACING_SCALE,
658
+ VALUE_KEYWORDS,
659
+ formatAttributeValues,
660
+ getAttribute,
661
+ getAttributeNames,
662
+ getAttributeTypeLabel,
663
+ getComponent,
664
+ getComponentAttributes,
665
+ getComponentNames,
666
+ getComponentsByCategory,
667
+ getValidChildren,
668
+ isAttribute,
669
+ isComponent,
670
+ isValidChild
671
+ });
672
+ //# sourceMappingURL=index.cjs.map