react-native-css 3.0.0-nightly.fa5e95b → 3.0.0-preview.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (577) 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/compiler.js +13 -8
  4. package/dist/commonjs/compiler/compiler.js.map +1 -1
  5. package/dist/commonjs/compiler/declarations.js +323 -176
  6. package/dist/commonjs/compiler/declarations.js.map +1 -1
  7. package/dist/commonjs/compiler/inheritance.test.js +12 -12
  8. package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
  9. package/dist/commonjs/compiler/keyframes.js +1 -1
  10. package/dist/commonjs/compiler/keyframes.js.map +1 -1
  11. package/dist/commonjs/compiler/pseudo-elements.js +49 -0
  12. package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
  13. package/dist/commonjs/compiler/selector-builder.js +501 -0
  14. package/dist/commonjs/compiler/selector-builder.js.map +1 -0
  15. package/dist/commonjs/compiler/selectors.js +10 -6
  16. package/dist/commonjs/compiler/selectors.js.map +1 -1
  17. package/dist/commonjs/compiler/stylesheet.js +63 -25
  18. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  19. package/dist/commonjs/compiler/supports.js +27 -0
  20. package/dist/commonjs/compiler/supports.js.map +1 -0
  21. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  22. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  23. package/dist/commonjs/components/Button.js +22 -0
  24. package/dist/commonjs/components/Button.js.map +1 -0
  25. package/dist/commonjs/components/FlatList.js +19 -0
  26. package/dist/commonjs/components/FlatList.js.map +1 -0
  27. package/dist/commonjs/components/Image.js +17 -0
  28. package/dist/commonjs/components/Image.js.map +1 -0
  29. package/dist/commonjs/components/Switch.js +17 -0
  30. package/dist/commonjs/components/Switch.js.map +1 -0
  31. package/dist/commonjs/components/TextInput.js +17 -0
  32. package/dist/commonjs/components/TextInput.js.map +1 -0
  33. package/dist/commonjs/components/index.js +48 -0
  34. package/dist/commonjs/components/index.js.map +1 -1
  35. package/dist/commonjs/components/react-native-safe-area-context.js +17 -0
  36. package/dist/commonjs/components/react-native-safe-area-context.js.map +1 -0
  37. package/dist/commonjs/components/react-native-safe-area-context.native.js +53 -0
  38. package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -0
  39. package/dist/commonjs/jest/index.js +24 -18
  40. package/dist/commonjs/jest/index.js.map +1 -1
  41. package/dist/commonjs/metro/index.js +7 -4
  42. package/dist/commonjs/metro/index.js.map +1 -1
  43. package/dist/commonjs/metro/injection-code.js +5 -10
  44. package/dist/commonjs/metro/injection-code.js.map +1 -1
  45. package/dist/commonjs/metro/metro-transformer.js +18 -8
  46. package/dist/commonjs/metro/metro-transformer.js.map +1 -1
  47. package/dist/commonjs/metro/resolver.js +3 -0
  48. package/dist/commonjs/metro/resolver.js.map +1 -1
  49. package/dist/commonjs/poison.pill.js +10 -10
  50. package/dist/commonjs/runtime/native/api.js +29 -4
  51. package/dist/commonjs/runtime/native/api.js.map +1 -1
  52. package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
  53. package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
  54. package/dist/commonjs/runtime/native/conditions/container-query.js +7 -0
  55. package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
  56. package/dist/commonjs/runtime/native/conditions/index.js +6 -40
  57. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  58. package/dist/commonjs/runtime/native/conditions/media-query.js +16 -11
  59. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  60. package/dist/commonjs/runtime/native/react/rules.js +26 -20
  61. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  62. package/dist/commonjs/runtime/native/react/useNativeCss.js +2 -2
  63. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
  64. package/dist/commonjs/runtime/native/reactivity.js +12 -25
  65. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  66. package/dist/commonjs/runtime/native/reanimated.js +17 -0
  67. package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
  68. package/dist/commonjs/runtime/native/styles/calculate-props.js +29 -9
  69. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  70. package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
  71. package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
  72. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
  73. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
  74. package/dist/commonjs/runtime/native/styles/functions/calc.js +125 -0
  75. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
  76. package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
  77. package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
  78. package/dist/commonjs/runtime/native/styles/functions/index.js +83 -0
  79. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
  80. package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js +32 -0
  81. package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js.map +1 -0
  82. package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
  83. package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
  84. package/dist/commonjs/runtime/native/styles/functions/string-functions.js +23 -0
  85. package/dist/commonjs/runtime/native/styles/functions/string-functions.js.map +1 -0
  86. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +121 -0
  87. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
  88. package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
  89. package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
  90. package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  91. package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
  92. package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +6 -37
  93. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
  94. package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
  95. package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
  96. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +50 -0
  97. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  98. package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
  99. package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
  100. package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
  101. package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  102. package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +1 -1
  103. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
  104. package/dist/commonjs/runtime/native/styles/units.js +11 -9
  105. package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
  106. package/dist/commonjs/runtime/native/styles/variables.js +3 -2
  107. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  108. package/dist/commonjs/runtime/utils/objects.js +14 -6
  109. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  110. package/dist/commonjs/runtime/utils/specificity.js +2 -1
  111. package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
  112. package/dist/commonjs/runtime/web/api.js +18 -0
  113. package/dist/commonjs/runtime/web/api.js.map +1 -1
  114. package/dist/commonjs/style-collection/index.js +110 -0
  115. package/dist/commonjs/style-collection/index.js.map +1 -0
  116. package/dist/commonjs/style-collection/root.js +29 -0
  117. package/dist/commonjs/style-collection/root.js.map +1 -0
  118. package/dist/module/compiler/atRules.js +15 -2
  119. package/dist/module/compiler/atRules.js.map +1 -1
  120. package/dist/module/compiler/compiler.js +13 -8
  121. package/dist/module/compiler/compiler.js.map +1 -1
  122. package/dist/module/compiler/compiler.types.js +1 -1
  123. package/dist/module/compiler/compiler.types.js.map +1 -1
  124. package/dist/module/compiler/declarations.js +314 -172
  125. package/dist/module/compiler/declarations.js.map +1 -1
  126. package/dist/module/compiler/inheritance.test.js +12 -12
  127. package/dist/module/compiler/inheritance.test.js.map +1 -1
  128. package/dist/module/compiler/keyframes.js +1 -1
  129. package/dist/module/compiler/keyframes.js.map +1 -1
  130. package/dist/module/compiler/pseudo-elements.js +44 -0
  131. package/dist/module/compiler/pseudo-elements.js.map +1 -0
  132. package/dist/module/compiler/selector-builder.js +496 -0
  133. package/dist/module/compiler/selector-builder.js.map +1 -0
  134. package/dist/module/compiler/selectors.js +10 -6
  135. package/dist/module/compiler/selectors.js.map +1 -1
  136. package/dist/module/compiler/stylesheet.js +61 -23
  137. package/dist/module/compiler/stylesheet.js.map +1 -1
  138. package/dist/module/compiler/supports.js +23 -0
  139. package/dist/module/compiler/supports.js.map +1 -0
  140. package/dist/module/components/ActivityIndicator.js +17 -0
  141. package/dist/module/components/ActivityIndicator.js.map +1 -0
  142. package/dist/module/components/Button.js +17 -0
  143. package/dist/module/components/Button.js.map +1 -0
  144. package/dist/module/components/FlatList.js +14 -0
  145. package/dist/module/components/FlatList.js.map +1 -0
  146. package/dist/module/components/Image.js +12 -0
  147. package/dist/module/components/Image.js.map +1 -0
  148. package/dist/module/components/Switch.js +12 -0
  149. package/dist/module/components/Switch.js.map +1 -0
  150. package/dist/module/components/TextInput.js +12 -0
  151. package/dist/module/components/TextInput.js.map +1 -0
  152. package/dist/module/components/index.js +6 -0
  153. package/dist/module/components/index.js.map +1 -1
  154. package/dist/module/components/react-native-safe-area-context.js +4 -0
  155. package/dist/module/components/react-native-safe-area-context.js.map +1 -0
  156. package/dist/module/components/react-native-safe-area-context.native.js +36 -0
  157. package/dist/module/components/react-native-safe-area-context.native.js.map +1 -0
  158. package/dist/module/jest/index.js +23 -18
  159. package/dist/module/jest/index.js.map +1 -1
  160. package/dist/module/metro/index.js +7 -4
  161. package/dist/module/metro/index.js.map +1 -1
  162. package/dist/module/metro/injection-code.js +5 -10
  163. package/dist/module/metro/injection-code.js.map +1 -1
  164. package/dist/module/metro/metro-transformer.js +18 -8
  165. package/dist/module/metro/metro-transformer.js.map +1 -1
  166. package/dist/module/metro/resolver.js +3 -0
  167. package/dist/module/metro/resolver.js.map +1 -1
  168. package/dist/module/poison.pill.js +10 -10
  169. package/dist/module/runtime/native/api.js +23 -4
  170. package/dist/module/runtime/native/api.js.map +1 -1
  171. package/dist/module/runtime/native/conditions/attributes.js +38 -0
  172. package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
  173. package/dist/module/runtime/native/conditions/container-query.js +7 -0
  174. package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
  175. package/dist/module/runtime/native/conditions/index.js +6 -40
  176. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  177. package/dist/module/runtime/native/conditions/media-query.js +17 -12
  178. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  179. package/dist/module/runtime/native/react/rules.js +24 -19
  180. package/dist/module/runtime/native/react/rules.js.map +1 -1
  181. package/dist/module/runtime/native/react/useNativeCss.js +1 -1
  182. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
  183. package/dist/module/runtime/native/reactivity.js +11 -24
  184. package/dist/module/runtime/native/reactivity.js.map +1 -1
  185. package/dist/module/runtime/native/reanimated.js +13 -0
  186. package/dist/module/runtime/native/reanimated.js.map +1 -0
  187. package/dist/module/runtime/native/styles/calculate-props.js +30 -10
  188. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  189. package/dist/module/runtime/native/styles/defaults.js +1 -1
  190. package/dist/module/runtime/native/styles/defaults.js.map +1 -1
  191. package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
  192. package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
  193. package/dist/module/runtime/native/styles/functions/calc.js +120 -0
  194. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
  195. package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
  196. package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
  197. package/dist/module/runtime/native/styles/functions/index.js +10 -0
  198. package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
  199. package/dist/module/runtime/native/styles/functions/numeric-functions.js +25 -0
  200. package/dist/module/runtime/native/styles/functions/numeric-functions.js.map +1 -0
  201. package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
  202. package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
  203. package/dist/module/runtime/native/styles/functions/string-functions.js +18 -0
  204. package/dist/module/runtime/native/styles/functions/string-functions.js.map +1 -0
  205. package/dist/module/runtime/native/styles/functions/transform-functions.js +114 -0
  206. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
  207. package/dist/module/runtime/native/styles/resolve.js +20 -44
  208. package/dist/module/runtime/native/styles/resolve.js.map +1 -1
  209. package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  210. package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
  211. package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
  212. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
  213. package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
  214. package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
  215. package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +16 -6
  216. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  217. package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
  218. package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
  219. package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
  220. package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  221. package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +1 -1
  222. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
  223. package/dist/module/runtime/native/styles/units.js +12 -9
  224. package/dist/module/runtime/native/styles/units.js.map +1 -1
  225. package/dist/module/runtime/native/styles/variables.js +2 -1
  226. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  227. package/dist/module/runtime/utils/objects.js +14 -6
  228. package/dist/module/runtime/utils/objects.js.map +1 -1
  229. package/dist/module/runtime/utils/specificity.js +2 -1
  230. package/dist/module/runtime/utils/specificity.js.map +1 -1
  231. package/dist/module/runtime/web/api.js +18 -1
  232. package/dist/module/runtime/web/api.js.map +1 -1
  233. package/dist/module/style-collection/index.js +95 -0
  234. package/dist/module/style-collection/index.js.map +1 -0
  235. package/dist/module/style-collection/root.js +25 -0
  236. package/dist/module/style-collection/root.js.map +1 -0
  237. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -1
  239. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  240. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +11 -13
  241. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  242. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +26 -17
  243. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
  245. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
  246. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +24 -0
  247. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  248. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
  249. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
  250. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +7 -7
  251. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  252. package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
  253. package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
  254. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
  255. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  256. package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
  257. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  258. package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
  259. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  260. package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
  261. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  262. package/dist/typescript/commonjs/src/components/Switch.d.ts +8 -0
  263. package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
  264. package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
  265. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  266. package/dist/typescript/commonjs/src/components/index.d.ts +6 -0
  267. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
  268. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts +2 -0
  269. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts.map +1 -0
  270. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +4 -0
  271. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  272. package/dist/typescript/commonjs/src/jest/index.d.ts +13 -3
  273. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  274. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  275. package/dist/typescript/commonjs/src/metro/injection-code.d.ts +4 -7
  276. package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
  277. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
  278. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
  279. package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
  280. package/dist/typescript/commonjs/src/runtime/native/api.d.ts +16 -2
  281. package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
  282. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
  283. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  284. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  285. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
  286. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
  287. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
  288. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  289. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +1 -11
  290. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  291. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
  292. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
  293. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +1 -1
  294. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  295. package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
  296. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  297. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  298. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
  299. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  300. package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  301. package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  302. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +8 -0
  303. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  304. package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
  305. package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
  306. package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  307. package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  308. package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
  309. package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
  310. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  311. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  312. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
  313. package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  314. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  315. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  316. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  317. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  318. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  319. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  320. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  321. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  322. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  323. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  324. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  325. package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  326. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  327. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
  328. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  329. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  330. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
  331. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
  332. package/dist/typescript/commonjs/src/runtime/web/api.d.ts +9 -3
  333. package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
  334. package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
  335. package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
  336. package/dist/typescript/commonjs/src/style-collection/root.d.ts +11 -0
  337. package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
  338. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
  339. package/dist/typescript/module/src/compiler/compiler.d.ts +1 -1
  340. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  341. package/dist/typescript/module/src/compiler/compiler.types.d.ts +11 -13
  342. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  343. package/dist/typescript/module/src/compiler/declarations.d.ts +26 -17
  344. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  345. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
  346. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
  347. package/dist/typescript/module/src/compiler/selector-builder.d.ts +24 -0
  348. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  349. package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
  350. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
  351. package/dist/typescript/module/src/compiler/stylesheet.d.ts +7 -7
  352. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  353. package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
  354. package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
  355. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
  356. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  357. package/dist/typescript/module/src/components/Button.d.ts +13 -0
  358. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  359. package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
  360. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  361. package/dist/typescript/module/src/components/Image.d.ts +8 -0
  362. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  363. package/dist/typescript/module/src/components/Switch.d.ts +8 -0
  364. package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
  365. package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
  366. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  367. package/dist/typescript/module/src/components/index.d.ts +6 -0
  368. package/dist/typescript/module/src/components/index.d.ts.map +1 -1
  369. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts +2 -0
  370. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts.map +1 -0
  371. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +4 -0
  372. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  373. package/dist/typescript/module/src/jest/index.d.ts +13 -3
  374. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  375. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  376. package/dist/typescript/module/src/metro/injection-code.d.ts +4 -7
  377. package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
  378. package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
  379. package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
  380. package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
  381. package/dist/typescript/module/src/runtime/native/api.d.ts +16 -2
  382. package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
  383. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
  384. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  385. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  386. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
  387. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
  388. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
  389. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  390. package/dist/typescript/module/src/runtime/native/reactivity.d.ts +1 -11
  391. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  392. package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
  393. package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
  394. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +1 -1
  395. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  396. package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
  397. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  398. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  399. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
  400. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  401. package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  402. package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  403. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +8 -0
  404. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  405. package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
  406. package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
  407. package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  408. package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  409. package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
  410. package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
  411. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  412. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  413. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
  414. package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  415. package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  416. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  417. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  418. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  419. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  420. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  421. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  422. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  423. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  424. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  425. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  426. package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  427. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  428. package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
  429. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  430. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  431. package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
  432. package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
  433. package/dist/typescript/module/src/runtime/web/api.d.ts +9 -3
  434. package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
  435. package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
  436. package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
  437. package/dist/typescript/module/src/style-collection/root.d.ts +11 -0
  438. package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
  439. package/package.json +30 -15
  440. package/src/compiler/atRules.ts +16 -2
  441. package/src/compiler/compiler.ts +12 -10
  442. package/src/compiler/compiler.types.ts +11 -14
  443. package/src/compiler/declarations.ts +518 -215
  444. package/src/compiler/inheritance.test.ts +10 -10
  445. package/src/compiler/keyframes.ts +1 -1
  446. package/src/compiler/pseudo-elements.ts +54 -0
  447. package/src/compiler/selector-builder.ts +586 -0
  448. package/src/compiler/selectors.ts +20 -6
  449. package/src/compiler/stylesheet.ts +93 -33
  450. package/src/compiler/supports.ts +26 -0
  451. package/src/components/ActivityIndicator.tsx +27 -0
  452. package/src/components/Button.tsx +22 -0
  453. package/src/components/FlatList.tsx +21 -0
  454. package/src/components/Image.tsx +17 -0
  455. package/src/components/Switch.tsx +17 -0
  456. package/src/components/TextInput.tsx +17 -0
  457. package/src/components/index.tsx +6 -0
  458. package/src/components/react-native-safe-area-context.native.tsx +40 -0
  459. package/src/components/react-native-safe-area-context.tsx +1 -0
  460. package/src/jest/index.ts +26 -17
  461. package/src/metro/index.ts +12 -7
  462. package/src/metro/injection-code.ts +6 -10
  463. package/src/metro/metro-transformer.ts +27 -10
  464. package/src/metro/resolver.ts +8 -0
  465. package/src/poison.pill.ts +10 -10
  466. package/src/runtime/native/{api.ts → api.tsx} +34 -5
  467. package/src/runtime/native/conditions/attributes.ts +52 -0
  468. package/src/runtime/native/conditions/container-query.ts +5 -0
  469. package/src/runtime/native/conditions/index.ts +7 -59
  470. package/src/runtime/native/conditions/media-query.ts +18 -12
  471. package/src/runtime/native/react/rules.ts +27 -17
  472. package/src/runtime/native/react/useNativeCss.ts +1 -1
  473. package/src/runtime/native/reactivity.ts +13 -33
  474. package/src/runtime/native/reanimated.ts +22 -0
  475. package/src/runtime/native/styles/calculate-props.ts +30 -8
  476. package/src/runtime/native/styles/defaults.ts +1 -0
  477. package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
  478. package/src/runtime/native/styles/functions/calc.ts +121 -0
  479. package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
  480. package/src/runtime/native/styles/functions/index.ts +7 -0
  481. package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
  482. package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
  483. package/src/runtime/native/styles/functions/string-functions.ts +22 -0
  484. package/src/runtime/native/styles/functions/transform-functions.ts +84 -0
  485. package/src/runtime/native/styles/resolve.ts +20 -63
  486. package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
  487. package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -62
  488. package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
  489. package/src/runtime/native/styles/shorthands/box-shadow.ts +74 -0
  490. package/src/runtime/native/styles/shorthands/index.ts +5 -0
  491. package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
  492. package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +4 -2
  493. package/src/runtime/native/styles/units.ts +14 -9
  494. package/src/runtime/native/styles/variables.ts +5 -5
  495. package/src/runtime/utils/objects.ts +16 -4
  496. package/src/runtime/utils/specificity.ts +1 -0
  497. package/src/runtime/web/{api.ts → api.tsx} +29 -3
  498. package/src/style-collection/index.ts +142 -0
  499. package/src/style-collection/root.ts +37 -0
  500. package/dist/commonjs/compiler/attributes.test.js +0 -20
  501. package/dist/commonjs/compiler/attributes.test.js.map +0 -1
  502. package/dist/commonjs/doctor/index.js +0 -6
  503. package/dist/commonjs/doctor/index.js.map +0 -1
  504. package/dist/commonjs/runtime/native/injection.js +0 -98
  505. package/dist/commonjs/runtime/native/injection.js.map +0 -1
  506. package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
  507. package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
  508. package/dist/commonjs/runtime/native/styles/box-shadow.js +0 -40
  509. package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
  510. package/dist/commonjs/runtime/native/styles/calc.js +0 -85
  511. package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
  512. package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
  513. package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
  514. package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
  515. package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
  516. package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
  517. package/dist/module/compiler/attributes.test.js +0 -20
  518. package/dist/module/compiler/attributes.test.js.map +0 -1
  519. package/dist/module/doctor/index.js +0 -4
  520. package/dist/module/doctor/index.js.map +0 -1
  521. package/dist/module/runtime/native/injection.js +0 -93
  522. package/dist/module/runtime/native/injection.js.map +0 -1
  523. package/dist/module/runtime/native/styles/animation.js.map +0 -1
  524. package/dist/module/runtime/native/styles/border.js.map +0 -1
  525. package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
  526. package/dist/module/runtime/native/styles/calc.js +0 -79
  527. package/dist/module/runtime/native/styles/calc.js.map +0 -1
  528. package/dist/module/runtime/native/styles/filters.js.map +0 -1
  529. package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
  530. package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
  531. package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
  532. package/dist/module/runtime/native/styles/transform.js.map +0 -1
  533. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +0 -2
  534. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +0 -1
  535. package/dist/typescript/commonjs/src/doctor/index.d.ts +0 -2
  536. package/dist/typescript/commonjs/src/doctor/index.d.ts.map +0 -1
  537. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -16
  538. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
  539. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
  540. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
  541. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
  542. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
  543. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
  544. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  545. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
  546. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
  547. package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
  548. package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  549. package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  550. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
  551. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  552. package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
  553. package/dist/typescript/module/src/compiler/attributes.test.d.ts +0 -2
  554. package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +0 -1
  555. package/dist/typescript/module/src/doctor/index.d.ts +0 -2
  556. package/dist/typescript/module/src/doctor/index.d.ts.map +0 -1
  557. package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -16
  558. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
  559. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
  560. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
  561. package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
  562. package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
  563. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
  564. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  565. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
  566. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
  567. package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
  568. package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  569. package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  570. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
  571. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  572. package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
  573. package/src/compiler/attributes.test.ts +0 -28
  574. package/src/doctor/index.ts +0 -1
  575. package/src/runtime/native/injection.ts +0 -131
  576. package/src/runtime/native/styles/box-shadow.ts +0 -54
  577. package/src/runtime/native/styles/calc.ts +0 -97
@@ -45,6 +45,14 @@ export function nativeResolver(
45
45
  return resolver(context, `react-native-css/components`, platform);
46
46
  }
47
47
 
48
+ if (moduleName === "react-native-safe-area-context") {
49
+ return resolver(
50
+ context,
51
+ `react-native-css/components/react-native-safe-area-context`,
52
+ platform,
53
+ );
54
+ }
55
+
48
56
  // We only care about `react-native/Library/Components/<module>.js` components
49
57
  const segments = resolution.filePath.split(sep);
50
58
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -3,9 +3,9 @@ const canWarn = process.env.NODE_ENV !== "test";
3
3
  if (canWarn) {
4
4
  throw new Error(`react-native-css has encountered a setup error.
5
5
 
6
- ┌─────-─┐
7
- | Metro |
8
- └─────-─┘
6
+ ┌───────┐
7
+ │ Metro │
8
+ └───────┘
9
9
 
10
10
  Either your metro.config.js is missing the 'withReactNativeCSS' wrapper OR
11
11
  the resolver.resolveRequest function of your config is being overridden, and not calling the parent resolver.
@@ -19,15 +19,15 @@ module.exports = with3rdPartyPlugin(
19
19
  )
20
20
  \`\`\`
21
21
 
22
- ┌─────------─┐
23
- | NativeWind |
24
- └─────------─┘
22
+ ┌────────────┐
23
+ │ NativeWind │
24
+ └────────────┘
25
25
 
26
- If you are using NativeWind with the 'withNativeWind' function, follow the Metro instructions above, but use 'withNativeWind' instead of 'withReactNativeCSS'.
26
+ If you are using NativeWind follow the Metro instructions above but use 'withNativeWind' instead of 'withReactNativeCSS'.
27
27
 
28
- ┌─────----------─┐
29
- | Other bundlers |
30
- └─────----------─┘
28
+ ┌────────────────┐
29
+ │ Other bundlers │
30
+ └────────────────┘
31
31
 
32
32
  If you are using another bundler (Vite, Webpack, etc), or non-Metro framework (Next.js, Remix, etc), please ensure you have included 'react-native-css/babel' as a babel preset.
33
33
  `);
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable */
2
- import { useContext, useState } from "react";
2
+ import { useContext, useMemo, useState, type PropsWithChildren } from "react";
3
3
  import { Appearance } from "react-native";
4
4
 
5
- import type { InlineVariable, StyleDescriptor } from "../../compiler";
5
+ import type { StyleDescriptor } from "../../compiler";
6
6
  import type {
7
7
  ColorScheme,
8
8
  Props,
@@ -18,10 +18,13 @@ import {
18
18
  VariableContext,
19
19
  type Effect,
20
20
  type Getter,
21
+ type VariableContextValue,
21
22
  } from "./reactivity";
22
23
  import { resolveValue } from "./styles/resolve";
23
24
 
24
- export { StyleCollection } from "./injection";
25
+ export { StyleCollection } from "react-native-css/style-collection";
26
+
27
+ export { useNativeCss };
25
28
 
26
29
  /**
27
30
  * Generates a new Higher-Order component the wraps the base component and applies the styles.
@@ -100,7 +103,33 @@ export function useNativeVariable(name: string) {
100
103
  return resolveValue([{}, "var", [name]], effect.get, { inheritedVariables });
101
104
  }
102
105
 
106
+ /**
107
+ * @deprecated Use `<VariableContextProvider />` instead.
108
+ */
103
109
  export function vars(variables: Record<string, StyleDescriptor>) {
104
- (variables as InlineVariable)[VAR_SYMBOL] = "inline";
105
- return variables;
110
+ return Object.assign(
111
+ { [VAR_SYMBOL]: "inline" },
112
+ Object.fromEntries(
113
+ Object.entries(variables).map(([k, v]) => [k.replace(/^--/, ""), v]),
114
+ ),
115
+ );
116
+ }
117
+
118
+ export function VariableContextProvider(
119
+ props: PropsWithChildren<{ value: Record<`--${string}`, StyleDescriptor> }>,
120
+ ) {
121
+ const inheritedVariables = useContext(VariableContext);
122
+
123
+ const value: VariableContextValue = useMemo(
124
+ () => ({
125
+ ...inheritedVariables,
126
+ ...Object.fromEntries(
127
+ Object.entries(props.value).map(([k, v]) => [k.replace(/^--/, ""), v]),
128
+ ),
129
+ [VAR_SYMBOL]: true,
130
+ }),
131
+ [inheritedVariables, props.value],
132
+ );
133
+
134
+ return <VariableContext value={value}>{props.children}</VariableContext>;
106
135
  }
@@ -0,0 +1,52 @@
1
+ import type { AttributeQuery } from "../../../compiler";
2
+ import type { Props } from "../../runtime.types";
3
+ import type { RenderGuard } from "./guards";
4
+
5
+ export function testAttributes(
6
+ queries: AttributeQuery[],
7
+ props: Props,
8
+ guards: RenderGuard[],
9
+ ) {
10
+ return queries.every((query) => testAttribute(query, props, guards));
11
+ }
12
+
13
+ function testAttribute(
14
+ [type, prop, operator, testValue]: AttributeQuery,
15
+ props: Props,
16
+ guards: RenderGuard[],
17
+ ) {
18
+ let value: unknown;
19
+
20
+ if (type === "a") {
21
+ value = props?.[prop];
22
+ } else {
23
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
24
+ value = props?.dataSet?.[prop];
25
+ }
26
+
27
+ guards.push([type, prop, value]);
28
+
29
+ if (!operator) {
30
+ return value !== undefined && value !== null && value !== false;
31
+ }
32
+
33
+ switch (operator) {
34
+ case "!":
35
+ return !value;
36
+ case "=":
37
+ return value == testValue;
38
+ case "~=":
39
+ return testValue && value?.toString().split(" ").includes(testValue);
40
+ case "|=":
41
+ return testValue && value?.toString().startsWith(testValue + "-");
42
+ case "^=":
43
+ return testValue && value?.toString().startsWith(testValue);
44
+ case "$=":
45
+ return testValue && value?.toString().endsWith(testValue);
46
+ case "*=":
47
+ return testValue && value?.toString().includes(testValue);
48
+ default:
49
+ operator satisfies never;
50
+ return false;
51
+ }
52
+ }
@@ -16,6 +16,7 @@ import {
16
16
  type ContainerContextValue,
17
17
  type Getter,
18
18
  } from "../reactivity";
19
+ // import { testAttributes } from "./attributes";
19
20
  import type { RenderGuard } from "./guards";
20
21
 
21
22
  export const DEFAULT_CONTAINER_NAME = "c:___default___";
@@ -46,6 +47,10 @@ export function testContainerQuery(
46
47
  return false;
47
48
  }
48
49
 
50
+ // if (query.a && !testAttributes(query.a, container.props, guards)) {
51
+ // return false;
52
+ // }
53
+
49
54
  if (query.m && !testContainerMediaCondition(query.m, container, get)) {
50
55
  return false;
51
56
  }
@@ -1,9 +1,4 @@
1
- /* eslint-disable */
2
- import type {
3
- AttributeQuery,
4
- PseudoClassesQuery,
5
- StyleRule,
6
- } from "../../../compiler";
1
+ import type { PseudoClassesQuery, StyleRule } from "../../../compiler";
7
2
  import type { Props } from "../../runtime.types";
8
3
  import {
9
4
  activeFamily,
@@ -12,6 +7,7 @@ import {
12
7
  type ContainerContextValue,
13
8
  type Getter,
14
9
  } from "../reactivity";
10
+ import { testAttributes } from "./attributes";
15
11
  import { testContainerQueries } from "./container-query";
16
12
  import type { RenderGuard } from "./guards";
17
13
  import { testMediaQuery } from "./media-query";
@@ -29,7 +25,7 @@ export function testRule(
29
25
  if (rule.m && !testMediaQuery(rule.m, get)) {
30
26
  return false;
31
27
  }
32
- if (rule.aq && !attributes(rule.aq, props, guards)) {
28
+ if (rule.aq && !testAttributes(rule.aq, props, guards)) {
33
29
  return false;
34
30
  }
35
31
  if (
@@ -43,10 +39,12 @@ export function testRule(
43
39
  }
44
40
 
45
41
  function pseudoClasses(query: PseudoClassesQuery, get: Getter) {
46
- if (query.h && !get(hoverFamily(get))) {
42
+ // IMPORTANT: active needs: to be first. Modifies a global value
43
+ // that we use to determine if the component should be a pressable
44
+ if (query.a && !get(activeFamily(get))) {
47
45
  return false;
48
46
  }
49
- if (query.a && !get(activeFamily(get))) {
47
+ if (query.h && !get(hoverFamily(get))) {
50
48
  return false;
51
49
  }
52
50
  if (query.f && !get(focusFamily(get))) {
@@ -54,53 +52,3 @@ function pseudoClasses(query: PseudoClassesQuery, get: Getter) {
54
52
  }
55
53
  return true;
56
54
  }
57
-
58
- function attributes(
59
- queries: AttributeQuery[],
60
- props: Props,
61
- guards: RenderGuard[],
62
- ) {
63
- return queries.every((query) => testAttribute(query, props, guards));
64
- }
65
-
66
- function testAttribute(
67
- query: AttributeQuery,
68
- props: Props,
69
- guards: RenderGuard[],
70
- ) {
71
- let value: any;
72
-
73
- if (query[0] === "a") {
74
- value = props?.[query[1]];
75
- } else {
76
- value = props?.dataSet?.[query[1]];
77
- }
78
-
79
- guards.push([query[0], query[1], value]);
80
-
81
- const operator = query[2];
82
-
83
- if (!operator) {
84
- return value !== undefined && value !== null && value !== false;
85
- }
86
-
87
- switch (operator) {
88
- case "!":
89
- return !value;
90
- case "=":
91
- return value == query[3];
92
- case "~=":
93
- return value?.toString().split(" ").includes(query[3]);
94
- case "|=":
95
- return value?.toString().startsWith(query[3] + "-");
96
- case "^=":
97
- return value?.toString().startsWith(query[3]);
98
- case "$=":
99
- return value?.toString().endsWith(query[3]);
100
- case "*=":
101
- return value?.toString().includes(query[3]);
102
- default:
103
- operator satisfies never;
104
- return false;
105
- }
106
- }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- import { PixelRatio, Platform } from "react-native";
2
+ import { I18nManager, PixelRatio, Platform } from "react-native";
3
3
 
4
4
  import type { MediaCondition } from "../../../compiler";
5
5
  import { colorScheme, vh, vw, type Getter } from "../reactivity";
@@ -34,33 +34,39 @@ function test(mediaQuery: MediaCondition, get: Getter): Boolean {
34
34
  }
35
35
 
36
36
  function testComparison(mediaQuery: MediaCondition, get: Getter): Boolean {
37
- let left: number | undefined;
38
- const right = mediaQuery[2];
37
+ const value = mediaQuery[2];
39
38
 
40
39
  switch (mediaQuery[1]) {
40
+ case "dir":
41
+ return (I18nManager.isRTL && value === "rtl") || value === "ltr";
42
+ case "hover":
43
+ return true;
41
44
  case "platform":
42
- return right === "native" || right === Platform.OS;
45
+ return value === "native" || value === Platform.OS;
43
46
  case "prefers-color-scheme": {
44
- return right === get(colorScheme);
47
+ return value === get(colorScheme);
45
48
  }
46
49
  case "display-mode":
47
- return right === "native" || Platform.OS === right;
50
+ return value === "native" || Platform.OS === value;
48
51
  case "min-width":
49
- return typeof right === "number" && get(vw) >= right;
52
+ return typeof value === "number" && get(vw) >= value;
50
53
  case "max-width":
51
- return typeof right === "number" && get(vw) <= right;
54
+ return typeof value === "number" && get(vw) <= value;
52
55
  case "min-height":
53
- return typeof right === "number" && get(vh) >= right;
56
+ return typeof value === "number" && get(vh) >= value;
54
57
  case "max-height":
55
- return typeof right === "number" && get(vh) <= right;
58
+ return typeof value === "number" && get(vh) <= value;
56
59
  case "orientation":
57
- return right === "landscape" ? get(vh) < get(vw) : get(vh) >= get(vw);
60
+ return value === "landscape" ? get(vh) < get(vw) : get(vh) >= get(vw);
58
61
  }
59
62
 
60
- if (typeof right !== "number") {
63
+ if (typeof value !== "number") {
61
64
  return false;
62
65
  }
63
66
 
67
+ let left: number | undefined;
68
+ const right = value;
69
+
64
70
  switch (mediaQuery[1]) {
65
71
  case "width":
66
72
  left = get(vw);
@@ -1,10 +1,11 @@
1
1
  /* eslint-disable */
2
+ import { StyleCollection } from "react-native-css/style-collection";
3
+
2
4
  import type { InlineVariable, StyleRule } from "../../../compiler";
3
5
  import { getDeepPath } from "../../utils";
4
6
  import { testRule } from "../conditions";
5
7
  import { DEFAULT_CONTAINER_NAME } from "../conditions/container-query";
6
8
  import type { RenderGuard } from "../conditions/guards";
7
- import { StyleCollection } from "../injection";
8
9
  import {
9
10
  activeFamily,
10
11
  containerLayoutFamily,
@@ -12,6 +13,7 @@ import {
12
13
  hoverFamily,
13
14
  VAR_SYMBOL,
14
15
  weakFamily,
16
+ type ContainerContextValue,
15
17
  type VariableContextValue,
16
18
  } from "../reactivity";
17
19
  import { stylesFamily } from "../styles";
@@ -36,11 +38,12 @@ export function updateRules(
36
38
 
37
39
  let usesVariables = false;
38
40
 
39
- let variables = state.variables ? inheritedVariables : undefined;
40
- let containers = state.containers ? inheritedContainers : undefined;
41
+ let variables: VariableContextValue | undefined;
42
+ let containers: ContainerContextValue | undefined;
41
43
  const inlineVariables = new Set<InlineVariable>();
42
44
 
43
45
  let animated = false;
46
+ let pressable = false;
44
47
 
45
48
  for (const config of state.configs) {
46
49
  const source = currentProps?.[config.source];
@@ -68,6 +71,11 @@ export function updateRules(
68
71
  if (target) {
69
72
  if (Array.isArray(target)) {
70
73
  for (const item of target) {
74
+ // undefined or falsy is allowed in the style array
75
+ if (!item) {
76
+ continue;
77
+ }
78
+
71
79
  if (VAR_SYMBOL in item) {
72
80
  inlineVariables.add(item);
73
81
  } else if (
@@ -93,13 +101,20 @@ export function updateRules(
93
101
  }
94
102
 
95
103
  for (let rule of styleRuleSet) {
96
- // Even if a rule does not match, make sure we register that it could set
97
- // a variable or container or be animated.
98
- if (rule.v) usesVariables = true;
99
- if (rule.c) containers ??= inheritedContainers;
104
+ usesVariables ||= Boolean(rule.dv);
105
+
106
+ // We do this even if the rule doesn't match so we can maintain a consistent render tree
107
+ // We we need to inject React context
100
108
  if (rule.a) animated = true;
101
109
 
102
- usesVariables ||= Boolean(rule.dv);
110
+ if (rule.v) {
111
+ variables ??= inheritedVariables;
112
+ }
113
+
114
+ if (rule.c) {
115
+ containers ??= inheritedContainers;
116
+ activeFamily(state.ruleEffectGetter);
117
+ }
103
118
 
104
119
  if (
105
120
  !testRule(
@@ -114,11 +129,8 @@ export function updateRules(
114
129
  }
115
130
 
116
131
  if (rule.v) {
117
- // We're going to set a value, so we need to create a new object
118
132
  if (variables === inheritedVariables) {
119
133
  variables = { ...inheritedVariables };
120
- } else {
121
- variables ??= { ...inheritedVariables };
122
134
  }
123
135
 
124
136
  for (const v of rule.v) {
@@ -163,7 +175,7 @@ export function updateRules(
163
175
 
164
176
  if (process.env.NODE_ENV !== "production") {
165
177
  if (isRerender) {
166
- let pressable = activeFamily.has(state.ruleEffectGetter);
178
+ const pressable = activeFamily.has(state.ruleEffectGetter);
167
179
 
168
180
  if (Boolean(variables) !== Boolean(state.variables)) {
169
181
  console.log(
@@ -186,11 +198,7 @@ export function updateRules(
186
198
  }
187
199
  }
188
200
 
189
- // We only track this in development
190
- let pressable =
191
- process.env.NODE_ENV === "production"
192
- ? undefined
193
- : activeFamily.has(state.ruleEffectGetter);
201
+ pressable = activeFamily.has(state.ruleEffectGetter);
194
202
 
195
203
  if (!rules.size && !state.stylesObs && !inlineVariables.size) {
196
204
  return {
@@ -199,6 +207,8 @@ export function updateRules(
199
207
  guards,
200
208
  animated,
201
209
  pressable,
210
+ variables,
211
+ containers,
202
212
  };
203
213
  }
204
214
 
@@ -20,8 +20,8 @@ import {
20
20
  type Getter,
21
21
  type VariableContextValue,
22
22
  } from "../reactivity";
23
+ import { animatedComponentFamily } from "../reanimated";
23
24
  import { getStyledProps, stylesFamily } from "../styles";
24
- import { animatedComponentFamily } from "../styles/animation";
25
25
  import { updateRules } from "./rules";
26
26
 
27
27
  export type Config = {
@@ -7,8 +7,7 @@ import {
7
7
  type LayoutRectangle,
8
8
  } from "react-native";
9
9
 
10
- import type { StyleDescriptor, VariableValue } from "../../compiler";
11
- import { testMediaQuery } from "./conditions/media-query";
10
+ import type { StyleDescriptor } from "../../compiler";
12
11
 
13
12
  export type Effect = {
14
13
  observers: Set<Effect>;
@@ -190,37 +189,6 @@ export const VariableContext = createContext<VariableContextValue>({
190
189
  [VAR_SYMBOL]: true,
191
190
  });
192
191
 
193
- const rootVariableFamily = () => {
194
- return family<string, Observable<StyleDescriptor, VariableValue[]>>(() => {
195
- const obs = observable<StyleDescriptor, VariableValue[]>(
196
- (read, variableValue) => {
197
- if (!variableValue) return undefined;
198
-
199
- for (const [value, mediaQuery] of variableValue) {
200
- if (!mediaQuery) {
201
- return value;
202
- }
203
-
204
- if (testMediaQuery(mediaQuery, read)) {
205
- return value;
206
- }
207
- }
208
-
209
- return undefined;
210
- },
211
- );
212
-
213
- return obs;
214
- });
215
- };
216
-
217
- export const rootVariables = rootVariableFamily();
218
- export const universalVariables = rootVariableFamily();
219
-
220
- /** Units *********************************************************************/
221
-
222
- export const rem = observable(14);
223
-
224
192
  /** Pseudo Classes ************************************************************/
225
193
 
226
194
  export const hoverFamily = weakFamily(() => observable(false));
@@ -237,6 +205,18 @@ export const vh = observable<number>(
237
205
  (read, value) => value ?? read(dimensions)?.height,
238
206
  );
239
207
 
208
+ Dimensions.addEventListener("change", ({ window }) => {
209
+ observableBatch.current = new Set();
210
+ vw.set(window.width);
211
+ vh.set(window.height);
212
+
213
+ for (const effect of observableBatch.current) {
214
+ effect.run();
215
+ }
216
+
217
+ observableBatch.current = undefined;
218
+ });
219
+
240
220
  /** Color Scheme **************************************************************/
241
221
 
242
222
  export const colorScheme = observable<ColorSchemeName>(
@@ -0,0 +1,22 @@
1
+ import type { ComponentType } from "react";
2
+
3
+ import { weakFamily } from "./reactivity";
4
+
5
+ export const animatedComponentFamily = weakFamily(
6
+ (component: ComponentType) => {
7
+ if (
8
+ "displayName" in component &&
9
+ component.displayName?.startsWith("Animated.")
10
+ ) {
11
+ return component;
12
+ }
13
+
14
+ const createAnimatedComponent =
15
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-member-access
16
+ require("react-native-reanimated").createAnimatedComponent as (
17
+ component: ComponentType,
18
+ ) => ComponentType;
19
+
20
+ return createAnimatedComponent(component);
21
+ },
22
+ );
@@ -4,13 +4,14 @@ import type {
4
4
  StyleDeclaration,
5
5
  StyleRule,
6
6
  } from "../../../compiler";
7
- import { applyValue, Specificity as S } from "../../utils";
7
+ import { applyValue, getDeepPath, Specificity as S } from "../../utils";
8
8
  import type { RenderGuard } from "../conditions/guards";
9
9
  import {
10
10
  VAR_SYMBOL,
11
11
  type Getter,
12
12
  type VariableContextValue,
13
13
  } from "../reactivity";
14
+ import { transformKeys } from "./defaults";
14
15
  import { resolveValue } from "./resolve";
15
16
 
16
17
  export function calculateProps(
@@ -28,6 +29,7 @@ export function calculateProps(
28
29
  let important: Record<string, any> | undefined;
29
30
 
30
31
  const delayedStyles: (() => void)[] = [];
32
+ const transformStyles: (() => void)[] = [];
31
33
 
32
34
  for (const rule of rules) {
33
35
  if (VAR_SYMBOL in rule) {
@@ -67,6 +69,7 @@ export function calculateProps(
67
69
  inlineVariables,
68
70
  inheritedVariables,
69
71
  delayedStyles,
72
+ transformStyles,
70
73
  guards,
71
74
  target,
72
75
  topLevelTarget,
@@ -78,6 +81,10 @@ export function calculateProps(
78
81
  delayedStyle();
79
82
  }
80
83
 
84
+ for (const transformStyle of transformStyles) {
85
+ transformStyle();
86
+ }
87
+
81
88
  return {
82
89
  normal,
83
90
  guards,
@@ -91,6 +98,7 @@ export function applyDeclarations(
91
98
  inlineVariables: InlineVariable,
92
99
  inheritedVariables: VariableContextValue,
93
100
  delayedStyles: (() => void)[] = [],
101
+ transformStyles: (() => void)[] = [],
94
102
  guards: RenderGuard[] = [],
95
103
  target: Record<string, any> = {},
96
104
  topLevelTarget = target,
@@ -136,7 +144,7 @@ export function applyDeclarations(
136
144
 
137
145
  const shouldDelay = declaration[2];
138
146
 
139
- if (shouldDelay) {
147
+ if (shouldDelay || transformKeys.has(prop)) {
140
148
  /**
141
149
  * We need to delay the resolution of this value until after all
142
150
  * styles have been calculated. But another style might override
@@ -147,10 +155,11 @@ export function applyDeclarations(
147
155
  * mutate the props object and not create a new one
148
156
  */
149
157
  const originalValue = value;
150
- value = {};
151
- delayedStyles.push(() => {
152
- if (target[prop] === value) {
153
- delete target[prop];
158
+ // This needs to be a object with the [prop] so we can discover in transform arrays
159
+ value = { [prop]: true };
160
+
161
+ if (transformKeys.has(prop)) {
162
+ transformStyles.push(() => {
154
163
  value = resolveValue(originalValue, get, {
155
164
  inlineVariables,
156
165
  inheritedVariables,
@@ -158,8 +167,21 @@ export function applyDeclarations(
158
167
  calculateProps,
159
168
  });
160
169
  applyValue(target, prop, value);
161
- }
162
- });
170
+ });
171
+ } else {
172
+ delayedStyles.push(() => {
173
+ if (getDeepPath(target, prop) === value) {
174
+ delete target[prop];
175
+ value = resolveValue(originalValue, get, {
176
+ inlineVariables,
177
+ inheritedVariables,
178
+ renderGuards: guards,
179
+ calculateProps,
180
+ });
181
+ applyValue(target, prop, value);
182
+ }
183
+ });
184
+ }
163
185
  } else {
164
186
  value = resolveValue(value, get, {
165
187
  inlineVariables,
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable */
2
2
  export const transformKeys = new Set([
3
+ "translate",
3
4
  "translateX",
4
5
  "translateY",
5
6
  "scale",