react-native-css 3.0.0-nightly.8dd703d → 3.0.0-nightly.9c84741

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 (368) hide show
  1. package/dist/commonjs/compiler/compiler.js +12 -5
  2. package/dist/commonjs/compiler/compiler.js.map +1 -1
  3. package/dist/commonjs/compiler/declarations.js +89 -82
  4. package/dist/commonjs/compiler/declarations.js.map +1 -1
  5. package/dist/commonjs/compiler/inheritance.test.js +10 -10
  6. package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
  7. package/dist/commonjs/compiler/pseudo-elements.js +49 -0
  8. package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
  9. package/dist/commonjs/compiler/selector-builder.js +124 -80
  10. package/dist/commonjs/compiler/selector-builder.js.map +1 -1
  11. package/dist/commonjs/compiler/stylesheet.js +18 -6
  12. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  13. package/dist/commonjs/compiler/supports.js +27 -0
  14. package/dist/commonjs/compiler/supports.js.map +1 -0
  15. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  16. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  17. package/dist/commonjs/components/Button.js +22 -0
  18. package/dist/commonjs/components/Button.js.map +1 -0
  19. package/dist/commonjs/components/FlatList.js +19 -0
  20. package/dist/commonjs/components/FlatList.js.map +1 -0
  21. package/dist/commonjs/components/Image.js +17 -0
  22. package/dist/commonjs/components/Image.js.map +1 -0
  23. package/dist/commonjs/components/Switch.js +17 -0
  24. package/dist/commonjs/components/Switch.js.map +1 -0
  25. package/dist/commonjs/components/TextInput.js +17 -0
  26. package/dist/commonjs/components/TextInput.js.map +1 -0
  27. package/dist/commonjs/components/index.js +48 -0
  28. package/dist/commonjs/components/index.js.map +1 -1
  29. package/dist/commonjs/components/react-native-safe-area-context.js +17 -0
  30. package/dist/commonjs/components/react-native-safe-area-context.js.map +1 -0
  31. package/dist/commonjs/components/react-native-safe-area-context.native.js +53 -0
  32. package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -0
  33. package/dist/commonjs/jest/index.js +5 -5
  34. package/dist/commonjs/jest/index.js.map +1 -1
  35. package/dist/commonjs/metro/index.js +6 -3
  36. package/dist/commonjs/metro/index.js.map +1 -1
  37. package/dist/commonjs/metro/injection-code.js +5 -10
  38. package/dist/commonjs/metro/injection-code.js.map +1 -1
  39. package/dist/commonjs/metro/metro-transformer.js +18 -8
  40. package/dist/commonjs/metro/metro-transformer.js.map +1 -1
  41. package/dist/commonjs/metro/resolver.js +3 -0
  42. package/dist/commonjs/metro/resolver.js.map +1 -1
  43. package/dist/commonjs/poison.pill.js +10 -10
  44. package/dist/commonjs/runtime/native/api.js +8 -2
  45. package/dist/commonjs/runtime/native/api.js.map +1 -1
  46. package/dist/commonjs/runtime/native/conditions/index.js +4 -2
  47. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  48. package/dist/commonjs/runtime/native/conditions/media-query.js +14 -11
  49. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  50. package/dist/commonjs/runtime/native/react/rules.js +26 -20
  51. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  52. package/dist/commonjs/runtime/native/reactivity.js +11 -0
  53. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  54. package/dist/commonjs/runtime/native/styles/calculate-props.js +25 -8
  55. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  56. package/dist/commonjs/runtime/native/styles/functions/calc.js +97 -57
  57. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -1
  58. package/dist/commonjs/runtime/native/styles/functions/index.js +22 -0
  59. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -1
  60. package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js +32 -0
  61. package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js.map +1 -0
  62. package/dist/commonjs/runtime/native/styles/functions/string-functions.js +23 -0
  63. package/dist/commonjs/runtime/native/styles/functions/string-functions.js.map +1 -0
  64. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +91 -53
  65. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -1
  66. package/dist/commonjs/runtime/native/styles/shorthands/animation.js +2 -2
  67. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -1
  68. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +14 -4
  69. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
  70. package/dist/commonjs/runtime/native/styles/shorthands/transform.js +1 -1
  71. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -1
  72. package/dist/commonjs/runtime/native/styles/variables.js +3 -3
  73. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  74. package/dist/commonjs/runtime/utils/objects.js +6 -18
  75. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  76. package/dist/commonjs/runtime/web/api.js.map +1 -1
  77. package/dist/commonjs/style-collection/index.js +110 -0
  78. package/dist/commonjs/style-collection/index.js.map +1 -0
  79. package/dist/commonjs/{runtime/native → style-collection}/root.js +2 -2
  80. package/dist/commonjs/style-collection/root.js.map +1 -0
  81. package/dist/module/compiler/compiler.js +12 -5
  82. package/dist/module/compiler/compiler.js.map +1 -1
  83. package/dist/module/compiler/compiler.types.js +1 -1
  84. package/dist/module/compiler/compiler.types.js.map +1 -1
  85. package/dist/module/compiler/declarations.js +89 -82
  86. package/dist/module/compiler/declarations.js.map +1 -1
  87. package/dist/module/compiler/inheritance.test.js +10 -10
  88. package/dist/module/compiler/inheritance.test.js.map +1 -1
  89. package/dist/module/compiler/pseudo-elements.js +44 -0
  90. package/dist/module/compiler/pseudo-elements.js.map +1 -0
  91. package/dist/module/compiler/selector-builder.js +124 -80
  92. package/dist/module/compiler/selector-builder.js.map +1 -1
  93. package/dist/module/compiler/stylesheet.js +18 -6
  94. package/dist/module/compiler/stylesheet.js.map +1 -1
  95. package/dist/module/compiler/supports.js +23 -0
  96. package/dist/module/compiler/supports.js.map +1 -0
  97. package/dist/module/components/ActivityIndicator.js +17 -0
  98. package/dist/module/components/ActivityIndicator.js.map +1 -0
  99. package/dist/module/components/Button.js +17 -0
  100. package/dist/module/components/Button.js.map +1 -0
  101. package/dist/module/components/FlatList.js +14 -0
  102. package/dist/module/components/FlatList.js.map +1 -0
  103. package/dist/module/components/Image.js +12 -0
  104. package/dist/module/components/Image.js.map +1 -0
  105. package/dist/module/components/Switch.js +12 -0
  106. package/dist/module/components/Switch.js.map +1 -0
  107. package/dist/module/components/TextInput.js +12 -0
  108. package/dist/module/components/TextInput.js.map +1 -0
  109. package/dist/module/components/index.js +6 -0
  110. package/dist/module/components/index.js.map +1 -1
  111. package/dist/module/components/react-native-safe-area-context.js +4 -0
  112. package/dist/module/components/react-native-safe-area-context.js.map +1 -0
  113. package/dist/module/components/react-native-safe-area-context.native.js +36 -0
  114. package/dist/module/components/react-native-safe-area-context.native.js.map +1 -0
  115. package/dist/module/jest/index.js +2 -2
  116. package/dist/module/jest/index.js.map +1 -1
  117. package/dist/module/metro/index.js +6 -3
  118. package/dist/module/metro/index.js.map +1 -1
  119. package/dist/module/metro/injection-code.js +5 -10
  120. package/dist/module/metro/injection-code.js.map +1 -1
  121. package/dist/module/metro/metro-transformer.js +18 -8
  122. package/dist/module/metro/metro-transformer.js.map +1 -1
  123. package/dist/module/metro/resolver.js +3 -0
  124. package/dist/module/metro/resolver.js.map +1 -1
  125. package/dist/module/poison.pill.js +10 -10
  126. package/dist/module/runtime/native/api.js +2 -1
  127. package/dist/module/runtime/native/api.js.map +1 -1
  128. package/dist/module/runtime/native/conditions/index.js +4 -2
  129. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  130. package/dist/module/runtime/native/conditions/media-query.js +15 -12
  131. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  132. package/dist/module/runtime/native/react/rules.js +24 -19
  133. package/dist/module/runtime/native/react/rules.js.map +1 -1
  134. package/dist/module/runtime/native/reactivity.js +11 -0
  135. package/dist/module/runtime/native/reactivity.js.map +1 -1
  136. package/dist/module/runtime/native/styles/calculate-props.js +25 -8
  137. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  138. package/dist/module/runtime/native/styles/functions/calc.js +97 -56
  139. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -1
  140. package/dist/module/runtime/native/styles/functions/index.js +2 -0
  141. package/dist/module/runtime/native/styles/functions/index.js.map +1 -1
  142. package/dist/module/runtime/native/styles/functions/numeric-functions.js +25 -0
  143. package/dist/module/runtime/native/styles/functions/numeric-functions.js.map +1 -0
  144. package/dist/module/runtime/native/styles/functions/string-functions.js +18 -0
  145. package/dist/module/runtime/native/styles/functions/string-functions.js.map +1 -0
  146. package/dist/module/runtime/native/styles/functions/transform-functions.js +91 -53
  147. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -1
  148. package/dist/module/runtime/native/styles/shorthands/animation.js +1 -1
  149. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -1
  150. package/dist/module/runtime/native/styles/shorthands/box-shadow.js +14 -4
  151. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
  152. package/dist/module/runtime/native/styles/shorthands/transform.js +1 -1
  153. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -1
  154. package/dist/module/runtime/native/styles/variables.js +1 -1
  155. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  156. package/dist/module/runtime/utils/objects.js +6 -18
  157. package/dist/module/runtime/utils/objects.js.map +1 -1
  158. package/dist/module/runtime/web/api.js.map +1 -1
  159. package/dist/module/style-collection/index.js +95 -0
  160. package/dist/module/style-collection/index.js.map +1 -0
  161. package/dist/module/{runtime/native → style-collection}/root.js +2 -2
  162. package/dist/module/style-collection/root.js.map +1 -0
  163. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -1
  164. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  165. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +11 -13
  166. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +4 -2
  168. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  169. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
  170. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
  171. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +1 -0
  172. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
  173. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +2 -2
  174. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  175. package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
  176. package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
  177. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
  178. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
  180. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
  182. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
  184. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/src/components/Switch.d.ts +8 -0
  186. package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
  188. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/src/components/index.d.ts +6 -0
  190. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
  191. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts +2 -0
  192. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +4 -0
  194. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/src/jest/index.d.ts +3 -3
  196. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  197. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  198. package/dist/typescript/commonjs/src/metro/injection-code.d.ts +4 -7
  199. package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
  200. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
  201. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
  202. package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
  203. package/dist/typescript/commonjs/src/runtime/native/api.d.ts +3 -1
  204. package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
  205. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
  206. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
  207. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +1 -1
  209. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  210. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -1
  211. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +2 -0
  212. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -1
  213. package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
  214. package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
  216. package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -1
  218. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
  219. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
  220. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -1
  221. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  223. package/dist/typescript/commonjs/src/runtime/web/api.d.ts +1 -1
  224. package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
  225. package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
  226. package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/src/{runtime/native → style-collection}/root.d.ts +1 -1
  228. package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
  229. package/dist/typescript/module/src/compiler/compiler.d.ts +1 -1
  230. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  231. package/dist/typescript/module/src/compiler/compiler.types.d.ts +11 -13
  232. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  233. package/dist/typescript/module/src/compiler/declarations.d.ts +4 -2
  234. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  235. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
  236. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
  237. package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -0
  238. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
  239. package/dist/typescript/module/src/compiler/stylesheet.d.ts +2 -2
  240. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  241. package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
  242. package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
  243. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
  244. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  245. package/dist/typescript/module/src/components/Button.d.ts +13 -0
  246. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  247. package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
  248. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  249. package/dist/typescript/module/src/components/Image.d.ts +8 -0
  250. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  251. package/dist/typescript/module/src/components/Switch.d.ts +8 -0
  252. package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
  253. package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
  254. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  255. package/dist/typescript/module/src/components/index.d.ts +6 -0
  256. package/dist/typescript/module/src/components/index.d.ts.map +1 -1
  257. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts +2 -0
  258. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts.map +1 -0
  259. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +4 -0
  260. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  261. package/dist/typescript/module/src/jest/index.d.ts +3 -3
  262. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  263. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  264. package/dist/typescript/module/src/metro/injection-code.d.ts +4 -7
  265. package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
  266. package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
  267. package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
  268. package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
  269. package/dist/typescript/module/src/runtime/native/api.d.ts +3 -1
  270. package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
  271. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
  272. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
  273. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  274. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +1 -1
  275. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  276. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -1
  277. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +2 -0
  278. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -1
  279. package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
  280. package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
  281. package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
  282. package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
  283. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -1
  284. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
  285. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
  286. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -1
  287. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  288. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  289. package/dist/typescript/module/src/runtime/web/api.d.ts +1 -1
  290. package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
  291. package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
  292. package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
  293. package/dist/typescript/module/src/{runtime/native → style-collection}/root.d.ts +1 -1
  294. package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
  295. package/package.json +30 -14
  296. package/src/compiler/compiler.ts +11 -3
  297. package/src/compiler/compiler.types.ts +11 -14
  298. package/src/compiler/declarations.ts +157 -121
  299. package/src/compiler/inheritance.test.ts +9 -9
  300. package/src/compiler/pseudo-elements.ts +54 -0
  301. package/src/compiler/selector-builder.ts +136 -81
  302. package/src/compiler/stylesheet.ts +26 -11
  303. package/src/compiler/supports.ts +26 -0
  304. package/src/components/ActivityIndicator.tsx +27 -0
  305. package/src/components/Button.tsx +22 -0
  306. package/src/components/FlatList.tsx +21 -0
  307. package/src/components/Image.tsx +17 -0
  308. package/src/components/Switch.tsx +17 -0
  309. package/src/components/TextInput.tsx +17 -0
  310. package/src/components/index.tsx +6 -0
  311. package/src/components/react-native-safe-area-context.native.tsx +40 -0
  312. package/src/components/react-native-safe-area-context.tsx +1 -0
  313. package/src/jest/index.ts +3 -2
  314. package/src/metro/index.ts +8 -6
  315. package/src/metro/injection-code.ts +6 -10
  316. package/src/metro/metro-transformer.ts +27 -10
  317. package/src/metro/resolver.ts +8 -0
  318. package/src/poison.pill.ts +10 -10
  319. package/src/runtime/native/api.ts +3 -1
  320. package/src/runtime/native/conditions/index.ts +4 -2
  321. package/src/runtime/native/conditions/media-query.ts +16 -12
  322. package/src/runtime/native/react/rules.ts +27 -17
  323. package/src/runtime/native/reactivity.ts +12 -0
  324. package/src/runtime/native/styles/calculate-props.ts +27 -6
  325. package/src/runtime/native/styles/functions/calc.ts +94 -70
  326. package/src/runtime/native/styles/functions/index.ts +2 -0
  327. package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
  328. package/src/runtime/native/styles/functions/string-functions.ts +22 -0
  329. package/src/runtime/native/styles/functions/transform-functions.ts +68 -35
  330. package/src/runtime/native/styles/shorthands/animation.ts +2 -1
  331. package/src/runtime/native/styles/shorthands/box-shadow.ts +34 -14
  332. package/src/runtime/native/styles/shorthands/transform.ts +3 -1
  333. package/src/runtime/native/styles/variables.ts +5 -1
  334. package/src/runtime/utils/objects.ts +10 -19
  335. package/src/runtime/web/api.ts +1 -1
  336. package/src/style-collection/index.ts +142 -0
  337. package/src/{runtime/native → style-collection}/root.ts +6 -2
  338. package/dist/commonjs/compiler/attributes.test.js +0 -20
  339. package/dist/commonjs/compiler/attributes.test.js.map +0 -1
  340. package/dist/commonjs/doctor/index.js +0 -6
  341. package/dist/commonjs/doctor/index.js.map +0 -1
  342. package/dist/commonjs/runtime/native/injection.js +0 -99
  343. package/dist/commonjs/runtime/native/injection.js.map +0 -1
  344. package/dist/commonjs/runtime/native/root.js.map +0 -1
  345. package/dist/module/compiler/attributes.test.js +0 -20
  346. package/dist/module/compiler/attributes.test.js.map +0 -1
  347. package/dist/module/doctor/index.js +0 -4
  348. package/dist/module/doctor/index.js.map +0 -1
  349. package/dist/module/runtime/native/injection.js +0 -94
  350. package/dist/module/runtime/native/injection.js.map +0 -1
  351. package/dist/module/runtime/native/root.js.map +0 -1
  352. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +0 -2
  353. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +0 -1
  354. package/dist/typescript/commonjs/src/doctor/index.d.ts +0 -2
  355. package/dist/typescript/commonjs/src/doctor/index.d.ts.map +0 -1
  356. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -16
  357. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
  358. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +0 -1
  359. package/dist/typescript/module/src/compiler/attributes.test.d.ts +0 -2
  360. package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +0 -1
  361. package/dist/typescript/module/src/doctor/index.d.ts +0 -2
  362. package/dist/typescript/module/src/doctor/index.d.ts.map +0 -1
  363. package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -16
  364. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
  365. package/dist/typescript/module/src/runtime/native/root.d.ts.map +0 -1
  366. package/src/compiler/attributes.test.ts +0 -28
  367. package/src/doctor/index.ts +0 -1
  368. package/src/runtime/native/injection.ts +0 -131
@@ -1,4 +1,4 @@
1
- import type { Selector, SelectorList } from "lightningcss";
1
+ import type { AttrOperation, Selector, SelectorList } from "lightningcss";
2
2
 
3
3
  import { Specificity } from "../runtime/utils";
4
4
  import type {
@@ -19,6 +19,7 @@ interface ReactNativeClassNameSelector {
19
19
  containerQuery?: ContainerQuery[];
20
20
  pseudoClassesQuery?: PseudoClassesQuery;
21
21
  attributeQuery?: AttributeQuery[];
22
+ pseudoElementQuery?: string[];
22
23
  }
23
24
 
24
25
  interface ReactNativeGlobalSelector {
@@ -32,10 +33,12 @@ type PartialSelector = Partial<ReactNativeClassNameSelector> & {
32
33
 
33
34
  const containerQueryMap = new WeakMap<WeakKey, ContainerQuery[]>();
34
35
  const attributeQueryMap = new WeakMap<WeakKey, AttributeQuery[]>();
36
+ const mediaQueryMap = new WeakMap<WeakKey, MediaCondition[]>();
35
37
  const pseudoClassesQueryMap = new WeakMap<WeakKey, PseudoClassesQuery>();
36
38
 
37
39
  type ContainerQueryWithSpecificity = ContainerQuery & {
38
40
  specificity: SpecificityArray;
41
+ m?: MediaCondition;
39
42
  };
40
43
 
41
44
  export function getClassNameSelectors(
@@ -55,6 +58,8 @@ export function getClassNameSelectors(
55
58
  (selector): (ReactNativeGlobalSelector | PartialSelector)[] => {
56
59
  if (isRootVariableSelector(selector)) {
57
60
  return [{ type: "rootVariables" }];
61
+ } else if (isUniversalSelector(selector)) {
62
+ return [{ type: "universalVariables" }];
58
63
  } else {
59
64
  return (
60
65
  parseComponents(
@@ -121,8 +126,19 @@ function parseComponents(
121
126
  return [];
122
127
  }
123
128
  case "pseudo-element": {
124
- // TODO: Support ::selection, ::placeholder, etc
125
- return [];
129
+ switch (component.kind) {
130
+ case "selection":
131
+ case "placeholder": {
132
+ specificity[Specificity.PseudoElements] =
133
+ (specificity[Specificity.PseudoElements] ?? 0) + 1;
134
+ root.pseudoElementQuery ??= [];
135
+ root.pseudoElementQuery.push(component.kind);
136
+ return parseComponents(rest, options, root, ref, specificity);
137
+ }
138
+ default: {
139
+ return [];
140
+ }
141
+ }
126
142
  }
127
143
  case "pseudo-class": {
128
144
  switch (component.kind) {
@@ -183,12 +199,16 @@ function parseComponents(
183
199
  return parents.flatMap((parent) => {
184
200
  const originalParent = { ...parent };
185
201
 
186
- return isWhereContainerQueries.map(({ specificity, ...query }) => {
202
+ return isWhereContainerQueries.map((containerQuery) => {
203
+ const { specificity, m, ...query } = containerQuery;
187
204
  parent = { ...originalParent };
188
205
  parent.specificity = [...originalParent.specificity];
189
- parent.containerQuery = [
190
- ...(originalParent.containerQuery ?? []),
191
- ];
206
+
207
+ if (m && m.length > 1) {
208
+ parent.mediaQuery = originalParent.mediaQuery
209
+ ? [["&", [...originalParent.mediaQuery, m]]]
210
+ : [m];
211
+ }
192
212
 
193
213
  if (component.kind === "is") {
194
214
  for (let i = 0; i < specificity.length; i++) {
@@ -200,7 +220,12 @@ function parseComponents(
200
220
  }
201
221
  }
202
222
 
203
- parent.containerQuery.push(query);
223
+ if (query.a || query.p || query.n !== undefined) {
224
+ parent.containerQuery = [
225
+ ...(originalParent.containerQuery ?? []),
226
+ ];
227
+ parent.containerQuery.push(query);
228
+ }
204
229
 
205
230
  return parent;
206
231
  });
@@ -212,47 +237,63 @@ function parseComponents(
212
237
  }
213
238
  }
214
239
  case "attribute": {
215
- // specificity[Specificity.ClassName] =
216
- // (specificity[Specificity.ClassName] ?? 0) + 1;
217
- const attributeQuery: AttributeQuery = component.name.startsWith("data-")
218
- ? // [data-*] are turned into `dataSet` queries
219
- ["d", toRNProperty(component.name.replace("data-", ""))]
220
- : // Everything else is turned into `attribute` queries
221
- ["a", toRNProperty(component.name)];
222
- if (component.operation) {
223
- let operator: AttrSelectorOperator | undefined;
224
- switch (component.operation.operator) {
225
- case "equal":
226
- operator = "=";
227
- break;
228
- case "includes":
229
- operator = "~=";
230
- break;
231
- case "dash-match":
232
- operator = "|=";
233
- break;
234
- case "prefix":
235
- operator = "^=";
236
- break;
237
- case "substring":
238
- operator = "*=";
239
- break;
240
- case "suffix":
241
- operator = "$=";
242
- break;
243
- default:
244
- component.operation.operator satisfies never;
245
- break;
240
+ if (component.name === "dir") {
241
+ if (!component.operation) {
242
+ return [];
246
243
  }
247
- if (operator) {
248
- // Append the operator onto the attribute query
249
- attributeQuery.push(operator, component.operation.value);
244
+ const operator = operatorMap[component.operation.operator];
245
+
246
+ if (operator !== "=") {
247
+ return [];
250
248
  }
249
+
250
+ getMediaQuery(ref).push([operator, "dir", component.operation.value]);
251
+ return parseComponents(rest, options, root, ref, specificity);
252
+ } else {
253
+ // specificity[Specificity.ClassName] =
254
+ // (specificity[Specificity.ClassName] ?? 0) + 1;
255
+ const attributeQuery: AttributeQuery = component.name.startsWith(
256
+ "data-",
257
+ )
258
+ ? // [data-*] are turned into `dataSet` queries
259
+ ["d", toRNProperty(component.name.replace("data-", ""))]
260
+ : // Everything else is turned into `attribute` queries
261
+ ["a", toRNProperty(component.name)];
262
+ if (component.operation) {
263
+ let operator: AttrSelectorOperator | undefined;
264
+ switch (component.operation.operator) {
265
+ case "equal":
266
+ operator = "=";
267
+ break;
268
+ case "includes":
269
+ operator = "~=";
270
+ break;
271
+ case "dash-match":
272
+ operator = "|=";
273
+ break;
274
+ case "prefix":
275
+ operator = "^=";
276
+ break;
277
+ case "substring":
278
+ operator = "*=";
279
+ break;
280
+ case "suffix":
281
+ operator = "$=";
282
+ break;
283
+ default:
284
+ component.operation.operator satisfies never;
285
+ break;
286
+ }
287
+ if (operator) {
288
+ // Append the operator onto the attribute query
289
+ attributeQuery.push(operator, component.operation.value);
290
+ }
291
+ }
292
+ getAttributeQuery(ref).push(attributeQuery);
293
+ specificity[Specificity.ClassName] =
294
+ (specificity[Specificity.ClassName] ?? 0) + 1;
295
+ return parseComponents(rest, options, root, ref, specificity);
251
296
  }
252
- getAttributeQuery(ref).push(attributeQuery);
253
- specificity[Specificity.ClassName] =
254
- (specificity[Specificity.ClassName] ?? 0) + 1;
255
- return parseComponents(rest, options, root, ref, specificity);
256
297
  }
257
298
  case "class": {
258
299
  if (component.name === options.selectorPrefix) {
@@ -282,7 +323,7 @@ function parseComponents(
282
323
  containerQueries.unshift(ref);
283
324
  }
284
325
 
285
- ref.n = ref.n ? `${ref.n}.${component.name}` : component.name;
326
+ ref.n = ref.n ? `${ref.n}.${component.name}` : `g:${component.name}`;
286
327
  }
287
328
 
288
329
  specificity[Specificity.ClassName] =
@@ -352,6 +393,13 @@ function parseIsWhereComponents(
352
393
  // specificity[Specificity.ClassName] =
353
394
  // (specificity[Specificity.ClassName] ?? 0) + 1;
354
395
  switch (component.kind) {
396
+ case "dir": {
397
+ queries ??= [{ specificity: [] }];
398
+ queries.forEach((query) => {
399
+ getMediaQuery(query).push(["=", "dir", component.direction]);
400
+ });
401
+ return parseIsWhereComponents(type, selector, index + 1, queries);
402
+ }
355
403
  case "hover": {
356
404
  queries ??= [{ specificity: [] }];
357
405
  queries.forEach((query) => {
@@ -389,11 +437,6 @@ function parseIsWhereComponents(
389
437
  }
390
438
  case "where":
391
439
  case "is": {
392
- // :is() and :where() need to be at the start of the selector,
393
- if (index !== 0) {
394
- return null;
395
- }
396
-
397
440
  // Now get the selectors inside the `is` or `where` pseudo-class
398
441
  queries = component.selectors.flatMap((selector) => {
399
442
  return parseIsWhereComponents(type, selector, 0, queries) ?? [];
@@ -407,6 +450,10 @@ function parseIsWhereComponents(
407
450
  }
408
451
  }
409
452
  case "attribute": {
453
+ if (component.name === "dir") {
454
+ return null;
455
+ }
456
+
410
457
  if (type !== "where") {
411
458
  // specificity[Specificity.ClassName] =
412
459
  // (specificity[Specificity.ClassName] ?? 0) + 1;
@@ -417,34 +464,9 @@ function parseIsWhereComponents(
417
464
  : // Everything else is turned into `attribute` queries
418
465
  ["a", toRNProperty(component.name)];
419
466
  if (component.operation) {
420
- let operator: AttrSelectorOperator | undefined;
421
- switch (component.operation.operator) {
422
- case "equal":
423
- operator = "=";
424
- break;
425
- case "includes":
426
- operator = "~=";
427
- break;
428
- case "dash-match":
429
- operator = "|=";
430
- break;
431
- case "prefix":
432
- operator = "^=";
433
- break;
434
- case "substring":
435
- operator = "*=";
436
- break;
437
- case "suffix":
438
- operator = "$=";
439
- break;
440
- default:
441
- component.operation.operator satisfies never;
442
- break;
443
- }
444
- if (operator) {
445
- // Append the operator onto the attribute query
446
- attributeQuery.push(operator, component.operation.value);
447
- }
467
+ const operator = operatorMap[component.operation.operator];
468
+ // Append the operator onto the attribute query
469
+ attributeQuery.push(operator, component.operation.value);
448
470
  }
449
471
  queries ??= [{ specificity: [] }];
450
472
  for (const query of queries) {
@@ -465,7 +487,9 @@ function parseIsWhereComponents(
465
487
  (query.specificity[Specificity.ClassName] ?? 0) + 1;
466
488
  }
467
489
 
468
- query.n = query.n ? `${query.n}.${component.name}` : component.name;
490
+ query.n = query.n
491
+ ? `${query.n}.${component.name}`
492
+ : `g:${component.name}`;
469
493
  }
470
494
 
471
495
  return parseIsWhereComponents(type, selector, index + 1, queries);
@@ -513,12 +537,34 @@ function getAttributeQuery(
513
537
  return attributeQuery;
514
538
  }
515
539
 
540
+ function getMediaQuery(
541
+ key: PartialSelector | ContainerQuery,
542
+ ): MediaCondition[] {
543
+ let mediaQuery = mediaQueryMap.get(key);
544
+ if (!mediaQuery) {
545
+ if ("type" in key) {
546
+ mediaQuery = [];
547
+ key.mediaQuery = mediaQuery;
548
+ } else {
549
+ mediaQuery = [];
550
+ key.m ??= ["&", mediaQuery];
551
+ }
552
+ mediaQueryMap.set(key, mediaQuery);
553
+ }
554
+
555
+ return mediaQuery;
556
+ }
557
+
516
558
  function isRootVariableSelector([first, second]: Selector) {
517
559
  return (
518
560
  first && !second && first.type === "pseudo-class" && first.kind === "root"
519
561
  );
520
562
  }
521
563
 
564
+ function isUniversalSelector([first, second]: Selector) {
565
+ return first && first.type === "universal" && !second;
566
+ }
567
+
522
568
  export function toRNProperty<T extends string>(str: T) {
523
569
  return str
524
570
  .replace(/^-rn-/, "")
@@ -529,3 +575,12 @@ type CamelCase<S extends string> =
529
575
  S extends `${infer P1}-${infer P2}${infer P3}`
530
576
  ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}`
531
577
  : Lowercase<S>;
578
+
579
+ const operatorMap: Record<AttrOperation["operator"], AttrSelectorOperator> = {
580
+ "equal": "=",
581
+ "includes": "~=",
582
+ "dash-match": "|=",
583
+ "prefix": "^=",
584
+ "substring": "*=",
585
+ "suffix": "$=",
586
+ };
@@ -6,7 +6,7 @@ import {
6
6
  specificityCompareFn,
7
7
  } from "../runtime/utils";
8
8
  import type {
9
- AnimationKeyframes_V2,
9
+ AnimationKeyframes,
10
10
  AnimationRecord,
11
11
  CompilerOptions,
12
12
  ContainerQuery,
@@ -21,6 +21,10 @@ import type {
21
21
  VariableRecord,
22
22
  VariableValue,
23
23
  } from "./compiler.types";
24
+ import {
25
+ modifyRuleForPlaceholder,
26
+ modifyRuleForSelection,
27
+ } from "./pseudo-elements";
24
28
  import { getClassNameSelectors, toRNProperty } from "./selector-builder";
25
29
 
26
30
  type BuilderMode = "style" | "media" | "container" | "keyframes";
@@ -35,7 +39,7 @@ const extraRules = new WeakMap<StyleRule, Partial<StyleRule>[]>();
35
39
  const keywords = new Set(["unset"]);
36
40
 
37
41
  export class StylesheetBuilder {
38
- animationFrames?: AnimationKeyframes_V2[];
42
+ animationFrames?: AnimationKeyframes[];
39
43
  animationDeclarations: StyleDeclaration[] = [];
40
44
 
41
45
  stylesheet: ReactNativeCssStyleSheet = {};
@@ -410,22 +414,21 @@ export class StylesheetBuilder {
410
414
  propPath = property;
411
415
  }
412
416
 
413
- if (isStyleFunction(value)) {
417
+ if (forceTuple && !Array.isArray(propPath)) {
418
+ propPath = [propPath];
419
+ }
420
+
421
+ if (isStyleFunction(value) || Array.isArray(propPath)) {
414
422
  if (delayed) {
415
423
  declarations.push([value, propPath, 1]);
416
424
  } else {
417
425
  declarations.push([value, propPath]);
418
426
  }
419
- } else if (forceTuple || Array.isArray(propPath)) {
420
- declarations.push([
421
- value,
422
- Array.isArray(propPath) ? propPath : [propPath],
423
- ]);
424
427
  } else if (Array.isArray(value) && value.some(isStyleFunction)) {
425
428
  declarations.push([value, propPath]);
426
429
  } else if (typeof value === "string" && keywords.has(value)) {
427
430
  declarations.push([value, propPath]);
428
- } else {
431
+ } else if (typeof propPath === "string") {
429
432
  let staticDeclarationRecord = staticDeclarations.get(declarations);
430
433
  if (!staticDeclarationRecord) {
431
434
  staticDeclarationRecord = {};
@@ -453,7 +456,19 @@ export class StylesheetBuilder {
453
456
 
454
457
  for (const selector of normalizedSelectors) {
455
458
  // We are going to be apply the current rule to n selectors, so we clone the rule
456
- const rule = this.cloneRule(this.rule);
459
+ let rule: StyleRule | undefined = this.cloneRule(this.rule);
460
+
461
+ if (selector.type === "className" && selector.pseudoElementQuery) {
462
+ if (selector.pseudoElementQuery.includes("selection")) {
463
+ rule = modifyRuleForSelection(rule);
464
+ } else if (selector.pseudoElementQuery.includes("placeholder")) {
465
+ rule = modifyRuleForPlaceholder(rule);
466
+ }
467
+ }
468
+
469
+ if (!rule) {
470
+ continue;
471
+ }
457
472
 
458
473
  if (selector.type === "className") {
459
474
  const {
@@ -492,7 +507,7 @@ export class StylesheetBuilder {
492
507
  continue;
493
508
  }
494
509
 
495
- const [first, ...rest] = name.split(".");
510
+ const [first, ...rest] = name.slice(2).split(".");
496
511
 
497
512
  if (typeof first !== "string") {
498
513
  continue;
@@ -0,0 +1,26 @@
1
+ import type { SupportsCondition } from "lightningcss";
2
+
3
+ export function supportsConditionValid(condition: SupportsCondition): boolean {
4
+ if (condition.type === "and") {
5
+ return condition.value.every((condition) => {
6
+ return supportsConditionValid(condition);
7
+ });
8
+ } else if (condition.type === "or") {
9
+ return condition.value.some((condition) => {
10
+ return supportsConditionValid(condition);
11
+ });
12
+ } else if (condition.type === "not") {
13
+ return !supportsConditionValid(condition.value);
14
+ } else if (condition.type === "declaration") {
15
+ return Boolean(
16
+ declarations[condition.propertyId.property]?.includes(condition.value),
17
+ );
18
+ }
19
+
20
+ return false;
21
+ }
22
+
23
+ const declarations: Record<string, string[]> = {
24
+ // We don't actually support this, but its needed for Tailwind CSS
25
+ "-moz-orient": ["inline"],
26
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ ActivityIndicator as RNActivityIndicator,
3
+ type ActivityIndicatorProps,
4
+ } from "react-native";
5
+
6
+ import {
7
+ useCssElement,
8
+ type StyledConfiguration,
9
+ type StyledProps,
10
+ } from "../runtime";
11
+
12
+ const mapping = {
13
+ className: {
14
+ target: "style",
15
+ nativeStyleMapping: {
16
+ color: "color",
17
+ },
18
+ },
19
+ } satisfies StyledConfiguration<typeof RNActivityIndicator>;
20
+
21
+ export function ActivityIndicator(
22
+ props: StyledProps<ActivityIndicatorProps, typeof mapping>,
23
+ ) {
24
+ return useCssElement(RNActivityIndicator, props, mapping);
25
+ }
26
+
27
+ export default ActivityIndicator;
@@ -0,0 +1,22 @@
1
+ import { Button as RNButton, type ButtonProps } from "react-native";
2
+
3
+ import {
4
+ useCssElement,
5
+ type StyledConfiguration,
6
+ type StyledProps,
7
+ } from "../runtime";
8
+
9
+ const mapping = {
10
+ className: {
11
+ target: false,
12
+ nativeStyleMapping: {
13
+ color: "color",
14
+ },
15
+ },
16
+ } satisfies StyledConfiguration<typeof RNButton>;
17
+
18
+ export function Button(props: StyledProps<ButtonProps, typeof mapping>) {
19
+ return useCssElement(RNButton, props, mapping);
20
+ }
21
+
22
+ export default Button;
@@ -0,0 +1,21 @@
1
+ import { FlatList as RNFlatList, type FlatListProps } from "react-native";
2
+
3
+ import {
4
+ useCssElement,
5
+ type StyledConfiguration,
6
+ type StyledProps,
7
+ } from "../runtime";
8
+
9
+ const mapping = {
10
+ columnWrapperStyle: "columnWrapperStyle",
11
+ listFooterComponentClassName: "ListFooterComponentStyle",
12
+ listHeaderComponentClassName: "ListHeaderComponentStyle",
13
+ } satisfies StyledConfiguration<typeof RNFlatList>;
14
+
15
+ export function FlatList<ItemT>(
16
+ props: StyledProps<FlatListProps<ItemT>, typeof mapping>,
17
+ ) {
18
+ return useCssElement(RNFlatList, props, mapping);
19
+ }
20
+
21
+ export default FlatList;
@@ -0,0 +1,17 @@
1
+ import { Image as RNImage, type ImageProps } from "react-native";
2
+
3
+ import {
4
+ useCssElement,
5
+ type StyledConfiguration,
6
+ type StyledProps,
7
+ } from "../runtime";
8
+
9
+ const mapping = {
10
+ className: "style",
11
+ } satisfies StyledConfiguration<typeof RNImage>;
12
+
13
+ export function Image(props: StyledProps<ImageProps, typeof mapping>) {
14
+ return useCssElement(RNImage, props, mapping);
15
+ }
16
+
17
+ export default Image;
@@ -0,0 +1,17 @@
1
+ import { Switch as RNSwitch, type SwitchProps } from "react-native";
2
+
3
+ import {
4
+ useCssElement,
5
+ type StyledConfiguration,
6
+ type StyledProps,
7
+ } from "../runtime";
8
+
9
+ const mapping = {
10
+ className: "style",
11
+ } satisfies StyledConfiguration<typeof RNSwitch>;
12
+
13
+ export function Switch(props: StyledProps<SwitchProps, typeof mapping>) {
14
+ return useCssElement(RNSwitch, props, mapping);
15
+ }
16
+
17
+ export default Switch;
@@ -0,0 +1,17 @@
1
+ import { TextInput as RNTextInput, type TextInputProps } from "react-native";
2
+
3
+ import {
4
+ useCssElement,
5
+ type StyledConfiguration,
6
+ type StyledProps,
7
+ } from "../runtime";
8
+
9
+ const mapping = {
10
+ className: "style",
11
+ } satisfies StyledConfiguration<typeof RNTextInput>;
12
+
13
+ export function TextInput(props: StyledProps<TextInputProps, typeof mapping>) {
14
+ return useCssElement(RNTextInput, props, mapping);
15
+ }
16
+
17
+ export default TextInput;
@@ -1,4 +1,10 @@
1
1
  export * from "react-native";
2
2
 
3
+ export { ActivityIndicator } from "./ActivityIndicator";
4
+ export { Button } from "./Button";
5
+ export { FlatList } from "./FlatList";
6
+ export { Image } from "./Image";
7
+ export { Switch } from "./Switch";
3
8
  export { Text } from "./Text";
9
+ export { TextInput } from "./TextInput";
4
10
  export { View } from "./View";
@@ -0,0 +1,40 @@
1
+ import { useContext, useMemo, type PropsWithChildren } from "react";
2
+
3
+ import {
4
+ SafeAreaProvider as OriginalSafeAreaProvider,
5
+ useSafeAreaInsets,
6
+ type SafeAreaProviderProps,
7
+ } from "react-native-safe-area-context";
8
+
9
+ import { VariableContext } from "../runtime/native/reactivity";
10
+
11
+ export * from "react-native-safe-area-context";
12
+
13
+ export function SafeAreaProvider({
14
+ children,
15
+ ...props
16
+ }: SafeAreaProviderProps) {
17
+ return (
18
+ <OriginalSafeAreaProvider {...props}>
19
+ <SafeAreaEnv>{children}</SafeAreaEnv>
20
+ </OriginalSafeAreaProvider>
21
+ );
22
+ }
23
+
24
+ function SafeAreaEnv({ children }: PropsWithChildren) {
25
+ const insets = useSafeAreaInsets();
26
+ const parentVars = useContext(VariableContext);
27
+
28
+ const value = useMemo(
29
+ () => ({
30
+ ...parentVars,
31
+ "--react-native-css-safe-area-inset-bottom": insets.bottom,
32
+ "--react-native-css-safe-area-inset-left": insets.left,
33
+ "--react-native-css-safe-area-inset-right": insets.right,
34
+ "--react-native-css-safe-area-inset-top": insets.top,
35
+ }),
36
+ [parentVars, insets],
37
+ );
38
+
39
+ return <VariableContext value={value}>{children}</VariableContext>;
40
+ }
@@ -0,0 +1 @@
1
+ export * from "react-native-safe-area-context";
package/src/jest/index.ts CHANGED
@@ -2,8 +2,9 @@ import { Appearance, Dimensions } from "react-native";
2
2
 
3
3
  import { inspect } from "node:util";
4
4
 
5
- import { compile, type CompilerOptions } from "../compiler";
6
- import { StyleCollection } from "../runtime/native/injection";
5
+ import { compile, type CompilerOptions } from "react-native-css/compiler";
6
+ import { StyleCollection } from "react-native-css/style-collection";
7
+
7
8
  import { colorScheme, dimensions, rem } from "../runtime/native/reactivity";
8
9
 
9
10
  declare global {