@autono/create-open-pages 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +30 -2
- package/package.json +1 -1
- package/template/.agents/skills/create-page/SKILL.md +1 -1
- package/template/.agents/skills/page-authoring/SKILL.md +2 -2
- package/template/.agents/skills/page-authoring/references/interactivity.md +13 -21
- package/template/README.md +2 -1
- package/template/components.json +19 -3
- package/template/package.json +7 -7
- package/template/styles/globals.css +83 -66
- package/template/ui/accordion.tsx +22 -7
- package/template/ui/alert-dialog.tsx +22 -21
- package/template/ui/alert.tsx +15 -5
- package/template/ui/avatar.tsx +7 -4
- package/template/ui/badge.tsx +8 -7
- package/template/ui/breadcrumb.tsx +21 -8
- package/template/ui/button-group.tsx +5 -5
- package/template/ui/button.tsx +18 -15
- package/template/ui/calendar.tsx +28 -24
- package/template/ui/card.tsx +17 -6
- package/template/ui/carousel.tsx +10 -11
- package/template/ui/chart.tsx +1 -2
- package/template/ui/checkbox.tsx +5 -6
- package/template/ui/collapsible.tsx +2 -0
- package/template/ui/combobox.tsx +9 -20
- package/template/ui/command.tsx +39 -26
- package/template/ui/context-menu.tsx +69 -60
- package/template/ui/dialog.tsx +26 -14
- package/template/ui/drawer.tsx +8 -9
- package/template/ui/dropdown-menu.tsx +34 -22
- package/template/ui/empty.tsx +8 -8
- package/template/ui/field.tsx +15 -25
- package/template/ui/hover-card.tsx +1 -1
- package/template/ui/input-group.tsx +10 -24
- package/template/ui/input-otp.tsx +16 -6
- package/template/ui/input.tsx +1 -3
- package/template/ui/item.tsx +17 -14
- package/template/ui/kbd.tsx +1 -3
- package/template/ui/menubar.tsx +28 -24
- package/template/ui/message-scroller.tsx +5 -4
- package/template/ui/native-select.tsx +13 -14
- package/template/ui/navigation-menu.tsx +8 -12
- package/template/ui/pagination.tsx +35 -33
- package/template/ui/popover.tsx +5 -5
- package/template/ui/progress.tsx +2 -2
- package/template/ui/radio-group.tsx +4 -5
- package/template/ui/resizable.tsx +2 -5
- package/template/ui/scroll-area.tsx +2 -5
- package/template/ui/select.tsx +26 -24
- package/template/ui/separator.tsx +1 -1
- package/template/ui/sheet.tsx +20 -16
- package/template/ui/sidebar.tsx +39 -63
- package/template/ui/skeleton.tsx +1 -1
- package/template/ui/slider.tsx +6 -8
- package/template/ui/sonner.tsx +21 -14
- package/template/ui/spinner.tsx +2 -8
- package/template/ui/switch.tsx +4 -4
- package/template/ui/table.tsx +2 -4
- package/template/ui/tabs.tsx +9 -8
- package/template/ui/textarea.tsx +1 -1
- package/template/ui/toggle-group.tsx +14 -8
- package/template/ui/toggle.tsx +8 -10
- package/template/ui/tooltip.tsx +4 -2
- package/template/ui/form.tsx +0 -167
package/template/ui/combobox.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react"
|
|
3
|
-
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react"
|
|
4
3
|
|
|
5
4
|
import { cn } from "@/lib/utils"
|
|
6
5
|
import { Button } from "@/ui/button"
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
InputGroupButton,
|
|
11
10
|
InputGroupInput,
|
|
12
11
|
} from "@/ui/input-group"
|
|
12
|
+
import { ChevronDownIcon, XIcon, CheckIcon } from "lucide-react"
|
|
13
13
|
|
|
14
14
|
const Combobox = ComboboxPrimitive.Root
|
|
15
15
|
|
|
@@ -29,10 +29,7 @@ function ComboboxTrigger({
|
|
|
29
29
|
{...props}
|
|
30
30
|
>
|
|
31
31
|
{children}
|
|
32
|
-
<ChevronDownIcon
|
|
33
|
-
data-slot="combobox-trigger-icon"
|
|
34
|
-
className="pointer-events-none size-4 text-muted-foreground"
|
|
35
|
-
/>
|
|
32
|
+
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
36
33
|
</ComboboxPrimitive.Trigger>
|
|
37
34
|
)
|
|
38
35
|
}
|
|
@@ -113,10 +110,7 @@ function ComboboxContent({
|
|
|
113
110
|
<ComboboxPrimitive.Popup
|
|
114
111
|
data-slot="combobox-content"
|
|
115
112
|
data-chips={!!anchor}
|
|
116
|
-
className={cn(
|
|
117
|
-
"group/combobox-content relative max-h-96 w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) 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-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none 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",
|
|
118
|
-
className
|
|
119
|
-
)}
|
|
113
|
+
className={cn("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none 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 )}
|
|
120
114
|
{...props}
|
|
121
115
|
/>
|
|
122
116
|
</ComboboxPrimitive.Positioner>
|
|
@@ -129,7 +123,7 @@ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
|
129
123
|
<ComboboxPrimitive.List
|
|
130
124
|
data-slot="combobox-list"
|
|
131
125
|
className={cn(
|
|
132
|
-
"max-h-[min(calc(--spacing(
|
|
126
|
+
"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",
|
|
133
127
|
className
|
|
134
128
|
)}
|
|
135
129
|
{...props}
|
|
@@ -146,19 +140,18 @@ function ComboboxItem({
|
|
|
146
140
|
<ComboboxPrimitive.Item
|
|
147
141
|
data-slot="combobox-item"
|
|
148
142
|
className={cn(
|
|
149
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-
|
|
143
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
150
144
|
className
|
|
151
145
|
)}
|
|
152
146
|
{...props}
|
|
153
147
|
>
|
|
154
148
|
{children}
|
|
155
149
|
<ComboboxPrimitive.ItemIndicator
|
|
156
|
-
data-slot="combobox-item-indicator"
|
|
157
150
|
render={
|
|
158
151
|
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
159
152
|
}
|
|
160
153
|
>
|
|
161
|
-
<CheckIcon className="pointer-events-none
|
|
154
|
+
<CheckIcon className="pointer-events-none" />
|
|
162
155
|
</ComboboxPrimitive.ItemIndicator>
|
|
163
156
|
</ComboboxPrimitive.Item>
|
|
164
157
|
)
|
|
@@ -181,10 +174,7 @@ function ComboboxLabel({
|
|
|
181
174
|
return (
|
|
182
175
|
<ComboboxPrimitive.GroupLabel
|
|
183
176
|
data-slot="combobox-label"
|
|
184
|
-
className={cn(
|
|
185
|
-
"px-2 py-1.5 text-xs text-muted-foreground pointer-coarse:px-3 pointer-coarse:py-2 pointer-coarse:text-sm",
|
|
186
|
-
className
|
|
187
|
-
)}
|
|
177
|
+
className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
|
|
188
178
|
{...props}
|
|
189
179
|
/>
|
|
190
180
|
)
|
|
@@ -231,7 +221,7 @@ function ComboboxChips({
|
|
|
231
221
|
<ComboboxPrimitive.Chips
|
|
232
222
|
data-slot="combobox-chips"
|
|
233
223
|
className={cn(
|
|
234
|
-
"flex min-h-
|
|
224
|
+
"flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
|
|
235
225
|
className
|
|
236
226
|
)}
|
|
237
227
|
{...props}
|
|
@@ -251,7 +241,7 @@ function ComboboxChip({
|
|
|
251
241
|
<ComboboxPrimitive.Chip
|
|
252
242
|
data-slot="combobox-chip"
|
|
253
243
|
className={cn(
|
|
254
|
-
"flex h-[calc(--spacing(5.
|
|
244
|
+
"flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",
|
|
255
245
|
className
|
|
256
246
|
)}
|
|
257
247
|
{...props}
|
|
@@ -272,7 +262,6 @@ function ComboboxChip({
|
|
|
272
262
|
|
|
273
263
|
function ComboboxChipsInput({
|
|
274
264
|
className,
|
|
275
|
-
children,
|
|
276
265
|
...props
|
|
277
266
|
}: ComboboxPrimitive.Input.Props) {
|
|
278
267
|
return (
|
package/template/ui/command.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import { Command as CommandPrimitive } from "cmdk"
|
|
3
|
-
import { SearchIcon } from "lucide-react"
|
|
4
5
|
|
|
5
6
|
import { cn } from "@/lib/utils"
|
|
6
7
|
import {
|
|
@@ -10,6 +11,11 @@ import {
|
|
|
10
11
|
DialogHeader,
|
|
11
12
|
DialogTitle,
|
|
12
13
|
} from "@/ui/dialog"
|
|
14
|
+
import {
|
|
15
|
+
InputGroup,
|
|
16
|
+
InputGroupAddon,
|
|
17
|
+
} from "@/ui/input-group"
|
|
18
|
+
import { SearchIcon, CheckIcon } from "lucide-react"
|
|
13
19
|
|
|
14
20
|
function Command({
|
|
15
21
|
className,
|
|
@@ -19,7 +25,7 @@ function Command({
|
|
|
19
25
|
<CommandPrimitive
|
|
20
26
|
data-slot="command"
|
|
21
27
|
className={cn(
|
|
22
|
-
"flex
|
|
28
|
+
"flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",
|
|
23
29
|
className
|
|
24
30
|
)}
|
|
25
31
|
{...props}
|
|
@@ -32,7 +38,7 @@ function CommandDialog({
|
|
|
32
38
|
description = "Search for a command to run...",
|
|
33
39
|
children,
|
|
34
40
|
className,
|
|
35
|
-
showCloseButton =
|
|
41
|
+
showCloseButton = false,
|
|
36
42
|
...props
|
|
37
43
|
}: React.ComponentProps<typeof Dialog> & {
|
|
38
44
|
title?: string
|
|
@@ -47,12 +53,13 @@ function CommandDialog({
|
|
|
47
53
|
<DialogDescription>{description}</DialogDescription>
|
|
48
54
|
</DialogHeader>
|
|
49
55
|
<DialogContent
|
|
50
|
-
className={cn(
|
|
56
|
+
className={cn(
|
|
57
|
+
"top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
|
|
58
|
+
className
|
|
59
|
+
)}
|
|
51
60
|
showCloseButton={showCloseButton}
|
|
52
61
|
>
|
|
53
|
-
|
|
54
|
-
{children}
|
|
55
|
-
</Command>
|
|
62
|
+
{children}
|
|
56
63
|
</DialogContent>
|
|
57
64
|
</Dialog>
|
|
58
65
|
)
|
|
@@ -63,19 +70,20 @@ function CommandInput({
|
|
|
63
70
|
...props
|
|
64
71
|
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
65
72
|
return (
|
|
66
|
-
<div
|
|
67
|
-
data-slot=
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
<div data-slot="command-input-wrapper" className="p-1 pb-0">
|
|
74
|
+
<InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
|
75
|
+
<CommandPrimitive.Input
|
|
76
|
+
data-slot="command-input"
|
|
77
|
+
className={cn(
|
|
78
|
+
"w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
<InputGroupAddon>
|
|
84
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
85
|
+
</InputGroupAddon>
|
|
86
|
+
</InputGroup>
|
|
79
87
|
</div>
|
|
80
88
|
)
|
|
81
89
|
}
|
|
@@ -88,7 +96,7 @@ function CommandList({
|
|
|
88
96
|
<CommandPrimitive.List
|
|
89
97
|
data-slot="command-list"
|
|
90
98
|
className={cn(
|
|
91
|
-
"max-h-
|
|
99
|
+
"no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
|
|
92
100
|
className
|
|
93
101
|
)}
|
|
94
102
|
{...props}
|
|
@@ -97,12 +105,13 @@ function CommandList({
|
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
function CommandEmpty({
|
|
108
|
+
className,
|
|
100
109
|
...props
|
|
101
110
|
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
102
111
|
return (
|
|
103
112
|
<CommandPrimitive.Empty
|
|
104
113
|
data-slot="command-empty"
|
|
105
|
-
className="py-6 text-center text-sm"
|
|
114
|
+
className={cn("py-6 text-center text-sm", className)}
|
|
106
115
|
{...props}
|
|
107
116
|
/>
|
|
108
117
|
)
|
|
@@ -116,7 +125,7 @@ function CommandGroup({
|
|
|
116
125
|
<CommandPrimitive.Group
|
|
117
126
|
data-slot="command-group"
|
|
118
127
|
className={cn(
|
|
119
|
-
"overflow-hidden p-1 text-foreground [
|
|
128
|
+
"overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",
|
|
120
129
|
className
|
|
121
130
|
)}
|
|
122
131
|
{...props}
|
|
@@ -139,17 +148,21 @@ function CommandSeparator({
|
|
|
139
148
|
|
|
140
149
|
function CommandItem({
|
|
141
150
|
className,
|
|
151
|
+
children,
|
|
142
152
|
...props
|
|
143
153
|
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
144
154
|
return (
|
|
145
155
|
<CommandPrimitive.Item
|
|
146
156
|
data-slot="command-item"
|
|
147
157
|
className={cn(
|
|
148
|
-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-
|
|
158
|
+
"group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
|
|
149
159
|
className
|
|
150
160
|
)}
|
|
151
161
|
{...props}
|
|
152
|
-
|
|
162
|
+
>
|
|
163
|
+
{children}
|
|
164
|
+
<CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
165
|
+
</CommandPrimitive.Item>
|
|
153
166
|
)
|
|
154
167
|
}
|
|
155
168
|
|
|
@@ -161,7 +174,7 @@ function CommandShortcut({
|
|
|
161
174
|
<span
|
|
162
175
|
data-slot="command-shortcut"
|
|
163
176
|
className={cn(
|
|
164
|
-
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
177
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
|
|
165
178
|
className
|
|
166
179
|
)}
|
|
167
180
|
{...props}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
1
|
import * as React from "react"
|
|
4
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
5
2
|
import { ContextMenu as ContextMenuPrimitive } from "radix-ui"
|
|
6
3
|
|
|
7
4
|
import { cn } from "@/lib/utils"
|
|
5
|
+
import { ChevronRightIcon, CheckIcon } from "lucide-react"
|
|
8
6
|
|
|
9
7
|
function ContextMenu({
|
|
10
8
|
...props
|
|
@@ -13,10 +11,15 @@ function ContextMenu({
|
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
function ContextMenuTrigger({
|
|
14
|
+
className,
|
|
16
15
|
...props
|
|
17
16
|
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
18
17
|
return (
|
|
19
|
-
<ContextMenuPrimitive.Trigger
|
|
18
|
+
<ContextMenuPrimitive.Trigger
|
|
19
|
+
data-slot="context-menu-trigger"
|
|
20
|
+
className={cn("select-none", className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
20
23
|
)
|
|
21
24
|
}
|
|
22
25
|
|
|
@@ -53,58 +56,17 @@ function ContextMenuRadioGroup({
|
|
|
53
56
|
)
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
function ContextMenuSubTrigger({
|
|
57
|
-
className,
|
|
58
|
-
inset,
|
|
59
|
-
children,
|
|
60
|
-
...props
|
|
61
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
62
|
-
inset?: boolean
|
|
63
|
-
}) {
|
|
64
|
-
return (
|
|
65
|
-
<ContextMenuPrimitive.SubTrigger
|
|
66
|
-
data-slot="context-menu-sub-trigger"
|
|
67
|
-
data-inset={inset}
|
|
68
|
-
className={cn(
|
|
69
|
-
"flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
>
|
|
74
|
-
{children}
|
|
75
|
-
<ChevronRightIcon className="ml-auto" />
|
|
76
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function ContextMenuSubContent({
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
84
|
-
return (
|
|
85
|
-
<ContextMenuPrimitive.SubContent
|
|
86
|
-
data-slot="context-menu-sub-content"
|
|
87
|
-
className={cn(
|
|
88
|
-
"z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
59
|
function ContextMenuContent({
|
|
97
60
|
className,
|
|
98
61
|
...props
|
|
99
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>
|
|
62
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {
|
|
63
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
64
|
+
}) {
|
|
100
65
|
return (
|
|
101
66
|
<ContextMenuPrimitive.Portal>
|
|
102
67
|
<ContextMenuPrimitive.Content
|
|
103
68
|
data-slot="context-menu-content"
|
|
104
|
-
className={cn(
|
|
105
|
-
"z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
106
|
-
className
|
|
107
|
-
)}
|
|
69
|
+
className={cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md 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 )}
|
|
108
70
|
{...props}
|
|
109
71
|
/>
|
|
110
72
|
</ContextMenuPrimitive.Portal>
|
|
@@ -126,7 +88,7 @@ function ContextMenuItem({
|
|
|
126
88
|
data-inset={inset}
|
|
127
89
|
data-variant={variant}
|
|
128
90
|
className={cn(
|
|
129
|
-
"relative flex cursor-default items-center gap-
|
|
91
|
+
"group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
130
92
|
className
|
|
131
93
|
)}
|
|
132
94
|
{...props}
|
|
@@ -134,25 +96,67 @@ function ContextMenuItem({
|
|
|
134
96
|
)
|
|
135
97
|
}
|
|
136
98
|
|
|
99
|
+
function ContextMenuSubTrigger({
|
|
100
|
+
className,
|
|
101
|
+
inset,
|
|
102
|
+
children,
|
|
103
|
+
...props
|
|
104
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
105
|
+
inset?: boolean
|
|
106
|
+
}) {
|
|
107
|
+
return (
|
|
108
|
+
<ContextMenuPrimitive.SubTrigger
|
|
109
|
+
data-slot="context-menu-sub-trigger"
|
|
110
|
+
data-inset={inset}
|
|
111
|
+
className={cn(
|
|
112
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
113
|
+
className
|
|
114
|
+
)}
|
|
115
|
+
{...props}
|
|
116
|
+
>
|
|
117
|
+
{children}
|
|
118
|
+
<ChevronRightIcon className="ml-auto" />
|
|
119
|
+
</ContextMenuPrimitive.SubTrigger>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function ContextMenuSubContent({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
127
|
+
return (
|
|
128
|
+
<ContextMenuPrimitive.SubContent
|
|
129
|
+
data-slot="context-menu-sub-content"
|
|
130
|
+
className={cn("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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 )}
|
|
131
|
+
{...props}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
137
136
|
function ContextMenuCheckboxItem({
|
|
138
137
|
className,
|
|
139
138
|
children,
|
|
140
139
|
checked,
|
|
140
|
+
inset,
|
|
141
141
|
...props
|
|
142
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>
|
|
142
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {
|
|
143
|
+
inset?: boolean
|
|
144
|
+
}) {
|
|
143
145
|
return (
|
|
144
146
|
<ContextMenuPrimitive.CheckboxItem
|
|
145
147
|
data-slot="context-menu-checkbox-item"
|
|
148
|
+
data-inset={inset}
|
|
146
149
|
className={cn(
|
|
147
|
-
"relative flex cursor-default items-center gap-
|
|
150
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
148
151
|
className
|
|
149
152
|
)}
|
|
150
153
|
checked={checked}
|
|
151
154
|
{...props}
|
|
152
155
|
>
|
|
153
|
-
<span className="pointer-events-none absolute
|
|
156
|
+
<span className="pointer-events-none absolute right-2">
|
|
154
157
|
<ContextMenuPrimitive.ItemIndicator>
|
|
155
|
-
<CheckIcon
|
|
158
|
+
<CheckIcon
|
|
159
|
+
/>
|
|
156
160
|
</ContextMenuPrimitive.ItemIndicator>
|
|
157
161
|
</span>
|
|
158
162
|
{children}
|
|
@@ -163,20 +167,25 @@ function ContextMenuCheckboxItem({
|
|
|
163
167
|
function ContextMenuRadioItem({
|
|
164
168
|
className,
|
|
165
169
|
children,
|
|
170
|
+
inset,
|
|
166
171
|
...props
|
|
167
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>
|
|
172
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {
|
|
173
|
+
inset?: boolean
|
|
174
|
+
}) {
|
|
168
175
|
return (
|
|
169
176
|
<ContextMenuPrimitive.RadioItem
|
|
170
177
|
data-slot="context-menu-radio-item"
|
|
178
|
+
data-inset={inset}
|
|
171
179
|
className={cn(
|
|
172
|
-
"relative flex cursor-default items-center gap-
|
|
180
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
173
181
|
className
|
|
174
182
|
)}
|
|
175
183
|
{...props}
|
|
176
184
|
>
|
|
177
|
-
<span className="pointer-events-none absolute
|
|
185
|
+
<span className="pointer-events-none absolute right-2">
|
|
178
186
|
<ContextMenuPrimitive.ItemIndicator>
|
|
179
|
-
<
|
|
187
|
+
<CheckIcon
|
|
188
|
+
/>
|
|
180
189
|
</ContextMenuPrimitive.ItemIndicator>
|
|
181
190
|
</span>
|
|
182
191
|
{children}
|
|
@@ -196,7 +205,7 @@ function ContextMenuLabel({
|
|
|
196
205
|
data-slot="context-menu-label"
|
|
197
206
|
data-inset={inset}
|
|
198
207
|
className={cn(
|
|
199
|
-
"px-
|
|
208
|
+
"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
|
|
200
209
|
className
|
|
201
210
|
)}
|
|
202
211
|
{...props}
|
|
@@ -225,7 +234,7 @@ function ContextMenuShortcut({
|
|
|
225
234
|
<span
|
|
226
235
|
data-slot="context-menu-shortcut"
|
|
227
236
|
className={cn(
|
|
228
|
-
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
237
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",
|
|
229
238
|
className
|
|
230
239
|
)}
|
|
231
240
|
{...props}
|
package/template/ui/dialog.tsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
|
-
import { XIcon } from "lucide-react"
|
|
3
4
|
import { Dialog as DialogPrimitive } from "radix-ui"
|
|
4
5
|
|
|
5
6
|
import { cn } from "@/lib/utils"
|
|
6
7
|
import { Button } from "@/ui/button"
|
|
8
|
+
import { XIcon } from "lucide-react"
|
|
7
9
|
|
|
8
10
|
function Dialog({
|
|
9
11
|
...props
|
|
@@ -37,7 +39,7 @@ function DialogOverlay({
|
|
|
37
39
|
<DialogPrimitive.Overlay
|
|
38
40
|
data-slot="dialog-overlay"
|
|
39
41
|
className={cn(
|
|
40
|
-
"fixed inset-0 z-50 bg-black/
|
|
42
|
+
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
41
43
|
className
|
|
42
44
|
)}
|
|
43
45
|
{...props}
|
|
@@ -54,24 +56,28 @@ function DialogContent({
|
|
|
54
56
|
showCloseButton?: boolean
|
|
55
57
|
}) {
|
|
56
58
|
return (
|
|
57
|
-
<DialogPortal
|
|
59
|
+
<DialogPortal>
|
|
58
60
|
<DialogOverlay />
|
|
59
61
|
<DialogPrimitive.Content
|
|
60
62
|
data-slot="dialog-content"
|
|
61
63
|
className={cn(
|
|
62
|
-
"fixed top-
|
|
64
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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",
|
|
63
65
|
className
|
|
64
66
|
)}
|
|
65
67
|
{...props}
|
|
66
68
|
>
|
|
67
69
|
{children}
|
|
68
70
|
{showCloseButton && (
|
|
69
|
-
<DialogPrimitive.Close
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
<DialogPrimitive.Close data-slot="dialog-close" asChild>
|
|
72
|
+
<Button
|
|
73
|
+
variant="ghost"
|
|
74
|
+
className="absolute top-2 right-2"
|
|
75
|
+
size="icon-sm"
|
|
76
|
+
>
|
|
77
|
+
<XIcon
|
|
78
|
+
/>
|
|
79
|
+
<span className="sr-only">Close</span>
|
|
80
|
+
</Button>
|
|
75
81
|
</DialogPrimitive.Close>
|
|
76
82
|
)}
|
|
77
83
|
</DialogPrimitive.Content>
|
|
@@ -83,7 +89,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
83
89
|
return (
|
|
84
90
|
<div
|
|
85
91
|
data-slot="dialog-header"
|
|
86
|
-
className={cn("flex flex-col gap-2
|
|
92
|
+
className={cn("flex flex-col gap-2", className)}
|
|
87
93
|
{...props}
|
|
88
94
|
/>
|
|
89
95
|
)
|
|
@@ -101,7 +107,7 @@ function DialogFooter({
|
|
|
101
107
|
<div
|
|
102
108
|
data-slot="dialog-footer"
|
|
103
109
|
className={cn(
|
|
104
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
110
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
|
|
105
111
|
className
|
|
106
112
|
)}
|
|
107
113
|
{...props}
|
|
@@ -123,7 +129,10 @@ function DialogTitle({
|
|
|
123
129
|
return (
|
|
124
130
|
<DialogPrimitive.Title
|
|
125
131
|
data-slot="dialog-title"
|
|
126
|
-
className={cn(
|
|
132
|
+
className={cn(
|
|
133
|
+
"font-heading text-base leading-none font-medium",
|
|
134
|
+
className
|
|
135
|
+
)}
|
|
127
136
|
{...props}
|
|
128
137
|
/>
|
|
129
138
|
)
|
|
@@ -136,7 +145,10 @@ function DialogDescription({
|
|
|
136
145
|
return (
|
|
137
146
|
<DialogPrimitive.Description
|
|
138
147
|
data-slot="dialog-description"
|
|
139
|
-
className={cn(
|
|
148
|
+
className={cn(
|
|
149
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
150
|
+
className
|
|
151
|
+
)}
|
|
140
152
|
{...props}
|
|
141
153
|
/>
|
|
142
154
|
)
|
package/template/ui/drawer.tsx
CHANGED
|
@@ -35,7 +35,7 @@ function DrawerOverlay({
|
|
|
35
35
|
<DrawerPrimitive.Overlay
|
|
36
36
|
data-slot="drawer-overlay"
|
|
37
37
|
className={cn(
|
|
38
|
-
"fixed inset-0 z-50 bg-black/
|
|
38
|
+
"fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
39
39
|
className
|
|
40
40
|
)}
|
|
41
41
|
{...props}
|
|
@@ -54,16 +54,12 @@ function DrawerContent({
|
|
|
54
54
|
<DrawerPrimitive.Content
|
|
55
55
|
data-slot="drawer-content"
|
|
56
56
|
className={cn(
|
|
57
|
-
"group/drawer-content fixed z-50 flex h-auto flex-col bg-
|
|
58
|
-
"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",
|
|
59
|
-
"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",
|
|
60
|
-
"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",
|
|
61
|
-
"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",
|
|
57
|
+
"group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground 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-xl data-[vaul-drawer-direction=bottom]:border-t 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]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r 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]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l 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-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
62
58
|
className
|
|
63
59
|
)}
|
|
64
60
|
{...props}
|
|
65
61
|
>
|
|
66
|
-
<div className="mx-auto mt-4 hidden h-
|
|
62
|
+
<div className="mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
|
67
63
|
{children}
|
|
68
64
|
</DrawerPrimitive.Content>
|
|
69
65
|
</DrawerPortal>
|
|
@@ -75,7 +71,7 @@ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
75
71
|
<div
|
|
76
72
|
data-slot="drawer-header"
|
|
77
73
|
className={cn(
|
|
78
|
-
"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-
|
|
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-0.5 md:text-left",
|
|
79
75
|
className
|
|
80
76
|
)}
|
|
81
77
|
{...props}
|
|
@@ -100,7 +96,10 @@ function DrawerTitle({
|
|
|
100
96
|
return (
|
|
101
97
|
<DrawerPrimitive.Title
|
|
102
98
|
data-slot="drawer-title"
|
|
103
|
-
className={cn(
|
|
99
|
+
className={cn(
|
|
100
|
+
"font-heading text-base font-medium text-foreground",
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
104
103
|
{...props}
|
|
105
104
|
/>
|
|
106
105
|
)
|