create-thexjs-app 1.0.0 → 1.1.1
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.
- package/README.md +56 -915
- package/dist/index.js +283 -196
- package/package.json +5 -1
- package/templates/{basic → addons/auth}/src/api/auth/login.ts +1 -3
- package/templates/{basic → addons/auth}/src/lib/auth.ts +13 -9
- package/templates/{basic → addons/auth}/src/lib/migrations/001_create_sessions.sql +1 -3
- package/templates/addons/auth/src/pages/dashboard/index.tsx +39 -0
- package/templates/addons/auth/src/pages/login.tsx +72 -0
- package/templates/addons/content/content/hello-world.md +13 -0
- package/templates/addons/content/src/pages/blog.tsx +29 -0
- package/templates/{basic → addons/shadcn}/components.json +1 -1
- package/templates/addons/shadcn/src/components/ui/badge.tsx +17 -0
- package/templates/addons/shadcn/src/components/ui/button.tsx +36 -0
- package/templates/addons/shadcn/src/components/ui/card.tsx +33 -0
- package/templates/addons/shadcn/src/components/ui/input.tsx +18 -0
- package/templates/addons/tailwind/src/styles/globals.css +32 -0
- package/templates/base/_gitignore +26 -0
- package/templates/base/src/pages/index.tsx +29 -0
- package/templates/base/src/styles/globals.css +22 -0
- package/templates/base/tsconfig.json +24 -0
- package/templates/basic/content/blog/hello.md +0 -8
- package/templates/basic/public/favicon.ico +0 -0
- package/templates/basic/src/actions/dashboard/greet.ts +0 -3
- package/templates/basic/src/api/placeholder/comments.ts +0 -17
- package/templates/basic/src/api/placeholder/posts.ts +0 -20
- package/templates/basic/src/api/placeholder/todos.ts +0 -21
- package/templates/basic/src/api/placeholder/users.ts +0 -12
- package/templates/basic/src/components/Head.tsx +0 -21
- package/templates/basic/src/components/Image.tsx +0 -27
- package/templates/basic/src/components/Link.tsx +0 -10
- package/templates/basic/src/components/ui/badge.tsx +0 -49
- package/templates/basic/src/components/ui/button.tsx +0 -58
- package/templates/basic/src/components/ui/card.tsx +0 -88
- package/templates/basic/src/components/ui/input.tsx +0 -20
- package/templates/basic/src/layouts/main.tsx +0 -38
- package/templates/basic/src/lib/placeholder-data.ts +0 -176
- package/templates/basic/src/pages/_404.tsx +0 -17
- package/templates/basic/src/pages/about.tsx +0 -22
- package/templates/basic/src/pages/blog.tsx +0 -41
- package/templates/basic/src/pages/dashboard/index.tsx +0 -84
- package/templates/basic/src/pages/index.tsx +0 -54
- package/templates/basic/src/pages/login.tsx +0 -92
- package/templates/basic/src/pages/placeholder.tsx +0 -203
- package/templates/basic/src/pages/posts/[id].tsx +0 -17
- package/templates/basic/src/styles/globals.css +0 -90
- package/templates/basic/src/x-routes.ts +0 -29
- package/templates/basic/tsconfig.json +0 -11
- package/templates/basic/x.config.ts +0 -10
- package/templates/blog/components.json +0 -20
- package/templates/blog/content/posts/getting-started.md +0 -38
- package/templates/blog/content/posts/hello-world.md +0 -21
- package/templates/blog/content/posts/tailwind-v4.md +0 -31
- package/templates/blog/public/favicon.ico +0 -0
- package/templates/blog/src/components/ui/avatar.tsx +0 -91
- package/templates/blog/src/components/ui/badge.tsx +0 -49
- package/templates/blog/src/components/ui/button.tsx +0 -58
- package/templates/blog/src/components/ui/card.tsx +0 -88
- package/templates/blog/src/components/ui/input.tsx +0 -20
- package/templates/blog/src/layouts/blog.tsx +0 -46
- package/templates/blog/src/layouts/main.tsx +0 -32
- package/templates/blog/src/lib/utils.ts +0 -5
- package/templates/blog/src/pages/about.tsx +0 -36
- package/templates/blog/src/pages/blog/[slug].tsx +0 -56
- package/templates/blog/src/pages/blog/index.tsx +0 -70
- package/templates/blog/src/pages/index.tsx +0 -73
- package/templates/blog/src/styles/globals.css +0 -90
- package/templates/blog/src/x-routes.ts +0 -20
- package/templates/blog/tsconfig.json +0 -5
- package/templates/blog/x.config.ts +0 -6
- package/templates/default/components.json +0 -19
- package/templates/default/src/layouts/main.tsx +0 -28
- package/templates/default/src/pages/index.tsx +0 -66
- package/templates/default/src/styles/globals.css +0 -55
- package/templates/default/src/x-routes.ts +0 -17
- package/templates/default/tsconfig.json +0 -5
- package/templates/default/x.config.ts +0 -6
- package/templates/landing/components.json +0 -20
- package/templates/landing/public/favicon.ico +0 -0
- package/templates/landing/src/components/code-block.tsx +0 -118
- package/templates/landing/src/components/ui/avatar.tsx +0 -91
- package/templates/landing/src/components/ui/badge.tsx +0 -49
- package/templates/landing/src/components/ui/button.tsx +0 -58
- package/templates/landing/src/components/ui/card.tsx +0 -88
- package/templates/landing/src/components/ui/input.tsx +0 -20
- package/templates/landing/src/layouts/main.tsx +0 -78
- package/templates/landing/src/lib/syntax.tsx +0 -366
- package/templates/landing/src/lib/utils.ts +0 -5
- package/templates/landing/src/pages/docs/_layout.tsx +0 -139
- package/templates/landing/src/pages/docs/api-routes.tsx +0 -113
- package/templates/landing/src/pages/docs/build-deploy.tsx +0 -124
- package/templates/landing/src/pages/docs/configuration.tsx +0 -121
- package/templates/landing/src/pages/docs/content-collections.tsx +0 -130
- package/templates/landing/src/pages/docs/data-layer.tsx +0 -142
- package/templates/landing/src/pages/docs/getting-started.tsx +0 -129
- package/templates/landing/src/pages/docs/index.tsx +0 -187
- package/templates/landing/src/pages/docs/installation.tsx +0 -143
- package/templates/landing/src/pages/docs/introduction.tsx +0 -114
- package/templates/landing/src/pages/docs/layouts.tsx +0 -114
- package/templates/landing/src/pages/docs/middleware.tsx +0 -124
- package/templates/landing/src/pages/docs/packages/cli.tsx +0 -133
- package/templates/landing/src/pages/docs/packages/core.tsx +0 -176
- package/templates/landing/src/pages/docs/packages/env.tsx +0 -128
- package/templates/landing/src/pages/docs/pages.tsx +0 -135
- package/templates/landing/src/pages/docs/routing.tsx +0 -123
- package/templates/landing/src/pages/docs/server-functions.tsx +0 -177
- package/templates/landing/src/pages/features.tsx +0 -129
- package/templates/landing/src/pages/index.tsx +0 -159
- package/templates/landing/src/styles/globals.css +0 -136
- package/templates/landing/src/x-routes.ts +0 -31
- package/templates/landing/tsconfig.json +0 -10
- package/templates/landing/x.config.ts +0 -2
- package/templates/saas/components.json +0 -20
- package/templates/saas/public/favicon.ico +0 -0
- package/templates/saas/src/actions/dashboard.ts +0 -3
- package/templates/saas/src/api/auth/login.ts +0 -31
- package/templates/saas/src/components/ui/avatar.tsx +0 -91
- package/templates/saas/src/components/ui/badge.tsx +0 -49
- package/templates/saas/src/components/ui/button.tsx +0 -58
- package/templates/saas/src/components/ui/card.tsx +0 -88
- package/templates/saas/src/components/ui/input.tsx +0 -20
- package/templates/saas/src/layouts/dashboard.tsx +0 -67
- package/templates/saas/src/layouts/main.tsx +0 -38
- package/templates/saas/src/lib/auth.ts +0 -91
- package/templates/saas/src/lib/migrations/001_create_sessions.sql +0 -9
- package/templates/saas/src/lib/utils.ts +0 -5
- package/templates/saas/src/pages/dashboard/_middleware.ts +0 -9
- package/templates/saas/src/pages/dashboard/analytics.tsx +0 -68
- package/templates/saas/src/pages/dashboard/index.tsx +0 -86
- package/templates/saas/src/pages/dashboard/settings.tsx +0 -111
- package/templates/saas/src/pages/index.tsx +0 -110
- package/templates/saas/src/pages/login.tsx +0 -140
- package/templates/saas/src/pages/pricing.tsx +0 -121
- package/templates/saas/src/styles/globals.css +0 -90
- package/templates/saas/src/x-routes.ts +0 -22
- package/templates/saas/tsconfig.json +0 -5
- package/templates/saas/x.config.ts +0 -7
- /package/templates/{basic → addons/auth}/src/api/auth/logout.ts +0 -0
- /package/templates/{basic → addons/auth}/src/pages/dashboard/_middleware.ts +0 -0
- /package/templates/{basic → addons/shadcn}/src/lib/utils.ts +0 -0
|
@@ -1,136 +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;0,9..40,700&family=IBM+Plex+Mono:wght@400;500&family=Syne:wght@600;700;800&display=swap");
|
|
2
|
-
|
|
3
|
-
@import "tailwindcss";
|
|
4
|
-
@import "tw-animate-css";
|
|
5
|
-
|
|
6
|
-
@custom-variant dark (&:is(.dark *));
|
|
7
|
-
|
|
8
|
-
@theme inline {
|
|
9
|
-
--font-display: "Syne", ui-sans-serif, system-ui, sans-serif;
|
|
10
|
-
--font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
|
|
11
|
-
--font-mono: "IBM Plex Mono", ui-monospace, monospace;
|
|
12
|
-
--color-background: var(--background);
|
|
13
|
-
--color-foreground: var(--foreground);
|
|
14
|
-
--color-card: var(--card);
|
|
15
|
-
--color-card-foreground: var(--card-foreground);
|
|
16
|
-
--color-popover: var(--popover);
|
|
17
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
18
|
-
--color-primary: var(--primary);
|
|
19
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
20
|
-
--color-secondary: var(--secondary);
|
|
21
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
22
|
-
--color-muted: var(--muted);
|
|
23
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
24
|
-
--color-accent: var(--accent);
|
|
25
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
26
|
-
--color-destructive: var(--destructive);
|
|
27
|
-
--color-border: var(--border);
|
|
28
|
-
--color-input: var(--input);
|
|
29
|
-
--color-ring: var(--ring);
|
|
30
|
-
--animate-float: float 3s ease-in-out infinite;
|
|
31
|
-
--animate-pulse-glow: pulse-glow 2.8s ease-in-out infinite;
|
|
32
|
-
--animate-cursor: cursor-blink 1.1s step-end infinite;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:root {
|
|
36
|
-
--radius: 0.625rem;
|
|
37
|
-
--background: #060910;
|
|
38
|
-
--foreground: #e4eaf4;
|
|
39
|
-
--card: #0c1018;
|
|
40
|
-
--card-foreground: #e4eaf4;
|
|
41
|
-
--popover: #0c1018;
|
|
42
|
-
--popover-foreground: #e4eaf4;
|
|
43
|
-
--primary: #e8952f;
|
|
44
|
-
--primary-foreground: #0a0d14;
|
|
45
|
-
--secondary: #3dd6c6;
|
|
46
|
-
--secondary-foreground: #060910;
|
|
47
|
-
--muted: #121824;
|
|
48
|
-
--muted-foreground: #7b879c;
|
|
49
|
-
--accent: #e8952f;
|
|
50
|
-
--accent-foreground: #0a0d14;
|
|
51
|
-
--destructive: #f07178;
|
|
52
|
-
--border: #1a2233;
|
|
53
|
-
--input: #1a2233;
|
|
54
|
-
--ring: #e8952f;
|
|
55
|
-
--terminal-bg: #05080f;
|
|
56
|
-
--terminal-bar: #0a0f18;
|
|
57
|
-
--terminal-border: #1c2638;
|
|
58
|
-
--terminal-text: #d8e1f0;
|
|
59
|
-
--terminal-muted: #6b7f9a;
|
|
60
|
-
--terminal-prompt: #e8952f;
|
|
61
|
-
--terminal-label: #5a6d88;
|
|
62
|
-
--terminal-glow: 0 24px 80px -20px rgba(232, 149, 47, 0.12);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@layer base {
|
|
66
|
-
* {
|
|
67
|
-
@apply border-border outline-ring/50;
|
|
68
|
-
}
|
|
69
|
-
body {
|
|
70
|
-
@apply bg-background font-sans text-foreground antialiased;
|
|
71
|
-
}
|
|
72
|
-
h1,
|
|
73
|
-
h2,
|
|
74
|
-
h3 {
|
|
75
|
-
@apply font-display tracking-tight;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Docs prose rhythm */
|
|
80
|
-
.doc-content h2 {
|
|
81
|
-
@apply mt-14 scroll-mt-24 border-t border-border/40 pt-10 text-xl font-bold first:mt-0 first:border-0 first:pt-0;
|
|
82
|
-
}
|
|
83
|
-
.doc-content h3 {
|
|
84
|
-
@apply mt-8 text-lg font-semibold;
|
|
85
|
-
}
|
|
86
|
-
.doc-content p {
|
|
87
|
-
@apply mt-3 leading-relaxed text-muted-foreground;
|
|
88
|
-
}
|
|
89
|
-
.doc-content ul {
|
|
90
|
-
@apply mt-4 list-inside list-disc space-y-2 text-muted-foreground;
|
|
91
|
-
}
|
|
92
|
-
.doc-content a:not(.no-doc-link) {
|
|
93
|
-
@apply text-primary underline underline-offset-2 transition-colors hover:text-primary/80;
|
|
94
|
-
}
|
|
95
|
-
.doc-content code:not(pre code) {
|
|
96
|
-
@apply rounded-md bg-muted px-1.5 py-0.5 font-mono text-sm text-foreground;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@keyframes float {
|
|
100
|
-
0%,
|
|
101
|
-
100% {
|
|
102
|
-
transform: translateY(0);
|
|
103
|
-
}
|
|
104
|
-
50% {
|
|
105
|
-
transform: translateY(-8px);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@keyframes pulse-glow {
|
|
110
|
-
0%,
|
|
111
|
-
100% {
|
|
112
|
-
opacity: 0.45;
|
|
113
|
-
transform: scale(0.98);
|
|
114
|
-
}
|
|
115
|
-
50% {
|
|
116
|
-
opacity: 0.85;
|
|
117
|
-
transform: scale(1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@keyframes cursor-blink {
|
|
122
|
-
0%,
|
|
123
|
-
100% {
|
|
124
|
-
opacity: 1;
|
|
125
|
-
}
|
|
126
|
-
50% {
|
|
127
|
-
opacity: 0;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
@media (prefers-reduced-motion: reduce) {
|
|
132
|
-
.animate-pulse-glow,
|
|
133
|
-
.animate-cursor {
|
|
134
|
-
animation: none !important;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Auto-generated by @thexjs/core -- do not edit
|
|
2
|
-
export type RouteMap = {
|
|
3
|
-
"/": Record<string, never>;
|
|
4
|
-
"/features": Record<string, never>;
|
|
5
|
-
"/contact": Record<string, never>;
|
|
6
|
-
"/docs": Record<string, never>;
|
|
7
|
-
"/docs/content-collections": Record<string, never>;
|
|
8
|
-
"/docs/build-deploy": Record<string, never>;
|
|
9
|
-
"/docs/configuration": Record<string, never>;
|
|
10
|
-
"/docs/data-layer": Record<string, never>;
|
|
11
|
-
"/docs/server-functions": Record<string, never>;
|
|
12
|
-
"/docs/layouts": Record<string, never>;
|
|
13
|
-
"/docs/api-routes": Record<string, never>;
|
|
14
|
-
"/docs/routing": Record<string, never>;
|
|
15
|
-
"/docs/pages": Record<string, never>;
|
|
16
|
-
"/docs/getting-started": Record<string, never>;
|
|
17
|
-
"/docs/middleware": Record<string, never>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export function href<T extends keyof RouteMap & string>(
|
|
21
|
-
path: T,
|
|
22
|
-
...[params]: RouteMap[T] extends Record<string, never> ? [] : [RouteMap[T]]
|
|
23
|
-
): string {
|
|
24
|
-
if (!params) return path;
|
|
25
|
-
let result: string = path;
|
|
26
|
-
for (const [key, value] of Object.entries(params)) {
|
|
27
|
-
result = result.replace(new RegExp(`:${key}(?=/|$)`), encodeURIComponent(String(value)));
|
|
28
|
-
}
|
|
29
|
-
result = result.replace(/\*+$/, "");
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": { "noEmit": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] } },
|
|
4
|
-
"include": [
|
|
5
|
-
"src",
|
|
6
|
-
"../../../core/src/build.ts",
|
|
7
|
-
"../../../core/src/client-nav.ts",
|
|
8
|
-
"../../../core/src/createApp.ts"
|
|
9
|
-
]
|
|
10
|
-
}
|
|
@@ -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
|
-
}
|
|
Binary file
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// DEMO ONLY: admin/admin with plaintext comparison via the shared
|
|
2
|
-
// authenticate() helper — replace with real credential storage before shipping.
|
|
3
|
-
import { authenticate, setSessionCookie } from "../../lib/auth";
|
|
4
|
-
|
|
5
|
-
export async function POST(req: Request): Promise<Response> {
|
|
6
|
-
try {
|
|
7
|
-
const body = (await req.json()) as { email?: string; password?: string };
|
|
8
|
-
const { email, password } = body;
|
|
9
|
-
|
|
10
|
-
if (!email || !password) {
|
|
11
|
-
return Response.json({ error: "email and password required" }, { status: 400 });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const session = authenticate(email, password);
|
|
15
|
-
if (!session) {
|
|
16
|
-
return Response.json({ error: "invalid credentials" }, { status: 401 });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const cookie = setSessionCookie(session.token);
|
|
20
|
-
return new Response(JSON.stringify({ user: { username: session.username } }), {
|
|
21
|
-
status: 200,
|
|
22
|
-
headers: {
|
|
23
|
-
"Content-Type": "application/json",
|
|
24
|
-
"Set-Cookie": cookie,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
} catch (err) {
|
|
28
|
-
console.error("[auth] login error:", err);
|
|
29
|
-
return Response.json({ error: "internal error" }, { status: 500 });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -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 };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { BarChart3, LayoutDashboard, Settings, User } from "lucide-react";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
import { cn } from "../lib/utils";
|
|
4
|
-
|
|
5
|
-
interface LayoutProps {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
page?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const sidebarLinks = [
|
|
11
|
-
{ href: "/dashboard", label: "Dashboard", icon: LayoutDashboard },
|
|
12
|
-
{ href: "/dashboard/analytics", label: "Analytics", icon: BarChart3 },
|
|
13
|
-
{ href: "/dashboard/settings", label: "Settings", icon: Settings },
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
export default function DashboardLayout({ children, page }: LayoutProps) {
|
|
17
|
-
return (
|
|
18
|
-
<div className="flex h-screen overflow-hidden bg-background">
|
|
19
|
-
<aside className="flex w-64 flex-col border-r border-border bg-sidebar">
|
|
20
|
-
<div className="flex h-16 items-center gap-2 border-b border-sidebar-border px-6">
|
|
21
|
-
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground text-sm font-bold">
|
|
22
|
-
S
|
|
23
|
-
</div>
|
|
24
|
-
<span className="text-lg font-bold text-sidebar-foreground">SaaS</span>
|
|
25
|
-
</div>
|
|
26
|
-
<nav className="flex-1 space-y-1 p-4">
|
|
27
|
-
{sidebarLinks.map((link) => {
|
|
28
|
-
const Icon = link.icon;
|
|
29
|
-
const isActive = page === link.label;
|
|
30
|
-
return (
|
|
31
|
-
<a
|
|
32
|
-
key={link.href}
|
|
33
|
-
href={link.href}
|
|
34
|
-
className={cn(
|
|
35
|
-
"flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",
|
|
36
|
-
isActive
|
|
37
|
-
? "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
38
|
-
: "text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground",
|
|
39
|
-
)}
|
|
40
|
-
>
|
|
41
|
-
<Icon className="h-4 w-4" />
|
|
42
|
-
{link.label}
|
|
43
|
-
</a>
|
|
44
|
-
);
|
|
45
|
-
})}
|
|
46
|
-
</nav>
|
|
47
|
-
<div className="border-t border-sidebar-border p-4">
|
|
48
|
-
<div className="flex items-center gap-3 rounded-lg px-3 py-2">
|
|
49
|
-
<div className="flex h-8 w-8 items-center justify-center rounded-full bg-muted">
|
|
50
|
-
<User className="h-4 w-4 text-muted-foreground" />
|
|
51
|
-
</div>
|
|
52
|
-
<div className="flex flex-col">
|
|
53
|
-
<span className="text-sm font-medium text-sidebar-foreground">John Doe</span>
|
|
54
|
-
<span className="text-xs text-sidebar-foreground/60">john@example.com</span>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</aside>
|
|
59
|
-
<div className="flex flex-1 flex-col overflow-hidden">
|
|
60
|
-
<header className="flex h-16 items-center border-b border-border bg-background px-8">
|
|
61
|
-
<h1 className="text-lg font-semibold text-foreground">{page || "Dashboard"}</h1>
|
|
62
|
-
</header>
|
|
63
|
-
<main className="flex-1 overflow-y-auto p-8">{children}</main>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { cn } from "../lib/utils";
|
|
3
|
-
|
|
4
|
-
interface LayoutProps {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const navLinks = [
|
|
9
|
-
{ href: "/#features", label: "Features" },
|
|
10
|
-
{ href: "/pricing", label: "Pricing" },
|
|
11
|
-
{ href: "/login", label: "Login" },
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
export default function MainLayout({ children }: LayoutProps) {
|
|
15
|
-
return (
|
|
16
|
-
<div className="min-h-screen bg-background">
|
|
17
|
-
<nav className="sticky top-0 z-50 bg-background/80 backdrop-blur-sm border-b border-border">
|
|
18
|
-
<div className="mx-auto flex h-16 max-w-7xl items-center justify-between px-4 sm:px-6 lg:px-8">
|
|
19
|
-
<a href="/" className="text-xl font-bold tracking-tight text-foreground">
|
|
20
|
-
SaaS
|
|
21
|
-
</a>
|
|
22
|
-
<div className="flex items-center gap-8">
|
|
23
|
-
{navLinks.map((link) => (
|
|
24
|
-
<a
|
|
25
|
-
key={link.href}
|
|
26
|
-
href={link.href}
|
|
27
|
-
className="text-sm font-medium text-muted-foreground transition-colors hover:text-foreground"
|
|
28
|
-
>
|
|
29
|
-
{link.label}
|
|
30
|
-
</a>
|
|
31
|
-
))}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</nav>
|
|
35
|
-
<main>{children}</main>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
}
|