@lark-apaas/coding-templates 0.1.5 → 0.1.7
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/package.json +1 -1
- package/template-vite-react/README.md +175 -0
- package/template-vite-react/client/index.html +2 -1
- package/template-vite-react/client/src/components/layout.tsx +0 -2
- package/template-vite-react/client/src/components/ui/README.md +134 -0
- package/template-vite-react/client/src/components/ui/accordion.tsx +22 -28
- package/template-vite-react/client/src/components/ui/alert-dialog.tsx +34 -64
- package/template-vite-react/client/src/components/ui/alert.tsx +10 -15
- package/template-vite-react/client/src/components/ui/aspect-ratio.tsx +5 -16
- package/template-vite-react/client/src/components/ui/avatar.tsx +11 -67
- package/template-vite-react/client/src/components/ui/badge.tsx +21 -31
- package/template-vite-react/client/src/components/ui/breadcrumb.tsx +23 -39
- package/template-vite-react/client/src/components/ui/button.tsx +36 -25
- package/template-vite-react/client/src/components/ui/calendar.tsx +37 -43
- package/template-vite-react/client/src/components/ui/card.tsx +73 -94
- package/template-vite-react/client/src/components/ui/carousel.tsx +7 -8
- package/template-vite-react/client/src/components/ui/chart.tsx +35 -49
- package/template-vite-react/client/src/components/ui/checkbox.tsx +10 -7
- package/template-vite-react/client/src/components/ui/collapsible.tsx +20 -6
- package/template-vite-react/client/src/components/ui/command.tsx +52 -40
- package/template-vite-react/client/src/components/ui/context-menu.tsx +170 -117
- package/template-vite-react/client/src/components/ui/dialog.tsx +37 -52
- package/template-vite-react/client/src/components/ui/drawer.tsx +12 -9
- package/template-vite-react/client/src/components/ui/dropdown-menu.tsx +194 -133
- package/template-vite-react/client/src/components/ui/hover-card.tsx +24 -29
- package/template-vite-react/client/src/components/ui/input-group.tsx +39 -29
- package/template-vite-react/client/src/components/ui/input-otp.tsx +7 -17
- package/template-vite-react/client/src/components/ui/input.tsx +4 -3
- package/template-vite-react/client/src/components/ui/label.tsx +9 -3
- package/template-vite-react/client/src/components/ui/menubar.tsx +160 -92
- package/template-vite-react/client/src/components/ui/navigation-menu.tsx +45 -45
- package/template-vite-react/client/src/components/ui/pagination.tsx +32 -35
- package/template-vite-react/client/src/components/ui/popover.tsx +20 -62
- package/template-vite-react/client/src/components/ui/progress.tsx +14 -64
- package/template-vite-react/client/src/components/ui/radio-group.tsx +20 -13
- package/template-vite-react/client/src/components/ui/resizable.tsx +18 -10
- package/template-vite-react/client/src/components/ui/scroll-area.tsx +13 -10
- package/template-vite-react/client/src/components/ui/select.tsx +122 -78
- package/template-vite-react/client/src/components/ui/separator.tsx +7 -4
- package/template-vite-react/client/src/components/ui/sheet.tsx +42 -41
- package/template-vite-react/client/src/components/ui/sidebar.tsx +162 -156
- package/template-vite-react/client/src/components/ui/skeleton.tsx +1 -1
- package/template-vite-react/client/src/components/ui/slider.tsx +52 -22
- package/template-vite-react/client/src/components/ui/sonner.tsx +44 -26
- package/template-vite-react/client/src/components/ui/switch.tsx +9 -8
- package/template-vite-react/client/src/components/ui/table.tsx +5 -5
- package/template-vite-react/client/src/components/ui/tabs.tsx +24 -38
- package/template-vite-react/client/src/components/ui/textarea.tsx +1 -1
- package/template-vite-react/client/src/components/ui/toggle-group.tsx +14 -20
- package/template-vite-react/client/src/components/ui/toggle.tsx +13 -10
- package/template-vite-react/client/src/components/ui/tooltip.tsx +30 -33
- package/template-vite-react/client/src/index.css +130 -0
- package/template-vite-react/client/src/main.tsx +1 -4
- package/template-vite-react/components.json +2 -6
- package/template-vite-react/eslint.config.js +11 -0
- package/template-vite-react/package.json +29 -2
- package/template-vite-react/client/src/components/header.tsx +0 -22
- package/template-vite-react/client/src/components/theme-provider.tsx +0 -45
- package/template-vite-react/client/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -36
- package/template-vite-react/client/src/components/ui/icons/file-android-colorful-icon.tsx +0 -33
- package/template-vite-react/client/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-code-colorful-icon.tsx +0 -28
- package/template-vite-react/client/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -29
- package/template-vite-react/client/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -25
- package/template-vite-react/client/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -29
- package/template-vite-react/client/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -29
- package/template-vite-react/client/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -29
- package/template-vite-react/client/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -23
- package/template-vite-react/client/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -27
- package/template-vite-react/client/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -20
- package/template-vite-react/client/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -12
- package/template-vite-react/client/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -14
- package/template-vite-react/client/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -23
- package/template-vite-react/client/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -38
- package/template-vite-react/client/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -21
- package/template-vite-react/client/src/types/index.ts +0 -1
|
@@ -1,35 +1,44 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
|
-
import
|
|
4
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
5
|
+
import { XIcon } from "lucide-react"
|
|
3
6
|
|
|
4
7
|
import { cn } from "@/lib/utils"
|
|
5
|
-
import { Button } from "@/components/ui/button"
|
|
6
|
-
import { XIcon } from "lucide-react"
|
|
7
8
|
|
|
8
|
-
function Dialog({
|
|
9
|
+
function Dialog({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
9
12
|
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
function DialogTrigger({
|
|
15
|
+
function DialogTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
13
18
|
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
function DialogPortal({
|
|
21
|
+
function DialogPortal({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
17
24
|
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
18
25
|
}
|
|
19
26
|
|
|
20
|
-
function DialogClose({
|
|
27
|
+
function DialogClose({
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
21
30
|
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
function DialogOverlay({
|
|
25
34
|
className,
|
|
26
35
|
...props
|
|
27
|
-
}: DialogPrimitive.
|
|
36
|
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
28
37
|
return (
|
|
29
|
-
<DialogPrimitive.
|
|
38
|
+
<DialogPrimitive.Overlay
|
|
30
39
|
data-slot="dialog-overlay"
|
|
31
40
|
className={cn(
|
|
32
|
-
"
|
|
41
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
33
42
|
className
|
|
34
43
|
)}
|
|
35
44
|
{...props}
|
|
@@ -42,16 +51,16 @@ function DialogContent({
|
|
|
42
51
|
children,
|
|
43
52
|
showCloseButton = true,
|
|
44
53
|
...props
|
|
45
|
-
}: DialogPrimitive.
|
|
54
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
46
55
|
showCloseButton?: boolean
|
|
47
56
|
}) {
|
|
48
57
|
return (
|
|
49
|
-
<DialogPortal>
|
|
58
|
+
<DialogPortal data-slot="dialog-portal">
|
|
50
59
|
<DialogOverlay />
|
|
51
|
-
<DialogPrimitive.
|
|
60
|
+
<DialogPrimitive.Content
|
|
52
61
|
data-slot="dialog-content"
|
|
53
62
|
className={cn(
|
|
54
|
-
"fixed top-
|
|
63
|
+
"bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-sm:max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 max-w-lg",
|
|
55
64
|
className
|
|
56
65
|
)}
|
|
57
66
|
{...props}
|
|
@@ -60,20 +69,13 @@ function DialogContent({
|
|
|
60
69
|
{showCloseButton && (
|
|
61
70
|
<DialogPrimitive.Close
|
|
62
71
|
data-slot="dialog-close"
|
|
63
|
-
|
|
64
|
-
<Button
|
|
65
|
-
variant="ghost"
|
|
66
|
-
className="absolute top-2 right-2"
|
|
67
|
-
size="icon-sm"
|
|
68
|
-
/>
|
|
69
|
-
}
|
|
72
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity enabled:hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
70
73
|
>
|
|
71
|
-
<XIcon
|
|
72
|
-
/>
|
|
74
|
+
<XIcon />
|
|
73
75
|
<span className="sr-only">Close</span>
|
|
74
76
|
</DialogPrimitive.Close>
|
|
75
77
|
)}
|
|
76
|
-
</DialogPrimitive.
|
|
78
|
+
</DialogPrimitive.Content>
|
|
77
79
|
</DialogPortal>
|
|
78
80
|
)
|
|
79
81
|
}
|
|
@@ -82,47 +84,33 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
82
84
|
return (
|
|
83
85
|
<div
|
|
84
86
|
data-slot="dialog-header"
|
|
85
|
-
className={cn("flex flex-col gap-2", className)}
|
|
87
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
86
88
|
{...props}
|
|
87
89
|
/>
|
|
88
90
|
)
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
function DialogFooter({
|
|
92
|
-
className,
|
|
93
|
-
showCloseButton = false,
|
|
94
|
-
children,
|
|
95
|
-
...props
|
|
96
|
-
}: React.ComponentProps<"div"> & {
|
|
97
|
-
showCloseButton?: boolean
|
|
98
|
-
}) {
|
|
93
|
+
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
99
94
|
return (
|
|
100
95
|
<div
|
|
101
96
|
data-slot="dialog-footer"
|
|
102
97
|
className={cn(
|
|
103
|
-
"
|
|
98
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
104
99
|
className
|
|
105
100
|
)}
|
|
106
101
|
{...props}
|
|
107
|
-
|
|
108
|
-
{children}
|
|
109
|
-
{showCloseButton && (
|
|
110
|
-
<DialogPrimitive.Close render={<Button variant="outline" />}>
|
|
111
|
-
Close
|
|
112
|
-
</DialogPrimitive.Close>
|
|
113
|
-
)}
|
|
114
|
-
</div>
|
|
102
|
+
/>
|
|
115
103
|
)
|
|
116
104
|
}
|
|
117
105
|
|
|
118
|
-
function DialogTitle({
|
|
106
|
+
function DialogTitle({
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
119
110
|
return (
|
|
120
111
|
<DialogPrimitive.Title
|
|
121
112
|
data-slot="dialog-title"
|
|
122
|
-
className={cn(
|
|
123
|
-
"text-base leading-none font-medium",
|
|
124
|
-
className
|
|
125
|
-
)}
|
|
113
|
+
className={cn("text-lg leading-none font-semibold", className)}
|
|
126
114
|
{...props}
|
|
127
115
|
/>
|
|
128
116
|
)
|
|
@@ -131,14 +119,11 @@ function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
|
131
119
|
function DialogDescription({
|
|
132
120
|
className,
|
|
133
121
|
...props
|
|
134
|
-
}: DialogPrimitive.Description
|
|
122
|
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
135
123
|
return (
|
|
136
124
|
<DialogPrimitive.Description
|
|
137
125
|
data-slot="dialog-description"
|
|
138
|
-
className={cn(
|
|
139
|
-
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
140
|
-
className
|
|
141
|
-
)}
|
|
126
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
142
127
|
{...props}
|
|
143
128
|
/>
|
|
144
129
|
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import { Drawer as DrawerPrimitive } from "vaul"
|
|
3
5
|
|
|
@@ -35,7 +37,7 @@ function DrawerOverlay({
|
|
|
35
37
|
<DrawerPrimitive.Overlay
|
|
36
38
|
data-slot="drawer-overlay"
|
|
37
39
|
className={cn(
|
|
38
|
-
"
|
|
40
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
39
41
|
className
|
|
40
42
|
)}
|
|
41
43
|
{...props}
|
|
@@ -54,12 +56,16 @@ function DrawerContent({
|
|
|
54
56
|
<DrawerPrimitive.Content
|
|
55
57
|
data-slot="drawer-content"
|
|
56
58
|
className={cn(
|
|
57
|
-
"group/drawer-content fixed z-50 flex h-auto flex-col
|
|
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",
|
|
58
64
|
className
|
|
59
65
|
)}
|
|
60
66
|
{...props}
|
|
61
67
|
>
|
|
62
|
-
<div className="mx-auto mt-4 hidden h-
|
|
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" />
|
|
63
69
|
{children}
|
|
64
70
|
</DrawerPrimitive.Content>
|
|
65
71
|
</DrawerPortal>
|
|
@@ -71,7 +77,7 @@ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
71
77
|
<div
|
|
72
78
|
data-slot="drawer-header"
|
|
73
79
|
className={cn(
|
|
74
|
-
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-
|
|
80
|
+
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
75
81
|
className
|
|
76
82
|
)}
|
|
77
83
|
{...props}
|
|
@@ -96,10 +102,7 @@ function DrawerTitle({
|
|
|
96
102
|
return (
|
|
97
103
|
<DrawerPrimitive.Title
|
|
98
104
|
data-slot="drawer-title"
|
|
99
|
-
className={cn(
|
|
100
|
-
"text-base font-medium text-foreground",
|
|
101
|
-
className
|
|
102
|
-
)}
|
|
105
|
+
className={cn("text-foreground font-semibold", className)}
|
|
103
106
|
{...props}
|
|
104
107
|
/>
|
|
105
108
|
)
|
|
@@ -112,7 +115,7 @@ function DrawerDescription({
|
|
|
112
115
|
return (
|
|
113
116
|
<DrawerPrimitive.Description
|
|
114
117
|
data-slot="drawer-description"
|
|
115
|
-
className={cn("text-
|
|
118
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
116
119
|
{...props}
|
|
117
120
|
/>
|
|
118
121
|
)
|
|
@@ -1,75 +1,61 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import
|
|
4
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
5
6
|
|
|
6
7
|
import { cn } from "@/lib/utils"
|
|
7
|
-
import { ChevronRightIcon, CheckIcon } from "lucide-react"
|
|
8
8
|
|
|
9
|
-
function DropdownMenu({
|
|
10
|
-
|
|
9
|
+
function DropdownMenu({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
12
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
function DropdownMenuPortal({
|
|
14
|
-
|
|
15
|
+
function DropdownMenuPortal({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
18
|
+
return (
|
|
19
|
+
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
20
|
+
)
|
|
15
21
|
}
|
|
16
22
|
|
|
17
|
-
function DropdownMenuTrigger({
|
|
18
|
-
|
|
23
|
+
function DropdownMenuTrigger({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
26
|
+
return (
|
|
27
|
+
<DropdownMenuPrimitive.Trigger
|
|
28
|
+
data-slot="dropdown-menu-trigger"
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
19
32
|
}
|
|
20
33
|
|
|
21
34
|
function DropdownMenuContent({
|
|
22
|
-
align = "start",
|
|
23
|
-
alignOffset = 0,
|
|
24
|
-
side = "bottom",
|
|
25
|
-
sideOffset = 4,
|
|
26
35
|
className,
|
|
36
|
+
sideOffset = 4,
|
|
27
37
|
...props
|
|
28
|
-
}:
|
|
29
|
-
Pick<
|
|
30
|
-
MenuPrimitive.Positioner.Props,
|
|
31
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
32
|
-
>) {
|
|
38
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
33
39
|
return (
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
align={align}
|
|
38
|
-
alignOffset={alignOffset}
|
|
39
|
-
side={side}
|
|
40
|
+
<DropdownMenuPrimitive.Portal>
|
|
41
|
+
<DropdownMenuPrimitive.Content
|
|
42
|
+
data-slot="dropdown-menu-content"
|
|
40
43
|
sideOffset={sideOffset}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</MenuPrimitive.Portal>
|
|
44
|
+
className={cn(
|
|
45
|
+
"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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
</DropdownMenuPrimitive.Portal>
|
|
49
51
|
)
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
function DropdownMenuGroup({
|
|
53
|
-
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function DropdownMenuLabel({
|
|
57
|
-
className,
|
|
58
|
-
inset,
|
|
54
|
+
function DropdownMenuGroup({
|
|
59
55
|
...props
|
|
60
|
-
}:
|
|
61
|
-
inset?: boolean
|
|
62
|
-
}) {
|
|
56
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
63
57
|
return (
|
|
64
|
-
<
|
|
65
|
-
data-slot="dropdown-menu-label"
|
|
66
|
-
data-inset={inset}
|
|
67
|
-
className={cn(
|
|
68
|
-
"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
|
|
69
|
-
className
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
58
|
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
73
59
|
)
|
|
74
60
|
}
|
|
75
61
|
|
|
@@ -77,157 +63,186 @@ function DropdownMenuItem({
|
|
|
77
63
|
className,
|
|
78
64
|
inset,
|
|
79
65
|
variant = "default",
|
|
66
|
+
disabled,
|
|
67
|
+
onClick,
|
|
68
|
+
onMouseDown,
|
|
69
|
+
onKeyDown,
|
|
70
|
+
onKeyUp,
|
|
71
|
+
onPointerDown,
|
|
80
72
|
...props
|
|
81
|
-
}:
|
|
73
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
82
74
|
inset?: boolean
|
|
83
75
|
variant?: "default" | "destructive"
|
|
84
76
|
}) {
|
|
85
77
|
return (
|
|
86
|
-
<
|
|
78
|
+
<DropdownMenuPrimitive.Item
|
|
87
79
|
data-slot="dropdown-menu-item"
|
|
88
80
|
data-inset={inset}
|
|
89
81
|
data-variant={variant}
|
|
90
82
|
className={cn(
|
|
91
|
-
"
|
|
83
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
92
84
|
className
|
|
93
85
|
)}
|
|
86
|
+
disabled={disabled}
|
|
87
|
+
onClick={(event) => {
|
|
88
|
+
if (disabled) {
|
|
89
|
+
event.preventDefault()
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
onClick?.(event)
|
|
93
|
+
}}
|
|
94
|
+
onMouseDown={disabled ? undefined : onMouseDown}
|
|
95
|
+
onKeyDown={disabled ? undefined : onKeyDown}
|
|
96
|
+
onKeyUp={disabled ? undefined : onKeyUp}
|
|
97
|
+
onPointerDown={(event) => {
|
|
98
|
+
if (disabled) {
|
|
99
|
+
event.preventDefault()
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
onPointerDown?.(event)
|
|
103
|
+
}}
|
|
94
104
|
{...props}
|
|
95
105
|
/>
|
|
96
106
|
)
|
|
97
107
|
}
|
|
98
108
|
|
|
99
|
-
function
|
|
100
|
-
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function DropdownMenuSubTrigger({
|
|
109
|
+
function DropdownMenuCheckboxItem({
|
|
104
110
|
className,
|
|
105
|
-
inset,
|
|
106
111
|
children,
|
|
112
|
+
checked,
|
|
113
|
+
disabled,
|
|
114
|
+
onClick,
|
|
115
|
+
onMouseDown,
|
|
116
|
+
onKeyDown,
|
|
117
|
+
onKeyUp,
|
|
118
|
+
onPointerDown,
|
|
107
119
|
...props
|
|
108
|
-
}:
|
|
109
|
-
inset?: boolean
|
|
110
|
-
}) {
|
|
120
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
111
121
|
return (
|
|
112
|
-
<
|
|
113
|
-
data-slot="dropdown-menu-
|
|
114
|
-
data-inset={inset}
|
|
122
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
123
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
115
124
|
className={cn(
|
|
116
|
-
"flex cursor-default items-center gap-
|
|
125
|
+
"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]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
117
126
|
className
|
|
118
127
|
)}
|
|
128
|
+
checked={checked}
|
|
129
|
+
disabled={disabled}
|
|
130
|
+
onClick={(event) => {
|
|
131
|
+
if (disabled) {
|
|
132
|
+
event.preventDefault()
|
|
133
|
+
return
|
|
134
|
+
}
|
|
135
|
+
onClick?.(event)
|
|
136
|
+
}}
|
|
137
|
+
onMouseDown={disabled ? undefined : onMouseDown}
|
|
138
|
+
onKeyDown={disabled ? undefined : onKeyDown}
|
|
139
|
+
onKeyUp={disabled ? undefined : onKeyUp}
|
|
140
|
+
onPointerDown={(event) => {
|
|
141
|
+
if (disabled) {
|
|
142
|
+
event.preventDefault()
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
onPointerDown?.(event)
|
|
146
|
+
}}
|
|
119
147
|
{...props}
|
|
120
148
|
>
|
|
149
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
150
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
151
|
+
<CheckIcon className="size-4" />
|
|
152
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
153
|
+
</span>
|
|
121
154
|
{children}
|
|
122
|
-
|
|
123
|
-
</MenuPrimitive.SubmenuTrigger>
|
|
155
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
124
156
|
)
|
|
125
157
|
}
|
|
126
158
|
|
|
127
|
-
function
|
|
128
|
-
align = "start",
|
|
129
|
-
alignOffset = -3,
|
|
130
|
-
side = "right",
|
|
131
|
-
sideOffset = 0,
|
|
132
|
-
className,
|
|
159
|
+
function DropdownMenuRadioGroup({
|
|
133
160
|
...props
|
|
134
|
-
}: React.ComponentProps<typeof
|
|
161
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
135
162
|
return (
|
|
136
|
-
<
|
|
137
|
-
data-slot="dropdown-menu-
|
|
138
|
-
className={cn("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
|
139
|
-
align={align}
|
|
140
|
-
alignOffset={alignOffset}
|
|
141
|
-
side={side}
|
|
142
|
-
sideOffset={sideOffset}
|
|
163
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
164
|
+
data-slot="dropdown-menu-radio-group"
|
|
143
165
|
{...props}
|
|
144
166
|
/>
|
|
145
167
|
)
|
|
146
168
|
}
|
|
147
169
|
|
|
148
|
-
function
|
|
170
|
+
function DropdownMenuRadioItem({
|
|
149
171
|
className,
|
|
150
172
|
children,
|
|
151
|
-
|
|
152
|
-
|
|
173
|
+
disabled,
|
|
174
|
+
onClick,
|
|
175
|
+
onMouseDown,
|
|
176
|
+
onKeyDown,
|
|
177
|
+
onKeyUp,
|
|
178
|
+
onPointerDown,
|
|
153
179
|
...props
|
|
154
|
-
}:
|
|
155
|
-
inset?: boolean
|
|
156
|
-
}) {
|
|
180
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
157
181
|
return (
|
|
158
|
-
<
|
|
159
|
-
data-slot="dropdown-menu-
|
|
160
|
-
data-inset={inset}
|
|
182
|
+
<DropdownMenuPrimitive.RadioItem
|
|
183
|
+
data-slot="dropdown-menu-radio-item"
|
|
161
184
|
className={cn(
|
|
162
|
-
"relative flex cursor-default items-center gap-
|
|
185
|
+
"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]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
163
186
|
className
|
|
164
187
|
)}
|
|
165
|
-
|
|
188
|
+
disabled={disabled}
|
|
189
|
+
onClick={(event) => {
|
|
190
|
+
if (disabled) {
|
|
191
|
+
event.preventDefault()
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
onClick?.(event)
|
|
195
|
+
}}
|
|
196
|
+
onMouseDown={disabled ? undefined : onMouseDown}
|
|
197
|
+
onKeyDown={disabled ? undefined : onKeyDown}
|
|
198
|
+
onKeyUp={disabled ? undefined : onKeyUp}
|
|
199
|
+
onPointerDown={(event) => {
|
|
200
|
+
if (disabled) {
|
|
201
|
+
event.preventDefault()
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
onPointerDown?.(event)
|
|
205
|
+
}}
|
|
166
206
|
{...props}
|
|
167
207
|
>
|
|
168
|
-
<span
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<MenuPrimitive.CheckboxItemIndicator>
|
|
173
|
-
<CheckIcon
|
|
174
|
-
/>
|
|
175
|
-
</MenuPrimitive.CheckboxItemIndicator>
|
|
208
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
209
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
210
|
+
<CircleIcon className="size-2 fill-current" />
|
|
211
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
176
212
|
</span>
|
|
177
213
|
{children}
|
|
178
|
-
</
|
|
214
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
179
215
|
)
|
|
180
216
|
}
|
|
181
217
|
|
|
182
|
-
function
|
|
183
|
-
return (
|
|
184
|
-
<MenuPrimitive.RadioGroup
|
|
185
|
-
data-slot="dropdown-menu-radio-group"
|
|
186
|
-
{...props}
|
|
187
|
-
/>
|
|
188
|
-
)
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function DropdownMenuRadioItem({
|
|
218
|
+
function DropdownMenuLabel({
|
|
192
219
|
className,
|
|
193
|
-
children,
|
|
194
220
|
inset,
|
|
195
221
|
...props
|
|
196
|
-
}:
|
|
222
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
197
223
|
inset?: boolean
|
|
198
224
|
}) {
|
|
199
225
|
return (
|
|
200
|
-
<
|
|
201
|
-
data-slot="dropdown-menu-
|
|
226
|
+
<DropdownMenuPrimitive.Label
|
|
227
|
+
data-slot="dropdown-menu-label"
|
|
202
228
|
data-inset={inset}
|
|
203
229
|
className={cn(
|
|
204
|
-
"
|
|
230
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
205
231
|
className
|
|
206
232
|
)}
|
|
207
233
|
{...props}
|
|
208
|
-
|
|
209
|
-
<span
|
|
210
|
-
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
211
|
-
data-slot="dropdown-menu-radio-item-indicator"
|
|
212
|
-
>
|
|
213
|
-
<MenuPrimitive.RadioItemIndicator>
|
|
214
|
-
<CheckIcon
|
|
215
|
-
/>
|
|
216
|
-
</MenuPrimitive.RadioItemIndicator>
|
|
217
|
-
</span>
|
|
218
|
-
{children}
|
|
219
|
-
</MenuPrimitive.RadioItem>
|
|
234
|
+
/>
|
|
220
235
|
)
|
|
221
236
|
}
|
|
222
237
|
|
|
223
238
|
function DropdownMenuSeparator({
|
|
224
239
|
className,
|
|
225
240
|
...props
|
|
226
|
-
}:
|
|
241
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
227
242
|
return (
|
|
228
|
-
<
|
|
243
|
+
<DropdownMenuPrimitive.Separator
|
|
229
244
|
data-slot="dropdown-menu-separator"
|
|
230
|
-
className={cn("-mx-1 my-1 h-px
|
|
245
|
+
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
231
246
|
{...props}
|
|
232
247
|
/>
|
|
233
248
|
)
|
|
@@ -241,7 +256,53 @@ function DropdownMenuShortcut({
|
|
|
241
256
|
<span
|
|
242
257
|
data-slot="dropdown-menu-shortcut"
|
|
243
258
|
className={cn(
|
|
244
|
-
"ml-auto text-xs tracking-widest
|
|
259
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
260
|
+
className
|
|
261
|
+
)}
|
|
262
|
+
{...props}
|
|
263
|
+
/>
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function DropdownMenuSub({
|
|
268
|
+
...props
|
|
269
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
270
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function DropdownMenuSubTrigger({
|
|
274
|
+
className,
|
|
275
|
+
inset,
|
|
276
|
+
children,
|
|
277
|
+
...props
|
|
278
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
279
|
+
inset?: boolean
|
|
280
|
+
}) {
|
|
281
|
+
return (
|
|
282
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
283
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
284
|
+
data-inset={inset}
|
|
285
|
+
className={cn(
|
|
286
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
287
|
+
className
|
|
288
|
+
)}
|
|
289
|
+
{...props}
|
|
290
|
+
>
|
|
291
|
+
{children}
|
|
292
|
+
<ChevronRightIcon className="ml-auto size-4" />
|
|
293
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function DropdownMenuSubContent({
|
|
298
|
+
className,
|
|
299
|
+
...props
|
|
300
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
301
|
+
return (
|
|
302
|
+
<DropdownMenuPrimitive.SubContent
|
|
303
|
+
data-slot="dropdown-menu-sub-content"
|
|
304
|
+
className={cn(
|
|
305
|
+
"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",
|
|
245
306
|
className
|
|
246
307
|
)}
|
|
247
308
|
{...props}
|