@tenphi/tasty 0.0.0-snapshot.c8bdaeb → 0.0.0-snapshot.cae4fee

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 (303) hide show
  1. package/README.md +314 -159
  2. package/dist/async-storage-B7_o6FKt.js +44 -0
  3. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  4. package/dist/collector-C-keQH9m.js +243 -0
  5. package/dist/collector-C-keQH9m.js.map +1 -0
  6. package/dist/collector-osfWTeRd.d.ts +108 -0
  7. package/dist/config-BBiyxMCe.js +10559 -0
  8. package/dist/config-BBiyxMCe.js.map +1 -0
  9. package/dist/config-BoZDUHW5.d.ts +945 -0
  10. package/dist/context-CkSg-kDT.js +24 -0
  11. package/dist/context-CkSg-kDT.js.map +1 -0
  12. package/dist/core/index.d.ts +5 -33
  13. package/dist/core/index.js +6 -26
  14. package/dist/core-BO4319td.js +1598 -0
  15. package/dist/core-BO4319td.js.map +1 -0
  16. package/dist/css-writer-BWvwQzz0.js +351 -0
  17. package/dist/css-writer-BWvwQzz0.js.map +1 -0
  18. package/dist/format-global-rules-Dbc_1tc3.js +22 -0
  19. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  20. package/dist/format-rules-BSjeH4Z7.js +143 -0
  21. package/dist/format-rules-BSjeH4Z7.js.map +1 -0
  22. package/dist/hydrate-CcvrP4qJ.js +45 -0
  23. package/dist/hydrate-CcvrP4qJ.js.map +1 -0
  24. package/dist/index-B_k47mc_.d.ts +1655 -0
  25. package/dist/index-tcHuMPFt.d.ts +1286 -0
  26. package/dist/index.d.ts +5 -48
  27. package/dist/index.js +731 -32
  28. package/dist/index.js.map +1 -0
  29. package/dist/keyframes-BUQhdOSJ.js +588 -0
  30. package/dist/keyframes-BUQhdOSJ.js.map +1 -0
  31. package/dist/{utils/merge-styles.d.ts → merge-styles-BMWcH6MF.d.ts} +3 -3
  32. package/dist/{utils/merge-styles.js → merge-styles-Cd2vBl9b.js} +4 -6
  33. package/dist/merge-styles-Cd2vBl9b.js.map +1 -0
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-C1nrvnYh.js} +5 -8
  35. package/dist/resolve-recipes-C1nrvnYh.js.map +1 -0
  36. package/dist/ssr/astro-client.d.ts +1 -0
  37. package/dist/ssr/astro-client.js +19 -0
  38. package/dist/ssr/astro-client.js.map +1 -0
  39. package/dist/ssr/astro-middleware.d.ts +15 -0
  40. package/dist/ssr/astro-middleware.js +19 -0
  41. package/dist/ssr/astro-middleware.js.map +1 -0
  42. package/dist/ssr/astro.d.ts +97 -0
  43. package/dist/ssr/astro.js +149 -0
  44. package/dist/ssr/astro.js.map +1 -0
  45. package/dist/ssr/index.d.ts +44 -0
  46. package/dist/ssr/index.js +10 -0
  47. package/dist/ssr/index.js.map +1 -0
  48. package/dist/ssr/next.d.ts +46 -0
  49. package/dist/ssr/next.js +75 -0
  50. package/dist/ssr/next.js.map +1 -0
  51. package/dist/static/index.d.ts +91 -5
  52. package/dist/static/index.js +49 -4
  53. package/dist/static/index.js.map +1 -0
  54. package/dist/static/inject.d.ts +5 -0
  55. package/dist/static/inject.js +17 -0
  56. package/dist/static/inject.js.map +1 -0
  57. package/dist/zero/babel.d.ts +57 -84
  58. package/dist/zero/babel.js +232 -40
  59. package/dist/zero/babel.js.map +1 -1
  60. package/dist/zero/index.d.ts +67 -3
  61. package/dist/zero/index.js +2 -4
  62. package/dist/zero/next.d.ts +56 -30
  63. package/dist/zero/next.js +105 -40
  64. package/dist/zero/next.js.map +1 -1
  65. package/docs/README.md +31 -0
  66. package/docs/adoption.md +298 -0
  67. package/docs/comparison.md +419 -0
  68. package/docs/configuration.md +438 -0
  69. package/docs/debug.md +320 -0
  70. package/docs/design-system.md +436 -0
  71. package/docs/dsl.md +690 -0
  72. package/docs/getting-started.md +217 -0
  73. package/docs/injector.md +544 -0
  74. package/docs/methodology.md +642 -0
  75. package/docs/pipeline.md +699 -0
  76. package/docs/react-api.md +581 -0
  77. package/docs/ssr.md +444 -0
  78. package/docs/styles.md +598 -0
  79. package/docs/tasty-static.md +547 -0
  80. package/package.json +70 -37
  81. package/tasty.config.ts +1 -0
  82. package/dist/_virtual/_rolldown/runtime.js +0 -8
  83. package/dist/chunks/cacheKey.js +0 -70
  84. package/dist/chunks/cacheKey.js.map +0 -1
  85. package/dist/chunks/definitions.d.ts +0 -37
  86. package/dist/chunks/definitions.js +0 -260
  87. package/dist/chunks/definitions.js.map +0 -1
  88. package/dist/chunks/renderChunk.js +0 -61
  89. package/dist/chunks/renderChunk.js.map +0 -1
  90. package/dist/config.d.ts +0 -280
  91. package/dist/config.js +0 -403
  92. package/dist/config.js.map +0 -1
  93. package/dist/debug.d.ts +0 -204
  94. package/dist/debug.js +0 -733
  95. package/dist/debug.js.map +0 -1
  96. package/dist/hooks/useGlobalStyles.d.ts +0 -27
  97. package/dist/hooks/useGlobalStyles.js +0 -56
  98. package/dist/hooks/useGlobalStyles.js.map +0 -1
  99. package/dist/hooks/useKeyframes.d.ts +0 -56
  100. package/dist/hooks/useKeyframes.js +0 -54
  101. package/dist/hooks/useKeyframes.js.map +0 -1
  102. package/dist/hooks/useProperty.d.ts +0 -79
  103. package/dist/hooks/useProperty.js +0 -91
  104. package/dist/hooks/useProperty.js.map +0 -1
  105. package/dist/hooks/useRawCSS.d.ts +0 -53
  106. package/dist/hooks/useRawCSS.js +0 -28
  107. package/dist/hooks/useRawCSS.js.map +0 -1
  108. package/dist/hooks/useStyles.d.ts +0 -40
  109. package/dist/hooks/useStyles.js +0 -169
  110. package/dist/hooks/useStyles.js.map +0 -1
  111. package/dist/injector/index.d.ts +0 -157
  112. package/dist/injector/index.js +0 -154
  113. package/dist/injector/index.js.map +0 -1
  114. package/dist/injector/injector.d.ts +0 -139
  115. package/dist/injector/injector.js +0 -404
  116. package/dist/injector/injector.js.map +0 -1
  117. package/dist/injector/sheet-manager.d.ts +0 -127
  118. package/dist/injector/sheet-manager.js +0 -714
  119. package/dist/injector/sheet-manager.js.map +0 -1
  120. package/dist/injector/types.d.ts +0 -135
  121. package/dist/keyframes/index.js +0 -206
  122. package/dist/keyframes/index.js.map +0 -1
  123. package/dist/parser/classify.js +0 -319
  124. package/dist/parser/classify.js.map +0 -1
  125. package/dist/parser/const.js +0 -33
  126. package/dist/parser/const.js.map +0 -1
  127. package/dist/parser/lru.js +0 -109
  128. package/dist/parser/lru.js.map +0 -1
  129. package/dist/parser/parser.d.ts +0 -25
  130. package/dist/parser/parser.js +0 -116
  131. package/dist/parser/parser.js.map +0 -1
  132. package/dist/parser/tokenizer.js +0 -69
  133. package/dist/parser/tokenizer.js.map +0 -1
  134. package/dist/parser/types.d.ts +0 -51
  135. package/dist/parser/types.js +0 -46
  136. package/dist/parser/types.js.map +0 -1
  137. package/dist/pipeline/conditions.d.ts +0 -134
  138. package/dist/pipeline/conditions.js +0 -406
  139. package/dist/pipeline/conditions.js.map +0 -1
  140. package/dist/pipeline/exclusive.js +0 -231
  141. package/dist/pipeline/exclusive.js.map +0 -1
  142. package/dist/pipeline/index.d.ts +0 -53
  143. package/dist/pipeline/index.js +0 -660
  144. package/dist/pipeline/index.js.map +0 -1
  145. package/dist/pipeline/materialize.js +0 -844
  146. package/dist/pipeline/materialize.js.map +0 -1
  147. package/dist/pipeline/parseStateKey.d.ts +0 -15
  148. package/dist/pipeline/parseStateKey.js +0 -438
  149. package/dist/pipeline/parseStateKey.js.map +0 -1
  150. package/dist/pipeline/simplify.js +0 -516
  151. package/dist/pipeline/simplify.js.map +0 -1
  152. package/dist/pipeline/warnings.js +0 -18
  153. package/dist/pipeline/warnings.js.map +0 -1
  154. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  155. package/dist/plugins/okhsl-plugin.js +0 -371
  156. package/dist/plugins/okhsl-plugin.js.map +0 -1
  157. package/dist/plugins/types.d.ts +0 -69
  158. package/dist/properties/index.js +0 -158
  159. package/dist/properties/index.js.map +0 -1
  160. package/dist/states/index.d.ts +0 -49
  161. package/dist/states/index.js +0 -416
  162. package/dist/states/index.js.map +0 -1
  163. package/dist/static/tastyStatic.d.ts +0 -46
  164. package/dist/static/tastyStatic.js +0 -31
  165. package/dist/static/tastyStatic.js.map +0 -1
  166. package/dist/static/types.d.ts +0 -49
  167. package/dist/static/types.js +0 -24
  168. package/dist/static/types.js.map +0 -1
  169. package/dist/styles/align.d.ts +0 -15
  170. package/dist/styles/align.js +0 -14
  171. package/dist/styles/align.js.map +0 -1
  172. package/dist/styles/border.d.ts +0 -25
  173. package/dist/styles/border.js +0 -114
  174. package/dist/styles/border.js.map +0 -1
  175. package/dist/styles/color.d.ts +0 -14
  176. package/dist/styles/color.js +0 -23
  177. package/dist/styles/color.js.map +0 -1
  178. package/dist/styles/createStyle.js +0 -77
  179. package/dist/styles/createStyle.js.map +0 -1
  180. package/dist/styles/dimension.js +0 -97
  181. package/dist/styles/dimension.js.map +0 -1
  182. package/dist/styles/display.d.ts +0 -37
  183. package/dist/styles/display.js +0 -67
  184. package/dist/styles/display.js.map +0 -1
  185. package/dist/styles/fade.d.ts +0 -15
  186. package/dist/styles/fade.js +0 -58
  187. package/dist/styles/fade.js.map +0 -1
  188. package/dist/styles/fill.d.ts +0 -42
  189. package/dist/styles/fill.js +0 -51
  190. package/dist/styles/fill.js.map +0 -1
  191. package/dist/styles/flow.d.ts +0 -16
  192. package/dist/styles/flow.js +0 -12
  193. package/dist/styles/flow.js.map +0 -1
  194. package/dist/styles/gap.d.ts +0 -31
  195. package/dist/styles/gap.js +0 -37
  196. package/dist/styles/gap.js.map +0 -1
  197. package/dist/styles/height.d.ts +0 -17
  198. package/dist/styles/height.js +0 -20
  199. package/dist/styles/height.js.map +0 -1
  200. package/dist/styles/index.d.ts +0 -2
  201. package/dist/styles/index.js +0 -9
  202. package/dist/styles/index.js.map +0 -1
  203. package/dist/styles/inset.d.ts +0 -52
  204. package/dist/styles/inset.js +0 -150
  205. package/dist/styles/inset.js.map +0 -1
  206. package/dist/styles/justify.d.ts +0 -15
  207. package/dist/styles/justify.js +0 -14
  208. package/dist/styles/justify.js.map +0 -1
  209. package/dist/styles/list.d.ts +0 -16
  210. package/dist/styles/list.js +0 -98
  211. package/dist/styles/list.js.map +0 -1
  212. package/dist/styles/margin.d.ts +0 -24
  213. package/dist/styles/margin.js +0 -104
  214. package/dist/styles/margin.js.map +0 -1
  215. package/dist/styles/outline.d.ts +0 -29
  216. package/dist/styles/outline.js +0 -65
  217. package/dist/styles/outline.js.map +0 -1
  218. package/dist/styles/padding.d.ts +0 -24
  219. package/dist/styles/padding.js +0 -104
  220. package/dist/styles/padding.js.map +0 -1
  221. package/dist/styles/predefined.d.ts +0 -73
  222. package/dist/styles/predefined.js +0 -241
  223. package/dist/styles/predefined.js.map +0 -1
  224. package/dist/styles/preset.d.ts +0 -47
  225. package/dist/styles/preset.js +0 -126
  226. package/dist/styles/preset.js.map +0 -1
  227. package/dist/styles/radius.d.ts +0 -14
  228. package/dist/styles/radius.js +0 -51
  229. package/dist/styles/radius.js.map +0 -1
  230. package/dist/styles/scrollbar.d.ts +0 -21
  231. package/dist/styles/scrollbar.js +0 -112
  232. package/dist/styles/scrollbar.js.map +0 -1
  233. package/dist/styles/shadow.d.ts +0 -14
  234. package/dist/styles/shadow.js +0 -24
  235. package/dist/styles/shadow.js.map +0 -1
  236. package/dist/styles/styledScrollbar.d.ts +0 -47
  237. package/dist/styles/styledScrollbar.js +0 -38
  238. package/dist/styles/styledScrollbar.js.map +0 -1
  239. package/dist/styles/transition.d.ts +0 -14
  240. package/dist/styles/transition.js +0 -158
  241. package/dist/styles/transition.js.map +0 -1
  242. package/dist/styles/types.d.ts +0 -498
  243. package/dist/styles/width.d.ts +0 -17
  244. package/dist/styles/width.js +0 -20
  245. package/dist/styles/width.js.map +0 -1
  246. package/dist/tasty.d.ts +0 -982
  247. package/dist/tasty.js +0 -206
  248. package/dist/tasty.js.map +0 -1
  249. package/dist/tokens/typography.d.ts +0 -19
  250. package/dist/tokens/typography.js +0 -237
  251. package/dist/tokens/typography.js.map +0 -1
  252. package/dist/types.d.ts +0 -184
  253. package/dist/utils/cache-wrapper.js +0 -26
  254. package/dist/utils/cache-wrapper.js.map +0 -1
  255. package/dist/utils/case-converter.js +0 -8
  256. package/dist/utils/case-converter.js.map +0 -1
  257. package/dist/utils/colors.d.ts +0 -5
  258. package/dist/utils/colors.js +0 -9
  259. package/dist/utils/colors.js.map +0 -1
  260. package/dist/utils/css-types.d.ts +0 -7
  261. package/dist/utils/dotize.d.ts +0 -26
  262. package/dist/utils/dotize.js +0 -122
  263. package/dist/utils/dotize.js.map +0 -1
  264. package/dist/utils/filter-base-props.d.ts +0 -15
  265. package/dist/utils/filter-base-props.js +0 -45
  266. package/dist/utils/filter-base-props.js.map +0 -1
  267. package/dist/utils/get-display-name.d.ts +0 -7
  268. package/dist/utils/get-display-name.js +0 -10
  269. package/dist/utils/get-display-name.js.map +0 -1
  270. package/dist/utils/hsl-to-rgb.js +0 -38
  271. package/dist/utils/hsl-to-rgb.js.map +0 -1
  272. package/dist/utils/is-dev-env.js +0 -19
  273. package/dist/utils/is-dev-env.js.map +0 -1
  274. package/dist/utils/is-valid-element-type.js +0 -15
  275. package/dist/utils/is-valid-element-type.js.map +0 -1
  276. package/dist/utils/merge-styles.js.map +0 -1
  277. package/dist/utils/mod-attrs.d.ts +0 -8
  278. package/dist/utils/mod-attrs.js +0 -21
  279. package/dist/utils/mod-attrs.js.map +0 -1
  280. package/dist/utils/okhsl-to-rgb.js +0 -296
  281. package/dist/utils/okhsl-to-rgb.js.map +0 -1
  282. package/dist/utils/process-tokens.d.ts +0 -31
  283. package/dist/utils/process-tokens.js +0 -171
  284. package/dist/utils/process-tokens.js.map +0 -1
  285. package/dist/utils/resolve-recipes.d.ts +0 -17
  286. package/dist/utils/resolve-recipes.js.map +0 -1
  287. package/dist/utils/string.js +0 -8
  288. package/dist/utils/string.js.map +0 -1
  289. package/dist/utils/styles.d.ts +0 -178
  290. package/dist/utils/styles.js +0 -590
  291. package/dist/utils/styles.js.map +0 -1
  292. package/dist/utils/typography.d.ts +0 -36
  293. package/dist/utils/typography.js +0 -53
  294. package/dist/utils/typography.js.map +0 -1
  295. package/dist/utils/warnings.d.ts +0 -16
  296. package/dist/utils/warnings.js +0 -16
  297. package/dist/utils/warnings.js.map +0 -1
  298. package/dist/zero/css-writer.d.ts +0 -45
  299. package/dist/zero/css-writer.js +0 -74
  300. package/dist/zero/css-writer.js.map +0 -1
  301. package/dist/zero/extractor.d.ts +0 -24
  302. package/dist/zero/extractor.js +0 -150
  303. package/dist/zero/extractor.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/tasty",
3
- "version": "0.0.0-snapshot.c8bdaeb",
3
+ "version": "0.0.0-snapshot.cae4fee",
4
4
  "description": "A design-system-integrated styling system and DSL for concise, state-aware UI styling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -8,48 +8,73 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "import": {
12
- "types": "./dist/index.d.ts",
13
- "default": "./dist/index.js"
14
- }
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
15
14
  },
16
15
  "./static": {
17
- "import": {
18
- "types": "./dist/static/index.d.ts",
19
- "default": "./dist/static/index.js"
20
- }
16
+ "types": "./dist/static/index.d.ts",
17
+ "import": "./dist/static/index.js",
18
+ "default": "./dist/static/index.js"
19
+ },
20
+ "./static/inject": {
21
+ "types": "./dist/static/inject.d.ts",
22
+ "import": "./dist/static/inject.js",
23
+ "default": "./dist/static/inject.js"
21
24
  },
22
25
  "./babel-plugin": {
23
- "import": {
24
- "types": "./dist/zero/babel.d.ts",
25
- "default": "./dist/zero/babel.js"
26
- }
26
+ "types": "./dist/zero/babel.d.ts",
27
+ "import": "./dist/zero/babel.js",
28
+ "default": "./dist/zero/babel.js"
27
29
  },
28
30
  "./zero": {
29
- "import": {
30
- "types": "./dist/zero/index.d.ts",
31
- "default": "./dist/zero/index.js"
32
- }
31
+ "types": "./dist/zero/index.d.ts",
32
+ "import": "./dist/zero/index.js",
33
+ "default": "./dist/zero/index.js"
33
34
  },
34
35
  "./next": {
35
- "import": {
36
- "types": "./dist/zero/next.d.ts",
37
- "default": "./dist/zero/next.js"
38
- }
36
+ "types": "./dist/zero/next.d.ts",
37
+ "import": "./dist/zero/next.js",
38
+ "default": "./dist/zero/next.js"
39
39
  },
40
40
  "./core": {
41
- "import": {
42
- "types": "./dist/core/index.d.ts",
43
- "default": "./dist/core/index.js"
44
- }
41
+ "types": "./dist/core/index.d.ts",
42
+ "import": "./dist/core/index.js",
43
+ "default": "./dist/core/index.js"
44
+ },
45
+ "./ssr": {
46
+ "types": "./dist/ssr/index.d.ts",
47
+ "import": "./dist/ssr/index.js",
48
+ "default": "./dist/ssr/index.js"
49
+ },
50
+ "./ssr/next": {
51
+ "types": "./dist/ssr/next.d.ts",
52
+ "import": "./dist/ssr/next.js",
53
+ "default": "./dist/ssr/next.js"
54
+ },
55
+ "./ssr/astro": {
56
+ "types": "./dist/ssr/astro.d.ts",
57
+ "import": "./dist/ssr/astro.js",
58
+ "default": "./dist/ssr/astro.js"
59
+ },
60
+ "./ssr/astro-client": {
61
+ "types": "./dist/ssr/astro-client.d.ts",
62
+ "import": "./dist/ssr/astro-client.js",
63
+ "default": "./dist/ssr/astro-client.js"
45
64
  },
46
65
  "./tasty.config": "./tasty.config.ts"
47
66
  },
48
67
  "files": [
49
68
  "dist",
69
+ "docs",
50
70
  "tasty.config.ts"
51
71
  ],
52
- "sideEffects": false,
72
+ "sideEffects": [
73
+ "./dist/ssr/index.js",
74
+ "./dist/ssr/next.js",
75
+ "./dist/ssr/astro.js",
76
+ "./dist/ssr/astro-client.js"
77
+ ],
53
78
  "engines": {
54
79
  "node": ">=20"
55
80
  },
@@ -64,10 +89,13 @@
64
89
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
65
90
  "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
66
91
  "size": "size-limit",
92
+ "bench": "vitest bench",
67
93
  "prepublishOnly": "pnpm run build",
68
94
  "changeset": "changeset",
69
95
  "version": "changeset version",
70
- "release": "changeset publish"
96
+ "release": "changeset publish",
97
+ "hygiene": "pnpm lint && pnpm format:check && pnpm typecheck",
98
+ "hygiene:fix": "pnpm lint:fix && pnpm format && pnpm typecheck"
71
99
  },
72
100
  "repository": {
73
101
  "type": "git",
@@ -94,6 +122,7 @@
94
122
  "@babel/core": "^7.24.0",
95
123
  "@babel/helper-plugin-utils": "^7.24.0",
96
124
  "@babel/types": "^7.24.0",
125
+ "jiti": "^2.6.1",
97
126
  "react": "^18.0.0 || ^19.0.0"
98
127
  },
99
128
  "peerDependenciesMeta": {
@@ -108,6 +137,9 @@
108
137
  },
109
138
  "react": {
110
139
  "optional": true
140
+ },
141
+ "jiti": {
142
+ "optional": true
111
143
  }
112
144
  },
113
145
  "dependencies": {
@@ -115,7 +147,7 @@
115
147
  },
116
148
  "devDependencies": {
117
149
  "@babel/core": "^7.24.0",
118
- "@changesets/changelog-github": "^0.5.2",
150
+ "@changesets/changelog-github": "^0.7.0",
119
151
  "@changesets/cli": "^2.29.8",
120
152
  "@eslint/js": "^10.0.1",
121
153
  "@size-limit/esbuild": "^12.0.0",
@@ -129,12 +161,13 @@
129
161
  "@vitest/runner": "^4.0.18",
130
162
  "eslint": "^10.0.0",
131
163
  "eslint-config-prettier": "^10.1.8",
132
- "jsdom": "^28.1.0",
164
+ "happy-dom": "^20.9.0",
165
+ "jsdom": "^29.0.2",
133
166
  "prettier": "^3.8.1",
134
167
  "react": "^19.0.0",
135
168
  "size-limit": "^12.0.0",
136
- "tsdown": "^0.20.3",
137
- "typescript": "^5.9.3",
169
+ "tsdown": "^0.22.0",
170
+ "typescript": "^6.0.2",
138
171
  "typescript-eslint": "^8.56.0",
139
172
  "vitest": "^4.0.18"
140
173
  },
@@ -143,25 +176,25 @@
143
176
  "esbuild"
144
177
  ]
145
178
  },
146
- "packageManager": "pnpm@10.29.3",
179
+ "packageManager": "pnpm@11.0.8",
147
180
  "size-limit": [
148
181
  {
149
182
  "name": "main (import *)",
150
183
  "path": "dist/index.js",
151
184
  "import": "*",
152
- "limit": "45 kB"
185
+ "limit": "52 kB"
153
186
  },
154
187
  {
155
188
  "name": "core (import *)",
156
189
  "path": "dist/core/index.js",
157
190
  "import": "*",
158
- "limit": "45 kB"
191
+ "limit": "49.5 kB"
159
192
  },
160
193
  {
161
194
  "name": "static",
162
195
  "path": "dist/static/index.js",
163
196
  "import": "*",
164
- "limit": "2 kB"
197
+ "limit": "17 kB"
165
198
  },
166
199
  {
167
200
  "name": "zero",
@@ -172,7 +205,7 @@
172
205
  "path",
173
206
  "crypto"
174
207
  ],
175
- "limit": "25 kB"
208
+ "limit": "31 kB"
176
209
  },
177
210
  {
178
211
  "name": "babel-plugin",
@@ -183,7 +216,7 @@
183
216
  "path",
184
217
  "crypto"
185
218
  ],
186
- "limit": "35 kB"
219
+ "limit": "45.65 kB"
187
220
  }
188
221
  ]
189
222
  }
package/tasty.config.ts CHANGED
@@ -3,6 +3,7 @@ export default {
3
3
  '#white',
4
4
  '#black',
5
5
  '#current',
6
+ '#clear',
6
7
  '$gap',
7
8
  '$radius',
8
9
  '$border-width',
@@ -1,8 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
3
- if (typeof require !== "undefined") return require.apply(this, arguments);
4
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
5
- });
6
-
7
- //#endregion
8
- export { __require };
@@ -1,70 +0,0 @@
1
- import { extractLocalPredefinedStates, extractPredefinedStateRefs } from "../states/index.js";
2
-
3
- //#region src/chunks/cacheKey.ts
4
- /**
5
- * Chunk-specific cache key generation.
6
- *
7
- * Generates cache keys that only include styles relevant to a specific chunk,
8
- * enabling more granular caching and reuse.
9
- *
10
- * Enhanced to support predefined states:
11
- * - Global predefined states don't affect cache keys (constant across app)
12
- * - Local predefined states only affect cache keys if referenced in the chunk
13
- */
14
- /**
15
- * Recursively serialize a value with sorted keys for stable output.
16
- * This ensures that {a: 1, b: 2} and {b: 2, a: 1} produce the same string.
17
- */
18
- function stableStringify(value) {
19
- if (value === null) return "null";
20
- if (value === void 0) return "undefined";
21
- if (typeof value !== "object") return JSON.stringify(value);
22
- if (Array.isArray(value)) return "[" + value.map(stableStringify).join(",") + "]";
23
- const obj = value;
24
- const sortedKeys = Object.keys(obj).sort();
25
- const parts = [];
26
- for (const key of sortedKeys) if (obj[key] !== void 0) parts.push(`${JSON.stringify(key)}:${stableStringify(obj[key])}`);
27
- return "{" + parts.join(",") + "}";
28
- }
29
- /**
30
- * Generate a cache key for a specific chunk.
31
- *
32
- * Only includes the styles that belong to this chunk, allowing
33
- * chunks to be cached independently.
34
- *
35
- * Also includes relevant local predefined states that are referenced
36
- * by this chunk's styles.
37
- *
38
- * @param styles - The full styles object
39
- * @param chunkName - Name of the chunk
40
- * @param styleKeys - Keys of styles belonging to this chunk
41
- * @returns A stable cache key string
42
- */
43
- function generateChunkCacheKey(styles, chunkName, styleKeys) {
44
- const parts = [chunkName];
45
- const sortedKeys = styleKeys.slice().sort();
46
- let chunkStylesStr = "";
47
- for (const key of sortedKeys) {
48
- const value = styles[key];
49
- if (value !== void 0) {
50
- const serialized = stableStringify(value);
51
- parts.push(`${key}:${serialized}`);
52
- chunkStylesStr += serialized;
53
- }
54
- }
55
- const localStates = extractLocalPredefinedStates(styles);
56
- if (Object.keys(localStates).length > 0) {
57
- const referencedStates = extractPredefinedStateRefs(chunkStylesStr);
58
- const relevantLocalStates = [];
59
- for (const stateName of referencedStates) if (localStates[stateName]) relevantLocalStates.push(`${stateName}=${localStates[stateName]}`);
60
- if (relevantLocalStates.length > 0) {
61
- relevantLocalStates.sort();
62
- parts.unshift(`[states:${relevantLocalStates.join("|")}]`);
63
- }
64
- }
65
- return parts.join("\0");
66
- }
67
-
68
- //#endregion
69
- export { generateChunkCacheKey };
70
- //# sourceMappingURL=cacheKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheKey.js","names":[],"sources":["../../src/chunks/cacheKey.ts"],"sourcesContent":["/**\n * Chunk-specific cache key generation.\n *\n * Generates cache keys that only include styles relevant to a specific chunk,\n * enabling more granular caching and reuse.\n *\n * Enhanced to support predefined states:\n * - Global predefined states don't affect cache keys (constant across app)\n * - Local predefined states only affect cache keys if referenced in the chunk\n */\n\nimport {\n extractLocalPredefinedStates,\n extractPredefinedStateRefs,\n} from '../states';\nimport type { Styles } from '../styles/types';\n\n/**\n * Recursively serialize a value with sorted keys for stable output.\n * This ensures that {a: 1, b: 2} and {b: 2, a: 1} produce the same string.\n */\nfunction stableStringify(value: unknown): string {\n if (value === null) {\n return 'null';\n }\n if (value === undefined) {\n return 'undefined';\n }\n if (typeof value !== 'object') {\n return JSON.stringify(value);\n }\n if (Array.isArray(value)) {\n return '[' + value.map(stableStringify).join(',') + ']';\n }\n // Object: sort keys for stable order\n const obj = value as Record<string, unknown>;\n const sortedKeys = Object.keys(obj).sort();\n const parts: string[] = [];\n for (const key of sortedKeys) {\n if (obj[key] !== undefined) {\n parts.push(`${JSON.stringify(key)}:${stableStringify(obj[key])}`);\n }\n }\n return '{' + parts.join(',') + '}';\n}\n\n/**\n * Generate a cache key for a specific chunk.\n *\n * Only includes the styles that belong to this chunk, allowing\n * chunks to be cached independently.\n *\n * Also includes relevant local predefined states that are referenced\n * by this chunk's styles.\n *\n * @param styles - The full styles object\n * @param chunkName - Name of the chunk\n * @param styleKeys - Keys of styles belonging to this chunk\n * @returns A stable cache key string\n */\nexport function generateChunkCacheKey(\n styles: Styles,\n chunkName: string,\n styleKeys: string[],\n): string {\n // Start with chunk name for namespace separation\n const parts: string[] = [chunkName];\n\n // Sort keys for stable ordering\n const sortedKeys = styleKeys.slice().sort();\n\n // Build the chunk-specific styles string for predefined state detection\n let chunkStylesStr = '';\n\n for (const key of sortedKeys) {\n const value = styles[key];\n if (value !== undefined) {\n // Use stable stringify for consistent serialization regardless of key order\n const serialized = stableStringify(value);\n parts.push(`${key}:${serialized}`);\n chunkStylesStr += serialized;\n }\n }\n\n // Extract local predefined states from the full styles object\n const localStates = extractLocalPredefinedStates(styles);\n\n // Only include local predefined states that are actually referenced in this chunk\n if (Object.keys(localStates).length > 0) {\n const referencedStates = extractPredefinedStateRefs(chunkStylesStr);\n const relevantLocalStates: string[] = [];\n\n for (const stateName of referencedStates) {\n if (localStates[stateName]) {\n relevantLocalStates.push(`${stateName}=${localStates[stateName]}`);\n }\n }\n\n // Add relevant local states to the cache key (sorted for stability)\n if (relevantLocalStates.length > 0) {\n relevantLocalStates.sort();\n parts.unshift(`[states:${relevantLocalStates.join('|')}]`);\n }\n }\n\n // Use null character as separator (safe, not in JSON output)\n return parts.join('\\0');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,SAAS,gBAAgB,OAAwB;AAC/C,KAAI,UAAU,KACZ,QAAO;AAET,KAAI,UAAU,OACZ,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO,KAAK,UAAU,MAAM;AAE9B,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,MAAM,IAAI,gBAAgB,CAAC,KAAK,IAAI,GAAG;CAGtD,MAAM,MAAM;CACZ,MAAM,aAAa,OAAO,KAAK,IAAI,CAAC,MAAM;CAC1C,MAAM,QAAkB,EAAE;AAC1B,MAAK,MAAM,OAAO,WAChB,KAAI,IAAI,SAAS,OACf,OAAM,KAAK,GAAG,KAAK,UAAU,IAAI,CAAC,GAAG,gBAAgB,IAAI,KAAK,GAAG;AAGrE,QAAO,MAAM,MAAM,KAAK,IAAI,GAAG;;;;;;;;;;;;;;;;AAiBjC,SAAgB,sBACd,QACA,WACA,WACQ;CAER,MAAM,QAAkB,CAAC,UAAU;CAGnC,MAAM,aAAa,UAAU,OAAO,CAAC,MAAM;CAG3C,IAAI,iBAAiB;AAErB,MAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,OAAO;AACrB,MAAI,UAAU,QAAW;GAEvB,MAAM,aAAa,gBAAgB,MAAM;AACzC,SAAM,KAAK,GAAG,IAAI,GAAG,aAAa;AAClC,qBAAkB;;;CAKtB,MAAM,cAAc,6BAA6B,OAAO;AAGxD,KAAI,OAAO,KAAK,YAAY,CAAC,SAAS,GAAG;EACvC,MAAM,mBAAmB,2BAA2B,eAAe;EACnE,MAAM,sBAAgC,EAAE;AAExC,OAAK,MAAM,aAAa,iBACtB,KAAI,YAAY,WACd,qBAAoB,KAAK,GAAG,UAAU,GAAG,YAAY,aAAa;AAKtE,MAAI,oBAAoB,SAAS,GAAG;AAClC,uBAAoB,MAAM;AAC1B,SAAM,QAAQ,WAAW,oBAAoB,KAAK,IAAI,CAAC,GAAG;;;AAK9D,QAAO,MAAM,KAAK,KAAK"}
@@ -1,37 +0,0 @@
1
- //#region src/chunks/definitions.d.ts
2
- declare const CHUNK_NAMES: {
3
- /** Special chunk for styles that cannot be split (e.g., @starting-style) */readonly COMBINED: "combined";
4
- readonly SUBCOMPONENTS: "subcomponents";
5
- readonly APPEARANCE: "appearance";
6
- readonly FONT: "font";
7
- readonly DIMENSION: "dimension";
8
- readonly DISPLAY: "display";
9
- readonly LAYOUT: "layout";
10
- readonly POSITION: "position";
11
- readonly MISC: "misc";
12
- };
13
- type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
14
- /**
15
- * Pre-computed map for O(1) style-to-chunk lookup.
16
- * Built once at module load time.
17
- */
18
- declare const STYLE_TO_CHUNK: Map<string, ChunkName>;
19
- interface ChunkInfo {
20
- /** Name of the chunk */
21
- name: ChunkName | string;
22
- /** Style keys belonging to this chunk */
23
- styleKeys: string[];
24
- }
25
- /**
26
- * Categorize style keys into chunks.
27
- *
28
- * Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
29
- * of the order of keys in the input styles object.
30
- *
31
- * @param styles - The styles object to categorize
32
- * @returns Map of chunk name to array of style keys in that chunk (in priority order)
33
- */
34
- declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
35
- //#endregion
36
- export { CHUNK_NAMES, ChunkInfo, ChunkName, STYLE_TO_CHUNK, categorizeStyleKeys };
37
- //# sourceMappingURL=definitions.d.ts.map
@@ -1,260 +0,0 @@
1
- import { isSelector } from "../pipeline/index.js";
2
-
3
- //#region src/chunks/definitions.ts
4
- /**
5
- * Style chunk definitions for CSS chunking optimization.
6
- *
7
- * Styles are grouped into chunks based on:
8
- * 1. Handler dependencies - styles that share a handler MUST be in the same chunk
9
- * 2. Logical grouping - related styles grouped for better cache reuse
10
- *
11
- * See STYLE_CHUNKING_SPEC.md for detailed rationale.
12
- *
13
- * ============================================================================
14
- * ⚠️ CRITICAL ARCHITECTURAL CONSTRAINT: NO CROSS-CHUNK HANDLER DEPENDENCIES
15
- * ============================================================================
16
- *
17
- * Style handlers declare their dependencies via `__lookupStyles` array.
18
- * This creates a dependency graph where handlers read multiple style props.
19
- *
20
- * **ALL styles in a handler's `__lookupStyles` MUST be in the SAME chunk.**
21
- *
22
- * Why this matters:
23
- * 1. Each chunk computes a cache key from ONLY its own style values
24
- * 2. If a handler reads a style from another chunk, that value isn't in the cache key
25
- * 3. Changing the cross-chunk style won't invalidate this chunk's cache
26
- * 4. Result: stale CSS output or incorrect cache hits
27
- *
28
- * Example of a violation:
29
- * ```
30
- * // flowStyle.__lookupStyles = ['display', 'flow']
31
- * // If 'display' is in DISPLAY chunk and 'flow' is in LAYOUT chunk:
32
- * // - User sets { display: 'grid', flow: 'column' }
33
- * // - LAYOUT chunk caches CSS with flow=column, display=grid
34
- * // - User changes to { display: 'flex', flow: 'column' }
35
- * // - LAYOUT chunk cache key unchanged (only has 'flow')
36
- * // - Returns stale CSS computed with display=grid!
37
- * ```
38
- *
39
- * Before adding/moving styles, verify:
40
- * 1. Find all handlers that use this style (grep for the style name in __lookupStyles)
41
- * 2. Ensure ALL styles from each handler's __lookupStyles are in the same chunk
42
- * ============================================================================
43
- */
44
- /**
45
- * Appearance chunk - visual styling with independent handlers
46
- */
47
- const APPEARANCE_CHUNK_STYLES = [
48
- "fill",
49
- "color",
50
- "opacity",
51
- "border",
52
- "radius",
53
- "outline",
54
- "outlineOffset",
55
- "shadow",
56
- "fade"
57
- ];
58
- /**
59
- * Font chunk - typography styles
60
- *
61
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
62
- * ⚠️ presetStyle: preset, fontSize, lineHeight, letterSpacing, textTransform,
63
- * fontWeight, fontStyle, font
64
- */
65
- const FONT_CHUNK_STYLES = [
66
- "preset",
67
- "font",
68
- "fontWeight",
69
- "fontStyle",
70
- "fontSize",
71
- "lineHeight",
72
- "letterSpacing",
73
- "textTransform",
74
- "fontFamily",
75
- "textAlign",
76
- "textDecoration",
77
- "wordBreak",
78
- "wordWrap",
79
- "boldFontWeight"
80
- ];
81
- /**
82
- * Dimension chunk - sizing and spacing
83
- *
84
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
85
- * ⚠️ paddingStyle: padding, paddingTop/Right/Bottom/Left, paddingBlock/Inline
86
- * ⚠️ marginStyle: margin, marginTop/Right/Bottom/Left, marginBlock/Inline
87
- * ⚠️ widthStyle: width, minWidth, maxWidth
88
- * ⚠️ heightStyle: height, minHeight, maxHeight
89
- */
90
- const DIMENSION_CHUNK_STYLES = [
91
- "padding",
92
- "paddingTop",
93
- "paddingRight",
94
- "paddingBottom",
95
- "paddingLeft",
96
- "paddingBlock",
97
- "paddingInline",
98
- "margin",
99
- "marginTop",
100
- "marginRight",
101
- "marginBottom",
102
- "marginLeft",
103
- "marginBlock",
104
- "marginInline",
105
- "width",
106
- "minWidth",
107
- "maxWidth",
108
- "height",
109
- "minHeight",
110
- "maxHeight",
111
- "flexBasis",
112
- "flexGrow",
113
- "flexShrink",
114
- "flex"
115
- ];
116
- /**
117
- * Display chunk - display mode, layout flow, text overflow, and scrollbar
118
- *
119
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
120
- * ⚠️ displayStyle: display, hide, textOverflow, overflow, whiteSpace
121
- * ⚠️ flowStyle: display, flow
122
- * ⚠️ gapStyle: display, flow, gap
123
- * ⚠️ scrollbarStyle: scrollbar, overflow
124
- */
125
- const DISPLAY_CHUNK_STYLES = [
126
- "display",
127
- "hide",
128
- "textOverflow",
129
- "overflow",
130
- "whiteSpace",
131
- "flow",
132
- "gap",
133
- "scrollbar",
134
- "styledScrollbar"
135
- ];
136
- /**
137
- * Layout chunk - flex/grid alignment and grid templates
138
- *
139
- * Note: flow and gap are in DISPLAY chunk due to handler dependencies
140
- * (flowStyle and gapStyle both require 'display' prop).
141
- */
142
- const LAYOUT_CHUNK_STYLES = [
143
- "placeItems",
144
- "placeContent",
145
- "alignItems",
146
- "alignContent",
147
- "justifyItems",
148
- "justifyContent",
149
- "align",
150
- "justify",
151
- "place",
152
- "columnGap",
153
- "rowGap",
154
- "gridColumns",
155
- "gridRows",
156
- "gridTemplate",
157
- "gridAreas",
158
- "gridAutoFlow",
159
- "gridAutoColumns",
160
- "gridAutoRows"
161
- ];
162
- /**
163
- * Position chunk - element positioning
164
- *
165
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
166
- * ⚠️ insetStyle: inset, insetBlock, insetInline, top, right, bottom, left
167
- */
168
- const POSITION_CHUNK_STYLES = [
169
- "position",
170
- "inset",
171
- "insetBlock",
172
- "insetInline",
173
- "top",
174
- "right",
175
- "bottom",
176
- "left",
177
- "zIndex",
178
- "gridArea",
179
- "gridColumn",
180
- "gridRow",
181
- "order",
182
- "placeSelf",
183
- "alignSelf",
184
- "justifySelf",
185
- "transform",
186
- "transition",
187
- "animation"
188
- ];
189
- const CHUNK_NAMES = {
190
- COMBINED: "combined",
191
- SUBCOMPONENTS: "subcomponents",
192
- APPEARANCE: "appearance",
193
- FONT: "font",
194
- DIMENSION: "dimension",
195
- DISPLAY: "display",
196
- LAYOUT: "layout",
197
- POSITION: "position",
198
- MISC: "misc"
199
- };
200
- /**
201
- * Pre-computed map for O(1) style-to-chunk lookup.
202
- * Built once at module load time.
203
- */
204
- const STYLE_TO_CHUNK = /* @__PURE__ */ new Map();
205
- function populateStyleToChunkMap() {
206
- for (const style of APPEARANCE_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.APPEARANCE);
207
- for (const style of FONT_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.FONT);
208
- for (const style of DIMENSION_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.DIMENSION);
209
- for (const style of DISPLAY_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.DISPLAY);
210
- for (const style of LAYOUT_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.LAYOUT);
211
- for (const style of POSITION_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.POSITION);
212
- }
213
- populateStyleToChunkMap();
214
- /**
215
- * Chunk processing order. This ensures deterministic className allocation
216
- * regardless of style key order in the input.
217
- */
218
- const CHUNK_ORDER = [
219
- CHUNK_NAMES.APPEARANCE,
220
- CHUNK_NAMES.FONT,
221
- CHUNK_NAMES.DIMENSION,
222
- CHUNK_NAMES.DISPLAY,
223
- CHUNK_NAMES.LAYOUT,
224
- CHUNK_NAMES.POSITION,
225
- CHUNK_NAMES.MISC,
226
- CHUNK_NAMES.SUBCOMPONENTS
227
- ];
228
- new Map(CHUNK_ORDER.map((name, index) => [name, index]));
229
- /**
230
- * Categorize style keys into chunks.
231
- *
232
- * Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
233
- * of the order of keys in the input styles object.
234
- *
235
- * @param styles - The styles object to categorize
236
- * @returns Map of chunk name to array of style keys in that chunk (in priority order)
237
- */
238
- function categorizeStyleKeys(styles) {
239
- const chunkData = {};
240
- const keys = Object.keys(styles);
241
- for (const key of keys) {
242
- if (key === "$" || key === "@keyframes" || key === "@properties" || key === "recipe") continue;
243
- if (isSelector(key)) {
244
- if (!chunkData[CHUNK_NAMES.SUBCOMPONENTS]) chunkData[CHUNK_NAMES.SUBCOMPONENTS] = [];
245
- chunkData[CHUNK_NAMES.SUBCOMPONENTS].push(key);
246
- } else {
247
- const chunkName = STYLE_TO_CHUNK.get(key) ?? CHUNK_NAMES.MISC;
248
- if (!chunkData[chunkName]) chunkData[chunkName] = [];
249
- chunkData[chunkName].push(key);
250
- }
251
- }
252
- const orderedChunks = /* @__PURE__ */ new Map();
253
- for (const chunkName of CHUNK_ORDER) if (chunkData[chunkName] && chunkData[chunkName].length > 0) orderedChunks.set(chunkName, chunkData[chunkName].sort());
254
- for (const chunkName of Object.keys(chunkData)) if (!orderedChunks.has(chunkName)) orderedChunks.set(chunkName, chunkData[chunkName].sort());
255
- return orderedChunks;
256
- }
257
-
258
- //#endregion
259
- export { CHUNK_NAMES, STYLE_TO_CHUNK, categorizeStyleKeys };
260
- //# sourceMappingURL=definitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"definitions.js","names":[],"sources":["../../src/chunks/definitions.ts"],"sourcesContent":["/**\n * Style chunk definitions for CSS chunking optimization.\n *\n * Styles are grouped into chunks based on:\n * 1. Handler dependencies - styles that share a handler MUST be in the same chunk\n * 2. Logical grouping - related styles grouped for better cache reuse\n *\n * See STYLE_CHUNKING_SPEC.md for detailed rationale.\n *\n * ============================================================================\n * ⚠️ CRITICAL ARCHITECTURAL CONSTRAINT: NO CROSS-CHUNK HANDLER DEPENDENCIES\n * ============================================================================\n *\n * Style handlers declare their dependencies via `__lookupStyles` array.\n * This creates a dependency graph where handlers read multiple style props.\n *\n * **ALL styles in a handler's `__lookupStyles` MUST be in the SAME chunk.**\n *\n * Why this matters:\n * 1. Each chunk computes a cache key from ONLY its own style values\n * 2. If a handler reads a style from another chunk, that value isn't in the cache key\n * 3. Changing the cross-chunk style won't invalidate this chunk's cache\n * 4. Result: stale CSS output or incorrect cache hits\n *\n * Example of a violation:\n * ```\n * // flowStyle.__lookupStyles = ['display', 'flow']\n * // If 'display' is in DISPLAY chunk and 'flow' is in LAYOUT chunk:\n * // - User sets { display: 'grid', flow: 'column' }\n * // - LAYOUT chunk caches CSS with flow=column, display=grid\n * // - User changes to { display: 'flex', flow: 'column' }\n * // - LAYOUT chunk cache key unchanged (only has 'flow')\n * // - Returns stale CSS computed with display=grid!\n * ```\n *\n * Before adding/moving styles, verify:\n * 1. Find all handlers that use this style (grep for the style name in __lookupStyles)\n * 2. Ensure ALL styles from each handler's __lookupStyles are in the same chunk\n * ============================================================================\n */\n\nimport { isSelector } from '../pipeline';\n\n// ============================================================================\n// Chunk Style Lists\n// ============================================================================\n\n/**\n * Appearance chunk - visual styling with independent handlers\n */\nexport const APPEARANCE_CHUNK_STYLES = [\n 'fill', // fillStyle (independent)\n 'color', // colorStyle (independent)\n 'opacity', // independent\n 'border', // borderStyle (independent)\n 'radius', // radiusStyle (independent)\n 'outline', // outlineStyle: outline ↔ outlineOffset\n 'outlineOffset', // outlineStyle: outline ↔ outlineOffset\n 'shadow', // shadowStyle (independent)\n 'fade', // fadeStyle (independent)\n] as const;\n\n/**\n * Font chunk - typography styles\n *\n * Handler dependencies (all styles in each handler MUST stay in this chunk):\n * ⚠️ presetStyle: preset, fontSize, lineHeight, letterSpacing, textTransform,\n * fontWeight, fontStyle, font\n */\nexport const FONT_CHUNK_STYLES = [\n // All from presetStyle handler - MUST stay together\n 'preset',\n 'font',\n 'fontWeight',\n 'fontStyle',\n 'fontSize',\n 'lineHeight',\n 'letterSpacing',\n 'textTransform',\n // Independent text styles grouped for cohesion\n 'fontFamily', // independent alias (logical grouping with font styles)\n 'textAlign',\n 'textDecoration',\n 'wordBreak',\n 'wordWrap',\n 'boldFontWeight',\n] as const;\n\n/**\n * Dimension chunk - sizing and spacing\n *\n * Handler dependencies (all styles in each handler MUST stay in this chunk):\n * ⚠️ paddingStyle: padding, paddingTop/Right/Bottom/Left, paddingBlock/Inline\n * ⚠️ marginStyle: margin, marginTop/Right/Bottom/Left, marginBlock/Inline\n * ⚠️ widthStyle: width, minWidth, maxWidth\n * ⚠️ heightStyle: height, minHeight, maxHeight\n */\nexport const DIMENSION_CHUNK_STYLES = [\n // All from paddingStyle handler - MUST stay together\n 'padding',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingBlock',\n 'paddingInline',\n // All from marginStyle handler - MUST stay together\n 'margin',\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'marginBlock',\n 'marginInline',\n // widthStyle handler - MUST stay together\n 'width',\n 'minWidth',\n 'maxWidth',\n // heightStyle handler - MUST stay together\n 'height',\n 'minHeight',\n 'maxHeight',\n 'flexBasis',\n 'flexGrow',\n 'flexShrink',\n 'flex',\n] as const;\n\n/**\n * Display chunk - display mode, layout flow, text overflow, and scrollbar\n *\n * Handler dependencies (all styles in each handler MUST stay in this chunk):\n * ⚠️ displayStyle: display, hide, textOverflow, overflow, whiteSpace\n * ⚠️ flowStyle: display, flow\n * ⚠️ gapStyle: display, flow, gap\n * ⚠️ scrollbarStyle: scrollbar, overflow\n */\nexport const DISPLAY_CHUNK_STYLES = [\n // displayStyle handler\n 'display',\n 'hide',\n 'textOverflow',\n 'overflow', // also used by scrollbarStyle\n 'whiteSpace',\n // flowStyle handler (requires display)\n 'flow',\n // gapStyle handler (requires display, flow)\n 'gap',\n // scrollbarStyle handler (requires overflow)\n 'scrollbar',\n 'styledScrollbar', // styledScrollbarStyle (deprecated)\n] as const;\n\n/**\n * Layout chunk - flex/grid alignment and grid templates\n *\n * Note: flow and gap are in DISPLAY chunk due to handler dependencies\n * (flowStyle and gapStyle both require 'display' prop).\n */\nexport const LAYOUT_CHUNK_STYLES = [\n // Alignment styles (all independent handlers)\n 'placeItems',\n 'placeContent',\n 'alignItems',\n 'alignContent',\n 'justifyItems',\n 'justifyContent',\n 'align', // alignStyle (independent)\n 'justify', // justifyStyle (independent)\n 'place', // placeStyle (independent)\n 'columnGap',\n 'rowGap',\n // Grid template styles\n 'gridColumns',\n 'gridRows',\n 'gridTemplate',\n 'gridAreas',\n 'gridAutoFlow',\n 'gridAutoColumns',\n 'gridAutoRows',\n] as const;\n\n/**\n * Position chunk - element positioning\n *\n * Handler dependencies (all styles in each handler MUST stay in this chunk):\n * ⚠️ insetStyle: inset, insetBlock, insetInline, top, right, bottom, left\n */\nexport const POSITION_CHUNK_STYLES = [\n 'position',\n // All from insetStyle handler - MUST stay together\n 'inset',\n 'insetBlock',\n 'insetInline',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'zIndex',\n 'gridArea',\n 'gridColumn',\n 'gridRow',\n 'order',\n 'placeSelf',\n 'alignSelf',\n 'justifySelf',\n 'transform',\n 'transition',\n 'animation',\n] as const;\n\n// ============================================================================\n// Chunk Names\n// ============================================================================\n\nexport const CHUNK_NAMES = {\n /** Special chunk for styles that cannot be split (e.g., @starting-style) */\n COMBINED: 'combined',\n SUBCOMPONENTS: 'subcomponents',\n APPEARANCE: 'appearance',\n FONT: 'font',\n DIMENSION: 'dimension',\n DISPLAY: 'display',\n LAYOUT: 'layout',\n POSITION: 'position',\n MISC: 'misc',\n} as const;\n\nexport type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];\n\n// ============================================================================\n// Style-to-Chunk Lookup Map (O(1) categorization)\n// ============================================================================\n\n/**\n * Pre-computed map for O(1) style-to-chunk lookup.\n * Built once at module load time.\n */\nexport const STYLE_TO_CHUNK = new Map<string, ChunkName>();\n\n// Populate the lookup map\nfunction populateStyleToChunkMap() {\n for (const style of APPEARANCE_CHUNK_STYLES) {\n STYLE_TO_CHUNK.set(style, CHUNK_NAMES.APPEARANCE);\n }\n for (const style of FONT_CHUNK_STYLES) {\n STYLE_TO_CHUNK.set(style, CHUNK_NAMES.FONT);\n }\n for (const style of DIMENSION_CHUNK_STYLES) {\n STYLE_TO_CHUNK.set(style, CHUNK_NAMES.DIMENSION);\n }\n for (const style of DISPLAY_CHUNK_STYLES) {\n STYLE_TO_CHUNK.set(style, CHUNK_NAMES.DISPLAY);\n }\n for (const style of LAYOUT_CHUNK_STYLES) {\n STYLE_TO_CHUNK.set(style, CHUNK_NAMES.LAYOUT);\n }\n for (const style of POSITION_CHUNK_STYLES) {\n STYLE_TO_CHUNK.set(style, CHUNK_NAMES.POSITION);\n }\n}\n\n// Initialize at module load\npopulateStyleToChunkMap();\n\n// ============================================================================\n// Chunk Priority Order\n// ============================================================================\n\n/**\n * Chunk processing order. This ensures deterministic className allocation\n * regardless of style key order in the input.\n */\nconst CHUNK_ORDER: readonly string[] = [\n CHUNK_NAMES.APPEARANCE,\n CHUNK_NAMES.FONT,\n CHUNK_NAMES.DIMENSION,\n CHUNK_NAMES.DISPLAY,\n CHUNK_NAMES.LAYOUT,\n CHUNK_NAMES.POSITION,\n CHUNK_NAMES.MISC,\n CHUNK_NAMES.SUBCOMPONENTS,\n] as const;\n\n/**\n * Map from chunk name to its priority index for sorting.\n */\nconst _CHUNK_PRIORITY = new Map<string, number>(\n CHUNK_ORDER.map((name, index) => [name, index]),\n);\n\n// ============================================================================\n// Chunk Info Interface\n// ============================================================================\n\nexport interface ChunkInfo {\n /** Name of the chunk */\n name: ChunkName | string;\n /** Style keys belonging to this chunk */\n styleKeys: string[];\n}\n\n// ============================================================================\n// Style Categorization\n// ============================================================================\n\n/**\n * Categorize style keys into chunks.\n *\n * Returns chunks in a deterministic order (by CHUNK_ORDER) regardless\n * of the order of keys in the input styles object.\n *\n * @param styles - The styles object to categorize\n * @returns Map of chunk name to array of style keys in that chunk (in priority order)\n */\nexport function categorizeStyleKeys(\n styles: Record<string, unknown>,\n): Map<string, string[]> {\n // First pass: collect keys into chunks (unordered)\n const chunkData: Record<string, string[]> = {};\n const keys = Object.keys(styles);\n\n for (const key of keys) {\n // Skip the $ helper key (used for selector combinators)\n // Skip @keyframes and @properties (processed separately in useStyles)\n // Skip recipe (resolved before pipeline by resolveRecipes)\n if (\n key === '$' ||\n key === '@keyframes' ||\n key === '@properties' ||\n key === 'recipe'\n ) {\n continue;\n }\n\n if (isSelector(key)) {\n // All selectors go into the subcomponents chunk\n if (!chunkData[CHUNK_NAMES.SUBCOMPONENTS]) {\n chunkData[CHUNK_NAMES.SUBCOMPONENTS] = [];\n }\n chunkData[CHUNK_NAMES.SUBCOMPONENTS].push(key);\n } else {\n // Look up the chunk for this style, default to misc\n const chunkName = STYLE_TO_CHUNK.get(key) ?? CHUNK_NAMES.MISC;\n if (!chunkData[chunkName]) {\n chunkData[chunkName] = [];\n }\n chunkData[chunkName].push(key);\n }\n }\n\n // Second pass: build ordered Map based on CHUNK_ORDER\n const orderedChunks = new Map<string, string[]>();\n\n // Add chunks in priority order\n for (const chunkName of CHUNK_ORDER) {\n if (chunkData[chunkName] && chunkData[chunkName].length > 0) {\n // Sort keys within chunk for consistent cache key generation\n orderedChunks.set(chunkName, chunkData[chunkName].sort());\n }\n }\n\n // Handle any unknown chunks (shouldn't happen, but be defensive)\n for (const chunkName of Object.keys(chunkData)) {\n if (!orderedChunks.has(chunkName)) {\n orderedChunks.set(chunkName, chunkData[chunkName].sort());\n }\n }\n\n return orderedChunks;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;AASD,MAAa,oBAAoB;CAE/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;AAWD,MAAa,yBAAyB;CAEpC;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;AAWD,MAAa,uBAAuB;CAElC;CACA;CACA;CACA;CACA;CAEA;CAEA;CAEA;CACA;CACD;;;;;;;AAQD,MAAa,sBAAsB;CAEjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;AAQD,MAAa,wBAAwB;CACnC;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAMD,MAAa,cAAc;CAEzB,UAAU;CACV,eAAe;CACf,YAAY;CACZ,MAAM;CACN,WAAW;CACX,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACP;;;;;AAYD,MAAa,iCAAiB,IAAI,KAAwB;AAG1D,SAAS,0BAA0B;AACjC,MAAK,MAAM,SAAS,wBAClB,gBAAe,IAAI,OAAO,YAAY,WAAW;AAEnD,MAAK,MAAM,SAAS,kBAClB,gBAAe,IAAI,OAAO,YAAY,KAAK;AAE7C,MAAK,MAAM,SAAS,uBAClB,gBAAe,IAAI,OAAO,YAAY,UAAU;AAElD,MAAK,MAAM,SAAS,qBAClB,gBAAe,IAAI,OAAO,YAAY,QAAQ;AAEhD,MAAK,MAAM,SAAS,oBAClB,gBAAe,IAAI,OAAO,YAAY,OAAO;AAE/C,MAAK,MAAM,SAAS,sBAClB,gBAAe,IAAI,OAAO,YAAY,SAAS;;AAKnD,yBAAyB;;;;;AAUzB,MAAM,cAAiC;CACrC,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACb;AAKuB,IAAI,IAC1B,YAAY,KAAK,MAAM,UAAU,CAAC,MAAM,MAAM,CAAC,CAChD;;;;;;;;;;AA0BD,SAAgB,oBACd,QACuB;CAEvB,MAAM,YAAsC,EAAE;CAC9C,MAAM,OAAO,OAAO,KAAK,OAAO;AAEhC,MAAK,MAAM,OAAO,MAAM;AAItB,MACE,QAAQ,OACR,QAAQ,gBACR,QAAQ,iBACR,QAAQ,SAER;AAGF,MAAI,WAAW,IAAI,EAAE;AAEnB,OAAI,CAAC,UAAU,YAAY,eACzB,WAAU,YAAY,iBAAiB,EAAE;AAE3C,aAAU,YAAY,eAAe,KAAK,IAAI;SACzC;GAEL,MAAM,YAAY,eAAe,IAAI,IAAI,IAAI,YAAY;AACzD,OAAI,CAAC,UAAU,WACb,WAAU,aAAa,EAAE;AAE3B,aAAU,WAAW,KAAK,IAAI;;;CAKlC,MAAM,gCAAgB,IAAI,KAAuB;AAGjD,MAAK,MAAM,aAAa,YACtB,KAAI,UAAU,cAAc,UAAU,WAAW,SAAS,EAExD,eAAc,IAAI,WAAW,UAAU,WAAW,MAAM,CAAC;AAK7D,MAAK,MAAM,aAAa,OAAO,KAAK,UAAU,CAC5C,KAAI,CAAC,cAAc,IAAI,UAAU,CAC/B,eAAc,IAAI,WAAW,UAAU,WAAW,MAAM,CAAC;AAI7D,QAAO"}