tailwind-styled-v4 1.0.0 → 4.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 +252 -0
- package/dist/animate.cjs.map +1 -0
- package/dist/animate.d.cts +117 -0
- package/dist/animate.d.ts +117 -0
- package/dist/animate.js +245 -0
- package/dist/animate.js.map +1 -0
- package/dist/astTransform-ua-eapqs.d.cts +41 -0
- package/dist/astTransform-ua-eapqs.d.ts +41 -0
- package/dist/compiler.cjs +3594 -0
- package/dist/compiler.cjs.map +1 -0
- package/dist/compiler.d.cts +716 -0
- package/dist/compiler.d.ts +716 -0
- package/dist/compiler.js +3535 -0
- package/dist/compiler.js.map +1 -0
- package/dist/css.cjs +71 -0
- package/dist/css.cjs.map +1 -0
- package/dist/css.d.cts +45 -0
- package/dist/css.d.ts +45 -0
- package/dist/css.js +62 -0
- package/dist/css.js.map +1 -0
- package/dist/devtools.cjs +959 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.cts +22 -0
- package/dist/devtools.d.ts +22 -0
- package/dist/devtools.js +952 -0
- package/dist/devtools.js.map +1 -0
- package/dist/index.cjs +1058 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +584 -0
- package/dist/index.d.ts +456 -958
- package/dist/index.js +1021 -8
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +268 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +45 -0
- package/dist/next.d.ts +45 -0
- package/dist/next.js +261 -0
- package/dist/next.js.map +1 -0
- package/dist/plugins.cjs +396 -0
- package/dist/plugins.cjs.map +1 -0
- package/dist/plugins.d.cts +231 -0
- package/dist/plugins.d.ts +231 -0
- package/dist/plugins.js +381 -0
- package/dist/plugins.js.map +1 -0
- package/dist/preset.cjs +129 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.d.cts +249 -0
- package/dist/preset.d.ts +249 -0
- package/dist/preset.js +124 -0
- package/dist/preset.js.map +1 -0
- package/dist/theme.cjs +154 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +181 -0
- package/dist/theme.d.ts +181 -0
- package/dist/theme.js +148 -0
- package/dist/theme.js.map +1 -0
- package/dist/turbopackLoader.cjs +2689 -0
- package/dist/turbopackLoader.cjs.map +1 -0
- package/dist/turbopackLoader.d.cts +22 -0
- package/dist/turbopackLoader.d.ts +22 -0
- package/dist/turbopackLoader.js +2681 -0
- package/dist/turbopackLoader.js.map +1 -0
- package/dist/vite.cjs +105 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.cts +22 -0
- package/dist/vite.d.ts +22 -0
- package/dist/vite.js +96 -0
- package/dist/vite.js.map +1 -0
- package/dist/webpackLoader.cjs +2670 -0
- package/dist/webpackLoader.cjs.map +1 -0
- package/dist/webpackLoader.d.cts +24 -0
- package/dist/webpackLoader.d.ts +24 -0
- package/dist/webpackLoader.js +2662 -0
- package/dist/webpackLoader.js.map +1 -0
- package/package.json +66 -90
- package/CHANGELOG.md +0 -75
- package/LICENSE +0 -21
- package/README.md +0 -330
- package/dist/compiler/index.d.mts +0 -214
- package/dist/compiler/index.d.ts +0 -214
- package/dist/compiler/index.js +0 -546
- package/dist/compiler/index.js.map +0 -1
- package/dist/compiler/index.mjs +0 -504
- package/dist/compiler/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -1086
- package/dist/index.mjs +0 -9
- package/dist/index.mjs.map +0 -1
- package/dist/turbopack-loader.js +0 -232
- package/dist/webpack-loader.js +0 -213
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tailwind-styled-v4 — Default Preset
|
|
3
|
+
*
|
|
4
|
+
* Tailwind config built-in yang dipakai ketika developer tidak punya
|
|
5
|
+
* tailwind.config.ts / tailwind.config.js di project mereka.
|
|
6
|
+
*
|
|
7
|
+
* Developer tidak perlu setup apapun:
|
|
8
|
+
* npm install tailwind-styled-v4
|
|
9
|
+
* → langsung bisa tw.div`p-4 bg-blue-500`
|
|
10
|
+
*
|
|
11
|
+
* Preset ini juga menyediakan design tokens yang consistent
|
|
12
|
+
* untuk semua project yang pakai tailwind-styled-v4.
|
|
13
|
+
*
|
|
14
|
+
* Override per-project:
|
|
15
|
+
* // tailwind.config.ts
|
|
16
|
+
* import { defaultPreset } from "tailwind-styled-v4/preset"
|
|
17
|
+
* export default { presets: [defaultPreset], theme: { extend: {...} } }
|
|
18
|
+
*/
|
|
19
|
+
declare const designTokens: {
|
|
20
|
+
readonly colors: {
|
|
21
|
+
readonly primary: {
|
|
22
|
+
readonly DEFAULT: "#3b82f6";
|
|
23
|
+
readonly hover: "#2563eb";
|
|
24
|
+
readonly active: "#1d4ed8";
|
|
25
|
+
readonly foreground: "#ffffff";
|
|
26
|
+
};
|
|
27
|
+
readonly secondary: {
|
|
28
|
+
readonly DEFAULT: "#6366f1";
|
|
29
|
+
readonly hover: "#4f46e5";
|
|
30
|
+
readonly active: "#4338ca";
|
|
31
|
+
readonly foreground: "#ffffff";
|
|
32
|
+
};
|
|
33
|
+
readonly accent: {
|
|
34
|
+
readonly DEFAULT: "#f59e0b";
|
|
35
|
+
readonly hover: "#d97706";
|
|
36
|
+
readonly active: "#b45309";
|
|
37
|
+
readonly foreground: "#000000";
|
|
38
|
+
};
|
|
39
|
+
readonly success: {
|
|
40
|
+
readonly DEFAULT: "#10b981";
|
|
41
|
+
readonly foreground: "#ffffff";
|
|
42
|
+
};
|
|
43
|
+
readonly warning: {
|
|
44
|
+
readonly DEFAULT: "#f59e0b";
|
|
45
|
+
readonly foreground: "#000000";
|
|
46
|
+
};
|
|
47
|
+
readonly danger: {
|
|
48
|
+
readonly DEFAULT: "#ef4444";
|
|
49
|
+
readonly foreground: "#ffffff";
|
|
50
|
+
};
|
|
51
|
+
readonly info: {
|
|
52
|
+
readonly DEFAULT: "#3b82f6";
|
|
53
|
+
readonly foreground: "#ffffff";
|
|
54
|
+
};
|
|
55
|
+
readonly surface: "#18181b";
|
|
56
|
+
readonly border: "#27272a";
|
|
57
|
+
readonly muted: "#71717a";
|
|
58
|
+
readonly subtle: "#3f3f46";
|
|
59
|
+
};
|
|
60
|
+
readonly fontFamily: {
|
|
61
|
+
readonly sans: readonly ["InterVariable", "Inter", "system-ui", "sans-serif"];
|
|
62
|
+
readonly mono: readonly ["JetBrains Mono", "Fira Code", "Consolas", "monospace"];
|
|
63
|
+
};
|
|
64
|
+
readonly borderRadius: {
|
|
65
|
+
readonly sm: "0.25rem";
|
|
66
|
+
readonly DEFAULT: "0.5rem";
|
|
67
|
+
readonly md: "0.5rem";
|
|
68
|
+
readonly lg: "0.75rem";
|
|
69
|
+
readonly xl: "1rem";
|
|
70
|
+
readonly "2xl": "1.5rem";
|
|
71
|
+
readonly full: "9999px";
|
|
72
|
+
};
|
|
73
|
+
readonly animation: {
|
|
74
|
+
readonly "fade-in": "fadeIn 0.2s ease-out";
|
|
75
|
+
readonly "fade-out": "fadeOut 0.2s ease-in";
|
|
76
|
+
readonly "slide-up": "slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
77
|
+
readonly "slide-down": "slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
78
|
+
readonly "scale-in": "scaleIn 0.2s ease-out";
|
|
79
|
+
};
|
|
80
|
+
readonly keyframes: {
|
|
81
|
+
readonly fadeIn: {
|
|
82
|
+
readonly from: {
|
|
83
|
+
readonly opacity: "0";
|
|
84
|
+
};
|
|
85
|
+
readonly to: {
|
|
86
|
+
readonly opacity: "1";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly fadeOut: {
|
|
90
|
+
readonly from: {
|
|
91
|
+
readonly opacity: "1";
|
|
92
|
+
};
|
|
93
|
+
readonly to: {
|
|
94
|
+
readonly opacity: "0";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
readonly slideUp: {
|
|
98
|
+
readonly from: {
|
|
99
|
+
readonly transform: "translateY(8px)";
|
|
100
|
+
readonly opacity: "0";
|
|
101
|
+
};
|
|
102
|
+
readonly to: {
|
|
103
|
+
readonly transform: "translateY(0)";
|
|
104
|
+
readonly opacity: "1";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
readonly slideDown: {
|
|
108
|
+
readonly from: {
|
|
109
|
+
readonly transform: "translateY(-8px)";
|
|
110
|
+
readonly opacity: "0";
|
|
111
|
+
};
|
|
112
|
+
readonly to: {
|
|
113
|
+
readonly transform: "translateY(0)";
|
|
114
|
+
readonly opacity: "1";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly scaleIn: {
|
|
118
|
+
readonly from: {
|
|
119
|
+
readonly transform: "scale(0.95)";
|
|
120
|
+
readonly opacity: "0";
|
|
121
|
+
};
|
|
122
|
+
readonly to: {
|
|
123
|
+
readonly transform: "scale(1)";
|
|
124
|
+
readonly opacity: "1";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
declare const defaultPreset: {
|
|
130
|
+
content: string[];
|
|
131
|
+
darkMode: "class";
|
|
132
|
+
theme: {
|
|
133
|
+
extend: {
|
|
134
|
+
colors: {
|
|
135
|
+
readonly primary: {
|
|
136
|
+
readonly DEFAULT: "#3b82f6";
|
|
137
|
+
readonly hover: "#2563eb";
|
|
138
|
+
readonly active: "#1d4ed8";
|
|
139
|
+
readonly foreground: "#ffffff";
|
|
140
|
+
};
|
|
141
|
+
readonly secondary: {
|
|
142
|
+
readonly DEFAULT: "#6366f1";
|
|
143
|
+
readonly hover: "#4f46e5";
|
|
144
|
+
readonly active: "#4338ca";
|
|
145
|
+
readonly foreground: "#ffffff";
|
|
146
|
+
};
|
|
147
|
+
readonly accent: {
|
|
148
|
+
readonly DEFAULT: "#f59e0b";
|
|
149
|
+
readonly hover: "#d97706";
|
|
150
|
+
readonly active: "#b45309";
|
|
151
|
+
readonly foreground: "#000000";
|
|
152
|
+
};
|
|
153
|
+
readonly success: {
|
|
154
|
+
readonly DEFAULT: "#10b981";
|
|
155
|
+
readonly foreground: "#ffffff";
|
|
156
|
+
};
|
|
157
|
+
readonly warning: {
|
|
158
|
+
readonly DEFAULT: "#f59e0b";
|
|
159
|
+
readonly foreground: "#000000";
|
|
160
|
+
};
|
|
161
|
+
readonly danger: {
|
|
162
|
+
readonly DEFAULT: "#ef4444";
|
|
163
|
+
readonly foreground: "#ffffff";
|
|
164
|
+
};
|
|
165
|
+
readonly info: {
|
|
166
|
+
readonly DEFAULT: "#3b82f6";
|
|
167
|
+
readonly foreground: "#ffffff";
|
|
168
|
+
};
|
|
169
|
+
readonly surface: "#18181b";
|
|
170
|
+
readonly border: "#27272a";
|
|
171
|
+
readonly muted: "#71717a";
|
|
172
|
+
readonly subtle: "#3f3f46";
|
|
173
|
+
};
|
|
174
|
+
fontFamily: {
|
|
175
|
+
readonly sans: readonly ["InterVariable", "Inter", "system-ui", "sans-serif"];
|
|
176
|
+
readonly mono: readonly ["JetBrains Mono", "Fira Code", "Consolas", "monospace"];
|
|
177
|
+
};
|
|
178
|
+
borderRadius: {
|
|
179
|
+
readonly sm: "0.25rem";
|
|
180
|
+
readonly DEFAULT: "0.5rem";
|
|
181
|
+
readonly md: "0.5rem";
|
|
182
|
+
readonly lg: "0.75rem";
|
|
183
|
+
readonly xl: "1rem";
|
|
184
|
+
readonly "2xl": "1.5rem";
|
|
185
|
+
readonly full: "9999px";
|
|
186
|
+
};
|
|
187
|
+
animation: {
|
|
188
|
+
readonly "fade-in": "fadeIn 0.2s ease-out";
|
|
189
|
+
readonly "fade-out": "fadeOut 0.2s ease-in";
|
|
190
|
+
readonly "slide-up": "slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
191
|
+
readonly "slide-down": "slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
192
|
+
readonly "scale-in": "scaleIn 0.2s ease-out";
|
|
193
|
+
};
|
|
194
|
+
keyframes: {
|
|
195
|
+
readonly fadeIn: {
|
|
196
|
+
readonly from: {
|
|
197
|
+
readonly opacity: "0";
|
|
198
|
+
};
|
|
199
|
+
readonly to: {
|
|
200
|
+
readonly opacity: "1";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly fadeOut: {
|
|
204
|
+
readonly from: {
|
|
205
|
+
readonly opacity: "1";
|
|
206
|
+
};
|
|
207
|
+
readonly to: {
|
|
208
|
+
readonly opacity: "0";
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
readonly slideUp: {
|
|
212
|
+
readonly from: {
|
|
213
|
+
readonly transform: "translateY(8px)";
|
|
214
|
+
readonly opacity: "0";
|
|
215
|
+
};
|
|
216
|
+
readonly to: {
|
|
217
|
+
readonly transform: "translateY(0)";
|
|
218
|
+
readonly opacity: "1";
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
readonly slideDown: {
|
|
222
|
+
readonly from: {
|
|
223
|
+
readonly transform: "translateY(-8px)";
|
|
224
|
+
readonly opacity: "0";
|
|
225
|
+
};
|
|
226
|
+
readonly to: {
|
|
227
|
+
readonly transform: "translateY(0)";
|
|
228
|
+
readonly opacity: "1";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
readonly scaleIn: {
|
|
232
|
+
readonly from: {
|
|
233
|
+
readonly transform: "scale(0.95)";
|
|
234
|
+
readonly opacity: "0";
|
|
235
|
+
};
|
|
236
|
+
readonly to: {
|
|
237
|
+
readonly transform: "scale(1)";
|
|
238
|
+
readonly opacity: "1";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
plugins: never[];
|
|
245
|
+
};
|
|
246
|
+
declare function generateTailwindConfig(safelistPath?: string, contentPaths?: string[]): string;
|
|
247
|
+
declare const defaultGlobalCss = "@import \"tailwindcss\";\n\n/* tailwind-styled-v4 \u2014 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";
|
|
248
|
+
|
|
249
|
+
export { defaultGlobalCss, defaultPreset, designTokens, generateTailwindConfig };
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tailwind-styled-v4 — Default Preset
|
|
3
|
+
*
|
|
4
|
+
* Tailwind config built-in yang dipakai ketika developer tidak punya
|
|
5
|
+
* tailwind.config.ts / tailwind.config.js di project mereka.
|
|
6
|
+
*
|
|
7
|
+
* Developer tidak perlu setup apapun:
|
|
8
|
+
* npm install tailwind-styled-v4
|
|
9
|
+
* → langsung bisa tw.div`p-4 bg-blue-500`
|
|
10
|
+
*
|
|
11
|
+
* Preset ini juga menyediakan design tokens yang consistent
|
|
12
|
+
* untuk semua project yang pakai tailwind-styled-v4.
|
|
13
|
+
*
|
|
14
|
+
* Override per-project:
|
|
15
|
+
* // tailwind.config.ts
|
|
16
|
+
* import { defaultPreset } from "tailwind-styled-v4/preset"
|
|
17
|
+
* export default { presets: [defaultPreset], theme: { extend: {...} } }
|
|
18
|
+
*/
|
|
19
|
+
declare const designTokens: {
|
|
20
|
+
readonly colors: {
|
|
21
|
+
readonly primary: {
|
|
22
|
+
readonly DEFAULT: "#3b82f6";
|
|
23
|
+
readonly hover: "#2563eb";
|
|
24
|
+
readonly active: "#1d4ed8";
|
|
25
|
+
readonly foreground: "#ffffff";
|
|
26
|
+
};
|
|
27
|
+
readonly secondary: {
|
|
28
|
+
readonly DEFAULT: "#6366f1";
|
|
29
|
+
readonly hover: "#4f46e5";
|
|
30
|
+
readonly active: "#4338ca";
|
|
31
|
+
readonly foreground: "#ffffff";
|
|
32
|
+
};
|
|
33
|
+
readonly accent: {
|
|
34
|
+
readonly DEFAULT: "#f59e0b";
|
|
35
|
+
readonly hover: "#d97706";
|
|
36
|
+
readonly active: "#b45309";
|
|
37
|
+
readonly foreground: "#000000";
|
|
38
|
+
};
|
|
39
|
+
readonly success: {
|
|
40
|
+
readonly DEFAULT: "#10b981";
|
|
41
|
+
readonly foreground: "#ffffff";
|
|
42
|
+
};
|
|
43
|
+
readonly warning: {
|
|
44
|
+
readonly DEFAULT: "#f59e0b";
|
|
45
|
+
readonly foreground: "#000000";
|
|
46
|
+
};
|
|
47
|
+
readonly danger: {
|
|
48
|
+
readonly DEFAULT: "#ef4444";
|
|
49
|
+
readonly foreground: "#ffffff";
|
|
50
|
+
};
|
|
51
|
+
readonly info: {
|
|
52
|
+
readonly DEFAULT: "#3b82f6";
|
|
53
|
+
readonly foreground: "#ffffff";
|
|
54
|
+
};
|
|
55
|
+
readonly surface: "#18181b";
|
|
56
|
+
readonly border: "#27272a";
|
|
57
|
+
readonly muted: "#71717a";
|
|
58
|
+
readonly subtle: "#3f3f46";
|
|
59
|
+
};
|
|
60
|
+
readonly fontFamily: {
|
|
61
|
+
readonly sans: readonly ["InterVariable", "Inter", "system-ui", "sans-serif"];
|
|
62
|
+
readonly mono: readonly ["JetBrains Mono", "Fira Code", "Consolas", "monospace"];
|
|
63
|
+
};
|
|
64
|
+
readonly borderRadius: {
|
|
65
|
+
readonly sm: "0.25rem";
|
|
66
|
+
readonly DEFAULT: "0.5rem";
|
|
67
|
+
readonly md: "0.5rem";
|
|
68
|
+
readonly lg: "0.75rem";
|
|
69
|
+
readonly xl: "1rem";
|
|
70
|
+
readonly "2xl": "1.5rem";
|
|
71
|
+
readonly full: "9999px";
|
|
72
|
+
};
|
|
73
|
+
readonly animation: {
|
|
74
|
+
readonly "fade-in": "fadeIn 0.2s ease-out";
|
|
75
|
+
readonly "fade-out": "fadeOut 0.2s ease-in";
|
|
76
|
+
readonly "slide-up": "slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
77
|
+
readonly "slide-down": "slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
78
|
+
readonly "scale-in": "scaleIn 0.2s ease-out";
|
|
79
|
+
};
|
|
80
|
+
readonly keyframes: {
|
|
81
|
+
readonly fadeIn: {
|
|
82
|
+
readonly from: {
|
|
83
|
+
readonly opacity: "0";
|
|
84
|
+
};
|
|
85
|
+
readonly to: {
|
|
86
|
+
readonly opacity: "1";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly fadeOut: {
|
|
90
|
+
readonly from: {
|
|
91
|
+
readonly opacity: "1";
|
|
92
|
+
};
|
|
93
|
+
readonly to: {
|
|
94
|
+
readonly opacity: "0";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
readonly slideUp: {
|
|
98
|
+
readonly from: {
|
|
99
|
+
readonly transform: "translateY(8px)";
|
|
100
|
+
readonly opacity: "0";
|
|
101
|
+
};
|
|
102
|
+
readonly to: {
|
|
103
|
+
readonly transform: "translateY(0)";
|
|
104
|
+
readonly opacity: "1";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
readonly slideDown: {
|
|
108
|
+
readonly from: {
|
|
109
|
+
readonly transform: "translateY(-8px)";
|
|
110
|
+
readonly opacity: "0";
|
|
111
|
+
};
|
|
112
|
+
readonly to: {
|
|
113
|
+
readonly transform: "translateY(0)";
|
|
114
|
+
readonly opacity: "1";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly scaleIn: {
|
|
118
|
+
readonly from: {
|
|
119
|
+
readonly transform: "scale(0.95)";
|
|
120
|
+
readonly opacity: "0";
|
|
121
|
+
};
|
|
122
|
+
readonly to: {
|
|
123
|
+
readonly transform: "scale(1)";
|
|
124
|
+
readonly opacity: "1";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
declare const defaultPreset: {
|
|
130
|
+
content: string[];
|
|
131
|
+
darkMode: "class";
|
|
132
|
+
theme: {
|
|
133
|
+
extend: {
|
|
134
|
+
colors: {
|
|
135
|
+
readonly primary: {
|
|
136
|
+
readonly DEFAULT: "#3b82f6";
|
|
137
|
+
readonly hover: "#2563eb";
|
|
138
|
+
readonly active: "#1d4ed8";
|
|
139
|
+
readonly foreground: "#ffffff";
|
|
140
|
+
};
|
|
141
|
+
readonly secondary: {
|
|
142
|
+
readonly DEFAULT: "#6366f1";
|
|
143
|
+
readonly hover: "#4f46e5";
|
|
144
|
+
readonly active: "#4338ca";
|
|
145
|
+
readonly foreground: "#ffffff";
|
|
146
|
+
};
|
|
147
|
+
readonly accent: {
|
|
148
|
+
readonly DEFAULT: "#f59e0b";
|
|
149
|
+
readonly hover: "#d97706";
|
|
150
|
+
readonly active: "#b45309";
|
|
151
|
+
readonly foreground: "#000000";
|
|
152
|
+
};
|
|
153
|
+
readonly success: {
|
|
154
|
+
readonly DEFAULT: "#10b981";
|
|
155
|
+
readonly foreground: "#ffffff";
|
|
156
|
+
};
|
|
157
|
+
readonly warning: {
|
|
158
|
+
readonly DEFAULT: "#f59e0b";
|
|
159
|
+
readonly foreground: "#000000";
|
|
160
|
+
};
|
|
161
|
+
readonly danger: {
|
|
162
|
+
readonly DEFAULT: "#ef4444";
|
|
163
|
+
readonly foreground: "#ffffff";
|
|
164
|
+
};
|
|
165
|
+
readonly info: {
|
|
166
|
+
readonly DEFAULT: "#3b82f6";
|
|
167
|
+
readonly foreground: "#ffffff";
|
|
168
|
+
};
|
|
169
|
+
readonly surface: "#18181b";
|
|
170
|
+
readonly border: "#27272a";
|
|
171
|
+
readonly muted: "#71717a";
|
|
172
|
+
readonly subtle: "#3f3f46";
|
|
173
|
+
};
|
|
174
|
+
fontFamily: {
|
|
175
|
+
readonly sans: readonly ["InterVariable", "Inter", "system-ui", "sans-serif"];
|
|
176
|
+
readonly mono: readonly ["JetBrains Mono", "Fira Code", "Consolas", "monospace"];
|
|
177
|
+
};
|
|
178
|
+
borderRadius: {
|
|
179
|
+
readonly sm: "0.25rem";
|
|
180
|
+
readonly DEFAULT: "0.5rem";
|
|
181
|
+
readonly md: "0.5rem";
|
|
182
|
+
readonly lg: "0.75rem";
|
|
183
|
+
readonly xl: "1rem";
|
|
184
|
+
readonly "2xl": "1.5rem";
|
|
185
|
+
readonly full: "9999px";
|
|
186
|
+
};
|
|
187
|
+
animation: {
|
|
188
|
+
readonly "fade-in": "fadeIn 0.2s ease-out";
|
|
189
|
+
readonly "fade-out": "fadeOut 0.2s ease-in";
|
|
190
|
+
readonly "slide-up": "slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
191
|
+
readonly "slide-down": "slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
192
|
+
readonly "scale-in": "scaleIn 0.2s ease-out";
|
|
193
|
+
};
|
|
194
|
+
keyframes: {
|
|
195
|
+
readonly fadeIn: {
|
|
196
|
+
readonly from: {
|
|
197
|
+
readonly opacity: "0";
|
|
198
|
+
};
|
|
199
|
+
readonly to: {
|
|
200
|
+
readonly opacity: "1";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly fadeOut: {
|
|
204
|
+
readonly from: {
|
|
205
|
+
readonly opacity: "1";
|
|
206
|
+
};
|
|
207
|
+
readonly to: {
|
|
208
|
+
readonly opacity: "0";
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
readonly slideUp: {
|
|
212
|
+
readonly from: {
|
|
213
|
+
readonly transform: "translateY(8px)";
|
|
214
|
+
readonly opacity: "0";
|
|
215
|
+
};
|
|
216
|
+
readonly to: {
|
|
217
|
+
readonly transform: "translateY(0)";
|
|
218
|
+
readonly opacity: "1";
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
readonly slideDown: {
|
|
222
|
+
readonly from: {
|
|
223
|
+
readonly transform: "translateY(-8px)";
|
|
224
|
+
readonly opacity: "0";
|
|
225
|
+
};
|
|
226
|
+
readonly to: {
|
|
227
|
+
readonly transform: "translateY(0)";
|
|
228
|
+
readonly opacity: "1";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
readonly scaleIn: {
|
|
232
|
+
readonly from: {
|
|
233
|
+
readonly transform: "scale(0.95)";
|
|
234
|
+
readonly opacity: "0";
|
|
235
|
+
};
|
|
236
|
+
readonly to: {
|
|
237
|
+
readonly transform: "scale(1)";
|
|
238
|
+
readonly opacity: "1";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
plugins: never[];
|
|
245
|
+
};
|
|
246
|
+
declare function generateTailwindConfig(safelistPath?: string, contentPaths?: string[]): string;
|
|
247
|
+
declare const defaultGlobalCss = "@import \"tailwindcss\";\n\n/* tailwind-styled-v4 \u2014 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";
|
|
248
|
+
|
|
249
|
+
export { defaultGlobalCss, defaultPreset, designTokens, generateTailwindConfig };
|
package/dist/preset.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* tailwind-styled-v4 v4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
2
|
+
|
|
3
|
+
// ../preset/src/defaultPreset.ts
|
|
4
|
+
var STANDARD_CONTENT_PATHS = [
|
|
5
|
+
// Next.js App Router
|
|
6
|
+
"./src/**/*.{tsx,ts,jsx,js,mdx}",
|
|
7
|
+
"./app/**/*.{tsx,ts,jsx,js,mdx}",
|
|
8
|
+
"./pages/**/*.{tsx,ts,jsx,js,mdx}",
|
|
9
|
+
"./components/**/*.{tsx,ts,jsx,js,mdx}",
|
|
10
|
+
// Vite / React
|
|
11
|
+
"./src/**/*.{tsx,ts,jsx,js}",
|
|
12
|
+
"./index.html",
|
|
13
|
+
// Monorepo
|
|
14
|
+
"../../packages/**/src/**/*.{tsx,ts,jsx,js}"
|
|
15
|
+
];
|
|
16
|
+
var designTokens = {
|
|
17
|
+
colors: {
|
|
18
|
+
// Brand
|
|
19
|
+
primary: { DEFAULT: "#3b82f6", hover: "#2563eb", active: "#1d4ed8", foreground: "#ffffff" },
|
|
20
|
+
secondary: { DEFAULT: "#6366f1", hover: "#4f46e5", active: "#4338ca", foreground: "#ffffff" },
|
|
21
|
+
accent: { DEFAULT: "#f59e0b", hover: "#d97706", active: "#b45309", foreground: "#000000" },
|
|
22
|
+
// Semantic
|
|
23
|
+
success: { DEFAULT: "#10b981", foreground: "#ffffff" },
|
|
24
|
+
warning: { DEFAULT: "#f59e0b", foreground: "#000000" },
|
|
25
|
+
danger: { DEFAULT: "#ef4444", foreground: "#ffffff" },
|
|
26
|
+
info: { DEFAULT: "#3b82f6", foreground: "#ffffff" },
|
|
27
|
+
// Neutral
|
|
28
|
+
surface: "#18181b",
|
|
29
|
+
border: "#27272a",
|
|
30
|
+
muted: "#71717a",
|
|
31
|
+
subtle: "#3f3f46"
|
|
32
|
+
},
|
|
33
|
+
fontFamily: {
|
|
34
|
+
sans: ["InterVariable", "Inter", "system-ui", "sans-serif"],
|
|
35
|
+
mono: ["JetBrains Mono", "Fira Code", "Consolas", "monospace"]
|
|
36
|
+
},
|
|
37
|
+
borderRadius: {
|
|
38
|
+
sm: "0.25rem",
|
|
39
|
+
DEFAULT: "0.5rem",
|
|
40
|
+
md: "0.5rem",
|
|
41
|
+
lg: "0.75rem",
|
|
42
|
+
xl: "1rem",
|
|
43
|
+
"2xl": "1.5rem",
|
|
44
|
+
full: "9999px"
|
|
45
|
+
},
|
|
46
|
+
animation: {
|
|
47
|
+
"fade-in": "fadeIn 0.2s ease-out",
|
|
48
|
+
"fade-out": "fadeOut 0.2s ease-in",
|
|
49
|
+
"slide-up": "slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)",
|
|
50
|
+
"slide-down": "slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)",
|
|
51
|
+
"scale-in": "scaleIn 0.2s ease-out"
|
|
52
|
+
},
|
|
53
|
+
keyframes: {
|
|
54
|
+
fadeIn: { from: { opacity: "0" }, to: { opacity: "1" } },
|
|
55
|
+
fadeOut: { from: { opacity: "1" }, to: { opacity: "0" } },
|
|
56
|
+
slideUp: {
|
|
57
|
+
from: { transform: "translateY(8px)", opacity: "0" },
|
|
58
|
+
to: { transform: "translateY(0)", opacity: "1" }
|
|
59
|
+
},
|
|
60
|
+
slideDown: {
|
|
61
|
+
from: { transform: "translateY(-8px)", opacity: "0" },
|
|
62
|
+
to: { transform: "translateY(0)", opacity: "1" }
|
|
63
|
+
},
|
|
64
|
+
scaleIn: {
|
|
65
|
+
from: { transform: "scale(0.95)", opacity: "0" },
|
|
66
|
+
to: { transform: "scale(1)", opacity: "1" }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var defaultPreset = {
|
|
71
|
+
content: STANDARD_CONTENT_PATHS,
|
|
72
|
+
darkMode: "class",
|
|
73
|
+
theme: {
|
|
74
|
+
extend: {
|
|
75
|
+
colors: designTokens.colors,
|
|
76
|
+
fontFamily: designTokens.fontFamily,
|
|
77
|
+
borderRadius: designTokens.borderRadius,
|
|
78
|
+
animation: designTokens.animation,
|
|
79
|
+
keyframes: designTokens.keyframes
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
plugins: []
|
|
83
|
+
};
|
|
84
|
+
function generateTailwindConfig(safelistPath = ".tailwind-styled-safelist.json", contentPaths = STANDARD_CONTENT_PATHS) {
|
|
85
|
+
return `import type { Config } from "tailwindcss"
|
|
86
|
+
import { defaultPreset } from "tailwind-styled-v4/preset"
|
|
87
|
+
|
|
88
|
+
// Auto-generated safelist dari tailwind-styled-v4 compiler
|
|
89
|
+
const safelist = (() => {
|
|
90
|
+
try { return require(${JSON.stringify(safelistPath)}) as string[] }
|
|
91
|
+
catch { return [] }
|
|
92
|
+
})()
|
|
93
|
+
|
|
94
|
+
export default {
|
|
95
|
+
presets: [defaultPreset],
|
|
96
|
+
content: ${JSON.stringify(contentPaths, null, 2)},
|
|
97
|
+
safelist,
|
|
98
|
+
} satisfies Config
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
var defaultGlobalCss = `@import "tailwindcss";
|
|
102
|
+
|
|
103
|
+
/* tailwind-styled-v4 \u2014 zero-config base styles */
|
|
104
|
+
*, *::before, *::after {
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
html {
|
|
109
|
+
-webkit-font-smoothing: antialiased;
|
|
110
|
+
-moz-osx-font-smoothing: grayscale;
|
|
111
|
+
text-rendering: optimizeLegibility;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
body {
|
|
115
|
+
margin: 0;
|
|
116
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
117
|
+
background: var(--color-background, #09090b);
|
|
118
|
+
color: var(--color-foreground, #fafafa);
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
export { defaultGlobalCss, defaultPreset, designTokens, generateTailwindConfig };
|
|
123
|
+
//# sourceMappingURL=preset.js.map
|
|
124
|
+
//# sourceMappingURL=preset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../preset/src/defaultPreset.ts"],"names":[],"mappings":"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","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"]}
|