wexts 4.1.0 → 4.1.5

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 (199) hide show
  1. package/README.md +49 -49
  2. package/bin/wexts.cjs +2 -2
  3. package/package.json +153 -148
  4. package/templates/.dockerignore +43 -43
  5. package/templates/.env.example +17 -17
  6. package/templates/Dockerfile +60 -60
  7. package/templates/Procfile +1 -1
  8. package/templates/README.md +67 -67
  9. package/templates/api-sdk.ts +115 -115
  10. package/templates/docker-compose.yml +34 -34
  11. package/templates/nestjs-api/.env.example +3 -3
  12. package/templates/nestjs-api/README.md +87 -87
  13. package/templates/nestjs-api/nest-cli.json +6 -6
  14. package/templates/nestjs-api/package.json +40 -40
  15. package/templates/nestjs-api/prisma/migrations/20251123205437_init/migration.sql +24 -24
  16. package/templates/nestjs-api/prisma/migrations/migration_lock.toml +3 -3
  17. package/templates/nestjs-api/prisma/schema.prisma +29 -29
  18. package/templates/nestjs-api/src/app.module.ts +17 -17
  19. package/templates/nestjs-api/src/auth/auth.controller.ts +27 -27
  20. package/templates/nestjs-api/src/auth/auth.module.ts +37 -37
  21. package/templates/nestjs-api/src/auth/auth.service.ts +86 -86
  22. package/templates/nestjs-api/src/auth/dto/auth.dto.ts +22 -22
  23. package/templates/nestjs-api/src/auth/guards/jwt-auth.guard.ts +5 -5
  24. package/templates/nestjs-api/src/auth/strategies/jwt.strategy.ts +27 -27
  25. package/templates/nestjs-api/src/main.ts +32 -32
  26. package/templates/nestjs-api/src/prisma/prisma.module.ts +9 -9
  27. package/templates/nestjs-api/src/prisma/prisma.service.ts +14 -14
  28. package/templates/nestjs-api/src/todos/dto/todo.dto.ts +24 -24
  29. package/templates/nestjs-api/src/todos/todos.controller.ts +39 -39
  30. package/templates/nestjs-api/src/todos/todos.module.ts +11 -11
  31. package/templates/nestjs-api/src/todos/todos.service.ts +53 -53
  32. package/templates/nestjs-api/src/users/users.controller.ts +14 -14
  33. package/templates/nestjs-api/src/users/users.module.ts +12 -12
  34. package/templates/nestjs-api/src/users/users.service.ts +19 -19
  35. package/templates/nestjs-api/tsconfig.json +39 -39
  36. package/templates/nextjs-web/README.md +76 -76
  37. package/templates/nextjs-web/app/actions/auth.ts +108 -108
  38. package/templates/nextjs-web/app/dashboard/error.tsx +39 -39
  39. package/templates/nextjs-web/app/dashboard/loading.tsx +14 -14
  40. package/templates/nextjs-web/app/dashboard/page.tsx +5 -5
  41. package/templates/nextjs-web/app/globals.css +93 -93
  42. package/templates/nextjs-web/app/layout.tsx +29 -29
  43. package/templates/nextjs-web/app/login/page.tsx +5 -5
  44. package/templates/nextjs-web/app/page.tsx +28 -28
  45. package/templates/nextjs-web/app/register/page.tsx +5 -5
  46. package/templates/nextjs-web/components/ui/button.tsx +56 -56
  47. package/templates/nextjs-web/components/ui/card.tsx +79 -79
  48. package/templates/nextjs-web/components/ui/input.tsx +25 -25
  49. package/templates/nextjs-web/components/ui/label.tsx +24 -24
  50. package/templates/nextjs-web/features/auth/LoginForm.tsx +140 -140
  51. package/templates/nextjs-web/features/auth/RegisterForm.tsx +159 -159
  52. package/templates/nextjs-web/features/auth/api.ts +35 -35
  53. package/templates/nextjs-web/features/auth/index.ts +3 -3
  54. package/templates/nextjs-web/features/dashboard/DashboardView.tsx +204 -204
  55. package/templates/nextjs-web/features/dashboard/api.ts +9 -9
  56. package/templates/nextjs-web/features/dashboard/components.tsx +74 -74
  57. package/templates/nextjs-web/features/dashboard/index.ts +3 -3
  58. package/templates/nextjs-web/hooks/index.ts +4 -4
  59. package/templates/nextjs-web/lib/api-client.ts +89 -89
  60. package/templates/nextjs-web/lib/api.ts +115 -115
  61. package/templates/nextjs-web/lib/axios-global-config.ts +17 -17
  62. package/templates/nextjs-web/lib/utils.ts +6 -6
  63. package/templates/nextjs-web/lib/wexts-client.ts +4 -4
  64. package/templates/nextjs-web/next-env.d.ts +6 -6
  65. package/templates/nextjs-web/next.config.ts +20 -20
  66. package/templates/nextjs-web/package.json +37 -37
  67. package/templates/nextjs-web/postcss.config.js +6 -6
  68. package/templates/nextjs-web/tailwind.config.ts +69 -69
  69. package/templates/nextjs-web/tsconfig.json +41 -41
  70. package/templates/nixpacks.toml +11 -11
  71. package/templates/root-package.json +31 -31
  72. package/templates/server.ts +66 -66
  73. package/templates/tsconfig.json +30 -30
  74. package/dist/chunk-2KAQYLVN.js +0 -1
  75. package/dist/chunk-2KAQYLVN.js.map +0 -1
  76. package/dist/chunk-2LJVUMXW.js +0 -228
  77. package/dist/chunk-2LJVUMXW.js.map +0 -1
  78. package/dist/chunk-342VRT25.mjs +0 -504
  79. package/dist/chunk-342VRT25.mjs.map +0 -1
  80. package/dist/chunk-7HNQWJWV.js +0 -504
  81. package/dist/chunk-7HNQWJWV.js.map +0 -1
  82. package/dist/chunk-7QKLIVRF.js +0 -94
  83. package/dist/chunk-7QKLIVRF.js.map +0 -1
  84. package/dist/chunk-7SSCNCTW.mjs +0 -137
  85. package/dist/chunk-7SSCNCTW.mjs.map +0 -1
  86. package/dist/chunk-7TLSPR65.mjs +0 -95
  87. package/dist/chunk-7TLSPR65.mjs.map +0 -1
  88. package/dist/chunk-7WULUGLH.mjs +0 -22
  89. package/dist/chunk-7WULUGLH.mjs.map +0 -1
  90. package/dist/chunk-AVMQJWYD.js +0 -95
  91. package/dist/chunk-AVMQJWYD.js.map +0 -1
  92. package/dist/chunk-BG56B4DE.js +0 -106
  93. package/dist/chunk-BG56B4DE.js.map +0 -1
  94. package/dist/chunk-CLM5PNSG.mjs +0 -496
  95. package/dist/chunk-CLM5PNSG.mjs.map +0 -1
  96. package/dist/chunk-DNLGCKTT.js +0 -31
  97. package/dist/chunk-DNLGCKTT.js.map +0 -1
  98. package/dist/chunk-JHOVXH3X.mjs +0 -65
  99. package/dist/chunk-JHOVXH3X.mjs.map +0 -1
  100. package/dist/chunk-MXINIFPC.js +0 -105
  101. package/dist/chunk-MXINIFPC.js.map +0 -1
  102. package/dist/chunk-O4II6N34.js +0 -137
  103. package/dist/chunk-O4II6N34.js.map +0 -1
  104. package/dist/chunk-SE32ZPOZ.js +0 -496
  105. package/dist/chunk-SE32ZPOZ.js.map +0 -1
  106. package/dist/chunk-UAL54DVV.mjs +0 -106
  107. package/dist/chunk-UAL54DVV.mjs.map +0 -1
  108. package/dist/chunk-WCKSKU3C.js +0 -65
  109. package/dist/chunk-WCKSKU3C.js.map +0 -1
  110. package/dist/chunk-WU6FW77M.mjs +0 -105
  111. package/dist/chunk-WU6FW77M.mjs.map +0 -1
  112. package/dist/chunk-XE4OXN2W.js +0 -12
  113. package/dist/chunk-XE4OXN2W.js.map +0 -1
  114. package/dist/chunk-YBM3IJEA.mjs +0 -94
  115. package/dist/chunk-YBM3IJEA.mjs.map +0 -1
  116. package/dist/chunk-YN6WIWNQ.mjs +0 -228
  117. package/dist/chunk-YN6WIWNQ.mjs.map +0 -1
  118. package/dist/chunk-YSLEF5C5.mjs +0 -1
  119. package/dist/chunk-YSLEF5C5.mjs.map +0 -1
  120. package/dist/chunk-ZX7QIN24.mjs +0 -31
  121. package/dist/chunk-ZX7QIN24.mjs.map +0 -1
  122. package/dist/cli/index.d.mts +0 -23
  123. package/dist/cli/index.d.ts +0 -23
  124. package/dist/cli/index.js +0 -716
  125. package/dist/cli/index.js.map +0 -1
  126. package/dist/cli/index.mjs +0 -718
  127. package/dist/cli/index.mjs.map +0 -1
  128. package/dist/client/index.d.mts +0 -21
  129. package/dist/client/index.d.ts +0 -21
  130. package/dist/client/index.js +0 -13
  131. package/dist/client/index.js.map +0 -1
  132. package/dist/client/index.mjs +0 -13
  133. package/dist/client/index.mjs.map +0 -1
  134. package/dist/codegen/index.d.mts +0 -2
  135. package/dist/codegen/index.d.ts +0 -2
  136. package/dist/codegen/index.js +0 -16
  137. package/dist/codegen/index.js.map +0 -1
  138. package/dist/codegen/index.mjs +0 -16
  139. package/dist/codegen/index.mjs.map +0 -1
  140. package/dist/decorators-BT1FFqN0.d.mts +0 -29
  141. package/dist/decorators-DvS58PqC.d.ts +0 -29
  142. package/dist/dev-server/index.d.mts +0 -1
  143. package/dist/dev-server/index.d.ts +0 -1
  144. package/dist/dev-server/index.js +0 -13
  145. package/dist/dev-server/index.js.map +0 -1
  146. package/dist/dev-server/index.mjs +0 -13
  147. package/dist/dev-server/index.mjs.map +0 -1
  148. package/dist/index-7QeQEf37.d.ts +0 -92
  149. package/dist/index-7RvU-jGE.d.mts +0 -66
  150. package/dist/index-7RvU-jGE.d.ts +0 -66
  151. package/dist/index-8nzxy0NN.d.mts +0 -92
  152. package/dist/index-Co5ZsLqq.d.ts +0 -58
  153. package/dist/index-D94W1__r.d.mts +0 -58
  154. package/dist/index-DQmyVp6F.d.mts +0 -27
  155. package/dist/index-KL_1BrQb.d.ts +0 -27
  156. package/dist/index.d.mts +0 -294
  157. package/dist/index.d.ts +0 -294
  158. package/dist/index.js +0 -424
  159. package/dist/index.js.map +0 -1
  160. package/dist/index.mjs +0 -424
  161. package/dist/index.mjs.map +0 -1
  162. package/dist/nest/index.d.mts +0 -3
  163. package/dist/nest/index.d.ts +0 -3
  164. package/dist/nest/index.js +0 -38
  165. package/dist/nest/index.js.map +0 -1
  166. package/dist/nest/index.mjs +0 -38
  167. package/dist/nest/index.mjs.map +0 -1
  168. package/dist/next/index.d.mts +0 -66
  169. package/dist/next/index.d.ts +0 -66
  170. package/dist/next/index.js +0 -289
  171. package/dist/next/index.js.map +0 -1
  172. package/dist/next/index.mjs +0 -251
  173. package/dist/next/index.mjs.map +0 -1
  174. package/dist/rpc/index.d.mts +0 -2
  175. package/dist/rpc/index.d.ts +0 -2
  176. package/dist/rpc/index.js +0 -23
  177. package/dist/rpc/index.js.map +0 -1
  178. package/dist/rpc/index.mjs +0 -23
  179. package/dist/rpc/index.mjs.map +0 -1
  180. package/dist/runtime/index.d.mts +0 -55
  181. package/dist/runtime/index.d.ts +0 -55
  182. package/dist/runtime/index.js +0 -221
  183. package/dist/runtime/index.js.map +0 -1
  184. package/dist/runtime/index.mjs +0 -221
  185. package/dist/runtime/index.mjs.map +0 -1
  186. package/dist/types/index.d.mts +0 -12
  187. package/dist/types/index.d.ts +0 -12
  188. package/dist/types/index.js +0 -2
  189. package/dist/types/index.js.map +0 -1
  190. package/dist/types/index.mjs +0 -3
  191. package/dist/types/index.mjs.map +0 -1
  192. package/dist/types-7d_fC-C3.d.mts +0 -32
  193. package/dist/types-7d_fC-C3.d.ts +0 -32
  194. package/dist/vercel-builder/index.d.mts +0 -58
  195. package/dist/vercel-builder/index.d.ts +0 -58
  196. package/dist/vercel-builder/index.js +0 -330
  197. package/dist/vercel-builder/index.js.map +0 -1
  198. package/dist/vercel-builder/index.mjs +0 -330
  199. package/dist/vercel-builder/index.mjs.map +0 -1
@@ -1,29 +1,29 @@
1
- import type { Metadata } from 'next';
2
- import { Inter } from 'next/font/google';
3
- import { WextsProvider } from '@/lib/wexts-client';
4
- import { Toaster } from 'react-hot-toast';
5
- import './globals.css';
6
-
7
- const inter = Inter({ subsets: ['latin'] });
8
-
9
- export const metadata: Metadata = {
10
- title: 'wexts Web App',
11
- description: 'Modern web application built with wexts',
12
- };
13
-
14
- export default function RootLayout({
15
- children,
16
- }: {
17
- children: React.ReactNode;
18
- }) {
19
- return (
20
- <html lang="en">
21
- <body className={inter.className}>
22
- <WextsProvider baseUrl={process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5050'}>
23
- {children}
24
- <Toaster position="top-center" />
25
- </WextsProvider>
26
- </body>
27
- </html>
28
- );
29
- }
1
+ import type { Metadata } from 'next';
2
+ import { Inter } from 'next/font/google';
3
+ import { WextsProvider } from '@/lib/wexts-client';
4
+ import { Toaster } from 'react-hot-toast';
5
+ import './globals.css';
6
+
7
+ const inter = Inter({ subsets: ['latin'] });
8
+
9
+ export const metadata: Metadata = {
10
+ title: 'wexts Web App',
11
+ description: 'Modern web application built with wexts',
12
+ };
13
+
14
+ export default function RootLayout({
15
+ children,
16
+ }: {
17
+ children: React.ReactNode;
18
+ }) {
19
+ return (
20
+ <html lang="en">
21
+ <body className={inter.className}>
22
+ <WextsProvider baseUrl={process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5050'}>
23
+ {children}
24
+ <Toaster position="top-center" />
25
+ </WextsProvider>
26
+ </body>
27
+ </html>
28
+ );
29
+ }
@@ -1,5 +1,5 @@
1
- import { LoginForm } from '@/features/auth';
2
-
3
- export default function LoginPage() {
4
- return <LoginForm />;
5
- }
1
+ import { LoginForm } from '@/features/auth';
2
+
3
+ export default function LoginPage() {
4
+ return <LoginForm />;
5
+ }
@@ -1,28 +1,28 @@
1
- 'use client';
2
-
3
- import { useAuth } from '@/lib/wexts-client';
4
- import { useRouter } from 'next/navigation';
5
- import { useEffect } from 'react';
6
-
7
- export default function Home() {
8
- const { isAuthenticated, user, loading } = useAuth();
9
- const router = useRouter();
10
-
11
- useEffect(() => {
12
- if (!loading && !isAuthenticated) {
13
- router.push('/login');
14
- } else if (!loading && isAuthenticated) {
15
- router.push('/dashboard');
16
- }
17
- }, [isAuthenticated, loading, router]);
18
-
19
- if (loading) {
20
- return (
21
- <div className="min-h-screen flex items-center justify-center">
22
- <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-violet-600"></div>
23
- </div>
24
- );
25
- }
26
-
27
- return null;
28
- }
1
+ 'use client';
2
+
3
+ import { useAuth } from '@/lib/wexts-client';
4
+ import { useRouter } from 'next/navigation';
5
+ import { useEffect } from 'react';
6
+
7
+ export default function Home() {
8
+ const { isAuthenticated, user, loading } = useAuth();
9
+ const router = useRouter();
10
+
11
+ useEffect(() => {
12
+ if (!loading && !isAuthenticated) {
13
+ router.push('/login');
14
+ } else if (!loading && isAuthenticated) {
15
+ router.push('/dashboard');
16
+ }
17
+ }, [isAuthenticated, loading, router]);
18
+
19
+ if (loading) {
20
+ return (
21
+ <div className="min-h-screen flex items-center justify-center">
22
+ <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-violet-600"></div>
23
+ </div>
24
+ );
25
+ }
26
+
27
+ return null;
28
+ }
@@ -1,5 +1,5 @@
1
- import { RegisterForm } from '@/features/auth';
2
-
3
- export default function RegisterPage() {
4
- return <RegisterForm />;
5
- }
1
+ import { RegisterForm } from '@/features/auth';
2
+
3
+ export default function RegisterPage() {
4
+ return <RegisterForm />;
5
+ }
@@ -1,56 +1,56 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center whitespace-nowrap 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 }
1
+ import * as React from "react"
2
+ import { Slot } from "@radix-ui/react-slot"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center whitespace-nowrap 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 }
@@ -1,79 +1,79 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
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, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
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, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
@@ -1,25 +1,25 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- export interface InputProps
6
- extends React.InputHTMLAttributes<HTMLInputElement> { }
7
-
8
- const Input = React.forwardRef<HTMLInputElement, InputProps>(
9
- ({ className, type, ...props }, ref) => {
10
- return (
11
- <input
12
- type={type}
13
- className={cn(
14
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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",
15
- className
16
- )}
17
- ref={ref}
18
- {...props}
19
- />
20
- )
21
- }
22
- )
23
- Input.displayName = "Input"
24
-
25
- export { Input }
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ export interface InputProps
6
+ extends React.InputHTMLAttributes<HTMLInputElement> { }
7
+
8
+ const Input = React.forwardRef<HTMLInputElement, InputProps>(
9
+ ({ className, type, ...props }, ref) => {
10
+ return (
11
+ <input
12
+ type={type}
13
+ className={cn(
14
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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",
15
+ className
16
+ )}
17
+ ref={ref}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+ )
23
+ Input.displayName = "Input"
24
+
25
+ export { Input }
@@ -1,24 +1,24 @@
1
- import * as React from "react"
2
- import * as LabelPrimitive from "@radix-ui/react-label"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const labelVariants = cva(
8
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
- )
10
-
11
- const Label = React.forwardRef<
12
- React.ElementRef<typeof LabelPrimitive.Root>,
13
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
- VariantProps<typeof labelVariants>
15
- >(({ className, ...props }, ref) => (
16
- <LabelPrimitive.Root
17
- ref={ref}
18
- className={cn(labelVariants(), className)}
19
- {...props}
20
- />
21
- ))
22
- Label.displayName = LabelPrimitive.Root.displayName
23
-
24
- export { Label }
1
+ import * as React from "react"
2
+ import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const labelVariants = cva(
8
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
+ )
10
+
11
+ const Label = React.forwardRef<
12
+ React.ElementRef<typeof LabelPrimitive.Root>,
13
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
+ VariantProps<typeof labelVariants>
15
+ >(({ className, ...props }, ref) => (
16
+ <LabelPrimitive.Root
17
+ ref={ref}
18
+ className={cn(labelVariants(), className)}
19
+ {...props}
20
+ />
21
+ ))
22
+ Label.displayName = LabelPrimitive.Root.displayName
23
+
24
+ export { Label }