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
package/dist/animate.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/* tailwind-styled-v4 v4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
2
|
+
|
|
3
|
+
// ../animate/src/index.ts
|
|
4
|
+
var TW_TO_CSS = {
|
|
5
|
+
// Opacity
|
|
6
|
+
"opacity-0": "opacity: 0",
|
|
7
|
+
"opacity-5": "opacity: 0.05",
|
|
8
|
+
"opacity-10": "opacity: 0.1",
|
|
9
|
+
"opacity-20": "opacity: 0.2",
|
|
10
|
+
"opacity-25": "opacity: 0.25",
|
|
11
|
+
"opacity-30": "opacity: 0.3",
|
|
12
|
+
"opacity-40": "opacity: 0.4",
|
|
13
|
+
"opacity-50": "opacity: 0.5",
|
|
14
|
+
"opacity-60": "opacity: 0.6",
|
|
15
|
+
"opacity-70": "opacity: 0.7",
|
|
16
|
+
"opacity-75": "opacity: 0.75",
|
|
17
|
+
"opacity-80": "opacity: 0.8",
|
|
18
|
+
"opacity-90": "opacity: 0.9",
|
|
19
|
+
"opacity-95": "opacity: 0.95",
|
|
20
|
+
"opacity-100": "opacity: 1",
|
|
21
|
+
// Translate Y
|
|
22
|
+
"translate-y-0": "transform: translateY(0px)",
|
|
23
|
+
"translate-y-0.5": "transform: translateY(0.125rem)",
|
|
24
|
+
"translate-y-1": "transform: translateY(0.25rem)",
|
|
25
|
+
"translate-y-2": "transform: translateY(0.5rem)",
|
|
26
|
+
"translate-y-3": "transform: translateY(0.75rem)",
|
|
27
|
+
"translate-y-4": "transform: translateY(1rem)",
|
|
28
|
+
"translate-y-6": "transform: translateY(1.5rem)",
|
|
29
|
+
"translate-y-8": "transform: translateY(2rem)",
|
|
30
|
+
"-translate-y-1": "transform: translateY(-0.25rem)",
|
|
31
|
+
"-translate-y-2": "transform: translateY(-0.5rem)",
|
|
32
|
+
"-translate-y-4": "transform: translateY(-1rem)",
|
|
33
|
+
"-translate-y-8": "transform: translateY(-2rem)",
|
|
34
|
+
// Translate X
|
|
35
|
+
"translate-x-0": "transform: translateX(0px)",
|
|
36
|
+
"translate-x-1": "transform: translateX(0.25rem)",
|
|
37
|
+
"translate-x-2": "transform: translateX(0.5rem)",
|
|
38
|
+
"translate-x-4": "transform: translateX(1rem)",
|
|
39
|
+
"-translate-x-1": "transform: translateX(-0.25rem)",
|
|
40
|
+
"-translate-x-2": "transform: translateX(-0.5rem)",
|
|
41
|
+
"-translate-x-4": "transform: translateX(-1rem)",
|
|
42
|
+
// Scale
|
|
43
|
+
"scale-0": "transform: scale(0)",
|
|
44
|
+
"scale-50": "transform: scale(0.5)",
|
|
45
|
+
"scale-75": "transform: scale(0.75)",
|
|
46
|
+
"scale-90": "transform: scale(0.9)",
|
|
47
|
+
"scale-95": "transform: scale(0.95)",
|
|
48
|
+
"scale-100": "transform: scale(1)",
|
|
49
|
+
"scale-105": "transform: scale(1.05)",
|
|
50
|
+
"scale-110": "transform: scale(1.1)",
|
|
51
|
+
"scale-125": "transform: scale(1.25)",
|
|
52
|
+
"scale-150": "transform: scale(1.5)",
|
|
53
|
+
// Rotate
|
|
54
|
+
"rotate-0": "transform: rotate(0deg)",
|
|
55
|
+
"rotate-1": "transform: rotate(1deg)",
|
|
56
|
+
"rotate-2": "transform: rotate(2deg)",
|
|
57
|
+
"rotate-3": "transform: rotate(3deg)",
|
|
58
|
+
"rotate-6": "transform: rotate(6deg)",
|
|
59
|
+
"rotate-12": "transform: rotate(12deg)",
|
|
60
|
+
"rotate-45": "transform: rotate(45deg)",
|
|
61
|
+
"rotate-90": "transform: rotate(90deg)",
|
|
62
|
+
"rotate-180": "transform: rotate(180deg)",
|
|
63
|
+
"-rotate-1": "transform: rotate(-1deg)",
|
|
64
|
+
"-rotate-2": "transform: rotate(-2deg)",
|
|
65
|
+
"-rotate-6": "transform: rotate(-6deg)",
|
|
66
|
+
"-rotate-12": "transform: rotate(-12deg)",
|
|
67
|
+
"-rotate-45": "transform: rotate(-45deg)",
|
|
68
|
+
"-rotate-90": "transform: rotate(-90deg)",
|
|
69
|
+
// Blur
|
|
70
|
+
"blur-none": "filter: blur(0)",
|
|
71
|
+
"blur-sm": "filter: blur(4px)",
|
|
72
|
+
blur: "filter: blur(8px)",
|
|
73
|
+
"blur-md": "filter: blur(12px)",
|
|
74
|
+
"blur-lg": "filter: blur(16px)",
|
|
75
|
+
"blur-xl": "filter: blur(24px)",
|
|
76
|
+
"blur-2xl": "filter: blur(40px)",
|
|
77
|
+
"blur-3xl": "filter: blur(64px)"
|
|
78
|
+
};
|
|
79
|
+
function classesToCss(classes) {
|
|
80
|
+
const parts = classes.split(/\s+/).filter(Boolean);
|
|
81
|
+
const transforms = [];
|
|
82
|
+
const others = [];
|
|
83
|
+
for (const cls of parts) {
|
|
84
|
+
const css = TW_TO_CSS[cls];
|
|
85
|
+
if (!css) continue;
|
|
86
|
+
if (css.startsWith("transform:")) {
|
|
87
|
+
transforms.push(css.replace("transform: ", ""));
|
|
88
|
+
} else {
|
|
89
|
+
others.push(css);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const result = [...others];
|
|
93
|
+
if (transforms.length > 0) {
|
|
94
|
+
result.push(`transform: ${transforms.join(" ")}`);
|
|
95
|
+
}
|
|
96
|
+
return result.join("; ");
|
|
97
|
+
}
|
|
98
|
+
var _animCounter = 0;
|
|
99
|
+
function genAnimId(name) {
|
|
100
|
+
if (name) return `tw-${name.replace(/[^a-zA-Z0-9]/g, "-")}`;
|
|
101
|
+
return `tw-anim-${++_animCounter}`;
|
|
102
|
+
}
|
|
103
|
+
var _animRegistry = /* @__PURE__ */ new Map();
|
|
104
|
+
function getAnimationRegistry() {
|
|
105
|
+
return _animRegistry;
|
|
106
|
+
}
|
|
107
|
+
function compileAnimation(opts) {
|
|
108
|
+
const {
|
|
109
|
+
from,
|
|
110
|
+
to,
|
|
111
|
+
duration = 300,
|
|
112
|
+
easing = "ease-out",
|
|
113
|
+
delay = 0,
|
|
114
|
+
fill = "both",
|
|
115
|
+
iterations = 1,
|
|
116
|
+
direction = "normal",
|
|
117
|
+
name
|
|
118
|
+
} = opts;
|
|
119
|
+
const animId = genAnimId(
|
|
120
|
+
name != null ? name : `${from.replace(/\s+/g, "-")}-${to.replace(/\s+/g, "-")}`.slice(0, 30)
|
|
121
|
+
);
|
|
122
|
+
if (_animRegistry.has(animId)) {
|
|
123
|
+
return _animRegistry.get(animId);
|
|
124
|
+
}
|
|
125
|
+
const fromCss = classesToCss(from);
|
|
126
|
+
const toCss = classesToCss(to);
|
|
127
|
+
const keyframesCss = [
|
|
128
|
+
`@keyframes ${animId} {`,
|
|
129
|
+
fromCss ? ` from { ${fromCss} }` : ` from {}`,
|
|
130
|
+
toCss ? ` to { ${toCss} }` : ` to {}`,
|
|
131
|
+
`}`
|
|
132
|
+
].join("\n");
|
|
133
|
+
const iterStr = iterations === "infinite" ? "infinite" : String(iterations);
|
|
134
|
+
const animationCss = [
|
|
135
|
+
`animation-name: ${animId}`,
|
|
136
|
+
`animation-duration: ${duration}ms`,
|
|
137
|
+
`animation-timing-function: ${easing}`,
|
|
138
|
+
`animation-delay: ${delay}ms`,
|
|
139
|
+
`animation-fill-mode: ${fill}`,
|
|
140
|
+
`animation-iteration-count: ${iterStr}`,
|
|
141
|
+
`animation-direction: ${direction}`
|
|
142
|
+
].join("; ");
|
|
143
|
+
const className = animId;
|
|
144
|
+
const compiled = { className, keyframesCss, animationCss };
|
|
145
|
+
_animRegistry.set(animId, compiled);
|
|
146
|
+
return compiled;
|
|
147
|
+
}
|
|
148
|
+
function animate(opts) {
|
|
149
|
+
const compiled = compileAnimation(opts);
|
|
150
|
+
if (typeof document !== "undefined") {
|
|
151
|
+
const styleId = `__tw_anim_${compiled.className}`;
|
|
152
|
+
if (!document.getElementById(styleId)) {
|
|
153
|
+
const style = document.createElement("style");
|
|
154
|
+
style.id = styleId;
|
|
155
|
+
style.textContent = `${compiled.keyframesCss}
|
|
156
|
+
.${compiled.className}{${compiled.animationCss}}`;
|
|
157
|
+
document.head.appendChild(style);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return compiled.className;
|
|
161
|
+
}
|
|
162
|
+
function keyframes(name, stops) {
|
|
163
|
+
const animId = genAnimId(name);
|
|
164
|
+
if (_animRegistry.has(animId)) {
|
|
165
|
+
return animId;
|
|
166
|
+
}
|
|
167
|
+
const stopLines = Object.entries(stops).map(([stop, classes]) => {
|
|
168
|
+
const css = classesToCss(classes);
|
|
169
|
+
return ` ${stop} { ${css} }`;
|
|
170
|
+
}).join("\n");
|
|
171
|
+
const keyframesCss = `@keyframes ${animId} {
|
|
172
|
+
${stopLines}
|
|
173
|
+
}`;
|
|
174
|
+
if (typeof document !== "undefined") {
|
|
175
|
+
const styleId = `__tw_kf_${animId}`;
|
|
176
|
+
if (!document.getElementById(styleId)) {
|
|
177
|
+
const style = document.createElement("style");
|
|
178
|
+
style.id = styleId;
|
|
179
|
+
style.textContent = keyframesCss;
|
|
180
|
+
document.head.appendChild(style);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
_animRegistry.set(animId, {
|
|
184
|
+
className: animId,
|
|
185
|
+
keyframesCss,
|
|
186
|
+
animationCss: `animation-name: ${animId}`
|
|
187
|
+
});
|
|
188
|
+
return animId;
|
|
189
|
+
}
|
|
190
|
+
var animations = {
|
|
191
|
+
fadeIn: animate({ from: "opacity-0", to: "opacity-100", duration: 200 }),
|
|
192
|
+
fadeOut: animate({ from: "opacity-100", to: "opacity-0", duration: 200 }),
|
|
193
|
+
slideUp: animate({
|
|
194
|
+
from: "opacity-0 translate-y-4",
|
|
195
|
+
to: "opacity-100 translate-y-0",
|
|
196
|
+
duration: 300
|
|
197
|
+
}),
|
|
198
|
+
slideDown: animate({
|
|
199
|
+
from: "opacity-0 -translate-y-4",
|
|
200
|
+
to: "opacity-100 translate-y-0",
|
|
201
|
+
duration: 300
|
|
202
|
+
}),
|
|
203
|
+
slideLeft: animate({
|
|
204
|
+
from: "opacity-0 translate-x-4",
|
|
205
|
+
to: "opacity-100 translate-x-0",
|
|
206
|
+
duration: 300
|
|
207
|
+
}),
|
|
208
|
+
slideRight: animate({
|
|
209
|
+
from: "opacity-0 -translate-x-4",
|
|
210
|
+
to: "opacity-100 translate-x-0",
|
|
211
|
+
duration: 300
|
|
212
|
+
}),
|
|
213
|
+
scaleIn: animate({
|
|
214
|
+
from: "opacity-0 scale-95",
|
|
215
|
+
to: "opacity-100 scale-100",
|
|
216
|
+
duration: 200,
|
|
217
|
+
easing: "cubic-bezier(0.16,1,0.3,1)"
|
|
218
|
+
}),
|
|
219
|
+
scaleOut: animate({ from: "opacity-100 scale-100", to: "opacity-0 scale-95", duration: 150 }),
|
|
220
|
+
blurIn: animate({ from: "opacity-0 blur-sm", to: "opacity-100 blur-none", duration: 300 }),
|
|
221
|
+
bounceIn: animate({
|
|
222
|
+
from: "opacity-0 scale-50",
|
|
223
|
+
to: "opacity-100 scale-100",
|
|
224
|
+
duration: 400,
|
|
225
|
+
easing: "cubic-bezier(0.34,1.56,0.64,1)"
|
|
226
|
+
}),
|
|
227
|
+
spinIn: animate({
|
|
228
|
+
from: "opacity-0 rotate-180 scale-50",
|
|
229
|
+
to: "opacity-100 rotate-0 scale-100",
|
|
230
|
+
duration: 400,
|
|
231
|
+
easing: "cubic-bezier(0.16,1,0.3,1)"
|
|
232
|
+
})
|
|
233
|
+
};
|
|
234
|
+
function extractAnimationCss() {
|
|
235
|
+
const lines = [];
|
|
236
|
+
for (const [, compiled] of _animRegistry) {
|
|
237
|
+
lines.push(compiled.keyframesCss);
|
|
238
|
+
lines.push(`.${compiled.className} { ${compiled.animationCss} }`);
|
|
239
|
+
}
|
|
240
|
+
return lines.join("\n\n");
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export { animate, animations, compileAnimation, extractAnimationCss, getAnimationRegistry, keyframes };
|
|
244
|
+
//# sourceMappingURL=animate.js.map
|
|
245
|
+
//# sourceMappingURL=animate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../animate/src/index.ts"],"names":[],"mappings":";;;AA6EA,IAAM,SAAA,GAAoC;AAAA;AAAA,EAExC,WAAA,EAAa,YAAA;AAAA,EACb,WAAA,EAAa,eAAA;AAAA,EACb,YAAA,EAAc,cAAA;AAAA,EACd,YAAA,EAAc,cAAA;AAAA,EACd,YAAA,EAAc,eAAA;AAAA,EACd,YAAA,EAAc,cAAA;AAAA,EACd,YAAA,EAAc,cAAA;AAAA,EACd,YAAA,EAAc,cAAA;A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AAA,IACJ,QAAA,EAAU,GAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACT,CAAA;AAAA,EACD,QAAA,EAAU,QAAQ,EAAE,IAAA,EAAM,yBAAyB,EAAA,EAAI,oBAAA,EAAsB,QAAA,EAAU,GAAA,EAAK,CAAA;AAAA,EAC5F,MAAA,EAAQ,QAAQ,EAAE,IAAA,EAAM,qBAAqB,EAAA,EAAI,uBAAA,EAAyB,QAAA,EAAU,GAAA,EAAK,CAAA;AAAA,EACzF,UAAU,OAAA,CAAQ;AAAA,IAChB,IAAA,EAAM,oBAAA;AAAA,IACN,EAAA,EAAI,uBAAA;AAAA,IACJ,QAAA,EAAU,GAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACT,CAAA;AAAA,EACD,QAAQ,OAAA,CAAQ;AAAA,IACd,IAAA,EAAM,+BAAA;AAAA,IACN,EAAA,EAAI,gCAAA;AAAA,IACJ,QAAA,EAAU,GAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACT;AACH;AAUO,SAAS,mBAAA,GAA8B;AAC5C,EAAA,MAAM,QAAkB,EAAC;AACzB,EAAA,KAAA,MAAW,GAAG,QAAQ,CAAA,IAAK,aAAA,EAAe;AACxC,IAAA,KAAA,CAAM,IAAA,CAAK,SAAS,YAAY,CAAA;AAChC,IAAA,KAAA,CAAM,KAAK,CAAA,CAAA,EAAI,QAAA,CAAS,SAAS,CAAA,GAAA,EAAM,QAAA,CAAS,YAAY,CAAA,EAAA,CAAI,CAAA;AAAA,EAClE;AACA,EAAA,OAAO,KAAA,CAAM,KAAK,MAAM,CAAA;AAC1B","file":"animate.js","sourcesContent":["/**\n * tailwind-styled-v4 — Animation DSL\n *\n * Compile-time animation system. Define animations dengan Tailwind class,\n * compiler generate @keyframes — nol runtime, nol JS overhead.\n *\n * Usage:\n *\n * // Cara 1: .animate() chaining pada tw component\n * const FadeIn = tw.div.animate({\n * from: \"opacity-0 translate-y-2\",\n * to: \"opacity-100 translate-y-0\",\n * duration: 300,\n * easing: \"ease-out\"\n * })\n *\n * // Cara 2: standalone animate() utility\n * const fadeIn = animate({\n * from: \"opacity-0 scale-95\",\n * to: \"opacity-100 scale-100\",\n * duration: 200,\n * })\n * const Box = tw.div`${fadeIn}`\n *\n * // Cara 3: preset animations\n * const Card = tw.div`${animations.fadeIn} ${animations.slideUp}`\n *\n * // Cara 4: tw.keyframes() custom\n * const spin = tw.keyframes(\"spin\", {\n * \"0%\": \"rotate-0\",\n * \"100%\": \"rotate-180\",\n * })\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface AnimateOptions {\n /** Tailwind classes for animation start state */\n from: string\n /** Tailwind classes for animation end state */\n to: string\n /** Duration in ms. Default: 300 */\n duration?: number\n /** CSS easing. Default: \"ease-out\" */\n easing?: string\n /** Delay in ms. Default: 0 */\n delay?: number\n /** Fill mode. Default: \"both\" */\n fill?: \"none\" | \"forwards\" | \"backwards\" | \"both\"\n /** Iteration count. Default: 1 */\n iterations?: number | \"infinite\"\n /** Direction. Default: \"normal\" */\n direction?: \"normal\" | \"reverse\" | \"alternate\" | \"alternate-reverse\"\n /** Animation name override (auto-generated from from+to if not set) */\n name?: string\n}\n\nexport interface KeyframesDefinition {\n [stop: string]: string // \"0%\": \"opacity-0 translate-y-2\"\n}\n\nexport interface CompiledAnimation {\n /** CSS animation class name to apply */\n className: string\n /** @keyframes CSS to inject */\n keyframesCss: string\n /** animation CSS shorthand */\n animationCss: string\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind class → CSS property mapping\n// (for compile-time keyframe generation)\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst TW_TO_CSS: Record<string, string> = {\n // Opacity\n \"opacity-0\": \"opacity: 0\",\n \"opacity-5\": \"opacity: 0.05\",\n \"opacity-10\": \"opacity: 0.1\",\n \"opacity-20\": \"opacity: 0.2\",\n \"opacity-25\": \"opacity: 0.25\",\n \"opacity-30\": \"opacity: 0.3\",\n \"opacity-40\": \"opacity: 0.4\",\n \"opacity-50\": \"opacity: 0.5\",\n \"opacity-60\": \"opacity: 0.6\",\n \"opacity-70\": \"opacity: 0.7\",\n \"opacity-75\": \"opacity: 0.75\",\n \"opacity-80\": \"opacity: 0.8\",\n \"opacity-90\": \"opacity: 0.9\",\n \"opacity-95\": \"opacity: 0.95\",\n \"opacity-100\": \"opacity: 1\",\n\n // Translate Y\n \"translate-y-0\": \"transform: translateY(0px)\",\n \"translate-y-0.5\": \"transform: translateY(0.125rem)\",\n \"translate-y-1\": \"transform: translateY(0.25rem)\",\n \"translate-y-2\": \"transform: translateY(0.5rem)\",\n \"translate-y-3\": \"transform: translateY(0.75rem)\",\n \"translate-y-4\": \"transform: translateY(1rem)\",\n \"translate-y-6\": \"transform: translateY(1.5rem)\",\n \"translate-y-8\": \"transform: translateY(2rem)\",\n \"-translate-y-1\": \"transform: translateY(-0.25rem)\",\n \"-translate-y-2\": \"transform: translateY(-0.5rem)\",\n \"-translate-y-4\": \"transform: translateY(-1rem)\",\n \"-translate-y-8\": \"transform: translateY(-2rem)\",\n\n // Translate X\n \"translate-x-0\": \"transform: translateX(0px)\",\n \"translate-x-1\": \"transform: translateX(0.25rem)\",\n \"translate-x-2\": \"transform: translateX(0.5rem)\",\n \"translate-x-4\": \"transform: translateX(1rem)\",\n \"-translate-x-1\": \"transform: translateX(-0.25rem)\",\n \"-translate-x-2\": \"transform: translateX(-0.5rem)\",\n \"-translate-x-4\": \"transform: translateX(-1rem)\",\n\n // Scale\n \"scale-0\": \"transform: scale(0)\",\n \"scale-50\": \"transform: scale(0.5)\",\n \"scale-75\": \"transform: scale(0.75)\",\n \"scale-90\": \"transform: scale(0.9)\",\n \"scale-95\": \"transform: scale(0.95)\",\n \"scale-100\": \"transform: scale(1)\",\n \"scale-105\": \"transform: scale(1.05)\",\n \"scale-110\": \"transform: scale(1.1)\",\n \"scale-125\": \"transform: scale(1.25)\",\n \"scale-150\": \"transform: scale(1.5)\",\n\n // Rotate\n \"rotate-0\": \"transform: rotate(0deg)\",\n \"rotate-1\": \"transform: rotate(1deg)\",\n \"rotate-2\": \"transform: rotate(2deg)\",\n \"rotate-3\": \"transform: rotate(3deg)\",\n \"rotate-6\": \"transform: rotate(6deg)\",\n \"rotate-12\": \"transform: rotate(12deg)\",\n \"rotate-45\": \"transform: rotate(45deg)\",\n \"rotate-90\": \"transform: rotate(90deg)\",\n \"rotate-180\": \"transform: rotate(180deg)\",\n \"-rotate-1\": \"transform: rotate(-1deg)\",\n \"-rotate-2\": \"transform: rotate(-2deg)\",\n \"-rotate-6\": \"transform: rotate(-6deg)\",\n \"-rotate-12\": \"transform: rotate(-12deg)\",\n \"-rotate-45\": \"transform: rotate(-45deg)\",\n \"-rotate-90\": \"transform: rotate(-90deg)\",\n\n // Blur\n \"blur-none\": \"filter: blur(0)\",\n \"blur-sm\": \"filter: blur(4px)\",\n blur: \"filter: blur(8px)\",\n \"blur-md\": \"filter: blur(12px)\",\n \"blur-lg\": \"filter: blur(16px)\",\n \"blur-xl\": \"filter: blur(24px)\",\n \"blur-2xl\": \"filter: blur(40px)\",\n \"blur-3xl\": \"filter: blur(64px)\",\n}\n\n// Multi-transform classes need merging\nfunction classesToCss(classes: string): string {\n const parts = classes.split(/\\s+/).filter(Boolean)\n const transforms: string[] = []\n const others: string[] = []\n\n for (const cls of parts) {\n const css = TW_TO_CSS[cls]\n if (!css) continue\n\n if (css.startsWith(\"transform:\")) {\n transforms.push(css.replace(\"transform: \", \"\"))\n } else {\n others.push(css)\n }\n }\n\n const result = [...others]\n if (transforms.length > 0) {\n result.push(`transform: ${transforms.join(\" \")}`)\n }\n\n return result.join(\"; \")\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Animation ID generator\n// ─────────────────────────────────────────────────────────────────────────────\n\nlet _animCounter = 0\nfunction genAnimId(name?: string): string {\n if (name) return `tw-${name.replace(/[^a-zA-Z0-9]/g, \"-\")}`\n return `tw-anim-${++_animCounter}`\n}\n\n// Global registry of generated animations (for CSS extraction)\nconst _animRegistry = new Map<string, CompiledAnimation>()\n\nexport function getAnimationRegistry(): Map<string, CompiledAnimation> {\n return _animRegistry\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core: compile animation options → CSS\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Compile AnimateOptions into CSS animation + @keyframes.\n *\n * Called at build time by the compiler, or at runtime in dev mode.\n */\nexport function compileAnimation(opts: AnimateOptions): CompiledAnimation {\n const {\n from,\n to,\n duration = 300,\n easing = \"ease-out\",\n delay = 0,\n fill = \"both\",\n iterations = 1,\n direction = \"normal\",\n name,\n } = opts\n\n const animId = genAnimId(\n name ?? `${from.replace(/\\s+/g, \"-\")}-${to.replace(/\\s+/g, \"-\")}`.slice(0, 30)\n )\n\n // Already compiled — return cached\n if (_animRegistry.has(animId)) {\n return _animRegistry.get(animId)!\n }\n\n const fromCss = classesToCss(from)\n const toCss = classesToCss(to)\n\n const keyframesCss = [\n `@keyframes ${animId} {`,\n fromCss ? ` from { ${fromCss} }` : ` from {}`,\n toCss ? ` to { ${toCss} }` : ` to {}`,\n `}`,\n ].join(\"\\n\")\n\n const iterStr = iterations === \"infinite\" ? \"infinite\" : String(iterations)\n const animationCss = [\n `animation-name: ${animId}`,\n `animation-duration: ${duration}ms`,\n `animation-timing-function: ${easing}`,\n `animation-delay: ${delay}ms`,\n `animation-fill-mode: ${fill}`,\n `animation-iteration-count: ${iterStr}`,\n `animation-direction: ${direction}`,\n ].join(\"; \")\n\n const className = animId\n\n const compiled: CompiledAnimation = { className, keyframesCss, animationCss }\n _animRegistry.set(animId, compiled)\n\n return compiled\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Public API: animate()\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Generate an animation class string to use in tw template literals.\n *\n * @example\n * const fadeIn = animate({ from: \"opacity-0\", to: \"opacity-100\", duration: 200 })\n * const Box = tw.div`${fadeIn} p-4 bg-white`\n */\nexport function animate(opts: AnimateOptions): string {\n const compiled = compileAnimation(opts)\n\n // In browser: inject keyframes into <style> if not already present\n if (typeof document !== \"undefined\") {\n const styleId = `__tw_anim_${compiled.className}`\n if (!document.getElementById(styleId)) {\n const style = document.createElement(\"style\")\n style.id = styleId\n style.textContent = `${compiled.keyframesCss}\\n.${compiled.className}{${compiled.animationCss}}`\n document.head.appendChild(style)\n }\n }\n\n return compiled.className\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// tw.keyframes() — custom multi-stop keyframes\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Define a custom keyframe animation with multiple stops.\n *\n * @example\n * const pulse = tw.keyframes(\"pulse\", {\n * \"0%, 100%\": \"opacity-100 scale-100\",\n * \"50%\": \"opacity-50 scale-95\",\n * })\n * const Dot = tw.div`${pulse} w-4 h-4 rounded-full bg-blue-500`\n */\nexport function keyframes(name: string, stops: KeyframesDefinition): string {\n const animId = genAnimId(name)\n\n if (_animRegistry.has(animId)) {\n return animId\n }\n\n const stopLines = Object.entries(stops)\n .map(([stop, classes]) => {\n const css = classesToCss(classes)\n return ` ${stop} { ${css} }`\n })\n .join(\"\\n\")\n\n const keyframesCss = `@keyframes ${animId} {\\n${stopLines}\\n}`\n\n // Inject in browser\n if (typeof document !== \"undefined\") {\n const styleId = `__tw_kf_${animId}`\n if (!document.getElementById(styleId)) {\n const style = document.createElement(\"style\")\n style.id = styleId\n style.textContent = keyframesCss\n document.head.appendChild(style)\n }\n }\n\n _animRegistry.set(animId, {\n className: animId,\n keyframesCss,\n animationCss: `animation-name: ${animId}`,\n })\n\n return animId\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Preset animations — ready to use\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Collection of ready-to-use animation class strings.\n *\n * @example\n * const Card = tw.div`${animations.fadeIn} p-4 bg-white`\n * const Modal = tw.div`${animations.scaleIn} fixed inset-0`\n */\nexport const animations = {\n fadeIn: animate({ from: \"opacity-0\", to: \"opacity-100\", duration: 200 }),\n fadeOut: animate({ from: \"opacity-100\", to: \"opacity-0\", duration: 200 }),\n slideUp: animate({\n from: \"opacity-0 translate-y-4\",\n to: \"opacity-100 translate-y-0\",\n duration: 300,\n }),\n slideDown: animate({\n from: \"opacity-0 -translate-y-4\",\n to: \"opacity-100 translate-y-0\",\n duration: 300,\n }),\n slideLeft: animate({\n from: \"opacity-0 translate-x-4\",\n to: \"opacity-100 translate-x-0\",\n duration: 300,\n }),\n slideRight: animate({\n from: \"opacity-0 -translate-x-4\",\n to: \"opacity-100 translate-x-0\",\n duration: 300,\n }),\n scaleIn: animate({\n from: \"opacity-0 scale-95\",\n to: \"opacity-100 scale-100\",\n duration: 200,\n easing: \"cubic-bezier(0.16,1,0.3,1)\",\n }),\n scaleOut: animate({ from: \"opacity-100 scale-100\", to: \"opacity-0 scale-95\", duration: 150 }),\n blurIn: animate({ from: \"opacity-0 blur-sm\", to: \"opacity-100 blur-none\", duration: 300 }),\n bounceIn: animate({\n from: \"opacity-0 scale-50\",\n to: \"opacity-100 scale-100\",\n duration: 400,\n easing: \"cubic-bezier(0.34,1.56,0.64,1)\",\n }),\n spinIn: animate({\n from: \"opacity-0 rotate-180 scale-50\",\n to: \"opacity-100 rotate-0 scale-100\",\n duration: 400,\n easing: \"cubic-bezier(0.16,1,0.3,1)\",\n }),\n} as const\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Extract all animation CSS (for build-time injection)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Get all compiled animation CSS to inject into a stylesheet.\n * Called by the CSS extraction engine at build time.\n */\nexport function extractAnimationCss(): string {\n const lines: string[] = []\n for (const [, compiled] of _animRegistry) {\n lines.push(compiled.keyframesCss)\n lines.push(`.${compiled.className} { ${compiled.animationCss} }`)\n }\n return lines.join(\"\\n\\n\")\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tailwind-styled-v4 v2 — AST Transform (RSC-Aware)
|
|
3
|
+
*
|
|
4
|
+
* FIXES:
|
|
5
|
+
* #01 — Double-merge base in variant component className array
|
|
6
|
+
* #08 — Idempotency guard — skip if already transformed
|
|
7
|
+
*
|
|
8
|
+
* Pipeline:
|
|
9
|
+
* source code
|
|
10
|
+
* ↓ idempotency check (new)
|
|
11
|
+
* ↓ analyze RSC context
|
|
12
|
+
* ↓ hoist components (if needed)
|
|
13
|
+
* ↓ detect tw.server.* vs tw.*
|
|
14
|
+
* ↓ extract + merge classes
|
|
15
|
+
* ↓ compile variants → lookup table (variant-only, no base dupe)
|
|
16
|
+
* ↓ generate React.forwardRef component
|
|
17
|
+
* ↓ auto "use client" if interactive
|
|
18
|
+
* ↓ strip tw import
|
|
19
|
+
* ↓ inject transform marker
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
interface TransformOptions {
|
|
23
|
+
mode?: "zero-runtime" | "runtime" | "extract-only";
|
|
24
|
+
autoClientBoundary?: boolean;
|
|
25
|
+
addDataAttr?: boolean;
|
|
26
|
+
hoist?: boolean;
|
|
27
|
+
filename?: string;
|
|
28
|
+
}
|
|
29
|
+
interface TransformResult {
|
|
30
|
+
code: string;
|
|
31
|
+
classes: string[];
|
|
32
|
+
rsc?: {
|
|
33
|
+
isServer: boolean;
|
|
34
|
+
needsClientDirective: boolean;
|
|
35
|
+
clientReasons: string[];
|
|
36
|
+
};
|
|
37
|
+
changed: boolean;
|
|
38
|
+
}
|
|
39
|
+
declare function transformSource(source: string, opts?: TransformOptions): TransformResult;
|
|
40
|
+
|
|
41
|
+
export { type TransformOptions as T, type TransformResult as a, transformSource as t };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tailwind-styled-v4 v2 — AST Transform (RSC-Aware)
|
|
3
|
+
*
|
|
4
|
+
* FIXES:
|
|
5
|
+
* #01 — Double-merge base in variant component className array
|
|
6
|
+
* #08 — Idempotency guard — skip if already transformed
|
|
7
|
+
*
|
|
8
|
+
* Pipeline:
|
|
9
|
+
* source code
|
|
10
|
+
* ↓ idempotency check (new)
|
|
11
|
+
* ↓ analyze RSC context
|
|
12
|
+
* ↓ hoist components (if needed)
|
|
13
|
+
* ↓ detect tw.server.* vs tw.*
|
|
14
|
+
* ↓ extract + merge classes
|
|
15
|
+
* ↓ compile variants → lookup table (variant-only, no base dupe)
|
|
16
|
+
* ↓ generate React.forwardRef component
|
|
17
|
+
* ↓ auto "use client" if interactive
|
|
18
|
+
* ↓ strip tw import
|
|
19
|
+
* ↓ inject transform marker
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
interface TransformOptions {
|
|
23
|
+
mode?: "zero-runtime" | "runtime" | "extract-only";
|
|
24
|
+
autoClientBoundary?: boolean;
|
|
25
|
+
addDataAttr?: boolean;
|
|
26
|
+
hoist?: boolean;
|
|
27
|
+
filename?: string;
|
|
28
|
+
}
|
|
29
|
+
interface TransformResult {
|
|
30
|
+
code: string;
|
|
31
|
+
classes: string[];
|
|
32
|
+
rsc?: {
|
|
33
|
+
isServer: boolean;
|
|
34
|
+
needsClientDirective: boolean;
|
|
35
|
+
clientReasons: string[];
|
|
36
|
+
};
|
|
37
|
+
changed: boolean;
|
|
38
|
+
}
|
|
39
|
+
declare function transformSource(source: string, opts?: TransformOptions): TransformResult;
|
|
40
|
+
|
|
41
|
+
export { type TransformOptions as T, type TransformResult as a, transformSource as t };
|