create-thexjs-app 1.0.0 → 1.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 (138) hide show
  1. package/README.md +56 -915
  2. package/dist/index.js +265 -196
  3. package/package.json +5 -1
  4. package/templates/{basic → addons/auth}/src/api/auth/login.ts +1 -3
  5. package/templates/{basic → addons/auth}/src/lib/auth.ts +13 -9
  6. package/templates/{basic → addons/auth}/src/lib/migrations/001_create_sessions.sql +1 -3
  7. package/templates/addons/auth/src/pages/dashboard/index.tsx +39 -0
  8. package/templates/addons/auth/src/pages/login.tsx +72 -0
  9. package/templates/addons/content/content/hello-world.md +13 -0
  10. package/templates/addons/content/src/pages/blog.tsx +29 -0
  11. package/templates/{basic → addons/shadcn}/components.json +1 -1
  12. package/templates/addons/shadcn/src/components/ui/badge.tsx +17 -0
  13. package/templates/addons/shadcn/src/components/ui/button.tsx +36 -0
  14. package/templates/addons/shadcn/src/components/ui/card.tsx +33 -0
  15. package/templates/addons/shadcn/src/components/ui/input.tsx +18 -0
  16. package/templates/addons/tailwind/src/styles/globals.css +32 -0
  17. package/templates/base/src/pages/index.tsx +29 -0
  18. package/templates/base/src/styles/globals.css +22 -0
  19. package/templates/base/tsconfig.json +24 -0
  20. package/templates/basic/content/blog/hello.md +0 -8
  21. package/templates/basic/public/favicon.ico +0 -0
  22. package/templates/basic/src/actions/dashboard/greet.ts +0 -3
  23. package/templates/basic/src/api/placeholder/comments.ts +0 -17
  24. package/templates/basic/src/api/placeholder/posts.ts +0 -20
  25. package/templates/basic/src/api/placeholder/todos.ts +0 -21
  26. package/templates/basic/src/api/placeholder/users.ts +0 -12
  27. package/templates/basic/src/components/Head.tsx +0 -21
  28. package/templates/basic/src/components/Image.tsx +0 -27
  29. package/templates/basic/src/components/Link.tsx +0 -10
  30. package/templates/basic/src/components/ui/badge.tsx +0 -49
  31. package/templates/basic/src/components/ui/button.tsx +0 -58
  32. package/templates/basic/src/components/ui/card.tsx +0 -88
  33. package/templates/basic/src/components/ui/input.tsx +0 -20
  34. package/templates/basic/src/layouts/main.tsx +0 -38
  35. package/templates/basic/src/lib/placeholder-data.ts +0 -176
  36. package/templates/basic/src/pages/_404.tsx +0 -17
  37. package/templates/basic/src/pages/about.tsx +0 -22
  38. package/templates/basic/src/pages/blog.tsx +0 -41
  39. package/templates/basic/src/pages/dashboard/index.tsx +0 -84
  40. package/templates/basic/src/pages/index.tsx +0 -54
  41. package/templates/basic/src/pages/login.tsx +0 -92
  42. package/templates/basic/src/pages/placeholder.tsx +0 -203
  43. package/templates/basic/src/pages/posts/[id].tsx +0 -17
  44. package/templates/basic/src/styles/globals.css +0 -90
  45. package/templates/basic/src/x-routes.ts +0 -29
  46. package/templates/basic/tsconfig.json +0 -11
  47. package/templates/basic/x.config.ts +0 -10
  48. package/templates/blog/components.json +0 -20
  49. package/templates/blog/content/posts/getting-started.md +0 -38
  50. package/templates/blog/content/posts/hello-world.md +0 -21
  51. package/templates/blog/content/posts/tailwind-v4.md +0 -31
  52. package/templates/blog/public/favicon.ico +0 -0
  53. package/templates/blog/src/components/ui/avatar.tsx +0 -91
  54. package/templates/blog/src/components/ui/badge.tsx +0 -49
  55. package/templates/blog/src/components/ui/button.tsx +0 -58
  56. package/templates/blog/src/components/ui/card.tsx +0 -88
  57. package/templates/blog/src/components/ui/input.tsx +0 -20
  58. package/templates/blog/src/layouts/blog.tsx +0 -46
  59. package/templates/blog/src/layouts/main.tsx +0 -32
  60. package/templates/blog/src/lib/utils.ts +0 -5
  61. package/templates/blog/src/pages/about.tsx +0 -36
  62. package/templates/blog/src/pages/blog/[slug].tsx +0 -56
  63. package/templates/blog/src/pages/blog/index.tsx +0 -70
  64. package/templates/blog/src/pages/index.tsx +0 -73
  65. package/templates/blog/src/styles/globals.css +0 -90
  66. package/templates/blog/src/x-routes.ts +0 -20
  67. package/templates/blog/tsconfig.json +0 -5
  68. package/templates/blog/x.config.ts +0 -6
  69. package/templates/default/components.json +0 -19
  70. package/templates/default/src/layouts/main.tsx +0 -28
  71. package/templates/default/src/pages/index.tsx +0 -66
  72. package/templates/default/src/styles/globals.css +0 -55
  73. package/templates/default/src/x-routes.ts +0 -17
  74. package/templates/default/tsconfig.json +0 -5
  75. package/templates/default/x.config.ts +0 -6
  76. package/templates/landing/components.json +0 -20
  77. package/templates/landing/public/favicon.ico +0 -0
  78. package/templates/landing/src/components/code-block.tsx +0 -118
  79. package/templates/landing/src/components/ui/avatar.tsx +0 -91
  80. package/templates/landing/src/components/ui/badge.tsx +0 -49
  81. package/templates/landing/src/components/ui/button.tsx +0 -58
  82. package/templates/landing/src/components/ui/card.tsx +0 -88
  83. package/templates/landing/src/components/ui/input.tsx +0 -20
  84. package/templates/landing/src/layouts/main.tsx +0 -78
  85. package/templates/landing/src/lib/syntax.tsx +0 -366
  86. package/templates/landing/src/lib/utils.ts +0 -5
  87. package/templates/landing/src/pages/docs/_layout.tsx +0 -139
  88. package/templates/landing/src/pages/docs/api-routes.tsx +0 -113
  89. package/templates/landing/src/pages/docs/build-deploy.tsx +0 -124
  90. package/templates/landing/src/pages/docs/configuration.tsx +0 -121
  91. package/templates/landing/src/pages/docs/content-collections.tsx +0 -130
  92. package/templates/landing/src/pages/docs/data-layer.tsx +0 -142
  93. package/templates/landing/src/pages/docs/getting-started.tsx +0 -129
  94. package/templates/landing/src/pages/docs/index.tsx +0 -187
  95. package/templates/landing/src/pages/docs/installation.tsx +0 -143
  96. package/templates/landing/src/pages/docs/introduction.tsx +0 -114
  97. package/templates/landing/src/pages/docs/layouts.tsx +0 -114
  98. package/templates/landing/src/pages/docs/middleware.tsx +0 -124
  99. package/templates/landing/src/pages/docs/packages/cli.tsx +0 -133
  100. package/templates/landing/src/pages/docs/packages/core.tsx +0 -176
  101. package/templates/landing/src/pages/docs/packages/env.tsx +0 -128
  102. package/templates/landing/src/pages/docs/pages.tsx +0 -135
  103. package/templates/landing/src/pages/docs/routing.tsx +0 -123
  104. package/templates/landing/src/pages/docs/server-functions.tsx +0 -177
  105. package/templates/landing/src/pages/features.tsx +0 -129
  106. package/templates/landing/src/pages/index.tsx +0 -159
  107. package/templates/landing/src/styles/globals.css +0 -136
  108. package/templates/landing/src/x-routes.ts +0 -31
  109. package/templates/landing/tsconfig.json +0 -10
  110. package/templates/landing/x.config.ts +0 -2
  111. package/templates/saas/components.json +0 -20
  112. package/templates/saas/public/favicon.ico +0 -0
  113. package/templates/saas/src/actions/dashboard.ts +0 -3
  114. package/templates/saas/src/api/auth/login.ts +0 -31
  115. package/templates/saas/src/components/ui/avatar.tsx +0 -91
  116. package/templates/saas/src/components/ui/badge.tsx +0 -49
  117. package/templates/saas/src/components/ui/button.tsx +0 -58
  118. package/templates/saas/src/components/ui/card.tsx +0 -88
  119. package/templates/saas/src/components/ui/input.tsx +0 -20
  120. package/templates/saas/src/layouts/dashboard.tsx +0 -67
  121. package/templates/saas/src/layouts/main.tsx +0 -38
  122. package/templates/saas/src/lib/auth.ts +0 -91
  123. package/templates/saas/src/lib/migrations/001_create_sessions.sql +0 -9
  124. package/templates/saas/src/lib/utils.ts +0 -5
  125. package/templates/saas/src/pages/dashboard/_middleware.ts +0 -9
  126. package/templates/saas/src/pages/dashboard/analytics.tsx +0 -68
  127. package/templates/saas/src/pages/dashboard/index.tsx +0 -86
  128. package/templates/saas/src/pages/dashboard/settings.tsx +0 -111
  129. package/templates/saas/src/pages/index.tsx +0 -110
  130. package/templates/saas/src/pages/login.tsx +0 -140
  131. package/templates/saas/src/pages/pricing.tsx +0 -121
  132. package/templates/saas/src/styles/globals.css +0 -90
  133. package/templates/saas/src/x-routes.ts +0 -22
  134. package/templates/saas/tsconfig.json +0 -5
  135. package/templates/saas/x.config.ts +0 -7
  136. /package/templates/{basic → addons/auth}/src/api/auth/logout.ts +0 -0
  137. /package/templates/{basic → addons/auth}/src/pages/dashboard/_middleware.ts +0 -0
  138. /package/templates/{basic → addons/shadcn}/src/lib/utils.ts +0 -0
@@ -1,66 +0,0 @@
1
- import type { RouteProps } from "@thexjs/core";
2
-
3
- export const mode = "static";
4
-
5
- export default function HomePage(_props: RouteProps) {
6
- return (
7
- <div className="flex flex-1 flex-col items-center justify-center px-6 pb-20 pt-8 sm:px-10">
8
- <div className="mb-10 flex w-full max-w-md items-center gap-3 rounded-xl border border-border bg-surface/80 px-4 py-3 font-mono text-xs backdrop-blur-sm sm:text-sm">
9
- <span className="shrink-0 text-muted-foreground">src/pages/</span>
10
- <span className="text-primary">index.tsx</span>
11
- <span className="route-line mx-1 h-px flex-1 animate-route-pulse bg-gradient-to-r from-transparent via-primary to-transparent" />
12
- <span className="shrink-0 rounded-md bg-primary/10 px-2 py-0.5 font-semibold text-primary">
13
- /
14
- </span>
15
- </div>
16
-
17
- <div className="max-w-2xl text-center">
18
- <p className="font-mono text-[11px] uppercase tracking-[0.28em] text-primary/90">
19
- Your app is running
20
- </p>
21
- <h1 className="font-display mt-5 text-[clamp(2.5rem,8vw,4.5rem)] font-extrabold leading-[0.95] tracking-tight">
22
- Start
23
- <span className="text-primary"> here.</span>
24
- </h1>
25
- <p className="mx-auto mt-6 max-w-lg text-base leading-relaxed text-muted-foreground sm:text-lg">
26
- This is your home page — the only route in the default template. Edit{" "}
27
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-sm text-foreground">
28
- src/pages/index.tsx
29
- </code>{" "}
30
- and save. The dev server reloads instantly.
31
- </p>
32
- </div>
33
-
34
- <div className="mt-14 w-full max-w-lg overflow-hidden rounded-2xl border border-border bg-surface shadow-[0_24px_80px_-24px_rgba(240,160,48,0.15)]">
35
- <div className="flex items-center gap-2 border-b border-border px-4 py-3">
36
- <span className="h-2.5 w-2.5 rounded-full bg-[#ff5f57]" />
37
- <span className="h-2.5 w-2.5 rounded-full bg-[#febc2e]" />
38
- <span className="h-2.5 w-2.5 rounded-full bg-[#28c840]" />
39
- <span className="ml-2 font-mono text-[10px] text-muted-foreground">terminal</span>
40
- </div>
41
- <pre className="overflow-x-auto p-5 font-mono text-[13px] leading-relaxed text-muted-foreground">
42
- <span className="text-foreground">$</span> bun run dev{"\n"}
43
- <span className="text-primary/80">→</span> dev server at{" "}
44
- <span className="text-foreground">http://localhost:3000</span>
45
- </pre>
46
- </div>
47
-
48
- <div className="mt-10 flex flex-wrap items-center justify-center gap-4">
49
- <a
50
- href="https://thexjs.vercel.app/docs"
51
- className="inline-flex h-11 items-center rounded-xl bg-primary px-5 text-sm font-semibold text-primary-foreground transition-transform hover:scale-[1.02] active:scale-[0.98]"
52
- >
53
- Read the docs
54
- </a>
55
- <a
56
- href="https://github.com/abdelkabirouadoukou/x"
57
- target="_blank"
58
- rel="noopener noreferrer"
59
- className="inline-flex h-11 items-center rounded-xl border border-border px-5 text-sm font-medium text-foreground transition-colors hover:bg-muted"
60
- >
61
- View on GitHub
62
- </a>
63
- </div>
64
- </div>
65
- );
66
- }
@@ -1,55 +0,0 @@
1
- @import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600&family=JetBrains+Mono:wght@400;500&family=Syne:wght@600;700;800&display=swap");
2
-
3
- @import "tailwindcss";
4
-
5
- @theme inline {
6
- --font-display: "Syne", ui-sans-serif, system-ui, sans-serif;
7
- --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
8
- --font-mono: "JetBrains Mono", ui-monospace, monospace;
9
- --color-background: var(--background);
10
- --color-foreground: var(--foreground);
11
- --color-muted: var(--muted);
12
- --color-muted-foreground: var(--muted-foreground);
13
- --color-primary: var(--primary);
14
- --color-primary-foreground: var(--primary-foreground);
15
- --color-border: var(--border);
16
- --color-surface: var(--surface);
17
- --animate-route-pulse: route-pulse 2.4s ease-in-out infinite;
18
- }
19
-
20
- :root {
21
- --background: #070a10;
22
- --foreground: #e6eaf2;
23
- --muted: #121824;
24
- --muted-foreground: #7b879c;
25
- --primary: oklch(0.72 0.18 35);
26
- --primary-foreground: #0a0d14;
27
- --border: #1c2433;
28
- --surface: #0d111a;
29
- }
30
-
31
- @layer base {
32
- * {
33
- @apply border-border;
34
- }
35
- body {
36
- @apply bg-background text-foreground font-sans antialiased;
37
- }
38
- }
39
-
40
- @keyframes route-pulse {
41
- 0%,
42
- 100% {
43
- opacity: 0.35;
44
- }
45
- 50% {
46
- opacity: 1;
47
- }
48
- }
49
-
50
- @media (prefers-reduced-motion: reduce) {
51
- .route-line {
52
- animation: none !important;
53
- opacity: 0.7;
54
- }
55
- }
@@ -1,17 +0,0 @@
1
- // Auto-generated by @thexjs/core -- do not edit
2
- export type RouteMap = {
3
- "/": Record<string, never>;
4
- };
5
-
6
- export function href<T extends keyof RouteMap & string>(
7
- path: T,
8
- ...[params]: RouteMap[T] extends Record<string, never> ? [] : [RouteMap[T]]
9
- ): string {
10
- if (!params) return path;
11
- let result: string = path;
12
- for (const [key, value] of Object.entries(params)) {
13
- result = result.replace(new RegExp(`:${key}(?=/|$)`), encodeURIComponent(String(value)));
14
- }
15
- result = result.replace(/\*+$/, "");
16
- return result;
17
- }
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": { "noEmit": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] } },
4
- "include": ["src"]
5
- }
@@ -1,6 +0,0 @@
1
- import { defineConfig } from "@thexjs/core";
2
-
3
- export default defineConfig({
4
- pagesDir: "src/pages",
5
- layoutsDir: "src/layouts",
6
- });
@@ -1,20 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "base-nova",
4
- "rsc": false,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "src/styles/globals.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true,
11
- "prefix": ""
12
- },
13
- "aliases": {
14
- "components": "@/components",
15
- "utils": "@/lib/utils",
16
- "ui": "@/components/ui",
17
- "lib": "@/lib"
18
- },
19
- "iconLibrary": "lucide"
20
- }
@@ -1,118 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import { highlight } from "../lib/syntax";
3
-
4
- interface CodeBlockProps {
5
- label: string;
6
- code: string;
7
- lang?: string;
8
- /** Terminal-style output with prompt prefixes and scanline texture. */
9
- variant?: "code" | "terminal";
10
- }
11
-
12
- function TerminalBody({ code, lang }: { code: string; lang: string }) {
13
- const lines = code.split("\n");
14
-
15
- return (
16
- <div className="relative font-mono text-[13px] leading-[1.65]">
17
- <div
18
- className="pointer-events-none absolute inset-0 opacity-[0.04]"
19
- style={{
20
- backgroundImage:
21
- "repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.15) 2px, rgba(255,255,255,0.15) 4px)",
22
- }}
23
- />
24
- <pre className="relative overflow-x-auto p-5">
25
- {lines.map((line, i) => {
26
- const isPrompt = line.startsWith("$") || line.startsWith(">");
27
- const isOutput = line.startsWith(" ") && !line.startsWith(" ");
28
- const isDim = line.trim() === "" || line.includes("(recommended)");
29
-
30
- if (lang === "bash" && isPrompt) {
31
- const [, ...rest] = line.split(/(?<=\$|\>)\s?/);
32
- const cmd = rest.join("") || line.slice(1).trim();
33
- return (
34
- <div key={`${i}-${line.slice(0, 8)}`} className="flex gap-3">
35
- <span className="shrink-0 select-none text-[var(--terminal-prompt)]">
36
- {line.startsWith("$") ? "$" : ">"}
37
- </span>
38
- <code className="text-[var(--terminal-text)]">{cmd}</code>
39
- </div>
40
- );
41
- }
42
-
43
- if (isOutput) {
44
- return (
45
- <div key={`${i}-${line.slice(0, 8)}`} className="pl-5 text-[var(--terminal-muted)]">
46
- {line.trimStart()}
47
- </div>
48
- );
49
- }
50
-
51
- return (
52
- <div
53
- key={`${i}-${line.slice(0, 8)}`}
54
- className={isDim ? "text-[var(--terminal-muted)]/80" : "text-[var(--terminal-text)]"}
55
- >
56
- {lang === "bash" ? line : highlight(line, lang)}
57
- </div>
58
- );
59
- })}
60
- </pre>
61
- </div>
62
- );
63
- }
64
-
65
- export function CodeBlock({ label, code, lang = "tsx", variant = "code" }: CodeBlockProps) {
66
- const isTerminal = variant === "terminal" || lang === "bash" || lang === "tree";
67
-
68
- return (
69
- <div
70
- className={`code-block mt-6 overflow-hidden rounded-2xl border shadow-2xl ${
71
- isTerminal
72
- ? "border-[var(--terminal-border)] bg-[var(--terminal-bg)] shadow-[var(--terminal-glow)]"
73
- : "border-border/50 bg-[#0a0e14] shadow-black/40"
74
- }`}
75
- >
76
- <div
77
- className={`flex items-center justify-between gap-3 border-b px-4 py-2.5 ${
78
- isTerminal
79
- ? "border-[var(--terminal-border)] bg-[var(--terminal-bar)]"
80
- : "border-white/[0.06] bg-[#121820]"
81
- }`}
82
- >
83
- <div className="flex items-center gap-1.5">
84
- <span className="h-2.5 w-2.5 rounded-full bg-[#ff5f56]" />
85
- <span className="h-2.5 w-2.5 rounded-full bg-[#ffbd2e]" />
86
- <span className="h-2.5 w-2.5 rounded-full bg-[#27c93f]" />
87
- </div>
88
- <span
89
- className={`truncate font-mono text-[11px] tracking-wide ${
90
- isTerminal ? "text-[var(--terminal-label)]" : "text-[#7d8da6]"
91
- }`}
92
- >
93
- {label}
94
- </span>
95
- <span className="hidden w-12 sm:block" />
96
- </div>
97
-
98
- {isTerminal ? (
99
- <TerminalBody code={code} lang={lang} />
100
- ) : (
101
- <pre className="overflow-x-auto p-5 text-sm leading-relaxed">
102
- <code className="font-mono text-[#e8edf5]">{highlight(code, lang)}</code>
103
- </pre>
104
- )}
105
- </div>
106
- );
107
- }
108
-
109
- /** Shorthand for bash/CLI snippets. */
110
- export function TerminalBlock({
111
- label,
112
- code,
113
- }: {
114
- label: string;
115
- code: string;
116
- }): ReactNode {
117
- return <CodeBlock label={label} code={code} lang="bash" variant="terminal" />;
118
- }
@@ -1,91 +0,0 @@
1
- import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
2
- import type * as React from "react";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- function Avatar({
7
- className,
8
- size = "default",
9
- ...props
10
- }: AvatarPrimitive.Root.Props & {
11
- size?: "default" | "sm" | "lg";
12
- }) {
13
- return (
14
- <AvatarPrimitive.Root
15
- data-slot="avatar"
16
- data-size={size}
17
- className={cn(
18
- "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
19
- className,
20
- )}
21
- {...props}
22
- />
23
- );
24
- }
25
-
26
- function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
27
- return (
28
- <AvatarPrimitive.Image
29
- data-slot="avatar-image"
30
- className={cn("aspect-square size-full rounded-full object-cover", className)}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props) {
37
- return (
38
- <AvatarPrimitive.Fallback
39
- data-slot="avatar-fallback"
40
- className={cn(
41
- "flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
42
- className,
43
- )}
44
- {...props}
45
- />
46
- );
47
- }
48
-
49
- function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
50
- return (
51
- <span
52
- data-slot="avatar-badge"
53
- className={cn(
54
- "absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
55
- "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
56
- "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
57
- "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
58
- className,
59
- )}
60
- {...props}
61
- />
62
- );
63
- }
64
-
65
- function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
66
- return (
67
- <div
68
- data-slot="avatar-group"
69
- className={cn(
70
- "group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
71
- className,
72
- )}
73
- {...props}
74
- />
75
- );
76
- }
77
-
78
- function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">) {
79
- return (
80
- <div
81
- data-slot="avatar-group-count"
82
- className={cn(
83
- "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
84
- className,
85
- )}
86
- {...props}
87
- />
88
- );
89
- }
90
-
91
- export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge };
@@ -1,49 +0,0 @@
1
- import { mergeProps } from "@base-ui/react/merge-props";
2
- import { useRender } from "@base-ui/react/use-render";
3
- import { type VariantProps, cva } from "class-variance-authority";
4
-
5
- import { cn } from "@/lib/utils";
6
-
7
- const badgeVariants = cva(
8
- "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
13
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
14
- destructive:
15
- "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
16
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
17
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
18
- link: "text-primary underline-offset-4 hover:underline",
19
- },
20
- },
21
- defaultVariants: {
22
- variant: "default",
23
- },
24
- },
25
- );
26
-
27
- function Badge({
28
- className,
29
- variant = "default",
30
- render,
31
- ...props
32
- }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
33
- return useRender({
34
- defaultTagName: "span",
35
- props: mergeProps<"span">(
36
- {
37
- className: cn(badgeVariants({ variant }), className),
38
- },
39
- props,
40
- ),
41
- render,
42
- state: {
43
- slot: "badge",
44
- variant,
45
- },
46
- });
47
- }
48
-
49
- export { Badge, badgeVariants };
@@ -1,58 +0,0 @@
1
- import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
- import { type VariantProps, cva } from "class-variance-authority";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- const buttonVariants = cva(
7
- "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-primary text-primary-foreground hover:bg-primary/80",
12
- outline:
13
- "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
14
- secondary:
15
- "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
- ghost:
17
- "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
18
- destructive:
19
- "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
20
- link: "text-primary underline-offset-4 hover:underline",
21
- },
22
- size: {
23
- default:
24
- "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
25
- xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
26
- sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
27
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
28
- icon: "size-8",
29
- "icon-xs":
30
- "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
31
- "icon-sm":
32
- "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
33
- "icon-lg": "size-9",
34
- },
35
- },
36
- defaultVariants: {
37
- variant: "default",
38
- size: "default",
39
- },
40
- },
41
- );
42
-
43
- function Button({
44
- className,
45
- variant = "default",
46
- size = "default",
47
- ...props
48
- }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
49
- return (
50
- <ButtonPrimitive
51
- data-slot="button"
52
- className={cn(buttonVariants({ variant, size, className }))}
53
- {...props}
54
- />
55
- );
56
- }
57
-
58
- export { Button, buttonVariants };
@@ -1,88 +0,0 @@
1
- import type * as React from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- function Card({
6
- className,
7
- size = "default",
8
- ...props
9
- }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
10
- return (
11
- <div
12
- data-slot="card"
13
- data-size={size}
14
- className={cn(
15
- "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
16
- className,
17
- )}
18
- {...props}
19
- />
20
- );
21
- }
22
-
23
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
24
- return (
25
- <div
26
- data-slot="card-header"
27
- className={cn(
28
- "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
29
- className,
30
- )}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
37
- return (
38
- <div
39
- data-slot="card-title"
40
- className={cn(
41
- "text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
42
- className,
43
- )}
44
- {...props}
45
- />
46
- );
47
- }
48
-
49
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
50
- return (
51
- <div
52
- data-slot="card-description"
53
- className={cn("text-sm text-muted-foreground", className)}
54
- {...props}
55
- />
56
- );
57
- }
58
-
59
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
60
- return (
61
- <div
62
- data-slot="card-action"
63
- className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
64
- {...props}
65
- />
66
- );
67
- }
68
-
69
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
70
- return (
71
- <div data-slot="card-content" className={cn("px-(--card-spacing)", className)} {...props} />
72
- );
73
- }
74
-
75
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
76
- return (
77
- <div
78
- data-slot="card-footer"
79
- className={cn(
80
- "flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
81
- className,
82
- )}
83
- {...props}
84
- />
85
- );
86
- }
87
-
88
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
@@ -1,20 +0,0 @@
1
- import { Input as InputPrimitive } from "@base-ui/react/input";
2
- import type * as React from "react";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
7
- return (
8
- <InputPrimitive
9
- type={type}
10
- data-slot="input"
11
- className={cn(
12
- "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
13
- className,
14
- )}
15
- {...props}
16
- />
17
- );
18
- }
19
-
20
- export { Input };