mta-design-system 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1351 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // mcp/src/index.ts
5
+ var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
6
+
7
+ // mcp/src/server.ts
8
+ var import_server = require("@modelcontextprotocol/sdk/server/index.js");
9
+ var import_types = require("@modelcontextprotocol/sdk/types.js");
10
+
11
+ // shared/registry.ts
12
+ var componentRegistry = [
13
+ // ==================== BASE UI COMPONENTS ====================
14
+ {
15
+ name: "Button",
16
+ category: "ui",
17
+ description: "A versatile button component with multiple variants and sizes.",
18
+ sourcePath: "src/components/ui/button.tsx",
19
+ props: [
20
+ { name: "variant", type: "'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'", required: false, default: "'default'", description: "Button visual style" },
21
+ { name: "size", type: "'default' | 'sm' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg'", required: false, default: "'default'", description: "Button size" },
22
+ { name: "asChild", type: "boolean", required: false, default: "false", description: "Render as child element" },
23
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" },
24
+ { name: "disabled", type: "boolean", required: false, description: "Disable the button" }
25
+ ],
26
+ examples: [
27
+ {
28
+ title: "Basic Button",
29
+ code: `import { Button } from 'mta-design-system';
30
+
31
+ <Button>Click me</Button>`
32
+ },
33
+ {
34
+ title: "Button Variants",
35
+ code: `<Button variant="default">Default</Button>
36
+ <Button variant="destructive">Destructive</Button>
37
+ <Button variant="outline">Outline</Button>
38
+ <Button variant="secondary">Secondary</Button>
39
+ <Button variant="ghost">Ghost</Button>
40
+ <Button variant="link">Link</Button>`
41
+ },
42
+ {
43
+ title: "Button Sizes",
44
+ code: `<Button size="sm">Small</Button>
45
+ <Button size="default">Default</Button>
46
+ <Button size="lg">Large</Button>`
47
+ }
48
+ ],
49
+ dependencies: ["@radix-ui/react-slot", "class-variance-authority"],
50
+ themable: false
51
+ },
52
+ {
53
+ name: "Alert",
54
+ category: "ui",
55
+ description: "Displays a callout for user attention.",
56
+ sourcePath: "src/components/ui/alert.tsx",
57
+ props: [
58
+ { name: "variant", type: "'default' | 'destructive'", required: false, default: "'default'", description: "Alert visual style" },
59
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
60
+ ],
61
+ examples: [
62
+ {
63
+ title: "Basic Alert",
64
+ code: `import { Alert, AlertTitle, AlertDescription } from 'mta-design-system';
65
+
66
+ <Alert>
67
+ <AlertTitle>Heads up!</AlertTitle>
68
+ <AlertDescription>You can add components to your app using the cli.</AlertDescription>
69
+ </Alert>`
70
+ },
71
+ {
72
+ title: "Destructive Alert",
73
+ code: `<Alert variant="destructive">
74
+ <AlertTitle>Error</AlertTitle>
75
+ <AlertDescription>Your session has expired. Please log in again.</AlertDescription>
76
+ </Alert>`
77
+ }
78
+ ],
79
+ dependencies: ["class-variance-authority"],
80
+ themable: false
81
+ },
82
+ {
83
+ name: "Card",
84
+ category: "ui",
85
+ description: "Displays a card with header, content, and footer sections.",
86
+ sourcePath: "src/components/ui/card.tsx",
87
+ props: [
88
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
89
+ ],
90
+ examples: [
91
+ {
92
+ title: "Basic Card",
93
+ code: `import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from 'mta-design-system';
94
+
95
+ <Card>
96
+ <CardHeader>
97
+ <CardTitle>Card Title</CardTitle>
98
+ <CardDescription>Card Description</CardDescription>
99
+ </CardHeader>
100
+ <CardContent>
101
+ <p>Card Content</p>
102
+ </CardContent>
103
+ <CardFooter>
104
+ <p>Card Footer</p>
105
+ </CardFooter>
106
+ </Card>`
107
+ }
108
+ ],
109
+ dependencies: [],
110
+ themable: false
111
+ },
112
+ {
113
+ name: "Input",
114
+ category: "ui",
115
+ description: "A text input component for forms.",
116
+ sourcePath: "src/components/ui/input.tsx",
117
+ props: [
118
+ { name: "type", type: "string", required: false, default: "'text'", description: "Input type" },
119
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
120
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" },
121
+ { name: "disabled", type: "boolean", required: false, description: "Disable the input" }
122
+ ],
123
+ examples: [
124
+ {
125
+ title: "Basic Input",
126
+ code: `import { Input } from 'mta-design-system';
127
+
128
+ <Input placeholder="Enter your name" />`
129
+ }
130
+ ],
131
+ dependencies: [],
132
+ themable: false
133
+ },
134
+ {
135
+ name: "Label",
136
+ category: "ui",
137
+ description: "A label component for form fields.",
138
+ sourcePath: "src/components/ui/label.tsx",
139
+ props: [
140
+ { name: "htmlFor", type: "string", required: false, description: "ID of the associated form element" },
141
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
142
+ ],
143
+ examples: [
144
+ {
145
+ title: "Basic Label",
146
+ code: `import { Label } from 'mta-design-system';
147
+
148
+ <Label htmlFor="email">Email</Label>`
149
+ }
150
+ ],
151
+ dependencies: ["@radix-ui/react-label"],
152
+ themable: false
153
+ },
154
+ {
155
+ name: "Dialog",
156
+ category: "ui",
157
+ description: "A modal dialog component.",
158
+ sourcePath: "src/components/ui/dialog.tsx",
159
+ props: [
160
+ { name: "open", type: "boolean", required: false, description: "Controlled open state" },
161
+ { name: "onOpenChange", type: "(open: boolean) => void", required: false, description: "Callback when open state changes" }
162
+ ],
163
+ examples: [
164
+ {
165
+ title: "Basic Dialog",
166
+ code: `import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from 'mta-design-system';
167
+
168
+ <Dialog>
169
+ <DialogTrigger>Open Dialog</DialogTrigger>
170
+ <DialogContent>
171
+ <DialogHeader>
172
+ <DialogTitle>Are you sure?</DialogTitle>
173
+ <DialogDescription>This action cannot be undone.</DialogDescription>
174
+ </DialogHeader>
175
+ <DialogFooter>
176
+ <Button>Confirm</Button>
177
+ </DialogFooter>
178
+ </DialogContent>
179
+ </Dialog>`
180
+ }
181
+ ],
182
+ dependencies: ["@radix-ui/react-dialog"],
183
+ themable: false
184
+ },
185
+ {
186
+ name: "Select",
187
+ category: "ui",
188
+ description: "A dropdown select component.",
189
+ sourcePath: "src/components/ui/select.tsx",
190
+ props: [
191
+ { name: "value", type: "string", required: false, description: "Selected value" },
192
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Callback when value changes" },
193
+ { name: "disabled", type: "boolean", required: false, description: "Disable the select" }
194
+ ],
195
+ examples: [
196
+ {
197
+ title: "Basic Select",
198
+ code: `import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from 'mta-design-system';
199
+
200
+ <Select>
201
+ <SelectTrigger>
202
+ <SelectValue placeholder="Select an option" />
203
+ </SelectTrigger>
204
+ <SelectContent>
205
+ <SelectItem value="option1">Option 1</SelectItem>
206
+ <SelectItem value="option2">Option 2</SelectItem>
207
+ </SelectContent>
208
+ </Select>`
209
+ }
210
+ ],
211
+ dependencies: ["@radix-ui/react-select"],
212
+ themable: false
213
+ },
214
+ {
215
+ name: "Switch",
216
+ category: "ui",
217
+ description: "A toggle switch component.",
218
+ sourcePath: "src/components/ui/switch.tsx",
219
+ props: [
220
+ { name: "checked", type: "boolean", required: false, description: "Controlled checked state" },
221
+ { name: "onCheckedChange", type: "(checked: boolean) => void", required: false, description: "Callback when checked state changes" },
222
+ { name: "disabled", type: "boolean", required: false, description: "Disable the switch" }
223
+ ],
224
+ examples: [
225
+ {
226
+ title: "Basic Switch",
227
+ code: `import { Switch } from 'mta-design-system';
228
+
229
+ <Switch />`
230
+ }
231
+ ],
232
+ dependencies: ["@radix-ui/react-switch"],
233
+ themable: false
234
+ },
235
+ {
236
+ name: "Tooltip",
237
+ category: "ui",
238
+ description: "A tooltip component for displaying additional information.",
239
+ sourcePath: "src/components/ui/tooltip.tsx",
240
+ props: [
241
+ { name: "content", type: "ReactNode", required: false, description: "Tooltip content" },
242
+ { name: "delayDuration", type: "number", required: false, default: "400", description: "Delay before showing tooltip" }
243
+ ],
244
+ examples: [
245
+ {
246
+ title: "Basic Tooltip",
247
+ code: `import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from 'mta-design-system';
248
+
249
+ <TooltipProvider>
250
+ <Tooltip>
251
+ <TooltipTrigger>Hover me</TooltipTrigger>
252
+ <TooltipContent>Tooltip content</TooltipContent>
253
+ </Tooltip>
254
+ </TooltipProvider>`
255
+ }
256
+ ],
257
+ dependencies: ["@radix-ui/react-tooltip"],
258
+ themable: false
259
+ },
260
+ {
261
+ name: "Table",
262
+ category: "ui",
263
+ description: "A table component for displaying data.",
264
+ sourcePath: "src/components/ui/table.tsx",
265
+ props: [
266
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
267
+ ],
268
+ examples: [
269
+ {
270
+ title: "Basic Table",
271
+ code: `import { Table, TableHeader, TableHead, TableBody, TableRow, TableCell } from 'mta-design-system';
272
+
273
+ <Table>
274
+ <TableHeader>
275
+ <TableRow>
276
+ <TableHead>Name</TableHead>
277
+ <TableHead>Email</TableHead>
278
+ </TableRow>
279
+ </TableHeader>
280
+ <TableBody>
281
+ <TableRow>
282
+ <TableCell>John Doe</TableCell>
283
+ <TableCell>john@example.com</TableCell>
284
+ </TableRow>
285
+ </TableBody>
286
+ </Table>`
287
+ }
288
+ ],
289
+ dependencies: [],
290
+ themable: false
291
+ },
292
+ {
293
+ name: "Progress",
294
+ category: "ui",
295
+ description: "A progress bar component.",
296
+ sourcePath: "src/components/ui/progress.tsx",
297
+ props: [
298
+ { name: "value", type: "number", required: false, description: "Progress value (0-100)" },
299
+ { name: "max", type: "number", required: false, default: "100", description: "Maximum value" }
300
+ ],
301
+ examples: [
302
+ {
303
+ title: "Basic Progress",
304
+ code: `import { Progress } from 'mta-design-system';
305
+
306
+ <Progress value={60} />`
307
+ }
308
+ ],
309
+ dependencies: ["@radix-ui/react-progress"],
310
+ themable: false
311
+ },
312
+ {
313
+ name: "Spinner",
314
+ category: "ui",
315
+ description: "A loading spinner component.",
316
+ sourcePath: "src/components/ui/spinner.tsx",
317
+ props: [
318
+ { name: "size", type: "'sm' | 'default' | 'lg'", required: false, default: "'default'", description: "Spinner size" },
319
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
320
+ ],
321
+ examples: [
322
+ {
323
+ title: "Basic Spinner",
324
+ code: `import { Spinner } from 'mta-design-system';
325
+
326
+ <Spinner />`
327
+ }
328
+ ],
329
+ dependencies: [],
330
+ themable: false
331
+ },
332
+ {
333
+ name: "Calendar",
334
+ category: "ui",
335
+ description: "A calendar component for date selection.",
336
+ sourcePath: "src/components/ui/calendar.tsx",
337
+ props: [
338
+ { name: "selected", type: "Date", required: false, description: "Selected date" },
339
+ { name: "onSelect", type: "(date: Date | undefined) => void", required: false, description: "Callback when date is selected" },
340
+ { name: "mode", type: "'single' | 'multiple' | 'range'", required: false, default: "'single'", description: "Selection mode" }
341
+ ],
342
+ examples: [
343
+ {
344
+ title: "Basic Calendar",
345
+ code: `import { Calendar } from 'mta-design-system';
346
+ import 'mta-design-system/styles.css';
347
+
348
+ <Calendar />`
349
+ }
350
+ ],
351
+ dependencies: ["react-day-picker", "date-fns"],
352
+ themable: false
353
+ },
354
+ {
355
+ name: "Popover",
356
+ category: "ui",
357
+ description: "A popover component for displaying floating content.",
358
+ sourcePath: "src/components/ui/popover.tsx",
359
+ props: [
360
+ { name: "open", type: "boolean", required: false, description: "Controlled open state" },
361
+ { name: "onOpenChange", type: "(open: boolean) => void", required: false, description: "Callback when open state changes" }
362
+ ],
363
+ examples: [
364
+ {
365
+ title: "Basic Popover",
366
+ code: `import { Popover, PopoverTrigger, PopoverContent } from 'mta-design-system';
367
+
368
+ <Popover>
369
+ <PopoverTrigger>Open</PopoverTrigger>
370
+ <PopoverContent>Popover content</PopoverContent>
371
+ </Popover>`
372
+ }
373
+ ],
374
+ dependencies: ["@radix-ui/react-popover"],
375
+ themable: false
376
+ },
377
+ {
378
+ name: "Command",
379
+ category: "ui",
380
+ description: "A command menu component for search and actions.",
381
+ sourcePath: "src/components/ui/command.tsx",
382
+ props: [
383
+ { name: "value", type: "string", required: false, description: "Selected value" },
384
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Callback when value changes" },
385
+ { name: "placeholder", type: "string", required: false, description: "Search placeholder" }
386
+ ],
387
+ examples: [
388
+ {
389
+ title: "Basic Command",
390
+ code: `import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from 'mta-design-system';
391
+
392
+ <Command>
393
+ <CommandInput placeholder="Search..." />
394
+ <CommandList>
395
+ <CommandEmpty>No results found.</CommandEmpty>
396
+ <CommandGroup heading="Suggestions">
397
+ <CommandItem>Option 1</CommandItem>
398
+ <CommandItem>Option 2</CommandItem>
399
+ </CommandGroup>
400
+ </CommandList>
401
+ </Command>`
402
+ }
403
+ ],
404
+ dependencies: ["cmdk"],
405
+ themable: false
406
+ },
407
+ // ==================== CLAIMMIND THEMED COMPONENTS ====================
408
+ {
409
+ name: "ClaimMindButton",
410
+ category: "claimmind",
411
+ description: "A themed button component with brand colors (Default, Owlexa, BPJS themes).",
412
+ sourcePath: "src/stories/claimmind/Button.tsx",
413
+ props: [
414
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
415
+ { name: "variant", type: "'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'", required: false, default: "'default'", description: "Button visual style" },
416
+ { name: "size", type: "'default' | 'sm' | 'lg' | 'icon'", required: false, default: "'default'", description: "Button size" },
417
+ { name: "label", type: "string", required: false, description: "Button label text" },
418
+ { name: "loading", type: "boolean", required: false, default: "false", description: "Show loading spinner" },
419
+ { name: "leftIconName", type: "LucideIconName", required: false, description: "Icon name for left side" },
420
+ { name: "rightIconName", type: "LucideIconName", required: false, description: "Icon name for right side" }
421
+ ],
422
+ examples: [
423
+ {
424
+ title: "Basic ClaimMindButton",
425
+ code: `import { ClaimMindButton } from 'mta-design-system';
426
+ import 'mta-design-system/styles.css';
427
+
428
+ <ClaimMindButton theme="Default">Click me</ClaimMindButton>`
429
+ },
430
+ {
431
+ title: "Themed Buttons",
432
+ code: `<ClaimMindButton theme="Default">ClaimMind</ClaimMindButton>
433
+ <ClaimMindButton theme="Owlexa">Owlexa</ClaimMindButton>
434
+ <ClaimMindButton theme="BPJS">BPJS</ClaimMindButton>`
435
+ },
436
+ {
437
+ title: "Loading State",
438
+ code: `<ClaimMindButton loading>Processing...</ClaimMindButton>`
439
+ },
440
+ {
441
+ title: "With Icons",
442
+ code: `import { ClaimMindButton } from 'mta-design-system';
443
+
444
+ <ClaimMindButton leftIconName="Mail">Send Email</ClaimMindButton>
445
+ <ClaimMindButton rightIconName="ChevronRight">Continue</ClaimMindButton>`
446
+ }
447
+ ],
448
+ dependencies: ["lucide-react"],
449
+ themable: true
450
+ },
451
+ {
452
+ name: "ClaimMindInput",
453
+ category: "claimmind",
454
+ description: "A themed input component with brand colors.",
455
+ sourcePath: "src/stories/claimmind/Input.tsx",
456
+ props: [
457
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
458
+ { name: "type", type: "string", required: false, default: "'text'", description: "Input type" },
459
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
460
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
461
+ ],
462
+ examples: [
463
+ {
464
+ title: "Basic ClaimMindInput",
465
+ code: `import { ClaimMindInput } from 'mta-design-system';
466
+ import 'mta-design-system/styles.css';
467
+
468
+ <ClaimMindInput theme="Default" placeholder="Enter text..." />`
469
+ }
470
+ ],
471
+ dependencies: [],
472
+ themable: true
473
+ },
474
+ {
475
+ name: "ClaimMindCard",
476
+ category: "claimmind",
477
+ description: "A themed card component with optional top border accent.",
478
+ sourcePath: "src/stories/claimmind/Card.tsx",
479
+ props: [
480
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
481
+ { name: "showTopBorder", type: "boolean", required: false, default: "false", description: "Show colored top border" },
482
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
483
+ ],
484
+ examples: [
485
+ {
486
+ title: "Basic ClaimMindCard",
487
+ code: `import { ClaimMindCard, CardHeader, CardTitle, CardContent } from 'mta-design-system';
488
+ import 'mta-design-system/styles.css';
489
+
490
+ <ClaimMindCard theme="Owlexa" showTopBorder>
491
+ <CardHeader>
492
+ <CardTitle>Card Title</CardTitle>
493
+ </CardHeader>
494
+ <CardContent>
495
+ <p>Card content goes here</p>
496
+ </CardContent>
497
+ </ClaimMindCard>`
498
+ }
499
+ ],
500
+ dependencies: [],
501
+ themable: true
502
+ },
503
+ {
504
+ name: "ClaimMindAlert",
505
+ category: "claimmind",
506
+ description: "A themed alert component with brand colors.",
507
+ sourcePath: "src/stories/claimmind/Alert.tsx",
508
+ props: [
509
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
510
+ { name: "variant", type: "'info' | 'success' | 'warning' | 'error'", required: false, default: "'info'", description: "Alert type" },
511
+ { name: "title", type: "string", required: false, description: "Alert title" },
512
+ { name: "description", type: "string", required: false, description: "Alert description" }
513
+ ],
514
+ examples: [
515
+ {
516
+ title: "ClaimMindAlert Variants",
517
+ code: `import { ClaimMindAlert } from 'mta-design-system';
518
+ import 'mta-design-system/styles.css';
519
+
520
+ <ClaimMindAlert theme="Default" variant="success" title="Success!" description="Operation completed." />
521
+ <ClaimMindAlert theme="Owlexa" variant="error" title="Error" description="Something went wrong." />`
522
+ }
523
+ ],
524
+ dependencies: ["lucide-react"],
525
+ themable: true
526
+ },
527
+ {
528
+ name: "ClaimMindSpinner",
529
+ category: "claimmind",
530
+ description: "A themed loading spinner component.",
531
+ sourcePath: "src/stories/claimmind/Spinner.tsx",
532
+ props: [
533
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
534
+ { name: "size", type: "'sm' | 'default' | 'lg'", required: false, default: "'default'", description: "Spinner size" },
535
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
536
+ ],
537
+ examples: [
538
+ {
539
+ title: "ClaimMindSpinner",
540
+ code: `import { ClaimMindSpinner } from 'mta-design-system';
541
+ import 'mta-design-system/styles.css';
542
+
543
+ <ClaimMindSpinner theme="BPJS" size="lg" />`
544
+ }
545
+ ],
546
+ dependencies: [],
547
+ themable: true
548
+ },
549
+ {
550
+ name: "ClaimMindSelect",
551
+ category: "claimmind",
552
+ description: "A themed select dropdown component.",
553
+ sourcePath: "src/stories/claimmind/Select.tsx",
554
+ props: [
555
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
556
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
557
+ { name: "options", type: "Array<{ value: string; label: string }>", required: true, description: "Select options" },
558
+ { name: "value", type: "string", required: false, description: "Selected value" },
559
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Value change callback" }
560
+ ],
561
+ examples: [
562
+ {
563
+ title: "ClaimMindSelect",
564
+ code: `import { ClaimMindSelect } from 'mta-design-system';
565
+ import 'mta-design-system/styles.css';
566
+
567
+ const options = [
568
+ { value: 'option1', label: 'Option 1' },
569
+ { value: 'option2', label: 'Option 2' },
570
+ ];
571
+
572
+ <ClaimMindSelect
573
+ theme="Default"
574
+ options={options}
575
+ placeholder="Select an option"
576
+ />`
577
+ }
578
+ ],
579
+ dependencies: ["@radix-ui/react-select"],
580
+ themable: true
581
+ },
582
+ {
583
+ name: "ClaimMindCombobox",
584
+ category: "claimmind",
585
+ description: "A themed combobox component with search functionality.",
586
+ sourcePath: "src/stories/claimmind/Combobox.tsx",
587
+ props: [
588
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
589
+ { name: "placeholder", type: "string", required: false, description: "Search placeholder" },
590
+ { name: "options", type: "Array<{ value: string; label: string }>", required: true, description: "Combobox options" },
591
+ { name: "value", type: "string", required: false, description: "Selected value" },
592
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Value change callback" }
593
+ ],
594
+ examples: [
595
+ {
596
+ title: "ClaimMindCombobox",
597
+ code: `import { ClaimMindCombobox } from 'mta-design-system';
598
+ import 'mta-design-system/styles.css';
599
+
600
+ const options = [
601
+ { value: 'apple', label: 'Apple' },
602
+ { value: 'banana', label: 'Banana' },
603
+ ];
604
+
605
+ <ClaimMindCombobox
606
+ theme="Owlexa"
607
+ options={options}
608
+ placeholder="Search fruits..."
609
+ />`
610
+ }
611
+ ],
612
+ dependencies: ["cmdk", "@radix-ui/react-popover"],
613
+ themable: true
614
+ },
615
+ {
616
+ name: "ClaimMindDatePicker",
617
+ category: "claimmind",
618
+ description: "A themed date picker component.",
619
+ sourcePath: "src/stories/claimmind/DatePicker.tsx",
620
+ props: [
621
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
622
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
623
+ { name: "value", type: "Date", required: false, description: "Selected date" },
624
+ { name: "onChange", type: "(date: Date | undefined) => void", required: false, description: "Date change callback" }
625
+ ],
626
+ examples: [
627
+ {
628
+ title: "ClaimMindDatePicker",
629
+ code: `import { ClaimMindDatePicker } from 'mta-design-system';
630
+ import 'mta-design-system/styles.css';
631
+
632
+ <ClaimMindDatePicker theme="Default" placeholder="Pick a date" />`
633
+ }
634
+ ],
635
+ dependencies: ["react-day-picker", "date-fns", "@radix-ui/react-popover"],
636
+ themable: true
637
+ },
638
+ {
639
+ name: "ClaimMindTable",
640
+ category: "claimmind",
641
+ description: "A themed table component for data display.",
642
+ sourcePath: "src/stories/claimmind/Table.tsx",
643
+ props: [
644
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
645
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
646
+ ],
647
+ examples: [
648
+ {
649
+ title: "ClaimMindTable",
650
+ code: `import { ClaimMindTable, TableHeader, TableHead, TableBody, TableRow, TableCell } from 'mta-design-system';
651
+ import 'mta-design-system/styles.css';
652
+
653
+ <ClaimMindTable theme="BPJS">
654
+ <TableHeader>
655
+ <TableRow>
656
+ <TableHead>Name</TableHead>
657
+ <TableHead>Status</TableHead>
658
+ </TableRow>
659
+ </TableHeader>
660
+ <TableBody>
661
+ <TableRow>
662
+ <TableCell>John Doe</TableCell>
663
+ <TableCell>Active</TableCell>
664
+ </TableRow>
665
+ </TableBody>
666
+ </ClaimMindTable>`
667
+ }
668
+ ],
669
+ dependencies: [],
670
+ themable: true
671
+ },
672
+ // ==================== MOLECULES ====================
673
+ {
674
+ name: "Chat",
675
+ category: "molecules",
676
+ description: "A floating chat widget component with theme support.",
677
+ sourcePath: "src/stories/claimmind/molecules/Chat.tsx",
678
+ props: [
679
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
680
+ { name: "variant", type: "'float' | 'bottom-side'", required: false, default: "'float'", description: "Chat widget position" },
681
+ { name: "title", type: "string", required: false, default: "'Chat Support'", description: "Chat window title" },
682
+ { name: "messages", type: "ChatMessage[]", required: false, description: "Chat messages array" },
683
+ { name: "onSendMessage", type: "(message: string) => void", required: false, description: "Send message callback" },
684
+ { name: "isOpen", type: "boolean", required: false, description: "Control open state" },
685
+ { name: "onToggle", type: "() => void", required: false, description: "Toggle callback" },
686
+ { name: "placeholder", type: "string", required: false, description: "Input placeholder" }
687
+ ],
688
+ examples: [
689
+ {
690
+ title: "Chat Widget",
691
+ code: `import { Chat } from 'mta-design-system';
692
+ import 'mta-design-system/styles.css';
693
+
694
+ const messages = [
695
+ { id: '1', text: 'Hello!', sender: 'bot' as const, timestamp: new Date() },
696
+ { id: '2', text: 'Hi there!', sender: 'user' as const, timestamp: new Date() },
697
+ ];
698
+
699
+ function App() {
700
+ const [isOpen, setIsOpen] = useState(false);
701
+
702
+ return (
703
+ <Chat
704
+ theme="Owlexa"
705
+ variant="float"
706
+ messages={messages}
707
+ isOpen={isOpen}
708
+ onToggle={() => setIsOpen(!isOpen)}
709
+ onSendMessage={(msg) => console.log(msg)}
710
+ />
711
+ );
712
+ }`
713
+ }
714
+ ],
715
+ dependencies: ["lucide-react"],
716
+ themable: true
717
+ },
718
+ {
719
+ name: "DashboardCard",
720
+ category: "molecules",
721
+ description: "A themed dashboard card for displaying metrics.",
722
+ sourcePath: "src/stories/claimmind/molecules/DashboardCard.tsx",
723
+ props: [
724
+ { name: "label", type: "string", required: true, description: 'Card label (e.g., "Total Claims")' },
725
+ { name: "value", type: "string | number", required: true, description: "Value to display" },
726
+ { name: "iconName", type: "LucideIconName", required: false, description: "Icon name from lucide-react" },
727
+ { name: "icon", type: "ReactNode", required: false, description: "Custom icon element" },
728
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
729
+ { name: "colorVariant", type: "'primary' | 'secondary' | 'tertiary' | 'success' | 'danger'", required: false, default: "'primary'", description: "Icon color variant" }
730
+ ],
731
+ examples: [
732
+ {
733
+ title: "DashboardCard",
734
+ code: `import { DashboardCard } from 'mta-design-system';
735
+ import 'mta-design-system/styles.css';
736
+
737
+ <DashboardCard
738
+ label="Total Claims"
739
+ value="1,234"
740
+ iconName="FileText"
741
+ theme="Default"
742
+ colorVariant="primary"
743
+ />`
744
+ }
745
+ ],
746
+ dependencies: ["lucide-react"],
747
+ themable: true
748
+ },
749
+ {
750
+ name: "Title",
751
+ category: "molecules",
752
+ description: "A themed title component with underline accent.",
753
+ sourcePath: "src/stories/claimmind/molecules/Title.tsx",
754
+ props: [
755
+ { name: "children", type: "ReactNode", required: true, description: "Title content" },
756
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
757
+ { name: "as", type: "'h1' | 'h2' | 'h3' | 'h4'", required: false, default: "'h2'", description: "HTML heading tag" },
758
+ { name: "underline", type: "boolean", required: false, default: "true", description: "Show underline accent" },
759
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
760
+ ],
761
+ examples: [
762
+ {
763
+ title: "Title Component",
764
+ code: `import { Title } from 'mta-design-system';
765
+ import 'mta-design-system/styles.css';
766
+
767
+ <Title theme="Owlexa" as="h1" underline>
768
+ Welcome to ClaimMind
769
+ </Title>`
770
+ }
771
+ ],
772
+ dependencies: [],
773
+ themable: true
774
+ },
775
+ {
776
+ name: "SyncProgress",
777
+ category: "molecules",
778
+ description: "A themed sync progress card showing synchronization status.",
779
+ sourcePath: "src/stories/claimmind/molecules/SyncProgress.tsx",
780
+ props: [
781
+ { name: "progress", type: "number", required: true, description: "Progress percentage (0-100)" },
782
+ { name: "status", type: "'syncing' | 'completed' | 'failed'", required: false, default: "'syncing'", description: "Sync status" },
783
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
784
+ { name: "message", type: "string", required: false, description: "Status message" },
785
+ { name: "onCancel", type: "() => void", required: false, description: "Cancel callback" }
786
+ ],
787
+ examples: [
788
+ {
789
+ title: "SyncProgress Card",
790
+ code: `import { SyncProgress } from 'mta-design-system';
791
+ import 'mta-design-system/styles.css';
792
+
793
+ <SyncProgress
794
+ progress={65}
795
+ status="syncing"
796
+ theme="BPJS"
797
+ message="Syncing data from server..."
798
+ onCancel={() => console.log('Cancelled')}
799
+ />`
800
+ }
801
+ ],
802
+ dependencies: ["lucide-react"],
803
+ themable: true
804
+ },
805
+ // ==================== PAGES ====================
806
+ {
807
+ name: "LoginPage",
808
+ category: "pages",
809
+ description: "A complete login page template with theme support.",
810
+ sourcePath: "src/stories/claimmind/pages/LoginPage.tsx",
811
+ props: [
812
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
813
+ { name: "title", type: "string", required: false, default: "'Login ke ClaimMind'", description: "Page title" },
814
+ { name: "description", type: "string", required: false, description: "Page description" }
815
+ ],
816
+ examples: [
817
+ {
818
+ title: "LoginPage",
819
+ code: `import { LoginPage } from 'mta-design-system';
820
+ import 'mta-design-system/styles.css';
821
+
822
+ // In your Next.js app
823
+ export default function Login() {
824
+ return (
825
+ <LoginPage
826
+ theme="Owlexa"
827
+ title="Welcome to Owlexa"
828
+ description="Enter your credentials to access your account."
829
+ />
830
+ );
831
+ }`
832
+ }
833
+ ],
834
+ dependencies: ["lucide-react"],
835
+ themable: true
836
+ }
837
+ ];
838
+ function getComponentByName(name) {
839
+ return componentRegistry.find(
840
+ (c) => c.name.toLowerCase() === name.toLowerCase() || c.name.toLowerCase().replace("claimmind", "") === name.toLowerCase()
841
+ );
842
+ }
843
+ function searchComponents(query) {
844
+ const lowerQuery = query.toLowerCase();
845
+ return componentRegistry.filter(
846
+ (c) => c.name.toLowerCase().includes(lowerQuery) || c.description.toLowerCase().includes(lowerQuery) || c.props.some((p) => p.name.toLowerCase().includes(lowerQuery))
847
+ );
848
+ }
849
+
850
+ // mcp/src/resources/components.ts
851
+ var componentsResource = {
852
+ uri: "mta://components",
853
+ name: "MTA Design System Components",
854
+ description: "Complete list of all components in the MTA Design System",
855
+ mimeType: "application/json",
856
+ content: JSON.stringify({
857
+ components: componentRegistry.map((c) => ({
858
+ name: c.name,
859
+ category: c.category,
860
+ description: c.description,
861
+ themable: c.themable,
862
+ dependencies: c.dependencies
863
+ })),
864
+ total: componentRegistry.length
865
+ }, null, 2)
866
+ };
867
+ function getComponentResource(name) {
868
+ const component = getComponentByName(name);
869
+ if (!component) {
870
+ return null;
871
+ }
872
+ return {
873
+ uri: `mta://components/${name.toLowerCase()}`,
874
+ name: `${component.name} Component`,
875
+ description: component.description,
876
+ mimeType: "application/json",
877
+ content: JSON.stringify(component, null, 2)
878
+ };
879
+ }
880
+
881
+ // mcp/src/resources/themes.ts
882
+ var themes = [
883
+ {
884
+ name: "Default",
885
+ primary: "#0284c7",
886
+ secondary: "#0ea5e9",
887
+ tertiary: "hsl(203, 97%, 77%)",
888
+ success: "#22c55e",
889
+ danger: "#ef4444",
890
+ background: "#f0f9ff",
891
+ cssVariables: {
892
+ "--claimmind-primary": "#0284c7",
893
+ "--claimmind-secondary": "#0ea5e9",
894
+ "--claimmind-tertiary": "hsl(203, 97%, 77%)",
895
+ "--claimmind-success": "#22c55e",
896
+ "--claimmind-danger": "#ef4444",
897
+ "--claimmind-background": "#f0f9ff"
898
+ }
899
+ },
900
+ {
901
+ name: "Owlexa",
902
+ primary: "#0ea5e9",
903
+ secondary: "#38bdf8",
904
+ tertiary: "#7dd3fc",
905
+ success: "#10b981",
906
+ danger: "#f43f5e",
907
+ background: "#f0f9ff",
908
+ cssVariables: {
909
+ "--owlexa-primary": "#0ea5e9",
910
+ "--owlexa-secondary": "#38bdf8",
911
+ "--owlexa-tertiary": "#7dd3fc",
912
+ "--owlexa-success": "#10b981",
913
+ "--owlexa-danger": "#f43f5e",
914
+ "--owlexa-background": "#f0f9ff"
915
+ }
916
+ },
917
+ {
918
+ name: "BPJS",
919
+ primary: "#059669",
920
+ secondary: "#10b981",
921
+ tertiary: "#34d399",
922
+ success: "#16a34a",
923
+ danger: "#dc2626",
924
+ background: "#ecfdf5",
925
+ cssVariables: {
926
+ "--bpjs-primary": "#059669",
927
+ "--bpjs-secondary": "#10b981",
928
+ "--bpjs-tertiary": "#34d399",
929
+ "--bpjs-success": "#16a34a",
930
+ "--bpjs-danger": "#dc2626",
931
+ "--bpjs-background": "#ecfdf5"
932
+ }
933
+ }
934
+ ];
935
+ var themesResource = {
936
+ uri: "mta://themes",
937
+ name: "MTA Design System Themes",
938
+ description: "All available brand themes in the MTA Design System",
939
+ mimeType: "application/json",
940
+ content: JSON.stringify({
941
+ themes: themes.map((t) => ({
942
+ name: t.name,
943
+ primary: t.primary,
944
+ secondary: t.secondary,
945
+ tertiary: t.tertiary,
946
+ success: t.success,
947
+ danger: t.danger,
948
+ background: t.background
949
+ })),
950
+ total: themes.length
951
+ }, null, 2)
952
+ };
953
+ function getThemeResource(name) {
954
+ const theme = themes.find((t) => t.name.toLowerCase() === name.toLowerCase());
955
+ if (!theme) {
956
+ return null;
957
+ }
958
+ return {
959
+ uri: `mta://themes/${name.toLowerCase()}`,
960
+ name: `${theme.name} Theme`,
961
+ description: `${theme.name} brand theme tokens and CSS variables`,
962
+ mimeType: "application/json",
963
+ content: JSON.stringify(theme, null, 2)
964
+ };
965
+ }
966
+ function getThemeVariablesCss(themeName) {
967
+ if (themeName) {
968
+ const theme = themes.find((t) => t.name.toLowerCase() === themeName.toLowerCase());
969
+ if (!theme) return "";
970
+ return `:root {
971
+ ${Object.entries(theme.cssVariables).map(([key, value]) => ` ${key}: ${value};`).join("\n")}
972
+ }`;
973
+ }
974
+ return themes.map((theme) => `/* ${theme.name} Theme */
975
+ :root {
976
+ ${Object.entries(theme.cssVariables).map(([key, value]) => ` ${key}: ${value};`).join("\n")}
977
+ }`).join("\n\n");
978
+ }
979
+
980
+ // mcp/src/resources/examples.ts
981
+ var examplesResource = {
982
+ uri: "mta://examples",
983
+ name: "MTA Design System Examples",
984
+ description: "Usage examples for all components",
985
+ mimeType: "application/json",
986
+ content: JSON.stringify({
987
+ examples: componentRegistry.map((c) => ({
988
+ name: c.name,
989
+ category: c.category,
990
+ examples: c.examples
991
+ })),
992
+ total: componentRegistry.length
993
+ }, null, 2)
994
+ };
995
+ function getExamplesResource(componentName) {
996
+ const component = getComponentByName(componentName);
997
+ if (!component) {
998
+ return null;
999
+ }
1000
+ return {
1001
+ uri: `mta://examples/${componentName.toLowerCase()}`,
1002
+ name: `${component.name} Examples`,
1003
+ description: `Usage examples for ${component.name}`,
1004
+ mimeType: "application/json",
1005
+ content: JSON.stringify({
1006
+ component: component.name,
1007
+ examples: component.examples
1008
+ }, null, 2)
1009
+ };
1010
+ }
1011
+ function generateCodeSnippet(componentName, options = {}) {
1012
+ const component = getComponentByName(componentName);
1013
+ if (!component) {
1014
+ return `// Component "${componentName}" not found`;
1015
+ }
1016
+ const propsArray = [];
1017
+ if (component.themable && options.theme) {
1018
+ propsArray.push(`theme="${options.theme}"`);
1019
+ }
1020
+ if (options.props) {
1021
+ for (const [key, value] of Object.entries(options.props)) {
1022
+ if (typeof value === "string") {
1023
+ propsArray.push(`${key}="${value}"`);
1024
+ } else if (typeof value === "boolean") {
1025
+ if (value) propsArray.push(key);
1026
+ } else if (typeof value === "number") {
1027
+ propsArray.push(`${key}={${value}}`);
1028
+ } else {
1029
+ propsArray.push(`${key}={${JSON.stringify(value)}}`);
1030
+ }
1031
+ }
1032
+ }
1033
+ const propsString = propsArray.length > 0 ? " " + propsArray.join(" ") : "";
1034
+ const hasChildren = !["Input", "Spinner", "Progress", "Switch"].includes(componentName);
1035
+ const importStatement = `import { ${component.name} } from 'mta-design-system';
1036
+ import 'mta-design-system/styles.css';`;
1037
+ let usage;
1038
+ if (hasChildren) {
1039
+ usage = `<${component.name}${propsString}>
1040
+ Content here
1041
+ </${component.name}>`;
1042
+ } else {
1043
+ usage = `<${component.name}${propsString} />`;
1044
+ }
1045
+ return `${importStatement}
1046
+
1047
+ // Usage
1048
+ ${usage}`;
1049
+ }
1050
+ function generateFullComponentCode(componentName, options = {}) {
1051
+ const component = getComponentByName(componentName);
1052
+ if (!component) {
1053
+ return `// Component "${componentName}" not found`;
1054
+ }
1055
+ const snippet = generateCodeSnippet(componentName, options);
1056
+ if (options.includeState) {
1057
+ const stateHooks = [];
1058
+ if (["Select", "ClaimMindSelect", "Combobox", "ClaimMindCombobox"].includes(componentName)) {
1059
+ stateHooks.push(`const [value, setValue] = useState<string>('');`);
1060
+ }
1061
+ if (["Switch", "ClaimMindSwitch"].includes(componentName)) {
1062
+ stateHooks.push(`const [checked, setChecked] = useState<boolean>(false);`);
1063
+ }
1064
+ if (["Dialog", "ClaimMindDialog"].includes(componentName)) {
1065
+ stateHooks.push(`const [open, setOpen] = useState<boolean>(false);`);
1066
+ }
1067
+ if (componentName === "Chat") {
1068
+ stateHooks.push(`const [isOpen, setIsOpen] = useState<boolean>(false);`);
1069
+ stateHooks.push(`const [messages, setMessages] = useState<ChatMessage[]>([]);`);
1070
+ }
1071
+ if (stateHooks.length > 0) {
1072
+ const hooksSection = stateHooks.join("\n ");
1073
+ return `import { useState } from 'react';
1074
+ ${snippet.replace("// Usage", `// State
1075
+ ${hooksSection}
1076
+
1077
+ // Usage`)}`;
1078
+ }
1079
+ }
1080
+ return snippet;
1081
+ }
1082
+
1083
+ // mcp/src/server.ts
1084
+ var server = new import_server.Server(
1085
+ {
1086
+ name: "mta-design-system",
1087
+ version: "0.1.0"
1088
+ },
1089
+ {
1090
+ capabilities: {
1091
+ resources: {},
1092
+ tools: {}
1093
+ }
1094
+ }
1095
+ );
1096
+ server.setRequestHandler(import_types.ListResourcesRequestSchema, async () => {
1097
+ return {
1098
+ resources: [
1099
+ // Main resources
1100
+ {
1101
+ uri: "mta://components",
1102
+ name: "MTA Design System Components",
1103
+ description: "Complete list of all components",
1104
+ mimeType: "application/json"
1105
+ },
1106
+ {
1107
+ uri: "mta://themes",
1108
+ name: "MTA Design System Themes",
1109
+ description: "All available brand themes",
1110
+ mimeType: "application/json"
1111
+ },
1112
+ {
1113
+ uri: "mta://examples",
1114
+ name: "MTA Design System Examples",
1115
+ description: "Usage examples for all components",
1116
+ mimeType: "application/json"
1117
+ },
1118
+ // Individual themes
1119
+ ...["Default", "Owlexa", "BPJS"].map((name) => ({
1120
+ uri: `mta://themes/${name.toLowerCase()}`,
1121
+ name: `${name} Theme`,
1122
+ description: `${name} brand theme tokens`,
1123
+ mimeType: "application/json"
1124
+ }))
1125
+ ]
1126
+ };
1127
+ });
1128
+ server.setRequestHandler(import_types.ReadResourceRequestSchema, async (request) => {
1129
+ const { uri } = request.params;
1130
+ if (uri === "mta://components") {
1131
+ return { contents: [componentsResource] };
1132
+ }
1133
+ if (uri.startsWith("mta://components/")) {
1134
+ const name = uri.replace("mta://components/", "");
1135
+ const resource = getComponentResource(name);
1136
+ if (!resource) {
1137
+ throw new Error(`Component not found: ${name}`);
1138
+ }
1139
+ return { contents: [resource] };
1140
+ }
1141
+ if (uri === "mta://themes") {
1142
+ return { contents: [themesResource] };
1143
+ }
1144
+ if (uri.startsWith("mta://themes/")) {
1145
+ const name = uri.replace("mta://themes/", "");
1146
+ const resource = getThemeResource(name);
1147
+ if (!resource) {
1148
+ throw new Error(`Theme not found: ${name}`);
1149
+ }
1150
+ return { contents: [resource] };
1151
+ }
1152
+ if (uri === "mta://examples") {
1153
+ return { contents: [examplesResource] };
1154
+ }
1155
+ if (uri.startsWith("mta://examples/")) {
1156
+ const name = uri.replace("mta://examples/", "");
1157
+ const resource = getExamplesResource(name);
1158
+ if (!resource) {
1159
+ throw new Error(`Examples not found for: ${name}`);
1160
+ }
1161
+ return { contents: [resource] };
1162
+ }
1163
+ throw new Error(`Unknown resource: ${uri}`);
1164
+ });
1165
+ server.setRequestHandler(import_types.ListToolsRequestSchema, async () => {
1166
+ return {
1167
+ tools: [
1168
+ {
1169
+ name: "search-components",
1170
+ description: "Search for components by name, description, or props",
1171
+ inputSchema: {
1172
+ type: "object",
1173
+ properties: {
1174
+ query: {
1175
+ type: "string",
1176
+ description: "Search query (component name, description, or prop name)"
1177
+ }
1178
+ },
1179
+ required: ["query"]
1180
+ }
1181
+ },
1182
+ {
1183
+ name: "get-component-props",
1184
+ description: "Get the TypeScript props interface for a component",
1185
+ inputSchema: {
1186
+ type: "object",
1187
+ properties: {
1188
+ componentName: {
1189
+ type: "string",
1190
+ description: 'Name of the component (e.g., "Button", "ClaimMindButton")'
1191
+ }
1192
+ },
1193
+ required: ["componentName"]
1194
+ }
1195
+ },
1196
+ {
1197
+ name: "generate-code",
1198
+ description: "Generate usage code snippet for a component",
1199
+ inputSchema: {
1200
+ type: "object",
1201
+ properties: {
1202
+ componentName: {
1203
+ type: "string",
1204
+ description: "Name of the component"
1205
+ },
1206
+ theme: {
1207
+ type: "string",
1208
+ enum: ["Default", "Owlexa", "BPJS"],
1209
+ description: "Theme to use (for themed components)"
1210
+ },
1211
+ props: {
1212
+ type: "object",
1213
+ description: "Props to include in the generated code"
1214
+ },
1215
+ includeState: {
1216
+ type: "boolean",
1217
+ description: "Include React state hooks if applicable"
1218
+ }
1219
+ },
1220
+ required: ["componentName"]
1221
+ }
1222
+ },
1223
+ {
1224
+ name: "get-theme-variables",
1225
+ description: "Get CSS custom properties for a theme",
1226
+ inputSchema: {
1227
+ type: "object",
1228
+ properties: {
1229
+ theme: {
1230
+ type: "string",
1231
+ enum: ["Default", "Owlexa", "BPJS"],
1232
+ description: "Theme name (leave empty for all themes)"
1233
+ }
1234
+ }
1235
+ }
1236
+ }
1237
+ ]
1238
+ };
1239
+ });
1240
+ server.setRequestHandler(import_types.CallToolRequestSchema, async (request) => {
1241
+ const { name, arguments: args } = request.params;
1242
+ switch (name) {
1243
+ case "search-components": {
1244
+ const { query } = args;
1245
+ const results = searchComponents(query);
1246
+ return {
1247
+ content: [
1248
+ {
1249
+ type: "text",
1250
+ text: JSON.stringify({
1251
+ query,
1252
+ total: results.length,
1253
+ components: results.map((c) => ({
1254
+ name: c.name,
1255
+ category: c.category,
1256
+ description: c.description,
1257
+ themable: c.themable
1258
+ }))
1259
+ }, null, 2)
1260
+ }
1261
+ ]
1262
+ };
1263
+ }
1264
+ case "get-component-props": {
1265
+ const { componentName } = args;
1266
+ const component = getComponentByName(componentName);
1267
+ if (!component) {
1268
+ return {
1269
+ content: [
1270
+ {
1271
+ type: "text",
1272
+ text: `Component "${componentName}" not found. Available components: ${componentRegistry.map((c) => c.name).join(", ")}`
1273
+ }
1274
+ ],
1275
+ isError: true
1276
+ };
1277
+ }
1278
+ const propsInterface = component.props.map((p) => {
1279
+ const required = p.required ? "" : "?";
1280
+ const defaultComment = p.default ? ` // default: ${p.default}` : "";
1281
+ return ` ${p.name}${required}: ${p.type};${defaultComment}`;
1282
+ }).join("\n");
1283
+ return {
1284
+ content: [
1285
+ {
1286
+ type: "text",
1287
+ text: `interface ${component.name}Props {
1288
+ ${propsInterface}
1289
+ }
1290
+
1291
+ // ${component.description}`
1292
+ }
1293
+ ]
1294
+ };
1295
+ }
1296
+ case "generate-code": {
1297
+ const { componentName, theme, props, includeState } = args;
1298
+ const component = getComponentByName(componentName);
1299
+ if (!component) {
1300
+ return {
1301
+ content: [
1302
+ {
1303
+ type: "text",
1304
+ text: `Component "${componentName}" not found.`
1305
+ }
1306
+ ],
1307
+ isError: true
1308
+ };
1309
+ }
1310
+ const code = generateFullComponentCode(componentName, {
1311
+ theme,
1312
+ props,
1313
+ includeState
1314
+ });
1315
+ return {
1316
+ content: [
1317
+ {
1318
+ type: "text",
1319
+ text: code
1320
+ }
1321
+ ]
1322
+ };
1323
+ }
1324
+ case "get-theme-variables": {
1325
+ const { theme } = args;
1326
+ const css = getThemeVariablesCss(theme);
1327
+ return {
1328
+ content: [
1329
+ {
1330
+ type: "text",
1331
+ text: css || "Theme not found."
1332
+ }
1333
+ ]
1334
+ };
1335
+ }
1336
+ default:
1337
+ throw new Error(`Unknown tool: ${name}`);
1338
+ }
1339
+ });
1340
+
1341
+ // mcp/src/index.ts
1342
+ async function main() {
1343
+ const transport = new import_stdio.StdioServerTransport();
1344
+ await server.connect(transport);
1345
+ console.error("MTA Design System MCP Server running on stdio");
1346
+ }
1347
+ main().catch((error) => {
1348
+ console.error("Fatal error in main():", error);
1349
+ process.exit(1);
1350
+ });
1351
+ //# sourceMappingURL=index.cjs.map