@lark-apaas/coding-templates 0.1.4 → 0.1.6
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/app.tsx +3 -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/client/src/pages/home/index.tsx +5 -5
- package/template-vite-react/components.json +2 -6
- package/template-vite-react/eslint.config.js +11 -0
- package/template-vite-react/package.json +27 -2
- package/template-vite-react/vite.config.ts +5 -0
- 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
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { OTPInput, OTPInputContext } from "input-otp"
|
|
5
|
+
import { MinusIcon } from "lucide-react"
|
|
5
6
|
|
|
6
7
|
import { cn } from "@/lib/utils"
|
|
7
|
-
import { MinusIcon } from "lucide-react"
|
|
8
8
|
|
|
9
9
|
function InputOTP({
|
|
10
10
|
className,
|
|
@@ -17,10 +17,9 @@ function InputOTP({
|
|
|
17
17
|
<OTPInput
|
|
18
18
|
data-slot="input-otp"
|
|
19
19
|
containerClassName={cn(
|
|
20
|
-
"
|
|
20
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
21
21
|
containerClassName
|
|
22
22
|
)}
|
|
23
|
-
spellCheck={false}
|
|
24
23
|
className={cn("disabled:cursor-not-allowed", className)}
|
|
25
24
|
{...props}
|
|
26
25
|
/>
|
|
@@ -31,10 +30,7 @@ function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
31
30
|
return (
|
|
32
31
|
<div
|
|
33
32
|
data-slot="input-otp-group"
|
|
34
|
-
className={cn(
|
|
35
|
-
"flex items-center rounded-lg has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40",
|
|
36
|
-
className
|
|
37
|
-
)}
|
|
33
|
+
className={cn("flex items-center", className)}
|
|
38
34
|
{...props}
|
|
39
35
|
/>
|
|
40
36
|
)
|
|
@@ -55,7 +51,7 @@ function InputOTPSlot({
|
|
|
55
51
|
data-slot="input-otp-slot"
|
|
56
52
|
data-active={isActive}
|
|
57
53
|
className={cn(
|
|
58
|
-
"
|
|
54
|
+
"data-[active=true]:border-ring data-[active=true]:ring-ring/20 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
59
55
|
className
|
|
60
56
|
)}
|
|
61
57
|
{...props}
|
|
@@ -63,7 +59,7 @@ function InputOTPSlot({
|
|
|
63
59
|
{char}
|
|
64
60
|
{hasFakeCaret && (
|
|
65
61
|
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
66
|
-
<div className="
|
|
62
|
+
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
|
|
67
63
|
</div>
|
|
68
64
|
)}
|
|
69
65
|
</div>
|
|
@@ -72,14 +68,8 @@ function InputOTPSlot({
|
|
|
72
68
|
|
|
73
69
|
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
|
74
70
|
return (
|
|
75
|
-
<div
|
|
76
|
-
|
|
77
|
-
className="flex items-center [&_svg:not([class*='size-'])]:size-4"
|
|
78
|
-
role="separator"
|
|
79
|
-
{...props}
|
|
80
|
-
>
|
|
81
|
-
<MinusIcon
|
|
82
|
-
/>
|
|
71
|
+
<div data-slot="input-otp-separator" role="separator" {...props}>
|
|
72
|
+
<MinusIcon />
|
|
83
73
|
</div>
|
|
84
74
|
)
|
|
85
75
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Input as InputPrimitive } from "@base-ui/react/input"
|
|
3
2
|
|
|
4
3
|
import { cn } from "@/lib/utils"
|
|
5
4
|
|
|
6
5
|
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
7
6
|
return (
|
|
8
|
-
<
|
|
7
|
+
<input
|
|
9
8
|
type={type}
|
|
10
9
|
data-slot="input"
|
|
11
10
|
className={cn(
|
|
12
|
-
"h-
|
|
11
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
+
"enabled:hover:border-ring focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[3px]",
|
|
13
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
13
14
|
className
|
|
14
15
|
)}
|
|
15
16
|
{...props}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
2
5
|
|
|
3
6
|
import { cn } from "@/lib/utils"
|
|
4
7
|
|
|
5
|
-
function Label({
|
|
8
|
+
function Label({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
6
12
|
return (
|
|
7
|
-
<
|
|
13
|
+
<LabelPrimitive.Root
|
|
8
14
|
data-slot="label"
|
|
9
15
|
className={cn(
|
|
10
|
-
"flex items-center gap-2 text-sm leading-none font-
|
|
16
|
+
"flex items-center gap-2 text-sm leading-none font-normal select-none group-data-[disabled=true]:cursor-not-allowed group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
11
17
|
className
|
|
12
18
|
)}
|
|
13
19
|
{...props}
|
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
6
6
|
|
|
7
7
|
import { cn } from "@/lib/utils"
|
|
8
|
-
import {
|
|
9
|
-
DropdownMenu,
|
|
10
|
-
DropdownMenuContent,
|
|
11
|
-
DropdownMenuGroup,
|
|
12
|
-
DropdownMenuItem,
|
|
13
|
-
DropdownMenuLabel,
|
|
14
|
-
DropdownMenuPortal,
|
|
15
|
-
DropdownMenuRadioGroup,
|
|
16
|
-
DropdownMenuSeparator,
|
|
17
|
-
DropdownMenuShortcut,
|
|
18
|
-
DropdownMenuSub,
|
|
19
|
-
DropdownMenuSubContent,
|
|
20
|
-
DropdownMenuSubTrigger,
|
|
21
|
-
DropdownMenuTrigger,
|
|
22
|
-
} from "@/components/ui/dropdown-menu"
|
|
23
|
-
import { CheckIcon } from "lucide-react"
|
|
24
8
|
|
|
25
|
-
function Menubar({
|
|
9
|
+
function Menubar({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
26
13
|
return (
|
|
27
|
-
<MenubarPrimitive
|
|
14
|
+
<MenubarPrimitive.Root
|
|
28
15
|
data-slot="menubar"
|
|
29
16
|
className={cn(
|
|
30
|
-
"flex h-
|
|
17
|
+
"bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
|
|
31
18
|
className
|
|
32
19
|
)}
|
|
33
20
|
{...props}
|
|
@@ -35,31 +22,41 @@ function Menubar({ className, ...props }: MenubarPrimitive.Props) {
|
|
|
35
22
|
)
|
|
36
23
|
}
|
|
37
24
|
|
|
38
|
-
function MenubarMenu({
|
|
39
|
-
|
|
25
|
+
function MenubarMenu({
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
28
|
+
return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
|
|
40
29
|
}
|
|
41
30
|
|
|
42
31
|
function MenubarGroup({
|
|
43
32
|
...props
|
|
44
|
-
}: React.ComponentProps<typeof
|
|
45
|
-
return <
|
|
33
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
34
|
+
return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
|
|
46
35
|
}
|
|
47
36
|
|
|
48
37
|
function MenubarPortal({
|
|
49
38
|
...props
|
|
50
|
-
}: React.ComponentProps<typeof
|
|
51
|
-
return <
|
|
39
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
40
|
+
return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function MenubarRadioGroup({
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
46
|
+
return (
|
|
47
|
+
<MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
|
|
48
|
+
)
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
function MenubarTrigger({
|
|
55
52
|
className,
|
|
56
53
|
...props
|
|
57
|
-
}: React.ComponentProps<typeof
|
|
54
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
58
55
|
return (
|
|
59
|
-
<
|
|
56
|
+
<MenubarPrimitive.Trigger
|
|
60
57
|
data-slot="menubar-trigger"
|
|
61
58
|
className={cn(
|
|
62
|
-
"flex items-center rounded-sm px-
|
|
59
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
|
|
63
60
|
className
|
|
64
61
|
)}
|
|
65
62
|
{...props}
|
|
@@ -73,16 +70,21 @@ function MenubarContent({
|
|
|
73
70
|
alignOffset = -4,
|
|
74
71
|
sideOffset = 8,
|
|
75
72
|
...props
|
|
76
|
-
}: React.ComponentProps<typeof
|
|
73
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Content>) {
|
|
77
74
|
return (
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
<MenubarPortal>
|
|
76
|
+
<MenubarPrimitive.Content
|
|
77
|
+
data-slot="menubar-content"
|
|
78
|
+
align={align}
|
|
79
|
+
alignOffset={alignOffset}
|
|
80
|
+
sideOffset={sideOffset}
|
|
81
|
+
className={cn(
|
|
82
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in 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-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
|
|
83
|
+
className
|
|
84
|
+
)}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
</MenubarPortal>
|
|
86
88
|
)
|
|
87
89
|
}
|
|
88
90
|
|
|
@@ -90,17 +92,44 @@ function MenubarItem({
|
|
|
90
92
|
className,
|
|
91
93
|
inset,
|
|
92
94
|
variant = "default",
|
|
95
|
+
disabled,
|
|
96
|
+
onClick,
|
|
97
|
+
onMouseDown,
|
|
98
|
+
onKeyDown,
|
|
99
|
+
onKeyUp,
|
|
100
|
+
onPointerDown,
|
|
93
101
|
...props
|
|
94
|
-
}: React.ComponentProps<typeof
|
|
102
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
103
|
+
inset?: boolean
|
|
104
|
+
variant?: "default" | "destructive"
|
|
105
|
+
}) {
|
|
95
106
|
return (
|
|
96
|
-
<
|
|
107
|
+
<MenubarPrimitive.Item
|
|
97
108
|
data-slot="menubar-item"
|
|
98
109
|
data-inset={inset}
|
|
99
110
|
data-variant={variant}
|
|
100
111
|
className={cn(
|
|
101
|
-
"
|
|
112
|
+
"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 [&_svg:not([class*='text-'])]:text-muted-foreground 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",
|
|
102
113
|
className
|
|
103
114
|
)}
|
|
115
|
+
disabled={disabled}
|
|
116
|
+
onClick={(event) => {
|
|
117
|
+
if (disabled) {
|
|
118
|
+
event.preventDefault()
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
onClick?.(event)
|
|
122
|
+
}}
|
|
123
|
+
onMouseDown={disabled ? undefined : onMouseDown}
|
|
124
|
+
onKeyDown={disabled ? undefined : onKeyDown}
|
|
125
|
+
onKeyUp={disabled ? undefined : onKeyUp}
|
|
126
|
+
onPointerDown={(event) => {
|
|
127
|
+
if (disabled) {
|
|
128
|
+
event.preventDefault()
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
onPointerDown?.(event)
|
|
132
|
+
}}
|
|
104
133
|
{...props}
|
|
105
134
|
/>
|
|
106
135
|
)
|
|
@@ -110,65 +139,97 @@ function MenubarCheckboxItem({
|
|
|
110
139
|
className,
|
|
111
140
|
children,
|
|
112
141
|
checked,
|
|
113
|
-
|
|
142
|
+
disabled,
|
|
143
|
+
onClick,
|
|
144
|
+
onMouseDown,
|
|
145
|
+
onKeyDown,
|
|
146
|
+
onKeyUp,
|
|
147
|
+
onPointerDown,
|
|
114
148
|
...props
|
|
115
|
-
}:
|
|
116
|
-
inset?: boolean
|
|
117
|
-
}) {
|
|
149
|
+
}: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {
|
|
118
150
|
return (
|
|
119
|
-
<
|
|
151
|
+
<MenubarPrimitive.CheckboxItem
|
|
120
152
|
data-slot="menubar-checkbox-item"
|
|
121
|
-
data-inset={inset}
|
|
122
153
|
className={cn(
|
|
123
|
-
"relative flex cursor-default items-center gap-
|
|
154
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs 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",
|
|
124
155
|
className
|
|
125
156
|
)}
|
|
126
157
|
checked={checked}
|
|
158
|
+
disabled={disabled}
|
|
159
|
+
onClick={(event) => {
|
|
160
|
+
if (disabled) {
|
|
161
|
+
event.preventDefault()
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
onClick?.(event)
|
|
165
|
+
}}
|
|
166
|
+
onMouseDown={disabled ? undefined : onMouseDown}
|
|
167
|
+
onKeyDown={disabled ? undefined : onKeyDown}
|
|
168
|
+
onKeyUp={disabled ? undefined : onKeyUp}
|
|
169
|
+
onPointerDown={(event) => {
|
|
170
|
+
if (disabled) {
|
|
171
|
+
event.preventDefault()
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
onPointerDown?.(event)
|
|
175
|
+
}}
|
|
127
176
|
{...props}
|
|
128
177
|
>
|
|
129
|
-
<span className="pointer-events-none absolute left-
|
|
130
|
-
<
|
|
131
|
-
<CheckIcon
|
|
132
|
-
|
|
133
|
-
</MenuPrimitive.CheckboxItemIndicator>
|
|
178
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
179
|
+
<MenubarPrimitive.ItemIndicator>
|
|
180
|
+
<CheckIcon className="size-4" />
|
|
181
|
+
</MenubarPrimitive.ItemIndicator>
|
|
134
182
|
</span>
|
|
135
183
|
{children}
|
|
136
|
-
</
|
|
184
|
+
</MenubarPrimitive.CheckboxItem>
|
|
137
185
|
)
|
|
138
186
|
}
|
|
139
187
|
|
|
140
|
-
function MenubarRadioGroup({
|
|
141
|
-
...props
|
|
142
|
-
}: React.ComponentProps<typeof DropdownMenuRadioGroup>) {
|
|
143
|
-
return <DropdownMenuRadioGroup data-slot="menubar-radio-group" {...props} />
|
|
144
|
-
}
|
|
145
|
-
|
|
146
188
|
function MenubarRadioItem({
|
|
147
189
|
className,
|
|
148
190
|
children,
|
|
149
|
-
|
|
191
|
+
disabled,
|
|
192
|
+
onClick,
|
|
193
|
+
onMouseDown,
|
|
194
|
+
onKeyDown,
|
|
195
|
+
onKeyUp,
|
|
196
|
+
onPointerDown,
|
|
150
197
|
...props
|
|
151
|
-
}:
|
|
152
|
-
inset?: boolean
|
|
153
|
-
}) {
|
|
198
|
+
}: React.ComponentProps<typeof MenubarPrimitive.RadioItem>) {
|
|
154
199
|
return (
|
|
155
|
-
<
|
|
200
|
+
<MenubarPrimitive.RadioItem
|
|
156
201
|
data-slot="menubar-radio-item"
|
|
157
|
-
data-inset={inset}
|
|
158
202
|
className={cn(
|
|
159
|
-
"relative flex cursor-default items-center gap-
|
|
203
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs 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",
|
|
160
204
|
className
|
|
161
205
|
)}
|
|
206
|
+
disabled={disabled}
|
|
207
|
+
onClick={(event) => {
|
|
208
|
+
if (disabled) {
|
|
209
|
+
event.preventDefault()
|
|
210
|
+
return
|
|
211
|
+
}
|
|
212
|
+
onClick?.(event)
|
|
213
|
+
}}
|
|
214
|
+
onMouseDown={disabled ? undefined : onMouseDown}
|
|
215
|
+
onKeyDown={disabled ? undefined : onKeyDown}
|
|
216
|
+
onKeyUp={disabled ? undefined : onKeyUp}
|
|
217
|
+
onPointerDown={(event) => {
|
|
218
|
+
if (disabled) {
|
|
219
|
+
event.preventDefault()
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
onPointerDown?.(event)
|
|
223
|
+
}}
|
|
162
224
|
{...props}
|
|
163
225
|
>
|
|
164
|
-
<span className="pointer-events-none absolute left-
|
|
165
|
-
<
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
</MenuPrimitive.RadioItemIndicator>
|
|
226
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
227
|
+
<MenubarPrimitive.ItemIndicator>
|
|
228
|
+
<CircleIcon className="size-2 fill-current" />
|
|
229
|
+
</MenubarPrimitive.ItemIndicator>
|
|
169
230
|
</span>
|
|
170
231
|
{children}
|
|
171
|
-
</
|
|
232
|
+
</MenubarPrimitive.RadioItem>
|
|
172
233
|
)
|
|
173
234
|
}
|
|
174
235
|
|
|
@@ -176,15 +237,15 @@ function MenubarLabel({
|
|
|
176
237
|
className,
|
|
177
238
|
inset,
|
|
178
239
|
...props
|
|
179
|
-
}: React.ComponentProps<typeof
|
|
240
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
180
241
|
inset?: boolean
|
|
181
242
|
}) {
|
|
182
243
|
return (
|
|
183
|
-
<
|
|
244
|
+
<MenubarPrimitive.Label
|
|
184
245
|
data-slot="menubar-label"
|
|
185
246
|
data-inset={inset}
|
|
186
247
|
className={cn(
|
|
187
|
-
"px-
|
|
248
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
188
249
|
className
|
|
189
250
|
)}
|
|
190
251
|
{...props}
|
|
@@ -195,11 +256,11 @@ function MenubarLabel({
|
|
|
195
256
|
function MenubarSeparator({
|
|
196
257
|
className,
|
|
197
258
|
...props
|
|
198
|
-
}: React.ComponentProps<typeof
|
|
259
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
|
|
199
260
|
return (
|
|
200
|
-
<
|
|
261
|
+
<MenubarPrimitive.Separator
|
|
201
262
|
data-slot="menubar-separator"
|
|
202
|
-
className={cn("-mx-1 my-1 h-px
|
|
263
|
+
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
203
264
|
{...props}
|
|
204
265
|
/>
|
|
205
266
|
)
|
|
@@ -208,12 +269,12 @@ function MenubarSeparator({
|
|
|
208
269
|
function MenubarShortcut({
|
|
209
270
|
className,
|
|
210
271
|
...props
|
|
211
|
-
}: React.ComponentProps<
|
|
272
|
+
}: React.ComponentProps<"span">) {
|
|
212
273
|
return (
|
|
213
|
-
<
|
|
274
|
+
<span
|
|
214
275
|
data-slot="menubar-shortcut"
|
|
215
276
|
className={cn(
|
|
216
|
-
"ml-auto text-xs tracking-widest
|
|
277
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
217
278
|
className
|
|
218
279
|
)}
|
|
219
280
|
{...props}
|
|
@@ -223,38 +284,45 @@ function MenubarShortcut({
|
|
|
223
284
|
|
|
224
285
|
function MenubarSub({
|
|
225
286
|
...props
|
|
226
|
-
}: React.ComponentProps<typeof
|
|
227
|
-
return <
|
|
287
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
288
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
|
|
228
289
|
}
|
|
229
290
|
|
|
230
291
|
function MenubarSubTrigger({
|
|
231
292
|
className,
|
|
232
293
|
inset,
|
|
294
|
+
children,
|
|
233
295
|
...props
|
|
234
|
-
}: React.ComponentProps<typeof
|
|
296
|
+
}: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
235
297
|
inset?: boolean
|
|
236
298
|
}) {
|
|
237
299
|
return (
|
|
238
|
-
<
|
|
300
|
+
<MenubarPrimitive.SubTrigger
|
|
239
301
|
data-slot="menubar-sub-trigger"
|
|
240
302
|
data-inset={inset}
|
|
241
303
|
className={cn(
|
|
242
|
-
"
|
|
304
|
+
"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-none select-none data-[inset]:pl-8",
|
|
243
305
|
className
|
|
244
306
|
)}
|
|
245
307
|
{...props}
|
|
246
|
-
|
|
308
|
+
>
|
|
309
|
+
{children}
|
|
310
|
+
<ChevronRightIcon className="ml-auto h-4 w-4" />
|
|
311
|
+
</MenubarPrimitive.SubTrigger>
|
|
247
312
|
)
|
|
248
313
|
}
|
|
249
314
|
|
|
250
315
|
function MenubarSubContent({
|
|
251
316
|
className,
|
|
252
317
|
...props
|
|
253
|
-
}: React.ComponentProps<typeof
|
|
318
|
+
}: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
|
|
254
319
|
return (
|
|
255
|
-
<
|
|
320
|
+
<MenubarPrimitive.SubContent
|
|
256
321
|
data-slot="menubar-sub-content"
|
|
257
|
-
className={cn(
|
|
322
|
+
className={cn(
|
|
323
|
+
"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-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
324
|
+
className
|
|
325
|
+
)}
|
|
258
326
|
{...props}
|
|
259
327
|
/>
|
|
260
328
|
)
|