react-native-css 3.0.0-nightly.4723140 → 3.0.0-nightly.4af17f5

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 (572) hide show
  1. package/README.md +184 -1
  2. package/dist/commonjs/babel/allowedModules.js +23 -0
  3. package/dist/commonjs/babel/allowedModules.js.map +1 -0
  4. package/dist/commonjs/babel/helpers.js +18 -122
  5. package/dist/commonjs/babel/helpers.js.map +1 -1
  6. package/dist/commonjs/babel/import-plugin.js +62 -58
  7. package/dist/commonjs/babel/import-plugin.js.map +1 -1
  8. package/dist/commonjs/babel/react-native-web.js +118 -0
  9. package/dist/commonjs/babel/react-native-web.js.map +1 -0
  10. package/dist/commonjs/babel/react-native.js +118 -0
  11. package/dist/commonjs/babel/react-native.js.map +1 -0
  12. package/dist/commonjs/compiler/atRules.js +105 -0
  13. package/dist/commonjs/compiler/atRules.js.map +1 -0
  14. package/dist/commonjs/compiler/attributes.test.js +20 -0
  15. package/dist/commonjs/compiler/attributes.test.js.map +1 -0
  16. package/dist/commonjs/compiler/compiler.js +158 -350
  17. package/dist/commonjs/compiler/compiler.js.map +1 -1
  18. package/dist/commonjs/compiler/compiler.types.js.map +1 -1
  19. package/dist/commonjs/compiler/container-query.js +10 -10
  20. package/dist/commonjs/compiler/container-query.js.map +1 -1
  21. package/dist/commonjs/compiler/declarations.js +1337 -989
  22. package/dist/commonjs/compiler/declarations.js.map +1 -1
  23. package/dist/commonjs/compiler/inheritance.test.js +78 -0
  24. package/dist/commonjs/compiler/inheritance.test.js.map +1 -0
  25. package/dist/commonjs/compiler/keyframes.js +15 -24
  26. package/dist/commonjs/compiler/keyframes.js.map +1 -1
  27. package/dist/commonjs/compiler/media-query.js +22 -22
  28. package/dist/commonjs/compiler/media-query.js.map +1 -1
  29. package/dist/commonjs/compiler/selector-builder.js +457 -0
  30. package/dist/commonjs/compiler/selector-builder.js.map +1 -0
  31. package/dist/commonjs/compiler/selectors.js +270 -186
  32. package/dist/commonjs/compiler/selectors.js.map +1 -1
  33. package/dist/commonjs/compiler/split-by-delimiter.js +21 -0
  34. package/dist/commonjs/compiler/split-by-delimiter.js.map +1 -0
  35. package/dist/commonjs/compiler/stylesheet.js +459 -0
  36. package/dist/commonjs/compiler/stylesheet.js.map +1 -0
  37. package/dist/commonjs/components/Text.js +2 -0
  38. package/dist/commonjs/components/Text.js.map +1 -1
  39. package/dist/commonjs/components/View.js +2 -0
  40. package/dist/commonjs/components/View.js.map +1 -1
  41. package/dist/commonjs/index.js +11 -0
  42. package/dist/commonjs/index.js.map +1 -1
  43. package/dist/commonjs/jest/index.js +25 -25
  44. package/dist/commonjs/jest/index.js.map +1 -1
  45. package/dist/commonjs/metro/index.js +111 -50
  46. package/dist/commonjs/metro/index.js.map +1 -1
  47. package/dist/commonjs/metro/injection-code.js +24 -4
  48. package/dist/commonjs/metro/injection-code.js.map +1 -1
  49. package/dist/commonjs/metro/resolver.js +62 -0
  50. package/dist/commonjs/metro/resolver.js.map +1 -0
  51. package/dist/commonjs/metro/typescript.js +1 -1
  52. package/dist/commonjs/poison.pill.js +39 -0
  53. package/dist/commonjs/poison.pill.js.map +1 -0
  54. package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
  55. package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
  56. package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
  57. package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
  58. package/dist/commonjs/runtime/native/conditions/guards.js +10 -4
  59. package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
  60. package/dist/commonjs/runtime/native/conditions/index.js +10 -46
  61. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  62. package/dist/commonjs/runtime/native/conditions/media-query.js +18 -16
  63. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  64. package/dist/commonjs/runtime/native/index.js +11 -1
  65. package/dist/commonjs/runtime/native/index.js.map +1 -1
  66. package/dist/commonjs/runtime/native/injection.js +21 -2
  67. package/dist/commonjs/runtime/native/injection.js.map +1 -1
  68. package/dist/commonjs/runtime/native/react/interaction.js +10 -10
  69. package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
  70. package/dist/commonjs/runtime/native/react/rules.js +32 -36
  71. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  72. package/dist/commonjs/runtime/native/react/useNativeCss.js +1 -0
  73. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
  74. package/dist/commonjs/runtime/native/reactivity.js +2 -17
  75. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  76. package/dist/commonjs/runtime/native/root.js +28 -0
  77. package/dist/commonjs/runtime/native/root.js.map +1 -0
  78. package/dist/commonjs/runtime/native/styles/animation.js +70 -72
  79. package/dist/commonjs/runtime/native/styles/animation.js.map +1 -1
  80. package/dist/commonjs/runtime/native/styles/border.js +12 -0
  81. package/dist/commonjs/runtime/native/styles/border.js.map +1 -0
  82. package/dist/commonjs/runtime/native/styles/box-shadow.js +40 -0
  83. package/dist/commonjs/runtime/native/styles/box-shadow.js.map +1 -0
  84. package/dist/commonjs/runtime/native/styles/calc.js +33 -61
  85. package/dist/commonjs/runtime/native/styles/calc.js.map +1 -1
  86. package/dist/commonjs/runtime/native/styles/calculate-props.js +128 -0
  87. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -0
  88. package/dist/commonjs/runtime/native/styles/constants.js +2 -1
  89. package/dist/commonjs/runtime/native/styles/constants.js.map +1 -1
  90. package/dist/commonjs/runtime/native/styles/filters.js +84 -0
  91. package/dist/commonjs/runtime/native/styles/filters.js.map +1 -0
  92. package/dist/commonjs/runtime/native/styles/index.js +14 -122
  93. package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
  94. package/dist/commonjs/runtime/native/styles/platform-functions.js +46 -0
  95. package/dist/commonjs/runtime/native/styles/platform-functions.js.map +1 -0
  96. package/dist/commonjs/runtime/native/styles/resolve.js +46 -13
  97. package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
  98. package/dist/commonjs/runtime/native/styles/shorthand.js +34 -17
  99. package/dist/commonjs/runtime/native/styles/shorthand.js.map +1 -1
  100. package/dist/commonjs/runtime/native/styles/transform.js +9 -3
  101. package/dist/commonjs/runtime/native/styles/transform.js.map +1 -1
  102. package/dist/commonjs/runtime/native/styles/units.js +12 -6
  103. package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
  104. package/dist/commonjs/runtime/native/styles/variables.js +58 -36
  105. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  106. package/dist/commonjs/runtime/utils/objects.js +18 -5
  107. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  108. package/dist/commonjs/runtime/utils/specificity.js +2 -1
  109. package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
  110. package/dist/commonjs/runtime/utils/style-value.js +7 -0
  111. package/dist/commonjs/runtime/utils/style-value.js.map +1 -1
  112. package/dist/commonjs/runtime/web/index.js +1 -0
  113. package/dist/commonjs/runtime/web/index.js.map +1 -1
  114. package/dist/commonjs/runtime/web/metro.js +6 -0
  115. package/dist/commonjs/runtime/web/metro.js.map +1 -0
  116. package/dist/module/babel/allowedModules.js +19 -0
  117. package/dist/module/babel/allowedModules.js.map +1 -0
  118. package/dist/module/babel/helpers.js +17 -116
  119. package/dist/module/babel/helpers.js.map +1 -1
  120. package/dist/module/babel/import-plugin.js +63 -59
  121. package/dist/module/babel/import-plugin.js.map +1 -1
  122. package/dist/module/babel/react-native-web.js +112 -0
  123. package/dist/module/babel/react-native-web.js.map +1 -0
  124. package/dist/module/babel/react-native.js +112 -0
  125. package/dist/module/babel/react-native.js.map +1 -0
  126. package/dist/module/compiler/atRules.js +101 -0
  127. package/dist/module/compiler/atRules.js.map +1 -0
  128. package/dist/module/compiler/attributes.test.js +20 -0
  129. package/dist/module/compiler/attributes.test.js.map +1 -0
  130. package/dist/module/compiler/compiler.js +158 -350
  131. package/dist/module/compiler/compiler.js.map +1 -1
  132. package/dist/module/compiler/compiler.types.js +0 -12
  133. package/dist/module/compiler/compiler.types.js.map +1 -1
  134. package/dist/module/compiler/container-query.js +10 -10
  135. package/dist/module/compiler/container-query.js.map +1 -1
  136. package/dist/module/compiler/declarations.js +1275 -993
  137. package/dist/module/compiler/declarations.js.map +1 -1
  138. package/dist/module/compiler/inheritance.test.js +78 -0
  139. package/dist/module/compiler/inheritance.test.js.map +1 -0
  140. package/dist/module/compiler/keyframes.js +15 -24
  141. package/dist/module/compiler/keyframes.js.map +1 -1
  142. package/dist/module/compiler/media-query.js +22 -22
  143. package/dist/module/compiler/media-query.js.map +1 -1
  144. package/dist/module/compiler/selector-builder.js +452 -0
  145. package/dist/module/compiler/selector-builder.js.map +1 -0
  146. package/dist/module/compiler/selectors.js +270 -186
  147. package/dist/module/compiler/selectors.js.map +1 -1
  148. package/dist/module/compiler/split-by-delimiter.js +17 -0
  149. package/dist/module/compiler/split-by-delimiter.js.map +1 -0
  150. package/dist/module/compiler/stylesheet.js +454 -0
  151. package/dist/module/compiler/stylesheet.js.map +1 -0
  152. package/dist/module/components/Text.js +1 -0
  153. package/dist/module/components/Text.js.map +1 -1
  154. package/dist/module/components/View.js +1 -0
  155. package/dist/module/components/View.js.map +1 -1
  156. package/dist/module/index.js +1 -0
  157. package/dist/module/index.js.map +1 -1
  158. package/dist/module/jest/index.js +26 -10
  159. package/dist/module/jest/index.js.map +1 -1
  160. package/dist/module/metro/index.js +111 -50
  161. package/dist/module/metro/index.js.map +1 -1
  162. package/dist/module/metro/injection-code.js +22 -3
  163. package/dist/module/metro/injection-code.js.map +1 -1
  164. package/dist/module/metro/resolver.js +57 -0
  165. package/dist/module/metro/resolver.js.map +1 -0
  166. package/dist/module/metro/typescript.js +1 -1
  167. package/dist/module/poison.pill.js +37 -0
  168. package/dist/module/poison.pill.js.map +1 -0
  169. package/dist/module/runtime/native/conditions/attributes.js +38 -0
  170. package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
  171. package/dist/module/runtime/native/conditions/container-query.js +28 -21
  172. package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
  173. package/dist/module/runtime/native/conditions/guards.js +10 -4
  174. package/dist/module/runtime/native/conditions/guards.js.map +1 -1
  175. package/dist/module/runtime/native/conditions/index.js +10 -46
  176. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  177. package/dist/module/runtime/native/conditions/media-query.js +18 -16
  178. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  179. package/dist/module/runtime/native/index.js +1 -2
  180. package/dist/module/runtime/native/index.js.map +1 -1
  181. package/dist/module/runtime/native/injection.js +20 -1
  182. package/dist/module/runtime/native/injection.js.map +1 -1
  183. package/dist/module/runtime/native/react/interaction.js +10 -10
  184. package/dist/module/runtime/native/react/interaction.js.map +1 -1
  185. package/dist/module/runtime/native/react/rules.js +31 -36
  186. package/dist/module/runtime/native/react/rules.js.map +1 -1
  187. package/dist/module/runtime/native/react/useNativeCss.js +1 -0
  188. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
  189. package/dist/module/runtime/native/reactivity.js +1 -16
  190. package/dist/module/runtime/native/reactivity.js.map +1 -1
  191. package/dist/module/runtime/native/root.js +24 -0
  192. package/dist/module/runtime/native/root.js.map +1 -0
  193. package/dist/module/runtime/native/styles/animation.js +68 -71
  194. package/dist/module/runtime/native/styles/animation.js.map +1 -1
  195. package/dist/module/runtime/native/styles/border.js +8 -0
  196. package/dist/module/runtime/native/styles/border.js.map +1 -0
  197. package/dist/module/runtime/native/styles/box-shadow.js +35 -0
  198. package/dist/module/runtime/native/styles/box-shadow.js.map +1 -0
  199. package/dist/module/runtime/native/styles/calc.js +33 -62
  200. package/dist/module/runtime/native/styles/calc.js.map +1 -1
  201. package/dist/module/runtime/native/styles/calculate-props.js +123 -0
  202. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -0
  203. package/dist/module/runtime/native/styles/constants.js +1 -0
  204. package/dist/module/runtime/native/styles/constants.js.map +1 -1
  205. package/dist/module/runtime/native/styles/filters.js +70 -0
  206. package/dist/module/runtime/native/styles/filters.js.map +1 -0
  207. package/dist/module/runtime/native/styles/index.js +14 -122
  208. package/dist/module/runtime/native/styles/index.js.map +1 -1
  209. package/dist/module/runtime/native/styles/platform-functions.js +36 -0
  210. package/dist/module/runtime/native/styles/platform-functions.js.map +1 -0
  211. package/dist/module/runtime/native/styles/resolve.js +47 -14
  212. package/dist/module/runtime/native/styles/resolve.js.map +1 -1
  213. package/dist/module/runtime/native/styles/shorthand.js +34 -17
  214. package/dist/module/runtime/native/styles/shorthand.js.map +1 -1
  215. package/dist/module/runtime/native/styles/transform.js +9 -3
  216. package/dist/module/runtime/native/styles/transform.js.map +1 -1
  217. package/dist/module/runtime/native/styles/units.js +12 -6
  218. package/dist/module/runtime/native/styles/units.js.map +1 -1
  219. package/dist/module/runtime/native/styles/variables.js +59 -37
  220. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  221. package/dist/module/runtime/utils/objects.js +16 -4
  222. package/dist/module/runtime/utils/objects.js.map +1 -1
  223. package/dist/module/runtime/utils/specificity.js +2 -1
  224. package/dist/module/runtime/utils/specificity.js.map +1 -1
  225. package/dist/module/runtime/utils/style-value.js +6 -0
  226. package/dist/module/runtime/utils/style-value.js.map +1 -1
  227. package/dist/module/runtime/web/index.js +2 -0
  228. package/dist/module/runtime/web/index.js.map +1 -1
  229. package/dist/module/runtime/web/metro.js +5 -0
  230. package/dist/module/runtime/web/metro.js.map +1 -0
  231. package/dist/typescript/commonjs/example/app.config.d.ts +4 -0
  232. package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -1
  234. package/dist/typescript/commonjs/src/babel/allowedModules.d.ts +2 -0
  235. package/dist/typescript/commonjs/src/babel/allowedModules.d.ts.map +1 -0
  236. package/dist/typescript/commonjs/src/babel/helpers.d.ts +3 -8
  237. package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
  239. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +8 -0
  240. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -0
  241. package/dist/typescript/commonjs/src/babel/react-native.d.ts +8 -0
  242. package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -0
  243. package/dist/typescript/commonjs/src/compiler/atRules.d.ts +34 -0
  244. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -0
  245. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +2 -0
  246. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +1 -0
  247. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
  248. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  249. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +32 -112
  250. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  251. package/dist/typescript/commonjs/src/compiler/container-query.d.ts +2 -2
  252. package/dist/typescript/commonjs/src/compiler/container-query.d.ts.map +1 -1
  253. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +115 -25
  254. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  255. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +2 -0
  256. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +1 -0
  257. package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +5 -4
  258. package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -1
  259. package/dist/typescript/commonjs/src/compiler/media-query.d.ts +4 -4
  260. package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
  261. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -0
  262. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  263. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +11 -5
  264. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
  265. package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts +2 -0
  266. package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts.map +1 -0
  267. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +68 -0
  268. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -0
  269. package/dist/typescript/commonjs/src/components/Text.d.ts +1 -1
  270. package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -1
  271. package/dist/typescript/commonjs/src/components/View.d.ts +1 -1
  272. package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -1
  273. package/dist/typescript/commonjs/src/index.d.ts +1 -0
  274. package/dist/typescript/commonjs/src/index.d.ts.map +1 -1
  275. package/dist/typescript/commonjs/src/jest/index.d.ts +11 -5
  276. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  277. package/dist/typescript/commonjs/src/metro/index.d.ts +5 -4
  278. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  279. package/dist/typescript/commonjs/src/metro/injection-code.d.ts +15 -1
  280. package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
  281. package/dist/typescript/commonjs/src/metro/resolver.d.ts +4 -0
  282. package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -0
  283. package/dist/typescript/commonjs/src/poison.pill.d.ts +2 -0
  284. package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -0
  285. package/dist/typescript/commonjs/src/runtime/native/api.d.ts +1 -1
  286. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
  287. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  288. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
  289. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  290. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
  291. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
  292. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
  293. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
  294. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
  295. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  296. package/dist/typescript/commonjs/src/runtime/native/index.d.ts +1 -1
  297. package/dist/typescript/commonjs/src/runtime/native/index.d.ts.map +1 -1
  298. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
  299. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
  300. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
  301. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -1
  302. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
  303. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +3 -2
  304. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  305. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +3 -11
  306. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  307. package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
  308. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
  309. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +3 -2
  310. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +1 -1
  311. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +2 -0
  312. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +1 -0
  313. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +3 -0
  314. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +1 -0
  315. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +1 -1
  316. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +10 -0
  317. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -0
  318. package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts +1 -0
  319. package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts.map +1 -1
  320. package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts +12 -0
  321. package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +1 -0
  322. package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts +3 -4
  323. package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts.map +1 -1
  324. package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts +8 -0
  325. package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +1 -0
  326. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts +6 -2
  327. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
  328. package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts +3 -4
  329. package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +1 -1
  330. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +1 -1
  331. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +1 -1
  332. package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +1 -1
  333. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
  334. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts +1 -1
  335. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  336. package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts +0 -15
  337. package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts.map +1 -1
  338. package/dist/typescript/commonjs/src/runtime/utils/components.d.ts +1 -1
  339. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts +2 -1
  340. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  341. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
  342. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
  343. package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts +3 -2
  344. package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts.map +1 -1
  345. package/dist/typescript/commonjs/src/runtime/web/index.d.ts +1 -0
  346. package/dist/typescript/commonjs/src/runtime/web/index.d.ts.map +1 -1
  347. package/dist/typescript/commonjs/src/runtime/web/metro.d.ts +2 -0
  348. package/dist/typescript/commonjs/src/runtime/web/metro.d.ts.map +1 -0
  349. package/dist/typescript/module/example/app.config.d.ts +4 -0
  350. package/dist/typescript/module/example/app.config.d.ts.map +1 -0
  351. package/dist/typescript/module/example/src/App.d.ts.map +1 -1
  352. package/dist/typescript/module/src/babel/allowedModules.d.ts +2 -0
  353. package/dist/typescript/module/src/babel/allowedModules.d.ts.map +1 -0
  354. package/dist/typescript/module/src/babel/helpers.d.ts +3 -8
  355. package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -1
  356. package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
  357. package/dist/typescript/module/src/babel/react-native-web.d.ts +8 -0
  358. package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -0
  359. package/dist/typescript/module/src/babel/react-native.d.ts +8 -0
  360. package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -0
  361. package/dist/typescript/module/src/compiler/atRules.d.ts +34 -0
  362. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -0
  363. package/dist/typescript/module/src/compiler/attributes.test.d.ts +2 -0
  364. package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +1 -0
  365. package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
  366. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  367. package/dist/typescript/module/src/compiler/compiler.types.d.ts +32 -112
  368. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  369. package/dist/typescript/module/src/compiler/container-query.d.ts +2 -2
  370. package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -1
  371. package/dist/typescript/module/src/compiler/declarations.d.ts +115 -25
  372. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  373. package/dist/typescript/module/src/compiler/inheritance.test.d.ts +2 -0
  374. package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +1 -0
  375. package/dist/typescript/module/src/compiler/keyframes.d.ts +5 -4
  376. package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
  377. package/dist/typescript/module/src/compiler/media-query.d.ts +4 -4
  378. package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
  379. package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -0
  380. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  381. package/dist/typescript/module/src/compiler/selectors.d.ts +11 -5
  382. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
  383. package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts +2 -0
  384. package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts.map +1 -0
  385. package/dist/typescript/module/src/compiler/stylesheet.d.ts +68 -0
  386. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -0
  387. package/dist/typescript/module/src/components/Text.d.ts +1 -1
  388. package/dist/typescript/module/src/components/Text.d.ts.map +1 -1
  389. package/dist/typescript/module/src/components/View.d.ts +1 -1
  390. package/dist/typescript/module/src/components/View.d.ts.map +1 -1
  391. package/dist/typescript/module/src/index.d.ts +1 -0
  392. package/dist/typescript/module/src/index.d.ts.map +1 -1
  393. package/dist/typescript/module/src/jest/index.d.ts +11 -5
  394. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  395. package/dist/typescript/module/src/metro/index.d.ts +5 -4
  396. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  397. package/dist/typescript/module/src/metro/injection-code.d.ts +15 -1
  398. package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
  399. package/dist/typescript/module/src/metro/resolver.d.ts +4 -0
  400. package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -0
  401. package/dist/typescript/module/src/poison.pill.d.ts +2 -0
  402. package/dist/typescript/module/src/poison.pill.d.ts.map +1 -0
  403. package/dist/typescript/module/src/runtime/native/api.d.ts +1 -1
  404. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
  405. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  406. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
  407. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  408. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
  409. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
  410. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
  411. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
  412. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
  413. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  414. package/dist/typescript/module/src/runtime/native/index.d.ts +1 -1
  415. package/dist/typescript/module/src/runtime/native/index.d.ts.map +1 -1
  416. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
  417. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
  418. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
  419. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -1
  420. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
  421. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +3 -2
  422. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  423. package/dist/typescript/module/src/runtime/native/reactivity.d.ts +3 -11
  424. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  425. package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
  426. package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
  427. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +3 -2
  428. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +1 -1
  429. package/dist/typescript/module/src/runtime/native/styles/border.d.ts +2 -0
  430. package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +1 -0
  431. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +3 -0
  432. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +1 -0
  433. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +1 -1
  434. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +10 -0
  435. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -0
  436. package/dist/typescript/module/src/runtime/native/styles/constants.d.ts +1 -0
  437. package/dist/typescript/module/src/runtime/native/styles/constants.d.ts.map +1 -1
  438. package/dist/typescript/module/src/runtime/native/styles/filters.d.ts +12 -0
  439. package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +1 -0
  440. package/dist/typescript/module/src/runtime/native/styles/index.d.ts +3 -4
  441. package/dist/typescript/module/src/runtime/native/styles/index.d.ts.map +1 -1
  442. package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts +8 -0
  443. package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +1 -0
  444. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts +6 -2
  445. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
  446. package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts +3 -4
  447. package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +1 -1
  448. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +1 -1
  449. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +1 -1
  450. package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +1 -1
  451. package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
  452. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts +1 -1
  453. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  454. package/dist/typescript/module/src/runtime/runtime.types.d.ts +0 -15
  455. package/dist/typescript/module/src/runtime/runtime.types.d.ts.map +1 -1
  456. package/dist/typescript/module/src/runtime/utils/components.d.ts +1 -1
  457. package/dist/typescript/module/src/runtime/utils/objects.d.ts +2 -1
  458. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  459. package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
  460. package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
  461. package/dist/typescript/module/src/runtime/utils/style-value.d.ts +3 -2
  462. package/dist/typescript/module/src/runtime/utils/style-value.d.ts.map +1 -1
  463. package/dist/typescript/module/src/runtime/web/index.d.ts +1 -0
  464. package/dist/typescript/module/src/runtime/web/index.d.ts.map +1 -1
  465. package/dist/typescript/module/src/runtime/web/metro.d.ts +2 -0
  466. package/dist/typescript/module/src/runtime/web/metro.d.ts.map +1 -0
  467. package/package.json +69 -14
  468. package/src/babel/allowedModules.ts +24 -0
  469. package/src/babel/helpers.ts +16 -158
  470. package/src/babel/import-plugin.ts +125 -132
  471. package/src/babel/react-native-web.ts +226 -0
  472. package/src/babel/react-native.ts +226 -0
  473. package/src/compiler/atRules.ts +149 -0
  474. package/src/compiler/attributes.test.ts +28 -0
  475. package/src/compiler/compiler.ts +163 -492
  476. package/src/compiler/compiler.types.ts +37 -140
  477. package/src/compiler/container-query.ts +12 -12
  478. package/src/compiler/declarations.ts +2010 -1961
  479. package/src/compiler/inheritance.test.ts +121 -0
  480. package/src/compiler/keyframes.ts +28 -42
  481. package/src/compiler/media-query.ts +27 -26
  482. package/src/compiler/selector-builder.ts +531 -0
  483. package/src/compiler/selectors.ts +304 -272
  484. package/src/compiler/split-by-delimiter.ts +19 -0
  485. package/src/compiler/stylesheet.ts +658 -0
  486. package/src/components/Text.tsx +2 -0
  487. package/src/components/View.tsx +2 -0
  488. package/src/index.ts +2 -0
  489. package/src/jest/index.ts +36 -11
  490. package/src/metro/index.ts +164 -64
  491. package/src/metro/injection-code.ts +33 -3
  492. package/src/metro/resolver.ts +89 -0
  493. package/src/metro/typescript.ts +1 -1
  494. package/src/poison.pill.ts +36 -0
  495. package/src/runtime/native/conditions/attributes.ts +52 -0
  496. package/src/runtime/native/conditions/container-query.ts +27 -22
  497. package/src/runtime/native/conditions/guards.ts +13 -6
  498. package/src/runtime/native/conditions/index.ts +12 -66
  499. package/src/runtime/native/conditions/media-query.ts +19 -19
  500. package/src/runtime/native/index.ts +1 -2
  501. package/src/runtime/native/injection.ts +31 -1
  502. package/src/runtime/native/react/interaction.ts +12 -12
  503. package/src/runtime/native/react/rules.ts +35 -42
  504. package/src/runtime/native/react/useNativeCss.ts +3 -0
  505. package/src/runtime/native/reactivity.ts +5 -28
  506. package/src/runtime/native/root.ts +31 -0
  507. package/src/runtime/native/styles/animation.ts +143 -104
  508. package/src/runtime/native/styles/border.ts +10 -0
  509. package/src/runtime/native/styles/box-shadow.ts +54 -0
  510. package/src/runtime/native/styles/calc.ts +37 -60
  511. package/src/runtime/native/styles/calculate-props.ts +175 -0
  512. package/src/runtime/native/styles/constants.ts +1 -0
  513. package/src/runtime/native/styles/filters.ts +98 -0
  514. package/src/runtime/native/styles/index.ts +14 -150
  515. package/src/runtime/native/styles/platform-functions.ts +50 -0
  516. package/src/runtime/native/styles/resolve.ts +91 -17
  517. package/src/runtime/native/styles/shorthand.ts +61 -41
  518. package/src/runtime/native/styles/transform.ts +10 -4
  519. package/src/runtime/native/styles/units.ts +15 -6
  520. package/src/runtime/native/styles/variables.ts +53 -41
  521. package/src/runtime/runtime.types.ts +0 -25
  522. package/src/runtime/utils/objects.ts +20 -5
  523. package/src/runtime/utils/specificity.ts +1 -0
  524. package/src/runtime/utils/style-value.ts +14 -2
  525. package/src/runtime/web/index.ts +3 -0
  526. package/src/runtime/web/metro.ts +2 -0
  527. package/types.d.ts +70 -0
  528. package/dist/commonjs/compiler/add.js +0 -175
  529. package/dist/commonjs/compiler/add.js.map +0 -1
  530. package/dist/commonjs/components/ActivityIndicator.js +0 -20
  531. package/dist/commonjs/components/ActivityIndicator.js.map +0 -1
  532. package/dist/commonjs/components/SafeAreaProvider/index.js +0 -41
  533. package/dist/commonjs/components/SafeAreaProvider/index.js.map +0 -1
  534. package/dist/commonjs/components/SafeAreaProvider/index.web.js +0 -13
  535. package/dist/commonjs/components/SafeAreaProvider/index.web.js.map +0 -1
  536. package/dist/commonjs/components/TextInput.js +0 -20
  537. package/dist/commonjs/components/TextInput.js.map +0 -1
  538. package/dist/module/compiler/add.js +0 -168
  539. package/dist/module/compiler/add.js.map +0 -1
  540. package/dist/module/components/ActivityIndicator.js +0 -16
  541. package/dist/module/components/ActivityIndicator.js.map +0 -1
  542. package/dist/module/components/SafeAreaProvider/index.js +0 -36
  543. package/dist/module/components/SafeAreaProvider/index.js.map +0 -1
  544. package/dist/module/components/SafeAreaProvider/index.web.js +0 -4
  545. package/dist/module/components/SafeAreaProvider/index.web.js.map +0 -1
  546. package/dist/module/components/TextInput.js +0 -16
  547. package/dist/module/components/TextInput.js.map +0 -1
  548. package/dist/typescript/commonjs/src/compiler/add.d.ts +0 -10
  549. package/dist/typescript/commonjs/src/compiler/add.d.ts.map +0 -1
  550. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +0 -3
  551. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +0 -1
  552. package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.d.ts +0 -4
  553. package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.d.ts.map +0 -1
  554. package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.web.d.ts +0 -2
  555. package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.web.d.ts.map +0 -1
  556. package/dist/typescript/commonjs/src/components/TextInput.d.ts +0 -13
  557. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +0 -1
  558. package/dist/typescript/module/src/compiler/add.d.ts +0 -10
  559. package/dist/typescript/module/src/compiler/add.d.ts.map +0 -1
  560. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +0 -3
  561. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +0 -1
  562. package/dist/typescript/module/src/components/SafeAreaProvider/index.d.ts +0 -4
  563. package/dist/typescript/module/src/components/SafeAreaProvider/index.d.ts.map +0 -1
  564. package/dist/typescript/module/src/components/SafeAreaProvider/index.web.d.ts +0 -2
  565. package/dist/typescript/module/src/components/SafeAreaProvider/index.web.d.ts.map +0 -1
  566. package/dist/typescript/module/src/components/TextInput.d.ts +0 -13
  567. package/dist/typescript/module/src/components/TextInput.d.ts.map +0 -1
  568. package/src/compiler/add.ts +0 -257
  569. package/src/components/ActivityIndicator.tsx +0 -19
  570. package/src/components/SafeAreaProvider/index.tsx +0 -50
  571. package/src/components/SafeAreaProvider/index.web.tsx +0 -1
  572. package/src/components/TextInput.tsx +0 -20
package/README.md CHANGED
@@ -1,19 +1,202 @@
1
1
  # react-native-css
2
2
 
3
- A CSS polyfill for React Native's native platforms
3
+ A CSS polyfill for React Native
4
+
5
+ The goal of this library is to provide the most complete CSS support for React Native, within the limitations of Yoga and the core React Native package. This includes multiple advanced CSS features like media queries, container queries, CSS variables, and more.
4
6
 
5
7
  ## Installation
6
8
 
9
+ 1. Create a CSS file in your project, e.g. `styles.css`.
10
+ 2. Import the CSS file in your App entry point, or root layout component:
11
+ 3. Setup the bundler using one of the methods below.
12
+
13
+ ### Metro based projects
14
+
15
+ > [!TIP]
16
+ > All Expo and React Native Community CLI projects use Metro as the bundler, so this guide applies to them.
17
+
18
+ You will need to add `withReactNativeCSS` to your Metro configuration.
19
+
20
+ ```ts
21
+ import { getDefaultConfig } from "expo/metro-config";
22
+ import { withReactNativeCSS } from "react-native-css/metro";
23
+
24
+ const defaultConfig = getDefaultConfig(__dirname);
25
+
26
+ export default withReactNativeCSS(defaultConfig);
27
+
28
+ // OR with the globalClassNamePolyfill enabled
29
+ export default withReactNativeCSS(defaultConfig, {
30
+ globalClassNamePolyfill: true,
31
+ });
32
+ ```
33
+
34
+ ### Other bundlers
35
+
36
+ `react-native-css` officially only supports Metro as the bundler, but we welcome community contributions to support other bundlers like Webpack, Vite or Turbopack.
37
+
38
+ More documentation coming soon.
39
+
7
40
  ## Usage
8
41
 
42
+ You can use the library by importing the React Native components directly from `react-native-css/components`:
43
+
44
+ ```ts
45
+ import { View } from 'react-native-css/components';
46
+
47
+ import "./styles.css";
48
+
49
+ export default function App() {
50
+ return (
51
+ <View className="container">
52
+ <View className="box" />
53
+ </View>
54
+ );
55
+ }
56
+ ```
57
+
58
+ ### With `globalClassNamePolyfill`
59
+
60
+ Enabling the `globalClassNamePolyfill` allows you to use the classNames prop on any React Native component, similar to how you would use it in a web application.
61
+
62
+ ```ts
63
+ import { View } from 'react-native';
64
+
65
+ import "./styles.css";
66
+
67
+ export default function App() {
68
+ return (
69
+ <View className="container">
70
+ <View className="box" />
71
+ </View>
72
+ );
73
+ }
74
+ ```
75
+
76
+ To enable the `globalClassNamePolyfill`, you need to enable it in your Metro configuration:
77
+
78
+ ```ts
79
+ import { withReactNativeCSS } from "react-native-css/metro";
80
+
81
+ module.exports = withReactNativeCSS(
82
+ {
83
+ // Your existing Metro configuration
84
+ },
85
+ {
86
+ globalClassNamePolyfill: true,
87
+ },
88
+ );
89
+ ```
90
+
91
+ ### Via hooks
92
+
93
+ #### `useCssElement`
94
+
95
+ You can also use the `useCssElement` hook.
96
+
97
+ ```ts
98
+ import { View as RNView } from 'react-native';
99
+ import { useCssElement } from 'react-native-css';
100
+
101
+ export default function App() {
102
+ const Container = useCssElement(RNView, {
103
+ className: "container",
104
+ });
105
+
106
+ const Box = useCssElement(RNView, {
107
+ className: "container",
108
+ });
109
+
110
+ return (
111
+ <Container>
112
+ <Box />
113
+ </Container>
114
+ );
115
+ }
116
+ ```
117
+
118
+ > [!IMPORTANT]
119
+ > The hook returns a React Element, not a style object. The element will work on all platforms and will correctly apply the React context needed to support all features of the library
120
+
121
+ #### `useNativeCssStyle`
122
+
123
+ If you just require the style object, you can use the `useNativeCssStyle` hook:
124
+
125
+ ```ts
126
+ import { View as RNView } from 'react-native';
127
+ import { useNativeCssStyle } from 'react-native-css';
128
+
129
+ import "./styles.css";
130
+
131
+ export default function App() {
132
+ return (
133
+ <View style={useNativeCssStyle("container")}>
134
+ <Text style={useNativeCssStyle("my-text")}>
135
+ Hello, world!
136
+ </Text>
137
+ </View>
138
+ )
139
+ }
140
+ ```
141
+
142
+ > [!IMPORTANT]
143
+ > This hook may will only work on native platforms. It will return an empty object on web.
144
+ > This hook may not support all features of the library.
145
+ > This hooks does not support container queries or inheritance for children elements.
146
+
147
+ #### `useNativeCssVariable`
148
+
149
+ If you just require a CSS variable value, you can use the `useNativeCssVariable` hook:
150
+
151
+ ```ts
152
+ import { useNativeCssVariable } from 'react-native-css';
153
+
154
+ export default function App() {
155
+ const myColor = useNativeCssVariable("my-color");
156
+
157
+ return (
158
+ <View style={{ backgroundColor: myColor }}>
159
+ <Text style={{ color: myColor }}>
160
+ Hello, world!
161
+ </Text>
162
+ </View>
163
+ )
164
+ }
165
+ ```
166
+
167
+ > [!IMPORTANT]
168
+ > This hook may will only work on native platforms. It will return `undefined` on web.
169
+ > This hook may not support all features of the library.
170
+
9
171
  ## Contributing
10
172
 
11
173
  See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
12
174
 
175
+ To quickly get started with the project, you can run:
176
+
177
+ ```sh
178
+ yarn init -2 # We require Yarn 4
179
+ yarn clean # Install dependencies, rebuild the project and example app
180
+ yarn example ios # Or yarn example android
181
+ ```
182
+
183
+ Once the example app is built, you can use
184
+
185
+ ```sh
186
+ yarn example start # Start Expo CLI
187
+ yarn example start:build # Rebuild the project and start Expo CLI
188
+ yarn example start:debug # Rebuild the project and start Expo CLI with debug logging
189
+ ```
190
+
191
+ > [!TIP]
192
+ > `start:build` and `start:debug` will clear the cache before starting the Expo CLI. If you are experiencing issue with `yarn example start` not reflecting your changes, try running `yarn example start:build` or `yarn example start:debug`.
193
+
13
194
  ## License
14
195
 
15
196
  MIT
16
197
 
198
+ See the [license](LICENSE) file for more details.
199
+
17
200
  ---
18
201
 
19
202
  Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.allowedModules = void 0;
7
+ var _fs = require("fs");
8
+ var _path = require("path");
9
+ function getFilesWithoutExtension(dirPath) {
10
+ // Read all files and directories inside dirPath synchronously
11
+ const entries = (0, _fs.readdirSync)(dirPath, {
12
+ withFileTypes: true
13
+ });
14
+
15
+ // Filter only files (ignore directories)
16
+ const files = entries.filter(entry => entry.isFile() && /\.[jt]sx?$/.exec(entry.name) && !/index\.[jt]sx?$/.exec(entry.name));
17
+
18
+ // For each file, get the filename without extension
19
+ const filesWithoutExt = files.map(file => (0, _path.parse)(file.name).name);
20
+ return filesWithoutExt;
21
+ }
22
+ const allowedModules = exports.allowedModules = new Set(getFilesWithoutExtension((0, _path.join)(__dirname, "../components")));
23
+ //# sourceMappingURL=allowedModules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_fs","require","_path","getFilesWithoutExtension","dirPath","entries","readdirSync","withFileTypes","files","filter","entry","isFile","exec","name","filesWithoutExt","map","file","parse","allowedModules","exports","Set","join","__dirname"],"sourceRoot":"../../../src","sources":["babel/allowedModules.ts"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,SAASE,wBAAwBA,CAACC,OAAe,EAAE;EACjD;EACA,MAAMC,OAAO,GAAG,IAAAC,eAAW,EAACF,OAAO,EAAE;IAAEG,aAAa,EAAE;EAAK,CAAC,CAAC;;EAE7D;EACA,MAAMC,KAAK,GAAGH,OAAO,CAACI,MAAM,CACzBC,KAAK,IACJA,KAAK,CAACC,MAAM,CAAC,CAAC,IACd,YAAY,CAACC,IAAI,CAACF,KAAK,CAACG,IAAI,CAAC,IAC7B,CAAC,iBAAiB,CAACD,IAAI,CAACF,KAAK,CAACG,IAAI,CACtC,CAAC;;EAED;EACA,MAAMC,eAAe,GAAGN,KAAK,CAACO,GAAG,CAAEC,IAAI,IAAK,IAAAC,WAAK,EAACD,IAAI,CAACH,IAAI,CAAC,CAACA,IAAI,CAAC;EAElE,OAAOC,eAAe;AACxB;AAEO,MAAMI,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAIE,GAAG,CACnCjB,wBAAwB,CAAC,IAAAkB,UAAI,EAACC,SAAS,EAAE,eAAe,CAAC,CAC3D,CAAC","ignoreList":[]}
@@ -3,127 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.allowedModules = void 0;
7
- exports.isInsideModule = isInsideModule;
8
- exports.isPackageImport = isPackageImport;
9
- exports.shouldTransformImport = shouldTransformImport;
10
- exports.shouldTransformRequire = shouldTransformRequire;
11
- var _fs = require("fs");
12
- var _path = require("path");
13
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
14
-
15
- const allowedModules = exports.allowedModules = new Set(getFilesWithoutExtension((0, _path.join)(__dirname, "../components")));
16
- function getFilesWithoutExtension(dirPath) {
17
- // Read all files and directories inside dirPath synchronously
18
- const entries = (0, _fs.readdirSync)(dirPath, {
19
- withFileTypes: true
20
- });
21
-
22
- // Filter only files (ignore directories)
23
- const files = entries.filter(entry => entry.isFile() && /\.[jt]sx$/.exec(entry.name) && !/index\.[jt]sx$/.exec(entry.name));
24
-
25
- // For each file, get the filename without extension
26
- const filesWithoutExt = files.map(file => (0, _path.parse)(file.name).name);
27
- return filesWithoutExt;
28
- }
29
- function isInsideModule(filename, module) {
30
- const normalized = (0, _path.normalize)(filename);
31
-
32
- // Match exact module name
33
- if (normalized === module) {
34
- return true;
35
- }
36
-
37
- // Absolute posix paths
38
- if (normalized.startsWith(`${module}/`)) {
39
- return true;
40
- }
41
-
42
- // Check for our local development structure
43
- if (normalized.includes(`${_path.sep}${module}${_path.sep}src${_path.sep}`)) {
44
- // Ignore the test files
45
- return !normalized.includes("__tests__");
46
- }
47
-
48
- // Match classic node_modules
49
- if (normalized.includes(`${_path.sep}node_modules${_path.sep}${module}${_path.sep}`)) {
50
- return true;
51
- }
52
-
53
- // Match Yarn PnP .zip-style paths (e.g., .zip/node_modules/${module}/)
54
- if (normalized.includes(`${_path.sep}.zip${_path.sep}node_modules${_path.sep}${module}${_path.sep}`)) {
55
- return true;
56
- }
57
-
58
- // Match Yarn .yarn/cache/${module}/*
59
- if (normalized.includes(`${_path.sep}.yarn${_path.sep}cache${_path.sep}${module}${_path.sep}`)) {
60
- return true;
61
- }
62
- return false;
63
- }
64
- function isPackageImport(path) {
65
- const source = path.node.source?.value;
66
- if (!source) {
67
- return false;
68
- }
69
- return source === "react-native" || source === "react-native-web";
70
- }
71
- function shouldTransformImport(path, filename) {
72
- let source = path.node.source?.value;
73
- if (!source) {
74
- return false;
75
- }
76
- if (source.startsWith(".")) {
77
- source = (0, _path.resolve)((0, _path.dirname)(filename), source);
78
- }
79
-
80
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
81
- return isReactNativeSource(source) || isReactNativeWebSource(source);
82
- }
83
- function isReactNativeSource(source) {
84
- if (source === "react-native") return true;
85
- const components = source.split(`react-native${_path.sep}Libraries${_path.sep}Components${_path.sep}`);
86
- if (components.length > 1) {
87
- const component = components[1]?.split(_path.sep)[0];
88
- return component && allowedModules.has(component);
89
- }
90
- return false;
91
- }
92
- function isReactNativeWebSource(source) {
93
- if (source === "react-native-web") return true;
94
- let components = source.split(`react-native-web${_path.sep}dist${_path.sep}commonjs${_path.sep}exports${_path.sep}`);
95
- if (components.length > 1) {
96
- const component = components[1]?.split(_path.sep)[0];
97
- return component && allowedModules.has(component);
98
- }
99
- components = source.split(`react-native-web${_path.sep}dist${_path.sep}module${_path.sep}exports${_path.sep}`);
100
- if (components.length > 1) {
101
- const component = components[1]?.split(_path.sep)[0];
102
- return component && allowedModules.has(component);
103
- }
104
- return false;
105
- }
106
- function shouldTransformRequire(t, node, basePath) {
107
- const {
108
- declarations
109
- } = node;
110
- const declaration = declarations[0];
111
- if (declarations.length > 1 || !declaration) {
112
- return false;
113
- }
114
- const {
115
- id,
116
- init
117
- } = declaration;
118
- let source = (t.isObjectPattern(id) || t.isIdentifier(id)) && t.isCallExpression(init) && t.isIdentifier(init.callee) && init.callee.name === "require" && init.arguments.length === 1 && "value" in init.arguments[0] && typeof init.arguments[0].value === "string" && init.arguments[0].value;
119
- if (!source) {
120
- return false;
121
- }
122
- if (source.startsWith(".")) {
123
- source = (0, _path.resolve)(basePath, source);
124
- }
125
-
126
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
127
- return isReactNativeSource(source) || isReactNativeWebSource(source);
6
+ exports.getInteropRequireDefaultSource = getInteropRequireDefaultSource;
7
+ function getInteropRequireDefaultSource(init, t) {
8
+ if (!t.isIdentifier(init.callee, {
9
+ name: "_interopRequireDefault"
10
+ })) {
11
+ return;
12
+ }
13
+ const interopArg = init.arguments.at(0);
14
+ if (!t.isCallExpression(interopArg) || !t.isIdentifier(interopArg.callee, {
15
+ name: "require"
16
+ })) {
17
+ return;
18
+ }
19
+ const requireArg = interopArg.arguments.at(0);
20
+ if (!t.isStringLiteral(requireArg)) {
21
+ return;
22
+ }
23
+ return requireArg.value;
128
24
  }
129
25
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_fs","require","_path","allowedModules","exports","Set","getFilesWithoutExtension","join","__dirname","dirPath","entries","readdirSync","withFileTypes","files","filter","entry","isFile","exec","name","filesWithoutExt","map","file","parse","isInsideModule","filename","module","normalized","normalize","startsWith","includes","sep","isPackageImport","path","source","node","value","shouldTransformImport","resolve","dirname","isReactNativeSource","isReactNativeWebSource","components","split","length","component","has","shouldTransformRequire","t","basePath","declarations","declaration","id","init","isObjectPattern","isIdentifier","isCallExpression","callee","arguments"],"sourceRoot":"../../../src","sources":["babel/helpers.ts"],"mappings":";;;;;;;;;;AACA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAFA;;AAoBO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAIE,GAAG,CACnCC,wBAAwB,CAAC,IAAAC,UAAI,EAACC,SAAS,EAAE,eAAe,CAAC,CAC3D,CAAC;AAED,SAASF,wBAAwBA,CAACG,OAAe,EAAE;EACjD;EACA,MAAMC,OAAO,GAAG,IAAAC,eAAW,EAACF,OAAO,EAAE;IAAEG,aAAa,EAAE;EAAK,CAAC,CAAC;;EAE7D;EACA,MAAMC,KAAK,GAAGH,OAAO,CAACI,MAAM,CACzBC,KAAK,IACJA,KAAK,CAACC,MAAM,CAAC,CAAC,IACd,WAAW,CAACC,IAAI,CAACF,KAAK,CAACG,IAAI,CAAC,IAC5B,CAAC,gBAAgB,CAACD,IAAI,CAACF,KAAK,CAACG,IAAI,CACrC,CAAC;;EAED;EACA,MAAMC,eAAe,GAAGN,KAAK,CAACO,GAAG,CAAEC,IAAI,IAAK,IAAAC,WAAK,EAACD,IAAI,CAACH,IAAI,CAAC,CAACA,IAAI,CAAC;EAElE,OAAOC,eAAe;AACxB;AAEO,SAASI,cAAcA,CAACC,QAAgB,EAAEC,MAAc,EAAW;EACxE,MAAMC,UAAU,GAAG,IAAAC,eAAS,EAACH,QAAQ,CAAC;;EAEtC;EACA,IAAIE,UAAU,KAAKD,MAAM,EAAE;IACzB,OAAO,IAAI;EACb;;EAEA;EACA,IAAIC,UAAU,CAACE,UAAU,CAAC,GAAGH,MAAM,GAAG,CAAC,EAAE;IACvC,OAAO,IAAI;EACb;;EAEA;EACA,IAAIC,UAAU,CAACG,QAAQ,CAAC,GAAGC,SAAG,GAAGL,MAAM,GA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AEO,SAASE,sBAAsBA,CACpCC,CAAa,EACbb,IAA2B,EAC3Bc,QAAgB,EAChB;EACA,MAAM;IAAEC;EAAa,CAAC,GAAGf,IAAI;EAE7B,MAAMgB,WAAW,GAAGD,YAAY,CAAC,CAAC,CAAC;EAEnC,IAAIA,YAAY,CAACN,MAAM,GAAG,CAAC,IAAI,CAACO,WAAW,EAAE;IAC3C,OAAO,KAAK;EACd;EACA,MAAM;IAAEC,EAAE;IAAEC;EAAK,CAAC,GAAGF,WAAW;EAEhC,IAAIjB,MAAM,GACR,CAACc,CAAC,CAACM,eAAe,CAACF,EAAE,CAAC,IAAIJ,CAAC,CAACO,YAAY,CAACH,EAAE,CAAC,KAC5CJ,CAAC,CAACQ,gBAAgB,CAACH,IAAI,CAAC,IACxBL,CAAC,CAACO,YAAY,CAACF,IAAI,CAACI,MAAM,CAAC,IAC3BJ,IAAI,CAACI,MAAM,CAACtC,IAAI,KAAK,SAAS,IAC9BkC,IAAI,CAACK,SAAS,CAACd,MAAM,KAAK,CAAC,IAC3B,OAAO,IAAIS,IAAI,CAACK,SAAS,CAAC,CAAC,CAAE,IAC7B,OAAOL,IAAI,CAACK,SAAS,CAAC,CAAC,CAAC,CAACtB,KAAK,KAAK,QAAQ,IAC3CiB,IAAI,CAACK,SAAS,CAAC,CAAC,CAAC,CAACtB,KAAK;EAEzB,IAAI,CAACF,MAAM,EAAE;IACX,OAAO,KAAK;EACd;EAEA,IAAIA,MAAM,CAACL,UAAU,CAAC,GAAG,CAAC,EAAE;IAC1BK,MAAM,GAAG,IAAAI,aAAO,EAACW,QAAQ,EAAEf,MAAM,CAAC;EACpC;;EAEA;EACA,OAAOM,mBAAmB,CAACN,MAAM,CAAC,IAAIO,sBAAsB,CAACP,MAAM,CAAC;AACtE","ignoreList":[]}
1
+ {"version":3,"names":["getInteropRequireDefaultSource","init","t","isIdentifier","callee","name","interopArg","arguments","at","isCallExpression","requireArg","isStringLiteral","value"],"sourceRoot":"../../../src","sources":["babel/helpers.ts"],"mappings":";;;;;;AAeO,SAASA,8BAA8BA,CAC5CC,IAAoB,EACpBC,CAAa,EACb;EACA,IAAI,CAACA,CAAC,CAACC,YAAY,CAACF,IAAI,CAACG,MAAM,EAAE;IAAEC,IAAI,EAAE;EAAyB,CAAC,CAAC,EAAE;IACpE;EACF;EAEA,MAAMC,UAAU,GAAGL,IAAI,CAACM,SAAS,CAACC,EAAE,CAAC,CAAC,CAAC;EAEvC,IACE,CAACN,CAAC,CAACO,gBAAgB,CAACH,UAAU,CAAC,IAC/B,CAACJ,CAAC,CAACC,YAAY,CAACG,UAAU,CAACF,MAAM,EAAE;IAAEC,IAAI,EAAE;EAAU,CAAC,CAAC,EACvD;IACA;EACF;EAEA,MAAMK,UAAU,GAAGJ,UAAU,CAACC,SAAS,CAACC,EAAE,CAAC,CAAC,CAAC;EAE7C,IAAI,CAACN,CAAC,CAACS,eAAe,CAACD,UAAU,CAAC,EAAE;IAClC;EACF;EAEA,OAAOA,UAAU,CAACE,KAAK;AACzB","ignoreList":[]}
@@ -4,92 +4,96 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = _default;
7
+ var _path = require("path");
7
8
  var _helpers = require("./helpers.js");
9
+ var _reactNative = require("./react-native.js");
10
+ var _reactNativeWeb = require("./react-native-web.js");
8
11
  function _default({
9
12
  types: t
10
13
  }) {
11
14
  const processed = new WeakSet();
12
- function importDeclaration(...args) {
13
- const declaration = t.importDeclaration(...args);
14
- processed.add(declaration);
15
- return declaration;
16
- }
17
- function requireDeclaration(...args) {
18
- const declaration = t.variableDeclaration(...args);
19
- processed.add(declaration);
20
- return declaration;
15
+ const thisModuleDist = (0, _path.resolve)(__dirname, "../../../dist");
16
+ const thisModuleSrc = (0, _path.resolve)(__dirname, "../../../src");
17
+ function isFromThisModule(filename) {
18
+ return filename.startsWith(thisModuleDist) || filename.startsWith(thisModuleSrc);
21
19
  }
22
20
  return {
23
21
  name: "Rewrite react-native to react-native-css",
24
22
  visitor: {
25
23
  ImportDeclaration(path, state) {
26
- if (processed.has(path) || processed.has(path.node)) {
24
+ if (processed.has(path) || processed.has(path.node) || isFromThisModule(state.filename)) {
27
25
  return;
28
26
  }
29
- const {
30
- specifiers,
31
- source
32
- } = path.node;
33
- if ((0, _helpers.isInsideModule)(state.filename, "react-native-css") || !(0, _helpers.shouldTransformImport)(path, state.filename)) {
27
+ const statements = (0, _reactNative.handleReactNativeImport)(path.node, t, state.filename) ?? (0, _reactNativeWeb.handleReactNativeWebImport)(path.node, t, state.filename);
28
+ if (!statements) {
34
29
  return;
35
30
  }
36
- if (specifiers.length === 0) {
37
- path.replaceWith(importDeclaration([], t.stringLiteral("react-native-css/components")));
38
- path.scope.registerDeclaration(path);
39
- return;
31
+ for (const statement of statements) {
32
+ processed.add(statement);
40
33
  }
41
- const imports = specifiers.map(specifier => {
42
- if (t.isImportDefaultSpecifier(specifier)) {
43
- const name = specifier.local.name;
44
- if ((0, _helpers.isPackageImport)(path)) {
45
- return importDeclaration([t.importDefaultSpecifier(specifier.local)], t.stringLiteral("react-native-css/components"));
46
- } else if (_helpers.allowedModules.has(name)) {
47
- return importDeclaration([t.importSpecifier(specifier.local, specifier.local)], t.stringLiteral(`react-native-css/components/${name}`));
48
- } else {
49
- return importDeclaration([specifier], source);
50
- }
51
- } else if (t.isImportNamespaceSpecifier(specifier)) {
52
- return importDeclaration([specifier], t.stringLiteral("react-native-css/components"));
53
- } else {
54
- const localName = t.isStringLiteral(specifier.imported) ? specifier.imported.value : specifier.imported.name;
55
- return _helpers.allowedModules.has(localName) ? importDeclaration([t.importSpecifier(specifier.local, specifier.imported)], t.stringLiteral(`react-native-css/components/${localName}`)) : importDeclaration([specifier], source);
56
- }
57
- });
58
- path.replaceInline(imports).map(importPath => {
59
- path.scope.registerDeclaration(importPath);
60
- });
34
+ path.replaceWithMultiple(statements);
61
35
  },
62
36
  VariableDeclaration(path, state) {
63
- if (processed.has(path) || processed.has(path.node)) {
37
+ if (processed.has(path) || processed.has(path.node) || isFromThisModule(state.filename)) {
64
38
  return;
65
39
  }
66
- if ((0, _helpers.isInsideModule)(state.filename, "react-native-css") || !(0, _helpers.shouldTransformRequire)(t, path.node, state.filename)) {
40
+ const firstDeclaration = path.node.declarations.at(0);
41
+
42
+ // We only handle single variable declarations for now.
43
+ if (path.node.declarations.length > 1) {
67
44
  return;
68
45
  }
69
46
 
70
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
47
+ // Skip declarations that are not initialized. eg `let x;`
48
+ if (!firstDeclaration?.init) {
49
+ return;
50
+ }
71
51
  const {
72
52
  id,
73
53
  init
74
- } = path.node.declarations[0];
75
- if (!t.isObjectPattern(id) || !init) {
76
- path.replaceWith(requireDeclaration(path.node.kind, [t.variableDeclarator(id, t.callExpression(t.identifier("require"), [t.stringLiteral(`react-native-css/components`)]))]));
54
+ } = firstDeclaration;
55
+
56
+ // We only handle `const <id> = <init>()`
57
+ if (!t.isCallExpression(init)) {
77
58
  return;
78
59
  }
79
- const imports = id.properties.map(identifier => {
80
- if (t.isRestElement(identifier)) {
81
- return requireDeclaration(path.node.kind, [t.variableDeclarator(identifier, init)]);
82
- }
83
- if (!t.isIdentifier(identifier.key)) {
84
- return requireDeclaration(path.node.kind, [t.variableDeclarator(t.objectPattern([identifier]), init)]);
85
- }
86
- const name = identifier.key.name;
87
- if (!_helpers.allowedModules.has(name)) {
88
- return requireDeclaration(path.node.kind, [t.variableDeclarator(t.objectPattern([t.objectProperty(t.identifier(name), t.identifier(name), false, true)]), init)]);
60
+
61
+ // We only handle `const id = <init>() OR const { <id> } = <init>()`
62
+ if (!(t.isIdentifier(id) || t.isObjectPattern(id))) {
63
+ return;
64
+ }
65
+ const initArg = init.arguments.at(0);
66
+ if (!initArg) {
67
+ return;
68
+ }
69
+ let statements;
70
+
71
+ // `const <id> = require(<source>);`
72
+ if (t.isIdentifier(id) && t.isIdentifier(init.callee, {
73
+ name: "require"
74
+ }) && t.isStringLiteral(initArg)) {
75
+ statements = (0, _reactNative.handleReactNativeIdentifierRequire)(path, t, id.name, initArg.value, state.filename) ?? (0, _reactNativeWeb.handleReactNativeWebIdentifierRequire)(path, t, id.name, initArg.value, state.filename);
76
+ } else if (t.isObjectPattern(id) && t.isIdentifier(init.callee, {
77
+ name: "require"
78
+ }) && t.isStringLiteral(initArg)) {
79
+ statements = (0, _reactNative.handleReactNativeObjectPatternRequire)(path, t, id, initArg.value, state.filename) ?? (0, _reactNativeWeb.handleReactNativeWebObjectPatternRequire)(path, t, id, initArg.value, state.filename);
80
+ } else if (t.isIdentifier(id) && t.isIdentifier(init.callee, {
81
+ name: "_interopRequireDefault"
82
+ })) {
83
+ // `const <id> = _interopRequireDefault(require(<source>));`
84
+ const source = (0, _helpers.getInteropRequireDefaultSource)(init, t);
85
+ if (!source) {
86
+ return;
89
87
  }
90
- return requireDeclaration(path.node.kind, [t.variableDeclarator(t.objectPattern([t.objectProperty(t.identifier(name), t.identifier(name), false, true)]), t.callExpression(t.identifier("require"), [t.stringLiteral(`react-native-css/components/${name}`)]))]);
91
- });
92
- path.replaceWithMultiple(imports);
88
+ statements = (0, _reactNativeWeb.handleReactNativeWebIdentifierRequire)(path, t, id.name, source, state.filename);
89
+ }
90
+ if (!statements) {
91
+ return;
92
+ }
93
+ for (const statement of statements) {
94
+ processed.add(statement);
95
+ }
96
+ path.replaceWithMultiple(statements);
93
97
  }
94
98
  }
95
99
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_helpers","require","_default","types","t","processed","WeakSet","importDeclaration","args","declaration","add","requireDeclaration","variableDeclaration","name","visitor","ImportDeclaration","path","state","has","node","specifiers","source","isInsideModule","filename","shouldTransformImport","length","replaceWith","stringLiteral","scope","registerDeclaration","imports","map","specifier","isImportDefaultSpecifier","local","isPackageImport","importDefaultSpecifier","allowedModules","importSpecifier","isImportNamespaceSpecifier","localName","isStringLiteral","imported","value","replaceInline","importPath","VariableDeclaration","shouldTransformRequire","id","init","declarations","isObjectPattern","kind","variableDeclarator","callExpression","identifier","properties","isRestElement","isIdentifier","key","objectPattern","objectProperty","replaceWithMultiple"],"sourceRoot":"../../../src","sources":["babel/import-plugin.ts"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAUe,SAAAC,SAAU;EACvBC,KAAK,EAAEC;AAGT,CAAC,EAA0B;EACzB,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAC,CAAC;EAE/B,SAASC,iBAAiBA,CAAC,GAAGC,IAA4C,EAAE;IAC1E,MAAMC,WAAW,GAAGL,CAAC,CAACG,iBAAiB,CAAC,GAAGC,IAAI,CAAC;IAChDH,SAAS,CAACK,GAAG,CAACD,WAAW,CAAC;IAC1B,OAAOA,WAAW;EACpB;EAEA,SAASE,kBAAkBA,CACzB,GAAGH,IAA8C,EACjD;IACA,MAAMC,WAAW,GAAGL,CAAC,CAACQ,mBAAmB,CAAC,GAAGJ,IAAI,CAAC;IAClDH,SAAS,CAACK,GAAG,CAACD,WAAW,CAAC;IAC1B,OAAOA,WAAW;EACpB;EAEA,OAAO;IACLI,IAAI,EAAE,0CAA0C;IAChDC,OAAO,EAAE;MACPC,iBAAiBA,CAACC,IAAI,EAAEC,KAAK,EAAQ;QACnC,IAAIZ,SAAS,CAACa,GAAG,CAACF,IAAI,CAAC,IAAIX,SAAS,CAACa,GAAG,CAACF,IAAI,CAACG,IAAI,CAAC,EAAE;UACnD;QACF;QAEA,MAAM;UAAEC,UAAU;UAAEC;QAAO,CAAC,GAAGL,IAAI,CAACG,IAAI;QAExC,IACE,IAAAG,uBAAc,EAACL,KAAK,CAACM,QAAQ,EAAE,kBAAkB,CAAC,IAClD,CAAC,IAAAC,8BAAqB,EAACR,IAAI,EAAEC,KAAK,CAACM,QAAQ,CAAC,EAC5C;UACA;QACF;QAEA,IAAIH,UAAU,CAACK,MAAM,KAAK,CAAC,EAAE;UAC3BT,IAAI,CAACU,WAAW,CACdnB,iBAAiB,CACf,EAAE,EACFH,CAAC,CAACuB,aAAa,CAAC,6BAA6B,CAC/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ClBT,CAAC,CAACmD,UAAU,CAAC1C,IAAI,CAAC,EAClB,KAAK,EACL,IACF,CAAC,CACF,CAAC,EACFT,CAAC,CAACkD,cAAc,CAAClD,CAAC,CAACmD,UAAU,CAAC,SAAS,CAAC,EAAE,CACxCnD,CAAC,CAACuB,aAAa,CAAC,+BAA+Bd,IAAI,EAAE,CAAC,CACvD,CACH,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;QAEFG,IAAI,CAAC8C,mBAAmB,CAAChC,OAAO,CAAC;MACnC;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_path","require","_helpers","_reactNative","_reactNativeWeb","_default","types","t","processed","WeakSet","thisModuleDist","resolve","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","name","visitor","ImportDeclaration","path","state","has","node","statements","handleReactNativeImport","handleReactNativeWebImport","statement","add","replaceWithMultiple","VariableDeclaration","firstDeclaration","declarations","at","length","init","id","isCallExpression","isIdentifier","isObjectPattern","initArg","arguments","callee","isStringLiteral","handleReactNativeIdentifierRequire","value","handleReactNativeWebIdentifierRequire","handleReactNativeObjectPatternRequire","handleReactNativeWebObjectPatternRequire","source","getInteropRequireDefaultSource"],"sourceRoot":"../../../src","sources":["babel/import-plugin.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,eAAA,GAAAH,OAAA;AAMe,SAAAI,SAAU;EACvBC,KAAK,EAAEC;AAGT,CAAC,EAA0B;EACzB,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAC,CAAC;EAE/B,MAAMC,cAAc,GAAG,IAAAC,aAAO,EAACC,SAAS,EAAE,eAAe,CAAC;EAC1D,MAAMC,aAAa,GAAG,IAAAF,aAAO,EAACC,SAAS,EAAE,cAAc,CAAC;EAExD,SAASE,gBAAgBA,CAACC,QAAgB,EAAW;IACnD,OACEA,QAAQ,CA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