@blips/ui 0.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 +4308 -2010
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +435 -411
- package/dist/index.d.ts +435 -411
- package/dist/index.js +4244 -2008
- package/dist/index.js.map +1 -1
- package/package.json +18 -4
- package/src/components/accordion.tsx +58 -48
- package/src/components/alert-dialog.tsx +170 -112
- package/src/components/alert.tsx +49 -42
- package/src/components/aspect-ratio.tsx +9 -3
- package/src/components/avatar.tsx +109 -50
- package/src/components/badge.tsx +29 -17
- package/src/components/breadcrumb.tsx +81 -87
- package/src/components/button-group.tsx +83 -0
- package/src/components/button.tsx +40 -32
- package/src/components/calendar.tsx +49 -45
- package/src/components/card.tsx +77 -71
- package/src/components/carousel.tsx +150 -168
- package/src/components/chart.tsx +357 -0
- package/src/components/checkbox.tsx +28 -24
- package/src/components/collapsible.tsx +28 -6
- package/src/components/command.tsx +144 -110
- package/src/components/context-menu.tsx +220 -166
- package/src/components/dialog.tsx +131 -95
- package/src/components/drawer.tsx +105 -86
- package/src/components/dropdown-menu.tsx +234 -177
- package/src/components/form.tsx +167 -0
- package/src/components/hover-card.tsx +39 -22
- package/src/components/input-group.tsx +175 -0
- package/src/components/input-otp.tsx +56 -48
- package/src/components/input.tsx +18 -19
- package/src/components/kbd.tsx +28 -0
- package/src/components/label.tsx +20 -22
- package/src/components/menubar.tsx +221 -199
- package/src/components/navigation-menu.tsx +144 -102
- package/src/components/pagination.tsx +102 -91
- package/src/components/popover.tsx +86 -26
- package/src/components/progress.tsx +27 -24
- package/src/components/radio-group.tsx +28 -25
- package/src/components/resizable.tsx +42 -34
- package/src/components/scroll-area.tsx +54 -42
- package/src/components/select.tsx +165 -135
- package/src/components/separator.tsx +16 -17
- package/src/components/sheet.tsx +116 -113
- package/src/components/sidebar.tsx +726 -0
- package/src/components/skeleton.tsx +6 -8
- package/src/components/slider.tsx +60 -23
- package/src/components/sonner.tsx +25 -30
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +30 -22
- package/src/components/table.tsx +96 -97
- package/src/components/tabs.tsx +91 -53
- package/src/components/textarea.tsx +8 -12
- package/src/components/toggle-group.tsx +60 -37
- package/src/components/toggle.tsx +28 -24
- package/src/components/tooltip.tsx +50 -23
- package/src/globals.css +230 -68
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +105 -6
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
+
import * as React from "react"
|
|
3
4
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "
|
|
8
|
-
import * as React from "react";
|
|
5
|
+
CaretDown,
|
|
6
|
+
CaretLeft,
|
|
7
|
+
CaretRight,
|
|
8
|
+
} from "@phosphor-icons/react"
|
|
9
9
|
import {
|
|
10
|
-
type DayButton,
|
|
11
10
|
DayPicker,
|
|
12
11
|
getDefaultClassNames,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
type DayButton,
|
|
13
|
+
} from "react-day-picker"
|
|
14
|
+
|
|
15
|
+
import { cn } from "../lib/utils"
|
|
16
|
+
import { Button, buttonVariants } from "./button"
|
|
16
17
|
|
|
17
18
|
function Calendar({
|
|
18
19
|
className,
|
|
@@ -24,15 +25,15 @@ function Calendar({
|
|
|
24
25
|
components,
|
|
25
26
|
...props
|
|
26
27
|
}: React.ComponentProps<typeof DayPicker> & {
|
|
27
|
-
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
28
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
28
29
|
}) {
|
|
29
|
-
const defaultClassNames = getDefaultClassNames()
|
|
30
|
+
const defaultClassNames = getDefaultClassNames()
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<DayPicker
|
|
33
34
|
showOutsideDays={showOutsideDays}
|
|
34
35
|
className={cn(
|
|
35
|
-
"bg-background
|
|
36
|
+
"group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
36
37
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
37
38
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
38
39
|
className
|
|
@@ -56,64 +57,67 @@ function Calendar({
|
|
|
56
57
|
),
|
|
57
58
|
button_previous: cn(
|
|
58
59
|
buttonVariants({ variant: buttonVariant }),
|
|
59
|
-
"
|
|
60
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
60
61
|
defaultClassNames.button_previous
|
|
61
62
|
),
|
|
62
63
|
button_next: cn(
|
|
63
64
|
buttonVariants({ variant: buttonVariant }),
|
|
64
|
-
"
|
|
65
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
65
66
|
defaultClassNames.button_next
|
|
66
67
|
),
|
|
67
68
|
month_caption: cn(
|
|
68
|
-
"flex h-
|
|
69
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
69
70
|
defaultClassNames.month_caption
|
|
70
71
|
),
|
|
71
72
|
dropdowns: cn(
|
|
72
|
-
"flex h-
|
|
73
|
+
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
73
74
|
defaultClassNames.dropdowns
|
|
74
75
|
),
|
|
75
76
|
dropdown_root: cn(
|
|
76
|
-
"
|
|
77
|
+
"relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
77
78
|
defaultClassNames.dropdown_root
|
|
78
79
|
),
|
|
79
80
|
dropdown: cn(
|
|
80
|
-
"
|
|
81
|
+
"absolute inset-0 bg-popover opacity-0",
|
|
81
82
|
defaultClassNames.dropdown
|
|
82
83
|
),
|
|
83
84
|
caption_label: cn(
|
|
84
|
-
"select-none
|
|
85
|
+
"font-medium select-none",
|
|
85
86
|
captionLayout === "label"
|
|
86
87
|
? "text-sm"
|
|
87
|
-
: "
|
|
88
|
+
: "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
88
89
|
defaultClassNames.caption_label
|
|
89
90
|
),
|
|
90
91
|
table: "w-full border-collapse",
|
|
91
92
|
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
92
93
|
weekday: cn(
|
|
93
|
-
"
|
|
94
|
+
"flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
94
95
|
defaultClassNames.weekday
|
|
95
96
|
),
|
|
96
97
|
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
97
98
|
week_number_header: cn(
|
|
98
|
-
"w-
|
|
99
|
+
"w-(--cell-size) select-none",
|
|
99
100
|
defaultClassNames.week_number_header
|
|
100
101
|
),
|
|
101
102
|
week_number: cn(
|
|
102
|
-
"text-muted-foreground select-none
|
|
103
|
+
"text-[0.8rem] text-muted-foreground select-none",
|
|
103
104
|
defaultClassNames.week_number
|
|
104
105
|
),
|
|
105
106
|
day: cn(
|
|
106
|
-
"group/day relative aspect-square h-full w-full
|
|
107
|
+
"group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md",
|
|
108
|
+
props.showWeekNumber
|
|
109
|
+
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
|
|
110
|
+
: "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
107
111
|
defaultClassNames.day
|
|
108
112
|
),
|
|
109
113
|
range_start: cn(
|
|
110
|
-
"
|
|
114
|
+
"rounded-l-md bg-accent",
|
|
111
115
|
defaultClassNames.range_start
|
|
112
116
|
),
|
|
113
117
|
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
114
|
-
range_end: cn("
|
|
118
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
115
119
|
today: cn(
|
|
116
|
-
"bg-accent text-accent-foreground
|
|
120
|
+
"rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
|
|
117
121
|
defaultClassNames.today
|
|
118
122
|
),
|
|
119
123
|
outside: cn(
|
|
@@ -136,43 +140,43 @@ function Calendar({
|
|
|
136
140
|
className={cn(className)}
|
|
137
141
|
{...props}
|
|
138
142
|
/>
|
|
139
|
-
)
|
|
143
|
+
)
|
|
140
144
|
},
|
|
141
145
|
Chevron: ({ className, orientation, ...props }) => {
|
|
142
146
|
if (orientation === "left") {
|
|
143
147
|
return (
|
|
144
|
-
<
|
|
145
|
-
)
|
|
148
|
+
<CaretLeft className={cn("size-4", className)} {...props} />
|
|
149
|
+
)
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
if (orientation === "right") {
|
|
149
153
|
return (
|
|
150
|
-
<
|
|
154
|
+
<CaretRight
|
|
151
155
|
className={cn("size-4", className)}
|
|
152
156
|
{...props}
|
|
153
157
|
/>
|
|
154
|
-
)
|
|
158
|
+
)
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
return (
|
|
158
|
-
<
|
|
159
|
-
)
|
|
162
|
+
<CaretDown className={cn("size-4", className)} {...props} />
|
|
163
|
+
)
|
|
160
164
|
},
|
|
161
165
|
DayButton: CalendarDayButton,
|
|
162
166
|
WeekNumber: ({ children, ...props }) => {
|
|
163
167
|
return (
|
|
164
168
|
<td {...props}>
|
|
165
|
-
<div className="flex size-
|
|
169
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
166
170
|
{children}
|
|
167
171
|
</div>
|
|
168
172
|
</td>
|
|
169
|
-
)
|
|
173
|
+
)
|
|
170
174
|
},
|
|
171
175
|
...components,
|
|
172
176
|
}}
|
|
173
177
|
{...props}
|
|
174
178
|
/>
|
|
175
|
-
)
|
|
179
|
+
)
|
|
176
180
|
}
|
|
177
181
|
|
|
178
182
|
function CalendarDayButton({
|
|
@@ -181,12 +185,12 @@ function CalendarDayButton({
|
|
|
181
185
|
modifiers,
|
|
182
186
|
...props
|
|
183
187
|
}: React.ComponentProps<typeof DayButton>) {
|
|
184
|
-
const defaultClassNames = getDefaultClassNames()
|
|
188
|
+
const defaultClassNames = getDefaultClassNames()
|
|
185
189
|
|
|
186
|
-
const ref = React.useRef<HTMLButtonElement>(null)
|
|
190
|
+
const ref = React.useRef<HTMLButtonElement>(null)
|
|
187
191
|
React.useEffect(() => {
|
|
188
|
-
if (modifiers.focused) ref.current?.focus()
|
|
189
|
-
}, [modifiers.focused])
|
|
192
|
+
if (modifiers.focused) ref.current?.focus()
|
|
193
|
+
}, [modifiers.focused])
|
|
190
194
|
|
|
191
195
|
return (
|
|
192
196
|
<Button
|
|
@@ -204,13 +208,13 @@ function CalendarDayButton({
|
|
|
204
208
|
data-range-end={modifiers.range_end}
|
|
205
209
|
data-range-middle={modifiers.range_middle}
|
|
206
210
|
className={cn(
|
|
207
|
-
"data-[
|
|
211
|
+
"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
208
212
|
defaultClassNames.day,
|
|
209
213
|
className
|
|
210
214
|
)}
|
|
211
215
|
{...props}
|
|
212
216
|
/>
|
|
213
|
-
)
|
|
217
|
+
)
|
|
214
218
|
}
|
|
215
219
|
|
|
216
|
-
export { Calendar, CalendarDayButton }
|
|
220
|
+
export { Calendar, CalendarDayButton }
|
package/src/components/card.tsx
CHANGED
|
@@ -1,86 +1,92 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from "../lib/utils"
|
|
3
|
+
import { cn } from "../lib/utils"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
));
|
|
18
|
-
Card.displayName = "Card";
|
|
5
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-slot="card"
|
|
9
|
+
className={cn(
|
|
10
|
+
"flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-slot="card-header"
|
|
22
|
+
className={cn(
|
|
23
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
));
|
|
45
|
-
CardTitle.displayName = "CardTitle";
|
|
31
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="card-title"
|
|
35
|
+
className={cn("leading-none font-semibold", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
));
|
|
57
|
-
CardDescription.displayName = "CardDescription";
|
|
41
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
data-slot="card-description"
|
|
45
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
58
50
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
data-slot="card-action"
|
|
55
|
+
className={cn(
|
|
56
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
CardFooter
|
|
64
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
data-slot="card-content"
|
|
68
|
+
className={cn("px-6", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
data-slot="card-footer"
|
|
78
|
+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
78
83
|
|
|
79
84
|
export {
|
|
80
85
|
Card,
|
|
81
86
|
CardHeader,
|
|
82
87
|
CardFooter,
|
|
83
88
|
CardTitle,
|
|
89
|
+
CardAction,
|
|
84
90
|
CardDescription,
|
|
85
91
|
CardContent,
|
|
86
|
-
}
|
|
92
|
+
}
|