@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,25 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Popover as PopoverPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Popover as PopoverPrimitive } from 'radix-ui'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
7
|
|
|
8
|
-
function Popover({
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
8
|
+
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
11
9
|
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
function PopoverTrigger({
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
12
|
+
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
17
13
|
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
function PopoverContent({
|
|
21
17
|
className,
|
|
22
|
-
align =
|
|
18
|
+
align = 'center',
|
|
23
19
|
sideOffset = 4,
|
|
24
20
|
...props
|
|
25
21
|
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
@@ -30,8 +26,8 @@ function PopoverContent({
|
|
|
30
26
|
align={align}
|
|
31
27
|
sideOffset={sideOffset}
|
|
32
28
|
className={cn(
|
|
33
|
-
|
|
34
|
-
className
|
|
29
|
+
'z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
30
|
+
className,
|
|
35
31
|
)}
|
|
36
32
|
{...props}
|
|
37
33
|
/>
|
|
@@ -39,40 +35,29 @@ function PopoverContent({
|
|
|
39
35
|
)
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
function PopoverAnchor({
|
|
43
|
-
...props
|
|
44
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
38
|
+
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
45
39
|
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
function PopoverHeader({ className, ...props }: React.ComponentProps<
|
|
42
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
49
43
|
return (
|
|
50
44
|
<div
|
|
51
45
|
data-slot="popover-header"
|
|
52
|
-
className={cn(
|
|
46
|
+
className={cn('flex flex-col gap-1 text-sm', className)}
|
|
53
47
|
{...props}
|
|
54
48
|
/>
|
|
55
49
|
)
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
function PopoverTitle({ className, ...props }: React.ComponentProps<
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
data-slot="popover-title"
|
|
62
|
-
className={cn("font-medium", className)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
)
|
|
52
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>) {
|
|
53
|
+
return <div data-slot="popover-title" className={cn('font-medium', className)} {...props} />
|
|
66
54
|
}
|
|
67
55
|
|
|
68
|
-
function PopoverDescription({
|
|
69
|
-
className,
|
|
70
|
-
...props
|
|
71
|
-
}: React.ComponentProps<"p">) {
|
|
56
|
+
function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
72
57
|
return (
|
|
73
58
|
<p
|
|
74
59
|
data-slot="popover-description"
|
|
75
|
-
className={cn(
|
|
60
|
+
className={cn('text-muted-foreground', className)}
|
|
76
61
|
{...props}
|
|
77
62
|
/>
|
|
78
63
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Progress as ProgressPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Progress as ProgressPrimitive } from 'radix-ui'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
7
|
|
|
8
8
|
function Progress({
|
|
9
9
|
className,
|
|
@@ -13,10 +13,7 @@ function Progress({
|
|
|
13
13
|
return (
|
|
14
14
|
<ProgressPrimitive.Root
|
|
15
15
|
data-slot="progress"
|
|
16
|
-
className={cn(
|
|
17
|
-
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
18
|
-
className
|
|
19
|
-
)}
|
|
16
|
+
className={cn('relative h-2 w-full overflow-hidden rounded-full bg-primary/20', className)}
|
|
20
17
|
{...props}
|
|
21
18
|
>
|
|
22
19
|
<ProgressPrimitive.Indicator
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { CircleIcon } from
|
|
5
|
-
import { RadioGroup as RadioGroupPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { CircleIcon } from 'lucide-react'
|
|
5
|
+
import { RadioGroup as RadioGroupPrimitive } from 'radix-ui'
|
|
6
6
|
|
|
7
|
-
import { cn } from
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
8
|
|
|
9
9
|
function RadioGroup({
|
|
10
10
|
className,
|
|
@@ -13,7 +13,7 @@ function RadioGroup({
|
|
|
13
13
|
return (
|
|
14
14
|
<RadioGroupPrimitive.Root
|
|
15
15
|
data-slot="radio-group"
|
|
16
|
-
className={cn(
|
|
16
|
+
className={cn('grid gap-3', className)}
|
|
17
17
|
{...props}
|
|
18
18
|
/>
|
|
19
19
|
)
|
|
@@ -27,8 +27,8 @@ function RadioGroupItem({
|
|
|
27
27
|
<RadioGroupPrimitive.Item
|
|
28
28
|
data-slot="radio-group-item"
|
|
29
29
|
className={cn(
|
|
30
|
-
|
|
31
|
-
className
|
|
30
|
+
'aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40',
|
|
31
|
+
className,
|
|
32
32
|
)}
|
|
33
33
|
{...props}
|
|
34
34
|
>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { ScrollArea as ScrollAreaPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
7
|
|
|
8
8
|
function ScrollArea({
|
|
9
9
|
className,
|
|
@@ -13,7 +13,7 @@ function ScrollArea({
|
|
|
13
13
|
return (
|
|
14
14
|
<ScrollAreaPrimitive.Root
|
|
15
15
|
data-slot="scroll-area"
|
|
16
|
-
className={cn(
|
|
16
|
+
className={cn('relative', className)}
|
|
17
17
|
{...props}
|
|
18
18
|
>
|
|
19
19
|
<ScrollAreaPrimitive.Viewport
|
|
@@ -30,7 +30,7 @@ function ScrollArea({
|
|
|
30
30
|
|
|
31
31
|
function ScrollBar({
|
|
32
32
|
className,
|
|
33
|
-
orientation =
|
|
33
|
+
orientation = 'vertical',
|
|
34
34
|
...props
|
|
35
35
|
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
36
36
|
return (
|
|
@@ -38,12 +38,10 @@ function ScrollBar({
|
|
|
38
38
|
data-slot="scroll-area-scrollbar"
|
|
39
39
|
orientation={orientation}
|
|
40
40
|
className={cn(
|
|
41
|
-
|
|
42
|
-
orientation ===
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"h-2.5 flex-col border-t border-t-transparent",
|
|
46
|
-
className
|
|
41
|
+
'flex touch-none p-px transition-colors select-none',
|
|
42
|
+
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',
|
|
43
|
+
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent',
|
|
44
|
+
className,
|
|
47
45
|
)}
|
|
48
46
|
{...props}
|
|
49
47
|
>
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from
|
|
5
|
-
import { Select as SelectPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react'
|
|
5
|
+
import { Select as SelectPrimitive } from 'radix-ui'
|
|
6
6
|
|
|
7
|
-
import { cn } from
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
8
|
|
|
9
|
-
function Select({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
9
|
+
function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
10
|
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
function SelectGroup({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
13
|
+
function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
14
|
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
function SelectValue({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
17
|
+
function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
18
|
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
function SelectTrigger({
|
|
28
22
|
className,
|
|
29
|
-
size =
|
|
23
|
+
size = 'default',
|
|
30
24
|
children,
|
|
31
25
|
...props
|
|
32
26
|
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
-
size?:
|
|
27
|
+
size?: 'sm' | 'default'
|
|
34
28
|
}) {
|
|
35
29
|
return (
|
|
36
30
|
<SelectPrimitive.Trigger
|
|
@@ -38,7 +32,7 @@ function SelectTrigger({
|
|
|
38
32
|
data-size={size}
|
|
39
33
|
className={cn(
|
|
40
34
|
"flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
41
|
-
className
|
|
35
|
+
className,
|
|
42
36
|
)}
|
|
43
37
|
{...props}
|
|
44
38
|
>
|
|
@@ -53,8 +47,8 @@ function SelectTrigger({
|
|
|
53
47
|
function SelectContent({
|
|
54
48
|
className,
|
|
55
49
|
children,
|
|
56
|
-
position =
|
|
57
|
-
align =
|
|
50
|
+
position = 'item-aligned',
|
|
51
|
+
align = 'center',
|
|
58
52
|
...props
|
|
59
53
|
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
60
54
|
return (
|
|
@@ -62,10 +56,10 @@ function SelectContent({
|
|
|
62
56
|
<SelectPrimitive.Content
|
|
63
57
|
data-slot="select-content"
|
|
64
58
|
className={cn(
|
|
65
|
-
|
|
66
|
-
position ===
|
|
67
|
-
|
|
68
|
-
className
|
|
59
|
+
'relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
60
|
+
position === 'popper' &&
|
|
61
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
62
|
+
className,
|
|
69
63
|
)}
|
|
70
64
|
position={position}
|
|
71
65
|
align={align}
|
|
@@ -74,9 +68,9 @@ function SelectContent({
|
|
|
74
68
|
<SelectScrollUpButton />
|
|
75
69
|
<SelectPrimitive.Viewport
|
|
76
70
|
className={cn(
|
|
77
|
-
|
|
78
|
-
position ===
|
|
79
|
-
|
|
71
|
+
'p-1',
|
|
72
|
+
position === 'popper' &&
|
|
73
|
+
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1',
|
|
80
74
|
)}
|
|
81
75
|
>
|
|
82
76
|
{children}
|
|
@@ -87,14 +81,11 @@ function SelectContent({
|
|
|
87
81
|
)
|
|
88
82
|
}
|
|
89
83
|
|
|
90
|
-
function SelectLabel({
|
|
91
|
-
className,
|
|
92
|
-
...props
|
|
93
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
84
|
+
function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
94
85
|
return (
|
|
95
86
|
<SelectPrimitive.Label
|
|
96
87
|
data-slot="select-label"
|
|
97
|
-
className={cn(
|
|
88
|
+
className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}
|
|
98
89
|
{...props}
|
|
99
90
|
/>
|
|
100
91
|
)
|
|
@@ -110,7 +101,7 @@ function SelectItem({
|
|
|
110
101
|
data-slot="select-item"
|
|
111
102
|
className={cn(
|
|
112
103
|
"relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
113
|
-
className
|
|
104
|
+
className,
|
|
114
105
|
)}
|
|
115
106
|
{...props}
|
|
116
107
|
>
|
|
@@ -134,7 +125,7 @@ function SelectSeparator({
|
|
|
134
125
|
return (
|
|
135
126
|
<SelectPrimitive.Separator
|
|
136
127
|
data-slot="select-separator"
|
|
137
|
-
className={cn(
|
|
128
|
+
className={cn('pointer-events-none -mx-1 my-1 h-px bg-border', className)}
|
|
138
129
|
{...props}
|
|
139
130
|
/>
|
|
140
131
|
)
|
|
@@ -147,10 +138,7 @@ function SelectScrollUpButton({
|
|
|
147
138
|
return (
|
|
148
139
|
<SelectPrimitive.ScrollUpButton
|
|
149
140
|
data-slot="select-scroll-up-button"
|
|
150
|
-
className={cn(
|
|
151
|
-
"flex cursor-default items-center justify-center py-1",
|
|
152
|
-
className
|
|
153
|
-
)}
|
|
141
|
+
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
154
142
|
{...props}
|
|
155
143
|
>
|
|
156
144
|
<ChevronUpIcon className="size-4" />
|
|
@@ -165,10 +153,7 @@ function SelectScrollDownButton({
|
|
|
165
153
|
return (
|
|
166
154
|
<SelectPrimitive.ScrollDownButton
|
|
167
155
|
data-slot="select-scroll-down-button"
|
|
168
|
-
className={cn(
|
|
169
|
-
"flex cursor-default items-center justify-center py-1",
|
|
170
|
-
className
|
|
171
|
-
)}
|
|
156
|
+
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
172
157
|
{...props}
|
|
173
158
|
>
|
|
174
159
|
<ChevronDownIcon className="size-4" />
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react'
|
|
2
2
|
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
4
|
|
|
5
5
|
function Separator({
|
|
6
6
|
className,
|
|
7
|
-
orientation =
|
|
7
|
+
orientation = 'horizontal',
|
|
8
8
|
decorative = true,
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<
|
|
11
|
-
orientation?:
|
|
10
|
+
}: React.ComponentProps<'div'> & {
|
|
11
|
+
orientation?: 'horizontal' | 'vertical'
|
|
12
12
|
decorative?: boolean
|
|
13
13
|
}) {
|
|
14
14
|
return (
|
|
15
15
|
<div
|
|
16
|
-
role={decorative ?
|
|
16
|
+
role={decorative ? 'none' : 'separator'}
|
|
17
17
|
aria-orientation={decorative ? undefined : orientation}
|
|
18
18
|
data-slot="separator-root"
|
|
19
19
|
data-orientation={orientation}
|
|
20
20
|
className={cn(
|
|
21
|
-
|
|
21
|
+
'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
|
|
22
22
|
className,
|
|
23
23
|
)}
|
|
24
24
|
{...props}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { XIcon } from
|
|
5
|
-
import { Dialog as SheetPrimitive } from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { XIcon } from 'lucide-react'
|
|
5
|
+
import { Dialog as SheetPrimitive } from 'radix-ui'
|
|
6
6
|
|
|
7
|
-
import { cn } from
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
8
|
|
|
9
9
|
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
10
|
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function SheetTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
13
|
+
function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
16
14
|
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
function SheetClose({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
17
|
+
function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
22
18
|
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
function SheetPortal({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
21
|
+
function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
28
22
|
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
29
23
|
}
|
|
30
24
|
|
|
@@ -36,8 +30,8 @@ function SheetOverlay({
|
|
|
36
30
|
<SheetPrimitive.Overlay
|
|
37
31
|
data-slot="sheet-overlay"
|
|
38
32
|
className={cn(
|
|
39
|
-
|
|
40
|
-
className
|
|
33
|
+
'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',
|
|
34
|
+
className,
|
|
41
35
|
)}
|
|
42
36
|
{...props}
|
|
43
37
|
/>
|
|
@@ -47,11 +41,11 @@ function SheetOverlay({
|
|
|
47
41
|
function SheetContent({
|
|
48
42
|
className,
|
|
49
43
|
children,
|
|
50
|
-
side =
|
|
44
|
+
side = 'right',
|
|
51
45
|
showCloseButton = true,
|
|
52
46
|
...props
|
|
53
47
|
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
54
|
-
side?:
|
|
48
|
+
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
55
49
|
showCloseButton?: boolean
|
|
56
50
|
}) {
|
|
57
51
|
return (
|
|
@@ -60,16 +54,16 @@ function SheetContent({
|
|
|
60
54
|
<SheetPrimitive.Content
|
|
61
55
|
data-slot="sheet-content"
|
|
62
56
|
className={cn(
|
|
63
|
-
|
|
64
|
-
side ===
|
|
65
|
-
|
|
66
|
-
side ===
|
|
67
|
-
|
|
68
|
-
side ===
|
|
69
|
-
|
|
70
|
-
side ===
|
|
71
|
-
|
|
72
|
-
className
|
|
57
|
+
'fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500',
|
|
58
|
+
side === 'right' &&
|
|
59
|
+
'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
|
|
60
|
+
side === 'left' &&
|
|
61
|
+
'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
62
|
+
side === 'top' &&
|
|
63
|
+
'inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
64
|
+
side === 'bottom' &&
|
|
65
|
+
'inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
66
|
+
className,
|
|
73
67
|
)}
|
|
74
68
|
{...props}
|
|
75
69
|
>
|
|
@@ -85,34 +79,31 @@ function SheetContent({
|
|
|
85
79
|
)
|
|
86
80
|
}
|
|
87
81
|
|
|
88
|
-
function SheetHeader({ className, ...props }: React.ComponentProps<
|
|
82
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
89
83
|
return (
|
|
90
84
|
<div
|
|
91
85
|
data-slot="sheet-header"
|
|
92
|
-
className={cn(
|
|
86
|
+
className={cn('flex flex-col gap-1.5 p-4', className)}
|
|
93
87
|
{...props}
|
|
94
88
|
/>
|
|
95
89
|
)
|
|
96
90
|
}
|
|
97
91
|
|
|
98
|
-
function SheetFooter({ className, ...props }: React.ComponentProps<
|
|
92
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
99
93
|
return (
|
|
100
94
|
<div
|
|
101
95
|
data-slot="sheet-footer"
|
|
102
|
-
className={cn(
|
|
96
|
+
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
103
97
|
{...props}
|
|
104
98
|
/>
|
|
105
99
|
)
|
|
106
100
|
}
|
|
107
101
|
|
|
108
|
-
function SheetTitle({
|
|
109
|
-
className,
|
|
110
|
-
...props
|
|
111
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
102
|
+
function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
112
103
|
return (
|
|
113
104
|
<SheetPrimitive.Title
|
|
114
105
|
data-slot="sheet-title"
|
|
115
|
-
className={cn(
|
|
106
|
+
className={cn('font-semibold text-foreground', className)}
|
|
116
107
|
{...props}
|
|
117
108
|
/>
|
|
118
109
|
)
|
|
@@ -125,7 +116,7 @@ function SheetDescription({
|
|
|
125
116
|
return (
|
|
126
117
|
<SheetPrimitive.Description
|
|
127
118
|
data-slot="sheet-description"
|
|
128
|
-
className={cn(
|
|
119
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
129
120
|
{...props}
|
|
130
121
|
/>
|
|
131
122
|
)
|