@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,118 @@
|
|
|
1
|
+
@import "tailwindcss" source(none);
|
|
2
|
+
@source "../pages";
|
|
3
|
+
@source "../ui";
|
|
4
|
+
@source "../lib";
|
|
5
|
+
@source "../hooks";
|
|
6
|
+
@source "../themes";
|
|
7
|
+
|
|
8
|
+
@custom-variant dark (&:is(.dark *));
|
|
9
|
+
|
|
10
|
+
:root {
|
|
11
|
+
--sidebar: oklch(0.985 0 0);
|
|
12
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
13
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
14
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
15
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
16
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
17
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
18
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
19
|
+
--background: oklch(1 0 0);
|
|
20
|
+
--foreground: oklch(0.145 0 0);
|
|
21
|
+
--card: oklch(1 0 0);
|
|
22
|
+
--card-foreground: oklch(0.145 0 0);
|
|
23
|
+
--popover: oklch(1 0 0);
|
|
24
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
25
|
+
--primary: oklch(0.205 0 0);
|
|
26
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
27
|
+
--secondary: oklch(0.97 0 0);
|
|
28
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
29
|
+
--muted: oklch(0.97 0 0);
|
|
30
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
31
|
+
--accent: oklch(0.97 0 0);
|
|
32
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
33
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
34
|
+
--border: oklch(0.922 0 0);
|
|
35
|
+
--input: oklch(0.922 0 0);
|
|
36
|
+
--ring: oklch(0.708 0 0);
|
|
37
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
38
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
39
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
40
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
41
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
42
|
+
--radius: 0.625rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dark {
|
|
46
|
+
--sidebar: oklch(0.205 0 0);
|
|
47
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
48
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
49
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
50
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
51
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
52
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
53
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
54
|
+
--background: oklch(0.145 0 0);
|
|
55
|
+
--foreground: oklch(0.985 0 0);
|
|
56
|
+
--card: oklch(0.205 0 0);
|
|
57
|
+
--card-foreground: oklch(0.985 0 0);
|
|
58
|
+
--popover: oklch(0.205 0 0);
|
|
59
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
60
|
+
--primary: oklch(0.922 0 0);
|
|
61
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
62
|
+
--secondary: oklch(0.269 0 0);
|
|
63
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
64
|
+
--muted: oklch(0.269 0 0);
|
|
65
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
66
|
+
--accent: oklch(0.269 0 0);
|
|
67
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
68
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
69
|
+
--border: oklch(1 0 0 / 10%);
|
|
70
|
+
--input: oklch(1 0 0 / 15%);
|
|
71
|
+
--ring: oklch(0.556 0 0);
|
|
72
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
73
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
74
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
75
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
76
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@theme inline {
|
|
80
|
+
--color-sidebar: var(--sidebar);
|
|
81
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
82
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
83
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
84
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
85
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
86
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
87
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
88
|
+
--color-chart-5: var(--chart-5);
|
|
89
|
+
--color-chart-4: var(--chart-4);
|
|
90
|
+
--color-chart-3: var(--chart-3);
|
|
91
|
+
--color-chart-2: var(--chart-2);
|
|
92
|
+
--color-chart-1: var(--chart-1);
|
|
93
|
+
--color-ring: var(--ring);
|
|
94
|
+
--color-input: var(--input);
|
|
95
|
+
--color-border: var(--border);
|
|
96
|
+
--color-destructive: var(--destructive);
|
|
97
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
98
|
+
--color-accent: var(--accent);
|
|
99
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
100
|
+
--color-muted: var(--muted);
|
|
101
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
102
|
+
--color-secondary: var(--secondary);
|
|
103
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
104
|
+
--color-primary: var(--primary);
|
|
105
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
106
|
+
--color-popover: var(--popover);
|
|
107
|
+
--color-card-foreground: var(--card-foreground);
|
|
108
|
+
--color-card: var(--card);
|
|
109
|
+
--color-foreground: var(--foreground);
|
|
110
|
+
--color-background: var(--background);
|
|
111
|
+
--radius-sm: calc(var(--radius) * 0.6);
|
|
112
|
+
--radius-md: calc(var(--radius) * 0.8);
|
|
113
|
+
--radius-lg: var(--radius);
|
|
114
|
+
--radius-xl: calc(var(--radius) * 1.4);
|
|
115
|
+
--radius-2xl: calc(var(--radius) * 1.8);
|
|
116
|
+
--radius-3xl: calc(var(--radius) * 2.2);
|
|
117
|
+
--radius-4xl: calc(var(--radius) * 2.6);
|
|
118
|
+
}
|
package/template/tsconfig.json
CHANGED
|
@@ -11,7 +11,18 @@
|
|
|
11
11
|
"noEmit": true,
|
|
12
12
|
"strict": true,
|
|
13
13
|
"skipLibCheck": true,
|
|
14
|
-
"types": ["@autono/open-pages/env"]
|
|
14
|
+
"types": ["@autono/open-pages/env"],
|
|
15
|
+
"baseUrl": ".",
|
|
16
|
+
"paths": {
|
|
17
|
+
"@/*": ["./*"]
|
|
18
|
+
}
|
|
15
19
|
},
|
|
16
|
-
"include": [
|
|
20
|
+
"include": [
|
|
21
|
+
"pages/**/*",
|
|
22
|
+
"ui/**/*",
|
|
23
|
+
"lib/**/*",
|
|
24
|
+
"hooks/**/*",
|
|
25
|
+
"themes/**/*",
|
|
26
|
+
"open-pages.config.ts"
|
|
27
|
+
]
|
|
17
28
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
3
|
+
import { Accordion as AccordionPrimitive } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
function Accordion({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
10
|
+
return <AccordionPrimitive.Root data-slot="accordion" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function AccordionItem({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
17
|
+
return (
|
|
18
|
+
<AccordionPrimitive.Item
|
|
19
|
+
data-slot="accordion-item"
|
|
20
|
+
className={cn("border-b last:border-b-0", className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function AccordionTrigger({
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
31
|
+
return (
|
|
32
|
+
<AccordionPrimitive.Header className="flex">
|
|
33
|
+
<AccordionPrimitive.Trigger
|
|
34
|
+
data-slot="accordion-trigger"
|
|
35
|
+
className={cn(
|
|
36
|
+
"flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
<ChevronDownIcon className="pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" />
|
|
43
|
+
</AccordionPrimitive.Trigger>
|
|
44
|
+
</AccordionPrimitive.Header>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function AccordionContent({
|
|
49
|
+
className,
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
53
|
+
return (
|
|
54
|
+
<AccordionPrimitive.Content
|
|
55
|
+
data-slot="accordion-content"
|
|
56
|
+
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
60
|
+
</AccordionPrimitive.Content>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { Button } from "@/ui/button"
|
|
8
|
+
|
|
9
|
+
function AlertDialog({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function AlertDialogTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
+
return (
|
|
19
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function AlertDialogPortal({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
+
return (
|
|
27
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function AlertDialogOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<AlertDialogPrimitive.Overlay
|
|
37
|
+
data-slot="alert-dialog-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function AlertDialogContent({
|
|
48
|
+
className,
|
|
49
|
+
size = "default",
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
52
|
+
size?: "default" | "sm"
|
|
53
|
+
}) {
|
|
54
|
+
return (
|
|
55
|
+
<AlertDialogPortal>
|
|
56
|
+
<AlertDialogOverlay />
|
|
57
|
+
<AlertDialogPrimitive.Content
|
|
58
|
+
data-slot="alert-dialog-content"
|
|
59
|
+
data-size={size}
|
|
60
|
+
className={cn(
|
|
61
|
+
"group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs 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 data-[size=default]:sm:max-w-lg",
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
</AlertDialogPortal>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function AlertDialogHeader({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<"div">) {
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
data-slot="alert-dialog-header"
|
|
77
|
+
className={cn(
|
|
78
|
+
"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function AlertDialogFooter({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<"div">) {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
data-slot="alert-dialog-footer"
|
|
93
|
+
className={cn(
|
|
94
|
+
"flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function AlertDialogTitle({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
106
|
+
return (
|
|
107
|
+
<AlertDialogPrimitive.Title
|
|
108
|
+
data-slot="alert-dialog-title"
|
|
109
|
+
className={cn(
|
|
110
|
+
"text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function AlertDialogDescription({
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
122
|
+
return (
|
|
123
|
+
<AlertDialogPrimitive.Description
|
|
124
|
+
data-slot="alert-dialog-description"
|
|
125
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function AlertDialogMedia({
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}: React.ComponentProps<"div">) {
|
|
135
|
+
return (
|
|
136
|
+
<div
|
|
137
|
+
data-slot="alert-dialog-media"
|
|
138
|
+
className={cn(
|
|
139
|
+
"mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
140
|
+
className
|
|
141
|
+
)}
|
|
142
|
+
{...props}
|
|
143
|
+
/>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function AlertDialogAction({
|
|
148
|
+
className,
|
|
149
|
+
variant = "default",
|
|
150
|
+
size = "default",
|
|
151
|
+
...props
|
|
152
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
|
|
153
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
154
|
+
return (
|
|
155
|
+
<Button variant={variant} size={size} asChild>
|
|
156
|
+
<AlertDialogPrimitive.Action
|
|
157
|
+
data-slot="alert-dialog-action"
|
|
158
|
+
className={cn(className)}
|
|
159
|
+
{...props}
|
|
160
|
+
/>
|
|
161
|
+
</Button>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function AlertDialogCancel({
|
|
166
|
+
className,
|
|
167
|
+
variant = "outline",
|
|
168
|
+
size = "default",
|
|
169
|
+
...props
|
|
170
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
|
|
171
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
172
|
+
return (
|
|
173
|
+
<Button variant={variant} size={size} asChild>
|
|
174
|
+
<AlertDialogPrimitive.Cancel
|
|
175
|
+
data-slot="alert-dialog-cancel"
|
|
176
|
+
className={cn(className)}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
</Button>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export {
|
|
184
|
+
AlertDialog,
|
|
185
|
+
AlertDialogAction,
|
|
186
|
+
AlertDialogCancel,
|
|
187
|
+
AlertDialogContent,
|
|
188
|
+
AlertDialogDescription,
|
|
189
|
+
AlertDialogFooter,
|
|
190
|
+
AlertDialogHeader,
|
|
191
|
+
AlertDialogMedia,
|
|
192
|
+
AlertDialogOverlay,
|
|
193
|
+
AlertDialogPortal,
|
|
194
|
+
AlertDialogTitle,
|
|
195
|
+
AlertDialogTrigger,
|
|
196
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
function Alert({
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
data-slot="alert"
|
|
30
|
+
role="alert"
|
|
31
|
+
className={cn(alertVariants({ variant }), className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="alert-title"
|
|
41
|
+
className={cn(
|
|
42
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function AlertDescription({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<"div">) {
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
data-slot="alert-description"
|
|
57
|
+
className={cn(
|
|
58
|
+
"col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Alert, AlertTitle, AlertDescription }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { AspectRatio as AspectRatioPrimitive } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
function AspectRatio({
|
|
6
|
+
...props
|
|
7
|
+
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
|
8
|
+
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { AspectRatio }
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import { Button } from "@/ui/button"
|
|
7
|
+
|
|
8
|
+
const attachmentVariants = cva(
|
|
9
|
+
"group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
default:
|
|
14
|
+
"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
15
|
+
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
16
|
+
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1",
|
|
17
|
+
},
|
|
18
|
+
orientation: {
|
|
19
|
+
horizontal: "min-w-40 items-center",
|
|
20
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
function Attachment({
|
|
27
|
+
className,
|
|
28
|
+
state = "done",
|
|
29
|
+
size = "default",
|
|
30
|
+
orientation = "horizontal",
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<"div"> &
|
|
33
|
+
VariantProps<typeof attachmentVariants> & {
|
|
34
|
+
state?: "idle" | "uploading" | "processing" | "error" | "done"
|
|
35
|
+
}) {
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
data-slot="attachment"
|
|
39
|
+
data-state={state}
|
|
40
|
+
data-size={size}
|
|
41
|
+
data-orientation={orientation}
|
|
42
|
+
className={cn(attachmentVariants({ size, orientation }), className)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const attachmentMediaVariants = cva(
|
|
49
|
+
"relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
variant: {
|
|
53
|
+
icon: "",
|
|
54
|
+
image:
|
|
55
|
+
"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
defaultVariants: {
|
|
59
|
+
variant: "icon",
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
function AttachmentMedia({
|
|
65
|
+
className,
|
|
66
|
+
variant = "icon",
|
|
67
|
+
...props
|
|
68
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>) {
|
|
69
|
+
return (
|
|
70
|
+
<div
|
|
71
|
+
data-slot="attachment-media"
|
|
72
|
+
data-variant={variant}
|
|
73
|
+
className={cn(attachmentMediaVariants({ variant }), className)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function AttachmentContent({
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}: React.ComponentProps<"div">) {
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
data-slot="attachment-content"
|
|
86
|
+
className={cn(
|
|
87
|
+
"max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",
|
|
88
|
+
className
|
|
89
|
+
)}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function AttachmentTitle({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<"span">) {
|
|
99
|
+
return (
|
|
100
|
+
<span
|
|
101
|
+
data-slot="attachment-title"
|
|
102
|
+
className={cn(
|
|
103
|
+
"block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",
|
|
104
|
+
className
|
|
105
|
+
)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function AttachmentDescription({
|
|
112
|
+
className,
|
|
113
|
+
...props
|
|
114
|
+
}: React.ComponentProps<"span">) {
|
|
115
|
+
return (
|
|
116
|
+
<span
|
|
117
|
+
data-slot="attachment-description"
|
|
118
|
+
className={cn(
|
|
119
|
+
"mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80",
|
|
120
|
+
"max-w-full",
|
|
121
|
+
className
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function AttachmentActions({
|
|
129
|
+
className,
|
|
130
|
+
...props
|
|
131
|
+
}: React.ComponentProps<"div">) {
|
|
132
|
+
return (
|
|
133
|
+
<div
|
|
134
|
+
data-slot="attachment-actions"
|
|
135
|
+
className={cn(
|
|
136
|
+
"relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1",
|
|
137
|
+
className
|
|
138
|
+
)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function AttachmentAction({
|
|
145
|
+
className,
|
|
146
|
+
variant,
|
|
147
|
+
size = "icon-xs",
|
|
148
|
+
...props
|
|
149
|
+
}: React.ComponentProps<typeof Button>) {
|
|
150
|
+
return (
|
|
151
|
+
<Button
|
|
152
|
+
data-slot="attachment-action"
|
|
153
|
+
variant={variant ?? "ghost"}
|
|
154
|
+
size={size}
|
|
155
|
+
className={cn(className)}
|
|
156
|
+
{...props}
|
|
157
|
+
/>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function AttachmentTrigger({
|
|
162
|
+
className,
|
|
163
|
+
asChild = false,
|
|
164
|
+
type,
|
|
165
|
+
...props
|
|
166
|
+
}: React.ComponentProps<"button"> & {
|
|
167
|
+
asChild?: boolean
|
|
168
|
+
}) {
|
|
169
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<Comp
|
|
173
|
+
data-slot="attachment-trigger"
|
|
174
|
+
type={asChild ? undefined : (type ?? "button")}
|
|
175
|
+
className={cn("absolute inset-0 z-10 outline-none", className)}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
182
|
+
return (
|
|
183
|
+
<div
|
|
184
|
+
data-slot="attachment-group"
|
|
185
|
+
className={cn(
|
|
186
|
+
"flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start",
|
|
187
|
+
className
|
|
188
|
+
)}
|
|
189
|
+
{...props}
|
|
190
|
+
/>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export {
|
|
195
|
+
Attachment,
|
|
196
|
+
AttachmentGroup,
|
|
197
|
+
AttachmentMedia,
|
|
198
|
+
AttachmentContent,
|
|
199
|
+
AttachmentTitle,
|
|
200
|
+
AttachmentDescription,
|
|
201
|
+
AttachmentActions,
|
|
202
|
+
AttachmentAction,
|
|
203
|
+
AttachmentTrigger,
|
|
204
|
+
}
|