@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.
Files changed (59) hide show
  1. package/dist/index.cjs +3612 -2515
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +329 -484
  4. package/dist/index.d.ts +329 -484
  5. package/dist/index.js +3602 -2513
  6. package/dist/index.js.map +1 -1
  7. package/package.json +14 -12
  8. package/src/components/accordion.tsx +56 -46
  9. package/src/components/alert-dialog.tsx +166 -109
  10. package/src/components/alert.tsx +45 -38
  11. package/src/components/aspect-ratio.tsx +7 -1
  12. package/src/components/avatar.tsx +104 -45
  13. package/src/components/badge.tsx +25 -13
  14. package/src/components/breadcrumb.tsx +76 -82
  15. package/src/components/button-group.tsx +2 -2
  16. package/src/components/button.tsx +36 -28
  17. package/src/components/calendar.tsx +35 -28
  18. package/src/components/card.tsx +83 -70
  19. package/src/components/carousel.tsx +118 -137
  20. package/src/components/chart.tsx +197 -208
  21. package/src/components/checkbox.tsx +25 -21
  22. package/src/components/collapsible.tsx +25 -3
  23. package/src/components/command.tsx +138 -105
  24. package/src/components/context-menu.tsx +215 -161
  25. package/src/components/dialog.tsx +127 -91
  26. package/src/components/drawer.tsx +102 -83
  27. package/src/components/dropdown-menu.tsx +227 -170
  28. package/src/components/form.tsx +41 -52
  29. package/src/components/hover-card.tsx +36 -19
  30. package/src/components/input-group.tsx +4 -4
  31. package/src/components/input-otp.tsx +51 -43
  32. package/src/components/input.tsx +16 -17
  33. package/src/components/kbd.tsx +1 -1
  34. package/src/components/label.tsx +16 -18
  35. package/src/components/menubar.tsx +214 -192
  36. package/src/components/navigation-menu.tsx +140 -98
  37. package/src/components/pagination.tsx +97 -87
  38. package/src/components/popover.tsx +83 -23
  39. package/src/components/progress.tsx +23 -20
  40. package/src/components/radio-group.tsx +23 -20
  41. package/src/components/resizable.tsx +39 -31
  42. package/src/components/scroll-area.tsx +51 -39
  43. package/src/components/select.tsx +161 -131
  44. package/src/components/separator.tsx +13 -14
  45. package/src/components/sheet.tsx +112 -109
  46. package/src/components/sidebar.tsx +422 -470
  47. package/src/components/skeleton.tsx +4 -6
  48. package/src/components/slider.tsx +57 -20
  49. package/src/components/sonner.tsx +19 -24
  50. package/src/components/spinner.tsx +3 -3
  51. package/src/components/switch.tsx +28 -20
  52. package/src/components/table.tsx +94 -95
  53. package/src/components/tabs.tsx +88 -50
  54. package/src/components/textarea.tsx +5 -9
  55. package/src/components/toggle-group.tsx +52 -30
  56. package/src/components/toggle.tsx +24 -20
  57. package/src/components/tooltip.tsx +46 -19
  58. package/src/globals.css +213 -96
  59. package/src/index.ts +27 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blips/ui",
3
- "version": "1.0.1",
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
- "scripts": {
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
- const Accordion = AccordionPrimitive.Root
7
+ import { cn } from "../lib/utils"
8
8
 
9
- const AccordionItem = React.forwardRef<
10
- React.ElementRef<typeof AccordionPrimitive.Item>,
11
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
12
- >(({ className, ...props }, ref) => (
13
- <AccordionPrimitive.Item
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
- const AccordionTrigger = React.forwardRef<
22
- React.ElementRef<typeof AccordionPrimitive.Trigger>,
23
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
24
- >(({ className, children, ...props }, ref) => (
25
- <AccordionPrimitive.Header className="flex">
26
- <AccordionPrimitive.Trigger
27
- ref={ref}
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
- {children}
35
- <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
36
- </AccordionPrimitive.Trigger>
37
- </AccordionPrimitive.Header>
38
- ))
39
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
24
+ />
25
+ )
26
+ }
40
27
 
41
- const AccordionContent = React.forwardRef<
42
- React.ElementRef<typeof AccordionPrimitive.Content>,
43
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
44
- >(({ className, children, ...props }, ref) => (
45
- <AccordionPrimitive.Content
46
- ref={ref}
47
- className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
48
- {...props}
49
- >
50
- <div className={cn("pb-4 pt-0", className)}>{children}</div>
51
- </AccordionPrimitive.Content>
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.displayName = AccordionPrimitive.Content.displayName
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 "@/lib/utils"
5
- import { buttonVariants } from "@/components/button"
6
+ import { cn } from "../lib/utils"
7
+ import { Button } from "./button"
6
8
 
7
- const AlertDialog = AlertDialogPrimitive.Root
9
+ function AlertDialog({
10
+ ...props
11
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
12
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
13
+ }
8
14
 
9
- const AlertDialogTrigger = AlertDialogPrimitive.Trigger
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
- const AlertDialogPortal = AlertDialogPrimitive.Portal
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
- const AlertDialogOverlay = React.forwardRef<
14
- React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
15
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
16
- >(({ className, ...props }, ref) => (
17
- <AlertDialogPrimitive.Overlay
18
- className={cn(
19
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
20
- className
21
- )}
22
- {...props}
23
- ref={ref}
24
- />
25
- ))
26
- AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
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
- const AlertDialogContent = React.forwardRef<
29
- React.ElementRef<typeof AlertDialogPrimitive.Content>,
30
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
31
- >(({ className, ...props }, ref) => (
32
- <AlertDialogPortal>
33
- <AlertDialogOverlay />
34
- <AlertDialogPrimitive.Content
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
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
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
- </AlertDialogPortal>
43
- ))
44
- AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
83
+ )
84
+ }
45
85
 
46
- const AlertDialogHeader = ({
86
+ function AlertDialogFooter({
47
87
  className,
48
88
  ...props
49
- }: React.HTMLAttributes<HTMLDivElement>) => (
50
- <div
51
- className={cn(
52
- "flex flex-col space-y-2 text-center sm:text-left",
53
- className
54
- )}
55
- {...props}
56
- />
57
- )
58
- AlertDialogHeader.displayName = "AlertDialogHeader"
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
- const AlertDialogFooter = ({
102
+ function AlertDialogTitle({
61
103
  className,
62
104
  ...props
63
- }: React.HTMLAttributes<HTMLDivElement>) => (
64
- <div
65
- className={cn(
66
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
67
- className
68
- )}
69
- {...props}
70
- />
71
- )
72
- AlertDialogFooter.displayName = "AlertDialogFooter"
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
- const AlertDialogTitle = React.forwardRef<
75
- React.ElementRef<typeof AlertDialogPrimitive.Title>,
76
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
77
- >(({ className, ...props }, ref) => (
78
- <AlertDialogPrimitive.Title
79
- ref={ref}
80
- className={cn("text-lg font-semibold", className)}
81
- {...props}
82
- />
83
- ))
84
- AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
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
- const AlertDialogDescription = React.forwardRef<
87
- React.ElementRef<typeof AlertDialogPrimitive.Description>,
88
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
89
- >(({ className, ...props }, ref) => (
90
- <AlertDialogPrimitive.Description
91
- ref={ref}
92
- className={cn("text-sm text-muted-foreground", className)}
93
- {...props}
94
- />
95
- ))
96
- AlertDialogDescription.displayName =
97
- AlertDialogPrimitive.Description.displayName
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
- const AlertDialogAction = React.forwardRef<
100
- React.ElementRef<typeof AlertDialogPrimitive.Action>,
101
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
102
- >(({ className, ...props }, ref) => (
103
- <AlertDialogPrimitive.Action
104
- ref={ref}
105
- className={cn(buttonVariants(), className)}
106
- {...props}
107
- />
108
- ))
109
- AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
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
- const AlertDialogCancel = React.forwardRef<
112
- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
113
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
114
- >(({ className, ...props }, ref) => (
115
- <AlertDialogPrimitive.Cancel
116
- ref={ref}
117
- className={cn(
118
- buttonVariants({ variant: "outline" }),
119
- "mt-2 sm:mt-0",
120
- className
121
- )}
122
- {...props}
123
- />
124
- ))
125
- AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
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
- AlertDialogPortal,
130
- AlertDialogOverlay,
131
- AlertDialogTrigger,
185
+ AlertDialogAction,
186
+ AlertDialogCancel,
132
187
  AlertDialogContent,
133
- AlertDialogHeader,
188
+ AlertDialogDescription,
134
189
  AlertDialogFooter,
190
+ AlertDialogHeader,
191
+ AlertDialogMedia,
192
+ AlertDialogOverlay,
193
+ AlertDialogPortal,
135
194
  AlertDialogTitle,
136
- AlertDialogDescription,
137
- AlertDialogAction,
138
- AlertDialogCancel,
195
+ AlertDialogTrigger,
139
196
  }
@@ -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 "@/lib/utils"
4
+ import { cn } from "../lib/utils"
5
5
 
6
6
  const alertVariants = cva(
7
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
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-background text-foreground",
11
+ default: "bg-card text-card-foreground",
12
12
  destructive:
13
- "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
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
- const Alert = React.forwardRef<
23
- HTMLDivElement,
24
- React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
25
- >(({ className, variant, ...props }, ref) => (
26
- <div
27
- ref={ref}
28
- role="alert"
29
- className={cn(alertVariants({ variant }), className)}
30
- {...props}
31
- />
32
- ))
33
- Alert.displayName = "Alert"
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
- const AlertTitle = React.forwardRef<
36
- HTMLParagraphElement,
37
- React.HTMLAttributes<HTMLHeadingElement>
38
- >(({ className, ...props }, ref) => (
39
- <h5
40
- ref={ref}
41
- className={cn("mb-1 font-medium leading-none tracking-tight", className)}
42
- {...props}
43
- />
44
- ))
45
- AlertTitle.displayName = "AlertTitle"
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
- const AlertDescription = React.forwardRef<
48
- HTMLParagraphElement,
49
- React.HTMLAttributes<HTMLParagraphElement>
50
- >(({ className, ...props }, ref) => (
51
- <div
52
- ref={ref}
53
- className={cn("text-sm [&_p]:leading-relaxed", className)}
54
- {...props}
55
- />
56
- ))
57
- AlertDescription.displayName = "AlertDescription"
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
- const AspectRatio = AspectRatioPrimitive.Root
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 }