tailwind-styled-v4 4.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +398 -0
  2. package/LICENSE +21 -0
  3. package/README.md +532 -0
  4. package/dist/analyzer.d.mts +114 -0
  5. package/dist/analyzer.d.ts +114 -0
  6. package/dist/analyzer.js +1555 -0
  7. package/dist/analyzer.js.map +1 -0
  8. package/dist/analyzer.mjs +1544 -0
  9. package/dist/analyzer.mjs.map +1 -0
  10. package/dist/animate.d.mts +46 -0
  11. package/dist/animate.d.ts +41 -112
  12. package/dist/animate.js +792 -235
  13. package/dist/animate.js.map +1 -1
  14. package/dist/animate.mjs +782 -0
  15. package/dist/animate.mjs.map +1 -0
  16. package/dist/atomic.d.mts +18 -0
  17. package/dist/atomic.d.ts +18 -0
  18. package/dist/atomic.js +191 -0
  19. package/dist/atomic.js.map +1 -0
  20. package/dist/atomic.mjs +185 -0
  21. package/dist/atomic.mjs.map +1 -0
  22. package/dist/cli.d.mts +1 -0
  23. package/dist/cli.d.ts +1 -0
  24. package/dist/cli.js +6063 -0
  25. package/dist/cli.js.map +1 -0
  26. package/dist/cli.mjs +6053 -0
  27. package/dist/cli.mjs.map +1 -0
  28. package/dist/{compiler.d.cts → compiler.d.mts} +503 -210
  29. package/dist/compiler.d.ts +503 -210
  30. package/dist/compiler.js +1549 -566
  31. package/dist/compiler.js.map +1 -1
  32. package/dist/{compiler.cjs → compiler.mjs} +1476 -627
  33. package/dist/compiler.mjs.map +1 -0
  34. package/dist/dashboard.d.mts +272 -0
  35. package/dist/dashboard.d.ts +272 -0
  36. package/dist/dashboard.js +249 -0
  37. package/dist/dashboard.js.map +1 -0
  38. package/dist/dashboard.mjs +239 -0
  39. package/dist/dashboard.mjs.map +1 -0
  40. package/dist/devtools.js +336 -211
  41. package/dist/devtools.js.map +1 -1
  42. package/dist/{devtools.cjs → devtools.mjs} +331 -220
  43. package/dist/devtools.mjs.map +1 -0
  44. package/dist/engine.d.mts +84 -0
  45. package/dist/engine.d.ts +84 -0
  46. package/dist/engine.js +3014 -0
  47. package/dist/engine.js.map +1 -0
  48. package/dist/engine.mjs +3005 -0
  49. package/dist/engine.mjs.map +1 -0
  50. package/dist/{index.d.cts → index.d.mts} +75 -4
  51. package/dist/index.d.ts +75 -4
  52. package/dist/index.js +1341 -149
  53. package/dist/index.js.map +1 -1
  54. package/dist/index.mjs +2162 -0
  55. package/dist/index.mjs.map +1 -0
  56. package/dist/liveTokenEngine-DYN3Zale.d.mts +34 -0
  57. package/dist/liveTokenEngine-DYN3Zale.d.ts +34 -0
  58. package/dist/next.d.mts +55 -0
  59. package/dist/next.d.ts +30 -20
  60. package/dist/next.js +6947 -149
  61. package/dist/next.js.map +1 -1
  62. package/dist/next.mjs +7050 -0
  63. package/dist/next.mjs.map +1 -0
  64. package/dist/plugin.d.mts +90 -0
  65. package/dist/plugin.d.ts +90 -0
  66. package/dist/plugin.js +185 -0
  67. package/dist/plugin.js.map +1 -0
  68. package/dist/plugin.mjs +174 -0
  69. package/dist/plugin.mjs.map +1 -0
  70. package/dist/pluginRegistry.d.mts +83 -0
  71. package/dist/pluginRegistry.d.ts +83 -0
  72. package/dist/pluginRegistry.js +303 -0
  73. package/dist/pluginRegistry.js.map +1 -0
  74. package/dist/pluginRegistry.mjs +298 -0
  75. package/dist/pluginRegistry.mjs.map +1 -0
  76. package/dist/{preset.d.cts → preset.d.mts} +29 -2
  77. package/dist/preset.d.ts +29 -2
  78. package/dist/preset.js +318 -21
  79. package/dist/preset.js.map +1 -1
  80. package/dist/preset.mjs +414 -0
  81. package/dist/preset.mjs.map +1 -0
  82. package/dist/rspack.d.mts +33 -0
  83. package/dist/rspack.d.ts +33 -0
  84. package/dist/rspack.js +55 -0
  85. package/dist/rspack.js.map +1 -0
  86. package/dist/rspack.mjs +45 -0
  87. package/dist/rspack.mjs.map +1 -0
  88. package/dist/runtime.d.mts +62 -0
  89. package/dist/runtime.d.ts +62 -0
  90. package/dist/runtime.js +207 -0
  91. package/dist/runtime.js.map +1 -0
  92. package/dist/runtime.mjs +188 -0
  93. package/dist/runtime.mjs.map +1 -0
  94. package/dist/runtimeCss.d.mts +65 -0
  95. package/dist/runtimeCss.d.ts +65 -0
  96. package/dist/runtimeCss.js +188 -0
  97. package/dist/runtimeCss.js.map +1 -0
  98. package/dist/runtimeCss.mjs +173 -0
  99. package/dist/runtimeCss.mjs.map +1 -0
  100. package/dist/scanner.d.mts +25 -0
  101. package/dist/scanner.d.ts +25 -0
  102. package/dist/scanner.js +717 -0
  103. package/dist/scanner.js.map +1 -0
  104. package/dist/scanner.mjs +703 -0
  105. package/dist/scanner.mjs.map +1 -0
  106. package/dist/shared.d.mts +85 -0
  107. package/dist/shared.d.ts +85 -0
  108. package/dist/shared.js +255 -0
  109. package/dist/shared.js.map +1 -0
  110. package/dist/shared.mjs +233 -0
  111. package/dist/shared.mjs.map +1 -0
  112. package/dist/storybookAddon.d.mts +108 -0
  113. package/dist/storybookAddon.d.ts +108 -0
  114. package/dist/storybookAddon.js +95 -0
  115. package/dist/storybookAddon.js.map +1 -0
  116. package/dist/storybookAddon.mjs +88 -0
  117. package/dist/storybookAddon.mjs.map +1 -0
  118. package/dist/svelte.d.mts +114 -0
  119. package/dist/svelte.d.ts +114 -0
  120. package/dist/svelte.js +67 -0
  121. package/dist/svelte.js.map +1 -0
  122. package/dist/svelte.mjs +59 -0
  123. package/dist/svelte.mjs.map +1 -0
  124. package/dist/testing.d.mts +185 -0
  125. package/dist/testing.d.ts +185 -0
  126. package/dist/testing.js +173 -0
  127. package/dist/testing.js.map +1 -0
  128. package/dist/testing.mjs +158 -0
  129. package/dist/testing.mjs.map +1 -0
  130. package/dist/{theme.d.cts → theme.d.mts} +18 -11
  131. package/dist/theme.d.ts +18 -11
  132. package/dist/theme.js +205 -19
  133. package/dist/theme.js.map +1 -1
  134. package/dist/theme.mjs +311 -0
  135. package/dist/theme.mjs.map +1 -0
  136. package/dist/types-DXr2PmGP.d.mts +31 -0
  137. package/dist/types-DXr2PmGP.d.ts +31 -0
  138. package/dist/vite.d.mts +51 -0
  139. package/dist/vite.d.ts +35 -6
  140. package/dist/vite.js +4254 -57
  141. package/dist/vite.js.map +1 -1
  142. package/dist/vite.mjs +4281 -0
  143. package/dist/vite.mjs.map +1 -0
  144. package/dist/vue.d.mts +89 -0
  145. package/dist/vue.d.ts +89 -0
  146. package/dist/vue.js +104 -0
  147. package/dist/vue.js.map +1 -0
  148. package/dist/vue.mjs +96 -0
  149. package/dist/vue.mjs.map +1 -0
  150. package/package.json +173 -67
  151. package/dist/animate.cjs +0 -252
  152. package/dist/animate.cjs.map +0 -1
  153. package/dist/animate.d.cts +0 -117
  154. package/dist/astTransform-ua-eapqs.d.cts +0 -41
  155. package/dist/astTransform-ua-eapqs.d.ts +0 -41
  156. package/dist/compiler.cjs.map +0 -1
  157. package/dist/css.cjs +0 -71
  158. package/dist/css.cjs.map +0 -1
  159. package/dist/css.d.cts +0 -45
  160. package/dist/css.d.ts +0 -45
  161. package/dist/css.js +0 -62
  162. package/dist/css.js.map +0 -1
  163. package/dist/devtools.cjs.map +0 -1
  164. package/dist/index.cjs +0 -1058
  165. package/dist/index.cjs.map +0 -1
  166. package/dist/next.cjs +0 -268
  167. package/dist/next.cjs.map +0 -1
  168. package/dist/next.d.cts +0 -45
  169. package/dist/plugins.cjs +0 -396
  170. package/dist/plugins.cjs.map +0 -1
  171. package/dist/plugins.d.cts +0 -231
  172. package/dist/plugins.d.ts +0 -231
  173. package/dist/plugins.js +0 -381
  174. package/dist/plugins.js.map +0 -1
  175. package/dist/preset.cjs +0 -129
  176. package/dist/preset.cjs.map +0 -1
  177. package/dist/theme.cjs +0 -154
  178. package/dist/theme.cjs.map +0 -1
  179. package/dist/turbopackLoader.cjs +0 -2689
  180. package/dist/turbopackLoader.cjs.map +0 -1
  181. package/dist/turbopackLoader.d.cts +0 -22
  182. package/dist/turbopackLoader.d.ts +0 -22
  183. package/dist/turbopackLoader.js +0 -2681
  184. package/dist/turbopackLoader.js.map +0 -1
  185. package/dist/vite.cjs +0 -105
  186. package/dist/vite.cjs.map +0 -1
  187. package/dist/vite.d.cts +0 -22
  188. package/dist/webpackLoader.cjs +0 -2670
  189. package/dist/webpackLoader.cjs.map +0 -1
  190. package/dist/webpackLoader.d.cts +0 -24
  191. package/dist/webpackLoader.d.ts +0 -24
  192. package/dist/webpackLoader.js +0 -2662
  193. package/dist/webpackLoader.js.map +0 -1
  194. /package/dist/{devtools.d.cts → devtools.d.mts} +0 -0
@@ -1,117 +0,0 @@
1
- /**
2
- * tailwind-styled-v4 — Animation DSL
3
- *
4
- * Compile-time animation system. Define animations dengan Tailwind class,
5
- * compiler generate @keyframes — nol runtime, nol JS overhead.
6
- *
7
- * Usage:
8
- *
9
- * // Cara 1: .animate() chaining pada tw component
10
- * const FadeIn = tw.div.animate({
11
- * from: "opacity-0 translate-y-2",
12
- * to: "opacity-100 translate-y-0",
13
- * duration: 300,
14
- * easing: "ease-out"
15
- * })
16
- *
17
- * // Cara 2: standalone animate() utility
18
- * const fadeIn = animate({
19
- * from: "opacity-0 scale-95",
20
- * to: "opacity-100 scale-100",
21
- * duration: 200,
22
- * })
23
- * const Box = tw.div`${fadeIn}`
24
- *
25
- * // Cara 3: preset animations
26
- * const Card = tw.div`${animations.fadeIn} ${animations.slideUp}`
27
- *
28
- * // Cara 4: tw.keyframes() custom
29
- * const spin = tw.keyframes("spin", {
30
- * "0%": "rotate-0",
31
- * "100%": "rotate-180",
32
- * })
33
- */
34
- interface AnimateOptions {
35
- /** Tailwind classes for animation start state */
36
- from: string;
37
- /** Tailwind classes for animation end state */
38
- to: string;
39
- /** Duration in ms. Default: 300 */
40
- duration?: number;
41
- /** CSS easing. Default: "ease-out" */
42
- easing?: string;
43
- /** Delay in ms. Default: 0 */
44
- delay?: number;
45
- /** Fill mode. Default: "both" */
46
- fill?: "none" | "forwards" | "backwards" | "both";
47
- /** Iteration count. Default: 1 */
48
- iterations?: number | "infinite";
49
- /** Direction. Default: "normal" */
50
- direction?: "normal" | "reverse" | "alternate" | "alternate-reverse";
51
- /** Animation name override (auto-generated from from+to if not set) */
52
- name?: string;
53
- }
54
- interface KeyframesDefinition {
55
- [stop: string]: string;
56
- }
57
- interface CompiledAnimation {
58
- /** CSS animation class name to apply */
59
- className: string;
60
- /** @keyframes CSS to inject */
61
- keyframesCss: string;
62
- /** animation CSS shorthand */
63
- animationCss: string;
64
- }
65
- declare function getAnimationRegistry(): Map<string, CompiledAnimation>;
66
- /**
67
- * Compile AnimateOptions into CSS animation + @keyframes.
68
- *
69
- * Called at build time by the compiler, or at runtime in dev mode.
70
- */
71
- declare function compileAnimation(opts: AnimateOptions): CompiledAnimation;
72
- /**
73
- * Generate an animation class string to use in tw template literals.
74
- *
75
- * @example
76
- * const fadeIn = animate({ from: "opacity-0", to: "opacity-100", duration: 200 })
77
- * const Box = tw.div`${fadeIn} p-4 bg-white`
78
- */
79
- declare function animate(opts: AnimateOptions): string;
80
- /**
81
- * Define a custom keyframe animation with multiple stops.
82
- *
83
- * @example
84
- * const pulse = tw.keyframes("pulse", {
85
- * "0%, 100%": "opacity-100 scale-100",
86
- * "50%": "opacity-50 scale-95",
87
- * })
88
- * const Dot = tw.div`${pulse} w-4 h-4 rounded-full bg-blue-500`
89
- */
90
- declare function keyframes(name: string, stops: KeyframesDefinition): string;
91
- /**
92
- * Collection of ready-to-use animation class strings.
93
- *
94
- * @example
95
- * const Card = tw.div`${animations.fadeIn} p-4 bg-white`
96
- * const Modal = tw.div`${animations.scaleIn} fixed inset-0`
97
- */
98
- declare const animations: {
99
- readonly fadeIn: string;
100
- readonly fadeOut: string;
101
- readonly slideUp: string;
102
- readonly slideDown: string;
103
- readonly slideLeft: string;
104
- readonly slideRight: string;
105
- readonly scaleIn: string;
106
- readonly scaleOut: string;
107
- readonly blurIn: string;
108
- readonly bounceIn: string;
109
- readonly spinIn: string;
110
- };
111
- /**
112
- * Get all compiled animation CSS to inject into a stylesheet.
113
- * Called by the CSS extraction engine at build time.
114
- */
115
- declare function extractAnimationCss(): string;
116
-
117
- export { type AnimateOptions, type CompiledAnimation, type KeyframesDefinition, animate, animations, compileAnimation, extractAnimationCss, getAnimationRegistry, keyframes };
@@ -1,41 +0,0 @@
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 };
@@ -1,41 +0,0 @@
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 };