@cogito.ai/cli 0.4.2 → 0.4.3
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 +29 -22
- package/dist/index.js +9 -15
- package/dist/templates/web-nextjs/.github/copilot-instructions.md +5 -6
- package/dist/templates/web-nextjs/README.md +25 -24
- package/dist/templates/web-nextjs/apps/docs/.source/browser.ts +18 -8
- package/dist/templates/web-nextjs/apps/docs/.source/dynamic.ts +11 -5
- package/dist/templates/web-nextjs/apps/docs/.source/server.ts +37 -17
- package/dist/templates/web-nextjs/apps/docs/app/docs/[[...slug]]/page.tsx +1 -6
- package/dist/templates/web-nextjs/apps/docs/app/docs/layout.tsx +1 -4
- package/dist/templates/web-nextjs/apps/docs/app/llms-full.txt/route.ts +3 -1
- package/dist/templates/web-nextjs/apps/docs/next-env.d.ts +1 -1
- package/dist/templates/web-nextjs/apps/web/.github/copilot-instructions.md +53 -6
- package/dist/templates/web-nextjs/apps/web/.github/skills/impeccable/SKILL.md +55 -0
- package/dist/templates/web-nextjs/apps/web/DESIGN.md +65 -0
- package/dist/templates/web-nextjs/apps/web/messages/en.json +81 -5
- package/dist/templates/web-nextjs/apps/web/messages/zh.json +81 -5
- package/dist/templates/web-nextjs/apps/web/next.config.ts +3 -3
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/forgot-password/page.tsx +174 -39
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/login/page.tsx +13 -3
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/reset-password/page.tsx +4 -1
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/signup/page.tsx +18 -17
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/dashboard/page.tsx +1 -5
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/layout.tsx +1 -5
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/profile/page.tsx +2 -8
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/about/page.tsx +3 -6
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/globals.css +17 -5
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/help/page.tsx +1 -5
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +10 -8
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/page.tsx +22 -6
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/privacy/page.tsx +3 -6
- package/dist/templates/web-nextjs/apps/web/src/app/[locale]/terms/page.tsx +1 -5
- package/dist/templates/web-nextjs/apps/web/src/app/auth/callback/route.ts +2 -3
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/app-sidebar.tsx +13 -16
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/chart-area-interactive.tsx +122 -146
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/data-table.tsx +84 -149
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-documents.tsx +7 -16
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-main.tsx +4 -4
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-secondary.tsx +4 -4
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-user.tsx +12 -21
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/page.tsx +10 -13
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/section-cards.tsx +5 -9
- package/dist/templates/web-nextjs/apps/web/src/components/dashboard/site-header.tsx +6 -7
- package/dist/templates/web-nextjs/apps/web/src/components/landing/features.tsx +63 -0
- package/dist/templates/web-nextjs/apps/web/src/components/landing/footer.tsx +48 -0
- package/dist/templates/web-nextjs/apps/web/src/components/landing/header.tsx +97 -0
- package/dist/templates/web-nextjs/apps/web/src/components/landing/hero.tsx +45 -0
- package/dist/templates/web-nextjs/apps/web/src/components/landing/how-it-works.tsx +35 -0
- package/dist/templates/web-nextjs/apps/web/src/components/landing/pricing-teaser.tsx +23 -0
- package/dist/templates/web-nextjs/apps/web/src/components/profile/profile-form.tsx +6 -4
- package/dist/templates/web-nextjs/apps/web/src/components/providers/theme-provider.tsx +16 -0
- package/dist/templates/web-nextjs/apps/web/src/components/ui/alert-dialog.tsx +32 -49
- package/dist/templates/web-nextjs/apps/web/src/components/ui/alert.tsx +16 -23
- package/dist/templates/web-nextjs/apps/web/src/components/ui/avatar.tsx +25 -38
- package/dist/templates/web-nextjs/apps/web/src/components/ui/badge.tsx +16 -18
- package/dist/templates/web-nextjs/apps/web/src/components/ui/breadcrumb.tsx +19 -26
- package/dist/templates/web-nextjs/apps/web/src/components/ui/button.tsx +23 -24
- package/dist/templates/web-nextjs/apps/web/src/components/ui/card.tsx +19 -36
- package/dist/templates/web-nextjs/apps/web/src/components/ui/chart.tsx +60 -94
- package/dist/templates/web-nextjs/apps/web/src/components/ui/checkbox.tsx +8 -11
- package/dist/templates/web-nextjs/apps/web/src/components/ui/collapsible.tsx +5 -17
- package/dist/templates/web-nextjs/apps/web/src/components/ui/command.tsx +25 -48
- package/dist/templates/web-nextjs/apps/web/src/components/ui/dialog.tsx +21 -35
- package/dist/templates/web-nextjs/apps/web/src/components/ui/drawer.tsx +24 -35
- package/dist/templates/web-nextjs/apps/web/src/components/ui/dropdown-menu.tsx +26 -55
- package/dist/templates/web-nextjs/apps/web/src/components/ui/field.tsx +62 -76
- package/dist/templates/web-nextjs/apps/web/src/components/ui/form.tsx +19 -34
- package/dist/templates/web-nextjs/apps/web/src/components/ui/input-otp.tsx +13 -20
- package/dist/templates/web-nextjs/apps/web/src/components/ui/input.tsx +6 -6
- package/dist/templates/web-nextjs/apps/web/src/components/ui/label.tsx +6 -6
- package/dist/templates/web-nextjs/apps/web/src/components/ui/pagination.tsx +21 -42
- package/dist/templates/web-nextjs/apps/web/src/components/ui/popover.tsx +16 -31
- package/dist/templates/web-nextjs/apps/web/src/components/ui/progress.tsx +5 -8
- package/dist/templates/web-nextjs/apps/web/src/components/ui/radio-group.tsx +8 -8
- package/dist/templates/web-nextjs/apps/web/src/components/ui/scroll-area.tsx +10 -12
- package/dist/templates/web-nextjs/apps/web/src/components/ui/select.tsx +26 -41
- package/dist/templates/web-nextjs/apps/web/src/components/ui/separator.tsx +7 -7
- package/dist/templates/web-nextjs/apps/web/src/components/ui/sheet.tsx +29 -38
- package/dist/templates/web-nextjs/apps/web/src/components/ui/sidebar.tsx +157 -189
- package/dist/templates/web-nextjs/apps/web/src/components/ui/skeleton.tsx +3 -3
- package/dist/templates/web-nextjs/apps/web/src/components/ui/slider.tsx +10 -15
- package/dist/templates/web-nextjs/apps/web/src/components/ui/sonner.tsx +13 -7
- package/dist/templates/web-nextjs/apps/web/src/components/ui/switch.tsx +9 -9
- package/dist/templates/web-nextjs/apps/web/src/components/ui/table.tsx +24 -48
- package/dist/templates/web-nextjs/apps/web/src/components/ui/tabs.tsx +21 -31
- package/dist/templates/web-nextjs/apps/web/src/components/ui/textarea.tsx +5 -5
- package/dist/templates/web-nextjs/apps/web/src/components/ui/theme-toggle.tsx +23 -0
- package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle-group.tsx +15 -16
- package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle.tsx +14 -15
- package/dist/templates/web-nextjs/apps/web/src/components/ui/tooltip.tsx +8 -12
- package/dist/templates/web-nextjs/apps/web/src/core/repositories/IAuthRepository.ts +2 -0
- package/dist/templates/web-nextjs/apps/web/src/core/types/auth.ts +1 -3
- package/dist/templates/web-nextjs/apps/web/src/features/auth/actions.ts +57 -1
- package/dist/templates/web-nextjs/apps/web/src/features/auth/index.ts +2 -0
- package/dist/templates/web-nextjs/apps/web/src/hooks/use-mobile.ts +4 -4
- package/dist/templates/web-nextjs/apps/web/src/i18n/config.ts +1 -1
- package/dist/templates/web-nextjs/apps/web/src/infra/db/SupabaseAuthRepository.ts +48 -4
- package/dist/templates/web-nextjs/apps/web/src/infra/db/client.ts +1 -4
- package/dist/templates/web-nextjs/apps/web/src/lib/utils.ts +2 -2
- package/dist/templates/web-nextjs/apps/web/src/lib/validations/auth.ts +13 -0
- package/dist/templates/web-nextjs/apps/web/src/styles/tokens.css +58 -0
- package/package.json +1 -1
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { AlertDialog as AlertDialogPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from 'radix-ui'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { Button } from
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
import { Button } from '@/components/ui/button'
|
|
8
8
|
|
|
9
|
-
function AlertDialog({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
9
|
+
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
10
|
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
function AlertDialogTrigger({
|
|
16
14
|
...props
|
|
17
15
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
-
return
|
|
19
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
-
)
|
|
16
|
+
return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
21
17
|
}
|
|
22
18
|
|
|
23
|
-
function AlertDialogPortal({
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
-
return (
|
|
27
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
-
)
|
|
19
|
+
function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
20
|
+
return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
function AlertDialogOverlay({
|
|
@@ -36,8 +28,8 @@ function AlertDialogOverlay({
|
|
|
36
28
|
<AlertDialogPrimitive.Overlay
|
|
37
29
|
data-slot="alert-dialog-overlay"
|
|
38
30
|
className={cn(
|
|
39
|
-
|
|
40
|
-
className
|
|
31
|
+
'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',
|
|
32
|
+
className,
|
|
41
33
|
)}
|
|
42
34
|
{...props}
|
|
43
35
|
/>
|
|
@@ -46,10 +38,10 @@ function AlertDialogOverlay({
|
|
|
46
38
|
|
|
47
39
|
function AlertDialogContent({
|
|
48
40
|
className,
|
|
49
|
-
size =
|
|
41
|
+
size = 'default',
|
|
50
42
|
...props
|
|
51
43
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
52
|
-
size?:
|
|
44
|
+
size?: 'default' | 'sm'
|
|
53
45
|
}) {
|
|
54
46
|
return (
|
|
55
47
|
<AlertDialogPortal>
|
|
@@ -58,8 +50,8 @@ function AlertDialogContent({
|
|
|
58
50
|
data-slot="alert-dialog-content"
|
|
59
51
|
data-size={size}
|
|
60
52
|
className={cn(
|
|
61
|
-
|
|
62
|
-
className
|
|
53
|
+
'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',
|
|
54
|
+
className,
|
|
63
55
|
)}
|
|
64
56
|
{...props}
|
|
65
57
|
/>
|
|
@@ -67,32 +59,26 @@ function AlertDialogContent({
|
|
|
67
59
|
)
|
|
68
60
|
}
|
|
69
61
|
|
|
70
|
-
function AlertDialogHeader({
|
|
71
|
-
className,
|
|
72
|
-
...props
|
|
73
|
-
}: React.ComponentProps<"div">) {
|
|
62
|
+
function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
74
63
|
return (
|
|
75
64
|
<div
|
|
76
65
|
data-slot="alert-dialog-header"
|
|
77
66
|
className={cn(
|
|
78
|
-
|
|
79
|
-
className
|
|
67
|
+
'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]',
|
|
68
|
+
className,
|
|
80
69
|
)}
|
|
81
70
|
{...props}
|
|
82
71
|
/>
|
|
83
72
|
)
|
|
84
73
|
}
|
|
85
74
|
|
|
86
|
-
function AlertDialogFooter({
|
|
87
|
-
className,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<"div">) {
|
|
75
|
+
function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
90
76
|
return (
|
|
91
77
|
<div
|
|
92
78
|
data-slot="alert-dialog-footer"
|
|
93
79
|
className={cn(
|
|
94
|
-
|
|
95
|
-
className
|
|
80
|
+
'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',
|
|
81
|
+
className,
|
|
96
82
|
)}
|
|
97
83
|
{...props}
|
|
98
84
|
/>
|
|
@@ -107,8 +93,8 @@ function AlertDialogTitle({
|
|
|
107
93
|
<AlertDialogPrimitive.Title
|
|
108
94
|
data-slot="alert-dialog-title"
|
|
109
95
|
className={cn(
|
|
110
|
-
|
|
111
|
-
className
|
|
96
|
+
'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',
|
|
97
|
+
className,
|
|
112
98
|
)}
|
|
113
99
|
{...props}
|
|
114
100
|
/>
|
|
@@ -122,22 +108,19 @@ function AlertDialogDescription({
|
|
|
122
108
|
return (
|
|
123
109
|
<AlertDialogPrimitive.Description
|
|
124
110
|
data-slot="alert-dialog-description"
|
|
125
|
-
className={cn(
|
|
111
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
126
112
|
{...props}
|
|
127
113
|
/>
|
|
128
114
|
)
|
|
129
115
|
}
|
|
130
116
|
|
|
131
|
-
function AlertDialogMedia({
|
|
132
|
-
className,
|
|
133
|
-
...props
|
|
134
|
-
}: React.ComponentProps<"div">) {
|
|
117
|
+
function AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>) {
|
|
135
118
|
return (
|
|
136
119
|
<div
|
|
137
120
|
data-slot="alert-dialog-media"
|
|
138
121
|
className={cn(
|
|
139
122
|
"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
|
|
123
|
+
className,
|
|
141
124
|
)}
|
|
142
125
|
{...props}
|
|
143
126
|
/>
|
|
@@ -146,11 +129,11 @@ function AlertDialogMedia({
|
|
|
146
129
|
|
|
147
130
|
function AlertDialogAction({
|
|
148
131
|
className,
|
|
149
|
-
variant =
|
|
150
|
-
size =
|
|
132
|
+
variant = 'default',
|
|
133
|
+
size = 'default',
|
|
151
134
|
...props
|
|
152
135
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
|
|
153
|
-
Pick<React.ComponentProps<typeof Button>,
|
|
136
|
+
Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
|
|
154
137
|
return (
|
|
155
138
|
<Button variant={variant} size={size} asChild>
|
|
156
139
|
<AlertDialogPrimitive.Action
|
|
@@ -164,11 +147,11 @@ function AlertDialogAction({
|
|
|
164
147
|
|
|
165
148
|
function AlertDialogCancel({
|
|
166
149
|
className,
|
|
167
|
-
variant =
|
|
168
|
-
size =
|
|
150
|
+
variant = 'outline',
|
|
151
|
+
size = 'default',
|
|
169
152
|
...props
|
|
170
153
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
|
|
171
|
-
Pick<React.ComponentProps<typeof Button>,
|
|
154
|
+
Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
|
|
172
155
|
return (
|
|
173
156
|
<Button variant={variant} size={size} asChild>
|
|
174
157
|
<AlertDialogPrimitive.Cancel
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
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
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default:
|
|
11
|
+
default: 'bg-card text-card-foreground',
|
|
12
12
|
destructive:
|
|
13
|
-
|
|
13
|
+
'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
17
|
-
variant:
|
|
17
|
+
variant: 'default',
|
|
18
18
|
},
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
function Alert({
|
|
23
23
|
className,
|
|
24
24
|
variant,
|
|
25
25
|
...props
|
|
26
|
-
}: React.ComponentProps<
|
|
26
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {
|
|
27
27
|
return (
|
|
28
28
|
<div
|
|
29
29
|
data-slot="alert"
|
|
@@ -34,42 +34,35 @@ function Alert({
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function AlertTitle({ className, ...props }: React.ComponentProps<
|
|
37
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
38
38
|
return (
|
|
39
39
|
<div
|
|
40
40
|
data-slot="alert-title"
|
|
41
41
|
className={cn(
|
|
42
|
-
|
|
43
|
-
className
|
|
42
|
+
'font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',
|
|
43
|
+
className,
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
46
46
|
/>
|
|
47
47
|
)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function AlertDescription({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}: React.ComponentProps<"div">) {
|
|
50
|
+
function AlertDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
|
54
51
|
return (
|
|
55
52
|
<div
|
|
56
53
|
data-slot="alert-description"
|
|
57
54
|
className={cn(
|
|
58
|
-
|
|
59
|
-
className
|
|
55
|
+
'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',
|
|
56
|
+
className,
|
|
60
57
|
)}
|
|
61
58
|
{...props}
|
|
62
59
|
/>
|
|
63
60
|
)
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
function AlertAction({ className, ...props }: React.ComponentProps<
|
|
63
|
+
function AlertAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
67
64
|
return (
|
|
68
|
-
<div
|
|
69
|
-
data-slot="alert-action"
|
|
70
|
-
className={cn("absolute top-2 right-2", className)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
65
|
+
<div data-slot="alert-action" className={cn('absolute top-2 right-2', className)} {...props} />
|
|
73
66
|
)
|
|
74
67
|
}
|
|
75
68
|
|
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Avatar as AvatarPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Avatar as AvatarPrimitive } from 'radix-ui'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
7
|
|
|
8
8
|
function Avatar({
|
|
9
9
|
className,
|
|
10
|
-
size =
|
|
10
|
+
size = 'default',
|
|
11
11
|
...props
|
|
12
12
|
}: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
13
|
-
size?:
|
|
13
|
+
size?: 'default' | 'sm' | 'lg'
|
|
14
14
|
}) {
|
|
15
15
|
return (
|
|
16
16
|
<AvatarPrimitive.Root
|
|
17
17
|
data-slot="avatar"
|
|
18
18
|
data-size={size}
|
|
19
19
|
className={cn(
|
|
20
|
-
|
|
21
|
-
className
|
|
20
|
+
'group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6',
|
|
21
|
+
className,
|
|
22
22
|
)}
|
|
23
23
|
{...props}
|
|
24
24
|
/>
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function AvatarImage({
|
|
29
|
-
className,
|
|
30
|
-
...props
|
|
31
|
-
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
28
|
+
function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
32
29
|
return (
|
|
33
30
|
<AvatarPrimitive.Image
|
|
34
31
|
data-slot="avatar-image"
|
|
35
|
-
className={cn(
|
|
32
|
+
className={cn('aspect-square size-full', className)}
|
|
36
33
|
{...props}
|
|
37
34
|
/>
|
|
38
35
|
)
|
|
@@ -46,64 +43,54 @@ function AvatarFallback({
|
|
|
46
43
|
<AvatarPrimitive.Fallback
|
|
47
44
|
data-slot="avatar-fallback"
|
|
48
45
|
className={cn(
|
|
49
|
-
|
|
50
|
-
className
|
|
46
|
+
'flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs',
|
|
47
|
+
className,
|
|
51
48
|
)}
|
|
52
49
|
{...props}
|
|
53
50
|
/>
|
|
54
51
|
)
|
|
55
52
|
}
|
|
56
53
|
|
|
57
|
-
function AvatarBadge({ className, ...props }: React.ComponentProps<
|
|
54
|
+
function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {
|
|
58
55
|
return (
|
|
59
56
|
<span
|
|
60
57
|
data-slot="avatar-badge"
|
|
61
58
|
className={cn(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
className
|
|
59
|
+
'absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none',
|
|
60
|
+
'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',
|
|
61
|
+
'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',
|
|
62
|
+
'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',
|
|
63
|
+
className,
|
|
67
64
|
)}
|
|
68
65
|
{...props}
|
|
69
66
|
/>
|
|
70
67
|
)
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
function AvatarGroup({ className, ...props }: React.ComponentProps<
|
|
70
|
+
function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
74
71
|
return (
|
|
75
72
|
<div
|
|
76
73
|
data-slot="avatar-group"
|
|
77
74
|
className={cn(
|
|
78
|
-
|
|
79
|
-
className
|
|
75
|
+
'group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',
|
|
76
|
+
className,
|
|
80
77
|
)}
|
|
81
78
|
{...props}
|
|
82
79
|
/>
|
|
83
80
|
)
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
function AvatarGroupCount({
|
|
87
|
-
className,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<"div">) {
|
|
83
|
+
function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>) {
|
|
90
84
|
return (
|
|
91
85
|
<div
|
|
92
86
|
data-slot="avatar-group-count"
|
|
93
87
|
className={cn(
|
|
94
|
-
|
|
95
|
-
className
|
|
88
|
+
'relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',
|
|
89
|
+
className,
|
|
96
90
|
)}
|
|
97
91
|
{...props}
|
|
98
92
|
/>
|
|
99
93
|
)
|
|
100
94
|
}
|
|
101
95
|
|
|
102
|
-
export {
|
|
103
|
-
Avatar,
|
|
104
|
-
AvatarImage,
|
|
105
|
-
AvatarFallback,
|
|
106
|
-
AvatarBadge,
|
|
107
|
-
AvatarGroup,
|
|
108
|
-
AvatarGroupCount,
|
|
109
|
-
}
|
|
96
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount }
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { cva, type VariantProps } from
|
|
3
|
-
import { Slot } from
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
import { Slot } from 'radix-ui'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
6
|
|
|
7
7
|
const badgeVariants = cva(
|
|
8
|
-
|
|
8
|
+
'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
13
|
-
secondary:
|
|
14
|
-
"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
12
|
+
default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
|
13
|
+
secondary: 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
|
15
14
|
destructive:
|
|
16
|
-
|
|
15
|
+
'bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90',
|
|
17
16
|
outline:
|
|
18
|
-
|
|
19
|
-
ghost:
|
|
20
|
-
link:
|
|
17
|
+
'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
|
18
|
+
ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
|
19
|
+
link: 'text-primary underline-offset-4 [a&]:hover:underline',
|
|
21
20
|
},
|
|
22
21
|
},
|
|
23
22
|
defaultVariants: {
|
|
24
|
-
variant:
|
|
23
|
+
variant: 'default',
|
|
25
24
|
},
|
|
26
|
-
}
|
|
25
|
+
},
|
|
27
26
|
)
|
|
28
27
|
|
|
29
28
|
function Badge({
|
|
30
29
|
className,
|
|
31
|
-
variant =
|
|
30
|
+
variant = 'default',
|
|
32
31
|
asChild = false,
|
|
33
32
|
...props
|
|
34
|
-
}: React.ComponentProps<
|
|
35
|
-
|
|
36
|
-
const Comp = asChild ? Slot.Root : "span"
|
|
33
|
+
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
34
|
+
const Comp = asChild ? Slot.Root : 'span'
|
|
37
35
|
|
|
38
36
|
return (
|
|
39
37
|
<Comp
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { ChevronRight, MoreHorizontal } from
|
|
3
|
-
import { Slot } from
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react'
|
|
3
|
+
import { Slot } from 'radix-ui'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
6
|
|
|
7
|
-
function Breadcrumb({ ...props }: React.ComponentProps<
|
|
7
|
+
function Breadcrumb({ ...props }: React.ComponentProps<'nav'>) {
|
|
8
8
|
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function BreadcrumbList({ className, ...props }: React.ComponentProps<
|
|
11
|
+
function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
|
|
12
12
|
return (
|
|
13
13
|
<ol
|
|
14
14
|
data-slot="breadcrumb-list"
|
|
15
15
|
className={cn(
|
|
16
|
-
|
|
17
|
-
className
|
|
16
|
+
'flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5',
|
|
17
|
+
className,
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
20
20
|
/>
|
|
21
21
|
)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function BreadcrumbItem({ className, ...props }: React.ComponentProps<
|
|
24
|
+
function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
|
|
25
25
|
return (
|
|
26
26
|
<li
|
|
27
27
|
data-slot="breadcrumb-item"
|
|
28
|
-
className={cn(
|
|
28
|
+
className={cn('inline-flex items-center gap-1.5', className)}
|
|
29
29
|
{...props}
|
|
30
30
|
/>
|
|
31
31
|
)
|
|
@@ -35,44 +35,40 @@ function BreadcrumbLink({
|
|
|
35
35
|
asChild,
|
|
36
36
|
className,
|
|
37
37
|
...props
|
|
38
|
-
}: React.ComponentProps<
|
|
38
|
+
}: React.ComponentProps<'a'> & {
|
|
39
39
|
asChild?: boolean
|
|
40
40
|
}) {
|
|
41
|
-
const Comp = asChild ? Slot.Root :
|
|
41
|
+
const Comp = asChild ? Slot.Root : 'a'
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
44
|
<Comp
|
|
45
45
|
data-slot="breadcrumb-link"
|
|
46
|
-
className={cn(
|
|
46
|
+
className={cn('transition-colors hover:text-foreground', className)}
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function BreadcrumbPage({ className, ...props }: React.ComponentProps<
|
|
52
|
+
function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
|
|
53
53
|
return (
|
|
54
54
|
<span
|
|
55
55
|
data-slot="breadcrumb-page"
|
|
56
56
|
role="link"
|
|
57
57
|
aria-disabled="true"
|
|
58
58
|
aria-current="page"
|
|
59
|
-
className={cn(
|
|
59
|
+
className={cn('font-normal text-foreground', className)}
|
|
60
60
|
{...props}
|
|
61
61
|
/>
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function BreadcrumbSeparator({
|
|
66
|
-
children,
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}: React.ComponentProps<"li">) {
|
|
65
|
+
function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>) {
|
|
70
66
|
return (
|
|
71
67
|
<li
|
|
72
68
|
data-slot="breadcrumb-separator"
|
|
73
69
|
role="presentation"
|
|
74
70
|
aria-hidden="true"
|
|
75
|
-
className={cn(
|
|
71
|
+
className={cn('[&>svg]:size-3.5', className)}
|
|
76
72
|
{...props}
|
|
77
73
|
>
|
|
78
74
|
{children ?? <ChevronRight />}
|
|
@@ -80,16 +76,13 @@ function BreadcrumbSeparator({
|
|
|
80
76
|
)
|
|
81
77
|
}
|
|
82
78
|
|
|
83
|
-
function BreadcrumbEllipsis({
|
|
84
|
-
className,
|
|
85
|
-
...props
|
|
86
|
-
}: React.ComponentProps<"span">) {
|
|
79
|
+
function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
|
|
87
80
|
return (
|
|
88
81
|
<span
|
|
89
82
|
data-slot="breadcrumb-ellipsis"
|
|
90
83
|
role="presentation"
|
|
91
84
|
aria-hidden="true"
|
|
92
|
-
className={cn(
|
|
85
|
+
className={cn('flex size-9 items-center justify-center', className)}
|
|
93
86
|
{...props}
|
|
94
87
|
>
|
|
95
88
|
<MoreHorizontal className="size-4" />
|
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
import { Button as ButtonPrimitive } from
|
|
2
|
-
import { Slot } from
|
|
3
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button'
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
8
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
12
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
13
13
|
outline:
|
|
14
|
-
|
|
14
|
+
'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
|
|
15
15
|
secondary:
|
|
16
|
-
|
|
16
|
+
'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
17
17
|
ghost:
|
|
18
|
-
|
|
18
|
+
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
19
19
|
destructive:
|
|
20
|
-
|
|
21
|
-
link:
|
|
20
|
+
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
21
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
22
22
|
},
|
|
23
23
|
size: {
|
|
24
24
|
default:
|
|
25
|
-
|
|
25
|
+
'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
26
26
|
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
27
27
|
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
28
|
-
lg:
|
|
29
|
-
icon:
|
|
30
|
-
|
|
28
|
+
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
29
|
+
icon: 'size-8',
|
|
30
|
+
'icon-xs':
|
|
31
31
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
'icon-sm':
|
|
33
|
+
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
34
|
+
'icon-lg': 'size-9',
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
variant:
|
|
39
|
-
size:
|
|
38
|
+
variant: 'default',
|
|
39
|
+
size: 'default',
|
|
40
40
|
},
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
function Button({
|
|
45
45
|
className,
|
|
46
|
-
variant =
|
|
47
|
-
size =
|
|
46
|
+
variant = 'default',
|
|
47
|
+
size = 'default',
|
|
48
48
|
asChild = false,
|
|
49
49
|
...props
|
|
50
|
-
}: React.ComponentProps<
|
|
51
|
-
VariantProps<typeof buttonVariants> & { asChild?: boolean }) {
|
|
50
|
+
}: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & { asChild?: boolean }) {
|
|
52
51
|
if (asChild) {
|
|
53
52
|
return (
|
|
54
53
|
<Slot
|