mycontext-cli 2.0.26 → 2.0.28

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.
Files changed (129) hide show
  1. package/README.md +36 -355
  2. package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
  3. package/dist/agents/implementations/CodeGenSubAgent.js +67 -14
  4. package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
  5. package/dist/agents/implementations/DesignPipelineAgent.d.ts +80 -0
  6. package/dist/agents/implementations/DesignPipelineAgent.d.ts.map +1 -0
  7. package/dist/agents/implementations/DesignPipelineAgent.js +1406 -0
  8. package/dist/agents/implementations/DesignPipelineAgent.js.map +1 -0
  9. package/dist/agents/implementations/FeatureAssemblyAgent.d.ts +67 -0
  10. package/dist/agents/implementations/FeatureAssemblyAgent.d.ts.map +1 -0
  11. package/dist/agents/implementations/FeatureAssemblyAgent.js +564 -0
  12. package/dist/agents/implementations/FeatureAssemblyAgent.js.map +1 -0
  13. package/dist/agents/implementations/PromptConstructorAgent.d.ts +10 -0
  14. package/dist/agents/implementations/PromptConstructorAgent.d.ts.map +1 -1
  15. package/dist/agents/implementations/PromptConstructorAgent.js +172 -12
  16. package/dist/agents/implementations/PromptConstructorAgent.js.map +1 -1
  17. package/dist/agents/implementations/RoleBasedGenerator.d.ts +52 -0
  18. package/dist/agents/implementations/RoleBasedGenerator.d.ts.map +1 -0
  19. package/dist/agents/implementations/RoleBasedGenerator.js +370 -0
  20. package/dist/agents/implementations/RoleBasedGenerator.js.map +1 -0
  21. package/dist/cli.js +65 -0
  22. package/dist/cli.js.map +1 -1
  23. package/dist/clients/ClaudeSDKClient.d.ts +48 -0
  24. package/dist/clients/ClaudeSDKClient.d.ts.map +1 -0
  25. package/dist/clients/ClaudeSDKClient.js +158 -0
  26. package/dist/clients/ClaudeSDKClient.js.map +1 -0
  27. package/dist/clients/MyContextAIClient.d.ts +73 -0
  28. package/dist/clients/MyContextAIClient.d.ts.map +1 -0
  29. package/dist/clients/MyContextAIClient.js +280 -0
  30. package/dist/clients/MyContextAIClient.js.map +1 -0
  31. package/dist/clients/ProviderChain.d.ts +87 -0
  32. package/dist/clients/ProviderChain.d.ts.map +1 -0
  33. package/dist/clients/ProviderChain.js +246 -0
  34. package/dist/clients/ProviderChain.js.map +1 -0
  35. package/dist/clients/XAIClient.d.ts +48 -0
  36. package/dist/clients/XAIClient.d.ts.map +1 -0
  37. package/dist/clients/XAIClient.js +152 -0
  38. package/dist/clients/XAIClient.js.map +1 -0
  39. package/dist/commands/assemble-features.d.ts +40 -0
  40. package/dist/commands/assemble-features.d.ts.map +1 -0
  41. package/dist/commands/assemble-features.js +383 -0
  42. package/dist/commands/assemble-features.js.map +1 -0
  43. package/dist/commands/clone-starter.d.ts +32 -0
  44. package/dist/commands/clone-starter.d.ts.map +1 -0
  45. package/dist/commands/clone-starter.js +218 -0
  46. package/dist/commands/clone-starter.js.map +1 -0
  47. package/dist/commands/design-analyze.d.ts +46 -0
  48. package/dist/commands/design-analyze.d.ts.map +1 -0
  49. package/dist/commands/design-analyze.js +232 -0
  50. package/dist/commands/design-analyze.js.map +1 -0
  51. package/dist/commands/generate-components.d.ts +1 -0
  52. package/dist/commands/generate-components.d.ts.map +1 -1
  53. package/dist/commands/generate-components.js +42 -9
  54. package/dist/commands/generate-components.js.map +1 -1
  55. package/dist/commands/generate.d.ts.map +1 -1
  56. package/dist/commands/generate.js +34 -1
  57. package/dist/commands/generate.js.map +1 -1
  58. package/dist/commands/setup-complete.d.ts.map +1 -1
  59. package/dist/commands/setup-complete.js +38 -2
  60. package/dist/commands/setup-complete.js.map +1 -1
  61. package/dist/commands/workflow.d.ts.map +1 -1
  62. package/dist/commands/workflow.js +86 -7
  63. package/dist/commands/workflow.js.map +1 -1
  64. package/dist/config/intent-dictionary.json +3700 -0
  65. package/dist/package.json +3 -1
  66. package/dist/services/IntentEnricher.d.ts +61 -0
  67. package/dist/services/IntentEnricher.d.ts.map +1 -0
  68. package/dist/services/IntentEnricher.js +318 -0
  69. package/dist/services/IntentEnricher.js.map +1 -0
  70. package/dist/services/IntentValidator.d.ts +114 -0
  71. package/dist/services/IntentValidator.d.ts.map +1 -0
  72. package/dist/services/IntentValidator.js +680 -0
  73. package/dist/services/IntentValidator.js.map +1 -0
  74. package/dist/types/design-pipeline.d.ts +300 -0
  75. package/dist/types/design-pipeline.d.ts.map +1 -0
  76. package/dist/types/design-pipeline.js +9 -0
  77. package/dist/types/design-pipeline.js.map +1 -0
  78. package/dist/types/feature-bundle.d.ts +239 -0
  79. package/dist/types/feature-bundle.d.ts.map +1 -0
  80. package/dist/types/feature-bundle.js +9 -0
  81. package/dist/types/feature-bundle.js.map +1 -0
  82. package/dist/types/index.d.ts +2 -0
  83. package/dist/types/index.d.ts.map +1 -1
  84. package/dist/types/index.js +2 -0
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/types/intent-dictionary.d.ts +525 -0
  87. package/dist/types/intent-dictionary.d.ts.map +1 -0
  88. package/dist/types/intent-dictionary.js +11 -0
  89. package/dist/types/intent-dictionary.js.map +1 -0
  90. package/dist/types/role-permissions.d.ts +167 -0
  91. package/dist/types/role-permissions.d.ts.map +1 -0
  92. package/dist/types/role-permissions.js +9 -0
  93. package/dist/types/role-permissions.js.map +1 -0
  94. package/dist/utils/contextEnricher.d.ts +41 -0
  95. package/dist/utils/contextEnricher.d.ts.map +1 -0
  96. package/dist/utils/contextEnricher.js +327 -0
  97. package/dist/utils/contextEnricher.js.map +1 -0
  98. package/dist/utils/designFallbacks.d.ts +48 -0
  99. package/dist/utils/designFallbacks.d.ts.map +1 -0
  100. package/dist/utils/designFallbacks.js +885 -0
  101. package/dist/utils/designFallbacks.js.map +1 -0
  102. package/dist/utils/designManifestManager.d.ts +89 -0
  103. package/dist/utils/designManifestManager.d.ts.map +1 -0
  104. package/dist/utils/designManifestManager.js +533 -0
  105. package/dist/utils/designManifestManager.js.map +1 -0
  106. package/dist/utils/designPipelineStateManager.d.ts +63 -0
  107. package/dist/utils/designPipelineStateManager.d.ts.map +1 -0
  108. package/dist/utils/designPipelineStateManager.js +174 -0
  109. package/dist/utils/designPipelineStateManager.js.map +1 -0
  110. package/dist/utils/envExampleGenerator.d.ts.map +1 -1
  111. package/dist/utils/envExampleGenerator.js +35 -171
  112. package/dist/utils/envExampleGenerator.js.map +1 -1
  113. package/dist/utils/featureBundleManager.d.ts +90 -0
  114. package/dist/utils/featureBundleManager.d.ts.map +1 -0
  115. package/dist/utils/featureBundleManager.js +340 -0
  116. package/dist/utils/featureBundleManager.js.map +1 -0
  117. package/dist/utils/githubCloner.d.ts +93 -0
  118. package/dist/utils/githubCloner.d.ts.map +1 -0
  119. package/dist/utils/githubCloner.js +305 -0
  120. package/dist/utils/githubCloner.js.map +1 -0
  121. package/dist/utils/rolePermissionMapper.d.ts +89 -0
  122. package/dist/utils/rolePermissionMapper.d.ts.map +1 -0
  123. package/dist/utils/rolePermissionMapper.js +337 -0
  124. package/dist/utils/rolePermissionMapper.js.map +1 -0
  125. package/dist/utils/unifiedDesignContextLoader.d.ts +76 -0
  126. package/dist/utils/unifiedDesignContextLoader.d.ts.map +1 -0
  127. package/dist/utils/unifiedDesignContextLoader.js +344 -0
  128. package/dist/utils/unifiedDesignContextLoader.js.map +1 -0
  129. package/package.json +3 -1
@@ -0,0 +1,3700 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "schema_version": "1.0.0",
4
+ "last_updated": "2025-10-09T00:00:00Z",
5
+ "validation_config": {
6
+ "min_confidence_threshold": 0.7,
7
+ "ambiguity_threshold": 0.3,
8
+ "require_design_tokens": true,
9
+ "strict_mode": false
10
+ },
11
+ "categories": [
12
+ {
13
+ "name": "forms",
14
+ "description": "Form inputs, validation, and submission components",
15
+ "common_patterns": ["input-field", "submit-button", "form-validation", "auth-form"],
16
+ "shadcn_components": ["form", "input", "button", "label", "select", "textarea", "checkbox"]
17
+ },
18
+ {
19
+ "name": "navigation",
20
+ "description": "Navigation and routing components",
21
+ "common_patterns": ["nav-menu", "breadcrumb", "tabs", "sidebar"],
22
+ "shadcn_components": ["navigation-menu", "breadcrumb", "tabs", "sheet"]
23
+ },
24
+ {
25
+ "name": "feedback",
26
+ "description": "User feedback, notifications, and dialogs",
27
+ "common_patterns": ["alert", "toast", "dialog", "confirmation"],
28
+ "shadcn_components": ["alert", "toast", "dialog", "alert-dialog", "sonner"]
29
+ },
30
+ {
31
+ "name": "data-display",
32
+ "description": "Data presentation and visualization components",
33
+ "common_patterns": ["data-table", "card-grid", "list-view"],
34
+ "shadcn_components": ["table", "card", "scroll-area", "skeleton"]
35
+ },
36
+ {
37
+ "name": "layout",
38
+ "description": "Layout and container components",
39
+ "common_patterns": ["card-layout", "container", "grid"],
40
+ "shadcn_components": ["card", "separator", "aspect-ratio"]
41
+ }
42
+ ],
43
+ "mappings": {
44
+ "primary-button": {
45
+ "canonical_name": "primary-button",
46
+ "category": "forms",
47
+ "intent_phrases": [
48
+ {
49
+ "phrase": "submit button",
50
+ "aliases": ["submit btn", "save button", "confirm button", "primary button"],
51
+ "context_keywords": ["form", "submit", "save", "confirm", "primary", "action"],
52
+ "confidence_boost": 0.9
53
+ },
54
+ {
55
+ "phrase": "call to action",
56
+ "aliases": ["cta", "main action", "primary action"],
57
+ "context_keywords": ["cta", "primary", "main", "action"],
58
+ "confidence_boost": 0.85
59
+ }
60
+ ],
61
+ "component_pattern": {
62
+ "shadcn_components": [
63
+ {
64
+ "name": "Button",
65
+ "import_path": "@/components/ui/button",
66
+ "exports": ["Button", "buttonVariants"],
67
+ "peer_components": ["Form", "Label"]
68
+ }
69
+ ],
70
+ "template_code": "<Button\n type=\"submit\"\n variant=\"default\"\n size=\"{{size}}\"\n disabled={{{disabled}}}\n onClick={{{handler}}}\n aria-label=\"{{aria_label}}\"\n>\n {{label}}\n</Button>",
71
+ "required_props": [
72
+ {
73
+ "name": "onClick",
74
+ "type": "() => void | Promise<void>",
75
+ "description": "Click handler for button action"
76
+ },
77
+ {
78
+ "name": "children",
79
+ "type": "React.ReactNode",
80
+ "description": "Button label or content"
81
+ }
82
+ ],
83
+ "optional_props": [
84
+ {
85
+ "name": "variant",
86
+ "type": "'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'",
87
+ "default_value": "default",
88
+ "description": "Visual variant of the button"
89
+ },
90
+ {
91
+ "name": "size",
92
+ "type": "'default' | 'sm' | 'lg' | 'icon'",
93
+ "default_value": "default",
94
+ "description": "Size variant of the button"
95
+ },
96
+ {
97
+ "name": "disabled",
98
+ "type": "boolean",
99
+ "default_value": false,
100
+ "description": "Whether button is disabled"
101
+ },
102
+ {
103
+ "name": "loading",
104
+ "type": "boolean",
105
+ "default_value": false,
106
+ "description": "Show loading state"
107
+ }
108
+ ],
109
+ "default_variants": {
110
+ "variant": "default",
111
+ "size": "default"
112
+ }
113
+ },
114
+ "interaction_spec": {
115
+ "events": ["onClick", "onFocus", "onBlur", "onKeyDown"],
116
+ "states": [
117
+ {
118
+ "name": "loading",
119
+ "initial_value": false,
120
+ "type": "boolean",
121
+ "transitions": ["idle → loading", "loading → idle"]
122
+ },
123
+ {
124
+ "name": "disabled",
125
+ "initial_value": false,
126
+ "type": "boolean"
127
+ }
128
+ ],
129
+ "behaviors": [
130
+ {
131
+ "trigger": "onClick",
132
+ "action": "Execute handler and optionally show loading state",
133
+ "requirements": ["onClick handler must be provided"]
134
+ },
135
+ {
136
+ "trigger": "onKeyDown[Enter|Space]",
137
+ "action": "Trigger onClick handler",
138
+ "requirements": ["Keyboard focus on button"]
139
+ }
140
+ ]
141
+ },
142
+ "accessibility_spec": {
143
+ "aria_attributes": {
144
+ "aria-label": "Descriptive button label",
145
+ "aria-disabled": "true when disabled",
146
+ "aria-busy": "true when loading"
147
+ },
148
+ "keyboard_support": [
149
+ {
150
+ "key": "Enter",
151
+ "action": "Activate button"
152
+ },
153
+ {
154
+ "key": "Space",
155
+ "action": "Activate button"
156
+ }
157
+ ],
158
+ "role": "button",
159
+ "focus_management": "Maintain focus on button during loading"
160
+ },
161
+ "design_tokens": [
162
+ {
163
+ "token_category": "color",
164
+ "required_tokens": ["primary", "primary-foreground"],
165
+ "css_var_mapping": {
166
+ "background": "var(--primary)",
167
+ "color": "var(--primary-foreground)"
168
+ }
169
+ },
170
+ {
171
+ "token_category": "spacing",
172
+ "required_tokens": ["md", "lg"],
173
+ "css_var_mapping": {
174
+ "padding": "var(--spacing-md)"
175
+ }
176
+ }
177
+ ],
178
+ "responsive_behavior": {
179
+ "breakpoint_behaviors": {
180
+ "sm": "Full width on mobile",
181
+ "md": "Auto width on tablet+",
182
+ "lg": "Auto width on desktop"
183
+ },
184
+ "mobile_first": true,
185
+ "touch_targets": {
186
+ "min_size": "44px"
187
+ }
188
+ },
189
+ "validation_rules": [
190
+ {
191
+ "rule_type": "required",
192
+ "rule_value": "onClick",
193
+ "error_message": "Button must have onClick handler"
194
+ },
195
+ {
196
+ "rule_type": "required",
197
+ "rule_value": "children",
198
+ "error_message": "Button must have children or aria-label"
199
+ }
200
+ ],
201
+ "conflict_resolution": [],
202
+ "confidence_threshold": 0.8,
203
+ "usage_frequency": 0,
204
+ "examples": [
205
+ {
206
+ "natural_language": "Add a submit button that saves the form",
207
+ "extracted_intent": "primary-button",
208
+ "generated_code_sample": "<Button type=\"submit\" onClick={handleSubmit}>Save</Button>"
209
+ },
210
+ {
211
+ "natural_language": "Include a primary action button to confirm",
212
+ "extracted_intent": "primary-button",
213
+ "generated_code_sample": "<Button onClick={handleConfirm}>Confirm</Button>"
214
+ }
215
+ ]
216
+ },
217
+ "secondary-button": {
218
+ "canonical_name": "secondary-button",
219
+ "category": "forms",
220
+ "intent_phrases": [
221
+ {
222
+ "phrase": "cancel button",
223
+ "aliases": ["cancel btn", "secondary button", "back button", "close button"],
224
+ "context_keywords": ["cancel", "back", "close", "secondary", "dismiss"],
225
+ "confidence_boost": 0.85
226
+ }
227
+ ],
228
+ "component_pattern": {
229
+ "shadcn_components": [
230
+ {
231
+ "name": "Button",
232
+ "import_path": "@/components/ui/button",
233
+ "exports": ["Button"],
234
+ "peer_components": []
235
+ }
236
+ ],
237
+ "template_code": "<Button\n type=\"button\"\n variant=\"outline\"\n size=\"{{size}}\"\n onClick={{{handler}}}\n>\n {{label}}\n</Button>",
238
+ "required_props": [
239
+ {
240
+ "name": "onClick",
241
+ "type": "() => void",
242
+ "description": "Click handler"
243
+ },
244
+ {
245
+ "name": "children",
246
+ "type": "React.ReactNode",
247
+ "description": "Button label"
248
+ }
249
+ ],
250
+ "optional_props": [
251
+ {
252
+ "name": "size",
253
+ "type": "'default' | 'sm' | 'lg'",
254
+ "default_value": "default",
255
+ "description": "Button size"
256
+ }
257
+ ],
258
+ "default_variants": {
259
+ "variant": "outline",
260
+ "size": "default"
261
+ }
262
+ },
263
+ "interaction_spec": {
264
+ "events": ["onClick"],
265
+ "states": [],
266
+ "behaviors": [
267
+ {
268
+ "trigger": "onClick",
269
+ "action": "Execute handler (usually cancels or goes back)",
270
+ "requirements": ["onClick handler provided"]
271
+ }
272
+ ]
273
+ },
274
+ "accessibility_spec": {
275
+ "aria_attributes": {
276
+ "aria-label": "Descriptive label"
277
+ },
278
+ "keyboard_support": [
279
+ {
280
+ "key": "Enter",
281
+ "action": "Activate"
282
+ },
283
+ {
284
+ "key": "Space",
285
+ "action": "Activate"
286
+ },
287
+ {
288
+ "key": "Escape",
289
+ "action": "Activate if cancel button",
290
+ "condition": "When focused"
291
+ }
292
+ ],
293
+ "role": "button"
294
+ },
295
+ "design_tokens": [
296
+ {
297
+ "token_category": "color",
298
+ "required_tokens": ["border", "foreground"],
299
+ "css_var_mapping": {
300
+ "border": "var(--border)",
301
+ "color": "var(--foreground)"
302
+ }
303
+ }
304
+ ],
305
+ "responsive_behavior": {
306
+ "breakpoint_behaviors": {
307
+ "sm": "Full width",
308
+ "md": "Auto width"
309
+ },
310
+ "mobile_first": true,
311
+ "touch_targets": {
312
+ "min_size": "44px"
313
+ }
314
+ },
315
+ "validation_rules": [],
316
+ "conflict_resolution": [],
317
+ "confidence_threshold": 0.75,
318
+ "usage_frequency": 0,
319
+ "examples": [
320
+ {
321
+ "natural_language": "Add a cancel button to dismiss the dialog",
322
+ "extracted_intent": "secondary-button",
323
+ "generated_code_sample": "<Button variant=\"outline\" onClick={onClose}>Cancel</Button>"
324
+ }
325
+ ]
326
+ },
327
+ "auth-form": {
328
+ "canonical_name": "auth-form",
329
+ "category": "forms",
330
+ "intent_phrases": [
331
+ {
332
+ "phrase": "login form",
333
+ "aliases": ["sign in form", "authentication form", "auth form", "signin form"],
334
+ "context_keywords": ["login", "signin", "auth", "authenticate", "credentials", "email", "password"],
335
+ "confidence_boost": 0.95
336
+ },
337
+ {
338
+ "phrase": "registration form",
339
+ "aliases": ["signup form", "sign up form", "register form", "create account"],
340
+ "context_keywords": ["register", "signup", "sign up", "create account", "new user"],
341
+ "confidence_boost": 0.9
342
+ }
343
+ ],
344
+ "component_pattern": {
345
+ "shadcn_components": [
346
+ {
347
+ "name": "Form",
348
+ "import_path": "@/components/ui/form",
349
+ "exports": ["Form", "FormControl", "FormField", "FormItem", "FormLabel", "FormMessage"],
350
+ "peer_components": ["Input", "Button"]
351
+ },
352
+ {
353
+ "name": "Input",
354
+ "import_path": "@/components/ui/input",
355
+ "exports": ["Input"]
356
+ },
357
+ {
358
+ "name": "Button",
359
+ "import_path": "@/components/ui/button",
360
+ "exports": ["Button"]
361
+ }
362
+ ],
363
+ "template_code": "<Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-6\">\n <FormField\n control={form.control}\n name=\"email\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Email</FormLabel>\n <FormControl>\n <Input type=\"email\" placeholder=\"Email\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name=\"password\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Password</FormLabel>\n <FormControl>\n <Input type=\"password\" placeholder=\"Password\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <Button type=\"submit\" className=\"w-full\" disabled={{{loading}}}>{{submit_label}}</Button>\n </form>\n</Form>",
364
+ "required_props": [
365
+ {
366
+ "name": "onSubmit",
367
+ "type": "(data: { email: string; password: string }) => void | Promise<void>",
368
+ "description": "Form submission handler"
369
+ }
370
+ ],
371
+ "optional_props": [
372
+ {
373
+ "name": "loading",
374
+ "type": "boolean",
375
+ "default_value": false,
376
+ "description": "Loading state during submission"
377
+ },
378
+ {
379
+ "name": "defaultValues",
380
+ "type": "{ email?: string; password?: string }",
381
+ "description": "Initial form values"
382
+ }
383
+ ],
384
+ "default_variants": {}
385
+ },
386
+ "interaction_spec": {
387
+ "events": ["onSubmit", "onChange", "onBlur"],
388
+ "states": [
389
+ {
390
+ "name": "email",
391
+ "initial_value": "",
392
+ "type": "string"
393
+ },
394
+ {
395
+ "name": "password",
396
+ "initial_value": "",
397
+ "type": "string"
398
+ },
399
+ {
400
+ "name": "loading",
401
+ "initial_value": false,
402
+ "type": "boolean"
403
+ },
404
+ {
405
+ "name": "errors",
406
+ "initial_value": {},
407
+ "type": "Record<string, string>"
408
+ }
409
+ ],
410
+ "behaviors": [
411
+ {
412
+ "trigger": "onSubmit",
413
+ "action": "Validate inputs and call onSubmit handler",
414
+ "requirements": ["Valid email format", "Password length >= 8"]
415
+ },
416
+ {
417
+ "trigger": "onChange",
418
+ "action": "Update field value and clear error",
419
+ "requirements": []
420
+ }
421
+ ]
422
+ },
423
+ "accessibility_spec": {
424
+ "aria_attributes": {
425
+ "aria-label": "Authentication form",
426
+ "aria-describedby": "form-description"
427
+ },
428
+ "keyboard_support": [
429
+ {
430
+ "key": "Tab",
431
+ "action": "Navigate between fields"
432
+ },
433
+ {
434
+ "key": "Enter",
435
+ "action": "Submit form",
436
+ "condition": "When focused on submit button or last field"
437
+ }
438
+ ],
439
+ "role": "form",
440
+ "focus_management": "Auto-focus first field on mount"
441
+ },
442
+ "design_tokens": [
443
+ {
444
+ "token_category": "spacing",
445
+ "required_tokens": ["md", "lg"],
446
+ "css_var_mapping": {
447
+ "gap": "var(--spacing-lg)"
448
+ }
449
+ },
450
+ {
451
+ "token_category": "color",
452
+ "required_tokens": ["primary", "destructive"],
453
+ "css_var_mapping": {
454
+ "button-bg": "var(--primary)",
455
+ "error-color": "var(--destructive)"
456
+ }
457
+ }
458
+ ],
459
+ "responsive_behavior": {
460
+ "breakpoint_behaviors": {
461
+ "sm": "Single column, full width",
462
+ "md": "Single column, max-width: 400px",
463
+ "lg": "Single column, max-width: 400px"
464
+ },
465
+ "mobile_first": true,
466
+ "touch_targets": {
467
+ "min_size": "48px"
468
+ }
469
+ },
470
+ "validation_rules": [
471
+ {
472
+ "rule_type": "required",
473
+ "rule_value": "onSubmit",
474
+ "error_message": "Form must have onSubmit handler"
475
+ },
476
+ {
477
+ "rule_type": "pattern",
478
+ "rule_value": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
479
+ "error_message": "Must include email validation"
480
+ },
481
+ {
482
+ "rule_type": "min",
483
+ "rule_value": 8,
484
+ "error_message": "Password must be at least 8 characters"
485
+ }
486
+ ],
487
+ "conflict_resolution": [],
488
+ "confidence_threshold": 0.85,
489
+ "usage_frequency": 0,
490
+ "examples": [
491
+ {
492
+ "natural_language": "Users need a login form with email and password",
493
+ "extracted_intent": "auth-form",
494
+ "generated_code_sample": "<Form>...</Form>"
495
+ }
496
+ ]
497
+ },
498
+ "text-input": {
499
+ "canonical_name": "text-input",
500
+ "category": "forms",
501
+ "intent_phrases": [
502
+ {
503
+ "phrase": "text input",
504
+ "aliases": ["input field", "text field", "input box", "text box"],
505
+ "context_keywords": ["input", "field", "text", "enter", "type"],
506
+ "confidence_boost": 0.8
507
+ },
508
+ {
509
+ "phrase": "email input",
510
+ "aliases": ["email field"],
511
+ "context_keywords": ["email", "address"],
512
+ "confidence_boost": 0.85
513
+ }
514
+ ],
515
+ "component_pattern": {
516
+ "shadcn_components": [
517
+ {
518
+ "name": "Input",
519
+ "import_path": "@/components/ui/input",
520
+ "exports": ["Input"],
521
+ "peer_components": ["Label", "FormControl"]
522
+ },
523
+ {
524
+ "name": "Label",
525
+ "import_path": "@/components/ui/label",
526
+ "exports": ["Label"]
527
+ }
528
+ ],
529
+ "template_code": "<div className=\"space-y-2\">\n <Label htmlFor=\"{{id}}\">{{label}}</Label>\n <Input\n id=\"{{id}}\"\n type=\"{{type}}\"\n placeholder=\"{{placeholder}}\"\n value={{{value}}}\n onChange={{{onChange}}}\n disabled={{{disabled}}}\n />\n</div>",
530
+ "required_props": [
531
+ {
532
+ "name": "id",
533
+ "type": "string",
534
+ "description": "Input ID for label association"
535
+ },
536
+ {
537
+ "name": "onChange",
538
+ "type": "(e: React.ChangeEvent<HTMLInputElement>) => void",
539
+ "description": "Change handler"
540
+ }
541
+ ],
542
+ "optional_props": [
543
+ {
544
+ "name": "type",
545
+ "type": "'text' | 'email' | 'password' | 'number' | 'tel' | 'url'",
546
+ "default_value": "text",
547
+ "description": "Input type"
548
+ },
549
+ {
550
+ "name": "placeholder",
551
+ "type": "string",
552
+ "description": "Placeholder text"
553
+ },
554
+ {
555
+ "name": "disabled",
556
+ "type": "boolean",
557
+ "default_value": false,
558
+ "description": "Whether input is disabled"
559
+ }
560
+ ],
561
+ "default_variants": {}
562
+ },
563
+ "interaction_spec": {
564
+ "events": ["onChange", "onBlur", "onFocus"],
565
+ "states": [
566
+ {
567
+ "name": "value",
568
+ "initial_value": "",
569
+ "type": "string"
570
+ },
571
+ {
572
+ "name": "focused",
573
+ "initial_value": false,
574
+ "type": "boolean"
575
+ }
576
+ ],
577
+ "behaviors": [
578
+ {
579
+ "trigger": "onChange",
580
+ "action": "Update value state",
581
+ "requirements": []
582
+ }
583
+ ]
584
+ },
585
+ "accessibility_spec": {
586
+ "aria_attributes": {
587
+ "aria-label": "Use label element instead",
588
+ "aria-describedby": "For error or help text"
589
+ },
590
+ "keyboard_support": [
591
+ {
592
+ "key": "Tab",
593
+ "action": "Navigate to next field"
594
+ },
595
+ {
596
+ "key": "Shift+Tab",
597
+ "action": "Navigate to previous field"
598
+ }
599
+ ],
600
+ "focus_management": "Clear focus indication on blur"
601
+ },
602
+ "design_tokens": [
603
+ {
604
+ "token_category": "color",
605
+ "required_tokens": ["border", "background", "foreground"],
606
+ "css_var_mapping": {
607
+ "border": "var(--border)",
608
+ "background": "var(--background)",
609
+ "color": "var(--foreground)"
610
+ }
611
+ },
612
+ {
613
+ "token_category": "spacing",
614
+ "required_tokens": ["sm", "md"],
615
+ "css_var_mapping": {
616
+ "padding": "var(--spacing-sm)"
617
+ }
618
+ }
619
+ ],
620
+ "responsive_behavior": {
621
+ "breakpoint_behaviors": {
622
+ "sm": "Full width",
623
+ "md": "Full width",
624
+ "lg": "Full width"
625
+ },
626
+ "mobile_first": true,
627
+ "touch_targets": {
628
+ "min_size": "44px"
629
+ }
630
+ },
631
+ "validation_rules": [],
632
+ "conflict_resolution": [],
633
+ "confidence_threshold": 0.7,
634
+ "usage_frequency": 0,
635
+ "examples": [
636
+ {
637
+ "natural_language": "Add an input field for the user's name",
638
+ "extracted_intent": "text-input",
639
+ "generated_code_sample": "<div><Label>Name</Label><Input type=\"text\" /></div>"
640
+ }
641
+ ]
642
+ },
643
+ "confirmation-dialog": {
644
+ "canonical_name": "confirmation-dialog",
645
+ "category": "feedback",
646
+ "intent_phrases": [
647
+ {
648
+ "phrase": "confirmation dialog",
649
+ "aliases": ["confirm dialog", "are you sure", "confirmation modal", "confirm popup"],
650
+ "context_keywords": ["confirm", "confirmation", "are you sure", "dialog", "modal"],
651
+ "confidence_boost": 0.9
652
+ },
653
+ {
654
+ "phrase": "delete confirmation",
655
+ "aliases": ["confirm delete", "delete dialog"],
656
+ "context_keywords": ["delete", "remove", "confirmation"],
657
+ "confidence_boost": 0.95
658
+ }
659
+ ],
660
+ "component_pattern": {
661
+ "shadcn_components": [
662
+ {
663
+ "name": "AlertDialog",
664
+ "import_path": "@/components/ui/alert-dialog",
665
+ "exports": ["AlertDialog", "AlertDialogAction", "AlertDialogCancel", "AlertDialogContent", "AlertDialogDescription", "AlertDialogFooter", "AlertDialogHeader", "AlertDialogTitle", "AlertDialogTrigger"],
666
+ "peer_components": ["Button"]
667
+ }
668
+ ],
669
+ "template_code": "<AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"{{trigger_variant}}\">{{trigger_label}}</Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{{title}}</AlertDialogTitle>\n <AlertDialogDescription>\n {{description}}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={{{onConfirm}}}>{{confirm_label}}</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n</AlertDialog>",
670
+ "required_props": [
671
+ {
672
+ "name": "onConfirm",
673
+ "type": "() => void | Promise<void>",
674
+ "description": "Action to perform on confirmation"
675
+ },
676
+ {
677
+ "name": "title",
678
+ "type": "string",
679
+ "description": "Dialog title"
680
+ },
681
+ {
682
+ "name": "description",
683
+ "type": "string",
684
+ "description": "Description text"
685
+ }
686
+ ],
687
+ "optional_props": [
688
+ {
689
+ "name": "trigger_label",
690
+ "type": "string",
691
+ "default_value": "Open",
692
+ "description": "Trigger button label"
693
+ },
694
+ {
695
+ "name": "confirm_label",
696
+ "type": "string",
697
+ "default_value": "Confirm",
698
+ "description": "Confirm button label"
699
+ }
700
+ ],
701
+ "default_variants": {}
702
+ },
703
+ "interaction_spec": {
704
+ "events": ["onConfirm", "onCancel", "onOpenChange"],
705
+ "states": [
706
+ {
707
+ "name": "open",
708
+ "initial_value": false,
709
+ "type": "boolean"
710
+ }
711
+ ],
712
+ "behaviors": [
713
+ {
714
+ "trigger": "onConfirm",
715
+ "action": "Execute confirmation action and close dialog",
716
+ "requirements": ["onConfirm handler provided"]
717
+ },
718
+ {
719
+ "trigger": "onCancel",
720
+ "action": "Close dialog without action",
721
+ "requirements": []
722
+ }
723
+ ]
724
+ },
725
+ "accessibility_spec": {
726
+ "aria_attributes": {
727
+ "role": "alertdialog",
728
+ "aria-labelledby": "Dialog title",
729
+ "aria-describedby": "Dialog description"
730
+ },
731
+ "keyboard_support": [
732
+ {
733
+ "key": "Escape",
734
+ "action": "Close dialog (cancel)"
735
+ },
736
+ {
737
+ "key": "Tab",
738
+ "action": "Navigate between buttons"
739
+ },
740
+ {
741
+ "key": "Enter",
742
+ "action": "Activate focused button"
743
+ }
744
+ ],
745
+ "focus_management": "Trap focus within dialog, restore on close"
746
+ },
747
+ "design_tokens": [
748
+ {
749
+ "token_category": "color",
750
+ "required_tokens": ["background", "foreground", "destructive"],
751
+ "css_var_mapping": {
752
+ "background": "var(--background)",
753
+ "color": "var(--foreground)"
754
+ }
755
+ }
756
+ ],
757
+ "responsive_behavior": {
758
+ "breakpoint_behaviors": {
759
+ "sm": "Full screen on mobile",
760
+ "md": "Centered modal on tablet+",
761
+ "lg": "Centered modal"
762
+ },
763
+ "mobile_first": true,
764
+ "touch_targets": {
765
+ "min_size": "44px"
766
+ }
767
+ },
768
+ "validation_rules": [
769
+ {
770
+ "rule_type": "required",
771
+ "rule_value": "onConfirm",
772
+ "error_message": "Dialog must have onConfirm handler"
773
+ }
774
+ ],
775
+ "conflict_resolution": [],
776
+ "confidence_threshold": 0.8,
777
+ "usage_frequency": 0,
778
+ "examples": [
779
+ {
780
+ "natural_language": "Show a confirmation dialog before deleting",
781
+ "extracted_intent": "confirmation-dialog",
782
+ "generated_code_sample": "<AlertDialog><AlertDialogTrigger>Delete</AlertDialogTrigger><AlertDialogContent>...</AlertDialogContent></AlertDialog>"
783
+ }
784
+ ]
785
+ },
786
+ "data-table": {
787
+ "canonical_name": "data-table",
788
+ "category": "data-display",
789
+ "intent_phrases": [
790
+ {
791
+ "phrase": "data table",
792
+ "aliases": ["table", "data grid", "list of items", "table view"],
793
+ "context_keywords": ["table", "data", "list", "rows", "columns", "grid"],
794
+ "confidence_boost": 0.9
795
+ }
796
+ ],
797
+ "component_pattern": {
798
+ "shadcn_components": [
799
+ {
800
+ "name": "Table",
801
+ "import_path": "@/components/ui/table",
802
+ "exports": ["Table", "TableHeader", "TableBody", "TableHead", "TableRow", "TableCell"],
803
+ "peer_components": []
804
+ }
805
+ ],
806
+ "template_code": "<Table>\n <TableHeader>\n <TableRow>\n {{{columns}}.map(col => <TableHead key={col}>{col}</TableHead>)}\n </TableRow>\n </TableHeader>\n <TableBody>\n {{{data}}.map((row, i) => (\n <TableRow key={i}>\n {Object.values(row).map((cell, j) => <TableCell key={j}>{cell}</TableCell>)}\n </TableRow>\n ))}\n </TableBody>\n</Table>",
807
+ "required_props": [
808
+ {
809
+ "name": "data",
810
+ "type": "Array<Record<string, any>>",
811
+ "description": "Array of data objects"
812
+ },
813
+ {
814
+ "name": "columns",
815
+ "type": "string[]",
816
+ "description": "Column names"
817
+ }
818
+ ],
819
+ "optional_props": [
820
+ {
821
+ "name": "onRowClick",
822
+ "type": "(row: any) => void",
823
+ "description": "Row click handler"
824
+ }
825
+ ],
826
+ "default_variants": {}
827
+ },
828
+ "interaction_spec": {
829
+ "events": ["onRowClick", "onSort"],
830
+ "states": [],
831
+ "behaviors": [
832
+ {
833
+ "trigger": "onRowClick",
834
+ "action": "Handle row selection or navigation",
835
+ "requirements": []
836
+ }
837
+ ]
838
+ },
839
+ "accessibility_spec": {
840
+ "aria_attributes": {
841
+ "role": "table",
842
+ "aria-label": "Data table"
843
+ },
844
+ "keyboard_support": [
845
+ {
846
+ "key": "Tab",
847
+ "action": "Navigate between focusable cells"
848
+ }
849
+ ]
850
+ },
851
+ "design_tokens": [
852
+ {
853
+ "token_category": "color",
854
+ "required_tokens": ["border", "muted"],
855
+ "css_var_mapping": {
856
+ "border": "var(--border)"
857
+ }
858
+ }
859
+ ],
860
+ "responsive_behavior": {
861
+ "breakpoint_behaviors": {
862
+ "sm": "Horizontal scroll on mobile",
863
+ "md": "Full table on tablet+",
864
+ "lg": "Full table"
865
+ },
866
+ "mobile_first": true,
867
+ "touch_targets": {
868
+ "min_size": "44px"
869
+ }
870
+ },
871
+ "validation_rules": [],
872
+ "conflict_resolution": [],
873
+ "confidence_threshold": 0.75,
874
+ "usage_frequency": 0,
875
+ "examples": [
876
+ {
877
+ "natural_language": "Display a table of users with name, email, and status",
878
+ "extracted_intent": "data-table",
879
+ "generated_code_sample": "<Table>...</Table>"
880
+ }
881
+ ]
882
+ },
883
+ "card-layout": {
884
+ "canonical_name": "card-layout",
885
+ "category": "layout",
886
+ "intent_phrases": [
887
+ {
888
+ "phrase": "card",
889
+ "aliases": ["card component", "card layout", "info card", "content card"],
890
+ "context_keywords": ["card", "panel", "box", "container"],
891
+ "confidence_boost": 0.8
892
+ }
893
+ ],
894
+ "component_pattern": {
895
+ "shadcn_components": [
896
+ {
897
+ "name": "Card",
898
+ "import_path": "@/components/ui/card",
899
+ "exports": ["Card", "CardHeader", "CardTitle", "CardDescription", "CardContent", "CardFooter"],
900
+ "peer_components": []
901
+ }
902
+ ],
903
+ "template_code": "<Card>\n <CardHeader>\n <CardTitle>{{title}}</CardTitle>\n <CardDescription>{{description}}</CardDescription>\n </CardHeader>\n <CardContent>\n {{content}}\n </CardContent>\n <CardFooter>\n {{footer}}\n </CardFooter>\n</Card>",
904
+ "required_props": [],
905
+ "optional_props": [
906
+ {
907
+ "name": "title",
908
+ "type": "string",
909
+ "description": "Card title"
910
+ },
911
+ {
912
+ "name": "description",
913
+ "type": "string",
914
+ "description": "Card description"
915
+ },
916
+ {
917
+ "name": "children",
918
+ "type": "React.ReactNode",
919
+ "description": "Card content"
920
+ }
921
+ ],
922
+ "default_variants": {}
923
+ },
924
+ "interaction_spec": {
925
+ "events": [],
926
+ "states": [],
927
+ "behaviors": []
928
+ },
929
+ "accessibility_spec": {
930
+ "aria_attributes": {},
931
+ "keyboard_support": []
932
+ },
933
+ "design_tokens": [
934
+ {
935
+ "token_category": "color",
936
+ "required_tokens": ["card", "card-foreground"],
937
+ "css_var_mapping": {
938
+ "background": "var(--card)",
939
+ "color": "var(--card-foreground)"
940
+ }
941
+ },
942
+ {
943
+ "token_category": "spacing",
944
+ "required_tokens": ["md", "lg"],
945
+ "css_var_mapping": {
946
+ "padding": "var(--spacing-lg)"
947
+ }
948
+ }
949
+ ],
950
+ "responsive_behavior": {
951
+ "breakpoint_behaviors": {
952
+ "sm": "Full width",
953
+ "md": "Grid layout",
954
+ "lg": "Grid layout"
955
+ },
956
+ "mobile_first": true,
957
+ "touch_targets": {
958
+ "min_size": "44px"
959
+ }
960
+ },
961
+ "validation_rules": [],
962
+ "conflict_resolution": [],
963
+ "confidence_threshold": 0.7,
964
+ "usage_frequency": 0,
965
+ "examples": [
966
+ {
967
+ "natural_language": "Display user profile information in a card",
968
+ "extracted_intent": "card-layout",
969
+ "generated_code_sample": "<Card><CardHeader><CardTitle>Profile</CardTitle></CardHeader><CardContent>...</CardContent></Card>"
970
+ }
971
+ ]
972
+ },
973
+ "navigation-menu": {
974
+ "canonical_name": "navigation-menu",
975
+ "category": "navigation",
976
+ "intent_phrases": [
977
+ {
978
+ "phrase": "navigation menu",
979
+ "aliases": ["nav menu", "navigation", "main menu", "navbar", "nav bar"],
980
+ "context_keywords": ["navigation", "menu", "nav", "navbar", "links"],
981
+ "confidence_boost": 0.85
982
+ }
983
+ ],
984
+ "component_pattern": {
985
+ "shadcn_components": [
986
+ {
987
+ "name": "NavigationMenu",
988
+ "import_path": "@/components/ui/navigation-menu",
989
+ "exports": ["NavigationMenu", "NavigationMenuList", "NavigationMenuItem", "NavigationMenuTrigger", "NavigationMenuContent", "NavigationMenuLink"],
990
+ "peer_components": []
991
+ }
992
+ ],
993
+ "template_code": "<NavigationMenu>\n <NavigationMenuList>\n {{{items}}.map(item => (\n <NavigationMenuItem key={item.href}>\n <NavigationMenuLink href={item.href}>\n {item.label}\n </NavigationMenuLink>\n </NavigationMenuItem>\n ))}\n </NavigationMenuList>\n</NavigationMenu>",
994
+ "required_props": [
995
+ {
996
+ "name": "items",
997
+ "type": "Array<{ href: string; label: string }>",
998
+ "description": "Navigation items"
999
+ }
1000
+ ],
1001
+ "optional_props": [],
1002
+ "default_variants": {}
1003
+ },
1004
+ "interaction_spec": {
1005
+ "events": ["onClick", "onHover"],
1006
+ "states": [
1007
+ {
1008
+ "name": "activeItem",
1009
+ "initial_value": null,
1010
+ "type": "string | null"
1011
+ }
1012
+ ],
1013
+ "behaviors": [
1014
+ {
1015
+ "trigger": "onClick",
1016
+ "action": "Navigate to href",
1017
+ "requirements": []
1018
+ }
1019
+ ]
1020
+ },
1021
+ "accessibility_spec": {
1022
+ "aria_attributes": {
1023
+ "role": "navigation",
1024
+ "aria-label": "Main navigation"
1025
+ },
1026
+ "keyboard_support": [
1027
+ {
1028
+ "key": "Tab",
1029
+ "action": "Navigate between menu items"
1030
+ },
1031
+ {
1032
+ "key": "Enter",
1033
+ "action": "Activate link"
1034
+ },
1035
+ {
1036
+ "key": "Escape",
1037
+ "action": "Close submenu if open"
1038
+ }
1039
+ ]
1040
+ },
1041
+ "design_tokens": [
1042
+ {
1043
+ "token_category": "color",
1044
+ "required_tokens": ["primary", "muted"],
1045
+ "css_var_mapping": {
1046
+ "active-color": "var(--primary)"
1047
+ }
1048
+ }
1049
+ ],
1050
+ "responsive_behavior": {
1051
+ "breakpoint_behaviors": {
1052
+ "sm": "Hamburger menu",
1053
+ "md": "Horizontal menu",
1054
+ "lg": "Horizontal menu"
1055
+ },
1056
+ "mobile_first": true,
1057
+ "touch_targets": {
1058
+ "min_size": "44px"
1059
+ }
1060
+ },
1061
+ "validation_rules": [],
1062
+ "conflict_resolution": [],
1063
+ "confidence_threshold": 0.75,
1064
+ "usage_frequency": 0,
1065
+ "examples": [
1066
+ {
1067
+ "natural_language": "Add a navigation menu with Home, About, and Contact links",
1068
+ "extracted_intent": "navigation-menu",
1069
+ "generated_code_sample": "<NavigationMenu>...</NavigationMenu>"
1070
+ }
1071
+ ]
1072
+ },
1073
+ "alert-message": {
1074
+ "canonical_name": "alert-message",
1075
+ "category": "feedback",
1076
+ "intent_phrases": [
1077
+ {
1078
+ "phrase": "alert",
1079
+ "aliases": ["alert message", "notification", "banner", "message"],
1080
+ "context_keywords": ["alert", "message", "notification", "warning", "error", "success"],
1081
+ "confidence_boost": 0.8
1082
+ },
1083
+ {
1084
+ "phrase": "error message",
1085
+ "aliases": ["error alert", "error notification"],
1086
+ "context_keywords": ["error", "failure"],
1087
+ "confidence_boost": 0.85
1088
+ }
1089
+ ],
1090
+ "component_pattern": {
1091
+ "shadcn_components": [
1092
+ {
1093
+ "name": "Alert",
1094
+ "import_path": "@/components/ui/alert",
1095
+ "exports": ["Alert", "AlertTitle", "AlertDescription"],
1096
+ "peer_components": []
1097
+ }
1098
+ ],
1099
+ "template_code": "<Alert variant=\"{{variant}}\">\n <AlertTitle>{{title}}</AlertTitle>\n <AlertDescription>{{description}}</AlertDescription>\n</Alert>",
1100
+ "required_props": [
1101
+ {
1102
+ "name": "title",
1103
+ "type": "string",
1104
+ "description": "Alert title"
1105
+ },
1106
+ {
1107
+ "name": "description",
1108
+ "type": "string",
1109
+ "description": "Alert message"
1110
+ }
1111
+ ],
1112
+ "optional_props": [
1113
+ {
1114
+ "name": "variant",
1115
+ "type": "'default' | 'destructive'",
1116
+ "default_value": "default",
1117
+ "description": "Alert style variant"
1118
+ }
1119
+ ],
1120
+ "default_variants": {
1121
+ "variant": "default"
1122
+ }
1123
+ },
1124
+ "interaction_spec": {
1125
+ "events": [],
1126
+ "states": [],
1127
+ "behaviors": []
1128
+ },
1129
+ "accessibility_spec": {
1130
+ "aria_attributes": {
1131
+ "role": "alert",
1132
+ "aria-live": "polite"
1133
+ },
1134
+ "keyboard_support": []
1135
+ },
1136
+ "design_tokens": [
1137
+ {
1138
+ "token_category": "color",
1139
+ "required_tokens": ["destructive", "muted"],
1140
+ "css_var_mapping": {
1141
+ "error-color": "var(--destructive)"
1142
+ }
1143
+ }
1144
+ ],
1145
+ "responsive_behavior": {
1146
+ "breakpoint_behaviors": {
1147
+ "sm": "Full width",
1148
+ "md": "Full width",
1149
+ "lg": "Full width"
1150
+ },
1151
+ "mobile_first": true,
1152
+ "touch_targets": {
1153
+ "min_size": "44px"
1154
+ }
1155
+ },
1156
+ "validation_rules": [],
1157
+ "conflict_resolution": [],
1158
+ "confidence_threshold": 0.7,
1159
+ "usage_frequency": 0,
1160
+ "examples": [
1161
+ {
1162
+ "natural_language": "Show an error message when login fails",
1163
+ "extracted_intent": "alert-message",
1164
+ "generated_code_sample": "<Alert variant=\"destructive\"><AlertTitle>Error</AlertTitle><AlertDescription>Login failed</AlertDescription></Alert>"
1165
+ }
1166
+ ]
1167
+ },
1168
+ "loading-spinner": {
1169
+ "canonical_name": "loading-spinner",
1170
+ "category": "feedback",
1171
+ "intent_phrases": [
1172
+ {
1173
+ "phrase": "loading spinner",
1174
+ "aliases": ["loader", "loading indicator", "spinner", "loading animation"],
1175
+ "context_keywords": ["loading", "spinner", "loader", "progress", "wait"],
1176
+ "confidence_boost": 0.85
1177
+ }
1178
+ ],
1179
+ "component_pattern": {
1180
+ "shadcn_components": [
1181
+ {
1182
+ "name": "Skeleton",
1183
+ "import_path": "@/components/ui/skeleton",
1184
+ "exports": ["Skeleton"],
1185
+ "peer_components": []
1186
+ }
1187
+ ],
1188
+ "template_code": "<div className=\"flex items-center justify-center p-4\">\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-primary\" />\n <span className=\"sr-only\">Loading...</span>\n</div>",
1189
+ "required_props": [],
1190
+ "optional_props": [
1191
+ {
1192
+ "name": "size",
1193
+ "type": "'sm' | 'md' | 'lg'",
1194
+ "default_value": "md",
1195
+ "description": "Spinner size"
1196
+ }
1197
+ ],
1198
+ "default_variants": {}
1199
+ },
1200
+ "interaction_spec": {
1201
+ "events": [],
1202
+ "states": [],
1203
+ "behaviors": []
1204
+ },
1205
+ "accessibility_spec": {
1206
+ "aria_attributes": {
1207
+ "role": "status",
1208
+ "aria-label": "Loading",
1209
+ "aria-live": "polite"
1210
+ },
1211
+ "keyboard_support": [],
1212
+ "screen_reader_text": "Loading content, please wait"
1213
+ },
1214
+ "design_tokens": [
1215
+ {
1216
+ "token_category": "color",
1217
+ "required_tokens": ["primary"],
1218
+ "css_var_mapping": {
1219
+ "border-color": "var(--primary)"
1220
+ }
1221
+ }
1222
+ ],
1223
+ "responsive_behavior": {
1224
+ "breakpoint_behaviors": {
1225
+ "sm": "Center aligned",
1226
+ "md": "Center aligned",
1227
+ "lg": "Center aligned"
1228
+ },
1229
+ "mobile_first": true,
1230
+ "touch_targets": {
1231
+ "min_size": "44px"
1232
+ }
1233
+ },
1234
+ "validation_rules": [],
1235
+ "conflict_resolution": [],
1236
+ "confidence_threshold": 0.75,
1237
+ "usage_frequency": 0,
1238
+ "examples": [
1239
+ {
1240
+ "natural_language": "Show a loading spinner while data is being fetched",
1241
+ "extracted_intent": "loading-spinner",
1242
+ "generated_code_sample": "<div className=\"animate-spin\">...</div>"
1243
+ }
1244
+ ]
1245
+ },
1246
+ "select-dropdown": {
1247
+ "canonical_name": "select-dropdown",
1248
+ "category": "forms",
1249
+ "intent_phrases": [
1250
+ {
1251
+ "phrase": "select dropdown",
1252
+ "aliases": ["dropdown", "select menu", "dropdown menu", "select field"],
1253
+ "context_keywords": ["select", "dropdown", "choose", "option", "menu"],
1254
+ "confidence_boost": 0.9
1255
+ }
1256
+ ],
1257
+ "component_pattern": {
1258
+ "shadcn_components": [
1259
+ {
1260
+ "name": "Select",
1261
+ "import_path": "@/components/ui/select",
1262
+ "exports": ["Select", "SelectContent", "SelectItem", "SelectTrigger", "SelectValue"],
1263
+ "peer_components": ["Label"]
1264
+ }
1265
+ ],
1266
+ "template_code": "<div className=\"space-y-2\">\n <Label htmlFor=\"{{id}}\">{{label}}</Label>\n <Select value={{{value}}} onValueChange={{{onChange}}}>\n <SelectTrigger>\n <SelectValue placeholder=\"{{placeholder}}\" />\n </SelectTrigger>\n <SelectContent>\n {{{options}}.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n</div>",
1267
+ "required_props": [
1268
+ {
1269
+ "name": "options",
1270
+ "type": "Array<{ value: string; label: string }>",
1271
+ "description": "Dropdown options"
1272
+ },
1273
+ {
1274
+ "name": "onChange",
1275
+ "type": "(value: string) => void",
1276
+ "description": "Value change handler"
1277
+ }
1278
+ ],
1279
+ "optional_props": [
1280
+ {
1281
+ "name": "value",
1282
+ "type": "string",
1283
+ "description": "Selected value"
1284
+ },
1285
+ {
1286
+ "name": "placeholder",
1287
+ "type": "string",
1288
+ "description": "Placeholder text"
1289
+ }
1290
+ ],
1291
+ "default_variants": {}
1292
+ },
1293
+ "interaction_spec": {
1294
+ "events": ["onValueChange", "onOpenChange"],
1295
+ "states": [
1296
+ {
1297
+ "name": "value",
1298
+ "initial_value": "",
1299
+ "type": "string"
1300
+ },
1301
+ {
1302
+ "name": "open",
1303
+ "initial_value": false,
1304
+ "type": "boolean"
1305
+ }
1306
+ ],
1307
+ "behaviors": [
1308
+ {
1309
+ "trigger": "onValueChange",
1310
+ "action": "Update selected value",
1311
+ "requirements": []
1312
+ }
1313
+ ]
1314
+ },
1315
+ "accessibility_spec": {
1316
+ "aria_attributes": {
1317
+ "role": "combobox",
1318
+ "aria-expanded": "true when open",
1319
+ "aria-haspopup": "listbox"
1320
+ },
1321
+ "keyboard_support": [
1322
+ {
1323
+ "key": "Enter",
1324
+ "action": "Open dropdown"
1325
+ },
1326
+ {
1327
+ "key": "ArrowDown",
1328
+ "action": "Navigate options"
1329
+ },
1330
+ {
1331
+ "key": "Escape",
1332
+ "action": "Close dropdown"
1333
+ }
1334
+ ]
1335
+ },
1336
+ "design_tokens": [
1337
+ {
1338
+ "token_category": "color",
1339
+ "required_tokens": ["border", "background"],
1340
+ "css_var_mapping": {
1341
+ "border": "var(--border)",
1342
+ "background": "var(--background)"
1343
+ }
1344
+ }
1345
+ ],
1346
+ "responsive_behavior": {
1347
+ "breakpoint_behaviors": {
1348
+ "sm": "Full width",
1349
+ "md": "Full width",
1350
+ "lg": "Full width"
1351
+ },
1352
+ "mobile_first": true,
1353
+ "touch_targets": {
1354
+ "min_size": "44px"
1355
+ }
1356
+ },
1357
+ "validation_rules": [],
1358
+ "conflict_resolution": [],
1359
+ "confidence_threshold": 0.8,
1360
+ "usage_frequency": 0,
1361
+ "examples": [
1362
+ {
1363
+ "natural_language": "Add a dropdown to select user role",
1364
+ "extracted_intent": "select-dropdown",
1365
+ "generated_code_sample": "<Select><SelectTrigger><SelectValue /></SelectTrigger><SelectContent>...</SelectContent></Select>"
1366
+ }
1367
+ ]
1368
+ },
1369
+ "checkbox-group": {
1370
+ "canonical_name": "checkbox-group",
1371
+ "category": "forms",
1372
+ "intent_phrases": [
1373
+ {
1374
+ "phrase": "checkbox group",
1375
+ "aliases": ["multiple checkboxes", "checkbox list", "checkboxes"],
1376
+ "context_keywords": ["checkbox", "multiple", "group", "list", "select multiple"],
1377
+ "confidence_boost": 0.85
1378
+ }
1379
+ ],
1380
+ "component_pattern": {
1381
+ "shadcn_components": [
1382
+ {
1383
+ "name": "Checkbox",
1384
+ "import_path": "@/components/ui/checkbox",
1385
+ "exports": ["Checkbox"],
1386
+ "peer_components": ["Label"]
1387
+ }
1388
+ ],
1389
+ "template_code": "<div className=\"space-y-3\">\n <Label className=\"text-sm font-medium\">{{group_label}}</Label>\n <div className=\"space-y-2\">\n {{{options}}.map(option => (\n <div key={option.value} className=\"flex items-center space-x-2\">\n <Checkbox\n id={option.value}\n checked={{{checked_values}}.includes(option.value)}\n onCheckedChange={{{onChange}}}\n />\n <Label htmlFor={option.value}>{option.label}</Label>\n </div>\n ))}\n </div>\n</div>",
1390
+ "required_props": [
1391
+ {
1392
+ "name": "options",
1393
+ "type": "Array<{ value: string; label: string }>",
1394
+ "description": "Checkbox options"
1395
+ },
1396
+ {
1397
+ "name": "checked_values",
1398
+ "type": "string[]",
1399
+ "description": "Currently checked values"
1400
+ },
1401
+ {
1402
+ "name": "onChange",
1403
+ "type": "(checkedValues: string[]) => void",
1404
+ "description": "Change handler"
1405
+ }
1406
+ ],
1407
+ "optional_props": [
1408
+ {
1409
+ "name": "group_label",
1410
+ "type": "string",
1411
+ "description": "Group label"
1412
+ }
1413
+ ],
1414
+ "default_variants": {}
1415
+ },
1416
+ "interaction_spec": {
1417
+ "events": ["onCheckedChange"],
1418
+ "states": [
1419
+ {
1420
+ "name": "checkedValues",
1421
+ "initial_value": [],
1422
+ "type": "string[]"
1423
+ }
1424
+ ],
1425
+ "behaviors": [
1426
+ {
1427
+ "trigger": "onCheckedChange",
1428
+ "action": "Update checked values array",
1429
+ "requirements": []
1430
+ }
1431
+ ]
1432
+ },
1433
+ "accessibility_spec": {
1434
+ "aria_attributes": {
1435
+ "role": "group",
1436
+ "aria-labelledby": "Group label"
1437
+ },
1438
+ "keyboard_support": [
1439
+ {
1440
+ "key": "Tab",
1441
+ "action": "Navigate between checkboxes"
1442
+ },
1443
+ {
1444
+ "key": "Space",
1445
+ "action": "Toggle checkbox"
1446
+ }
1447
+ ]
1448
+ },
1449
+ "design_tokens": [
1450
+ {
1451
+ "token_category": "color",
1452
+ "required_tokens": ["primary"],
1453
+ "css_var_mapping": {
1454
+ "checked-color": "var(--primary)"
1455
+ }
1456
+ }
1457
+ ],
1458
+ "responsive_behavior": {
1459
+ "breakpoint_behaviors": {
1460
+ "sm": "Vertical layout",
1461
+ "md": "Vertical layout",
1462
+ "lg": "Vertical layout"
1463
+ },
1464
+ "mobile_first": true,
1465
+ "touch_targets": {
1466
+ "min_size": "44px"
1467
+ }
1468
+ },
1469
+ "validation_rules": [],
1470
+ "conflict_resolution": [],
1471
+ "confidence_threshold": 0.75,
1472
+ "usage_frequency": 0,
1473
+ "examples": [
1474
+ {
1475
+ "natural_language": "Add checkboxes for selecting multiple categories",
1476
+ "extracted_intent": "checkbox-group",
1477
+ "generated_code_sample": "<div><Checkbox /><Label>Option 1</Label></div>"
1478
+ }
1479
+ ]
1480
+ },
1481
+ "radio-group": {
1482
+ "canonical_name": "radio-group",
1483
+ "category": "forms",
1484
+ "intent_phrases": [
1485
+ {
1486
+ "phrase": "radio group",
1487
+ "aliases": ["radio buttons", "radio list", "single choice"],
1488
+ "context_keywords": ["radio", "single", "choice", "one option", "exclusive"],
1489
+ "confidence_boost": 0.85
1490
+ }
1491
+ ],
1492
+ "component_pattern": {
1493
+ "shadcn_components": [
1494
+ {
1495
+ "name": "RadioGroup",
1496
+ "import_path": "@/components/ui/radio-group",
1497
+ "exports": ["RadioGroup", "RadioGroupItem"],
1498
+ "peer_components": ["Label"]
1499
+ }
1500
+ ],
1501
+ "template_code": "<div className=\"space-y-3\">\n <Label className=\"text-sm font-medium\">{{group_label}}</Label>\n <RadioGroup value={{{value}}} onValueChange={{{onChange}}}>\n {{{options}}.map(option => (\n <div key={option.value} className=\"flex items-center space-x-2\">\n <RadioGroupItem value={option.value} id={option.value} />\n <Label htmlFor={option.value}>{option.label}</Label>\n </div>\n ))}\n </RadioGroup>\n</div>",
1502
+ "required_props": [
1503
+ {
1504
+ "name": "options",
1505
+ "type": "Array<{ value: string; label: string }>",
1506
+ "description": "Radio options"
1507
+ },
1508
+ {
1509
+ "name": "value",
1510
+ "type": "string",
1511
+ "description": "Selected value"
1512
+ },
1513
+ {
1514
+ "name": "onChange",
1515
+ "type": "(value: string) => void",
1516
+ "description": "Change handler"
1517
+ }
1518
+ ],
1519
+ "optional_props": [
1520
+ {
1521
+ "name": "group_label",
1522
+ "type": "string",
1523
+ "description": "Group label"
1524
+ }
1525
+ ],
1526
+ "default_variants": {}
1527
+ },
1528
+ "interaction_spec": {
1529
+ "events": ["onValueChange"],
1530
+ "states": [
1531
+ {
1532
+ "name": "value",
1533
+ "initial_value": "",
1534
+ "type": "string"
1535
+ }
1536
+ ],
1537
+ "behaviors": [
1538
+ {
1539
+ "trigger": "onValueChange",
1540
+ "action": "Update selected value",
1541
+ "requirements": []
1542
+ }
1543
+ ]
1544
+ },
1545
+ "accessibility_spec": {
1546
+ "aria_attributes": {
1547
+ "role": "radiogroup",
1548
+ "aria-labelledby": "Group label"
1549
+ },
1550
+ "keyboard_support": [
1551
+ {
1552
+ "key": "Tab",
1553
+ "action": "Navigate to group"
1554
+ },
1555
+ {
1556
+ "key": "ArrowDown",
1557
+ "action": "Select next option"
1558
+ },
1559
+ {
1560
+ "key": "ArrowUp",
1561
+ "action": "Select previous option"
1562
+ }
1563
+ ]
1564
+ },
1565
+ "design_tokens": [
1566
+ {
1567
+ "token_category": "color",
1568
+ "required_tokens": ["primary"],
1569
+ "css_var_mapping": {
1570
+ "checked-color": "var(--primary)"
1571
+ }
1572
+ }
1573
+ ],
1574
+ "responsive_behavior": {
1575
+ "breakpoint_behaviors": {
1576
+ "sm": "Vertical layout",
1577
+ "md": "Vertical layout",
1578
+ "lg": "Vertical layout"
1579
+ },
1580
+ "mobile_first": true,
1581
+ "touch_targets": {
1582
+ "min_size": "44px"
1583
+ }
1584
+ },
1585
+ "validation_rules": [],
1586
+ "conflict_resolution": [],
1587
+ "confidence_threshold": 0.75,
1588
+ "usage_frequency": 0,
1589
+ "examples": [
1590
+ {
1591
+ "natural_language": "Add radio buttons for selecting payment method",
1592
+ "extracted_intent": "radio-group",
1593
+ "generated_code_sample": "<RadioGroup><RadioGroupItem /><Label>Option 1</Label></RadioGroup>"
1594
+ }
1595
+ ]
1596
+ },
1597
+ "textarea-field": {
1598
+ "canonical_name": "textarea-field",
1599
+ "category": "forms",
1600
+ "intent_phrases": [
1601
+ {
1602
+ "phrase": "textarea",
1603
+ "aliases": ["text area", "multiline input", "comment box", "message box"],
1604
+ "context_keywords": ["textarea", "multiline", "comment", "message", "description"],
1605
+ "confidence_boost": 0.8
1606
+ }
1607
+ ],
1608
+ "component_pattern": {
1609
+ "shadcn_components": [
1610
+ {
1611
+ "name": "Textarea",
1612
+ "import_path": "@/components/ui/textarea",
1613
+ "exports": ["Textarea"],
1614
+ "peer_components": ["Label"]
1615
+ }
1616
+ ],
1617
+ "template_code": "<div className=\"space-y-2\">\n <Label htmlFor=\"{{id}}\">{{label}}</Label>\n <Textarea\n id=\"{{id}}\"\n placeholder=\"{{placeholder}}\"\n value={{{value}}}\n onChange={{{onChange}}}\n rows={{{rows}}}\n disabled={{{disabled}}}\n />\n</div>",
1618
+ "required_props": [
1619
+ {
1620
+ "name": "id",
1621
+ "type": "string",
1622
+ "description": "Textarea ID"
1623
+ },
1624
+ {
1625
+ "name": "onChange",
1626
+ "type": "(e: React.ChangeEvent<HTMLTextAreaElement>) => void",
1627
+ "description": "Change handler"
1628
+ }
1629
+ ],
1630
+ "optional_props": [
1631
+ {
1632
+ "name": "value",
1633
+ "type": "string",
1634
+ "description": "Textarea value"
1635
+ },
1636
+ {
1637
+ "name": "placeholder",
1638
+ "type": "string",
1639
+ "description": "Placeholder text"
1640
+ },
1641
+ {
1642
+ "name": "rows",
1643
+ "type": "number",
1644
+ "default_value": 3,
1645
+ "description": "Number of rows"
1646
+ },
1647
+ {
1648
+ "name": "disabled",
1649
+ "type": "boolean",
1650
+ "default_value": false,
1651
+ "description": "Whether disabled"
1652
+ }
1653
+ ],
1654
+ "default_variants": {}
1655
+ },
1656
+ "interaction_spec": {
1657
+ "events": ["onChange", "onBlur", "onFocus"],
1658
+ "states": [
1659
+ {
1660
+ "name": "value",
1661
+ "initial_value": "",
1662
+ "type": "string"
1663
+ }
1664
+ ],
1665
+ "behaviors": [
1666
+ {
1667
+ "trigger": "onChange",
1668
+ "action": "Update value",
1669
+ "requirements": []
1670
+ }
1671
+ ]
1672
+ },
1673
+ "accessibility_spec": {
1674
+ "aria_attributes": {
1675
+ "aria-label": "Use label element instead"
1676
+ },
1677
+ "keyboard_support": [
1678
+ {
1679
+ "key": "Tab",
1680
+ "action": "Navigate to textarea"
1681
+ }
1682
+ ]
1683
+ },
1684
+ "design_tokens": [
1685
+ {
1686
+ "token_category": "color",
1687
+ "required_tokens": ["border", "background"],
1688
+ "css_var_mapping": {
1689
+ "border": "var(--border)",
1690
+ "background": "var(--background)"
1691
+ }
1692
+ }
1693
+ ],
1694
+ "responsive_behavior": {
1695
+ "breakpoint_behaviors": {
1696
+ "sm": "Full width",
1697
+ "md": "Full width",
1698
+ "lg": "Full width"
1699
+ },
1700
+ "mobile_first": true,
1701
+ "touch_targets": {
1702
+ "min_size": "44px"
1703
+ }
1704
+ },
1705
+ "validation_rules": [],
1706
+ "conflict_resolution": [],
1707
+ "confidence_threshold": 0.7,
1708
+ "usage_frequency": 0,
1709
+ "examples": [
1710
+ {
1711
+ "natural_language": "Add a textarea for user comments",
1712
+ "extracted_intent": "textarea-field",
1713
+ "generated_code_sample": "<Textarea placeholder=\"Enter your comment...\" />"
1714
+ }
1715
+ ]
1716
+ },
1717
+ "file-upload": {
1718
+ "canonical_name": "file-upload",
1719
+ "category": "forms",
1720
+ "intent_phrases": [
1721
+ {
1722
+ "phrase": "file upload",
1723
+ "aliases": ["upload file", "file input", "file picker", "upload component"],
1724
+ "context_keywords": ["upload", "file", "input", "picker", "attach"],
1725
+ "confidence_boost": 0.9
1726
+ }
1727
+ ],
1728
+ "component_pattern": {
1729
+ "shadcn_components": [
1730
+ {
1731
+ "name": "Button",
1732
+ "import_path": "@/components/ui/button",
1733
+ "exports": ["Button"],
1734
+ "peer_components": ["Input"]
1735
+ },
1736
+ {
1737
+ "name": "Input",
1738
+ "import_path": "@/components/ui/input",
1739
+ "exports": ["Input"],
1740
+ "peer_components": []
1741
+ }
1742
+ ],
1743
+ "template_code": "<div className=\"space-y-2\">\n <Label htmlFor=\"{{id}}\">{{label}}</Label>\n <div className=\"flex items-center space-x-2\">\n <Input\n id=\"{{id}}\"\n type=\"file\"\n onChange={{{onChange}}}\n accept=\"{{accept}}\"\n multiple={{{multiple}}}\n disabled={{{disabled}}}\n />\n <Button type=\"button\" variant=\"outline\" onClick={{{onClear}}}>\n Clear\n </Button>\n </div>\n {{{files}}.length > 0 && (\n <div className=\"text-sm text-muted-foreground\">\n {{{files}}.length} file(s) selected\n </div>\n )}\n</div>",
1744
+ "required_props": [
1745
+ {
1746
+ "name": "onChange",
1747
+ "type": "(files: FileList | null) => void",
1748
+ "description": "File change handler"
1749
+ }
1750
+ ],
1751
+ "optional_props": [
1752
+ {
1753
+ "name": "accept",
1754
+ "type": "string",
1755
+ "description": "Accepted file types"
1756
+ },
1757
+ {
1758
+ "name": "multiple",
1759
+ "type": "boolean",
1760
+ "default_value": false,
1761
+ "description": "Allow multiple files"
1762
+ },
1763
+ {
1764
+ "name": "disabled",
1765
+ "type": "boolean",
1766
+ "default_value": false,
1767
+ "description": "Whether disabled"
1768
+ }
1769
+ ],
1770
+ "default_variants": {}
1771
+ },
1772
+ "interaction_spec": {
1773
+ "events": ["onChange", "onClear"],
1774
+ "states": [
1775
+ {
1776
+ "name": "files",
1777
+ "initial_value": [],
1778
+ "type": "File[]"
1779
+ }
1780
+ ],
1781
+ "behaviors": [
1782
+ {
1783
+ "trigger": "onChange",
1784
+ "action": "Update files state",
1785
+ "requirements": []
1786
+ }
1787
+ ]
1788
+ },
1789
+ "accessibility_spec": {
1790
+ "aria_attributes": {
1791
+ "aria-label": "File upload input"
1792
+ },
1793
+ "keyboard_support": [
1794
+ {
1795
+ "key": "Tab",
1796
+ "action": "Navigate to input"
1797
+ }
1798
+ ]
1799
+ },
1800
+ "design_tokens": [
1801
+ {
1802
+ "token_category": "color",
1803
+ "required_tokens": ["border"],
1804
+ "css_var_mapping": {
1805
+ "border": "var(--border)"
1806
+ }
1807
+ }
1808
+ ],
1809
+ "responsive_behavior": {
1810
+ "breakpoint_behaviors": {
1811
+ "sm": "Full width",
1812
+ "md": "Full width",
1813
+ "lg": "Full width"
1814
+ },
1815
+ "mobile_first": true,
1816
+ "touch_targets": {
1817
+ "min_size": "44px"
1818
+ }
1819
+ },
1820
+ "validation_rules": [],
1821
+ "conflict_resolution": [],
1822
+ "confidence_threshold": 0.8,
1823
+ "usage_frequency": 0,
1824
+ "examples": [
1825
+ {
1826
+ "natural_language": "Add a file upload for profile pictures",
1827
+ "extracted_intent": "file-upload",
1828
+ "generated_code_sample": "<Input type=\"file\" accept=\"image/*\" />"
1829
+ }
1830
+ ]
1831
+ },
1832
+ "date-picker": {
1833
+ "canonical_name": "date-picker",
1834
+ "category": "forms",
1835
+ "intent_phrases": [
1836
+ {
1837
+ "phrase": "date picker",
1838
+ "aliases": ["date input", "calendar picker", "date selector"],
1839
+ "context_keywords": ["date", "calendar", "picker", "select date"],
1840
+ "confidence_boost": 0.9
1841
+ }
1842
+ ],
1843
+ "component_pattern": {
1844
+ "shadcn_components": [
1845
+ {
1846
+ "name": "Calendar",
1847
+ "import_path": "@/components/ui/calendar",
1848
+ "exports": ["Calendar"],
1849
+ "peer_components": ["Popover", "Button"]
1850
+ },
1851
+ {
1852
+ "name": "Popover",
1853
+ "import_path": "@/components/ui/popover",
1854
+ "exports": ["Popover", "PopoverContent", "PopoverTrigger"],
1855
+ "peer_components": []
1856
+ }
1857
+ ],
1858
+ "template_code": "<div className=\"space-y-2\">\n <Label htmlFor=\"{{id}}\">{{label}}</Label>\n <Popover>\n <PopoverTrigger asChild>\n <Button\n id=\"{{id}}\"\n variant=\"outline\"\n className=\"w-full justify-start text-left font-normal\"\n >\n {{{value}} ? format({{value}}, \"PPP\") : \"{{placeholder}}\"}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n selected={{{value}}}\n onSelect={{{onChange}}}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n</div>",
1859
+ "required_props": [
1860
+ {
1861
+ "name": "value",
1862
+ "type": "Date | undefined",
1863
+ "description": "Selected date"
1864
+ },
1865
+ {
1866
+ "name": "onChange",
1867
+ "type": "(date: Date | undefined) => void",
1868
+ "description": "Date change handler"
1869
+ }
1870
+ ],
1871
+ "optional_props": [
1872
+ {
1873
+ "name": "placeholder",
1874
+ "type": "string",
1875
+ "default_value": "Pick a date",
1876
+ "description": "Placeholder text"
1877
+ },
1878
+ {
1879
+ "name": "disabled",
1880
+ "type": "boolean",
1881
+ "default_value": false,
1882
+ "description": "Whether disabled"
1883
+ }
1884
+ ],
1885
+ "default_variants": {}
1886
+ },
1887
+ "interaction_spec": {
1888
+ "events": ["onSelect", "onOpenChange"],
1889
+ "states": [
1890
+ {
1891
+ "name": "value",
1892
+ "initial_value": "undefined",
1893
+ "type": "Date | undefined"
1894
+ },
1895
+ {
1896
+ "name": "open",
1897
+ "initial_value": false,
1898
+ "type": "boolean"
1899
+ }
1900
+ ],
1901
+ "behaviors": [
1902
+ {
1903
+ "trigger": "onSelect",
1904
+ "action": "Update selected date",
1905
+ "requirements": []
1906
+ }
1907
+ ]
1908
+ },
1909
+ "accessibility_spec": {
1910
+ "aria_attributes": {
1911
+ "role": "combobox",
1912
+ "aria-expanded": "true when open"
1913
+ },
1914
+ "keyboard_support": [
1915
+ {
1916
+ "key": "Enter",
1917
+ "action": "Open calendar"
1918
+ },
1919
+ {
1920
+ "key": "Escape",
1921
+ "action": "Close calendar"
1922
+ }
1923
+ ]
1924
+ },
1925
+ "design_tokens": [
1926
+ {
1927
+ "token_category": "color",
1928
+ "required_tokens": ["primary", "border"],
1929
+ "css_var_mapping": {
1930
+ "selected-color": "var(--primary)",
1931
+ "border": "var(--border)"
1932
+ }
1933
+ }
1934
+ ],
1935
+ "responsive_behavior": {
1936
+ "breakpoint_behaviors": {
1937
+ "sm": "Full width",
1938
+ "md": "Full width",
1939
+ "lg": "Full width"
1940
+ },
1941
+ "mobile_first": true,
1942
+ "touch_targets": {
1943
+ "min_size": "44px"
1944
+ }
1945
+ },
1946
+ "validation_rules": [],
1947
+ "conflict_resolution": [],
1948
+ "confidence_threshold": 0.8,
1949
+ "usage_frequency": 0,
1950
+ "examples": [
1951
+ {
1952
+ "natural_language": "Add a date picker for selecting birth date",
1953
+ "extracted_intent": "date-picker",
1954
+ "generated_code_sample": "<Popover><PopoverTrigger><Button>Pick date</Button></PopoverTrigger><PopoverContent><Calendar /></PopoverContent></Popover>"
1955
+ }
1956
+ ]
1957
+ },
1958
+ "time-picker": {
1959
+ "canonical_name": "time-picker",
1960
+ "category": "forms",
1961
+ "intent_phrases": [
1962
+ {
1963
+ "phrase": "time picker",
1964
+ "aliases": ["time input", "time selector", "time field"],
1965
+ "context_keywords": ["time", "hour", "minute", "clock", "schedule"],
1966
+ "confidence_boost": 0.85
1967
+ }
1968
+ ],
1969
+ "component_pattern": {
1970
+ "shadcn_components": [
1971
+ {
1972
+ "name": "Input",
1973
+ "import_path": "@/components/ui/input",
1974
+ "exports": ["Input"],
1975
+ "peer_components": ["Label"]
1976
+ }
1977
+ ],
1978
+ "template_code": "<div className=\"space-y-2\">\n <Label htmlFor=\"{{id}}\">{{label}}</Label>\n <Input\n id=\"{{id}}\"\n type=\"time\"\n value={{{value}}}\n onChange={{{onChange}}}\n disabled={{{disabled}}}\n />\n</div>",
1979
+ "required_props": [
1980
+ {
1981
+ "name": "value",
1982
+ "type": "string",
1983
+ "description": "Time value (HH:MM format)"
1984
+ },
1985
+ {
1986
+ "name": "onChange",
1987
+ "type": "(e: React.ChangeEvent<HTMLInputElement>) => void",
1988
+ "description": "Time change handler"
1989
+ }
1990
+ ],
1991
+ "optional_props": [
1992
+ {
1993
+ "name": "disabled",
1994
+ "type": "boolean",
1995
+ "default_value": false,
1996
+ "description": "Whether disabled"
1997
+ }
1998
+ ],
1999
+ "default_variants": {}
2000
+ },
2001
+ "interaction_spec": {
2002
+ "events": ["onChange"],
2003
+ "states": [
2004
+ {
2005
+ "name": "value",
2006
+ "initial_value": "",
2007
+ "type": "string"
2008
+ }
2009
+ ],
2010
+ "behaviors": [
2011
+ {
2012
+ "trigger": "onChange",
2013
+ "action": "Update time value",
2014
+ "requirements": []
2015
+ }
2016
+ ]
2017
+ },
2018
+ "accessibility_spec": {
2019
+ "aria_attributes": {
2020
+ "aria-label": "Time input"
2021
+ },
2022
+ "keyboard_support": [
2023
+ {
2024
+ "key": "Tab",
2025
+ "action": "Navigate to input"
2026
+ }
2027
+ ]
2028
+ },
2029
+ "design_tokens": [
2030
+ {
2031
+ "token_category": "color",
2032
+ "required_tokens": ["border"],
2033
+ "css_var_mapping": {
2034
+ "border": "var(--border)"
2035
+ }
2036
+ }
2037
+ ],
2038
+ "responsive_behavior": {
2039
+ "breakpoint_behaviors": {
2040
+ "sm": "Full width",
2041
+ "md": "Full width",
2042
+ "lg": "Full width"
2043
+ },
2044
+ "mobile_first": true,
2045
+ "touch_targets": {
2046
+ "min_size": "44px"
2047
+ }
2048
+ },
2049
+ "validation_rules": [],
2050
+ "conflict_resolution": [],
2051
+ "confidence_threshold": 0.75,
2052
+ "usage_frequency": 0,
2053
+ "examples": [
2054
+ {
2055
+ "natural_language": "Add a time picker for appointment scheduling",
2056
+ "extracted_intent": "time-picker",
2057
+ "generated_code_sample": "<Input type=\"time\" />"
2058
+ }
2059
+ ]
2060
+ },
2061
+ "breadcrumb-nav": {
2062
+ "canonical_name": "breadcrumb-nav",
2063
+ "category": "navigation",
2064
+ "intent_phrases": [
2065
+ {
2066
+ "phrase": "breadcrumb navigation",
2067
+ "aliases": ["breadcrumb", "breadcrumbs", "navigation breadcrumb"],
2068
+ "context_keywords": ["breadcrumb", "navigation", "path", "trail", "location"],
2069
+ "confidence_boost": 0.9
2070
+ }
2071
+ ],
2072
+ "component_pattern": {
2073
+ "shadcn_components": [
2074
+ {
2075
+ "name": "Breadcrumb",
2076
+ "import_path": "@/components/ui/breadcrumb",
2077
+ "exports": ["Breadcrumb", "BreadcrumbItem", "BreadcrumbLink", "BreadcrumbList", "BreadcrumbPage", "BreadcrumbSeparator"],
2078
+ "peer_components": []
2079
+ }
2080
+ ],
2081
+ "template_code": "<Breadcrumb>\n <BreadcrumbList>\n {{{items}}.map((item, index) => (\n <BreadcrumbItem key={item.href}>\n {index === {{items}}.length - 1 ? (\n <BreadcrumbPage>{item.label}</BreadcrumbPage>\n ) : (\n <BreadcrumbLink href={item.href}>{item.label}</BreadcrumbLink>\n )}\n {index < {{items}}.length - 1 && <BreadcrumbSeparator />}\n </BreadcrumbItem>\n ))}\n </BreadcrumbList>\n</Breadcrumb>",
2082
+ "required_props": [
2083
+ {
2084
+ "name": "items",
2085
+ "type": "Array<{ href: string; label: string }>",
2086
+ "description": "Breadcrumb items"
2087
+ }
2088
+ ],
2089
+ "optional_props": [],
2090
+ "default_variants": {}
2091
+ },
2092
+ "interaction_spec": {
2093
+ "events": ["onClick"],
2094
+ "states": [],
2095
+ "behaviors": [
2096
+ {
2097
+ "trigger": "onClick",
2098
+ "action": "Navigate to href",
2099
+ "requirements": []
2100
+ }
2101
+ ]
2102
+ },
2103
+ "accessibility_spec": {
2104
+ "aria_attributes": {
2105
+ "role": "navigation",
2106
+ "aria-label": "Breadcrumb"
2107
+ },
2108
+ "keyboard_support": [
2109
+ {
2110
+ "key": "Tab",
2111
+ "action": "Navigate between links"
2112
+ },
2113
+ {
2114
+ "key": "Enter",
2115
+ "action": "Activate link"
2116
+ }
2117
+ ]
2118
+ },
2119
+ "design_tokens": [
2120
+ {
2121
+ "token_category": "color",
2122
+ "required_tokens": ["muted-foreground"],
2123
+ "css_var_mapping": {
2124
+ "separator-color": "var(--muted-foreground)"
2125
+ }
2126
+ }
2127
+ ],
2128
+ "responsive_behavior": {
2129
+ "breakpoint_behaviors": {
2130
+ "sm": "Horizontal scroll if needed",
2131
+ "md": "Full display",
2132
+ "lg": "Full display"
2133
+ },
2134
+ "mobile_first": true,
2135
+ "touch_targets": {
2136
+ "min_size": "44px"
2137
+ }
2138
+ },
2139
+ "validation_rules": [],
2140
+ "conflict_resolution": [],
2141
+ "confidence_threshold": 0.8,
2142
+ "usage_frequency": 0,
2143
+ "examples": [
2144
+ {
2145
+ "natural_language": "Add breadcrumb navigation showing current page path",
2146
+ "extracted_intent": "breadcrumb-nav",
2147
+ "generated_code_sample": "<Breadcrumb><BreadcrumbList><BreadcrumbItem><BreadcrumbLink>Home</BreadcrumbLink></BreadcrumbItem></BreadcrumbList></Breadcrumb>"
2148
+ }
2149
+ ]
2150
+ },
2151
+ "tabs-navigation": {
2152
+ "canonical_name": "tabs-navigation",
2153
+ "category": "navigation",
2154
+ "intent_phrases": [
2155
+ {
2156
+ "phrase": "tabs",
2157
+ "aliases": ["tab navigation", "tabbed interface", "tab panel"],
2158
+ "context_keywords": ["tabs", "tab", "navigation", "panel", "section"],
2159
+ "confidence_boost": 0.9
2160
+ }
2161
+ ],
2162
+ "component_pattern": {
2163
+ "shadcn_components": [
2164
+ {
2165
+ "name": "Tabs",
2166
+ "import_path": "@/components/ui/tabs",
2167
+ "exports": ["Tabs", "TabsContent", "TabsList", "TabsTrigger"],
2168
+ "peer_components": []
2169
+ }
2170
+ ],
2171
+ "template_code": "<Tabs defaultValue=\"{{default_tab}}\" className=\"w-full\">\n <TabsList>\n {{{tabs}}.map(tab => (\n <TabsTrigger key={tab.value} value={tab.value}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {{{tabs}}.map(tab => (\n <TabsContent key={tab.value} value={tab.value}>\n {tab.content}\n </TabsContent>\n ))}\n</Tabs>",
2172
+ "required_props": [
2173
+ {
2174
+ "name": "tabs",
2175
+ "type": "Array<{ value: string; label: string; content: React.ReactNode }>",
2176
+ "description": "Tab definitions"
2177
+ }
2178
+ ],
2179
+ "optional_props": [
2180
+ {
2181
+ "name": "default_tab",
2182
+ "type": "string",
2183
+ "description": "Default active tab"
2184
+ }
2185
+ ],
2186
+ "default_variants": {}
2187
+ },
2188
+ "interaction_spec": {
2189
+ "events": ["onValueChange"],
2190
+ "states": [
2191
+ {
2192
+ "name": "activeTab",
2193
+ "initial_value": "",
2194
+ "type": "string"
2195
+ }
2196
+ ],
2197
+ "behaviors": [
2198
+ {
2199
+ "trigger": "onValueChange",
2200
+ "action": "Switch active tab",
2201
+ "requirements": []
2202
+ }
2203
+ ]
2204
+ },
2205
+ "accessibility_spec": {
2206
+ "aria_attributes": {
2207
+ "role": "tablist",
2208
+ "aria-label": "Tab navigation"
2209
+ },
2210
+ "keyboard_support": [
2211
+ {
2212
+ "key": "ArrowLeft",
2213
+ "action": "Previous tab"
2214
+ },
2215
+ {
2216
+ "key": "ArrowRight",
2217
+ "action": "Next tab"
2218
+ },
2219
+ {
2220
+ "key": "Home",
2221
+ "action": "First tab"
2222
+ },
2223
+ {
2224
+ "key": "End",
2225
+ "action": "Last tab"
2226
+ }
2227
+ ]
2228
+ },
2229
+ "design_tokens": [
2230
+ {
2231
+ "token_category": "color",
2232
+ "required_tokens": ["primary", "muted"],
2233
+ "css_var_mapping": {
2234
+ "active-color": "var(--primary)",
2235
+ "inactive-color": "var(--muted)"
2236
+ }
2237
+ }
2238
+ ],
2239
+ "responsive_behavior": {
2240
+ "breakpoint_behaviors": {
2241
+ "sm": "Scrollable tabs",
2242
+ "md": "Full tabs",
2243
+ "lg": "Full tabs"
2244
+ },
2245
+ "mobile_first": true,
2246
+ "touch_targets": {
2247
+ "min_size": "44px"
2248
+ }
2249
+ },
2250
+ "validation_rules": [],
2251
+ "conflict_resolution": [],
2252
+ "confidence_threshold": 0.8,
2253
+ "usage_frequency": 0,
2254
+ "examples": [
2255
+ {
2256
+ "natural_language": "Add tabs for different sections of the form",
2257
+ "extracted_intent": "tabs-navigation",
2258
+ "generated_code_sample": "<Tabs><TabsList><TabsTrigger>Tab 1</TabsTrigger></TabsList><TabsContent>Content</TabsContent></Tabs>"
2259
+ }
2260
+ ]
2261
+ },
2262
+ "sidebar-menu": {
2263
+ "canonical_name": "sidebar-menu",
2264
+ "category": "navigation",
2265
+ "intent_phrases": [
2266
+ {
2267
+ "phrase": "sidebar menu",
2268
+ "aliases": ["sidebar", "side menu", "navigation sidebar"],
2269
+ "context_keywords": ["sidebar", "side", "menu", "navigation", "panel"],
2270
+ "confidence_boost": 0.85
2271
+ }
2272
+ ],
2273
+ "component_pattern": {
2274
+ "shadcn_components": [
2275
+ {
2276
+ "name": "Sheet",
2277
+ "import_path": "@/components/ui/sheet",
2278
+ "exports": ["Sheet", "SheetContent", "SheetTrigger"],
2279
+ "peer_components": ["Button"]
2280
+ }
2281
+ ],
2282
+ "template_code": "<div className=\"flex h-screen\">\n <Sheet>\n <SheetTrigger asChild>\n <Button variant=\"outline\" size=\"icon\">\n <Menu className=\"h-4 w-4\" />\n </Button>\n </SheetTrigger>\n <SheetContent side=\"left\" className=\"w-64\">\n <nav className=\"space-y-2\">\n {{{items}}.map(item => (\n <a\n key={item.href}\n href={item.href}\n className=\"flex items-center space-x-2 px-3 py-2 rounded-md hover:bg-accent\"\n >\n {item.icon && <item.icon className=\"h-4 w-4\" />}\n <span>{item.label}</span>\n </a>\n ))}\n </nav>\n </SheetContent>\n </Sheet>\n</div>",
2283
+ "required_props": [
2284
+ {
2285
+ "name": "items",
2286
+ "type": "Array<{ href: string; label: string; icon?: React.ComponentType }>",
2287
+ "description": "Sidebar menu items"
2288
+ }
2289
+ ],
2290
+ "optional_props": [],
2291
+ "default_variants": {}
2292
+ },
2293
+ "interaction_spec": {
2294
+ "events": ["onClick", "onOpenChange"],
2295
+ "states": [
2296
+ {
2297
+ "name": "open",
2298
+ "initial_value": false,
2299
+ "type": "boolean"
2300
+ }
2301
+ ],
2302
+ "behaviors": [
2303
+ {
2304
+ "trigger": "onClick",
2305
+ "action": "Navigate to href",
2306
+ "requirements": []
2307
+ }
2308
+ ]
2309
+ },
2310
+ "accessibility_spec": {
2311
+ "aria_attributes": {
2312
+ "role": "navigation",
2313
+ "aria-label": "Sidebar navigation"
2314
+ },
2315
+ "keyboard_support": [
2316
+ {
2317
+ "key": "Escape",
2318
+ "action": "Close sidebar"
2319
+ },
2320
+ {
2321
+ "key": "Tab",
2322
+ "action": "Navigate between items"
2323
+ }
2324
+ ]
2325
+ },
2326
+ "design_tokens": [
2327
+ {
2328
+ "token_category": "color",
2329
+ "required_tokens": ["accent"],
2330
+ "css_var_mapping": {
2331
+ "hover-color": "var(--accent)"
2332
+ }
2333
+ }
2334
+ ],
2335
+ "responsive_behavior": {
2336
+ "breakpoint_behaviors": {
2337
+ "sm": "Overlay sidebar",
2338
+ "md": "Overlay sidebar",
2339
+ "lg": "Persistent sidebar"
2340
+ },
2341
+ "mobile_first": true,
2342
+ "touch_targets": {
2343
+ "min_size": "44px"
2344
+ }
2345
+ },
2346
+ "validation_rules": [],
2347
+ "conflict_resolution": [],
2348
+ "confidence_threshold": 0.75,
2349
+ "usage_frequency": 0,
2350
+ "examples": [
2351
+ {
2352
+ "natural_language": "Add a sidebar menu for navigation",
2353
+ "extracted_intent": "sidebar-menu",
2354
+ "generated_code_sample": "<Sheet><SheetTrigger><Button>Menu</Button></SheetTrigger><SheetContent>...</SheetContent></Sheet>"
2355
+ }
2356
+ ]
2357
+ },
2358
+ "pagination-control": {
2359
+ "canonical_name": "pagination-control",
2360
+ "category": "navigation",
2361
+ "intent_phrases": [
2362
+ {
2363
+ "phrase": "pagination",
2364
+ "aliases": ["page navigation", "page controls", "pager"],
2365
+ "context_keywords": ["pagination", "page", "navigation", "next", "previous"],
2366
+ "confidence_boost": 0.9
2367
+ }
2368
+ ],
2369
+ "component_pattern": {
2370
+ "shadcn_components": [
2371
+ {
2372
+ "name": "Pagination",
2373
+ "import_path": "@/components/ui/pagination",
2374
+ "exports": ["Pagination", "PaginationContent", "PaginationEllipsis", "PaginationItem", "PaginationLink", "PaginationNext", "PaginationPrevious"],
2375
+ "peer_components": []
2376
+ }
2377
+ ],
2378
+ "template_code": "<Pagination>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious \n href=\"{{previous_href}}\"\n onClick={{{onPrevious}}}\n disabled={{{!has_previous}}}\n />\n </PaginationItem>\n {{{pages}}.map(page => (\n <PaginationItem key={page}>\n <PaginationLink \n href=\"{{base_href}}?page={{page}}\"\n isActive={page === {{current_page}}}\n >\n {page}\n </PaginationLink>\n </PaginationItem>\n ))}\n <PaginationItem>\n <PaginationNext \n href=\"{{next_href}}\"\n onClick={{{onNext}}}\n disabled={{{!has_next}}}\n />\n </PaginationItem>\n </PaginationContent>\n</Pagination>",
2379
+ "required_props": [
2380
+ {
2381
+ "name": "current_page",
2382
+ "type": "number",
2383
+ "description": "Current page number"
2384
+ },
2385
+ {
2386
+ "name": "total_pages",
2387
+ "type": "number",
2388
+ "description": "Total number of pages"
2389
+ },
2390
+ {
2391
+ "name": "onPageChange",
2392
+ "type": "(page: number) => void",
2393
+ "description": "Page change handler"
2394
+ }
2395
+ ],
2396
+ "optional_props": [
2397
+ {
2398
+ "name": "base_href",
2399
+ "type": "string",
2400
+ "description": "Base URL for page links"
2401
+ }
2402
+ ],
2403
+ "default_variants": {}
2404
+ },
2405
+ "interaction_spec": {
2406
+ "events": ["onPageChange"],
2407
+ "states": [
2408
+ {
2409
+ "name": "currentPage",
2410
+ "initial_value": 1,
2411
+ "type": "number"
2412
+ }
2413
+ ],
2414
+ "behaviors": [
2415
+ {
2416
+ "trigger": "onPageChange",
2417
+ "action": "Navigate to new page",
2418
+ "requirements": []
2419
+ }
2420
+ ]
2421
+ },
2422
+ "accessibility_spec": {
2423
+ "aria_attributes": {
2424
+ "role": "navigation",
2425
+ "aria-label": "Pagination navigation"
2426
+ },
2427
+ "keyboard_support": [
2428
+ {
2429
+ "key": "Tab",
2430
+ "action": "Navigate between page links"
2431
+ },
2432
+ {
2433
+ "key": "Enter",
2434
+ "action": "Activate page link"
2435
+ }
2436
+ ]
2437
+ },
2438
+ "design_tokens": [
2439
+ {
2440
+ "token_category": "color",
2441
+ "required_tokens": ["primary", "muted"],
2442
+ "css_var_mapping": {
2443
+ "active-color": "var(--primary)",
2444
+ "inactive-color": "var(--muted)"
2445
+ }
2446
+ }
2447
+ ],
2448
+ "responsive_behavior": {
2449
+ "breakpoint_behaviors": {
2450
+ "sm": "Compact pagination",
2451
+ "md": "Full pagination",
2452
+ "lg": "Full pagination"
2453
+ },
2454
+ "mobile_first": true,
2455
+ "touch_targets": {
2456
+ "min_size": "44px"
2457
+ }
2458
+ },
2459
+ "validation_rules": [],
2460
+ "conflict_resolution": [],
2461
+ "confidence_threshold": 0.8,
2462
+ "usage_frequency": 0,
2463
+ "examples": [
2464
+ {
2465
+ "natural_language": "Add pagination controls for the data table",
2466
+ "extracted_intent": "pagination-control",
2467
+ "generated_code_sample": "<Pagination><PaginationContent><PaginationPrevious /><PaginationNext /></PaginationContent></Pagination>"
2468
+ }
2469
+ ]
2470
+ },
2471
+ "toast-notification": {
2472
+ "canonical_name": "toast-notification",
2473
+ "category": "feedback",
2474
+ "intent_phrases": [
2475
+ {
2476
+ "phrase": "toast notification",
2477
+ "aliases": ["toast", "notification", "popup message", "snackbar"],
2478
+ "context_keywords": ["toast", "notification", "message", "popup", "alert"],
2479
+ "confidence_boost": 0.9
2480
+ }
2481
+ ],
2482
+ "component_pattern": {
2483
+ "shadcn_components": [
2484
+ {
2485
+ "name": "Sonner",
2486
+ "import_path": "@/components/ui/sonner",
2487
+ "exports": ["Toaster", "toast"],
2488
+ "peer_components": []
2489
+ }
2490
+ ],
2491
+ "template_code": "<>\n <Toaster />\n <Button onClick={() => toast({{toast_type}}, {\n title: \"{{title}}\",\n description: \"{{description}}\",\n action: {\n label: \"{{action_label}}\",\n onClick: {{action_handler}}\n }\n })}>\n Show Toast\n </Button>\n</>",
2492
+ "required_props": [
2493
+ {
2494
+ "name": "title",
2495
+ "type": "string",
2496
+ "description": "Toast title"
2497
+ },
2498
+ {
2499
+ "name": "description",
2500
+ "type": "string",
2501
+ "description": "Toast description"
2502
+ }
2503
+ ],
2504
+ "optional_props": [
2505
+ {
2506
+ "name": "type",
2507
+ "type": "'default' | 'success' | 'error' | 'warning' | 'info'",
2508
+ "default_value": "default",
2509
+ "description": "Toast type"
2510
+ },
2511
+ {
2512
+ "name": "action_label",
2513
+ "type": "string",
2514
+ "description": "Action button label"
2515
+ },
2516
+ {
2517
+ "name": "action_handler",
2518
+ "type": "() => void",
2519
+ "description": "Action button handler"
2520
+ }
2521
+ ],
2522
+ "default_variants": {}
2523
+ },
2524
+ "interaction_spec": {
2525
+ "events": ["onAction", "onDismiss"],
2526
+ "states": [],
2527
+ "behaviors": [
2528
+ {
2529
+ "trigger": "onAction",
2530
+ "action": "Execute action handler",
2531
+ "requirements": []
2532
+ }
2533
+ ]
2534
+ },
2535
+ "accessibility_spec": {
2536
+ "aria_attributes": {
2537
+ "role": "alert",
2538
+ "aria-live": "polite"
2539
+ },
2540
+ "keyboard_support": [
2541
+ {
2542
+ "key": "Escape",
2543
+ "action": "Dismiss toast"
2544
+ }
2545
+ ]
2546
+ },
2547
+ "design_tokens": [
2548
+ {
2549
+ "token_category": "color",
2550
+ "required_tokens": ["background", "foreground"],
2551
+ "css_var_mapping": {
2552
+ "background": "var(--background)",
2553
+ "color": "var(--foreground)"
2554
+ }
2555
+ }
2556
+ ],
2557
+ "responsive_behavior": {
2558
+ "breakpoint_behaviors": {
2559
+ "sm": "Bottom positioned",
2560
+ "md": "Top-right positioned",
2561
+ "lg": "Top-right positioned"
2562
+ },
2563
+ "mobile_first": true,
2564
+ "touch_targets": {
2565
+ "min_size": "44px"
2566
+ }
2567
+ },
2568
+ "validation_rules": [],
2569
+ "conflict_resolution": [],
2570
+ "confidence_threshold": 0.8,
2571
+ "usage_frequency": 0,
2572
+ "examples": [
2573
+ {
2574
+ "natural_language": "Show a success toast when form is submitted",
2575
+ "extracted_intent": "toast-notification",
2576
+ "generated_code_sample": "toast('success', { title: 'Success', description: 'Form submitted' })"
2577
+ }
2578
+ ]
2579
+ },
2580
+ "progress-bar": {
2581
+ "canonical_name": "progress-bar",
2582
+ "category": "feedback",
2583
+ "intent_phrases": [
2584
+ {
2585
+ "phrase": "progress bar",
2586
+ "aliases": ["progress indicator", "loading bar", "progress meter"],
2587
+ "context_keywords": ["progress", "loading", "bar", "indicator", "meter"],
2588
+ "confidence_boost": 0.85
2589
+ }
2590
+ ],
2591
+ "component_pattern": {
2592
+ "shadcn_components": [
2593
+ {
2594
+ "name": "Progress",
2595
+ "import_path": "@/components/ui/progress",
2596
+ "exports": ["Progress"],
2597
+ "peer_components": []
2598
+ }
2599
+ ],
2600
+ "template_code": "<div className=\"space-y-2\">\n <div className=\"flex justify-between text-sm\">\n <span>{{label}}</span>\n <span>{{{value}}}%</span>\n </div>\n <Progress value={{{value}}} className=\"w-full\" />\n</div>",
2601
+ "required_props": [
2602
+ {
2603
+ "name": "value",
2604
+ "type": "number",
2605
+ "description": "Progress value (0-100)"
2606
+ }
2607
+ ],
2608
+ "optional_props": [
2609
+ {
2610
+ "name": "label",
2611
+ "type": "string",
2612
+ "description": "Progress label"
2613
+ },
2614
+ {
2615
+ "name": "show_percentage",
2616
+ "type": "boolean",
2617
+ "default_value": true,
2618
+ "description": "Show percentage"
2619
+ }
2620
+ ],
2621
+ "default_variants": {}
2622
+ },
2623
+ "interaction_spec": {
2624
+ "events": [],
2625
+ "states": [
2626
+ {
2627
+ "name": "value",
2628
+ "initial_value": 0,
2629
+ "type": "number"
2630
+ }
2631
+ ],
2632
+ "behaviors": []
2633
+ },
2634
+ "accessibility_spec": {
2635
+ "aria_attributes": {
2636
+ "role": "progressbar",
2637
+ "aria-valuenow": "Current progress value",
2638
+ "aria-valuemin": "0",
2639
+ "aria-valuemax": "100"
2640
+ },
2641
+ "keyboard_support": []
2642
+ },
2643
+ "design_tokens": [
2644
+ {
2645
+ "token_category": "color",
2646
+ "required_tokens": ["primary"],
2647
+ "css_var_mapping": {
2648
+ "progress-color": "var(--primary)"
2649
+ }
2650
+ }
2651
+ ],
2652
+ "responsive_behavior": {
2653
+ "breakpoint_behaviors": {
2654
+ "sm": "Full width",
2655
+ "md": "Full width",
2656
+ "lg": "Full width"
2657
+ },
2658
+ "mobile_first": true,
2659
+ "touch_targets": {
2660
+ "min_size": "44px"
2661
+ }
2662
+ },
2663
+ "validation_rules": [],
2664
+ "conflict_resolution": [],
2665
+ "confidence_threshold": 0.75,
2666
+ "usage_frequency": 0,
2667
+ "examples": [
2668
+ {
2669
+ "natural_language": "Add a progress bar showing upload progress",
2670
+ "extracted_intent": "progress-bar",
2671
+ "generated_code_sample": "<Progress value={75} />"
2672
+ }
2673
+ ]
2674
+ },
2675
+ "skeleton-loader": {
2676
+ "canonical_name": "skeleton-loader",
2677
+ "category": "feedback",
2678
+ "intent_phrases": [
2679
+ {
2680
+ "phrase": "skeleton loader",
2681
+ "aliases": ["skeleton", "loading skeleton", "placeholder", "shimmer"],
2682
+ "context_keywords": ["skeleton", "loading", "placeholder", "shimmer", "placeholder"],
2683
+ "confidence_boost": 0.85
2684
+ }
2685
+ ],
2686
+ "component_pattern": {
2687
+ "shadcn_components": [
2688
+ {
2689
+ "name": "Skeleton",
2690
+ "import_path": "@/components/ui/skeleton",
2691
+ "exports": ["Skeleton"],
2692
+ "peer_components": []
2693
+ }
2694
+ ],
2695
+ "template_code": "<div className=\"space-y-2\">\n <Skeleton className=\"h-4 w-[250px]\" />\n <Skeleton className=\"h-4 w-[200px]\" />\n <Skeleton className=\"h-4 w-[150px]\" />\n</div>",
2696
+ "required_props": [],
2697
+ "optional_props": [
2698
+ {
2699
+ "name": "lines",
2700
+ "type": "number",
2701
+ "default_value": 3,
2702
+ "description": "Number of skeleton lines"
2703
+ },
2704
+ {
2705
+ "name": "width",
2706
+ "type": "string",
2707
+ "description": "Skeleton width"
2708
+ },
2709
+ {
2710
+ "name": "height",
2711
+ "type": "string",
2712
+ "description": "Skeleton height"
2713
+ }
2714
+ ],
2715
+ "default_variants": {}
2716
+ },
2717
+ "interaction_spec": {
2718
+ "events": [],
2719
+ "states": [],
2720
+ "behaviors": []
2721
+ },
2722
+ "accessibility_spec": {
2723
+ "aria_attributes": {
2724
+ "role": "status",
2725
+ "aria-label": "Loading content"
2726
+ },
2727
+ "keyboard_support": []
2728
+ },
2729
+ "design_tokens": [
2730
+ {
2731
+ "token_category": "color",
2732
+ "required_tokens": ["muted"],
2733
+ "css_var_mapping": {
2734
+ "background": "var(--muted)"
2735
+ }
2736
+ }
2737
+ ],
2738
+ "responsive_behavior": {
2739
+ "breakpoint_behaviors": {
2740
+ "sm": "Full width",
2741
+ "md": "Full width",
2742
+ "lg": "Full width"
2743
+ },
2744
+ "mobile_first": true,
2745
+ "touch_targets": {
2746
+ "min_size": "44px"
2747
+ }
2748
+ },
2749
+ "validation_rules": [],
2750
+ "conflict_resolution": [],
2751
+ "confidence_threshold": 0.75,
2752
+ "usage_frequency": 0,
2753
+ "examples": [
2754
+ {
2755
+ "natural_language": "Show skeleton loading while content loads",
2756
+ "extracted_intent": "skeleton-loader",
2757
+ "generated_code_sample": "<Skeleton className=\"h-4 w-[250px]\" />"
2758
+ }
2759
+ ]
2760
+ },
2761
+ "error-message": {
2762
+ "canonical_name": "error-message",
2763
+ "category": "feedback",
2764
+ "intent_phrases": [
2765
+ {
2766
+ "phrase": "error message",
2767
+ "aliases": ["error alert", "error notification", "error display"],
2768
+ "context_keywords": ["error", "message", "alert", "notification", "failure"],
2769
+ "confidence_boost": 0.9
2770
+ }
2771
+ ],
2772
+ "component_pattern": {
2773
+ "shadcn_components": [
2774
+ {
2775
+ "name": "Alert",
2776
+ "import_path": "@/components/ui/alert",
2777
+ "exports": ["Alert", "AlertTitle", "AlertDescription"],
2778
+ "peer_components": []
2779
+ }
2780
+ ],
2781
+ "template_code": "<Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertTitle>Error</AlertTitle>\n <AlertDescription>\n {{message}}\n </AlertDescription>\n</Alert>",
2782
+ "required_props": [
2783
+ {
2784
+ "name": "message",
2785
+ "type": "string",
2786
+ "description": "Error message"
2787
+ }
2788
+ ],
2789
+ "optional_props": [
2790
+ {
2791
+ "name": "title",
2792
+ "type": "string",
2793
+ "default_value": "Error",
2794
+ "description": "Error title"
2795
+ },
2796
+ {
2797
+ "name": "dismissible",
2798
+ "type": "boolean",
2799
+ "default_value": false,
2800
+ "description": "Whether dismissible"
2801
+ }
2802
+ ],
2803
+ "default_variants": {
2804
+ "variant": "destructive"
2805
+ }
2806
+ },
2807
+ "interaction_spec": {
2808
+ "events": ["onDismiss"],
2809
+ "states": [
2810
+ {
2811
+ "name": "visible",
2812
+ "initial_value": true,
2813
+ "type": "boolean"
2814
+ }
2815
+ ],
2816
+ "behaviors": [
2817
+ {
2818
+ "trigger": "onDismiss",
2819
+ "action": "Hide error message",
2820
+ "requirements": []
2821
+ }
2822
+ ]
2823
+ },
2824
+ "accessibility_spec": {
2825
+ "aria_attributes": {
2826
+ "role": "alert",
2827
+ "aria-live": "assertive"
2828
+ },
2829
+ "keyboard_support": []
2830
+ },
2831
+ "design_tokens": [
2832
+ {
2833
+ "token_category": "color",
2834
+ "required_tokens": ["destructive"],
2835
+ "css_var_mapping": {
2836
+ "error-color": "var(--destructive)"
2837
+ }
2838
+ }
2839
+ ],
2840
+ "responsive_behavior": {
2841
+ "breakpoint_behaviors": {
2842
+ "sm": "Full width",
2843
+ "md": "Full width",
2844
+ "lg": "Full width"
2845
+ },
2846
+ "mobile_first": true,
2847
+ "touch_targets": {
2848
+ "min_size": "44px"
2849
+ }
2850
+ },
2851
+ "validation_rules": [],
2852
+ "conflict_resolution": [],
2853
+ "confidence_threshold": 0.8,
2854
+ "usage_frequency": 0,
2855
+ "examples": [
2856
+ {
2857
+ "natural_language": "Display an error message when validation fails",
2858
+ "extracted_intent": "error-message",
2859
+ "generated_code_sample": "<Alert variant=\"destructive\"><AlertTitle>Error</AlertTitle><AlertDescription>Validation failed</AlertDescription></Alert>"
2860
+ }
2861
+ ]
2862
+ },
2863
+ "modal-dialog": {
2864
+ "canonical_name": "modal-dialog",
2865
+ "category": "overlay",
2866
+ "intent_phrases": [
2867
+ {
2868
+ "phrase": "modal dialog",
2869
+ "aliases": ["modal", "dialog", "popup", "overlay"],
2870
+ "context_keywords": ["modal", "dialog", "popup", "overlay", "window"],
2871
+ "confidence_boost": 0.9
2872
+ }
2873
+ ],
2874
+ "component_pattern": {
2875
+ "shadcn_components": [
2876
+ {
2877
+ "name": "Dialog",
2878
+ "import_path": "@/components/ui/dialog",
2879
+ "exports": ["Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger"],
2880
+ "peer_components": ["Button"]
2881
+ }
2882
+ ],
2883
+ "template_code": "<Dialog>\n <DialogTrigger asChild>\n <Button variant=\"{{trigger_variant}}\">{{trigger_label}}</Button>\n </DialogTrigger>\n <DialogContent className=\"sm:max-w-[425px]\">\n <DialogHeader>\n <DialogTitle>{{title}}</DialogTitle>\n <DialogDescription>\n {{description}}\n </DialogDescription>\n </DialogHeader>\n <div className=\"py-4\">\n {{content}}\n </div>\n <DialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={{{onCancel}}}>\n Cancel\n </Button>\n <Button type=\"button\" onClick={{{onConfirm}}}>\n {{confirm_label}}\n </Button>\n </DialogFooter>\n </DialogContent>\n</Dialog>",
2884
+ "required_props": [
2885
+ {
2886
+ "name": "title",
2887
+ "type": "string",
2888
+ "description": "Dialog title"
2889
+ },
2890
+ {
2891
+ "name": "content",
2892
+ "type": "React.ReactNode",
2893
+ "description": "Dialog content"
2894
+ }
2895
+ ],
2896
+ "optional_props": [
2897
+ {
2898
+ "name": "description",
2899
+ "type": "string",
2900
+ "description": "Dialog description"
2901
+ },
2902
+ {
2903
+ "name": "trigger_label",
2904
+ "type": "string",
2905
+ "default_value": "Open",
2906
+ "description": "Trigger button label"
2907
+ },
2908
+ {
2909
+ "name": "confirm_label",
2910
+ "type": "string",
2911
+ "default_value": "Confirm",
2912
+ "description": "Confirm button label"
2913
+ },
2914
+ {
2915
+ "name": "onConfirm",
2916
+ "type": "() => void",
2917
+ "description": "Confirm handler"
2918
+ },
2919
+ {
2920
+ "name": "onCancel",
2921
+ "type": "() => void",
2922
+ "description": "Cancel handler"
2923
+ }
2924
+ ],
2925
+ "default_variants": {}
2926
+ },
2927
+ "interaction_spec": {
2928
+ "events": ["onOpenChange", "onConfirm", "onCancel"],
2929
+ "states": [
2930
+ {
2931
+ "name": "open",
2932
+ "initial_value": false,
2933
+ "type": "boolean"
2934
+ }
2935
+ ],
2936
+ "behaviors": [
2937
+ {
2938
+ "trigger": "onConfirm",
2939
+ "action": "Execute confirm action and close",
2940
+ "requirements": []
2941
+ },
2942
+ {
2943
+ "trigger": "onCancel",
2944
+ "action": "Close dialog",
2945
+ "requirements": []
2946
+ }
2947
+ ]
2948
+ },
2949
+ "accessibility_spec": {
2950
+ "aria_attributes": {
2951
+ "role": "dialog",
2952
+ "aria-labelledby": "Dialog title",
2953
+ "aria-describedby": "Dialog description"
2954
+ },
2955
+ "keyboard_support": [
2956
+ {
2957
+ "key": "Escape",
2958
+ "action": "Close dialog"
2959
+ },
2960
+ {
2961
+ "key": "Tab",
2962
+ "action": "Navigate between focusable elements"
2963
+ }
2964
+ ],
2965
+ "focus_management": "Trap focus within dialog, restore on close"
2966
+ },
2967
+ "design_tokens": [
2968
+ {
2969
+ "token_category": "color",
2970
+ "required_tokens": ["background", "foreground"],
2971
+ "css_var_mapping": {
2972
+ "background": "var(--background)",
2973
+ "color": "var(--foreground)"
2974
+ }
2975
+ }
2976
+ ],
2977
+ "responsive_behavior": {
2978
+ "breakpoint_behaviors": {
2979
+ "sm": "Full screen on mobile",
2980
+ "md": "Centered modal on tablet+",
2981
+ "lg": "Centered modal"
2982
+ },
2983
+ "mobile_first": true,
2984
+ "touch_targets": {
2985
+ "min_size": "44px"
2986
+ }
2987
+ },
2988
+ "validation_rules": [],
2989
+ "conflict_resolution": [],
2990
+ "confidence_threshold": 0.8,
2991
+ "usage_frequency": 0,
2992
+ "examples": [
2993
+ {
2994
+ "natural_language": "Add a modal dialog for editing user details",
2995
+ "extracted_intent": "modal-dialog",
2996
+ "generated_code_sample": "<Dialog><DialogTrigger><Button>Edit</Button></DialogTrigger><DialogContent>...</DialogContent></Dialog>"
2997
+ }
2998
+ ]
2999
+ },
3000
+ "dropdown-menu": {
3001
+ "canonical_name": "dropdown-menu",
3002
+ "category": "overlay",
3003
+ "intent_phrases": [
3004
+ {
3005
+ "phrase": "dropdown menu",
3006
+ "aliases": ["dropdown", "menu", "context menu", "action menu"],
3007
+ "context_keywords": ["dropdown", "menu", "context", "action", "options"],
3008
+ "confidence_boost": 0.9
3009
+ }
3010
+ ],
3011
+ "component_pattern": {
3012
+ "shadcn_components": [
3013
+ {
3014
+ "name": "DropdownMenu",
3015
+ "import_path": "@/components/ui/dropdown-menu",
3016
+ "exports": ["DropdownMenu", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuTrigger"],
3017
+ "peer_components": ["Button"]
3018
+ }
3019
+ ],
3020
+ "template_code": "<DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\">{{trigger_label}}</Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel>{{label}}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {{{items}}.map(item => (\n <DropdownMenuItem key={item.value} onClick={item.onClick}>\n {item.icon && <item.icon className=\"mr-2 h-4 w-4\" />}\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n</DropdownMenu>",
3021
+ "required_props": [
3022
+ {
3023
+ "name": "items",
3024
+ "type": "Array<{ value: string; label: string; onClick: () => void; icon?: React.ComponentType }>",
3025
+ "description": "Menu items"
3026
+ }
3027
+ ],
3028
+ "optional_props": [
3029
+ {
3030
+ "name": "trigger_label",
3031
+ "type": "string",
3032
+ "default_value": "Options",
3033
+ "description": "Trigger button label"
3034
+ },
3035
+ {
3036
+ "name": "label",
3037
+ "type": "string",
3038
+ "description": "Menu label"
3039
+ }
3040
+ ],
3041
+ "default_variants": {}
3042
+ },
3043
+ "interaction_spec": {
3044
+ "events": ["onSelect", "onOpenChange"],
3045
+ "states": [
3046
+ {
3047
+ "name": "open",
3048
+ "initial_value": false,
3049
+ "type": "boolean"
3050
+ }
3051
+ ],
3052
+ "behaviors": [
3053
+ {
3054
+ "trigger": "onSelect",
3055
+ "action": "Execute item action",
3056
+ "requirements": []
3057
+ }
3058
+ ]
3059
+ },
3060
+ "accessibility_spec": {
3061
+ "aria_attributes": {
3062
+ "role": "menu",
3063
+ "aria-label": "Dropdown menu"
3064
+ },
3065
+ "keyboard_support": [
3066
+ {
3067
+ "key": "Enter",
3068
+ "action": "Open menu"
3069
+ },
3070
+ {
3071
+ "key": "ArrowDown",
3072
+ "action": "Navigate menu items"
3073
+ },
3074
+ {
3075
+ "key": "Escape",
3076
+ "action": "Close menu"
3077
+ }
3078
+ ]
3079
+ },
3080
+ "design_tokens": [
3081
+ {
3082
+ "token_category": "color",
3083
+ "required_tokens": ["background", "foreground"],
3084
+ "css_var_mapping": {
3085
+ "background": "var(--background)",
3086
+ "color": "var(--foreground)"
3087
+ }
3088
+ }
3089
+ ],
3090
+ "responsive_behavior": {
3091
+ "breakpoint_behaviors": {
3092
+ "sm": "Full width",
3093
+ "md": "Auto width",
3094
+ "lg": "Auto width"
3095
+ },
3096
+ "mobile_first": true,
3097
+ "touch_targets": {
3098
+ "min_size": "44px"
3099
+ }
3100
+ },
3101
+ "validation_rules": [],
3102
+ "conflict_resolution": [],
3103
+ "confidence_threshold": 0.8,
3104
+ "usage_frequency": 0,
3105
+ "examples": [
3106
+ {
3107
+ "natural_language": "Add a dropdown menu with edit and delete options",
3108
+ "extracted_intent": "dropdown-menu",
3109
+ "generated_code_sample": "<DropdownMenu><DropdownMenuTrigger><Button>Options</Button></DropdownMenuTrigger><DropdownMenuContent>...</DropdownMenuContent></DropdownMenu>"
3110
+ }
3111
+ ]
3112
+ },
3113
+ "tooltip": {
3114
+ "canonical_name": "tooltip",
3115
+ "category": "overlay",
3116
+ "intent_phrases": [
3117
+ {
3118
+ "phrase": "tooltip",
3119
+ "aliases": ["tool tip", "hint", "help text", "popover hint"],
3120
+ "context_keywords": ["tooltip", "hint", "help", "tip", "information"],
3121
+ "confidence_boost": 0.85
3122
+ }
3123
+ ],
3124
+ "component_pattern": {
3125
+ "shadcn_components": [
3126
+ {
3127
+ "name": "Tooltip",
3128
+ "import_path": "@/components/ui/tooltip",
3129
+ "exports": ["Tooltip", "TooltipContent", "TooltipProvider", "TooltipTrigger"],
3130
+ "peer_components": []
3131
+ }
3132
+ ],
3133
+ "template_code": "<TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n {{trigger_element}}\n </TooltipTrigger>\n <TooltipContent>\n <p>{{content}}</p>\n </TooltipContent>\n </Tooltip>\n</TooltipProvider>",
3134
+ "required_props": [
3135
+ {
3136
+ "name": "content",
3137
+ "type": "string",
3138
+ "description": "Tooltip content"
3139
+ },
3140
+ {
3141
+ "name": "trigger_element",
3142
+ "type": "React.ReactNode",
3143
+ "description": "Element that triggers tooltip"
3144
+ }
3145
+ ],
3146
+ "optional_props": [
3147
+ {
3148
+ "name": "side",
3149
+ "type": "'top' | 'right' | 'bottom' | 'left'",
3150
+ "default_value": "top",
3151
+ "description": "Tooltip position"
3152
+ },
3153
+ {
3154
+ "name": "delay_duration",
3155
+ "type": "number",
3156
+ "default_value": 400,
3157
+ "description": "Delay before showing tooltip"
3158
+ }
3159
+ ],
3160
+ "default_variants": {}
3161
+ },
3162
+ "interaction_spec": {
3163
+ "events": ["onOpenChange"],
3164
+ "states": [
3165
+ {
3166
+ "name": "open",
3167
+ "initial_value": false,
3168
+ "type": "boolean"
3169
+ }
3170
+ ],
3171
+ "behaviors": [
3172
+ {
3173
+ "trigger": "hover",
3174
+ "action": "Show tooltip after delay",
3175
+ "requirements": []
3176
+ }
3177
+ ]
3178
+ },
3179
+ "accessibility_spec": {
3180
+ "aria_attributes": {
3181
+ "role": "tooltip"
3182
+ },
3183
+ "keyboard_support": [
3184
+ {
3185
+ "key": "Tab",
3186
+ "action": "Focus trigger element"
3187
+ }
3188
+ ]
3189
+ },
3190
+ "design_tokens": [
3191
+ {
3192
+ "token_category": "color",
3193
+ "required_tokens": ["background", "foreground"],
3194
+ "css_var_mapping": {
3195
+ "background": "var(--background)",
3196
+ "color": "var(--foreground)"
3197
+ }
3198
+ }
3199
+ ],
3200
+ "responsive_behavior": {
3201
+ "breakpoint_behaviors": {
3202
+ "sm": "Auto position",
3203
+ "md": "Auto position",
3204
+ "lg": "Auto position"
3205
+ },
3206
+ "mobile_first": true,
3207
+ "touch_targets": {
3208
+ "min_size": "44px"
3209
+ }
3210
+ },
3211
+ "validation_rules": [],
3212
+ "conflict_resolution": [],
3213
+ "confidence_threshold": 0.75,
3214
+ "usage_frequency": 0,
3215
+ "examples": [
3216
+ {
3217
+ "natural_language": "Add a tooltip explaining what this button does",
3218
+ "extracted_intent": "tooltip",
3219
+ "generated_code_sample": "<Tooltip><TooltipTrigger><Button>?</Button></TooltipTrigger><TooltipContent>Help text</TooltipContent></Tooltip>"
3220
+ }
3221
+ ]
3222
+ },
3223
+ "popover": {
3224
+ "canonical_name": "popover",
3225
+ "category": "overlay",
3226
+ "intent_phrases": [
3227
+ {
3228
+ "phrase": "popover",
3229
+ "aliases": ["pop up", "floating panel", "overlay panel"],
3230
+ "context_keywords": ["popover", "popup", "floating", "panel", "overlay"],
3231
+ "confidence_boost": 0.8
3232
+ }
3233
+ ],
3234
+ "component_pattern": {
3235
+ "shadcn_components": [
3236
+ {
3237
+ "name": "Popover",
3238
+ "import_path": "@/components/ui/popover",
3239
+ "exports": ["Popover", "PopoverContent", "PopoverTrigger"],
3240
+ "peer_components": ["Button"]
3241
+ }
3242
+ ],
3243
+ "template_code": "<Popover>\n <PopoverTrigger asChild>\n <Button variant=\"outline\">{{trigger_label}}</Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium leading-none\">{{title}}</h4>\n <p className=\"text-sm text-muted-foreground\">\n {{description}}\n </p>\n {{content}}\n </div>\n </PopoverContent>\n</Popover>",
3244
+ "required_props": [
3245
+ {
3246
+ "name": "content",
3247
+ "type": "React.ReactNode",
3248
+ "description": "Popover content"
3249
+ }
3250
+ ],
3251
+ "optional_props": [
3252
+ {
3253
+ "name": "trigger_label",
3254
+ "type": "string",
3255
+ "default_value": "Open",
3256
+ "description": "Trigger button label"
3257
+ },
3258
+ {
3259
+ "name": "title",
3260
+ "type": "string",
3261
+ "description": "Popover title"
3262
+ },
3263
+ {
3264
+ "name": "description",
3265
+ "type": "string",
3266
+ "description": "Popover description"
3267
+ }
3268
+ ],
3269
+ "default_variants": {}
3270
+ },
3271
+ "interaction_spec": {
3272
+ "events": ["onOpenChange"],
3273
+ "states": [
3274
+ {
3275
+ "name": "open",
3276
+ "initial_value": false,
3277
+ "type": "boolean"
3278
+ }
3279
+ ],
3280
+ "behaviors": [
3281
+ {
3282
+ "trigger": "onOpenChange",
3283
+ "action": "Toggle popover visibility",
3284
+ "requirements": []
3285
+ }
3286
+ ]
3287
+ },
3288
+ "accessibility_spec": {
3289
+ "aria_attributes": {
3290
+ "role": "dialog",
3291
+ "aria-expanded": "true when open"
3292
+ },
3293
+ "keyboard_support": [
3294
+ {
3295
+ "key": "Enter",
3296
+ "action": "Open popover"
3297
+ },
3298
+ {
3299
+ "key": "Escape",
3300
+ "action": "Close popover"
3301
+ }
3302
+ ]
3303
+ },
3304
+ "design_tokens": [
3305
+ {
3306
+ "token_category": "color",
3307
+ "required_tokens": ["background", "foreground"],
3308
+ "css_var_mapping": {
3309
+ "background": "var(--background)",
3310
+ "color": "var(--foreground)"
3311
+ }
3312
+ }
3313
+ ],
3314
+ "responsive_behavior": {
3315
+ "breakpoint_behaviors": {
3316
+ "sm": "Full width on mobile",
3317
+ "md": "Auto width",
3318
+ "lg": "Auto width"
3319
+ },
3320
+ "mobile_first": true,
3321
+ "touch_targets": {
3322
+ "min_size": "44px"
3323
+ }
3324
+ },
3325
+ "validation_rules": [],
3326
+ "conflict_resolution": [],
3327
+ "confidence_threshold": 0.75,
3328
+ "usage_frequency": 0,
3329
+ "examples": [
3330
+ {
3331
+ "natural_language": "Add a popover with additional information",
3332
+ "extracted_intent": "popover",
3333
+ "generated_code_sample": "<Popover><PopoverTrigger><Button>Info</Button></PopoverTrigger><PopoverContent>Content</PopoverContent></Popover>"
3334
+ }
3335
+ ]
3336
+ },
3337
+ "badge": {
3338
+ "canonical_name": "badge",
3339
+ "category": "data-display",
3340
+ "intent_phrases": [
3341
+ {
3342
+ "phrase": "badge",
3343
+ "aliases": ["label", "tag", "chip", "status indicator"],
3344
+ "context_keywords": ["badge", "label", "tag", "chip", "status", "indicator"],
3345
+ "confidence_boost": 0.8
3346
+ }
3347
+ ],
3348
+ "component_pattern": {
3349
+ "shadcn_components": [
3350
+ {
3351
+ "name": "Badge",
3352
+ "import_path": "@/components/ui/badge",
3353
+ "exports": ["Badge"],
3354
+ "peer_components": []
3355
+ }
3356
+ ],
3357
+ "template_code": "<Badge variant=\"{{variant}}\" className=\"{{className}}\">\n {{content}}\n</Badge>",
3358
+ "required_props": [
3359
+ {
3360
+ "name": "content",
3361
+ "type": "string",
3362
+ "description": "Badge content"
3363
+ }
3364
+ ],
3365
+ "optional_props": [
3366
+ {
3367
+ "name": "variant",
3368
+ "type": "'default' | 'secondary' | 'destructive' | 'outline'",
3369
+ "default_value": "default",
3370
+ "description": "Badge variant"
3371
+ },
3372
+ {
3373
+ "name": "className",
3374
+ "type": "string",
3375
+ "description": "Additional CSS classes"
3376
+ }
3377
+ ],
3378
+ "default_variants": {
3379
+ "variant": "default"
3380
+ }
3381
+ },
3382
+ "interaction_spec": {
3383
+ "events": [],
3384
+ "states": [],
3385
+ "behaviors": []
3386
+ },
3387
+ "accessibility_spec": {
3388
+ "aria_attributes": {},
3389
+ "keyboard_support": []
3390
+ },
3391
+ "design_tokens": [
3392
+ {
3393
+ "token_category": "color",
3394
+ "required_tokens": ["primary", "secondary", "destructive"],
3395
+ "css_var_mapping": {
3396
+ "default-color": "var(--primary)",
3397
+ "secondary-color": "var(--secondary)",
3398
+ "destructive-color": "var(--destructive)"
3399
+ }
3400
+ }
3401
+ ],
3402
+ "responsive_behavior": {
3403
+ "breakpoint_behaviors": {
3404
+ "sm": "Auto size",
3405
+ "md": "Auto size",
3406
+ "lg": "Auto size"
3407
+ },
3408
+ "mobile_first": true,
3409
+ "touch_targets": {
3410
+ "min_size": "44px"
3411
+ }
3412
+ },
3413
+ "validation_rules": [],
3414
+ "conflict_resolution": [],
3415
+ "confidence_threshold": 0.7,
3416
+ "usage_frequency": 0,
3417
+ "examples": [
3418
+ {
3419
+ "natural_language": "Add a badge showing user status",
3420
+ "extracted_intent": "badge",
3421
+ "generated_code_sample": "<Badge variant=\"default\">Active</Badge>"
3422
+ }
3423
+ ]
3424
+ },
3425
+ "avatar": {
3426
+ "canonical_name": "avatar",
3427
+ "category": "data-display",
3428
+ "intent_phrases": [
3429
+ {
3430
+ "phrase": "avatar",
3431
+ "aliases": ["profile picture", "user image", "profile photo"],
3432
+ "context_keywords": ["avatar", "profile", "picture", "image", "photo", "user"],
3433
+ "confidence_boost": 0.9
3434
+ }
3435
+ ],
3436
+ "component_pattern": {
3437
+ "shadcn_components": [
3438
+ {
3439
+ "name": "Avatar",
3440
+ "import_path": "@/components/ui/avatar",
3441
+ "exports": ["Avatar", "AvatarFallback", "AvatarImage"],
3442
+ "peer_components": []
3443
+ }
3444
+ ],
3445
+ "template_code": "<Avatar className=\"{{className}}\">\n <AvatarImage src=\"{{src}}\" alt=\"{{alt}}\" />\n <AvatarFallback>{{fallback}}</AvatarFallback>\n</Avatar>",
3446
+ "required_props": [
3447
+ {
3448
+ "name": "fallback",
3449
+ "type": "string",
3450
+ "description": "Fallback text when image fails to load"
3451
+ }
3452
+ ],
3453
+ "optional_props": [
3454
+ {
3455
+ "name": "src",
3456
+ "type": "string",
3457
+ "description": "Image source URL"
3458
+ },
3459
+ {
3460
+ "name": "alt",
3461
+ "type": "string",
3462
+ "description": "Image alt text"
3463
+ },
3464
+ {
3465
+ "name": "className",
3466
+ "type": "string",
3467
+ "description": "Additional CSS classes"
3468
+ }
3469
+ ],
3470
+ "default_variants": {}
3471
+ },
3472
+ "interaction_spec": {
3473
+ "events": ["onError"],
3474
+ "states": [],
3475
+ "behaviors": [
3476
+ {
3477
+ "trigger": "onError",
3478
+ "action": "Show fallback text",
3479
+ "requirements": []
3480
+ }
3481
+ ]
3482
+ },
3483
+ "accessibility_spec": {
3484
+ "aria_attributes": {
3485
+ "role": "img",
3486
+ "aria-label": "User avatar"
3487
+ },
3488
+ "keyboard_support": []
3489
+ },
3490
+ "design_tokens": [
3491
+ {
3492
+ "token_category": "color",
3493
+ "required_tokens": ["muted"],
3494
+ "css_var_mapping": {
3495
+ "fallback-bg": "var(--muted)"
3496
+ }
3497
+ }
3498
+ ],
3499
+ "responsive_behavior": {
3500
+ "breakpoint_behaviors": {
3501
+ "sm": "Small size",
3502
+ "md": "Medium size",
3503
+ "lg": "Large size"
3504
+ },
3505
+ "mobile_first": true,
3506
+ "touch_targets": {
3507
+ "min_size": "44px"
3508
+ }
3509
+ },
3510
+ "validation_rules": [],
3511
+ "conflict_resolution": [],
3512
+ "confidence_threshold": 0.8,
3513
+ "usage_frequency": 0,
3514
+ "examples": [
3515
+ {
3516
+ "natural_language": "Add an avatar for the user profile",
3517
+ "extracted_intent": "avatar",
3518
+ "generated_code_sample": "<Avatar><AvatarImage src=\"/user.jpg\" /><AvatarFallback>JD</AvatarFallback></Avatar>"
3519
+ }
3520
+ ]
3521
+ },
3522
+ "stat-card": {
3523
+ "canonical_name": "stat-card",
3524
+ "category": "data-display",
3525
+ "intent_phrases": [
3526
+ {
3527
+ "phrase": "stat card",
3528
+ "aliases": ["statistics card", "metric card", "kpi card", "dashboard card"],
3529
+ "context_keywords": ["stat", "statistics", "metric", "kpi", "dashboard", "card"],
3530
+ "confidence_boost": 0.85
3531
+ }
3532
+ ],
3533
+ "component_pattern": {
3534
+ "shadcn_components": [
3535
+ {
3536
+ "name": "Card",
3537
+ "import_path": "@/components/ui/card",
3538
+ "exports": ["Card", "CardContent", "CardHeader", "CardTitle"],
3539
+ "peer_components": []
3540
+ }
3541
+ ],
3542
+ "template_code": "<Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">{{title}}</CardTitle>\n {{icon}}\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{{value}}</div>\n <p className=\"text-xs text-muted-foreground\">\n {{description}}\n </p>\n </CardContent>\n</Card>",
3543
+ "required_props": [
3544
+ {
3545
+ "name": "title",
3546
+ "type": "string",
3547
+ "description": "Card title"
3548
+ },
3549
+ {
3550
+ "name": "value",
3551
+ "type": "string | number",
3552
+ "description": "Statistic value"
3553
+ }
3554
+ ],
3555
+ "optional_props": [
3556
+ {
3557
+ "name": "description",
3558
+ "type": "string",
3559
+ "description": "Description text"
3560
+ },
3561
+ {
3562
+ "name": "icon",
3563
+ "type": "React.ReactNode",
3564
+ "description": "Icon element"
3565
+ }
3566
+ ],
3567
+ "default_variants": {}
3568
+ },
3569
+ "interaction_spec": {
3570
+ "events": [],
3571
+ "states": [],
3572
+ "behaviors": []
3573
+ },
3574
+ "accessibility_spec": {
3575
+ "aria_attributes": {
3576
+ "role": "region",
3577
+ "aria-label": "Statistics card"
3578
+ },
3579
+ "keyboard_support": []
3580
+ },
3581
+ "design_tokens": [
3582
+ {
3583
+ "token_category": "color",
3584
+ "required_tokens": ["card", "card-foreground"],
3585
+ "css_var_mapping": {
3586
+ "background": "var(--card)",
3587
+ "color": "var(--card-foreground)"
3588
+ }
3589
+ }
3590
+ ],
3591
+ "responsive_behavior": {
3592
+ "breakpoint_behaviors": {
3593
+ "sm": "Full width",
3594
+ "md": "Grid layout",
3595
+ "lg": "Grid layout"
3596
+ },
3597
+ "mobile_first": true,
3598
+ "touch_targets": {
3599
+ "min_size": "44px"
3600
+ }
3601
+ },
3602
+ "validation_rules": [],
3603
+ "conflict_resolution": [],
3604
+ "confidence_threshold": 0.75,
3605
+ "usage_frequency": 0,
3606
+ "examples": [
3607
+ {
3608
+ "natural_language": "Add a card showing total users count",
3609
+ "extracted_intent": "stat-card",
3610
+ "generated_code_sample": "<Card><CardHeader><CardTitle>Total Users</CardTitle></CardHeader><CardContent><div className=\"text-2xl font-bold\">1,234</div></CardContent></Card>"
3611
+ }
3612
+ ]
3613
+ }
3614
+ },
3615
+ "synonyms": {
3616
+ "cta": "primary-button",
3617
+ "submit": "primary-button",
3618
+ "save": "primary-button",
3619
+ "signin": "auth-form",
3620
+ "login": "auth-form",
3621
+ "signup": "auth-form",
3622
+ "register": "auth-form",
3623
+ "cancel": "secondary-button",
3624
+ "back": "secondary-button",
3625
+ "close": "secondary-button",
3626
+ "confirm": "confirmation-dialog",
3627
+ "are you sure": "confirmation-dialog",
3628
+ "table": "data-table",
3629
+ "grid": "data-table",
3630
+ "card": "card-layout",
3631
+ "panel": "card-layout",
3632
+ "nav": "navigation-menu",
3633
+ "navbar": "navigation-menu",
3634
+ "menu": "navigation-menu",
3635
+ "error": "alert-message",
3636
+ "warning": "alert-message",
3637
+ "success": "alert-message",
3638
+ "loader": "loading-spinner",
3639
+ "spinner": "loading-spinner",
3640
+ "dropdown": "select-dropdown",
3641
+ "select": "select-dropdown",
3642
+ "checkboxes": "checkbox-group",
3643
+ "multiple choice": "checkbox-group",
3644
+ "radio buttons": "radio-group",
3645
+ "single choice": "radio-group",
3646
+ "textarea": "textarea-field",
3647
+ "multiline": "textarea-field",
3648
+ "file input": "file-upload",
3649
+ "upload": "file-upload",
3650
+ "date input": "date-picker",
3651
+ "calendar": "date-picker",
3652
+ "time input": "time-picker",
3653
+ "clock": "time-picker",
3654
+ "breadcrumbs": "breadcrumb-nav",
3655
+ "path": "breadcrumb-nav",
3656
+ "tabs": "tabs-navigation",
3657
+ "tabbed": "tabs-navigation",
3658
+ "sidebar": "sidebar-menu",
3659
+ "side menu": "sidebar-menu",
3660
+ "pagination": "pagination-control",
3661
+ "pager": "pagination-control",
3662
+ "toast": "toast-notification",
3663
+ "notification": "toast-notification",
3664
+ "snackbar": "toast-notification",
3665
+ "progress": "progress-bar",
3666
+ "loading bar": "progress-bar",
3667
+ "skeleton": "skeleton-loader",
3668
+ "placeholder": "skeleton-loader",
3669
+ "shimmer": "skeleton-loader",
3670
+ "error alert": "error-message",
3671
+ "failure": "error-message",
3672
+ "modal": "modal-dialog",
3673
+ "dialog": "modal-dialog",
3674
+ "popup": "modal-dialog",
3675
+ "context menu": "dropdown-menu",
3676
+ "action menu": "dropdown-menu",
3677
+ "tool tip": "tooltip",
3678
+ "hint": "tooltip",
3679
+ "help": "tooltip",
3680
+ "pop up": "popover",
3681
+ "floating panel": "popover",
3682
+ "label": "badge",
3683
+ "tag": "badge",
3684
+ "chip": "badge",
3685
+ "status": "badge",
3686
+ "profile picture": "avatar",
3687
+ "user image": "avatar",
3688
+ "photo": "avatar",
3689
+ "statistics": "stat-card",
3690
+ "metric": "stat-card",
3691
+ "kpi": "stat-card",
3692
+ "dashboard": "stat-card"
3693
+ },
3694
+ "usage_analytics": {
3695
+ "total_validations": 0,
3696
+ "intent_usage_counts": {},
3697
+ "validation_failures": [],
3698
+ "average_confidence": 0
3699
+ }
3700
+ }