@tamagui/style-grammar 0.0.0-bootstrap.0 → 3.0.0-beta.643.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -1
  3. package/dist/cjs/backgroundFamily.cjs +176 -0
  4. package/dist/cjs/backgroundFamily.native.cjs +195 -0
  5. package/dist/cjs/backgroundFamily.native.js +197 -0
  6. package/dist/cjs/backgroundFamily.native.js.map +1 -0
  7. package/dist/cjs/borderFamily.cjs +169 -0
  8. package/dist/cjs/borderFamily.native.cjs +247 -0
  9. package/dist/cjs/borderFamily.native.js +249 -0
  10. package/dist/cjs/borderFamily.native.js.map +1 -0
  11. package/dist/cjs/candidate.cjs +608 -0
  12. package/dist/cjs/candidate.native.cjs +821 -0
  13. package/dist/cjs/candidate.native.js +823 -0
  14. package/dist/cjs/candidate.native.js.map +1 -0
  15. package/dist/cjs/candidateTarget.cjs +50 -0
  16. package/dist/cjs/candidateTarget.native.cjs +88 -0
  17. package/dist/cjs/candidateTarget.native.js +90 -0
  18. package/dist/cjs/candidateTarget.native.js.map +1 -0
  19. package/dist/cjs/clauseCapability.cjs +130 -0
  20. package/dist/cjs/clauseCapability.native.cjs +152 -0
  21. package/dist/cjs/clauseCapability.native.js +154 -0
  22. package/dist/cjs/clauseCapability.native.js.map +1 -0
  23. package/dist/cjs/clausePrecedence.cjs +153 -0
  24. package/dist/cjs/clausePrecedence.native.cjs +204 -0
  25. package/dist/cjs/clausePrecedence.native.js +206 -0
  26. package/dist/cjs/clausePrecedence.native.js.map +1 -0
  27. package/dist/cjs/clauseSources.cjs +47 -0
  28. package/dist/cjs/clauseSources.native.cjs +49 -0
  29. package/dist/cjs/clauseSources.native.js +51 -0
  30. package/dist/cjs/clauseSources.native.js.map +1 -0
  31. package/dist/cjs/config.cjs +130 -0
  32. package/dist/cjs/config.native.cjs +185 -0
  33. package/dist/cjs/config.native.js +187 -0
  34. package/dist/cjs/config.native.js.map +1 -0
  35. package/dist/cjs/evaluateProgram.cjs +65 -0
  36. package/dist/cjs/evaluateProgram.native.cjs +70 -0
  37. package/dist/cjs/evaluateProgram.native.js +72 -0
  38. package/dist/cjs/evaluateProgram.native.js.map +1 -0
  39. package/dist/cjs/fontShorthand.cjs +207 -0
  40. package/dist/cjs/fontShorthand.native.cjs +260 -0
  41. package/dist/cjs/fontShorthand.native.js +262 -0
  42. package/dist/cjs/fontShorthand.native.js.map +1 -0
  43. package/dist/cjs/geometricShorthand.cjs +122 -0
  44. package/dist/cjs/geometricShorthand.native.cjs +128 -0
  45. package/dist/cjs/geometricShorthand.native.js +130 -0
  46. package/dist/cjs/geometricShorthand.native.js.map +1 -0
  47. package/dist/cjs/index.cjs +19 -0
  48. package/dist/cjs/index.native.cjs +21 -0
  49. package/dist/cjs/index.native.js +23 -0
  50. package/dist/cjs/index.native.js.map +1 -0
  51. package/dist/cjs/lowerProgram.cjs +205 -0
  52. package/dist/cjs/lowerProgram.native.cjs +257 -0
  53. package/dist/cjs/lowerProgram.native.js +259 -0
  54. package/dist/cjs/lowerProgram.native.js.map +1 -0
  55. package/dist/cjs/mergeFlatValues.cjs +50 -0
  56. package/dist/cjs/mergeFlatValues.native.cjs +71 -0
  57. package/dist/cjs/mergeFlatValues.native.js +73 -0
  58. package/dist/cjs/mergeFlatValues.native.js.map +1 -0
  59. package/dist/cjs/modifierRegistry.cjs +246 -0
  60. package/dist/cjs/modifierRegistry.native.cjs +426 -0
  61. package/dist/cjs/modifierRegistry.native.js +428 -0
  62. package/dist/cjs/modifierRegistry.native.js.map +1 -0
  63. package/dist/cjs/payloadShape.cjs +69 -0
  64. package/dist/cjs/payloadShape.native.cjs +71 -0
  65. package/dist/cjs/payloadShape.native.js +73 -0
  66. package/dist/cjs/payloadShape.native.js.map +1 -0
  67. package/dist/cjs/programEligibility.cjs +46 -0
  68. package/dist/cjs/programEligibility.native.cjs +48 -0
  69. package/dist/cjs/programEligibility.native.js +50 -0
  70. package/dist/cjs/programEligibility.native.js.map +1 -0
  71. package/dist/cjs/programHash.cjs +86 -0
  72. package/dist/cjs/programHash.native.cjs +106 -0
  73. package/dist/cjs/programHash.native.js +108 -0
  74. package/dist/cjs/programHash.native.js.map +1 -0
  75. package/dist/cjs/programs.cjs +128 -0
  76. package/dist/cjs/programs.native.cjs +220 -0
  77. package/dist/cjs/programs.native.js +222 -0
  78. package/dist/cjs/programs.native.js.map +1 -0
  79. package/dist/cjs/registry.cjs +629 -0
  80. package/dist/cjs/registry.native.cjs +635 -0
  81. package/dist/cjs/registry.native.js +637 -0
  82. package/dist/cjs/registry.native.js.map +1 -0
  83. package/dist/cjs/resolvePayload.cjs +296 -0
  84. package/dist/cjs/resolvePayload.native.cjs +302 -0
  85. package/dist/cjs/resolvePayload.native.js +304 -0
  86. package/dist/cjs/resolvePayload.native.js.map +1 -0
  87. package/dist/cjs/runtime.cjs +50 -0
  88. package/dist/cjs/runtime.native.cjs +52 -0
  89. package/dist/cjs/runtime.native.js +54 -0
  90. package/dist/cjs/runtime.native.js.map +1 -0
  91. package/dist/cjs/safeAreaVariables.cjs +42 -0
  92. package/dist/cjs/safeAreaVariables.native.cjs +44 -0
  93. package/dist/cjs/safeAreaVariables.native.js +46 -0
  94. package/dist/cjs/safeAreaVariables.native.js.map +1 -0
  95. package/dist/cjs/scanFlatValue.cjs +181 -0
  96. package/dist/cjs/scanFlatValue.native.cjs +183 -0
  97. package/dist/cjs/scanFlatValue.native.js +185 -0
  98. package/dist/cjs/scanFlatValue.native.js.map +1 -0
  99. package/dist/cjs/serializePayload.cjs +149 -0
  100. package/dist/cjs/serializePayload.native.cjs +187 -0
  101. package/dist/cjs/serializePayload.native.js +189 -0
  102. package/dist/cjs/serializePayload.native.js.map +1 -0
  103. package/dist/cjs/stateModifiers.cjs +43 -0
  104. package/dist/cjs/stateModifiers.native.cjs +45 -0
  105. package/dist/cjs/stateModifiers.native.js +47 -0
  106. package/dist/cjs/stateModifiers.native.js.map +1 -0
  107. package/dist/cjs/states.cjs +97 -0
  108. package/dist/cjs/states.native.cjs +131 -0
  109. package/dist/cjs/states.native.js +133 -0
  110. package/dist/cjs/states.native.js.map +1 -0
  111. package/dist/cjs/table.cjs +54 -0
  112. package/dist/cjs/table.native.cjs +135 -0
  113. package/dist/cjs/table.native.js +137 -0
  114. package/dist/cjs/table.native.js.map +1 -0
  115. package/dist/cjs/textDecorationFamily.cjs +129 -0
  116. package/dist/cjs/textDecorationFamily.native.cjs +199 -0
  117. package/dist/cjs/textDecorationFamily.native.js +201 -0
  118. package/dist/cjs/textDecorationFamily.native.js.map +1 -0
  119. package/dist/cjs/tooling.cjs +26 -0
  120. package/dist/cjs/tooling.native.cjs +28 -0
  121. package/dist/cjs/tooling.native.js +30 -0
  122. package/dist/cjs/tooling.native.js.map +1 -0
  123. package/dist/cjs/toolingAnnotations.cjs +105 -0
  124. package/dist/cjs/toolingAnnotations.native.cjs +133 -0
  125. package/dist/cjs/toolingAnnotations.native.js +135 -0
  126. package/dist/cjs/toolingAnnotations.native.js.map +1 -0
  127. package/dist/cjs/toolingDiagnostics.cjs +459 -0
  128. package/dist/cjs/toolingDiagnostics.native.cjs +788 -0
  129. package/dist/cjs/toolingDiagnostics.native.js +790 -0
  130. package/dist/cjs/toolingDiagnostics.native.js.map +1 -0
  131. package/dist/cjs/toolingRegistry.cjs +159 -0
  132. package/dist/cjs/toolingRegistry.native.cjs +164 -0
  133. package/dist/cjs/toolingRegistry.native.js +166 -0
  134. package/dist/cjs/toolingRegistry.native.js.map +1 -0
  135. package/dist/cjs/transformFamily.cjs +425 -0
  136. package/dist/cjs/transformFamily.native.cjs +517 -0
  137. package/dist/cjs/transformFamily.native.js +519 -0
  138. package/dist/cjs/transformFamily.native.js.map +1 -0
  139. package/dist/cjs/transition.cjs +459 -0
  140. package/dist/cjs/transition.native.cjs +499 -0
  141. package/dist/cjs/transition.native.js +501 -0
  142. package/dist/cjs/transition.native.js.map +1 -0
  143. package/dist/cjs/transitionAlign.cjs +115 -0
  144. package/dist/cjs/transitionAlign.native.cjs +154 -0
  145. package/dist/cjs/transitionAlign.native.js +156 -0
  146. package/dist/cjs/transitionAlign.native.js.map +1 -0
  147. package/dist/cjs/transitionLegacy.cjs +217 -0
  148. package/dist/cjs/transitionLegacy.native.cjs +260 -0
  149. package/dist/cjs/transitionLegacy.native.js +262 -0
  150. package/dist/cjs/transitionLegacy.native.js.map +1 -0
  151. package/dist/cjs/transitionNative.cjs +281 -0
  152. package/dist/cjs/transitionNative.native.cjs +285 -0
  153. package/dist/cjs/transitionNative.native.js +287 -0
  154. package/dist/cjs/transitionNative.native.js.map +1 -0
  155. package/dist/cjs/unitlessNumbers.cjs +86 -0
  156. package/dist/cjs/unitlessNumbers.native.cjs +106 -0
  157. package/dist/cjs/unitlessNumbers.native.js +108 -0
  158. package/dist/cjs/unitlessNumbers.native.js.map +1 -0
  159. package/dist/cjs/v6ThemeNames.cjs +47 -0
  160. package/dist/cjs/v6ThemeNames.native.cjs +53 -0
  161. package/dist/cjs/v6ThemeNames.native.js +55 -0
  162. package/dist/cjs/v6ThemeNames.native.js.map +1 -0
  163. package/dist/cjs/valueParser.cjs +148 -0
  164. package/dist/cjs/valueParser.native.cjs +150 -0
  165. package/dist/cjs/valueParser.native.js +152 -0
  166. package/dist/cjs/valueParser.native.js.map +1 -0
  167. package/dist/cjs/valueTypes.cjs +38 -0
  168. package/dist/cjs/valueTypes.native.cjs +40 -0
  169. package/dist/cjs/valueTypes.native.js +42 -0
  170. package/dist/cjs/valueTypes.native.js.map +1 -0
  171. package/dist/esm/backgroundFamily.mjs +150 -0
  172. package/dist/esm/backgroundFamily.mjs.map +1 -0
  173. package/dist/esm/backgroundFamily.native.js +167 -0
  174. package/dist/esm/backgroundFamily.native.js.map +1 -0
  175. package/dist/esm/borderFamily.mjs +146 -0
  176. package/dist/esm/borderFamily.mjs.map +1 -0
  177. package/dist/esm/borderFamily.native.js +222 -0
  178. package/dist/esm/borderFamily.native.js.map +1 -0
  179. package/dist/esm/candidate.mjs +581 -0
  180. package/dist/esm/candidate.mjs.map +1 -0
  181. package/dist/esm/candidate.native.js +792 -0
  182. package/dist/esm/candidate.native.js.map +1 -0
  183. package/dist/esm/candidateTarget.mjs +29 -0
  184. package/dist/esm/candidateTarget.mjs.map +1 -0
  185. package/dist/esm/candidateTarget.native.js +65 -0
  186. package/dist/esm/candidateTarget.native.js.map +1 -0
  187. package/dist/esm/clauseCapability.mjs +107 -0
  188. package/dist/esm/clauseCapability.mjs.map +1 -0
  189. package/dist/esm/clauseCapability.native.js +127 -0
  190. package/dist/esm/clauseCapability.native.js.map +1 -0
  191. package/dist/esm/clausePrecedence.mjs +121 -0
  192. package/dist/esm/clausePrecedence.mjs.map +1 -0
  193. package/dist/esm/clausePrecedence.native.js +170 -0
  194. package/dist/esm/clausePrecedence.native.js.map +1 -0
  195. package/dist/esm/clauseSources.mjs +23 -0
  196. package/dist/esm/clauseSources.mjs.map +1 -0
  197. package/dist/esm/clauseSources.native.js +23 -0
  198. package/dist/esm/clauseSources.native.js.map +1 -0
  199. package/dist/esm/config.mjs +103 -0
  200. package/dist/esm/config.mjs.map +1 -0
  201. package/dist/esm/config.native.js +156 -0
  202. package/dist/esm/config.native.js.map +1 -0
  203. package/dist/esm/evaluateProgram.mjs +45 -0
  204. package/dist/esm/evaluateProgram.mjs.map +1 -0
  205. package/dist/esm/evaluateProgram.native.js +48 -0
  206. package/dist/esm/evaluateProgram.native.js.map +1 -0
  207. package/dist/esm/fontShorthand.mjs +184 -0
  208. package/dist/esm/fontShorthand.mjs.map +1 -0
  209. package/dist/esm/fontShorthand.native.js +235 -0
  210. package/dist/esm/fontShorthand.native.js.map +1 -0
  211. package/dist/esm/geometricShorthand.mjs +102 -0
  212. package/dist/esm/geometricShorthand.mjs.map +1 -0
  213. package/dist/esm/geometricShorthand.native.js +106 -0
  214. package/dist/esm/geometricShorthand.native.js.map +1 -0
  215. package/dist/esm/index.mjs +1 -0
  216. package/dist/esm/index.native.js +1 -0
  217. package/dist/esm/lowerProgram.mjs +182 -0
  218. package/dist/esm/lowerProgram.mjs.map +1 -0
  219. package/dist/esm/lowerProgram.native.js +232 -0
  220. package/dist/esm/lowerProgram.native.js.map +1 -0
  221. package/dist/esm/mergeFlatValues.mjs +27 -0
  222. package/dist/esm/mergeFlatValues.mjs.map +1 -0
  223. package/dist/esm/mergeFlatValues.native.js +46 -0
  224. package/dist/esm/mergeFlatValues.native.js.map +1 -0
  225. package/dist/esm/modifierRegistry.mjs +219 -0
  226. package/dist/esm/modifierRegistry.mjs.map +1 -0
  227. package/dist/esm/modifierRegistry.native.js +397 -0
  228. package/dist/esm/modifierRegistry.native.js.map +1 -0
  229. package/dist/esm/payloadShape.mjs +49 -0
  230. package/dist/esm/payloadShape.mjs.map +1 -0
  231. package/dist/esm/payloadShape.native.js +49 -0
  232. package/dist/esm/payloadShape.native.js.map +1 -0
  233. package/dist/esm/programEligibility.mjs +22 -0
  234. package/dist/esm/programEligibility.mjs.map +1 -0
  235. package/dist/esm/programEligibility.native.js +22 -0
  236. package/dist/esm/programEligibility.native.js.map +1 -0
  237. package/dist/esm/programHash.mjs +62 -0
  238. package/dist/esm/programHash.mjs.map +1 -0
  239. package/dist/esm/programHash.native.js +80 -0
  240. package/dist/esm/programHash.native.js.map +1 -0
  241. package/dist/esm/programs.mjs +103 -0
  242. package/dist/esm/programs.mjs.map +1 -0
  243. package/dist/esm/programs.native.js +193 -0
  244. package/dist/esm/programs.native.js.map +1 -0
  245. package/dist/esm/registry.mjs +595 -0
  246. package/dist/esm/registry.mjs.map +1 -0
  247. package/dist/esm/registry.native.js +599 -0
  248. package/dist/esm/registry.native.js.map +1 -0
  249. package/dist/esm/resolvePayload.mjs +273 -0
  250. package/dist/esm/resolvePayload.mjs.map +1 -0
  251. package/dist/esm/resolvePayload.native.js +277 -0
  252. package/dist/esm/resolvePayload.native.js.map +1 -0
  253. package/dist/esm/runtime.mjs +63 -0
  254. package/dist/esm/runtime.native.js +63 -0
  255. package/dist/esm/safeAreaVariables.mjs +18 -0
  256. package/dist/esm/safeAreaVariables.mjs.map +1 -0
  257. package/dist/esm/safeAreaVariables.native.js +18 -0
  258. package/dist/esm/safeAreaVariables.native.js.map +1 -0
  259. package/dist/esm/scanFlatValue.mjs +160 -0
  260. package/dist/esm/scanFlatValue.mjs.map +1 -0
  261. package/dist/esm/scanFlatValue.native.js +160 -0
  262. package/dist/esm/scanFlatValue.native.js.map +1 -0
  263. package/dist/esm/serializePayload.mjs +125 -0
  264. package/dist/esm/serializePayload.mjs.map +1 -0
  265. package/dist/esm/serializePayload.native.js +161 -0
  266. package/dist/esm/serializePayload.native.js.map +1 -0
  267. package/dist/esm/stateModifiers.mjs +19 -0
  268. package/dist/esm/stateModifiers.mjs.map +1 -0
  269. package/dist/esm/stateModifiers.native.js +19 -0
  270. package/dist/esm/stateModifiers.native.js.map +1 -0
  271. package/dist/esm/states.mjs +69 -0
  272. package/dist/esm/states.mjs.map +1 -0
  273. package/dist/esm/states.native.js +101 -0
  274. package/dist/esm/states.native.js.map +1 -0
  275. package/dist/esm/table.mjs +31 -0
  276. package/dist/esm/table.mjs.map +1 -0
  277. package/dist/esm/table.native.js +110 -0
  278. package/dist/esm/table.native.js.map +1 -0
  279. package/dist/esm/textDecorationFamily.mjs +106 -0
  280. package/dist/esm/textDecorationFamily.mjs.map +1 -0
  281. package/dist/esm/textDecorationFamily.native.js +174 -0
  282. package/dist/esm/textDecorationFamily.native.js.map +1 -0
  283. package/dist/esm/tooling.mjs +15 -0
  284. package/dist/esm/tooling.native.js +15 -0
  285. package/dist/esm/toolingAnnotations.mjs +85 -0
  286. package/dist/esm/toolingAnnotations.mjs.map +1 -0
  287. package/dist/esm/toolingAnnotations.native.js +111 -0
  288. package/dist/esm/toolingAnnotations.native.js.map +1 -0
  289. package/dist/esm/toolingDiagnostics.mjs +428 -0
  290. package/dist/esm/toolingDiagnostics.mjs.map +1 -0
  291. package/dist/esm/toolingDiagnostics.native.js +755 -0
  292. package/dist/esm/toolingDiagnostics.native.js.map +1 -0
  293. package/dist/esm/toolingRegistry.mjs +135 -0
  294. package/dist/esm/toolingRegistry.mjs.map +1 -0
  295. package/dist/esm/toolingRegistry.native.js +138 -0
  296. package/dist/esm/toolingRegistry.native.js.map +1 -0
  297. package/dist/esm/transformFamily.mjs +392 -0
  298. package/dist/esm/transformFamily.mjs.map +1 -0
  299. package/dist/esm/transformFamily.native.js +482 -0
  300. package/dist/esm/transformFamily.native.js.map +1 -0
  301. package/dist/esm/transition.mjs +434 -0
  302. package/dist/esm/transition.mjs.map +1 -0
  303. package/dist/esm/transition.native.js +472 -0
  304. package/dist/esm/transition.native.js.map +1 -0
  305. package/dist/esm/transitionAlign.mjs +95 -0
  306. package/dist/esm/transitionAlign.mjs.map +1 -0
  307. package/dist/esm/transitionAlign.native.js +132 -0
  308. package/dist/esm/transitionAlign.native.js.map +1 -0
  309. package/dist/esm/transitionLegacy.mjs +197 -0
  310. package/dist/esm/transitionLegacy.mjs.map +1 -0
  311. package/dist/esm/transitionLegacy.native.js +238 -0
  312. package/dist/esm/transitionLegacy.native.js.map +1 -0
  313. package/dist/esm/transitionNative.mjs +257 -0
  314. package/dist/esm/transitionNative.mjs.map +1 -0
  315. package/dist/esm/transitionNative.native.js +259 -0
  316. package/dist/esm/transitionNative.native.js.map +1 -0
  317. package/dist/esm/unitlessNumbers.mjs +65 -0
  318. package/dist/esm/unitlessNumbers.mjs.map +1 -0
  319. package/dist/esm/unitlessNumbers.native.js +83 -0
  320. package/dist/esm/unitlessNumbers.native.js.map +1 -0
  321. package/dist/esm/v6ThemeNames.mjs +23 -0
  322. package/dist/esm/v6ThemeNames.mjs.map +1 -0
  323. package/dist/esm/v6ThemeNames.native.js +27 -0
  324. package/dist/esm/v6ThemeNames.native.js.map +1 -0
  325. package/dist/esm/valueParser.mjs +125 -0
  326. package/dist/esm/valueParser.mjs.map +1 -0
  327. package/dist/esm/valueParser.native.js +125 -0
  328. package/dist/esm/valueParser.native.js.map +1 -0
  329. package/dist/esm/valueTypes.mjs +14 -0
  330. package/dist/esm/valueTypes.mjs.map +1 -0
  331. package/dist/esm/valueTypes.native.js +14 -0
  332. package/dist/esm/valueTypes.native.js.map +1 -0
  333. package/package.json +98 -4
  334. package/src/backgroundFamily.ts +182 -0
  335. package/src/borderFamily.ts +172 -0
  336. package/src/candidate.ts +691 -0
  337. package/src/candidateTarget.ts +67 -0
  338. package/src/clauseCapability.ts +209 -0
  339. package/src/clausePrecedence.ts +198 -0
  340. package/src/clauseSources.ts +29 -0
  341. package/src/config.ts +169 -0
  342. package/src/evaluateProgram.ts +91 -0
  343. package/src/fontShorthand.ts +177 -0
  344. package/src/geometricShorthand.ts +105 -0
  345. package/src/index.ts +1 -0
  346. package/src/lowerProgram.ts +398 -0
  347. package/src/modifierRegistry.ts +340 -0
  348. package/src/payloadShape.ts +92 -0
  349. package/src/programEligibility.ts +46 -0
  350. package/src/programHash.ts +128 -0
  351. package/src/programs.ts +95 -0
  352. package/src/registry.ts +367 -0
  353. package/src/resolvePayload.ts +480 -0
  354. package/src/runtime.ts +32 -0
  355. package/src/safeAreaVariables.ts +19 -0
  356. package/src/scanFlatValue.ts +327 -0
  357. package/src/serializePayload.ts +199 -0
  358. package/src/stateModifiers.ts +36 -0
  359. package/src/states.ts +128 -0
  360. package/src/table.ts +47 -0
  361. package/src/textDecorationFamily.ts +119 -0
  362. package/src/tooling.ts +8 -0
  363. package/src/toolingAnnotations.ts +151 -0
  364. package/src/toolingDiagnostics.ts +735 -0
  365. package/src/toolingRegistry.ts +130 -0
  366. package/src/transformFamily.ts +590 -0
  367. package/src/transition.ts +553 -0
  368. package/src/transitionAlign.ts +165 -0
  369. package/src/transitionLegacy.ts +237 -0
  370. package/src/transitionNative.ts +357 -0
  371. package/src/unitlessNumbers.ts +61 -0
  372. package/src/v6ThemeNames.ts +40 -0
  373. package/src/valueParser.ts +193 -0
  374. package/src/valueTypes.ts +136 -0
  375. package/types/backgroundFamily.d.ts +17 -0
  376. package/types/backgroundFamily.d.ts.map +11 -0
  377. package/types/borderFamily.d.ts +23 -0
  378. package/types/borderFamily.d.ts.map +11 -0
  379. package/types/candidate.d.ts +52 -0
  380. package/types/candidate.d.ts.map +11 -0
  381. package/types/candidateTarget.d.ts +32 -0
  382. package/types/candidateTarget.d.ts.map +11 -0
  383. package/types/clauseCapability.d.ts +69 -0
  384. package/types/clauseCapability.d.ts.map +11 -0
  385. package/types/clausePrecedence.d.ts +30 -0
  386. package/types/clausePrecedence.d.ts.map +11 -0
  387. package/types/clauseSources.d.ts +12 -0
  388. package/types/clauseSources.d.ts.map +11 -0
  389. package/types/config.d.ts +44 -0
  390. package/types/config.d.ts.map +11 -0
  391. package/types/evaluateProgram.d.ts +27 -0
  392. package/types/evaluateProgram.d.ts.map +11 -0
  393. package/types/fontShorthand.d.ts +25 -0
  394. package/types/fontShorthand.d.ts.map +11 -0
  395. package/types/geometricShorthand.d.ts +21 -0
  396. package/types/geometricShorthand.d.ts.map +11 -0
  397. package/types/index.d.ts +3 -0
  398. package/types/index.d.ts.map +11 -0
  399. package/types/lowerProgram.d.ts +73 -0
  400. package/types/lowerProgram.d.ts.map +11 -0
  401. package/types/mergeFlatValues.d.ts +14 -0
  402. package/types/mergeFlatValues.d.ts.map +11 -0
  403. package/types/modifierRegistry.d.ts +70 -0
  404. package/types/modifierRegistry.d.ts.map +11 -0
  405. package/types/payloadShape.d.ts +15 -0
  406. package/types/payloadShape.d.ts.map +11 -0
  407. package/types/programEligibility.d.ts +23 -0
  408. package/types/programEligibility.d.ts.map +11 -0
  409. package/types/programHash.d.ts +20 -0
  410. package/types/programHash.d.ts.map +11 -0
  411. package/types/programs.d.ts +18 -0
  412. package/types/programs.d.ts.map +11 -0
  413. package/types/registry.d.ts +24 -0
  414. package/types/registry.d.ts.map +11 -0
  415. package/types/resolvePayload.d.ts +75 -0
  416. package/types/resolvePayload.d.ts.map +11 -0
  417. package/types/runtime.d.ts +34 -0
  418. package/types/runtime.d.ts.map +11 -0
  419. package/types/safeAreaVariables.d.ts +5 -0
  420. package/types/safeAreaVariables.d.ts.map +11 -0
  421. package/types/scanFlatValue.d.ts +29 -0
  422. package/types/scanFlatValue.d.ts.map +11 -0
  423. package/types/serializePayload.d.ts +13 -0
  424. package/types/serializePayload.d.ts.map +11 -0
  425. package/types/stateModifiers.d.ts +14 -0
  426. package/types/stateModifiers.d.ts.map +11 -0
  427. package/types/states.d.ts +22 -0
  428. package/types/states.d.ts.map +11 -0
  429. package/types/table.d.ts +4 -0
  430. package/types/table.d.ts.map +11 -0
  431. package/types/textDecorationFamily.d.ts +23 -0
  432. package/types/textDecorationFamily.d.ts.map +11 -0
  433. package/types/tooling.d.ts +10 -0
  434. package/types/tooling.d.ts.map +11 -0
  435. package/types/toolingAnnotations.d.ts +29 -0
  436. package/types/toolingAnnotations.d.ts.map +11 -0
  437. package/types/toolingDiagnostics.d.ts +114 -0
  438. package/types/toolingDiagnostics.d.ts.map +11 -0
  439. package/types/toolingRegistry.d.ts +10 -0
  440. package/types/toolingRegistry.d.ts.map +11 -0
  441. package/types/transformFamily.d.ts +83 -0
  442. package/types/transformFamily.d.ts.map +11 -0
  443. package/types/transition.d.ts +65 -0
  444. package/types/transition.d.ts.map +11 -0
  445. package/types/transitionAlign.d.ts +15 -0
  446. package/types/transitionAlign.d.ts.map +11 -0
  447. package/types/transitionLegacy.d.ts +9 -0
  448. package/types/transitionLegacy.d.ts.map +11 -0
  449. package/types/transitionNative.d.ts +41 -0
  450. package/types/transitionNative.d.ts.map +11 -0
  451. package/types/unitlessNumbers.d.ts +3 -0
  452. package/types/unitlessNumbers.d.ts.map +11 -0
  453. package/types/v6ThemeNames.d.ts +7 -0
  454. package/types/v6ThemeNames.d.ts.map +11 -0
  455. package/types/valueParser.d.ts +36 -0
  456. package/types/valueParser.d.ts.map +11 -0
  457. package/types/valueTypes.d.ts +66 -0
  458. package/types/valueTypes.d.ts.map +11 -0
@@ -0,0 +1,15 @@
1
+ export interface PayloadShapeDiagnostic {
2
+ code: "multi-component-single-value";
3
+ property: string;
4
+ payload: string;
5
+ message: string;
6
+ }
7
+ /**
8
+ * Returns a diagnostic when `payload` holds more than one top-level component
9
+ * for a longhand that takes exactly one. `hasBase` sharpens the message: with
10
+ * no base in the program, the most likely cause is a base written after a
11
+ * conditional and swallowed by its space-greedy payload.
12
+ */
13
+ export declare function validatePayloadShape(property: string, payload: string, hasBase: boolean): PayloadShapeDiagnostic | null;
14
+
15
+ //# sourceMappingURL=payloadShape.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AA4DA,iBAAiB,uBAAuB;CACtC,MAAM;CACN;CACA;CACA;;;;;;;;AASF,OAAO,iBAAS,qBACd,kBACA,iBACA,mBACC",
3
+ "names": [],
4
+ "sources": [
5
+ "src/payloadShape.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// Value-level payload-shape validation, owned by the resolution layer per the\n// design record (\"Value-level validation of resolved payloads has exactly one\n// owner, the resolution step\"). One source of truth for the runtime, the\n// compiler, and the ESLint rule — none of them may grow a second opinion\n// about what a suspicious payload looks like.\n//\n// The clause grammar is space-greedy by design: a payload extends until the\n// next `modifier:` clause, because many longhands legitimately take\n// space-separated component lists (`boxShadow=\"inset 0 2px red\"`). The\n// consequence is that a base written AFTER a conditional is absorbed into\n// that conditional's payload — `backgroundColor=\"sm:green red\"` parses as one\n// clause with payload \"green red\" and NO base, the browser then drops the\n// invalid declaration, and the element renders with nothing at every\n// viewport. The absorption stays (changing it would break legitimate\n// multi-component payloads); the silence goes: a multi-component payload on a\n// longhand that takes exactly one component value is a diagnostic.\n\nimport { splitTopLevelComponents } from './backgroundFamily'\n\n/**\n * Longhands whose value is a component LIST, where a multi-component payload\n * is ordinary CSS. Everything else that this validator is asked about is\n * treated as single-component. Family shorthands (`border`, `background`,\n * `textDecoration`, `font`) never reach payload validation — they split into\n * per-longhand programs first.\n */\nconst listValuedLonghands: ReadonlySet<string> = new Set([\n 'boxShadow',\n 'textShadow',\n 'transform',\n 'transition',\n 'transitionProperty',\n 'animation',\n 'animationName',\n 'backgroundImage',\n 'backgroundPosition',\n 'backgroundSize',\n 'backgroundRepeat',\n 'fontFamily',\n 'fontVariant',\n 'filter',\n 'backdropFilter',\n 'willChange',\n 'quotes',\n 'textDecorationLine',\n 'containIntrinsicSize',\n 'strokeDasharray',\n 'gridTemplateColumns',\n 'gridTemplateRows',\n 'gridTemplateAreas',\n 'gridArea',\n 'gridColumn',\n 'gridRow',\n 'inset',\n 'mask',\n 'maskImage',\n 'maskPosition',\n 'maskSize',\n])\n\nexport interface PayloadShapeDiagnostic {\n code: 'multi-component-single-value'\n property: string\n payload: string\n message: string\n}\n\n/**\n * Returns a diagnostic when `payload` holds more than one top-level component\n * for a longhand that takes exactly one. `hasBase` sharpens the message: with\n * no base in the program, the most likely cause is a base written after a\n * conditional and swallowed by its space-greedy payload.\n */\nexport function validatePayloadShape(\n property: string,\n payload: string,\n hasBase: boolean\n): PayloadShapeDiagnostic | null {\n if (listValuedLonghands.has(property)) return null\n const components = splitTopLevelComponents(payload)\n if (components.length <= 1) return null\n return {\n code: 'multi-component-single-value',\n property,\n payload,\n message:\n `\"${payload}\" holds ${components.length} values but \"${property}\" takes one.` +\n (hasBase\n ? ''\n : ` A value written after a conditional joins that conditional's payload — write the base value before the first conditional.`),\n }\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Props with no per-part flat clause spelling BY DESIGN, mapped to the
3
+ * composite property that owns their clause spelling.
4
+ *
5
+ * - RN shadow parts are not CSS longhands: plain values compose into
6
+ * boxShadow/textShadow (web `styleToCSS`) or pass straight to the RN host,
7
+ * and the composite property carries any conditional.
8
+ * - Transform parts outside the flat family (skews, 3D rotations,
9
+ * perspective, matrix) have no per-part spelling; the raw `transform`
10
+ * property is one ordinary program and owns their clauses (design record,
11
+ * "The transform family").
12
+ */
13
+ export declare const legacyPartComposite: Readonly<Record<string, string>>;
14
+ export type ProgramEligibility = "program" | "legacy-part";
15
+ /**
16
+ * 'program': a clause-bearing flat value on this prop evaluates through the
17
+ * program engine. 'legacy-part': plain values keep their legacy pipeline and
18
+ * a clause-bearing value is a diagnostic naming the composite — never a
19
+ * silent forward, never a codemod conversion.
20
+ */
21
+ export declare function programEligibility(prop: string): ProgramEligibility;
22
+
23
+ //# sourceMappingURL=programEligibility.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": ";;;;;;;;;;;;AAkBA,OAAO,cAAM,qBAAqB,SAAS;AAiB3C,YAAY,qBAAqB,YAAY;;;;;;;AAQ7C,OAAO,iBAAS,mBAAmB,eAAe",
3
+ "names": [],
4
+ "sources": [
5
+ "src/programEligibility.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// One owner for \"does a flat clause value on this prop evaluate through the\n// program engine\". The runtime consults it before contributing, the codemod\n// consults it before converting a condition object, and the ESLint rule\n// consults it before blessing a clause spelling — so a migration can never\n// produce source the runtime will not evaluate (review P0-2).\n\n/**\n * Props with no per-part flat clause spelling BY DESIGN, mapped to the\n * composite property that owns their clause spelling.\n *\n * - RN shadow parts are not CSS longhands: plain values compose into\n * boxShadow/textShadow (web `styleToCSS`) or pass straight to the RN host,\n * and the composite property carries any conditional.\n * - Transform parts outside the flat family (skews, 3D rotations,\n * perspective, matrix) have no per-part spelling; the raw `transform`\n * property is one ordinary program and owns their clauses (design record,\n * \"The transform family\").\n */\nexport const legacyPartComposite: Readonly<Record<string, string>> = Object.freeze({\n shadowColor: 'boxShadow',\n shadowOffset: 'boxShadow',\n shadowOpacity: 'boxShadow',\n shadowRadius: 'boxShadow',\n textShadowColor: 'textShadow',\n textShadowOffset: 'textShadow',\n textShadowRadius: 'textShadow',\n perspective: 'transform',\n skewX: 'transform',\n skewY: 'transform',\n matrix: 'transform',\n rotateX: 'transform',\n rotateY: 'transform',\n rotateZ: 'transform',\n})\n\nexport type ProgramEligibility = 'program' | 'legacy-part'\n\n/**\n * 'program': a clause-bearing flat value on this prop evaluates through the\n * program engine. 'legacy-part': plain values keep their legacy pipeline and\n * a clause-bearing value is a diagnostic naming the composite — never a\n * silent forward, never a codemod conversion.\n */\nexport function programEligibility(prop: string): ProgramEligibility {\n return prop in legacyPartComposite ? 'legacy-part' : 'program'\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,20 @@
1
+ import type { ParsedValue } from "./valueTypes";
2
+ /**
3
+ * The exact string that identifies a program. Every variable-length part is
4
+ * length-prefixed, so no payload can forge a boundary and two different
5
+ * programs cannot normalize to the same key. Also usable as the upstream
6
+ * parse/lower cache key.
7
+ */
8
+ export declare function normalizeProgramKey(property: string, value: ParsedValue, configRevision: string): string;
9
+ /**
10
+ * Short per-property prefix for readability in devtools: the first letter of
11
+ * each camelCase word, so `backgroundColor` is `bc` and `borderTopLeftRadius`
12
+ * is `btlr`. Abbreviations may collide (`backgroundColor` and `backgroundClip`
13
+ * are both `bc`); the hash carries the property name, so the full class name
14
+ * still differs. This is a label, not identity.
15
+ */
16
+ export declare function propertyAbbreviation(property: string): string;
17
+ /** the css-safe class name that owns this program's block, eg `_bc-1076745300` */
18
+ export declare function programClassName(property: string, value: ParsedValue, configRevision: string): string;
19
+
20
+ //# sourceMappingURL=programHash.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAaA,cAAc,mBAAmB;;;;;;;AA6DjC,OAAO,iBAAS,oBACd,kBACA,OAAO,aACP;;;;;;;;AAuBF,OAAO,iBAAS,qBAAqB;;AAkBrC,OAAO,iBAAS,iBACd,kBACA,OAAO,aACP",
3
+ "names": [],
4
+ "sources": [
5
+ "src/programHash.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// Deterministic identity for one lowered program.\n//\n// A (longhand property, program, config revision) triple hashes to one class\n// name, which is the whole dedup mechanism for the program block encoding: a\n// class name fully determines its block, so duplicate arrival is idempotent and\n// dedup is a name check. See plans/dom-tailwind-flat-values.md — \"The program\n// block encoding\".\n//\n// Server and client must agree, so nothing here may depend on iteration order,\n// config object identity, or insertion history. The config revision is the\n// caller's opaque stamp for \"the resolved config that produced these payloads\".\n\nimport { canonicalClauseModifier } from './clausePrecedence'\nimport type { ParsedValue } from './valueTypes'\n\n// The hash is the algorithm from @tamagui/simple-hash\n// (code/core/simple-hash/src/index.ts), copied rather than imported because this\n// package stays dependency-free. Same accumulator, same CSS-safe character\n// rules, so identifiers behave like the ones core already generates. Keep in\n// sync if that file changes. Two deliberate differences: no memo cache (callers\n// own caching, and a shared module-level cache in the grammar package would\n// outlive every config), and `strict` mode at the call site below.\nfunction hashChar(hash: number, char: string): number {\n return (Math.imul(31, hash) + char.charCodeAt(0)) | 0\n}\n\nfunction isValidCssCharCode(code: number): boolean {\n return (\n (code >= 65 && code <= 90) || // A-Z\n (code >= 97 && code <= 122) || // a-z\n code === 95 || // _\n code === 45 || // -\n (code >= 48 && code <= 57) // 0-9\n )\n}\n\nfunction simpleHash(input: string, hashMin: number | 'strict' = 10): string {\n let str = input\n\n // remove var()\n if (str[0] === 'v' && str.startsWith('var(')) {\n str = str.slice(6, str.length - 1)\n }\n\n let hash = 0\n let valids = ''\n let added = 0\n const len = str.length\n\n for (let i = 0; i < len; i++) {\n if (hashMin !== 'strict' && added <= hashMin) {\n const char = str.charCodeAt(i)\n if (char === 46) {\n valids += '--'\n continue\n }\n if (isValidCssCharCode(char)) {\n added++\n valids += str[i]\n continue\n }\n }\n hash = hashChar(hash, str[i])\n }\n\n return valids + (hash ? Math.abs(hash) : '')\n}\n\n/**\n * The exact string that identifies a program. Every variable-length part is\n * length-prefixed, so no payload can forge a boundary and two different\n * programs cannot normalize to the same key. Also usable as the upstream\n * parse/lower cache key.\n */\nexport function normalizeProgramKey(\n property: string,\n value: ParsedValue,\n configRevision: string\n): string {\n let key = `${configRevision.length}:${configRevision}${property.length}:${property}`\n key += value.base === null ? 'n' : `b${value.base.length}:${value.base}`\n for (const clause of value.clauses) {\n // condition sets are conjunctions: `dark:hover:` and `hover:dark:` are one\n // clause, so the hash sorts a copy to agree with the merge rule and dedup;\n // alias spellings canonicalize first so `active:` and `press:` are one name\n const canonical = clause.modifiers.map(canonicalClauseModifier)\n const modifiers =\n canonical.length > 1 ? canonical.sort().join(',') : canonical.join(',')\n key += `c${modifiers.length}:${modifiers}${clause.payload.length}:${clause.payload}`\n }\n return key\n}\n\n/**\n * Short per-property prefix for readability in devtools: the first letter of\n * each camelCase word, so `backgroundColor` is `bc` and `borderTopLeftRadius`\n * is `btlr`. Abbreviations may collide (`backgroundColor` and `backgroundClip`\n * are both `bc`); the hash carries the property name, so the full class name\n * still differs. This is a label, not identity.\n */\nexport function propertyAbbreviation(property: string): string {\n let out = ''\n for (let index = 0; index < property.length; index++) {\n const code = property.charCodeAt(index)\n const isWordStart =\n index === 0 ||\n (code >= 65 && code <= 90) ||\n // a dash also starts a word, so the transform family's custom properties\n // read as `--t-x` -> `tx` rather than collapsing to the fallback\n property.charCodeAt(index - 1) === 45\n if (isWordStart && ((code >= 65 && code <= 90) || (code >= 97 && code <= 122))) {\n out += property[index].toLowerCase()\n }\n }\n return out || 'x'\n}\n\n/** the css-safe class name that owns this program's block, eg `_bc-1076745300` */\nexport function programClassName(\n property: string,\n value: ParsedValue,\n configRevision: string\n): string {\n const hash = simpleHash(normalizeProgramKey(property, value, configRevision), 'strict')\n // `strict` returns '' when the accumulator lands on 0, which would make every\n // such program share one name\n return `_${propertyAbbreviation(property)}-${hash || '0'}`\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,18 @@
1
+ import type { LonghandProgram, ParsedValue } from "./valueTypes";
2
+ export declare const longhandExpansionTable: Readonly<Record<string, readonly string[]>>;
3
+ export declare function expandToLonghands(prop: string, shorthands?: Record<string, string>): readonly string[];
4
+ /**
5
+ * The merge unit is the clause, keyed by its exact condition set (decision
6
+ * 21): the later contribution replaces the base only when it restates one,
7
+ * replaces the clauses whose condition sets it restates, and its clauses
8
+ * append after the surviving earlier ones so last-match-wins holds. A styled
9
+ * `bg="gray hover:blue"` overridden by a call-site `bg="red"` keeps the
10
+ * hover clause, matching tailwind-merge's per-variant conflict groups.
11
+ */
12
+ export declare function mergeProgramValues(earlier: ParsedValue, later: ParsedValue): ParsedValue;
13
+ export declare function mergePrograms(entries: ReadonlyArray<{
14
+ prop: string;
15
+ value: ParsedValue;
16
+ }>, shorthands?: Record<string, string>): Map<string, LonghandProgram>;
17
+
18
+ //# sourceMappingURL=programs.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AACA,cAAc,iBAA+B,mBAAmB;AAEhE,OAAO,cAAM,wBAAwB,SAAS;AAoC9C,OAAO,iBAAS,kBACd,cACA,aAAa;;;;;;;;;AAcf,OAAO,iBAAS,mBACd,SAAS,aACT,OAAO,cACN;AAoBH,OAAO,iBAAS,cACd,SAAS,cAAc;CAAE;CAAc,OAAO;IAC9C,aAAa,yBACZ,YAAY",
3
+ "names": [],
4
+ "sources": [
5
+ "src/programs.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import { clauseConditionSetKey } from './clausePrecedence'\nimport type { LonghandProgram, ParsedClause, ParsedValue } from './valueTypes'\n\nexport const longhandExpansionTable: Readonly<Record<string, readonly string[]>> = {\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n paddingHorizontal: ['paddingLeft', 'paddingRight'],\n paddingVertical: ['paddingTop', 'paddingBottom'],\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n marginHorizontal: ['marginLeft', 'marginRight'],\n marginVertical: ['marginTop', 'marginBottom'],\n inset: ['top', 'right', 'bottom', 'left'],\n borderWidth: [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ],\n borderColor: [\n 'borderTopColor',\n 'borderRightColor',\n 'borderBottomColor',\n 'borderLeftColor',\n ],\n borderStyle: [\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n ],\n borderRadius: [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n ],\n overflow: ['overflowX', 'overflowY'],\n gap: ['rowGap', 'columnGap'],\n}\n\nexport function expandToLonghands(\n prop: string,\n shorthands?: Record<string, string>\n): readonly string[] {\n const resolvedProp = shorthands?.[prop] ?? prop\n return longhandExpansionTable[resolvedProp] ?? [resolvedProp]\n}\n\n/**\n * The merge unit is the clause, keyed by its exact condition set (decision\n * 21): the later contribution replaces the base only when it restates one,\n * replaces the clauses whose condition sets it restates, and its clauses\n * append after the surviving earlier ones so last-match-wins holds. A styled\n * `bg=\"gray hover:blue\"` overridden by a call-site `bg=\"red\"` keeps the\n * hover clause, matching tailwind-merge's per-variant conflict groups.\n */\nexport function mergeProgramValues(\n earlier: ParsedValue,\n later: ParsedValue\n): ParsedValue {\n const base = later.base ?? earlier.base\n if (!earlier.clauses.length) {\n return base === later.base ? later : { base, clauses: later.clauses }\n }\n if (!later.clauses.length) {\n return base === earlier.base ? earlier : { base, clauses: earlier.clauses }\n }\n const restated = new Set<string>()\n for (const clause of later.clauses) {\n restated.add(clauseConditionSetKey(clause.modifiers))\n }\n const clauses: ParsedClause[] = []\n for (const clause of earlier.clauses) {\n if (!restated.has(clauseConditionSetKey(clause.modifiers))) clauses.push(clause)\n }\n for (const clause of later.clauses) clauses.push(clause)\n return { base, clauses }\n}\n\nexport function mergePrograms(\n entries: ReadonlyArray<{ prop: string; value: ParsedValue }>,\n shorthands?: Record<string, string>\n): Map<string, LonghandProgram> {\n const programs = new Map<string, LonghandProgram>()\n\n for (const { prop, value } of entries) {\n for (const property of expandToLonghands(prop, shorthands)) {\n const existing = programs.get(property)\n const merged = existing ? mergeProgramValues(existing.value, value) : value\n programs.delete(property)\n programs.set(property, { property, value: merged, sourceProp: prop })\n }\n }\n\n return programs\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,24 @@
1
+ import { modifierAliases } from "./stateModifiers";
2
+ export { modifierAliases };
3
+ export type TokenCategory = "space" | "size" | "radius" | "zIndex" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing";
4
+ export type Convenience = "alignment-alias" | "bare-border" | "flex-bundle" | "font-generic" | "integer" | "percentage" | "sizing-keyword";
5
+ export interface GrammarEntry {
6
+ prop: string;
7
+ prefix: string;
8
+ tokenCategory?: TokenCategory;
9
+ conveniences?: readonly Convenience[];
10
+ }
11
+ export declare const grammarEntries: readonly GrammarEntry[];
12
+ export declare const propToGrammarEntry: Readonly<Record<string, GrammarEntry>>;
13
+ export declare function getTokenCategory(prop: string): TokenCategory | null;
14
+ export declare const prefixToEntries: Readonly<Record<string, readonly GrammarEntry[]>>;
15
+ export declare const standaloneValueProps: Readonly<Record<string, Readonly<Record<string, string>>>>;
16
+ export declare const fontWeightNames: Readonly<Record<string, string>>;
17
+ export declare const wholeClassUtilities: Readonly<Record<string, Readonly<Record<string, string | number>>>>;
18
+ export declare const wholeClassConveniences: Readonly<Record<string, Convenience>>;
19
+ export declare const borderSideSuffix: Readonly<Record<string, readonly string[]>>;
20
+ export declare const radiusCornerProps: Readonly<Record<string, readonly string[]>>;
21
+ export declare const textAlignKeywords: ReadonlySet<string>;
22
+ export declare const percentUtilityProps: ReadonlySet<string>;
23
+
24
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,SAAS,uBAAuB;AAEhC,SAAS;AAET,YAAY,gBACR,UACA,SACA,WACA,WACA,UACA,eACA,aACA,eACA,eACA;AAEJ,YAAY,cACR,oBACA,gBACA,gBACA,iBACA,YACA,eACA;AAEJ,iBAAiB,aAAa;CAC5B;CACA;CACA,gBAAgB;CAChB,wBAAwB;;AAG1B,OAAO,cAAM,yBAAyB;AA+GtC,OAAO,cAAM,oBAAoB,SAAS,eAAe;AAIzD,OAAO,iBAAS,iBAAiB,eAAe;AAIhD,OAAO,cAAM,iBAAiB,SAAS,wBAAwB;AAS/D,OAAO,cAAM,sBAAsB,SACjC,eAAe,SAAS;AA4G1B,OAAO,cAAM,iBAAiB,SAAS;AA0BvC,OAAO,cAAM,qBAAqB,SAChC,eAAe,SAAS;AAkB1B,OAAO,cAAM,wBAAwB,SAAS,eAAe;AAgB7D,OAAO,cAAM,kBAAkB,SAAS;AAUxC,OAAO,cAAM,mBAAmB,SAAS;AAYzC,OAAO,cAAM,mBAAmB;AAShC,OAAO,cAAM,qBAAqB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/registry.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import { modifierAliases } from './stateModifiers'\n\nexport { modifierAliases }\n\nexport type TokenCategory =\n | 'space'\n | 'size'\n | 'radius'\n | 'zIndex'\n | 'color'\n | 'fontFamily'\n | 'fontSize'\n | 'fontWeight'\n | 'lineHeight'\n | 'letterSpacing'\n\nexport type Convenience =\n | 'alignment-alias'\n | 'bare-border'\n | 'flex-bundle'\n | 'font-generic'\n | 'integer'\n | 'percentage'\n | 'sizing-keyword'\n\nexport interface GrammarEntry {\n prop: string\n prefix: string\n tokenCategory?: TokenCategory\n conveniences?: readonly Convenience[]\n}\n\nexport const grammarEntries: readonly GrammarEntry[] = [\n { prop: 'backgroundColor', prefix: 'bg', tokenCategory: 'color' },\n { prop: 'width', prefix: 'w', tokenCategory: 'size', conveniences: ['sizing-keyword'] },\n {\n prop: 'height',\n prefix: 'h',\n tokenCategory: 'size',\n conveniences: ['sizing-keyword'],\n },\n {\n prop: 'minWidth',\n prefix: 'min-w',\n tokenCategory: 'size',\n conveniences: ['sizing-keyword'],\n },\n {\n prop: 'maxWidth',\n prefix: 'max-w',\n tokenCategory: 'size',\n conveniences: ['sizing-keyword'],\n },\n {\n prop: 'minHeight',\n prefix: 'min-h',\n tokenCategory: 'size',\n conveniences: ['sizing-keyword'],\n },\n {\n prop: 'maxHeight',\n prefix: 'max-h',\n tokenCategory: 'size',\n conveniences: ['sizing-keyword'],\n },\n { prop: 'padding', prefix: 'p', tokenCategory: 'space' },\n { prop: 'paddingTop', prefix: 'pt', tokenCategory: 'space' },\n { prop: 'paddingRight', prefix: 'pr', tokenCategory: 'space' },\n { prop: 'paddingBottom', prefix: 'pb', tokenCategory: 'space' },\n { prop: 'paddingLeft', prefix: 'pl', tokenCategory: 'space' },\n { prop: 'paddingHorizontal', prefix: 'px', tokenCategory: 'space' },\n { prop: 'paddingVertical', prefix: 'py', tokenCategory: 'space' },\n { prop: 'margin', prefix: 'm', tokenCategory: 'space' },\n { prop: 'marginTop', prefix: 'mt', tokenCategory: 'space' },\n { prop: 'marginRight', prefix: 'mr', tokenCategory: 'space' },\n { prop: 'marginBottom', prefix: 'mb', tokenCategory: 'space' },\n { prop: 'marginLeft', prefix: 'ml', tokenCategory: 'space' },\n { prop: 'marginHorizontal', prefix: 'mx', tokenCategory: 'space' },\n { prop: 'marginVertical', prefix: 'my', tokenCategory: 'space' },\n { prop: 'gap', prefix: 'gap', tokenCategory: 'space' },\n { prop: 'borderWidth', prefix: 'border', tokenCategory: 'space' },\n { prop: 'borderTopWidth', prefix: 'border-t', tokenCategory: 'space' },\n { prop: 'borderRightWidth', prefix: 'border-r', tokenCategory: 'space' },\n { prop: 'borderBottomWidth', prefix: 'border-b', tokenCategory: 'space' },\n { prop: 'borderLeftWidth', prefix: 'border-l', tokenCategory: 'space' },\n { prop: 'borderColor', prefix: 'border', tokenCategory: 'color' },\n { prop: 'borderTopColor', prefix: 'border-t', tokenCategory: 'color' },\n { prop: 'borderRightColor', prefix: 'border-r', tokenCategory: 'color' },\n { prop: 'borderBottomColor', prefix: 'border-b', tokenCategory: 'color' },\n { prop: 'borderLeftColor', prefix: 'border-l', tokenCategory: 'color' },\n { prop: 'borderRadius', prefix: 'rounded', tokenCategory: 'radius' },\n { prop: 'borderTopLeftRadius', prefix: 'rounded-tl', tokenCategory: 'radius' },\n { prop: 'borderTopRightRadius', prefix: 'rounded-tr', tokenCategory: 'radius' },\n { prop: 'borderBottomLeftRadius', prefix: 'rounded-bl', tokenCategory: 'radius' },\n { prop: 'borderBottomRightRadius', prefix: 'rounded-br', tokenCategory: 'radius' },\n { prop: 'borderStyle', prefix: 'border' },\n { prop: 'color', prefix: 'color', tokenCategory: 'color' },\n { prop: 'fontSize', prefix: 'text', tokenCategory: 'fontSize' },\n // bound (2026-07-31 adjudication): the runtime resolves fontWeight through\n // the active family's weight sub-map and the codemod already emits flat\n // weight names, so an unbound registry row was an omission, not a decision\n { prop: 'fontWeight', prefix: 'font', tokenCategory: 'fontWeight' },\n {\n prop: 'fontFamily',\n prefix: 'font',\n tokenCategory: 'fontFamily',\n conveniences: ['font-generic'],\n },\n { prop: 'fontStyle', prefix: '' },\n { prop: 'lineHeight', prefix: 'leading', tokenCategory: 'lineHeight' },\n { prop: 'letterSpacing', prefix: 'tracking', tokenCategory: 'letterSpacing' },\n { prop: 'textAlign', prefix: 'text' },\n { prop: 'textTransform', prefix: '' },\n { prop: 'textDecorationLine', prefix: '' },\n { prop: 'display', prefix: '' },\n { prop: 'position', prefix: '' },\n { prop: 'top', prefix: 'top', tokenCategory: 'space' },\n { prop: 'right', prefix: 'right', tokenCategory: 'space' },\n { prop: 'bottom', prefix: 'bottom', tokenCategory: 'space' },\n { prop: 'left', prefix: 'left', tokenCategory: 'space' },\n { prop: 'inset', prefix: 'inset', tokenCategory: 'space' },\n { prop: 'zIndex', prefix: 'z', tokenCategory: 'zIndex', conveniences: ['integer'] },\n { prop: 'overflow', prefix: '' },\n { prop: 'flex', prefix: 'flex', conveniences: ['flex-bundle'] },\n { prop: 'flexDirection', prefix: 'flex' },\n { prop: 'flexWrap', prefix: 'flex' },\n { prop: 'flexGrow', prefix: 'grow' },\n { prop: 'flexShrink', prefix: 'shrink' },\n { prop: 'alignItems', prefix: 'items', conveniences: ['alignment-alias'] },\n { prop: 'alignContent', prefix: 'content', conveniences: ['alignment-alias'] },\n { prop: 'alignSelf', prefix: 'self', conveniences: ['alignment-alias'] },\n { prop: 'justifyContent', prefix: 'justify', conveniences: ['alignment-alias'] },\n { prop: 'opacity', prefix: 'opacity', conveniences: ['percentage'] },\n { prop: 'boxShadow', prefix: 'shadow' },\n { prop: 'pointerEvents', prefix: 'pointer-events' },\n { prop: 'rotate', prefix: 'rotate' },\n { prop: 'scale', prefix: 'scale', conveniences: ['percentage'] },\n { prop: 'x', prefix: 'translate-x', tokenCategory: 'space' },\n { prop: 'y', prefix: 'translate-y', tokenCategory: 'space' },\n { prop: 'aspectRatio', prefix: 'aspect' },\n { prop: 'objectFit', prefix: 'object' },\n] as const\n\nexport const propToGrammarEntry: Readonly<Record<string, GrammarEntry>> = Object.freeze(\n Object.fromEntries(grammarEntries.map((entry) => [entry.prop, entry]))\n)\n\nexport function getTokenCategory(prop: string): TokenCategory | null {\n return propToGrammarEntry[prop]?.tokenCategory || null\n}\n\nexport const prefixToEntries: Readonly<Record<string, readonly GrammarEntry[]>> =\n Object.freeze(\n grammarEntries.reduce<Record<string, GrammarEntry[]>>((out, entry) => {\n if (!entry.prefix) return out\n ;(out[entry.prefix] ||= []).push(entry)\n return out\n }, {})\n )\n\nexport const standaloneValueProps: Readonly<\n Record<string, Readonly<Record<string, string>>>\n> = Object.freeze({\n display: {\n flex: 'flex',\n none: 'hidden',\n block: 'block',\n inline: 'inline',\n grid: 'grid',\n 'inline-flex': 'inline-flex',\n },\n position: {\n relative: 'relative',\n absolute: 'absolute',\n fixed: 'fixed',\n sticky: 'sticky',\n static: 'static',\n },\n flexDirection: {\n row: 'flex-row',\n column: 'flex-col',\n 'row-reverse': 'flex-row-reverse',\n 'column-reverse': 'flex-col-reverse',\n },\n flexWrap: {\n wrap: 'flex-wrap',\n nowrap: 'flex-nowrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n },\n textTransform: {\n uppercase: 'uppercase',\n lowercase: 'lowercase',\n capitalize: 'capitalize',\n none: 'normal-case',\n },\n textDecorationLine: {\n underline: 'underline',\n 'line-through': 'line-through',\n none: 'no-underline',\n },\n fontStyle: {\n italic: 'italic',\n normal: 'not-italic',\n },\n borderStyle: {\n solid: 'border-solid',\n dashed: 'border-dashed',\n dotted: 'border-dotted',\n none: 'border-none',\n },\n alignItems: {\n center: 'items-center',\n 'flex-start': 'items-start',\n 'flex-end': 'items-end',\n baseline: 'items-baseline',\n stretch: 'items-stretch',\n },\n alignContent: {\n center: 'content-center',\n 'flex-start': 'content-start',\n 'flex-end': 'content-end',\n 'space-between': 'content-between',\n 'space-around': 'content-around',\n stretch: 'content-stretch',\n },\n alignSelf: {\n auto: 'self-auto',\n center: 'self-center',\n 'flex-start': 'self-start',\n 'flex-end': 'self-end',\n stretch: 'self-stretch',\n },\n justifyContent: {\n center: 'justify-center',\n 'flex-start': 'justify-start',\n 'flex-end': 'justify-end',\n 'space-between': 'justify-between',\n 'space-around': 'justify-around',\n 'space-evenly': 'justify-evenly',\n },\n overflow: {\n hidden: 'overflow-hidden',\n scroll: 'overflow-scroll',\n auto: 'overflow-auto',\n visible: 'overflow-visible',\n },\n pointerEvents: {\n none: 'pointer-events-none',\n auto: 'pointer-events-auto',\n 'box-none': 'pointer-events-box-none',\n 'box-only': 'pointer-events-box-only',\n },\n textAlign: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n justify: 'text-justify',\n start: 'text-start',\n end: 'text-end',\n },\n objectFit: {\n contain: 'object-contain',\n cover: 'object-cover',\n fill: 'object-fill',\n none: 'object-none',\n 'scale-down': 'object-scale-down',\n },\n})\n\nexport const fontWeightNames: Readonly<Record<string, string>> = Object.freeze({\n '100': 'thin',\n '200': 'extralight',\n '300': 'light',\n '400': 'normal',\n '500': 'medium',\n '600': 'semibold',\n '700': 'bold',\n '800': 'extrabold',\n '900': 'black',\n normal: 'normal',\n bold: 'bold',\n})\n\nconst generatedWholeUtilities: Record<string, Record<string, string | number>> = {}\nfor (const prop in standaloneValueProps) {\n for (const value in standaloneValueProps[prop]) {\n generatedWholeUtilities[standaloneValueProps[prop][value]] = { [prop]: value }\n }\n}\nfor (const value in fontWeightNames) {\n generatedWholeUtilities[`font-${fontWeightNames[value]}`] = {\n fontWeight: /^\\d+$/.test(value) ? value : value === 'bold' ? '700' : '400',\n }\n}\n\nexport const wholeClassUtilities: Readonly<\n Record<string, Readonly<Record<string, string | number>>>\n> = Object.freeze({\n ...generatedWholeUtilities,\n 'flex-1': { flex: 1 },\n 'flex-auto': { flexGrow: 1, flexShrink: 1, flexBasis: 'auto' },\n 'flex-initial': { flexGrow: 0, flexShrink: 1, flexBasis: 'auto' },\n 'flex-none': { flexGrow: 0, flexShrink: 0, flexBasis: 'auto' },\n contents: { display: 'contents' },\n border: { borderWidth: 1 },\n 'border-t': { borderTopWidth: 1 },\n 'border-r': { borderRightWidth: 1 },\n 'border-b': { borderBottomWidth: 1 },\n 'border-l': { borderLeftWidth: 1 },\n 'border-x': { borderLeftWidth: 1, borderRightWidth: 1 },\n 'border-y': { borderTopWidth: 1, borderBottomWidth: 1 },\n 'inset-0': { top: 0, right: 0, bottom: 0, left: 0 },\n})\n\nexport const wholeClassConveniences: Readonly<Record<string, Convenience>> =\n Object.freeze({\n 'flex-1': 'flex-bundle',\n 'flex-auto': 'flex-bundle',\n 'flex-initial': 'flex-bundle',\n 'flex-none': 'flex-bundle',\n border: 'bare-border',\n 'border-t': 'bare-border',\n 'border-r': 'bare-border',\n 'border-b': 'bare-border',\n 'border-l': 'bare-border',\n 'border-x': 'bare-border',\n 'border-y': 'bare-border',\n 'inset-0': 'sizing-keyword',\n })\n\nexport const borderSideSuffix: Readonly<Record<string, readonly string[]>> =\n Object.freeze({\n t: ['Top'],\n r: ['Right'],\n b: ['Bottom'],\n l: ['Left'],\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom'],\n })\n\nexport const radiusCornerProps: Readonly<Record<string, readonly string[]>> =\n Object.freeze({\n tl: ['borderTopLeftRadius'],\n tr: ['borderTopRightRadius'],\n bl: ['borderBottomLeftRadius'],\n br: ['borderBottomRightRadius'],\n t: ['borderTopLeftRadius', 'borderTopRightRadius'],\n b: ['borderBottomLeftRadius', 'borderBottomRightRadius'],\n l: ['borderTopLeftRadius', 'borderBottomLeftRadius'],\n r: ['borderTopRightRadius', 'borderBottomRightRadius'],\n })\n\nexport const textAlignKeywords: ReadonlySet<string> = new Set([\n 'left',\n 'center',\n 'right',\n 'justify',\n 'start',\n 'end',\n])\n\nexport const percentUtilityProps: ReadonlySet<string> = new Set([\n 'opacity',\n 'scale',\n 'scaleX',\n 'scaleY',\n])\n"
10
+ ]
11
+ }
@@ -0,0 +1,75 @@
1
+ export type ReferenceKind = "color" | "length" | "number" | "other";
2
+ /**
3
+ * What a lookup returns for a configured token or variable. Intentionally open:
4
+ * the variables unification (design item 11) can carry more here, and extra
5
+ * fields ride through onto the emitted reference.
6
+ */
7
+ export interface ResolvedReference {
8
+ /** the resolved name, which is what the serializers key on */
9
+ name: string;
10
+ kind: ReferenceKind;
11
+ }
12
+ /** a resolved reference in a payload, with its color opacity suffix if any */
13
+ export type PayloadReference = ResolvedReference & {
14
+ /** integer 1-99; only ever present when `kind` is `color` */
15
+ opacity?: number;
16
+ };
17
+ export type PayloadSegment = string | PayloadReference;
18
+ export type PayloadResolveErrorCode = "opacity-on-non-color" | "opacity-out-of-range";
19
+ export interface PayloadResolveError {
20
+ code: PayloadResolveErrorCode;
21
+ /** character offset of the identifier within the payload */
22
+ index: number;
23
+ message: string;
24
+ /** the identifier the suffix was applied to, without the suffix */
25
+ name: string;
26
+ /** the percentage as authored, which may be out of range or fractional */
27
+ opacity: number;
28
+ }
29
+ export interface ResolvedPayload {
30
+ /** static text runs and references, in payload order; adjacent text collapses */
31
+ segments: readonly PayloadSegment[];
32
+ /** every reference in `segments`, same objects, in order */
33
+ references: readonly PayloadReference[];
34
+ errors: readonly PayloadResolveError[];
35
+ }
36
+ export interface ResolvePayloadOptions {
37
+ /** the property's bound token categories first, then the variables namespace */
38
+ lookup(name: string): ResolvedReference | undefined;
39
+ /**
40
+ * set when the property binds a numeric token category (space, size, radius,
41
+ * z-index). Off means bare numbers are always literal.
42
+ */
43
+ resolveNumbers?: boolean;
44
+ /**
45
+ * tooling hook: receives every top-level candidate the resolver considered —
46
+ * idents and hex colors always, bare numbers when `resolveNumbers` is set —
47
+ * with its payload offsets and resolution. Skipped positions (strings, url()
48
+ * bodies, function names, custom properties) never report. The runtime path
49
+ * never passes this.
50
+ */
51
+ onCandidate?(start: number, end: number, name: string, resolved: PayloadReference | undefined): void;
52
+ }
53
+ export declare function resolvePayload(payload: string, options: ResolvePayloadOptions): ResolvedPayload;
54
+ export type ColorOpacitySuffix = {
55
+ kind: "none";
56
+ } | {
57
+ kind: "valid";
58
+ name: string;
59
+ opacity: number;
60
+ } | {
61
+ kind: "invalid";
62
+ name: string;
63
+ raw: string;
64
+ };
65
+ /**
66
+ * The one owner of the color opacity suffix rule for WHOLE names
67
+ * (`slate-500/50`). Every layer — flat payloads (via `readOpacitySuffix`
68
+ * below, same rules anchored mid-payload), Tailwind candidates, and whole
69
+ * color token values must agree: valid means an unsigned integer 0 through
70
+ * 100; an invalid attempt is a diagnostic and is never clamped or partially
71
+ * applied (review divergence 2).
72
+ */
73
+ export declare function splitColorOpacitySuffix(value: string): ColorOpacitySuffix;
74
+
75
+ //# sourceMappingURL=resolvePayload.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAyBA,YAAY,gBAAgB,UAAU,WAAW,WAAW;;;;;;AAO5D,iBAAiB,kBAAkB;;CAEjC;CACA,MAAM;;;AAIR,YAAY,mBAAmB,oBAAoB;;CAEjD;;AAGF,YAAY,0BAA0B;AAEtC,YAAY,0BAER,yBAEA;AAEJ,iBAAiB,oBAAoB;CACnC,MAAM;;CAEN;CACA;;CAEA;;CAEA;;AAUF,iBAAiB,gBAAgB;;CAE/B,mBAAmB;;CAEnB,qBAAqB;CACrB,iBAAiB;;AAGnB,iBAAiB,sBAAsB;;CAErC,OAAO,eAAe;;;;;CAKtB;;;;;;;;CAQA,aACE,eACA,aACA,cACA,UAAU;;AA8Ed,OAAO,iBAAS,eACd,iBACA,SAAS,wBACR;AA+MH,YAAY,qBAER;CAAE,MAAM;IAER;CAAE,MAAM;CAAS;CAAc;IAE/B;CAAE,MAAM;CAAW;CAAc;;;;;;;;;;AAarC,OAAO,iBAAS,wBAAwB,gBAAgB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/resolvePayload.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// Config-first identifier resolution inside one clause payload.\n//\n// See plans/dom-tailwind-flat-values.md — \"the resolver's mechanical contract\".\n// Step 3 of the shared pipeline: the parser has already split the program, and\n// this turns one payload into static text runs plus reference nodes, which the\n// two serializers in ./serializePayload render for web and native. One\n// implementation serves both platforms, so resolution never bakes in a target.\n//\n// What is a candidate:\n//\n// - ident tokens anywhere, including inside function arguments, so\n// `linear-gradient(135deg, accent, blue)` resolves `accent`;\n// - never inside a string, never inside an unquoted `url()` body, never a\n// function name, never a `--*` custom-property reference;\n// - bare numbers only when the property binds a numeric token category, and only\n// as a whole component value: `4 8` resolves both, `0 2px` resolves neither for\n// box-shadow because it binds no numeric category. Numbers with units are\n// always literal.\n//\n// A lookup miss stays literal text. Typos in literal positions are the\n// compiler's and language service's job, never a runtime guess — so with a\n// lookup that resolves nothing, both serializers reproduce the input exactly.\n\nimport { reservedCssIdents } from './valueTypes'\n\nexport type ReferenceKind = 'color' | 'length' | 'number' | 'other'\n\n/**\n * What a lookup returns for a configured token or variable. Intentionally open:\n * the variables unification (design item 11) can carry more here, and extra\n * fields ride through onto the emitted reference.\n */\nexport interface ResolvedReference {\n /** the resolved name, which is what the serializers key on */\n name: string\n kind: ReferenceKind\n}\n\n/** a resolved reference in a payload, with its color opacity suffix if any */\nexport type PayloadReference = ResolvedReference & {\n /** integer 1-99; only ever present when `kind` is `color` */\n opacity?: number\n}\n\nexport type PayloadSegment = string | PayloadReference\n\nexport type PayloadResolveErrorCode =\n /** the suffix is recognized only directly after a resolved color token */\n | 'opacity-on-non-color'\n /** a suffix on a resolved color token that is not an integer 0 through 100 */\n | 'opacity-out-of-range'\n\nexport interface PayloadResolveError {\n code: PayloadResolveErrorCode\n /** character offset of the identifier within the payload */\n index: number\n message: string\n /** the identifier the suffix was applied to, without the suffix */\n name: string\n /** the percentage as authored, which may be out of range or fractional */\n opacity: number\n}\n\ninterface OpacitySuffix {\n /** index just past the suffix */\n end: number\n /** the percentage, or null when it is not a valid integer 0 through 100 */\n percentage: number | null\n}\n\nexport interface ResolvedPayload {\n /** static text runs and references, in payload order; adjacent text collapses */\n segments: readonly PayloadSegment[]\n /** every reference in `segments`, same objects, in order */\n references: readonly PayloadReference[]\n errors: readonly PayloadResolveError[]\n}\n\nexport interface ResolvePayloadOptions {\n /** the property's bound token categories first, then the variables namespace */\n lookup(name: string): ResolvedReference | undefined\n /**\n * set when the property binds a numeric token category (space, size, radius,\n * z-index). Off means bare numbers are always literal.\n */\n resolveNumbers?: boolean\n /**\n * tooling hook: receives every top-level candidate the resolver considered —\n * idents and hex colors always, bare numbers when `resolveNumbers` is set —\n * with its payload offsets and resolution. Skipped positions (strings, url()\n * bodies, function names, custom properties) never report. The runtime path\n * never passes this.\n */\n onCandidate?(\n start: number,\n end: number,\n name: string,\n resolved: PayloadReference | undefined\n ): void\n}\n\n// CSS-wide keywords are case-insensitive, and the shared set spells one of them\n// camelCase (`currentColor`), so both sides of the comparison have to fold\nconst reservedFolded: ReadonlySet<string> = new Set(\n Array.from(reservedCssIdents, (ident) => ident.toLowerCase())\n)\n\nconst noReferences: readonly PayloadReference[] = Object.freeze([])\nconst noErrors: readonly PayloadResolveError[] = Object.freeze([])\n\nconst CHAR_TAB = 9\nconst CHAR_LF = 10\nconst CHAR_FF = 12\nconst CHAR_CR = 13\nconst CHAR_SPACE = 32\nconst CHAR_PERCENT = 37\nconst CHAR_HASH = 35\nconst CHAR_DOUBLE_QUOTE = 34\nconst CHAR_SINGLE_QUOTE = 39\nconst CHAR_PAREN_OPEN = 40\nconst CHAR_PAREN_CLOSE = 41\nconst CHAR_PLUS = 43\nconst CHAR_COMMA = 44\nconst CHAR_MINUS = 45\nconst CHAR_DOT = 46\nconst CHAR_SLASH = 47\nconst CHAR_UNDERSCORE = 95\nconst CHAR_BACKSLASH = 92\nconst CHAR_E_LOWER = 101\nconst CHAR_E_UPPER = 69\n\nfunction isWhitespace(code: number): boolean {\n return (\n code === CHAR_SPACE ||\n code === CHAR_TAB ||\n code === CHAR_LF ||\n code === CHAR_CR ||\n code === CHAR_FF\n )\n}\n\nfunction isDigit(code: number): boolean {\n return code >= 48 && code <= 57\n}\n\nfunction isLetter(code: number): boolean {\n return (code >= 97 && code <= 122) || (code >= 65 && code <= 90)\n}\n\nfunction isIdentStart(code: number): boolean {\n return (\n isLetter(code) ||\n code === CHAR_UNDERSCORE ||\n code === CHAR_MINUS ||\n code === CHAR_BACKSLASH ||\n // non-ascii idents are legal CSS and may name a configured token\n code > 127\n )\n}\n\nfunction isIdentPart(code: number): boolean {\n return isIdentStart(code) || isDigit(code)\n}\n\n/** a component-value boundary, with -1 meaning start or end of the payload */\nfunction isBoundary(code: number): boolean {\n return (\n code === -1 ||\n isWhitespace(code) ||\n code === CHAR_COMMA ||\n code === CHAR_PAREN_OPEN ||\n code === CHAR_PAREN_CLOSE\n )\n}\n\nexport function resolvePayload(\n payload: string,\n options: ResolvePayloadOptions\n): ResolvedPayload {\n const { lookup, resolveNumbers = false, onCandidate } = options\n const length = payload.length\n\n const segments: PayloadSegment[] = []\n let references: PayloadReference[] | null = null\n let errors: PayloadResolveError[] | null = null\n // start of the static run not yet pushed\n let staticStart = 0\n\n const codeAt = (index: number): number =>\n index >= 0 && index < length ? payload.charCodeAt(index) : -1\n\n const pushReference = (start: number, end: number, reference: PayloadReference) => {\n if (start > staticStart) segments.push(payload.slice(staticStart, start))\n segments.push(reference)\n ;(references ||= []).push(reference)\n staticStart = end\n }\n\n let index = 0\n while (index < length) {\n const code = payload.charCodeAt(index)\n\n // strings are verbatim, including anything ident-shaped inside them\n if (code === CHAR_DOUBLE_QUOTE || code === CHAR_SINGLE_QUOTE) {\n index++\n while (index < length) {\n const inner = payload.charCodeAt(index)\n if (inner === CHAR_BACKSLASH) index += 2\n else if (inner === code) {\n index++\n break\n } else index++\n }\n continue\n }\n\n // a hex color's digits are not a number token\n if (code === CHAR_HASH) {\n const start = index\n index++\n while (index < length && isIdentPart(payload.charCodeAt(index))) index++\n onCandidate?.(start, index, payload.slice(start, index), undefined)\n continue\n }\n\n // `-` before a digit is a signed number, not an ident\n if (isIdentStart(code) && !(code === CHAR_MINUS && isDigit(codeAt(index + 1)))) {\n const start = index\n let end = index\n while (end < length && isIdentPart(payload.charCodeAt(end))) {\n end += payload.charCodeAt(end) === CHAR_BACKSLASH ? 2 : 1\n }\n const name = payload.slice(start, Math.min(end, length))\n\n // a function name is never a candidate, and an unquoted url() body never\n // resolves, so skip the whole call\n if (codeAt(end) === CHAR_PAREN_OPEN) {\n index = name.toLowerCase() === 'url' ? skipParens(payload, end) : end + 1\n continue\n }\n\n // custom-property references stay literal\n if (name.startsWith('--')) {\n index = end\n continue\n }\n\n // CSS-wide keywords are case-insensitive, so the reserved gate is folded.\n // Token names themselves stay case-sensitive: only the gate folds.\n const resolved = reservedFolded.has(name.toLowerCase()) ? undefined : lookup(name)\n\n // a numeric run directly after the ident, ending at a component boundary,\n // is an opacity suffix attempt. `center/50%` and `center/cover` are not\n // attempts at all, so ordinary CSS slash forms never come near this.\n const suffix = readOpacitySuffix(payload, end, codeAt)\n\n if (suffix !== null && resolved?.kind === 'color') {\n if (suffix.percentage === null) {\n // a malformed percentage on a real color token is the user reaching for\n // opacity and missing, so it is reported rather than emitted as text\n ;(errors ||= []).push({\n code: 'opacity-out-of-range',\n index: start,\n message: `\"${name}${payload.slice(end, suffix.end)}\" is not an opacity suffix: it must be an integer percentage from 0 through 100`,\n name,\n opacity: Number(payload.slice(end + 1, suffix.end)),\n })\n onCandidate?.(start, suffix.end, name, { ...resolved })\n index = suffix.end\n continue\n }\n const reference =\n // 100% is the identity, so it never reaches a serializer\n suffix.percentage === 100\n ? { ...resolved }\n : { ...resolved, opacity: suffix.percentage }\n pushReference(start, suffix.end, reference)\n onCandidate?.(start, suffix.end, name, reference)\n index = suffix.end\n continue\n }\n\n if (suffix !== null && suffix.percentage !== null) {\n // a well-formed suffix somewhere it cannot apply: the suffix is\n // recognized only directly after a resolved color token. The text stays\n // literal so the payload still round-trips.\n ;(errors ||= []).push({\n code: 'opacity-on-non-color',\n index: start,\n message: resolved\n ? `\"${name}\" is not a color token (kind: ${resolved.kind}), so the /${suffix.percentage} opacity suffix does not apply`\n : `\"${name}\" is not a resolved color token, so the /${suffix.percentage} opacity suffix does not apply`,\n name,\n opacity: suffix.percentage,\n })\n onCandidate?.(start, end, name, resolved ? { ...resolved } : undefined)\n index = suffix.end\n continue\n }\n\n // no suffix, or a malformed one after an ident that is not a color token,\n // which is ordinary CSS such as `font: bold small/1.2 serif`\n if (!resolved) {\n onCandidate?.(start, end, name, undefined)\n index = end\n continue\n }\n\n const reference = { ...resolved }\n pushReference(start, end, reference)\n onCandidate?.(start, end, name, reference)\n index = end\n continue\n }\n\n if (\n isDigit(code) ||\n code === CHAR_DOT ||\n ((code === CHAR_PLUS || code === CHAR_MINUS) && isDigit(codeAt(index + 1)))\n ) {\n const start = index\n let end = index\n if (code === CHAR_PLUS || code === CHAR_MINUS) end++\n while (end < length) {\n const digit = payload.charCodeAt(end)\n if (isDigit(digit) || digit === CHAR_DOT) end++\n else break\n }\n // scientific notation stays part of the number token\n if (codeAt(end) === CHAR_E_LOWER || codeAt(end) === CHAR_E_UPPER) {\n let exponent = end + 1\n if (codeAt(exponent) === CHAR_PLUS || codeAt(exponent) === CHAR_MINUS) exponent++\n if (isDigit(codeAt(exponent))) {\n exponent++\n while (exponent < length && isDigit(payload.charCodeAt(exponent))) exponent++\n end = exponent\n }\n }\n const numberEnd = end\n\n // a unit or percent sign makes it literal\n let unitEnd = numberEnd\n if (codeAt(unitEnd) === CHAR_PERCENT) unitEnd++\n else while (unitEnd < length && isIdentPart(payload.charCodeAt(unitEnd))) unitEnd++\n if (unitEnd > numberEnd) {\n index = unitEnd\n continue\n }\n\n // a number resolves only as a WHOLE component value, so it must be\n // bounded on both sides: `4 8` resolves both, `4/8` and `12px/4` neither\n if (\n !resolveNumbers ||\n !isBoundary(codeAt(start - 1)) ||\n !isBoundary(codeAt(numberEnd))\n ) {\n index = numberEnd\n continue\n }\n\n const name = payload.slice(start, numberEnd)\n const resolved = lookup(name)\n if (resolved) {\n const reference = { ...resolved }\n pushReference(start, numberEnd, reference)\n onCandidate?.(start, numberEnd, name, reference)\n } else {\n onCandidate?.(start, numberEnd, name, undefined)\n }\n index = numberEnd\n continue\n }\n\n index++\n }\n\n if (staticStart < length) segments.push(payload.slice(staticStart))\n\n return {\n segments,\n references: references ?? noReferences,\n errors: errors ?? noErrors,\n }\n}\n\nexport type ColorOpacitySuffix =\n /** no suffix attempt: `center/cover` and `x/50%` are ordinary CSS */\n | { kind: 'none' }\n /** a valid suffix: unsigned integer 0 through 100 */\n | { kind: 'valid'; name: string; opacity: number }\n /** an attempt that is signed, fractional, or out of range — a diagnostic, never a clamp */\n | { kind: 'invalid'; name: string; raw: string }\n\nconst opacityAttempt = /^[+-]?\\d+(?:\\.\\d+)?$/\nconst opacityValid = /^\\d+$/\n\n/**\n * The one owner of the color opacity suffix rule for WHOLE names\n * (`slate-500/50`). Every layer — flat payloads (via `readOpacitySuffix`\n * below, same rules anchored mid-payload), Tailwind candidates, and whole\n * color token values must agree: valid means an unsigned integer 0 through\n * 100; an invalid attempt is a diagnostic and is never clamped or partially\n * applied (review divergence 2).\n */\nexport function splitColorOpacitySuffix(value: string): ColorOpacitySuffix {\n const slash = value.lastIndexOf('/')\n if (slash <= 0 || slash === value.length - 1) return { kind: 'none' }\n const raw = value.slice(slash + 1)\n if (!opacityAttempt.test(raw)) return { kind: 'none' }\n const name = value.slice(0, slash)\n if (opacityValid.test(raw) && Number(raw) <= 100) {\n return { kind: 'valid', name, opacity: Number(raw) }\n }\n return { kind: 'invalid', name, raw }\n}\n\n/**\n * Reads a `/NN` opacity suffix attempt sitting directly on an ident. An attempt\n * is a numeric run that ends at a component boundary, so `center/cover` and\n * `center/50%` are not attempts and stay ordinary CSS. `percentage` is null when\n * the number is signed, fractional, or outside 0 through 100.\n */\nfunction readOpacitySuffix(\n payload: string,\n identEnd: number,\n codeAt: (index: number) => number\n): OpacitySuffix | null {\n if (codeAt(identEnd) !== CHAR_SLASH) return null\n let cursor = identEnd + 1\n let signed = false\n if (codeAt(cursor) === CHAR_MINUS || codeAt(cursor) === CHAR_PLUS) {\n signed = true\n cursor++\n }\n const digitsStart = cursor\n while (isDigit(codeAt(cursor))) cursor++\n if (cursor === digitsStart) return null\n let fractional = false\n if (codeAt(cursor) === CHAR_DOT && isDigit(codeAt(cursor + 1))) {\n fractional = true\n cursor++\n while (isDigit(codeAt(cursor))) cursor++\n }\n if (!isBoundary(codeAt(cursor))) return null\n const value = Number(payload.slice(identEnd + 1, cursor))\n const valid = !signed && !fractional && value >= 0 && value <= 100\n return { end: cursor, percentage: valid ? value : null }\n}\n\n/** index just past the `)` matching the `(` at `open` */\nfunction skipParens(payload: string, open: number): number {\n let depth = 0\n let index = open\n while (index < payload.length) {\n const code = payload.charCodeAt(index)\n if (code === CHAR_BACKSLASH) {\n index += 2\n continue\n }\n if (code === CHAR_DOUBLE_QUOTE || code === CHAR_SINGLE_QUOTE) {\n index++\n while (index < payload.length) {\n const inner = payload.charCodeAt(index)\n if (inner === CHAR_BACKSLASH) index += 2\n else if (inner === code) {\n index++\n break\n } else index++\n }\n continue\n }\n if (code === CHAR_PAREN_OPEN) depth++\n else if (code === CHAR_PAREN_CLOSE) {\n depth--\n if (depth === 0) return index + 1\n }\n index++\n }\n return payload.length\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,34 @@
1
+ export * from "./backgroundFamily";
2
+ export * from "./borderFamily";
3
+ export * from "./candidate";
4
+ export * from "./candidateTarget";
5
+ export * from "./clausePrecedence";
6
+ export * from "./clauseSources";
7
+ export * from "./config";
8
+ export * from "./evaluateProgram";
9
+ export * from "./fontShorthand";
10
+ export * from "./geometricShorthand";
11
+ export * from "./lowerProgram";
12
+ export * from "./mergeFlatValues";
13
+ export * from "./modifierRegistry";
14
+ export * from "./payloadShape";
15
+ export * from "./programEligibility";
16
+ export * from "./programHash";
17
+ export * from "./programs";
18
+ export * from "./registry";
19
+ export * from "./resolvePayload";
20
+ export * from "./safeAreaVariables";
21
+ export * from "./scanFlatValue";
22
+ export * from "./stateModifiers";
23
+ export * from "./serializePayload";
24
+ export * from "./states";
25
+ export * from "./textDecorationFamily";
26
+ export * from "./transformFamily";
27
+ export * from "./transition";
28
+ export * from "./transitionAlign";
29
+ export * from "./transitionNative";
30
+ export * from "./valueParser";
31
+ export * from "./valueTypes";
32
+ export * from "./unitlessNumbers";
33
+
34
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc",
3
+ "names": [],
4
+ "sources": [
5
+ "src/runtime.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "export * from './backgroundFamily'\nexport * from './borderFamily'\nexport * from './candidate'\nexport * from './candidateTarget'\nexport * from './clausePrecedence'\nexport * from './clauseSources'\nexport * from './config'\nexport * from './evaluateProgram'\nexport * from './fontShorthand'\nexport * from './geometricShorthand'\nexport * from './lowerProgram'\nexport * from './mergeFlatValues'\nexport * from './modifierRegistry'\nexport * from './payloadShape'\nexport * from './programEligibility'\nexport * from './programHash'\nexport * from './programs'\nexport * from './registry'\nexport * from './resolvePayload'\nexport * from './safeAreaVariables'\nexport * from './scanFlatValue'\nexport * from './stateModifiers'\nexport * from './serializePayload'\nexport * from './states'\nexport * from './textDecorationFamily'\nexport * from './transformFamily'\nexport * from './transition'\nexport * from './transitionAlign'\nexport * from './transitionNative'\nexport * from './valueParser'\nexport * from './valueTypes'\nexport * from './unitlessNumbers'\n"
10
+ ]
11
+ }
@@ -0,0 +1,5 @@
1
+ export type SafeAreaEdge = "top" | "right" | "bottom" | "left";
2
+ export declare const safeAreaVariableNames: Readonly<Record<SafeAreaEdge, string>>;
3
+ export declare function getSafeAreaEdge(name: string): SafeAreaEdge | undefined;
4
+
5
+ //# sourceMappingURL=safeAreaVariables.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,YAAY,eAAe,QAAQ,UAAU,WAAW;AAExD,OAAO,cAAM,uBAAuB,SAAS,OAAO;AAcpD,OAAO,iBAAS,gBAAgB,eAAe",
3
+ "names": [],
4
+ "sources": [
5
+ "src/safeAreaVariables.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "export type SafeAreaEdge = 'top' | 'right' | 'bottom' | 'left'\n\nexport const safeAreaVariableNames: Readonly<Record<SafeAreaEdge, string>> = {\n top: 'safe-area-top',\n right: 'safe-area-right',\n bottom: 'safe-area-bottom',\n left: 'safe-area-left',\n}\n\nconst safeAreaEdges: Readonly<Record<string, SafeAreaEdge>> = {\n [safeAreaVariableNames.top]: 'top',\n [safeAreaVariableNames.right]: 'right',\n [safeAreaVariableNames.bottom]: 'bottom',\n [safeAreaVariableNames.left]: 'left',\n}\n\nexport function getSafeAreaEdge(name: string): SafeAreaEdge | undefined {\n return safeAreaEdges[name]\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,29 @@
1
+ export type FlatScanErrorCode = "invalid-character" | "unterminated-string" | "unterminated-function" | "unterminated-comment" | "stray-comment-close";
2
+ /** why a scan stopped short, or null when it ran to the end cleanly */
3
+ export type FlatScanFailure = FlatScanErrorCode | "refused-chain";
4
+ export interface FlatValueVisitor {
5
+ /**
6
+ * The base, or one clause's payload, just ended. `start` and `end` are
7
+ * already trimmed, and `start === end` means the segment is empty: an empty
8
+ * base is simply no base, an empty payload is a clause with nothing in it.
9
+ */
10
+ segment(start: number, end: number, isBase: boolean): void;
11
+ /**
12
+ * A modifier chain just ended, without its trailing colon, so
13
+ * `source.slice(start, end)` is `dark:hover` for `dark:hover:red`. Returning
14
+ * false stops the scan: the consumer has refused the value and does not want
15
+ * later chains resolved.
16
+ */
17
+ chain(start: number, end: number): boolean;
18
+ /**
19
+ * A character the grammar refuses, or a delimiter left open at the end. The
20
+ * scan continues, so a consumer that only wants the first one records it and
21
+ * refuses the next chain.
22
+ */
23
+ error?(code: FlatScanErrorCode, index: number): void;
24
+ /** every top-level word, whether or not it turned out to carry a chain */
25
+ word?(start: number, end: number, isChain: boolean): void;
26
+ }
27
+ export declare function scanFlatValue(source: string, visitor: FlatValueVisitor): FlatScanFailure | null;
28
+
29
+ //# sourceMappingURL=scanFlatValue.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAiFA,YAAY,oBACR,sBACA,wBACA,0BACA,yBACA;;AAGJ,YAAY,kBAAkB,oBAAoB;AAElD,iBAAiB,iBAAiB;;;;;;CAMhC,QAAQ,eAAe,aAAa;;;;;;;CAOpC,MAAM,eAAe;;;;;;CAMrB,OAAO,MAAM,mBAAmB;;CAEhC,MAAM,eAAe,aAAa;;AAiEpC,OAAO,iBAAS,cACd,gBACA,SAAS,mBACR",
3
+ "names": [],
4
+ "sources": [
5
+ "src/scanFlatValue.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// The one flat-value lexer.\n//\n// value := base? clause*\n// clause := modifier (\":\" modifier)* \":\" payload\n//\n// Every implementation of this grammar splits a value the same way, so the\n// split lives here once and every consumer drives it with a visitor:\n// `parseValue` builds the canonical result on top of it, and the web runtime's\n// style, variant and lifecycle scanners drive it directly so that what they\n// consume cannot drift from what the canonical parser says the value means.\n//\n// The visitor gets index ranges, never slices. A style prop is scanned on every\n// render it is not classed away, so the scan itself allocates nothing and the\n// consumer slices only what it keeps.\n//\n// Clause detection is purely syntactic. A colon counts only at the top level:\n// outside strings, outside comments, outside `url()` and outside every paren\n// nesting, which covers every other function. A top-level colon is never valid\n// inside a CSS value, so an unregistered modifier is a hard error rather than\n// silent value content.\n//\n// A top-level `{`, `}`, or `;` is rejected for the same reason: those tokens are\n// never valid in a CSS component value. Inside strings, comments, `url()` and\n// parens they stay ordinary content.\n//\n// The states below mirror CSS's tokenizer rather than approximating it, because\n// the whole class of bugs here has been the scan believing it was inside a\n// construct the tokenizer had already left:\n//\n// - a comment outranks paren depth, because comments are lexical. `/*` opens\n// one at ANY depth, since `calc(1px /* pad */ + 2px)` is real CSS. It runs\n// to `*/` however many lines that takes and holds no escapes: `\\*/` still\n// closes it. A comment is opaque content belonging to whatever segment it\n// sits in, so a colon inside one is not a clause boundary and a `;` inside\n// one is not a refused character.\n// - a string outranks a comment opener: `\"/*\"` is a two-character string.\n// - a comment outranks a quote: a `\"` inside one is just text.\n// - `url(` outranks BOTH. It is the one function CSS does not tokenize: no\n// comments, no strings, only an escape and the `)` that ends it.\n// `url(\"...\")` is an ordinary function whose string IS real, so the quote\n// lookahead in `opensUrlToken` has to tell the two apart.\n// - a backslash escapes its next character everywhere except inside a comment.\n//\n// Containment is only real if the delimiter actually closes, so an unbalanced\n// value is an error rather than trusted for a containment the emitted CSS will\n// not honour:\n//\n// - a string. CSS ends an unterminated one at a NEWLINE, as a parse error, so\n// `\"abc\\n;}.x{y\"` would read quoted end to end to a naive scan while the\n// browser reads a bad string, a top-level `;}` and a new rule. The scan\n// reports the error at the opening quote and RESUMES at the newline, so the\n// `;}` is seen where the browser sees it. A backslash before the newline is\n// a line continuation and does stay inside the string, which is why the\n// escape branch is checked first.\n// - a comment. `red/*` opens one that swallows whatever follows it, and\n// `insertStyleRule`'s `getAllRules` joins rules into one blob that SSR emits\n// as a single style tag, so an unclosed comment blanks other components'\n// rules until some later `*/` turns them back on.\n// - a `*/` with nothing open, at any depth, closes a comment somewhere else in\n// that same blob.\n//\n// This runs at runtime on native, so it is one left-to-right pass with no\n// regexes and no substrings.\n\nconst CHAR_TAB = 9\nconst CHAR_LF = 10\nconst CHAR_FF = 12\nconst CHAR_CR = 13\nconst CHAR_SPACE = 32\nconst CHAR_DOUBLE_QUOTE = 34\nconst CHAR_SINGLE_QUOTE = 39\nconst CHAR_PAREN_OPEN = 40\nconst CHAR_PAREN_CLOSE = 41\nconst CHAR_STAR = 42\nconst CHAR_SLASH = 47\nconst CHAR_SEMICOLON = 59\nconst CHAR_COLON = 58\nconst CHAR_BACKSLASH = 92\nconst CHAR_BRACE_OPEN = 123\nconst CHAR_BRACE_CLOSE = 125\n\nexport type FlatScanErrorCode =\n | 'invalid-character'\n | 'unterminated-string'\n | 'unterminated-function'\n | 'unterminated-comment'\n | 'stray-comment-close'\n\n/** why a scan stopped short, or null when it ran to the end cleanly */\nexport type FlatScanFailure = FlatScanErrorCode | 'refused-chain'\n\nexport interface FlatValueVisitor {\n /**\n * The base, or one clause's payload, just ended. `start` and `end` are\n * already trimmed, and `start === end` means the segment is empty: an empty\n * base is simply no base, an empty payload is a clause with nothing in it.\n */\n segment(start: number, end: number, isBase: boolean): void\n /**\n * A modifier chain just ended, without its trailing colon, so\n * `source.slice(start, end)` is `dark:hover` for `dark:hover:red`. Returning\n * false stops the scan: the consumer has refused the value and does not want\n * later chains resolved.\n */\n chain(start: number, end: number): boolean\n /**\n * A character the grammar refuses, or a delimiter left open at the end. The\n * scan continues, so a consumer that only wants the first one records it and\n * refuses the next chain.\n */\n error?(code: FlatScanErrorCode, index: number): void\n /** every top-level word, whether or not it turned out to carry a chain */\n word?(start: number, end: number, isChain: boolean): void\n}\n\nfunction isWhitespace(code: number): boolean {\n return (\n code === CHAR_SPACE ||\n code === CHAR_TAB ||\n code === CHAR_LF ||\n code === CHAR_CR ||\n code === CHAR_FF\n )\n}\n\n/**\n * `index` points at the `(`. A url token is the ident `url` followed directly by\n * it, with no ident character before the `u` (`myurl(` is an ordinary function)\n * and no quote after it (`url(\"a\")` is one too).\n */\nfunction opensUrlToken(source: string, index: number): boolean {\n if (index < 3) return false\n if (\n (source.charCodeAt(index - 3) | 32) !== 117 ||\n (source.charCodeAt(index - 2) | 32) !== 114 ||\n (source.charCodeAt(index - 1) | 32) !== 108\n ) {\n return false\n }\n const before = index > 3 ? source.charCodeAt(index - 4) : 0\n if (\n before === 45 ||\n before === 95 ||\n before >= 128 ||\n (before >= 48 && before <= 57) ||\n (before >= 65 && before <= 90) ||\n (before >= 97 && before <= 122)\n ) {\n return false\n }\n let next = index + 1\n while (next < source.length && source.charCodeAt(next) <= 32) next++\n const quote = source.charCodeAt(next)\n return quote !== CHAR_DOUBLE_QUOTE && quote !== CHAR_SINGLE_QUOTE\n}\n\n/**\n * Closes the base (before any clause) or the payload of the pending clause.\n *\n * A module function rather than a closure over the scan: a style prop is\n * scanned on every render it is not classed away, and one closure per scan is\n * one allocation per prop per render for nothing.\n */\nfunction closeSegment(\n source: string,\n visitor: FlatValueVisitor,\n segmentStart: number,\n end: number,\n isBase: boolean\n): void {\n let start = segmentStart\n let stop = end\n while (start < stop && isWhitespace(source.charCodeAt(start))) start++\n while (stop > start && isWhitespace(source.charCodeAt(stop - 1))) stop--\n visitor.segment(start, stop, isBase)\n}\n\nexport function scanFlatValue(\n source: string,\n visitor: FlatValueVisitor\n): FlatScanFailure | null {\n const length = source.length\n\n let failure: FlatScanFailure | null = null\n let sawChain = false\n // where the base, or the current payload, starts\n let segmentStart = 0\n\n // scanner state: in a comment, in a string, in a url token, inside parens, or\n // at the top level\n let comment = false\n let commentStart = -1\n let quote = 0\n let quoteStart = -1\n let url = false\n let depth = 0\n let parenStart = -1\n // the top-level word being scanned, and the last top-level colon inside it\n let wordStart = -1\n let lastColon = -1\n\n for (let index = 0; index < length; index++) {\n const code = source.charCodeAt(index)\n\n if (comment) {\n // no escapes inside a comment: `\\*/` still closes it\n if (code === CHAR_STAR && source.charCodeAt(index + 1) === CHAR_SLASH) {\n comment = false\n index++\n }\n continue\n }\n\n if (quote !== 0) {\n // inside a string an unescaped matching quote ends it, and a newline ends\n // it as a parse error the browser sees the same way\n if (code === CHAR_BACKSLASH) index++\n else if (code === quote) quote = 0\n else if (code === CHAR_LF || code === CHAR_CR || code === CHAR_FF) {\n if (failure === null) failure = 'unterminated-string'\n if (visitor.error !== undefined) visitor.error('unterminated-string', quoteStart)\n quote = 0\n // re-read the newline at top level, where it is ordinary whitespace\n index--\n }\n continue\n }\n\n if (url) {\n // the one function CSS does not tokenize: only an escape and the `)`\n if (code === CHAR_BACKSLASH) index++\n else if (code === CHAR_PAREN_CLOSE) {\n url = false\n depth--\n }\n continue\n }\n\n // comments are lexical, so they open at any depth and outrank paren nesting\n if (code === CHAR_SLASH && source.charCodeAt(index + 1) === CHAR_STAR) {\n comment = true\n commentStart = index\n index++\n continue\n }\n if (code === CHAR_STAR && source.charCodeAt(index + 1) === CHAR_SLASH) {\n if (failure === null) failure = 'stray-comment-close'\n if (visitor.error !== undefined) visitor.error('stray-comment-close', index)\n index++\n continue\n }\n\n if (depth > 0) {\n // inside parens whitespace and colons are ordinary content\n if (code === CHAR_BACKSLASH) index++\n else if (code === CHAR_DOUBLE_QUOTE || code === CHAR_SINGLE_QUOTE) {\n quote = code\n quoteStart = index\n } else if (code === CHAR_PAREN_OPEN) {\n if (opensUrlToken(source, index)) url = true\n depth++\n } else if (code === CHAR_PAREN_CLOSE) depth--\n continue\n }\n\n if (isWhitespace(code)) {\n if (wordStart !== -1) {\n if (visitor.word !== undefined) visitor.word(wordStart, index, lastColon !== -1)\n if (lastColon !== -1) {\n closeSegment(source, visitor, segmentStart, wordStart, !sawChain)\n if (!visitor.chain(wordStart, lastColon)) return 'refused-chain'\n sawChain = true\n segmentStart = lastColon + 1\n }\n wordStart = -1\n lastColon = -1\n }\n continue\n }\n\n // any other top-level character starts or continues a word\n if (wordStart === -1) wordStart = index\n\n if (\n code === CHAR_BRACE_OPEN ||\n code === CHAR_BRACE_CLOSE ||\n code === CHAR_SEMICOLON\n ) {\n if (failure === null) failure = 'invalid-character'\n if (visitor.error !== undefined) visitor.error('invalid-character', index)\n } else if (code === CHAR_BACKSLASH) index++\n else if (code === CHAR_DOUBLE_QUOTE || code === CHAR_SINGLE_QUOTE) {\n quote = code\n quoteStart = index\n } else if (code === CHAR_PAREN_OPEN) {\n if (opensUrlToken(source, index)) url = true\n depth = 1\n parenStart = index\n } else if (code === CHAR_COLON) lastColon = index\n }\n\n if (comment) {\n if (failure === null) failure = 'unterminated-comment'\n if (visitor.error !== undefined) visitor.error('unterminated-comment', commentStart)\n }\n if (quote !== 0) {\n if (failure === null) failure = 'unterminated-string'\n if (visitor.error !== undefined) visitor.error('unterminated-string', quoteStart)\n }\n if (depth > 0) {\n if (failure === null) failure = 'unterminated-function'\n if (visitor.error !== undefined) visitor.error('unterminated-function', parenStart)\n }\n\n if (wordStart !== -1) {\n if (visitor.word !== undefined) visitor.word(wordStart, length, lastColon !== -1)\n if (lastColon !== -1) {\n closeSegment(source, visitor, segmentStart, wordStart, !sawChain)\n if (!visitor.chain(wordStart, lastColon)) return 'refused-chain'\n sawChain = true\n segmentStart = lastColon + 1\n }\n }\n closeSegment(source, visitor, segmentStart, length, !sawChain)\n\n return failure\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,13 @@
1
+ import type { ResolvedPayload } from "./resolvePayload";
2
+ export declare function serializePayloadWeb(resolved: ResolvedPayload, toVar: (name: string) => string): string;
3
+ export interface SerializeNativeOptions {
4
+ /**
5
+ * `px-to-number` finalizes a single `<number>px` result to the bare number,
6
+ * which React Native requires for length props. Whether a property takes
7
+ * unitless numbers is property-table knowledge, so it stays with the caller.
8
+ */
9
+ unit?: "px-to-number";
10
+ }
11
+ export declare function serializePayloadNative(resolved: ResolvedPayload, get: (name: string) => string | number, opts?: SerializeNativeOptions): string | number;
12
+
13
+ //# sourceMappingURL=serializePayload.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAiBA,cAAgC,uBAAuB;AAEvD,OAAO,iBAAS,oBACd,UAAU,iBACV,QAAQ;AAiBV,iBAAiB,uBAAuB;;;;;;CAMtC,OAAO;;AAGT,OAAO,iBAAS,uBACd,UAAU,iBACV,MAAM,kCACN,OAAO",
3
+ "names": [],
4
+ "sources": [
5
+ "src/serializePayload.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "// The two serializers over a ResolvedPayload: one representation, two targets.\n//\n// See plans/dom-tailwind-flat-values.md — \"the resolver's mechanical contract\".\n// Web joins references as `var(--name)` so theme switches stay zero-re-render,\n// and a color opacity suffix becomes `color-mix(in srgb, var(--name) NN%,\n// transparent)`, which keeps opacity variants theme-reactive without generating\n// per-alpha variables. Native looks references up through the granular theme\n// subscription at evaluate time and alpha-composes the color right there.\n//\n// Both spellings match what core already emits: the `color-mix` form is\n// `normalizeColor` on web, and the `rgba(r,g,b,a)` form is `normalizeColor` on\n// native. Neither is imported — this package stays dependency-free.\n//\n// With a payload whose references are empty (every lookup missed), both\n// functions return the input string byte for byte, which is what makes literal\n// CSS provably untouched.\n\nimport type { PayloadReference, ResolvedPayload } from './resolvePayload'\n\nexport function serializePayloadWeb(\n resolved: ResolvedPayload,\n toVar: (name: string) => string\n): string {\n let out = ''\n for (const segment of resolved.segments) {\n if (typeof segment === 'string') {\n out += segment\n continue\n }\n const variable = toVar(segment.name)\n out +=\n segment.opacity === undefined\n ? variable\n : `color-mix(in srgb, ${variable} ${segment.opacity}%, transparent)`\n }\n return out\n}\n\nexport interface SerializeNativeOptions {\n /**\n * `px-to-number` finalizes a single `<number>px` result to the bare number,\n * which React Native requires for length props. Whether a property takes\n * unitless numbers is property-table knowledge, so it stays with the caller.\n */\n unit?: 'px-to-number'\n}\n\nexport function serializePayloadNative(\n resolved: ResolvedPayload,\n get: (name: string) => string | number,\n opts?: SerializeNativeOptions\n): string | number {\n let out = ''\n for (const segment of resolved.segments) {\n if (typeof segment === 'string') {\n out += segment\n continue\n }\n const value = get(segment.name)\n out += segment.opacity === undefined ? value : composeAlpha(value, segment)\n }\n return finalizeNumeric(out, opts?.unit)\n}\n\n/**\n * Alpha-composes a resolved color so native matches what `color-mix(in srgb, C\n * NN%, transparent)` produces on web: the suffix scales the color's existing\n * alpha rather than replacing it.\n */\nfunction composeAlpha(value: string | number, reference: PayloadReference): string {\n const parsed = typeof value === 'string' ? readColor(value) : null\n if (!parsed) {\n throw new Error(\n `cannot apply the /${reference.opacity} opacity suffix to \"${reference.name}\": ` +\n `its value ${JSON.stringify(value)} is not a #hex, rgb(), or rgba() color`\n )\n }\n const alpha = round4(parsed.a * (reference.opacity! / 100))\n return `rgba(${parsed.r},${parsed.g},${parsed.b},${alpha})`\n}\n\ninterface Rgba {\n r: number\n g: number\n b: number\n a: number\n}\n\nfunction readColor(input: string): Rgba | null {\n const color = input.trim()\n if (color.charCodeAt(0) === 35) return readHex(color)\n\n const open = color.indexOf('(')\n if (open === -1 || color.charCodeAt(color.length - 1) !== 41) return null\n const fn = color.slice(0, open).toLowerCase()\n if (fn !== 'rgb' && fn !== 'rgba') return null\n\n const parts = color.slice(open + 1, -1).split(',')\n if (parts.length !== 3 && parts.length !== 4) return null\n\n const channels: number[] = []\n for (let index = 0; index < 3; index++) {\n const channel = readNumber(parts[index])\n // percentage channels would need a second scale; not supported here\n if (channel === null) return null\n channels.push(clamp(Math.round(channel), 0, 255))\n }\n let alpha = 1\n if (parts.length === 4) {\n const parsedAlpha = readNumber(parts[3])\n if (parsedAlpha === null) return null\n alpha = clamp(parsedAlpha, 0, 1)\n }\n return { r: channels[0], g: channels[1], b: channels[2], a: alpha }\n}\n\nfunction readHex(color: string): Rgba | null {\n const digits = color.slice(1)\n const size = digits.length\n if (size !== 3 && size !== 4 && size !== 6 && size !== 8) return null\n for (let index = 0; index < size; index++) {\n const code = digits.charCodeAt(index)\n const isHex =\n (code >= 48 && code <= 57) ||\n (code >= 97 && code <= 102) ||\n (code >= 65 && code <= 70)\n if (!isHex) return null\n }\n const short = size === 3 || size === 4\n const pair = (position: number): number =>\n short\n ? Number.parseInt(digits[position].repeat(2), 16)\n : Number.parseInt(digits.slice(position * 2, position * 2 + 2), 16)\n const hasAlpha = size === 4 || size === 8\n return {\n r: pair(0),\n g: pair(1),\n b: pair(2),\n a: hasAlpha ? round4(pair(3) / 255) : 1,\n }\n}\n\nfunction readNumber(text: string): number | null {\n const trimmed = text.trim()\n if (!trimmed) return null\n for (let index = 0; index < trimmed.length; index++) {\n const code = trimmed.charCodeAt(index)\n const ok =\n (code >= 48 && code <= 57) ||\n code === 46 || // .\n ((code === 45 || code === 43) && index === 0) // leading sign\n if (!ok) return null\n }\n const value = Number(trimmed)\n return Number.isFinite(value) ? value : null\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return value < min ? min : value > max ? max : value\n}\n\n/** 8-bit alpha needs nowhere near this much precision; this just kills float noise */\nfunction round4(value: number): number {\n return Math.round(value * 10000) / 10000\n}\n\n/**\n * React Native wants bare numbers for numeric props, so a result that is exactly\n * one plain number becomes a number, and `<number>px` becomes one when the\n * caller says this property's lengths are unitless.\n */\nfunction finalizeNumeric(out: string, unit: 'px-to-number' | undefined): string | number {\n let end = out.length\n if (unit === 'px-to-number' && end > 2 && out.endsWith('px')) end -= 2\n if (end === 0) return out\n\n let index = 0\n const first = out.charCodeAt(0)\n if (first === 45 || first === 43) index++\n let digits = 0\n let dots = 0\n for (; index < end; index++) {\n const code = out.charCodeAt(index)\n if (code >= 48 && code <= 57) {\n digits++\n continue\n }\n if (code === 46) {\n dots++\n if (dots > 1) return out\n continue\n }\n return out\n }\n if (digits === 0) return out\n\n const value = Number(out.slice(0, end))\n return Number.isFinite(value) ? value : out\n}\n"
10
+ ]
11
+ }
@@ -0,0 +1,14 @@
1
+ export type CoreStateModifierName = "hover" | "press" | "focus" | "focus-visible" | "focus-within" | "disabled" | "enter" | "exit";
2
+ export declare const coreStateModifierNames: readonly CoreStateModifierName[];
3
+ /**
4
+ * Every alternate spelling of a core state modifier, and the one it means.
5
+ *
6
+ * This table is the only place an alias is written down. The web runtime used
7
+ * to re-map `pressed`, `starting` and `ending` inline while resolving a
8
+ * condition, which meant `parseValue` reported them as unregistered modifiers
9
+ * and the runtime styled them anyway. `stateVocabulary` in states.ts already
10
+ * calls all four aliases, so the two tables now agree by construction.
11
+ */
12
+ export declare const modifierAliases: Readonly<Record<string, string>>;
13
+
14
+ //# sourceMappingURL=stateModifiers.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,YAAY,wBACR,UACA,UACA,UACA,kBACA,iBACA,aACA,UACA;AAEJ,OAAO,cAAM,iCAAiC;;;;;;;;;;AAoB9C,OAAO,cAAM,iBAAiB,SAAS",
3
+ "names": [],
4
+ "sources": [
5
+ "src/stateModifiers.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "export type CoreStateModifierName =\n | 'hover'\n | 'press'\n | 'focus'\n | 'focus-visible'\n | 'focus-within'\n | 'disabled'\n | 'enter'\n | 'exit'\n\nexport const coreStateModifierNames: readonly CoreStateModifierName[] = Object.freeze([\n 'hover',\n 'press',\n 'focus',\n 'focus-visible',\n 'focus-within',\n 'disabled',\n 'enter',\n 'exit',\n])\n\n/**\n * Every alternate spelling of a core state modifier, and the one it means.\n *\n * This table is the only place an alias is written down. The web runtime used\n * to re-map `pressed`, `starting` and `ending` inline while resolving a\n * condition, which meant `parseValue` reported them as unregistered modifiers\n * and the runtime styled them anyway. `stateVocabulary` in states.ts already\n * calls all four aliases, so the two tables now agree by construction.\n */\nexport const modifierAliases: Readonly<Record<string, string>> = Object.freeze({\n active: 'press',\n pressed: 'press',\n starting: 'enter',\n ending: 'exit',\n})\n"
10
+ ]
11
+ }
@@ -0,0 +1,22 @@
1
+ export type StateTier = "pseudo" | "component";
2
+ export interface StateEntry {
3
+ /** canonical state name — the vocabulary word. */
4
+ state: string;
5
+ /** how the state is applied: a core interaction state, or a DOM attribute. */
6
+ tier: StateTier;
7
+ /** canonical Tailwind modifier (e.g. 'press', 'data-[state=open]'). */
8
+ modifier: string;
9
+ /** the web attribute selector the behavior emits (tier === 'component'). */
10
+ selector?: string;
11
+ /** additional modifier spellings that resolve to the canonical one. */
12
+ aliases?: readonly string[];
13
+ }
14
+ export declare const stateVocabulary: readonly StateEntry[];
15
+ export type StateName = (typeof stateVocabulary)[number]["state"];
16
+ export declare const stateNames: readonly string[];
17
+ export declare const stateToModifier: Readonly<Record<string, string>>;
18
+ export declare const modifierToState: Readonly<Record<string, string>>;
19
+ export declare const stateToSelector: Readonly<Record<string, string>>;
20
+ export declare const componentStateNames: readonly string[];
21
+
22
+ //# sourceMappingURL=states.d.ts.map