react-native-css 3.0.0-nightly.26b272f → 3.0.0-nightly.46bc0ab

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 (331) hide show
  1. package/dist/commonjs/compiler/atRules.js +15 -2
  2. package/dist/commonjs/compiler/atRules.js.map +1 -1
  3. package/dist/commonjs/compiler/declarations.js +103 -80
  4. package/dist/commonjs/compiler/declarations.js.map +1 -1
  5. package/dist/commonjs/compiler/keyframes.js +1 -1
  6. package/dist/commonjs/compiler/keyframes.js.map +1 -1
  7. package/dist/commonjs/compiler/stylesheet.js +14 -8
  8. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  9. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  10. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  11. package/dist/commonjs/components/Button.js +22 -0
  12. package/dist/commonjs/components/Button.js.map +1 -0
  13. package/dist/commonjs/components/FlatList.js +19 -0
  14. package/dist/commonjs/components/FlatList.js.map +1 -0
  15. package/dist/commonjs/components/Image.js +17 -0
  16. package/dist/commonjs/components/Image.js.map +1 -0
  17. package/dist/commonjs/components/TextInput.js +17 -0
  18. package/dist/commonjs/components/TextInput.js.map +1 -0
  19. package/dist/commonjs/components/index.js +40 -0
  20. package/dist/commonjs/components/index.js.map +1 -1
  21. package/dist/commonjs/jest/index.js +21 -14
  22. package/dist/commonjs/jest/index.js.map +1 -1
  23. package/dist/commonjs/runtime/native/conditions/media-query.js +2 -0
  24. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  25. package/dist/commonjs/runtime/native/injection.js +19 -18
  26. package/dist/commonjs/runtime/native/injection.js.map +1 -1
  27. package/dist/commonjs/runtime/native/react/rules.js +13 -8
  28. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  29. package/dist/commonjs/runtime/native/react/useNativeCss.js +2 -2
  30. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
  31. package/dist/commonjs/runtime/native/reanimated.js +17 -0
  32. package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
  33. package/dist/commonjs/runtime/native/styles/calculate-props.js +5 -2
  34. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  35. package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
  36. package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
  37. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
  38. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
  39. package/dist/commonjs/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
  40. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
  41. package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
  42. package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
  43. package/dist/commonjs/runtime/native/styles/functions/index.js +61 -0
  44. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
  45. package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
  46. package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
  47. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +83 -0
  48. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
  49. package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
  50. package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
  51. package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  52. package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
  53. package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +5 -36
  54. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
  55. package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
  56. package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
  57. package/dist/commonjs/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +3 -3
  58. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  59. package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
  60. package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
  61. package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
  62. package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  63. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
  64. package/dist/commonjs/runtime/native/styles/units.js +1 -1
  65. package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
  66. package/dist/commonjs/runtime/utils/objects.js +14 -6
  67. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  68. package/dist/module/compiler/atRules.js +15 -2
  69. package/dist/module/compiler/atRules.js.map +1 -1
  70. package/dist/module/compiler/compiler.types.js.map +1 -1
  71. package/dist/module/compiler/declarations.js +100 -77
  72. package/dist/module/compiler/declarations.js.map +1 -1
  73. package/dist/module/compiler/keyframes.js +1 -1
  74. package/dist/module/compiler/keyframes.js.map +1 -1
  75. package/dist/module/compiler/stylesheet.js +14 -8
  76. package/dist/module/compiler/stylesheet.js.map +1 -1
  77. package/dist/module/components/ActivityIndicator.js +17 -0
  78. package/dist/module/components/ActivityIndicator.js.map +1 -0
  79. package/dist/module/components/Button.js +17 -0
  80. package/dist/module/components/Button.js.map +1 -0
  81. package/dist/module/components/FlatList.js +14 -0
  82. package/dist/module/components/FlatList.js.map +1 -0
  83. package/dist/module/components/Image.js +12 -0
  84. package/dist/module/components/Image.js.map +1 -0
  85. package/dist/module/components/TextInput.js +12 -0
  86. package/dist/module/components/TextInput.js.map +1 -0
  87. package/dist/module/components/index.js +5 -0
  88. package/dist/module/components/index.js.map +1 -1
  89. package/dist/module/jest/index.js +20 -14
  90. package/dist/module/jest/index.js.map +1 -1
  91. package/dist/module/runtime/native/conditions/media-query.js +2 -0
  92. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  93. package/dist/module/runtime/native/injection.js +19 -18
  94. package/dist/module/runtime/native/injection.js.map +1 -1
  95. package/dist/module/runtime/native/react/rules.js +13 -8
  96. package/dist/module/runtime/native/react/rules.js.map +1 -1
  97. package/dist/module/runtime/native/react/useNativeCss.js +1 -1
  98. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
  99. package/dist/module/runtime/native/reanimated.js +13 -0
  100. package/dist/module/runtime/native/reanimated.js.map +1 -0
  101. package/dist/module/runtime/native/styles/calculate-props.js +6 -3
  102. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  103. package/dist/module/runtime/native/styles/defaults.js +1 -1
  104. package/dist/module/runtime/native/styles/defaults.js.map +1 -1
  105. package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
  106. package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
  107. package/dist/module/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
  108. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
  109. package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
  110. package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
  111. package/dist/module/runtime/native/styles/functions/index.js +8 -0
  112. package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
  113. package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
  114. package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
  115. package/dist/module/runtime/native/styles/functions/transform-functions.js +76 -0
  116. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
  117. package/dist/module/runtime/native/styles/resolve.js +20 -44
  118. package/dist/module/runtime/native/styles/resolve.js.map +1 -1
  119. package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  120. package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
  121. package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
  122. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
  123. package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
  124. package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
  125. package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +2 -2
  126. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  127. package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
  128. package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
  129. package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
  130. package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  131. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
  132. package/dist/module/runtime/native/styles/units.js +1 -1
  133. package/dist/module/runtime/native/styles/units.js.map +1 -1
  134. package/dist/module/runtime/utils/objects.js +14 -6
  135. package/dist/module/runtime/utils/objects.js.map +1 -1
  136. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
  137. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +1 -3
  138. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  139. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +9 -9
  140. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  141. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  142. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
  143. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  144. package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
  145. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  146. package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
  147. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  148. package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
  149. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  150. package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
  151. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  152. package/dist/typescript/commonjs/src/components/index.d.ts +5 -0
  153. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
  154. package/dist/typescript/commonjs/src/jest/index.d.ts +11 -1
  155. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  156. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
  157. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
  158. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
  159. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  160. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
  161. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
  162. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  163. package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
  164. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  165. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  166. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
  167. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  168. package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  169. package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  170. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +6 -0
  171. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  172. package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  173. package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  174. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  175. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  176. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
  177. package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  178. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  180. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  182. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  184. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  186. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  188. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  190. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  192. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
  193. package/dist/typescript/module/src/compiler/compiler.types.d.ts +1 -3
  194. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  195. package/dist/typescript/module/src/compiler/declarations.d.ts +9 -9
  196. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  197. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  198. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
  199. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  200. package/dist/typescript/module/src/components/Button.d.ts +13 -0
  201. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  202. package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
  203. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  204. package/dist/typescript/module/src/components/Image.d.ts +8 -0
  205. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  206. package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
  207. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  208. package/dist/typescript/module/src/components/index.d.ts +5 -0
  209. package/dist/typescript/module/src/components/index.d.ts.map +1 -1
  210. package/dist/typescript/module/src/jest/index.d.ts +11 -1
  211. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  212. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
  213. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
  214. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
  215. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  216. package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
  217. package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
  218. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  219. package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
  220. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  221. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  222. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
  223. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  224. package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  225. package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  226. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +6 -0
  227. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  228. package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  229. package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  230. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  231. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  232. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
  233. package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  234. package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  235. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  236. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  237. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  238. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  239. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  240. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  241. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  242. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  243. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  244. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  245. package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  246. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  247. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  248. package/package.json +1 -1
  249. package/src/compiler/atRules.ts +16 -2
  250. package/src/compiler/compiler.types.ts +1 -3
  251. package/src/compiler/declarations.ts +182 -95
  252. package/src/compiler/keyframes.ts +1 -1
  253. package/src/compiler/stylesheet.ts +17 -7
  254. package/src/components/ActivityIndicator.tsx +27 -0
  255. package/src/components/Button.tsx +22 -0
  256. package/src/components/FlatList.tsx +21 -0
  257. package/src/components/Image.tsx +17 -0
  258. package/src/components/TextInput.tsx +17 -0
  259. package/src/components/index.tsx +5 -0
  260. package/src/jest/index.ts +22 -13
  261. package/src/runtime/native/conditions/media-query.ts +2 -0
  262. package/src/runtime/native/injection.ts +31 -30
  263. package/src/runtime/native/react/rules.ts +14 -5
  264. package/src/runtime/native/react/useNativeCss.ts +1 -1
  265. package/src/runtime/native/reanimated.ts +22 -0
  266. package/src/runtime/native/styles/calculate-props.ts +4 -3
  267. package/src/runtime/native/styles/defaults.ts +1 -0
  268. package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
  269. package/src/runtime/native/styles/{calc.ts → functions/calc.ts} +2 -2
  270. package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
  271. package/src/runtime/native/styles/functions/index.ts +5 -0
  272. package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
  273. package/src/runtime/native/styles/functions/transform-functions.ts +51 -0
  274. package/src/runtime/native/styles/resolve.ts +20 -63
  275. package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
  276. package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -63
  277. package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
  278. package/src/runtime/native/styles/{box-shadow.ts → shorthands/box-shadow.ts} +3 -3
  279. package/src/runtime/native/styles/shorthands/index.ts +5 -0
  280. package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
  281. package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +1 -1
  282. package/src/runtime/native/styles/units.ts +1 -1
  283. package/src/runtime/utils/objects.ts +14 -4
  284. package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
  285. package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
  286. package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
  287. package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
  288. package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
  289. package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
  290. package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
  291. package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
  292. package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
  293. package/dist/module/runtime/native/styles/animation.js.map +0 -1
  294. package/dist/module/runtime/native/styles/border.js.map +0 -1
  295. package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
  296. package/dist/module/runtime/native/styles/calc.js.map +0 -1
  297. package/dist/module/runtime/native/styles/filters.js.map +0 -1
  298. package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
  299. package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
  300. package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
  301. package/dist/module/runtime/native/styles/transform.js.map +0 -1
  302. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
  303. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
  304. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
  305. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
  306. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
  307. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  308. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
  309. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
  310. package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
  311. package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  312. package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  313. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
  314. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  315. package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
  316. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
  317. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
  318. package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
  319. package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
  320. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
  321. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  322. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
  323. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
  324. package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
  325. package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  326. package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  327. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
  328. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  329. package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
  330. /package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
  331. /package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
@@ -62,12 +62,16 @@ const propertyRename: Record<string, string> = {
62
62
  "background-image": "experimental_backgroundImage",
63
63
  };
64
64
 
65
+ // TODO: We need a better way to handle this
65
66
  const unparsedRuntimeParsing = new Set([
66
67
  "animation",
68
+ "border",
69
+ "box-shadow",
67
70
  "text-shadow",
68
71
  "transform",
69
- "box-shadow",
70
- "border",
72
+ "scale",
73
+ "rotate",
74
+ "translate",
71
75
  ]);
72
76
 
73
77
  const parsers: {
@@ -142,7 +146,7 @@ const parsers: {
142
146
  "border-width": parseBorderWidth,
143
147
  "bottom": parseSizeDeclaration,
144
148
  "box-shadow": parseBoxShadow,
145
- "caret-color": parseColorOrAuto,
149
+ "caret-color": parseColorOrAutoDeclaration,
146
150
  "color": parseFontColorDeclaration,
147
151
  "column-gap": parseGap,
148
152
  "container": parseContainer,
@@ -263,9 +267,9 @@ export function parseDeclaration(
263
267
  }
264
268
 
265
269
  if (declaration.property === "unparsed") {
266
- parseDeclarationUnparsed(declaration, builder);
270
+ parseUnparsedDeclaration(declaration, builder);
267
271
  } else if (declaration.property === "custom") {
268
- parseDeclarationCustom(declaration, builder);
272
+ parseCustomDeclaration(declaration, builder);
269
273
  } else {
270
274
  parseWithParser(declaration, builder);
271
275
  }
@@ -666,22 +670,22 @@ function parseTransform(
666
670
  ) {
667
671
  builder.addDescriptor("transform", [
668
672
  {},
669
- "@transform",
673
+ "transform",
670
674
  value.flatMap((t): StyleDescriptor[] => {
671
675
  switch (t.type) {
672
676
  case "perspective":
673
- return [[{}, "@perspective", parseLength(t.value, builder)]];
677
+ return [[{}, "perspective", parseLength(t.value, builder)]];
674
678
  case "translate":
675
679
  return [
676
680
  [
677
681
  {},
678
- "@translateX",
682
+ "translateX",
679
683
  parseLengthOrCoercePercentageToRuntime(t.value[0], builder),
680
684
  ],
681
685
  [
682
686
  [
683
687
  {},
684
- "@translateY",
688
+ "translateY",
685
689
  parseLengthOrCoercePercentageToRuntime(t.value[1], builder),
686
690
  ],
687
691
  ],
@@ -690,7 +694,7 @@ function parseTransform(
690
694
  return [
691
695
  [
692
696
  {},
693
- "@translateX",
697
+ "translateX",
694
698
  parseLengthOrCoercePercentageToRuntime(t.value, builder),
695
699
  ],
696
700
  ];
@@ -698,22 +702,22 @@ function parseTransform(
698
702
  return [
699
703
  [
700
704
  {},
701
- "@translateY",
705
+ "translateY",
702
706
  parseLengthOrCoercePercentageToRuntime(t.value, builder),
703
707
  ],
704
708
  ];
705
709
  case "rotate":
706
- return [[{}, "@rotate", parseAngle(t.value, builder)]];
710
+ return [[{}, "rotate", parseAngle(t.value, builder)]];
707
711
  case "rotateX":
708
- return [[{}, "@rotateX", parseAngle(t.value, builder)]];
712
+ return [[{}, "rotateX", parseAngle(t.value, builder)]];
709
713
  case "rotateY":
710
- return [[{}, "@rotateY", parseAngle(t.value, builder)]];
714
+ return [[{}, "rotateY", parseAngle(t.value, builder)]];
711
715
  case "rotateZ":
712
- return [[{}, "@rotateZ", parseAngle(t.value, builder)]];
716
+ return [[{}, "rotateZ", parseAngle(t.value, builder)]];
713
717
  case "scale":
714
718
  return [
715
- [{}, "@scaleX", parseLength(t.value[0], builder)],
716
- [{}, "@scaleY", parseLength(t.value[1], builder)],
719
+ [{}, "scaleX", parseLength(t.value[0], builder)],
720
+ [{}, "scaleY", parseLength(t.value[1], builder)],
717
721
  ];
718
722
  case "scaleX":
719
723
  return [[{}, "scaleX", parseLength(t.value, builder)]];
@@ -762,21 +766,29 @@ function parseRotate(
762
766
  { value }: DeclarationType<"rotate">,
763
767
  builder: StylesheetBuilder,
764
768
  ) {
765
- builder.addDescriptor("rotateX", [
766
- {},
767
- "rotateX",
768
- parseAngle(value.x, builder),
769
- ]);
770
- builder.addDescriptor("rotateY", [
771
- {},
772
- "rotateY",
773
- parseAngle(value.y, builder),
774
- ]);
775
- builder.addDescriptor("rotateZ", [
776
- {},
777
- "rotateZ",
778
- parseAngle(value.z, builder),
779
- ]);
769
+ if (value.x) {
770
+ builder.addDescriptor("rotateX", [
771
+ {},
772
+ "rotateX",
773
+ parseAngle(value.angle, builder),
774
+ ]);
775
+ }
776
+
777
+ if (value.y) {
778
+ builder.addDescriptor("rotateY", [
779
+ {},
780
+ "rotateY",
781
+ parseAngle(value.angle, builder),
782
+ ]);
783
+ }
784
+
785
+ if (value.z) {
786
+ builder.addDescriptor("rotateZ", [
787
+ {},
788
+ "rotateZ",
789
+ parseAngle(value.angle, builder),
790
+ ]);
791
+ }
780
792
  }
781
793
 
782
794
  function parseScale(
@@ -853,7 +865,11 @@ function parseZIndex(
853
865
  }
854
866
  }
855
867
 
856
- function parseContainerType(_value: unknown, _builder: StylesheetBuilder) {
868
+ function parseContainerType(
869
+ _declaration: DeclarationType<"container-type">,
870
+ builder: StylesheetBuilder,
871
+ ) {
872
+ builder.addContainer(["___default___"]);
857
873
  return;
858
874
  }
859
875
 
@@ -873,7 +889,7 @@ function parseContainer(
873
889
  return;
874
890
  }
875
891
 
876
- export function parseDeclarationUnparsed(
892
+ export function parseUnparsedDeclaration(
877
893
  declaration: Extract<Declaration, { property: "unparsed" }>,
878
894
  builder: StylesheetBuilder,
879
895
  ) {
@@ -900,24 +916,15 @@ export function parseDeclarationUnparsed(
900
916
  builder.descriptorProperty = property;
901
917
 
902
918
  if (unparsedRuntimeParsing.has(property)) {
903
- const args = parseUnparsed(declaration.value.value, builder);
919
+ const args = parseUnparsed(declaration.value.value, builder, property);
904
920
 
905
921
  if (property === "animation") {
906
- builder.addDescriptor("animation", [
907
- {},
908
- `@${toRNProperty(property)}`,
909
- args,
910
- ]);
922
+ builder.addDescriptor("animation", [{}, property, args]);
911
923
  } else {
912
- builder.addDescriptor(property, [
913
- {},
914
- `@${toRNProperty(property)}`,
915
- args,
916
- 1,
917
- ]);
924
+ builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
918
925
  }
919
926
  } else {
920
- const value = parseUnparsed(declaration.value.value, builder);
927
+ const value = parseUnparsed(declaration.value.value, builder, property);
921
928
 
922
929
  builder.addDescriptor(property, value);
923
930
 
@@ -931,26 +938,31 @@ export function parseDeclarationUnparsed(
931
938
  }
932
939
  }
933
940
 
934
- export function parseDeclarationCustom(
941
+ export function parseCustomDeclaration(
935
942
  declaration: Extract<Declaration, { property: "custom" }>,
936
943
  builder: StylesheetBuilder,
937
944
  ) {
938
945
  const property = declaration.value.name;
939
- if (
946
+
947
+ if (property === "-webkit-line-clamp") {
948
+ builder.addDescriptor(
949
+ property,
950
+ parseUnparsed(declaration.value.value, builder, property),
951
+ );
952
+ } else if (property === "-rn-ripple-style") {
953
+ builder.addDescriptor(
954
+ property,
955
+ parseUnparsed(declaration.value.value, builder, property) ===
956
+ "borderless",
957
+ );
958
+ } else if (
940
959
  validProperties.has(property) ||
941
960
  property.startsWith("--") ||
942
961
  property.startsWith("-rn-")
943
962
  ) {
944
- builder.setWarningProperty(property);
945
963
  builder.addDescriptor(
946
964
  property,
947
- parseUnparsed(declaration.value.value, builder, allowAuto.has(property)),
948
- );
949
- } else if (property === "-webkit-line-clamp") {
950
- builder.addMapping({ [property]: ["numberOfLines"] });
951
- builder.addDescriptor(
952
- property,
953
- parseUnparsed(declaration.value.value, builder, allowAuto.has(property)),
965
+ parseUnparsed(declaration.value.value, builder, property),
954
966
  );
955
967
  } else {
956
968
  builder.addWarning("property", declaration.value.name);
@@ -960,9 +972,13 @@ export function parseDeclarationCustom(
960
972
  export function reduceParseUnparsed(
961
973
  tokenOrValues: TokenOrValue[],
962
974
  builder: StylesheetBuilder,
975
+ property: string,
976
+ allowAuto: boolean,
963
977
  ): StyleDescriptor {
964
978
  const result = tokenOrValues
965
- .map((tokenOrValue) => parseUnparsed(tokenOrValue, builder))
979
+ .map((tokenOrValue) =>
980
+ parseUnparsed(tokenOrValue, builder, property, allowAuto),
981
+ )
966
982
  .filter((v) => v !== undefined);
967
983
 
968
984
  if (result.length === 0) {
@@ -981,6 +997,8 @@ export function reduceParseUnparsed(
981
997
  }
982
998
  }
983
999
 
1000
+ // Groups are the tokens grouped together by comma location
1001
+ // If a group only has 1 item, it shouldn't be an array
984
1002
  groups = groups.flatMap((group): StyleDescriptor[] => {
985
1003
  if (!Array.isArray(group)) {
986
1004
  return [];
@@ -996,6 +1014,17 @@ export function reduceParseUnparsed(
996
1014
  } else {
997
1015
  return [first];
998
1016
  }
1017
+ } else if (
1018
+ // This is a special case for <ratio> values
1019
+ group.includes("/") &&
1020
+ group.every((item) =>
1021
+ typeof item === "string" && item === "/"
1022
+ ? item
1023
+ : typeof item === "number",
1024
+ )
1025
+ ) {
1026
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
1027
+ return [group.join(" ")];
999
1028
  } else {
1000
1029
  return [group];
1001
1030
  }
@@ -1007,11 +1036,13 @@ export function reduceParseUnparsed(
1007
1036
  export function unparsedFunction(
1008
1037
  token: Extract<TokenOrValue, { type: "function" }>,
1009
1038
  builder: StylesheetBuilder,
1039
+ property: string,
1040
+ allowAuto: boolean,
1010
1041
  ): StyleFunction {
1011
1042
  return [
1012
1043
  {},
1013
- token.value.name,
1014
- reduceParseUnparsed(token.value.arguments, builder),
1044
+ toRNProperty(token.value.name),
1045
+ reduceParseUnparsed(token.value.arguments, builder, property, allowAuto),
1015
1046
  ];
1016
1047
  }
1017
1048
 
@@ -1028,7 +1059,8 @@ export function parseUnparsed(
1028
1059
  | undefined
1029
1060
  | null,
1030
1061
  builder: StylesheetBuilder,
1031
- allowAuto = false,
1062
+ property: string,
1063
+ allowAuto = allowAutoProperties.has(property),
1032
1064
  ): StyleDescriptor {
1033
1065
  if (tokenOrValue === undefined || tokenOrValue === null) {
1034
1066
  return;
@@ -1051,7 +1083,12 @@ export function parseUnparsed(
1051
1083
  }
1052
1084
 
1053
1085
  if (Array.isArray(tokenOrValue)) {
1054
- const args = reduceParseUnparsed(tokenOrValue, builder);
1086
+ const args = reduceParseUnparsed(
1087
+ tokenOrValue,
1088
+ builder,
1089
+ property,
1090
+ allowAuto,
1091
+ );
1055
1092
  if (!args) return;
1056
1093
  if (Array.isArray(args) && args.length === 1) return args[0];
1057
1094
  return args;
@@ -1059,11 +1096,21 @@ export function parseUnparsed(
1059
1096
 
1060
1097
  switch (tokenOrValue.type) {
1061
1098
  case "unresolved-color": {
1062
- return parseUnresolvedColor(tokenOrValue.value, builder);
1099
+ return parseUnresolvedColor(
1100
+ tokenOrValue.value,
1101
+ builder,
1102
+ property,
1103
+ allowAuto,
1104
+ );
1063
1105
  }
1064
1106
  case "var": {
1065
1107
  let args: StyleDescriptor = tokenOrValue.value.name.ident.slice(2);
1066
- const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
1108
+ const fallback = parseUnparsed(
1109
+ tokenOrValue.value.fallback,
1110
+ builder,
1111
+ property,
1112
+ allowAuto,
1113
+ );
1067
1114
  if (fallback !== undefined) {
1068
1115
  args = [args, fallback];
1069
1116
  }
@@ -1072,44 +1119,53 @@ export function parseUnparsed(
1072
1119
  }
1073
1120
  case "function": {
1074
1121
  switch (tokenOrValue.value.name) {
1075
- case "translate":
1076
- case "rotate":
1077
- case "rotateX":
1078
- case "rotateY":
1079
- case "skewX":
1080
- case "skewY":
1081
- case "scale":
1082
- case "scaleX":
1083
- case "scaleY":
1084
- case "translateX":
1085
- case "translateY":
1086
- tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
1087
- return unparsedFunction(tokenOrValue, builder);
1088
1122
  case "blur":
1089
1123
  case "brightness":
1090
1124
  case "contrast":
1091
1125
  case "cubic-bezier":
1092
1126
  case "drop-shadow":
1093
1127
  case "fontScale":
1128
+ case "getPixelSizeForLayoutSize":
1094
1129
  case "grayscale":
1095
1130
  case "hsl":
1096
1131
  case "hsla":
1097
1132
  case "hue-rotate":
1098
1133
  case "invert":
1099
- case "linear-gradient":
1100
1134
  case "opacity":
1101
1135
  case "pixelScale":
1102
- case "pixelSizeForLayoutSize":
1103
1136
  case "platformColor":
1104
- case "radial-gradient":
1105
1137
  case "rgb":
1106
1138
  case "rgba":
1139
+ case "rotate":
1140
+ case "rotateX":
1141
+ case "rotateY":
1107
1142
  case "roundToNearestPixel":
1108
1143
  case "saturate":
1144
+ case "scale":
1145
+ case "scaleX":
1146
+ case "scaleY":
1109
1147
  case "sepia":
1110
1148
  case "shadow":
1149
+ case "skewX":
1150
+ case "skewY":
1111
1151
  case "steps":
1112
- return unparsedFunction(tokenOrValue, builder);
1152
+ case "translate":
1153
+ case "translateX":
1154
+ case "translateY":
1155
+ return unparsedFunction(tokenOrValue, builder, property, allowAuto);
1156
+ case "linear-gradient":
1157
+ case "radial-gradient":
1158
+ // These are special as React Native requires the '-' in their name
1159
+ return [
1160
+ {},
1161
+ tokenOrValue.value.name,
1162
+ reduceParseUnparsed(
1163
+ tokenOrValue.value.arguments,
1164
+ builder,
1165
+ property,
1166
+ allowAuto,
1167
+ ),
1168
+ ];
1113
1169
  case "hairlineWidth":
1114
1170
  return [{}, tokenOrValue.value.name, []];
1115
1171
  case "calc":
@@ -1120,6 +1176,7 @@ export function parseUnparsed(
1120
1176
  tokenOrValue.value.name,
1121
1177
  tokenOrValue.value.arguments,
1122
1178
  builder,
1179
+ property,
1123
1180
  );
1124
1181
  default: {
1125
1182
  builder.addWarning("value", `${tokenOrValue.value.name}()`);
@@ -1152,6 +1209,8 @@ export function parseUnparsed(
1152
1209
  return true;
1153
1210
  } else if (value === "false") {
1154
1211
  return false;
1212
+ } else if (value === "infinity") {
1213
+ return Number.MAX_SAFE_INTEGER;
1155
1214
  } else {
1156
1215
  return value;
1157
1216
  }
@@ -1168,11 +1227,16 @@ export function parseUnparsed(
1168
1227
  return parseDimension(tokenOrValue.value, builder);
1169
1228
  case "comma":
1170
1229
  return CommaSeparator as unknown as StyleDescriptor;
1230
+ case "delim": {
1231
+ if (tokenOrValue.value.value === "/") {
1232
+ return tokenOrValue.value.value;
1233
+ }
1234
+ return;
1235
+ }
1171
1236
  case "at-keyword":
1172
1237
  case "hash":
1173
1238
  case "id-hash":
1174
1239
  case "unquoted-url":
1175
- case "delim":
1176
1240
  case "white-space":
1177
1241
  case "comment":
1178
1242
  case "colon":
@@ -1254,7 +1318,12 @@ export function parseLength(
1254
1318
  } else if (length.value === -Infinity) {
1255
1319
  return -9999;
1256
1320
  } else {
1257
- return round(length.value);
1321
+ // Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
1322
+ const value = Math.max(
1323
+ Math.min(length.value, Number.MAX_SAFE_INTEGER),
1324
+ Number.MIN_SAFE_INTEGER,
1325
+ );
1326
+ return round(value);
1258
1327
  }
1259
1328
  }
1260
1329
  case "rem":
@@ -1432,7 +1501,7 @@ export function parseSize(
1432
1501
  return;
1433
1502
  }
1434
1503
 
1435
- export function parseColorOrAuto(
1504
+ export function parseColorOrAutoDeclaration(
1436
1505
  { value }: { value: ColorOrAuto },
1437
1506
  builder: StylesheetBuilder,
1438
1507
  ) {
@@ -2399,7 +2468,6 @@ export function parseSVGPaint(
2399
2468
  return;
2400
2469
  }
2401
2470
 
2402
- builder.addMapping({ [property]: [property] });
2403
2471
  builder.addDescriptor(property, parsedValue);
2404
2472
  }
2405
2473
 
@@ -2420,7 +2488,7 @@ export function parseDimensionPercentageFor_LengthValue(
2420
2488
  }
2421
2489
  }
2422
2490
 
2423
- const allowAuto = new Set(["pointer-events"]);
2491
+ const allowAutoProperties = new Set(["pointer-events"]);
2424
2492
 
2425
2493
  export function parseEnv(
2426
2494
  value: EnvironmentVariable,
@@ -2438,7 +2506,7 @@ export function parseEnv(
2438
2506
  "var",
2439
2507
  [
2440
2508
  `--react-native-css-${value.name.value}`,
2441
- parseUnparsed(value.fallback, builder),
2509
+ parseUnparsed(value.fallback, builder, value.name.value),
2442
2510
  ],
2443
2511
  1,
2444
2512
  ];
@@ -2461,8 +2529,9 @@ export function parseCalcFn(
2461
2529
  name: string,
2462
2530
  tokens: TokenOrValue[],
2463
2531
  builder: StylesheetBuilder,
2532
+ property: string,
2464
2533
  ): StyleDescriptor {
2465
- const args = parseCalcArguments(tokens, builder);
2534
+ const args = parseCalcArguments(tokens, builder, property);
2466
2535
  if (args) {
2467
2536
  return [{}, name, args];
2468
2537
  }
@@ -2473,6 +2542,7 @@ export function parseCalcFn(
2473
2542
  export function parseCalcArguments(
2474
2543
  [...args]: TokenOrValue[],
2475
2544
  builder: StylesheetBuilder,
2545
+ property: string,
2476
2546
  ) {
2477
2547
  const parsed: StyleDescriptor[] = [];
2478
2548
 
@@ -2487,7 +2557,7 @@ export function parseCalcArguments(
2487
2557
  case "var":
2488
2558
  case "function":
2489
2559
  case "unresolved-color": {
2490
- const value = parseUnparsed(arg, builder);
2560
+ const value = parseUnparsed(arg, builder, property);
2491
2561
 
2492
2562
  if (value === undefined) {
2493
2563
  return undefined;
@@ -2563,7 +2633,7 @@ export function parseCalcArguments(
2563
2633
  // Then drop the surrounding parenthesis
2564
2634
  .slice(1, -1);
2565
2635
 
2566
- parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
2636
+ parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
2567
2637
 
2568
2638
  break;
2569
2639
  }
@@ -2616,6 +2686,8 @@ export function parseTranslateProp(
2616
2686
  export function parseUnresolvedColor(
2617
2687
  color: UnresolvedColor,
2618
2688
  builder: StylesheetBuilder,
2689
+ property: string,
2690
+ allowAuto: boolean,
2619
2691
  ): StyleDescriptor {
2620
2692
  switch (color.type) {
2621
2693
  case "rgb":
@@ -2626,26 +2698,31 @@ export function parseUnresolvedColor(
2626
2698
  round(color.r * 255),
2627
2699
  round(color.g * 255),
2628
2700
  round(color.b * 255),
2629
- parseUnparsed(color.alpha, builder),
2701
+ parseUnparsed(color.alpha, builder, property),
2630
2702
  ],
2631
2703
  ];
2632
2704
  case "hsl":
2633
2705
  return [
2634
2706
  {},
2635
2707
  color.type,
2636
- [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)],
2708
+ [
2709
+ color.h,
2710
+ color.s,
2711
+ color.l,
2712
+ parseUnparsed(color.alpha, builder, property),
2713
+ ],
2637
2714
  ];
2638
2715
  case "light-dark": {
2639
2716
  const extraRule = builder.extendRule({
2640
2717
  m: [["=", "prefers-color-scheme", "dark"]],
2641
2718
  });
2642
2719
  builder.addUnnamedDescriptor(
2643
- reduceParseUnparsed(color.dark, builder),
2720
+ reduceParseUnparsed(color.dark, builder, property, allowAuto),
2644
2721
  false,
2645
2722
  extraRule,
2646
2723
  );
2647
2724
  builder.addExtraRule(extraRule);
2648
- return reduceParseUnparsed(color.light, builder);
2725
+ return reduceParseUnparsed(color.light, builder, property, allowAuto);
2649
2726
  }
2650
2727
  default:
2651
2728
  color satisfies never;
@@ -2891,7 +2968,7 @@ function parseGradient(
2891
2968
  case "linear": {
2892
2969
  return [
2893
2970
  {},
2894
- "@linear-gradient",
2971
+ "linear-gradient",
2895
2972
  [
2896
2973
  parseLineDirection(gradient.direction, builder),
2897
2974
  ...gradient.items.map((item) => parseGradientItem(item, builder)),
@@ -2968,6 +3045,16 @@ function parseFilter(
2968
3045
  [value.type]: parseAngle(value.value, builder),
2969
3046
  } as unknown as StyleDescriptor;
2970
3047
  case "drop-shadow":
3048
+ return [
3049
+ {},
3050
+ toRNProperty(value.type),
3051
+ [
3052
+ parseLength(value.value.xOffset, builder),
3053
+ parseLength(value.value.yOffset, builder),
3054
+ parseLength(value.value.blur, builder),
3055
+ parseColor(value.value.color, builder),
3056
+ ],
3057
+ ] as unknown as StyleDescriptor;
2971
3058
  case "url":
2972
3059
  return;
2973
3060
  }
@@ -30,7 +30,7 @@ export function parseEasingFunction(
30
30
  case "cubic-bezier":
31
31
  return [
32
32
  {},
33
- "cubic-bezier",
33
+ "cubicBezier",
34
34
  [value.x1, value.y1, value.x2, value.y2],
35
35
  ] as const;
36
36
  case "steps":
@@ -32,6 +32,8 @@ const staticDeclarations = new WeakMap<
32
32
 
33
33
  const extraRules = new WeakMap<StyleRule, Partial<StyleRule>[]>();
34
34
 
35
+ const keywords = new Set(["unset"]);
36
+
35
37
  export class StylesheetBuilder {
36
38
  animationFrames?: AnimationKeyframes_V2[];
37
39
  animationDeclarations: StyleDeclaration[] = [];
@@ -50,6 +52,7 @@ export class StylesheetBuilder {
50
52
  private ruleTemplate: StyleRule = {
51
53
  s: [],
52
54
  },
55
+ // Any default mapping should be included in the @prop parsing
53
56
  private mapping: StyleRuleMapping = {},
54
57
  public descriptorProperty?: string,
55
58
  private shared: {
@@ -339,7 +342,10 @@ export class StylesheetBuilder {
339
342
  const [delayed, usesVariables] = postProcessStyleFunction(value);
340
343
 
341
344
  rule.d ??= [];
342
- if (value[1] === "@animation") {
345
+ if (
346
+ value[1].startsWith("animation") ||
347
+ value[1].startsWith("transition")
348
+ ) {
343
349
  rule.a ??= true;
344
350
  }
345
351
 
@@ -404,17 +410,21 @@ export class StylesheetBuilder {
404
410
  propPath = property;
405
411
  }
406
412
 
407
- if (isStyleFunction(value)) {
413
+ if (forceTuple && !Array.isArray(propPath)) {
414
+ propPath = [propPath];
415
+ }
416
+
417
+ if (isStyleFunction(value) || Array.isArray(propPath)) {
408
418
  if (delayed) {
409
419
  declarations.push([value, propPath, 1]);
410
420
  } else {
411
421
  declarations.push([value, propPath]);
412
422
  }
413
- } else if (forceTuple || Array.isArray(propPath)) {
414
- declarations.push([value, propPath]);
415
423
  } else if (Array.isArray(value) && value.some(isStyleFunction)) {
416
424
  declarations.push([value, propPath]);
417
- } else {
425
+ } else if (typeof value === "string" && keywords.has(value)) {
426
+ declarations.push([value, propPath]);
427
+ } else if (typeof propPath === "string") {
418
428
  let staticDeclarationRecord = staticDeclarations.get(declarations);
419
429
  if (!staticDeclarationRecord) {
420
430
  staticDeclarationRecord = {};
@@ -431,7 +441,7 @@ export class StylesheetBuilder {
431
441
  return;
432
442
  }
433
443
 
434
- if (!this.rule.d && !this.rule.v) {
444
+ if (!this.rule.d && !this.rule.v && !this.rule.c) {
435
445
  return;
436
446
  }
437
447
 
@@ -611,7 +621,7 @@ function postProcessStyleFunction(value: StyleDescriptor): [
611
621
  let [shouldDelay, usesVariables] = postProcessStyleFunction(value[2]);
612
622
 
613
623
  usesVariables ||= value[1] === "var";
614
- shouldDelay ||= value[3] === 1;
624
+ shouldDelay ||= value[3] === 1 || usesVariables;
615
625
 
616
626
  if (shouldDelay) {
617
627
  return [true, usesVariables];