@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
|
@@ -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}
|
|
@@ -1,48 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
|
|
2
5
|
|
|
3
6
|
import { cn } from "@/lib/utils"
|
|
4
7
|
|
|
5
|
-
function HoverCard({
|
|
6
|
-
|
|
8
|
+
function HoverCard({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
|
|
11
|
+
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
|
|
7
12
|
}
|
|
8
13
|
|
|
9
|
-
function HoverCardTrigger({
|
|
14
|
+
function HoverCardTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
|
|
10
17
|
return (
|
|
11
|
-
<
|
|
18
|
+
<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
|
|
12
19
|
)
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
function HoverCardContent({
|
|
16
23
|
className,
|
|
17
|
-
side = "bottom",
|
|
18
|
-
sideOffset = 4,
|
|
19
24
|
align = "center",
|
|
20
|
-
|
|
25
|
+
sideOffset = 4,
|
|
21
26
|
...props
|
|
22
|
-
}:
|
|
23
|
-
Pick<
|
|
24
|
-
PreviewCardPrimitive.Positioner.Props,
|
|
25
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
26
|
-
>) {
|
|
27
|
+
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
|
|
27
28
|
return (
|
|
28
|
-
<
|
|
29
|
-
<
|
|
29
|
+
<HoverCardPrimitive.Portal data-slot="hover-card-portal">
|
|
30
|
+
<HoverCardPrimitive.Content
|
|
31
|
+
data-slot="hover-card-content"
|
|
30
32
|
align={align}
|
|
31
|
-
alignOffset={alignOffset}
|
|
32
|
-
side={side}
|
|
33
33
|
sideOffset={sideOffset}
|
|
34
|
-
className=
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
</PreviewCardPrimitive.Positioner>
|
|
45
|
-
</PreviewCardPrimitive.Portal>
|
|
34
|
+
className={cn(
|
|
35
|
+
"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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
</HoverCardPrimitive.Portal>
|
|
46
41
|
)
|
|
47
42
|
}
|
|
48
43
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
5
|
|
|
@@ -12,7 +14,21 @@ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
12
14
|
data-slot="input-group"
|
|
13
15
|
role="group"
|
|
14
16
|
className={cn(
|
|
15
|
-
"group/input-group
|
|
17
|
+
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border transition-[color,box-shadow] outline-none",
|
|
18
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
19
|
+
|
|
20
|
+
// Variants based on alignment.
|
|
21
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
22
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
23
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
24
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
25
|
+
|
|
26
|
+
// Focus state.
|
|
27
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/20 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
28
|
+
|
|
29
|
+
// Error state.
|
|
30
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
31
|
+
|
|
16
32
|
className
|
|
17
33
|
)}
|
|
18
34
|
{...props}
|
|
@@ -21,18 +37,18 @@ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
21
37
|
}
|
|
22
38
|
|
|
23
39
|
const inputGroupAddonVariants = cva(
|
|
24
|
-
"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium
|
|
40
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
|
25
41
|
{
|
|
26
42
|
variants: {
|
|
27
43
|
align: {
|
|
28
44
|
"inline-start":
|
|
29
|
-
"order-first pl-
|
|
45
|
+
"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
30
46
|
"inline-end":
|
|
31
|
-
"order-last pr-
|
|
47
|
+
"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
32
48
|
"block-start":
|
|
33
|
-
"order-first w-full justify-start px-
|
|
49
|
+
"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
34
50
|
"block-end":
|
|
35
|
-
"order-last w-full justify-start px-
|
|
51
|
+
"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5",
|
|
36
52
|
},
|
|
37
53
|
},
|
|
38
54
|
defaultVariants: {
|
|
@@ -63,23 +79,19 @@ function InputGroupAddon({
|
|
|
63
79
|
)
|
|
64
80
|
}
|
|
65
81
|
|
|
66
|
-
const inputGroupButtonVariants = cva(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"icon-xs":
|
|
74
|
-
"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
75
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
size: "xs",
|
|
82
|
+
const inputGroupButtonVariants = cva("text-sm flex gap-2 items-center", {
|
|
83
|
+
variants: {
|
|
84
|
+
size: {
|
|
85
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
86
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
87
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
88
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
80
89
|
},
|
|
81
|
-
}
|
|
82
|
-
|
|
90
|
+
},
|
|
91
|
+
defaultVariants: {
|
|
92
|
+
size: "xs",
|
|
93
|
+
},
|
|
94
|
+
})
|
|
83
95
|
|
|
84
96
|
function InputGroupButton({
|
|
85
97
|
className,
|
|
@@ -87,10 +99,8 @@ function InputGroupButton({
|
|
|
87
99
|
variant = "ghost",
|
|
88
100
|
size = "xs",
|
|
89
101
|
...props
|
|
90
|
-
}: Omit<React.ComponentProps<typeof Button>, "size"
|
|
91
|
-
VariantProps<typeof inputGroupButtonVariants>
|
|
92
|
-
type?: "button" | "submit" | "reset"
|
|
93
|
-
}) {
|
|
102
|
+
}: Omit<React.ComponentProps<typeof Button>, "size"> &
|
|
103
|
+
VariantProps<typeof inputGroupButtonVariants>) {
|
|
94
104
|
return (
|
|
95
105
|
<Button
|
|
96
106
|
type={type}
|
|
@@ -106,7 +116,7 @@ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
|
106
116
|
return (
|
|
107
117
|
<span
|
|
108
118
|
className={cn(
|
|
109
|
-
"flex items-center gap-2 text-sm
|
|
119
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
110
120
|
className
|
|
111
121
|
)}
|
|
112
122
|
{...props}
|
|
@@ -122,7 +132,7 @@ function InputGroupInput({
|
|
|
122
132
|
<Input
|
|
123
133
|
data-slot="input-group-control"
|
|
124
134
|
className={cn(
|
|
125
|
-
"flex-1 rounded-none border-0 bg-transparent
|
|
135
|
+
"flex-1 rounded-none border-0 bg-transparent focus-visible:ring-0 dark:bg-transparent",
|
|
126
136
|
className
|
|
127
137
|
)}
|
|
128
138
|
{...props}
|
|
@@ -138,7 +148,7 @@ function InputGroupTextarea({
|
|
|
138
148
|
<Textarea
|
|
139
149
|
data-slot="input-group-control"
|
|
140
150
|
className={cn(
|
|
141
|
-
"flex-1 resize-none rounded-none border-0 bg-transparent py-
|
|
151
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 focus-visible:ring-0 dark:bg-transparent",
|
|
142
152
|
className
|
|
143
153
|
)}
|
|
144
154
|
{...props}
|