@fluentic/style 0.1.0-beta.1 → 0.1.0-beta.11

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 (491) hide show
  1. package/CHANGELOG.md +156 -2
  2. package/README.md +181 -49
  3. package/atomic/atRule/utils.ts +3 -2
  4. package/atomic/className.ts +50 -12
  5. package/atomic/debug/className/className.ts +24 -8
  6. package/atomic/element.ts +5 -2
  7. package/atomic/rule.ts +11 -5
  8. package/atomic/scope.ts +19 -0
  9. package/atomic/theme.ts +44 -3
  10. package/atomic/token.ts +7 -4
  11. package/atomic/utils/cssIdent.ts +54 -0
  12. package/atomic/utils/cssVar.ts +19 -0
  13. package/atomic/utils/debug.ts +1 -1
  14. package/atomic/utils/format.ts +1 -1
  15. package/atomic/utils/hash.ts +14 -0
  16. package/atomic/utils/selector.ts +31 -1
  17. package/atomic/var.ts +3 -2
  18. package/builder/classname/class_name_builder.ts +491 -0
  19. package/builder/classname/fns.ts +77 -0
  20. package/builder/classname/index.ts +3 -0
  21. package/builder/classname/types.ts +41 -0
  22. package/builder/data/const.ts +8 -1
  23. package/builder/data/create.ts +52 -6
  24. package/builder/data/data.ts +33 -8
  25. package/builder/data/debug.ts +1 -0
  26. package/builder/data/index.ts +0 -1
  27. package/builder/data/is.ts +26 -3
  28. package/builder/data/merge/scope.ts +38 -38
  29. package/builder/data/merge/style.ts +115 -20
  30. package/builder/data/state.ts +17 -2
  31. package/builder/extract/index.ts +1 -0
  32. package/builder/extract/sheet.ts +30 -0
  33. package/builder/extract/token.ts +30 -14
  34. package/builder/extract/utils.ts +2 -0
  35. package/builder/extract/withTokens.ts +2 -1
  36. package/builder/selector_override.noop.ts +11 -0
  37. package/builder/selector_override.ts +31 -0
  38. package/builder/selector_override_core.ts +79 -0
  39. package/builder/style_builder.ts +144 -20
  40. package/builder/style_data.ts +25 -0
  41. package/builder/style_fns.ts +57 -57
  42. package/builder/token/data.ts +30 -0
  43. package/builder/token/index.ts +3 -0
  44. package/builder/token/name.ts +54 -0
  45. package/builder/token/symbols.ts +6 -0
  46. package/builder/types/alias.ts +44 -16
  47. package/builder/types/fns.ts +24 -16
  48. package/builder/types/types.ts +37 -7
  49. package/builder/utils.ts +1 -0
  50. package/compiler/compiler/compiler.ts +88 -14
  51. package/compiler/compiler/constants.ts +6 -0
  52. package/compiler/compiler/index.ts +1 -0
  53. package/compiler/compiler/types.ts +4 -1
  54. package/compiler/cssProp.ts +21 -0
  55. package/compiler/extract/extract.ts +42 -14
  56. package/compiler/extract/types.ts +2 -0
  57. package/compiler/index.ts +1 -0
  58. package/compiler/transform/cssProp/index.ts +1 -0
  59. package/compiler/transform/cssProp/plugin.ts +161 -0
  60. package/compiler/transform/debug/plugin.ts +93 -4
  61. package/compiler/transform/debug/transform.ts +2 -1
  62. package/compiler/transform/debug/utils/debug_data.ts +73 -0
  63. package/compiler/transform/evaluator/evaluator.ts +169 -32
  64. package/compiler/transform/evaluator/tracer.ts +48 -11
  65. package/compiler/transform/extract/chain/chain.ts +1370 -162
  66. package/compiler/transform/extract/chain/extract_chain.ts +12 -4
  67. package/compiler/transform/extract/chain/types.ts +3 -1
  68. package/compiler/transform/extract/plugin.ts +64 -6
  69. package/compiler/transform/extract/transform.ts +2 -1
  70. package/compiler/transform/extract/utils/replacement.ts +72 -2
  71. package/compiler/transform/extract/utils/state.ts +3 -0
  72. package/compiler/transform/extract/utils/theme.ts +6 -6
  73. package/compiler/transform/index.ts +1 -0
  74. package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
  75. package/compiler/transform/syntax/static_ids.ts +1 -1
  76. package/compiler/utils/constants.ts +12 -5
  77. package/compiler/utils/file_resolver.ts +2 -0
  78. package/compiler/utils/import_source.ts +19 -8
  79. package/compiler/utils/imports.ts +11 -1
  80. package/config/build.ts +9 -2
  81. package/config/config/check.ts +25 -0
  82. package/config/config/css.ts +18 -1
  83. package/config/config/debug.ts +24 -1
  84. package/config/config/dev.ts +17 -1
  85. package/config/configure.ts +19 -2
  86. package/config/types.ts +7 -0
  87. package/css/index.ts +2 -0
  88. package/css/sheet.ts +152 -0
  89. package/css/styleTarget.ts +251 -0
  90. package/dev/config.ts +2 -3
  91. package/dev/utils.ts +3 -3
  92. package/dialect/extracted/index.ts +5 -0
  93. package/dialect/index.ts +1 -0
  94. package/dialect/namedTokens.ts +153 -0
  95. package/dist/adapter/preact.js +2 -0
  96. package/dist/adapter/react.js +2 -0
  97. package/dist/adapter/solid.js +2 -0
  98. package/dist/className-yhJCGT0F.js +304 -0
  99. package/dist/className-yhJCGT0F.js.map +1 -0
  100. package/dist/combine-Bww7VnSr.js +1254 -0
  101. package/dist/combine-Bww7VnSr.js.map +1 -0
  102. package/dist/compiler/index.mjs +2 -2
  103. package/dist/{compiler-DENc3a2R.mjs → compiler-C3CEGGtI.mjs} +2335 -638
  104. package/dist/compiler-C3CEGGtI.mjs.map +1 -0
  105. package/dist/config/index.js +2 -2
  106. package/dist/config-BAEzRmSJ.js +6 -0
  107. package/dist/{config-Di2VYYKV.js.map → config-BAEzRmSJ.js.map} +1 -1
  108. package/dist/config-BKP5LOkt.js +35 -0
  109. package/dist/config-BKP5LOkt.js.map +1 -0
  110. package/dist/config-C5VWvTav.js +34 -0
  111. package/dist/config-C5VWvTav.js.map +1 -0
  112. package/dist/config-CB4lm2tM.js +1 -0
  113. package/dist/config-CDjbHwb-.js +6 -0
  114. package/dist/config-CDjbHwb-.js.map +1 -0
  115. package/dist/config-DNEnHEf3.js +36 -0
  116. package/dist/config-DNEnHEf3.js.map +1 -0
  117. package/dist/createTransformElement-D8fXZ3wA.js +34 -0
  118. package/dist/createTransformElement-D8fXZ3wA.js.map +1 -0
  119. package/dist/css-BDn0epJ8.js +1339 -0
  120. package/dist/css-BDn0epJ8.js.map +1 -0
  121. package/dist/css-CFxNrYt3.js +4040 -0
  122. package/dist/css-CFxNrYt3.js.map +1 -0
  123. package/dist/css-DEYgrj76.js +524 -0
  124. package/dist/css-DEYgrj76.js.map +1 -0
  125. package/dist/{runtime-CYqNCiaM.js → css-DWBWsyxZ.js} +16 -19
  126. package/dist/css-DWBWsyxZ.js.map +1 -0
  127. package/dist/css.js +2 -2
  128. package/dist/{css_extra-oIi3UEPK.js → css_extra-nTq_Gw0E.js} +2 -2
  129. package/dist/{css_extra-DlOnsnR1.js.map → css_extra-nTq_Gw0E.js.map} +1 -1
  130. package/dist/data-CDrS1Bq4.js +785 -0
  131. package/dist/data-CDrS1Bq4.js.map +1 -0
  132. package/dist/debug-BkVbf0Cz.js +52 -0
  133. package/dist/debug-BkVbf0Cz.js.map +1 -0
  134. package/dist/{debug-n2aZQBSa.js → debug-YuhEIQVO.js} +80 -4
  135. package/dist/debug-YuhEIQVO.js.map +1 -0
  136. package/dist/dev/rsc.js +10 -9
  137. package/dist/dev/rsc.js.map +1 -1
  138. package/dist/{dev-CcphAa3R.js → dev-0imWmSVb.js} +10 -10
  139. package/dist/dev-0imWmSVb.js.map +1 -0
  140. package/dist/dev.js +1 -1
  141. package/dist/dialect/extracted/index.js +2 -0
  142. package/dist/dialect/index.js +2 -0
  143. package/dist/{elementMarker-Bu7gDAkE.js → elementMarker-kvpMjB49.js} +164 -30
  144. package/dist/elementMarker-kvpMjB49.js.map +1 -0
  145. package/dist/entry/dev/adapter/preact.js +12 -0
  146. package/dist/entry/dev/adapter/preact.js.map +1 -0
  147. package/dist/entry/dev/adapter/react.js +12 -0
  148. package/dist/entry/dev/adapter/react.js.map +1 -0
  149. package/dist/entry/dev/adapter/solid.js +12 -0
  150. package/dist/entry/dev/adapter/solid.js.map +1 -0
  151. package/dist/entry/dev/css.js +3 -3
  152. package/dist/entry/dev/jsx-dev-runtime.js +2 -1
  153. package/dist/entry/dev/jsx-runtime.js +2 -1
  154. package/dist/entry/dev.js +13 -9
  155. package/dist/entry/prod/adapter/preact.js +12 -0
  156. package/dist/entry/prod/adapter/preact.js.map +1 -0
  157. package/dist/entry/prod/adapter/react.js +12 -0
  158. package/dist/entry/prod/adapter/react.js.map +1 -0
  159. package/dist/entry/prod/adapter/solid.js +12 -0
  160. package/dist/entry/prod/adapter/solid.js.map +1 -0
  161. package/dist/entry/prod/css.js +3 -3
  162. package/dist/entry/prod/extract.js +242 -3
  163. package/dist/entry/prod/extract.js.map +1 -0
  164. package/dist/entry/prod/jsx-dev-runtime.js +2 -2
  165. package/dist/entry/prod/jsx-runtime.js +2 -2
  166. package/dist/entry/prod/runtime.js +3 -4
  167. package/dist/entry/prod.js +84 -1201
  168. package/dist/entry/prod.js.map +1 -1
  169. package/dist/entry/rsc-dev/adapter/preact.js +13 -0
  170. package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
  171. package/dist/entry/rsc-dev/adapter/react.js +13 -0
  172. package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
  173. package/dist/entry/rsc-dev/adapter/solid.js +13 -0
  174. package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
  175. package/dist/entry/rsc-dev/css.js +3 -3
  176. package/dist/entry/rsc-dev/dev.js +11 -13
  177. package/dist/entry/rsc-dev/dev.js.map +1 -1
  178. package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
  179. package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
  180. package/dist/entry/rsc-dev.js +582 -664
  181. package/dist/entry/rsc-dev.js.map +1 -1
  182. package/dist/entry/rsc-prod/adapter/preact.js +2 -0
  183. package/dist/entry/rsc-prod/adapter/react.js +2 -0
  184. package/dist/entry/rsc-prod/adapter/solid.js +2 -0
  185. package/dist/entry/rsc-prod/css.js +9 -3
  186. package/dist/entry/rsc-prod/css.js.map +1 -0
  187. package/dist/entry/rsc-prod/jsx-dev-runtime.js +2 -2
  188. package/dist/entry/rsc-prod/jsx-runtime.js +2 -2
  189. package/dist/entry/rsc-prod/runtime.js +3 -4
  190. package/dist/entry/rsc-prod.js +242 -10
  191. package/dist/entry/rsc-prod.js.map +1 -0
  192. package/dist/{styleStore-Dea_WVbr.js → env-Cz8frh6e.js} +1335 -372
  193. package/dist/env-Cz8frh6e.js.map +1 -0
  194. package/dist/getClassName-9CsXbNls.js +545 -0
  195. package/dist/getClassName-9CsXbNls.js.map +1 -0
  196. package/dist/{utils-D7FAOyg6.js → getClassName-DGm-VNDo.js} +28 -65
  197. package/dist/getClassName-DGm-VNDo.js.map +1 -0
  198. package/dist/getClassName-Dtc4yyYI.js +47 -0
  199. package/dist/getClassName-Dtc4yyYI.js.map +1 -0
  200. package/dist/{getClassName-BlvXHYuf.js → getClassName-DtkplEIt.js} +56 -14
  201. package/dist/getClassName-DtkplEIt.js.map +1 -0
  202. package/dist/global-CAc9OjKx.js +14 -0
  203. package/dist/global-CAc9OjKx.js.map +1 -0
  204. package/dist/{format-3nKBE_5t.js → hash-Cr-LCWDt.js} +51 -29
  205. package/dist/hash-Cr-LCWDt.js.map +1 -0
  206. package/dist/index.js +10 -8
  207. package/dist/jsx/jsx-dev-runtime.js +2 -2
  208. package/dist/jsx/jsx-dev-runtime.server.js +1 -1
  209. package/dist/jsx/jsx-runtime.js +2 -2
  210. package/dist/jsx/jsx-runtime.server.js +1 -1
  211. package/dist/jsx-CVxpkS04.js +39 -0
  212. package/dist/jsx-CVxpkS04.js.map +1 -0
  213. package/dist/{jsx_dev_runtime-B6xs4by8.js → jsx_dev_runtime-D068tAsT.js} +2 -3
  214. package/dist/{jsx_dev_runtime-B6xs4by8.js.map → jsx_dev_runtime-D068tAsT.js.map} +1 -1
  215. package/dist/{jsx_runtime-iHLDwpcW.js → jsx_runtime-6Qa1lmz2.js} +2 -2
  216. package/dist/{jsx_runtime-iHLDwpcW.js.map → jsx_runtime-6Qa1lmz2.js.map} +1 -1
  217. package/dist/{jsx_runtime-04xfnsi7.js → jsx_runtime-DT1Tr9cH.js} +2 -3
  218. package/dist/{jsx_runtime-04xfnsi7.js.map → jsx_runtime-DT1Tr9cH.js.map} +1 -1
  219. package/dist/{loader-B5Kw0DD-.mjs → loader-_-VjzlrX.mjs} +13 -14
  220. package/dist/loader-_-VjzlrX.mjs.map +1 -0
  221. package/dist/{misc-DCdYYyhK.mjs → misc-B76PUnWe.mjs} +11 -6
  222. package/dist/misc-B76PUnWe.mjs.map +1 -0
  223. package/dist/namedTokens-5AayGokX.js +85 -0
  224. package/dist/namedTokens-5AayGokX.js.map +1 -0
  225. package/dist/plugin/farm/index.mjs +4 -3
  226. package/dist/plugin/farm/index.mjs.map +1 -1
  227. package/dist/plugin/nextjs/index.mjs +151 -31
  228. package/dist/plugin/nextjs/index.mjs.map +1 -1
  229. package/dist/plugin/nextjs/loader.mjs +4 -4
  230. package/dist/plugin/parcel/index.cjs +2 -0
  231. package/dist/plugin/parcel/index.mjs +3 -1
  232. package/dist/plugin/parcel/optimizer.cjs +3 -2
  233. package/dist/plugin/parcel/optimizer.cjs.map +1 -1
  234. package/dist/plugin/parcel/optimizer.mjs +3 -2
  235. package/dist/plugin/parcel/optimizer.mjs.map +1 -1
  236. package/dist/plugin/parcel/resolver.cjs +1 -1
  237. package/dist/plugin/parcel/resolver.mjs +2 -2
  238. package/dist/plugin/parcel/runtime.cjs +1 -1
  239. package/dist/plugin/parcel/runtime.mjs +1 -1
  240. package/dist/plugin/parcel/transformer.cjs +1 -1
  241. package/dist/plugin/parcel/transformer.mjs +2 -2
  242. package/dist/plugin/rspack/index.mjs +3 -2
  243. package/dist/plugin/rspack/index.mjs.map +1 -1
  244. package/dist/plugin/vite/index.mjs +13 -10
  245. package/dist/plugin/vite/index.mjs.map +1 -1
  246. package/dist/plugin/webpack/index.mjs +3 -2
  247. package/dist/plugin/webpack/loader.mjs +2 -2
  248. package/dist/presets/tailwind/index.js +995 -0
  249. package/dist/presets/tailwind/index.js.map +1 -0
  250. package/dist/{assert-BGdigdr5.js → presets-DSanixJV.js} +106 -2
  251. package/dist/presets-DSanixJV.js.map +1 -0
  252. package/dist/{registry-yHLRxyoo.mjs → registry-w8ET5R7v.mjs} +2 -2
  253. package/dist/{registry-yHLRxyoo.mjs.map → registry-w8ET5R7v.mjs.map} +1 -1
  254. package/dist/resolveClassNameRuntime-CJjlUP93.js +63 -0
  255. package/dist/resolveClassNameRuntime-CJjlUP93.js.map +1 -0
  256. package/dist/{rules-9HSO1pxL.js → rules-DaMaMHgb.js} +618 -138
  257. package/dist/rules-DaMaMHgb.js.map +1 -0
  258. package/dist/scope-CZdGAnl_.js +601 -0
  259. package/dist/scope-CZdGAnl_.js.map +1 -0
  260. package/dist/selector/index.js +1 -2
  261. package/dist/server.js +17 -11
  262. package/dist/server.js.map +1 -1
  263. package/dist/{shared-CxbHR89f.mjs → shared-C_cYxNzz.mjs} +4 -4
  264. package/dist/{shared-CxbHR89f.mjs.map → shared-C_cYxNzz.mjs.map} +1 -1
  265. package/dist/{shared-CBArHB9-.cjs → shared-PK52rW6T.cjs} +2338 -635
  266. package/dist/shared-PK52rW6T.cjs.map +1 -0
  267. package/dist/sheet-CxkO1Hwt.js +7 -0
  268. package/dist/sheet-CxkO1Hwt.js.map +1 -0
  269. package/dist/{sidecar-BFakLl0X.mjs → sidecar-BhvmXYsD.mjs} +3 -3
  270. package/dist/{sidecar-BFakLl0X.mjs.map → sidecar-BhvmXYsD.mjs.map} +1 -1
  271. package/dist/style-CAhAnRni.js +1129 -0
  272. package/dist/style-CAhAnRni.js.map +1 -0
  273. package/dist/{styleStore-DyNXBcUK.js → styleStore-BzLZwpwy.js} +8 -7
  274. package/dist/styleStore-BzLZwpwy.js.map +1 -0
  275. package/dist/styleStore-DaIJ4OPV.js +58 -0
  276. package/dist/styleStore-DaIJ4OPV.js.map +1 -0
  277. package/dist/token-D33mKTka.js +138 -0
  278. package/dist/token-D33mKTka.js.map +1 -0
  279. package/dist/{trace-Bu_qOqRy.js → trace-B3dpTRJp.js} +3 -3
  280. package/dist/{trace-Bu_qOqRy.js.map → trace-B3dpTRJp.js.map} +1 -1
  281. package/dist/{trace-CU0rvNYr.js → trace-c2WmBbmX.js} +2 -2
  282. package/dist/{trace-CU0rvNYr.js.map → trace-c2WmBbmX.js.map} +1 -1
  283. package/dist/transform-DSpimwwC.js +23 -0
  284. package/dist/transform-DSpimwwC.js.map +1 -0
  285. package/dist/{utils-Bdbqn0f8.mjs → utils-DND33M6y.mjs} +3 -3
  286. package/dist/{utils-Bdbqn0f8.mjs.map → utils-DND33M6y.mjs.map} +1 -1
  287. package/dist/utils-DZK0mfmY.js +42 -0
  288. package/dist/utils-DZK0mfmY.js.map +1 -0
  289. package/dist/utils-D_XgtMtn.js +72 -0
  290. package/dist/utils-D_XgtMtn.js.map +1 -0
  291. package/dist/utils-DxCpyV2E.js +62 -0
  292. package/dist/utils-DxCpyV2E.js.map +1 -0
  293. package/dist/{utils-BbehLOby.js → utils-H1VInWpd.js} +407 -234
  294. package/dist/utils-H1VInWpd.js.map +1 -0
  295. package/dist/utils-NdisireF.mjs +182 -0
  296. package/dist/utils-NdisireF.mjs.map +1 -0
  297. package/dist/utils.js +4 -4
  298. package/dist/utils.js.map +1 -1
  299. package/dist/value-CK0-Xbov.js +160 -0
  300. package/dist/value-CK0-Xbov.js.map +1 -0
  301. package/dist/{webpack-Dh6lox2l.mjs → webpack-D7QO0bKN.mjs} +5 -5
  302. package/dist/webpack-D7QO0bKN.mjs.map +1 -0
  303. package/entry/dev/adapter/preact.ts +8 -0
  304. package/entry/dev/adapter/react.ts +8 -0
  305. package/entry/dev/adapter/solid.ts +8 -0
  306. package/entry/dev/config.ts +1 -1
  307. package/entry/dev/index.ts +1 -0
  308. package/entry/dev/jsx_dev_runtime.ts +1 -0
  309. package/entry/dev/jsx_runtime.ts +1 -0
  310. package/entry/dev/sheet.ts +4 -0
  311. package/entry/prod/adapter/preact.ts +8 -0
  312. package/entry/prod/adapter/react.ts +8 -0
  313. package/entry/prod/adapter/solid.ts +8 -0
  314. package/entry/prod/config_debug.ts +2 -0
  315. package/entry/prod/index.ts +1 -1
  316. package/entry/prod/runtime.ts +4 -2
  317. package/entry/rsc_dev/adapter/preact.ts +9 -0
  318. package/entry/rsc_dev/adapter/react.ts +9 -0
  319. package/entry/rsc_dev/adapter/solid.ts +9 -0
  320. package/entry/rsc_dev/config.ts +1 -1
  321. package/entry/rsc_dev/server.ts +1 -1
  322. package/entry/rsc_prod/adapter/preact.ts +1 -0
  323. package/entry/rsc_prod/adapter/react.ts +1 -0
  324. package/entry/rsc_prod/adapter/solid.ts +1 -0
  325. package/entry/rsc_prod/config_debug.ts +6 -0
  326. package/entry/rsc_prod/index.ts +1 -1
  327. package/entry/rsc_prod/runtime.ts +1 -1
  328. package/entry/rsc_prod/server.ts +1 -1
  329. package/entry/shared/config_debug.ts +9 -0
  330. package/entry/shared/config_dev.ts +14 -0
  331. package/entry/shared/dev.ts +11 -2
  332. package/entry/shared/utils.ts +28 -0
  333. package/jsx/types/index.ts +1 -0
  334. package/jsx/types/preact.ts +14 -0
  335. package/jsx/{types.ts → types/react.ts} +2 -2
  336. package/jsx/types/solid.ts +32 -0
  337. package/package.json +110 -8
  338. package/plugin/bundler/farm/plugin.ts +2 -0
  339. package/plugin/bundler/parcel/optimizer.ts +1 -0
  340. package/plugin/bundler/parcel/plugin.ts +2 -0
  341. package/plugin/bundler/rspack/plugin.ts +1 -0
  342. package/plugin/bundler/vite/plugin.ts +5 -9
  343. package/plugin/bundler/vite/state.ts +11 -6
  344. package/plugin/bundler/webpack/plugin.ts +2 -1
  345. package/plugin/bundler/webpack/shared/loader.ts +9 -7
  346. package/plugin/nextjs/plugin.ts +249 -35
  347. package/plugin/nextjs/types.ts +1 -2
  348. package/plugin/nextjs/utils.ts +121 -0
  349. package/plugin/utils/compiler.ts +2 -0
  350. package/plugin/utils/runtimeEntry.ts +15 -2
  351. package/presets/tailwind/classname/index.ts +2 -0
  352. package/presets/tailwind/classname/transform.ts +239 -0
  353. package/presets/tailwind/classname/types.ts +124 -0
  354. package/presets/tailwind/index.ts +5 -0
  355. package/presets/tailwind/selectors.ts +27 -0
  356. package/presets/tailwind/style/index.ts +2 -0
  357. package/presets/tailwind/style/transform.ts +436 -0
  358. package/presets/tailwind/style/types.ts +346 -0
  359. package/presets/tailwind/theme.ts +479 -0
  360. package/presets/tailwind/types.ts +147 -0
  361. package/runtime/adapter/utils.ts +120 -0
  362. package/runtime/core/cache/combine.ts +76 -28
  363. package/runtime/core/cache/combineRuntime.ts +4 -0
  364. package/runtime/core/cache/index.ts +2 -1
  365. package/runtime/core/cache/item.ts +32 -13
  366. package/runtime/core/cache/itemWithResolver.ts +44 -0
  367. package/runtime/core/cache/pool.ts +16 -31
  368. package/runtime/core/cache/prop.ts +10 -8
  369. package/runtime/core/cache/result.ts +2 -2
  370. package/runtime/core/cache/stateItem.ts +16 -1
  371. package/runtime/core/cache/token.ts +20 -0
  372. package/runtime/core/cache/tokenValues.ts +19 -11
  373. package/runtime/core/combinedStyle.ts +4 -4
  374. package/runtime/extract/combineStyle.ts +211 -0
  375. package/runtime/extract/getClassName.ts +55 -23
  376. package/runtime/extract/index.ts +4 -2
  377. package/runtime/extract/token.ts +41 -0
  378. package/runtime/extract/tokenResolver.ts +17 -0
  379. package/runtime/index.ts +8 -1
  380. package/runtime/rsc/getClassName.ts +4 -0
  381. package/runtime/rsc/observer.ts +4 -0
  382. package/runtime/rsc/styleStore.ts +18 -7
  383. package/runtime/sheet/rule.ts +16 -12
  384. package/runtime/sheet/rules.ts +8 -3
  385. package/runtime/style/scope.ts +0 -24
  386. package/runtime/style/style.ts +181 -6
  387. package/runtime/types.ts +6 -4
  388. package/sheet/dev/dev_layer.ts +18 -7
  389. package/sheet/dev/dev_sort.ts +45 -11
  390. package/sheet/prod.ts +18 -7
  391. package/sheet/types.ts +2 -0
  392. package/sheet/utils/layer.ts +33 -0
  393. package/style/classname.ts +47 -0
  394. package/style/important.ts +19 -0
  395. package/style/index.ts +3 -0
  396. package/style/style.ts +47 -16
  397. package/style/theme.ts +4 -3
  398. package/style/token.ts +26 -21
  399. package/style/tokens.ts +18 -12
  400. package/style/transform.ts +41 -2
  401. package/style/types.ts +6 -4
  402. package/style/utils/expose.ts +4 -3
  403. package/style/value.ts +26 -11
  404. package/style/valueRef.ts +1 -1
  405. package/style/weight.ts +21 -0
  406. package/utils/global.ts +1 -3
  407. package/utils/hash.ts +4 -0
  408. package/utils/symbol.ts +3 -0
  409. package/atomic/layer/README.md +0 -116
  410. package/atomic/utils/css.ts +0 -49
  411. package/dist/assert-BGdigdr5.js.map +0 -1
  412. package/dist/className-C1Ht5Wvv.js +0 -144
  413. package/dist/className-C1Ht5Wvv.js.map +0 -1
  414. package/dist/className-DC2Cq8p3.js +0 -251
  415. package/dist/className-DC2Cq8p3.js.map +0 -1
  416. package/dist/compiler-DENc3a2R.mjs.map +0 -1
  417. package/dist/config-BryWDfQX.js +0 -25
  418. package/dist/config-BryWDfQX.js.map +0 -1
  419. package/dist/config-DKHXWhe1.js +0 -1
  420. package/dist/config-Di2VYYKV.js +0 -6
  421. package/dist/config-DloHOG6I.js +0 -13
  422. package/dist/config-DloHOG6I.js.map +0 -1
  423. package/dist/css-BowBszUt.js +0 -243
  424. package/dist/css-BowBszUt.js.map +0 -1
  425. package/dist/css-ByOrugEX.js +0 -805
  426. package/dist/css-ByOrugEX.js.map +0 -1
  427. package/dist/css-DcazYor9.js +0 -235
  428. package/dist/css-DcazYor9.js.map +0 -1
  429. package/dist/css_extra-DlOnsnR1.js +0 -8
  430. package/dist/css_extra-oIi3UEPK.js.map +0 -1
  431. package/dist/data-BsqOa5br.js +0 -473
  432. package/dist/data-BsqOa5br.js.map +0 -1
  433. package/dist/debug-BAw63qX6.js +0 -15
  434. package/dist/debug-BAw63qX6.js.map +0 -1
  435. package/dist/debug-DGki_v7g.js +0 -15
  436. package/dist/debug-DGki_v7g.js.map +0 -1
  437. package/dist/debug-n2aZQBSa.js.map +0 -1
  438. package/dist/dev-CcphAa3R.js.map +0 -1
  439. package/dist/dev-DfBbuLeE.js +0 -71
  440. package/dist/dev-DfBbuLeE.js.map +0 -1
  441. package/dist/elementMarker-Bu7gDAkE.js.map +0 -1
  442. package/dist/extract-CzWJeQi8.js +0 -121
  443. package/dist/extract-CzWJeQi8.js.map +0 -1
  444. package/dist/extract-DEwSDJ9Z.js +0 -2
  445. package/dist/format-3nKBE_5t.js.map +0 -1
  446. package/dist/getClassName-BlvXHYuf.js.map +0 -1
  447. package/dist/global-CvfmFLsK.js +0 -11
  448. package/dist/global-CvfmFLsK.js.map +0 -1
  449. package/dist/jsx-CwTeyUxr.js +0 -39
  450. package/dist/jsx-CwTeyUxr.js.map +0 -1
  451. package/dist/jsx-D2BksHSv.js +0 -38
  452. package/dist/jsx-D2BksHSv.js.map +0 -1
  453. package/dist/layer-D1SaH07m.js +0 -94
  454. package/dist/layer-D1SaH07m.js.map +0 -1
  455. package/dist/loader-B5Kw0DD-.mjs.map +0 -1
  456. package/dist/misc-DCdYYyhK.mjs.map +0 -1
  457. package/dist/presets-BhXa232U.js +0 -108
  458. package/dist/presets-BhXa232U.js.map +0 -1
  459. package/dist/property-CnLFt5kx.js +0 -406
  460. package/dist/property-CnLFt5kx.js.map +0 -1
  461. package/dist/rules-9HSO1pxL.js.map +0 -1
  462. package/dist/runtime-CYqNCiaM.js.map +0 -1
  463. package/dist/shared-CBArHB9-.cjs.map +0 -1
  464. package/dist/style-B-6jHipw.js +0 -5
  465. package/dist/style-B1UUqjj5.js +0 -743
  466. package/dist/style-B1UUqjj5.js.map +0 -1
  467. package/dist/style-DgHbdbdF.js +0 -752
  468. package/dist/style-DgHbdbdF.js.map +0 -1
  469. package/dist/style-v2bf70TZ.js +0 -1269
  470. package/dist/style-v2bf70TZ.js.map +0 -1
  471. package/dist/styleStore-Dea_WVbr.js.map +0 -1
  472. package/dist/styleStore-DyNXBcUK.js.map +0 -1
  473. package/dist/token-CKXUECuU.js +0 -76
  474. package/dist/token-CKXUECuU.js.map +0 -1
  475. package/dist/token-u_tM-mtg.js +0 -204
  476. package/dist/token-u_tM-mtg.js.map +0 -1
  477. package/dist/utils-BbehLOby.js.map +0 -1
  478. package/dist/utils-CEaq_c-A.mjs +0 -97
  479. package/dist/utils-CEaq_c-A.mjs.map +0 -1
  480. package/dist/utils-CWNHx4EC.js +0 -170
  481. package/dist/utils-CWNHx4EC.js.map +0 -1
  482. package/dist/utils-D7FAOyg6.js.map +0 -1
  483. package/dist/value-BR4e2MKt.js +0 -910
  484. package/dist/value-BR4e2MKt.js.map +0 -1
  485. package/dist/value-E8rEv2Oe.js +0 -136
  486. package/dist/value-E8rEv2Oe.js.map +0 -1
  487. package/dist/valueRef-lshFk1Cs.js +0 -16
  488. package/dist/valueRef-lshFk1Cs.js.map +0 -1
  489. package/dist/webpack-Dh6lox2l.mjs.map +0 -1
  490. package/dist/withTokens-LRidu3Vc.js +0 -95
  491. package/dist/withTokens-LRidu3Vc.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,10 +1,164 @@
1
1
  # @fluentic/style
2
2
 
3
- ## 0.1.0-beta.1
3
+ ## 0.1.0-beta.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Fingerprint the finished Turbopack stylesheet so Next.js serves a new CSS URL when extracted styles change.
8
+
9
+ ## 0.1.0-beta.10
10
+
11
+ ### Patch Changes
12
+
13
+ - Improve selector-sheet cascade control and important-value guidance.
14
+
15
+ - Keep `createSheet(...)` output unlayered by default so selector sheets can override unlayered third-party CSS, while allowing global `css.layer.sheet` and per-sheet `layer` opt-in through the derived `<layerNamespace>.sheet` layer.
16
+ - Add `createSheet({ layer, weight }, items)` so individual sheets can override layer participation and deliberately increase their generated anchor specificity.
17
+ - Preserve Fluentic's intended rule priority for `style.important(...)` when cascade layers reverse important declaration order.
18
+ - Add opt-in `check.important.rawValue` and `check.important.outsideSheet` compiler/runtime checks with `warn` and `error` modes.
19
+
20
+ ## 0.1.0-beta.9
21
+
22
+ ### Patch Changes
23
+
24
+ - 0309b3b: Resolve TypeScript path aliases when statically extracting imported theme
25
+ values. Imported `createValues(...)` palettes referenced through `tsconfig`
26
+ paths now extract correctly, including in React Server Component production
27
+ builds.
28
+
29
+ ## 0.1.0-beta.8
30
+
31
+ ### Patch Changes
32
+
33
+ - Improve Next.js RSC development CSS stability.
34
+
35
+ - Include imported `createValues(...)` and named-token `getToken(...)` values
36
+ in RSC dev precollected CSS so initial server styles match the dev
37
+ stylesheet.
38
+ - Use stable project-relative callsites for RSC dev local CSS variables,
39
+ including values imported from shared theme modules.
40
+ - Include the installed package identity in the Next.js cache key so local
41
+ tarball/package changes invalidate dev CSS caches.
42
+ - Increase the default dev/debug hash suffix from 3 to 5 characters to avoid
43
+ readable class-name collisions in large debug stylesheets while preserving
44
+ explicit `hashLength` configuration.
45
+
46
+ ## 0.1.0-beta.7
47
+
48
+ ### Patch Changes
49
+
50
+ - Keep Preact and SolidJS JSX type augmentations opt-in so React projects using
51
+ `@fluentic/style/plugin/jsx` no longer need optional framework peers installed.
52
+
53
+ - Keep React JSX `css` prop types in the default package type bundle.
54
+ - Add explicit `@fluentic/style/types/preact` and
55
+ `@fluentic/style/types/solid` type entrypoints for Preact and SolidJS
56
+ projects.
57
+ - Document the required project-level declaration-file import and update the
58
+ Preact and SolidJS examples.
59
+
60
+ ## 0.1.0-beta.6
4
61
 
5
62
  ### Patch Changes
6
63
 
7
- - Add `createSelectorAssert` for typed custom selector validators and improve selector preset documentation.
64
+ - 2bff82f: Improve css-prop adapters, class-name extraction, and Next.js build stability.
65
+
66
+ - Preserve normal JSX prop precedence when compiling intrinsic `css` props through React, Preact, and Solid adapters.
67
+ - Keep React `key` props outside generated css-prop spreads so list identity is preserved.
68
+ - Improve React Server Component development handling for css-prop adapter imports, including client components.
69
+ - Make class-name extraction produce stable debug hashes and better source locations for class-name utilities.
70
+ - Add Tailwind class-name support for arbitrary text values such as `text-[13px]`, `text-[length:13px]`, and `text-[color:purple]`.
71
+ - Improve Next.js integration for dev CSS delivery, Turbopack loader options, and production CSS precollection.
72
+ - Add default export conditions for common package entry points.
73
+
74
+ ## 0.1.0-beta.5
75
+
76
+ ### Patch Changes
77
+
78
+ - Add attachable selector sheets for styling fixed third-party class names
79
+ without emitting global CSS.
80
+
81
+ - Add `style.selector(...)` selector targets and `createSheet(...)` from
82
+ `@fluentic/style/css` for manual selector rules that still attach through
83
+ generated Fluentic classes.
84
+ - Support selector overrides and token overrides inside sheets so component
85
+ wrappers can expose local third-party themes with the same shape as
86
+ scoped style composition.
87
+ - Add `&` and `&?` selector handling for attached-element and portal-friendly
88
+ selector rules. Comma-separated selector strings are rejected; pass an
89
+ array when a rule should target multiple selectors.
90
+ - Add `createStyleTarget(...)` for applying style props to explicit DOM
91
+ targets such as `document.body`, with shared-target reference counting for
92
+ overlapping portal users.
93
+ - Make `combineStyle(...)` compose sheets directly, and add
94
+ `combineStyle.with(...)` plus array-only `combineStyle.multi(...)` for
95
+ cache-friendly style and sheet composition.
96
+ - Support selector sheet extraction, local token overrides, debug class
97
+ names, source tracing, and sourcemap data across runtime and extracted
98
+ builds.
99
+ - Add Preact css-prop support with a `CssPropPresets.Preact` compiler
100
+ preset, runtime adapters, JSX types, and a Vite example.
101
+ - Keep plugin css-prop configuration focused on `CssPropPresets` instead of
102
+ exporting each framework preset as a separate top-level plugin API.
103
+ - Add `style.important(...)` and `className.important(...)` for interop cases
104
+ that need emitted `!important` declarations, especially selector sheets
105
+ wrapping third-party CSS.
106
+ - Add `style.weight(...)` as the style-object counterpart to
107
+ `className.weight(...)`.
108
+ - Keep the extracted production runtime below 5 KB minified and gzipped with
109
+ `combineStyle` included, and keep selector parsing helpers out of the
110
+ extracted production entry.
111
+ - Add a React Select third-party selectors example, Preact integration docs,
112
+ and a clearer third-party styling guide for selector sheets, style targets,
113
+ portal menus, and the new `combineStyle` helpers.
114
+
115
+ ## 0.1.0-beta.4
116
+
117
+ ### Patch Changes
118
+
119
+ - Slim the extracted production runtime token path and fix named token refs in token-bound extracted styles.
120
+
121
+ - Keep token symbols, guards, naming, and extracted token helpers in builder/runtime internals instead of the public style token surface.
122
+ - Split extracted combine, token resolution, CSS variable, scope, and debug config helpers so extracted builds retain less eager runtime code.
123
+ - Make named tokens carry their extracted CSS variable name so production token bindings can reference named token values without compiler metadata errors.
124
+ - Hide manual stable ids from the public token and theme factory types while preserving internal compiler-provided identities.
125
+ - Add snapshot and runtime contract coverage for createToken, createTokens, createValues, createTheme, scopes, bindScope, combineStyle, and named-token refs in extracted output.
126
+ - Keep the Parcel optimizer on Node's `Buffer` import path and declare the Parcel example polyfill dependency so workspace builds do not rely on Parcel auto-install.
127
+
128
+ ## 0.1.0-beta.3
129
+
130
+ ### Patch Changes
131
+
132
+ - fd4a705: Make production class names globally dedupe extracted rules by deriving callsite-local hashing from dev mode only. Keep debug class names configurable from plugin and runtime CSS options, with dev defaulting to readable names and production defaulting to compact hashes.
133
+
134
+ ## 0.1.0-beta.2
135
+
136
+ This beta adds class-name style chains, Tailwind presets, and compiler support
137
+ for transform-driven styling.
138
+
139
+ ### Highlights
140
+
141
+ - Add `createClassNameFn` for class-name-driven style builders.
142
+ - Support nested class-name values, conditional falsy entries, weighted
143
+ class-name tokens, selector chaining, at-rules, and merges.
144
+ - Add compiler extraction for class-name style chains.
145
+ - Add Tailwind presets for both style-object and class-name authoring.
146
+ - Add `classNameTransform`, `classNameValue`, and transform metadata for
147
+ preserving source class labels in emitted rules.
148
+ - Add named token compiler support for static extraction and theme override
149
+ identity.
150
+ - Add configurable transform class-name formatting and hash length behavior for
151
+ debug output.
152
+
153
+ ## 0.1.0-beta.1
154
+
155
+ This patch beta improves typed selector authoring and documentation.
156
+
157
+ ### Changes
158
+
159
+ - Add `createSelectorAssert` for typed custom selector validators.
160
+ - Keep the public beta API moving with small usability refinements after
161
+ `0.1.0-beta.0`.
8
162
 
9
163
  ## 0.1.0-beta.0
10
164
 
package/README.md CHANGED
@@ -1,22 +1,28 @@
1
1
  # Fluentic Style
2
2
 
3
- Component style composition for React.
3
+ Build your own styling language on top of a stable component styling model.
4
4
 
5
- React styling has a lot of good answers already: CSS files, utility classes,
5
+ Styling UI apps has a lot of good answers already: CSS files, utility classes,
6
6
  CSS-in-JS, compiled CSS, design tokens, and component libraries. Fluentic
7
7
  explores a specific question inside that space: what if styles composed around
8
- React components the same way props and state do?
9
-
10
- With Fluentic, you start simple with type-safe `style(...)` and the JSX `css`
11
- prop. When a component needs variants, themes, nested parts, or consumer
12
- overrides, add slots, scopes, tokens, and `combineStyle(...)` so those styles
13
- stay organized around the component.
14
-
15
- For production builds, styles are extracted into static atomic CSS output.
16
- Dynamic values from props and state still work as usual.
8
+ components the same way props, state, and themes do?
9
+
10
+ With Fluentic, you start simple with type-safe `style(...)` values and attach
11
+ them through a JSX `css` prop or a framework adapter. React, Preact, and SolidJS
12
+ are supported today, with the core style data model designed to keep expanding
13
+ across JSX runtimes, compiler-backed frameworks, and server-rendered UI stacks.
14
+ If your team prefers utility class names, you can also create class-name style
15
+ chains, including a Tailwind-like preset.
16
+
17
+ When a component needs variants, themes, nested parts, or consumer overrides,
18
+ add slots, scopes, tokens, values, and `combineStyle(...)` so those styles stay
19
+ organized around the component instead of leaking through class names or private
20
+ DOM structure. For production builds, Fluentic extracts static styles into
21
+ atomic CSS output while dynamic values from props, state, signals, or request
22
+ data still work at runtime.
17
23
 
18
24
  [Docs](https://fluenticstack.com/style) |
19
- [Quick start](https://fluenticstack.com/style/docs/getting-started/quick-start/) |
25
+ [Start here](https://fluenticstack.com/style/docs/learn/start-here/) |
20
26
  [Playground](https://fluenticstack.com/style/playground/) |
21
27
  [npm](https://www.npmjs.com/package/@fluentic/style)
22
28
 
@@ -34,13 +40,35 @@ Or with pnpm:
34
40
  pnpm add @fluentic/style@beta
35
41
  ```
36
42
 
37
- Use Fluentic in a React app. Add a bundler plugin later when you want production
38
- extraction.
43
+ Use Fluentic in a JSX app. Add a bundler or framework plugin when you want
44
+ production extraction.
45
+
46
+ ## What Fluentic Supports
47
+
48
+ Fluentic is not tied to one styling vocabulary or one framework runtime. The
49
+ same style model powers CSS-like objects, custom design-system fields,
50
+ Tailwind-like object fields, class-name chains, slots, scopes, themes, tokens,
51
+ runtime values, static extraction, and development traces.
52
+
53
+ | Area | Support |
54
+ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55
+ | Core styling model | [`style(...)`](https://fluenticstack.com/style/docs/reference/style/), [`style.slot(...)`](https://fluenticstack.com/style/docs/reference/style-slot/), [`style.scope(...)`](https://fluenticstack.com/style/docs/reference/style-scope/), [`combineStyle(...)`](https://fluenticstack.com/style/docs/reference/combine-style/), themes, tokens, values, selectors, at-rules, keyframes, and font faces. |
56
+ | Authoring vocabularies | CSS-like object styles, custom style functions, custom selectors, custom properties, Tailwind-like object fields, and Tailwind-like class-name chains. |
57
+ | Runtime paths | Runtime-only JSX setup for quick adoption, compiler-backed extracted runtime for production, and framework css-prop adapters that keep the framework's normal JSX transform. |
58
+ | Frameworks today | React, Next.js App Router, Preact, and SolidJS. |
59
+ | Bundlers today | Vite, Webpack, Rspack, Farm, Parcel 2, Babel/custom compiler use, and the Next.js integration for App Router projects. |
60
+ | Development tools | Readable debug class names, source traces, JSX element markers, sourcemaps, priority inspection, and React Server Component development support for Next.js. |
61
+
62
+ See the [integration overview](https://fluenticstack.com/style/docs/integrations/overview/)
63
+ for setup guides and the
64
+ [reference overview](https://fluenticstack.com/style/docs/reference/overview/)
65
+ for the API surface.
39
66
 
40
67
  ## Configure Runtime JSX
41
68
 
42
69
  Enable the runtime JSX import source so DOM and SVG elements accept the `css`
43
- prop. This path works without a Fluentic bundler plugin.
70
+ prop. This path works without a Fluentic bundler plugin and is the quickest
71
+ React setup path.
44
72
 
45
73
  ```jsonc
46
74
  /* tsconfig.json */
@@ -52,10 +80,14 @@ prop. This path works without a Fluentic bundler plugin.
52
80
  }
53
81
  ```
54
82
 
83
+ For SolidJS and Preact, keep the framework's normal JSX configuration and use
84
+ the Vite css-prop adapter instead:
85
+ [SolidJS](https://fluenticstack.com/style/docs/integrations/solidjs/) and
86
+ [PreactJS](https://fluenticstack.com/style/docs/integrations/preact/).
87
+
55
88
  ## Why Another Style Library?
56
89
 
57
- Component libraries need more than a way to attach styles to elements. They
58
- need:
90
+ Component systems need more than a way to attach styles to elements. They need:
59
91
 
60
92
  - base styles owned by the component;
61
93
  - state styles for hover, focus, active, disabled, media, and container queries;
@@ -97,12 +129,60 @@ export function Card() {
97
129
  }
98
130
  ```
99
131
 
100
- That is the smallest version of Fluentic Style: type-safe styles, selectors, and
101
- a `css` prop.
132
+ That is the smallest version of Fluentic Style: type-safe styles, selectors,
133
+ and a component-owned style value attached to JSX. The example uses React-style
134
+ syntax, but the same style data can be lowered through framework adapters.
135
+
136
+ ## Class Name Chains
137
+
138
+ Fluentic's default authoring path is object style chains, but class-name chains
139
+ are supported too. A class-name chain still produces Fluentic style data, so it
140
+ can use the same `css` prop, selector methods, slots, scopes, debugging, runtime
141
+ resolution, and production extraction path.
142
+
143
+ ```tsx
144
+ import { createClassNameFn } from '@fluentic/style';
145
+ import {
146
+ createTailwindClassNamePreset,
147
+ defaultTailwindTheme,
148
+ } from '@fluentic/style/presets/tailwind';
149
+
150
+ const tailwind = createTailwindClassNamePreset({
151
+ theme: defaultTailwindTheme,
152
+ });
153
+
154
+ export const { className: cx } = createClassNameFn({
155
+ selectors: tailwind.selectors,
156
+ transform: tailwind.transform,
157
+ });
158
+
159
+ const button = cx(
160
+ 'inline-flex',
161
+ 'items-center',
162
+ 'gap-2',
163
+ 'rounded-md',
164
+ 'bg-blue-600',
165
+ 'px-4',
166
+ 'py-2',
167
+ 'text-white',
168
+ )
169
+ .hover('bg-blue-700')
170
+ .md('px-6');
171
+ ```
172
+
173
+ Class names get their meaning from a user-land transform or a preset. See
174
+ [Class Name Style Chains](https://fluenticstack.com/style/docs/beyond-the-basics/class-name-style-chains/)
175
+ for the generic API, or
176
+ [Tailwind Class Name Preset](https://fluenticstack.com/style/docs/presets/tailwind/class-name/)
177
+ for the built-in Tailwind-like class-name vocabulary.
102
178
 
103
179
  ## Scale Into Components
104
180
 
105
- When a component becomes reusable, give its styles component structure.
181
+ When a component becomes reusable, give its styles component structure. This
182
+ section uses React component types for the example, but the important part is
183
+ the framework-independent style model: slots name public styling targets, scopes
184
+ describe changes to those targets, and the component decides where resolved
185
+ styles attach.
106
186
 
107
187
  ```tsx
108
188
  /* tokens.ts */
@@ -285,15 +365,24 @@ priority with layers or sorted output.
285
365
 
286
366
  ## Add Production Extraction
287
367
 
288
- Fluentic Style works without a compiler. In runtime mode, the JSX `css` prop
289
- resolves class names and inserts atomic CSS rules as needed.
368
+ Fluentic Style works without a compiler. In runtime-only mode, the JSX `css`
369
+ prop resolves class names and inserts atomic CSS rules as needed. That is useful
370
+ for trying the API, custom environments, and incremental adoption.
371
+
372
+ For production builds, add a bundler or framework plugin. Static styles are
373
+ extracted into ordered atomic CSS output. Runtime composition stays available
374
+ for values that still depend on props, state, signals, request data, user input,
375
+ or incoming themes.
290
376
 
291
- For production builds, add a bundler plugin. Styles are extracted into static
292
- atomic CSS output. Dynamic values from props, state, or user input still work as
293
- usual.
377
+ There are two integration shapes:
294
378
 
295
- After adding a Fluentic bundler plugin, change the JSX import source from
296
- `@fluentic/style/jsx` to `@fluentic/style/plugin/jsx`.
379
+ - React apps can use Fluentic's JSX runtime import source, switching from
380
+ `@fluentic/style/jsx` to `@fluentic/style/plugin/jsx` after adding a plugin.
381
+ - React, Preact, and SolidJS can also use a compiler css-prop adapter, letting
382
+ the framework keep its normal JSX runtime while Fluentic compiles
383
+ `css={...}` before the framework JSX transform runs.
384
+
385
+ The React JSX-runtime setup looks like this:
297
386
 
298
387
  ```jsonc
299
388
  /* tsconfig.json */
@@ -325,15 +414,57 @@ export default defineConfig({
325
414
  development sourcemaps, and extracted CSS output. See
326
415
  [Plugin Options](https://fluenticstack.com/style/docs/reference/plugin-options/).
327
416
 
328
- For Next.js and other bundlers, see the
329
- [integration docs](https://fluenticstack.com/style/docs/integrations/overview/).
417
+ The framework-adapter setup passes a css-prop preset to the plugin. This is the
418
+ normal path for SolidJS and Preact, and an optional path for React:
419
+
420
+ ```ts
421
+ /* vite.config.ts */
422
+ import { CssPropPresets, plugin as stylePlugin } from '@fluentic/style/plugin/vite';
423
+ import { defineConfig } from 'vite';
424
+
425
+ export default defineConfig({
426
+ plugins: [
427
+ stylePlugin({
428
+ cssProp: CssPropPresets.Solid,
429
+ }),
430
+ // then the framework JSX plugin, such as vite-plugin-solid
431
+ ],
432
+ });
433
+ ```
434
+
435
+ For framework and bundler-specific setup, see:
436
+
437
+ | Environment | Guide |
438
+ | -------------------------- | ----------------------------------------------------------------------------------------- |
439
+ | Next.js App Router | [Next.js](https://fluenticstack.com/style/docs/integrations/nextjs/) |
440
+ | Vite + React | [Vite](https://fluenticstack.com/style/docs/integrations/vite/) |
441
+ | Vite + SolidJS | [SolidJS](https://fluenticstack.com/style/docs/integrations/solidjs/) |
442
+ | Vite + Preact | [PreactJS](https://fluenticstack.com/style/docs/integrations/preact/) |
443
+ | Webpack | [Webpack](https://fluenticstack.com/style/docs/integrations/webpack/) |
444
+ | Rspack | [Rspack](https://fluenticstack.com/style/docs/integrations/rspack/) |
445
+ | Farm | [Farm](https://fluenticstack.com/style/docs/integrations/farm/) |
446
+ | Parcel 2 | [Parcel](https://fluenticstack.com/style/docs/integrations/parcel/) |
447
+ | Runtime-only | [Runtime-Only Mode](https://fluenticstack.com/style/docs/integrations/runtime-only-mode/) |
448
+ | Custom compiler or bundler | [Custom Compiler](https://fluenticstack.com/style/docs/integrations/custom-compiler/) |
330
449
 
331
450
  ## Benchmarks
332
451
 
333
452
  Benchmarks live in the repository's `benchmark/` folder and run against
334
453
  production builds. Current benchmark snapshots:
335
454
 
336
- React app, 1500-row dashboard:
455
+ The main production checks are runtime cost and bundle size. In the production
456
+ path most apps use, Fluentic extracts CSS at build time and ships the extracted
457
+ production runtime for `css` prop composition, dynamic values, class-name
458
+ merging, and token resolution. That runtime entry currently reports `4.92 KB`
459
+ min+gzip.
460
+ Browser and SSR benchmarks track whether style resolution stays fast in
461
+ app-shaped renders. See the
462
+ [Bundle Size](https://fluenticstack.com/style/docs/benchmark/bundle-size/),
463
+ [React App](https://fluenticstack.com/style/docs/benchmark/react-app/), and
464
+ [SSR Style](https://fluenticstack.com/style/docs/benchmark/ssr-style/) reports
465
+ for what each number measures and how to rerun it.
466
+
467
+ [React app](https://fluenticstack.com/style/docs/benchmark/react-app/), 1500-row dashboard:
337
468
 
338
469
  | Case | Mount | Style Update |
339
470
  | -------------------------- | ---------- | ------------ |
@@ -347,7 +478,7 @@ React app, 1500-row dashboard:
347
478
  | vanilla-extract DOM | `39.85 ms` | `17.65 ms` |
348
479
  | CSS Modules DOM | `40.35 ms` | `17.75 ms` |
349
480
 
350
- SSR render-only, 500 rows:
481
+ [SSR render-only](https://fluenticstack.com/style/docs/benchmark/ssr-style/), 500 rows:
351
482
 
352
483
  | Case | Dashboard Mean | Composition Mean |
353
484
  | --------------- | -------------- | ---------------- |
@@ -357,7 +488,7 @@ SSR render-only, 500 rows:
357
488
  | Fluentic token | `7.667 ms` | `8.253 ms` |
358
489
  | StyleX | `6.826 ms` | `8.059 ms` |
359
490
 
360
- Compiler transform, 100 files per corpus:
491
+ [Compiler transform](https://fluenticstack.com/style/docs/benchmark/compiler/), 100 files per corpus:
361
492
 
362
493
  | Corpus | Fluentic Warm | StyleX Babel |
363
494
  | ------------- | ------------- | ------------ |
@@ -371,23 +502,24 @@ and the public suite list.
371
502
 
372
503
  ## Package Exports
373
504
 
374
- | Import | Purpose |
375
- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
376
- | `@fluentic/style` | Runtime API, style builders, hooks, tokens, themes, and types. |
377
- | `@fluentic/style/css` | CSS helper APIs for keyframes, font faces, and at-rules. |
378
- | `@fluentic/style/selector` | Selector constructors, validators, presets, and priority helpers. |
379
- | `@fluentic/style/config` | Runtime configuration helpers. |
380
- | `@fluentic/style/compiler` | Node-only compiler entry used by build integrations and compiler benchmarks. |
381
- | `@fluentic/style/dev` | Development utilities. |
382
- | `@fluentic/style/dev/rsc` | React Server Component dev client boundary. |
383
- | `@fluentic/style/jsx` | [JSX import source without a bundler plugin](https://fluenticstack.com/style/docs/integrations/runtime-only-mode/). |
384
- | `@fluentic/style/plugin/jsx` | [JSX import source after adding a bundler plugin](https://fluenticstack.com/style/docs/integrations/jsx-runtime-setup/). |
385
- | `@fluentic/style/plugin/nextjs` | [Next.js App Router integration](https://fluenticstack.com/style/docs/integrations/nextjs/). |
386
- | `@fluentic/style/plugin/vite` | [Vite plugin](https://fluenticstack.com/style/docs/integrations/vite/). |
387
- | `@fluentic/style/plugin/webpack` | [Webpack plugin](https://fluenticstack.com/style/docs/integrations/webpack/). |
388
- | `@fluentic/style/plugin/rspack` | [Rspack plugin](https://fluenticstack.com/style/docs/integrations/rspack/). |
389
- | `@fluentic/style/plugin/farm` | [Farm plugin](https://fluenticstack.com/style/docs/integrations/farm/). |
390
- | `@fluentic/style/plugin/parcel` | [Parcel plugin](https://fluenticstack.com/style/docs/integrations/parcel/). |
505
+ | Import | Purpose |
506
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
507
+ | `@fluentic/style` | Runtime API, style builders, hooks, tokens, themes, and types. |
508
+ | `@fluentic/style/css` | CSS helper APIs for keyframes, font faces, and at-rules. |
509
+ | `@fluentic/style/selector` | Selector constructors, validators, presets, and priority helpers. |
510
+ | `@fluentic/style/config` | Runtime configuration helpers. |
511
+ | `@fluentic/style/compiler` | Node-only compiler entry used by build integrations and compiler benchmarks. |
512
+ | `@fluentic/style/presets/tailwind` | [Tailwind-like object fields and class-name chains](https://fluenticstack.com/style/docs/presets/tailwind/). |
513
+ | `@fluentic/style/dev` | Development utilities. |
514
+ | `@fluentic/style/dev/rsc` | React Server Component dev client boundary. |
515
+ | `@fluentic/style/jsx` | [JSX import source without a bundler plugin](https://fluenticstack.com/style/docs/integrations/runtime-only-mode/). |
516
+ | `@fluentic/style/plugin/jsx` | [JSX import source after adding a bundler plugin](https://fluenticstack.com/style/docs/integrations/jsx-runtime-setup/). |
517
+ | `@fluentic/style/plugin/nextjs` | [Next.js App Router integration](https://fluenticstack.com/style/docs/integrations/nextjs/). |
518
+ | `@fluentic/style/plugin/vite` | [Vite plugin](https://fluenticstack.com/style/docs/integrations/vite/). |
519
+ | `@fluentic/style/plugin/webpack` | [Webpack plugin](https://fluenticstack.com/style/docs/integrations/webpack/). |
520
+ | `@fluentic/style/plugin/rspack` | [Rspack plugin](https://fluenticstack.com/style/docs/integrations/rspack/). |
521
+ | `@fluentic/style/plugin/farm` | [Farm plugin](https://fluenticstack.com/style/docs/integrations/farm/). |
522
+ | `@fluentic/style/plugin/parcel` | [Parcel plugin](https://fluenticstack.com/style/docs/integrations/parcel/). |
391
523
 
392
524
  ## Repository Guide
393
525
 
@@ -1,9 +1,10 @@
1
+ import { CSS_CONFIG } from '../../config/config/css';
1
2
  import { type NamedAtRuleFormat, type NamedAtRuleInfo, type TokenNameFormat } from '../../config/types';
2
3
  import { getStyleTokenId, isStyleTokenData, type StyleTokenData } from '../../style/token';
3
4
  import { getCssPropertyName } from '../property';
4
5
  import { getTokenVar } from '../token';
5
- import { getIdentifierSafeHash } from '../utils/css';
6
6
  import { createNameFormatter } from '../utils/format';
7
+ import { getIdentifierSafeHash } from '../utils/hash';
7
8
  import { getCssPropertyValue } from '../value';
8
9
 
9
10
  export function createAtRuleNameFormatter(defaultFormat: NamedAtRuleFormat, prefix?: string) {
@@ -14,7 +15,7 @@ export function createAtRuleNameFormatter(defaultFormat: NamedAtRuleFormat, pref
14
15
  id: string,
15
16
  info: NamedAtRuleInfo,
16
17
  ) => {
17
- const hash = getIdentifierSafeHash(id);
18
+ const hash = getIdentifierSafeHash(id, CSS_CONFIG.hashLength);
18
19
  const name = formatter(format || defaultFormat, hash, info);
19
20
 
20
21
  if (!prefix) return name;
@@ -1,15 +1,19 @@
1
1
  import type { BuilderCallsite, ItemSelector } from '../builder/data';
2
- import type { ClassNameFormat, ScopeClassNameFormat } from '../config/types';
2
+ import { CSS_CONFIG } from '../config/config/css';
3
+ import { DEV_CONFIG } from '../config/config/dev';
4
+ import type { ClassNameFormat, TransformClassNameFormat } from '../config/types';
3
5
  import { hashString } from '../utils/hash';
4
- import { getDebugClassName, getDebugScopeClassName } from './debug/className';
6
+ import { getDebugClassName, getDebugSheetClassName, getDebugTransformClassName } from './debug/className';
5
7
  import { getDebugPropertyName } from './debug/property';
6
8
  import { getDebugAtRuleName, getDebugSelectorName } from './debug/selector';
7
- import { getIdentifierSafeHash } from './utils/css';
8
- import { getSelectorHash, getSelectorText } from './utils/selector';
9
+ export { getScopeClassName } from './scope';
10
+ import { getIdentifierSafeHash } from './utils/hash';
11
+ import { getSelectorHash, getSelectorText, hasSheetSelectorAnchor } from './utils/selector';
9
12
 
10
13
  export function getAtomicClassName(
11
14
  property: string,
12
15
  priority: number | null,
16
+ important: boolean,
13
17
  value: string,
14
18
  selector: ItemSelector | null,
15
19
  parentSelector: ItemSelector | null,
@@ -18,24 +22,41 @@ export function getAtomicClassName(
18
22
  localClassName: boolean,
19
23
  debugClassName: boolean,
20
24
  classNameFormat: ClassNameFormat | null,
25
+ transformClassName: string | null,
26
+ transformClassNameFormat: TransformClassNameFormat | null,
27
+ sheetClassNameFormat: ClassNameFormat | null = null,
28
+ hashLength: number | null = null,
21
29
  ) {
22
30
  let hash = property;
23
31
 
24
32
  hash += '\n' + (priority || '');
33
+ if (important) hash += '\nimportant';
25
34
  hash += '\n' + value;
26
35
  hash += '\n' + (selector ? getSelectorHash(selector) : '');
27
36
  hash += '\n' + (parentSelector ? getSelectorHash(parentSelector) : '');
28
37
  hash += '\n' + (atRule ? atRule.map(getSelectorHash).join('\n') : '');
29
38
  hash += '\n' + getCallsiteHash(callsite, localClassName);
30
39
 
31
- hash = getIdentifierSafeHash(hash);
40
+ hash = getIdentifierSafeHash(
41
+ hash,
42
+ hashLength ?? getRuntimeClassNameHashLength(debugClassName),
43
+ );
32
44
 
33
45
  if (!debugClassName) return hash;
34
46
 
47
+ if (transformClassName) {
48
+ return getDebugTransformClassName(
49
+ transformClassNameFormat,
50
+ hash,
51
+ { className: transformClassName },
52
+ );
53
+ }
54
+
35
55
  const propertyName = getDebugPropertyName(property, value);
36
56
 
37
- const className = getDebugClassName(
38
- classNameFormat,
57
+ const isSheetClassName = hasSheetSelectorAnchor(selector);
58
+ const className = (isSheetClassName ? getDebugSheetClassName : getDebugClassName)(
59
+ isSheetClassName ? sheetClassNameFormat : classNameFormat,
39
60
  hash,
40
61
  {
41
62
  atRule: atRule
@@ -59,16 +80,32 @@ export function getAtomicClassName(
59
80
  return className;
60
81
  }
61
82
 
62
- export function getScopeClassName(
63
- className: string,
64
- scopeClassNameFormat: ScopeClassNameFormat | null,
65
- ) {
66
- return getDebugScopeClassName(scopeClassNameFormat, { className });
83
+ function getRuntimeClassNameHashLength(debugClassName: boolean) {
84
+ return getClassNameHashLength({
85
+ debugClassName,
86
+ isDev: DEV_CONFIG.isDev,
87
+ devHashLength: DEV_CONFIG.hashLength,
88
+ cssHashLength: CSS_CONFIG.hashLength,
89
+ });
90
+ }
91
+
92
+ export function getClassNameHashLength(options: {
93
+ debugClassName: boolean;
94
+ isDev: boolean;
95
+ devHashLength?: number | null;
96
+ cssHashLength?: number | null;
97
+ }) {
98
+ if (options.debugClassName && options.isDev) {
99
+ return options.devHashLength ?? options.cssHashLength ?? 5;
100
+ }
101
+
102
+ return options.cssHashLength ?? 7;
67
103
  }
68
104
 
69
105
  export function getClassNameDedupe(
70
106
  property: string,
71
107
  priority: number | null,
108
+ important: boolean,
72
109
  selector: ItemSelector | null,
73
110
  parentSelector: ItemSelector | null,
74
111
  atRule: ItemSelector[] | null,
@@ -76,6 +113,7 @@ export function getClassNameDedupe(
76
113
  let hash = property;
77
114
 
78
115
  hash += '\n' + (priority || '');
116
+ if (important) hash += '\nimportant';
79
117
  hash += '\n' + (selector ? getSelectorHash(selector) : '');
80
118
  hash += '\n' + (parentSelector ? getSelectorHash(parentSelector) : '');
81
119
  hash += '\n' + (atRule ? atRule.map(getSelectorHash).join('\n') : '');