@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
|
@@ -1,31 +1,58 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
|
-
import type { DialogProps } from "@radix-ui/react-dialog"
|
|
3
4
|
import { Command as CommandPrimitive } from "cmdk"
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { cn } from "
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
import { MagnifyingGlass } from "@phosphor-icons/react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../lib/utils"
|
|
8
|
+
import {
|
|
9
|
+
Dialog,
|
|
10
|
+
DialogContent,
|
|
11
|
+
DialogDescription,
|
|
12
|
+
DialogHeader,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
} from "./dialog"
|
|
15
|
+
|
|
16
|
+
function Command({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
20
|
+
return (
|
|
21
|
+
<CommandPrimitive
|
|
22
|
+
data-slot="command"
|
|
23
|
+
className={cn(
|
|
24
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
23
31
|
|
|
24
|
-
|
|
32
|
+
function CommandDialog({
|
|
33
|
+
title = "Command Palette",
|
|
34
|
+
description = "Search for a command to run...",
|
|
35
|
+
children,
|
|
36
|
+
className,
|
|
37
|
+
showCloseButton = true,
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof Dialog> & {
|
|
40
|
+
title?: string
|
|
41
|
+
description?: string
|
|
42
|
+
className?: string
|
|
43
|
+
showCloseButton?: boolean
|
|
44
|
+
}) {
|
|
25
45
|
return (
|
|
26
46
|
<Dialog {...props}>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
47
|
+
<DialogHeader className="sr-only">
|
|
48
|
+
<DialogTitle>{title}</DialogTitle>
|
|
49
|
+
<DialogDescription>{description}</DialogDescription>
|
|
50
|
+
</DialogHeader>
|
|
51
|
+
<DialogContent
|
|
52
|
+
className={cn("overflow-hidden p-0", className)}
|
|
53
|
+
showCloseButton={showCloseButton}
|
|
54
|
+
>
|
|
55
|
+
<Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
29
56
|
{children}
|
|
30
57
|
</Command>
|
|
31
58
|
</DialogContent>
|
|
@@ -33,101 +60,108 @@ const CommandDialog = ({ children, ...props }: DialogProps) => {
|
|
|
33
60
|
)
|
|
34
61
|
}
|
|
35
62
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
function CommandInput({
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
data-slot="command-input-wrapper"
|
|
70
|
+
className="flex h-9 items-center gap-2 border-b px-3"
|
|
71
|
+
>
|
|
72
|
+
<MagnifyingGlass className="size-4 shrink-0 opacity-50" />
|
|
73
|
+
<CommandPrimitive.Input
|
|
74
|
+
data-slot="command-input"
|
|
75
|
+
className={cn(
|
|
76
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function CommandList({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
89
|
+
return (
|
|
90
|
+
<CommandPrimitive.List
|
|
91
|
+
data-slot="command-list"
|
|
44
92
|
className={cn(
|
|
45
|
-
"
|
|
93
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
46
94
|
className
|
|
47
95
|
)}
|
|
48
96
|
{...props}
|
|
49
97
|
/>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
CommandInput.displayName = CommandPrimitive.Input.displayName
|
|
54
|
-
|
|
55
|
-
const CommandList = React.forwardRef<
|
|
56
|
-
React.ElementRef<typeof CommandPrimitive.List>,
|
|
57
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
|
|
58
|
-
>(({ className, ...props }, ref) => (
|
|
59
|
-
<CommandPrimitive.List
|
|
60
|
-
ref={ref}
|
|
61
|
-
className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
))
|
|
65
|
-
|
|
66
|
-
CommandList.displayName = CommandPrimitive.List.displayName
|
|
67
|
-
|
|
68
|
-
const CommandEmpty = React.forwardRef<
|
|
69
|
-
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
70
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
|
|
71
|
-
>((props, ref) => (
|
|
72
|
-
<CommandPrimitive.Empty
|
|
73
|
-
ref={ref}
|
|
74
|
-
className="py-6 text-center text-sm"
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
))
|
|
78
|
-
|
|
79
|
-
CommandEmpty.displayName = CommandPrimitive.Empty.displayName
|
|
80
|
-
|
|
81
|
-
const CommandGroup = React.forwardRef<
|
|
82
|
-
React.ElementRef<typeof CommandPrimitive.Group>,
|
|
83
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
|
|
84
|
-
>(({ className, ...props }, ref) => (
|
|
85
|
-
<CommandPrimitive.Group
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={cn(
|
|
88
|
-
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
))
|
|
98
|
+
)
|
|
99
|
+
}
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
function CommandEmpty({
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
104
|
+
return (
|
|
105
|
+
<CommandPrimitive.Empty
|
|
106
|
+
data-slot="command-empty"
|
|
107
|
+
className="py-6 text-center text-sm"
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
96
112
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
function CommandGroup({
|
|
114
|
+
className,
|
|
115
|
+
...props
|
|
116
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
117
|
+
return (
|
|
118
|
+
<CommandPrimitive.Group
|
|
119
|
+
data-slot="command-group"
|
|
120
|
+
className={cn(
|
|
121
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
122
|
+
className
|
|
123
|
+
)}
|
|
124
|
+
{...props}
|
|
125
|
+
/>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
108
128
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
))
|
|
129
|
+
function CommandSeparator({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
133
|
+
return (
|
|
134
|
+
<CommandPrimitive.Separator
|
|
135
|
+
data-slot="command-separator"
|
|
136
|
+
className={cn("-mx-1 h-px bg-border", className)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
122
141
|
|
|
123
|
-
CommandItem
|
|
142
|
+
function CommandItem({
|
|
143
|
+
className,
|
|
144
|
+
...props
|
|
145
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
146
|
+
return (
|
|
147
|
+
<CommandPrimitive.Item
|
|
148
|
+
data-slot="command-item"
|
|
149
|
+
className={cn(
|
|
150
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
151
|
+
className
|
|
152
|
+
)}
|
|
153
|
+
{...props}
|
|
154
|
+
/>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
124
157
|
|
|
125
|
-
|
|
158
|
+
function CommandShortcut({
|
|
126
159
|
className,
|
|
127
160
|
...props
|
|
128
|
-
}: React.
|
|
161
|
+
}: React.ComponentProps<"span">) {
|
|
129
162
|
return (
|
|
130
163
|
<span
|
|
164
|
+
data-slot="command-shortcut"
|
|
131
165
|
className={cn(
|
|
132
166
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
133
167
|
className
|
|
@@ -136,7 +170,6 @@ const CommandShortcut = ({
|
|
|
136
170
|
/>
|
|
137
171
|
)
|
|
138
172
|
}
|
|
139
|
-
CommandShortcut.displayName = "CommandShortcut"
|
|
140
173
|
|
|
141
174
|
export {
|
|
142
175
|
Command,
|