rnwind 0.0.1 → 0.0.2

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 (330) hide show
  1. package/lib/cjs/core/parser/animation.cjs +427 -0
  2. package/lib/cjs/core/parser/animation.cjs.map +1 -0
  3. package/lib/cjs/core/parser/animation.d.ts +126 -0
  4. package/lib/cjs/core/parser/border-dispatcher.cjs +180 -0
  5. package/lib/cjs/core/parser/border-dispatcher.cjs.map +1 -0
  6. package/lib/cjs/core/parser/border-dispatcher.d.ts +15 -0
  7. package/lib/cjs/core/parser/case-convert.cjs +15 -0
  8. package/lib/cjs/core/parser/case-convert.cjs.map +1 -0
  9. package/lib/cjs/core/parser/case-convert.d.ts +6 -0
  10. package/lib/cjs/core/parser/color-properties-dispatcher.cjs +84 -0
  11. package/lib/cjs/core/parser/color-properties-dispatcher.cjs.map +1 -0
  12. package/lib/cjs/core/parser/color-properties-dispatcher.d.ts +19 -0
  13. package/lib/cjs/core/parser/color.cjs +164 -0
  14. package/lib/cjs/core/parser/color.cjs.map +1 -0
  15. package/lib/cjs/core/parser/color.d.ts +12 -0
  16. package/lib/cjs/core/parser/constants.cjs +21 -0
  17. package/lib/cjs/core/parser/constants.cjs.map +1 -0
  18. package/lib/cjs/core/parser/constants.d.ts +8 -0
  19. package/lib/cjs/core/parser/declaration.cjs +347 -0
  20. package/lib/cjs/core/parser/declaration.cjs.map +1 -0
  21. package/lib/cjs/core/parser/declaration.d.ts +15 -0
  22. package/lib/cjs/core/parser/gradient.cjs +132 -0
  23. package/lib/cjs/core/parser/gradient.cjs.map +1 -0
  24. package/lib/cjs/core/parser/gradient.d.ts +59 -0
  25. package/lib/cjs/core/parser/haptics.cjs +73 -0
  26. package/lib/cjs/core/parser/haptics.cjs.map +1 -0
  27. package/lib/cjs/core/parser/haptics.d.ts +47 -0
  28. package/lib/cjs/core/parser/index.d.ts +8 -0
  29. package/lib/cjs/core/parser/keyframes.cjs +95 -0
  30. package/lib/cjs/core/parser/keyframes.cjs.map +1 -0
  31. package/lib/cjs/core/parser/keyframes.d.ts +26 -0
  32. package/lib/cjs/core/parser/layout-dispatcher.cjs +100 -0
  33. package/lib/cjs/core/parser/layout-dispatcher.cjs.map +1 -0
  34. package/lib/cjs/core/parser/layout-dispatcher.d.ts +14 -0
  35. package/lib/cjs/core/parser/length.cjs +96 -0
  36. package/lib/cjs/core/parser/length.cjs.map +1 -0
  37. package/lib/cjs/core/parser/length.d.ts +48 -0
  38. package/lib/cjs/core/parser/motion-dispatcher.cjs +77 -0
  39. package/lib/cjs/core/parser/motion-dispatcher.cjs.map +1 -0
  40. package/lib/cjs/core/parser/motion-dispatcher.d.ts +11 -0
  41. package/lib/cjs/core/parser/property.cjs +22 -0
  42. package/lib/cjs/core/parser/property.cjs.map +1 -0
  43. package/lib/cjs/core/parser/property.d.ts +8 -0
  44. package/lib/cjs/core/parser/safe-area.cjs +404 -0
  45. package/lib/cjs/core/parser/safe-area.cjs.map +1 -0
  46. package/lib/cjs/core/parser/safe-area.d.ts +39 -0
  47. package/lib/cjs/core/parser/selector.cjs +22 -0
  48. package/lib/cjs/core/parser/selector.cjs.map +1 -0
  49. package/lib/cjs/core/parser/selector.d.ts +11 -0
  50. package/lib/cjs/core/parser/shorthand.cjs +156 -0
  51. package/lib/cjs/core/parser/shorthand.cjs.map +1 -0
  52. package/lib/cjs/core/parser/shorthand.d.ts +61 -0
  53. package/lib/cjs/core/parser/text-truncate.cjs +78 -0
  54. package/lib/cjs/core/parser/text-truncate.cjs.map +1 -0
  55. package/lib/cjs/core/parser/text-truncate.d.ts +44 -0
  56. package/lib/cjs/core/parser/theme-vars.cjs +414 -0
  57. package/lib/cjs/core/parser/theme-vars.cjs.map +1 -0
  58. package/lib/cjs/core/parser/theme-vars.d.ts +61 -0
  59. package/lib/cjs/core/parser/tokens.cjs +304 -0
  60. package/lib/cjs/core/parser/tokens.cjs.map +1 -0
  61. package/lib/cjs/core/parser/tokens.d.ts +45 -0
  62. package/lib/cjs/core/parser/transform.cjs +198 -0
  63. package/lib/cjs/core/parser/transform.cjs.map +1 -0
  64. package/lib/cjs/core/parser/transform.d.ts +36 -0
  65. package/lib/cjs/core/parser/tw-parser.cjs +1567 -0
  66. package/lib/cjs/core/parser/tw-parser.cjs.map +1 -0
  67. package/lib/cjs/core/parser/tw-parser.d.ts +194 -0
  68. package/lib/cjs/core/parser/types.d.ts +37 -0
  69. package/lib/cjs/core/parser/typography-dispatcher.cjs +93 -0
  70. package/lib/cjs/core/parser/typography-dispatcher.cjs.map +1 -0
  71. package/lib/cjs/core/parser/typography-dispatcher.d.ts +11 -0
  72. package/lib/cjs/core/parser/typography.cjs +97 -0
  73. package/lib/cjs/core/parser/typography.cjs.map +1 -0
  74. package/lib/cjs/core/parser/typography.d.ts +43 -0
  75. package/lib/cjs/core/style-builder/build-style.cjs +397 -0
  76. package/lib/cjs/core/style-builder/build-style.cjs.map +1 -0
  77. package/lib/cjs/core/style-builder/build-style.d.ts +54 -0
  78. package/lib/cjs/core/style-builder/index.d.ts +3 -0
  79. package/lib/cjs/core/style-builder/union-builder.cjs +326 -0
  80. package/lib/cjs/core/style-builder/union-builder.cjs.map +1 -0
  81. package/lib/cjs/core/style-builder/union-builder.d.ts +128 -0
  82. package/lib/cjs/core/types.d.ts +14 -0
  83. package/lib/cjs/metro/dts.cjs +127 -0
  84. package/lib/cjs/metro/dts.cjs.map +1 -0
  85. package/lib/cjs/metro/dts.d.ts +16 -0
  86. package/lib/cjs/metro/index.cjs +19 -0
  87. package/lib/cjs/metro/index.cjs.map +1 -0
  88. package/lib/cjs/metro/index.d.ts +9 -0
  89. package/lib/cjs/metro/resolver.cjs +47 -0
  90. package/lib/cjs/metro/resolver.cjs.map +1 -0
  91. package/lib/cjs/metro/resolver.d.ts +22 -0
  92. package/lib/cjs/metro/state.cjs +251 -0
  93. package/lib/cjs/metro/state.cjs.map +1 -0
  94. package/lib/cjs/metro/state.d.ts +72 -0
  95. package/lib/cjs/metro/transform-ast.cjs +1255 -0
  96. package/lib/cjs/metro/transform-ast.cjs.map +1 -0
  97. package/lib/cjs/metro/transform-ast.d.ts +73 -0
  98. package/lib/cjs/metro/transformer.cjs +345 -0
  99. package/lib/cjs/metro/transformer.cjs.map +1 -0
  100. package/lib/cjs/metro/transformer.d.ts +47 -0
  101. package/lib/cjs/metro/warn-unknown-classes.cjs +86 -0
  102. package/lib/cjs/metro/warn-unknown-classes.cjs.map +1 -0
  103. package/lib/cjs/metro/warn-unknown-classes.d.ts +21 -0
  104. package/lib/cjs/metro/with-config.cjs +196 -0
  105. package/lib/cjs/metro/with-config.cjs.map +1 -0
  106. package/lib/cjs/metro/with-config.d.ts +57 -0
  107. package/lib/cjs/runtime/chain-handlers.cjs +37 -0
  108. package/lib/cjs/runtime/chain-handlers.cjs.map +1 -0
  109. package/lib/cjs/runtime/chain-handlers.d.ts +33 -0
  110. package/lib/cjs/runtime/components/rnwind-provider.cjs +98 -0
  111. package/lib/cjs/runtime/components/rnwind-provider.cjs.map +1 -0
  112. package/lib/cjs/runtime/components/rnwind-provider.d.ts +84 -0
  113. package/lib/cjs/runtime/gradient-types.d.ts +58 -0
  114. package/lib/cjs/runtime/haptics.cjs +113 -0
  115. package/lib/cjs/runtime/haptics.cjs.map +1 -0
  116. package/lib/cjs/runtime/haptics.d.ts +48 -0
  117. package/lib/cjs/runtime/hooks/use-css.cjs +21 -0
  118. package/lib/cjs/runtime/hooks/use-css.cjs.map +1 -0
  119. package/lib/cjs/runtime/hooks/use-css.d.ts +11 -0
  120. package/lib/cjs/runtime/hooks/use-interact.cjs +46 -0
  121. package/lib/cjs/runtime/hooks/use-interact.cjs.map +1 -0
  122. package/lib/cjs/runtime/hooks/use-interact.d.ts +42 -0
  123. package/lib/cjs/runtime/hooks/use-scheme.cjs +68 -0
  124. package/lib/cjs/runtime/hooks/use-scheme.cjs.map +1 -0
  125. package/lib/cjs/runtime/hooks/use-scheme.d.ts +34 -0
  126. package/lib/cjs/runtime/index.cjs +45 -0
  127. package/lib/cjs/runtime/index.cjs.map +1 -0
  128. package/lib/cjs/runtime/index.d.ts +27 -0
  129. package/lib/cjs/runtime/interactive-box.cjs +35 -0
  130. package/lib/cjs/runtime/interactive-box.cjs.map +1 -0
  131. package/lib/cjs/runtime/interactive-box.d.ts +40 -0
  132. package/lib/cjs/runtime/lookup-css.cjs +542 -0
  133. package/lib/cjs/runtime/lookup-css.cjs.map +1 -0
  134. package/lib/cjs/runtime/lookup-css.d.ts +164 -0
  135. package/lib/cjs/runtime/types.d.ts +29 -0
  136. package/lib/cjs/testing/index.cjs +367 -0
  137. package/lib/cjs/testing/index.cjs.map +1 -0
  138. package/lib/cjs/testing/index.d.ts +145 -0
  139. package/lib/esm/core/parser/animation.d.ts +126 -0
  140. package/lib/esm/core/parser/animation.mjs +408 -0
  141. package/lib/esm/core/parser/animation.mjs.map +1 -0
  142. package/lib/esm/core/parser/border-dispatcher.d.ts +15 -0
  143. package/lib/esm/core/parser/border-dispatcher.mjs +178 -0
  144. package/lib/esm/core/parser/border-dispatcher.mjs.map +1 -0
  145. package/lib/esm/core/parser/case-convert.d.ts +6 -0
  146. package/lib/esm/core/parser/case-convert.mjs +13 -0
  147. package/lib/esm/core/parser/case-convert.mjs.map +1 -0
  148. package/lib/esm/core/parser/color-properties-dispatcher.d.ts +19 -0
  149. package/lib/esm/core/parser/color-properties-dispatcher.mjs +82 -0
  150. package/lib/esm/core/parser/color-properties-dispatcher.mjs.map +1 -0
  151. package/lib/esm/core/parser/color.d.ts +12 -0
  152. package/lib/esm/core/parser/color.mjs +162 -0
  153. package/lib/esm/core/parser/color.mjs.map +1 -0
  154. package/lib/esm/core/parser/constants.d.ts +8 -0
  155. package/lib/esm/core/parser/constants.mjs +13 -0
  156. package/lib/esm/core/parser/constants.mjs.map +1 -0
  157. package/lib/esm/core/parser/declaration.d.ts +15 -0
  158. package/lib/esm/core/parser/declaration.mjs +345 -0
  159. package/lib/esm/core/parser/declaration.mjs.map +1 -0
  160. package/lib/esm/core/parser/gradient.d.ts +59 -0
  161. package/lib/esm/core/parser/gradient.mjs +130 -0
  162. package/lib/esm/core/parser/gradient.mjs.map +1 -0
  163. package/lib/esm/core/parser/haptics.d.ts +47 -0
  164. package/lib/esm/core/parser/haptics.mjs +71 -0
  165. package/lib/esm/core/parser/haptics.mjs.map +1 -0
  166. package/lib/esm/core/parser/index.d.ts +8 -0
  167. package/lib/esm/core/parser/keyframes.d.ts +26 -0
  168. package/lib/esm/core/parser/keyframes.mjs +91 -0
  169. package/lib/esm/core/parser/keyframes.mjs.map +1 -0
  170. package/lib/esm/core/parser/layout-dispatcher.d.ts +14 -0
  171. package/lib/esm/core/parser/layout-dispatcher.mjs +98 -0
  172. package/lib/esm/core/parser/layout-dispatcher.mjs.map +1 -0
  173. package/lib/esm/core/parser/length.d.ts +48 -0
  174. package/lib/esm/core/parser/length.mjs +90 -0
  175. package/lib/esm/core/parser/length.mjs.map +1 -0
  176. package/lib/esm/core/parser/motion-dispatcher.d.ts +11 -0
  177. package/lib/esm/core/parser/motion-dispatcher.mjs +75 -0
  178. package/lib/esm/core/parser/motion-dispatcher.mjs.map +1 -0
  179. package/lib/esm/core/parser/property.d.ts +8 -0
  180. package/lib/esm/core/parser/property.mjs +20 -0
  181. package/lib/esm/core/parser/property.mjs.map +1 -0
  182. package/lib/esm/core/parser/safe-area.d.ts +39 -0
  183. package/lib/esm/core/parser/safe-area.mjs +402 -0
  184. package/lib/esm/core/parser/safe-area.mjs.map +1 -0
  185. package/lib/esm/core/parser/selector.d.ts +11 -0
  186. package/lib/esm/core/parser/selector.mjs +20 -0
  187. package/lib/esm/core/parser/selector.mjs.map +1 -0
  188. package/lib/esm/core/parser/shorthand.d.ts +61 -0
  189. package/lib/esm/core/parser/shorthand.mjs +148 -0
  190. package/lib/esm/core/parser/shorthand.mjs.map +1 -0
  191. package/lib/esm/core/parser/text-truncate.d.ts +44 -0
  192. package/lib/esm/core/parser/text-truncate.mjs +75 -0
  193. package/lib/esm/core/parser/text-truncate.mjs.map +1 -0
  194. package/lib/esm/core/parser/theme-vars.d.ts +61 -0
  195. package/lib/esm/core/parser/theme-vars.mjs +409 -0
  196. package/lib/esm/core/parser/theme-vars.mjs.map +1 -0
  197. package/lib/esm/core/parser/tokens.d.ts +45 -0
  198. package/lib/esm/core/parser/tokens.mjs +298 -0
  199. package/lib/esm/core/parser/tokens.mjs.map +1 -0
  200. package/lib/esm/core/parser/transform.d.ts +36 -0
  201. package/lib/esm/core/parser/transform.mjs +193 -0
  202. package/lib/esm/core/parser/transform.mjs.map +1 -0
  203. package/lib/esm/core/parser/tw-parser.d.ts +194 -0
  204. package/lib/esm/core/parser/tw-parser.mjs +1565 -0
  205. package/lib/esm/core/parser/tw-parser.mjs.map +1 -0
  206. package/lib/esm/core/parser/types.d.ts +37 -0
  207. package/lib/esm/core/parser/typography-dispatcher.d.ts +11 -0
  208. package/lib/esm/core/parser/typography-dispatcher.mjs +91 -0
  209. package/lib/esm/core/parser/typography-dispatcher.mjs.map +1 -0
  210. package/lib/esm/core/parser/typography.d.ts +43 -0
  211. package/lib/esm/core/parser/typography.mjs +91 -0
  212. package/lib/esm/core/parser/typography.mjs.map +1 -0
  213. package/lib/esm/core/style-builder/build-style.d.ts +54 -0
  214. package/lib/esm/core/style-builder/build-style.mjs +395 -0
  215. package/lib/esm/core/style-builder/build-style.mjs.map +1 -0
  216. package/lib/esm/core/style-builder/index.d.ts +3 -0
  217. package/lib/esm/core/style-builder/union-builder.d.ts +128 -0
  218. package/lib/esm/core/style-builder/union-builder.mjs +324 -0
  219. package/lib/esm/core/style-builder/union-builder.mjs.map +1 -0
  220. package/lib/esm/core/types.d.ts +14 -0
  221. package/lib/esm/metro/dts.d.ts +16 -0
  222. package/lib/esm/metro/dts.mjs +125 -0
  223. package/lib/esm/metro/dts.mjs.map +1 -0
  224. package/lib/esm/metro/index.d.ts +9 -0
  225. package/lib/esm/metro/index.mjs +6 -0
  226. package/lib/esm/metro/index.mjs.map +1 -0
  227. package/lib/esm/metro/resolver.d.ts +22 -0
  228. package/lib/esm/metro/resolver.mjs +43 -0
  229. package/lib/esm/metro/resolver.mjs.map +1 -0
  230. package/lib/esm/metro/state.d.ts +72 -0
  231. package/lib/esm/metro/state.mjs +243 -0
  232. package/lib/esm/metro/state.mjs.map +1 -0
  233. package/lib/esm/metro/transform-ast.d.ts +73 -0
  234. package/lib/esm/metro/transform-ast.mjs +1234 -0
  235. package/lib/esm/metro/transform-ast.mjs.map +1 -0
  236. package/lib/esm/metro/transformer.d.ts +47 -0
  237. package/lib/esm/metro/transformer.mjs +322 -0
  238. package/lib/esm/metro/transformer.mjs.map +1 -0
  239. package/lib/esm/metro/warn-unknown-classes.d.ts +21 -0
  240. package/lib/esm/metro/warn-unknown-classes.mjs +84 -0
  241. package/lib/esm/metro/warn-unknown-classes.mjs.map +1 -0
  242. package/lib/esm/metro/with-config.d.ts +57 -0
  243. package/lib/esm/metro/with-config.mjs +194 -0
  244. package/lib/esm/metro/with-config.mjs.map +1 -0
  245. package/lib/esm/runtime/chain-handlers.d.ts +33 -0
  246. package/lib/esm/runtime/chain-handlers.mjs +34 -0
  247. package/lib/esm/runtime/chain-handlers.mjs.map +1 -0
  248. package/lib/esm/runtime/components/rnwind-provider.d.ts +84 -0
  249. package/lib/esm/runtime/components/rnwind-provider.mjs +94 -0
  250. package/lib/esm/runtime/components/rnwind-provider.mjs.map +1 -0
  251. package/lib/esm/runtime/gradient-types.d.ts +58 -0
  252. package/lib/esm/runtime/haptics.d.ts +48 -0
  253. package/lib/esm/runtime/haptics.mjs +110 -0
  254. package/lib/esm/runtime/haptics.mjs.map +1 -0
  255. package/lib/esm/runtime/hooks/use-css.d.ts +11 -0
  256. package/lib/esm/runtime/hooks/use-css.mjs +19 -0
  257. package/lib/esm/runtime/hooks/use-css.mjs.map +1 -0
  258. package/lib/esm/runtime/hooks/use-interact.d.ts +42 -0
  259. package/lib/esm/runtime/hooks/use-interact.mjs +44 -0
  260. package/lib/esm/runtime/hooks/use-interact.mjs.map +1 -0
  261. package/lib/esm/runtime/hooks/use-scheme.d.ts +34 -0
  262. package/lib/esm/runtime/hooks/use-scheme.mjs +63 -0
  263. package/lib/esm/runtime/hooks/use-scheme.mjs.map +1 -0
  264. package/lib/esm/runtime/index.d.ts +27 -0
  265. package/lib/esm/runtime/index.mjs +18 -0
  266. package/lib/esm/runtime/index.mjs.map +1 -0
  267. package/lib/esm/runtime/interactive-box.d.ts +40 -0
  268. package/lib/esm/runtime/interactive-box.mjs +33 -0
  269. package/lib/esm/runtime/interactive-box.mjs.map +1 -0
  270. package/lib/esm/runtime/lookup-css.d.ts +164 -0
  271. package/lib/esm/runtime/lookup-css.mjs +531 -0
  272. package/lib/esm/runtime/lookup-css.mjs.map +1 -0
  273. package/lib/esm/runtime/types.d.ts +29 -0
  274. package/lib/esm/testing/index.d.ts +145 -0
  275. package/lib/esm/testing/index.mjs +344 -0
  276. package/lib/esm/testing/index.mjs.map +1 -0
  277. package/package.json +79 -13
  278. package/preset.css +1171 -0
  279. package/src/core/parser/animation.ts +404 -0
  280. package/src/core/parser/border-dispatcher.ts +176 -0
  281. package/src/core/parser/case-convert.ts +10 -0
  282. package/src/core/parser/color-properties-dispatcher.ts +78 -0
  283. package/src/core/parser/color.ts +157 -0
  284. package/src/core/parser/constants.ts +11 -0
  285. package/src/core/parser/declaration.ts +340 -0
  286. package/src/core/parser/gradient.ts +148 -0
  287. package/src/core/parser/haptics.ts +88 -0
  288. package/src/core/parser/index.ts +8 -0
  289. package/src/core/parser/keyframes.ts +84 -0
  290. package/src/core/parser/layout-dispatcher.ts +92 -0
  291. package/src/core/parser/length.ts +100 -0
  292. package/src/core/parser/motion-dispatcher.ts +89 -0
  293. package/src/core/parser/property.ts +15 -0
  294. package/src/core/parser/safe-area.ts +404 -0
  295. package/src/core/parser/selector.ts +17 -0
  296. package/src/core/parser/shorthand.ts +152 -0
  297. package/src/core/parser/text-truncate.ts +79 -0
  298. package/src/core/parser/theme-vars.ts +412 -0
  299. package/src/core/parser/tokens.ts +286 -0
  300. package/src/core/parser/transform.ts +195 -0
  301. package/src/core/parser/tw-parser.ts +1709 -0
  302. package/src/core/parser/types.ts +45 -0
  303. package/src/core/parser/typography-dispatcher.ts +83 -0
  304. package/src/core/parser/typography.ts +83 -0
  305. package/src/core/style-builder/build-style.ts +442 -0
  306. package/src/core/style-builder/index.ts +3 -0
  307. package/src/core/style-builder/union-builder.ts +328 -0
  308. package/src/core/types.ts +15 -0
  309. package/src/metro/dts.ts +128 -0
  310. package/src/metro/index.ts +9 -0
  311. package/src/metro/resolver.ts +42 -0
  312. package/src/metro/state.ts +257 -0
  313. package/src/metro/transform-ast.ts +1498 -0
  314. package/src/metro/transformer.ts +347 -0
  315. package/src/metro/warn-unknown-classes.ts +79 -0
  316. package/src/metro/with-config.ts +229 -0
  317. package/src/runtime/chain-handlers.ts +47 -0
  318. package/src/runtime/components/rnwind-provider.tsx +144 -0
  319. package/src/runtime/gradient-types.ts +60 -0
  320. package/src/runtime/haptics.ts +120 -0
  321. package/src/runtime/hooks/use-css.ts +16 -0
  322. package/src/runtime/hooks/use-interact.ts +65 -0
  323. package/src/runtime/hooks/use-scheme.ts +63 -0
  324. package/src/runtime/index.ts +54 -0
  325. package/src/runtime/interactive-box.tsx +57 -0
  326. package/src/runtime/lookup-css.ts +628 -0
  327. package/src/runtime/types.ts +32 -0
  328. package/src/testing/index.ts +507 -0
  329. package/src/types/tailwindcss-node.d.ts +33 -0
  330. package/src/index.ts +0 -1
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ var tokens = require('./tokens.cjs');
4
+
5
+ /**
6
+ * Haptic-atom extractor.
7
+ *
8
+ * rnwind's haptic utilities are declared in preset.css as `@utility`
9
+ * rules that write a single `--rnwind-haptic: <kind>[-<value>]` custom
10
+ * property. Lightningcss surfaces those custom-property writes on the
11
+ * style rule's declaration list; this module converts the raw marker
12
+ * text into a structured {@link HapticRequest} the transformer can
13
+ * hoist into JSX.
14
+ *
15
+ * Marker vocabulary:
16
+ *
17
+ * --rnwind-haptic: impact-Light | impact-Medium | impact-Heavy | impact-Soft | impact-Rigid;
18
+ * --rnwind-haptic: notification-Success | notification-Warning | notification-Error;
19
+ * --rnwind-haptic: selection;
20
+ *
21
+ * Everything else is returned as `null` so unknown markers don't leak
22
+ * into the transformer's map.
23
+ */
24
+ const IMPACT_STYLES = new Set(['Light', 'Medium', 'Heavy', 'Soft', 'Rigid']);
25
+ const NOTIFICATION_TYPES = new Set(['Success', 'Warning', 'Error']);
26
+ /**
27
+ * Parse the raw marker text (post-serialization) into a
28
+ * {@link HapticRequest}, or `null` when the token is unrecognised.
29
+ * Shape: `impact-<Style>`, `notification-<Type>`, or bare `selection`.
30
+ * @param text Trimmed marker text.
31
+ * @returns Haptic request, or null.
32
+ */
33
+ function parseMarker(text) {
34
+ if (text === 'selection')
35
+ return { kind: 'selection' };
36
+ if (text.startsWith('impact-')) {
37
+ const style = text.slice('impact-'.length);
38
+ if (IMPACT_STYLES.has(style))
39
+ return { kind: 'impact', style: style };
40
+ return null;
41
+ }
42
+ if (text.startsWith('notification-')) {
43
+ const typeText = text.slice('notification-'.length);
44
+ if (NOTIFICATION_TYPES.has(typeText)) {
45
+ return { kind: 'notification', type: typeText };
46
+ }
47
+ return null;
48
+ }
49
+ return null;
50
+ }
51
+ /**
52
+ * Inspect a rule's declaration list for a `--rnwind-haptic: <marker>`
53
+ * custom property and return the structured request. Returns `null`
54
+ * for rules that don't carry the marker.
55
+ * @param declarations Declarations from one lightningcss style rule.
56
+ * @returns Parsed haptic request, or null.
57
+ */
58
+ function detectHapticAtom(declarations) {
59
+ for (const decl of declarations) {
60
+ if (decl.property !== 'custom')
61
+ continue;
62
+ const custom = decl.value;
63
+ const name = typeof custom.name === 'string' ? custom.name : custom.name.name;
64
+ if (name !== '--rnwind-haptic')
65
+ continue;
66
+ const text = tokens.serializeTokens(custom.value ?? []).trim();
67
+ return parseMarker(text);
68
+ }
69
+ return null;
70
+ }
71
+
72
+ exports.detectHapticAtom = detectHapticAtom;
73
+ //# sourceMappingURL=haptics.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"haptics.cjs","sources":["../../../../../src/core/parser/haptics.ts"],"sourcesContent":["/**\n * Haptic-atom extractor.\n *\n * rnwind's haptic utilities are declared in preset.css as `@utility`\n * rules that write a single `--rnwind-haptic: <kind>[-<value>]` custom\n * property. Lightningcss surfaces those custom-property writes on the\n * style rule's declaration list; this module converts the raw marker\n * text into a structured {@link HapticRequest} the transformer can\n * hoist into JSX.\n *\n * Marker vocabulary:\n *\n * --rnwind-haptic: impact-Light | impact-Medium | impact-Heavy | impact-Soft | impact-Rigid;\n * --rnwind-haptic: notification-Success | notification-Warning | notification-Error;\n * --rnwind-haptic: selection;\n *\n * Everything else is returned as `null` so unknown markers don't leak\n * into the transformer's map.\n */\n\nimport type { Declaration as LcDeclaration, TokenOrValue } from 'lightningcss'\nimport { serializeTokens } from './tokens'\n\n/**\n * Structured haptic request the `onHaptics` callback receives. Union\n * members mirror `expo-haptics`'s three entry points 1:1 so consumers\n * can index directly into the enum (`Haptics.ImpactFeedbackStyle[req.style]`).\n */\nexport type HapticRequest =\n | { readonly kind: 'impact'; readonly style: 'Light' | 'Medium' | 'Heavy' | 'Soft' | 'Rigid' }\n | { readonly kind: 'notification'; readonly type: 'Success' | 'Warning' | 'Error' }\n | { readonly kind: 'selection' }\n\n/** When during a component's lifecycle the haptic was triggered. */\nexport type HapticTrigger = 'mount' | 'pressIn' | 'pressOut' | 'focus' | 'hover'\n\n/** User-provided callback fired by rnwind when a haptic atom resolves. */\nexport type OnHaptics = (request: HapticRequest, trigger: HapticTrigger) => void\n\nconst IMPACT_STYLES = new Set(['Light', 'Medium', 'Heavy', 'Soft', 'Rigid'] as const)\ntype ImpactStyle = 'Light' | 'Medium' | 'Heavy' | 'Soft' | 'Rigid'\nconst NOTIFICATION_TYPES = new Set(['Success', 'Warning', 'Error'] as const)\ntype NotificationType = 'Success' | 'Warning' | 'Error'\n\n/**\n * Parse the raw marker text (post-serialization) into a\n * {@link HapticRequest}, or `null` when the token is unrecognised.\n * Shape: `impact-<Style>`, `notification-<Type>`, or bare `selection`.\n * @param text Trimmed marker text.\n * @returns Haptic request, or null.\n */\nfunction parseMarker(text: string): HapticRequest | null {\n if (text === 'selection') return { kind: 'selection' }\n if (text.startsWith('impact-')) {\n const style = text.slice('impact-'.length)\n if (IMPACT_STYLES.has(style as ImpactStyle)) return { kind: 'impact', style: style as ImpactStyle }\n return null\n }\n if (text.startsWith('notification-')) {\n const typeText = text.slice('notification-'.length)\n if (NOTIFICATION_TYPES.has(typeText as NotificationType)) {\n return { kind: 'notification', type: typeText as NotificationType }\n }\n return null\n }\n return null\n}\n\n/**\n * Inspect a rule's declaration list for a `--rnwind-haptic: <marker>`\n * custom property and return the structured request. Returns `null`\n * for rules that don't carry the marker.\n * @param declarations Declarations from one lightningcss style rule.\n * @returns Parsed haptic request, or null.\n */\nfunction detectHapticAtom(declarations: readonly LcDeclaration[]): HapticRequest | null {\n for (const decl of declarations) {\n if (decl.property !== 'custom') continue\n const custom = decl.value as { name: { name: string } | string; value?: readonly TokenOrValue[] }\n const name = typeof custom.name === 'string' ? custom.name : custom.name.name\n if (name !== '--rnwind-haptic') continue\n const text = serializeTokens(custom.value ?? []).trim()\n return parseMarker(text)\n }\n return null\n}\n\nexport { detectHapticAtom }\n"],"names":["serializeTokens"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;AAkBG;AAqBH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAErF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAG5E;;;;;;AAMG;AACH,SAAS,WAAW,CAAC,IAAY,EAAA;IAC/B,IAAI,IAAI,KAAK,WAAW;AAAE,QAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE;AACtD,IAAA,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;AAC1C,QAAA,IAAI,aAAa,CAAC,GAAG,CAAC,KAAoB,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAoB,EAAE;AACnG,QAAA,OAAO,IAAI;IACb;AACA,IAAA,IAAI,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC;AACnD,QAAA,IAAI,kBAAkB,CAAC,GAAG,CAAC,QAA4B,CAAC,EAAE;YACxD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAA4B,EAAE;QACrE;AACA,QAAA,OAAO,IAAI;IACb;AACA,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMG;AACH,SAAS,gBAAgB,CAAC,YAAsC,EAAA;AAC9D,IAAA,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;AAC/B,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ;YAAE;AAChC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,KAA6E;QACjG,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI;QAC7E,IAAI,IAAI,KAAK,iBAAiB;YAAE;AAChC,QAAA,MAAM,IAAI,GAAGA,sBAAe,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;AACvD,QAAA,OAAO,WAAW,CAAC,IAAI,CAAC;IAC1B;AACA,IAAA,OAAO,IAAI;AACb;;;;"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Haptic-atom extractor.
3
+ *
4
+ * rnwind's haptic utilities are declared in preset.css as `@utility`
5
+ * rules that write a single `--rnwind-haptic: <kind>[-<value>]` custom
6
+ * property. Lightningcss surfaces those custom-property writes on the
7
+ * style rule's declaration list; this module converts the raw marker
8
+ * text into a structured {@link HapticRequest} the transformer can
9
+ * hoist into JSX.
10
+ *
11
+ * Marker vocabulary:
12
+ *
13
+ * --rnwind-haptic: impact-Light | impact-Medium | impact-Heavy | impact-Soft | impact-Rigid;
14
+ * --rnwind-haptic: notification-Success | notification-Warning | notification-Error;
15
+ * --rnwind-haptic: selection;
16
+ *
17
+ * Everything else is returned as `null` so unknown markers don't leak
18
+ * into the transformer's map.
19
+ */
20
+ import type { Declaration as LcDeclaration } from 'lightningcss';
21
+ /**
22
+ * Structured haptic request the `onHaptics` callback receives. Union
23
+ * members mirror `expo-haptics`'s three entry points 1:1 so consumers
24
+ * can index directly into the enum (`Haptics.ImpactFeedbackStyle[req.style]`).
25
+ */
26
+ export type HapticRequest = {
27
+ readonly kind: 'impact';
28
+ readonly style: 'Light' | 'Medium' | 'Heavy' | 'Soft' | 'Rigid';
29
+ } | {
30
+ readonly kind: 'notification';
31
+ readonly type: 'Success' | 'Warning' | 'Error';
32
+ } | {
33
+ readonly kind: 'selection';
34
+ };
35
+ /** When during a component's lifecycle the haptic was triggered. */
36
+ export type HapticTrigger = 'mount' | 'pressIn' | 'pressOut' | 'focus' | 'hover';
37
+ /** User-provided callback fired by rnwind when a haptic atom resolves. */
38
+ export type OnHaptics = (request: HapticRequest, trigger: HapticTrigger) => void;
39
+ /**
40
+ * Inspect a rule's declaration list for a `--rnwind-haptic: <marker>`
41
+ * custom property and return the structured request. Returns `null`
42
+ * for rules that don't carry the marker.
43
+ * @param declarations Declarations from one lightningcss style rule.
44
+ * @returns Parsed haptic request, or null.
45
+ */
46
+ declare function detectHapticAtom(declarations: readonly LcDeclaration[]): HapticRequest | null;
47
+ export { detectHapticAtom };
@@ -0,0 +1,8 @@
1
+ export { TailwindParser } from './tw-parser';
2
+ export type { TailwindParserConfig, ParseOptions, ParsedOutput, SchemedStyle, KeyframeBlock, KeyframeStep } from './tw-parser';
3
+ export type { SourceEntry } from '@tailwindcss/oxide';
4
+ export type { RNStyle, RNStyleValue, RNEntry, SafeAreaMarker } from './types';
5
+ export type { GradientAtomInfo, GradientDirection } from './gradient';
6
+ export type { TextTruncateInfo } from './text-truncate';
7
+ export type { HapticRequest, HapticTrigger, OnHaptics } from './haptics';
8
+ export { BASE_SCHEME } from './theme-vars';
@@ -0,0 +1,95 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Pull the first keyframe name out of a typed `animation` shorthand.
5
+ * @param animations Parsed animation shorthand entries.
6
+ * @returns First ident name, or `null`.
7
+ */
8
+ function firstAnimationName(animations) {
9
+ for (const animation of animations) {
10
+ if (animation.name.type === 'ident' || animation.name.type === 'string')
11
+ return animation.name.value;
12
+ }
13
+ return null;
14
+ }
15
+ /**
16
+ * Pull the first ident name from a typed `animation-name` longhand.
17
+ * @param names Animation-name list.
18
+ * @returns First name, or `null`.
19
+ */
20
+ function firstNameFromAnimationNames(names) {
21
+ for (const name of names) {
22
+ if ((name.type === 'ident' || name.type === 'string') && typeof name.value === 'string')
23
+ return name.value;
24
+ }
25
+ return null;
26
+ }
27
+ /**
28
+ * Extract the animation name of an `@keyframes` rule. lightningcss models
29
+ * the name as a discriminated union (`ident` / `custom`); both variants
30
+ * carry the same downstream string.
31
+ * @param raw lightningcss `KeyframesName`.
32
+ * @returns Animation name, or `null` when empty.
33
+ */
34
+ function keyframesName(raw) {
35
+ if (typeof raw.value !== 'string' || raw.value.length === 0)
36
+ return null;
37
+ return raw.value;
38
+ }
39
+ /**
40
+ * Render a keyframe step's selector list back to CSS-text (`'from'`,
41
+ * `'to'`, or `'50%'`). Timeline-range keyframe selectors (CSS Scroll /
42
+ * View Timelines) can't run in React Native — those steps are skipped.
43
+ * @param selectors Step selectors.
44
+ * @returns Step offset, or `null` when unrepresentable in RN.
45
+ */
46
+ function keyframeSelectorOffset(selectors) {
47
+ const [head] = selectors;
48
+ if (!head)
49
+ return null;
50
+ switch (head.type) {
51
+ case 'from': {
52
+ return 'from';
53
+ }
54
+ case 'to': {
55
+ return 'to';
56
+ }
57
+ case 'percentage': {
58
+ return `${head.value * 100}%`;
59
+ }
60
+ default: {
61
+ return null;
62
+ }
63
+ }
64
+ }
65
+ /**
66
+ * Extract the referenced `@keyframes` name from a declaration whose
67
+ * property is `animation-name` or a shorthand `animation` that names one.
68
+ * Returns the first ident found inside the value — Tailwind's animate-*
69
+ * utilities emit exactly one animation-name per rule.
70
+ * @param decl One declaration from a style rule.
71
+ * @returns Keyframe name, or `null` when the declaration doesn't reference one.
72
+ */
73
+ function pickAnimationName(decl) {
74
+ if (decl.property === 'animation')
75
+ return firstAnimationName(decl.value);
76
+ if (decl.property === 'animation-name')
77
+ return firstNameFromAnimationNames(decl.value);
78
+ if (decl.property !== 'unparsed')
79
+ return null;
80
+ const targetProperty = decl.value.propertyId.property;
81
+ if (targetProperty !== 'animation-name' && targetProperty !== 'animation')
82
+ return null;
83
+ for (const token of decl.value.value) {
84
+ if (token.type === 'token' && token.value.type === 'ident')
85
+ return token.value.value;
86
+ if (token.type === 'dashed-ident')
87
+ return token.value;
88
+ }
89
+ return null;
90
+ }
91
+
92
+ exports.keyframeSelectorOffset = keyframeSelectorOffset;
93
+ exports.keyframesName = keyframesName;
94
+ exports.pickAnimationName = pickAnimationName;
95
+ //# sourceMappingURL=keyframes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyframes.cjs","sources":["../../../../../src/core/parser/keyframes.ts"],"sourcesContent":["import type { Animation, Declaration as LcDeclaration, KeyframeSelector, KeyframesName } from 'lightningcss'\n\n/**\n * Pull the first keyframe name out of a typed `animation` shorthand.\n * @param animations Parsed animation shorthand entries.\n * @returns First ident name, or `null`.\n */\nfunction firstAnimationName(animations: readonly Animation[]): string | null {\n for (const animation of animations) {\n if (animation.name.type === 'ident' || animation.name.type === 'string') return animation.name.value\n }\n return null\n}\n\n/**\n * Pull the first ident name from a typed `animation-name` longhand.\n * @param names Animation-name list.\n * @returns First name, or `null`.\n */\nfunction firstNameFromAnimationNames(names: readonly { type: string; value?: string }[]): string | null {\n for (const name of names) {\n if ((name.type === 'ident' || name.type === 'string') && typeof name.value === 'string') return name.value\n }\n return null\n}\n\n/**\n * Extract the animation name of an `@keyframes` rule. lightningcss models\n * the name as a discriminated union (`ident` / `custom`); both variants\n * carry the same downstream string.\n * @param raw lightningcss `KeyframesName`.\n * @returns Animation name, or `null` when empty.\n */\nexport function keyframesName(raw: KeyframesName): string | null {\n if (typeof raw.value !== 'string' || raw.value.length === 0) return null\n return raw.value\n}\n\n/**\n * Render a keyframe step's selector list back to CSS-text (`'from'`,\n * `'to'`, or `'50%'`). Timeline-range keyframe selectors (CSS Scroll /\n * View Timelines) can't run in React Native — those steps are skipped.\n * @param selectors Step selectors.\n * @returns Step offset, or `null` when unrepresentable in RN.\n */\nexport function keyframeSelectorOffset(selectors: readonly KeyframeSelector[]): string | null {\n const [head] = selectors\n if (!head) return null\n switch (head.type) {\n case 'from': {\n return 'from'\n }\n case 'to': {\n return 'to'\n }\n case 'percentage': {\n return `${head.value * 100}%`\n }\n default: {\n return null\n }\n }\n}\n\n/**\n * Extract the referenced `@keyframes` name from a declaration whose\n * property is `animation-name` or a shorthand `animation` that names one.\n * Returns the first ident found inside the value — Tailwind's animate-*\n * utilities emit exactly one animation-name per rule.\n * @param decl One declaration from a style rule.\n * @returns Keyframe name, or `null` when the declaration doesn't reference one.\n */\nexport function pickAnimationName(decl: LcDeclaration): string | null {\n if (decl.property === 'animation') return firstAnimationName(decl.value)\n if (decl.property === 'animation-name') return firstNameFromAnimationNames(decl.value)\n if (decl.property !== 'unparsed') return null\n const targetProperty = decl.value.propertyId.property\n if (targetProperty !== 'animation-name' && targetProperty !== 'animation') return null\n for (const token of decl.value.value) {\n if (token.type === 'token' && token.value.type === 'ident') return token.value.value\n if (token.type === 'dashed-ident') return token.value\n }\n return null\n}\n"],"names":[],"mappings":";;AAEA;;;;AAIG;AACH,SAAS,kBAAkB,CAAC,UAAgC,EAAA;AAC1D,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;AAClC,QAAA,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK;IACtG;AACA,IAAA,OAAO,IAAI;AACb;AAEA;;;;AAIG;AACH,SAAS,2BAA2B,CAAC,KAAkD,EAAA;AACrF,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACxB,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,KAAK;IAC5G;AACA,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMG;AACG,SAAU,aAAa,CAAC,GAAkB,EAAA;AAC9C,IAAA,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;IACxE,OAAO,GAAG,CAAC,KAAK;AAClB;AAEA;;;;;;AAMG;AACG,SAAU,sBAAsB,CAAC,SAAsC,EAAA;AAC3E,IAAA,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS;AACxB,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,IAAI;AACtB,IAAA,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,MAAM,EAAE;AACX,YAAA,OAAO,MAAM;QACf;QACA,KAAK,IAAI,EAAE;AACT,YAAA,OAAO,IAAI;QACb;QACA,KAAK,YAAY,EAAE;AACjB,YAAA,OAAO,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG;QAC/B;QACA,SAAS;AACP,YAAA,OAAO,IAAI;QACb;;AAEJ;AAEA;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,IAAmB,EAAA;AACnD,IAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,WAAW;AAAE,QAAA,OAAO,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC;AACxE,IAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,gBAAgB;AAAE,QAAA,OAAO,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC;AACtF,IAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,UAAU;AAAE,QAAA,OAAO,IAAI;IAC7C,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ;AACrD,IAAA,IAAI,cAAc,KAAK,gBAAgB,IAAI,cAAc,KAAK,WAAW;AAAE,QAAA,OAAO,IAAI;IACtF,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AACpC,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO;AAAE,YAAA,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK;AACpF,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc;YAAE,OAAO,KAAK,CAAC,KAAK;IACvD;AACA,IAAA,OAAO,IAAI;AACb;;;;;;"}
@@ -0,0 +1,26 @@
1
+ import type { Declaration as LcDeclaration, KeyframeSelector, KeyframesName } from 'lightningcss';
2
+ /**
3
+ * Extract the animation name of an `@keyframes` rule. lightningcss models
4
+ * the name as a discriminated union (`ident` / `custom`); both variants
5
+ * carry the same downstream string.
6
+ * @param raw lightningcss `KeyframesName`.
7
+ * @returns Animation name, or `null` when empty.
8
+ */
9
+ export declare function keyframesName(raw: KeyframesName): string | null;
10
+ /**
11
+ * Render a keyframe step's selector list back to CSS-text (`'from'`,
12
+ * `'to'`, or `'50%'`). Timeline-range keyframe selectors (CSS Scroll /
13
+ * View Timelines) can't run in React Native — those steps are skipped.
14
+ * @param selectors Step selectors.
15
+ * @returns Step offset, or `null` when unrepresentable in RN.
16
+ */
17
+ export declare function keyframeSelectorOffset(selectors: readonly KeyframeSelector[]): string | null;
18
+ /**
19
+ * Extract the referenced `@keyframes` name from a declaration whose
20
+ * property is `animation-name` or a shorthand `animation` that names one.
21
+ * Returns the first ident found inside the value — Tailwind's animate-*
22
+ * utilities emit exactly one animation-name per rule.
23
+ * @param decl One declaration from a style rule.
24
+ * @returns Keyframe name, or `null` when the declaration doesn't reference one.
25
+ */
26
+ export declare function pickAnimationName(decl: LcDeclaration): string | null;
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Lower CSS alignment keywords to the strings RN accepts. CSS uses
5
+ * `start`/`end` while RN sticks with the legacy `flex-start`/`flex-end`.
6
+ * Shared between `align-items`, `align-self`, `align-content`, and
7
+ * `justify-content` — the lowering rule is identical for all four.
8
+ * @param css CSS keyword (`center` / `start` / `end` / `baseline` / `stretch`).
9
+ * @returns RN-compatible keyword.
10
+ */
11
+ function cssToRnAlignment(css) {
12
+ if (css === 'start')
13
+ return 'flex-start';
14
+ if (css === 'end')
15
+ return 'flex-end';
16
+ return css;
17
+ }
18
+ /** Alias kept for clarity at the call site. Identical lowering rule. */
19
+ const cssToRnJustify = cssToRnAlignment;
20
+ /**
21
+ * Map lightningcss's `align-items` / `align-self` / `align-content`
22
+ * value (typed as `{type: 'self-position' | 'baseline-position', value: …}`)
23
+ * to the RN keyword RN expects.
24
+ * @param value Typed alignment value.
25
+ * @returns RN alignment string, or `null` when unmappable.
26
+ */
27
+ function mapAlignKeyword(value) {
28
+ if (typeof value === 'string')
29
+ return cssToRnAlignment(value);
30
+ if (typeof value !== 'object' || value === null)
31
+ return null;
32
+ const tagged = value;
33
+ if (tagged.type === 'baseline-position')
34
+ return 'baseline';
35
+ if (typeof tagged.value === 'string')
36
+ return cssToRnAlignment(tagged.value);
37
+ // Bare-keyword variants like `{type: 'stretch'}` carry the keyword
38
+ // in the `type` field with no separate `value`.
39
+ if (tagged.type === 'stretch' || tagged.type === 'normal')
40
+ return cssToRnAlignment(tagged.type);
41
+ return null;
42
+ }
43
+ /**
44
+ * Map lightningcss's `justify-content` value to the RN keyword.
45
+ * @param value Typed justify value.
46
+ * @returns RN justify string, or `null` when unmappable.
47
+ */
48
+ function mapJustifyKeyword(value) {
49
+ if (typeof value === 'string')
50
+ return cssToRnJustify(value);
51
+ if (typeof value !== 'object' || value === null)
52
+ return null;
53
+ const tagged = value;
54
+ if (typeof tagged.value === 'string')
55
+ return cssToRnJustify(tagged.value);
56
+ return null;
57
+ }
58
+ /**
59
+ * Dispatch flexbox-layout declarations (flex-direction, flex-wrap,
60
+ * align-items, align-self, align-content, justify-content). Returns
61
+ * `null` for any property the dispatcher doesn't handle so the caller
62
+ * can fall through to its main switch.
63
+ *
64
+ * RN expects keyword-mapped strings: `flex-start` / `flex-end` instead
65
+ * of CSS's `start` / `end`. We do the lowering here.
66
+ * @param decl One lightningcss declaration.
67
+ * @returns RN entries when the property matched, else `null`.
68
+ */
69
+ function dispatchLayoutDeclaration(decl) {
70
+ switch (decl.property) {
71
+ case 'flex-direction': {
72
+ return [['flexDirection', String(decl.value)]];
73
+ }
74
+ case 'flex-wrap': {
75
+ return [['flexWrap', String(decl.value)]];
76
+ }
77
+ case 'align-items': {
78
+ const v = mapAlignKeyword(decl.value);
79
+ return v === null ? [] : [['alignItems', v]];
80
+ }
81
+ case 'align-self': {
82
+ const v = mapAlignKeyword(decl.value);
83
+ return v === null ? [] : [['alignSelf', v]];
84
+ }
85
+ case 'align-content': {
86
+ const v = mapAlignKeyword(decl.value);
87
+ return v === null ? [] : [['alignContent', v]];
88
+ }
89
+ case 'justify-content': {
90
+ const v = mapJustifyKeyword(decl.value);
91
+ return v === null ? [] : [['justifyContent', v]];
92
+ }
93
+ default: {
94
+ return null;
95
+ }
96
+ }
97
+ }
98
+
99
+ exports.dispatchLayoutDeclaration = dispatchLayoutDeclaration;
100
+ //# sourceMappingURL=layout-dispatcher.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-dispatcher.cjs","sources":["../../../../../src/core/parser/layout-dispatcher.ts"],"sourcesContent":["import type { Declaration as LcDeclaration } from 'lightningcss'\nimport type { RNEntry } from './types'\n\n/**\n * Lower CSS alignment keywords to the strings RN accepts. CSS uses\n * `start`/`end` while RN sticks with the legacy `flex-start`/`flex-end`.\n * Shared between `align-items`, `align-self`, `align-content`, and\n * `justify-content` — the lowering rule is identical for all four.\n * @param css CSS keyword (`center` / `start` / `end` / `baseline` / `stretch`).\n * @returns RN-compatible keyword.\n */\nfunction cssToRnAlignment(css: string): string {\n if (css === 'start') return 'flex-start'\n if (css === 'end') return 'flex-end'\n return css\n}\n\n/** Alias kept for clarity at the call site. Identical lowering rule. */\nconst cssToRnJustify = cssToRnAlignment\n\n/**\n * Map lightningcss's `align-items` / `align-self` / `align-content`\n * value (typed as `{type: 'self-position' | 'baseline-position', value: …}`)\n * to the RN keyword RN expects.\n * @param value Typed alignment value.\n * @returns RN alignment string, or `null` when unmappable.\n */\nfunction mapAlignKeyword(value: unknown): string | null {\n if (typeof value === 'string') return cssToRnAlignment(value)\n if (typeof value !== 'object' || value === null) return null\n const tagged = value as { type?: string; value?: string }\n if (tagged.type === 'baseline-position') return 'baseline'\n if (typeof tagged.value === 'string') return cssToRnAlignment(tagged.value)\n // Bare-keyword variants like `{type: 'stretch'}` carry the keyword\n // in the `type` field with no separate `value`.\n if (tagged.type === 'stretch' || tagged.type === 'normal') return cssToRnAlignment(tagged.type)\n return null\n}\n\n/**\n * Map lightningcss's `justify-content` value to the RN keyword.\n * @param value Typed justify value.\n * @returns RN justify string, or `null` when unmappable.\n */\nfunction mapJustifyKeyword(value: unknown): string | null {\n if (typeof value === 'string') return cssToRnJustify(value)\n if (typeof value !== 'object' || value === null) return null\n const tagged = value as { type?: string; value?: string }\n if (typeof tagged.value === 'string') return cssToRnJustify(tagged.value)\n return null\n}\n\n/**\n * Dispatch flexbox-layout declarations (flex-direction, flex-wrap,\n * align-items, align-self, align-content, justify-content). Returns\n * `null` for any property the dispatcher doesn't handle so the caller\n * can fall through to its main switch.\n *\n * RN expects keyword-mapped strings: `flex-start` / `flex-end` instead\n * of CSS's `start` / `end`. We do the lowering here.\n * @param decl One lightningcss declaration.\n * @returns RN entries when the property matched, else `null`.\n */\nexport function dispatchLayoutDeclaration(decl: LcDeclaration): readonly RNEntry[] | null {\n switch (decl.property) {\n case 'flex-direction': {\n return [['flexDirection', String(decl.value)]]\n }\n case 'flex-wrap': {\n return [['flexWrap', String(decl.value)]]\n }\n case 'align-items': {\n const v = mapAlignKeyword(decl.value)\n return v === null ? [] : [['alignItems', v]]\n }\n case 'align-self': {\n const v = mapAlignKeyword(decl.value)\n return v === null ? [] : [['alignSelf', v]]\n }\n case 'align-content': {\n const v = mapAlignKeyword(decl.value)\n return v === null ? [] : [['alignContent', v]]\n }\n case 'justify-content': {\n const v = mapJustifyKeyword(decl.value)\n return v === null ? [] : [['justifyContent', v]]\n }\n default: {\n return null\n }\n }\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;AAOG;AACH,SAAS,gBAAgB,CAAC,GAAW,EAAA;IACnC,IAAI,GAAG,KAAK,OAAO;AAAE,QAAA,OAAO,YAAY;IACxC,IAAI,GAAG,KAAK,KAAK;AAAE,QAAA,OAAO,UAAU;AACpC,IAAA,OAAO,GAAG;AACZ;AAEA;AACA,MAAM,cAAc,GAAG,gBAAgB;AAEvC;;;;;;AAMG;AACH,SAAS,eAAe,CAAC,KAAc,EAAA;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,gBAAgB,CAAC,KAAK,CAAC;AAC7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AAAE,QAAA,OAAO,IAAI;IAC5D,MAAM,MAAM,GAAG,KAA0C;AACzD,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAmB;AAAE,QAAA,OAAO,UAAU;AAC1D,IAAA,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC;;;IAG3E,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC;AAC/F,IAAA,OAAO,IAAI;AACb;AAEA;;;;AAIG;AACH,SAAS,iBAAiB,CAAC,KAAc,EAAA;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,cAAc,CAAC,KAAK,CAAC;AAC3D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AAAE,QAAA,OAAO,IAAI;IAC5D,MAAM,MAAM,GAAG,KAA0C;AACzD,IAAA,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC;AACzE,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;;;AAUG;AACG,SAAU,yBAAyB,CAAC,IAAmB,EAAA;AAC3D,IAAA,QAAQ,IAAI,CAAC,QAAQ;QACnB,KAAK,gBAAgB,EAAE;AACrB,YAAA,OAAO,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAChD;QACA,KAAK,WAAW,EAAE;AAChB,YAAA,OAAO,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C;QACA,KAAK,aAAa,EAAE;YAClB,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;AACrC,YAAA,OAAO,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;QAC9C;QACA,KAAK,YAAY,EAAE;YACjB,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;AACrC,YAAA,OAAO,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC7C;QACA,KAAK,eAAe,EAAE;YACpB,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;AACrC,YAAA,OAAO,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAChD;QACA,KAAK,iBAAiB,EAAE;YACtB,MAAM,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;AACvC,YAAA,OAAO,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;QAClD;QACA,SAAS;AACP,YAAA,OAAO,IAAI;QACb;;AAEJ;;;;"}
@@ -0,0 +1,14 @@
1
+ import type { Declaration as LcDeclaration } from 'lightningcss';
2
+ import type { RNEntry } from './types';
3
+ /**
4
+ * Dispatch flexbox-layout declarations (flex-direction, flex-wrap,
5
+ * align-items, align-self, align-content, justify-content). Returns
6
+ * `null` for any property the dispatcher doesn't handle so the caller
7
+ * can fall through to its main switch.
8
+ *
9
+ * RN expects keyword-mapped strings: `flex-start` / `flex-end` instead
10
+ * of CSS's `start` / `end`. We do the lowering here.
11
+ * @param decl One lightningcss declaration.
12
+ * @returns RN entries when the property matched, else `null`.
13
+ */
14
+ export declare function dispatchLayoutDeclaration(decl: LcDeclaration): readonly RNEntry[] | null;
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ var constants = require('./constants.cjs');
4
+
5
+ /**
6
+ * Round a percentage / length float to 4 decimal places so lightningcss's
7
+ * IEEE-754 noise (`0.237 → 0.23700000345…`) doesn't leak into RN style
8
+ * strings. 4 decimals is well below CSS subpixel precision.
9
+ * @param n Raw float.
10
+ * @returns Rounded float with trailing zeros trimmed.
11
+ */
12
+ function roundFloat(n) {
13
+ return Math.round(n * 10_000) / 10_000;
14
+ }
15
+ /**
16
+ * Convert a lightningcss `LengthValue` to a pixel number. Handles the
17
+ * units Tailwind emits: px, rem, em. Unknown units pass through as the
18
+ * raw numeric value so a later pass can warn.
19
+ * @param length Typed length value.
20
+ * @returns Pixel number.
21
+ */
22
+ function lengthToPx(length) {
23
+ switch (length.unit) {
24
+ case 'px': {
25
+ return length.value;
26
+ }
27
+ case 'rem':
28
+ case 'em': {
29
+ return length.value * constants.REM_TO_PX;
30
+ }
31
+ default: {
32
+ return length.value;
33
+ }
34
+ }
35
+ }
36
+ /**
37
+ * Collapse a `DimensionPercentageFor_LengthValue` to a number (pixel) or
38
+ * `'N%'` string. `calc()` variants are not evaluated here — they fall
39
+ * through to `null` so the caller can skip or serialize via tokens.
40
+ * @param value Typed dimension-or-percentage.
41
+ * @returns Number, percent string, or `null` when unrepresentable.
42
+ */
43
+ function dimensionPercentageToNumber(value) {
44
+ if (value.type === 'dimension')
45
+ return lengthToPx(value.value);
46
+ if (value.type === 'percentage')
47
+ return `${roundFloat(value.value * 100)}%`;
48
+ return null;
49
+ }
50
+ /**
51
+ * Convert `LengthPercentageOrAuto` (per-side value type for padding /
52
+ * margin / inset) to an RN scalar. `auto` maps to the string `'auto'`,
53
+ * which RN's margin accepts for centering; non-margin callers can filter
54
+ * it out if they need a number.
55
+ * @param value Typed length-percentage-or-auto.
56
+ * @returns RN scalar or `null` for unrepresentable shapes.
57
+ */
58
+ function lengthPercentageOrAutoToValue(value) {
59
+ if (value.type === 'auto')
60
+ return 'auto';
61
+ return dimensionPercentageToNumber(value.value);
62
+ }
63
+ /**
64
+ * Convert a lightningcss `Size` (used by width/height) or `MaxSize` (used
65
+ * by max-width/max-height) to an RN scalar. Sizing keywords with no RN
66
+ * analog (`min-content`, `fit-content`, `stretch`, …) fall through to
67
+ * `null` so the caller drops them.
68
+ * @param value Typed size value.
69
+ * @returns RN scalar or `null` when unrepresentable.
70
+ */
71
+ function sizeLikeToValue(value) {
72
+ if (value.type === 'auto' || value.type === 'none')
73
+ return value.type === 'auto' ? 'auto' : null;
74
+ if (value.type === 'length-percentage')
75
+ return dimensionPercentageToNumber(value.value);
76
+ return null;
77
+ }
78
+ /**
79
+ * Convert a lightningcss `GapValue` (per-axis gap, used by `row-gap` /
80
+ * `column-gap`) to an RN scalar. The `normal` keyword has no RN analog
81
+ * and falls through to `null`.
82
+ * @param value Typed gap value.
83
+ * @returns Number, percent string, or `null`.
84
+ */
85
+ function gapValueToValue(value) {
86
+ if (value.type === 'normal')
87
+ return null;
88
+ return dimensionPercentageToNumber(value.value);
89
+ }
90
+
91
+ exports.dimensionPercentageToNumber = dimensionPercentageToNumber;
92
+ exports.gapValueToValue = gapValueToValue;
93
+ exports.lengthPercentageOrAutoToValue = lengthPercentageOrAutoToValue;
94
+ exports.lengthToPx = lengthToPx;
95
+ exports.sizeLikeToValue = sizeLikeToValue;
96
+ //# sourceMappingURL=length.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"length.cjs","sources":["../../../../../src/core/parser/length.ts"],"sourcesContent":["import type {\n DimensionPercentageFor_LengthValue as LcDimensionPercentage,\n GapValue,\n LengthPercentageOrAuto,\n LengthValue,\n MaxSize,\n Size,\n} from 'lightningcss'\nimport { REM_TO_PX } from './constants'\n\n/** Alias for lightningcss's snake_case dimension-or-percentage type. */\ntype DimensionPercentage = LcDimensionPercentage\n\n/** RN-compatible length/percent result, or `null` when unrepresentable. */\ntype LengthResult = number | string | null\n\n/**\n * Round a percentage / length float to 4 decimal places so lightningcss's\n * IEEE-754 noise (`0.237 → 0.23700000345…`) doesn't leak into RN style\n * strings. 4 decimals is well below CSS subpixel precision.\n * @param n Raw float.\n * @returns Rounded float with trailing zeros trimmed.\n */\nfunction roundFloat(n: number): number {\n return Math.round(n * 10_000) / 10_000\n}\n\n/**\n * Convert a lightningcss `LengthValue` to a pixel number. Handles the\n * units Tailwind emits: px, rem, em. Unknown units pass through as the\n * raw numeric value so a later pass can warn.\n * @param length Typed length value.\n * @returns Pixel number.\n */\nexport function lengthToPx(length: LengthValue): number {\n switch (length.unit) {\n case 'px': {\n return length.value\n }\n case 'rem':\n case 'em': {\n return length.value * REM_TO_PX\n }\n default: {\n return length.value\n }\n }\n}\n\n/**\n * Collapse a `DimensionPercentageFor_LengthValue` to a number (pixel) or\n * `'N%'` string. `calc()` variants are not evaluated here — they fall\n * through to `null` so the caller can skip or serialize via tokens.\n * @param value Typed dimension-or-percentage.\n * @returns Number, percent string, or `null` when unrepresentable.\n */\nexport function dimensionPercentageToNumber(value: DimensionPercentage): LengthResult {\n if (value.type === 'dimension') return lengthToPx(value.value)\n if (value.type === 'percentage') return `${roundFloat(value.value * 100)}%`\n return null\n}\n\n/**\n * Convert `LengthPercentageOrAuto` (per-side value type for padding /\n * margin / inset) to an RN scalar. `auto` maps to the string `'auto'`,\n * which RN's margin accepts for centering; non-margin callers can filter\n * it out if they need a number.\n * @param value Typed length-percentage-or-auto.\n * @returns RN scalar or `null` for unrepresentable shapes.\n */\nexport function lengthPercentageOrAutoToValue(value: LengthPercentageOrAuto): LengthResult {\n if (value.type === 'auto') return 'auto'\n return dimensionPercentageToNumber(value.value)\n}\n\n/**\n * Convert a lightningcss `Size` (used by width/height) or `MaxSize` (used\n * by max-width/max-height) to an RN scalar. Sizing keywords with no RN\n * analog (`min-content`, `fit-content`, `stretch`, …) fall through to\n * `null` so the caller drops them.\n * @param value Typed size value.\n * @returns RN scalar or `null` when unrepresentable.\n */\nexport function sizeLikeToValue(value: Size | MaxSize): LengthResult {\n if (value.type === 'auto' || value.type === 'none') return value.type === 'auto' ? 'auto' : null\n if (value.type === 'length-percentage') return dimensionPercentageToNumber(value.value)\n return null\n}\n\n/**\n * Convert a lightningcss `GapValue` (per-axis gap, used by `row-gap` /\n * `column-gap`) to an RN scalar. The `normal` keyword has no RN analog\n * and falls through to `null`.\n * @param value Typed gap value.\n * @returns Number, percent string, or `null`.\n */\nexport function gapValueToValue(value: GapValue): LengthResult {\n if (value.type === 'normal') return null\n return dimensionPercentageToNumber(value.value)\n}\n"],"names":["REM_TO_PX"],"mappings":";;;;AAgBA;;;;;;AAMG;AACH,SAAS,UAAU,CAAC,CAAS,EAAA;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM;AACxC;AAEA;;;;;;AAMG;AACG,SAAU,UAAU,CAAC,MAAmB,EAAA;AAC5C,IAAA,QAAQ,MAAM,CAAC,IAAI;QACjB,KAAK,IAAI,EAAE;YACT,OAAO,MAAM,CAAC,KAAK;QACrB;AACA,QAAA,KAAK,KAAK;QACV,KAAK,IAAI,EAAE;AACT,YAAA,OAAO,MAAM,CAAC,KAAK,GAAGA,mBAAS;QACjC;QACA,SAAS;YACP,OAAO,MAAM,CAAC,KAAK;QACrB;;AAEJ;AAEA;;;;;;AAMG;AACG,SAAU,2BAA2B,CAAC,KAA0B,EAAA;AACpE,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW;AAAE,QAAA,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;AAC9D,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,CAAA,EAAG,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAA,CAAA,CAAG;AAC3E,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;;AAOG;AACG,SAAU,6BAA6B,CAAC,KAA6B,EAAA;AACzE,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;AAAE,QAAA,OAAO,MAAM;AACxC,IAAA,OAAO,2BAA2B,CAAC,KAAK,CAAC,KAAK,CAAC;AACjD;AAEA;;;;;;;AAOG;AACG,SAAU,eAAe,CAAC,KAAqB,EAAA;IACnD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;AAAE,QAAA,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI;AAChG,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB;AAAE,QAAA,OAAO,2BAA2B,CAAC,KAAK,CAAC,KAAK,CAAC;AACvF,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMG;AACG,SAAU,eAAe,CAAC,KAAe,EAAA;AAC7C,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;AACxC,IAAA,OAAO,2BAA2B,CAAC,KAAK,CAAC,KAAK,CAAC;AACjD;;;;;;;;"}
@@ -0,0 +1,48 @@
1
+ import type { DimensionPercentageFor_LengthValue as LcDimensionPercentage, GapValue, LengthPercentageOrAuto, LengthValue, MaxSize, Size } from 'lightningcss';
2
+ /** Alias for lightningcss's snake_case dimension-or-percentage type. */
3
+ type DimensionPercentage = LcDimensionPercentage;
4
+ /** RN-compatible length/percent result, or `null` when unrepresentable. */
5
+ type LengthResult = number | string | null;
6
+ /**
7
+ * Convert a lightningcss `LengthValue` to a pixel number. Handles the
8
+ * units Tailwind emits: px, rem, em. Unknown units pass through as the
9
+ * raw numeric value so a later pass can warn.
10
+ * @param length Typed length value.
11
+ * @returns Pixel number.
12
+ */
13
+ export declare function lengthToPx(length: LengthValue): number;
14
+ /**
15
+ * Collapse a `DimensionPercentageFor_LengthValue` to a number (pixel) or
16
+ * `'N%'` string. `calc()` variants are not evaluated here — they fall
17
+ * through to `null` so the caller can skip or serialize via tokens.
18
+ * @param value Typed dimension-or-percentage.
19
+ * @returns Number, percent string, or `null` when unrepresentable.
20
+ */
21
+ export declare function dimensionPercentageToNumber(value: DimensionPercentage): LengthResult;
22
+ /**
23
+ * Convert `LengthPercentageOrAuto` (per-side value type for padding /
24
+ * margin / inset) to an RN scalar. `auto` maps to the string `'auto'`,
25
+ * which RN's margin accepts for centering; non-margin callers can filter
26
+ * it out if they need a number.
27
+ * @param value Typed length-percentage-or-auto.
28
+ * @returns RN scalar or `null` for unrepresentable shapes.
29
+ */
30
+ export declare function lengthPercentageOrAutoToValue(value: LengthPercentageOrAuto): LengthResult;
31
+ /**
32
+ * Convert a lightningcss `Size` (used by width/height) or `MaxSize` (used
33
+ * by max-width/max-height) to an RN scalar. Sizing keywords with no RN
34
+ * analog (`min-content`, `fit-content`, `stretch`, …) fall through to
35
+ * `null` so the caller drops them.
36
+ * @param value Typed size value.
37
+ * @returns RN scalar or `null` when unrepresentable.
38
+ */
39
+ export declare function sizeLikeToValue(value: Size | MaxSize): LengthResult;
40
+ /**
41
+ * Convert a lightningcss `GapValue` (per-axis gap, used by `row-gap` /
42
+ * `column-gap`) to an RN scalar. The `normal` keyword has no RN analog
43
+ * and falls through to `null`.
44
+ * @param value Typed gap value.
45
+ * @returns Number, percent string, or `null`.
46
+ */
47
+ export declare function gapValueToValue(value: GapValue): LengthResult;
48
+ export {};
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ var animation = require('./animation.cjs');
4
+ var transform = require('./transform.cjs');
5
+
6
+ /**
7
+ * Dispatch motion-adjacent declarations (animation/transition/transform)
8
+ * to their typed handlers. Returns `null` when the declaration isn't
9
+ * one this dispatcher handles, so the caller can fall through to its
10
+ * main switch.
11
+ * @param decl One lightningcss declaration.
12
+ * @returns RN entries when the property matched, else `null`.
13
+ */
14
+ function dispatchMotionDeclaration(decl) {
15
+ switch (decl.property) {
16
+ case 'animation': {
17
+ return animation.animationShorthandToEntries(decl.value);
18
+ }
19
+ case 'animation-name': {
20
+ return animation.animationNameEntries(decl.value);
21
+ }
22
+ case 'animation-duration': {
23
+ return animation.animationDurationEntries(decl.value);
24
+ }
25
+ case 'animation-timing-function': {
26
+ return animation.animationTimingFunctionEntries(decl.value);
27
+ }
28
+ case 'animation-iteration-count': {
29
+ return animation.animationIterationCountEntries(decl.value);
30
+ }
31
+ case 'animation-delay': {
32
+ return animation.animationDelayEntries(decl.value);
33
+ }
34
+ case 'animation-direction': {
35
+ return animation.animationDirectionEntries(decl.value);
36
+ }
37
+ case 'animation-fill-mode': {
38
+ return animation.animationFillModeEntries(decl.value);
39
+ }
40
+ case 'animation-play-state': {
41
+ return animation.animationPlayStateEntries(decl.value);
42
+ }
43
+ case 'transition': {
44
+ return animation.transitionShorthandToEntries(decl.value);
45
+ }
46
+ case 'transition-property': {
47
+ return animation.transitionPropertyEntries(decl.value);
48
+ }
49
+ case 'transition-duration': {
50
+ return animation.transitionDurationEntries(decl.value);
51
+ }
52
+ case 'transition-timing-function': {
53
+ return animation.transitionTimingFunctionEntries(decl.value);
54
+ }
55
+ case 'transition-delay': {
56
+ return animation.transitionDelayEntries(decl.value);
57
+ }
58
+ case 'transform': {
59
+ return transform.transformFunctionsToEntries(decl.value);
60
+ }
61
+ case 'rotate': {
62
+ return transform.rotateToEntries(decl.value);
63
+ }
64
+ case 'translate': {
65
+ return transform.translateToEntries(decl.value);
66
+ }
67
+ case 'scale': {
68
+ return transform.scaleToEntries(decl.value);
69
+ }
70
+ default: {
71
+ return null;
72
+ }
73
+ }
74
+ }
75
+
76
+ exports.dispatchMotionDeclaration = dispatchMotionDeclaration;
77
+ //# sourceMappingURL=motion-dispatcher.cjs.map