@blips/ui 1.0.1 → 2.0.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/dist/index.cjs +3612 -2515
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +329 -484
- package/dist/index.d.ts +329 -484
- package/dist/index.js +3602 -2513
- package/dist/index.js.map +1 -1
- package/package.json +14 -12
- package/src/components/accordion.tsx +56 -46
- package/src/components/alert-dialog.tsx +166 -109
- package/src/components/alert.tsx +45 -38
- package/src/components/aspect-ratio.tsx +7 -1
- package/src/components/avatar.tsx +104 -45
- package/src/components/badge.tsx +25 -13
- package/src/components/breadcrumb.tsx +76 -82
- package/src/components/button-group.tsx +2 -2
- package/src/components/button.tsx +36 -28
- package/src/components/calendar.tsx +35 -28
- package/src/components/card.tsx +83 -70
- package/src/components/carousel.tsx +118 -137
- package/src/components/chart.tsx +197 -208
- package/src/components/checkbox.tsx +25 -21
- package/src/components/collapsible.tsx +25 -3
- package/src/components/command.tsx +138 -105
- package/src/components/context-menu.tsx +215 -161
- package/src/components/dialog.tsx +127 -91
- package/src/components/drawer.tsx +102 -83
- package/src/components/dropdown-menu.tsx +227 -170
- package/src/components/form.tsx +41 -52
- package/src/components/hover-card.tsx +36 -19
- package/src/components/input-group.tsx +4 -4
- package/src/components/input-otp.tsx +51 -43
- package/src/components/input.tsx +16 -17
- package/src/components/kbd.tsx +1 -1
- package/src/components/label.tsx +16 -18
- package/src/components/menubar.tsx +214 -192
- package/src/components/navigation-menu.tsx +140 -98
- package/src/components/pagination.tsx +97 -87
- package/src/components/popover.tsx +83 -23
- package/src/components/progress.tsx +23 -20
- package/src/components/radio-group.tsx +23 -20
- package/src/components/resizable.tsx +39 -31
- package/src/components/scroll-area.tsx +51 -39
- package/src/components/select.tsx +161 -131
- package/src/components/separator.tsx +13 -14
- package/src/components/sheet.tsx +112 -109
- package/src/components/sidebar.tsx +422 -470
- package/src/components/skeleton.tsx +4 -6
- package/src/components/slider.tsx +57 -20
- package/src/components/sonner.tsx +19 -24
- package/src/components/spinner.tsx +3 -3
- package/src/components/switch.tsx +28 -20
- package/src/components/table.tsx +94 -95
- package/src/components/tabs.tsx +88 -50
- package/src/components/textarea.tsx +5 -9
- package/src/components/toggle-group.tsx +52 -30
- package/src/components/toggle.tsx +24 -20
- package/src/components/tooltip.tsx +46 -19
- package/src/globals.css +213 -96
- package/src/index.ts +27 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blips/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Blips UI Component Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"./globals.css": "./src/globals.css",
|
|
21
|
+
"./postcss.config": "./postcss.config.mjs",
|
|
21
22
|
"./lib/utils": "./src/lib/utils.ts",
|
|
22
23
|
"./components/accordion": "./src/components/accordion.tsx",
|
|
23
24
|
"./components/alert": "./src/components/alert.tsx",
|
|
@@ -78,12 +79,21 @@
|
|
|
78
79
|
"sideEffects": [
|
|
79
80
|
"**/*.css"
|
|
80
81
|
],
|
|
82
|
+
"scripts": {
|
|
83
|
+
"build": "tsup",
|
|
84
|
+
"dev": "tsup --watch",
|
|
85
|
+
"typecheck": "tsc --noEmit",
|
|
86
|
+
"lint": "biome lint src/",
|
|
87
|
+
"clean": "rm -rf dist .turbo",
|
|
88
|
+
"registry:build": "node scripts/build-registry.js"
|
|
89
|
+
},
|
|
81
90
|
"peerDependencies": {
|
|
82
91
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
83
92
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
84
93
|
},
|
|
85
94
|
"dependencies": {
|
|
86
95
|
"@hookform/resolvers": "^5.2.2",
|
|
96
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
87
97
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
88
98
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
89
99
|
"@radix-ui/react-aspect-ratio": "^1.1.8",
|
|
@@ -116,7 +126,6 @@
|
|
|
116
126
|
"date-fns": "^4.1.0",
|
|
117
127
|
"embla-carousel-react": "^8.6.0",
|
|
118
128
|
"input-otp": "^1.4.2",
|
|
119
|
-
"lucide-react": "^0.468.0",
|
|
120
129
|
"next-themes": "^0.4.6",
|
|
121
130
|
"react-day-picker": "^9.13.0",
|
|
122
131
|
"react-hook-form": "^7.71.1",
|
|
@@ -124,6 +133,7 @@
|
|
|
124
133
|
"recharts": "2.15.4",
|
|
125
134
|
"sonner": "^2.0.7",
|
|
126
135
|
"tailwind-merge": "^2.6.0",
|
|
136
|
+
"tw-animate-css": "^1.4.0",
|
|
127
137
|
"vaul": "^1.1.2",
|
|
128
138
|
"zod": "^4.3.6"
|
|
129
139
|
},
|
|
@@ -153,13 +163,5 @@
|
|
|
153
163
|
"radix-ui",
|
|
154
164
|
"blips"
|
|
155
165
|
],
|
|
156
|
-
"license": "MIT"
|
|
157
|
-
|
|
158
|
-
"build": "tsup",
|
|
159
|
-
"dev": "tsup --watch",
|
|
160
|
-
"typecheck": "tsc --noEmit",
|
|
161
|
-
"lint": "biome lint src/",
|
|
162
|
-
"clean": "rm -rf dist .turbo",
|
|
163
|
-
"registry:build": "node scripts/build-registry.js"
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
+
"license": "MIT"
|
|
167
|
+
}
|
|
@@ -1,56 +1,66 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
4
|
+
import { CaretDown } from "@phosphor-icons/react"
|
|
2
5
|
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
3
|
-
import { ChevronDown } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { cn } from "../lib/utils"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ref={ref}
|
|
15
|
-
className={cn("border-b", className)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
))
|
|
19
|
-
AccordionItem.displayName = "AccordionItem"
|
|
9
|
+
function Accordion({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
12
|
+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />
|
|
13
|
+
}
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<AccordionPrimitive.
|
|
27
|
-
|
|
28
|
-
className={cn(
|
|
29
|
-
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
30
|
-
className
|
|
31
|
-
)}
|
|
15
|
+
function AccordionItem({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
19
|
+
return (
|
|
20
|
+
<AccordionPrimitive.Item
|
|
21
|
+
data-slot="accordion-item"
|
|
22
|
+
className={cn("border-b last:border-b-0", className)}
|
|
32
23
|
{...props}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</AccordionPrimitive.Trigger>
|
|
37
|
-
</AccordionPrimitive.Header>
|
|
38
|
-
))
|
|
39
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
className="
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
function AccordionTrigger({
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
33
|
+
return (
|
|
34
|
+
<AccordionPrimitive.Header className="flex">
|
|
35
|
+
<AccordionPrimitive.Trigger
|
|
36
|
+
data-slot="accordion-trigger"
|
|
37
|
+
className={cn(
|
|
38
|
+
"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:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
<CaretDown className="pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" />
|
|
45
|
+
</AccordionPrimitive.Trigger>
|
|
46
|
+
</AccordionPrimitive.Header>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
53
49
|
|
|
54
|
-
AccordionContent
|
|
50
|
+
function AccordionContent({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
...props
|
|
54
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
55
|
+
return (
|
|
56
|
+
<AccordionPrimitive.Content
|
|
57
|
+
data-slot="accordion-content"
|
|
58
|
+
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
62
|
+
</AccordionPrimitive.Content>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
55
65
|
|
|
56
66
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -1,139 +1,196 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
3
5
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import {
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
7
|
+
import { Button } from "./button"
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
function AlertDialog({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
13
|
+
}
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
function AlertDialogTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
+
return (
|
|
19
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
+
)
|
|
21
|
+
}
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
function AlertDialogPortal({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
+
return (
|
|
27
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
+
)
|
|
29
|
+
}
|
|
12
30
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
function AlertDialogOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<AlertDialogPrimitive.Overlay
|
|
37
|
+
data-slot="alert-dialog-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function AlertDialogContent({
|
|
48
|
+
className,
|
|
49
|
+
size = "default",
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
52
|
+
size?: "default" | "sm"
|
|
53
|
+
}) {
|
|
54
|
+
return (
|
|
55
|
+
<AlertDialogPortal>
|
|
56
|
+
<AlertDialogOverlay />
|
|
57
|
+
<AlertDialogPrimitive.Content
|
|
58
|
+
data-slot="alert-dialog-content"
|
|
59
|
+
data-size={size}
|
|
60
|
+
className={cn(
|
|
61
|
+
"group/alert-dialog-content 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 bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
</AlertDialogPortal>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
27
69
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
ref={ref}
|
|
70
|
+
function AlertDialogHeader({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<"div">) {
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
data-slot="alert-dialog-header"
|
|
36
77
|
className={cn(
|
|
37
|
-
"
|
|
78
|
+
"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
38
79
|
className
|
|
39
80
|
)}
|
|
40
81
|
{...props}
|
|
41
82
|
/>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
83
|
+
)
|
|
84
|
+
}
|
|
45
85
|
|
|
46
|
-
|
|
86
|
+
function AlertDialogFooter({
|
|
47
87
|
className,
|
|
48
88
|
...props
|
|
49
|
-
}: React.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
className
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
89
|
+
}: React.ComponentProps<"div">) {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
data-slot="alert-dialog-footer"
|
|
93
|
+
className={cn(
|
|
94
|
+
"flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
59
101
|
|
|
60
|
-
|
|
102
|
+
function AlertDialogTitle({
|
|
61
103
|
className,
|
|
62
104
|
...props
|
|
63
|
-
}: React.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
className
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
105
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
106
|
+
return (
|
|
107
|
+
<AlertDialogPrimitive.Title
|
|
108
|
+
data-slot="alert-dialog-title"
|
|
109
|
+
className={cn(
|
|
110
|
+
"text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
73
117
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
function AlertDialogDescription({
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
122
|
+
return (
|
|
123
|
+
<AlertDialogPrimitive.Description
|
|
124
|
+
data-slot="alert-dialog-description"
|
|
125
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
85
130
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
131
|
+
function AlertDialogMedia({
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}: React.ComponentProps<"div">) {
|
|
135
|
+
return (
|
|
136
|
+
<div
|
|
137
|
+
data-slot="alert-dialog-media"
|
|
138
|
+
className={cn(
|
|
139
|
+
"mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
140
|
+
className
|
|
141
|
+
)}
|
|
142
|
+
{...props}
|
|
143
|
+
/>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
98
146
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
147
|
+
function AlertDialogAction({
|
|
148
|
+
className,
|
|
149
|
+
variant = "default",
|
|
150
|
+
size = "default",
|
|
151
|
+
...props
|
|
152
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
|
|
153
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
154
|
+
return (
|
|
155
|
+
<Button variant={variant} size={size} asChild>
|
|
156
|
+
<AlertDialogPrimitive.Action
|
|
157
|
+
data-slot="alert-dialog-action"
|
|
158
|
+
className={cn(className)}
|
|
159
|
+
{...props}
|
|
160
|
+
/>
|
|
161
|
+
</Button>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
110
164
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
165
|
+
function AlertDialogCancel({
|
|
166
|
+
className,
|
|
167
|
+
variant = "outline",
|
|
168
|
+
size = "default",
|
|
169
|
+
...props
|
|
170
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
|
|
171
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
172
|
+
return (
|
|
173
|
+
<Button variant={variant} size={size} asChild>
|
|
174
|
+
<AlertDialogPrimitive.Cancel
|
|
175
|
+
data-slot="alert-dialog-cancel"
|
|
176
|
+
className={cn(className)}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
</Button>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
126
182
|
|
|
127
183
|
export {
|
|
128
184
|
AlertDialog,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
AlertDialogTrigger,
|
|
185
|
+
AlertDialogAction,
|
|
186
|
+
AlertDialogCancel,
|
|
132
187
|
AlertDialogContent,
|
|
133
|
-
|
|
188
|
+
AlertDialogDescription,
|
|
134
189
|
AlertDialogFooter,
|
|
190
|
+
AlertDialogHeader,
|
|
191
|
+
AlertDialogMedia,
|
|
192
|
+
AlertDialogOverlay,
|
|
193
|
+
AlertDialogPortal,
|
|
135
194
|
AlertDialogTitle,
|
|
136
|
-
|
|
137
|
-
AlertDialogAction,
|
|
138
|
-
AlertDialogCancel,
|
|
195
|
+
AlertDialogTrigger,
|
|
139
196
|
}
|
package/src/components/alert.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "../lib/utils"
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-lg border
|
|
7
|
+
"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",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
12
|
destructive:
|
|
13
|
-
"
|
|
13
|
+
"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
@@ -19,41 +19,48 @@ const alertVariants = cva(
|
|
|
19
19
|
}
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
function Alert({
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
data-slot="alert"
|
|
30
|
+
role="alert"
|
|
31
|
+
className={cn(alertVariants({ variant }), className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="alert-title"
|
|
41
|
+
className={cn(
|
|
42
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
function AlertDescription({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<"div">) {
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
data-slot="alert-description"
|
|
57
|
+
className={cn(
|
|
58
|
+
"col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
58
65
|
|
|
59
66
|
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
function AspectRatio({
|
|
6
|
+
...props
|
|
7
|
+
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
|
8
|
+
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
|
|
9
|
+
}
|
|
4
10
|
|
|
5
11
|
export { AspectRatio }
|