create-ej-app 1.0.0 → 2.1.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 (198) hide show
  1. package/cli.js +22 -4
  2. package/package.json +1 -1
  3. package/template/{.env.example → advanced/.env.example} +4 -0
  4. package/template/{components.json → advanced/components.json} +1 -1
  5. package/template/{package.json → advanced/package.json} +11 -0
  6. package/template/{prisma → advanced/prisma}/schema.prisma +18 -1
  7. package/template/{src → advanced/src}/app/(app)/tasks/[id]/actions.ts +46 -4
  8. package/template/{src → advanced/src}/app/(app)/tasks/[id]/render.tsx +136 -25
  9. package/template/{src → advanced/src}/app/(app)/tasks/actions.ts +0 -6
  10. package/template/{src → advanced/src}/app/(app)/tasks/page.tsx +0 -3
  11. package/template/{src → advanced/src}/app/(app)/tasks/render.tsx +0 -10
  12. package/template/advanced/src/app/api/upload/route.ts +45 -0
  13. package/template/{src → advanced/src}/app/layout.tsx +1 -1
  14. package/template/{src → advanced/src}/env.mjs +10 -2
  15. package/template/advanced/src/styles/editor.css +61 -0
  16. package/template/{tailwind.config.ts → advanced/tailwind.config.ts} +1 -1
  17. package/template/base/.env.example +16 -0
  18. package/template/base/.eslintrc.cjs +24 -0
  19. package/template/base/components.json +16 -0
  20. package/template/base/next.config.mjs +18 -0
  21. package/template/base/package.json +79 -0
  22. package/template/base/postcss.config.cjs +6 -0
  23. package/template/base/prettier.config.ts +11 -0
  24. package/template/base/prisma/schema.prisma +115 -0
  25. package/template/base/public/next.svg +1 -0
  26. package/template/base/src/app/(app)/dashboard/page.tsx +19 -0
  27. package/template/base/src/app/(app)/layout.tsx +90 -0
  28. package/template/base/src/app/(app)/settings/actions.ts +18 -0
  29. package/template/base/src/app/(app)/settings/loading.tsx +28 -0
  30. package/template/base/src/app/(app)/settings/page.tsx +28 -0
  31. package/template/base/src/app/(app)/settings/render.tsx +113 -0
  32. package/template/base/src/app/(app)/tasks/[id]/actions.ts +149 -0
  33. package/template/base/src/app/(app)/tasks/[id]/page.tsx +25 -0
  34. package/template/base/src/app/(app)/tasks/[id]/render.tsx +413 -0
  35. package/template/base/src/app/(app)/tasks/actions.ts +69 -0
  36. package/template/base/src/app/(app)/tasks/page.tsx +53 -0
  37. package/template/base/src/app/(app)/tasks/render.tsx +107 -0
  38. package/template/base/src/app/(app)/users/[id]/actions.ts +83 -0
  39. package/template/base/src/app/(app)/users/[id]/page.tsx +32 -0
  40. package/template/base/src/app/(app)/users/[id]/render.tsx +240 -0
  41. package/template/base/src/app/(app)/users/actions.ts +55 -0
  42. package/template/base/src/app/(app)/users/page.tsx +49 -0
  43. package/template/base/src/app/(app)/users/render.tsx +80 -0
  44. package/template/base/src/app/(auth)/layout.tsx +20 -0
  45. package/template/base/src/app/(auth)/login/page.tsx +49 -0
  46. package/template/base/src/app/(auth)/login/user-auth-form.tsx +152 -0
  47. package/template/base/src/app/(marketing)/layout.tsx +42 -0
  48. package/template/base/src/app/(marketing)/page.tsx +96 -0
  49. package/template/base/src/app/api/auth/[...nextauth]/route.ts +7 -0
  50. package/template/base/src/app/api/upload/route.ts +45 -0
  51. package/template/base/src/app/favicon.ico +0 -0
  52. package/template/base/src/app/layout.tsx +32 -0
  53. package/template/base/src/components/app-nav-command.tsx +160 -0
  54. package/template/base/src/components/dark-mode-toggle.tsx +43 -0
  55. package/template/base/src/components/data-table/data-table-column-header.tsx +91 -0
  56. package/template/base/src/components/data-table/data-table-faceted-filter.tsx +149 -0
  57. package/template/base/src/components/data-table/data-table-loading.tsx +77 -0
  58. package/template/base/src/components/data-table/data-table-pagination.tsx +94 -0
  59. package/template/base/src/components/data-table/data-table-toolbar.tsx +78 -0
  60. package/template/base/src/components/data-table/data-table-types.ts +17 -0
  61. package/template/base/src/components/data-table/data-table-view-options.tsx +59 -0
  62. package/template/base/src/components/data-table/data-table.tsx +301 -0
  63. package/template/base/src/components/data-table/simple-data-table.tsx +109 -0
  64. package/template/base/src/components/empty-placeholder.tsx +78 -0
  65. package/template/base/src/components/heading.tsx +17 -0
  66. package/template/base/src/components/icons.tsx +83 -0
  67. package/template/base/src/components/main-nav.tsx +64 -0
  68. package/template/base/src/components/mobile-nav.tsx +50 -0
  69. package/template/base/src/components/shell.tsx +13 -0
  70. package/template/base/src/components/side-nav.tsx +51 -0
  71. package/template/base/src/components/site-footer.tsx +31 -0
  72. package/template/base/src/components/system-info.tsx +36 -0
  73. package/template/base/src/components/theme-provider.tsx +13 -0
  74. package/template/base/src/components/ui/alert-dialog.tsx +145 -0
  75. package/template/base/src/components/ui/avatar.tsx +50 -0
  76. package/template/base/src/components/ui/badge.tsx +36 -0
  77. package/template/base/src/components/ui/button.tsx +56 -0
  78. package/template/base/src/components/ui/card.tsx +79 -0
  79. package/template/base/src/components/ui/checkbox.tsx +30 -0
  80. package/template/base/src/components/ui/command.tsx +155 -0
  81. package/template/base/src/components/ui/dialog.tsx +123 -0
  82. package/template/base/src/components/ui/dropdown-menu.tsx +200 -0
  83. package/template/base/src/components/ui/form.tsx +176 -0
  84. package/template/base/src/components/ui/input.tsx +25 -0
  85. package/template/base/src/components/ui/label.tsx +26 -0
  86. package/template/base/src/components/ui/popover.tsx +31 -0
  87. package/template/base/src/components/ui/select.tsx +121 -0
  88. package/template/base/src/components/ui/separator.tsx +31 -0
  89. package/template/base/src/components/ui/skeleton.tsx +15 -0
  90. package/template/base/src/components/ui/table.tsx +114 -0
  91. package/template/base/src/components/ui/textarea.tsx +24 -0
  92. package/template/base/src/components/ui/toast.tsx +127 -0
  93. package/template/base/src/components/ui/toaster.tsx +35 -0
  94. package/template/base/src/components/ui/use-toast.ts +189 -0
  95. package/template/base/src/components/user-account-nav.tsx +60 -0
  96. package/template/base/src/components/user-avatar.tsx +25 -0
  97. package/template/base/src/env.mjs +75 -0
  98. package/template/base/src/hooks/use-debounce.ts +17 -0
  99. package/template/base/src/hooks/use-lock-body.tsx +12 -0
  100. package/template/base/src/lib/auth.ts +79 -0
  101. package/template/base/src/lib/cn.ts +4 -0
  102. package/template/base/src/lib/db.ts +20 -0
  103. package/template/base/src/lib/delay.ts +2 -0
  104. package/template/base/src/lib/formatDate.ts +11 -0
  105. package/template/base/src/lib/generateLabel.ts +5 -0
  106. package/template/base/src/lib/siteConfig.ts +4 -0
  107. package/template/base/src/styles/editor.css +61 -0
  108. package/template/base/src/styles/globals.css +76 -0
  109. package/template/base/src/types/UnwrapPromise.ts +1 -0
  110. package/template/base/tailwind.config.ts +79 -0
  111. package/template/base/tsconfig.json +46 -0
  112. /package/template/{.eslintrc.cjs → advanced/.eslintrc.cjs} +0 -0
  113. /package/template/{next.config.mjs → advanced/next.config.mjs} +0 -0
  114. /package/template/{postcss.config.cjs → advanced/postcss.config.cjs} +0 -0
  115. /package/template/{prettier.config.ts → advanced/prettier.config.ts} +0 -0
  116. /package/template/{public → advanced/public}/next.svg +0 -0
  117. /package/template/{src → advanced/src}/app/(app)/dashboard/page.tsx +0 -0
  118. /package/template/{src → advanced/src}/app/(app)/layout.tsx +0 -0
  119. /package/template/{src → advanced/src}/app/(app)/roles/[id]/actions.ts +0 -0
  120. /package/template/{src → advanced/src}/app/(app)/roles/[id]/page.tsx +0 -0
  121. /package/template/{src → advanced/src}/app/(app)/roles/[id]/render.tsx +0 -0
  122. /package/template/{src → advanced/src}/app/(app)/roles/actions.ts +0 -0
  123. /package/template/{src → advanced/src}/app/(app)/roles/page.tsx +0 -0
  124. /package/template/{src → advanced/src}/app/(app)/roles/render.tsx +0 -0
  125. /package/template/{src → advanced/src}/app/(app)/settings/actions.ts +0 -0
  126. /package/template/{src → advanced/src}/app/(app)/settings/loading.tsx +0 -0
  127. /package/template/{src → advanced/src}/app/(app)/settings/page.tsx +0 -0
  128. /package/template/{src → advanced/src}/app/(app)/settings/render.tsx +0 -0
  129. /package/template/{src → advanced/src}/app/(app)/tasks/[id]/page.tsx +0 -0
  130. /package/template/{src → advanced/src}/app/(app)/users/[id]/actions.ts +0 -0
  131. /package/template/{src → advanced/src}/app/(app)/users/[id]/page.tsx +0 -0
  132. /package/template/{src → advanced/src}/app/(app)/users/[id]/render.tsx +0 -0
  133. /package/template/{src → advanced/src}/app/(app)/users/actions.ts +0 -0
  134. /package/template/{src → advanced/src}/app/(app)/users/page.tsx +0 -0
  135. /package/template/{src → advanced/src}/app/(app)/users/render.tsx +0 -0
  136. /package/template/{src → advanced/src}/app/(auth)/layout.tsx +0 -0
  137. /package/template/{src → advanced/src}/app/(auth)/login/page.tsx +0 -0
  138. /package/template/{src → advanced/src}/app/(auth)/login/user-auth-form.tsx +0 -0
  139. /package/template/{src → advanced/src}/app/(marketing)/layout.tsx +0 -0
  140. /package/template/{src → advanced/src}/app/(marketing)/page.tsx +0 -0
  141. /package/template/{src → advanced/src}/app/api/auth/[...nextauth]/route.ts +0 -0
  142. /package/template/{src → advanced/src}/app/favicon.ico +0 -0
  143. /package/template/{src → advanced/src}/components/app-nav-command.tsx +0 -0
  144. /package/template/{src → advanced/src}/components/dark-mode-toggle.tsx +0 -0
  145. /package/template/{src → advanced/src}/components/data-table/data-table-column-header.tsx +0 -0
  146. /package/template/{src → advanced/src}/components/data-table/data-table-faceted-filter.tsx +0 -0
  147. /package/template/{src → advanced/src}/components/data-table/data-table-loading.tsx +0 -0
  148. /package/template/{src → advanced/src}/components/data-table/data-table-pagination.tsx +0 -0
  149. /package/template/{src → advanced/src}/components/data-table/data-table-toolbar.tsx +0 -0
  150. /package/template/{src → advanced/src}/components/data-table/data-table-types.ts +0 -0
  151. /package/template/{src → advanced/src}/components/data-table/data-table-view-options.tsx +0 -0
  152. /package/template/{src → advanced/src}/components/data-table/data-table.tsx +0 -0
  153. /package/template/{src → advanced/src}/components/data-table/simple-data-table.tsx +0 -0
  154. /package/template/{src → advanced/src}/components/empty-placeholder.tsx +0 -0
  155. /package/template/{src → advanced/src}/components/heading.tsx +0 -0
  156. /package/template/{src → advanced/src}/components/icons.tsx +0 -0
  157. /package/template/{src → advanced/src}/components/main-nav.tsx +0 -0
  158. /package/template/{src → advanced/src}/components/mobile-nav.tsx +0 -0
  159. /package/template/{src → advanced/src}/components/shell.tsx +0 -0
  160. /package/template/{src → advanced/src}/components/side-nav.tsx +0 -0
  161. /package/template/{src → advanced/src}/components/site-footer.tsx +0 -0
  162. /package/template/{src → advanced/src}/components/system-info.tsx +0 -0
  163. /package/template/{src → advanced/src}/components/theme-provider.tsx +0 -0
  164. /package/template/{src → advanced/src}/components/ui/alert-dialog.tsx +0 -0
  165. /package/template/{src → advanced/src}/components/ui/avatar.tsx +0 -0
  166. /package/template/{src → advanced/src}/components/ui/badge.tsx +0 -0
  167. /package/template/{src → advanced/src}/components/ui/button.tsx +0 -0
  168. /package/template/{src → advanced/src}/components/ui/card.tsx +0 -0
  169. /package/template/{src → advanced/src}/components/ui/checkbox.tsx +0 -0
  170. /package/template/{src → advanced/src}/components/ui/command.tsx +0 -0
  171. /package/template/{src → advanced/src}/components/ui/dialog.tsx +0 -0
  172. /package/template/{src → advanced/src}/components/ui/dropdown-menu.tsx +0 -0
  173. /package/template/{src → advanced/src}/components/ui/form.tsx +0 -0
  174. /package/template/{src → advanced/src}/components/ui/input.tsx +0 -0
  175. /package/template/{src → advanced/src}/components/ui/label.tsx +0 -0
  176. /package/template/{src → advanced/src}/components/ui/popover.tsx +0 -0
  177. /package/template/{src → advanced/src}/components/ui/select.tsx +0 -0
  178. /package/template/{src → advanced/src}/components/ui/separator.tsx +0 -0
  179. /package/template/{src → advanced/src}/components/ui/skeleton.tsx +0 -0
  180. /package/template/{src → advanced/src}/components/ui/table.tsx +0 -0
  181. /package/template/{src → advanced/src}/components/ui/textarea.tsx +0 -0
  182. /package/template/{src → advanced/src}/components/ui/toast.tsx +0 -0
  183. /package/template/{src → advanced/src}/components/ui/toaster.tsx +0 -0
  184. /package/template/{src → advanced/src}/components/ui/use-toast.ts +0 -0
  185. /package/template/{src → advanced/src}/components/user-account-nav.tsx +0 -0
  186. /package/template/{src → advanced/src}/components/user-avatar.tsx +0 -0
  187. /package/template/{src → advanced/src}/hooks/use-debounce.ts +0 -0
  188. /package/template/{src → advanced/src}/hooks/use-lock-body.tsx +0 -0
  189. /package/template/{src → advanced/src}/lib/auth.ts +0 -0
  190. /package/template/{src → advanced/src}/lib/cn.ts +0 -0
  191. /package/template/{src → advanced/src}/lib/db.ts +0 -0
  192. /package/template/{src → advanced/src}/lib/delay.ts +0 -0
  193. /package/template/{src → advanced/src}/lib/formatDate.ts +0 -0
  194. /package/template/{src → advanced/src}/lib/generateLabel.ts +0 -0
  195. /package/template/{src → advanced/src}/lib/siteConfig.ts +0 -0
  196. /package/template/{src/app → advanced/src/styles}/globals.css +0 -0
  197. /package/template/{src → advanced/src}/types/UnwrapPromise.ts +0 -0
  198. /package/template/{tsconfig.json → advanced/tsconfig.json} +0 -0
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react'
2
+
3
+ import { cn } from '@/lib/cn'
4
+
5
+ interface ShellProps extends React.HTMLAttributes<HTMLDivElement> {}
6
+
7
+ export const Shell: FC<ShellProps> = ({ children, className, ...props }) => {
8
+ return (
9
+ <div className={cn('grid items-start gap-8 p-1', className)} {...props}>
10
+ {children}
11
+ </div>
12
+ )
13
+ }
@@ -0,0 +1,51 @@
1
+ 'use client'
2
+
3
+ import Link from 'next/link'
4
+ import { usePathname } from 'next/navigation'
5
+
6
+ import { Icons } from '@/components/icons'
7
+ import { cn } from '@/lib/cn'
8
+ import { FC } from 'react'
9
+
10
+ type IconKeys = keyof typeof Icons
11
+
12
+ interface SideNavProps {
13
+ items: {
14
+ title: string
15
+ href?: string | null
16
+ disabled?: boolean | null
17
+ icon?: IconKeys | null
18
+ }[]
19
+ }
20
+
21
+ export const SideNav: FC<SideNavProps> = ({ items }) => {
22
+ const path = usePathname()
23
+
24
+ if (!items?.length) return null
25
+
26
+ return (
27
+ <nav className="grid items-start gap-2">
28
+ {items.map((item, index) => {
29
+ const Icon = Icons[item.icon || 'arrowRight']
30
+ return (
31
+ item.href && (
32
+ <Link key={index} href={item.disabled ? '/' : item.href}>
33
+ <span
34
+ className={cn(
35
+ 'group flex items-center rounded-md px-3 py-2 text-sm font-medium',
36
+ path.includes(item.href)
37
+ ? 'bg-accent'
38
+ : 'transparent underline-offset-4 hover:underline',
39
+ item.disabled && 'cursor-not-allowed opacity-80'
40
+ )}
41
+ >
42
+ <Icon className="mr-2 h-4 w-4" />
43
+ <span>{item.title}</span>
44
+ </span>
45
+ </Link>
46
+ )
47
+ )
48
+ })}
49
+ </nav>
50
+ )
51
+ }
@@ -0,0 +1,31 @@
1
+ import { FC, HTMLAttributes } from 'react'
2
+
3
+ import { DarkModeToggle } from '@/components/dark-mode-toggle'
4
+ import { Icons } from '@/components/icons'
5
+ import { cn } from '@/lib/cn'
6
+ import { siteConfig } from '@/lib/siteConfig'
7
+
8
+ export const SiteFooter: FC<HTMLAttributes<HTMLElement>> = ({ className }) => {
9
+ return (
10
+ <footer className={cn(className)}>
11
+ <div className="container flex flex-col items-center justify-between gap-2 py-4 sm:flex-row">
12
+ <div className="flex flex-col items-center gap-2 sm:flex-row">
13
+ <Icons.logo />
14
+ <p className="text-center text-sm leading-loose sm:text-left">
15
+ {siteConfig.name}. Built by{' '}
16
+ <a
17
+ href="https://github.com/ejekanshjain"
18
+ target="_blank"
19
+ rel="noreferrer"
20
+ className="font-medium underline underline-offset-4"
21
+ >
22
+ ejekanshjain
23
+ </a>
24
+ .
25
+ </p>
26
+ </div>
27
+ <DarkModeToggle />
28
+ </div>
29
+ </footer>
30
+ )
31
+ }
@@ -0,0 +1,36 @@
1
+ 'use client'
2
+
3
+ import { FC, ReactNode } from 'react'
4
+
5
+ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
6
+ import { Separator } from '@/components/ui/separator'
7
+
8
+ type SystemInfoProps = {
9
+ items: {
10
+ label: string
11
+ value: string | ReactNode
12
+ }[]
13
+ }
14
+
15
+ export const SystemInfo: FC<SystemInfoProps> = ({ items }) => {
16
+ return (
17
+ <Card className="max-w-[600px]">
18
+ <CardHeader>
19
+ <CardTitle>System Information</CardTitle>
20
+ </CardHeader>
21
+ <CardContent>
22
+ <dl className="grid gap-4">
23
+ {items.map((item, i) => (
24
+ <div key={i}>
25
+ <dt className="font-semibold">{item.label}</dt>
26
+ <dd>{item.value}</dd>
27
+ {i < items.length - 1 ? (
28
+ <Separator className="mt-2" />
29
+ ) : undefined}
30
+ </div>
31
+ ))}
32
+ </dl>
33
+ </CardContent>
34
+ </Card>
35
+ )
36
+ }
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+
3
+ import { FC } from 'react'
4
+
5
+ import { ThemeProvider as NextThemesProvider } from 'next-themes'
6
+ import { type ThemeProviderProps } from 'next-themes/dist/types'
7
+
8
+ export const ThemeProvider: FC<ThemeProviderProps> = ({
9
+ children,
10
+ ...props
11
+ }) => {
12
+ return <NextThemesProvider {...props}>{children}</NextThemesProvider>
13
+ }
@@ -0,0 +1,145 @@
1
+ 'use client'
2
+
3
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
4
+ import * as React from 'react'
5
+
6
+ import { buttonVariants } from '@/components/ui/button'
7
+ import { cn } from '@/lib/cn'
8
+
9
+ const AlertDialog = AlertDialogPrimitive.Root
10
+
11
+ const AlertDialogTrigger = AlertDialogPrimitive.Trigger
12
+
13
+ const AlertDialogPortal = ({
14
+ className,
15
+ ...props
16
+ }: AlertDialogPrimitive.AlertDialogPortalProps) => (
17
+ <AlertDialogPrimitive.Portal className={cn(className)} {...props} />
18
+ )
19
+ AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName
20
+
21
+ const AlertDialogOverlay = React.forwardRef<
22
+ React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
23
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
24
+ >(({ className, children, ...props }, ref) => (
25
+ <AlertDialogPrimitive.Overlay
26
+ className={cn(
27
+ 'fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
28
+ className
29
+ )}
30
+ {...props}
31
+ ref={ref}
32
+ />
33
+ ))
34
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
35
+
36
+ const AlertDialogContent = React.forwardRef<
37
+ React.ElementRef<typeof AlertDialogPrimitive.Content>,
38
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
39
+ >(({ className, ...props }, ref) => (
40
+ <AlertDialogPortal>
41
+ <AlertDialogOverlay />
42
+ <AlertDialogPrimitive.Content
43
+ ref={ref}
44
+ className={cn(
45
+ '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 md:w-full',
46
+ className
47
+ )}
48
+ {...props}
49
+ />
50
+ </AlertDialogPortal>
51
+ ))
52
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
53
+
54
+ const AlertDialogHeader = ({
55
+ className,
56
+ ...props
57
+ }: React.HTMLAttributes<HTMLDivElement>) => (
58
+ <div
59
+ className={cn(
60
+ 'flex flex-col space-y-2 text-center sm:text-left',
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ )
66
+ AlertDialogHeader.displayName = 'AlertDialogHeader'
67
+
68
+ const AlertDialogFooter = ({
69
+ className,
70
+ ...props
71
+ }: React.HTMLAttributes<HTMLDivElement>) => (
72
+ <div
73
+ className={cn(
74
+ 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
75
+ className
76
+ )}
77
+ {...props}
78
+ />
79
+ )
80
+ AlertDialogFooter.displayName = 'AlertDialogFooter'
81
+
82
+ const AlertDialogTitle = React.forwardRef<
83
+ React.ElementRef<typeof AlertDialogPrimitive.Title>,
84
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
85
+ >(({ className, ...props }, ref) => (
86
+ <AlertDialogPrimitive.Title
87
+ ref={ref}
88
+ className={cn('text-lg font-semibold', className)}
89
+ {...props}
90
+ />
91
+ ))
92
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
93
+
94
+ const AlertDialogDescription = React.forwardRef<
95
+ React.ElementRef<typeof AlertDialogPrimitive.Description>,
96
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
97
+ >(({ className, ...props }, ref) => (
98
+ <AlertDialogPrimitive.Description
99
+ ref={ref}
100
+ className={cn('text-sm text-muted-foreground', className)}
101
+ {...props}
102
+ />
103
+ ))
104
+ AlertDialogDescription.displayName =
105
+ AlertDialogPrimitive.Description.displayName
106
+
107
+ const AlertDialogAction = React.forwardRef<
108
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
109
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
110
+ >(({ className, ...props }, ref) => (
111
+ <AlertDialogPrimitive.Action
112
+ ref={ref}
113
+ className={cn(buttonVariants(), className)}
114
+ {...props}
115
+ />
116
+ ))
117
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
118
+
119
+ const AlertDialogCancel = React.forwardRef<
120
+ React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
121
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
122
+ >(({ className, ...props }, ref) => (
123
+ <AlertDialogPrimitive.Cancel
124
+ ref={ref}
125
+ className={cn(
126
+ buttonVariants({ variant: 'outline' }),
127
+ 'mt-2 sm:mt-0',
128
+ className
129
+ )}
130
+ {...props}
131
+ />
132
+ ))
133
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
134
+
135
+ export {
136
+ AlertDialog,
137
+ AlertDialogAction,
138
+ AlertDialogCancel,
139
+ AlertDialogContent,
140
+ AlertDialogDescription,
141
+ AlertDialogFooter,
142
+ AlertDialogHeader,
143
+ AlertDialogTitle,
144
+ AlertDialogTrigger
145
+ }
@@ -0,0 +1,50 @@
1
+ 'use client'
2
+
3
+ import * as AvatarPrimitive from '@radix-ui/react-avatar'
4
+ import * as React from 'react'
5
+
6
+ import { cn } from '@/lib/cn'
7
+
8
+ const Avatar = React.forwardRef<
9
+ React.ElementRef<typeof AvatarPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
11
+ >(({ className, ...props }, ref) => (
12
+ <AvatarPrimitive.Root
13
+ ref={ref}
14
+ className={cn(
15
+ 'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full',
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ ))
21
+ Avatar.displayName = AvatarPrimitive.Root.displayName
22
+
23
+ const AvatarImage = React.forwardRef<
24
+ React.ElementRef<typeof AvatarPrimitive.Image>,
25
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
26
+ >(({ className, ...props }, ref) => (
27
+ <AvatarPrimitive.Image
28
+ ref={ref}
29
+ className={cn('aspect-square h-full w-full', className)}
30
+ {...props}
31
+ />
32
+ ))
33
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName
34
+
35
+ const AvatarFallback = React.forwardRef<
36
+ React.ElementRef<typeof AvatarPrimitive.Fallback>,
37
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
38
+ >(({ className, ...props }, ref) => (
39
+ <AvatarPrimitive.Fallback
40
+ ref={ref}
41
+ className={cn(
42
+ 'flex h-full w-full items-center justify-center rounded-full bg-muted',
43
+ className
44
+ )}
45
+ {...props}
46
+ />
47
+ ))
48
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
49
+
50
+ export { Avatar, AvatarFallback, AvatarImage }
@@ -0,0 +1,36 @@
1
+ import { cva, type VariantProps } from 'class-variance-authority'
2
+ import * as React from 'react'
3
+
4
+ import { cn } from '@/lib/cn'
5
+
6
+ const badgeVariants = cva(
7
+ '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',
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default:
12
+ 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
13
+ secondary:
14
+ 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
15
+ destructive:
16
+ 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
17
+ outline: 'text-foreground'
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ variant: 'default'
22
+ }
23
+ }
24
+ )
25
+
26
+ export interface BadgeProps
27
+ extends React.HTMLAttributes<HTMLDivElement>,
28
+ VariantProps<typeof badgeVariants> {}
29
+
30
+ function Badge({ className, variant, ...props }: BadgeProps) {
31
+ return (
32
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
+ )
34
+ }
35
+
36
+ export { Badge, badgeVariants }
@@ -0,0 +1,56 @@
1
+ import { Slot } from '@radix-ui/react-slot'
2
+ import { cva, type VariantProps } from 'class-variance-authority'
3
+ import * as React from 'react'
4
+
5
+ import { cn } from '@/lib/cn'
6
+
7
+ const buttonVariants = cva(
8
+ 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
+ destructive:
14
+ 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
15
+ outline:
16
+ 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
17
+ secondary:
18
+ 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
19
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
20
+ link: 'text-primary underline-offset-4 hover:underline'
21
+ },
22
+ size: {
23
+ default: 'h-10 px-4 py-2',
24
+ sm: 'h-9 rounded-md px-3',
25
+ lg: 'h-11 rounded-md px-8',
26
+ icon: 'h-10 w-10'
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ variant: 'default',
31
+ size: 'default'
32
+ }
33
+ }
34
+ )
35
+
36
+ export interface ButtonProps
37
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
+ VariantProps<typeof buttonVariants> {
39
+ asChild?: boolean
40
+ }
41
+
42
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
44
+ const Comp = asChild ? Slot : 'button'
45
+ return (
46
+ <Comp
47
+ className={cn(buttonVariants({ variant, size, className }))}
48
+ ref={ref}
49
+ {...props}
50
+ />
51
+ )
52
+ }
53
+ )
54
+ Button.displayName = 'Button'
55
+
56
+ export { Button, buttonVariants }
@@ -0,0 +1,79 @@
1
+ import * as React from 'react'
2
+
3
+ import { cn } from '@/lib/cn'
4
+
5
+ const Card = React.forwardRef<
6
+ HTMLDivElement,
7
+ React.HTMLAttributes<HTMLDivElement>
8
+ >(({ className, ...props }, ref) => (
9
+ <div
10
+ ref={ref}
11
+ className={cn(
12
+ 'rounded-lg border bg-card text-card-foreground shadow-sm',
13
+ className
14
+ )}
15
+ {...props}
16
+ />
17
+ ))
18
+ Card.displayName = 'Card'
19
+
20
+ const CardHeader = React.forwardRef<
21
+ HTMLDivElement,
22
+ React.HTMLAttributes<HTMLDivElement>
23
+ >(({ className, ...props }, ref) => (
24
+ <div
25
+ ref={ref}
26
+ className={cn('flex flex-col space-y-1.5 p-6', className)}
27
+ {...props}
28
+ />
29
+ ))
30
+ CardHeader.displayName = 'CardHeader'
31
+
32
+ const CardTitle = React.forwardRef<
33
+ HTMLParagraphElement,
34
+ React.HTMLAttributes<HTMLHeadingElement>
35
+ >(({ className, ...props }, ref) => (
36
+ <h3
37
+ ref={ref}
38
+ className={cn(
39
+ 'text-2xl font-semibold leading-none tracking-tight',
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ ))
45
+ CardTitle.displayName = 'CardTitle'
46
+
47
+ const CardDescription = React.forwardRef<
48
+ HTMLParagraphElement,
49
+ React.HTMLAttributes<HTMLParagraphElement>
50
+ >(({ className, ...props }, ref) => (
51
+ <p
52
+ ref={ref}
53
+ className={cn('text-sm text-muted-foreground', className)}
54
+ {...props}
55
+ />
56
+ ))
57
+ CardDescription.displayName = 'CardDescription'
58
+
59
+ const CardContent = React.forwardRef<
60
+ HTMLDivElement,
61
+ React.HTMLAttributes<HTMLDivElement>
62
+ >(({ className, ...props }, ref) => (
63
+ <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
64
+ ))
65
+ CardContent.displayName = 'CardContent'
66
+
67
+ const CardFooter = React.forwardRef<
68
+ HTMLDivElement,
69
+ React.HTMLAttributes<HTMLDivElement>
70
+ >(({ className, ...props }, ref) => (
71
+ <div
72
+ ref={ref}
73
+ className={cn('flex items-center p-6 pt-0', className)}
74
+ {...props}
75
+ />
76
+ ))
77
+ CardFooter.displayName = 'CardFooter'
78
+
79
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
@@ -0,0 +1,30 @@
1
+ 'use client'
2
+
3
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
4
+ import { Check } from 'lucide-react'
5
+ import * as React from 'react'
6
+
7
+ import { cn } from '@/lib/cn'
8
+
9
+ const Checkbox = React.forwardRef<
10
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
+ >(({ className, ...props }, ref) => (
13
+ <CheckboxPrimitive.Root
14
+ ref={ref}
15
+ className={cn(
16
+ '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',
17
+ className
18
+ )}
19
+ {...props}
20
+ >
21
+ <CheckboxPrimitive.Indicator
22
+ className={cn('flex items-center justify-center text-current')}
23
+ >
24
+ <Check className="h-4 w-4" />
25
+ </CheckboxPrimitive.Indicator>
26
+ </CheckboxPrimitive.Root>
27
+ ))
28
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName
29
+
30
+ export { Checkbox }