@fluentic/style 0.1.0-beta.3 → 0.1.0-beta.5

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 (430) hide show
  1. package/CHANGELOG.md +55 -1
  2. package/README.md +10 -9
  3. package/atomic/className.ts +12 -12
  4. package/atomic/debug/className/className.ts +10 -15
  5. package/atomic/element.ts +1 -1
  6. package/atomic/rule.ts +8 -5
  7. package/atomic/scope.ts +19 -0
  8. package/atomic/theme.ts +41 -2
  9. package/atomic/token.ts +4 -3
  10. package/atomic/utils/{css.ts → cssIdent.ts} +0 -20
  11. package/atomic/utils/cssVar.ts +19 -0
  12. package/atomic/utils/debug.ts +1 -1
  13. package/atomic/utils/selector.ts +14 -1
  14. package/builder/classname/class_name_builder.ts +68 -24
  15. package/builder/classname/fns.ts +2 -2
  16. package/builder/classname/types.ts +7 -0
  17. package/builder/data/const.ts +7 -1
  18. package/builder/data/create.ts +42 -0
  19. package/builder/data/data.ts +20 -1
  20. package/builder/data/index.ts +0 -1
  21. package/builder/data/is.ts +23 -0
  22. package/builder/data/merge/scope.ts +20 -19
  23. package/builder/data/merge/style.ts +71 -21
  24. package/builder/data/state.ts +16 -2
  25. package/builder/extract/index.ts +1 -0
  26. package/builder/extract/sheet.ts +26 -0
  27. package/builder/extract/token.ts +30 -14
  28. package/builder/extract/utils.ts +2 -0
  29. package/builder/extract/withTokens.ts +2 -1
  30. package/builder/selector_override.noop.ts +11 -0
  31. package/builder/selector_override.ts +30 -0
  32. package/builder/selector_override_core.ts +66 -0
  33. package/builder/style_builder.ts +127 -3
  34. package/builder/style_data.ts +24 -0
  35. package/builder/style_fns.ts +24 -24
  36. package/builder/token/data.ts +30 -0
  37. package/builder/token/index.ts +3 -0
  38. package/builder/token/name.ts +54 -0
  39. package/builder/token/symbols.ts +6 -0
  40. package/builder/types/alias.ts +34 -6
  41. package/builder/types/fns.ts +13 -5
  42. package/builder/types/types.ts +32 -2
  43. package/builder/utils.ts +1 -0
  44. package/compiler/compiler/compiler.ts +4 -7
  45. package/compiler/compiler/constants.ts +6 -0
  46. package/compiler/compiler/index.ts +1 -0
  47. package/compiler/compiler/types.ts +2 -0
  48. package/compiler/cssProp.ts +35 -0
  49. package/compiler/index.ts +1 -0
  50. package/compiler/transform/cssProp/index.ts +1 -0
  51. package/compiler/transform/cssProp/plugin.ts +129 -0
  52. package/compiler/transform/debug/plugin.ts +85 -1
  53. package/compiler/transform/debug/transform.ts +2 -1
  54. package/compiler/transform/evaluator/evaluator.ts +106 -30
  55. package/compiler/transform/evaluator/tracer.ts +30 -2
  56. package/compiler/transform/extract/chain/chain.ts +541 -63
  57. package/compiler/transform/extract/chain/extract_chain.ts +12 -4
  58. package/compiler/transform/extract/chain/types.ts +1 -1
  59. package/compiler/transform/extract/plugin.ts +20 -4
  60. package/compiler/transform/extract/transform.ts +2 -1
  61. package/compiler/transform/extract/utils/replacement.ts +52 -2
  62. package/compiler/transform/extract/utils/state.ts +2 -0
  63. package/compiler/transform/extract/utils/theme.ts +6 -6
  64. package/compiler/transform/index.ts +1 -0
  65. package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
  66. package/compiler/transform/syntax/static_ids.ts +1 -1
  67. package/compiler/utils/constants.ts +8 -1
  68. package/compiler/utils/imports.ts +11 -1
  69. package/config/build.ts +1 -8
  70. package/config/config/css.ts +1 -0
  71. package/config/config/debug.ts +11 -0
  72. package/css/index.ts +2 -0
  73. package/css/sheet.ts +119 -0
  74. package/css/styleTarget.ts +251 -0
  75. package/dialect/namedTokens.ts +22 -5
  76. package/dist/adapter/preact.js +2 -0
  77. package/dist/adapter/react.js +2 -0
  78. package/dist/adapter/solid.js +2 -0
  79. package/dist/className-hiAsQ9V6.js +303 -0
  80. package/dist/className-hiAsQ9V6.js.map +1 -0
  81. package/dist/{style-Bw5ka-Nq.js → combine-Ca6LfFxv.js} +427 -722
  82. package/dist/combine-Ca6LfFxv.js.map +1 -0
  83. package/dist/compiler/index.mjs +2 -2
  84. package/dist/{compiler-D5v5tJXI.mjs → compiler-OgDBuqfs.mjs} +1635 -607
  85. package/dist/compiler-OgDBuqfs.mjs.map +1 -0
  86. package/dist/config/index.js +2 -2
  87. package/dist/config-B-KbXpIh.js +6 -0
  88. package/dist/{config-OXHoDUIo.js.map → config-B-KbXpIh.js.map} +1 -1
  89. package/dist/config-Barf8f4B.js +35 -0
  90. package/dist/config-Barf8f4B.js.map +1 -0
  91. package/dist/{config-BEvP7108.js → config-BtANtGAh.js} +4 -6
  92. package/dist/config-BtANtGAh.js.map +1 -0
  93. package/dist/config-CsB4MuFI.js +6 -0
  94. package/dist/config-CsB4MuFI.js.map +1 -0
  95. package/dist/config-DOWSNV8w.js +1 -0
  96. package/dist/{config-FIfi5aJ8.js → config-t76UljYv.js} +9 -7
  97. package/dist/config-t76UljYv.js.map +1 -0
  98. package/dist/createTransformElement-DDqld3RF.js +34 -0
  99. package/dist/createTransformElement-DDqld3RF.js.map +1 -0
  100. package/dist/css-CZwrac6F.js +3923 -0
  101. package/dist/css-CZwrac6F.js.map +1 -0
  102. package/dist/{global-zaCE-g1C.js → css-GtUPEO9U.js} +16 -3
  103. package/dist/css-GtUPEO9U.js.map +1 -0
  104. package/dist/css-YfHN_8Nk.js +479 -0
  105. package/dist/css-YfHN_8Nk.js.map +1 -0
  106. package/dist/css-a9O5so0b.js +1246 -0
  107. package/dist/css-a9O5so0b.js.map +1 -0
  108. package/dist/css.js +2 -2
  109. package/dist/{css_extra-DeTuIlcO.js → css_extra-BiG57TKN.js} +2 -2
  110. package/dist/{css_extra-DQdCrYoC.js.map → css_extra-BiG57TKN.js.map} +1 -1
  111. package/dist/{css_extra-DQdCrYoC.js → css_extra-CXXZAylc.js} +2 -2
  112. package/dist/{css_extra-DeTuIlcO.js.map → css_extra-CXXZAylc.js.map} +1 -1
  113. package/dist/data-CzHJg147.js +763 -0
  114. package/dist/data-CzHJg147.js.map +1 -0
  115. package/dist/{debug-D96KGgpH.js → debug-DkrxyknP.js} +80 -4
  116. package/dist/debug-DkrxyknP.js.map +1 -0
  117. package/dist/{runtime-BKChZZ2-.js → debug-DycdGrul.js} +20 -27
  118. package/dist/debug-DycdGrul.js.map +1 -0
  119. package/dist/dev/rsc.js +6 -9
  120. package/dist/dev/rsc.js.map +1 -1
  121. package/dist/{dev-fOtWB5K3.js → dev-z4laBwlS.js} +7 -6
  122. package/dist/{dev-fOtWB5K3.js.map → dev-z4laBwlS.js.map} +1 -1
  123. package/dist/dev.js +1 -1
  124. package/dist/dialect/extracted/index.js +1 -1
  125. package/dist/dialect/index.js +1 -1
  126. package/dist/{elementMarker-CvqqIb7J.js → elementMarker-CqhU_l_m.js} +95 -9
  127. package/dist/elementMarker-CqhU_l_m.js.map +1 -0
  128. package/dist/entry/dev/adapter/preact.js +12 -0
  129. package/dist/entry/dev/adapter/preact.js.map +1 -0
  130. package/dist/entry/dev/adapter/react.js +12 -0
  131. package/dist/entry/dev/adapter/react.js.map +1 -0
  132. package/dist/entry/dev/adapter/solid.js +12 -0
  133. package/dist/entry/dev/adapter/solid.js.map +1 -0
  134. package/dist/entry/dev/css.js +3 -3
  135. package/dist/entry/dev/jsx-dev-runtime.js +2 -2
  136. package/dist/entry/dev/jsx-runtime.js +2 -2
  137. package/dist/entry/dev.js +13 -12
  138. package/dist/entry/prod/adapter/preact.js +12 -0
  139. package/dist/entry/prod/adapter/preact.js.map +1 -0
  140. package/dist/entry/prod/adapter/react.js +12 -0
  141. package/dist/entry/prod/adapter/react.js.map +1 -0
  142. package/dist/entry/prod/adapter/solid.js +12 -0
  143. package/dist/entry/prod/adapter/solid.js.map +1 -0
  144. package/dist/entry/prod/css.js +3 -3
  145. package/dist/entry/prod/extract.js +240 -3
  146. package/dist/entry/prod/extract.js.map +1 -0
  147. package/dist/entry/prod/jsx-dev-runtime.js +2 -2
  148. package/dist/entry/prod/jsx-runtime.js +2 -2
  149. package/dist/entry/prod/runtime.js +3 -4
  150. package/dist/entry/prod.js +85 -1201
  151. package/dist/entry/prod.js.map +1 -1
  152. package/dist/entry/rsc-dev/adapter/preact.js +12 -0
  153. package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
  154. package/dist/entry/rsc-dev/adapter/react.js +12 -0
  155. package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
  156. package/dist/entry/rsc-dev/adapter/solid.js +12 -0
  157. package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
  158. package/dist/entry/rsc-dev/css.js +3 -3
  159. package/dist/entry/rsc-dev/dev.js +6 -10
  160. package/dist/entry/rsc-dev/dev.js.map +1 -1
  161. package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
  162. package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
  163. package/dist/entry/rsc-dev.js +323 -615
  164. package/dist/entry/rsc-dev.js.map +1 -1
  165. package/dist/entry/rsc-prod/adapter/preact.js +2 -0
  166. package/dist/entry/rsc-prod/adapter/react.js +2 -0
  167. package/dist/entry/rsc-prod/adapter/solid.js +2 -0
  168. package/dist/entry/rsc-prod/css.js +9 -3
  169. package/dist/entry/rsc-prod/css.js.map +1 -0
  170. package/dist/entry/rsc-prod/jsx-dev-runtime.js +2 -2
  171. package/dist/entry/rsc-prod/jsx-runtime.js +2 -2
  172. package/dist/entry/rsc-prod/runtime.js +3 -4
  173. package/dist/entry/rsc-prod.js +241 -10
  174. package/dist/entry/rsc-prod.js.map +1 -0
  175. package/dist/{styleStore-ydQcDBD4.js → env-Db2cRt-h.js} +1256 -355
  176. package/dist/env-Db2cRt-h.js.map +1 -0
  177. package/dist/{jsx-A4cK517J.js → getClassName-DKtQl5ZX.js} +5 -11
  178. package/dist/getClassName-DKtQl5ZX.js.map +1 -0
  179. package/dist/{utils-hoYnMiA7.js → getClassName-DaZF5nfJ.js} +28 -65
  180. package/dist/getClassName-DaZF5nfJ.js.map +1 -0
  181. package/dist/getClassName-a6p2uMFM.js +536 -0
  182. package/dist/getClassName-a6p2uMFM.js.map +1 -0
  183. package/dist/{getClassName-oiQ8CnkS.js → getClassName-aD9zqg9U.js} +56 -14
  184. package/dist/getClassName-aD9zqg9U.js.map +1 -0
  185. package/dist/global-zYTvWskP.js +10 -0
  186. package/dist/{global-Cul1dX8k.js.map → global-zYTvWskP.js.map} +1 -1
  187. package/dist/{hash-Bycpk3MR.js → hash-BOlQThNz.js} +48 -4
  188. package/dist/hash-BOlQThNz.js.map +1 -0
  189. package/dist/index.js +10 -10
  190. package/dist/jsx/jsx-dev-runtime.js +2 -2
  191. package/dist/jsx/jsx-dev-runtime.server.js +1 -1
  192. package/dist/jsx/jsx-runtime.js +2 -2
  193. package/dist/jsx/jsx-runtime.server.js +1 -1
  194. package/dist/jsx-C2pnWLcb.js +39 -0
  195. package/dist/jsx-C2pnWLcb.js.map +1 -0
  196. package/dist/{jsx_dev_runtime-BQcRzl5D.js → jsx_dev_runtime-kSrmu6b1.js} +2 -3
  197. package/dist/{jsx_dev_runtime-BQcRzl5D.js.map → jsx_dev_runtime-kSrmu6b1.js.map} +1 -1
  198. package/dist/{jsx_runtime-BXcbW8Yp.js → jsx_runtime-BgK90E2O.js} +2 -3
  199. package/dist/{jsx_runtime-BXcbW8Yp.js.map → jsx_runtime-BgK90E2O.js.map} +1 -1
  200. package/dist/{jsx_runtime-B9KEoAQN.js → jsx_runtime-XJSHujgI.js} +2 -2
  201. package/dist/{jsx_runtime-B9KEoAQN.js.map → jsx_runtime-XJSHujgI.js.map} +1 -1
  202. package/dist/{loader-BAth2yZ1.mjs → loader-DHvgp0fK.mjs} +3 -3
  203. package/dist/{loader-BAth2yZ1.mjs.map → loader-DHvgp0fK.mjs.map} +1 -1
  204. package/dist/{misc-DFBKJGLT.mjs → misc-BuSLnvx0.mjs} +4 -4
  205. package/dist/misc-BuSLnvx0.mjs.map +1 -0
  206. package/dist/{namedTokens-BUa6raTb.js → namedTokens-D3tt-joz.js} +8 -6
  207. package/dist/namedTokens-D3tt-joz.js.map +1 -0
  208. package/dist/plugin/farm/index.mjs +4 -3
  209. package/dist/plugin/farm/index.mjs.map +1 -1
  210. package/dist/plugin/nextjs/index.mjs +5 -5
  211. package/dist/plugin/nextjs/index.mjs.map +1 -1
  212. package/dist/plugin/nextjs/loader.mjs +4 -4
  213. package/dist/plugin/parcel/index.cjs +2 -0
  214. package/dist/plugin/parcel/index.mjs +3 -1
  215. package/dist/plugin/parcel/optimizer.cjs +3 -2
  216. package/dist/plugin/parcel/optimizer.cjs.map +1 -1
  217. package/dist/plugin/parcel/optimizer.mjs +3 -2
  218. package/dist/plugin/parcel/optimizer.mjs.map +1 -1
  219. package/dist/plugin/parcel/resolver.cjs +1 -1
  220. package/dist/plugin/parcel/resolver.mjs +2 -2
  221. package/dist/plugin/parcel/runtime.cjs +1 -1
  222. package/dist/plugin/parcel/runtime.mjs +1 -1
  223. package/dist/plugin/parcel/transformer.cjs +1 -1
  224. package/dist/plugin/parcel/transformer.mjs +2 -2
  225. package/dist/plugin/rspack/index.mjs +3 -2
  226. package/dist/plugin/rspack/index.mjs.map +1 -1
  227. package/dist/plugin/vite/index.mjs +6 -6
  228. package/dist/plugin/vite/index.mjs.map +1 -1
  229. package/dist/plugin/webpack/index.mjs +3 -2
  230. package/dist/plugin/webpack/loader.mjs +2 -2
  231. package/dist/presets/tailwind/index.js +9 -7
  232. package/dist/presets/tailwind/index.js.map +1 -1
  233. package/dist/{assert-BGdigdr5.js → presets-DSanixJV.js} +106 -2
  234. package/dist/presets-DSanixJV.js.map +1 -0
  235. package/dist/{registry-CiwvMfx8.mjs → registry-r3BKWqpI.mjs} +2 -2
  236. package/dist/{registry-CiwvMfx8.mjs.map → registry-r3BKWqpI.mjs.map} +1 -1
  237. package/dist/resolveClassNameRuntime-D5a37GNr.js +63 -0
  238. package/dist/resolveClassNameRuntime-D5a37GNr.js.map +1 -0
  239. package/dist/{rules-DlXcch7-.js → rules-B0_rKPfB.js} +598 -132
  240. package/dist/rules-B0_rKPfB.js.map +1 -0
  241. package/dist/scope-BSuRLice.js +601 -0
  242. package/dist/scope-BSuRLice.js.map +1 -0
  243. package/dist/selector/index.js +1 -2
  244. package/dist/server.js +15 -13
  245. package/dist/server.js.map +1 -1
  246. package/dist/{shared-yDD0nfm1.cjs → shared-8_Msr7Q5.cjs} +1630 -597
  247. package/dist/shared-8_Msr7Q5.cjs.map +1 -0
  248. package/dist/{shared-x59dI2NW.mjs → shared-BGO_05rW.mjs} +4 -4
  249. package/dist/{shared-x59dI2NW.mjs.map → shared-BGO_05rW.mjs.map} +1 -1
  250. package/dist/sheet-BpLZIIuO.js +7 -0
  251. package/dist/{sheet-B-uJfHRY.js.map → sheet-BpLZIIuO.js.map} +1 -1
  252. package/dist/{sidecar-CJ6i4wmn.mjs → sidecar-Bu2x35JE.mjs} +3 -3
  253. package/dist/{sidecar-CJ6i4wmn.mjs.map → sidecar-Bu2x35JE.mjs.map} +1 -1
  254. package/dist/{styleStore-DJ0Msgkh.js → styleStore-BDy5TH6N.js} +5 -6
  255. package/dist/{styleStore-DJ0Msgkh.js.map → styleStore-BDy5TH6N.js.map} +1 -1
  256. package/dist/styleStore-DX3z_UVK.js +51 -0
  257. package/dist/styleStore-DX3z_UVK.js.map +1 -0
  258. package/dist/token-BsW_S8fN.js +138 -0
  259. package/dist/token-BsW_S8fN.js.map +1 -0
  260. package/dist/{trace-D8j96G57.js → trace-BdKEpgME.js} +2 -2
  261. package/dist/{trace-D8j96G57.js.map → trace-BdKEpgME.js.map} +1 -1
  262. package/dist/{trace-CO36aenp.js → trace-DcuMxR45.js} +3 -3
  263. package/dist/{trace-CO36aenp.js.map → trace-DcuMxR45.js.map} +1 -1
  264. package/dist/{transform-BTJOg8Hg.js → transform-BkrLIiIR.js} +2 -2
  265. package/dist/{transform-BTJOg8Hg.js.map → transform-BkrLIiIR.js.map} +1 -1
  266. package/dist/{style-DFFK06Of.js → types-BEUgXuu2.js} +356 -129
  267. package/dist/types-BEUgXuu2.js.map +1 -0
  268. package/dist/{utils-D2fygyTm.mjs → utils-BPDxr-oc.mjs} +4 -4
  269. package/dist/{utils-D2fygyTm.mjs.map → utils-BPDxr-oc.mjs.map} +1 -1
  270. package/dist/utils-CLnpwhJd.js +83 -0
  271. package/dist/utils-CLnpwhJd.js.map +1 -0
  272. package/dist/utils-CUl1BU40.js +72 -0
  273. package/dist/utils-CUl1BU40.js.map +1 -0
  274. package/dist/{utils-DTXCTUlS.mjs → utils-DZjLTV4D.mjs} +3 -3
  275. package/dist/{utils-DTXCTUlS.mjs.map → utils-DZjLTV4D.mjs.map} +1 -1
  276. package/dist/utils-okFWrQsg.js +41 -0
  277. package/dist/utils-okFWrQsg.js.map +1 -0
  278. package/dist/{utils-DVFxZnVC.js → utils-sBVZEq4u.js} +190 -144
  279. package/dist/utils-sBVZEq4u.js.map +1 -0
  280. package/dist/utils.js +4 -4
  281. package/dist/utils.js.map +1 -1
  282. package/dist/value-CpJpQ00y.js +145 -0
  283. package/dist/value-CpJpQ00y.js.map +1 -0
  284. package/dist/{webpack-BOU7_xld.mjs → webpack-DTKgR-HY.mjs} +5 -5
  285. package/dist/webpack-DTKgR-HY.mjs.map +1 -0
  286. package/entry/dev/adapter/preact.ts +8 -0
  287. package/entry/dev/adapter/react.ts +8 -0
  288. package/entry/dev/adapter/solid.ts +8 -0
  289. package/entry/prod/adapter/preact.ts +8 -0
  290. package/entry/prod/adapter/react.ts +8 -0
  291. package/entry/prod/adapter/solid.ts +8 -0
  292. package/entry/prod/config_debug.ts +2 -0
  293. package/entry/prod/index.ts +1 -1
  294. package/entry/prod/runtime.ts +3 -1
  295. package/entry/rsc_dev/adapter/preact.ts +1 -0
  296. package/entry/rsc_dev/adapter/react.ts +1 -0
  297. package/entry/rsc_dev/adapter/solid.ts +1 -0
  298. package/entry/rsc_prod/adapter/preact.ts +1 -0
  299. package/entry/rsc_prod/adapter/react.ts +1 -0
  300. package/entry/rsc_prod/adapter/solid.ts +1 -0
  301. package/entry/rsc_prod/config_debug.ts +6 -0
  302. package/entry/rsc_prod/index.ts +1 -1
  303. package/entry/shared/config_debug.ts +9 -0
  304. package/entry/shared/config_dev.ts +9 -7
  305. package/jsx/types/index.ts +3 -0
  306. package/jsx/types/preact.ts +14 -0
  307. package/jsx/{types.ts → types/react.ts} +2 -2
  308. package/jsx/types/solid.ts +32 -0
  309. package/package.json +78 -12
  310. package/plugin/bundler/farm/plugin.ts +2 -0
  311. package/plugin/bundler/parcel/optimizer.ts +1 -0
  312. package/plugin/bundler/parcel/plugin.ts +2 -0
  313. package/plugin/bundler/rspack/plugin.ts +1 -0
  314. package/plugin/bundler/vite/plugin.ts +3 -8
  315. package/plugin/bundler/vite/state.ts +2 -2
  316. package/plugin/bundler/webpack/plugin.ts +2 -1
  317. package/plugin/nextjs/plugin.ts +3 -0
  318. package/plugin/utils/compiler.ts +2 -0
  319. package/plugin/utils/runtimeEntry.ts +2 -2
  320. package/presets/tailwind/style/transform.ts +9 -3
  321. package/runtime/adapter/utils.ts +94 -0
  322. package/runtime/core/cache/combine.ts +76 -28
  323. package/runtime/core/cache/combineRuntime.ts +4 -0
  324. package/runtime/core/cache/index.ts +2 -1
  325. package/runtime/core/cache/item.ts +32 -13
  326. package/runtime/core/cache/itemWithResolver.ts +44 -0
  327. package/runtime/core/cache/pool.ts +15 -30
  328. package/runtime/core/cache/prop.ts +10 -8
  329. package/runtime/core/cache/result.ts +2 -2
  330. package/runtime/core/cache/stateItem.ts +16 -1
  331. package/runtime/core/cache/token.ts +20 -0
  332. package/runtime/core/cache/tokenValues.ts +19 -11
  333. package/runtime/core/combinedStyle.ts +4 -4
  334. package/runtime/extract/combineStyle.ts +211 -0
  335. package/runtime/extract/getClassName.ts +54 -17
  336. package/runtime/extract/index.ts +3 -1
  337. package/runtime/extract/token.ts +41 -0
  338. package/runtime/extract/tokenResolver.ts +17 -0
  339. package/runtime/sheet/rule.ts +3 -10
  340. package/runtime/style/scope.ts +0 -24
  341. package/runtime/style/style.ts +181 -6
  342. package/runtime/types.ts +3 -3
  343. package/style/classname.ts +12 -6
  344. package/style/important.ts +19 -0
  345. package/style/index.ts +2 -0
  346. package/style/style.ts +17 -5
  347. package/style/theme.ts +0 -1
  348. package/style/token.ts +26 -21
  349. package/style/tokens.ts +18 -12
  350. package/style/transform.ts +1 -1
  351. package/style/types.ts +6 -4
  352. package/style/utils/expose.ts +4 -3
  353. package/style/value.ts +26 -11
  354. package/style/valueRef.ts +1 -1
  355. package/style/weight.ts +21 -0
  356. package/utils/global.ts +1 -3
  357. package/utils/symbol.ts +3 -0
  358. package/dist/assert-BGdigdr5.js.map +0 -1
  359. package/dist/className-CKo4TxuT.js +0 -144
  360. package/dist/className-CKo4TxuT.js.map +0 -1
  361. package/dist/className-ZJ5pBA-o.js +0 -263
  362. package/dist/className-ZJ5pBA-o.js.map +0 -1
  363. package/dist/compiler-D5v5tJXI.mjs.map +0 -1
  364. package/dist/config-BEvP7108.js.map +0 -1
  365. package/dist/config-B_cbG3S6.js +0 -1
  366. package/dist/config-FIfi5aJ8.js.map +0 -1
  367. package/dist/config-OXHoDUIo.js +0 -6
  368. package/dist/css-CELBp6Gu.js +0 -58
  369. package/dist/css-CELBp6Gu.js.map +0 -1
  370. package/dist/css-DcuJ_jSH.js +0 -243
  371. package/dist/css-DcuJ_jSH.js.map +0 -1
  372. package/dist/css-dPoZJDQH.js +0 -807
  373. package/dist/css-dPoZJDQH.js.map +0 -1
  374. package/dist/css-oOt6ZR54.js +0 -237
  375. package/dist/css-oOt6ZR54.js.map +0 -1
  376. package/dist/data-CeYstKMP.js +0 -482
  377. package/dist/data-CeYstKMP.js.map +0 -1
  378. package/dist/debug-D96KGgpH.js.map +0 -1
  379. package/dist/dev-p8tW7X-A.js +0 -81
  380. package/dist/dev-p8tW7X-A.js.map +0 -1
  381. package/dist/elementMarker-CvqqIb7J.js.map +0 -1
  382. package/dist/extract-CzWJeQi8.js +0 -121
  383. package/dist/extract-CzWJeQi8.js.map +0 -1
  384. package/dist/extract-DeOytHKW.js +0 -2
  385. package/dist/getClassName-oiQ8CnkS.js.map +0 -1
  386. package/dist/global-Cul1dX8k.js +0 -14
  387. package/dist/global-zaCE-g1C.js.map +0 -1
  388. package/dist/hash-Bycpk3MR.js.map +0 -1
  389. package/dist/jsx-A4cK517J.js.map +0 -1
  390. package/dist/jsx-Ba-XV33u.js +0 -39
  391. package/dist/jsx-Ba-XV33u.js.map +0 -1
  392. package/dist/layer-CbQzwZF-.js +0 -94
  393. package/dist/layer-CbQzwZF-.js.map +0 -1
  394. package/dist/misc-DFBKJGLT.mjs.map +0 -1
  395. package/dist/namedTokens-BUa6raTb.js.map +0 -1
  396. package/dist/presets-BhXa232U.js +0 -108
  397. package/dist/presets-BhXa232U.js.map +0 -1
  398. package/dist/property-CF6JgpTq.js +0 -406
  399. package/dist/property-CF6JgpTq.js.map +0 -1
  400. package/dist/rules-DlXcch7-.js.map +0 -1
  401. package/dist/runtime-BKChZZ2-.js.map +0 -1
  402. package/dist/shared-yDD0nfm1.cjs.map +0 -1
  403. package/dist/sheet-B-uJfHRY.js +0 -7
  404. package/dist/style-91J0B5ef.js +0 -771
  405. package/dist/style-91J0B5ef.js.map +0 -1
  406. package/dist/style-Bw5ka-Nq.js.map +0 -1
  407. package/dist/style-DFFK06Of.js.map +0 -1
  408. package/dist/style-pz8e5To1.js +0 -5
  409. package/dist/styleStore-ydQcDBD4.js.map +0 -1
  410. package/dist/token-CKXUECuU.js +0 -76
  411. package/dist/token-CKXUECuU.js.map +0 -1
  412. package/dist/token-DTOyFLmp.js +0 -58
  413. package/dist/token-DTOyFLmp.js.map +0 -1
  414. package/dist/token-DT_sCPtm.js +0 -298
  415. package/dist/token-DT_sCPtm.js.map +0 -1
  416. package/dist/utils-Bmw655wa.js +0 -170
  417. package/dist/utils-Bmw655wa.js.map +0 -1
  418. package/dist/utils-DVFxZnVC.js.map +0 -1
  419. package/dist/utils-hoYnMiA7.js.map +0 -1
  420. package/dist/value-D-ZcRzLA.js +0 -42
  421. package/dist/value-D-ZcRzLA.js.map +0 -1
  422. package/dist/value-DvFkGBy2.js +0 -1029
  423. package/dist/value-DvFkGBy2.js.map +0 -1
  424. package/dist/value-dG9LK0Gq.js +0 -85
  425. package/dist/value-dG9LK0Gq.js.map +0 -1
  426. package/dist/valueRef-CsLVJwjA.js +0 -16
  427. package/dist/valueRef-CsLVJwjA.js.map +0 -1
  428. package/dist/webpack-BOU7_xld.mjs.map +0 -1
  429. package/dist/withTokens-LRidu3Vc.js +0 -95
  430. package/dist/withTokens-LRidu3Vc.js.map +0 -1
@@ -0,0 +1,763 @@
1
+ import { s as symbol, t as CSS_CONFIG } from "./css-GtUPEO9U.js";
2
+ import { t as DEBUG_CONFIG } from "./debug-DycdGrul.js";
3
+ import { a as hashString, i as createNameFormatter, t as getIdentifierSafeHash } from "./hash-BOlQThNz.js";
4
+ import { g as DEV_CONFIG, i as sanitizeDebugPropertyName, l as getDebugFieldVarName, m as traceError, n as normalizePropertyName, s as getDebugFieldCallsite, t as normalizeDebugKeywordValue } from "./debug-DkrxyknP.js";
5
+ import { C as BUILDER_SCOPE_ID, D as BUILDER_TYPE, E as BUILDER_STATE, S as BUILDER_SCOPE, T as BUILDER_SLOT_ID, _ as isSlotData, a as getSelectorText$1, f as isScopeData, n as shouldAppendCssPx, o as hasSheetSelectorAnchor, r as getSelectorHash, v as isSlotOverrideData, w as BUILDER_SELECTOR, x as BUILDER_CALLSITE, y as isStyleData } from "./value-CpJpQ00y.js";
6
+ import { a as getCssVarRawFallback, f as getStyleTokenId, g as isStyleTokenOverrideData, h as isStyleTokenData, n as getTokenVar } from "./token-BsW_S8fN.js";
7
+ import { r as isClassNameValue } from "./transform-BkrLIiIR.js";
8
+ //#region style/important.ts
9
+ const STYLE_IMPORTANT = symbol("style.important");
10
+ function importantValue(value) {
11
+ return {
12
+ [STYLE_IMPORTANT]: true,
13
+ value
14
+ };
15
+ }
16
+ function isStyleImportantValue(value) {
17
+ return !!value && typeof value === "object" && value[STYLE_IMPORTANT] === true;
18
+ }
19
+ //#endregion
20
+ //#region style/weight.ts
21
+ const STYLE_WEIGHT = symbol("style.weight");
22
+ function weightValue(value, weight) {
23
+ return {
24
+ [STYLE_WEIGHT]: true,
25
+ value,
26
+ weight
27
+ };
28
+ }
29
+ function isStyleWeightValue(value) {
30
+ return !!value && typeof value === "object" && value[STYLE_WEIGHT] === true;
31
+ }
32
+ //#endregion
33
+ //#region builder/data/create.ts
34
+ function createStyleData(callsite) {
35
+ return {
36
+ [BUILDER_TYPE]: 1,
37
+ [BUILDER_STATE]: {
38
+ items: [],
39
+ lookup: {}
40
+ },
41
+ [BUILDER_CALLSITE]: callsite
42
+ };
43
+ }
44
+ function createSheetData(callsite) {
45
+ return {
46
+ [BUILDER_TYPE]: 9,
47
+ [BUILDER_STATE]: {
48
+ items: [],
49
+ lookup: {}
50
+ },
51
+ [BUILDER_CALLSITE]: callsite
52
+ };
53
+ }
54
+ function createSlotData(callsite, slotId) {
55
+ return {
56
+ [BUILDER_TYPE]: 2,
57
+ [BUILDER_STATE]: {
58
+ items: [],
59
+ lookup: {}
60
+ },
61
+ [BUILDER_CALLSITE]: callsite,
62
+ [BUILDER_SLOT_ID]: slotId
63
+ };
64
+ }
65
+ function createSlotOverrideData(callsite, slotId) {
66
+ return {
67
+ [BUILDER_TYPE]: 3,
68
+ [BUILDER_STATE]: {
69
+ items: [],
70
+ lookup: {}
71
+ },
72
+ [BUILDER_CALLSITE]: callsite,
73
+ [BUILDER_SLOT_ID]: slotId
74
+ };
75
+ }
76
+ function createSelectorOverrideData(callsite, selectors) {
77
+ return {
78
+ [BUILDER_TYPE]: 8,
79
+ [BUILDER_STATE]: {
80
+ items: [],
81
+ lookup: {}
82
+ },
83
+ [BUILDER_CALLSITE]: callsite,
84
+ [BUILDER_SELECTOR]: selectors
85
+ };
86
+ }
87
+ function createSelectorData(callsite, selectors) {
88
+ return {
89
+ [BUILDER_TYPE]: 7,
90
+ [BUILDER_STATE]: {
91
+ items: [],
92
+ lookup: {}
93
+ },
94
+ [BUILDER_CALLSITE]: callsite,
95
+ [BUILDER_SELECTOR]: selectors
96
+ };
97
+ }
98
+ function createScopeData(callsite) {
99
+ return {
100
+ [BUILDER_TYPE]: 4,
101
+ [BUILDER_STATE]: {
102
+ items: [],
103
+ lookup: {}
104
+ },
105
+ [BUILDER_CALLSITE]: callsite
106
+ };
107
+ }
108
+ function createScopeTargetData(scope, slot) {
109
+ return {
110
+ [BUILDER_TYPE]: 5,
111
+ [BUILDER_SCOPE]: scope,
112
+ [BUILDER_SCOPE_ID]: slot[BUILDER_SLOT_ID]
113
+ };
114
+ }
115
+ function createThemeData(callsite, id, className, tokens) {
116
+ return {
117
+ [BUILDER_TYPE]: 6,
118
+ [BUILDER_STATE]: {
119
+ items: [],
120
+ lookup: {}
121
+ },
122
+ [BUILDER_CALLSITE]: callsite,
123
+ id,
124
+ className,
125
+ tokens
126
+ };
127
+ }
128
+ const formatClassName = createNameFormatter([
129
+ "atRule",
130
+ "scopeSelector",
131
+ "property",
132
+ "selector",
133
+ "value"
134
+ ]);
135
+ const formatTransformClassName = createNameFormatter(["className"]);
136
+ function getDebugClassName(format, hash, info) {
137
+ return formatClassName(format || "[(atRule)-][(scopeSelector)-](property)[-(selector)][-(value)]--$hash", hash, info);
138
+ }
139
+ function getDebugSheetClassName(format, hash, info) {
140
+ return formatClassName(format || "sheet-(property)[-(value)]--$hash", hash, info);
141
+ }
142
+ function getDebugTransformClassName(format, hash, info) {
143
+ return formatTransformClassName(format || "(className)--$hash", hash, info);
144
+ }
145
+ //#endregion
146
+ //#region atomic/debug/value.ts
147
+ function getDebugValueName(value) {
148
+ if (!value) return {
149
+ value: null,
150
+ arbitraryValue: null
151
+ };
152
+ const normalized = value.trim().toLowerCase();
153
+ if (!normalized) return {
154
+ value: null,
155
+ arbitraryValue: null
156
+ };
157
+ if (normalized.startsWith("url") || normalized.includes("gradient") || normalized.startsWith("image") || normalized.startsWith("calc(") || normalized.startsWith("var(") || normalized.startsWith("env(") || normalized.startsWith("rgb") || normalized.startsWith("hsl")) return {
158
+ value: null,
159
+ arbitraryValue: null
160
+ };
161
+ if (/^[a-z][a-z0-9-]*$/.test(normalized)) return {
162
+ value: normalized,
163
+ arbitraryValue: null
164
+ };
165
+ const name = normalized.replace(/px/g, "").replace(/rem/g, "rem").replace(/em/g, "em").replace(/%/g, "pct").replace(/fr/g, "fr").replace(/[,()"'#]/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9._%-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
166
+ if (!name) return {
167
+ value: null,
168
+ arbitraryValue: null
169
+ };
170
+ return {
171
+ value: null,
172
+ arbitraryValue: name
173
+ };
174
+ }
175
+ //#endregion
176
+ //#region atomic/debug/property/data.ts
177
+ const PROPERTY_ALIASES = {
178
+ "border-radius": "radius",
179
+ "flex-direction": "flex",
180
+ "font-style": "font",
181
+ "font-weight": "font",
182
+ "grid-template-columns": "grid-cols",
183
+ "grid-template-rows": "grid-rows",
184
+ "align-items": "items",
185
+ "justify-content": "justify",
186
+ "z-index": "zindex",
187
+ "pointer-events": "pointer"
188
+ };
189
+ const KEYWORD_VALUE_PROPERTIES = new Set([
190
+ "align-content",
191
+ "align-items",
192
+ "align-self",
193
+ "background-repeat",
194
+ "background-size",
195
+ "border-collapse",
196
+ "border-style",
197
+ "box-sizing",
198
+ "clear",
199
+ "cursor",
200
+ "display",
201
+ "flex-direction",
202
+ "flex-wrap",
203
+ "float",
204
+ "font-weight",
205
+ "font-style",
206
+ "justify-content",
207
+ "justify-items",
208
+ "justify-self",
209
+ "list-style-position",
210
+ "list-style-type",
211
+ "object-fit",
212
+ "object-position",
213
+ "overflow",
214
+ "overflow-x",
215
+ "overflow-y",
216
+ "pointer-events",
217
+ "place-content",
218
+ "place-items",
219
+ "place-self",
220
+ "position",
221
+ "resize",
222
+ "table-layout",
223
+ "text-align",
224
+ "text-decoration-line",
225
+ "text-transform",
226
+ "user-select",
227
+ "vertical-align",
228
+ "visibility",
229
+ "white-space"
230
+ ]);
231
+ const ARBITRARY_VALUE_PROPERTIES = new Set(["font-weight"]);
232
+ //#endregion
233
+ //#region atomic/debug/property/property.ts
234
+ function getDebugPropertyName(property, value) {
235
+ if (!property) return null;
236
+ const normalized = normalizePropertyName(property);
237
+ const name = PROPERTY_ALIASES[normalized] || sanitizeDebugPropertyName(normalized);
238
+ if (!name) return null;
239
+ return {
240
+ property: name,
241
+ ...withKeywordValueFallback(normalized, value, withArbitraryValueFallback(normalized, getDebugValueName(value)))
242
+ };
243
+ }
244
+ function withArbitraryValueFallback(property, valueName) {
245
+ if (!valueName.arbitraryValue || ARBITRARY_VALUE_PROPERTIES.has(property)) return valueName;
246
+ return {
247
+ value: valueName.value,
248
+ arbitraryValue: null
249
+ };
250
+ }
251
+ function withKeywordValueFallback(property, value, valueName) {
252
+ if (valueName.value || valueName.arbitraryValue) return valueName;
253
+ if (!KEYWORD_VALUE_PROPERTIES.has(property)) return valueName;
254
+ const normalized = normalizeDebugKeywordValue(value);
255
+ if (!normalized) return valueName;
256
+ return {
257
+ value: normalized,
258
+ arbitraryValue: null
259
+ };
260
+ }
261
+ //#endregion
262
+ //#region atomic/debug/selector.ts
263
+ function getDebugSelectorName(selector) {
264
+ if (!selector) return null;
265
+ const normalized = selector.trim().toLowerCase();
266
+ if (/^[a-z0-9]+$/.test(normalized)) return null;
267
+ return validateName(normalized.replace(/\$\$/g, "args").replace(/\$/g, "arg").replace(/\.\.\./g, "merge").replace(/:not\(/g, "not-").replace(/:(is|where|has)\(/g, "$1-").replace(/:nth-(child|of-type)\(/g, "nth-").replace(/[.#]/g, "-").replace(/[[\]()]/g, "-").replace(/:+/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9_-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
268
+ }
269
+ function getDebugAtRuleName(selector) {
270
+ if (!selector || Array.isArray(selector) && selector.length === 0) return null;
271
+ return validateName((Array.isArray(selector) ? selector.map(parseAtRule).filter(Boolean).join("-") : parseAtRule(selector)).replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
272
+ }
273
+ function compressQuery(query) {
274
+ return query.trim().toLowerCase().replace(/prefers-color-scheme\s*:\s*dark/g, "dark").replace(/prefers-color-scheme\s*:\s*light/g, "light").replace(/min-width\s*:\s*/g, "min-").replace(/max-width\s*:\s*/g, "max-").replace(/min-height\s*:\s*/g, "minh-").replace(/max-height\s*:\s*/g, "maxh-").replace(/inline-size/g, "inline").replace(/\b(and|or|only|not)\b/g, "").replace(/>=/g, "-gte-").replace(/<=/g, "-lte-").replace(/>/g, "-gt-").replace(/</g, "-lt-").replace(/[():=\s]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
275
+ }
276
+ function validateName(name) {
277
+ if (!name || name === "selector" || name.length < 2) return null;
278
+ return name;
279
+ }
280
+ function parseAtRule(rule) {
281
+ const normalized = rule.trim().toLowerCase();
282
+ if (normalized.startsWith("@media")) return compressQuery(normalized.slice(6));
283
+ if (normalized.startsWith("@container")) return compressQuery(normalized.slice(10));
284
+ if (normalized.startsWith("@supports")) return compressQuery(normalized.slice(9));
285
+ return compressQuery(normalized);
286
+ }
287
+ //#endregion
288
+ //#region atomic/className.ts
289
+ function getAtomicClassName(property, priority, important, value, selector, parentSelector, atRule, callsite, localClassName, debugClassName, classNameFormat, transformClassName, transformClassNameFormat, sheetClassNameFormat = null, hashLength = null) {
290
+ let hash = property;
291
+ hash += "\n" + (priority || "");
292
+ if (important) hash += "\nimportant";
293
+ hash += "\n" + value;
294
+ hash += "\n" + (selector ? getSelectorHash(selector) : "");
295
+ hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
296
+ hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
297
+ hash += "\n" + getCallsiteHash(callsite, localClassName);
298
+ hash = getIdentifierSafeHash(hash, hashLength ?? getRuntimeClassNameHashLength(debugClassName));
299
+ if (!debugClassName) return hash;
300
+ if (transformClassName) return getDebugTransformClassName(transformClassNameFormat, hash, { className: transformClassName });
301
+ const propertyName = getDebugPropertyName(property, value);
302
+ const isSheetClassName = hasSheetSelectorAnchor(selector);
303
+ return (isSheetClassName ? getDebugSheetClassName : getDebugClassName)(isSheetClassName ? sheetClassNameFormat : classNameFormat, hash, {
304
+ atRule: atRule ? getDebugAtRuleName(atRule.map(getSelectorText$1)) : null,
305
+ scopeSelector: parentSelector ? getDebugSelectorName(getSelectorText$1(parentSelector)) : null,
306
+ selector: selector ? getDebugSelectorName(getSelectorText$1(selector)) : null,
307
+ property: propertyName ? propertyName.property : property,
308
+ value: propertyName ? propertyName.value ?? propertyName.arbitraryValue : null
309
+ });
310
+ }
311
+ function getRuntimeClassNameHashLength(debugClassName) {
312
+ if (debugClassName && DEV_CONFIG.isDev) return DEV_CONFIG.hashLength ?? CSS_CONFIG.hashLength ?? 3;
313
+ return CSS_CONFIG.hashLength ?? 7;
314
+ }
315
+ function getClassNameDedupe(property, priority, important, selector, parentSelector, atRule) {
316
+ let hash = property;
317
+ hash += "\n" + (priority || "");
318
+ if (important) hash += "\nimportant";
319
+ hash += "\n" + (selector ? getSelectorHash(selector) : "");
320
+ hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
321
+ hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
322
+ return hashString(hash);
323
+ }
324
+ function getCallsiteHash(callsite, localClassName) {
325
+ if (!localClassName || !callsite) return "";
326
+ return callsite.filePath + "\n" + callsite.line + ":" + callsite.column;
327
+ }
328
+ //#endregion
329
+ //#region builder/data/merge/utils.ts
330
+ function cloneData(data, source, debug, merge = true) {
331
+ const runtimeType = DEV_CONFIG.isDev ? debug ? -2 : -1 : -3;
332
+ const state = data[BUILDER_STATE];
333
+ state.items = merge ? source[BUILDER_STATE].items.slice() : [];
334
+ state.lookup = Object.assign(Object.create(null), merge ? source[BUILDER_STATE].lookup : null);
335
+ const lookup = state.lookup;
336
+ return [
337
+ runtimeType,
338
+ data,
339
+ state.items,
340
+ lookup
341
+ ];
342
+ }
343
+ function logInvalidData(message, data) {
344
+ console.log(traceError(message), "data:", data);
345
+ }
346
+ //#endregion
347
+ //#region builder/data/merge/scope.ts
348
+ function mergeScopeData(scope, callsite, items, debug, parentSelector, scopeAtRule) {
349
+ if (!items) return scope;
350
+ const sourceItems = Array.isArray(items) ? items : [items];
351
+ const [runtimeType, data, styles, lookup] = cloneData(scope, scope, debug);
352
+ let source;
353
+ let item;
354
+ let lookupIndex;
355
+ let weight;
356
+ let important;
357
+ let value;
358
+ let atRule;
359
+ let dedupe;
360
+ let className;
361
+ let itemDebug;
362
+ let itemCallsite;
363
+ for (let i = 0, len = sourceItems.length; i < len; i++) {
364
+ source = sourceItems[i];
365
+ if (!source) continue;
366
+ if (isStyleTokenOverrideData(source)) {
367
+ addTokenOverride(source, styles, lookup);
368
+ continue;
369
+ }
370
+ if (isScopeData(source)) {
371
+ const scopeItems = source[BUILDER_STATE].items;
372
+ for (let j = 0, len = scopeItems.length; j < len; j++) {
373
+ item = scopeItems[j];
374
+ if (isStyleTokenOverrideData(item)) {
375
+ addTokenOverride(item, styles, lookup);
376
+ continue;
377
+ }
378
+ if (Array.isArray(item) || item.type !== 4) {
379
+ logInvalidData("invalid scope data", {
380
+ source,
381
+ item
382
+ });
383
+ continue;
384
+ }
385
+ const sourceScopeItem = item;
386
+ atRule = scopeAtRule ? sourceScopeItem.atRule ? [scopeAtRule].concat(sourceScopeItem.atRule) : [scopeAtRule] : sourceScopeItem.atRule;
387
+ const scopeItem = {
388
+ ...sourceScopeItem,
389
+ runtime: runtimeType,
390
+ atRule,
391
+ parentSelector: parentSelector ?? sourceScopeItem.parentSelector
392
+ };
393
+ itemDebug = getMergedScopeDebug(debug, scopeItem);
394
+ itemCallsite = getDebugFieldCallsite(itemDebug ?? null, scopeItem.property) ?? callsite ?? scopeItem.callsite;
395
+ value = scopeItem.value;
396
+ weight = scopeItem.weight;
397
+ important = scopeItem.important;
398
+ dedupe = getClassNameDedupe(scopeItem.property, weight, important, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule);
399
+ className = getAtomicClassName(scopeItem.property, weight, important, value, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule, itemCallsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, scopeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null, CSS_CONFIG.sheetClassNameFormat ?? null);
400
+ scopeItem.dedupe = dedupe;
401
+ scopeItem.className = className;
402
+ scopeItem.callsite = itemCallsite;
403
+ scopeItem.debug = itemDebug ?? null;
404
+ scopeItem.debugField = itemDebug ? scopeItem.property : null;
405
+ const lookupKey = getScopeLookupKey(scopeItem.slotId, dedupe);
406
+ lookupIndex = lookup[lookupKey];
407
+ if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
408
+ else lookup[lookupKey] = styles.push(scopeItem) - 1;
409
+ }
410
+ continue;
411
+ }
412
+ if (!isSlotOverrideData(source)) {
413
+ logInvalidData("invalid scope data", { source });
414
+ continue;
415
+ }
416
+ const slotId = source[BUILDER_SLOT_ID];
417
+ const overrideItems = source[BUILDER_STATE].items;
418
+ for (let j = 0, len = overrideItems.length; j < len; j++) {
419
+ item = overrideItems[j];
420
+ if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 3) {
421
+ logInvalidData("invalid scope data", {
422
+ source,
423
+ item
424
+ });
425
+ continue;
426
+ }
427
+ const overrideItem = item;
428
+ atRule = scopeAtRule ? overrideItem.atRule ? [scopeAtRule].concat(overrideItem.atRule) : [scopeAtRule] : overrideItem.atRule;
429
+ const scopeItem = {
430
+ type: 4,
431
+ slotId,
432
+ runtime: runtimeType,
433
+ dedupe: "",
434
+ className: "",
435
+ property: overrideItem.property,
436
+ weight: overrideItem.weight,
437
+ important: overrideItem.important,
438
+ value: overrideItem.value,
439
+ transformClassName: overrideItem.transformClassName,
440
+ token: overrideItem.token,
441
+ selector: overrideItem.selector,
442
+ atRule,
443
+ callsite: overrideItem.callsite ?? callsite,
444
+ debug: overrideItem.debug,
445
+ debugField: overrideItem.debugField,
446
+ parentSelector
447
+ };
448
+ value = scopeItem.value;
449
+ weight = scopeItem.weight;
450
+ important = scopeItem.important;
451
+ dedupe = getClassNameDedupe(scopeItem.property, weight, important, scopeItem.selector, parentSelector, scopeItem.atRule);
452
+ className = getAtomicClassName(scopeItem.property, weight, important, value, scopeItem.selector, parentSelector, scopeItem.atRule, scopeItem.callsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, scopeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null, CSS_CONFIG.sheetClassNameFormat ?? null);
453
+ scopeItem.dedupe = dedupe;
454
+ scopeItem.className = className;
455
+ const lookupKey = getScopeLookupKey(slotId, dedupe);
456
+ lookupIndex = lookup[lookupKey];
457
+ if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
458
+ else lookup[lookupKey] = styles.push(scopeItem) - 1;
459
+ }
460
+ }
461
+ return data;
462
+ }
463
+ function addTokenOverride(item, styles, lookup) {
464
+ const lookupKey = getTokenLookupKey(getStyleTokenId(item));
465
+ const lookupIndex = lookup[lookupKey];
466
+ if (typeof lookupIndex === "number") styles[lookupIndex] = item;
467
+ else lookup[lookupKey] = styles.push(item) - 1;
468
+ }
469
+ function getMergedScopeDebug(debug, item) {
470
+ if (!debug) return item.debug;
471
+ if (debug.fields?.[item.property]) return debug;
472
+ const valueLoc = getRuntimeScopeItemValueLoc(item);
473
+ if (!valueLoc) return debug;
474
+ return {
475
+ ...debug,
476
+ fields: {
477
+ ...debug.fields,
478
+ [item.property]: {
479
+ [0]: debug.loc,
480
+ [1]: valueLoc
481
+ }
482
+ }
483
+ };
484
+ }
485
+ function getRuntimeScopeItemValueLoc(item) {
486
+ if (item.debug && item.debugField) {
487
+ const loc = item.debug.fields?.[item.debugField];
488
+ if (Array.isArray(loc)) return withDebugSource$1(loc, item.debug.sourceUrl, item.debug.code);
489
+ if (loc) {
490
+ const valueLoc = loc[1] ?? loc[0] ?? null;
491
+ return valueLoc ? withDebugSource$1(valueLoc, item.debug.sourceUrl, item.debug.code) : null;
492
+ }
493
+ }
494
+ return item.callsite ? [
495
+ item.callsite.line,
496
+ item.callsite.column,
497
+ void 0,
498
+ item.callsite.sourceUrl,
499
+ item.callsite.sourceContent
500
+ ] : null;
501
+ }
502
+ function withDebugSource$1(loc, sourceUrl, sourceContent) {
503
+ return loc[3] ? loc : [
504
+ loc[0],
505
+ loc[1],
506
+ loc[2],
507
+ sourceUrl,
508
+ sourceContent
509
+ ];
510
+ }
511
+ function getScopeLookupKey(slotId, dedupe) {
512
+ return slotId + "\0" + dedupe;
513
+ }
514
+ function getTokenLookupKey(tokenId) {
515
+ return "token\0" + tokenId;
516
+ }
517
+ //#endregion
518
+ //#region style/valueRef.ts
519
+ const AT_RULE_REF = symbol("atRule.ref");
520
+ function createAtRuleRef(data) {
521
+ return {
522
+ [AT_RULE_REF]: true,
523
+ ...data
524
+ };
525
+ }
526
+ function isAtRuleRef(value) {
527
+ return !!value && typeof value === "object" && value[AT_RULE_REF] === true;
528
+ }
529
+ //#endregion
530
+ //#region builder/data/merge/style.ts
531
+ function mergeBuilderData(create, callsite, source, style, debug, selector, atRule, type) {
532
+ if (!style) return source;
533
+ const [runtimeType, data, styles, lookup] = cloneData(create(callsite, source), source, debug);
534
+ const slotId = isSlotData(source) || isSlotOverrideData(source) ? source[BUILDER_SLOT_ID] : null;
535
+ const items = [];
536
+ let item;
537
+ let itemData;
538
+ let valueRaw;
539
+ let value;
540
+ let weight;
541
+ let important;
542
+ let itemCallsite;
543
+ let className;
544
+ let dedupe;
545
+ let token;
546
+ let ref;
547
+ let variableName;
548
+ let transformClassName;
549
+ let lookupIndex;
550
+ if (isStyleData(style)) {
551
+ const stylesItems = style[BUILDER_STATE].items;
552
+ for (let i = 0, len = stylesItems.length; i < len; i++) {
553
+ item = stylesItems[i];
554
+ if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 1) {
555
+ logInvalidData("invalid style data", {
556
+ item,
557
+ style
558
+ });
559
+ continue;
560
+ }
561
+ if (atRule) item = Object.assign({}, item, { atRule: item.atRule ? atRule.concat(item.atRule) : atRule });
562
+ if (selector) item = Object.assign({}, item, { selector: item.selector ? combineSelectors(selector, item.selector) : selector });
563
+ if (type === 2 && slotId !== null) item = Object.assign({}, item, {
564
+ type: 2,
565
+ slotId
566
+ });
567
+ else if (type === 3 && slotId !== null) item = Object.assign({}, item, {
568
+ type: 3,
569
+ slotId
570
+ });
571
+ else if (type === 8) item = Object.assign({}, item, { type: 1 });
572
+ const itemDebug = getMergedStyleDebug(debug, item);
573
+ const debugCallsite = getDebugFieldCallsite(itemDebug, item.property);
574
+ if (debugCallsite) item = Object.assign({}, item, {
575
+ callsite: debugCallsite,
576
+ debug: itemDebug,
577
+ debugField: item.property
578
+ });
579
+ items.push(item);
580
+ }
581
+ } else for (const property in style) {
582
+ valueRaw = style[property];
583
+ [valueRaw, weight, important] = unwrapAuthoredStyleValue(valueRaw);
584
+ transformClassName = null;
585
+ if (isClassNameValue(valueRaw)) {
586
+ transformClassName = valueRaw.className;
587
+ valueRaw = valueRaw.value;
588
+ }
589
+ ref = isAtRuleRef(valueRaw) ? valueRaw : null;
590
+ if (ref) valueRaw = ref.value;
591
+ token = isStyleTokenData(valueRaw) ? valueRaw : null;
592
+ variableName = getDebugFieldVarName(debug, property);
593
+ value = variableName && token ? getCssVarRawFallback(variableName, getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null)) : token ? getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null) : String(valueRaw ?? "");
594
+ itemCallsite = getDebugFieldCallsite(debug, property) ?? callsite;
595
+ itemData = {
596
+ runtime: runtimeType,
597
+ debug,
598
+ debugField: property,
599
+ dedupe: "",
600
+ className: "",
601
+ property,
602
+ weight,
603
+ important,
604
+ value,
605
+ transformClassName,
606
+ variable: ref ? [3, ref] : variableName && token ? [
607
+ 1,
608
+ variableName,
609
+ valueRaw,
610
+ shouldAppendCssPx(property) ? 1 : void 0
611
+ ] : ref ? [3, ref] : void 0,
612
+ token,
613
+ selector,
614
+ atRule,
615
+ callsite: itemCallsite
616
+ };
617
+ if (type === 1 || type === 8) {
618
+ items.push({
619
+ ...itemData,
620
+ type: 1
621
+ });
622
+ continue;
623
+ }
624
+ if (slotId === null) {
625
+ logInvalidData("invalid style data", {
626
+ property,
627
+ style
628
+ });
629
+ continue;
630
+ }
631
+ if (type === 2) {
632
+ items.push({
633
+ ...itemData,
634
+ type: 2,
635
+ slotId
636
+ });
637
+ continue;
638
+ }
639
+ if (type === 3) {
640
+ items.push({
641
+ ...itemData,
642
+ type: 3,
643
+ slotId
644
+ });
645
+ continue;
646
+ }
647
+ logInvalidData("invalid style data", {
648
+ property,
649
+ style
650
+ });
651
+ }
652
+ if (!items.length) return data;
653
+ for (let i = 0, len = items.length; i < len; i++) {
654
+ item = items[i];
655
+ if (Array.isArray(item) || isStyleTokenOverrideData(item)) {
656
+ logInvalidData("invalid style data", {
657
+ item,
658
+ style
659
+ });
660
+ continue;
661
+ }
662
+ const runtimeItem = item;
663
+ value = runtimeItem.value;
664
+ weight = runtimeItem.weight;
665
+ important = runtimeItem.important;
666
+ dedupe = getClassNameDedupe(runtimeItem.property, weight, important, runtimeItem.selector, null, runtimeItem.atRule);
667
+ className = getAtomicClassName(runtimeItem.property, weight, important, value, runtimeItem.selector, null, runtimeItem.atRule, runtimeItem.callsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, runtimeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null, CSS_CONFIG.sheetClassNameFormat ?? null);
668
+ runtimeItem.dedupe = dedupe;
669
+ runtimeItem.className = className;
670
+ lookupIndex = lookup[dedupe];
671
+ if (typeof lookupIndex === "number") styles[lookupIndex] = runtimeItem;
672
+ else lookup[dedupe] = styles.push(runtimeItem) - 1;
673
+ }
674
+ return data;
675
+ }
676
+ function unwrapAuthoredStyleValue(value) {
677
+ let weight = null;
678
+ let important = false;
679
+ while (true) {
680
+ if (isStyleImportantValue(value)) {
681
+ important = true;
682
+ value = value.value;
683
+ continue;
684
+ }
685
+ if (isStyleWeightValue(value)) {
686
+ weight = value.weight;
687
+ value = value.value;
688
+ continue;
689
+ }
690
+ break;
691
+ }
692
+ return [
693
+ value,
694
+ weight,
695
+ important
696
+ ];
697
+ }
698
+ function combineSelectors(parent, child) {
699
+ const parentText = getSelectorText(parent);
700
+ const childText = getSelectorText(child);
701
+ const priority = Math.max(getSelectorPriority(parent), getSelectorPriority(child));
702
+ const selector = parentText + childText;
703
+ return priority > 0 ? [selector, priority] : selector;
704
+ }
705
+ function getSelectorText(selector) {
706
+ return Array.isArray(selector) ? selector[0] : selector;
707
+ }
708
+ function getSelectorPriority(selector) {
709
+ return Array.isArray(selector) ? selector[1] : 0;
710
+ }
711
+ function getMergedStyleDebug(debug, item) {
712
+ if (!debug) return null;
713
+ if (debug.fields?.[item.property]) return debug;
714
+ const valueLoc = getMergedItemValueLoc(item);
715
+ if (!valueLoc) return debug;
716
+ return {
717
+ ...debug,
718
+ fields: {
719
+ ...debug.fields,
720
+ [item.property]: {
721
+ [0]: withDebugSource(debug.loc, debug),
722
+ [1]: valueLoc
723
+ }
724
+ }
725
+ };
726
+ }
727
+ function getMergedItemValueLoc(item) {
728
+ if (item.debug && item.debugField) {
729
+ const loc = item.debug.fields?.[item.debugField];
730
+ if (Array.isArray(loc)) return withDebugSource(loc, item.debug);
731
+ if (loc) {
732
+ const traceLoc = loc[1] ?? loc[0] ?? null;
733
+ return traceLoc ? withDebugSource(traceLoc, item.debug) : null;
734
+ }
735
+ }
736
+ return item.callsite ? [
737
+ item.callsite.line,
738
+ item.callsite.column,
739
+ void 0,
740
+ item.callsite.sourceUrl,
741
+ item.callsite.sourceContent
742
+ ] : null;
743
+ }
744
+ function withDebugSource(loc, debug) {
745
+ return loc[3] ? loc : [
746
+ loc[0],
747
+ loc[1],
748
+ loc[2],
749
+ debug.sourceUrl,
750
+ debug.code
751
+ ];
752
+ }
753
+ //#endregion
754
+ //#region builder/data/selector.ts
755
+ const SELECTOR_MEDIA = "@media";
756
+ const SELECTOR_CONTAINER = "@container";
757
+ function normalizeSelectorArg(arg) {
758
+ return arg.includes("\n") ? arg.replace(/\n/g, "") : arg;
759
+ }
760
+ //#endregion
761
+ export { createThemeData as _, AT_RULE_REF as a, importantValue as b, mergeScopeData as c, createSelectorData as d, createSelectorOverrideData as f, createStyleData as g, createSlotOverrideData as h, mergeBuilderData as i, createScopeData as l, createSlotData as m, SELECTOR_MEDIA as n, createAtRuleRef as o, createSheetData as p, normalizeSelectorArg as r, isAtRuleRef as s, SELECTOR_CONTAINER as t, createScopeTargetData as u, isStyleWeightValue as v, isStyleImportantValue as x, weightValue as y };
762
+
763
+ //# sourceMappingURL=data-CzHJg147.js.map