react-native-css 3.0.6 → 3.1.0-rc.0

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 (483) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/commonjs/babel/import-plugin.js +9 -3
  3. package/dist/commonjs/babel/import-plugin.js.map +1 -1
  4. package/dist/commonjs/babel/react-native-web.js +16 -3
  5. package/dist/commonjs/babel/react-native-web.js.map +1 -1
  6. package/dist/commonjs/babel/react-native.js +7 -2
  7. package/dist/commonjs/babel/react-native.js.map +1 -1
  8. package/dist/commonjs/compiler/atRules.js +35 -0
  9. package/dist/commonjs/compiler/atRules.js.map +1 -1
  10. package/dist/commonjs/compiler/compiler.js +43 -30
  11. package/dist/commonjs/compiler/compiler.js.map +1 -1
  12. package/dist/commonjs/compiler/container-query.js +6 -1
  13. package/dist/commonjs/compiler/container-query.js.map +1 -1
  14. package/dist/commonjs/compiler/declarations.js +102 -61
  15. package/dist/commonjs/compiler/declarations.js.map +1 -1
  16. package/dist/commonjs/compiler/lightningcss-loader.js +11 -8
  17. package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
  18. package/dist/commonjs/compiler/media-query.js +16 -6
  19. package/dist/commonjs/compiler/media-query.js.map +1 -1
  20. package/dist/commonjs/compiler/selector-builder.js +13 -3
  21. package/dist/commonjs/compiler/selector-builder.js.map +1 -1
  22. package/dist/commonjs/components/FlatList.js +1 -0
  23. package/dist/commonjs/components/FlatList.js.map +1 -1
  24. package/dist/commonjs/components/ImageBackground.js +2 -6
  25. package/dist/commonjs/components/ImageBackground.js.map +1 -1
  26. package/dist/commonjs/components/KeyboardAvoidingView.js +2 -3
  27. package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
  28. package/dist/commonjs/components/index.cjs +46 -1
  29. package/dist/commonjs/components/index.cjs.map +1 -1
  30. package/dist/commonjs/jest/index.js +1 -1
  31. package/dist/commonjs/jest/index.js.map +1 -1
  32. package/dist/commonjs/metro/cache-version.js +43 -0
  33. package/dist/commonjs/metro/cache-version.js.map +1 -0
  34. package/dist/commonjs/metro/index.js +2 -0
  35. package/dist/commonjs/metro/index.js.map +1 -1
  36. package/dist/commonjs/metro/metro-transformer.js +1 -1
  37. package/dist/commonjs/metro/metro-transformer.js.map +1 -1
  38. package/dist/commonjs/metro/typescript.js +26 -6
  39. package/dist/commonjs/metro/typescript.js.map +1 -1
  40. package/dist/commonjs/native/api.js +12 -8
  41. package/dist/commonjs/native/api.js.map +1 -1
  42. package/dist/commonjs/native/conditions/attributes.js +16 -9
  43. package/dist/commonjs/native/conditions/attributes.js.map +1 -1
  44. package/dist/commonjs/native/conditions/container-query.js +11 -11
  45. package/dist/commonjs/native/conditions/container-query.js.map +1 -1
  46. package/dist/commonjs/native/conditions/media-query.js +1 -1
  47. package/dist/commonjs/native/conditions/media-query.js.map +1 -1
  48. package/dist/commonjs/native/react/interaction.js +10 -5
  49. package/dist/commonjs/native/react/interaction.js.map +1 -1
  50. package/dist/commonjs/native/react/rules.js +12 -5
  51. package/dist/commonjs/native/react/rules.js.map +1 -1
  52. package/dist/commonjs/native/react/useNativeCss.js +48 -12
  53. package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
  54. package/dist/commonjs/native/react/usePassthrough.js +5 -2
  55. package/dist/commonjs/native/react/usePassthrough.js.map +1 -1
  56. package/dist/commonjs/native/reactivity.js +32 -22
  57. package/dist/commonjs/native/reactivity.js.map +1 -1
  58. package/dist/commonjs/native/reanimated.js +15 -3
  59. package/dist/commonjs/native/reanimated.js.map +1 -1
  60. package/dist/commonjs/native/styles/functions/color-mix.js +43 -29
  61. package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -1
  62. package/dist/commonjs/native/styles/functions/filters.js +18 -5
  63. package/dist/commonjs/native/styles/functions/filters.js.map +1 -1
  64. package/dist/commonjs/native/styles/functions/numeric-functions.js +4 -3
  65. package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -1
  66. package/dist/commonjs/native/styles/functions/string-functions.js +16 -1
  67. package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
  68. package/dist/commonjs/native/styles/functions/transform-functions.js +5 -4
  69. package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
  70. package/dist/commonjs/native/styles/index.js +140 -14
  71. package/dist/commonjs/native/styles/index.js.map +1 -1
  72. package/dist/commonjs/native/styles/resolve.js +10 -6
  73. package/dist/commonjs/native/styles/resolve.js.map +1 -1
  74. package/dist/commonjs/native/styles/scale-factor.js +13 -0
  75. package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
  76. package/dist/commonjs/native/styles/shorthands/animation.js +6 -3
  77. package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
  78. package/dist/commonjs/native/styles/shorthands/index.js +11 -0
  79. package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
  80. package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
  81. package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
  82. package/dist/commonjs/native/styles/variables.js +55 -43
  83. package/dist/commonjs/native/styles/variables.js.map +1 -1
  84. package/dist/commonjs/native-internal/style-collection.js +1 -1
  85. package/dist/commonjs/native-internal/style-collection.js.map +1 -1
  86. package/dist/commonjs/utilities/dot-notation.types.js +4 -0
  87. package/dist/commonjs/utilities/style-descriptor.js +4 -9
  88. package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
  89. package/dist/commonjs/web/api.js +1 -1
  90. package/dist/commonjs/web/api.js.map +1 -1
  91. package/dist/commonjs/web/assign-style.js +4 -1
  92. package/dist/commonjs/web/assign-style.js.map +1 -1
  93. package/dist/module/babel/import-plugin.js +11 -5
  94. package/dist/module/babel/import-plugin.js.map +1 -1
  95. package/dist/module/babel/react-native-web.js +16 -4
  96. package/dist/module/babel/react-native-web.js.map +1 -1
  97. package/dist/module/babel/react-native.js +7 -2
  98. package/dist/module/babel/react-native.js.map +1 -1
  99. package/dist/module/compiler/atRules.js +33 -0
  100. package/dist/module/compiler/atRules.js.map +1 -1
  101. package/dist/module/compiler/compiler.js +44 -31
  102. package/dist/module/compiler/compiler.js.map +1 -1
  103. package/dist/module/compiler/container-query.js +6 -1
  104. package/dist/module/compiler/container-query.js.map +1 -1
  105. package/dist/module/compiler/declarations.js +102 -61
  106. package/dist/module/compiler/declarations.js.map +1 -1
  107. package/dist/module/compiler/lightningcss-loader.js +10 -8
  108. package/dist/module/compiler/lightningcss-loader.js.map +1 -1
  109. package/dist/module/compiler/media-query.js +16 -6
  110. package/dist/module/compiler/media-query.js.map +1 -1
  111. package/dist/module/compiler/selector-builder.js +13 -3
  112. package/dist/module/compiler/selector-builder.js.map +1 -1
  113. package/dist/module/components/FlatList.js +1 -0
  114. package/dist/module/components/FlatList.js.map +1 -1
  115. package/dist/module/components/ImageBackground.js +2 -6
  116. package/dist/module/components/ImageBackground.js.map +1 -1
  117. package/dist/module/components/KeyboardAvoidingView.js +2 -3
  118. package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
  119. package/dist/module/components/index.cjs +46 -1
  120. package/dist/module/components/index.cjs.map +1 -1
  121. package/dist/module/jest/index.js +1 -1
  122. package/dist/module/jest/index.js.map +1 -1
  123. package/dist/module/metro/cache-version.js +39 -0
  124. package/dist/module/metro/cache-version.js.map +1 -0
  125. package/dist/module/metro/index.js +2 -0
  126. package/dist/module/metro/index.js.map +1 -1
  127. package/dist/module/metro/metro-transformer.js +1 -1
  128. package/dist/module/metro/metro-transformer.js.map +1 -1
  129. package/dist/module/metro/typescript.js +26 -6
  130. package/dist/module/metro/typescript.js.map +1 -1
  131. package/dist/module/native/api.js +14 -10
  132. package/dist/module/native/api.js.map +1 -1
  133. package/dist/module/native/conditions/attributes.js +16 -9
  134. package/dist/module/native/conditions/attributes.js.map +1 -1
  135. package/dist/module/native/conditions/container-query.js +11 -11
  136. package/dist/module/native/conditions/container-query.js.map +1 -1
  137. package/dist/module/native/conditions/media-query.js +1 -1
  138. package/dist/module/native/conditions/media-query.js.map +1 -1
  139. package/dist/module/native/react/interaction.js +10 -5
  140. package/dist/module/native/react/interaction.js.map +1 -1
  141. package/dist/module/native/react/rules.js +13 -6
  142. package/dist/module/native/react/rules.js.map +1 -1
  143. package/dist/module/native/react/useNativeCss.js +49 -13
  144. package/dist/module/native/react/useNativeCss.js.map +1 -1
  145. package/dist/module/native/react/usePassthrough.js +5 -2
  146. package/dist/module/native/react/usePassthrough.js.map +1 -1
  147. package/dist/module/native/reactivity.js +32 -22
  148. package/dist/module/native/reactivity.js.map +1 -1
  149. package/dist/module/native/reanimated.js +15 -3
  150. package/dist/module/native/reanimated.js.map +1 -1
  151. package/dist/module/native/styles/functions/color-mix.js +43 -29
  152. package/dist/module/native/styles/functions/color-mix.js.map +1 -1
  153. package/dist/module/native/styles/functions/filters.js +16 -4
  154. package/dist/module/native/styles/functions/filters.js.map +1 -1
  155. package/dist/module/native/styles/functions/numeric-functions.js +4 -3
  156. package/dist/module/native/styles/functions/numeric-functions.js.map +1 -1
  157. package/dist/module/native/styles/functions/string-functions.js +13 -0
  158. package/dist/module/native/styles/functions/string-functions.js.map +1 -1
  159. package/dist/module/native/styles/functions/transform-functions.js +5 -4
  160. package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
  161. package/dist/module/native/styles/index.js +140 -14
  162. package/dist/module/native/styles/index.js.map +1 -1
  163. package/dist/module/native/styles/resolve.js +10 -6
  164. package/dist/module/native/styles/resolve.js.map +1 -1
  165. package/dist/module/native/styles/scale-factor.js +9 -0
  166. package/dist/module/native/styles/scale-factor.js.map +1 -0
  167. package/dist/module/native/styles/shorthands/animation.js +6 -3
  168. package/dist/module/native/styles/shorthands/animation.js.map +1 -1
  169. package/dist/module/native/styles/shorthands/index.js +1 -0
  170. package/dist/module/native/styles/shorthands/index.js.map +1 -1
  171. package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
  172. package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
  173. package/dist/module/native/styles/variables.js +55 -43
  174. package/dist/module/native/styles/variables.js.map +1 -1
  175. package/dist/module/native-internal/style-collection.js +1 -1
  176. package/dist/module/native-internal/style-collection.js.map +1 -1
  177. package/dist/module/utilities/dot-notation.types.js +2 -0
  178. package/dist/module/utilities/style-descriptor.js +4 -9
  179. package/dist/module/utilities/style-descriptor.js.map +1 -1
  180. package/dist/module/web/api.js +1 -1
  181. package/dist/module/web/api.js.map +1 -1
  182. package/dist/module/web/assign-style.js +4 -1
  183. package/dist/module/web/assign-style.js.map +1 -1
  184. package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
  185. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +2 -1
  186. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
  187. package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
  188. package/dist/typescript/commonjs/src/compiler/atRules.d.ts +4 -1
  189. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
  190. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  191. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -2
  192. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  193. package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
  194. package/dist/typescript/commonjs/src/compiler/media-query.d.ts +1 -1
  195. package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
  196. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
  197. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
  198. package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
  199. package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
  200. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +1 -1
  201. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
  202. package/dist/typescript/commonjs/src/metro/cache-version.d.ts +8 -0
  203. package/dist/typescript/commonjs/src/metro/cache-version.d.ts.map +1 -0
  204. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  205. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +5 -3
  206. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
  207. package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/src/native/api.d.ts +4 -8
  209. package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
  210. package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts.map +1 -1
  211. package/dist/typescript/commonjs/src/native/react/interaction.d.ts +1 -1
  212. package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -1
  213. package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
  214. package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
  215. package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -1
  216. package/dist/typescript/commonjs/src/native/reactivity.d.ts +7 -3
  217. package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
  218. package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -1
  219. package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -1
  220. package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +2 -0
  221. package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
  223. package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +2 -0
  224. package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
  225. package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
  226. package/dist/typescript/commonjs/src/native/styles/index.d.ts +2 -2
  227. package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
  228. package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +1 -0
  229. package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
  230. package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
  231. package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
  232. package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
  234. package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
  236. package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
  237. package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/src/native-internal/variables.d.ts +1 -1
  239. package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -1
  240. package/dist/typescript/commonjs/src/runtime.types.d.ts +11 -6
  241. package/dist/typescript/commonjs/src/runtime.types.d.ts.map +1 -1
  242. package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +2 -1
  243. package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +1 -1
  245. package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -1
  246. package/dist/typescript/commonjs/src/web/api.d.ts +5 -5
  247. package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
  248. package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -1
  249. package/dist/typescript/module/src/babel/import-plugin.d.ts +1 -1
  250. package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
  251. package/dist/typescript/module/src/babel/react-native-web.d.ts +2 -1
  252. package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -1
  253. package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -1
  254. package/dist/typescript/module/src/compiler/atRules.d.ts +6 -3
  255. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
  256. package/dist/typescript/module/src/compiler/compiler.d.ts +2 -2
  257. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  258. package/dist/typescript/module/src/compiler/compiler.types.d.ts +1 -1
  259. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  260. package/dist/typescript/module/src/compiler/container-query.d.ts +2 -2
  261. package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -1
  262. package/dist/typescript/module/src/compiler/declarations.d.ts +4 -4
  263. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  264. package/dist/typescript/module/src/compiler/index.d.ts +2 -2
  265. package/dist/typescript/module/src/compiler/index.d.ts.map +1 -1
  266. package/dist/typescript/module/src/compiler/inline-variables.d.ts +1 -1
  267. package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
  268. package/dist/typescript/module/src/compiler/keyframes.d.ts +2 -2
  269. package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
  270. package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -1
  271. package/dist/typescript/module/src/compiler/media-query.d.ts +3 -3
  272. package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
  273. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +1 -1
  274. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -1
  275. package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -1
  276. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
  277. package/dist/typescript/module/src/compiler/selectors.d.ts +2 -2
  278. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
  279. package/dist/typescript/module/src/compiler/stylesheet.d.ts +1 -1
  280. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  281. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
  282. package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
  283. package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
  284. package/dist/typescript/module/src/components/index.d.ts +16 -16
  285. package/dist/typescript/module/src/components/index.d.ts.map +1 -1
  286. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +1 -1
  287. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
  288. package/dist/typescript/module/src/metro/cache-version.d.ts +8 -0
  289. package/dist/typescript/module/src/metro/cache-version.d.ts.map +1 -0
  290. package/dist/typescript/module/src/metro/index.d.ts +1 -1
  291. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  292. package/dist/typescript/module/src/metro/metro-transformer.d.ts +6 -4
  293. package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
  294. package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -1
  295. package/dist/typescript/module/src/native/api.d.ts +5 -9
  296. package/dist/typescript/module/src/native/api.d.ts.map +1 -1
  297. package/dist/typescript/module/src/native/conditions/attributes.d.ts +1 -1
  298. package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -1
  299. package/dist/typescript/module/src/native/conditions/container-query.d.ts +2 -2
  300. package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -1
  301. package/dist/typescript/module/src/native/conditions/guards.d.ts +2 -2
  302. package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -1
  303. package/dist/typescript/module/src/native/conditions/index.d.ts +3 -3
  304. package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -1
  305. package/dist/typescript/module/src/native/conditions/media-query.d.ts +1 -1
  306. package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -1
  307. package/dist/typescript/module/src/native/index.d.ts +3 -3
  308. package/dist/typescript/module/src/native/index.d.ts.map +1 -1
  309. package/dist/typescript/module/src/native/react/interaction.d.ts +2 -2
  310. package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -1
  311. package/dist/typescript/module/src/native/react/rules.d.ts +2 -2
  312. package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
  313. package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -4
  314. package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
  315. package/dist/typescript/module/src/native/react/usePassthrough.d.ts +1 -1
  316. package/dist/typescript/module/src/native/react/usePassthrough.d.ts.map +1 -1
  317. package/dist/typescript/module/src/native/reactivity.d.ts +7 -3
  318. package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
  319. package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -1
  320. package/dist/typescript/module/src/native/styles/calculate-props.d.ts +2 -2
  321. package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
  322. package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
  323. package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
  324. package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
  325. package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
  326. package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +1 -1
  327. package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -1
  328. package/dist/typescript/module/src/native/styles/functions/filters.d.ts +3 -1
  329. package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -1
  330. package/dist/typescript/module/src/native/styles/functions/index.d.ts +8 -8
  331. package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
  332. package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +1 -1
  333. package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
  334. package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +1 -1
  335. package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -1
  336. package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -1
  337. package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -1
  338. package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +1 -1
  339. package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
  340. package/dist/typescript/module/src/native/styles/index.d.ts +7 -7
  341. package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
  342. package/dist/typescript/module/src/native/styles/line-height.d.ts +1 -1
  343. package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -1
  344. package/dist/typescript/module/src/native/styles/resolve.d.ts +4 -3
  345. package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
  346. package/dist/typescript/module/src/native/styles/scale-factor.d.ts +2 -0
  347. package/dist/typescript/module/src/native/styles/scale-factor.d.ts.map +1 -0
  348. package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +1 -1
  349. package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -1
  350. package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +2 -2
  351. package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -1
  352. package/dist/typescript/module/src/native/styles/shorthands/border.d.ts +1 -1
  353. package/dist/typescript/module/src/native/styles/shorthands/border.d.ts.map +1 -1
  354. package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts +1 -1
  355. package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
  356. package/dist/typescript/module/src/native/styles/shorthands/index.d.ts +6 -5
  357. package/dist/typescript/module/src/native/styles/shorthands/index.d.ts.map +1 -1
  358. package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
  359. package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
  360. package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts +1 -1
  361. package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts.map +1 -1
  362. package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts +1 -1
  363. package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts.map +1 -1
  364. package/dist/typescript/module/src/native/styles/units.d.ts +1 -1
  365. package/dist/typescript/module/src/native/styles/units.d.ts.map +1 -1
  366. package/dist/typescript/module/src/native/styles/variables.d.ts +2 -2
  367. package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -1
  368. package/dist/typescript/module/src/native-internal/index.d.ts +3 -3
  369. package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -1
  370. package/dist/typescript/module/src/native-internal/root.d.ts +1 -1
  371. package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
  372. package/dist/typescript/module/src/native-internal/style-collection.d.ts +2 -2
  373. package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -1
  374. package/dist/typescript/module/src/native-internal/variables.d.ts +2 -2
  375. package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
  376. package/dist/typescript/module/src/runtime.d.ts +1 -1
  377. package/dist/typescript/module/src/runtime.d.ts.map +1 -1
  378. package/dist/typescript/module/src/runtime.native.d.ts +1 -1
  379. package/dist/typescript/module/src/runtime.native.d.ts.map +1 -1
  380. package/dist/typescript/module/src/runtime.types.d.ts +11 -6
  381. package/dist/typescript/module/src/runtime.types.d.ts.map +1 -1
  382. package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +2 -1
  383. package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
  384. package/dist/typescript/module/src/utilities/index.d.ts +3 -3
  385. package/dist/typescript/module/src/utilities/index.d.ts.map +1 -1
  386. package/dist/typescript/module/src/utilities/specificity.d.ts +2 -2
  387. package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -1
  388. package/dist/typescript/module/src/utilities/style-descriptor.d.ts +1 -1
  389. package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -1
  390. package/dist/typescript/module/src/web/api.d.ts +5 -5
  391. package/dist/typescript/module/src/web/api.d.ts.map +1 -1
  392. package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -1
  393. package/dist/typescript/module/src/web/index.d.ts +3 -3
  394. package/dist/typescript/module/src/web/index.d.ts.map +1 -1
  395. package/node/babel.mjs +4 -0
  396. package/node/compiler.mjs +2 -0
  397. package/node/metro.mjs +2 -0
  398. package/package.json +61 -27
  399. package/src/babel/import-plugin.ts +15 -4
  400. package/src/babel/react-native-web.ts +32 -3
  401. package/src/babel/react-native.ts +7 -1
  402. package/src/compiler/atRules.ts +44 -0
  403. package/src/compiler/compiler.ts +73 -49
  404. package/src/compiler/container-query.ts +8 -3
  405. package/src/compiler/declarations.ts +189 -100
  406. package/src/compiler/lightningcss-loader.ts +16 -15
  407. package/src/compiler/media-query.ts +20 -9
  408. package/src/compiler/selector-builder.ts +29 -3
  409. package/src/components/FlatList.tsx +1 -0
  410. package/src/components/ImageBackground.tsx +2 -6
  411. package/src/components/KeyboardAvoidingView.tsx +2 -3
  412. package/src/components/index.cts +46 -1
  413. package/src/jest/index.ts +1 -1
  414. package/src/metro/cache-version.ts +48 -0
  415. package/src/metro/index.ts +2 -0
  416. package/src/metro/metro-transformer.ts +9 -6
  417. package/src/metro/typescript.ts +53 -6
  418. package/src/native/api.tsx +20 -14
  419. package/src/native/conditions/attributes.ts +26 -9
  420. package/src/native/conditions/container-query.ts +11 -9
  421. package/src/native/conditions/media-query.ts +1 -1
  422. package/src/native/react/interaction.ts +11 -6
  423. package/src/native/react/rules.ts +13 -5
  424. package/src/native/react/useNativeCss.ts +54 -14
  425. package/src/native/react/usePassthrough.ts +3 -2
  426. package/src/native/reactivity.ts +42 -24
  427. package/src/native/reanimated.ts +24 -5
  428. package/src/native/styles/functions/color-mix.ts +45 -39
  429. package/src/native/styles/functions/filters.ts +20 -6
  430. package/src/native/styles/functions/numeric-functions.ts +7 -6
  431. package/src/native/styles/functions/string-functions.ts +18 -0
  432. package/src/native/styles/functions/transform-functions.ts +5 -4
  433. package/src/native/styles/index.ts +146 -15
  434. package/src/native/styles/resolve.ts +15 -11
  435. package/src/native/styles/scale-factor.ts +6 -0
  436. package/src/native/styles/shorthands/animation.ts +8 -2
  437. package/src/native/styles/shorthands/index.ts +1 -0
  438. package/src/native/styles/shorthands/logical-border-width.ts +32 -0
  439. package/src/native/styles/variables.ts +48 -38
  440. package/src/native-internal/style-collection.ts +1 -1
  441. package/src/runtime.types.ts +17 -15
  442. package/src/utilities/dot-notation.types.ts +4 -3
  443. package/src/utilities/style-descriptor.ts +11 -16
  444. package/src/web/api.tsx +6 -11
  445. package/src/web/assign-style.ts +2 -1
  446. package/types.d.ts +0 -20
  447. package/dist/commonjs/compiler/inheritance.test.js +0 -78
  448. package/dist/commonjs/compiler/inheritance.test.js.map +0 -1
  449. package/dist/module/compiler/inheritance.test.js +0 -78
  450. package/dist/module/compiler/inheritance.test.js.map +0 -1
  451. package/dist/typescript/commonjs/.config/eslint.config.d.mts +0 -3
  452. package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +0 -1
  453. package/dist/typescript/commonjs/eslint.config.d.mts +0 -2
  454. package/dist/typescript/commonjs/eslint.config.d.mts.map +0 -1
  455. package/dist/typescript/commonjs/example/app.config.d.ts +0 -4
  456. package/dist/typescript/commonjs/example/app.config.d.ts.map +0 -1
  457. package/dist/typescript/commonjs/example/index.d.ts +0 -2
  458. package/dist/typescript/commonjs/example/index.d.ts.map +0 -1
  459. package/dist/typescript/commonjs/example/metro.config.d.ts +0 -3
  460. package/dist/typescript/commonjs/example/metro.config.d.ts.map +0 -1
  461. package/dist/typescript/commonjs/example/postcss.config.d.mts +0 -7
  462. package/dist/typescript/commonjs/example/postcss.config.d.mts.map +0 -1
  463. package/dist/typescript/commonjs/example/src/App.d.ts +0 -3
  464. package/dist/typescript/commonjs/example/src/App.d.ts.map +0 -1
  465. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +0 -2
  466. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +0 -1
  467. package/dist/typescript/module/.config/eslint.config.d.mts +0 -3
  468. package/dist/typescript/module/.config/eslint.config.d.mts.map +0 -1
  469. package/dist/typescript/module/eslint.config.d.mts +0 -2
  470. package/dist/typescript/module/eslint.config.d.mts.map +0 -1
  471. package/dist/typescript/module/example/app.config.d.ts +0 -4
  472. package/dist/typescript/module/example/app.config.d.ts.map +0 -1
  473. package/dist/typescript/module/example/index.d.ts +0 -2
  474. package/dist/typescript/module/example/index.d.ts.map +0 -1
  475. package/dist/typescript/module/example/metro.config.d.ts +0 -3
  476. package/dist/typescript/module/example/metro.config.d.ts.map +0 -1
  477. package/dist/typescript/module/example/postcss.config.d.mts +0 -7
  478. package/dist/typescript/module/example/postcss.config.d.mts.map +0 -1
  479. package/dist/typescript/module/example/src/App.d.ts +0 -3
  480. package/dist/typescript/module/example/src/App.d.ts.map +0 -1
  481. package/dist/typescript/module/src/compiler/inheritance.test.d.ts +0 -2
  482. package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +0 -1
  483. package/src/compiler/inheritance.test.ts +0 -121
@@ -172,9 +172,10 @@ export const stylesFamily = family(
172
172
  /**
173
173
  * A family is a map, so we need to cleanup the observers when the the hash is no longer used
174
174
  */
175
+ const unsubscribe = obs.unsubscribe;
175
176
  return Object.assign(obs, {
176
- cleanup: (effect: Effect) => {
177
- obs.observers.delete(effect);
177
+ unsubscribe: (effect: Effect) => {
178
+ unsubscribe(effect);
178
179
  if (obs.observers.size === 0) {
179
180
  stylesFamily.delete(hash);
180
181
  }
@@ -186,15 +187,23 @@ export const stylesFamily = family(
186
187
  export function getStyledProps(
187
188
  state: ComponentState,
188
189
  inline: Record<string, any> | undefined | null,
190
+ adaptProps: (
191
+ props: Record<string, any> | undefined,
192
+ ) => Record<string, any> | undefined = (props) => props,
189
193
  ) {
190
194
  let result: Record<string, any> | undefined;
191
195
 
192
196
  const styledProps = state.stylesObs?.get(state.styleEffect);
193
197
 
198
+ // Each config merges a complete props object. Preserve its full target path
199
+ // before the next config merges unrelated inline props over that object.
200
+ const computedTargets: { path: string[]; value: unknown }[] = [];
201
+ const consumedSources: string[] = [];
202
+
194
203
  for (const config of state.configs) {
195
204
  result = deepMergeConfig(
196
205
  config,
197
- nativeStyleMapping(config, styledProps?.normal),
206
+ nativeStyleMapping(config, adaptProps(styledProps?.normal)),
198
207
  inline,
199
208
  true,
200
209
  );
@@ -203,10 +212,27 @@ export function getStyledProps(
203
212
  result = deepMergeConfig(
204
213
  config,
205
214
  result,
206
- nativeStyleMapping(config, styledProps.important),
215
+ nativeStyleMapping(config, adaptProps(styledProps.important)),
207
216
  );
208
217
  }
209
218
 
219
+ if (result && config.target) {
220
+ const path = Array.isArray(config.target)
221
+ ? config.target
222
+ : [config.target];
223
+ let target = result;
224
+ for (const key of path.slice(0, -1)) target = target?.[key];
225
+ const key = path[path.length - 1];
226
+ if (target && key && key in target) {
227
+ computedTargets.push({ path, value: target[key] });
228
+ }
229
+ }
230
+
231
+ // Track consumed className sources for cleanup
232
+ if (config.source !== config.target) {
233
+ consumedSources.push(config.source);
234
+ }
235
+
210
236
  // Apply the handlers
211
237
  if (hoverFamily.has(state.ruleEffectGetter)) {
212
238
  result ??= {};
@@ -265,6 +291,68 @@ export function getStyledProps(
265
291
  }
266
292
  }
267
293
 
294
+ // Restore correctly-merged target props that may have been overwritten
295
+ // by later config iterations' Object.assign({}, left, right)
296
+ if (result) {
297
+ for (const { path, value } of computedTargets) {
298
+ let target = result;
299
+ for (const key of path.slice(0, -1)) {
300
+ const existing = target[key];
301
+ target = target[key] = Array.isArray(existing)
302
+ ? [...existing]
303
+ : { ...existing };
304
+ }
305
+ target[path[path.length - 1]!] = value;
306
+ }
307
+ for (const source of consumedSources) {
308
+ delete result[source];
309
+ }
310
+ }
311
+
312
+ return result;
313
+ }
314
+
315
+ /**
316
+ * Merges two prop objects, skipping keys from `right` whose value is `undefined`
317
+ * or an empty plain object.
318
+ *
319
+ * `Object.assign({}, left, right)` copies all enumerable own properties from `right`,
320
+ * including those with value `undefined` or `{}`. When a component passes
321
+ * `style={undefined}` or `contentContainerStyle={{}}`, the computed NativeWind
322
+ * style from `left` gets overwritten. This function prevents that by only copying
323
+ * values that carry meaningful style information.
324
+ *
325
+ * Empty object detection uses inline `for...in` instead of a separate function or
326
+ * `Object.keys().length` — avoids both function call overhead and intermediate array
327
+ * allocation on a hot path (called per-prop per-render). Consistent with how the
328
+ * `["style"]` target path handles this via `filterCssVariables({})` returning `undefined`.
329
+ *
330
+ * @param left - The computed NativeWind props (className-derived styles)
331
+ * @param right - The inline props from the component (guaranteed non-null by caller; may contain undefined values)
332
+ * @returns A new object with all properties from `left`, overridden only by meaningful values from `right`
333
+ */
334
+ function mergeDefinedProps(
335
+ left: Record<string, any> | undefined,
336
+ right: Record<string, any>,
337
+ ) {
338
+ const result = left ? { ...left } : {};
339
+ for (const key in right) {
340
+ const value = right[key];
341
+ if (value === undefined) continue;
342
+ // Non-object values (strings, numbers, booleans, null, arrays): always assign
343
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
344
+ result[key] = value;
345
+ continue;
346
+ }
347
+ // Plain object: assign only if non-empty. An empty style object (e.g.,
348
+ // contentContainerStyle={{}}) has no properties to apply and should not
349
+ // overwrite computed className styles. The for...in loop only executes
350
+ // if the object has enumerable keys — empty objects are skipped.
351
+ for (const _ in value) {
352
+ result[key] = value;
353
+ break;
354
+ }
355
+ }
268
356
  return result;
269
357
  }
270
358
 
@@ -359,10 +447,10 @@ function deepMergeConfig(
359
447
  }
360
448
  }
361
449
  } else {
362
- result = Object.assign({}, left, right);
450
+ result = mergeDefinedProps(left, right);
363
451
  }
364
452
  } else {
365
- result = Object.assign({}, left, right);
453
+ result = mergeDefinedProps(left, right);
366
454
  }
367
455
 
368
456
  if (
@@ -378,21 +466,59 @@ function deepMergeConfig(
378
466
  * If target is a path, deep merge until we get to the last key
379
467
  */
380
468
  if (Array.isArray(config.target)) {
381
- for (let i = 0; i < config.target.length - 1; i++) {
382
- const key = config.target[i];
383
-
384
- if (key === undefined) {
385
- return result;
386
- }
387
-
469
+ if (config.target.length > 1) {
470
+ const key = config.target[0]!;
388
471
  result[key] = deepMergeConfig(
389
- { source: config.source, target: config.target.slice(i + 1) },
472
+ { source: config.source, target: config.target.slice(1) },
390
473
  left?.[key],
391
474
  right?.[key],
392
475
  rightIsInline,
393
476
  );
394
477
  }
395
478
 
479
+ // For length-1 array targets (e.g. ["contentContainerStyle"]), the loop
480
+ // above runs 0 iterations. Merge the target prop so inline styles don't
481
+ // silently overwrite className-computed styles (same as string target path).
482
+ const finalKey = config.target[config.target.length - 1];
483
+ if (config.target.length === 1 && finalKey && rightIsInline) {
484
+ let rightValue = right?.[finalKey];
485
+ if (rightValue !== undefined) {
486
+ rightValue = filterCssVariables(rightValue);
487
+ }
488
+ if (rightValue === undefined || rightValue === null) {
489
+ // Inline is empty or fully filtered — preserve className-computed value
490
+ if (left && finalKey in left) {
491
+ result[finalKey] = left[finalKey];
492
+ } else {
493
+ // No left value either — remove unfiltered inline value from result
494
+ delete result[finalKey];
495
+ }
496
+ } else if (left && finalKey in left) {
497
+ const leftValue = left[finalKey];
498
+ const leftIsObj =
499
+ typeof leftValue === "object" &&
500
+ leftValue !== null &&
501
+ !Array.isArray(leftValue);
502
+ const rightIsObj =
503
+ typeof rightValue === "object" &&
504
+ rightValue !== null &&
505
+ !Array.isArray(rightValue);
506
+ if (leftIsObj && rightIsObj) {
507
+ if (hasNonOverlappingProperties(leftValue, rightValue)) {
508
+ result[finalKey] = [leftValue, rightValue];
509
+ } else {
510
+ // All left keys are in right — use filtered right value
511
+ result[finalKey] = rightValue;
512
+ }
513
+ } else {
514
+ result[finalKey] = [leftValue, rightValue];
515
+ }
516
+ } else {
517
+ // No left value — use filtered right value (not the unfiltered one from mergeDefinedProps)
518
+ result[finalKey] = rightValue;
519
+ }
520
+ }
521
+
396
522
  return result;
397
523
  }
398
524
 
@@ -421,7 +547,11 @@ function nativeStyleMapping(
421
547
  config: Config,
422
548
  props: Record<string, any> | undefined,
423
549
  ) {
424
- if (!config.nativeStyleMapping || !props) {
550
+ if (!props) {
551
+ return props;
552
+ }
553
+ if (!config.nativeStyleMapping) {
554
+ if (config.target === false) delete props.style;
425
555
  return props;
426
556
  }
427
557
 
@@ -470,5 +600,6 @@ function nativeStyleMapping(
470
600
  target[lastToken!] = styleValue;
471
601
  }
472
602
 
603
+ if (config.target === false) delete props.style;
473
604
  return props;
474
605
  }
@@ -5,6 +5,7 @@ import type {
5
5
  StyleDescriptor,
6
6
  StyleFunction,
7
7
  } from "react-native-css/compiler";
8
+ import { isStyleDescriptorArray } from "react-native-css/utilities";
8
9
 
9
10
  import type { RenderGuard } from "../conditions/guards";
10
11
  import { type Getter, type VariableContextValue } from "../reactivity";
@@ -12,6 +13,7 @@ import type { calculateProps } from "./calculate-props";
12
13
  import { transformKeys } from "./defaults";
13
14
  import * as functions from "./functions";
14
15
  import { lineHeight } from "./line-height";
16
+ import { scaleFactor } from "./scale-factor";
15
17
  import * as shorthands from "./shorthands";
16
18
  import { em, rem, vh, vw } from "./units";
17
19
  import { varResolver } from "./variables";
@@ -51,6 +53,7 @@ export type ResolveValueOptions = {
51
53
  inlineVariables?: InlineVariable | undefined;
52
54
  renderGuards?: RenderGuard[];
53
55
  variableHistory?: Set<string>;
56
+ variableCycles?: Set<string>;
54
57
  /** Pass down to perform recursive calculations and avoid circular dependencies */
55
58
  calculateProps?: typeof calculateProps;
56
59
  };
@@ -77,7 +80,7 @@ export function resolveValue(
77
80
  return null;
78
81
  } else if (value.endsWith("px")) {
79
82
  // Inline vars() might set a value with a px suffix
80
- return parseInt(value.slice(0, -2), 10);
83
+ return parseFloat(value.slice(0, -2));
81
84
  } else {
82
85
  return value;
83
86
  }
@@ -87,7 +90,7 @@ export function resolveValue(
87
90
  return value;
88
91
  }
89
92
 
90
- if (isDescriptorArray(value)) {
93
+ if (isStyleDescriptorArray(value)) {
91
94
  value = value
92
95
  .map((d) => resolveValue(d, get, options))
93
96
  .filter((d) => d !== undefined);
@@ -122,7 +125,16 @@ export function resolveValue(
122
125
  ) as StyleDescriptor;
123
126
  } else if (transformKeys.has(name)) {
124
127
  // translate, rotate, scale, etc.
125
- return { [name]: simpleResolve(value[2], castToArray) };
128
+ let resolved = simpleResolve(value[2], castToArray);
129
+ // CSS scale percentages describe a factor, unlike translation percentages.
130
+ if (
131
+ (name === "scaleX" || name === "scaleY" || name === "scale") &&
132
+ typeof resolved === "string" &&
133
+ resolved.endsWith("%")
134
+ ) {
135
+ resolved = scaleFactor(resolved);
136
+ }
137
+ return { [name]: resolved };
126
138
  } else {
127
139
  let args = simpleResolve(value[2], castToArray);
128
140
 
@@ -154,11 +166,3 @@ export function resolveValue(
154
166
  }
155
167
  }
156
168
  }
157
-
158
- function isDescriptorArray(
159
- value: StyleDescriptor | StyleDescriptor[],
160
- ): value is StyleDescriptor[] {
161
- return Array.isArray(value) && typeof value[0] === "object"
162
- ? Array.isArray(value[0])
163
- : true;
164
- }
@@ -0,0 +1,6 @@
1
+ export function scaleFactor(value: unknown) {
2
+ if (typeof value === "string" && value.endsWith("%")) {
3
+ return Number(value.slice(0, -1)) / 100;
4
+ }
5
+ return value;
6
+ }
@@ -39,6 +39,8 @@ export const animationShorthand = shorthandHandler(
39
39
  [name],
40
40
  [duration, name],
41
41
  [name, duration],
42
+ [name, duration, timingFunction],
43
+ [duration, timingFunction, name],
42
44
  [name, duration, iteration],
43
45
  [name, duration, timingFunction, iteration],
44
46
  [duration, delay, name],
@@ -67,7 +69,7 @@ export const animation: StyleFunctionResolver = (
67
69
  ) => {
68
70
  const animationShortHandTuples = animationShorthand(
69
71
  resolveValue,
70
- value,
72
+ [value[2]],
71
73
  get,
72
74
  options,
73
75
  );
@@ -86,6 +88,10 @@ export const animation: StyleFunctionResolver = (
86
88
  return;
87
89
  }
88
90
 
91
+ if (name === "none") {
92
+ return applyShorthand(animationShortHandTuples);
93
+ }
94
+
89
95
  const keyframes = get(StyleCollection.keyframes(name));
90
96
 
91
97
  const animation: Record<string, any> = {};
@@ -127,5 +133,5 @@ export const animationName: StyleFunctionResolver = (
127
133
  options,
128
134
  ) => {
129
135
  const shorthand: any = animation(resolveValue, value, get, options);
130
- return shorthand.animationName;
136
+ return shorthand?.animationName;
131
137
  };
@@ -1,5 +1,6 @@
1
1
  export * from "./animation";
2
2
  export * from "./border";
3
+ export * from "./logical-border-width";
3
4
  export * from "./box-shadow";
4
5
  export * from "./text-shadow";
5
6
  export * from "./transform";
@@ -0,0 +1,32 @@
1
+ import { ShortHandSymbol } from "../constants";
2
+ import type { StyleFunctionResolver } from "../resolve";
3
+
4
+ function logicalWidth(start: string, end: string): StyleFunctionResolver {
5
+ return (resolve, descriptor) => {
6
+ const resolved = resolve(descriptor[2]);
7
+ const values: unknown[] = Array.isArray(resolved) ? resolved : [resolved];
8
+ if (
9
+ values.length < 1 ||
10
+ values.length > 2 ||
11
+ !values.every(
12
+ (value) =>
13
+ typeof value === "number" && Number.isFinite(value) && value >= 0,
14
+ )
15
+ )
16
+ return;
17
+ return {
18
+ [ShortHandSymbol]: true,
19
+ [start]: values[0],
20
+ [end]: values[1] ?? values[0],
21
+ };
22
+ };
23
+ }
24
+
25
+ export const borderBlockWidth = logicalWidth(
26
+ "borderTopWidth",
27
+ "borderBottomWidth",
28
+ );
29
+ export const borderInlineWidth = logicalWidth(
30
+ "borderStartWidth",
31
+ "borderEndWidth",
32
+ );
@@ -18,7 +18,8 @@ export function varResolver(
18
18
  renderGuards,
19
19
  inheritedVariables: variables = { [VAR_SYMBOL]: true },
20
20
  inlineVariables,
21
- variableHistory = new Set(),
21
+ variableHistory = (options.variableHistory ??= new Set()),
22
+ variableCycles = (options.variableCycles ??= new Set()),
22
23
  } = options;
23
24
 
24
25
  const args = fn[2];
@@ -29,11 +30,10 @@ export function varResolver(
29
30
  if (typeof args === "string") {
30
31
  name = args;
31
32
  } else {
32
- const result = resolve(args);
33
-
34
- if (isStyleDescriptorArray(result)) {
35
- name = result[0] as string;
36
- fallback = result[1];
33
+ // Fallbacks are substituted only when needed, after reading the variable.
34
+ if (isStyleDescriptorArray(args)) {
35
+ name = args[0] as string;
36
+ fallback = args[1];
37
37
  }
38
38
  }
39
39
 
@@ -41,48 +41,58 @@ export function varResolver(
41
41
  return;
42
42
  }
43
43
 
44
- // If this recurses back to the same variable, we need to stop
44
+ if (variableCycles.has(name)) return resolve(fallback);
45
+
46
+ // Share the active resolution path with recursive calls. Mark only the
47
+ // actual cycle, so a dependent variable can still use its own fallback.
45
48
  if (variableHistory.has(name)) {
49
+ let inCycle = false;
50
+ for (const dependency of variableHistory) {
51
+ if (dependency === name) inCycle = true;
52
+ if (inCycle) variableCycles.add(dependency);
53
+ }
46
54
  return;
47
55
  }
48
56
 
49
- if (name in variables) {
50
- renderGuards?.push(["v", name, variables[name]]);
51
- return resolve(variables[name]);
52
- }
53
-
54
57
  variableHistory.add(name);
55
58
 
56
- let value = resolve(inlineVariables?.[name] as StyleDescriptor);
57
- if (value !== undefined) {
58
- options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
59
- options.inlineVariables[name] = value;
59
+ try {
60
+ let value = resolve(inlineVariables?.[name] as StyleDescriptor);
61
+ if (variableCycles.has(name)) return resolve(fallback);
62
+ if (value !== undefined) {
63
+ options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
64
+ options.inlineVariables[name] = value;
60
65
 
61
- return value;
62
- }
66
+ return value;
67
+ }
63
68
 
64
- value = resolve(variables[name]);
65
- if (value !== undefined) {
66
- renderGuards?.push(["v", name, value]);
67
- options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
68
- options.inlineVariables[name] = value;
69
+ // A universal selector declares the variable on this element. It has lower
70
+ // specificity than the element's class declarations, but beats inheritance.
71
+ value = resolve(get(universalVariables(name)));
72
+ if (variableCycles.has(name)) return resolve(fallback);
73
+ if (value !== undefined) {
74
+ options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
75
+ options.inlineVariables[name] = value;
76
+ return value;
77
+ }
69
78
 
70
- return value;
71
- }
79
+ // Guards retain the ancestor's raw descriptor, matching the context value.
80
+ if (name in variables) {
81
+ renderGuards?.push(["v", name, variables[name]]);
82
+ value = resolve(variables[name]);
83
+ return variableCycles.has(name) ? resolve(fallback) : value;
84
+ }
72
85
 
73
- value = resolve(get(universalVariables(name)));
74
- if (value !== undefined) {
75
- options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
76
- options.inlineVariables[name] = value;
77
- return value;
78
- }
86
+ value = resolve(get(rootVariables(name)));
87
+ if (variableCycles.has(name)) return resolve(fallback);
88
+ if (value !== undefined) {
89
+ options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
90
+ options.inlineVariables[name] = value;
91
+ return value;
92
+ }
79
93
 
80
- value = resolve(get(rootVariables(name)));
81
- if (value !== undefined) {
82
- options.inlineVariables ??= { [VAR_SYMBOL]: "inline" };
83
- options.inlineVariables[name] = value;
84
- return value;
94
+ return resolve(fallback);
95
+ } finally {
96
+ variableHistory.delete(name);
85
97
  }
86
-
87
- return resolve(fallback);
88
98
  }
@@ -91,7 +91,7 @@ globalThis.__react_native_css_style_collection ??= {
91
91
 
92
92
  if (options.vu) {
93
93
  for (const entry of options.vu) {
94
- rootVariables(entry[0]).set(entry[1]);
94
+ universalVariables(entry[0]).set(entry[1]);
95
95
  }
96
96
  }
97
97
 
@@ -3,6 +3,7 @@ import type {
3
3
  ClassicComponentClass,
4
4
  ComponentClass,
5
5
  ComponentProps,
6
+ ComponentPropsWithRef,
6
7
  ComponentType,
7
8
  ForwardRefExoticComponent,
8
9
  FunctionComponent,
@@ -44,20 +45,24 @@ export type StyledProps<P, M extends StyledConfiguration<any>> = P & {
44
45
  : never]?: string;
45
46
  };
46
47
 
47
- export type Styled = <
48
- const C extends ReactComponent,
49
- const M extends StyledConfiguration<C>,
50
- >(
51
- component: C,
52
- mapping: M & StyledConfiguration<C>,
53
- options?: StyledOptions,
54
- ) => StyledComponent<C, M>;
48
+ export interface Styled {
49
+ <const C extends ReactComponent>(
50
+ component: C,
51
+ mapping?: undefined,
52
+ options?: StyledOptions,
53
+ ): ComponentType<ComponentPropsWithRef<C> & { className?: string }>;
54
+ <const C extends ReactComponent, const M extends StyledConfiguration<C>>(
55
+ component: C,
56
+ mapping: M & StyledConfiguration<C>,
57
+ options?: StyledOptions,
58
+ ): StyledComponent<C, M>;
59
+ }
55
60
 
56
61
  type StyledComponent<
57
62
  C extends ReactComponent,
58
63
  M extends StyledConfiguration<C>,
59
64
  > = ComponentType<
60
- ComponentProps<C> & {
65
+ ComponentPropsWithRef<C> & {
61
66
  [K in keyof M as K extends string
62
67
  ? M[K] extends undefined | false
63
68
  ? never
@@ -90,10 +95,7 @@ interface StyledConfigurationObject<
90
95
  ComponentProps<C>
91
96
  >;
92
97
  /** @deprecated Please use nativeStyleMapping */
93
- nativeStyleToProp?: NativeStyleMapping<
94
- ResolveDotPath<T, ComponentProps<C>>,
95
- ComponentProps<C>
96
- >;
98
+ nativeStyleToProp?: StyledConfigurationObject<C, T>["nativeStyleMapping"];
97
99
  }
98
100
 
99
101
  type NativeStyleMapping<T, S> = T extends object
@@ -145,6 +147,6 @@ export type RNStyle = ViewStyle & TextStyle & ImageStyle;
145
147
  /******************************** Globals ********************************/
146
148
 
147
149
  export interface ColorScheme {
148
- get: () => ColorSchemeName;
149
- set: (value: ColorSchemeName) => void;
150
+ get: () => ColorSchemeName | null | undefined;
151
+ set: (value: ColorSchemeName | null | undefined) => void;
150
152
  }
@@ -1,4 +1,6 @@
1
1
  /* eslint-disable */
2
+ import type { Component, ReactElement } from "react";
3
+
2
4
  // ---------- Base Utilities ----------
3
5
 
4
6
  type Falsy = undefined | null | false | "";
@@ -32,14 +34,13 @@ export type StyleProp<T> =
32
34
  type UnwrapRecursiveArray<
33
35
  T,
34
36
  Depth extends unknown[] = [],
35
- MaxDepth extends number = 10
37
+ MaxDepth extends number = 10,
36
38
  > = Depth["length"] extends MaxDepth
37
39
  ? T
38
40
  : T extends (infer I)[]
39
41
  ? UnwrapRecursiveArray<I, [...Depth, unknown], MaxDepth>
40
42
  : T;
41
43
 
42
-
43
44
  // Remove null, false, undefined, etc.
44
45
  type RemoveFalsy<T> = Exclude<T, Falsy>;
45
46
 
@@ -53,7 +54,7 @@ type ExtractStyleObject<T> = RemoveRegisteredStyle<
53
54
 
54
55
  // Check if something is a non-array plain object
55
56
  type IsPlainObject<T> = T extends object
56
- ? T extends Function
57
+ ? T extends Function | Component | ReactElement
57
58
  ? false
58
59
  : T extends readonly any[]
59
60
  ? false
@@ -3,22 +3,17 @@ import type { StyleDescriptor, StyleFunction } from "react-native-css/compiler";
3
3
  export function isStyleDescriptorArray(
4
4
  value: unknown,
5
5
  ): value is StyleDescriptor[] {
6
- if (Array.isArray(value)) {
7
- // If its an array and the first item is an object, the only allowed value is an array
8
- return typeof value[0] === "object" ? Array.isArray(value[0]) : true;
9
- }
10
-
11
- return false;
6
+ return Array.isArray(value) && !isStyleFunction(value);
12
7
  }
13
8
 
14
- export function isStyleFunction(
15
- value: StyleDescriptor,
16
- ): value is StyleFunction {
17
- if (Array.isArray(value)) {
18
- return typeof value[0] === "object"
19
- ? Object.keys(value[0]).length === 0
20
- : false;
21
- }
22
-
23
- return false;
9
+ export function isStyleFunction(value: unknown): value is StyleFunction {
10
+ if (!Array.isArray(value)) return false;
11
+ const marker: unknown = value[0];
12
+ return (
13
+ marker !== null &&
14
+ typeof marker === "object" &&
15
+ !Array.isArray(marker) &&
16
+ Object.keys(marker).length === 0 &&
17
+ typeof value[1] === "string"
18
+ );
24
19
  }