tailwind-styled-v4 1.0.1 → 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.
Files changed (74) hide show
  1. package/dist/animate.cjs +771 -0
  2. package/dist/animate.cjs.map +1 -0
  3. package/dist/animate.d.cts +73 -0
  4. package/dist/animate.d.ts +73 -0
  5. package/dist/animate.js +752 -0
  6. package/dist/animate.js.map +1 -0
  7. package/dist/chunk-VZEJV27B.js +11 -0
  8. package/dist/chunk-VZEJV27B.js.map +1 -0
  9. package/dist/chunk-Y5D3E72P.cjs +13 -0
  10. package/dist/chunk-Y5D3E72P.cjs.map +1 -0
  11. package/dist/css.cjs +121 -0
  12. package/dist/css.cjs.map +1 -0
  13. package/dist/css.d.cts +30 -0
  14. package/dist/css.d.ts +30 -0
  15. package/dist/css.js +112 -0
  16. package/dist/css.js.map +1 -0
  17. package/dist/devtools.cjs +1071 -0
  18. package/dist/devtools.cjs.map +1 -0
  19. package/dist/devtools.d.cts +22 -0
  20. package/dist/devtools.d.ts +22 -0
  21. package/dist/devtools.js +1064 -0
  22. package/dist/devtools.js.map +1 -0
  23. package/dist/index.cjs +1353 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.cts +655 -0
  26. package/dist/index.d.ts +508 -968
  27. package/dist/index.js +1304 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/next.cjs +248 -0
  30. package/dist/next.cjs.map +1 -0
  31. package/dist/next.d.cts +54 -0
  32. package/dist/next.d.ts +54 -0
  33. package/dist/next.js +241 -0
  34. package/dist/next.js.map +1 -0
  35. package/dist/preset.cjs +423 -0
  36. package/dist/preset.cjs.map +1 -0
  37. package/dist/preset.d.cts +276 -0
  38. package/dist/preset.d.ts +276 -0
  39. package/dist/preset.js +416 -0
  40. package/dist/preset.js.map +1 -0
  41. package/dist/turbopackLoader.cjs +37 -0
  42. package/dist/turbopackLoader.cjs.map +1 -0
  43. package/dist/turbopackLoader.d.cts +12 -0
  44. package/dist/turbopackLoader.d.ts +12 -0
  45. package/dist/turbopackLoader.js +35 -0
  46. package/dist/turbopackLoader.js.map +1 -0
  47. package/dist/vite.cjs +138 -0
  48. package/dist/vite.cjs.map +1 -0
  49. package/dist/vite.d.cts +51 -0
  50. package/dist/vite.d.ts +51 -0
  51. package/dist/vite.js +128 -0
  52. package/dist/vite.js.map +1 -0
  53. package/dist/webpackLoader.cjs +51 -0
  54. package/dist/webpackLoader.cjs.map +1 -0
  55. package/dist/webpackLoader.d.cts +17 -0
  56. package/dist/webpackLoader.d.ts +17 -0
  57. package/dist/webpackLoader.js +49 -0
  58. package/dist/webpackLoader.js.map +1 -0
  59. package/package.json +65 -32
  60. package/CHANGELOG.md +0 -75
  61. package/LICENSE +0 -21
  62. package/README.md +0 -608
  63. package/dist/cli/init.js +0 -208
  64. package/dist/compiler/index.d.mts +0 -214
  65. package/dist/compiler/index.d.ts +0 -214
  66. package/dist/compiler/index.js +0 -546
  67. package/dist/compiler/index.js.map +0 -1
  68. package/dist/compiler/index.mjs +0 -504
  69. package/dist/compiler/index.mjs.map +0 -1
  70. package/dist/index.d.mts +0 -1115
  71. package/dist/index.mjs +0 -4
  72. package/dist/index.mjs.map +0 -1
  73. package/dist/turbopack-loader.js +0 -232
  74. package/dist/webpack-loader.js +0 -213
package/package.json CHANGED
@@ -1,37 +1,68 @@
1
1
  {
2
2
  "name": "tailwind-styled-v4",
3
- "version": "1.0.1",
4
- "description": "Tailwind CSS v4 + styled-componentsvariant engine, prop engine, zero-runtime compiler",
3
+ "version": "5.0.0",
4
+ "description": "Zero-config, zero-runtime, compiler-driven Tailwind stylingtw.div, variants, RSC-aware",
5
5
  "author": "Dictionar32",
6
6
  "license": "MIT",
7
- "main": "./dist/index.js",
8
- "module": "./dist/index.mjs",
9
- "types": "./dist/index.d.ts",
10
- "scripts": {
11
- "build": "tsup",
12
- "dev": "tsup --watch",
13
- "clean": "rm -rf dist"
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "engines": {
10
+ "node": ">=20"
14
11
  },
12
+ "main": "./dist/index.cjs",
13
+ "module": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/index.d.ts",
18
- "import": "./dist/index.mjs",
19
- "require": "./dist/index.js",
20
- "default": "./dist/index.mjs"
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.cjs",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "./next": {
23
+ "types": "./dist/next.d.ts",
24
+ "import": "./dist/next.js",
25
+ "require": "./dist/next.cjs"
26
+ },
27
+ "./vite": {
28
+ "types": "./dist/vite.d.ts",
29
+ "import": "./dist/vite.js",
30
+ "require": "./dist/vite.cjs"
21
31
  },
22
32
  "./compiler": {
23
- "types": "./dist/compiler/index.d.ts",
24
- "import": "./dist/compiler/index.mjs",
25
- "require": "./dist/compiler/index.js"
33
+ "types": "../compiler/dist/index.d.ts",
34
+ "import": "../compiler/dist/index.js",
35
+ "require": "../compiler/dist/index.cjs"
36
+ },
37
+ "./preset": {
38
+ "types": "./dist/preset.d.ts",
39
+ "import": "./dist/preset.js",
40
+ "require": "./dist/preset.cjs"
26
41
  },
27
- "./webpack-loader": {
28
- "require": "./dist/webpack-loader.js"
42
+ "./css": {
43
+ "types": "./dist/css.d.ts",
44
+ "import": "./dist/css.js",
45
+ "require": "./dist/css.cjs"
29
46
  },
30
- "./turbopack-loader": {
31
- "require": "./dist/turbopack-loader.js"
47
+ "./plugins": {
48
+ "types": "../plugin/dist/index.d.ts",
49
+ "import": "../plugin/dist/index.js",
50
+ "require": "../plugin/dist/index.cjs"
32
51
  },
33
- "./cli": {
34
- "require": "./dist/cli/init.js"
52
+ "./devtools": {
53
+ "types": "./dist/devtools.d.ts",
54
+ "import": "./dist/devtools.js",
55
+ "require": "./dist/devtools.cjs"
56
+ },
57
+ "./animate": {
58
+ "types": "./dist/animate.d.ts",
59
+ "import": "./dist/animate.js",
60
+ "require": "./dist/animate.cjs"
61
+ },
62
+ "./theme": {
63
+ "types": "../theme/dist/index.d.ts",
64
+ "import": "../theme/dist/index.js",
65
+ "require": "../theme/dist/index.cjs"
35
66
  },
36
67
  "./package.json": "./package.json"
37
68
  },
@@ -41,27 +72,29 @@
41
72
  "CHANGELOG.md",
42
73
  "LICENSE"
43
74
  ],
44
- "sideEffects": false,
45
- "engines": {
46
- "node": ">=18"
47
- },
48
75
  "dependencies": {
49
- "clsx": "^2",
50
- "tailwind-merge": "^3"
76
+ "tailwind-merge": "^3",
77
+ "postcss": "^8"
51
78
  },
52
79
  "peerDependencies": {
53
80
  "react": ">=18",
54
- "react-dom": ">=18",
55
- "styled-components": ">=6"
81
+ "react-dom": ">=18"
82
+ },
83
+ "peerDependenciesOptional": {
84
+ "tailwindcss": "^4",
85
+ "@tailwindcss/postcss": "^4"
56
86
  },
57
87
  "devDependencies": {
88
+ "@tailwind-styled/animate": "^5.0.0",
58
89
  "@types/node": "^20",
59
90
  "@types/react": "^19",
60
- "@types/react-dom": "^19",
61
91
  "tsup": "^8",
62
92
  "typescript": "^5"
63
93
  },
64
- "bin": {
65
- "tailwind-styled-v4": "./dist/cli/init.js"
94
+ "scripts": {
95
+ "build": "tsup",
96
+ "dev": "tsup --watch",
97
+ "clean": "rm -rf dist",
98
+ "test": "npm run build && node --test test/*.test.mjs"
66
99
  }
67
100
  }
package/CHANGELOG.md DELETED
@@ -1,75 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `tailwind-styled-v4` will be documented here.
4
-
5
- ## [1.0.0] — Initial Release
6
-
7
- ### Added
8
-
9
- #### Core Engine
10
- - `tw` proxy — template literal & object config syntax
11
- - `tw.tag\`classes\`` — template literal API
12
- - `tw.tag({ base, variants, compoundVariants, defaultVariants })` — object config API
13
- - `tw(Component)\`classes\`` — wrap any existing component
14
- - `Component.extend\`extra-classes\`` — chain extra classes
15
- - `Component.withVariants(config)` — merge new variants
16
-
17
- #### Runtime Engines
18
- - **propEngine** — 80+ props (padding, margin, sizing, colors, flex, grid, layout, effects, animation, interaction)
19
- - **responsiveEngine** — `{ base, sm, md, lg, xl, 2xl }` responsive objects
20
- - **variantEngine** — CVA-style variants with `defaultVariants` support
21
- - **compoundVariant** — multi-condition compound variants
22
- - **classResolver** — central resolver combining all engines via `tailwind-merge`
23
-
24
- #### Standalone APIs
25
- - `cv()` — standalone class variants function (shadcn/ui & Radix compatible)
26
- - `withTw(Component, base?)` — HOC untuk wrap third-party components
27
- - `cls\`...\`` — tagged template for static class strings
28
- - `cx(...inputs)` — lightweight class joiner (~100b, zero-dep)
29
- - `cxm(...inputs)` — cx + tailwind-merge deduplication
30
-
31
- #### Plugin System
32
- - `registerPlugin({ name, props })` — custom prop resolver plugins
33
- - `loadBuiltinPlugins()` — 6 built-in plugins: animation, grid, backdrop, gradient, scroll, print
34
- - `listPlugins()` / `getPlugin(name)` — plugin introspection
35
-
36
- #### Theme System
37
- - `setTheme(tokens)` — deep-merge semantic tokens
38
- - `replaceTheme(tokens)` — replace entire theme
39
- - `getTheme()` / `getThemeNamespace(key)` — read current theme
40
- - `onThemeChange(listener)` — subscription API
41
- - `loadDefaultTheme()` — semantic token preset (primary, surface, muted, etc.)
42
- - `loadDarkTheme()` — fintech/crypto/Web3 dark preset
43
-
44
- #### Zero-Runtime Compiler
45
- - `withTailwindStyled(opts)(nextConfig)` — Next.js HOC wrapper
46
- - `tailwindStyledPlugin(opts)` — Vite plugin
47
- - Webpack loader (`tailwind-styled-v4/webpack-loader`)
48
- - Static transform: `tw.div\`p-4\`` → `styled.div.attrs(()=>({className:"p-4"}))\`\``
49
- - Dynamic guard: skips interpolated templates (`${}`) safely
50
- - `data-tw="tw-xxxxx"` attribute injection for DevTools (dev mode)
51
-
52
- #### Build Tools
53
- - `generateTailwindTypes.ts` — generates **58.055** Tailwind class type unions
54
- - `generateSafelist.ts` — scans src/ and outputs `tailwind.safelist.json`
55
- - `extractAllClasses(source)` — extract classes from any source string
56
-
57
- #### IntelliSense
58
- - **58.055 class definitions** in `tailwind.generated.ts`
59
- - Coverage: all colors (21 palettes × 11 shades), spacing, sizing, flexbox, grid, effects, transitions, animations, responsive prefixes (sm/md/lg/xl/2xl), state prefixes (hover/focus/active/disabled/dark/group-hover/peer-hover/focus-visible/focus-within)
60
-
61
- #### Developer Experience
62
- - `shouldForwardProp` — tw props tidak bocor ke DOM attributes
63
- - `blockProp(name)` / `allowProp(name)` — fine-grained forwarding control
64
- - `hashClass(input)` → `"tw-xxxxx"` — stable component hash
65
- - `componentName(tag, classes)` — display name generator for React DevTools
66
- - Source maps enabled in all builds
67
-
68
- #### Stack Compatibility
69
- - Next.js 15/16 (App Router + Pages Router)
70
- - React 18/19
71
- - Tailwind CSS v3/v4
72
- - styled-components v5/v6
73
- - TypeScript 4.9/5.x
74
- - shadcn/ui, Radix UI, Headless UI
75
- - Vite 4/5, Webpack 4/5
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 tailwind-styled-v4
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.