@autono/open-pages 0.5.0 → 0.7.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/{build-L50pau9v.js → build-CCoxDxL-.js} +11 -10
- package/dist/cli/bin.d.ts +1 -1
- package/dist/cli/bin.js +434 -28
- package/dist/{config-CDUdFE8N.js → config-D_U_aCQz.js} +484 -460
- package/dist/{config-C9or4m4J.d.ts → config-p-TWNXbv.d.ts} +4 -4
- package/dist/{design-C13iz9_4.js → design-Cpqx7SJs.js} +1 -2
- package/dist/{dev-CzJYXFOO.js → dev-CTrB263u.js} +40 -20
- package/dist/{export-DbVwSmKW.js → export-enKL9R7x.js} +7 -10
- package/dist/index.d.ts +6 -8
- package/dist/index.js +2 -3
- package/dist/locale/index.d.ts +8 -14
- package/dist/locale/index.js +67 -32
- package/dist/{open-pages-plugin-C0poXLsx.js → open-pages-plugin-C8cFhMB9.js} +23 -38
- package/dist/preview-Dmzyd1cf.js +24 -0
- package/dist/sync-ui-BzRiAGCK.js +132 -0
- package/dist/{types-C5NCdDT-.d.ts → types-DDdUFUIS.d.ts} +19 -6
- package/dist/{update-CV62NhBT.js → update-CWaCKlnl.js} +14 -5
- package/dist/{update-package-Cxt57pz7.js → update-package-GaNsVdr8.js} +50 -22
- package/dist/{version-B6AiiGvT.js → version-DZrXLoAD.js} +19 -3
- package/dist/vite/index.d.ts +3 -7
- package/dist/vite/index.js +2 -7
- package/package.json +24 -22
- package/src/app/app.tsx +19 -14
- package/src/app/assets/autono-social.png +0 -0
- package/src/app/assets/autono.svg +7 -0
- package/src/app/components/asset-view.tsx +510 -26
- package/src/app/components/command/command-menu.tsx +5 -1
- package/src/app/components/command/command.tsx +4 -2
- package/src/app/components/command/home-command-menu.tsx +6 -6
- package/src/app/components/icon-tooltip.tsx +24 -15
- package/src/app/components/sidebar/folder-item.tsx +46 -19
- package/src/app/components/sidebar/icon-picker.tsx +1 -1
- package/src/app/components/sidebar/sidebar-footer.tsx +18 -7
- package/src/app/components/sidebar/sidebar.tsx +91 -64
- package/src/app/components/theme-toggle.tsx +4 -5
- package/src/app/components/themes/theme-detail.tsx +6 -3
- package/src/app/components/themes/themes-gallery.tsx +12 -7
- package/src/app/index.html +33 -2
- package/src/app/lib/assets.ts +33 -0
- package/src/app/lib/last-home-location.ts +18 -0
- package/src/app/main.tsx +10 -1
- package/src/app/routes/home-shell.tsx +82 -61
- package/src/app/routes/home.tsx +42 -39
- package/src/app/routes/page.tsx +18 -3
- package/src/app/routes/themes.tsx +6 -8
- package/src/app/styles.css +40 -4
- package/src/app/virtual.d.ts +1 -0
- package/src/locale/en.ts +17 -6
- package/src/locale/ja.ts +18 -6
- package/src/locale/types.ts +17 -4
- package/src/locale/zh-cn.ts +19 -8
- package/src/locale/zh-tw.ts +17 -6
- package/src/shared/update-package.ts +193 -0
- package/workspace/components.json +25 -0
- package/workspace/deps.json +24 -0
- package/workspace/hooks/use-mobile.ts +19 -0
- package/workspace/lib/utils.ts +6 -0
- package/workspace/styles/globals.css +135 -0
- package/workspace/ui/accordion.tsx +79 -0
- package/workspace/ui/alert-dialog.tsx +197 -0
- package/workspace/ui/alert.tsx +76 -0
- package/workspace/ui/aspect-ratio.tsx +11 -0
- package/workspace/ui/attachment.tsx +204 -0
- package/workspace/ui/avatar.tsx +110 -0
- package/workspace/ui/badge.tsx +49 -0
- package/workspace/ui/breadcrumb.tsx +122 -0
- package/workspace/ui/bubble.tsx +125 -0
- package/workspace/ui/button-group.tsx +83 -0
- package/workspace/ui/button.tsx +67 -0
- package/workspace/ui/calendar.tsx +222 -0
- package/workspace/ui/card.tsx +103 -0
- package/workspace/ui/carousel.tsx +240 -0
- package/workspace/ui/chart.tsx +373 -0
- package/workspace/ui/checkbox.tsx +31 -0
- package/workspace/ui/collapsible.tsx +33 -0
- package/workspace/ui/combobox.tsx +297 -0
- package/workspace/ui/command.tsx +195 -0
- package/workspace/ui/context-menu.tsx +261 -0
- package/workspace/ui/dialog.tsx +168 -0
- package/workspace/ui/direction.tsx +22 -0
- package/workspace/ui/drawer.tsx +132 -0
- package/workspace/ui/dropdown-menu.tsx +269 -0
- package/workspace/ui/empty.tsx +104 -0
- package/workspace/ui/field.tsx +236 -0
- package/workspace/ui/hover-card.tsx +42 -0
- package/workspace/ui/input-group.tsx +156 -0
- package/workspace/ui/input-otp.tsx +87 -0
- package/workspace/ui/input.tsx +19 -0
- package/workspace/ui/item.tsx +196 -0
- package/workspace/ui/kbd.tsx +26 -0
- package/workspace/ui/label.tsx +22 -0
- package/workspace/ui/marker.tsx +69 -0
- package/workspace/ui/menubar.tsx +280 -0
- package/workspace/ui/message-scroller.tsx +129 -0
- package/workspace/ui/message.tsx +92 -0
- package/workspace/ui/native-select.tsx +61 -0
- package/workspace/ui/navigation-menu.tsx +164 -0
- package/workspace/ui/pagination.tsx +129 -0
- package/workspace/ui/popover.tsx +87 -0
- package/workspace/ui/progress.tsx +31 -0
- package/workspace/ui/radio-group.tsx +42 -0
- package/workspace/ui/resizable.tsx +50 -0
- package/workspace/ui/scroll-area.tsx +53 -0
- package/workspace/ui/select.tsx +192 -0
- package/workspace/ui/separator.tsx +26 -0
- package/workspace/ui/sheet.tsx +147 -0
- package/workspace/ui/sidebar.tsx +702 -0
- package/workspace/ui/skeleton.tsx +13 -0
- package/workspace/ui/slider.tsx +59 -0
- package/workspace/ui/sonner.tsx +47 -0
- package/workspace/ui/spinner.tsx +10 -0
- package/workspace/ui/switch.tsx +33 -0
- package/workspace/ui/table.tsx +114 -0
- package/workspace/ui/tabs.tsx +90 -0
- package/workspace/ui/textarea.tsx +18 -0
- package/workspace/ui/toggle-group.tsx +87 -0
- package/workspace/ui/toggle.tsx +45 -0
- package/workspace/ui/tooltip.tsx +57 -0
- package/dist/export-BsK6OCpc.js +0 -4
- package/dist/preview-CPufRmuj.js +0 -21
- package/dist/sync-Be_hxSOF.js +0 -139
- package/dist/sync-lKEXyPOh.js +0 -3
- package/dist/version-CeffgdfZ.js +0 -3
- package/src/app/components/language-toggle.tsx +0 -46
- package/src/app/favicon.ico +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@import "tailwindcss" source(none);
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
@import "shadcn/tailwind.css";
|
|
4
|
+
@import "@fontsource-variable/geist";
|
|
5
|
+
@source "../pages";
|
|
6
|
+
@source "../ui";
|
|
7
|
+
@source "../lib";
|
|
8
|
+
@source "../hooks";
|
|
9
|
+
@source "../themes";
|
|
10
|
+
|
|
11
|
+
@custom-variant dark (&:is(.dark *));
|
|
12
|
+
|
|
13
|
+
@theme inline {
|
|
14
|
+
--font-heading: var(--font-sans);
|
|
15
|
+
--font-sans: 'Geist Variable', sans-serif;
|
|
16
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
17
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
18
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
19
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
20
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
21
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
22
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
23
|
+
--color-sidebar: var(--sidebar);
|
|
24
|
+
--color-chart-5: var(--chart-5);
|
|
25
|
+
--color-chart-4: var(--chart-4);
|
|
26
|
+
--color-chart-3: var(--chart-3);
|
|
27
|
+
--color-chart-2: var(--chart-2);
|
|
28
|
+
--color-chart-1: var(--chart-1);
|
|
29
|
+
--color-ring: var(--ring);
|
|
30
|
+
--color-input: var(--input);
|
|
31
|
+
--color-border: var(--border);
|
|
32
|
+
--color-destructive: var(--destructive);
|
|
33
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
34
|
+
--color-accent: var(--accent);
|
|
35
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
36
|
+
--color-muted: var(--muted);
|
|
37
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
38
|
+
--color-secondary: var(--secondary);
|
|
39
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
40
|
+
--color-primary: var(--primary);
|
|
41
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
42
|
+
--color-popover: var(--popover);
|
|
43
|
+
--color-card-foreground: var(--card-foreground);
|
|
44
|
+
--color-card: var(--card);
|
|
45
|
+
--color-foreground: var(--foreground);
|
|
46
|
+
--color-background: var(--background);
|
|
47
|
+
--radius-sm: calc(var(--radius) * 0.6);
|
|
48
|
+
--radius-md: calc(var(--radius) * 0.8);
|
|
49
|
+
--radius-lg: var(--radius);
|
|
50
|
+
--radius-xl: calc(var(--radius) * 1.4);
|
|
51
|
+
--radius-2xl: calc(var(--radius) * 1.8);
|
|
52
|
+
--radius-3xl: calc(var(--radius) * 2.2);
|
|
53
|
+
--radius-4xl: calc(var(--radius) * 2.6);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:root {
|
|
57
|
+
--background: oklch(1 0 0);
|
|
58
|
+
--foreground: oklch(0.145 0 0);
|
|
59
|
+
--card: oklch(1 0 0);
|
|
60
|
+
--card-foreground: oklch(0.145 0 0);
|
|
61
|
+
--popover: oklch(1 0 0);
|
|
62
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
63
|
+
--primary: oklch(0.205 0 0);
|
|
64
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
65
|
+
--secondary: oklch(0.97 0 0);
|
|
66
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
67
|
+
--muted: oklch(0.97 0 0);
|
|
68
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
69
|
+
--accent: oklch(0.97 0 0);
|
|
70
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
71
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
72
|
+
--border: oklch(0.922 0 0);
|
|
73
|
+
--input: oklch(0.922 0 0);
|
|
74
|
+
--ring: oklch(0.708 0 0);
|
|
75
|
+
--chart-1: oklch(0.87 0 0);
|
|
76
|
+
--chart-2: oklch(0.556 0 0);
|
|
77
|
+
--chart-3: oklch(0.439 0 0);
|
|
78
|
+
--chart-4: oklch(0.371 0 0);
|
|
79
|
+
--chart-5: oklch(0.269 0 0);
|
|
80
|
+
--radius: 0.625rem;
|
|
81
|
+
--sidebar: oklch(0.985 0 0);
|
|
82
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
83
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
84
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
85
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
86
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
87
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
88
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dark {
|
|
92
|
+
--background: oklch(0.145 0 0);
|
|
93
|
+
--foreground: oklch(0.985 0 0);
|
|
94
|
+
--card: oklch(0.205 0 0);
|
|
95
|
+
--card-foreground: oklch(0.985 0 0);
|
|
96
|
+
--popover: oklch(0.205 0 0);
|
|
97
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
98
|
+
--primary: oklch(0.922 0 0);
|
|
99
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
100
|
+
--secondary: oklch(0.269 0 0);
|
|
101
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
102
|
+
--muted: oklch(0.269 0 0);
|
|
103
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
104
|
+
--accent: oklch(0.269 0 0);
|
|
105
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
106
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
107
|
+
--border: oklch(1 0 0 / 10%);
|
|
108
|
+
--input: oklch(1 0 0 / 15%);
|
|
109
|
+
--ring: oklch(0.556 0 0);
|
|
110
|
+
--chart-1: oklch(0.87 0 0);
|
|
111
|
+
--chart-2: oklch(0.556 0 0);
|
|
112
|
+
--chart-3: oklch(0.439 0 0);
|
|
113
|
+
--chart-4: oklch(0.371 0 0);
|
|
114
|
+
--chart-5: oklch(0.269 0 0);
|
|
115
|
+
--sidebar: oklch(0.205 0 0);
|
|
116
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
117
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
118
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
119
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
120
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
121
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
122
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@layer base {
|
|
126
|
+
* {
|
|
127
|
+
@apply border-border outline-ring/50;
|
|
128
|
+
}
|
|
129
|
+
body {
|
|
130
|
+
@apply bg-background text-foreground;
|
|
131
|
+
}
|
|
132
|
+
html {
|
|
133
|
+
@apply font-sans;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
function Accordion({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
11
|
+
return (
|
|
12
|
+
<AccordionPrimitive.Root
|
|
13
|
+
data-slot="accordion"
|
|
14
|
+
className={cn("flex w-full flex-col", className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function AccordionItem({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
24
|
+
return (
|
|
25
|
+
<AccordionPrimitive.Item
|
|
26
|
+
data-slot="accordion-item"
|
|
27
|
+
className={cn("not-last:border-b", className)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function AccordionTrigger({
|
|
34
|
+
className,
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
38
|
+
return (
|
|
39
|
+
<AccordionPrimitive.Header className="flex">
|
|
40
|
+
<AccordionPrimitive.Trigger
|
|
41
|
+
data-slot="accordion-trigger"
|
|
42
|
+
className={cn(
|
|
43
|
+
"group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
|
|
44
|
+
className
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
<ChevronDownIcon data-slot="accordion-trigger-icon" className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" />
|
|
50
|
+
<ChevronUpIcon data-slot="accordion-trigger-icon" className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" />
|
|
51
|
+
</AccordionPrimitive.Trigger>
|
|
52
|
+
</AccordionPrimitive.Header>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function AccordionContent({
|
|
57
|
+
className,
|
|
58
|
+
children,
|
|
59
|
+
...props
|
|
60
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
61
|
+
return (
|
|
62
|
+
<AccordionPrimitive.Content
|
|
63
|
+
data-slot="accordion-content"
|
|
64
|
+
className="overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up"
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
<div
|
|
68
|
+
className={cn(
|
|
69
|
+
"h-(--radix-accordion-content-height) pt-0 pb-2.5 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
70
|
+
className
|
|
71
|
+
)}
|
|
72
|
+
>
|
|
73
|
+
{children}
|
|
74
|
+
</div>
|
|
75
|
+
</AccordionPrimitive.Content>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Button } from "@/ui/button"
|
|
6
|
+
|
|
7
|
+
function AlertDialog({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
10
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function AlertDialogTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
16
|
+
return (
|
|
17
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function AlertDialogPortal({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
24
|
+
return (
|
|
25
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function AlertDialogOverlay({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
33
|
+
return (
|
|
34
|
+
<AlertDialogPrimitive.Overlay
|
|
35
|
+
data-slot="alert-dialog-overlay"
|
|
36
|
+
className={cn(
|
|
37
|
+
"fixed inset-0 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",
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function AlertDialogContent({
|
|
46
|
+
className,
|
|
47
|
+
size = "default",
|
|
48
|
+
...props
|
|
49
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
50
|
+
size?: "default" | "sm"
|
|
51
|
+
}) {
|
|
52
|
+
return (
|
|
53
|
+
<AlertDialogPortal>
|
|
54
|
+
<AlertDialogOverlay />
|
|
55
|
+
<AlertDialogPrimitive.Content
|
|
56
|
+
data-slot="alert-dialog-content"
|
|
57
|
+
data-size={size}
|
|
58
|
+
className={cn(
|
|
59
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]: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",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
</AlertDialogPortal>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function AlertDialogHeader({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<"div">) {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
data-slot="alert-dialog-header"
|
|
75
|
+
className={cn(
|
|
76
|
+
"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-4 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]",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function AlertDialogFooter({
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}: React.ComponentProps<"div">) {
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
data-slot="alert-dialog-footer"
|
|
91
|
+
className={cn(
|
|
92
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
93
|
+
className
|
|
94
|
+
)}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function AlertDialogMedia({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<"div">) {
|
|
104
|
+
return (
|
|
105
|
+
<div
|
|
106
|
+
data-slot="alert-dialog-media"
|
|
107
|
+
className={cn(
|
|
108
|
+
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
109
|
+
className
|
|
110
|
+
)}
|
|
111
|
+
{...props}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function AlertDialogTitle({
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
120
|
+
return (
|
|
121
|
+
<AlertDialogPrimitive.Title
|
|
122
|
+
data-slot="alert-dialog-title"
|
|
123
|
+
className={cn(
|
|
124
|
+
"font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
125
|
+
className
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function AlertDialogDescription({
|
|
133
|
+
className,
|
|
134
|
+
...props
|
|
135
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
136
|
+
return (
|
|
137
|
+
<AlertDialogPrimitive.Description
|
|
138
|
+
data-slot="alert-dialog-description"
|
|
139
|
+
className={cn(
|
|
140
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
141
|
+
className
|
|
142
|
+
)}
|
|
143
|
+
{...props}
|
|
144
|
+
/>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function AlertDialogAction({
|
|
149
|
+
className,
|
|
150
|
+
variant = "default",
|
|
151
|
+
size = "default",
|
|
152
|
+
...props
|
|
153
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
|
|
154
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
155
|
+
return (
|
|
156
|
+
<Button variant={variant} size={size} asChild>
|
|
157
|
+
<AlertDialogPrimitive.Action
|
|
158
|
+
data-slot="alert-dialog-action"
|
|
159
|
+
className={cn(className)}
|
|
160
|
+
{...props}
|
|
161
|
+
/>
|
|
162
|
+
</Button>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function AlertDialogCancel({
|
|
167
|
+
className,
|
|
168
|
+
variant = "outline",
|
|
169
|
+
size = "default",
|
|
170
|
+
...props
|
|
171
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
|
|
172
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
173
|
+
return (
|
|
174
|
+
<Button variant={variant} size={size} asChild>
|
|
175
|
+
<AlertDialogPrimitive.Cancel
|
|
176
|
+
data-slot="alert-dialog-cancel"
|
|
177
|
+
className={cn(className)}
|
|
178
|
+
{...props}
|
|
179
|
+
/>
|
|
180
|
+
</Button>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
AlertDialog,
|
|
186
|
+
AlertDialogAction,
|
|
187
|
+
AlertDialogCancel,
|
|
188
|
+
AlertDialogContent,
|
|
189
|
+
AlertDialogDescription,
|
|
190
|
+
AlertDialogFooter,
|
|
191
|
+
AlertDialogHeader,
|
|
192
|
+
AlertDialogMedia,
|
|
193
|
+
AlertDialogOverlay,
|
|
194
|
+
AlertDialogPortal,
|
|
195
|
+
AlertDialogTitle,
|
|
196
|
+
AlertDialogTrigger,
|
|
197
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
"group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
|
|
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
|
+
"font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
|
|
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
|
+
"text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
data-slot="alert-action"
|
|
70
|
+
className={cn("absolute top-2 right-2", className)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction }
|
|
@@ -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
|
+
}
|