ar-saas 0.3.1 → 0.3.2
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/LICENSE +21 -21
- package/README.md +338 -314
- package/dist/cli.js +19 -0
- package/dist/generator.js +166 -55
- package/package.json +52 -50
- package/templates/backend/.env.example +67 -67
- package/templates/backend/.prettierrc +4 -4
- package/templates/backend/README.md +249 -168
- package/templates/backend/eslint.config.mjs +35 -35
- package/templates/backend/nest-cli.json +8 -8
- package/templates/backend/package-lock.json +10979 -10979
- package/templates/backend/package.json +88 -88
- package/templates/backend/src/app.controller.spec.ts +24 -24
- package/templates/backend/src/app.controller.ts +15 -15
- package/templates/backend/src/app.module.ts +40 -40
- package/templates/backend/src/app.service.ts +11 -11
- package/templates/backend/src/common/base/base.repository.ts +221 -221
- package/templates/backend/src/common/base/base.schema.ts +24 -24
- package/templates/backend/src/common/decorators/cookie.decorator.ts +9 -9
- package/templates/backend/src/common/decorators/current-user.decorator.ts +20 -20
- package/templates/backend/src/common/decorators/workspace-id.decorator.ts +14 -14
- package/templates/backend/src/common/filters/global-exception.filter.ts +61 -61
- package/templates/backend/src/common/guards/jwt-auth.guard.ts +5 -5
- package/templates/backend/src/common/interceptors/workspace-tenant.interceptor.ts +45 -45
- package/templates/backend/src/main.ts +51 -51
- package/templates/backend/src/modules/auth/auth.controller.ts +158 -158
- package/templates/backend/src/modules/auth/auth.module.ts +20 -20
- package/templates/backend/src/modules/auth/auth.service.ts +257 -257
- package/templates/backend/src/modules/auth/dto/forgot-password.dto.ts +9 -9
- package/templates/backend/src/modules/auth/dto/login.dto.ts +14 -14
- package/templates/backend/src/modules/auth/dto/refresh-token.dto.ts +12 -12
- package/templates/backend/src/modules/auth/dto/register.dto.ts +26 -26
- package/templates/backend/src/modules/auth/dto/reset-password.dto.ts +16 -16
- package/templates/backend/src/modules/auth/dto/verify-email.dto.ts +9 -9
- package/templates/backend/src/modules/auth/strategies/jwt.strategy.ts +43 -43
- package/templates/backend/src/modules/mail/mail.module.ts +9 -9
- package/templates/backend/src/modules/mail/mail.service.ts +141 -141
- package/templates/backend/src/modules/users/schemas/user.schema.ts +54 -54
- package/templates/backend/src/modules/users/users.module.ts +14 -14
- package/templates/backend/src/modules/users/users.repository.ts +51 -51
- package/templates/backend/src/modules/users/users.service.ts +104 -104
- package/templates/backend/src/modules/workspaces/schemas/workspace.schema.ts +26 -26
- package/templates/backend/src/modules/workspaces/workspaces.module.ts +16 -16
- package/templates/backend/src/modules/workspaces/workspaces.repository.ts +34 -34
- package/templates/backend/src/modules/workspaces/workspaces.service.ts +42 -42
- package/templates/backend/test/app.e2e-spec.ts +25 -25
- package/templates/backend/test/jest-e2e.json +9 -9
- package/templates/backend/tsconfig.build.json +4 -4
- package/templates/backend/tsconfig.json +26 -26
- package/templates/frontend/.env.local.example +1 -1
- package/templates/frontend/README.md +152 -0
- package/templates/frontend/components.json +20 -20
- package/templates/frontend/eslint.config.mjs +14 -14
- package/templates/frontend/next.config.ts +5 -5
- package/templates/frontend/package-lock.json +6722 -6722
- package/templates/frontend/package.json +48 -48
- package/templates/frontend/pnpm-lock.yaml +5012 -5012
- package/templates/frontend/pnpm-workspace.yaml +3 -3
- package/templates/frontend/postcss.config.mjs +7 -7
- package/templates/frontend/src/app/(auth)/forgot-password/page.tsx +84 -84
- package/templates/frontend/src/app/(auth)/layout.tsx +28 -28
- package/templates/frontend/src/app/(auth)/login/page.tsx +111 -111
- package/templates/frontend/src/app/(auth)/register/page.tsx +161 -161
- package/templates/frontend/src/app/(auth)/reset-password/page.tsx +120 -120
- package/templates/frontend/src/app/(auth)/verify-email/page.tsx +78 -78
- package/templates/frontend/src/app/(dashboard)/billing/page.tsx +111 -111
- package/templates/frontend/src/app/(dashboard)/dashboard/page.tsx +105 -105
- package/templates/frontend/src/app/(dashboard)/layout.tsx +38 -38
- package/templates/frontend/src/app/(dashboard)/profile/page.tsx +226 -226
- package/templates/frontend/src/app/(dashboard)/settings/page.tsx +156 -156
- package/templates/frontend/src/app/(dashboard)/team/page.tsx +178 -178
- package/templates/frontend/src/app/(legal)/privacy/page.tsx +127 -127
- package/templates/frontend/src/app/(legal)/terms/page.tsx +118 -118
- package/templates/frontend/src/app/globals.css +81 -81
- package/templates/frontend/src/app/layout.tsx +26 -26
- package/templates/frontend/src/app/page.tsx +5 -45
- package/templates/frontend/src/app/setup/page.tsx +371 -275
- package/templates/frontend/src/components/dashboard/header.tsx +89 -89
- package/templates/frontend/src/components/dashboard/sidebar.tsx +71 -71
- package/templates/frontend/src/components/dashboard/stat-card.tsx +34 -34
- package/templates/frontend/src/components/landing/faq.tsx +39 -39
- package/templates/frontend/src/components/landing/features.tsx +54 -54
- package/templates/frontend/src/components/landing/footer.tsx +76 -76
- package/templates/frontend/src/components/landing/hero.tsx +72 -72
- package/templates/frontend/src/components/landing/navbar.tsx +78 -78
- package/templates/frontend/src/components/landing/pricing.tsx +90 -90
- package/templates/frontend/src/components/ui/accordion.tsx +52 -52
- package/templates/frontend/src/components/ui/avatar.tsx +46 -46
- package/templates/frontend/src/components/ui/badge.tsx +30 -30
- package/templates/frontend/src/components/ui/button.tsx +52 -52
- package/templates/frontend/src/components/ui/card.tsx +50 -50
- package/templates/frontend/src/components/ui/checkbox.tsx +27 -27
- package/templates/frontend/src/components/ui/dialog.tsx +100 -100
- package/templates/frontend/src/components/ui/dropdown-menu.tsx +173 -173
- package/templates/frontend/src/components/ui/form.tsx +158 -158
- package/templates/frontend/src/components/ui/input.tsx +21 -21
- package/templates/frontend/src/components/ui/label.tsx +22 -22
- package/templates/frontend/src/components/ui/separator.tsx +25 -25
- package/templates/frontend/src/components/ui/skeleton.tsx +7 -7
- package/templates/frontend/src/components/ui/switch.tsx +28 -28
- package/templates/frontend/src/components/ui/tabs.tsx +54 -54
- package/templates/frontend/src/components/ui/textarea.tsx +20 -20
- package/templates/frontend/src/components/ui/toast.tsx +109 -109
- package/templates/frontend/src/components/ui/toaster.tsx +30 -30
- package/templates/frontend/src/config/site.ts +197 -197
- package/templates/frontend/src/hooks/use-toast.ts +116 -116
- package/templates/frontend/src/lib/api/auth.ts +39 -39
- package/templates/frontend/src/lib/api/client.ts +66 -66
- package/templates/frontend/src/lib/hooks/use-auth.ts +1 -1
- package/templates/frontend/src/lib/utils.ts +6 -6
- package/templates/frontend/src/providers/auth-provider.tsx +60 -60
- package/templates/frontend/src/types/api.ts +12 -12
- package/templates/frontend/src/types/auth.ts +27 -27
- package/templates/frontend/tsconfig.json +23 -23
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion'
|
|
5
|
-
import { ChevronDown } from 'lucide-react'
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
const Accordion = AccordionPrimitive.Root
|
|
9
|
-
|
|
10
|
-
const AccordionItem = React.forwardRef<
|
|
11
|
-
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
12
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
13
|
-
>(({ className, ...props }, ref) => (
|
|
14
|
-
<AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
|
|
15
|
-
))
|
|
16
|
-
AccordionItem.displayName = 'AccordionItem'
|
|
17
|
-
|
|
18
|
-
const AccordionTrigger = React.forwardRef<
|
|
19
|
-
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
20
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
21
|
-
>(({ className, children, ...props }, ref) => (
|
|
22
|
-
<AccordionPrimitive.Header className="flex">
|
|
23
|
-
<AccordionPrimitive.Trigger
|
|
24
|
-
ref={ref}
|
|
25
|
-
className={cn(
|
|
26
|
-
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
|
|
27
|
-
className,
|
|
28
|
-
)}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
33
|
-
</AccordionPrimitive.Trigger>
|
|
34
|
-
</AccordionPrimitive.Header>
|
|
35
|
-
))
|
|
36
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
37
|
-
|
|
38
|
-
const AccordionContent = React.forwardRef<
|
|
39
|
-
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
40
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
41
|
-
>(({ className, children, ...props }, ref) => (
|
|
42
|
-
<AccordionPrimitive.Content
|
|
43
|
-
ref={ref}
|
|
44
|
-
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
48
|
-
</AccordionPrimitive.Content>
|
|
49
|
-
))
|
|
50
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
51
|
-
|
|
52
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion'
|
|
5
|
+
import { ChevronDown } from 'lucide-react'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const Accordion = AccordionPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const AccordionItem = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
13
|
+
>(({ className, ...props }, ref) => (
|
|
14
|
+
<AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
|
|
15
|
+
))
|
|
16
|
+
AccordionItem.displayName = 'AccordionItem'
|
|
17
|
+
|
|
18
|
+
const AccordionTrigger = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
20
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
21
|
+
>(({ className, children, ...props }, ref) => (
|
|
22
|
+
<AccordionPrimitive.Header className="flex">
|
|
23
|
+
<AccordionPrimitive.Trigger
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn(
|
|
26
|
+
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
33
|
+
</AccordionPrimitive.Trigger>
|
|
34
|
+
</AccordionPrimitive.Header>
|
|
35
|
+
))
|
|
36
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
37
|
+
|
|
38
|
+
const AccordionContent = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
40
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
41
|
+
>(({ className, children, ...props }, ref) => (
|
|
42
|
+
<AccordionPrimitive.Content
|
|
43
|
+
ref={ref}
|
|
44
|
+
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
48
|
+
</AccordionPrimitive.Content>
|
|
49
|
+
))
|
|
50
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
51
|
+
|
|
52
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar'
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
const Avatar = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => (
|
|
11
|
-
<AvatarPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
|
-
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
))
|
|
17
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
18
|
-
|
|
19
|
-
const AvatarImage = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
22
|
-
>(({ className, ...props }, ref) => (
|
|
23
|
-
<AvatarPrimitive.Image
|
|
24
|
-
ref={ref}
|
|
25
|
-
className={cn('aspect-square h-full w-full', className)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
))
|
|
29
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
30
|
-
|
|
31
|
-
const AvatarFallback = React.forwardRef<
|
|
32
|
-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
33
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
34
|
-
>(({ className, ...props }, ref) => (
|
|
35
|
-
<AvatarPrimitive.Fallback
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn(
|
|
38
|
-
'flex h-full w-full items-center justify-center rounded-full bg-muted text-sm font-medium',
|
|
39
|
-
className,
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
43
|
-
))
|
|
44
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
45
|
-
|
|
46
|
-
export { Avatar, AvatarImage, AvatarFallback }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Avatar = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<AvatarPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
))
|
|
17
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
18
|
+
|
|
19
|
+
const AvatarImage = React.forwardRef<
|
|
20
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
21
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
22
|
+
>(({ className, ...props }, ref) => (
|
|
23
|
+
<AvatarPrimitive.Image
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn('aspect-square h-full w-full', className)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
))
|
|
29
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
30
|
+
|
|
31
|
+
const AvatarFallback = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
34
|
+
>(({ className, ...props }, ref) => (
|
|
35
|
+
<AvatarPrimitive.Fallback
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={cn(
|
|
38
|
+
'flex h-full w-full items-center justify-center rounded-full bg-muted text-sm font-medium',
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
))
|
|
44
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
45
|
+
|
|
46
|
+
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
-
import { cn } from '@/lib/utils'
|
|
4
|
-
|
|
5
|
-
const badgeVariants = cva(
|
|
6
|
-
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
11
|
-
secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
12
|
-
destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
|
13
|
-
outline: 'text-foreground',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
variant: 'default',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
export interface BadgeProps
|
|
23
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
24
|
-
VariantProps<typeof badgeVariants> {}
|
|
25
|
-
|
|
26
|
-
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
27
|
-
return <div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { Badge, badgeVariants }
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const badgeVariants = cva(
|
|
6
|
+
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
11
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
12
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
|
13
|
+
outline: 'text-foreground',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: 'default',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export interface BadgeProps
|
|
23
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
24
|
+
VariantProps<typeof badgeVariants> {}
|
|
25
|
+
|
|
26
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
27
|
+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Badge, badgeVariants }
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
3
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0',
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
|
12
|
-
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
|
13
|
-
outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
14
|
-
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
|
15
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
16
|
-
link: 'text-primary underline-offset-4 hover:underline',
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
default: 'h-9 px-4 py-2',
|
|
20
|
-
sm: 'h-8 rounded-md px-3 text-xs',
|
|
21
|
-
lg: 'h-10 rounded-md px-8',
|
|
22
|
-
icon: 'h-9 w-9',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
variant: 'default',
|
|
27
|
-
size: 'default',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
export interface ButtonProps
|
|
33
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
34
|
-
VariantProps<typeof buttonVariants> {
|
|
35
|
-
asChild?: boolean
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
39
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
40
|
-
const Comp = asChild ? Slot : 'button'
|
|
41
|
-
return (
|
|
42
|
-
<Comp
|
|
43
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
44
|
-
ref={ref}
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
},
|
|
49
|
-
)
|
|
50
|
-
Button.displayName = 'Button'
|
|
51
|
-
|
|
52
|
-
export { Button, buttonVariants }
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0',
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
|
12
|
+
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
|
13
|
+
outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
14
|
+
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
|
15
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
16
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: 'h-9 px-4 py-2',
|
|
20
|
+
sm: 'h-8 rounded-md px-3 text-xs',
|
|
21
|
+
lg: 'h-10 rounded-md px-8',
|
|
22
|
+
icon: 'h-9 w-9',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: 'default',
|
|
27
|
+
size: 'default',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export interface ButtonProps
|
|
33
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
34
|
+
VariantProps<typeof buttonVariants> {
|
|
35
|
+
asChild?: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
39
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
40
|
+
const Comp = asChild ? Slot : 'button'
|
|
41
|
+
return (
|
|
42
|
+
<Comp
|
|
43
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
44
|
+
ref={ref}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
},
|
|
49
|
+
)
|
|
50
|
+
Button.displayName = 'Button'
|
|
51
|
+
|
|
52
|
+
export { Button, buttonVariants }
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { cn } from '@/lib/utils'
|
|
3
|
-
|
|
4
|
-
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
5
|
-
({ className, ...props }, ref) => (
|
|
6
|
-
<div
|
|
7
|
-
ref={ref}
|
|
8
|
-
className={cn('rounded-xl border bg-card text-card-foreground shadow', className)}
|
|
9
|
-
{...props}
|
|
10
|
-
/>
|
|
11
|
-
),
|
|
12
|
-
)
|
|
13
|
-
Card.displayName = 'Card'
|
|
14
|
-
|
|
15
|
-
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
16
|
-
({ className, ...props }, ref) => (
|
|
17
|
-
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
18
|
-
),
|
|
19
|
-
)
|
|
20
|
-
CardHeader.displayName = 'CardHeader'
|
|
21
|
-
|
|
22
|
-
const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
23
|
-
({ className, ...props }, ref) => (
|
|
24
|
-
<div ref={ref} className={cn('font-semibold leading-none tracking-tight', className)} {...props} />
|
|
25
|
-
),
|
|
26
|
-
)
|
|
27
|
-
CardTitle.displayName = 'CardTitle'
|
|
28
|
-
|
|
29
|
-
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
30
|
-
({ className, ...props }, ref) => (
|
|
31
|
-
<div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
32
|
-
),
|
|
33
|
-
)
|
|
34
|
-
CardDescription.displayName = 'CardDescription'
|
|
35
|
-
|
|
36
|
-
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
37
|
-
({ className, ...props }, ref) => (
|
|
38
|
-
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
39
|
-
),
|
|
40
|
-
)
|
|
41
|
-
CardContent.displayName = 'CardContent'
|
|
42
|
-
|
|
43
|
-
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
44
|
-
({ className, ...props }, ref) => (
|
|
45
|
-
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
46
|
-
),
|
|
47
|
-
)
|
|
48
|
-
CardFooter.displayName = 'CardFooter'
|
|
49
|
-
|
|
50
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
5
|
+
({ className, ...props }, ref) => (
|
|
6
|
+
<div
|
|
7
|
+
ref={ref}
|
|
8
|
+
className={cn('rounded-xl border bg-card text-card-foreground shadow', className)}
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
),
|
|
12
|
+
)
|
|
13
|
+
Card.displayName = 'Card'
|
|
14
|
+
|
|
15
|
+
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
16
|
+
({ className, ...props }, ref) => (
|
|
17
|
+
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
18
|
+
),
|
|
19
|
+
)
|
|
20
|
+
CardHeader.displayName = 'CardHeader'
|
|
21
|
+
|
|
22
|
+
const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
23
|
+
({ className, ...props }, ref) => (
|
|
24
|
+
<div ref={ref} className={cn('font-semibold leading-none tracking-tight', className)} {...props} />
|
|
25
|
+
),
|
|
26
|
+
)
|
|
27
|
+
CardTitle.displayName = 'CardTitle'
|
|
28
|
+
|
|
29
|
+
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
30
|
+
({ className, ...props }, ref) => (
|
|
31
|
+
<div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
32
|
+
),
|
|
33
|
+
)
|
|
34
|
+
CardDescription.displayName = 'CardDescription'
|
|
35
|
+
|
|
36
|
+
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
37
|
+
({ className, ...props }, ref) => (
|
|
38
|
+
<div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
39
|
+
),
|
|
40
|
+
)
|
|
41
|
+
CardContent.displayName = 'CardContent'
|
|
42
|
+
|
|
43
|
+
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
44
|
+
({ className, ...props }, ref) => (
|
|
45
|
+
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
CardFooter.displayName = 'CardFooter'
|
|
49
|
+
|
|
50
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
|
|
5
|
-
import { Check } from 'lucide-react'
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
const Checkbox = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
11
|
-
>(({ className, ...props }, ref) => (
|
|
12
|
-
<CheckboxPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
|
|
21
|
-
<Check className="h-4 w-4" />
|
|
22
|
-
</CheckboxPrimitive.Indicator>
|
|
23
|
-
</CheckboxPrimitive.Root>
|
|
24
|
-
))
|
|
25
|
-
Checkbox.displayName = CheckboxPrimitive.Root.displayName
|
|
26
|
-
|
|
27
|
-
export { Checkbox }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
|
|
5
|
+
import { Check } from 'lucide-react'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const Checkbox = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<CheckboxPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
|
|
21
|
+
<Check className="h-4 w-4" />
|
|
22
|
+
</CheckboxPrimitive.Indicator>
|
|
23
|
+
</CheckboxPrimitive.Root>
|
|
24
|
+
))
|
|
25
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName
|
|
26
|
+
|
|
27
|
+
export { Checkbox }
|