@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,122 +1,163 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
|
-
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
3
4
|
import { cva } from "class-variance-authority"
|
|
4
|
-
import {
|
|
5
|
+
import { CaretDown } from "@phosphor-icons/react"
|
|
6
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
5
7
|
|
|
6
|
-
import { cn } from "
|
|
8
|
+
import { cn } from "../lib/utils"
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
24
|
-
|
|
10
|
+
function NavigationMenu({
|
|
11
|
+
className,
|
|
12
|
+
children,
|
|
13
|
+
viewport = true,
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
16
|
+
viewport?: boolean
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<NavigationMenuPrimitive.Root
|
|
20
|
+
data-slot="navigation-menu"
|
|
21
|
+
data-viewport={viewport}
|
|
22
|
+
className={cn(
|
|
23
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
{viewport && <NavigationMenuViewport />}
|
|
30
|
+
</NavigationMenuPrimitive.Root>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
function NavigationMenuList({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
38
|
+
return (
|
|
39
|
+
<NavigationMenuPrimitive.List
|
|
40
|
+
data-slot="navigation-menu-list"
|
|
41
|
+
className={cn(
|
|
42
|
+
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
function NavigationMenuItem({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
54
|
+
return (
|
|
55
|
+
<NavigationMenuPrimitive.Item
|
|
56
|
+
data-slot="navigation-menu-item"
|
|
57
|
+
className={cn("relative", className)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
42
62
|
|
|
43
63
|
const navigationMenuTriggerStyle = cva(
|
|
44
|
-
"group inline-flex h-
|
|
64
|
+
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
|
|
45
65
|
)
|
|
46
66
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
function NavigationMenuTrigger({
|
|
68
|
+
className,
|
|
69
|
+
children,
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
72
|
+
return (
|
|
73
|
+
<NavigationMenuPrimitive.Trigger
|
|
74
|
+
data-slot="navigation-menu-trigger"
|
|
75
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
76
|
+
{...props}
|
|
77
|
+
>
|
|
78
|
+
{children}{" "}
|
|
79
|
+
<CaretDown
|
|
80
|
+
className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
81
|
+
aria-hidden="true"
|
|
82
|
+
/>
|
|
83
|
+
</NavigationMenuPrimitive.Trigger>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
64
86
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
function NavigationMenuContent({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
91
|
+
return (
|
|
92
|
+
<NavigationMenuPrimitive.Content
|
|
93
|
+
data-slot="navigation-menu-content"
|
|
94
|
+
className={cn(
|
|
95
|
+
"top-0 left-0 w-full p-2 pr-2.5 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out md:absolute md:w-auto",
|
|
96
|
+
"group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95",
|
|
97
|
+
className
|
|
98
|
+
)}
|
|
99
|
+
{...props}
|
|
100
|
+
/>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
79
103
|
|
|
80
|
-
|
|
104
|
+
function NavigationMenuViewport({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
108
|
+
return (
|
|
109
|
+
<div
|
|
110
|
+
className={cn(
|
|
111
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
<NavigationMenuPrimitive.Viewport
|
|
115
|
+
data-slot="navigation-menu-viewport"
|
|
116
|
+
className={cn(
|
|
117
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
118
|
+
className
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
81
125
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<NavigationMenuPrimitive.
|
|
126
|
+
function NavigationMenuLink({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
130
|
+
return (
|
|
131
|
+
<NavigationMenuPrimitive.Link
|
|
132
|
+
data-slot="navigation-menu-link"
|
|
88
133
|
className={cn(
|
|
89
|
-
"
|
|
134
|
+
"flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
90
135
|
className
|
|
91
136
|
)}
|
|
92
|
-
ref={ref}
|
|
93
137
|
{...props}
|
|
94
138
|
/>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
NavigationMenuViewport.displayName =
|
|
98
|
-
NavigationMenuPrimitive.Viewport.displayName
|
|
139
|
+
)
|
|
140
|
+
}
|
|
99
141
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
142
|
+
function NavigationMenuIndicator({
|
|
143
|
+
className,
|
|
144
|
+
...props
|
|
145
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
146
|
+
return (
|
|
147
|
+
<NavigationMenuPrimitive.Indicator
|
|
148
|
+
data-slot="navigation-menu-indicator"
|
|
149
|
+
className={cn(
|
|
150
|
+
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
|
|
151
|
+
className
|
|
152
|
+
)}
|
|
153
|
+
{...props}
|
|
154
|
+
>
|
|
155
|
+
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
156
|
+
</NavigationMenuPrimitive.Indicator>
|
|
157
|
+
)
|
|
158
|
+
}
|
|
117
159
|
|
|
118
160
|
export {
|
|
119
|
-
navigationMenuTriggerStyle,
|
|
120
161
|
NavigationMenu,
|
|
121
162
|
NavigationMenuList,
|
|
122
163
|
NavigationMenuItem,
|
|
@@ -125,4 +166,5 @@ export {
|
|
|
125
166
|
NavigationMenuLink,
|
|
126
167
|
NavigationMenuIndicator,
|
|
127
168
|
NavigationMenuViewport,
|
|
169
|
+
navigationMenuTriggerStyle,
|
|
128
170
|
}
|
|
@@ -1,117 +1,127 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
CaretLeft,
|
|
4
|
+
CaretRight,
|
|
5
|
+
DotsThree,
|
|
6
|
+
} from "@phosphor-icons/react"
|
|
3
7
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { type
|
|
8
|
+
import { cn } from "../lib/utils"
|
|
9
|
+
import { buttonVariants, type Button } from "./button"
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
12
|
+
return (
|
|
13
|
+
<nav
|
|
14
|
+
role="navigation"
|
|
15
|
+
aria-label="pagination"
|
|
16
|
+
data-slot="pagination"
|
|
17
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
function PaginationContent({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"ul">) {
|
|
27
|
+
return (
|
|
28
|
+
<ul
|
|
29
|
+
data-slot="pagination-content"
|
|
30
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
>(({ className, ...props }, ref) => (
|
|
33
|
-
<li ref={ref} className={cn("", className)} {...props} />
|
|
34
|
-
))
|
|
35
|
-
PaginationItem.displayName = "PaginationItem"
|
|
36
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
37
|
+
return <li data-slot="pagination-item" {...props} />
|
|
38
|
+
}
|
|
36
39
|
|
|
37
40
|
type PaginationLinkProps = {
|
|
38
41
|
isActive?: boolean
|
|
39
|
-
} & Pick<
|
|
42
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
40
43
|
React.ComponentProps<"a">
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
function PaginationLink({
|
|
43
46
|
className,
|
|
44
47
|
isActive,
|
|
45
48
|
size = "icon",
|
|
46
49
|
...props
|
|
47
|
-
}: PaginationLinkProps)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
60
|
-
|
|
50
|
+
}: PaginationLinkProps) {
|
|
51
|
+
return (
|
|
52
|
+
<a
|
|
53
|
+
aria-current={isActive ? "page" : undefined}
|
|
54
|
+
data-slot="pagination-link"
|
|
55
|
+
data-active={isActive}
|
|
56
|
+
className={cn(
|
|
57
|
+
buttonVariants({
|
|
58
|
+
variant: isActive ? "outline" : "ghost",
|
|
59
|
+
size,
|
|
60
|
+
}),
|
|
61
|
+
className
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
function PaginationPrevious({
|
|
63
69
|
className,
|
|
64
70
|
...props
|
|
65
|
-
}: React.ComponentProps<typeof PaginationLink>)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
72
|
+
return (
|
|
73
|
+
<PaginationLink
|
|
74
|
+
aria-label="Go to previous page"
|
|
75
|
+
size="default"
|
|
76
|
+
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
<CaretLeft />
|
|
80
|
+
<span className="hidden sm:block">Previous</span>
|
|
81
|
+
</PaginationLink>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
function PaginationNext({
|
|
79
86
|
className,
|
|
80
87
|
...props
|
|
81
|
-
}: React.ComponentProps<typeof PaginationLink>)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
89
|
+
return (
|
|
90
|
+
<PaginationLink
|
|
91
|
+
aria-label="Go to next page"
|
|
92
|
+
size="default"
|
|
93
|
+
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
<span className="hidden sm:block">Next</span>
|
|
97
|
+
<CaretRight />
|
|
98
|
+
</PaginationLink>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
93
101
|
|
|
94
|
-
|
|
102
|
+
function PaginationEllipsis({
|
|
95
103
|
className,
|
|
96
104
|
...props
|
|
97
|
-
}: React.ComponentProps<"span">)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
}: React.ComponentProps<"span">) {
|
|
106
|
+
return (
|
|
107
|
+
<span
|
|
108
|
+
aria-hidden
|
|
109
|
+
data-slot="pagination-ellipsis"
|
|
110
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
111
|
+
{...props}
|
|
112
|
+
>
|
|
113
|
+
<DotsThree className="size-4" />
|
|
114
|
+
<span className="sr-only">More pages</span>
|
|
115
|
+
</span>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
108
118
|
|
|
109
119
|
export {
|
|
110
120
|
Pagination,
|
|
111
121
|
PaginationContent,
|
|
112
|
-
PaginationEllipsis,
|
|
113
|
-
PaginationItem,
|
|
114
122
|
PaginationLink,
|
|
115
|
-
|
|
123
|
+
PaginationItem,
|
|
116
124
|
PaginationPrevious,
|
|
125
|
+
PaginationNext,
|
|
126
|
+
PaginationEllipsis,
|
|
117
127
|
}
|
|
@@ -1,29 +1,89 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
3
5
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
7
|
+
|
|
8
|
+
function Popover({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
11
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function PopoverTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
17
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function PopoverContent({
|
|
21
|
+
className,
|
|
22
|
+
align = "center",
|
|
23
|
+
sideOffset = 4,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
26
|
+
return (
|
|
27
|
+
<PopoverPrimitive.Portal>
|
|
28
|
+
<PopoverPrimitive.Content
|
|
29
|
+
data-slot="popover-content"
|
|
30
|
+
align={align}
|
|
31
|
+
sideOffset={sideOffset}
|
|
32
|
+
className={cn(
|
|
33
|
+
"z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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",
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
</PopoverPrimitive.Portal>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function PopoverAnchor({
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
45
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
data-slot="popover-header"
|
|
52
|
+
className={cn("flex flex-col gap-1 text-sm", className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-slot="popover-title"
|
|
62
|
+
className={cn("font-medium", className)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function PopoverDescription({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<"p">) {
|
|
72
|
+
return (
|
|
73
|
+
<p
|
|
74
|
+
data-slot="popover-description"
|
|
75
|
+
className={cn("text-muted-foreground", className)}
|
|
23
76
|
{...props}
|
|
24
77
|
/>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
78
|
+
)
|
|
79
|
+
}
|
|
28
80
|
|
|
29
|
-
export {
|
|
81
|
+
export {
|
|
82
|
+
Popover,
|
|
83
|
+
PopoverTrigger,
|
|
84
|
+
PopoverContent,
|
|
85
|
+
PopoverAnchor,
|
|
86
|
+
PopoverHeader,
|
|
87
|
+
PopoverTitle,
|
|
88
|
+
PopoverDescription,
|
|
89
|
+
}
|
|
@@ -3,26 +3,29 @@
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "../lib/utils"
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
))
|
|
26
|
-
|
|
8
|
+
function Progress({
|
|
9
|
+
className,
|
|
10
|
+
value,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<ProgressPrimitive.Root
|
|
15
|
+
data-slot="progress"
|
|
16
|
+
className={cn(
|
|
17
|
+
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<ProgressPrimitive.Indicator
|
|
23
|
+
data-slot="progress-indicator"
|
|
24
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
25
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
|
+
/>
|
|
27
|
+
</ProgressPrimitive.Root>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
27
30
|
|
|
28
31
|
export { Progress }
|