@zabuti/components-mcp 0.0.0-stage → 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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -2
  3. package/dist/index.js +527 -0
  4. package/dist/project-setup.js +424 -0
  5. package/dist/registry.js +73 -0
  6. package/dist/source.js +19 -0
  7. package/package.json +41 -4
  8. package/payload/registry.json +801 -0
  9. package/payload/src/components/ui/accordion.tsx +75 -0
  10. package/payload/src/components/ui/alert-dialog.tsx +151 -0
  11. package/payload/src/components/ui/alert.tsx +69 -0
  12. package/payload/src/components/ui/avatar.tsx +59 -0
  13. package/payload/src/components/ui/badge.tsx +57 -0
  14. package/payload/src/components/ui/breadcrumb.tsx +109 -0
  15. package/payload/src/components/ui/button.tsx +76 -0
  16. package/payload/src/components/ui/calendar.tsx +117 -0
  17. package/payload/src/components/ui/card.tsx +120 -0
  18. package/payload/src/components/ui/chart.tsx +249 -0
  19. package/payload/src/components/ui/checkbox.tsx +38 -0
  20. package/payload/src/components/ui/collapsible.tsx +30 -0
  21. package/payload/src/components/ui/combobox.tsx +127 -0
  22. package/payload/src/components/ui/command.tsx +186 -0
  23. package/payload/src/components/ui/context-menu.tsx +261 -0
  24. package/payload/src/components/ui/date-picker.tsx +140 -0
  25. package/payload/src/components/ui/dialog.tsx +176 -0
  26. package/payload/src/components/ui/dropdown-menu.tsx +277 -0
  27. package/payload/src/components/ui/form.tsx +151 -0
  28. package/payload/src/components/ui/hover-card.tsx +46 -0
  29. package/payload/src/components/ui/input-group.tsx +127 -0
  30. package/payload/src/components/ui/input.tsx +25 -0
  31. package/payload/src/components/ui/label.tsx +28 -0
  32. package/payload/src/components/ui/pagination.tsx +130 -0
  33. package/payload/src/components/ui/popover.tsx +97 -0
  34. package/payload/src/components/ui/progress.tsx +35 -0
  35. package/payload/src/components/ui/radio-group.tsx +49 -0
  36. package/payload/src/components/ui/scroll-area.tsx +67 -0
  37. package/payload/src/components/ui/select.tsx +199 -0
  38. package/payload/src/components/ui/separator.tsx +32 -0
  39. package/payload/src/components/ui/sheet.tsx +155 -0
  40. package/payload/src/components/ui/skeleton.tsx +21 -0
  41. package/payload/src/components/ui/slider.tsx +61 -0
  42. package/payload/src/components/ui/sonner.tsx +31 -0
  43. package/payload/src/components/ui/switch.tsx +40 -0
  44. package/payload/src/components/ui/table.tsx +108 -0
  45. package/payload/src/components/ui/tabs.tsx +98 -0
  46. package/payload/src/components/ui/textarea.tsx +24 -0
  47. package/payload/src/components/ui/toggle-group.tsx +72 -0
  48. package/payload/src/components/ui/toggle.tsx +54 -0
  49. package/payload/src/components/ui/tooltip.tsx +65 -0
  50. package/payload/src/lib/utils.ts +1 -0
  51. package/payload/src/themes/manifest.json +12 -0
  52. package/payload/src/themes/zabuti-ui-sky.css +14 -0
  53. package/payload/src/themes/zabuti-ui-teal.css +14 -0
  54. package/payload/src/zabuti-ui.css +272 -0
@@ -0,0 +1,75 @@
1
+ "use client"
2
+
3
+ /**
4
+ * Accordion — Zabuti UI primitive.
5
+ *
6
+ * Radix Accordion + Tailwind over the `zabuti-ui.css` token layer, lucide
7
+ * chevron indicator. Zabuti-owned, no shadcn dependency; Radix is the
8
+ * behavioural base only.
9
+ *
10
+ * Needs the `accordion-down` / `accordion-up` keyframes + `--animate-accordion-*`
11
+ * declared in `zabuti-ui.css`.
12
+ */
13
+ import * as React from "react"
14
+ import { ChevronDownIcon } from "lucide-react"
15
+ import { cn } from "cn"
16
+ import { Accordion as AccordionPrimitive } from "radix-ui"
17
+
18
+ function Accordion({
19
+ ...props
20
+ }: React.ComponentProps<typeof AccordionPrimitive.Root>) {
21
+ return <AccordionPrimitive.Root data-slot="accordion" {...props} />
22
+ }
23
+
24
+ function AccordionItem({
25
+ className,
26
+ ...props
27
+ }: React.ComponentProps<typeof AccordionPrimitive.Item>) {
28
+ return (
29
+ <AccordionPrimitive.Item
30
+ data-slot="accordion-item"
31
+ className={cn("border-b border-border last:border-b-0", className)}
32
+ {...props}
33
+ />
34
+ )
35
+ }
36
+
37
+ function AccordionTrigger({
38
+ className,
39
+ children,
40
+ ...props
41
+ }: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
42
+ return (
43
+ <AccordionPrimitive.Header className="flex">
44
+ <AccordionPrimitive.Trigger
45
+ data-slot="accordion-trigger"
46
+ className={cn(
47
+ "flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium text-foreground transition-all outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
48
+ className
49
+ )}
50
+ {...props}
51
+ >
52
+ {children}
53
+ <ChevronDownIcon className="pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" />
54
+ </AccordionPrimitive.Trigger>
55
+ </AccordionPrimitive.Header>
56
+ )
57
+ }
58
+
59
+ function AccordionContent({
60
+ className,
61
+ children,
62
+ ...props
63
+ }: React.ComponentProps<typeof AccordionPrimitive.Content>) {
64
+ return (
65
+ <AccordionPrimitive.Content
66
+ data-slot="accordion-content"
67
+ className="overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
68
+ {...props}
69
+ >
70
+ <div className={cn("pt-0 pb-4 leading-relaxed", className)}>{children}</div>
71
+ </AccordionPrimitive.Content>
72
+ )
73
+ }
74
+
75
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -0,0 +1,151 @@
1
+ "use client"
2
+
3
+ /**
4
+ * Alert Dialog — Zabuti UI primitive.
5
+ *
6
+ * Radix AlertDialog + Tailwind over the `zabuti-ui.css` token layer — a modal
7
+ * that interrupts for a confirm / cancel decision (no dismiss-on-outside, no
8
+ * close X). Zabuti-owned, no shadcn dependency; Radix is the behavioural base
9
+ * only. `AlertDialogAction` / `AlertDialogCancel` reuse the Button primitive's
10
+ * `buttonVariants`.
11
+ */
12
+ import * as React from "react"
13
+ import { cn } from "cn"
14
+ import { AlertDialog as AlertDialogPrimitive } from "radix-ui"
15
+
16
+ import { buttonVariants } from "@/components/ui/button"
17
+
18
+ function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
19
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
20
+ }
21
+
22
+ function AlertDialogTrigger({
23
+ ...props
24
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
25
+ return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
26
+ }
27
+
28
+ function AlertDialogPortal({
29
+ ...props
30
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
31
+ return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
32
+ }
33
+
34
+ function AlertDialogOverlay({
35
+ className,
36
+ ...props
37
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
38
+ return (
39
+ <AlertDialogPrimitive.Overlay
40
+ data-slot="alert-dialog-overlay"
41
+ className={cn(
42
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
43
+ className
44
+ )}
45
+ {...props}
46
+ />
47
+ )
48
+ }
49
+
50
+ function AlertDialogContent({
51
+ className,
52
+ ...props
53
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
54
+ return (
55
+ <AlertDialogPortal>
56
+ <AlertDialogOverlay />
57
+ <AlertDialogPrimitive.Content
58
+ data-slot="alert-dialog-content"
59
+ className={cn(
60
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ </AlertDialogPortal>
66
+ )
67
+ }
68
+
69
+ function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">) {
70
+ return (
71
+ <div
72
+ data-slot="alert-dialog-header"
73
+ className={cn("flex flex-col gap-2", className)}
74
+ {...props}
75
+ />
76
+ )
77
+ }
78
+
79
+ function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) {
80
+ return (
81
+ <div
82
+ data-slot="alert-dialog-footer"
83
+ className={cn(
84
+ "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
85
+ className
86
+ )}
87
+ {...props}
88
+ />
89
+ )
90
+ }
91
+
92
+ function AlertDialogTitle({
93
+ className,
94
+ ...props
95
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
96
+ return (
97
+ <AlertDialogPrimitive.Title
98
+ data-slot="alert-dialog-title"
99
+ className={cn("font-heading text-base leading-none font-medium", className)}
100
+ {...props}
101
+ />
102
+ )
103
+ }
104
+
105
+ function AlertDialogDescription({
106
+ className,
107
+ ...props
108
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
109
+ return (
110
+ <AlertDialogPrimitive.Description
111
+ data-slot="alert-dialog-description"
112
+ className={cn("text-sm text-muted-foreground", className)}
113
+ {...props}
114
+ />
115
+ )
116
+ }
117
+
118
+ function AlertDialogAction({
119
+ className,
120
+ ...props
121
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
122
+ return (
123
+ <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />
124
+ )
125
+ }
126
+
127
+ function AlertDialogCancel({
128
+ className,
129
+ ...props
130
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
131
+ return (
132
+ <AlertDialogPrimitive.Cancel
133
+ className={cn(buttonVariants({ variant: "outline" }), className)}
134
+ {...props}
135
+ />
136
+ )
137
+ }
138
+
139
+ export {
140
+ AlertDialog,
141
+ AlertDialogTrigger,
142
+ AlertDialogPortal,
143
+ AlertDialogOverlay,
144
+ AlertDialogContent,
145
+ AlertDialogHeader,
146
+ AlertDialogFooter,
147
+ AlertDialogTitle,
148
+ AlertDialogDescription,
149
+ AlertDialogAction,
150
+ AlertDialogCancel,
151
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Alert — Zabuti UI primitive.
3
+ *
4
+ * A static, inline callout (`role="alert"`) + `class-variance-authority` over
5
+ * the `zabuti-ui.css` token layer. No hooks, server-safe. Zabuti-owned, no
6
+ * shadcn dependency. For transient notifications use the `sonner` primitive.
7
+ *
8
+ * Local surface: `variant` (`default` / `destructive`); an optional leading icon
9
+ * is laid out via a grid when present.
10
+ */
11
+ import * as React from "react"
12
+ import { cva, type VariantProps } from "class-variance-authority"
13
+ import { cn } from "cn"
14
+
15
+ const alertVariants = cva(
16
+ "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
17
+ {
18
+ variants: {
19
+ variant: {
20
+ default: "bg-card text-card-foreground",
21
+ destructive:
22
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ variant: "default",
27
+ },
28
+ }
29
+ )
30
+
31
+ function Alert({
32
+ className,
33
+ variant,
34
+ ...props
35
+ }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
36
+ return (
37
+ <div
38
+ data-slot="alert"
39
+ role="alert"
40
+ className={cn(alertVariants({ variant }), className)}
41
+ {...props}
42
+ />
43
+ )
44
+ }
45
+
46
+ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
47
+ return (
48
+ <div
49
+ data-slot="alert-title"
50
+ className={cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)}
51
+ {...props}
52
+ />
53
+ )
54
+ }
55
+
56
+ function AlertDescription({ className, ...props }: React.ComponentProps<"div">) {
57
+ return (
58
+ <div
59
+ data-slot="alert-description"
60
+ className={cn(
61
+ "col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",
62
+ className
63
+ )}
64
+ {...props}
65
+ />
66
+ )
67
+ }
68
+
69
+ export { Alert, AlertTitle, AlertDescription, alertVariants }
@@ -0,0 +1,59 @@
1
+ "use client"
2
+
3
+ /**
4
+ * Avatar — Zabuti UI primitive.
5
+ *
6
+ * Radix Avatar + Tailwind over the `zabuti-ui.css` token layer — an image that
7
+ * falls back to initials / a glyph while loading or on error. Zabuti-owned, no
8
+ * shadcn dependency; Radix is the behavioural base only.
9
+ */
10
+ import * as React from "react"
11
+ import { cn } from "cn"
12
+ import { Avatar as AvatarPrimitive } from "radix-ui"
13
+
14
+ function Avatar({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
18
+ return (
19
+ <AvatarPrimitive.Root
20
+ data-slot="avatar"
21
+ className={cn(
22
+ "relative flex size-8 shrink-0 overflow-hidden rounded-full",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ function AvatarImage({
31
+ className,
32
+ ...props
33
+ }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
34
+ return (
35
+ <AvatarPrimitive.Image
36
+ data-slot="avatar-image"
37
+ className={cn("aspect-square size-full", className)}
38
+ {...props}
39
+ />
40
+ )
41
+ }
42
+
43
+ function AvatarFallback({
44
+ className,
45
+ ...props
46
+ }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
47
+ return (
48
+ <AvatarPrimitive.Fallback
49
+ data-slot="avatar-fallback"
50
+ className={cn(
51
+ "flex size-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",
52
+ className
53
+ )}
54
+ {...props}
55
+ />
56
+ )
57
+ }
58
+
59
+ export { Avatar, AvatarImage, AvatarFallback }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Badge — Zabuti UI primitive.
3
+ *
4
+ * `class-variance-authority` variants over the `zabuti-ui.css` token layer,
5
+ * `asChild` via Radix `Slot`. Zabuti-owned, no shadcn dependency. Server-safe.
6
+ *
7
+ * Local surface: `ghost` and `link` variants beyond the stock set; `data-icon`
8
+ * slot padding for a leading/trailing glyph.
9
+ */
10
+ import * as React from "react"
11
+ import { cva, type VariantProps } from "class-variance-authority"
12
+ import { cn } from "cn"
13
+ import { Slot } from "radix-ui"
14
+
15
+ const badgeVariants = cva(
16
+ "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
17
+ {
18
+ variants: {
19
+ variant: {
20
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
21
+ secondary:
22
+ "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
23
+ destructive:
24
+ "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
25
+ outline:
26
+ "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
27
+ ghost:
28
+ "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
29
+ link: "text-primary underline-offset-4 hover:underline",
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ },
35
+ }
36
+ )
37
+
38
+ function Badge({
39
+ className,
40
+ variant = "default",
41
+ asChild = false,
42
+ ...props
43
+ }: React.ComponentProps<"span"> &
44
+ VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
45
+ const Comp = asChild ? Slot.Root : "span"
46
+
47
+ return (
48
+ <Comp
49
+ data-slot="badge"
50
+ data-variant={variant}
51
+ className={cn(badgeVariants({ variant }), className)}
52
+ {...props}
53
+ />
54
+ )
55
+ }
56
+
57
+ export { Badge, badgeVariants }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Breadcrumb — Zabuti UI primitive.
3
+ *
4
+ * Semantic `<nav>` / `<ol>` breadcrumb trail + Tailwind over the `zabuti-ui.css`
5
+ * token layer, with a `Slot`-based link so the caller supplies their own router
6
+ * anchor. No hooks, server-safe. Zabuti-owned, no shadcn dependency.
7
+ */
8
+ import * as React from "react"
9
+ import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
10
+ import { cn } from "cn"
11
+ import { Slot } from "radix-ui"
12
+
13
+ function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
14
+ return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
15
+ }
16
+
17
+ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
18
+ return (
19
+ <ol
20
+ data-slot="breadcrumb-list"
21
+ className={cn(
22
+ "flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
31
+ return (
32
+ <li
33
+ data-slot="breadcrumb-item"
34
+ className={cn("inline-flex items-center gap-1.5", className)}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function BreadcrumbLink({
41
+ asChild,
42
+ className,
43
+ ...props
44
+ }: React.ComponentProps<"a"> & { asChild?: boolean }) {
45
+ const Comp = asChild ? Slot.Root : "a"
46
+ return (
47
+ <Comp
48
+ data-slot="breadcrumb-link"
49
+ className={cn("transition-colors hover:text-foreground", className)}
50
+ {...props}
51
+ />
52
+ )
53
+ }
54
+
55
+ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
56
+ return (
57
+ <span
58
+ data-slot="breadcrumb-page"
59
+ role="link"
60
+ aria-disabled="true"
61
+ aria-current="page"
62
+ className={cn("font-normal text-foreground", className)}
63
+ {...props}
64
+ />
65
+ )
66
+ }
67
+
68
+ function BreadcrumbSeparator({
69
+ children,
70
+ className,
71
+ ...props
72
+ }: React.ComponentProps<"li">) {
73
+ return (
74
+ <li
75
+ data-slot="breadcrumb-separator"
76
+ role="presentation"
77
+ aria-hidden="true"
78
+ className={cn("[&>svg]:size-3.5", className)}
79
+ {...props}
80
+ >
81
+ {children ?? <ChevronRightIcon />}
82
+ </li>
83
+ )
84
+ }
85
+
86
+ function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">) {
87
+ return (
88
+ <span
89
+ data-slot="breadcrumb-ellipsis"
90
+ role="presentation"
91
+ aria-hidden="true"
92
+ className={cn("flex size-9 items-center justify-center", className)}
93
+ {...props}
94
+ >
95
+ <MoreHorizontalIcon className="size-4" />
96
+ <span className="sr-only">More</span>
97
+ </span>
98
+ )
99
+ }
100
+
101
+ export {
102
+ Breadcrumb,
103
+ BreadcrumbList,
104
+ BreadcrumbItem,
105
+ BreadcrumbLink,
106
+ BreadcrumbPage,
107
+ BreadcrumbSeparator,
108
+ BreadcrumbEllipsis,
109
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Button — Zabuti UI primitive.
3
+ *
4
+ * Radix `Slot` for `asChild` + `class-variance-authority` variants over the
5
+ * `zabuti-ui.css` token layer. Zabuti-owned, no shadcn dependency; Radix is the
6
+ * behavioural base only. Server-safe (Slot pulls in no client runtime).
7
+ *
8
+ * Local surface beyond a stock button: `outline` / `ghost` / `link` variants,
9
+ * `xs` and `icon-*` sizes, `data-icon` leading/trailing glyph padding.
10
+ */
11
+ import * as React from "react"
12
+ import { cva, type VariantProps } from "class-variance-authority"
13
+ import { cn } from "cn"
14
+ import { Slot } from "radix-ui"
15
+
16
+ const buttonVariants = cva(
17
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
18
+ {
19
+ variants: {
20
+ variant: {
21
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
22
+ outline:
23
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
24
+ secondary:
25
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
26
+ ghost:
27
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
28
+ destructive:
29
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
30
+ link: "text-primary underline-offset-4 hover:underline",
31
+ },
32
+ size: {
33
+ default:
34
+ "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
35
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
36
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
37
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
38
+ icon: "size-8",
39
+ "icon-xs":
40
+ "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
41
+ "icon-sm":
42
+ "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
43
+ "icon-lg": "size-9",
44
+ },
45
+ },
46
+ defaultVariants: {
47
+ variant: "default",
48
+ size: "default",
49
+ },
50
+ }
51
+ )
52
+
53
+ function Button({
54
+ className,
55
+ variant = "default",
56
+ size = "default",
57
+ asChild = false,
58
+ ...props
59
+ }: React.ComponentProps<"button"> &
60
+ VariantProps<typeof buttonVariants> & {
61
+ asChild?: boolean
62
+ }) {
63
+ const Comp = asChild ? Slot.Root : "button"
64
+
65
+ return (
66
+ <Comp
67
+ data-slot="button"
68
+ data-variant={variant}
69
+ data-size={size}
70
+ className={cn(buttonVariants({ variant, size, className }))}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ export { Button, buttonVariants }