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,1234 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
25
+
26
+ // cli/src/index.ts
27
+ var import_commander = require("commander");
28
+ var import_chalk5 = __toESM(require("chalk"), 1);
29
+
30
+ // cli/src/commands/list.ts
31
+ var import_chalk = __toESM(require("chalk"), 1);
32
+
33
+ // cli/src/registry.ts
34
+ var componentRegistry = [
35
+ // ==================== BASE UI COMPONENTS ====================
36
+ {
37
+ name: "Button",
38
+ category: "ui",
39
+ description: "A versatile button component with multiple variants and sizes.",
40
+ sourcePath: "src/components/ui/button.tsx",
41
+ props: [
42
+ { name: "variant", type: "'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'", required: false, default: "'default'", description: "Button visual style" },
43
+ { name: "size", type: "'default' | 'sm' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg'", required: false, default: "'default'", description: "Button size" },
44
+ { name: "asChild", type: "boolean", required: false, default: "false", description: "Render as child element" },
45
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" },
46
+ { name: "disabled", type: "boolean", required: false, description: "Disable the button" }
47
+ ],
48
+ examples: [
49
+ {
50
+ title: "Basic Button",
51
+ code: `import { Button } from 'mta-design-system';
52
+
53
+ <Button>Click me</Button>`
54
+ },
55
+ {
56
+ title: "Button Variants",
57
+ code: `<Button variant="default">Default</Button>
58
+ <Button variant="destructive">Destructive</Button>
59
+ <Button variant="outline">Outline</Button>
60
+ <Button variant="secondary">Secondary</Button>
61
+ <Button variant="ghost">Ghost</Button>
62
+ <Button variant="link">Link</Button>`
63
+ },
64
+ {
65
+ title: "Button Sizes",
66
+ code: `<Button size="sm">Small</Button>
67
+ <Button size="default">Default</Button>
68
+ <Button size="lg">Large</Button>`
69
+ }
70
+ ],
71
+ dependencies: ["@radix-ui/react-slot", "class-variance-authority"],
72
+ themable: false
73
+ },
74
+ {
75
+ name: "Alert",
76
+ category: "ui",
77
+ description: "Displays a callout for user attention.",
78
+ sourcePath: "src/components/ui/alert.tsx",
79
+ props: [
80
+ { name: "variant", type: "'default' | 'destructive'", required: false, default: "'default'", description: "Alert visual style" },
81
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
82
+ ],
83
+ examples: [
84
+ {
85
+ title: "Basic Alert",
86
+ code: `import { Alert, AlertTitle, AlertDescription } from 'mta-design-system';
87
+
88
+ <Alert>
89
+ <AlertTitle>Heads up!</AlertTitle>
90
+ <AlertDescription>You can add components to your app using the cli.</AlertDescription>
91
+ </Alert>`
92
+ },
93
+ {
94
+ title: "Destructive Alert",
95
+ code: `<Alert variant="destructive">
96
+ <AlertTitle>Error</AlertTitle>
97
+ <AlertDescription>Your session has expired. Please log in again.</AlertDescription>
98
+ </Alert>`
99
+ }
100
+ ],
101
+ dependencies: ["class-variance-authority"],
102
+ themable: false
103
+ },
104
+ {
105
+ name: "Card",
106
+ category: "ui",
107
+ description: "Displays a card with header, content, and footer sections.",
108
+ sourcePath: "src/components/ui/card.tsx",
109
+ props: [
110
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
111
+ ],
112
+ examples: [
113
+ {
114
+ title: "Basic Card",
115
+ code: `import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from 'mta-design-system';
116
+
117
+ <Card>
118
+ <CardHeader>
119
+ <CardTitle>Card Title</CardTitle>
120
+ <CardDescription>Card Description</CardDescription>
121
+ </CardHeader>
122
+ <CardContent>
123
+ <p>Card Content</p>
124
+ </CardContent>
125
+ <CardFooter>
126
+ <p>Card Footer</p>
127
+ </CardFooter>
128
+ </Card>`
129
+ }
130
+ ],
131
+ dependencies: [],
132
+ themable: false
133
+ },
134
+ {
135
+ name: "Input",
136
+ category: "ui",
137
+ description: "A text input component for forms.",
138
+ sourcePath: "src/components/ui/input.tsx",
139
+ props: [
140
+ { name: "type", type: "string", required: false, default: "'text'", description: "Input type" },
141
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
142
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" },
143
+ { name: "disabled", type: "boolean", required: false, description: "Disable the input" }
144
+ ],
145
+ examples: [
146
+ {
147
+ title: "Basic Input",
148
+ code: `import { Input } from 'mta-design-system';
149
+
150
+ <Input placeholder="Enter your name" />`
151
+ }
152
+ ],
153
+ dependencies: [],
154
+ themable: false
155
+ },
156
+ {
157
+ name: "Label",
158
+ category: "ui",
159
+ description: "A label component for form fields.",
160
+ sourcePath: "src/components/ui/label.tsx",
161
+ props: [
162
+ { name: "htmlFor", type: "string", required: false, description: "ID of the associated form element" },
163
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
164
+ ],
165
+ examples: [
166
+ {
167
+ title: "Basic Label",
168
+ code: `import { Label } from 'mta-design-system';
169
+
170
+ <Label htmlFor="email">Email</Label>`
171
+ }
172
+ ],
173
+ dependencies: ["@radix-ui/react-label"],
174
+ themable: false
175
+ },
176
+ {
177
+ name: "Dialog",
178
+ category: "ui",
179
+ description: "A modal dialog component.",
180
+ sourcePath: "src/components/ui/dialog.tsx",
181
+ props: [
182
+ { name: "open", type: "boolean", required: false, description: "Controlled open state" },
183
+ { name: "onOpenChange", type: "(open: boolean) => void", required: false, description: "Callback when open state changes" }
184
+ ],
185
+ examples: [
186
+ {
187
+ title: "Basic Dialog",
188
+ code: `import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from 'mta-design-system';
189
+
190
+ <Dialog>
191
+ <DialogTrigger>Open Dialog</DialogTrigger>
192
+ <DialogContent>
193
+ <DialogHeader>
194
+ <DialogTitle>Are you sure?</DialogTitle>
195
+ <DialogDescription>This action cannot be undone.</DialogDescription>
196
+ </DialogHeader>
197
+ <DialogFooter>
198
+ <Button>Confirm</Button>
199
+ </DialogFooter>
200
+ </DialogContent>
201
+ </Dialog>`
202
+ }
203
+ ],
204
+ dependencies: ["@radix-ui/react-dialog"],
205
+ themable: false
206
+ },
207
+ {
208
+ name: "Select",
209
+ category: "ui",
210
+ description: "A dropdown select component.",
211
+ sourcePath: "src/components/ui/select.tsx",
212
+ props: [
213
+ { name: "value", type: "string", required: false, description: "Selected value" },
214
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Callback when value changes" },
215
+ { name: "disabled", type: "boolean", required: false, description: "Disable the select" }
216
+ ],
217
+ examples: [
218
+ {
219
+ title: "Basic Select",
220
+ code: `import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from 'mta-design-system';
221
+
222
+ <Select>
223
+ <SelectTrigger>
224
+ <SelectValue placeholder="Select an option" />
225
+ </SelectTrigger>
226
+ <SelectContent>
227
+ <SelectItem value="option1">Option 1</SelectItem>
228
+ <SelectItem value="option2">Option 2</SelectItem>
229
+ </SelectContent>
230
+ </Select>`
231
+ }
232
+ ],
233
+ dependencies: ["@radix-ui/react-select"],
234
+ themable: false
235
+ },
236
+ {
237
+ name: "Switch",
238
+ category: "ui",
239
+ description: "A toggle switch component.",
240
+ sourcePath: "src/components/ui/switch.tsx",
241
+ props: [
242
+ { name: "checked", type: "boolean", required: false, description: "Controlled checked state" },
243
+ { name: "onCheckedChange", type: "(checked: boolean) => void", required: false, description: "Callback when checked state changes" },
244
+ { name: "disabled", type: "boolean", required: false, description: "Disable the switch" }
245
+ ],
246
+ examples: [
247
+ {
248
+ title: "Basic Switch",
249
+ code: `import { Switch } from 'mta-design-system';
250
+
251
+ <Switch />`
252
+ }
253
+ ],
254
+ dependencies: ["@radix-ui/react-switch"],
255
+ themable: false
256
+ },
257
+ {
258
+ name: "Tooltip",
259
+ category: "ui",
260
+ description: "A tooltip component for displaying additional information.",
261
+ sourcePath: "src/components/ui/tooltip.tsx",
262
+ props: [
263
+ { name: "content", type: "ReactNode", required: false, description: "Tooltip content" },
264
+ { name: "delayDuration", type: "number", required: false, default: "400", description: "Delay before showing tooltip" }
265
+ ],
266
+ examples: [
267
+ {
268
+ title: "Basic Tooltip",
269
+ code: `import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from 'mta-design-system';
270
+
271
+ <TooltipProvider>
272
+ <Tooltip>
273
+ <TooltipTrigger>Hover me</TooltipTrigger>
274
+ <TooltipContent>Tooltip content</TooltipContent>
275
+ </Tooltip>
276
+ </TooltipProvider>`
277
+ }
278
+ ],
279
+ dependencies: ["@radix-ui/react-tooltip"],
280
+ themable: false
281
+ },
282
+ {
283
+ name: "Table",
284
+ category: "ui",
285
+ description: "A table component for displaying data.",
286
+ sourcePath: "src/components/ui/table.tsx",
287
+ props: [
288
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
289
+ ],
290
+ examples: [
291
+ {
292
+ title: "Basic Table",
293
+ code: `import { Table, TableHeader, TableHead, TableBody, TableRow, TableCell } from 'mta-design-system';
294
+
295
+ <Table>
296
+ <TableHeader>
297
+ <TableRow>
298
+ <TableHead>Name</TableHead>
299
+ <TableHead>Email</TableHead>
300
+ </TableRow>
301
+ </TableHeader>
302
+ <TableBody>
303
+ <TableRow>
304
+ <TableCell>John Doe</TableCell>
305
+ <TableCell>john@example.com</TableCell>
306
+ </TableRow>
307
+ </TableBody>
308
+ </Table>`
309
+ }
310
+ ],
311
+ dependencies: [],
312
+ themable: false
313
+ },
314
+ {
315
+ name: "Progress",
316
+ category: "ui",
317
+ description: "A progress bar component.",
318
+ sourcePath: "src/components/ui/progress.tsx",
319
+ props: [
320
+ { name: "value", type: "number", required: false, description: "Progress value (0-100)" },
321
+ { name: "max", type: "number", required: false, default: "100", description: "Maximum value" }
322
+ ],
323
+ examples: [
324
+ {
325
+ title: "Basic Progress",
326
+ code: `import { Progress } from 'mta-design-system';
327
+
328
+ <Progress value={60} />`
329
+ }
330
+ ],
331
+ dependencies: ["@radix-ui/react-progress"],
332
+ themable: false
333
+ },
334
+ {
335
+ name: "Spinner",
336
+ category: "ui",
337
+ description: "A loading spinner component.",
338
+ sourcePath: "src/components/ui/spinner.tsx",
339
+ props: [
340
+ { name: "size", type: "'sm' | 'default' | 'lg'", required: false, default: "'default'", description: "Spinner size" },
341
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
342
+ ],
343
+ examples: [
344
+ {
345
+ title: "Basic Spinner",
346
+ code: `import { Spinner } from 'mta-design-system';
347
+
348
+ <Spinner />`
349
+ }
350
+ ],
351
+ dependencies: [],
352
+ themable: false
353
+ },
354
+ {
355
+ name: "Calendar",
356
+ category: "ui",
357
+ description: "A calendar component for date selection.",
358
+ sourcePath: "src/components/ui/calendar.tsx",
359
+ props: [
360
+ { name: "selected", type: "Date", required: false, description: "Selected date" },
361
+ { name: "onSelect", type: "(date: Date | undefined) => void", required: false, description: "Callback when date is selected" },
362
+ { name: "mode", type: "'single' | 'multiple' | 'range'", required: false, default: "'single'", description: "Selection mode" }
363
+ ],
364
+ examples: [
365
+ {
366
+ title: "Basic Calendar",
367
+ code: `import { Calendar } from 'mta-design-system';
368
+ import 'mta-design-system/styles.css';
369
+
370
+ <Calendar />`
371
+ }
372
+ ],
373
+ dependencies: ["react-day-picker", "date-fns"],
374
+ themable: false
375
+ },
376
+ {
377
+ name: "Popover",
378
+ category: "ui",
379
+ description: "A popover component for displaying floating content.",
380
+ sourcePath: "src/components/ui/popover.tsx",
381
+ props: [
382
+ { name: "open", type: "boolean", required: false, description: "Controlled open state" },
383
+ { name: "onOpenChange", type: "(open: boolean) => void", required: false, description: "Callback when open state changes" }
384
+ ],
385
+ examples: [
386
+ {
387
+ title: "Basic Popover",
388
+ code: `import { Popover, PopoverTrigger, PopoverContent } from 'mta-design-system';
389
+
390
+ <Popover>
391
+ <PopoverTrigger>Open</PopoverTrigger>
392
+ <PopoverContent>Popover content</PopoverContent>
393
+ </Popover>`
394
+ }
395
+ ],
396
+ dependencies: ["@radix-ui/react-popover"],
397
+ themable: false
398
+ },
399
+ {
400
+ name: "Command",
401
+ category: "ui",
402
+ description: "A command menu component for search and actions.",
403
+ sourcePath: "src/components/ui/command.tsx",
404
+ props: [
405
+ { name: "value", type: "string", required: false, description: "Selected value" },
406
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Callback when value changes" },
407
+ { name: "placeholder", type: "string", required: false, description: "Search placeholder" }
408
+ ],
409
+ examples: [
410
+ {
411
+ title: "Basic Command",
412
+ code: `import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from 'mta-design-system';
413
+
414
+ <Command>
415
+ <CommandInput placeholder="Search..." />
416
+ <CommandList>
417
+ <CommandEmpty>No results found.</CommandEmpty>
418
+ <CommandGroup heading="Suggestions">
419
+ <CommandItem>Option 1</CommandItem>
420
+ <CommandItem>Option 2</CommandItem>
421
+ </CommandGroup>
422
+ </CommandList>
423
+ </Command>`
424
+ }
425
+ ],
426
+ dependencies: ["cmdk"],
427
+ themable: false
428
+ },
429
+ // ==================== CLAIMMIND THEMED COMPONENTS ====================
430
+ {
431
+ name: "ClaimMindButton",
432
+ category: "claimmind",
433
+ description: "A themed button component with brand colors (Default, Owlexa, BPJS themes).",
434
+ sourcePath: "src/stories/claimmind/Button.tsx",
435
+ props: [
436
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
437
+ { name: "variant", type: "'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'", required: false, default: "'default'", description: "Button visual style" },
438
+ { name: "size", type: "'default' | 'sm' | 'lg' | 'icon'", required: false, default: "'default'", description: "Button size" },
439
+ { name: "label", type: "string", required: false, description: "Button label text" },
440
+ { name: "loading", type: "boolean", required: false, default: "false", description: "Show loading spinner" },
441
+ { name: "leftIconName", type: "LucideIconName", required: false, description: "Icon name for left side" },
442
+ { name: "rightIconName", type: "LucideIconName", required: false, description: "Icon name for right side" }
443
+ ],
444
+ examples: [
445
+ {
446
+ title: "Basic ClaimMindButton",
447
+ code: `import { ClaimMindButton } from 'mta-design-system';
448
+ import 'mta-design-system/styles.css';
449
+
450
+ <ClaimMindButton theme="Default">Click me</ClaimMindButton>`
451
+ },
452
+ {
453
+ title: "Themed Buttons",
454
+ code: `<ClaimMindButton theme="Default">ClaimMind</ClaimMindButton>
455
+ <ClaimMindButton theme="Owlexa">Owlexa</ClaimMindButton>
456
+ <ClaimMindButton theme="BPJS">BPJS</ClaimMindButton>`
457
+ },
458
+ {
459
+ title: "Loading State",
460
+ code: `<ClaimMindButton loading>Processing...</ClaimMindButton>`
461
+ },
462
+ {
463
+ title: "With Icons",
464
+ code: `import { ClaimMindButton } from 'mta-design-system';
465
+
466
+ <ClaimMindButton leftIconName="Mail">Send Email</ClaimMindButton>
467
+ <ClaimMindButton rightIconName="ChevronRight">Continue</ClaimMindButton>`
468
+ }
469
+ ],
470
+ dependencies: ["lucide-react"],
471
+ themable: true
472
+ },
473
+ {
474
+ name: "ClaimMindInput",
475
+ category: "claimmind",
476
+ description: "A themed input component with brand colors.",
477
+ sourcePath: "src/stories/claimmind/Input.tsx",
478
+ props: [
479
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
480
+ { name: "type", type: "string", required: false, default: "'text'", description: "Input type" },
481
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
482
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
483
+ ],
484
+ examples: [
485
+ {
486
+ title: "Basic ClaimMindInput",
487
+ code: `import { ClaimMindInput } from 'mta-design-system';
488
+ import 'mta-design-system/styles.css';
489
+
490
+ <ClaimMindInput theme="Default" placeholder="Enter text..." />`
491
+ }
492
+ ],
493
+ dependencies: [],
494
+ themable: true
495
+ },
496
+ {
497
+ name: "ClaimMindCard",
498
+ category: "claimmind",
499
+ description: "A themed card component with optional top border accent.",
500
+ sourcePath: "src/stories/claimmind/Card.tsx",
501
+ props: [
502
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
503
+ { name: "showTopBorder", type: "boolean", required: false, default: "false", description: "Show colored top border" },
504
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
505
+ ],
506
+ examples: [
507
+ {
508
+ title: "Basic ClaimMindCard",
509
+ code: `import { ClaimMindCard, CardHeader, CardTitle, CardContent } from 'mta-design-system';
510
+ import 'mta-design-system/styles.css';
511
+
512
+ <ClaimMindCard theme="Owlexa" showTopBorder>
513
+ <CardHeader>
514
+ <CardTitle>Card Title</CardTitle>
515
+ </CardHeader>
516
+ <CardContent>
517
+ <p>Card content goes here</p>
518
+ </CardContent>
519
+ </ClaimMindCard>`
520
+ }
521
+ ],
522
+ dependencies: [],
523
+ themable: true
524
+ },
525
+ {
526
+ name: "ClaimMindAlert",
527
+ category: "claimmind",
528
+ description: "A themed alert component with brand colors.",
529
+ sourcePath: "src/stories/claimmind/Alert.tsx",
530
+ props: [
531
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
532
+ { name: "variant", type: "'info' | 'success' | 'warning' | 'error'", required: false, default: "'info'", description: "Alert type" },
533
+ { name: "title", type: "string", required: false, description: "Alert title" },
534
+ { name: "description", type: "string", required: false, description: "Alert description" }
535
+ ],
536
+ examples: [
537
+ {
538
+ title: "ClaimMindAlert Variants",
539
+ code: `import { ClaimMindAlert } from 'mta-design-system';
540
+ import 'mta-design-system/styles.css';
541
+
542
+ <ClaimMindAlert theme="Default" variant="success" title="Success!" description="Operation completed." />
543
+ <ClaimMindAlert theme="Owlexa" variant="error" title="Error" description="Something went wrong." />`
544
+ }
545
+ ],
546
+ dependencies: ["lucide-react"],
547
+ themable: true
548
+ },
549
+ {
550
+ name: "ClaimMindSpinner",
551
+ category: "claimmind",
552
+ description: "A themed loading spinner component.",
553
+ sourcePath: "src/stories/claimmind/Spinner.tsx",
554
+ props: [
555
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
556
+ { name: "size", type: "'sm' | 'default' | 'lg'", required: false, default: "'default'", description: "Spinner size" },
557
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
558
+ ],
559
+ examples: [
560
+ {
561
+ title: "ClaimMindSpinner",
562
+ code: `import { ClaimMindSpinner } from 'mta-design-system';
563
+ import 'mta-design-system/styles.css';
564
+
565
+ <ClaimMindSpinner theme="BPJS" size="lg" />`
566
+ }
567
+ ],
568
+ dependencies: [],
569
+ themable: true
570
+ },
571
+ {
572
+ name: "ClaimMindSelect",
573
+ category: "claimmind",
574
+ description: "A themed select dropdown component.",
575
+ sourcePath: "src/stories/claimmind/Select.tsx",
576
+ props: [
577
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
578
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
579
+ { name: "options", type: "Array<{ value: string; label: string }>", required: true, description: "Select options" },
580
+ { name: "value", type: "string", required: false, description: "Selected value" },
581
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Value change callback" }
582
+ ],
583
+ examples: [
584
+ {
585
+ title: "ClaimMindSelect",
586
+ code: `import { ClaimMindSelect } from 'mta-design-system';
587
+ import 'mta-design-system/styles.css';
588
+
589
+ const options = [
590
+ { value: 'option1', label: 'Option 1' },
591
+ { value: 'option2', label: 'Option 2' },
592
+ ];
593
+
594
+ <ClaimMindSelect
595
+ theme="Default"
596
+ options={options}
597
+ placeholder="Select an option"
598
+ />`
599
+ }
600
+ ],
601
+ dependencies: ["@radix-ui/react-select"],
602
+ themable: true
603
+ },
604
+ {
605
+ name: "ClaimMindCombobox",
606
+ category: "claimmind",
607
+ description: "A themed combobox component with search functionality.",
608
+ sourcePath: "src/stories/claimmind/Combobox.tsx",
609
+ props: [
610
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
611
+ { name: "placeholder", type: "string", required: false, description: "Search placeholder" },
612
+ { name: "options", type: "Array<{ value: string; label: string }>", required: true, description: "Combobox options" },
613
+ { name: "value", type: "string", required: false, description: "Selected value" },
614
+ { name: "onValueChange", type: "(value: string) => void", required: false, description: "Value change callback" }
615
+ ],
616
+ examples: [
617
+ {
618
+ title: "ClaimMindCombobox",
619
+ code: `import { ClaimMindCombobox } from 'mta-design-system';
620
+ import 'mta-design-system/styles.css';
621
+
622
+ const options = [
623
+ { value: 'apple', label: 'Apple' },
624
+ { value: 'banana', label: 'Banana' },
625
+ ];
626
+
627
+ <ClaimMindCombobox
628
+ theme="Owlexa"
629
+ options={options}
630
+ placeholder="Search fruits..."
631
+ />`
632
+ }
633
+ ],
634
+ dependencies: ["cmdk", "@radix-ui/react-popover"],
635
+ themable: true
636
+ },
637
+ {
638
+ name: "ClaimMindDatePicker",
639
+ category: "claimmind",
640
+ description: "A themed date picker component.",
641
+ sourcePath: "src/stories/claimmind/DatePicker.tsx",
642
+ props: [
643
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
644
+ { name: "placeholder", type: "string", required: false, description: "Placeholder text" },
645
+ { name: "value", type: "Date", required: false, description: "Selected date" },
646
+ { name: "onChange", type: "(date: Date | undefined) => void", required: false, description: "Date change callback" }
647
+ ],
648
+ examples: [
649
+ {
650
+ title: "ClaimMindDatePicker",
651
+ code: `import { ClaimMindDatePicker } from 'mta-design-system';
652
+ import 'mta-design-system/styles.css';
653
+
654
+ <ClaimMindDatePicker theme="Default" placeholder="Pick a date" />`
655
+ }
656
+ ],
657
+ dependencies: ["react-day-picker", "date-fns", "@radix-ui/react-popover"],
658
+ themable: true
659
+ },
660
+ {
661
+ name: "ClaimMindTable",
662
+ category: "claimmind",
663
+ description: "A themed table component for data display.",
664
+ sourcePath: "src/stories/claimmind/Table.tsx",
665
+ props: [
666
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
667
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
668
+ ],
669
+ examples: [
670
+ {
671
+ title: "ClaimMindTable",
672
+ code: `import { ClaimMindTable, TableHeader, TableHead, TableBody, TableRow, TableCell } from 'mta-design-system';
673
+ import 'mta-design-system/styles.css';
674
+
675
+ <ClaimMindTable theme="BPJS">
676
+ <TableHeader>
677
+ <TableRow>
678
+ <TableHead>Name</TableHead>
679
+ <TableHead>Status</TableHead>
680
+ </TableRow>
681
+ </TableHeader>
682
+ <TableBody>
683
+ <TableRow>
684
+ <TableCell>John Doe</TableCell>
685
+ <TableCell>Active</TableCell>
686
+ </TableRow>
687
+ </TableBody>
688
+ </ClaimMindTable>`
689
+ }
690
+ ],
691
+ dependencies: [],
692
+ themable: true
693
+ },
694
+ // ==================== MOLECULES ====================
695
+ {
696
+ name: "Chat",
697
+ category: "molecules",
698
+ description: "A floating chat widget component with theme support.",
699
+ sourcePath: "src/stories/claimmind/molecules/Chat.tsx",
700
+ props: [
701
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
702
+ { name: "variant", type: "'float' | 'bottom-side'", required: false, default: "'float'", description: "Chat widget position" },
703
+ { name: "title", type: "string", required: false, default: "'Chat Support'", description: "Chat window title" },
704
+ { name: "messages", type: "ChatMessage[]", required: false, description: "Chat messages array" },
705
+ { name: "onSendMessage", type: "(message: string) => void", required: false, description: "Send message callback" },
706
+ { name: "isOpen", type: "boolean", required: false, description: "Control open state" },
707
+ { name: "onToggle", type: "() => void", required: false, description: "Toggle callback" },
708
+ { name: "placeholder", type: "string", required: false, description: "Input placeholder" }
709
+ ],
710
+ examples: [
711
+ {
712
+ title: "Chat Widget",
713
+ code: `import { Chat } from 'mta-design-system';
714
+ import 'mta-design-system/styles.css';
715
+
716
+ const messages = [
717
+ { id: '1', text: 'Hello!', sender: 'bot' as const, timestamp: new Date() },
718
+ { id: '2', text: 'Hi there!', sender: 'user' as const, timestamp: new Date() },
719
+ ];
720
+
721
+ function App() {
722
+ const [isOpen, setIsOpen] = useState(false);
723
+
724
+ return (
725
+ <Chat
726
+ theme="Owlexa"
727
+ variant="float"
728
+ messages={messages}
729
+ isOpen={isOpen}
730
+ onToggle={() => setIsOpen(!isOpen)}
731
+ onSendMessage={(msg) => console.log(msg)}
732
+ />
733
+ );
734
+ }`
735
+ }
736
+ ],
737
+ dependencies: ["lucide-react"],
738
+ themable: true
739
+ },
740
+ {
741
+ name: "DashboardCard",
742
+ category: "molecules",
743
+ description: "A themed dashboard card for displaying metrics.",
744
+ sourcePath: "src/stories/claimmind/molecules/DashboardCard.tsx",
745
+ props: [
746
+ { name: "label", type: "string", required: true, description: 'Card label (e.g., "Total Claims")' },
747
+ { name: "value", type: "string | number", required: true, description: "Value to display" },
748
+ { name: "iconName", type: "LucideIconName", required: false, description: "Icon name from lucide-react" },
749
+ { name: "icon", type: "ReactNode", required: false, description: "Custom icon element" },
750
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
751
+ { name: "colorVariant", type: "'primary' | 'secondary' | 'tertiary' | 'success' | 'danger'", required: false, default: "'primary'", description: "Icon color variant" }
752
+ ],
753
+ examples: [
754
+ {
755
+ title: "DashboardCard",
756
+ code: `import { DashboardCard } from 'mta-design-system';
757
+ import 'mta-design-system/styles.css';
758
+
759
+ <DashboardCard
760
+ label="Total Claims"
761
+ value="1,234"
762
+ iconName="FileText"
763
+ theme="Default"
764
+ colorVariant="primary"
765
+ />`
766
+ }
767
+ ],
768
+ dependencies: ["lucide-react"],
769
+ themable: true
770
+ },
771
+ {
772
+ name: "Title",
773
+ category: "molecules",
774
+ description: "A themed title component with underline accent.",
775
+ sourcePath: "src/stories/claimmind/molecules/Title.tsx",
776
+ props: [
777
+ { name: "children", type: "ReactNode", required: true, description: "Title content" },
778
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
779
+ { name: "as", type: "'h1' | 'h2' | 'h3' | 'h4'", required: false, default: "'h2'", description: "HTML heading tag" },
780
+ { name: "underline", type: "boolean", required: false, default: "true", description: "Show underline accent" },
781
+ { name: "className", type: "string", required: false, description: "Additional CSS classes" }
782
+ ],
783
+ examples: [
784
+ {
785
+ title: "Title Component",
786
+ code: `import { Title } from 'mta-design-system';
787
+ import 'mta-design-system/styles.css';
788
+
789
+ <Title theme="Owlexa" as="h1" underline>
790
+ Welcome to ClaimMind
791
+ </Title>`
792
+ }
793
+ ],
794
+ dependencies: [],
795
+ themable: true
796
+ },
797
+ {
798
+ name: "SyncProgress",
799
+ category: "molecules",
800
+ description: "A themed sync progress card showing synchronization status.",
801
+ sourcePath: "src/stories/claimmind/molecules/SyncProgress.tsx",
802
+ props: [
803
+ { name: "progress", type: "number", required: true, description: "Progress percentage (0-100)" },
804
+ { name: "status", type: "'syncing' | 'completed' | 'failed'", required: false, default: "'syncing'", description: "Sync status" },
805
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
806
+ { name: "message", type: "string", required: false, description: "Status message" },
807
+ { name: "onCancel", type: "() => void", required: false, description: "Cancel callback" }
808
+ ],
809
+ examples: [
810
+ {
811
+ title: "SyncProgress Card",
812
+ code: `import { SyncProgress } from 'mta-design-system';
813
+ import 'mta-design-system/styles.css';
814
+
815
+ <SyncProgress
816
+ progress={65}
817
+ status="syncing"
818
+ theme="BPJS"
819
+ message="Syncing data from server..."
820
+ onCancel={() => console.log('Cancelled')}
821
+ />`
822
+ }
823
+ ],
824
+ dependencies: ["lucide-react"],
825
+ themable: true
826
+ },
827
+ // ==================== PAGES ====================
828
+ {
829
+ name: "LoginPage",
830
+ category: "pages",
831
+ description: "A complete login page template with theme support.",
832
+ sourcePath: "src/stories/claimmind/pages/LoginPage.tsx",
833
+ props: [
834
+ { name: "theme", type: "'Default' | 'Owlexa' | 'BPJS'", required: false, default: "'Default'", description: "Brand theme" },
835
+ { name: "title", type: "string", required: false, default: "'Login ke ClaimMind'", description: "Page title" },
836
+ { name: "description", type: "string", required: false, description: "Page description" }
837
+ ],
838
+ examples: [
839
+ {
840
+ title: "LoginPage",
841
+ code: `import { LoginPage } from 'mta-design-system';
842
+ import 'mta-design-system/styles.css';
843
+
844
+ // In your Next.js app
845
+ export default function Login() {
846
+ return (
847
+ <LoginPage
848
+ theme="Owlexa"
849
+ title="Welcome to Owlexa"
850
+ description="Enter your credentials to access your account."
851
+ />
852
+ );
853
+ }`
854
+ }
855
+ ],
856
+ dependencies: ["lucide-react"],
857
+ themable: true
858
+ }
859
+ ];
860
+ function getComponentByName(name) {
861
+ return componentRegistry.find(
862
+ (c) => c.name.toLowerCase() === name.toLowerCase() || c.name.toLowerCase().replace("claimmind", "") === name.toLowerCase()
863
+ );
864
+ }
865
+ function getComponentsByCategory(category) {
866
+ return componentRegistry.filter((c) => c.category === category);
867
+ }
868
+ function getCategories() {
869
+ return ["ui", "claimmind", "molecules", "pages"];
870
+ }
871
+
872
+ // cli/src/commands/list.ts
873
+ function listCommand(options) {
874
+ const { category, json } = options;
875
+ if (json) {
876
+ let components = componentRegistry;
877
+ if (category) {
878
+ components = getComponentsByCategory(category);
879
+ }
880
+ console.log(JSON.stringify(components, null, 2));
881
+ return;
882
+ }
883
+ console.log(import_chalk.default.bold.cyan("\n\u{1F4E6} MTA Design System Components\n"));
884
+ if (category) {
885
+ const components = getComponentsByCategory(category);
886
+ if (components.length === 0) {
887
+ console.log(import_chalk.default.yellow(`No components found in category "${category}"`));
888
+ console.log(import_chalk.default.gray(`Available categories: ${getCategories().join(", ")}`));
889
+ return;
890
+ }
891
+ printCategory(category, components);
892
+ } else {
893
+ const categories = getCategories();
894
+ for (const cat of categories) {
895
+ const components = getComponentsByCategory(cat);
896
+ printCategory(cat, components);
897
+ }
898
+ }
899
+ console.log(import_chalk.default.gray(`
900
+ Total: ${componentRegistry.length} components`));
901
+ console.log(import_chalk.default.gray(` Run ${import_chalk.default.cyan("mta-ds show <component>")} for details
902
+ `));
903
+ }
904
+ function printCategory(category, components) {
905
+ const categoryLabels = {
906
+ ui: "UI Components (shadcn/ui based)",
907
+ claimmind: "ClaimMind Themed Components",
908
+ molecules: "Molecule Components",
909
+ pages: "Page Templates"
910
+ };
911
+ console.log(import_chalk.default.bold.white(`${categoryLabels[category] || category}:`));
912
+ console.log(import_chalk.default.gray("\u2500".repeat(40)));
913
+ for (const comp of components) {
914
+ const themableTag = comp.themable ? import_chalk.default.green(" [themable]") : "";
915
+ console.log(` ${import_chalk.default.cyan(comp.name)}${themableTag}`);
916
+ console.log(import_chalk.default.gray(` ${comp.description}`));
917
+ }
918
+ console.log();
919
+ }
920
+
921
+ // cli/src/commands/show.ts
922
+ var import_chalk2 = __toESM(require("chalk"), 1);
923
+ var import_fs = __toESM(require("fs"), 1);
924
+ var import_path = __toESM(require("path"), 1);
925
+ function showCommand(componentName, options) {
926
+ const component = getComponentByName(componentName);
927
+ if (!component) {
928
+ console.log(import_chalk2.default.red(`
929
+ Component "${componentName}" not found.`));
930
+ console.log(import_chalk2.default.gray(` Run ${import_chalk2.default.cyan("mta-ds list")} to see all available components.
931
+ `));
932
+ process.exit(1);
933
+ }
934
+ const { props, examples, source } = options;
935
+ const showAll = !props && !examples && !source;
936
+ console.log(import_chalk2.default.bold.cyan(`
937
+ \u{1F4CB} ${component.name}
938
+ `));
939
+ console.log(import_chalk2.default.white(component.description));
940
+ if (component.themable) {
941
+ console.log(import_chalk2.default.green("\n \u2728 Themable: Yes (Default, Owlexa, BPJS)"));
942
+ }
943
+ if (component.dependencies && component.dependencies.length > 0) {
944
+ console.log(import_chalk2.default.gray(`
945
+ Dependencies: ${component.dependencies.join(", ")}`));
946
+ }
947
+ if ((showAll || props) && component.props.length > 0) {
948
+ console.log(import_chalk2.default.bold.white("\n Props:"));
949
+ console.log(import_chalk2.default.gray(" \u2500".repeat(30)));
950
+ for (const prop of component.props) {
951
+ const required = prop.required ? import_chalk2.default.red("*") : "";
952
+ const defaultVal = prop.default ? import_chalk2.default.gray(` = ${prop.default}`) : "";
953
+ console.log(` ${import_chalk2.default.cyan(prop.name)}${required}: ${import_chalk2.default.yellow(prop.type)}${defaultVal}`);
954
+ console.log(import_chalk2.default.gray(` ${prop.description}`));
955
+ }
956
+ }
957
+ if (showAll || examples) {
958
+ console.log(import_chalk2.default.bold.white("\n Examples:"));
959
+ console.log(import_chalk2.default.gray(" \u2500".repeat(30)));
960
+ for (const example of component.examples) {
961
+ console.log(import_chalk2.default.white(`
962
+ ${example.title}:`));
963
+ if (example.description) {
964
+ console.log(import_chalk2.default.gray(` ${example.description}`));
965
+ }
966
+ console.log(import_chalk2.default.gray(" " + "\u2500".repeat(20)));
967
+ console.log(import_chalk2.default.blue(example.code.split("\n").map((line) => " " + line).join("\n")));
968
+ }
969
+ }
970
+ if (source) {
971
+ console.log(import_chalk2.default.bold.white("\n Source:"));
972
+ console.log(import_chalk2.default.gray(" \u2500".repeat(30)));
973
+ console.log(import_chalk2.default.gray(` Path: ${component.sourcePath}`));
974
+ try {
975
+ const packageRoot = import_path.default.resolve(__dirname, "..", "..", "..");
976
+ const sourcePath = import_path.default.join(packageRoot, component.sourcePath);
977
+ if (import_fs.default.existsSync(sourcePath)) {
978
+ const sourceCode = import_fs.default.readFileSync(sourcePath, "utf-8");
979
+ console.log(import_chalk2.default.gray("\n"));
980
+ console.log(import_chalk2.default.blue(sourceCode.split("\n").map((line) => " " + line).join("\n")));
981
+ } else {
982
+ console.log(import_chalk2.default.yellow(" Source file not available in this context."));
983
+ }
984
+ } catch (error) {
985
+ console.log(import_chalk2.default.yellow(" Could not read source file."));
986
+ }
987
+ }
988
+ console.log(import_chalk2.default.gray(`
989
+ Import: ${import_chalk2.default.cyan(`import { ${component.name} } from 'mta-design-system';`)}
990
+ `));
991
+ }
992
+
993
+ // cli/src/commands/init.ts
994
+ var import_chalk3 = __toESM(require("chalk"), 1);
995
+ var import_fs_extra = __toESM(require("fs-extra"), 1);
996
+ var import_path2 = __toESM(require("path"), 1);
997
+ var import_inquirer = __toESM(require("inquirer"), 1);
998
+ async function initCommand(options) {
999
+ const { path: targetPath = ".", theme = "Default", skipDeps } = options;
1000
+ console.log(import_chalk3.default.bold.cyan("\n\u{1F680} Initializing MTA Design System...\n"));
1001
+ const projectPath = import_path2.default.resolve(targetPath);
1002
+ const packageJsonPath = import_path2.default.join(projectPath, "package.json");
1003
+ if (!import_fs_extra.default.existsSync(packageJsonPath)) {
1004
+ console.log(import_chalk3.default.yellow(" No package.json found. Creating one..."));
1005
+ await import_fs_extra.default.writeJson(packageJsonPath, {
1006
+ name: import_path2.default.basename(projectPath),
1007
+ version: "0.1.0",
1008
+ private: true
1009
+ }, { spaces: 2 });
1010
+ }
1011
+ const answers = await import_inquirer.default.prompt([
1012
+ {
1013
+ type: "list",
1014
+ name: "defaultTheme",
1015
+ message: "Select your default theme:",
1016
+ choices: ["Default", "Owlexa", "BPJS"],
1017
+ default: theme,
1018
+ when: !options.theme
1019
+ },
1020
+ {
1021
+ type: "confirm",
1022
+ name: "installDeps",
1023
+ message: "Install required dependencies?",
1024
+ default: true,
1025
+ when: !skipDeps
1026
+ },
1027
+ {
1028
+ type: "input",
1029
+ name: "componentsPath",
1030
+ message: "Where should components be stored?",
1031
+ default: "./src/components"
1032
+ }
1033
+ ]);
1034
+ const config = {
1035
+ defaultTheme: answers.defaultTheme || theme,
1036
+ componentsPath: answers.componentsPath || "./src/components",
1037
+ importAlias: "@/"
1038
+ };
1039
+ const configPath = import_path2.default.join(projectPath, "mta-ds.config.json");
1040
+ await import_fs_extra.default.writeJson(configPath, config, { spaces: 2 });
1041
+ console.log(import_chalk3.default.green(" \u2713 Created mta-ds.config.json"));
1042
+ const componentsDir = import_path2.default.join(projectPath, config.componentsPath.replace("./", ""));
1043
+ await import_fs_extra.default.ensureDir(componentsDir);
1044
+ await import_fs_extra.default.ensureDir(import_path2.default.join(componentsDir, "ui"));
1045
+ console.log(import_chalk3.default.green(` \u2713 Created ${config.componentsPath}/ui directory`));
1046
+ await createTailwindConfig(projectPath);
1047
+ await createGlobalsCss(projectPath, config.componentsPath);
1048
+ if (answers.installDeps && !skipDeps) {
1049
+ console.log(import_chalk3.default.cyan("\n Installing dependencies...\n"));
1050
+ const { execSync } = await import("child_process");
1051
+ const deps = [
1052
+ "mta-design-system",
1053
+ "@radix-ui/react-dialog",
1054
+ "@radix-ui/react-label",
1055
+ "@radix-ui/react-popover",
1056
+ "@radix-ui/react-progress",
1057
+ "@radix-ui/react-select",
1058
+ "@radix-ui/react-slot",
1059
+ "@radix-ui/react-switch",
1060
+ "@radix-ui/react-tooltip",
1061
+ "class-variance-authority",
1062
+ "clsx",
1063
+ "tailwind-merge",
1064
+ "lucide-react"
1065
+ ];
1066
+ try {
1067
+ execSync(`npm install ${deps.join(" ")}`, { cwd: projectPath, stdio: "inherit" });
1068
+ console.log(import_chalk3.default.green("\n \u2713 Dependencies installed"));
1069
+ } catch (e) {
1070
+ console.log(import_chalk3.default.yellow("\n \u26A0 Could not install dependencies automatically."));
1071
+ console.log(import_chalk3.default.gray(` Run: npm install ${deps.join(" ")}`));
1072
+ }
1073
+ }
1074
+ console.log(import_chalk3.default.bold.green("\n\u2705 MTA Design System initialized successfully!\n"));
1075
+ console.log(import_chalk3.default.white(" Next steps:"));
1076
+ console.log(import_chalk3.default.gray(" 1. Import styles in your app:"));
1077
+ console.log(import_chalk3.default.cyan(" import 'mta-design-system/styles.css';"));
1078
+ console.log(import_chalk3.default.gray(" 2. Start using components:"));
1079
+ console.log(import_chalk3.default.cyan(" import { ClaimMindButton } from 'mta-design-system';"));
1080
+ console.log(import_chalk3.default.gray(" 3. Add components to your project:"));
1081
+ console.log(import_chalk3.default.cyan(" npx mta-ds add Button"));
1082
+ console.log();
1083
+ }
1084
+ async function createTailwindConfig(projectPath) {
1085
+ const tailwindConfigPath = import_path2.default.join(projectPath, "tailwind.config.ts");
1086
+ if (import_fs_extra.default.existsSync(tailwindConfigPath)) {
1087
+ console.log(import_chalk3.default.gray(" \u2139 tailwind.config.ts already exists"));
1088
+ return;
1089
+ }
1090
+ const tailwindConfig = `import type { Config } from 'tailwindcss';
1091
+
1092
+ const config: Config = {
1093
+ content: [
1094
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
1095
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
1096
+ './src/app/**/*.{js,ts,jsx,tsx,mdx}',
1097
+ './node_modules/mta-design-system/dist/**/*.{js,mjs}',
1098
+ ],
1099
+ theme: {
1100
+ extend: {},
1101
+ },
1102
+ plugins: [],
1103
+ };
1104
+
1105
+ export default config;
1106
+ `;
1107
+ await import_fs_extra.default.writeFile(tailwindConfigPath, tailwindConfig);
1108
+ console.log(import_chalk3.default.green(" \u2713 Created tailwind.config.ts"));
1109
+ }
1110
+ async function createGlobalsCss(projectPath, componentsPath) {
1111
+ const globalsPath = import_path2.default.join(projectPath, "src", "app", "globals.css");
1112
+ if (import_fs_extra.default.existsSync(globalsPath)) {
1113
+ console.log(import_chalk3.default.gray(" \u2139 globals.css already exists"));
1114
+ return;
1115
+ }
1116
+ const globalsContent = `/* MTA Design System Styles */
1117
+ @import "mta-design-system/styles.css";
1118
+ `;
1119
+ await import_fs_extra.default.ensureDir(import_path2.default.dirname(globalsPath));
1120
+ await import_fs_extra.default.writeFile(globalsPath, globalsContent);
1121
+ console.log(import_chalk3.default.green(` \u2713 Created src/app/globals.css`));
1122
+ }
1123
+
1124
+ // cli/src/commands/add.ts
1125
+ var import_chalk4 = __toESM(require("chalk"), 1);
1126
+ var import_fs_extra2 = __toESM(require("fs-extra"), 1);
1127
+ var import_path3 = __toESM(require("path"), 1);
1128
+ var import_inquirer2 = __toESM(require("inquirer"), 1);
1129
+ async function addCommand(componentName, options) {
1130
+ const { output = "./src/components/ui", theme, overwrite = false, alias = "@/" } = options;
1131
+ const component = getComponentByName(componentName);
1132
+ if (!component) {
1133
+ console.log(import_chalk4.default.red(`
1134
+ Component "${componentName}" not found.`));
1135
+ console.log(import_chalk4.default.gray(` Run ${import_chalk4.default.cyan("mta-ds list")} to see all available components.
1136
+ `));
1137
+ process.exit(1);
1138
+ }
1139
+ console.log(import_chalk4.default.bold.cyan(`
1140
+ \u{1F4E6} Adding ${component.name}...
1141
+ `));
1142
+ let outputDir = output;
1143
+ if (component.category === "claimmind") {
1144
+ outputDir = output.replace("/ui", "/claimmind");
1145
+ } else if (component.category === "molecules") {
1146
+ outputDir = output.replace("/ui", "/claimmind/molecules");
1147
+ } else if (component.category === "pages") {
1148
+ outputDir = output.replace("/ui", "/claimmind/pages");
1149
+ }
1150
+ const packageRoot = import_path3.default.resolve(__dirname, "..", "..", "..");
1151
+ const sourcePath = import_path3.default.join(packageRoot, component.sourcePath);
1152
+ if (!import_fs_extra2.default.existsSync(sourcePath)) {
1153
+ console.log(import_chalk4.default.yellow(" \u26A0 Source file not found in package."));
1154
+ console.log(import_chalk4.default.gray(" The component is still available via import:"));
1155
+ console.log(import_chalk4.default.cyan(` import { ${component.name} } from 'mta-design-system';`));
1156
+ console.log();
1157
+ return;
1158
+ }
1159
+ const targetPath = import_path3.default.resolve(outputDir, import_path3.default.basename(component.sourcePath));
1160
+ if (import_fs_extra2.default.existsSync(targetPath) && !overwrite) {
1161
+ const { shouldOverwrite } = await import_inquirer2.default.prompt([
1162
+ {
1163
+ type: "confirm",
1164
+ name: "shouldOverwrite",
1165
+ message: `File ${targetPath} already exists. Overwrite?`,
1166
+ default: false
1167
+ }
1168
+ ]);
1169
+ if (!shouldOverwrite) {
1170
+ console.log(import_chalk4.default.gray(" Skipped."));
1171
+ return;
1172
+ }
1173
+ }
1174
+ let sourceCode = await import_fs_extra2.default.readFile(sourcePath, "utf-8");
1175
+ sourceCode = transformImports(sourceCode, alias);
1176
+ await import_fs_extra2.default.ensureDir(import_path3.default.dirname(targetPath));
1177
+ await import_fs_extra2.default.writeFile(targetPath, sourceCode);
1178
+ console.log(import_chalk4.default.green(` \u2713 Created ${import_path3.default.relative(process.cwd(), targetPath)}`));
1179
+ if (component.dependencies && component.dependencies.length > 0) {
1180
+ console.log(import_chalk4.default.white("\n Dependencies needed:"));
1181
+ for (const dep of component.dependencies) {
1182
+ console.log(import_chalk4.default.gray(` - ${dep}`));
1183
+ }
1184
+ console.log(import_chalk4.default.gray(`
1185
+ Install with: npm install ${component.dependencies.join(" ")}`));
1186
+ }
1187
+ const relativePath = import_path3.default.relative(process.cwd(), targetPath).replace(/\\/g, "/").replace(/^src\//, "@/").replace(/\.tsx$/, "");
1188
+ console.log(import_chalk4.default.white("\n Import:"));
1189
+ console.log(import_chalk4.default.cyan(` import { ${component.name} } from '${alias}components/${getComponentFolder(component)}/${import_path3.default.basename(component.sourcePath, ".tsx")}';`));
1190
+ console.log(import_chalk4.default.gray(" or"));
1191
+ console.log(import_chalk4.default.cyan(` import { ${component.name} } from 'mta-design-system';`));
1192
+ console.log();
1193
+ }
1194
+ function transformImports(sourceCode, alias) {
1195
+ return sourceCode.replace(/from\s+['"]@\/([^'"]+)['"]/g, (match, importPath) => {
1196
+ return `from '${alias}${importPath}'`;
1197
+ });
1198
+ }
1199
+ function getComponentFolder(component) {
1200
+ switch (component.category) {
1201
+ case "ui":
1202
+ return "ui";
1203
+ case "claimmind":
1204
+ return "claimmind";
1205
+ case "molecules":
1206
+ return "claimmind/molecules";
1207
+ case "pages":
1208
+ return "claimmind/pages";
1209
+ default:
1210
+ return "components";
1211
+ }
1212
+ }
1213
+
1214
+ // cli/src/index.ts
1215
+ var program = new import_commander.Command();
1216
+ program.name("mta-design-system").alias("mta-ds").description("MTA Design System CLI - Component library tools").version("0.1.0");
1217
+ program.command("list").alias("ls").description("List all available components").option("-c, --category <category>", "Filter by category (ui, claimmind, molecules, pages)").option("-j, --json", "Output as JSON").action(listCommand);
1218
+ program.command("show <component>").description("Show detailed information about a component").option("-p, --props", "Show component props").option("-e, --examples", "Show usage examples").option("-s, --source", "Show component source code").action(showCommand);
1219
+ program.command("init").description("Initialize MTA Design System in your project").option("-p, --path <path>", "Path to initialize", ".").option("-t, --theme <theme>", "Default theme (Default, Owlexa, BPJS)", "Default").option("--skip-deps", "Skip installing dependencies").action(initCommand);
1220
+ program.command("add <component>").description("Copy a component source file to your project (shadcn-style)").option("-o, --output <path>", "Output directory", "./src/components/ui").option("-t, --theme <theme>", "Theme variant for themed components (Default, Owlexa, BPJS)").option("--overwrite", "Overwrite existing files").option("-a, --alias <alias>", "Import alias to use", "@/").action(addCommand);
1221
+ program.exitOverride((err) => {
1222
+ if (err.code === "commander.help" || err.code === "commander.version") {
1223
+ process.exit(0);
1224
+ }
1225
+ if (err.code === "commander.unknownOption") {
1226
+ console.log(import_chalk5.default.yellow(`
1227
+ ${err.message}`));
1228
+ console.log(import_chalk5.default.gray(` Run ${import_chalk5.default.cyan("mta-ds --help")} for usage information.
1229
+ `));
1230
+ process.exit(1);
1231
+ }
1232
+ });
1233
+ program.parse();
1234
+ //# sourceMappingURL=index.cjs.map