@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/src/components/sheet.tsx
CHANGED
|
@@ -1,135 +1,138 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
+
import { X } from "@phosphor-icons/react"
|
|
4
5
|
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
-
import { X } from "lucide-react"
|
|
7
6
|
|
|
8
|
-
import { cn } from "
|
|
7
|
+
import { cn } from "../lib/utils"
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
|
+
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
function SheetTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
16
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
|
+
}
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
function SheetClose({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
22
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
23
|
+
}
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
function SheetPortal({
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
28
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
29
|
+
}
|
|
17
30
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
className
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
function SheetOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<SheetPrimitive.Overlay
|
|
37
|
+
data-slot="sheet-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
|
+
}
|
|
32
46
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
function SheetContent({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
side = "right",
|
|
51
|
+
showCloseButton = true,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
54
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
55
|
+
showCloseButton?: boolean
|
|
56
|
+
}) {
|
|
57
|
+
return (
|
|
58
|
+
<SheetPortal>
|
|
59
|
+
<SheetOverlay />
|
|
60
|
+
<SheetPrimitive.Content
|
|
61
|
+
data-slot="sheet-content"
|
|
62
|
+
className={cn(
|
|
63
|
+
"fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
64
|
+
side === "right" &&
|
|
65
|
+
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
66
|
+
side === "left" &&
|
|
67
|
+
"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
68
|
+
side === "top" &&
|
|
69
|
+
"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
70
|
+
side === "bottom" &&
|
|
71
|
+
"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
72
|
+
className
|
|
73
|
+
)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
{children}
|
|
77
|
+
{showCloseButton && (
|
|
78
|
+
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
79
|
+
<X className="size-4" />
|
|
80
|
+
<span className="sr-only">Close</span>
|
|
81
|
+
</SheetPrimitive.Close>
|
|
82
|
+
)}
|
|
83
|
+
</SheetPrimitive.Content>
|
|
84
|
+
</SheetPortal>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
51
87
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
88
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
89
|
+
return (
|
|
90
|
+
<div
|
|
91
|
+
data-slot="sheet-header"
|
|
92
|
+
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
55
97
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<SheetOverlay />
|
|
62
|
-
<SheetPrimitive.Content
|
|
63
|
-
ref={ref}
|
|
64
|
-
className={cn(sheetVariants({ side }), className)}
|
|
98
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
99
|
+
return (
|
|
100
|
+
<div
|
|
101
|
+
data-slot="sheet-footer"
|
|
102
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
65
103
|
{...props}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<X className="h-4 w-4" />
|
|
70
|
-
<span className="sr-only">Close</span>
|
|
71
|
-
</SheetPrimitive.Close>
|
|
72
|
-
</SheetPrimitive.Content>
|
|
73
|
-
</SheetPortal>
|
|
74
|
-
))
|
|
75
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
76
107
|
|
|
77
|
-
|
|
108
|
+
function SheetTitle({
|
|
78
109
|
className,
|
|
79
110
|
...props
|
|
80
|
-
}: React.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
className
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
SheetHeader.displayName = "SheetHeader"
|
|
111
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
112
|
+
return (
|
|
113
|
+
<SheetPrimitive.Title
|
|
114
|
+
data-slot="sheet-title"
|
|
115
|
+
className={cn("font-semibold text-foreground", className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
90
120
|
|
|
91
|
-
|
|
121
|
+
function SheetDescription({
|
|
92
122
|
className,
|
|
93
123
|
...props
|
|
94
|
-
}: React.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
className
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
SheetFooter.displayName = "SheetFooter"
|
|
104
|
-
|
|
105
|
-
const SheetTitle = React.forwardRef<
|
|
106
|
-
React.ElementRef<typeof SheetPrimitive.Title>,
|
|
107
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
|
|
108
|
-
>(({ className, ...props }, ref) => (
|
|
109
|
-
<SheetPrimitive.Title
|
|
110
|
-
ref={ref}
|
|
111
|
-
className={cn("text-lg font-semibold text-foreground", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
))
|
|
115
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName
|
|
116
|
-
|
|
117
|
-
const SheetDescription = React.forwardRef<
|
|
118
|
-
React.ElementRef<typeof SheetPrimitive.Description>,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
|
|
120
|
-
>(({ className, ...props }, ref) => (
|
|
121
|
-
<SheetPrimitive.Description
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
))
|
|
127
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|
124
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
125
|
+
return (
|
|
126
|
+
<SheetPrimitive.Description
|
|
127
|
+
data-slot="sheet-description"
|
|
128
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
128
133
|
|
|
129
134
|
export {
|
|
130
135
|
Sheet,
|
|
131
|
-
SheetPortal,
|
|
132
|
-
SheetOverlay,
|
|
133
136
|
SheetTrigger,
|
|
134
137
|
SheetClose,
|
|
135
138
|
SheetContent,
|