@melv1c/ui-kit 1.5.0 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LLM.md ADDED
@@ -0,0 +1,762 @@
1
+ # AI Component Usage Guide
2
+
3
+ This package ships reusable React components from `@melv1c/ui-kit`.
4
+
5
+ ## Setup
6
+
7
+ ```tsx
8
+ import "@melv1c/ui-kit/base.css";
9
+ ```
10
+
11
+ Optional theme:
12
+
13
+ ```tsx
14
+ import "@melv1c/ui-kit/themes/default.css";
15
+ ```
16
+
17
+ ## Base Components (`@melv1c/ui-kit`)
18
+
19
+ ### Accordion
20
+
21
+ ```tsx
22
+ import {
23
+ Accordion,
24
+ AccordionItem,
25
+ AccordionTrigger,
26
+ AccordionContent,
27
+ } from "@melv1c/ui-kit";
28
+
29
+ <Accordion type="single" collapsible>
30
+ <AccordionItem value="item-1">
31
+ <AccordionTrigger>Section</AccordionTrigger>
32
+ <AccordionContent>Content</AccordionContent>
33
+ </AccordionItem>
34
+ </Accordion>;
35
+ ```
36
+
37
+ ### Alert
38
+
39
+ ```tsx
40
+ import { Alert, AlertTitle, AlertDescription } from "@melv1c/ui-kit";
41
+
42
+ <Alert>
43
+ <AlertTitle>Heads up</AlertTitle>
44
+ <AlertDescription>Something important happened.</AlertDescription>
45
+ </Alert>;
46
+ ```
47
+
48
+ ### AlertDialog
49
+
50
+ ```tsx
51
+ import {
52
+ AlertDialog,
53
+ AlertDialogTrigger,
54
+ AlertDialogContent,
55
+ AlertDialogHeader,
56
+ AlertDialogTitle,
57
+ AlertDialogDescription,
58
+ AlertDialogFooter,
59
+ AlertDialogCancel,
60
+ AlertDialogAction,
61
+ } from "@melv1c/ui-kit";
62
+
63
+ <AlertDialog>
64
+ <AlertDialogTrigger>Delete</AlertDialogTrigger>
65
+ <AlertDialogContent>
66
+ <AlertDialogHeader>
67
+ <AlertDialogTitle>Are you sure?</AlertDialogTitle>
68
+ <AlertDialogDescription>
69
+ This action cannot be undone.
70
+ </AlertDialogDescription>
71
+ </AlertDialogHeader>
72
+ <AlertDialogFooter>
73
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
74
+ <AlertDialogAction>Continue</AlertDialogAction>
75
+ </AlertDialogFooter>
76
+ </AlertDialogContent>
77
+ </AlertDialog>;
78
+ ```
79
+
80
+ ### Avatar
81
+
82
+ ```tsx
83
+ import { Avatar, AvatarImage, AvatarFallback } from "@melv1c/ui-kit";
84
+
85
+ <Avatar>
86
+ <AvatarImage src="/avatar.png" alt="User" />
87
+ <AvatarFallback>U</AvatarFallback>
88
+ </Avatar>;
89
+ ```
90
+
91
+ ### Badge
92
+
93
+ ```tsx
94
+ import { Badge } from "@melv1c/ui-kit";
95
+
96
+ <Badge>New</Badge>;
97
+ ```
98
+
99
+ ### Breadcrumb
100
+
101
+ ```tsx
102
+ import {
103
+ Breadcrumb,
104
+ BreadcrumbList,
105
+ BreadcrumbItem,
106
+ BreadcrumbLink,
107
+ BreadcrumbSeparator,
108
+ BreadcrumbPage,
109
+ } from "@melv1c/ui-kit";
110
+
111
+ <Breadcrumb>
112
+ <BreadcrumbList>
113
+ <BreadcrumbItem>
114
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
115
+ </BreadcrumbItem>
116
+ <BreadcrumbSeparator />
117
+ <BreadcrumbItem>
118
+ <BreadcrumbPage>Settings</BreadcrumbPage>
119
+ </BreadcrumbItem>
120
+ </BreadcrumbList>
121
+ </Breadcrumb>;
122
+ ```
123
+
124
+ ### Button
125
+
126
+ ```tsx
127
+ import { Button } from "@melv1c/ui-kit";
128
+
129
+ <Button>Save</Button>;
130
+ ```
131
+
132
+ ### ButtonGroup
133
+
134
+ ```tsx
135
+ import { Button, ButtonGroup } from "@melv1c/ui-kit";
136
+
137
+ <ButtonGroup>
138
+ <Button variant="outline">Left</Button>
139
+ <Button>Right</Button>
140
+ </ButtonGroup>;
141
+ ```
142
+
143
+ ### Calendar
144
+
145
+ ```tsx
146
+ import { Calendar } from "@melv1c/ui-kit";
147
+
148
+ <Calendar mode="single" selected={new Date()} onSelect={() => {}} />;
149
+ ```
150
+
151
+ ### Card
152
+
153
+ ```tsx
154
+ import {
155
+ Card,
156
+ CardHeader,
157
+ CardTitle,
158
+ CardDescription,
159
+ CardContent,
160
+ CardFooter,
161
+ Button,
162
+ } from "@melv1c/ui-kit";
163
+
164
+ <Card>
165
+ <CardHeader>
166
+ <CardTitle>Title</CardTitle>
167
+ <CardDescription>Description</CardDescription>
168
+ </CardHeader>
169
+ <CardContent>Body</CardContent>
170
+ <CardFooter>
171
+ <Button>Action</Button>
172
+ </CardFooter>
173
+ </Card>;
174
+ ```
175
+
176
+ ### Carousel
177
+
178
+ ```tsx
179
+ import {
180
+ Carousel,
181
+ CarouselContent,
182
+ CarouselItem,
183
+ CarouselPrevious,
184
+ CarouselNext,
185
+ } from "@melv1c/ui-kit";
186
+
187
+ <Carousel>
188
+ <CarouselContent>
189
+ <CarouselItem>Slide 1</CarouselItem>
190
+ <CarouselItem>Slide 2</CarouselItem>
191
+ </CarouselContent>
192
+ <CarouselPrevious />
193
+ <CarouselNext />
194
+ </Carousel>;
195
+ ```
196
+
197
+ ### Checkbox
198
+
199
+ ```tsx
200
+ import { Checkbox } from "@melv1c/ui-kit";
201
+
202
+ <Checkbox checked />;
203
+ ```
204
+
205
+ ### Collapsible
206
+
207
+ ```tsx
208
+ import {
209
+ Collapsible,
210
+ CollapsibleTrigger,
211
+ CollapsibleContent,
212
+ } from "@melv1c/ui-kit";
213
+
214
+ <Collapsible>
215
+ <CollapsibleTrigger>Toggle</CollapsibleTrigger>
216
+ <CollapsibleContent>Hidden content</CollapsibleContent>
217
+ </Collapsible>;
218
+ ```
219
+
220
+ ### Command
221
+
222
+ ```tsx
223
+ import {
224
+ Command,
225
+ CommandInput,
226
+ CommandList,
227
+ CommandItem,
228
+ } from "@melv1c/ui-kit";
229
+
230
+ <Command>
231
+ <CommandInput placeholder="Search..." />
232
+ <CommandList>
233
+ <CommandItem>Profile</CommandItem>
234
+ </CommandList>
235
+ </Command>;
236
+ ```
237
+
238
+ ### ContextMenu
239
+
240
+ ```tsx
241
+ import {
242
+ ContextMenu,
243
+ ContextMenuTrigger,
244
+ ContextMenuContent,
245
+ ContextMenuItem,
246
+ } from "@melv1c/ui-kit";
247
+
248
+ <ContextMenu>
249
+ <ContextMenuTrigger>Right click me</ContextMenuTrigger>
250
+ <ContextMenuContent>
251
+ <ContextMenuItem>Edit</ContextMenuItem>
252
+ </ContextMenuContent>
253
+ </ContextMenu>;
254
+ ```
255
+
256
+ ### Dialog
257
+
258
+ ```tsx
259
+ import {
260
+ Dialog,
261
+ DialogTrigger,
262
+ DialogContent,
263
+ DialogHeader,
264
+ DialogTitle,
265
+ DialogDescription,
266
+ } from "@melv1c/ui-kit";
267
+
268
+ <Dialog>
269
+ <DialogTrigger>Open</DialogTrigger>
270
+ <DialogContent>
271
+ <DialogHeader>
272
+ <DialogTitle>Dialog title</DialogTitle>
273
+ <DialogDescription>Dialog body</DialogDescription>
274
+ </DialogHeader>
275
+ </DialogContent>
276
+ </Dialog>;
277
+ ```
278
+
279
+ ### Drawer
280
+
281
+ ```tsx
282
+ import {
283
+ Drawer,
284
+ DrawerTrigger,
285
+ DrawerContent,
286
+ DrawerHeader,
287
+ DrawerTitle,
288
+ } from "@melv1c/ui-kit";
289
+
290
+ <Drawer>
291
+ <DrawerTrigger>Open drawer</DrawerTrigger>
292
+ <DrawerContent>
293
+ <DrawerHeader>
294
+ <DrawerTitle>Drawer title</DrawerTitle>
295
+ </DrawerHeader>
296
+ </DrawerContent>
297
+ </Drawer>;
298
+ ```
299
+
300
+ ### DropdownMenu
301
+
302
+ ```tsx
303
+ import {
304
+ DropdownMenu,
305
+ DropdownMenuTrigger,
306
+ DropdownMenuContent,
307
+ DropdownMenuItem,
308
+ } from "@melv1c/ui-kit";
309
+
310
+ <DropdownMenu>
311
+ <DropdownMenuTrigger>Open</DropdownMenuTrigger>
312
+ <DropdownMenuContent>
313
+ <DropdownMenuItem>Profile</DropdownMenuItem>
314
+ </DropdownMenuContent>
315
+ </DropdownMenu>;
316
+ ```
317
+
318
+ ### Form
319
+
320
+ ```tsx
321
+ import {
322
+ Form,
323
+ FormField,
324
+ FormItem,
325
+ FormLabel,
326
+ FormControl,
327
+ FormMessage,
328
+ Input,
329
+ } from "@melv1c/ui-kit";
330
+
331
+ <Form {...form}>
332
+ <FormField
333
+ control={form.control}
334
+ name="email"
335
+ render={({ field }) => (
336
+ <FormItem>
337
+ <FormLabel>Email</FormLabel>
338
+ <FormControl>
339
+ <Input {...field} />
340
+ </FormControl>
341
+ <FormMessage />
342
+ </FormItem>
343
+ )}
344
+ />
345
+ </Form>;
346
+ ```
347
+
348
+ ### HoverCard
349
+
350
+ ```tsx
351
+ import { HoverCard, HoverCardTrigger, HoverCardContent } from "@melv1c/ui-kit";
352
+
353
+ <HoverCard>
354
+ <HoverCardTrigger>Hover me</HoverCardTrigger>
355
+ <HoverCardContent>More details</HoverCardContent>
356
+ </HoverCard>;
357
+ ```
358
+
359
+ ### Input
360
+
361
+ ```tsx
362
+ import { Input } from "@melv1c/ui-kit";
363
+
364
+ <Input placeholder="Type here" />;
365
+ ```
366
+
367
+ ### Label
368
+
369
+ ```tsx
370
+ import { Label, Input } from "@melv1c/ui-kit";
371
+
372
+ <div>
373
+ <Label htmlFor="email">Email</Label>
374
+ <Input id="email" />
375
+ </div>;
376
+ ```
377
+
378
+ ### Menubar
379
+
380
+ ```tsx
381
+ import {
382
+ Menubar,
383
+ MenubarMenu,
384
+ MenubarTrigger,
385
+ MenubarContent,
386
+ MenubarItem,
387
+ } from "@melv1c/ui-kit";
388
+
389
+ <Menubar>
390
+ <MenubarMenu>
391
+ <MenubarTrigger>File</MenubarTrigger>
392
+ <MenubarContent>
393
+ <MenubarItem>New</MenubarItem>
394
+ </MenubarContent>
395
+ </MenubarMenu>
396
+ </Menubar>;
397
+ ```
398
+
399
+ ### NavigationMenu
400
+
401
+ ```tsx
402
+ import {
403
+ NavigationMenu,
404
+ NavigationMenuList,
405
+ NavigationMenuItem,
406
+ NavigationMenuTrigger,
407
+ NavigationMenuContent,
408
+ } from "@melv1c/ui-kit";
409
+
410
+ <NavigationMenu>
411
+ <NavigationMenuList>
412
+ <NavigationMenuItem>
413
+ <NavigationMenuTrigger>Docs</NavigationMenuTrigger>
414
+ <NavigationMenuContent>Links</NavigationMenuContent>
415
+ </NavigationMenuItem>
416
+ </NavigationMenuList>
417
+ </NavigationMenu>;
418
+ ```
419
+
420
+ ### Pagination
421
+
422
+ ```tsx
423
+ import {
424
+ Pagination,
425
+ PaginationContent,
426
+ PaginationItem,
427
+ PaginationPrevious,
428
+ PaginationLink,
429
+ PaginationNext,
430
+ } from "@melv1c/ui-kit";
431
+
432
+ <Pagination>
433
+ <PaginationContent>
434
+ <PaginationItem>
435
+ <PaginationPrevious href="#" />
436
+ </PaginationItem>
437
+ <PaginationItem>
438
+ <PaginationLink href="#" isActive>
439
+ 1
440
+ </PaginationLink>
441
+ </PaginationItem>
442
+ <PaginationItem>
443
+ <PaginationNext href="#" />
444
+ </PaginationItem>
445
+ </PaginationContent>
446
+ </Pagination>;
447
+ ```
448
+
449
+ ### Popover
450
+
451
+ ```tsx
452
+ import { Popover, PopoverTrigger, PopoverContent } from "@melv1c/ui-kit";
453
+
454
+ <Popover>
455
+ <PopoverTrigger>Open</PopoverTrigger>
456
+ <PopoverContent>Popover content</PopoverContent>
457
+ </Popover>;
458
+ ```
459
+
460
+ ### Progress
461
+
462
+ ```tsx
463
+ import { Progress } from "@melv1c/ui-kit";
464
+
465
+ <Progress value={60} />;
466
+ ```
467
+
468
+ ### RadioGroup
469
+
470
+ ```tsx
471
+ import { RadioGroup, RadioGroupItem, Label } from "@melv1c/ui-kit";
472
+
473
+ <RadioGroup defaultValue="a">
474
+ <div>
475
+ <RadioGroupItem value="a" id="r-a" />
476
+ <Label htmlFor="r-a">Option A</Label>
477
+ </div>
478
+ </RadioGroup>;
479
+ ```
480
+
481
+ ### ScrollArea
482
+
483
+ ```tsx
484
+ import { ScrollArea } from "@melv1c/ui-kit";
485
+
486
+ <ScrollArea className="h-24">Long content...</ScrollArea>;
487
+ ```
488
+
489
+ ### Select
490
+
491
+ ```tsx
492
+ import {
493
+ Select,
494
+ SelectTrigger,
495
+ SelectValue,
496
+ SelectContent,
497
+ SelectItem,
498
+ } from "@melv1c/ui-kit";
499
+
500
+ <Select>
501
+ <SelectTrigger>
502
+ <SelectValue placeholder="Choose one" />
503
+ </SelectTrigger>
504
+ <SelectContent>
505
+ <SelectItem value="a">Option A</SelectItem>
506
+ </SelectContent>
507
+ </Select>;
508
+ ```
509
+
510
+ ### Separator
511
+
512
+ ```tsx
513
+ import { Separator } from "@melv1c/ui-kit";
514
+
515
+ <Separator />;
516
+ ```
517
+
518
+ ### Sheet
519
+
520
+ ```tsx
521
+ import {
522
+ Sheet,
523
+ SheetTrigger,
524
+ SheetContent,
525
+ SheetHeader,
526
+ SheetTitle,
527
+ } from "@melv1c/ui-kit";
528
+
529
+ <Sheet>
530
+ <SheetTrigger>Open</SheetTrigger>
531
+ <SheetContent>
532
+ <SheetHeader>
533
+ <SheetTitle>Sheet title</SheetTitle>
534
+ </SheetHeader>
535
+ </SheetContent>
536
+ </Sheet>;
537
+ ```
538
+
539
+ ### Sidebar
540
+
541
+ ```tsx
542
+ import {
543
+ SidebarProvider,
544
+ Sidebar,
545
+ SidebarContent,
546
+ SidebarMenu,
547
+ SidebarMenuItem,
548
+ SidebarMenuButton,
549
+ } from "@melv1c/ui-kit";
550
+
551
+ <SidebarProvider>
552
+ <Sidebar>
553
+ <SidebarContent>
554
+ <SidebarMenu>
555
+ <SidebarMenuItem>
556
+ <SidebarMenuButton>Dashboard</SidebarMenuButton>
557
+ </SidebarMenuItem>
558
+ </SidebarMenu>
559
+ </SidebarContent>
560
+ </Sidebar>
561
+ </SidebarProvider>;
562
+ ```
563
+
564
+ ### Skeleton
565
+
566
+ ```tsx
567
+ import { Skeleton } from "@melv1c/ui-kit";
568
+
569
+ <Skeleton className="h-4 w-40" />;
570
+ ```
571
+
572
+ ### Slider
573
+
574
+ ```tsx
575
+ import { Slider } from "@melv1c/ui-kit";
576
+
577
+ <Slider defaultValue={[50]} max={100} step={1} />;
578
+ ```
579
+
580
+ ### Sonner
581
+
582
+ ```tsx
583
+ import { Toaster } from "@melv1c/ui-kit";
584
+
585
+ <Toaster />;
586
+ ```
587
+
588
+ ### Switch
589
+
590
+ ```tsx
591
+ import { Switch } from "@melv1c/ui-kit";
592
+
593
+ <Switch defaultChecked />;
594
+ ```
595
+
596
+ ### Table
597
+
598
+ ```tsx
599
+ import {
600
+ Table,
601
+ TableHeader,
602
+ TableRow,
603
+ TableHead,
604
+ TableBody,
605
+ TableCell,
606
+ } from "@melv1c/ui-kit";
607
+
608
+ <Table>
609
+ <TableHeader>
610
+ <TableRow>
611
+ <TableHead>Name</TableHead>
612
+ </TableRow>
613
+ </TableHeader>
614
+ <TableBody>
615
+ <TableRow>
616
+ <TableCell>Alice</TableCell>
617
+ </TableRow>
618
+ </TableBody>
619
+ </Table>;
620
+ ```
621
+
622
+ ### Tabs
623
+
624
+ ```tsx
625
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from "@melv1c/ui-kit";
626
+
627
+ <Tabs defaultValue="account">
628
+ <TabsList>
629
+ <TabsTrigger value="account">Account</TabsTrigger>
630
+ <TabsTrigger value="security">Security</TabsTrigger>
631
+ </TabsList>
632
+ <TabsContent value="account">Account content</TabsContent>
633
+ <TabsContent value="security">Security content</TabsContent>
634
+ </Tabs>;
635
+ ```
636
+
637
+ ### Textarea
638
+
639
+ ```tsx
640
+ import { Textarea } from "@melv1c/ui-kit";
641
+
642
+ <Textarea placeholder="Write a message" />;
643
+ ```
644
+
645
+ ### Toggle
646
+
647
+ ```tsx
648
+ import { Toggle } from "@melv1c/ui-kit";
649
+
650
+ <Toggle aria-label="Toggle">B</Toggle>;
651
+ ```
652
+
653
+ ### ToggleGroup
654
+
655
+ ```tsx
656
+ import { ToggleGroup, ToggleGroupItem } from "@melv1c/ui-kit";
657
+
658
+ <ToggleGroup type="multiple">
659
+ <ToggleGroupItem value="bold">B</ToggleGroupItem>
660
+ <ToggleGroupItem value="italic">I</ToggleGroupItem>
661
+ </ToggleGroup>;
662
+ ```
663
+
664
+ ### Tooltip
665
+
666
+ ```tsx
667
+ import {
668
+ TooltipProvider,
669
+ Tooltip,
670
+ TooltipTrigger,
671
+ TooltipContent,
672
+ } from "@melv1c/ui-kit";
673
+
674
+ <TooltipProvider>
675
+ <Tooltip>
676
+ <TooltipTrigger>Hover</TooltipTrigger>
677
+ <TooltipContent>Tooltip text</TooltipContent>
678
+ </Tooltip>
679
+ </TooltipProvider>;
680
+ ```
681
+
682
+ ## Blocks (`@melv1c/ui-kit`)
683
+
684
+ ### LoginForm
685
+
686
+ ```tsx
687
+ import { LoginForm } from "@melv1c/ui-kit";
688
+
689
+ <LoginForm onSubmit={async (values) => console.log(values)} />;
690
+ ```
691
+
692
+ ## Custom (`@melv1c/ui-kit`)
693
+
694
+ ### NextButton and PreviousButton
695
+
696
+ ```tsx
697
+ import { NextButton, PreviousButton } from "@melv1c/ui-kit";
698
+
699
+ <div className="flex gap-2">
700
+ <PreviousButton variant="outline" />
701
+ <NextButton />
702
+ </div>;
703
+ ```
704
+
705
+ ### DateTimePicker
706
+
707
+ ```tsx
708
+ import { DateTimePicker } from "@melv1c/ui-kit";
709
+
710
+ <DateTimePicker value={new Date()} onChange={() => {}} />;
711
+ ```
712
+
713
+ ## Icons (`@melv1c/ui-kit`)
714
+
715
+ ```tsx
716
+ import {
717
+ AppleIcon,
718
+ FacebookIcon,
719
+ GithubIcon,
720
+ GoogleIcon,
721
+ MicrosoftIcon,
722
+ } from "@melv1c/ui-kit";
723
+
724
+ <div className="flex gap-2">
725
+ <AppleIcon />
726
+ <FacebookIcon />
727
+ <GithubIcon />
728
+ <GoogleIcon />
729
+ <MicrosoftIcon />
730
+ </div>;
731
+ ```
732
+
733
+ ## Provider (`@melv1c/ui-kit`)
734
+
735
+ ```tsx
736
+ import { UIKitProvider } from "@melv1c/ui-kit";
737
+
738
+ <UIKitProvider>{/* app */}</UIKitProvider>;
739
+ ```
740
+
741
+ ## Optional Entrypoints
742
+
743
+ ### Code Editors (`@melv1c/ui-kit/code-editors`)
744
+
745
+ ```tsx
746
+ import { CodeEditor, CodeDiffEditor } from "@melv1c/ui-kit/code-editors";
747
+
748
+ <CodeEditor language="typescript" value={"const x = 1;"} onChange={() => {}} />;
749
+ <CodeDiffEditor
750
+ original="const x = 1;"
751
+ modified="const x = 2;"
752
+ language="typescript"
753
+ />;
754
+ ```
755
+
756
+ ### Rich Text Editor (`@melv1c/ui-kit/rich-text-editor`)
757
+
758
+ ```tsx
759
+ import { RichTextEditor } from "@melv1c/ui-kit/rich-text-editor";
760
+
761
+ <RichTextEditor content="<p>Hello</p>" onChange={() => {}} />;
762
+ ```