@stevederico/skateboard-ui 0.6.2 → 0.7.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.
- package/CHANGELOG.md +10 -0
- package/components.json +1 -1
- package/package.json +39 -7
- package/shadcn/ui/accordion.jsx +62 -0
- package/shadcn/ui/alert-dialog.jsx +138 -0
- package/shadcn/ui/alert.jsx +63 -0
- package/shadcn/ui/aspect-ratio.jsx +9 -0
- package/shadcn/ui/avatar.jsx +47 -0
- package/shadcn/ui/badge.jsx +44 -0
- package/shadcn/ui/breadcrumb.jsx +112 -0
- package/shadcn/ui/button.jsx +1 -1
- package/shadcn/ui/calendar.jsx +173 -0
- package/shadcn/ui/card.jsx +2 -2
- package/shadcn/ui/carousel.jsx +195 -0
- package/shadcn/ui/checkbox.jsx +28 -0
- package/shadcn/ui/collapsible.jsx +23 -0
- package/shadcn/ui/command.jsx +157 -0
- package/shadcn/ui/context-menu.jsx +222 -0
- package/shadcn/ui/dialog.jsx +137 -0
- package/shadcn/ui/drawer.jsx +134 -0
- package/shadcn/ui/dropdown-menu.jsx +223 -0
- package/shadcn/ui/hover-card.jsx +39 -0
- package/shadcn/ui/input.jsx +1 -1
- package/shadcn/ui/label.jsx +1 -1
- package/shadcn/ui/menubar.jsx +252 -0
- package/shadcn/ui/navigation-menu.jsx +152 -0
- package/shadcn/ui/pagination.jsx +118 -0
- package/shadcn/ui/popover.jsx +45 -0
- package/shadcn/ui/progress.jsx +29 -0
- package/shadcn/ui/radio-group.jsx +41 -0
- package/shadcn/ui/resizable.jsx +53 -0
- package/shadcn/ui/scroll-area.jsx +49 -0
- package/shadcn/ui/select.jsx +166 -0
- package/shadcn/ui/separator.jsx +2 -2
- package/shadcn/ui/sheet.jsx +3 -4
- package/shadcn/ui/sidebar.jsx +13 -13
- package/shadcn/ui/skeleton.jsx +1 -1
- package/shadcn/ui/slider.jsx +54 -0
- package/shadcn/ui/sonner.jsx +26 -0
- package/shadcn/ui/switch.jsx +27 -0
- package/shadcn/ui/table.jsx +123 -0
- package/shadcn/ui/tabs.jsx +60 -0
- package/shadcn/ui/textarea.jsx +20 -0
- package/shadcn/ui/toggle-group.jsx +61 -0
- package/shadcn/ui/toggle.jsx +43 -0
- package/shadcn/ui/tooltip.jsx +2 -4
package/CHANGELOG.md
CHANGED
package/components.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stevederico/skateboard-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./AppSidebar": {
|
|
@@ -65,28 +65,60 @@
|
|
|
65
65
|
"scripts": {
|
|
66
66
|
"prod": "npm publish"
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public",
|
|
70
|
+
"registry": "https://registry.npmjs.org/"
|
|
71
|
+
},
|
|
72
72
|
"repository": {
|
|
73
73
|
"type": "git",
|
|
74
74
|
"url": "git+https://github.com/stevederico/skateboard-ui.git"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
+
"@radix-ui/react-accordion": "^1.2.11",
|
|
78
|
+
"@radix-ui/react-alert-dialog": "^1.1.14",
|
|
79
|
+
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
|
80
|
+
"@radix-ui/react-avatar": "^1.1.10",
|
|
81
|
+
"@radix-ui/react-checkbox": "^1.3.2",
|
|
82
|
+
"@radix-ui/react-collapsible": "^1.1.11",
|
|
83
|
+
"@radix-ui/react-context-menu": "^2.2.15",
|
|
77
84
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
85
|
+
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
86
|
+
"@radix-ui/react-hover-card": "^1.1.14",
|
|
78
87
|
"@radix-ui/react-label": "^2.1.7",
|
|
88
|
+
"@radix-ui/react-menubar": "^1.1.15",
|
|
89
|
+
"@radix-ui/react-navigation-menu": "^1.2.13",
|
|
90
|
+
"@radix-ui/react-popover": "^1.1.14",
|
|
91
|
+
"@radix-ui/react-progress": "^1.1.7",
|
|
92
|
+
"@radix-ui/react-radio-group": "^1.3.7",
|
|
93
|
+
"@radix-ui/react-scroll-area": "^1.2.9",
|
|
94
|
+
"@radix-ui/react-select": "^2.2.5",
|
|
79
95
|
"@radix-ui/react-separator": "^1.1.7",
|
|
96
|
+
"@radix-ui/react-slider": "^1.3.5",
|
|
80
97
|
"@radix-ui/react-slot": "^1.2.3",
|
|
98
|
+
"@radix-ui/react-switch": "^1.2.5",
|
|
99
|
+
"@radix-ui/react-tabs": "^1.1.12",
|
|
100
|
+
"@radix-ui/react-toggle": "^1.1.9",
|
|
101
|
+
"@radix-ui/react-toggle-group": "^1.1.10",
|
|
81
102
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
82
103
|
"class-variance-authority": "^0.7.1",
|
|
83
|
-
"lucide-react": "^0.523.0",
|
|
84
104
|
"clsx": "^2.1.1",
|
|
105
|
+
"cmdk": "^1.1.1",
|
|
106
|
+
"date-fns": "^4.1.0",
|
|
107
|
+
"embla-carousel-react": "^8.6.0",
|
|
108
|
+
"lucide-react": "^0.537.0",
|
|
109
|
+
"next-themes": "^0.4.6",
|
|
110
|
+
"react-day-picker": "^9.8.1",
|
|
111
|
+
"react-resizable-panels": "^3.0.4",
|
|
112
|
+
"sonner": "^2.0.7",
|
|
85
113
|
"tailwind-merge": "^3.3.0",
|
|
86
|
-
"tailwindcss-animate": "^1.0.7"
|
|
114
|
+
"tailwindcss-animate": "^1.0.7",
|
|
115
|
+
"vaul": "^1.1.2"
|
|
87
116
|
},
|
|
88
117
|
"peerDependencies": {
|
|
89
118
|
"react": "^19.1.0",
|
|
90
119
|
"react-dom": "^19.1.0"
|
|
120
|
+
},
|
|
121
|
+
"overrides": {
|
|
122
|
+
"@radix-ui/react-slot": "^1.2.3"
|
|
91
123
|
}
|
|
92
124
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
6
|
+
|
|
7
|
+
function Accordion({
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function AccordionItem({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return (
|
|
18
|
+
(<AccordionPrimitive.Item
|
|
19
|
+
data-slot="accordion-item"
|
|
20
|
+
className={cn("border-b last:border-b-0", className)}
|
|
21
|
+
{...props} />)
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function AccordionTrigger({
|
|
26
|
+
className,
|
|
27
|
+
children,
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return (
|
|
31
|
+
(<AccordionPrimitive.Header className="flex">
|
|
32
|
+
<AccordionPrimitive.Trigger
|
|
33
|
+
data-slot="accordion-trigger"
|
|
34
|
+
className={cn(
|
|
35
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props}>
|
|
39
|
+
{children}
|
|
40
|
+
<ChevronDownIcon
|
|
41
|
+
className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
|
|
42
|
+
</AccordionPrimitive.Trigger>
|
|
43
|
+
</AccordionPrimitive.Header>)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function AccordionContent({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return (
|
|
53
|
+
(<AccordionPrimitive.Content
|
|
54
|
+
data-slot="accordion-content"
|
|
55
|
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
|
|
56
|
+
{...props}>
|
|
57
|
+
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
58
|
+
</AccordionPrimitive.Content>)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
7
|
+
import { buttonVariants } from "@/shadcn/ui/button"
|
|
8
|
+
|
|
9
|
+
function AlertDialog({
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function AlertDialogTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return (<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function AlertDialogPortal({
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return (<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function AlertDialogOverlay({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
return (
|
|
32
|
+
(<AlertDialogPrimitive.Overlay
|
|
33
|
+
data-slot="alert-dialog-overlay"
|
|
34
|
+
className={cn(
|
|
35
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props} />)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function AlertDialogContent({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}) {
|
|
46
|
+
return (
|
|
47
|
+
(<AlertDialogPortal>
|
|
48
|
+
<AlertDialogOverlay />
|
|
49
|
+
<AlertDialogPrimitive.Content
|
|
50
|
+
data-slot="alert-dialog-content"
|
|
51
|
+
className={cn(
|
|
52
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props} />
|
|
56
|
+
</AlertDialogPortal>)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function AlertDialogHeader({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return (
|
|
65
|
+
(<div
|
|
66
|
+
data-slot="alert-dialog-header"
|
|
67
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
68
|
+
{...props} />)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function AlertDialogFooter({
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}) {
|
|
76
|
+
return (
|
|
77
|
+
(<div
|
|
78
|
+
data-slot="alert-dialog-footer"
|
|
79
|
+
className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
|
|
80
|
+
{...props} />)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function AlertDialogTitle({
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}) {
|
|
88
|
+
return (
|
|
89
|
+
(<AlertDialogPrimitive.Title
|
|
90
|
+
data-slot="alert-dialog-title"
|
|
91
|
+
className={cn("text-lg font-semibold", className)}
|
|
92
|
+
{...props} />)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function AlertDialogDescription({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
return (
|
|
101
|
+
(<AlertDialogPrimitive.Description
|
|
102
|
+
data-slot="alert-dialog-description"
|
|
103
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
104
|
+
{...props} />)
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function AlertDialogAction({
|
|
109
|
+
className,
|
|
110
|
+
...props
|
|
111
|
+
}) {
|
|
112
|
+
return (<AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function AlertDialogCancel({
|
|
116
|
+
className,
|
|
117
|
+
...props
|
|
118
|
+
}) {
|
|
119
|
+
return (
|
|
120
|
+
(<AlertDialogPrimitive.Cancel
|
|
121
|
+
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
122
|
+
{...props} />)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
AlertDialog,
|
|
128
|
+
AlertDialogPortal,
|
|
129
|
+
AlertDialogOverlay,
|
|
130
|
+
AlertDialogTrigger,
|
|
131
|
+
AlertDialogContent,
|
|
132
|
+
AlertDialogHeader,
|
|
133
|
+
AlertDialogFooter,
|
|
134
|
+
AlertDialogTitle,
|
|
135
|
+
AlertDialogDescription,
|
|
136
|
+
AlertDialogAction,
|
|
137
|
+
AlertDialogCancel,
|
|
138
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
function Alert({
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
return (
|
|
28
|
+
(<div
|
|
29
|
+
data-slot="alert"
|
|
30
|
+
role="alert"
|
|
31
|
+
className={cn(alertVariants({ variant }), className)}
|
|
32
|
+
{...props} />)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function AlertTitle({
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return (
|
|
41
|
+
(<div
|
|
42
|
+
data-slot="alert-title"
|
|
43
|
+
className={cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)}
|
|
44
|
+
{...props} />)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function AlertDescription({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return (
|
|
53
|
+
(<div
|
|
54
|
+
data-slot="alert-description"
|
|
55
|
+
className={cn(
|
|
56
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props} />)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Avatar({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
(<AvatarPrimitive.Root
|
|
14
|
+
data-slot="avatar"
|
|
15
|
+
className={cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className)}
|
|
16
|
+
{...props} />)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function AvatarImage({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
(<AvatarPrimitive.Image
|
|
26
|
+
data-slot="avatar-image"
|
|
27
|
+
className={cn("aspect-square size-full", className)}
|
|
28
|
+
{...props} />)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function AvatarFallback({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return (
|
|
37
|
+
(<AvatarPrimitive.Fallback
|
|
38
|
+
data-slot="avatar-fallback"
|
|
39
|
+
className={cn(
|
|
40
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props} />)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
6
|
+
|
|
7
|
+
const badgeVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default:
|
|
13
|
+
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
14
|
+
secondary:
|
|
15
|
+
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
16
|
+
destructive:
|
|
17
|
+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
18
|
+
outline:
|
|
19
|
+
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
function Badge({
|
|
29
|
+
className,
|
|
30
|
+
variant,
|
|
31
|
+
asChild = false,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
const Comp = asChild ? Slot : "span"
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
(<Comp
|
|
38
|
+
data-slot="badge"
|
|
39
|
+
className={cn(badgeVariants({ variant }), className)}
|
|
40
|
+
{...props} />)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { Badge, badgeVariants }
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
6
|
+
|
|
7
|
+
function Breadcrumb({
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function BreadcrumbList({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return (
|
|
18
|
+
(<ol
|
|
19
|
+
data-slot="breadcrumb-list"
|
|
20
|
+
className={cn(
|
|
21
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props} />)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function BreadcrumbItem({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
return (
|
|
33
|
+
(<li
|
|
34
|
+
data-slot="breadcrumb-item"
|
|
35
|
+
className={cn("inline-flex items-center gap-1.5", className)}
|
|
36
|
+
{...props} />)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function BreadcrumbLink({
|
|
41
|
+
asChild,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const Comp = asChild ? Slot : "a"
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
(<Comp
|
|
49
|
+
data-slot="breadcrumb-link"
|
|
50
|
+
className={cn("hover:text-foreground transition-colors", className)}
|
|
51
|
+
{...props} />)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function BreadcrumbPage({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
return (
|
|
60
|
+
(<span
|
|
61
|
+
data-slot="breadcrumb-page"
|
|
62
|
+
role="link"
|
|
63
|
+
aria-disabled="true"
|
|
64
|
+
aria-current="page"
|
|
65
|
+
className={cn("text-foreground font-normal", className)}
|
|
66
|
+
{...props} />)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function BreadcrumbSeparator({
|
|
71
|
+
children,
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
return (
|
|
76
|
+
(<li
|
|
77
|
+
data-slot="breadcrumb-separator"
|
|
78
|
+
role="presentation"
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
className={cn("[&>svg]:size-3.5", className)}
|
|
81
|
+
{...props}>
|
|
82
|
+
{children ?? <ChevronRight />}
|
|
83
|
+
</li>)
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function BreadcrumbEllipsis({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
return (
|
|
92
|
+
(<span
|
|
93
|
+
data-slot="breadcrumb-ellipsis"
|
|
94
|
+
role="presentation"
|
|
95
|
+
aria-hidden="true"
|
|
96
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
97
|
+
{...props}>
|
|
98
|
+
<MoreHorizontal className="size-4" />
|
|
99
|
+
<span className="sr-only">More</span>
|
|
100
|
+
</span>)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
Breadcrumb,
|
|
106
|
+
BreadcrumbList,
|
|
107
|
+
BreadcrumbItem,
|
|
108
|
+
BreadcrumbLink,
|
|
109
|
+
BreadcrumbPage,
|
|
110
|
+
BreadcrumbSeparator,
|
|
111
|
+
BreadcrumbEllipsis,
|
|
112
|
+
}
|
package/shadcn/ui/button.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot"
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/shadcn/lib/utils"
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
8
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|