tailwind-styled-v4 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animate.cjs +754 -235
- package/dist/animate.cjs.map +1 -1
- package/dist/animate.d.cts +55 -99
- package/dist/animate.d.ts +55 -99
- package/dist/animate.js +742 -235
- package/dist/animate.js.map +1 -1
- package/dist/chunk-VZEJV27B.js +11 -0
- package/dist/chunk-VZEJV27B.js.map +1 -0
- package/dist/chunk-Y5D3E72P.cjs +13 -0
- package/dist/chunk-Y5D3E72P.cjs.map +1 -0
- package/dist/css.cjs +61 -11
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +3 -18
- package/dist/css.d.ts +3 -18
- package/dist/css.js +61 -11
- package/dist/css.js.map +1 -1
- package/dist/devtools.cjs +200 -88
- package/dist/devtools.cjs.map +1 -1
- package/dist/devtools.js +200 -88
- package/dist/devtools.js.map +1 -1
- package/dist/index.cjs +430 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -3
- package/dist/index.d.ts +74 -3
- package/dist/index.js +415 -132
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +118 -138
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +28 -19
- package/dist/next.d.ts +28 -19
- package/dist/next.js +111 -131
- package/dist/next.js.map +1 -1
- package/dist/preset.cjs +312 -18
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.d.cts +29 -2
- package/dist/preset.d.ts +29 -2
- package/dist/preset.js +311 -19
- package/dist/preset.js.map +1 -1
- package/dist/turbopackLoader.cjs +24 -2676
- package/dist/turbopackLoader.cjs.map +1 -1
- package/dist/turbopackLoader.d.cts +3 -13
- package/dist/turbopackLoader.d.ts +3 -13
- package/dist/turbopackLoader.js +24 -2670
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/vite.cjs +90 -57
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +35 -6
- package/dist/vite.d.ts +35 -6
- package/dist/vite.js +90 -58
- package/dist/vite.js.map +1 -1
- package/dist/webpackLoader.cjs +27 -2646
- package/dist/webpackLoader.cjs.map +1 -1
- package/dist/webpackLoader.d.cts +3 -10
- package/dist/webpackLoader.d.ts +3 -10
- package/dist/webpackLoader.js +27 -2640
- package/dist/webpackLoader.js.map +1 -1
- package/package.json +31 -28
- package/dist/astTransform-ua-eapqs.d.cts +0 -41
- package/dist/astTransform-ua-eapqs.d.ts +0 -41
- package/dist/compiler.cjs +0 -3594
- package/dist/compiler.cjs.map +0 -1
- package/dist/compiler.d.cts +0 -716
- package/dist/compiler.d.ts +0 -716
- package/dist/compiler.js +0 -3535
- package/dist/compiler.js.map +0 -1
- package/dist/plugins.cjs +0 -396
- package/dist/plugins.cjs.map +0 -1
- package/dist/plugins.d.cts +0 -231
- package/dist/plugins.d.ts +0 -231
- package/dist/plugins.js +0 -381
- package/dist/plugins.js.map +0 -1
- package/dist/theme.cjs +0 -154
- package/dist/theme.cjs.map +0 -1
- package/dist/theme.d.cts +0 -181
- package/dist/theme.d.ts +0 -181
- package/dist/theme.js +0 -148
- package/dist/theme.js.map +0 -1
package/dist/preset.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import './chunk-VZEJV27B.js';
|
|
2
|
+
|
|
1
3
|
/* tailwind-styled-v4 v4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
2
4
|
|
|
3
5
|
// ../preset/src/defaultPreset.ts
|
|
@@ -15,21 +17,43 @@ var STANDARD_CONTENT_PATHS = [
|
|
|
15
17
|
];
|
|
16
18
|
var designTokens = {
|
|
17
19
|
colors: {
|
|
18
|
-
// Brand
|
|
19
20
|
primary: { DEFAULT: "#3b82f6", hover: "#2563eb", active: "#1d4ed8", foreground: "#ffffff" },
|
|
20
21
|
secondary: { DEFAULT: "#6366f1", hover: "#4f46e5", active: "#4338ca", foreground: "#ffffff" },
|
|
21
22
|
accent: { DEFAULT: "#f59e0b", hover: "#d97706", active: "#b45309", foreground: "#000000" },
|
|
22
|
-
// Semantic
|
|
23
23
|
success: { DEFAULT: "#10b981", foreground: "#ffffff" },
|
|
24
24
|
warning: { DEFAULT: "#f59e0b", foreground: "#000000" },
|
|
25
25
|
danger: { DEFAULT: "#ef4444", foreground: "#ffffff" },
|
|
26
26
|
info: { DEFAULT: "#3b82f6", foreground: "#ffffff" },
|
|
27
|
-
// Neutral
|
|
28
27
|
surface: "#18181b",
|
|
29
28
|
border: "#27272a",
|
|
30
29
|
muted: "#71717a",
|
|
31
30
|
subtle: "#3f3f46"
|
|
32
31
|
},
|
|
32
|
+
spacing: {
|
|
33
|
+
1: "0.25rem",
|
|
34
|
+
2: "0.5rem",
|
|
35
|
+
3: "0.75rem",
|
|
36
|
+
4: "1rem",
|
|
37
|
+
5: "1.25rem",
|
|
38
|
+
6: "1.5rem",
|
|
39
|
+
8: "2rem",
|
|
40
|
+
10: "2.5rem",
|
|
41
|
+
12: "3rem",
|
|
42
|
+
16: "4rem"
|
|
43
|
+
},
|
|
44
|
+
breakpoints: {
|
|
45
|
+
sm: "40rem",
|
|
46
|
+
md: "48rem",
|
|
47
|
+
lg: "64rem",
|
|
48
|
+
xl: "80rem",
|
|
49
|
+
"2xl": "96rem"
|
|
50
|
+
},
|
|
51
|
+
fontWeight: {
|
|
52
|
+
normal: "400",
|
|
53
|
+
medium: "500",
|
|
54
|
+
semibold: "600",
|
|
55
|
+
bold: "700"
|
|
56
|
+
},
|
|
33
57
|
fontFamily: {
|
|
34
58
|
sans: ["InterVariable", "Inter", "system-ui", "sans-serif"],
|
|
35
59
|
mono: ["JetBrains Mono", "Fira Code", "Consolas", "monospace"]
|
|
@@ -81,25 +105,183 @@ var defaultPreset = {
|
|
|
81
105
|
},
|
|
82
106
|
plugins: []
|
|
83
107
|
};
|
|
84
|
-
|
|
85
|
-
return `import type { Config } from "tailwindcss"
|
|
86
|
-
import { defaultPreset } from "tailwind-styled-v4/preset"
|
|
108
|
+
var defaultThemeCss = `@import "tailwindcss";
|
|
87
109
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
110
|
+
@theme {
|
|
111
|
+
/* colors */
|
|
112
|
+
--color-primary: #3b82f6;
|
|
113
|
+
--color-primary-hover: #2563eb;
|
|
114
|
+
--color-primary-active: #1d4ed8;
|
|
115
|
+
--color-primary-foreground: #ffffff;
|
|
116
|
+
--color-secondary: #6366f1;
|
|
117
|
+
--color-secondary-hover: #4f46e5;
|
|
118
|
+
--color-secondary-active: #4338ca;
|
|
119
|
+
--color-secondary-foreground: #ffffff;
|
|
120
|
+
--color-accent: #f59e0b;
|
|
121
|
+
--color-accent-hover: #d97706;
|
|
122
|
+
--color-accent-active: #b45309;
|
|
123
|
+
--color-accent-foreground: #000000;
|
|
124
|
+
--color-success: #10b981;
|
|
125
|
+
--color-success-foreground: #ffffff;
|
|
126
|
+
--color-warning: #f59e0b;
|
|
127
|
+
--color-warning-foreground: #000000;
|
|
128
|
+
--color-danger: #ef4444;
|
|
129
|
+
--color-danger-foreground: #ffffff;
|
|
130
|
+
--color-info: #3b82f6;
|
|
131
|
+
--color-info-foreground: #ffffff;
|
|
132
|
+
--color-surface: #18181b;
|
|
133
|
+
--color-border: #27272a;
|
|
134
|
+
--color-muted: #71717a;
|
|
135
|
+
--color-subtle: #3f3f46;
|
|
93
136
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
137
|
+
/* fonts */
|
|
138
|
+
--font-sans: InterVariable, Inter, system-ui, sans-serif;
|
|
139
|
+
--font-mono: JetBrains Mono, Fira Code, Consolas, monospace;
|
|
140
|
+
|
|
141
|
+
/* spacing */
|
|
142
|
+
--spacing-1: 0.25rem;
|
|
143
|
+
--spacing-2: 0.5rem;
|
|
144
|
+
--spacing-3: 0.75rem;
|
|
145
|
+
--spacing-4: 1rem;
|
|
146
|
+
--spacing-5: 1.25rem;
|
|
147
|
+
--spacing-6: 1.5rem;
|
|
148
|
+
--spacing-8: 2rem;
|
|
149
|
+
--spacing-10: 2.5rem;
|
|
150
|
+
--spacing-12: 3rem;
|
|
151
|
+
--spacing-16: 4rem;
|
|
152
|
+
|
|
153
|
+
/* breakpoints */
|
|
154
|
+
--breakpoint-sm: 40rem;
|
|
155
|
+
--breakpoint-md: 48rem;
|
|
156
|
+
--breakpoint-lg: 64rem;
|
|
157
|
+
--breakpoint-xl: 80rem;
|
|
158
|
+
--breakpoint-2xl: 96rem;
|
|
159
|
+
|
|
160
|
+
/* border radius */
|
|
161
|
+
--radius-sm: 0.25rem;
|
|
162
|
+
--radius-md: 0.5rem;
|
|
163
|
+
--radius-lg: 0.75rem;
|
|
164
|
+
--radius-xl: 1rem;
|
|
165
|
+
--radius-2xl: 1.5rem;
|
|
166
|
+
--radius-full: 9999px;
|
|
167
|
+
|
|
168
|
+
/* animations */
|
|
169
|
+
--animate-fade-in: fadeIn 0.2s ease-out;
|
|
170
|
+
--animate-fade-out: fadeOut 0.2s ease-in;
|
|
171
|
+
--animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
172
|
+
--animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
173
|
+
--animate-scale-in: scaleIn 0.2s ease-out;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@keyframes fadeIn {
|
|
177
|
+
from { opacity: 0; }
|
|
178
|
+
to { opacity: 1; }
|
|
100
179
|
}
|
|
180
|
+
@keyframes fadeOut {
|
|
181
|
+
from { opacity: 1; }
|
|
182
|
+
to { opacity: 0; }
|
|
183
|
+
}
|
|
184
|
+
@keyframes slideUp {
|
|
185
|
+
from { transform: translateY(8px); opacity: 0; }
|
|
186
|
+
to { transform: translateY(0); opacity: 1; }
|
|
187
|
+
}
|
|
188
|
+
@keyframes slideDown {
|
|
189
|
+
from { transform: translateY(-8px); opacity: 0; }
|
|
190
|
+
to { transform: translateY(0); opacity: 1; }
|
|
191
|
+
}
|
|
192
|
+
@keyframes scaleIn {
|
|
193
|
+
from { transform: scale(0.95); opacity: 0; }
|
|
194
|
+
to { transform: scale(1); opacity: 1; }
|
|
195
|
+
}`;
|
|
101
196
|
var defaultGlobalCss = `@import "tailwindcss";
|
|
102
197
|
|
|
198
|
+
@theme {
|
|
199
|
+
/* colors */
|
|
200
|
+
--color-primary: #3b82f6;
|
|
201
|
+
--color-primary-hover: #2563eb;
|
|
202
|
+
--color-primary-active: #1d4ed8;
|
|
203
|
+
--color-primary-foreground: #ffffff;
|
|
204
|
+
--color-secondary: #6366f1;
|
|
205
|
+
--color-secondary-hover: #4f46e5;
|
|
206
|
+
--color-secondary-active: #4338ca;
|
|
207
|
+
--color-secondary-foreground: #ffffff;
|
|
208
|
+
--color-accent: #f59e0b;
|
|
209
|
+
--color-accent-hover: #d97706;
|
|
210
|
+
--color-accent-active: #b45309;
|
|
211
|
+
--color-accent-foreground: #000000;
|
|
212
|
+
--color-success: #10b981;
|
|
213
|
+
--color-success-foreground: #ffffff;
|
|
214
|
+
--color-warning: #f59e0b;
|
|
215
|
+
--color-warning-foreground: #000000;
|
|
216
|
+
--color-danger: #ef4444;
|
|
217
|
+
--color-danger-foreground: #ffffff;
|
|
218
|
+
--color-info: #3b82f6;
|
|
219
|
+
--color-info-foreground: #ffffff;
|
|
220
|
+
--color-surface: #18181b;
|
|
221
|
+
--color-border: #27272a;
|
|
222
|
+
--color-muted: #71717a;
|
|
223
|
+
--color-subtle: #3f3f46;
|
|
224
|
+
|
|
225
|
+
/* fonts */
|
|
226
|
+
--font-sans: InterVariable, Inter, system-ui, sans-serif;
|
|
227
|
+
--font-mono: JetBrains Mono, Fira Code, Consolas, monospace;
|
|
228
|
+
|
|
229
|
+
/* spacing */
|
|
230
|
+
--spacing-1: 0.25rem;
|
|
231
|
+
--spacing-2: 0.5rem;
|
|
232
|
+
--spacing-3: 0.75rem;
|
|
233
|
+
--spacing-4: 1rem;
|
|
234
|
+
--spacing-5: 1.25rem;
|
|
235
|
+
--spacing-6: 1.5rem;
|
|
236
|
+
--spacing-8: 2rem;
|
|
237
|
+
--spacing-10: 2.5rem;
|
|
238
|
+
--spacing-12: 3rem;
|
|
239
|
+
--spacing-16: 4rem;
|
|
240
|
+
|
|
241
|
+
/* breakpoints */
|
|
242
|
+
--breakpoint-sm: 40rem;
|
|
243
|
+
--breakpoint-md: 48rem;
|
|
244
|
+
--breakpoint-lg: 64rem;
|
|
245
|
+
--breakpoint-xl: 80rem;
|
|
246
|
+
--breakpoint-2xl: 96rem;
|
|
247
|
+
|
|
248
|
+
/* border radius */
|
|
249
|
+
--radius-sm: 0.25rem;
|
|
250
|
+
--radius-md: 0.5rem;
|
|
251
|
+
--radius-lg: 0.75rem;
|
|
252
|
+
--radius-xl: 1rem;
|
|
253
|
+
--radius-2xl: 1.5rem;
|
|
254
|
+
--radius-full: 9999px;
|
|
255
|
+
|
|
256
|
+
/* animations */
|
|
257
|
+
--animate-fade-in: fadeIn 0.2s ease-out;
|
|
258
|
+
--animate-fade-out: fadeOut 0.2s ease-in;
|
|
259
|
+
--animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
260
|
+
--animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
261
|
+
--animate-scale-in: scaleIn 0.2s ease-out;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@keyframes fadeIn {
|
|
265
|
+
from { opacity: 0; }
|
|
266
|
+
to { opacity: 1; }
|
|
267
|
+
}
|
|
268
|
+
@keyframes fadeOut {
|
|
269
|
+
from { opacity: 1; }
|
|
270
|
+
to { opacity: 0; }
|
|
271
|
+
}
|
|
272
|
+
@keyframes slideUp {
|
|
273
|
+
from { transform: translateY(8px); opacity: 0; }
|
|
274
|
+
to { transform: translateY(0); opacity: 1; }
|
|
275
|
+
}
|
|
276
|
+
@keyframes slideDown {
|
|
277
|
+
from { transform: translateY(-8px); opacity: 0; }
|
|
278
|
+
to { transform: translateY(0); opacity: 1; }
|
|
279
|
+
}
|
|
280
|
+
@keyframes scaleIn {
|
|
281
|
+
from { transform: scale(0.95); opacity: 0; }
|
|
282
|
+
to { transform: scale(1); opacity: 1; }
|
|
283
|
+
}
|
|
284
|
+
|
|
103
285
|
/* tailwind-styled-v4 \u2014 zero-config base styles */
|
|
104
286
|
*, *::before, *::after {
|
|
105
287
|
box-sizing: border-box;
|
|
@@ -114,11 +296,121 @@ html {
|
|
|
114
296
|
body {
|
|
115
297
|
margin: 0;
|
|
116
298
|
font-family: var(--font-sans, system-ui, sans-serif);
|
|
117
|
-
background: var(--color-
|
|
299
|
+
background: var(--color-surface, #18181b);
|
|
118
300
|
color: var(--color-foreground, #fafafa);
|
|
119
301
|
}
|
|
120
302
|
`;
|
|
303
|
+
function generateTailwindCss(contentPaths = STANDARD_CONTENT_PATHS) {
|
|
304
|
+
return `@import "tailwindcss";
|
|
305
|
+
|
|
306
|
+
@theme {
|
|
307
|
+
/* colors */
|
|
308
|
+
--color-primary: #3b82f6;
|
|
309
|
+
--color-primary-hover: #2563eb;
|
|
310
|
+
--color-primary-active: #1d4ed8;
|
|
311
|
+
--color-primary-foreground: #ffffff;
|
|
312
|
+
--color-secondary: #6366f1;
|
|
313
|
+
--color-secondary-hover: #4f46e5;
|
|
314
|
+
--color-secondary-active: #4338ca;
|
|
315
|
+
--color-secondary-foreground: #ffffff;
|
|
316
|
+
--color-accent: #f59e0b;
|
|
317
|
+
--color-accent-hover: #d97706;
|
|
318
|
+
--color-accent-active: #b45309;
|
|
319
|
+
--color-accent-foreground: #000000;
|
|
320
|
+
--color-success: #10b981;
|
|
321
|
+
--color-success-foreground: #ffffff;
|
|
322
|
+
--color-warning: #f59e0b;
|
|
323
|
+
--color-warning-foreground: #000000;
|
|
324
|
+
--color-danger: #ef4444;
|
|
325
|
+
--color-danger-foreground: #ffffff;
|
|
326
|
+
--color-info: #3b82f6;
|
|
327
|
+
--color-info-foreground: #ffffff;
|
|
328
|
+
--color-surface: #18181b;
|
|
329
|
+
--color-border: #27272a;
|
|
330
|
+
--color-muted: #71717a;
|
|
331
|
+
--color-subtle: #3f3f46;
|
|
332
|
+
|
|
333
|
+
/* fonts */
|
|
334
|
+
--font-sans: InterVariable, Inter, system-ui, sans-serif;
|
|
335
|
+
--font-mono: JetBrains Mono, Fira Code, Consolas, monospace;
|
|
336
|
+
|
|
337
|
+
/* spacing */
|
|
338
|
+
--spacing-1: 0.25rem;
|
|
339
|
+
--spacing-2: 0.5rem;
|
|
340
|
+
--spacing-3: 0.75rem;
|
|
341
|
+
--spacing-4: 1rem;
|
|
342
|
+
--spacing-5: 1.25rem;
|
|
343
|
+
--spacing-6: 1.5rem;
|
|
344
|
+
--spacing-8: 2rem;
|
|
345
|
+
--spacing-10: 2.5rem;
|
|
346
|
+
--spacing-12: 3rem;
|
|
347
|
+
--spacing-16: 4rem;
|
|
348
|
+
|
|
349
|
+
/* breakpoints */
|
|
350
|
+
--breakpoint-sm: 40rem;
|
|
351
|
+
--breakpoint-md: 48rem;
|
|
352
|
+
--breakpoint-lg: 64rem;
|
|
353
|
+
--breakpoint-xl: 80rem;
|
|
354
|
+
--breakpoint-2xl: 96rem;
|
|
355
|
+
|
|
356
|
+
/* border radius */
|
|
357
|
+
--radius-sm: 0.25rem;
|
|
358
|
+
--radius-md: 0.5rem;
|
|
359
|
+
--radius-lg: 0.75rem;
|
|
360
|
+
--radius-xl: 1rem;
|
|
361
|
+
--radius-2xl: 1.5rem;
|
|
362
|
+
--radius-full: 9999px;
|
|
363
|
+
|
|
364
|
+
/* animations */
|
|
365
|
+
--animate-fade-in: fadeIn 0.2s ease-out;
|
|
366
|
+
--animate-fade-out: fadeOut 0.2s ease-in;
|
|
367
|
+
--animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
368
|
+
--animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
369
|
+
--animate-scale-in: scaleIn 0.2s ease-out;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
@keyframes fadeIn {
|
|
373
|
+
from { opacity: 0; }
|
|
374
|
+
to { opacity: 1; }
|
|
375
|
+
}
|
|
376
|
+
@keyframes fadeOut {
|
|
377
|
+
from { opacity: 1; }
|
|
378
|
+
to { opacity: 0; }
|
|
379
|
+
}
|
|
380
|
+
@keyframes slideUp {
|
|
381
|
+
from { transform: translateY(8px); opacity: 0; }
|
|
382
|
+
to { transform: translateY(0); opacity: 1; }
|
|
383
|
+
}
|
|
384
|
+
@keyframes slideDown {
|
|
385
|
+
from { transform: translateY(-8px); opacity: 0; }
|
|
386
|
+
to { transform: translateY(0); opacity: 1; }
|
|
387
|
+
}
|
|
388
|
+
@keyframes scaleIn {
|
|
389
|
+
from { transform: scale(0.95); opacity: 0; }
|
|
390
|
+
to { transform: scale(1); opacity: 1; }
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
@source ${contentPaths.join("\n@source ")}
|
|
394
|
+
`;
|
|
395
|
+
}
|
|
396
|
+
function generateTailwindConfig(safelistPath = ".tailwind-styled-safelist.json", contentPaths = STANDARD_CONTENT_PATHS) {
|
|
397
|
+
return `import type { Config } from "tailwindcss"
|
|
398
|
+
import { defaultPreset } from "tailwind-styled-v4/preset"
|
|
399
|
+
|
|
400
|
+
// Auto-generated safelist dari tailwind-styled-v4 compiler
|
|
401
|
+
const safelist = (() => {
|
|
402
|
+
try { return require(${JSON.stringify(safelistPath)}) as string[] }
|
|
403
|
+
catch { return [] }
|
|
404
|
+
})()
|
|
405
|
+
|
|
406
|
+
export default {
|
|
407
|
+
presets: [defaultPreset],
|
|
408
|
+
content: ${JSON.stringify(contentPaths, null, 2)},
|
|
409
|
+
safelist,
|
|
410
|
+
} satisfies Config
|
|
411
|
+
`;
|
|
412
|
+
}
|
|
121
413
|
|
|
122
|
-
export { defaultGlobalCss, defaultPreset, designTokens, generateTailwindConfig };
|
|
414
|
+
export { defaultGlobalCss, defaultPreset, defaultThemeCss, designTokens, generateTailwindConfig, generateTailwindCss };
|
|
123
415
|
//# sourceMappingURL=preset.js.map
|
|
124
416
|
//# sourceMappingURL=preset.js.map
|
package/dist/preset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../preset/src/defaultPreset.ts"],"names":[],"mappings":";;;AAuBA,IAAM,sBAAA,GAAyB;AAAA;AAAA,EAE7B,gCAAA;AAAA,EACA,gCAAA;AAAA,EACA,kCAAA;AAAA,EACA,uCAAA;AAAA;AAAA,EAEA,4BAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAEA;AACF,CAAA;AAMO,IAAM,YAAA,GAAe;AAAA,EAC1B,MAAA,EAAQ;AAAA;AAAA,IAEN,OAAA,EAAS,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA,IAC1F,SAAA,EAAW,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA,IAC5F,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA;AAAA,IAEzF,OAAA,EAAS,EAAE,OAAA,EAAS,SAAA,EAAW,YAAY,SAAA,EAAU;AAAA,IACrD,OAAA,EAAS,EAAE,OAAA,EAAS,SAAA,EAAW,YAAY,SAAA,EAAU;AAAA,IACrD,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,YAAY,SAAA,EAAU;AAAA,IACpD,IAAA,EAAM,EAAE,OAAA,EAAS,SAAA,EAAW,YAAY,SAAA,EAAU;AAAA;AAAA,IAElD,OAAA,EAAS,SAAA;AAAA,IACT,MAAA,EAAQ,SAAA;AAAA,IACR,KAAA,EAAO,SAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EAEA,U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AS;AAAA,MACP,IAAA,EAAM,EAAE,SAAA,EAAW,aAAA,EAAe,SAAS,GAAA,EAAI;AAAA,MAC/C,EAAA,EAAI,EAAE,SAAA,EAAW,UAAA,EAAY,SAAS,GAAA;AAAI;AAC5C;AAEJ;AAMO,IAAM,aAAA,GAAgB;AAAA,EAC3B,OAAA,EAAS,sBAAA;AAAA,EAET,QAAA,EAAU,OAAA;AAAA,EAEV,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,QAAQ,YAAA,CAAa,MAAA;AAAA,MACrB,YAAY,YAAA,CAAa,UAAA;AAAA,MACzB,cAAc,YAAA,CAAa,YAAA;AAAA,MAC3B,WAAW,YAAA,CAAa,SAAA;AAAA,MACxB,WAAW,YAAA,CAAa;AAAA;AAC1B,GACF;AAAA,EAEA,SAAS;AACX;AAOO,SAAS,sBAAA,CACd,YAAA,GAAe,gCAAA,EACf,YAAA,GAAe,sBAAA,EACP;AACR,EAAA,OAAO,CAAA;AAAA;;AAAA;AAAA;AAAA,uBAAA,EAKgB,IAAA,CAAK,SAAA,CAAU,YAAY,CAAC,CAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,WAAA,EAMxC,IAAA,CAAK,SAAA,CAAU,YAAA,EAAc,IAAA,EAAM,CAAC,CAAC,CAAA;AAAA;AAAA;AAAA,CAAA;AAIlD;AAMO,IAAM,gBAAA,GAAmB,CAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","file":"preset.js","sourcesContent":["/**\n * tailwind-styled-v4 — Default Preset\n *\n * Tailwind config built-in yang dipakai ketika developer tidak punya\n * tailwind.config.ts / tailwind.config.js di project mereka.\n *\n * Developer tidak perlu setup apapun:\n * npm install tailwind-styled-v4\n * → langsung bisa tw.div`p-4 bg-blue-500`\n *\n * Preset ini juga menyediakan design tokens yang consistent\n * untuk semua project yang pakai tailwind-styled-v4.\n *\n * Override per-project:\n * // tailwind.config.ts\n * import { defaultPreset } from \"tailwind-styled-v4/preset\"\n * export default { presets: [defaultPreset], theme: { extend: {...} } }\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Content paths — auto-detect berdasarkan project structure\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst STANDARD_CONTENT_PATHS = [\n // Next.js App Router\n \"./src/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./app/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./pages/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./components/**/*.{tsx,ts,jsx,js,mdx}\",\n // Vite / React\n \"./src/**/*.{tsx,ts,jsx,js}\",\n \"./index.html\",\n // Monorepo\n \"../../packages/**/src/**/*.{tsx,ts,jsx,js}\",\n]\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Design tokens — consistent across all tailwind-styled-v4 projects\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const designTokens = {\n colors: {\n // Brand\n primary: { DEFAULT: \"#3b82f6\", hover: \"#2563eb\", active: \"#1d4ed8\", foreground: \"#ffffff\" },\n secondary: { DEFAULT: \"#6366f1\", hover: \"#4f46e5\", active: \"#4338ca\", foreground: \"#ffffff\" },\n accent: { DEFAULT: \"#f59e0b\", hover: \"#d97706\", active: \"#b45309\", foreground: \"#000000\" },\n // Semantic\n success: { DEFAULT: \"#10b981\", foreground: \"#ffffff\" },\n warning: { DEFAULT: \"#f59e0b\", foreground: \"#000000\" },\n danger: { DEFAULT: \"#ef4444\", foreground: \"#ffffff\" },\n info: { DEFAULT: \"#3b82f6\", foreground: \"#ffffff\" },\n // Neutral\n surface: \"#18181b\",\n border: \"#27272a\",\n muted: \"#71717a\",\n subtle: \"#3f3f46\",\n },\n\n fontFamily: {\n sans: [\"InterVariable\", \"Inter\", \"system-ui\", \"sans-serif\"],\n mono: [\"JetBrains Mono\", \"Fira Code\", \"Consolas\", \"monospace\"],\n },\n\n borderRadius: {\n sm: \"0.25rem\",\n DEFAULT: \"0.5rem\",\n md: \"0.5rem\",\n lg: \"0.75rem\",\n xl: \"1rem\",\n \"2xl\": \"1.5rem\",\n full: \"9999px\",\n },\n\n animation: {\n \"fade-in\": \"fadeIn 0.2s ease-out\",\n \"fade-out\": \"fadeOut 0.2s ease-in\",\n \"slide-up\": \"slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"slide-down\": \"slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"scale-in\": \"scaleIn 0.2s ease-out\",\n },\n\n keyframes: {\n fadeIn: { from: { opacity: \"0\" }, to: { opacity: \"1\" } },\n fadeOut: { from: { opacity: \"1\" }, to: { opacity: \"0\" } },\n slideUp: {\n from: { transform: \"translateY(8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n slideDown: {\n from: { transform: \"translateY(-8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n scaleIn: {\n from: { transform: \"scale(0.95)\", opacity: \"0\" },\n to: { transform: \"scale(1)\", opacity: \"1\" },\n },\n },\n} as const\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Tailwind Config — dipakai sebagai fallback + preset\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultPreset = {\n content: STANDARD_CONTENT_PATHS,\n\n darkMode: \"class\" as const,\n\n theme: {\n extend: {\n colors: designTokens.colors,\n fontFamily: designTokens.fontFamily,\n borderRadius: designTokens.borderRadius,\n animation: designTokens.animation,\n keyframes: designTokens.keyframes,\n },\n },\n\n plugins: [],\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config tailwind.config.ts generator\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindConfig(\n safelistPath = \".tailwind-styled-safelist.json\",\n contentPaths = STANDARD_CONTENT_PATHS\n): string {\n return `import type { Config } from \"tailwindcss\"\nimport { defaultPreset } from \"tailwind-styled-v4/preset\"\n\n// Auto-generated safelist dari tailwind-styled-v4 compiler\nconst safelist = (() => {\n try { return require(${JSON.stringify(safelistPath)}) as string[] }\n catch { return [] }\n})()\n\nexport default {\n presets: [defaultPreset],\n content: ${JSON.stringify(contentPaths, null, 2)},\n safelist,\n} satisfies Config\n`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config globals.css — tidak perlu @tailwind base dll\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultGlobalCss = `@import \"tailwindcss\";\n\n/* tailwind-styled-v4 — zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-background, #09090b);\n color: var(--color-foreground, #fafafa);\n}\n`\n"]}
|
|
1
|
+
{"version":3,"sources":["../../preset/src/defaultPreset.ts"],"names":[],"mappings":";;;;;AAuBA,IAAM,sBAAA,GAAyB;AAAA;AAAA,EAE7B,gCAAA;AAAA,EACA,gCAAA;AAAA,EACA,kCAAA;AAAA,EACA,uCAAA;AAAA;AAAA,EAEA,4BAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAEA;AACF,CAAA;AAMO,IAAM,YAAA,GAAe;AAAA,EAC1B,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA,IAC1F,SAAA,EAAW,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA,IAC5F,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AA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preset.js","sourcesContent":["/**\n * tailwind-styled-v4 — Default Preset\n *\n * Tailwind config built-in yang dipakai ketika developer tidak punya\n * tailwind.config.ts / tailwind.config.js di project mereka.\n *\n * Developer tidak perlu setup apapun:\n * npm install tailwind-styled-v4\n * → langsung bisa tw.div`p-4 bg-blue-500`\n *\n * Preset ini juga menyediakan design tokens yang consistent\n * untuk semua project yang pakai tailwind-styled-v4.\n *\n * Override per-project:\n * // tailwind.config.ts\n * import { defaultPreset } from \"tailwind-styled-v4/preset\"\n * export default { presets: [defaultPreset], theme: { extend: {...} } }\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Content paths — auto-detect berdasarkan project structure\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst STANDARD_CONTENT_PATHS = [\n // Next.js App Router\n \"./src/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./app/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./pages/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./components/**/*.{tsx,ts,jsx,js,mdx}\",\n // Vite / React\n \"./src/**/*.{tsx,ts,jsx,js}\",\n \"./index.html\",\n // Monorepo\n \"../../packages/**/src/**/*.{tsx,ts,jsx,js}\",\n]\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Design tokens — consistent across all tailwind-styled-v4 projects\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const designTokens = {\n colors: {\n primary: { DEFAULT: \"#3b82f6\", hover: \"#2563eb\", active: \"#1d4ed8\", foreground: \"#ffffff\" },\n secondary: { DEFAULT: \"#6366f1\", hover: \"#4f46e5\", active: \"#4338ca\", foreground: \"#ffffff\" },\n accent: { DEFAULT: \"#f59e0b\", hover: \"#d97706\", active: \"#b45309\", foreground: \"#000000\" },\n success: { DEFAULT: \"#10b981\", foreground: \"#ffffff\" },\n warning: { DEFAULT: \"#f59e0b\", foreground: \"#000000\" },\n danger: { DEFAULT: \"#ef4444\", foreground: \"#ffffff\" },\n info: { DEFAULT: \"#3b82f6\", foreground: \"#ffffff\" },\n surface: \"#18181b\",\n border: \"#27272a\",\n muted: \"#71717a\",\n subtle: \"#3f3f46\",\n },\n\n spacing: {\n 1: \"0.25rem\",\n 2: \"0.5rem\",\n 3: \"0.75rem\",\n 4: \"1rem\",\n 5: \"1.25rem\",\n 6: \"1.5rem\",\n 8: \"2rem\",\n 10: \"2.5rem\",\n 12: \"3rem\",\n 16: \"4rem\",\n },\n\n breakpoints: {\n sm: \"40rem\",\n md: \"48rem\",\n lg: \"64rem\",\n xl: \"80rem\",\n \"2xl\": \"96rem\",\n },\n\n fontWeight: {\n normal: \"400\",\n medium: \"500\",\n semibold: \"600\",\n bold: \"700\",\n },\n\n fontFamily: {\n sans: [\"InterVariable\", \"Inter\", \"system-ui\", \"sans-serif\"],\n mono: [\"JetBrains Mono\", \"Fira Code\", \"Consolas\", \"monospace\"],\n },\n\n borderRadius: {\n sm: \"0.25rem\",\n DEFAULT: \"0.5rem\",\n md: \"0.5rem\",\n lg: \"0.75rem\",\n xl: \"1rem\",\n \"2xl\": \"1.5rem\",\n full: \"9999px\",\n },\n\n animation: {\n \"fade-in\": \"fadeIn 0.2s ease-out\",\n \"fade-out\": \"fadeOut 0.2s ease-in\",\n \"slide-up\": \"slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"slide-down\": \"slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"scale-in\": \"scaleIn 0.2s ease-out\",\n },\n\n keyframes: {\n fadeIn: { from: { opacity: \"0\" }, to: { opacity: \"1\" } },\n fadeOut: { from: { opacity: \"1\" }, to: { opacity: \"0\" } },\n slideUp: {\n from: { transform: \"translateY(8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n slideDown: {\n from: { transform: \"translateY(-8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n scaleIn: {\n from: { transform: \"scale(0.95)\", opacity: \"0\" },\n to: { transform: \"scale(1)\", opacity: \"1\" },\n },\n },\n} as const\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Tailwind Config — dipakai sebagai fallback + preset\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultPreset = {\n content: STANDARD_CONTENT_PATHS,\n\n darkMode: \"class\" as const,\n\n theme: {\n extend: {\n colors: designTokens.colors,\n fontFamily: designTokens.fontFamily,\n borderRadius: designTokens.borderRadius,\n animation: designTokens.animation,\n keyframes: designTokens.keyframes,\n },\n },\n\n plugins: [],\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Theme CSS — Tailwind v4 @theme block\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultThemeCss = `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}`\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config globals.css — tidak perlu @tailwind base dll\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultGlobalCss = `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n/* tailwind-styled-v4 — zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-surface, #18181b);\n color: var(--color-foreground, #fafafa);\n}\n`\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config Tailwind v4 CSS generator\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindCss(contentPaths = STANDARD_CONTENT_PATHS): string {\n return `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n@source ${contentPaths.join(\"\\n@source \")}\n`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config tailwind.config.ts generator\n// DEPRECATED: Use generateTailwindCss for Tailwind v4 instead\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindConfig(\n safelistPath = \".tailwind-styled-safelist.json\",\n contentPaths = STANDARD_CONTENT_PATHS\n): string {\n return `import type { Config } from \"tailwindcss\"\nimport { defaultPreset } from \"tailwind-styled-v4/preset\"\n\n// Auto-generated safelist dari tailwind-styled-v4 compiler\nconst safelist = (() => {\n try { return require(${JSON.stringify(safelistPath)}) as string[] }\n catch { return [] }\n})()\n\nexport default {\n presets: [defaultPreset],\n content: ${JSON.stringify(contentPaths, null, 2)},\n safelist,\n} satisfies Config\n`\n}\n"]}
|