create-thexjs-app 0.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1026 -0
  3. package/dist/index.js +224 -0
  4. package/package.json +30 -0
  5. package/templates/basic/components.json +21 -0
  6. package/templates/basic/content/blog/hello.md +8 -0
  7. package/templates/basic/public/favicon.ico +0 -0
  8. package/templates/basic/src/actions/dashboard/greet.ts +3 -0
  9. package/templates/basic/src/api/auth/login.ts +30 -0
  10. package/templates/basic/src/api/auth/logout.ts +12 -0
  11. package/templates/basic/src/api/placeholder/comments.ts +17 -0
  12. package/templates/basic/src/api/placeholder/posts.ts +20 -0
  13. package/templates/basic/src/api/placeholder/todos.ts +21 -0
  14. package/templates/basic/src/api/placeholder/users.ts +12 -0
  15. package/templates/basic/src/components/Head.tsx +21 -0
  16. package/templates/basic/src/components/Image.tsx +27 -0
  17. package/templates/basic/src/components/Link.tsx +16 -0
  18. package/templates/basic/src/components/ui/badge.tsx +49 -0
  19. package/templates/basic/src/components/ui/button.tsx +58 -0
  20. package/templates/basic/src/components/ui/card.tsx +88 -0
  21. package/templates/basic/src/components/ui/input.tsx +20 -0
  22. package/templates/basic/src/layouts/main.tsx +38 -0
  23. package/templates/basic/src/lib/auth.ts +70 -0
  24. package/templates/basic/src/lib/migrations/001_create_sessions.sql +9 -0
  25. package/templates/basic/src/lib/placeholder-data.ts +176 -0
  26. package/templates/basic/src/lib/utils.ts +6 -0
  27. package/templates/basic/src/pages/_404.tsx +17 -0
  28. package/templates/basic/src/pages/about.tsx +22 -0
  29. package/templates/basic/src/pages/blog.tsx +41 -0
  30. package/templates/basic/src/pages/dashboard/_middleware.ts +16 -0
  31. package/templates/basic/src/pages/dashboard/index.tsx +84 -0
  32. package/templates/basic/src/pages/index.tsx +54 -0
  33. package/templates/basic/src/pages/login.tsx +85 -0
  34. package/templates/basic/src/pages/placeholder.tsx +194 -0
  35. package/templates/basic/src/pages/posts/[id].tsx +17 -0
  36. package/templates/basic/src/styles/globals.css +90 -0
  37. package/templates/basic/src/x-routes.ts +29 -0
  38. package/templates/basic/tsconfig.json +11 -0
  39. package/templates/basic/x.config.ts +10 -0
  40. package/templates/blog/components.json +20 -0
  41. package/templates/blog/content/posts/getting-started.md +38 -0
  42. package/templates/blog/content/posts/hello-world.md +21 -0
  43. package/templates/blog/content/posts/tailwind-v4.md +31 -0
  44. package/templates/blog/public/favicon.ico +0 -0
  45. package/templates/blog/src/components/ui/avatar.tsx +91 -0
  46. package/templates/blog/src/components/ui/badge.tsx +49 -0
  47. package/templates/blog/src/components/ui/button.tsx +58 -0
  48. package/templates/blog/src/components/ui/card.tsx +88 -0
  49. package/templates/blog/src/components/ui/input.tsx +20 -0
  50. package/templates/blog/src/layouts/blog.tsx +46 -0
  51. package/templates/blog/src/layouts/main.tsx +32 -0
  52. package/templates/blog/src/lib/utils.ts +5 -0
  53. package/templates/blog/src/pages/about.tsx +36 -0
  54. package/templates/blog/src/pages/blog/[slug].tsx +56 -0
  55. package/templates/blog/src/pages/blog/index.tsx +70 -0
  56. package/templates/blog/src/pages/index.tsx +70 -0
  57. package/templates/blog/src/styles/globals.css +90 -0
  58. package/templates/blog/src/x-routes.ts +20 -0
  59. package/templates/blog/tsconfig.json +5 -0
  60. package/templates/blog/x.config.ts +6 -0
  61. package/templates/landing/components.json +20 -0
  62. package/templates/landing/public/favicon.ico +0 -0
  63. package/templates/landing/src/components/code-block.tsx +24 -0
  64. package/templates/landing/src/components/ui/avatar.tsx +91 -0
  65. package/templates/landing/src/components/ui/badge.tsx +49 -0
  66. package/templates/landing/src/components/ui/button.tsx +58 -0
  67. package/templates/landing/src/components/ui/card.tsx +88 -0
  68. package/templates/landing/src/components/ui/input.tsx +20 -0
  69. package/templates/landing/src/layouts/main.tsx +48 -0
  70. package/templates/landing/src/lib/syntax.tsx +366 -0
  71. package/templates/landing/src/lib/utils.ts +5 -0
  72. package/templates/landing/src/pages/contact.tsx +95 -0
  73. package/templates/landing/src/pages/docs/_layout.tsx +109 -0
  74. package/templates/landing/src/pages/docs/api-routes.tsx +113 -0
  75. package/templates/landing/src/pages/docs/build-deploy.tsx +124 -0
  76. package/templates/landing/src/pages/docs/configuration.tsx +121 -0
  77. package/templates/landing/src/pages/docs/content-collections.tsx +130 -0
  78. package/templates/landing/src/pages/docs/data-layer.tsx +142 -0
  79. package/templates/landing/src/pages/docs/getting-started.tsx +119 -0
  80. package/templates/landing/src/pages/docs/index.tsx +123 -0
  81. package/templates/landing/src/pages/docs/layouts.tsx +114 -0
  82. package/templates/landing/src/pages/docs/middleware.tsx +124 -0
  83. package/templates/landing/src/pages/docs/pages.tsx +135 -0
  84. package/templates/landing/src/pages/docs/routing.tsx +123 -0
  85. package/templates/landing/src/pages/docs/server-functions.tsx +123 -0
  86. package/templates/landing/src/pages/features.tsx +129 -0
  87. package/templates/landing/src/pages/index.tsx +175 -0
  88. package/templates/landing/src/styles/globals.css +100 -0
  89. package/templates/landing/src/x-routes.ts +31 -0
  90. package/templates/landing/tsconfig.json +5 -0
  91. package/templates/landing/x.config.ts +2 -0
  92. package/templates/saas/components.json +20 -0
  93. package/templates/saas/public/favicon.ico +0 -0
  94. package/templates/saas/src/actions/dashboard.ts +3 -0
  95. package/templates/saas/src/components/ui/avatar.tsx +91 -0
  96. package/templates/saas/src/components/ui/badge.tsx +49 -0
  97. package/templates/saas/src/components/ui/button.tsx +58 -0
  98. package/templates/saas/src/components/ui/card.tsx +88 -0
  99. package/templates/saas/src/components/ui/input.tsx +20 -0
  100. package/templates/saas/src/layouts/dashboard.tsx +67 -0
  101. package/templates/saas/src/layouts/main.tsx +38 -0
  102. package/templates/saas/src/lib/auth.ts +70 -0
  103. package/templates/saas/src/lib/migrations/001_create_sessions.sql +9 -0
  104. package/templates/saas/src/lib/utils.ts +5 -0
  105. package/templates/saas/src/pages/dashboard/_middleware.ts +9 -0
  106. package/templates/saas/src/pages/dashboard/analytics.tsx +68 -0
  107. package/templates/saas/src/pages/dashboard/index.tsx +86 -0
  108. package/templates/saas/src/pages/dashboard/settings.tsx +105 -0
  109. package/templates/saas/src/pages/index.tsx +110 -0
  110. package/templates/saas/src/pages/login.tsx +67 -0
  111. package/templates/saas/src/pages/pricing.tsx +121 -0
  112. package/templates/saas/src/styles/globals.css +90 -0
  113. package/templates/saas/src/x-routes.ts +22 -0
  114. package/templates/saas/tsconfig.json +5 -0
  115. package/templates/saas/x.config.ts +7 -0
@@ -0,0 +1,194 @@
1
+ export default function PlaceholderPage() {
2
+ return (
3
+ <div className="mx-auto max-w-3xl space-y-6">
4
+ <h1 className="text-3xl font-bold">
5
+ {"{"}JSON{"}"} Placeholder
6
+ </h1>
7
+ <p className="text-muted-foreground">
8
+ Free fake API powered by <strong>@thexjs/core</strong> — in-memory data, sub-ms response times.
9
+ </p>
10
+
11
+ <div className="overflow-x-auto rounded-lg border border-border">
12
+ <table className="w-full text-sm">
13
+ <thead>
14
+ <tr className="border-b border-border">
15
+ <th className="text-left p-3 font-medium">Endpoint</th>
16
+ <th className="text-right p-3 font-medium">Size</th>
17
+ <th className="text-right p-3 font-medium">Action</th>
18
+ </tr>
19
+ </thead>
20
+ <tbody id="endpoints">
21
+ <tr className="border-b border-border">
22
+ <td className="p-3">
23
+ <code className="bg-muted px-1.5 py-0.5 rounded">GET /api/placeholder/posts</code>
24
+ </td>
25
+ <td className="text-right p-3">100</td>
26
+ <td className="text-right p-3">
27
+ <button
28
+ className="fetch-btn text-primary hover:underline text-xs"
29
+ data-url="/api/placeholder/posts"
30
+ >
31
+ Fetch
32
+ </button>
33
+ </td>
34
+ </tr>
35
+ <tr className="border-b border-border">
36
+ <td className="p-3">
37
+ <code className="bg-muted px-1.5 py-0.5 rounded">
38
+ GET /api/placeholder/comments
39
+ </code>
40
+ </td>
41
+ <td className="text-right p-3">500</td>
42
+ <td className="text-right p-3">
43
+ <button
44
+ className="fetch-btn text-primary hover:underline text-xs"
45
+ data-url="/api/placeholder/comments"
46
+ >
47
+ Fetch
48
+ </button>
49
+ </td>
50
+ </tr>
51
+ <tr className="border-b border-border">
52
+ <td className="p-3">
53
+ <code className="bg-muted px-1.5 py-0.5 rounded">GET /api/placeholder/todos</code>
54
+ </td>
55
+ <td className="text-right p-3">200</td>
56
+ <td className="text-right p-3">
57
+ <button
58
+ className="fetch-btn text-primary hover:underline text-xs"
59
+ data-url="/api/placeholder/todos"
60
+ >
61
+ Fetch
62
+ </button>
63
+ </td>
64
+ </tr>
65
+ <tr className="border-b border-border">
66
+ <td className="p-3">
67
+ <code className="bg-muted px-1.5 py-0.5 rounded">GET /api/placeholder/users</code>
68
+ </td>
69
+ <td className="text-right p-3">10</td>
70
+ <td className="text-right p-3">
71
+ <button
72
+ className="fetch-btn text-primary hover:underline text-xs"
73
+ data-url="/api/placeholder/users"
74
+ >
75
+ Fetch
76
+ </button>
77
+ </td>
78
+ </tr>
79
+ <tr className="font-semibold">
80
+ <td colSpan={2} className="p-3">
81
+ All endpoints (sequential)
82
+ </td>
83
+ <td className="text-right p-3">
84
+ <button id="fetch-all" className="fetch-btn text-primary hover:underline text-xs">
85
+ Fetch All
86
+ </button>
87
+ </td>
88
+ </tr>
89
+ </tbody>
90
+ </table>
91
+ </div>
92
+
93
+ <div
94
+ id="results"
95
+ className="rounded-lg border border-border bg-muted p-4 font-mono text-xs whitespace-pre-wrap min-h-[60px]"
96
+ >
97
+ Click a button to fetch data. Response times shown below.
98
+ </div>
99
+
100
+ <hr className="border-border" />
101
+ <a href="/" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
102
+ &larr; Back home
103
+ </a>
104
+
105
+ <script
106
+ dangerouslySetInnerHTML={{
107
+ __html: `
108
+ (function () {
109
+ var results = document.getElementById("results");
110
+ if (!results) return;
111
+ function log(msg) { results.textContent = msg; }
112
+
113
+ function fmt(ms) {
114
+ if (ms < 1) return (ms * 1000).toFixed(0) + " \\u00b5s";
115
+ if (ms < 10) return ms.toFixed(2) + " ms";
116
+ return ms.toFixed(1) + " ms";
117
+ }
118
+
119
+ [].forEach.call(document.querySelectorAll(".fetch-btn:not(#fetch-all)"), function (btn) {
120
+ btn.addEventListener("click", function () {
121
+ var url = btn.getAttribute("data-url");
122
+ btn.disabled = true;
123
+ btn.textContent = "Loading...";
124
+ log("Fetching " + url + "\\n");
125
+ var start = performance.now();
126
+ fetch(url)
127
+ .then(function (r) { return r.json(); })
128
+ .then(function (json) {
129
+ var elapsed = performance.now() - start;
130
+ var size = JSON.stringify(json).length;
131
+ var label = btn.parentElement.previousElementSibling.textContent.trim();
132
+ log(
133
+ "\\u2714 " + url + "\\n" +
134
+ "Status: 200 OK\\n" +
135
+ "Time: " + fmt(elapsed) + "\\n" +
136
+ "Size: " + (size / 1024).toFixed(1) + " KB\\n" +
137
+ "Items: " + (Array.isArray(json) ? json.length : json.data ? json.data.length : 1) + "\\n\\n" +
138
+ JSON.stringify(json, null, 2).slice(0, 2000) +
139
+ (JSON.stringify(json, null, 2).length > 2000 ? "\\n..." : "")
140
+ );
141
+ })
142
+ .catch(function (err) {
143
+ log("\\u2716 Error: " + err.message);
144
+ })
145
+ .finally(function () {
146
+ btn.disabled = false;
147
+ btn.textContent = "Fetch";
148
+ });
149
+ });
150
+ });
151
+
152
+ var fetchAll = document.getElementById("fetch-all");
153
+ if (fetchAll) {
154
+ fetchAll.addEventListener("click", function () {
155
+ fetchAll.disabled = true;
156
+ fetchAll.textContent = "Running...";
157
+ var urls = ["/api/placeholder/posts", "/api/placeholder/comments", "/api/placeholder/todos", "/api/placeholder/users"];
158
+ var lines = ["Benchmarking " + urls.length + " endpoints...\\n"];
159
+ var totalStart = performance.now();
160
+
161
+ function run(i) {
162
+ if (i >= urls.length) {
163
+ var total = performance.now() - totalStart;
164
+ lines.push("\\u2014".repeat(30));
165
+ lines.push("Total: " + fmt(total) + " (" + fmt(total / urls.length) + " avg)");
166
+ log(lines.join("\\n"));
167
+ fetchAll.disabled = false;
168
+ fetchAll.textContent = "Fetch All";
169
+ return;
170
+ }
171
+ var url = urls[i];
172
+ var start = performance.now();
173
+ fetch(url)
174
+ .then(function (r) { return r.json(); })
175
+ .then(function () {
176
+ var elapsed = performance.now() - start;
177
+ lines.push((i + 1) + ". " + url + " \\u2192 " + fmt(elapsed));
178
+ run(i + 1);
179
+ })
180
+ .catch(function (err) {
181
+ lines.push((i + 1) + ". " + url + " \\u2716 " + err.message);
182
+ run(i + 1);
183
+ });
184
+ }
185
+ run(0);
186
+ });
187
+ }
188
+ })();
189
+ `.trim(),
190
+ }}
191
+ />
192
+ </div>
193
+ );
194
+ }
@@ -0,0 +1,17 @@
1
+ import type { RouteProps } from "@thexjs/core";
2
+
3
+ export default function PostPage({ params }: RouteProps) {
4
+ return (
5
+ <div className="space-y-4">
6
+ <h1 className="text-3xl font-bold">Post: {params.id}</h1>
7
+ <p>
8
+ <a
9
+ href="/"
10
+ className="text-sm text-muted-foreground hover:text-foreground transition-colors"
11
+ >
12
+ &larr; Back home
13
+ </a>
14
+ </p>
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,90 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @custom-variant dark (&:is(.dark *));
5
+
6
+ @theme inline {
7
+ --color-background: var(--background);
8
+ --color-foreground: var(--foreground);
9
+ --color-card: var(--card);
10
+ --color-card-foreground: var(--card-foreground);
11
+ --color-popover: var(--popover);
12
+ --color-popover-foreground: var(--popover-foreground);
13
+ --color-primary: var(--primary);
14
+ --color-primary-foreground: var(--primary-foreground);
15
+ --color-secondary: var(--secondary);
16
+ --color-secondary-foreground: var(--secondary-foreground);
17
+ --color-muted: var(--muted);
18
+ --color-muted-foreground: var(--muted-foreground);
19
+ --color-accent: var(--accent);
20
+ --color-accent-foreground: var(--accent-foreground);
21
+ --color-destructive: var(--destructive);
22
+ --color-destructive-foreground: var(--destructive-foreground);
23
+ --color-border: var(--border);
24
+ --color-input: var(--input);
25
+ --color-ring: var(--ring);
26
+ --color-chart-1: var(--chart-1);
27
+ --color-chart-2: var(--chart-2);
28
+ --color-chart-3: var(--chart-3);
29
+ --color-chart-4: var(--chart-4);
30
+ --color-chart-5: var(--chart-5);
31
+ --radius-sm: calc(var(--radius) * 0.6);
32
+ --radius-md: calc(var(--radius) * 0.8);
33
+ --radius-lg: var(--radius);
34
+ --radius-xl: calc(var(--radius) * 1.4);
35
+ --radius-2xl: calc(var(--radius) * 1.8);
36
+ --radius-3xl: calc(var(--radius) * 2.2);
37
+ --radius-4xl: calc(var(--radius) * 2.6);
38
+ --color-sidebar: var(--sidebar);
39
+ --color-sidebar-foreground: var(--sidebar-foreground);
40
+ --color-sidebar-primary: var(--sidebar-primary);
41
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
42
+ --color-sidebar-accent: var(--sidebar-accent);
43
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
44
+ --color-sidebar-border: var(--sidebar-border);
45
+ --color-sidebar-ring: var(--sidebar-ring);
46
+ }
47
+
48
+ :root {
49
+ --radius: 0.625rem;
50
+ --background: oklch(0.145 0 0);
51
+ --foreground: oklch(0.985 0 0);
52
+ --card: oklch(0.205 0 0);
53
+ --card-foreground: oklch(0.985 0 0);
54
+ --popover: oklch(0.205 0 0);
55
+ --popover-foreground: oklch(0.985 0 0);
56
+ --primary: oklch(0.922 0 0);
57
+ --primary-foreground: oklch(0.205 0 0);
58
+ --secondary: oklch(0.269 0 0);
59
+ --secondary-foreground: oklch(0.985 0 0);
60
+ --muted: oklch(0.269 0 0);
61
+ --muted-foreground: oklch(0.708 0 0);
62
+ --accent: oklch(0.269 0 0);
63
+ --accent-foreground: oklch(0.985 0 0);
64
+ --destructive: oklch(0.704 0.191 22.216);
65
+ --border: oklch(1 0 0 / 10%);
66
+ --input: oklch(1 0 0 / 15%);
67
+ --ring: oklch(0.556 0 0);
68
+ --chart-1: oklch(0.488 0.243 264.376);
69
+ --chart-2: oklch(0.696 0.17 162.48);
70
+ --chart-3: oklch(0.769 0.188 70.08);
71
+ --chart-4: oklch(0.627 0.265 303.9);
72
+ --chart-5: oklch(0.645 0.246 16.439);
73
+ --sidebar: oklch(0.205 0 0);
74
+ --sidebar-foreground: oklch(0.985 0 0);
75
+ --sidebar-primary: oklch(0.488 0.243 264.376);
76
+ --sidebar-primary-foreground: oklch(0.985 0 0);
77
+ --sidebar-accent: oklch(0.269 0 0);
78
+ --sidebar-foreground: oklch(0.985 0 0);
79
+ --sidebar-border: oklch(1 0 0 / 10%);
80
+ --sidebar-ring: oklch(0.556 0 0);
81
+ }
82
+
83
+ @layer base {
84
+ * {
85
+ @apply border-border outline-ring/50;
86
+ }
87
+ body {
88
+ @apply bg-background text-foreground;
89
+ }
90
+ }
@@ -0,0 +1,29 @@
1
+ // Auto-generated by @thexjs/core -- do not edit
2
+ export type RouteMap = {
3
+ "/": Record<string, never>;
4
+ "/posts/:id": { id: string };
5
+ "/login": Record<string, never>;
6
+ "/dashboard": Record<string, never>;
7
+ "/blog": Record<string, never>;
8
+ "/placeholder": Record<string, never>;
9
+ "/about": Record<string, never>;
10
+ "/api/auth/login": Record<string, never>;
11
+ "/api/auth/logout": Record<string, never>;
12
+ "/api/placeholder/comments": Record<string, never>;
13
+ "/api/placeholder/posts": Record<string, never>;
14
+ "/api/placeholder/todos": Record<string, never>;
15
+ "/api/placeholder/users": Record<string, never>;
16
+ };
17
+
18
+ export function href<T extends keyof RouteMap & string>(
19
+ path: T,
20
+ ...[params]: RouteMap[T] extends Record<string, never> ? [] : [RouteMap[T]]
21
+ ): string {
22
+ if (!params) return path;
23
+ let result: string = path;
24
+ for (const [key, value] of Object.entries(params)) {
25
+ result = result.replace(new RegExp(`:${key}(?=/|$)`), encodeURIComponent(String(value)));
26
+ }
27
+ result = result.replace(/\*+$/, "");
28
+ return result;
29
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "baseUrl": ".",
6
+ "paths": {
7
+ "@/*": ["./src/*"]
8
+ }
9
+ },
10
+ "include": ["src"]
11
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "@thexjs/core";
2
+
3
+ export default defineConfig({
4
+ pagesDir: "src/pages",
5
+ layoutsDir: "src/layouts",
6
+ apiDir: "src/api",
7
+ actionsDir: "src/actions",
8
+ contentDir: "content",
9
+ port: 3000,
10
+ });
@@ -0,0 +1,20 @@
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
+ }
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: "Getting Started with x Framework"
3
+ date: "2026-07-26"
4
+ description: "Learn how to build your first fullstack application with x framework."
5
+ tags: [tutorial, x-framework]
6
+ ---
7
+
8
+ # Getting Started with x Framework
9
+
10
+ x is a fullstack framework for Bun that lets you build static sites, SSR pages, API routes, and server functions — all in one process.
11
+
12
+ ## Quick Start
13
+
14
+ Create a new project and define your routes in `src/pages/`:
15
+
16
+ ```
17
+ my-app/
18
+ ├── src/
19
+ │ ├── pages/
20
+ │ │ ├── index.tsx
21
+ │ │ └── about.tsx
22
+ │ ├── layouts/
23
+ │ │ └── main.tsx
24
+ │ └── api/
25
+ │ └── hello.ts
26
+ ├── content/
27
+ └── x.config.ts
28
+ ```
29
+
30
+ ## File-based Routing
31
+
32
+ Each file in `src/pages/` becomes a route automatically:
33
+
34
+ | File | Route |
35
+ |------|-------|
36
+ | `src/pages/index.tsx` | `/` |
37
+ | `src/pages/about.tsx` | `/about` |
38
+ | `src/pages/blog/[slug].tsx` | `/blog/:slug` |
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: "Hello World"
3
+ date: "2026-07-27"
4
+ description: "Welcome to our blog — a space for thoughts on web development, design, and technology."
5
+ tags: [welcome, meta]
6
+ ---
7
+
8
+ # Hello World
9
+
10
+ Welcome to **The Blog** — a space for thoughts on web development, design, and technology.
11
+
12
+ This site is built with [x framework](https://x.opencode.ai), a Bun-based fullstack framework that combines static generation, server-side rendering, and API routes in a single process.
13
+
14
+ ## What to expect
15
+
16
+ - Articles on modern web development
17
+ - Deep dives into TypeScript, React, and Bun
18
+ - Design system patterns and best practices
19
+ - Performance optimization techniques
20
+
21
+ Stay tuned for more content coming soon!
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: "Tailwind CSS v4 — What's New"
3
+ date: "2026-07-25"
4
+ description: "A comprehensive look at the changes in Tailwind CSS v4, including the new CSS-first configuration."
5
+ tags: [css, tailwind, design]
6
+ ---
7
+
8
+ # Tailwind CSS v4 — What's New
9
+
10
+ Tailwind CSS v4 introduces a completely new configuration model based on native CSS. Gone are the days of `tailwind.config.js` — now everything lives in your CSS.
11
+
12
+ ## CSS-First Configuration
13
+
14
+ Instead of JavaScript configuration, you use `@theme` directives:
15
+
16
+ ```css
17
+ @import "tailwindcss";
18
+
19
+ @theme inline {
20
+ --color-brand: oklch(0.5 0.2 240);
21
+ --font-display: "Inter", sans-serif;
22
+ }
23
+ ```
24
+
25
+ ## New Utility Classes
26
+
27
+ v4 brings new utilities like `@container` queries, `field-sizing`, and more.
28
+
29
+ ## Performance
30
+
31
+ The new engine is significantly faster than v3, with sub-second rebuilds even on large projects.
@@ -0,0 +1,91 @@
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 };
@@ -0,0 +1,49 @@
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 };
@@ -0,0 +1,58 @@
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 };