better-ts-stack 1.1.3 → 2.0.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 (162) hide show
  1. package/README.md +113 -82
  2. package/dist/args.d.ts +12 -0
  3. package/dist/args.d.ts.map +1 -0
  4. package/dist/args.js +90 -0
  5. package/dist/args.js.map +1 -0
  6. package/dist/builder/configGenerator.d.ts +1 -0
  7. package/dist/builder/configGenerator.d.ts.map +1 -1
  8. package/dist/builder/configGenerator.js +46 -6
  9. package/dist/builder/configGenerator.js.map +1 -1
  10. package/dist/builder/dependencyInstaller.d.ts.map +1 -1
  11. package/dist/builder/dependencyInstaller.js +8 -14
  12. package/dist/builder/dependencyInstaller.js.map +1 -1
  13. package/dist/builder/gitInitializer.d.ts.map +1 -1
  14. package/dist/builder/gitInitializer.js +8 -41
  15. package/dist/builder/gitInitializer.js.map +1 -1
  16. package/dist/builder/index.d.ts.map +1 -1
  17. package/dist/builder/index.js +27 -63
  18. package/dist/builder/index.js.map +1 -1
  19. package/dist/builder/moduleSelector.d.ts +1 -4
  20. package/dist/builder/moduleSelector.d.ts.map +1 -1
  21. package/dist/builder/moduleSelector.js +11 -15
  22. package/dist/builder/moduleSelector.js.map +1 -1
  23. package/dist/builder/templateContext.d.ts +2 -17
  24. package/dist/builder/templateContext.d.ts.map +1 -1
  25. package/dist/builder/templateContext.js +6 -5
  26. package/dist/builder/templateContext.js.map +1 -1
  27. package/dist/index.js +45 -20
  28. package/dist/index.js.map +1 -1
  29. package/dist/output/nextSteps.d.ts +1 -2
  30. package/dist/output/nextSteps.d.ts.map +1 -1
  31. package/dist/output/nextSteps.js +10 -19
  32. package/dist/output/nextSteps.js.map +1 -1
  33. package/dist/prompts/index.d.ts +3 -3
  34. package/dist/prompts/index.d.ts.map +1 -1
  35. package/dist/prompts/index.js +22 -58
  36. package/dist/prompts/index.js.map +1 -1
  37. package/dist/prompts/stack.d.ts +3 -2
  38. package/dist/prompts/stack.d.ts.map +1 -1
  39. package/dist/prompts/stack.js +81 -70
  40. package/dist/prompts/stack.js.map +1 -1
  41. package/dist/types/index.d.ts +20 -42
  42. package/dist/types/index.d.ts.map +1 -1
  43. package/dist/types/index.js +40 -38
  44. package/dist/types/index.js.map +1 -1
  45. package/dist/ui/index.d.ts +3 -0
  46. package/dist/ui/index.d.ts.map +1 -0
  47. package/dist/ui/index.js +19 -0
  48. package/dist/ui/index.js.map +1 -0
  49. package/dist/ui/messages.d.ts +9 -0
  50. package/dist/ui/messages.d.ts.map +1 -0
  51. package/dist/ui/messages.js +100 -0
  52. package/dist/ui/messages.js.map +1 -0
  53. package/dist/ui/prompts.d.ts +20 -0
  54. package/dist/ui/prompts.d.ts.map +1 -0
  55. package/dist/ui/prompts.js +71 -0
  56. package/dist/ui/prompts.js.map +1 -0
  57. package/dist/ui/theme.d.ts +9 -0
  58. package/dist/ui/theme.d.ts.map +1 -0
  59. package/dist/ui/theme.js +24 -0
  60. package/dist/ui/theme.js.map +1 -0
  61. package/dist/validators/index.d.ts +1 -0
  62. package/dist/validators/index.d.ts.map +1 -1
  63. package/dist/validators/index.js +6 -0
  64. package/dist/validators/index.js.map +1 -1
  65. package/package.json +70 -66
  66. package/templates/backend/express/config.json +44 -44
  67. package/templates/backend/express/eslint.config.mjs +40 -40
  68. package/templates/backend/express/gitignore +36 -36
  69. package/templates/backend/express/src/index.ts +76 -76
  70. package/templates/backend/express/src/routes/health.ts +12 -12
  71. package/templates/backend/express/tsconfig.json +25 -25
  72. package/templates/backend/nestjs/.prettierignore +52 -0
  73. package/templates/backend/nestjs/.prettierrc +16 -0
  74. package/templates/backend/nestjs/config.json +44 -0
  75. package/templates/backend/nestjs/eslint.config.mjs +40 -0
  76. package/templates/backend/nestjs/gitignore +36 -0
  77. package/templates/backend/nestjs/nest-cli.json +9 -0
  78. package/templates/backend/nestjs/src/app.module.ts.hbs +34 -0
  79. package/templates/backend/nestjs/src/health/health.controller.ts +12 -0
  80. package/templates/backend/nestjs/src/main.ts +23 -0
  81. package/templates/backend/nestjs/tsconfig.eslint.json +9 -0
  82. package/templates/backend/nestjs/tsconfig.json +25 -0
  83. package/templates/frontend/nextjs/app/layout.tsx +13 -13
  84. package/templates/frontend/nextjs/app/page.tsx.hbs +97 -97
  85. package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
  86. package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
  87. package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
  88. package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
  89. package/templates/frontend/nextjs/components.json +19 -19
  90. package/templates/frontend/nextjs/config.json +38 -38
  91. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  92. package/templates/frontend/nextjs/gitignore +42 -42
  93. package/templates/frontend/nextjs/lib/utils.ts +6 -6
  94. package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
  95. package/templates/frontend/nextjs/proxy.ts.hbs +24 -24
  96. package/templates/frontend/nextjs/tsconfig.json +34 -34
  97. package/templates/frontend/tanstack/config.json +48 -48
  98. package/templates/frontend/tanstack/src/routeTree.gen.ts +68 -68
  99. package/templates/frontend/tanstack/src/styles/app.css +85 -85
  100. package/templates/modules/auth/express/config.json +27 -26
  101. package/templates/modules/auth/express/src/controllers/authController.ts.hbs +116 -130
  102. package/templates/modules/auth/express/src/middleware/requireAuth.ts.hbs +26 -26
  103. package/templates/modules/auth/express/src/services/userStore.ts.hbs +117 -117
  104. package/templates/modules/auth/nestjs/config.json +24 -0
  105. package/templates/modules/auth/nestjs/src/auth/auth.controller.ts +46 -0
  106. package/templates/modules/auth/nestjs/src/auth/auth.guard.ts +36 -0
  107. package/templates/modules/auth/nestjs/src/auth/auth.module.ts.hbs +22 -0
  108. package/templates/modules/auth/nestjs/src/auth/auth.schemas.ts +35 -0
  109. package/templates/modules/auth/nestjs/src/auth/auth.service.ts +70 -0
  110. package/templates/modules/auth/nestjs/src/auth/jwt.ts +27 -0
  111. package/templates/modules/auth/nestjs/src/auth/users.service.ts.hbs +144 -0
  112. package/templates/modules/auth/nestjs/src/auth/zod-validation.pipe.ts +16 -0
  113. package/templates/modules/auth/nextjs/app/dashboard/page.tsx +96 -96
  114. package/templates/modules/auth/nextjs/app/sign-in/page.tsx +35 -35
  115. package/templates/modules/auth/nextjs/app/sign-up/page.tsx +35 -35
  116. package/templates/modules/auth/nextjs/components/auth/sign-in-form.tsx +132 -132
  117. package/templates/modules/auth/nextjs/components/auth/sign-out-button.tsx +50 -50
  118. package/templates/modules/auth/nextjs/components/auth/sign-up-form.tsx +152 -152
  119. package/templates/modules/auth/nextjs/config.json +31 -31
  120. package/templates/modules/auth/nextjs/lib/auth-schema.ts +39 -39
  121. package/templates/modules/auth/nextjs/lib/auth.ts.hbs +37 -37
  122. package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +4 -4
  123. package/templates/modules/auth/tanstack/src/routeTree.gen.ts +140 -140
  124. package/templates/modules/docker/.dockerignore +14 -14
  125. package/templates/modules/docker/Dockerfile.hbs +137 -130
  126. package/templates/modules/docker/config.json +19 -19
  127. package/templates/modules/docker/docker-compose.yml.hbs +9 -9
  128. package/templates/modules/drizzle/express/config.json +27 -27
  129. package/templates/modules/drizzle/express/drizzle.config.ts +13 -13
  130. package/templates/modules/drizzle/express/src/lib/db.ts +13 -13
  131. package/templates/modules/drizzle/express/src/lib/schema.ts +10 -10
  132. package/templates/modules/drizzle/nestjs/config.json +27 -0
  133. package/templates/modules/drizzle/nestjs/drizzle.config.ts +13 -0
  134. package/templates/modules/drizzle/nestjs/src/database/database.module.ts +30 -0
  135. package/templates/modules/drizzle/nestjs/src/database/schema.ts +10 -0
  136. package/templates/modules/drizzle/nextjs/config.json +29 -29
  137. package/templates/modules/drizzle/nextjs/lib/db.ts +13 -13
  138. package/templates/modules/drizzle/nextjs/lib/schema.ts.hbs +84 -84
  139. package/templates/modules/mongoose/express/config.json +16 -16
  140. package/templates/modules/mongoose/nestjs/config.json +16 -0
  141. package/templates/modules/mongoose/nestjs/src/users/user.schema.ts +21 -0
  142. package/templates/modules/mongoose/nextjs/config.json +16 -16
  143. package/templates/modules/mongoose/nextjs/lib/db.ts +36 -36
  144. package/templates/modules/mongoose/tanstack/config.json +17 -17
  145. package/templates/modules/mongoose/tanstack/src/lib/db.ts +37 -37
  146. package/templates/modules/prisma/express/config.json +28 -28
  147. package/templates/modules/prisma/express/prisma/schema.prisma +1 -1
  148. package/templates/modules/prisma/express/prisma.config.ts +12 -12
  149. package/templates/modules/prisma/express/src/lib/prisma.ts +24 -24
  150. package/templates/modules/prisma/nestjs/config.json +28 -0
  151. package/templates/modules/prisma/nestjs/prisma/schema.prisma +23 -0
  152. package/templates/modules/prisma/nestjs/prisma.config.ts +12 -0
  153. package/templates/modules/prisma/nestjs/src/prisma/prisma.module.ts +11 -0
  154. package/templates/modules/prisma/nestjs/src/prisma/prisma.service.ts +17 -0
  155. package/templates/modules/prisma/nextjs/config.json +29 -29
  156. package/templates/modules/prisma/nextjs/prisma/schema.prisma.hbs +91 -91
  157. package/templates/modules/prisma/tanstack/config.json +5 -5
  158. package/dist/intro.d.ts +0 -2
  159. package/dist/intro.d.ts.map +0 -1
  160. package/dist/intro.js +0 -27
  161. package/dist/intro.js.map +0 -1
  162. package/templates/backend/express/.eslintrc.js +0 -24
@@ -1,97 +1,97 @@
1
- import Link from "next/link";
2
-
3
- import { ArrowRight } from "lucide-react";
4
-
5
- import { buttonVariants } from "@/components/ui/button";
6
- import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
7
- import { cn } from "@/lib/utils";
8
-
9
- const featureList = [
10
- "Next.js 16 App Router",
11
- "React 19 and TypeScript",
12
- "Tailwind CSS v4",
13
- {{#if useAuth}}"Better Auth-ready session flow",{{/if}}
14
- {{#if (eq database "prisma")}}"Prisma database tooling",{{/if}}
15
- {{#if (eq database "drizzle")}}"Drizzle database tooling",{{/if}}
16
- ];
17
-
18
- export default function Home() {
19
- return (
20
- <main className="min-h-screen bg-background text-foreground">
21
- <div className="mx-auto flex min-h-screen max-w-6xl flex-col justify-center gap-12 px-6 py-16 sm:px-10 lg:px-12">
22
- <section className="grid gap-10 lg:grid-cols-[1.2fr_0.8fr] lg:items-center">
23
- <div className="space-y-6">
24
- <span className="inline-flex w-fit items-center rounded-full border border-border bg-card px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground shadow-sm">
25
- Created with better-ts-stack
26
- </span>
27
- <div className="space-y-4">
28
- <h1 className="max-w-3xl text-4xl font-semibold tracking-tight sm:text-5xl">
29
- Ship your stack faster with a polished TypeScript foundation.
30
- </h1>
31
- <p className="max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg">
32
- Your project already includes the core app shell, database wiring,
33
- and a shadcn-compatible UI foundation so you can keep building
34
- instead of setting up boilerplate.
35
- </p>
36
- </div>
37
- <div className="flex flex-col gap-3 sm:flex-row">
38
- {{#if useAuth}}
39
- <Link
40
- href="/sign-up"
41
- className={cn(buttonVariants({ size: "lg" }), "gap-2")}
42
- >
43
- Create an account
44
- <ArrowRight className="size-4" />
45
- </Link>
46
- <Link
47
- href="/sign-in"
48
- className={buttonVariants({ variant: "outline", size: "lg" })}
49
- >
50
- Login
51
- </Link>
52
- {{else}}
53
- <Link
54
- href="https://github.com/Abdullah-dev0/better-ts-stack"
55
- target="_blank"
56
- rel="noreferrer"
57
- className={cn(buttonVariants({ size: "lg" }), "gap-2")}
58
- >
59
- Explore the docs
60
- <ArrowRight className="size-4" />
61
- </Link>
62
- <Link
63
- href="https://nextjs.org/docs"
64
- target="_blank"
65
- rel="noreferrer"
66
- className={buttonVariants({ variant: "outline", size: "lg" })}
67
- >
68
- Next.js guide
69
- </Link>
70
- {{/if}}
71
- </div>
72
- </div>
73
-
74
- <Card className="border-border bg-card shadow-sm">
75
- <CardHeader>
76
- <CardTitle>Included in this starter</CardTitle>
77
- </CardHeader>
78
- <CardContent className="space-y-4">
79
- <ul className="space-y-3 text-sm text-muted-foreground">
80
- {featureList.map((feature) => (
81
- <li key={feature} className="flex items-center gap-3">
82
- <span className="size-2 rounded-full bg-primary" />
83
- <span>{feature}</span>
84
- </li>
85
- ))}
86
- </ul>
87
- <div className="rounded-2xl border border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
88
- Start editing <code className="font-mono">app/page.tsx</code> and
89
- shape the project around your product instead of setup chores.
90
- </div>
91
- </CardContent>
92
- </Card>
93
- </section>
94
- </div>
95
- </main>
96
- );
97
- }
1
+ import Link from "next/link";
2
+
3
+ import { ArrowRight } from "lucide-react";
4
+
5
+ import { buttonVariants } from "@/components/ui/button";
6
+ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const featureList = [
10
+ "Next.js 16 App Router",
11
+ "React 19 and TypeScript",
12
+ "Tailwind CSS v4",
13
+ {{#if useAuth}}"Better Auth-ready session flow",{{/if}}
14
+ {{#if (eq database "prisma")}}"Prisma database tooling",{{/if}}
15
+ {{#if (eq database "drizzle")}}"Drizzle database tooling",{{/if}}
16
+ ];
17
+
18
+ export default function Home() {
19
+ return (
20
+ <main className="min-h-screen bg-background text-foreground">
21
+ <div className="mx-auto flex min-h-screen max-w-6xl flex-col justify-center gap-12 px-6 py-16 sm:px-10 lg:px-12">
22
+ <section className="grid gap-10 lg:grid-cols-[1.2fr_0.8fr] lg:items-center">
23
+ <div className="space-y-6">
24
+ <span className="inline-flex w-fit items-center rounded-full border border-border bg-card px-3 py-1 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground shadow-sm">
25
+ Created with better-ts-stack
26
+ </span>
27
+ <div className="space-y-4">
28
+ <h1 className="max-w-3xl text-4xl font-semibold tracking-tight sm:text-5xl">
29
+ Ship your stack faster with a polished TypeScript foundation.
30
+ </h1>
31
+ <p className="max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg">
32
+ Your project already includes the core app shell, database wiring,
33
+ and a shadcn-compatible UI foundation so you can keep building
34
+ instead of setting up boilerplate.
35
+ </p>
36
+ </div>
37
+ <div className="flex flex-col gap-3 sm:flex-row">
38
+ {{#if useAuth}}
39
+ <Link
40
+ href="/sign-up"
41
+ className={cn(buttonVariants({ size: "lg" }), "gap-2")}
42
+ >
43
+ Create an account
44
+ <ArrowRight className="size-4" />
45
+ </Link>
46
+ <Link
47
+ href="/sign-in"
48
+ className={buttonVariants({ variant: "outline", size: "lg" })}
49
+ >
50
+ Login
51
+ </Link>
52
+ {{else}}
53
+ <Link
54
+ href="https://github.com/Abdullah-dev0/better-ts-stack"
55
+ target="_blank"
56
+ rel="noreferrer"
57
+ className={cn(buttonVariants({ size: "lg" }), "gap-2")}
58
+ >
59
+ Explore the docs
60
+ <ArrowRight className="size-4" />
61
+ </Link>
62
+ <Link
63
+ href="https://nextjs.org/docs"
64
+ target="_blank"
65
+ rel="noreferrer"
66
+ className={buttonVariants({ variant: "outline", size: "lg" })}
67
+ >
68
+ Next.js guide
69
+ </Link>
70
+ {{/if}}
71
+ </div>
72
+ </div>
73
+
74
+ <Card className="border-border bg-card shadow-sm">
75
+ <CardHeader>
76
+ <CardTitle>Included in this starter</CardTitle>
77
+ </CardHeader>
78
+ <CardContent className="space-y-4">
79
+ <ul className="space-y-3 text-sm text-muted-foreground">
80
+ {featureList.map((feature) => (
81
+ <li key={feature} className="flex items-center gap-3">
82
+ <span className="size-2 rounded-full bg-primary" />
83
+ <span>{feature}</span>
84
+ </li>
85
+ ))}
86
+ </ul>
87
+ <div className="rounded-2xl border border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
88
+ Start editing <code className="font-mono">app/page.tsx</code> and
89
+ shape the project around your product instead of setup chores.
90
+ </div>
91
+ </CardContent>
92
+ </Card>
93
+ </section>
94
+ </div>
95
+ </main>
96
+ );
97
+ }
@@ -1,51 +1,51 @@
1
- import * as React from "react";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- const buttonVariants = cva(
7
- "inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:pointer-events-none disabled:opacity-50",
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- "bg-slate-950 text-white shadow-sm hover:bg-slate-800",
13
- outline:
14
- "border border-slate-200 bg-white text-slate-900 hover:bg-slate-100",
15
- ghost: "text-slate-700 hover:bg-slate-100 hover:text-slate-950",
16
- },
17
- size: {
18
- default: "h-10 px-4 py-2",
19
- sm: "h-9 px-3",
20
- lg: "h-11 px-6 text-sm",
21
- icon: "size-10",
22
- },
23
- },
24
- defaultVariants: {
25
- variant: "default",
26
- size: "default",
27
- },
28
- }
29
- );
30
-
31
- export interface ButtonProps
32
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
33
- VariantProps<typeof buttonVariants> {}
34
-
35
- function Button({
36
- className,
37
- variant,
38
- size,
39
- type = "button",
40
- ...props
41
- }: ButtonProps) {
42
- return (
43
- <button
44
- type={type}
45
- className={cn(buttonVariants({ variant, size }), className)}
46
- {...props}
47
- />
48
- );
49
- }
50
-
51
- export { Button, buttonVariants };
1
+ import * as React from "react";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const buttonVariants = cva(
7
+ "inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:pointer-events-none disabled:opacity-50",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default:
12
+ "bg-slate-950 text-white shadow-sm hover:bg-slate-800",
13
+ outline:
14
+ "border border-slate-200 bg-white text-slate-900 hover:bg-slate-100",
15
+ ghost: "text-slate-700 hover:bg-slate-100 hover:text-slate-950",
16
+ },
17
+ size: {
18
+ default: "h-10 px-4 py-2",
19
+ sm: "h-9 px-3",
20
+ lg: "h-11 px-6 text-sm",
21
+ icon: "size-10",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ }
29
+ );
30
+
31
+ export interface ButtonProps
32
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
33
+ VariantProps<typeof buttonVariants> {}
34
+
35
+ function Button({
36
+ className,
37
+ variant,
38
+ size,
39
+ type = "button",
40
+ ...props
41
+ }: ButtonProps) {
42
+ return (
43
+ <button
44
+ type={type}
45
+ className={cn(buttonVariants({ variant, size }), className)}
46
+ {...props}
47
+ />
48
+ );
49
+ }
50
+
51
+ export { Button, buttonVariants };
@@ -1,60 +1,60 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- function Card({
6
- className,
7
- ...props
8
- }: React.HTMLAttributes<HTMLDivElement>) {
9
- return (
10
- <div
11
- className={cn(
12
- "rounded-3xl border border-slate-200/80 bg-white text-slate-950 shadow-sm",
13
- className
14
- )}
15
- {...props}
16
- />
17
- );
18
- }
19
-
20
- function CardHeader({
21
- className,
22
- ...props
23
- }: React.HTMLAttributes<HTMLDivElement>) {
24
- return <div className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />;
25
- }
26
-
27
- function CardTitle({
28
- className,
29
- ...props
30
- }: React.HTMLAttributes<HTMLHeadingElement>) {
31
- return (
32
- <h3
33
- className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
34
- {...props}
35
- />
36
- );
37
- }
38
-
39
- function CardDescription({
40
- className,
41
- ...props
42
- }: React.HTMLAttributes<HTMLParagraphElement>) {
43
- return <p className={cn("text-sm text-slate-600", className)} {...props} />;
44
- }
45
-
46
- function CardContent({
47
- className,
48
- ...props
49
- }: React.HTMLAttributes<HTMLDivElement>) {
50
- return <div className={cn("p-6 pt-0", className)} {...props} />;
51
- }
52
-
53
- function CardFooter({
54
- className,
55
- ...props
56
- }: React.HTMLAttributes<HTMLDivElement>) {
57
- return <div className={cn("flex items-center p-6 pt-0", className)} {...props} />;
58
- }
59
-
60
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function Card({
6
+ className,
7
+ ...props
8
+ }: React.HTMLAttributes<HTMLDivElement>) {
9
+ return (
10
+ <div
11
+ className={cn(
12
+ "rounded-3xl border border-slate-200/80 bg-white text-slate-950 shadow-sm",
13
+ className
14
+ )}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ function CardHeader({
21
+ className,
22
+ ...props
23
+ }: React.HTMLAttributes<HTMLDivElement>) {
24
+ return <div className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />;
25
+ }
26
+
27
+ function CardTitle({
28
+ className,
29
+ ...props
30
+ }: React.HTMLAttributes<HTMLHeadingElement>) {
31
+ return (
32
+ <h3
33
+ className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
34
+ {...props}
35
+ />
36
+ );
37
+ }
38
+
39
+ function CardDescription({
40
+ className,
41
+ ...props
42
+ }: React.HTMLAttributes<HTMLParagraphElement>) {
43
+ return <p className={cn("text-sm text-slate-600", className)} {...props} />;
44
+ }
45
+
46
+ function CardContent({
47
+ className,
48
+ ...props
49
+ }: React.HTMLAttributes<HTMLDivElement>) {
50
+ return <div className={cn("p-6 pt-0", className)} {...props} />;
51
+ }
52
+
53
+ function CardFooter({
54
+ className,
55
+ ...props
56
+ }: React.HTMLAttributes<HTMLDivElement>) {
57
+ return <div className={cn("flex items-center p-6 pt-0", className)} {...props} />;
58
+ }
59
+
60
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,67 +1,67 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- function FieldGroup({
6
- className,
7
- ...props
8
- }: React.HTMLAttributes<HTMLDivElement>) {
9
- return <div className={cn("space-y-5", className)} {...props} />;
10
- }
11
-
12
- type FieldProps = React.HTMLAttributes<HTMLDivElement> & {
13
- "data-invalid"?: boolean;
14
- };
15
-
16
- function Field({
17
- className,
18
- "data-invalid": dataInvalid,
19
- ...props
20
- }: FieldProps) {
21
- return (
22
- <div
23
- data-invalid={dataInvalid}
24
- className={cn("space-y-2", className)}
25
- {...props}
26
- />
27
- );
28
- }
29
-
30
- function FieldLabel({
31
- className,
32
- ...props
33
- }: React.LabelHTMLAttributes<HTMLLabelElement>) {
34
- return (
35
- <label
36
- className={cn("text-sm font-medium text-slate-900", className)}
37
- {...props}
38
- />
39
- );
40
- }
41
-
42
- function FieldDescription({
43
- className,
44
- ...props
45
- }: React.HTMLAttributes<HTMLParagraphElement>) {
46
- return <p className={cn("text-sm text-slate-500", className)} {...props} />;
47
- }
48
-
49
- type FieldErrorProps = React.HTMLAttributes<HTMLParagraphElement> & {
50
- errors?: Array<{ message?: string } | undefined>;
51
- };
52
-
53
- function FieldError({ className, errors, ...props }: FieldErrorProps) {
54
- const message = errors?.find((error) => error?.message)?.message;
55
-
56
- if (!message) {
57
- return null;
58
- }
59
-
60
- return (
61
- <p className={cn("text-sm font-medium text-rose-600", className)} {...props}>
62
- {message}
63
- </p>
64
- );
65
- }
66
-
67
- export { Field, FieldDescription, FieldError, FieldGroup, FieldLabel };
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function FieldGroup({
6
+ className,
7
+ ...props
8
+ }: React.HTMLAttributes<HTMLDivElement>) {
9
+ return <div className={cn("space-y-5", className)} {...props} />;
10
+ }
11
+
12
+ type FieldProps = React.HTMLAttributes<HTMLDivElement> & {
13
+ "data-invalid"?: boolean;
14
+ };
15
+
16
+ function Field({
17
+ className,
18
+ "data-invalid": dataInvalid,
19
+ ...props
20
+ }: FieldProps) {
21
+ return (
22
+ <div
23
+ data-invalid={dataInvalid}
24
+ className={cn("space-y-2", className)}
25
+ {...props}
26
+ />
27
+ );
28
+ }
29
+
30
+ function FieldLabel({
31
+ className,
32
+ ...props
33
+ }: React.LabelHTMLAttributes<HTMLLabelElement>) {
34
+ return (
35
+ <label
36
+ className={cn("text-sm font-medium text-slate-900", className)}
37
+ {...props}
38
+ />
39
+ );
40
+ }
41
+
42
+ function FieldDescription({
43
+ className,
44
+ ...props
45
+ }: React.HTMLAttributes<HTMLParagraphElement>) {
46
+ return <p className={cn("text-sm text-slate-500", className)} {...props} />;
47
+ }
48
+
49
+ type FieldErrorProps = React.HTMLAttributes<HTMLParagraphElement> & {
50
+ errors?: Array<{ message?: string } | undefined>;
51
+ };
52
+
53
+ function FieldError({ className, errors, ...props }: FieldErrorProps) {
54
+ const message = errors?.find((error) => error?.message)?.message;
55
+
56
+ if (!message) {
57
+ return null;
58
+ }
59
+
60
+ return (
61
+ <p className={cn("text-sm font-medium text-rose-600", className)} {...props}>
62
+ {message}
63
+ </p>
64
+ );
65
+ }
66
+
67
+ export { Field, FieldDescription, FieldError, FieldGroup, FieldLabel };
@@ -1,18 +1,18 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
- return (
7
- <input
8
- type={type}
9
- className={cn(
10
- "flex h-11 w-full rounded-2xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-950 shadow-sm transition-[color,box-shadow] outline-none placeholder:text-slate-400 focus-visible:border-sky-500 focus-visible:ring-[3px] focus-visible:ring-sky-500/20 disabled:cursor-not-allowed disabled:opacity-50",
11
- className
12
- )}
13
- {...props}
14
- />
15
- );
16
- }
17
-
18
- export { Input };
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <input
8
+ type={type}
9
+ className={cn(
10
+ "flex h-11 w-full rounded-2xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-950 shadow-sm transition-[color,box-shadow] outline-none placeholder:text-slate-400 focus-visible:border-sky-500 focus-visible:ring-[3px] focus-visible:ring-sky-500/20 disabled:cursor-not-allowed disabled:opacity-50",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ );
16
+ }
17
+
18
+ export { Input };
@@ -1,19 +1,19 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "new-york",
4
- "rsc": true,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "app/globals.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true
11
- },
12
- "iconLibrary": "lucide",
13
- "aliases": {
14
- "components": "@/components",
15
- "lib": "@/lib",
16
- "ui": "@/components/ui",
17
- "utils": "@/lib/utils"
18
- }
19
- }
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "app/globals.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true
11
+ },
12
+ "iconLibrary": "lucide",
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "lib": "@/lib",
16
+ "ui": "@/components/ui",
17
+ "utils": "@/lib/utils"
18
+ }
19
+ }