ar-saas 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +107 -25
  2. package/dist/cli.js +33 -1
  3. package/dist/generator.js +12 -3
  4. package/package.json +7 -3
  5. package/templates/frontend/package.json +21 -13
  6. package/templates/frontend/pnpm-lock.yaml +5012 -0
  7. package/templates/frontend/pnpm-workspace.yaml +3 -0
  8. package/templates/frontend/src/app/(auth)/register/page.tsx +49 -7
  9. package/templates/frontend/src/app/(dashboard)/billing/page.tsx +111 -0
  10. package/templates/frontend/src/app/(dashboard)/dashboard/page.tsx +81 -12
  11. package/templates/frontend/src/app/(dashboard)/layout.tsx +11 -32
  12. package/templates/frontend/src/app/(dashboard)/profile/page.tsx +226 -0
  13. package/templates/frontend/src/app/(dashboard)/settings/page.tsx +156 -0
  14. package/templates/frontend/src/app/(dashboard)/team/page.tsx +178 -0
  15. package/templates/frontend/src/app/(legal)/privacy/page.tsx +127 -0
  16. package/templates/frontend/src/app/(legal)/terms/page.tsx +118 -0
  17. package/templates/frontend/src/app/page.tsx +43 -3
  18. package/templates/frontend/src/app/setup/page.tsx +1 -4
  19. package/templates/frontend/src/components/dashboard/header.tsx +89 -0
  20. package/templates/frontend/src/components/dashboard/sidebar.tsx +71 -0
  21. package/templates/frontend/src/components/dashboard/stat-card.tsx +34 -0
  22. package/templates/frontend/src/components/landing/faq.tsx +39 -0
  23. package/templates/frontend/src/components/landing/features.tsx +54 -0
  24. package/templates/frontend/src/components/landing/footer.tsx +76 -0
  25. package/templates/frontend/src/components/landing/hero.tsx +72 -0
  26. package/templates/frontend/src/components/landing/navbar.tsx +78 -0
  27. package/templates/frontend/src/components/landing/pricing.tsx +90 -0
  28. package/templates/frontend/src/components/ui/accordion.tsx +52 -0
  29. package/templates/frontend/src/components/ui/avatar.tsx +46 -0
  30. package/templates/frontend/src/components/ui/badge.tsx +30 -0
  31. package/templates/frontend/src/components/ui/checkbox.tsx +27 -0
  32. package/templates/frontend/src/components/ui/dialog.tsx +100 -0
  33. package/templates/frontend/src/components/ui/dropdown-menu.tsx +173 -0
  34. package/templates/frontend/src/components/ui/separator.tsx +25 -0
  35. package/templates/frontend/src/components/ui/skeleton.tsx +7 -0
  36. package/templates/frontend/src/components/ui/switch.tsx +28 -0
  37. package/templates/frontend/src/components/ui/tabs.tsx +54 -0
  38. package/templates/frontend/src/components/ui/textarea.tsx +20 -0
  39. package/templates/frontend/src/config/site.ts +197 -0
@@ -0,0 +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 }
@@ -0,0 +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 }
@@ -0,0 +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 }
@@ -0,0 +1,100 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import * as DialogPrimitive from '@radix-ui/react-dialog'
5
+ import { X } from 'lucide-react'
6
+ import { cn } from '@/lib/utils'
7
+
8
+ const Dialog = DialogPrimitive.Root
9
+ const DialogTrigger = DialogPrimitive.Trigger
10
+ const DialogPortal = DialogPrimitive.Portal
11
+ const DialogClose = DialogPrimitive.Close
12
+
13
+ const DialogOverlay = React.forwardRef<
14
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
15
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
16
+ >(({ className, ...props }, ref) => (
17
+ <DialogPrimitive.Overlay
18
+ ref={ref}
19
+ className={cn(
20
+ 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
21
+ className,
22
+ )}
23
+ {...props}
24
+ />
25
+ ))
26
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
27
+
28
+ const DialogContent = React.forwardRef<
29
+ React.ElementRef<typeof DialogPrimitive.Content>,
30
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
31
+ >(({ className, children, ...props }, ref) => (
32
+ <DialogPortal>
33
+ <DialogOverlay />
34
+ <DialogPrimitive.Content
35
+ ref={ref}
36
+ className={cn(
37
+ 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
38
+ className,
39
+ )}
40
+ {...props}
41
+ >
42
+ {children}
43
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
44
+ <X className="h-4 w-4" />
45
+ <span className="sr-only">Cerrar</span>
46
+ </DialogPrimitive.Close>
47
+ </DialogPrimitive.Content>
48
+ </DialogPortal>
49
+ ))
50
+ DialogContent.displayName = DialogPrimitive.Content.displayName
51
+
52
+ const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
53
+ <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />
54
+ )
55
+ DialogHeader.displayName = 'DialogHeader'
56
+
57
+ const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
58
+ <div
59
+ className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
60
+ {...props}
61
+ />
62
+ )
63
+ DialogFooter.displayName = 'DialogFooter'
64
+
65
+ const DialogTitle = React.forwardRef<
66
+ React.ElementRef<typeof DialogPrimitive.Title>,
67
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
68
+ >(({ className, ...props }, ref) => (
69
+ <DialogPrimitive.Title
70
+ ref={ref}
71
+ className={cn('text-lg font-semibold leading-none tracking-tight', className)}
72
+ {...props}
73
+ />
74
+ ))
75
+ DialogTitle.displayName = DialogPrimitive.Title.displayName
76
+
77
+ const DialogDescription = React.forwardRef<
78
+ React.ElementRef<typeof DialogPrimitive.Description>,
79
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
80
+ >(({ className, ...props }, ref) => (
81
+ <DialogPrimitive.Description
82
+ ref={ref}
83
+ className={cn('text-sm text-muted-foreground', className)}
84
+ {...props}
85
+ />
86
+ ))
87
+ DialogDescription.displayName = DialogPrimitive.Description.displayName
88
+
89
+ export {
90
+ Dialog,
91
+ DialogPortal,
92
+ DialogOverlay,
93
+ DialogClose,
94
+ DialogTrigger,
95
+ DialogContent,
96
+ DialogHeader,
97
+ DialogFooter,
98
+ DialogTitle,
99
+ DialogDescription,
100
+ }
@@ -0,0 +1,173 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
5
+ import { Check, ChevronRight, Circle } from 'lucide-react'
6
+ import { cn } from '@/lib/utils'
7
+
8
+ const DropdownMenu = DropdownMenuPrimitive.Root
9
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
10
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group
11
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal
12
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub
13
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
14
+
15
+ const DropdownMenuSubTrigger = React.forwardRef<
16
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
17
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }
18
+ >(({ className, inset, children, ...props }, ref) => (
19
+ <DropdownMenuPrimitive.SubTrigger
20
+ ref={ref}
21
+ className={cn(
22
+ 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
23
+ inset && 'pl-8',
24
+ className,
25
+ )}
26
+ {...props}
27
+ >
28
+ {children}
29
+ <ChevronRight className="ml-auto h-4 w-4" />
30
+ </DropdownMenuPrimitive.SubTrigger>
31
+ ))
32
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName
33
+
34
+ const DropdownMenuSubContent = React.forwardRef<
35
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
36
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
37
+ >(({ className, ...props }, ref) => (
38
+ <DropdownMenuPrimitive.SubContent
39
+ ref={ref}
40
+ className={cn(
41
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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',
42
+ className,
43
+ )}
44
+ {...props}
45
+ />
46
+ ))
47
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName
48
+
49
+ const DropdownMenuContent = React.forwardRef<
50
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
51
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
52
+ >(({ className, sideOffset = 4, ...props }, ref) => (
53
+ <DropdownMenuPrimitive.Portal>
54
+ <DropdownMenuPrimitive.Content
55
+ ref={ref}
56
+ sideOffset={sideOffset}
57
+ className={cn(
58
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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',
59
+ className,
60
+ )}
61
+ {...props}
62
+ />
63
+ </DropdownMenuPrimitive.Portal>
64
+ ))
65
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
66
+
67
+ const DropdownMenuItem = React.forwardRef<
68
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
69
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & { inset?: boolean }
70
+ >(({ className, inset, ...props }, ref) => (
71
+ <DropdownMenuPrimitive.Item
72
+ ref={ref}
73
+ className={cn(
74
+ 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
75
+ inset && 'pl-8',
76
+ className,
77
+ )}
78
+ {...props}
79
+ />
80
+ ))
81
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
82
+
83
+ const DropdownMenuCheckboxItem = React.forwardRef<
84
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
85
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
86
+ >(({ className, children, checked, ...props }, ref) => (
87
+ <DropdownMenuPrimitive.CheckboxItem
88
+ ref={ref}
89
+ className={cn(
90
+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
91
+ className,
92
+ )}
93
+ checked={checked}
94
+ {...props}
95
+ >
96
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
97
+ <DropdownMenuPrimitive.ItemIndicator>
98
+ <Check className="h-4 w-4" />
99
+ </DropdownMenuPrimitive.ItemIndicator>
100
+ </span>
101
+ {children}
102
+ </DropdownMenuPrimitive.CheckboxItem>
103
+ ))
104
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName
105
+
106
+ const DropdownMenuRadioItem = React.forwardRef<
107
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
108
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
109
+ >(({ className, children, ...props }, ref) => (
110
+ <DropdownMenuPrimitive.RadioItem
111
+ ref={ref}
112
+ className={cn(
113
+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
114
+ className,
115
+ )}
116
+ {...props}
117
+ >
118
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
119
+ <DropdownMenuPrimitive.ItemIndicator>
120
+ <Circle className="h-2 w-2 fill-current" />
121
+ </DropdownMenuPrimitive.ItemIndicator>
122
+ </span>
123
+ {children}
124
+ </DropdownMenuPrimitive.RadioItem>
125
+ ))
126
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
127
+
128
+ const DropdownMenuLabel = React.forwardRef<
129
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
130
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }
131
+ >(({ className, inset, ...props }, ref) => (
132
+ <DropdownMenuPrimitive.Label
133
+ ref={ref}
134
+ className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
135
+ {...props}
136
+ />
137
+ ))
138
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
139
+
140
+ const DropdownMenuSeparator = React.forwardRef<
141
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
142
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
143
+ >(({ className, ...props }, ref) => (
144
+ <DropdownMenuPrimitive.Separator
145
+ ref={ref}
146
+ className={cn('-mx-1 my-1 h-px bg-muted', className)}
147
+ {...props}
148
+ />
149
+ ))
150
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
151
+
152
+ const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => (
153
+ <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />
154
+ )
155
+ DropdownMenuShortcut.displayName = 'DropdownMenuShortcut'
156
+
157
+ export {
158
+ DropdownMenu,
159
+ DropdownMenuTrigger,
160
+ DropdownMenuContent,
161
+ DropdownMenuItem,
162
+ DropdownMenuCheckboxItem,
163
+ DropdownMenuRadioItem,
164
+ DropdownMenuLabel,
165
+ DropdownMenuSeparator,
166
+ DropdownMenuShortcut,
167
+ DropdownMenuGroup,
168
+ DropdownMenuPortal,
169
+ DropdownMenuSub,
170
+ DropdownMenuSubContent,
171
+ DropdownMenuSubTrigger,
172
+ DropdownMenuRadioGroup,
173
+ }
@@ -0,0 +1,25 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import * as SeparatorPrimitive from '@radix-ui/react-separator'
5
+ import { cn } from '@/lib/utils'
6
+
7
+ const Separator = React.forwardRef<
8
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
10
+ >(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
11
+ <SeparatorPrimitive.Root
12
+ ref={ref}
13
+ decorative={decorative}
14
+ orientation={orientation}
15
+ className={cn(
16
+ 'shrink-0 bg-border',
17
+ orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
18
+ className,
19
+ )}
20
+ {...props}
21
+ />
22
+ ))
23
+ Separator.displayName = SeparatorPrimitive.Root.displayName
24
+
25
+ export { Separator }
@@ -0,0 +1,7 @@
1
+ import { cn } from '@/lib/utils'
2
+
3
+ function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
4
+ return <div className={cn('animate-pulse rounded-md bg-muted', className)} {...props} />
5
+ }
6
+
7
+ export { Skeleton }
@@ -0,0 +1,28 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import * as SwitchPrimitive from '@radix-ui/react-switch'
5
+ import { cn } from '@/lib/utils'
6
+
7
+ const Switch = React.forwardRef<
8
+ React.ElementRef<typeof SwitchPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>
10
+ >(({ className, ...props }, ref) => (
11
+ <SwitchPrimitive.Root
12
+ className={cn(
13
+ 'peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
14
+ className,
15
+ )}
16
+ {...props}
17
+ ref={ref}
18
+ >
19
+ <SwitchPrimitive.Thumb
20
+ className={cn(
21
+ 'pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',
22
+ )}
23
+ />
24
+ </SwitchPrimitive.Root>
25
+ ))
26
+ Switch.displayName = SwitchPrimitive.Root.displayName
27
+
28
+ export { Switch }
@@ -0,0 +1,54 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import * as TabsPrimitive from '@radix-ui/react-tabs'
5
+ import { cn } from '@/lib/utils'
6
+
7
+ const Tabs = TabsPrimitive.Root
8
+
9
+ const TabsList = React.forwardRef<
10
+ React.ElementRef<typeof TabsPrimitive.List>,
11
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
12
+ >(({ className, ...props }, ref) => (
13
+ <TabsPrimitive.List
14
+ ref={ref}
15
+ className={cn(
16
+ 'inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',
17
+ className,
18
+ )}
19
+ {...props}
20
+ />
21
+ ))
22
+ TabsList.displayName = TabsPrimitive.List.displayName
23
+
24
+ const TabsTrigger = React.forwardRef<
25
+ React.ElementRef<typeof TabsPrimitive.Trigger>,
26
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
27
+ >(({ className, ...props }, ref) => (
28
+ <TabsPrimitive.Trigger
29
+ ref={ref}
30
+ className={cn(
31
+ 'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
32
+ className,
33
+ )}
34
+ {...props}
35
+ />
36
+ ))
37
+ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
38
+
39
+ const TabsContent = React.forwardRef<
40
+ React.ElementRef<typeof TabsPrimitive.Content>,
41
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
42
+ >(({ className, ...props }, ref) => (
43
+ <TabsPrimitive.Content
44
+ ref={ref}
45
+ className={cn(
46
+ 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
47
+ className,
48
+ )}
49
+ {...props}
50
+ />
51
+ ))
52
+ TabsContent.displayName = TabsPrimitive.Content.displayName
53
+
54
+ export { Tabs, TabsList, TabsTrigger, TabsContent }
@@ -0,0 +1,20 @@
1
+ import * as React from 'react'
2
+ import { cn } from '@/lib/utils'
3
+
4
+ const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<'textarea'>>(
5
+ ({ className, ...props }, ref) => {
6
+ return (
7
+ <textarea
8
+ className={cn(
9
+ 'flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
10
+ className,
11
+ )}
12
+ ref={ref}
13
+ {...props}
14
+ />
15
+ )
16
+ },
17
+ )
18
+ Textarea.displayName = 'Textarea'
19
+
20
+ export { Textarea }