better-auth-ui 3.2.6 → 3.2.12
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/README.md +30 -3
- package/dist/index.cjs +653 -661
- package/dist/index.d.cts +19 -15
- package/dist/index.d.ts +19 -15
- package/dist/index.js +665 -673
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +161 -156
- package/src/components/organization/organization-cell-view.tsx +2 -2
- package/src/components/organization/organization-invitations-card.tsx +3 -1
- package/src/components/organization/organization-view.tsx +6 -6
- package/src/components/organization/organizations-card.tsx +3 -1
- package/src/components/organization/user-invitations-card.tsx +3 -1
- package/src/components/ui/alert.tsx +37 -44
- package/src/components/ui/avatar.tsx +39 -44
- package/src/components/ui/button.tsx +28 -30
- package/src/components/ui/card.tsx +66 -82
- package/src/components/ui/checkbox.tsx +20 -24
- package/src/components/ui/dialog.tsx +92 -113
- package/src/components/ui/drawer.tsx +82 -101
- package/src/components/ui/dropdown-menu.tsx +183 -224
- package/src/components/ui/form.tsx +50 -39
- package/src/components/ui/input-otp.tsx +43 -51
- package/src/components/ui/input.tsx +16 -15
- package/src/components/ui/label.tsx +17 -17
- package/src/components/ui/select.tsx +130 -156
- package/src/components/ui/separator.tsx +13 -12
- package/src/components/ui/skeleton.tsx +5 -3
- package/src/components/ui/tabs.tsx +43 -54
- package/src/components/ui/textarea.tsx +8 -4
|
@@ -1,125 +1,106 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
1
|
import * as React from "react"
|
|
4
2
|
import { Drawer as DrawerPrimitive } from "vaul"
|
|
5
3
|
|
|
6
4
|
import { cn } from "../../lib/utils"
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
const Drawer = ({
|
|
7
|
+
shouldScaleBackground = true,
|
|
9
8
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Root>)
|
|
11
|
-
|
|
12
|
-
}
|
|
9
|
+
}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
|
|
10
|
+
<DrawerPrimitive.Root
|
|
11
|
+
shouldScaleBackground={shouldScaleBackground}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
Drawer.displayName = "Drawer"
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
|
17
|
-
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
|
18
|
-
}
|
|
17
|
+
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
23
|
-
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
|
24
|
-
}
|
|
19
|
+
const DrawerPortal = DrawerPrimitive.Portal
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
29
|
-
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
|
30
|
-
}
|
|
21
|
+
const DrawerClose = DrawerPrimitive.Close
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
23
|
+
const DrawerOverlay = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
26
|
+
>(({ className, ...props }, ref) => (
|
|
27
|
+
<DrawerPrimitive.Overlay
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={cn("fixed inset-0 z-50 bg-black/80", className)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
))
|
|
33
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
|
|
47
34
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
<DrawerPrimitive.Content
|
|
57
|
-
data-slot="drawer-content"
|
|
58
|
-
className={cn(
|
|
59
|
-
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
60
|
-
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
61
|
-
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
62
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
63
|
-
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
64
|
-
className
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
>
|
|
68
|
-
<div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
|
69
|
-
{children}
|
|
70
|
-
</DrawerPrimitive.Content>
|
|
71
|
-
</DrawerPortal>
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
76
|
-
return (
|
|
77
|
-
<div
|
|
78
|
-
data-slot="drawer-header"
|
|
35
|
+
const DrawerContent = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
38
|
+
>(({ className, children, ...props }, ref) => (
|
|
39
|
+
<DrawerPortal>
|
|
40
|
+
<DrawerOverlay />
|
|
41
|
+
<DrawerPrimitive.Content
|
|
42
|
+
ref={ref}
|
|
79
43
|
className={cn(
|
|
80
|
-
"
|
|
44
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
81
45
|
className
|
|
82
46
|
)}
|
|
83
47
|
{...props}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
data-slot="drawer-footer"
|
|
92
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
48
|
+
>
|
|
49
|
+
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
|
|
50
|
+
{children}
|
|
51
|
+
</DrawerPrimitive.Content>
|
|
52
|
+
</DrawerPortal>
|
|
53
|
+
))
|
|
54
|
+
DrawerContent.displayName = "DrawerContent"
|
|
97
55
|
|
|
98
|
-
|
|
56
|
+
const DrawerHeader = ({
|
|
99
57
|
className,
|
|
100
58
|
...props
|
|
101
|
-
}: React.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
-
}
|
|
59
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
60
|
+
<div
|
|
61
|
+
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
DrawerHeader.displayName = "DrawerHeader"
|
|
110
66
|
|
|
111
|
-
|
|
67
|
+
const DrawerFooter = ({
|
|
112
68
|
className,
|
|
113
69
|
...props
|
|
114
|
-
}: React.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
70
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
71
|
+
<div
|
|
72
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
DrawerFooter.displayName = "DrawerFooter"
|
|
77
|
+
|
|
78
|
+
const DrawerTitle = React.forwardRef<
|
|
79
|
+
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
80
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
81
|
+
>(({ className, ...props }, ref) => (
|
|
82
|
+
<DrawerPrimitive.Title
|
|
83
|
+
ref={ref}
|
|
84
|
+
className={cn(
|
|
85
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
))
|
|
91
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
92
|
+
|
|
93
|
+
const DrawerDescription = React.forwardRef<
|
|
94
|
+
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
95
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
|
|
96
|
+
>(({ className, ...props }, ref) => (
|
|
97
|
+
<DrawerPrimitive.Description
|
|
98
|
+
ref={ref}
|
|
99
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
))
|
|
103
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName
|
|
123
104
|
|
|
124
105
|
export {
|
|
125
106
|
Drawer,
|
|
@@ -2,256 +2,215 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
|
5
|
-
import {
|
|
5
|
+
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
6
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
7
|
|
|
7
8
|
import { cn } from "../../lib/utils"
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
68
|
-
inset?: boolean
|
|
69
|
-
variant?: "default" | "destructive"
|
|
70
|
-
}) {
|
|
71
|
-
return (
|
|
72
|
-
<DropdownMenuPrimitive.Item
|
|
73
|
-
data-slot="dropdown-menu-item"
|
|
74
|
-
data-inset={inset}
|
|
75
|
-
data-variant={variant}
|
|
10
|
+
const DropdownMenu = DropdownMenuPrimitive.Root
|
|
11
|
+
|
|
12
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
|
|
13
|
+
|
|
14
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group
|
|
15
|
+
|
|
16
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal
|
|
17
|
+
|
|
18
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub
|
|
19
|
+
|
|
20
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
|
|
21
|
+
|
|
22
|
+
const DropdownMenuSubTrigger = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
25
|
+
inset?: boolean
|
|
26
|
+
}
|
|
27
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
28
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
32
|
+
inset && "pl-8",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
<ChevronRight className="ml-auto" />
|
|
39
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
40
|
+
))
|
|
41
|
+
DropdownMenuSubTrigger.displayName =
|
|
42
|
+
DropdownMenuPrimitive.SubTrigger.displayName
|
|
43
|
+
|
|
44
|
+
const DropdownMenuSubContent = React.forwardRef<
|
|
45
|
+
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
46
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
47
|
+
>(({ className, ...props }, ref) => (
|
|
48
|
+
<DropdownMenuPrimitive.SubContent
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={cn(
|
|
51
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
))
|
|
57
|
+
DropdownMenuSubContent.displayName =
|
|
58
|
+
DropdownMenuPrimitive.SubContent.displayName
|
|
59
|
+
|
|
60
|
+
const DropdownMenuContent = React.forwardRef<
|
|
61
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
62
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
63
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
64
|
+
<DropdownMenuPrimitive.Portal>
|
|
65
|
+
<DropdownMenuPrimitive.Content
|
|
66
|
+
ref={ref}
|
|
67
|
+
sideOffset={sideOffset}
|
|
76
68
|
className={cn(
|
|
77
|
-
"
|
|
69
|
+
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
70
|
+
"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-[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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
78
71
|
className
|
|
79
72
|
)}
|
|
80
73
|
{...props}
|
|
81
74
|
/>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
</DropdownMenuPrimitive.Portal>
|
|
76
|
+
))
|
|
77
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
|
|
78
|
+
|
|
79
|
+
const dropdownMenuItemVariants = cva(
|
|
80
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
81
|
+
{
|
|
82
|
+
variants: {
|
|
83
|
+
variant: {
|
|
84
|
+
default: "",
|
|
85
|
+
destructive:
|
|
86
|
+
"text-destructive focus:bg-destructive focus:text-destructive-foreground",
|
|
87
|
+
},
|
|
88
|
+
inset: {
|
|
89
|
+
true: "pl-8",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
variant: "default",
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
const DropdownMenuItem = React.forwardRef<
|
|
99
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
100
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> &
|
|
101
|
+
VariantProps<typeof dropdownMenuItemVariants>
|
|
102
|
+
>(({ className, variant, inset, ...props }, ref) => (
|
|
103
|
+
<DropdownMenuPrimitive.Item
|
|
104
|
+
ref={ref}
|
|
105
|
+
className={cn(dropdownMenuItemVariants({ variant, inset, className }))}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
))
|
|
109
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
|
|
110
|
+
|
|
111
|
+
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
112
|
+
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
113
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
114
|
+
>(({ className, children, checked, ...props }, ref) => (
|
|
115
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={cn(
|
|
118
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
119
|
+
className
|
|
120
|
+
)}
|
|
121
|
+
checked={checked}
|
|
122
|
+
{...props}
|
|
123
|
+
>
|
|
124
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
125
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
126
|
+
<Check className="h-4 w-4" />
|
|
127
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
128
|
+
</span>
|
|
129
|
+
{children}
|
|
130
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
131
|
+
))
|
|
132
|
+
DropdownMenuCheckboxItem.displayName =
|
|
133
|
+
DropdownMenuPrimitive.CheckboxItem.displayName
|
|
134
|
+
|
|
135
|
+
const DropdownMenuRadioItem = React.forwardRef<
|
|
136
|
+
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
137
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
138
|
+
>(({ className, children, ...props }, ref) => (
|
|
139
|
+
<DropdownMenuPrimitive.RadioItem
|
|
140
|
+
ref={ref}
|
|
141
|
+
className={cn(
|
|
142
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
143
|
+
className
|
|
144
|
+
)}
|
|
145
|
+
{...props}
|
|
146
|
+
>
|
|
147
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
148
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
149
|
+
<Circle className="h-2 w-2 fill-current" />
|
|
150
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
151
|
+
</span>
|
|
152
|
+
{children}
|
|
153
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
154
|
+
))
|
|
155
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
|
|
156
|
+
|
|
157
|
+
const DropdownMenuLabel = React.forwardRef<
|
|
158
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
159
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
160
|
+
inset?: boolean
|
|
161
|
+
}
|
|
162
|
+
>(({ className, inset, ...props }, ref) => (
|
|
163
|
+
<DropdownMenuPrimitive.Label
|
|
164
|
+
ref={ref}
|
|
165
|
+
className={cn(
|
|
166
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
167
|
+
inset && "pl-8",
|
|
168
|
+
className
|
|
169
|
+
)}
|
|
170
|
+
{...props}
|
|
171
|
+
/>
|
|
172
|
+
))
|
|
173
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
|
|
174
|
+
|
|
175
|
+
const DropdownMenuSeparator = React.forwardRef<
|
|
176
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
177
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
178
|
+
>(({ className, ...props }, ref) => (
|
|
179
|
+
<DropdownMenuPrimitive.Separator
|
|
180
|
+
ref={ref}
|
|
181
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
182
|
+
{...props}
|
|
183
|
+
/>
|
|
184
|
+
))
|
|
185
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
|
|
186
|
+
|
|
187
|
+
const DropdownMenuShortcut = ({
|
|
86
188
|
className,
|
|
87
|
-
children,
|
|
88
|
-
checked,
|
|
89
189
|
...props
|
|
90
|
-
}: React.
|
|
91
|
-
return (
|
|
92
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
93
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
94
|
-
className={cn(
|
|
95
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
96
|
-
className
|
|
97
|
-
)}
|
|
98
|
-
checked={checked}
|
|
99
|
-
{...props}
|
|
100
|
-
>
|
|
101
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
102
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
103
|
-
<CheckIcon className="size-4" />
|
|
104
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
105
|
-
</span>
|
|
106
|
-
{children}
|
|
107
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function DropdownMenuRadioGroup({
|
|
112
|
-
...props
|
|
113
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
114
|
-
return (
|
|
115
|
-
<DropdownMenuPrimitive.RadioGroup
|
|
116
|
-
data-slot="dropdown-menu-radio-group"
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function DropdownMenuRadioItem({
|
|
123
|
-
className,
|
|
124
|
-
children,
|
|
125
|
-
...props
|
|
126
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
127
|
-
return (
|
|
128
|
-
<DropdownMenuPrimitive.RadioItem
|
|
129
|
-
data-slot="dropdown-menu-radio-item"
|
|
130
|
-
className={cn(
|
|
131
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
132
|
-
className
|
|
133
|
-
)}
|
|
134
|
-
{...props}
|
|
135
|
-
>
|
|
136
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
137
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
138
|
-
<CircleIcon className="size-2 fill-current" />
|
|
139
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
140
|
-
</span>
|
|
141
|
-
{children}
|
|
142
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function DropdownMenuLabel({
|
|
147
|
-
className,
|
|
148
|
-
inset,
|
|
149
|
-
...props
|
|
150
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
151
|
-
inset?: boolean
|
|
152
|
-
}) {
|
|
153
|
-
return (
|
|
154
|
-
<DropdownMenuPrimitive.Label
|
|
155
|
-
data-slot="dropdown-menu-label"
|
|
156
|
-
data-inset={inset}
|
|
157
|
-
className={cn(
|
|
158
|
-
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
159
|
-
className
|
|
160
|
-
)}
|
|
161
|
-
{...props}
|
|
162
|
-
/>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function DropdownMenuSeparator({
|
|
167
|
-
className,
|
|
168
|
-
...props
|
|
169
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
170
|
-
return (
|
|
171
|
-
<DropdownMenuPrimitive.Separator
|
|
172
|
-
data-slot="dropdown-menu-separator"
|
|
173
|
-
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
174
|
-
{...props}
|
|
175
|
-
/>
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function DropdownMenuShortcut({
|
|
180
|
-
className,
|
|
181
|
-
...props
|
|
182
|
-
}: React.ComponentProps<"span">) {
|
|
190
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
183
191
|
return (
|
|
184
192
|
<span
|
|
185
|
-
|
|
186
|
-
className={cn(
|
|
187
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
188
|
-
className
|
|
189
|
-
)}
|
|
190
|
-
{...props}
|
|
191
|
-
/>
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function DropdownMenuSub({
|
|
196
|
-
...props
|
|
197
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
198
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function DropdownMenuSubTrigger({
|
|
202
|
-
className,
|
|
203
|
-
inset,
|
|
204
|
-
children,
|
|
205
|
-
...props
|
|
206
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
207
|
-
inset?: boolean
|
|
208
|
-
}) {
|
|
209
|
-
return (
|
|
210
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
211
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
212
|
-
data-inset={inset}
|
|
213
|
-
className={cn(
|
|
214
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
|
|
215
|
-
className
|
|
216
|
-
)}
|
|
217
|
-
{...props}
|
|
218
|
-
>
|
|
219
|
-
{children}
|
|
220
|
-
<ChevronRightIcon className="ml-auto size-4" />
|
|
221
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function DropdownMenuSubContent({
|
|
226
|
-
className,
|
|
227
|
-
...props
|
|
228
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
229
|
-
return (
|
|
230
|
-
<DropdownMenuPrimitive.SubContent
|
|
231
|
-
data-slot="dropdown-menu-sub-content"
|
|
232
|
-
className={cn(
|
|
233
|
-
"bg-popover text-popover-foreground 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-[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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
234
|
-
className
|
|
235
|
-
)}
|
|
193
|
+
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
236
194
|
{...props}
|
|
237
195
|
/>
|
|
238
196
|
)
|
|
239
197
|
}
|
|
198
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
|
|
240
199
|
|
|
241
200
|
export {
|
|
242
201
|
DropdownMenu,
|
|
243
|
-
DropdownMenuPortal,
|
|
244
202
|
DropdownMenuTrigger,
|
|
245
203
|
DropdownMenuContent,
|
|
246
|
-
DropdownMenuGroup,
|
|
247
|
-
DropdownMenuLabel,
|
|
248
204
|
DropdownMenuItem,
|
|
249
205
|
DropdownMenuCheckboxItem,
|
|
250
|
-
DropdownMenuRadioGroup,
|
|
251
206
|
DropdownMenuRadioItem,
|
|
207
|
+
DropdownMenuLabel,
|
|
252
208
|
DropdownMenuSeparator,
|
|
253
209
|
DropdownMenuShortcut,
|
|
210
|
+
DropdownMenuGroup,
|
|
211
|
+
DropdownMenuPortal,
|
|
254
212
|
DropdownMenuSub,
|
|
255
|
-
DropdownMenuSubTrigger,
|
|
256
213
|
DropdownMenuSubContent,
|
|
214
|
+
DropdownMenuSubTrigger,
|
|
215
|
+
DropdownMenuRadioGroup,
|
|
257
216
|
}
|