@autono/create-open-pages 0.1.0 → 0.4.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/README.md +6 -3
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/apply-comments/SKILL.md +4 -4
- package/template/.agents/skills/create-page/SKILL.md +26 -8
- package/template/.agents/skills/create-theme/SKILL.md +137 -150
- package/template/.agents/skills/current-page/SKILL.md +1 -1
- package/template/.agents/skills/page-authoring/SKILL.md +97 -42
- package/template/.agents/skills/page-authoring/references/interactivity.md +71 -23
- package/template/.agents/skills/page-authoring/references/layout-and-responsive.md +38 -17
- package/template/.agents/skills/page-authoring/references/typography-and-color.md +50 -32
- package/template/.agents/skills/shadcn/SKILL.md +277 -0
- package/template/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
- package/template/.agents/skills/shadcn/assets/shadcn.png +0 -0
- package/template/.agents/skills/shadcn/cli.md +290 -0
- package/template/.agents/skills/shadcn/customization.md +209 -0
- package/template/.agents/skills/shadcn/mcp.md +105 -0
- package/template/.agents/skills/shadcn/registry.md +277 -0
- package/template/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
- package/template/.agents/skills/shadcn/rules/chat.md +224 -0
- package/template/.agents/skills/shadcn/rules/composition.md +213 -0
- package/template/.agents/skills/shadcn/rules/forms.md +192 -0
- package/template/.agents/skills/shadcn/rules/icons.md +101 -0
- package/template/.agents/skills/shadcn/rules/styling.md +185 -0
- package/template/AGENTS.md +7 -4
- package/template/README.md +21 -4
- package/template/components.json +9 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/utils.ts +6 -0
- package/template/package.json +27 -5
- package/template/pages/getting-started/index.tsx +51 -45
- package/template/styles/globals.css +118 -0
- package/template/tsconfig.json +13 -2
- package/template/ui/accordion.tsx +64 -0
- package/template/ui/alert-dialog.tsx +196 -0
- package/template/ui/alert.tsx +66 -0
- package/template/ui/aspect-ratio.tsx +11 -0
- package/template/ui/attachment.tsx +204 -0
- package/template/ui/avatar.tsx +107 -0
- package/template/ui/badge.tsx +48 -0
- package/template/ui/breadcrumb.tsx +109 -0
- package/template/ui/bubble.tsx +125 -0
- package/template/ui/button-group.tsx +83 -0
- package/template/ui/button.tsx +64 -0
- package/template/ui/calendar.tsx +218 -0
- package/template/ui/card.tsx +92 -0
- package/template/ui/carousel.tsx +241 -0
- package/template/ui/chart.tsx +374 -0
- package/template/ui/checkbox.tsx +32 -0
- package/template/ui/collapsible.tsx +31 -0
- package/template/ui/combobox.tsx +308 -0
- package/template/ui/command.tsx +182 -0
- package/template/ui/context-menu.tsx +252 -0
- package/template/ui/dialog.tsx +156 -0
- package/template/ui/direction.tsx +22 -0
- package/template/ui/drawer.tsx +133 -0
- package/template/ui/dropdown-menu.tsx +257 -0
- package/template/ui/empty.tsx +104 -0
- package/template/ui/field.tsx +246 -0
- package/template/ui/form.tsx +167 -0
- package/template/ui/hover-card.tsx +42 -0
- package/template/ui/input-group.tsx +170 -0
- package/template/ui/input-otp.tsx +77 -0
- package/template/ui/input.tsx +21 -0
- package/template/ui/item.tsx +193 -0
- package/template/ui/kbd.tsx +28 -0
- package/template/ui/label.tsx +22 -0
- package/template/ui/marker.tsx +69 -0
- package/template/ui/menubar.tsx +276 -0
- package/template/ui/message-scroller.tsx +128 -0
- package/template/ui/message.tsx +92 -0
- package/template/ui/native-select.tsx +62 -0
- package/template/ui/navigation-menu.tsx +168 -0
- package/template/ui/pagination.tsx +127 -0
- package/template/ui/popover.tsx +87 -0
- package/template/ui/progress.tsx +31 -0
- package/template/ui/radio-group.tsx +43 -0
- package/template/ui/resizable.tsx +53 -0
- package/template/ui/scroll-area.tsx +56 -0
- package/template/ui/select.tsx +190 -0
- package/template/ui/separator.tsx +26 -0
- package/template/ui/sheet.tsx +143 -0
- package/template/ui/sidebar.tsx +726 -0
- package/template/ui/skeleton.tsx +13 -0
- package/template/ui/slider.tsx +61 -0
- package/template/ui/sonner.tsx +40 -0
- package/template/ui/spinner.tsx +16 -0
- package/template/ui/switch.tsx +33 -0
- package/template/ui/table.tsx +116 -0
- package/template/ui/tabs.tsx +89 -0
- package/template/ui/textarea.tsx +18 -0
- package/template/ui/toggle-group.tsx +81 -0
- package/template/ui/toggle.tsx +47 -0
- package/template/ui/tooltip.tsx +55 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react"
|
|
3
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import { Button } from "@/ui/button"
|
|
7
|
+
import {
|
|
8
|
+
InputGroup,
|
|
9
|
+
InputGroupAddon,
|
|
10
|
+
InputGroupButton,
|
|
11
|
+
InputGroupInput,
|
|
12
|
+
} from "@/ui/input-group"
|
|
13
|
+
|
|
14
|
+
const Combobox = ComboboxPrimitive.Root
|
|
15
|
+
|
|
16
|
+
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
17
|
+
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function ComboboxTrigger({
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}: ComboboxPrimitive.Trigger.Props) {
|
|
25
|
+
return (
|
|
26
|
+
<ComboboxPrimitive.Trigger
|
|
27
|
+
data-slot="combobox-trigger"
|
|
28
|
+
className={cn("[&_svg:not([class*='size-'])]:size-4", className)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
<ChevronDownIcon
|
|
33
|
+
data-slot="combobox-trigger-icon"
|
|
34
|
+
className="pointer-events-none size-4 text-muted-foreground"
|
|
35
|
+
/>
|
|
36
|
+
</ComboboxPrimitive.Trigger>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
41
|
+
return (
|
|
42
|
+
<ComboboxPrimitive.Clear
|
|
43
|
+
data-slot="combobox-clear"
|
|
44
|
+
render={<InputGroupButton variant="ghost" size="icon-xs" />}
|
|
45
|
+
className={cn(className)}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
<XIcon className="pointer-events-none" />
|
|
49
|
+
</ComboboxPrimitive.Clear>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function ComboboxInput({
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
disabled = false,
|
|
57
|
+
showTrigger = true,
|
|
58
|
+
showClear = false,
|
|
59
|
+
...props
|
|
60
|
+
}: ComboboxPrimitive.Input.Props & {
|
|
61
|
+
showTrigger?: boolean
|
|
62
|
+
showClear?: boolean
|
|
63
|
+
}) {
|
|
64
|
+
return (
|
|
65
|
+
<InputGroup className={cn("w-auto", className)}>
|
|
66
|
+
<ComboboxPrimitive.Input
|
|
67
|
+
render={<InputGroupInput disabled={disabled} />}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
<InputGroupAddon align="inline-end">
|
|
71
|
+
{showTrigger && (
|
|
72
|
+
<InputGroupButton
|
|
73
|
+
size="icon-xs"
|
|
74
|
+
variant="ghost"
|
|
75
|
+
asChild
|
|
76
|
+
data-slot="input-group-button"
|
|
77
|
+
className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
78
|
+
disabled={disabled}
|
|
79
|
+
>
|
|
80
|
+
<ComboboxTrigger />
|
|
81
|
+
</InputGroupButton>
|
|
82
|
+
)}
|
|
83
|
+
{showClear && <ComboboxClear disabled={disabled} />}
|
|
84
|
+
</InputGroupAddon>
|
|
85
|
+
{children}
|
|
86
|
+
</InputGroup>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function ComboboxContent({
|
|
91
|
+
className,
|
|
92
|
+
side = "bottom",
|
|
93
|
+
sideOffset = 6,
|
|
94
|
+
align = "start",
|
|
95
|
+
alignOffset = 0,
|
|
96
|
+
anchor,
|
|
97
|
+
...props
|
|
98
|
+
}: ComboboxPrimitive.Popup.Props &
|
|
99
|
+
Pick<
|
|
100
|
+
ComboboxPrimitive.Positioner.Props,
|
|
101
|
+
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
|
|
102
|
+
>) {
|
|
103
|
+
return (
|
|
104
|
+
<ComboboxPrimitive.Portal>
|
|
105
|
+
<ComboboxPrimitive.Positioner
|
|
106
|
+
side={side}
|
|
107
|
+
sideOffset={sideOffset}
|
|
108
|
+
align={align}
|
|
109
|
+
alignOffset={alignOffset}
|
|
110
|
+
anchor={anchor}
|
|
111
|
+
className="isolate z-50"
|
|
112
|
+
>
|
|
113
|
+
<ComboboxPrimitive.Popup
|
|
114
|
+
data-slot="combobox-content"
|
|
115
|
+
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
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
</ComboboxPrimitive.Positioner>
|
|
123
|
+
</ComboboxPrimitive.Portal>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
128
|
+
return (
|
|
129
|
+
<ComboboxPrimitive.List
|
|
130
|
+
data-slot="combobox-list"
|
|
131
|
+
className={cn(
|
|
132
|
+
"max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0",
|
|
133
|
+
className
|
|
134
|
+
)}
|
|
135
|
+
{...props}
|
|
136
|
+
/>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function ComboboxItem({
|
|
141
|
+
className,
|
|
142
|
+
children,
|
|
143
|
+
...props
|
|
144
|
+
}: ComboboxPrimitive.Item.Props) {
|
|
145
|
+
return (
|
|
146
|
+
<ComboboxPrimitive.Item
|
|
147
|
+
data-slot="combobox-item"
|
|
148
|
+
className={cn(
|
|
149
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent 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
|
+
className
|
|
151
|
+
)}
|
|
152
|
+
{...props}
|
|
153
|
+
>
|
|
154
|
+
{children}
|
|
155
|
+
<ComboboxPrimitive.ItemIndicator
|
|
156
|
+
data-slot="combobox-item-indicator"
|
|
157
|
+
render={
|
|
158
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
159
|
+
}
|
|
160
|
+
>
|
|
161
|
+
<CheckIcon className="pointer-events-none size-4 pointer-coarse:size-5" />
|
|
162
|
+
</ComboboxPrimitive.ItemIndicator>
|
|
163
|
+
</ComboboxPrimitive.Item>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
168
|
+
return (
|
|
169
|
+
<ComboboxPrimitive.Group
|
|
170
|
+
data-slot="combobox-group"
|
|
171
|
+
className={cn(className)}
|
|
172
|
+
{...props}
|
|
173
|
+
/>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function ComboboxLabel({
|
|
178
|
+
className,
|
|
179
|
+
...props
|
|
180
|
+
}: ComboboxPrimitive.GroupLabel.Props) {
|
|
181
|
+
return (
|
|
182
|
+
<ComboboxPrimitive.GroupLabel
|
|
183
|
+
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
|
+
)}
|
|
188
|
+
{...props}
|
|
189
|
+
/>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
194
|
+
return (
|
|
195
|
+
<ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
200
|
+
return (
|
|
201
|
+
<ComboboxPrimitive.Empty
|
|
202
|
+
data-slot="combobox-empty"
|
|
203
|
+
className={cn(
|
|
204
|
+
"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",
|
|
205
|
+
className
|
|
206
|
+
)}
|
|
207
|
+
{...props}
|
|
208
|
+
/>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function ComboboxSeparator({
|
|
213
|
+
className,
|
|
214
|
+
...props
|
|
215
|
+
}: ComboboxPrimitive.Separator.Props) {
|
|
216
|
+
return (
|
|
217
|
+
<ComboboxPrimitive.Separator
|
|
218
|
+
data-slot="combobox-separator"
|
|
219
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
220
|
+
{...props}
|
|
221
|
+
/>
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function ComboboxChips({
|
|
226
|
+
className,
|
|
227
|
+
...props
|
|
228
|
+
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &
|
|
229
|
+
ComboboxPrimitive.Chips.Props) {
|
|
230
|
+
return (
|
|
231
|
+
<ComboboxPrimitive.Chips
|
|
232
|
+
data-slot="combobox-chips"
|
|
233
|
+
className={cn(
|
|
234
|
+
"flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
|
|
235
|
+
className
|
|
236
|
+
)}
|
|
237
|
+
{...props}
|
|
238
|
+
/>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function ComboboxChip({
|
|
243
|
+
className,
|
|
244
|
+
children,
|
|
245
|
+
showRemove = true,
|
|
246
|
+
...props
|
|
247
|
+
}: ComboboxPrimitive.Chip.Props & {
|
|
248
|
+
showRemove?: boolean
|
|
249
|
+
}) {
|
|
250
|
+
return (
|
|
251
|
+
<ComboboxPrimitive.Chip
|
|
252
|
+
data-slot="combobox-chip"
|
|
253
|
+
className={cn(
|
|
254
|
+
"flex h-[calc(--spacing(5.5))] 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
|
+
className
|
|
256
|
+
)}
|
|
257
|
+
{...props}
|
|
258
|
+
>
|
|
259
|
+
{children}
|
|
260
|
+
{showRemove && (
|
|
261
|
+
<ComboboxPrimitive.ChipRemove
|
|
262
|
+
render={<Button variant="ghost" size="icon-xs" />}
|
|
263
|
+
className="-ml-1 opacity-50 hover:opacity-100"
|
|
264
|
+
data-slot="combobox-chip-remove"
|
|
265
|
+
>
|
|
266
|
+
<XIcon className="pointer-events-none" />
|
|
267
|
+
</ComboboxPrimitive.ChipRemove>
|
|
268
|
+
)}
|
|
269
|
+
</ComboboxPrimitive.Chip>
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function ComboboxChipsInput({
|
|
274
|
+
className,
|
|
275
|
+
children,
|
|
276
|
+
...props
|
|
277
|
+
}: ComboboxPrimitive.Input.Props) {
|
|
278
|
+
return (
|
|
279
|
+
<ComboboxPrimitive.Input
|
|
280
|
+
data-slot="combobox-chip-input"
|
|
281
|
+
className={cn("min-w-16 flex-1 outline-none", className)}
|
|
282
|
+
{...props}
|
|
283
|
+
/>
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function useComboboxAnchor() {
|
|
288
|
+
return React.useRef<HTMLDivElement | null>(null)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export {
|
|
292
|
+
Combobox,
|
|
293
|
+
ComboboxInput,
|
|
294
|
+
ComboboxContent,
|
|
295
|
+
ComboboxList,
|
|
296
|
+
ComboboxItem,
|
|
297
|
+
ComboboxGroup,
|
|
298
|
+
ComboboxLabel,
|
|
299
|
+
ComboboxCollection,
|
|
300
|
+
ComboboxEmpty,
|
|
301
|
+
ComboboxSeparator,
|
|
302
|
+
ComboboxChips,
|
|
303
|
+
ComboboxChip,
|
|
304
|
+
ComboboxChipsInput,
|
|
305
|
+
ComboboxTrigger,
|
|
306
|
+
ComboboxValue,
|
|
307
|
+
useComboboxAnchor,
|
|
308
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk"
|
|
3
|
+
import { SearchIcon } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogDescription,
|
|
10
|
+
DialogHeader,
|
|
11
|
+
DialogTitle,
|
|
12
|
+
} from "@/ui/dialog"
|
|
13
|
+
|
|
14
|
+
function Command({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
18
|
+
return (
|
|
19
|
+
<CommandPrimitive
|
|
20
|
+
data-slot="command"
|
|
21
|
+
className={cn(
|
|
22
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function CommandDialog({
|
|
31
|
+
title = "Command Palette",
|
|
32
|
+
description = "Search for a command to run...",
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
showCloseButton = true,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof Dialog> & {
|
|
38
|
+
title?: string
|
|
39
|
+
description?: string
|
|
40
|
+
className?: string
|
|
41
|
+
showCloseButton?: boolean
|
|
42
|
+
}) {
|
|
43
|
+
return (
|
|
44
|
+
<Dialog {...props}>
|
|
45
|
+
<DialogHeader className="sr-only">
|
|
46
|
+
<DialogTitle>{title}</DialogTitle>
|
|
47
|
+
<DialogDescription>{description}</DialogDescription>
|
|
48
|
+
</DialogHeader>
|
|
49
|
+
<DialogContent
|
|
50
|
+
className={cn("overflow-hidden p-0", className)}
|
|
51
|
+
showCloseButton={showCloseButton}
|
|
52
|
+
>
|
|
53
|
+
<Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
54
|
+
{children}
|
|
55
|
+
</Command>
|
|
56
|
+
</DialogContent>
|
|
57
|
+
</Dialog>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function CommandInput({
|
|
62
|
+
className,
|
|
63
|
+
...props
|
|
64
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
data-slot="command-input-wrapper"
|
|
68
|
+
className="flex h-9 items-center gap-2 border-b px-3"
|
|
69
|
+
>
|
|
70
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
71
|
+
<CommandPrimitive.Input
|
|
72
|
+
data-slot="command-input"
|
|
73
|
+
className={cn(
|
|
74
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
75
|
+
className
|
|
76
|
+
)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function CommandList({
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
87
|
+
return (
|
|
88
|
+
<CommandPrimitive.List
|
|
89
|
+
data-slot="command-list"
|
|
90
|
+
className={cn(
|
|
91
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
92
|
+
className
|
|
93
|
+
)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function CommandEmpty({
|
|
100
|
+
...props
|
|
101
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
102
|
+
return (
|
|
103
|
+
<CommandPrimitive.Empty
|
|
104
|
+
data-slot="command-empty"
|
|
105
|
+
className="py-6 text-center text-sm"
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function CommandGroup({
|
|
112
|
+
className,
|
|
113
|
+
...props
|
|
114
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
115
|
+
return (
|
|
116
|
+
<CommandPrimitive.Group
|
|
117
|
+
data-slot="command-group"
|
|
118
|
+
className={cn(
|
|
119
|
+
"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
|
+
className
|
|
121
|
+
)}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function CommandSeparator({
|
|
128
|
+
className,
|
|
129
|
+
...props
|
|
130
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
131
|
+
return (
|
|
132
|
+
<CommandPrimitive.Separator
|
|
133
|
+
data-slot="command-separator"
|
|
134
|
+
className={cn("-mx-1 h-px bg-border", className)}
|
|
135
|
+
{...props}
|
|
136
|
+
/>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function CommandItem({
|
|
141
|
+
className,
|
|
142
|
+
...props
|
|
143
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
144
|
+
return (
|
|
145
|
+
<CommandPrimitive.Item
|
|
146
|
+
data-slot="command-item"
|
|
147
|
+
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-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
149
|
+
className
|
|
150
|
+
)}
|
|
151
|
+
{...props}
|
|
152
|
+
/>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function CommandShortcut({
|
|
157
|
+
className,
|
|
158
|
+
...props
|
|
159
|
+
}: React.ComponentProps<"span">) {
|
|
160
|
+
return (
|
|
161
|
+
<span
|
|
162
|
+
data-slot="command-shortcut"
|
|
163
|
+
className={cn(
|
|
164
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
165
|
+
className
|
|
166
|
+
)}
|
|
167
|
+
{...props}
|
|
168
|
+
/>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
Command,
|
|
174
|
+
CommandDialog,
|
|
175
|
+
CommandInput,
|
|
176
|
+
CommandList,
|
|
177
|
+
CommandEmpty,
|
|
178
|
+
CommandGroup,
|
|
179
|
+
CommandItem,
|
|
180
|
+
CommandShortcut,
|
|
181
|
+
CommandSeparator,
|
|
182
|
+
}
|