better-ts-stack 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +21 -21
  2. package/dist/args.js +6 -0
  3. package/dist/builder/moduleSelector.js +6 -1
  4. package/dist/builder/readmeGenerator.js +6 -0
  5. package/dist/builder/templateContext.js +1 -0
  6. package/dist/prompts/stack.js +7 -0
  7. package/dist/types/index.js +2 -0
  8. package/dist/ui/messages.js +2 -0
  9. package/package.json +71 -71
  10. package/templates/backend/express/.prettierignore +52 -52
  11. package/templates/backend/express/.prettierrc +16 -16
  12. package/templates/backend/express/gitignore +3 -1
  13. package/templates/backend/express/tsconfig.eslint.json +9 -9
  14. package/templates/backend/nestjs/.prettierignore +52 -52
  15. package/templates/backend/nestjs/gitignore +3 -1
  16. package/templates/backend/nestjs/tsconfig.eslint.json +9 -9
  17. package/templates/frontend/nextjs/app/globals.css +89 -89
  18. package/templates/frontend/nextjs/app/layout.tsx +34 -34
  19. package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
  20. package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
  21. package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
  22. package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
  23. package/templates/frontend/nextjs/config.json +35 -35
  24. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  25. package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
  26. package/templates/frontend/nextjs/postcss.config.mjs +7 -7
  27. package/templates/frontend/nextjs/public/file.svg +1 -1
  28. package/templates/frontend/nextjs/public/globe.svg +1 -1
  29. package/templates/frontend/nextjs/public/window.svg +1 -1
  30. package/templates/frontend/tanstack/components.json +18 -18
  31. package/templates/frontend/tanstack/eslint.config.mjs +23 -23
  32. package/templates/frontend/tanstack/gitignore +39 -39
  33. package/templates/frontend/tanstack/public/favicon.svg +7 -7
  34. package/templates/frontend/tanstack/src/components/ui/button.tsx +51 -51
  35. package/templates/frontend/tanstack/src/components/ui/card.tsx +60 -60
  36. package/templates/frontend/tanstack/src/components/ui/field.tsx +67 -67
  37. package/templates/frontend/tanstack/src/components/ui/input.tsx +18 -18
  38. package/templates/frontend/tanstack/src/lib/utils.ts +6 -6
  39. package/templates/frontend/tanstack/src/router.tsx +31 -31
  40. package/templates/frontend/tanstack/src/routes/__root.tsx +69 -69
  41. package/templates/frontend/tanstack/tsconfig.json +22 -22
  42. package/templates/modules/agents/AGENTS.md.hbs +237 -0
  43. package/templates/modules/agents/CLAUDE.md +1 -0
  44. package/templates/modules/agents/config.json +10 -0
  45. package/templates/modules/auth/express/src/lib/jwt.ts.hbs +27 -27
  46. package/templates/modules/auth/nextjs/app/api/auth/[...all]/route.ts +4 -4
  47. package/templates/modules/auth/nextjs/config.json +18 -18
  48. package/templates/modules/auth/nextjs/lib/auth-client.ts +3 -3
  49. package/templates/modules/auth/tanstack/config.json +18 -18
  50. package/templates/modules/auth/tanstack/src/lib/auth-client.ts +2 -2
  51. package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +8 -8
  52. package/templates/modules/auth/tanstack/src/lib/auth.ts.hbs +37 -37
  53. package/templates/modules/auth/tanstack/src/routes/api/auth/$.ts +15 -15
  54. package/templates/modules/auth/tanstack/src/routes/dashboard.tsx +110 -110
  55. package/templates/modules/auth/tanstack/src/routes/sign-in.tsx +36 -36
  56. package/templates/modules/auth/tanstack/src/routes/sign-up.tsx +36 -36
  57. package/templates/modules/docker/.dockerignore +2 -0
  58. package/templates/modules/docker/config.json +15 -15
  59. package/templates/modules/drizzle/express/config.json +26 -26
  60. package/templates/modules/drizzle/nestjs/config.json +26 -26
  61. package/templates/modules/drizzle/nextjs/config.json +26 -26
  62. package/templates/modules/drizzle/nextjs/drizzle.config.ts +13 -13
  63. package/templates/modules/drizzle/tanstack/config.json +26 -26
  64. package/templates/modules/drizzle/tanstack/drizzle.config.ts +12 -12
  65. package/templates/modules/drizzle/tanstack/src/lib/db.ts +13 -13
  66. package/templates/modules/mongoose/express/config.json +15 -15
  67. package/templates/modules/mongoose/express/src/lib/db.ts +43 -43
  68. package/templates/modules/mongoose/express/src/models/User.ts +48 -48
  69. package/templates/modules/mongoose/nestjs/config.json +15 -15
  70. package/templates/modules/mongoose/nextjs/config.json +15 -15
  71. package/templates/modules/mongoose/nextjs/models/User.ts +48 -48
  72. package/templates/modules/mongoose/tanstack/config.json +16 -16
  73. package/templates/modules/mongoose/tanstack/src/models/User.ts +48 -48
  74. package/templates/modules/prisma/express/config.json +27 -27
  75. package/templates/modules/prisma/express/prisma/schema.prisma +23 -23
  76. package/templates/modules/prisma/nestjs/config.json +27 -27
  77. package/templates/modules/prisma/nextjs/config.json +28 -28
  78. package/templates/modules/prisma/nextjs/lib/prisma.ts +18 -18
  79. package/templates/modules/prisma/nextjs/prisma.config.ts +14 -14
  80. package/templates/modules/prisma/tanstack/config.json +28 -28
  81. package/templates/modules/prisma/tanstack/prisma/schema.prisma.hbs +91 -91
  82. package/templates/modules/prisma/tanstack/prisma.config.ts +14 -14
  83. package/templates/modules/prisma/tanstack/src/lib/prisma.ts +17 -17
  84. package/templates/modules/vscode/.vscode/extensions.json.hbs +29 -0
  85. package/templates/modules/vscode/.vscode/settings.json.hbs +22 -0
  86. package/templates/modules/vscode/config.json +10 -0
@@ -1,35 +1,35 @@
1
- {
2
- "id": "nextjs",
3
- "name": "Next.js",
4
- "description": "Next.js 16 App Router with TypeScript and Tailwind CSS",
5
- "type": "base",
6
- "scripts": {
7
- "dev": "next dev",
8
- "build": "next build",
9
- "start": "next start",
10
- "lint": "eslint",
11
- "type:check": "tsc --noEmit"
12
- },
13
- "dependencies": {
14
- "class-variance-authority": "^0.7.1",
15
- "clsx": "^2.1.1",
16
- "lucide-react": "^1.66.0",
17
- "next": "^16.4.3",
18
- "react": "^19.3.1",
19
- "react-dom": "^19.3.1",
20
- "tailwind-merge": "^3.7.0",
21
- "@radix-ui/react-slot": "^1.5.0"
22
- },
23
- "devDependencies": {
24
- "@tailwindcss/postcss": "^4.3.3",
25
- "@types/node": "^24.19.2",
26
- "@types/react": "^19.3.0",
27
- "@types/react-dom": "^19.3.0",
28
- "eslint": "^10.14.0",
29
- "eslint-config-next": "^16.4.3",
30
- "tailwindcss": "^4.3.3",
31
- "typescript": "^6.0.3",
32
- "@eslint/compat": "^2.1.1"
33
- },
34
- "envVars": {}
35
- }
1
+ {
2
+ "id": "nextjs",
3
+ "name": "Next.js",
4
+ "description": "Next.js 16 App Router with TypeScript and Tailwind CSS",
5
+ "type": "base",
6
+ "scripts": {
7
+ "dev": "next dev",
8
+ "build": "next build",
9
+ "start": "next start",
10
+ "lint": "eslint",
11
+ "type:check": "tsc --noEmit"
12
+ },
13
+ "dependencies": {
14
+ "class-variance-authority": "^0.7.1",
15
+ "clsx": "^2.1.1",
16
+ "lucide-react": "^1.66.0",
17
+ "next": "^16.4.5",
18
+ "react": "^19.3.1",
19
+ "react-dom": "^19.3.1",
20
+ "tailwind-merge": "^3.7.0",
21
+ "@radix-ui/react-slot": "^1.5.0"
22
+ },
23
+ "devDependencies": {
24
+ "@tailwindcss/postcss": "^4.3.3",
25
+ "@types/node": "^24.19.2",
26
+ "@types/react": "^19.3.0",
27
+ "@types/react-dom": "^19.3.0",
28
+ "eslint": "^10.14.0",
29
+ "eslint-config-next": "^16.4.5",
30
+ "tailwindcss": "^4.3.3",
31
+ "typescript": "^6.0.3",
32
+ "@eslint/compat": "^2.1.1"
33
+ },
34
+ "envVars": {}
35
+ }
@@ -1,11 +1,11 @@
1
- import { fixupConfigRules } from "@eslint/compat";
2
- import nextVitals from "eslint-config-next/core-web-vitals";
3
- import nextTs from "eslint-config-next/typescript";
4
- import { defineConfig, globalIgnores } from "eslint/config";
5
-
6
- const eslintConfig = defineConfig([
7
- ...fixupConfigRules([...nextVitals, ...nextTs]),
8
- globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
9
- ]);
10
-
11
- export default eslintConfig;
1
+ import { fixupConfigRules } from "@eslint/compat";
2
+ import nextVitals from "eslint-config-next/core-web-vitals";
3
+ import nextTs from "eslint-config-next/typescript";
4
+ import { defineConfig, globalIgnores } from "eslint/config";
5
+
6
+ const eslintConfig = defineConfig([
7
+ ...fixupConfigRules([...nextVitals, ...nextTs]),
8
+ globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
9
+ ]);
10
+
11
+ export default eslintConfig;
@@ -1,12 +1,12 @@
1
- import type { NextConfig } from "next";
2
-
3
- {{#if useDocker}}
4
- const nextConfig: NextConfig = {
5
- // Standalone output is what the Docker image runs (node server.js)
6
- output: "standalone",
7
- };
8
- {{else}}
9
- const nextConfig: NextConfig = {};
10
- {{/if}}
11
-
12
- export default nextConfig;
1
+ import type { NextConfig } from "next";
2
+
3
+ {{#if useDocker}}
4
+ const nextConfig: NextConfig = {
5
+ // Standalone output is what the Docker image runs (node server.js)
6
+ output: "standalone",
7
+ };
8
+ {{else}}
9
+ const nextConfig: NextConfig = {};
10
+ {{/if}}
11
+
12
+ export default nextConfig;
@@ -1,7 +1,7 @@
1
- const config = {
2
- plugins: {
3
- "@tailwindcss/postcss": {},
4
- },
5
- };
6
-
7
- export default config;
1
+ const config = {
2
+ plugins: {
3
+ "@tailwindcss/postcss": {},
4
+ },
5
+ };
6
+
7
+ export default config;
@@ -1 +1 @@
1
- <svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
1
+ <svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
@@ -1 +1 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
1
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
@@ -1 +1 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
1
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
@@ -1,18 +1,18 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "new-york",
4
- "tsx": true,
5
- "tailwind": {
6
- "config": "",
7
- "css": "src/styles/app.css",
8
- "baseColor": "neutral",
9
- "cssVariables": true
10
- },
11
- "iconLibrary": "lucide",
12
- "aliases": {
13
- "components": "~/components",
14
- "lib": "~/lib",
15
- "ui": "~/components/ui",
16
- "utils": "~/lib/utils"
17
- }
18
- }
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "tsx": true,
5
+ "tailwind": {
6
+ "config": "",
7
+ "css": "src/styles/app.css",
8
+ "baseColor": "neutral",
9
+ "cssVariables": true
10
+ },
11
+ "iconLibrary": "lucide",
12
+ "aliases": {
13
+ "components": "~/components",
14
+ "lib": "~/lib",
15
+ "ui": "~/components/ui",
16
+ "utils": "~/lib/utils"
17
+ }
18
+ }
@@ -1,23 +1,23 @@
1
- import eslint from "@eslint/js";
2
- import { defineConfig, globalIgnores } from "eslint/config";
3
- import tseslint from "typescript-eslint";
4
-
5
- const eslintConfig = defineConfig([
6
- globalIgnores([
7
- "dist/**",
8
- ".output/**",
9
- "src/routeTree.gen.ts",
10
- ".tanstack/**",
11
- "public/**",
12
- ]),
13
- eslint.configs.recommended,
14
- ...tseslint.configs.recommended,
15
- {
16
- rules: {
17
- "@typescript-eslint/no-explicit-any": "warn",
18
- "no-console": "off",
19
- },
20
- },
21
- ]);
22
-
23
- export default eslintConfig;
1
+ import eslint from "@eslint/js";
2
+ import { defineConfig, globalIgnores } from "eslint/config";
3
+ import tseslint from "typescript-eslint";
4
+
5
+ const eslintConfig = defineConfig([
6
+ globalIgnores([
7
+ "dist/**",
8
+ ".output/**",
9
+ "src/routeTree.gen.ts",
10
+ ".tanstack/**",
11
+ "public/**",
12
+ ]),
13
+ eslint.configs.recommended,
14
+ ...tseslint.configs.recommended,
15
+ {
16
+ rules: {
17
+ "@typescript-eslint/no-explicit-any": "warn",
18
+ "no-console": "off",
19
+ },
20
+ },
21
+ ]);
22
+
23
+ export default eslintConfig;
@@ -1,42 +1,42 @@
1
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
- /.pnp
6
- .pnp.*
7
- .yarn/*
8
- !.yarn/patches
9
- !.yarn/plugins
10
- !.yarn/releases
11
- !.yarn/versions
12
-
13
- # testing
14
- /coverage
15
-
16
- # production
17
- /build
18
- /dist
19
- /.output
20
-
21
- # tanstack
22
- /.tanstack
23
-
24
- # misc
25
- .DS_Store
26
- *.pem
27
-
28
- # debug
29
- npm-debug.log*
30
- yarn-debug.log*
31
- yarn-error.log*
32
- .pnpm-debug.log*
33
-
34
- # env files (can opt-in for committing if needed)
35
- .env*
36
- !.env.example
37
-
38
- # typescript
39
- *.tsbuildinfo
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.*
7
+ .yarn/*
8
+ !.yarn/patches
9
+ !.yarn/plugins
10
+ !.yarn/releases
11
+ !.yarn/versions
12
+
13
+ # testing
14
+ /coverage
15
+
16
+ # production
17
+ /build
18
+ /dist
19
+ /.output
20
+
21
+ # tanstack
22
+ /.tanstack
23
+
24
+ # misc
25
+ .DS_Store
26
+ *.pem
27
+
28
+ # debug
29
+ npm-debug.log*
30
+ yarn-debug.log*
31
+ yarn-error.log*
32
+ .pnpm-debug.log*
33
+
34
+ # env files (can opt-in for committing if needed)
35
+ .env*
36
+ !.env.example
37
+
38
+ # typescript
39
+ *.tsbuildinfo
40
40
 
41
41
  # Prisma client, created by prisma generate
42
42
  /generated/
@@ -1,7 +1,7 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" fill="none">
2
- <rect width="128" height="128" rx="24" fill="#0a0a0a"/>
3
- <circle cx="64" cy="64" r="20" stroke="#38bdf8" stroke-width="3" fill="none"/>
4
- <circle cx="64" cy="64" r="8" fill="#38bdf8"/>
5
- <path d="M64 44V24M64 104V84M44 64H24M104 64H84" stroke="#38bdf8" stroke-width="3" stroke-linecap="round"/>
6
- <path d="M49.9 49.9L35.8 35.8M92.1 92.1L78 78M78.1 49.9L92.2 35.8M35.9 78.1L49.9 92.2" stroke="#38bdf8" stroke-width="2" stroke-linecap="round"/>
7
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" fill="none">
2
+ <rect width="128" height="128" rx="24" fill="#0a0a0a"/>
3
+ <circle cx="64" cy="64" r="20" stroke="#38bdf8" stroke-width="3" fill="none"/>
4
+ <circle cx="64" cy="64" r="8" fill="#38bdf8"/>
5
+ <path d="M64 44V24M64 104V84M44 64H24M104 64H84" stroke="#38bdf8" stroke-width="3" stroke-linecap="round"/>
6
+ <path d="M49.9 49.9L35.8 35.8M92.1 92.1L78 78M78.1 49.9L92.2 35.8M35.9 78.1L49.9 92.2" stroke="#38bdf8" stroke-width="2" stroke-linecap="round"/>
7
+ </svg>
@@ -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 };