react-native-css 0.0.0-nightly.008d479

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 (1052) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +330 -0
  3. package/dist/commonjs/babel/allowedModules.js +23 -0
  4. package/dist/commonjs/babel/allowedModules.js.map +1 -0
  5. package/dist/commonjs/babel/helpers.js +25 -0
  6. package/dist/commonjs/babel/helpers.js.map +1 -0
  7. package/dist/commonjs/babel/import-plugin.js +101 -0
  8. package/dist/commonjs/babel/import-plugin.js.map +1 -0
  9. package/dist/commonjs/babel/index.js +13 -0
  10. package/dist/commonjs/babel/index.js.map +1 -0
  11. package/dist/commonjs/babel/react-native-web.js +118 -0
  12. package/dist/commonjs/babel/react-native-web.js.map +1 -0
  13. package/dist/commonjs/babel/react-native.js +118 -0
  14. package/dist/commonjs/babel/react-native.js.map +1 -0
  15. package/dist/commonjs/compiler/atRules.js +108 -0
  16. package/dist/commonjs/compiler/atRules.js.map +1 -0
  17. package/dist/commonjs/compiler/compiler.js +338 -0
  18. package/dist/commonjs/compiler/compiler.js.map +1 -0
  19. package/dist/commonjs/compiler/compiler.types.js +4 -0
  20. package/dist/commonjs/compiler/compiler.types.js.map +1 -0
  21. package/dist/commonjs/compiler/container-query.js +63 -0
  22. package/dist/commonjs/compiler/container-query.js.map +1 -0
  23. package/dist/commonjs/compiler/declarations.js +2341 -0
  24. package/dist/commonjs/compiler/declarations.js.map +1 -0
  25. package/dist/commonjs/compiler/functions-web.js +44 -0
  26. package/dist/commonjs/compiler/functions-web.js.map +1 -0
  27. package/dist/commonjs/compiler/functions.js +59 -0
  28. package/dist/commonjs/compiler/functions.js.map +1 -0
  29. package/dist/commonjs/compiler/index.js +17 -0
  30. package/dist/commonjs/compiler/index.js.map +1 -0
  31. package/dist/commonjs/compiler/inheritance.test.js +78 -0
  32. package/dist/commonjs/compiler/inheritance.test.js.map +1 -0
  33. package/dist/commonjs/compiler/inline-variables.js +142 -0
  34. package/dist/commonjs/compiler/inline-variables.js.map +1 -0
  35. package/dist/commonjs/compiler/keyframes.js +60 -0
  36. package/dist/commonjs/compiler/keyframes.js.map +1 -0
  37. package/dist/commonjs/compiler/lightningcss-loader.js +50 -0
  38. package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -0
  39. package/dist/commonjs/compiler/media-query.js +172 -0
  40. package/dist/commonjs/compiler/media-query.js.map +1 -0
  41. package/dist/commonjs/compiler/pseudo-elements.js +49 -0
  42. package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
  43. package/dist/commonjs/compiler/selector-builder.js +504 -0
  44. package/dist/commonjs/compiler/selector-builder.js.map +1 -0
  45. package/dist/commonjs/compiler/selectors.js +414 -0
  46. package/dist/commonjs/compiler/selectors.js.map +1 -0
  47. package/dist/commonjs/compiler/split-by-delimiter.js +21 -0
  48. package/dist/commonjs/compiler/split-by-delimiter.js.map +1 -0
  49. package/dist/commonjs/compiler/stylesheet.js +478 -0
  50. package/dist/commonjs/compiler/stylesheet.js.map +1 -0
  51. package/dist/commonjs/compiler/supports.js +29 -0
  52. package/dist/commonjs/compiler/supports.js.map +1 -0
  53. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  54. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  55. package/dist/commonjs/components/Button.js +22 -0
  56. package/dist/commonjs/components/Button.js.map +1 -0
  57. package/dist/commonjs/components/FlatList.js +20 -0
  58. package/dist/commonjs/components/FlatList.js.map +1 -0
  59. package/dist/commonjs/components/Image.js +17 -0
  60. package/dist/commonjs/components/Image.js.map +1 -0
  61. package/dist/commonjs/components/ImageBackground.js +22 -0
  62. package/dist/commonjs/components/ImageBackground.js.map +1 -0
  63. package/dist/commonjs/components/KeyboardAvoidingView.js +19 -0
  64. package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -0
  65. package/dist/commonjs/components/Pressable.js +17 -0
  66. package/dist/commonjs/components/Pressable.js.map +1 -0
  67. package/dist/commonjs/components/ScrollView.js +18 -0
  68. package/dist/commonjs/components/ScrollView.js.map +1 -0
  69. package/dist/commonjs/components/Switch.js +17 -0
  70. package/dist/commonjs/components/Switch.js.map +1 -0
  71. package/dist/commonjs/components/Text.js +17 -0
  72. package/dist/commonjs/components/Text.js.map +1 -0
  73. package/dist/commonjs/components/TextInput.js +22 -0
  74. package/dist/commonjs/components/TextInput.js.map +1 -0
  75. package/dist/commonjs/components/TouchableHighlight.js +17 -0
  76. package/dist/commonjs/components/TouchableHighlight.js.map +1 -0
  77. package/dist/commonjs/components/TouchableOpacity.js +17 -0
  78. package/dist/commonjs/components/TouchableOpacity.js.map +1 -0
  79. package/dist/commonjs/components/TouchableWithoutFeedback.js +17 -0
  80. package/dist/commonjs/components/TouchableWithoutFeedback.js.map +1 -0
  81. package/dist/commonjs/components/View.js +17 -0
  82. package/dist/commonjs/components/View.js.map +1 -0
  83. package/dist/commonjs/components/VirtualizedList.js +20 -0
  84. package/dist/commonjs/components/VirtualizedList.js.map +1 -0
  85. package/dist/commonjs/components/copyComponentProperties.js +19 -0
  86. package/dist/commonjs/components/copyComponentProperties.js.map +1 -0
  87. package/dist/commonjs/components/index.cjs +265 -0
  88. package/dist/commonjs/components/index.cjs.map +1 -0
  89. package/dist/commonjs/components/index.js +148 -0
  90. package/dist/commonjs/components/index.js.map +1 -0
  91. package/dist/commonjs/components/react-native-safe-area-context.js +17 -0
  92. package/dist/commonjs/components/react-native-safe-area-context.js.map +1 -0
  93. package/dist/commonjs/components/react-native-safe-area-context.native.js +53 -0
  94. package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -0
  95. package/dist/commonjs/index.js +17 -0
  96. package/dist/commonjs/index.js.map +1 -0
  97. package/dist/commonjs/jest/expect.d.js +2 -0
  98. package/dist/commonjs/jest/expect.d.js.map +1 -0
  99. package/dist/commonjs/jest/index.js +55 -0
  100. package/dist/commonjs/jest/index.js.map +1 -0
  101. package/dist/commonjs/jest/setup.js +3 -0
  102. package/dist/commonjs/jest/setup.js.map +1 -0
  103. package/dist/commonjs/jest/setupAfterEnv.js +15 -0
  104. package/dist/commonjs/jest/setupAfterEnv.js.map +1 -0
  105. package/dist/commonjs/metro/index.js +60 -0
  106. package/dist/commonjs/metro/index.js.map +1 -0
  107. package/dist/commonjs/metro/injection-code.js +27 -0
  108. package/dist/commonjs/metro/injection-code.js.map +1 -0
  109. package/dist/commonjs/metro/metro-transformer.js +38 -0
  110. package/dist/commonjs/metro/metro-transformer.js.map +1 -0
  111. package/dist/commonjs/metro/override.js +6 -0
  112. package/dist/commonjs/metro/override.js.map +1 -0
  113. package/dist/commonjs/metro/picocolors.js +71 -0
  114. package/dist/commonjs/metro/picocolors.js.map +1 -0
  115. package/dist/commonjs/metro/resolver.js +58 -0
  116. package/dist/commonjs/metro/resolver.js.map +1 -0
  117. package/dist/commonjs/metro/stringify.js +59 -0
  118. package/dist/commonjs/metro/stringify.js.map +1 -0
  119. package/dist/commonjs/metro/typescript.js +47 -0
  120. package/dist/commonjs/metro/typescript.js.map +1 -0
  121. package/dist/commonjs/native/api.js +117 -0
  122. package/dist/commonjs/native/api.js.map +1 -0
  123. package/dist/commonjs/native/conditions/attributes.js +44 -0
  124. package/dist/commonjs/native/conditions/attributes.js.map +1 -0
  125. package/dist/commonjs/native/conditions/container-query.js +123 -0
  126. package/dist/commonjs/native/conditions/container-query.js.map +1 -0
  127. package/dist/commonjs/native/conditions/guards.js +33 -0
  128. package/dist/commonjs/native/conditions/guards.js.map +1 -0
  129. package/dist/commonjs/native/conditions/index.js +40 -0
  130. package/dist/commonjs/native/conditions/index.js.map +1 -0
  131. package/dist/commonjs/native/conditions/media-query.js +98 -0
  132. package/dist/commonjs/native/conditions/media-query.js.map +1 -0
  133. package/dist/commonjs/native/index.js +28 -0
  134. package/dist/commonjs/native/index.js.map +1 -0
  135. package/dist/commonjs/native/objects.js +92 -0
  136. package/dist/commonjs/native/objects.js.map +1 -0
  137. package/dist/commonjs/native/react/interaction.js +63 -0
  138. package/dist/commonjs/native/react/interaction.js.map +1 -0
  139. package/dist/commonjs/native/react/rules.js +259 -0
  140. package/dist/commonjs/native/react/rules.js.map +1 -0
  141. package/dist/commonjs/native/react/useNativeCss.js +166 -0
  142. package/dist/commonjs/native/react/useNativeCss.js.map +1 -0
  143. package/dist/commonjs/native/react/usePassthrough.js +50 -0
  144. package/dist/commonjs/native/react/usePassthrough.js.map +1 -0
  145. package/dist/commonjs/native/react-native-css-metro-override.js +39 -0
  146. package/dist/commonjs/native/react-native-css-metro-override.js.map +1 -0
  147. package/dist/commonjs/native/reactivity.js +181 -0
  148. package/dist/commonjs/native/reactivity.js.map +1 -0
  149. package/dist/commonjs/native/reanimated.js +17 -0
  150. package/dist/commonjs/native/reanimated.js.map +1 -0
  151. package/dist/commonjs/native/styles/calculate-props.js +162 -0
  152. package/dist/commonjs/native/styles/calculate-props.js.map +1 -0
  153. package/dist/commonjs/native/styles/constants.js +9 -0
  154. package/dist/commonjs/native/styles/constants.js.map +1 -0
  155. package/dist/commonjs/native/styles/defaults.js +69 -0
  156. package/dist/commonjs/native/styles/defaults.js.map +1 -0
  157. package/dist/commonjs/native/styles/functions/animation-timing.js +34 -0
  158. package/dist/commonjs/native/styles/functions/animation-timing.js.map +1 -0
  159. package/dist/commonjs/native/styles/functions/calc.js +125 -0
  160. package/dist/commonjs/native/styles/functions/calc.js.map +1 -0
  161. package/dist/commonjs/native/styles/functions/color-mix.js +50 -0
  162. package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -0
  163. package/dist/commonjs/native/styles/functions/filters.js +84 -0
  164. package/dist/commonjs/native/styles/functions/filters.js.map +1 -0
  165. package/dist/commonjs/native/styles/functions/index.js +94 -0
  166. package/dist/commonjs/native/styles/functions/index.js.map +1 -0
  167. package/dist/commonjs/native/styles/functions/numeric-functions.js +32 -0
  168. package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -0
  169. package/dist/commonjs/native/styles/functions/platform-functions.js +46 -0
  170. package/dist/commonjs/native/styles/functions/platform-functions.js.map +1 -0
  171. package/dist/commonjs/native/styles/functions/string-functions.js +23 -0
  172. package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -0
  173. package/dist/commonjs/native/styles/functions/transform-functions.js +121 -0
  174. package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -0
  175. package/dist/commonjs/native/styles/index.js +345 -0
  176. package/dist/commonjs/native/styles/index.js.map +1 -0
  177. package/dist/commonjs/native/styles/line-height.js +25 -0
  178. package/dist/commonjs/native/styles/line-height.js.map +1 -0
  179. package/dist/commonjs/native/styles/resolve.js +107 -0
  180. package/dist/commonjs/native/styles/resolve.js.map +1 -0
  181. package/dist/commonjs/native/styles/shorthands/_handler.js +79 -0
  182. package/dist/commonjs/native/styles/shorthands/_handler.js.map +1 -0
  183. package/dist/commonjs/native/styles/shorthands/animation.js +61 -0
  184. package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -0
  185. package/dist/commonjs/native/styles/shorthands/border.js +12 -0
  186. package/dist/commonjs/native/styles/shorthands/border.js.map +1 -0
  187. package/dist/commonjs/native/styles/shorthands/box-shadow.js +48 -0
  188. package/dist/commonjs/native/styles/shorthands/box-shadow.js.map +1 -0
  189. package/dist/commonjs/native/styles/shorthands/index.js +61 -0
  190. package/dist/commonjs/native/styles/shorthands/index.js.map +1 -0
  191. package/dist/commonjs/native/styles/shorthands/text-shadow.js +13 -0
  192. package/dist/commonjs/native/styles/shorthands/text-shadow.js.map +1 -0
  193. package/dist/commonjs/native/styles/shorthands/transform.js +23 -0
  194. package/dist/commonjs/native/styles/shorthands/transform.js.map +1 -0
  195. package/dist/commonjs/native/styles/units.js +54 -0
  196. package/dist/commonjs/native/styles/units.js.map +1 -0
  197. package/dist/commonjs/native/styles/variables.js +79 -0
  198. package/dist/commonjs/native/styles/variables.js.map +1 -0
  199. package/dist/commonjs/native-internal/README.md +11 -0
  200. package/dist/commonjs/native-internal/index.js +39 -0
  201. package/dist/commonjs/native-internal/index.js.map +1 -0
  202. package/dist/commonjs/native-internal/root.js +34 -0
  203. package/dist/commonjs/native-internal/root.js.map +1 -0
  204. package/dist/commonjs/native-internal/style-collection.js +110 -0
  205. package/dist/commonjs/native-internal/style-collection.js.map +1 -0
  206. package/dist/commonjs/native-internal/variables.js +27 -0
  207. package/dist/commonjs/native-internal/variables.js.map +1 -0
  208. package/dist/commonjs/package.json +1 -0
  209. package/dist/commonjs/runtime.js +17 -0
  210. package/dist/commonjs/runtime.js.map +1 -0
  211. package/dist/commonjs/runtime.native.js +17 -0
  212. package/dist/commonjs/runtime.native.js.map +1 -0
  213. package/dist/commonjs/runtime.types.js +6 -0
  214. package/dist/commonjs/runtime.types.js.map +1 -0
  215. package/dist/commonjs/utilities/dot-notation.types.js +2 -0
  216. package/dist/commonjs/utilities/dot-notation.types.js.map +1 -0
  217. package/dist/commonjs/utilities/index.js +39 -0
  218. package/dist/commonjs/utilities/index.js.map +1 -0
  219. package/dist/commonjs/utilities/specificity.js +44 -0
  220. package/dist/commonjs/utilities/specificity.js.map +1 -0
  221. package/dist/commonjs/utilities/style-descriptor.js +21 -0
  222. package/dist/commonjs/utilities/style-descriptor.js.map +1 -0
  223. package/dist/commonjs/web/api.js +89 -0
  224. package/dist/commonjs/web/api.js.map +1 -0
  225. package/dist/commonjs/web/assign-style.js +27 -0
  226. package/dist/commonjs/web/assign-style.js.map +1 -0
  227. package/dist/commonjs/web/index.js +18 -0
  228. package/dist/commonjs/web/index.js.map +1 -0
  229. package/dist/commonjs/web/metro.js +6 -0
  230. package/dist/commonjs/web/metro.js.map +1 -0
  231. package/dist/module/babel/allowedModules.js +19 -0
  232. package/dist/module/babel/allowedModules.js.map +1 -0
  233. package/dist/module/babel/helpers.js +21 -0
  234. package/dist/module/babel/helpers.js.map +1 -0
  235. package/dist/module/babel/import-plugin.js +97 -0
  236. package/dist/module/babel/import-plugin.js.map +1 -0
  237. package/dist/module/babel/index.js +9 -0
  238. package/dist/module/babel/index.js.map +1 -0
  239. package/dist/module/babel/react-native-web.js +112 -0
  240. package/dist/module/babel/react-native-web.js.map +1 -0
  241. package/dist/module/babel/react-native.js +112 -0
  242. package/dist/module/babel/react-native.js.map +1 -0
  243. package/dist/module/compiler/atRules.js +104 -0
  244. package/dist/module/compiler/atRules.js.map +1 -0
  245. package/dist/module/compiler/compiler.js +333 -0
  246. package/dist/module/compiler/compiler.js.map +1 -0
  247. package/dist/module/compiler/compiler.types.js +60 -0
  248. package/dist/module/compiler/compiler.types.js.map +1 -0
  249. package/dist/module/compiler/container-query.js +59 -0
  250. package/dist/module/compiler/container-query.js.map +1 -0
  251. package/dist/module/compiler/declarations.js +2260 -0
  252. package/dist/module/compiler/declarations.js.map +1 -0
  253. package/dist/module/compiler/functions-web.js +32 -0
  254. package/dist/module/compiler/functions-web.js.map +1 -0
  255. package/dist/module/compiler/functions.js +47 -0
  256. package/dist/module/compiler/functions.js.map +1 -0
  257. package/dist/module/compiler/index.js +9 -0
  258. package/dist/module/compiler/index.js.map +1 -0
  259. package/dist/module/compiler/inheritance.test.js +78 -0
  260. package/dist/module/compiler/inheritance.test.js.map +1 -0
  261. package/dist/module/compiler/inline-variables.js +138 -0
  262. package/dist/module/compiler/inline-variables.js.map +1 -0
  263. package/dist/module/compiler/keyframes.js +54 -0
  264. package/dist/module/compiler/keyframes.js.map +1 -0
  265. package/dist/module/compiler/lightningcss-loader.js +46 -0
  266. package/dist/module/compiler/lightningcss-loader.js.map +1 -0
  267. package/dist/module/compiler/media-query.js +166 -0
  268. package/dist/module/compiler/media-query.js.map +1 -0
  269. package/dist/module/compiler/pseudo-elements.js +44 -0
  270. package/dist/module/compiler/pseudo-elements.js.map +1 -0
  271. package/dist/module/compiler/selector-builder.js +499 -0
  272. package/dist/module/compiler/selector-builder.js.map +1 -0
  273. package/dist/module/compiler/selectors.js +409 -0
  274. package/dist/module/compiler/selectors.js.map +1 -0
  275. package/dist/module/compiler/split-by-delimiter.js +17 -0
  276. package/dist/module/compiler/split-by-delimiter.js.map +1 -0
  277. package/dist/module/compiler/stylesheet.js +473 -0
  278. package/dist/module/compiler/stylesheet.js.map +1 -0
  279. package/dist/module/compiler/supports.js +25 -0
  280. package/dist/module/compiler/supports.js.map +1 -0
  281. package/dist/module/components/ActivityIndicator.js +18 -0
  282. package/dist/module/components/ActivityIndicator.js.map +1 -0
  283. package/dist/module/components/Button.js +18 -0
  284. package/dist/module/components/Button.js.map +1 -0
  285. package/dist/module/components/FlatList.js +16 -0
  286. package/dist/module/components/FlatList.js.map +1 -0
  287. package/dist/module/components/Image.js +13 -0
  288. package/dist/module/components/Image.js.map +1 -0
  289. package/dist/module/components/ImageBackground.js +18 -0
  290. package/dist/module/components/ImageBackground.js.map +1 -0
  291. package/dist/module/components/KeyboardAvoidingView.js +15 -0
  292. package/dist/module/components/KeyboardAvoidingView.js.map +1 -0
  293. package/dist/module/components/Pressable.js +13 -0
  294. package/dist/module/components/Pressable.js.map +1 -0
  295. package/dist/module/components/ScrollView.js +14 -0
  296. package/dist/module/components/ScrollView.js.map +1 -0
  297. package/dist/module/components/Switch.js +13 -0
  298. package/dist/module/components/Switch.js.map +1 -0
  299. package/dist/module/components/Text.js +13 -0
  300. package/dist/module/components/Text.js.map +1 -0
  301. package/dist/module/components/TextInput.js +18 -0
  302. package/dist/module/components/TextInput.js.map +1 -0
  303. package/dist/module/components/TouchableHighlight.js +13 -0
  304. package/dist/module/components/TouchableHighlight.js.map +1 -0
  305. package/dist/module/components/TouchableOpacity.js +13 -0
  306. package/dist/module/components/TouchableOpacity.js.map +1 -0
  307. package/dist/module/components/TouchableWithoutFeedback.js +13 -0
  308. package/dist/module/components/TouchableWithoutFeedback.js.map +1 -0
  309. package/dist/module/components/View.js +13 -0
  310. package/dist/module/components/View.js.map +1 -0
  311. package/dist/module/components/VirtualizedList.js +16 -0
  312. package/dist/module/components/VirtualizedList.js.map +1 -0
  313. package/dist/module/components/copyComponentProperties.js +15 -0
  314. package/dist/module/components/copyComponentProperties.js.map +1 -0
  315. package/dist/module/components/index.cjs +265 -0
  316. package/dist/module/components/index.cjs.map +1 -0
  317. package/dist/module/components/index.js +20 -0
  318. package/dist/module/components/index.js.map +1 -0
  319. package/dist/module/components/react-native-safe-area-context.js +4 -0
  320. package/dist/module/components/react-native-safe-area-context.js.map +1 -0
  321. package/dist/module/components/react-native-safe-area-context.native.js +36 -0
  322. package/dist/module/components/react-native-safe-area-context.native.js.map +1 -0
  323. package/dist/module/index.js +4 -0
  324. package/dist/module/index.js.map +1 -0
  325. package/dist/module/jest/expect.d.js +2 -0
  326. package/dist/module/jest/expect.d.js.map +1 -0
  327. package/dist/module/jest/index.js +49 -0
  328. package/dist/module/jest/index.js.map +1 -0
  329. package/dist/module/jest/setup.js +3 -0
  330. package/dist/module/jest/setup.js.map +1 -0
  331. package/dist/module/jest/setupAfterEnv.js +15 -0
  332. package/dist/module/jest/setupAfterEnv.js.map +1 -0
  333. package/dist/module/metro/index.js +55 -0
  334. package/dist/module/metro/index.js.map +1 -0
  335. package/dist/module/metro/injection-code.js +22 -0
  336. package/dist/module/metro/injection-code.js.map +1 -0
  337. package/dist/module/metro/metro-transformer.js +34 -0
  338. package/dist/module/metro/metro-transformer.js.map +1 -0
  339. package/dist/module/metro/override.js +4 -0
  340. package/dist/module/metro/override.js.map +1 -0
  341. package/dist/module/metro/picocolors.js +67 -0
  342. package/dist/module/metro/picocolors.js.map +1 -0
  343. package/dist/module/metro/resolver.js +53 -0
  344. package/dist/module/metro/resolver.js.map +1 -0
  345. package/dist/module/metro/stringify.js +55 -0
  346. package/dist/module/metro/stringify.js.map +1 -0
  347. package/dist/module/metro/typescript.js +42 -0
  348. package/dist/module/metro/typescript.js.map +1 -0
  349. package/dist/module/native/api.js +85 -0
  350. package/dist/module/native/api.js.map +1 -0
  351. package/dist/module/native/conditions/attributes.js +40 -0
  352. package/dist/module/native/conditions/attributes.js.map +1 -0
  353. package/dist/module/native/conditions/container-query.js +117 -0
  354. package/dist/module/native/conditions/container-query.js.map +1 -0
  355. package/dist/module/native/conditions/guards.js +29 -0
  356. package/dist/module/native/conditions/guards.js.map +1 -0
  357. package/dist/module/native/conditions/index.js +36 -0
  358. package/dist/module/native/conditions/index.js.map +1 -0
  359. package/dist/module/native/conditions/media-query.js +93 -0
  360. package/dist/module/native/conditions/media-query.js.map +1 -0
  361. package/dist/module/native/index.js +5 -0
  362. package/dist/module/native/index.js.map +1 -0
  363. package/dist/module/native/objects.js +84 -0
  364. package/dist/module/native/objects.js.map +1 -0
  365. package/dist/module/native/react/interaction.js +59 -0
  366. package/dist/module/native/react/interaction.js.map +1 -0
  367. package/dist/module/native/react/rules.js +252 -0
  368. package/dist/module/native/react/rules.js.map +1 -0
  369. package/dist/module/native/react/useNativeCss.js +160 -0
  370. package/dist/module/native/react/useNativeCss.js.map +1 -0
  371. package/dist/module/native/react/usePassthrough.js +45 -0
  372. package/dist/module/native/react/usePassthrough.js.map +1 -0
  373. package/dist/module/native/react-native-css-metro-override.js +37 -0
  374. package/dist/module/native/react-native-css-metro-override.js.map +1 -0
  375. package/dist/module/native/reactivity.js +169 -0
  376. package/dist/module/native/reactivity.js.map +1 -0
  377. package/dist/module/native/reanimated.js +13 -0
  378. package/dist/module/native/reanimated.js.map +1 -0
  379. package/dist/module/native/styles/calculate-props.js +157 -0
  380. package/dist/module/native/styles/calculate-props.js.map +1 -0
  381. package/dist/module/native/styles/constants.js +5 -0
  382. package/dist/module/native/styles/constants.js.map +1 -0
  383. package/dist/module/native/styles/defaults.js +65 -0
  384. package/dist/module/native/styles/defaults.js.map +1 -0
  385. package/dist/module/native/styles/functions/animation-timing.js +30 -0
  386. package/dist/module/native/styles/functions/animation-timing.js.map +1 -0
  387. package/dist/module/native/styles/functions/calc.js +120 -0
  388. package/dist/module/native/styles/functions/calc.js.map +1 -0
  389. package/dist/module/native/styles/functions/color-mix.js +45 -0
  390. package/dist/module/native/styles/functions/color-mix.js.map +1 -0
  391. package/dist/module/native/styles/functions/filters.js +70 -0
  392. package/dist/module/native/styles/functions/filters.js.map +1 -0
  393. package/dist/module/native/styles/functions/index.js +11 -0
  394. package/dist/module/native/styles/functions/index.js.map +1 -0
  395. package/dist/module/native/styles/functions/numeric-functions.js +25 -0
  396. package/dist/module/native/styles/functions/numeric-functions.js.map +1 -0
  397. package/dist/module/native/styles/functions/platform-functions.js +36 -0
  398. package/dist/module/native/styles/functions/platform-functions.js.map +1 -0
  399. package/dist/module/native/styles/functions/string-functions.js +18 -0
  400. package/dist/module/native/styles/functions/string-functions.js.map +1 -0
  401. package/dist/module/native/styles/functions/transform-functions.js +114 -0
  402. package/dist/module/native/styles/functions/transform-functions.js.map +1 -0
  403. package/dist/module/native/styles/index.js +341 -0
  404. package/dist/module/native/styles/index.js.map +1 -0
  405. package/dist/module/native/styles/line-height.js +20 -0
  406. package/dist/module/native/styles/line-height.js.map +1 -0
  407. package/dist/module/native/styles/resolve.js +102 -0
  408. package/dist/module/native/styles/resolve.js.map +1 -0
  409. package/dist/module/native/styles/shorthands/_handler.js +74 -0
  410. package/dist/module/native/styles/shorthands/_handler.js.map +1 -0
  411. package/dist/module/native/styles/shorthands/animation.js +54 -0
  412. package/dist/module/native/styles/shorthands/animation.js.map +1 -0
  413. package/dist/module/native/styles/shorthands/border.js +8 -0
  414. package/dist/module/native/styles/shorthands/border.js.map +1 -0
  415. package/dist/module/native/styles/shorthands/box-shadow.js +43 -0
  416. package/dist/module/native/styles/shorthands/box-shadow.js.map +1 -0
  417. package/dist/module/native/styles/shorthands/index.js +8 -0
  418. package/dist/module/native/styles/shorthands/index.js.map +1 -0
  419. package/dist/module/native/styles/shorthands/text-shadow.js +9 -0
  420. package/dist/module/native/styles/shorthands/text-shadow.js.map +1 -0
  421. package/dist/module/native/styles/shorthands/transform.js +18 -0
  422. package/dist/module/native/styles/shorthands/transform.js.map +1 -0
  423. package/dist/module/native/styles/units.js +46 -0
  424. package/dist/module/native/styles/units.js.map +1 -0
  425. package/dist/module/native/styles/variables.js +75 -0
  426. package/dist/module/native/styles/variables.js.map +1 -0
  427. package/dist/module/native-internal/README.md +11 -0
  428. package/dist/module/native-internal/index.js +6 -0
  429. package/dist/module/native-internal/index.js.map +1 -0
  430. package/dist/module/native-internal/root.js +30 -0
  431. package/dist/module/native-internal/root.js.map +1 -0
  432. package/dist/module/native-internal/style-collection.js +95 -0
  433. package/dist/module/native-internal/style-collection.js.map +1 -0
  434. package/dist/module/native-internal/variables.js +22 -0
  435. package/dist/module/native-internal/variables.js.map +1 -0
  436. package/dist/module/package.json +1 -0
  437. package/dist/module/runtime.js +4 -0
  438. package/dist/module/runtime.js.map +1 -0
  439. package/dist/module/runtime.native.js +4 -0
  440. package/dist/module/runtime.native.js.map +1 -0
  441. package/dist/module/runtime.types.js +4 -0
  442. package/dist/module/runtime.types.js.map +1 -0
  443. package/dist/module/utilities/dot-notation.types.js +2 -0
  444. package/dist/module/utilities/dot-notation.types.js.map +1 -0
  445. package/dist/module/utilities/index.js +6 -0
  446. package/dist/module/utilities/index.js.map +1 -0
  447. package/dist/module/utilities/specificity.js +39 -0
  448. package/dist/module/utilities/specificity.js.map +1 -0
  449. package/dist/module/utilities/style-descriptor.js +16 -0
  450. package/dist/module/utilities/style-descriptor.js.map +1 -0
  451. package/dist/module/web/api.js +79 -0
  452. package/dist/module/web/api.js.map +1 -0
  453. package/dist/module/web/assign-style.js +23 -0
  454. package/dist/module/web/assign-style.js.map +1 -0
  455. package/dist/module/web/index.js +6 -0
  456. package/dist/module/web/index.js.map +1 -0
  457. package/dist/module/web/metro.js +5 -0
  458. package/dist/module/web/metro.js.map +1 -0
  459. package/dist/typescript/commonjs/.config/eslint.config.d.mts +3 -0
  460. package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +1 -0
  461. package/dist/typescript/commonjs/eslint.config.d.mts +2 -0
  462. package/dist/typescript/commonjs/eslint.config.d.mts.map +1 -0
  463. package/dist/typescript/commonjs/example/app.config.d.ts +4 -0
  464. package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -0
  465. package/dist/typescript/commonjs/example/index.d.ts +2 -0
  466. package/dist/typescript/commonjs/example/index.d.ts.map +1 -0
  467. package/dist/typescript/commonjs/example/metro.config.d.ts +3 -0
  468. package/dist/typescript/commonjs/example/metro.config.d.ts.map +1 -0
  469. package/dist/typescript/commonjs/example/postcss.config.d.mts +7 -0
  470. package/dist/typescript/commonjs/example/postcss.config.d.mts.map +1 -0
  471. package/dist/typescript/commonjs/example/src/App.d.ts +3 -0
  472. package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -0
  473. package/dist/typescript/commonjs/package.json +1 -0
  474. package/dist/typescript/commonjs/src/babel/allowedModules.d.ts +2 -0
  475. package/dist/typescript/commonjs/src/babel/allowedModules.d.ts.map +1 -0
  476. package/dist/typescript/commonjs/src/babel/helpers.d.ts +13 -0
  477. package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -0
  478. package/dist/typescript/commonjs/src/babel/import-plugin.d.ts +6 -0
  479. package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -0
  480. package/dist/typescript/commonjs/src/babel/index.d.ts +4 -0
  481. package/dist/typescript/commonjs/src/babel/index.d.ts.map +1 -0
  482. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +8 -0
  483. package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -0
  484. package/dist/typescript/commonjs/src/babel/react-native.d.ts +8 -0
  485. package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -0
  486. package/dist/typescript/commonjs/src/compiler/atRules.d.ts +34 -0
  487. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -0
  488. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +17 -0
  489. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -0
  490. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +201 -0
  491. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -0
  492. package/dist/typescript/commonjs/src/compiler/container-query.d.ts +5 -0
  493. package/dist/typescript/commonjs/src/compiler/container-query.d.ts.map +1 -0
  494. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +132 -0
  495. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -0
  496. package/dist/typescript/commonjs/src/compiler/functions-web.d.ts +11 -0
  497. package/dist/typescript/commonjs/src/compiler/functions-web.d.ts.map +1 -0
  498. package/dist/typescript/commonjs/src/compiler/functions.d.ts +11 -0
  499. package/dist/typescript/commonjs/src/compiler/functions.d.ts.map +1 -0
  500. package/dist/typescript/commonjs/src/compiler/index.d.ts +7 -0
  501. package/dist/typescript/commonjs/src/compiler/index.d.ts.map +1 -0
  502. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +2 -0
  503. package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +1 -0
  504. package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts +4 -0
  505. package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts.map +1 -0
  506. package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +7 -0
  507. package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -0
  508. package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts +30 -0
  509. package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -0
  510. package/dist/typescript/commonjs/src/compiler/media-query.d.ts +7 -0
  511. package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -0
  512. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
  513. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
  514. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +24 -0
  515. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  516. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +24 -0
  517. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -0
  518. package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts +2 -0
  519. package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts.map +1 -0
  520. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +69 -0
  521. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -0
  522. package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
  523. package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
  524. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +4 -0
  525. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  526. package/dist/typescript/commonjs/src/components/Button.d.ts +4 -0
  527. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  528. package/dist/typescript/commonjs/src/components/FlatList.d.ts +6 -0
  529. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  530. package/dist/typescript/commonjs/src/components/Image.d.ts +4 -0
  531. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  532. package/dist/typescript/commonjs/src/components/ImageBackground.d.ts +4 -0
  533. package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -0
  534. package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts +4 -0
  535. package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -0
  536. package/dist/typescript/commonjs/src/components/Pressable.d.ts +4 -0
  537. package/dist/typescript/commonjs/src/components/Pressable.d.ts.map +1 -0
  538. package/dist/typescript/commonjs/src/components/ScrollView.d.ts +4 -0
  539. package/dist/typescript/commonjs/src/components/ScrollView.d.ts.map +1 -0
  540. package/dist/typescript/commonjs/src/components/Switch.d.ts +4 -0
  541. package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
  542. package/dist/typescript/commonjs/src/components/Text.d.ts +4 -0
  543. package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -0
  544. package/dist/typescript/commonjs/src/components/TextInput.d.ts +4 -0
  545. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  546. package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts +4 -0
  547. package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts.map +1 -0
  548. package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts +4 -0
  549. package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts.map +1 -0
  550. package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts +4 -0
  551. package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts.map +1 -0
  552. package/dist/typescript/commonjs/src/components/View.d.ts +4 -0
  553. package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -0
  554. package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts +6 -0
  555. package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts.map +1 -0
  556. package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts +5 -0
  557. package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts.map +1 -0
  558. package/dist/typescript/commonjs/src/components/index.d.cts +2 -0
  559. package/dist/typescript/commonjs/src/components/index.d.cts.map +1 -0
  560. package/dist/typescript/commonjs/src/components/index.d.ts +18 -0
  561. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
  562. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts +2 -0
  563. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts.map +1 -0
  564. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +4 -0
  565. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  566. package/dist/typescript/commonjs/src/index.d.ts +2 -0
  567. package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
  568. package/dist/typescript/commonjs/src/jest/index.d.ts +30 -0
  569. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -0
  570. package/dist/typescript/commonjs/src/jest/setup.d.ts +1 -0
  571. package/dist/typescript/commonjs/src/jest/setup.d.ts.map +1 -0
  572. package/dist/typescript/commonjs/src/jest/setupAfterEnv.d.ts +1 -0
  573. package/dist/typescript/commonjs/src/jest/setupAfterEnv.d.ts.map +1 -0
  574. package/dist/typescript/commonjs/src/metro/index.d.ts +11 -0
  575. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -0
  576. package/dist/typescript/commonjs/src/metro/injection-code.d.ts +13 -0
  577. package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -0
  578. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +6 -0
  579. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -0
  580. package/dist/typescript/commonjs/src/metro/override.d.ts +2 -0
  581. package/dist/typescript/commonjs/src/metro/override.d.ts.map +1 -0
  582. package/dist/typescript/commonjs/src/metro/picocolors.d.ts +27 -0
  583. package/dist/typescript/commonjs/src/metro/picocolors.d.ts.map +1 -0
  584. package/dist/typescript/commonjs/src/metro/resolver.d.ts +4 -0
  585. package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -0
  586. package/dist/typescript/commonjs/src/metro/stringify.d.ts +7 -0
  587. package/dist/typescript/commonjs/src/metro/stringify.d.ts.map +1 -0
  588. package/dist/typescript/commonjs/src/metro/typescript.d.ts +2 -0
  589. package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -0
  590. package/dist/typescript/commonjs/src/native/api.d.ts +26 -0
  591. package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -0
  592. package/dist/typescript/commonjs/src/native/conditions/attributes.d.ts +4 -0
  593. package/dist/typescript/commonjs/src/native/conditions/attributes.d.ts.map +1 -0
  594. package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts +7 -0
  595. package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts.map +1 -0
  596. package/dist/typescript/commonjs/src/native/conditions/guards.d.ts +5 -0
  597. package/dist/typescript/commonjs/src/native/conditions/guards.d.ts.map +1 -0
  598. package/dist/typescript/commonjs/src/native/conditions/index.d.ts +6 -0
  599. package/dist/typescript/commonjs/src/native/conditions/index.d.ts.map +1 -0
  600. package/dist/typescript/commonjs/src/native/conditions/media-query.d.ts +4 -0
  601. package/dist/typescript/commonjs/src/native/conditions/media-query.d.ts.map +1 -0
  602. package/dist/typescript/commonjs/src/native/index.d.ts +4 -0
  603. package/dist/typescript/commonjs/src/native/index.d.ts.map +1 -0
  604. package/dist/typescript/commonjs/src/native/objects.d.ts +5 -0
  605. package/dist/typescript/commonjs/src/native/objects.d.ts.map +1 -0
  606. package/dist/typescript/commonjs/src/native/react/interaction.d.ts +6 -0
  607. package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -0
  608. package/dist/typescript/commonjs/src/native/react/rules.d.ts +7 -0
  609. package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -0
  610. package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +38 -0
  611. package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -0
  612. package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts +4 -0
  613. package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -0
  614. package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts +2 -0
  615. package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts.map +1 -0
  616. package/dist/typescript/commonjs/src/native/reactivity.d.ts +52 -0
  617. package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -0
  618. package/dist/typescript/commonjs/src/native/reanimated.d.ts +5 -0
  619. package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -0
  620. package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts +10 -0
  621. package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts.map +1 -0
  622. package/dist/typescript/commonjs/src/native/styles/constants.d.ts +3 -0
  623. package/dist/typescript/commonjs/src/native/styles/constants.d.ts.map +1 -0
  624. package/dist/typescript/commonjs/src/native/styles/defaults.d.ts +3 -0
  625. package/dist/typescript/commonjs/src/native/styles/defaults.d.ts.map +1 -0
  626. package/dist/typescript/commonjs/src/native/styles/functions/animation-timing.d.ts +4 -0
  627. package/dist/typescript/commonjs/src/native/styles/functions/animation-timing.d.ts.map +1 -0
  628. package/dist/typescript/commonjs/src/native/styles/functions/calc.d.ts +3 -0
  629. package/dist/typescript/commonjs/src/native/styles/functions/calc.d.ts.map +1 -0
  630. package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts +3 -0
  631. package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -0
  632. package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +12 -0
  633. package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -0
  634. package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts +9 -0
  635. package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts.map +1 -0
  636. package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts +5 -0
  637. package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -0
  638. package/dist/typescript/commonjs/src/native/styles/functions/platform-functions.d.ts +8 -0
  639. package/dist/typescript/commonjs/src/native/styles/functions/platform-functions.d.ts.map +1 -0
  640. package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +3 -0
  641. package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -0
  642. package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts +5 -0
  643. package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -0
  644. package/dist/typescript/commonjs/src/native/styles/index.d.ts +19 -0
  645. package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -0
  646. package/dist/typescript/commonjs/src/native/styles/line-height.d.ts +3 -0
  647. package/dist/typescript/commonjs/src/native/styles/line-height.d.ts.map +1 -0
  648. package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +18 -0
  649. package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -0
  650. package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts +11 -0
  651. package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts.map +1 -0
  652. package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts +5 -0
  653. package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -0
  654. package/dist/typescript/commonjs/src/native/styles/shorthands/border.d.ts +2 -0
  655. package/dist/typescript/commonjs/src/native/styles/shorthands/border.d.ts.map +1 -0
  656. package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts +3 -0
  657. package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  658. package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +6 -0
  659. package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -0
  660. package/dist/typescript/commonjs/src/native/styles/shorthands/text-shadow.d.ts +2 -0
  661. package/dist/typescript/commonjs/src/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  662. package/dist/typescript/commonjs/src/native/styles/shorthands/transform.d.ts +7 -0
  663. package/dist/typescript/commonjs/src/native/styles/shorthands/transform.d.ts.map +1 -0
  664. package/dist/typescript/commonjs/src/native/styles/units.d.ts +6 -0
  665. package/dist/typescript/commonjs/src/native/styles/units.d.ts.map +1 -0
  666. package/dist/typescript/commonjs/src/native/styles/variables.d.ts +5 -0
  667. package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -0
  668. package/dist/typescript/commonjs/src/native-internal/index.d.ts +4 -0
  669. package/dist/typescript/commonjs/src/native-internal/index.d.ts.map +1 -0
  670. package/dist/typescript/commonjs/src/native-internal/root.d.ts +11 -0
  671. package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -0
  672. package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts +16 -0
  673. package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts.map +1 -0
  674. package/dist/typescript/commonjs/src/native-internal/variables.d.ts +8 -0
  675. package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -0
  676. package/dist/typescript/commonjs/src/runtime.d.ts +2 -0
  677. package/dist/typescript/commonjs/src/runtime.d.ts.map +1 -0
  678. package/dist/typescript/commonjs/src/runtime.native.d.ts +2 -0
  679. package/dist/typescript/commonjs/src/runtime.native.d.ts.map +1 -0
  680. package/dist/typescript/commonjs/src/runtime.types.d.ts +49 -0
  681. package/dist/typescript/commonjs/src/runtime.types.d.ts.map +1 -0
  682. package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +23 -0
  683. package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -0
  684. package/dist/typescript/commonjs/src/utilities/index.d.ts +4 -0
  685. package/dist/typescript/commonjs/src/utilities/index.d.ts.map +1 -0
  686. package/dist/typescript/commonjs/src/utilities/specificity.d.ts +13 -0
  687. package/dist/typescript/commonjs/src/utilities/specificity.d.ts.map +1 -0
  688. package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +4 -0
  689. package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -0
  690. package/dist/typescript/commonjs/src/web/api.d.ts +16 -0
  691. package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -0
  692. package/dist/typescript/commonjs/src/web/assign-style.d.ts +2 -0
  693. package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -0
  694. package/dist/typescript/commonjs/src/web/index.d.ts +4 -0
  695. package/dist/typescript/commonjs/src/web/index.d.ts.map +1 -0
  696. package/dist/typescript/commonjs/src/web/metro.d.ts +2 -0
  697. package/dist/typescript/commonjs/src/web/metro.d.ts.map +1 -0
  698. package/dist/typescript/module/.config/eslint.config.d.mts +3 -0
  699. package/dist/typescript/module/.config/eslint.config.d.mts.map +1 -0
  700. package/dist/typescript/module/eslint.config.d.mts +2 -0
  701. package/dist/typescript/module/eslint.config.d.mts.map +1 -0
  702. package/dist/typescript/module/example/app.config.d.ts +4 -0
  703. package/dist/typescript/module/example/app.config.d.ts.map +1 -0
  704. package/dist/typescript/module/example/index.d.ts +2 -0
  705. package/dist/typescript/module/example/index.d.ts.map +1 -0
  706. package/dist/typescript/module/example/metro.config.d.ts +3 -0
  707. package/dist/typescript/module/example/metro.config.d.ts.map +1 -0
  708. package/dist/typescript/module/example/postcss.config.d.mts +7 -0
  709. package/dist/typescript/module/example/postcss.config.d.mts.map +1 -0
  710. package/dist/typescript/module/example/src/App.d.ts +3 -0
  711. package/dist/typescript/module/example/src/App.d.ts.map +1 -0
  712. package/dist/typescript/module/package.json +1 -0
  713. package/dist/typescript/module/src/babel/allowedModules.d.ts +2 -0
  714. package/dist/typescript/module/src/babel/allowedModules.d.ts.map +1 -0
  715. package/dist/typescript/module/src/babel/helpers.d.ts +13 -0
  716. package/dist/typescript/module/src/babel/helpers.d.ts.map +1 -0
  717. package/dist/typescript/module/src/babel/import-plugin.d.ts +6 -0
  718. package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -0
  719. package/dist/typescript/module/src/babel/index.d.ts +4 -0
  720. package/dist/typescript/module/src/babel/index.d.ts.map +1 -0
  721. package/dist/typescript/module/src/babel/react-native-web.d.ts +8 -0
  722. package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -0
  723. package/dist/typescript/module/src/babel/react-native.d.ts +8 -0
  724. package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -0
  725. package/dist/typescript/module/src/compiler/atRules.d.ts +34 -0
  726. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -0
  727. package/dist/typescript/module/src/compiler/compiler.d.ts +17 -0
  728. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -0
  729. package/dist/typescript/module/src/compiler/compiler.types.d.ts +201 -0
  730. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -0
  731. package/dist/typescript/module/src/compiler/container-query.d.ts +5 -0
  732. package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -0
  733. package/dist/typescript/module/src/compiler/declarations.d.ts +132 -0
  734. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -0
  735. package/dist/typescript/module/src/compiler/functions-web.d.ts +11 -0
  736. package/dist/typescript/module/src/compiler/functions-web.d.ts.map +1 -0
  737. package/dist/typescript/module/src/compiler/functions.d.ts +11 -0
  738. package/dist/typescript/module/src/compiler/functions.d.ts.map +1 -0
  739. package/dist/typescript/module/src/compiler/index.d.ts +7 -0
  740. package/dist/typescript/module/src/compiler/index.d.ts.map +1 -0
  741. package/dist/typescript/module/src/compiler/inheritance.test.d.ts +2 -0
  742. package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +1 -0
  743. package/dist/typescript/module/src/compiler/inline-variables.d.ts +4 -0
  744. package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -0
  745. package/dist/typescript/module/src/compiler/keyframes.d.ts +7 -0
  746. package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -0
  747. package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts +30 -0
  748. package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -0
  749. package/dist/typescript/module/src/compiler/media-query.d.ts +7 -0
  750. package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -0
  751. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
  752. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
  753. package/dist/typescript/module/src/compiler/selector-builder.d.ts +24 -0
  754. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  755. package/dist/typescript/module/src/compiler/selectors.d.ts +24 -0
  756. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -0
  757. package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts +2 -0
  758. package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts.map +1 -0
  759. package/dist/typescript/module/src/compiler/stylesheet.d.ts +69 -0
  760. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -0
  761. package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
  762. package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
  763. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +4 -0
  764. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  765. package/dist/typescript/module/src/components/Button.d.ts +4 -0
  766. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  767. package/dist/typescript/module/src/components/FlatList.d.ts +6 -0
  768. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  769. package/dist/typescript/module/src/components/Image.d.ts +4 -0
  770. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  771. package/dist/typescript/module/src/components/ImageBackground.d.ts +4 -0
  772. package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -0
  773. package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts +4 -0
  774. package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -0
  775. package/dist/typescript/module/src/components/Pressable.d.ts +4 -0
  776. package/dist/typescript/module/src/components/Pressable.d.ts.map +1 -0
  777. package/dist/typescript/module/src/components/ScrollView.d.ts +4 -0
  778. package/dist/typescript/module/src/components/ScrollView.d.ts.map +1 -0
  779. package/dist/typescript/module/src/components/Switch.d.ts +4 -0
  780. package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
  781. package/dist/typescript/module/src/components/Text.d.ts +4 -0
  782. package/dist/typescript/module/src/components/Text.d.ts.map +1 -0
  783. package/dist/typescript/module/src/components/TextInput.d.ts +4 -0
  784. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  785. package/dist/typescript/module/src/components/TouchableHighlight.d.ts +4 -0
  786. package/dist/typescript/module/src/components/TouchableHighlight.d.ts.map +1 -0
  787. package/dist/typescript/module/src/components/TouchableOpacity.d.ts +4 -0
  788. package/dist/typescript/module/src/components/TouchableOpacity.d.ts.map +1 -0
  789. package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts +4 -0
  790. package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts.map +1 -0
  791. package/dist/typescript/module/src/components/View.d.ts +4 -0
  792. package/dist/typescript/module/src/components/View.d.ts.map +1 -0
  793. package/dist/typescript/module/src/components/VirtualizedList.d.ts +6 -0
  794. package/dist/typescript/module/src/components/VirtualizedList.d.ts.map +1 -0
  795. package/dist/typescript/module/src/components/copyComponentProperties.d.ts +5 -0
  796. package/dist/typescript/module/src/components/copyComponentProperties.d.ts.map +1 -0
  797. package/dist/typescript/module/src/components/index.d.cts +2 -0
  798. package/dist/typescript/module/src/components/index.d.cts.map +1 -0
  799. package/dist/typescript/module/src/components/index.d.ts +18 -0
  800. package/dist/typescript/module/src/components/index.d.ts.map +1 -0
  801. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts +2 -0
  802. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts.map +1 -0
  803. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +4 -0
  804. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  805. package/dist/typescript/module/src/index.d.ts +2 -0
  806. package/dist/typescript/module/src/index.d.ts.map +1 -0
  807. package/dist/typescript/module/src/jest/index.d.ts +30 -0
  808. package/dist/typescript/module/src/jest/index.d.ts.map +1 -0
  809. package/dist/typescript/module/src/jest/setup.d.ts +1 -0
  810. package/dist/typescript/module/src/jest/setup.d.ts.map +1 -0
  811. package/dist/typescript/module/src/jest/setupAfterEnv.d.ts +1 -0
  812. package/dist/typescript/module/src/jest/setupAfterEnv.d.ts.map +1 -0
  813. package/dist/typescript/module/src/metro/index.d.ts +11 -0
  814. package/dist/typescript/module/src/metro/index.d.ts.map +1 -0
  815. package/dist/typescript/module/src/metro/injection-code.d.ts +13 -0
  816. package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -0
  817. package/dist/typescript/module/src/metro/metro-transformer.d.ts +6 -0
  818. package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -0
  819. package/dist/typescript/module/src/metro/override.d.ts +2 -0
  820. package/dist/typescript/module/src/metro/override.d.ts.map +1 -0
  821. package/dist/typescript/module/src/metro/picocolors.d.ts +27 -0
  822. package/dist/typescript/module/src/metro/picocolors.d.ts.map +1 -0
  823. package/dist/typescript/module/src/metro/resolver.d.ts +4 -0
  824. package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -0
  825. package/dist/typescript/module/src/metro/stringify.d.ts +7 -0
  826. package/dist/typescript/module/src/metro/stringify.d.ts.map +1 -0
  827. package/dist/typescript/module/src/metro/typescript.d.ts +2 -0
  828. package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -0
  829. package/dist/typescript/module/src/native/api.d.ts +26 -0
  830. package/dist/typescript/module/src/native/api.d.ts.map +1 -0
  831. package/dist/typescript/module/src/native/conditions/attributes.d.ts +4 -0
  832. package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -0
  833. package/dist/typescript/module/src/native/conditions/container-query.d.ts +7 -0
  834. package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -0
  835. package/dist/typescript/module/src/native/conditions/guards.d.ts +5 -0
  836. package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -0
  837. package/dist/typescript/module/src/native/conditions/index.d.ts +6 -0
  838. package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -0
  839. package/dist/typescript/module/src/native/conditions/media-query.d.ts +4 -0
  840. package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -0
  841. package/dist/typescript/module/src/native/index.d.ts +4 -0
  842. package/dist/typescript/module/src/native/index.d.ts.map +1 -0
  843. package/dist/typescript/module/src/native/objects.d.ts +5 -0
  844. package/dist/typescript/module/src/native/objects.d.ts.map +1 -0
  845. package/dist/typescript/module/src/native/react/interaction.d.ts +6 -0
  846. package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -0
  847. package/dist/typescript/module/src/native/react/rules.d.ts +7 -0
  848. package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -0
  849. package/dist/typescript/module/src/native/react/useNativeCss.d.ts +38 -0
  850. package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -0
  851. package/dist/typescript/module/src/native/react/usePassthrough.d.ts +4 -0
  852. package/dist/typescript/module/src/native/react/usePassthrough.d.ts.map +1 -0
  853. package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts +2 -0
  854. package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts.map +1 -0
  855. package/dist/typescript/module/src/native/reactivity.d.ts +52 -0
  856. package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -0
  857. package/dist/typescript/module/src/native/reanimated.d.ts +5 -0
  858. package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -0
  859. package/dist/typescript/module/src/native/styles/calculate-props.d.ts +10 -0
  860. package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -0
  861. package/dist/typescript/module/src/native/styles/constants.d.ts +3 -0
  862. package/dist/typescript/module/src/native/styles/constants.d.ts.map +1 -0
  863. package/dist/typescript/module/src/native/styles/defaults.d.ts +3 -0
  864. package/dist/typescript/module/src/native/styles/defaults.d.ts.map +1 -0
  865. package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +4 -0
  866. package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -0
  867. package/dist/typescript/module/src/native/styles/functions/calc.d.ts +3 -0
  868. package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -0
  869. package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +3 -0
  870. package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -0
  871. package/dist/typescript/module/src/native/styles/functions/filters.d.ts +12 -0
  872. package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -0
  873. package/dist/typescript/module/src/native/styles/functions/index.d.ts +9 -0
  874. package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -0
  875. package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +5 -0
  876. package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -0
  877. package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +8 -0
  878. package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -0
  879. package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -0
  880. package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -0
  881. package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +5 -0
  882. package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -0
  883. package/dist/typescript/module/src/native/styles/index.d.ts +19 -0
  884. package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -0
  885. package/dist/typescript/module/src/native/styles/line-height.d.ts +3 -0
  886. package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -0
  887. package/dist/typescript/module/src/native/styles/resolve.d.ts +18 -0
  888. package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -0
  889. package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +11 -0
  890. package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -0
  891. package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +5 -0
  892. package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -0
  893. package/dist/typescript/module/src/native/styles/shorthands/border.d.ts +2 -0
  894. package/dist/typescript/module/src/native/styles/shorthands/border.d.ts.map +1 -0
  895. package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts +3 -0
  896. package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  897. package/dist/typescript/module/src/native/styles/shorthands/index.d.ts +6 -0
  898. package/dist/typescript/module/src/native/styles/shorthands/index.d.ts.map +1 -0
  899. package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts +2 -0
  900. package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  901. package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts +7 -0
  902. package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts.map +1 -0
  903. package/dist/typescript/module/src/native/styles/units.d.ts +6 -0
  904. package/dist/typescript/module/src/native/styles/units.d.ts.map +1 -0
  905. package/dist/typescript/module/src/native/styles/variables.d.ts +5 -0
  906. package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -0
  907. package/dist/typescript/module/src/native-internal/index.d.ts +4 -0
  908. package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -0
  909. package/dist/typescript/module/src/native-internal/root.d.ts +11 -0
  910. package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -0
  911. package/dist/typescript/module/src/native-internal/style-collection.d.ts +16 -0
  912. package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -0
  913. package/dist/typescript/module/src/native-internal/variables.d.ts +8 -0
  914. package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -0
  915. package/dist/typescript/module/src/runtime.d.ts +2 -0
  916. package/dist/typescript/module/src/runtime.d.ts.map +1 -0
  917. package/dist/typescript/module/src/runtime.native.d.ts +2 -0
  918. package/dist/typescript/module/src/runtime.native.d.ts.map +1 -0
  919. package/dist/typescript/module/src/runtime.types.d.ts +49 -0
  920. package/dist/typescript/module/src/runtime.types.d.ts.map +1 -0
  921. package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +23 -0
  922. package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -0
  923. package/dist/typescript/module/src/utilities/index.d.ts +4 -0
  924. package/dist/typescript/module/src/utilities/index.d.ts.map +1 -0
  925. package/dist/typescript/module/src/utilities/specificity.d.ts +13 -0
  926. package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -0
  927. package/dist/typescript/module/src/utilities/style-descriptor.d.ts +4 -0
  928. package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -0
  929. package/dist/typescript/module/src/web/api.d.ts +16 -0
  930. package/dist/typescript/module/src/web/api.d.ts.map +1 -0
  931. package/dist/typescript/module/src/web/assign-style.d.ts +2 -0
  932. package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -0
  933. package/dist/typescript/module/src/web/index.d.ts +4 -0
  934. package/dist/typescript/module/src/web/index.d.ts.map +1 -0
  935. package/dist/typescript/module/src/web/metro.d.ts +2 -0
  936. package/dist/typescript/module/src/web/metro.d.ts.map +1 -0
  937. package/package.json +304 -0
  938. package/src/babel/allowedModules.ts +24 -0
  939. package/src/babel/helpers.ts +40 -0
  940. package/src/babel/import-plugin.ts +176 -0
  941. package/src/babel/index.ts +9 -0
  942. package/src/babel/react-native-web.ts +226 -0
  943. package/src/babel/react-native.ts +226 -0
  944. package/src/compiler/atRules.ts +149 -0
  945. package/src/compiler/compiler.ts +379 -0
  946. package/src/compiler/compiler.types.ts +275 -0
  947. package/src/compiler/container-query.ts +97 -0
  948. package/src/compiler/declarations.ts +3444 -0
  949. package/src/compiler/functions-web.ts +44 -0
  950. package/src/compiler/functions.ts +64 -0
  951. package/src/compiler/index.ts +7 -0
  952. package/src/compiler/inheritance.test.ts +121 -0
  953. package/src/compiler/inline-variables.ts +209 -0
  954. package/src/compiler/keyframes.ts +86 -0
  955. package/src/compiler/lightningcss-loader.ts +59 -0
  956. package/src/compiler/media-query.ts +251 -0
  957. package/src/compiler/pseudo-elements.ts +54 -0
  958. package/src/compiler/selector-builder.ts +592 -0
  959. package/src/compiler/selectors.ts +505 -0
  960. package/src/compiler/split-by-delimiter.ts +19 -0
  961. package/src/compiler/stylesheet.ts +680 -0
  962. package/src/compiler/supports.ts +28 -0
  963. package/src/components/ActivityIndicator.tsx +30 -0
  964. package/src/components/Button.tsx +27 -0
  965. package/src/components/FlatList.tsx +31 -0
  966. package/src/components/Image.tsx +22 -0
  967. package/src/components/ImageBackground.tsx +30 -0
  968. package/src/components/KeyboardAvoidingView.tsx +27 -0
  969. package/src/components/Pressable.tsx +22 -0
  970. package/src/components/ScrollView.tsx +23 -0
  971. package/src/components/Switch.tsx +22 -0
  972. package/src/components/Text.tsx +22 -0
  973. package/src/components/TextInput.tsx +27 -0
  974. package/src/components/TouchableHighlight.tsx +25 -0
  975. package/src/components/TouchableOpacity.tsx +25 -0
  976. package/src/components/TouchableWithoutFeedback.tsx +25 -0
  977. package/src/components/View.tsx +22 -0
  978. package/src/components/VirtualizedList.tsx +37 -0
  979. package/src/components/copyComponentProperties.ts +21 -0
  980. package/src/components/index.cts +263 -0
  981. package/src/components/index.ts +17 -0
  982. package/src/components/react-native-safe-area-context.native.tsx +44 -0
  983. package/src/components/react-native-safe-area-context.tsx +1 -0
  984. package/src/index.ts +1 -0
  985. package/src/jest/expect.d.ts +1 -0
  986. package/src/jest/index.ts +75 -0
  987. package/src/jest/setup.ts +1 -0
  988. package/src/jest/setupAfterEnv.ts +13 -0
  989. package/src/metro/index.ts +83 -0
  990. package/src/metro/injection-code.ts +34 -0
  991. package/src/metro/metro-transformer.ts +62 -0
  992. package/src/metro/override.ts +1 -0
  993. package/src/metro/picocolors.ts +77 -0
  994. package/src/metro/resolver.ts +98 -0
  995. package/src/metro/stringify.ts +59 -0
  996. package/src/metro/typescript.ts +73 -0
  997. package/src/native/api.tsx +124 -0
  998. package/src/native/conditions/attributes.ts +54 -0
  999. package/src/native/conditions/container-query.ts +162 -0
  1000. package/src/native/conditions/guards.ts +44 -0
  1001. package/src/native/conditions/index.ts +55 -0
  1002. package/src/native/conditions/media-query.ts +99 -0
  1003. package/src/native/index.ts +3 -0
  1004. package/src/native/objects.ts +109 -0
  1005. package/src/native/react/interaction.ts +90 -0
  1006. package/src/native/react/rules.ts +336 -0
  1007. package/src/native/react/useNativeCss.ts +211 -0
  1008. package/src/native/react/usePassthrough.ts +51 -0
  1009. package/src/native/react-native-css-metro-override.ts +36 -0
  1010. package/src/native/reactivity.ts +248 -0
  1011. package/src/native/reanimated.ts +22 -0
  1012. package/src/native/styles/calculate-props.ts +217 -0
  1013. package/src/native/styles/constants.ts +2 -0
  1014. package/src/native/styles/defaults.ts +79 -0
  1015. package/src/native/styles/functions/animation-timing.ts +44 -0
  1016. package/src/native/styles/functions/calc.ts +121 -0
  1017. package/src/native/styles/functions/color-mix.ts +68 -0
  1018. package/src/native/styles/functions/filters.ts +99 -0
  1019. package/src/native/styles/functions/index.ts +8 -0
  1020. package/src/native/styles/functions/numeric-functions.ts +38 -0
  1021. package/src/native/styles/functions/platform-functions.ts +50 -0
  1022. package/src/native/styles/functions/string-functions.ts +22 -0
  1023. package/src/native/styles/functions/transform-functions.ts +85 -0
  1024. package/src/native/styles/index.ts +474 -0
  1025. package/src/native/styles/line-height.ts +25 -0
  1026. package/src/native/styles/resolve.ts +164 -0
  1027. package/src/native/styles/shorthands/_handler.ts +122 -0
  1028. package/src/native/styles/shorthands/animation.ts +131 -0
  1029. package/src/native/styles/shorthands/border.ts +10 -0
  1030. package/src/native/styles/shorthands/box-shadow.ts +71 -0
  1031. package/src/native/styles/shorthands/index.ts +5 -0
  1032. package/src/native/styles/shorthands/text-shadow.ts +17 -0
  1033. package/src/native/styles/shorthands/transform.ts +23 -0
  1034. package/src/native/styles/units.ts +62 -0
  1035. package/src/native/styles/variables.ts +88 -0
  1036. package/src/native-internal/README.md +11 -0
  1037. package/src/native-internal/index.ts +3 -0
  1038. package/src/native-internal/root.ts +44 -0
  1039. package/src/native-internal/style-collection.ts +148 -0
  1040. package/src/native-internal/variables.tsx +36 -0
  1041. package/src/runtime.native.ts +1 -0
  1042. package/src/runtime.ts +1 -0
  1043. package/src/runtime.types.ts +150 -0
  1044. package/src/utilities/dot-notation.types.ts +125 -0
  1045. package/src/utilities/index.ts +3 -0
  1046. package/src/utilities/specificity.ts +45 -0
  1047. package/src/utilities/style-descriptor.ts +24 -0
  1048. package/src/web/api.tsx +120 -0
  1049. package/src/web/assign-style.ts +26 -0
  1050. package/src/web/index.ts +5 -0
  1051. package/src/web/metro.ts +2 -0
  1052. package/types.d.ts +73 -0
@@ -0,0 +1,3444 @@
1
+ // cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto,squircle,oldstyle,nums
2
+
3
+ import Color from "colorjs.io";
4
+ import type {
5
+ Angle,
6
+ BorderSideWidth,
7
+ BorderStyle,
8
+ ColorOrAuto,
9
+ CssColor,
10
+ CustomProperty,
11
+ Declaration,
12
+ DimensionPercentageFor_LengthValue,
13
+ EnvironmentVariable,
14
+ FontSize,
15
+ FontStyle,
16
+ FontVariantCaps,
17
+ FontWeight,
18
+ GapValue,
19
+ Gradient,
20
+ GradientItemFor_DimensionPercentageFor_LengthValue,
21
+ Length,
22
+ LengthPercentageOrAuto,
23
+ LengthValue,
24
+ LineDirection,
25
+ LineHeight,
26
+ LineStyle,
27
+ MaxSize,
28
+ NumberOrPercentage,
29
+ Scale,
30
+ Size,
31
+ Size2DFor_DimensionPercentageFor_LengthValue,
32
+ Time,
33
+ Token,
34
+ TokenOrValue,
35
+ Translate,
36
+ UnresolvedColor,
37
+ } from "lightningcss";
38
+
39
+ import { isStyleFunction } from "../utilities";
40
+ import type {
41
+ StyleDescriptor,
42
+ StyleFunction,
43
+ StyleRule,
44
+ } from "./compiler.types";
45
+ import { parseEasingFunction, parseIterationCount } from "./keyframes";
46
+ import { toRNProperty } from "./selectors";
47
+ import type { StylesheetBuilder } from "./stylesheet";
48
+
49
+ const CommaSeparator = Symbol("CommaSeparator");
50
+
51
+ type DeclarationType<P extends Declaration["property"]> = Extract<
52
+ Declaration,
53
+ { property: P }
54
+ >;
55
+
56
+ type Parser<T extends Declaration["property"] = Declaration["property"]> = (
57
+ declaration: Extract<Declaration, { property: T }>,
58
+ builder: StylesheetBuilder,
59
+ propertyName: string,
60
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
61
+ ) => StyleDescriptor | void;
62
+
63
+ const propertyRename: Record<string, string> = {
64
+ "background-image": "experimental_backgroundImage",
65
+ };
66
+
67
+ const unparsedRuntimeParsing = new Set([
68
+ "animation",
69
+ "border",
70
+ "box-shadow",
71
+ "line-height",
72
+ "rotate",
73
+ "scale",
74
+ "text-shadow",
75
+ "transform",
76
+ "translate",
77
+ ]);
78
+
79
+ const parsers: {
80
+ [K in Declaration["property"]]?: Parser<K>;
81
+ } = {
82
+ "align-content": parseAlignContent,
83
+ "align-items": parseAlignItems,
84
+ "align-self": parseAlignSelf,
85
+ "animation": addAnimationValue,
86
+ "animation-delay": addAnimationValue,
87
+ "animation-direction": addAnimationValue,
88
+ "animation-duration": addAnimationValue,
89
+ "animation-fill-mode": addAnimationValue,
90
+ "animation-iteration-count": addAnimationValue,
91
+ "animation-name": addAnimationValue,
92
+ "animation-play-state": addAnimationValue,
93
+ "animation-timing-function": addAnimationValue,
94
+ "aspect-ratio": parseAspectRatio,
95
+ "backface-visibility": parseBackfaceVisibility,
96
+ "background-color": parseColorDeclaration,
97
+ "background-image": parseBackgroundImage,
98
+ "block-size": parseSizeDeclaration,
99
+ "border": parseBorder,
100
+ "border-block": parseBorderBlock,
101
+ "border-block-color": parseBorderColor,
102
+ "border-block-end": parseBorderBlockEnd,
103
+ "border-block-end-color": parseColorDeclaration,
104
+ "border-block-end-width": parseBorderSideWidthDeclaration,
105
+ "border-block-start": parseBorderBlockStart,
106
+ "border-block-start-color": parseColorDeclaration,
107
+ "border-block-start-style": parseBorderStyleDeclaration,
108
+ "border-block-start-width": parseBorderSideWidthDeclaration,
109
+ "border-block-style": parseBorderBlockStyle,
110
+ "border-block-width": parseBorderBlockWidth,
111
+ "border-bottom": parseBorderSide,
112
+ "border-bottom-color": parseColorDeclaration,
113
+ "border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
114
+ "border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
115
+ "border-bottom-style": parseBorderStyleDeclaration,
116
+ "border-bottom-width": parseBorderSideWidthDeclaration,
117
+ "border-color": parseBorderColor,
118
+ "border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
119
+ "border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
120
+ "border-inline": parseBorderInline,
121
+ "border-inline-color": parseBorderColor,
122
+ "border-inline-end": parseBorderInlineEnd,
123
+ "border-inline-end-color": parseColorDeclaration,
124
+ "border-inline-end-style": parseBorderInlineStyle,
125
+ "border-inline-end-width": parseBorderSideWidthDeclaration,
126
+ "border-inline-start": parseBorderInlineStart,
127
+ "border-inline-start-color": parseColorDeclaration,
128
+ "border-inline-start-style": parseBorderInlineStyle,
129
+ "border-inline-start-width": parseBorderSideWidthDeclaration,
130
+ "border-inline-style": parseBorderInlineStyle,
131
+ "border-inline-width": parseBorderInlineWidth,
132
+ "border-left": parseBorderSide,
133
+ "border-left-color": parseColorDeclaration,
134
+ "border-left-style": parseBorderStyleDeclaration,
135
+ "border-left-width": parseBorderSideWidthDeclaration,
136
+ "border-radius": parseBorderRadius,
137
+ "border-right": parseBorderSide,
138
+ "border-right-color": parseColorDeclaration,
139
+ "border-right-style": parseBorderStyleDeclaration,
140
+ "border-right-width": parseBorderSideWidthDeclaration,
141
+ "border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
142
+ "border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
143
+ "border-style": parseBorderStyleDeclaration,
144
+ "border-top": parseBorderSide,
145
+ "border-top-color": parseColorDeclaration,
146
+ "border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
147
+ "border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
148
+ "border-top-style": parseBorderStyleDeclaration,
149
+ "border-top-width": parseBorderSideWidthDeclaration,
150
+ "border-width": parseBorderWidth,
151
+ "bottom": parseSizeWithAutoDeclaration,
152
+ "box-shadow": parseBoxShadow,
153
+ "box-sizing": parseBoxSizing,
154
+ "caret-color": parseColorOrAutoDeclaration,
155
+ "color": parseFontColorDeclaration,
156
+ "column-gap": parseGap,
157
+ "container": parseContainer,
158
+ "container-name": parseContainerName,
159
+ "container-type": parseContainerType,
160
+ "display": parseDisplay,
161
+ "direction": parseDirection,
162
+ "fill": parseSVGPaint,
163
+ "filter": parseFilter,
164
+ "flex": parseFlex,
165
+ "flex-basis": parseLengthPercentageDeclaration,
166
+ "flex-direction": ({ value }) => value,
167
+ "flex-flow": parseFlexFlow,
168
+ "flex-grow": ({ value }) => value,
169
+ "flex-shrink": ({ value }) => value,
170
+ "flex-wrap": ({ value }) => value,
171
+ "font": parseFont,
172
+ "font-family": parseFontFamily,
173
+ "font-size": parseFontSizeDeclaration,
174
+ "font-style": parseFontStyleDeclaration,
175
+ "font-variant-caps": parseFontVariantCapsDeclaration,
176
+ "font-weight": parseFontWeightDeclaration,
177
+ "gap": parseGap,
178
+ "height": parseSizeWithAutoDeclaration,
179
+ "inline-size": parseSizeWithAutoDeclaration,
180
+ "inset": parseInset,
181
+ "inset-block": parseInsetBlock,
182
+ "inset-block-end": parseLengthPercentageDeclaration,
183
+ "inset-block-start": parseLengthPercentageDeclaration,
184
+ "inset-inline": parseInsetInline,
185
+ "inset-inline-end": parseLengthPercentageDeclaration,
186
+ "inset-inline-start": parseLengthPercentageDeclaration,
187
+ "justify-content": parseJustifyContent,
188
+ "left": parseSizeWithAutoDeclaration,
189
+ "letter-spacing": parseLetterSpacing,
190
+ "line-height": parseLineHeightDeclaration,
191
+ "margin": parseMargin,
192
+ "margin-block": parseMarginBlock,
193
+ "margin-block-end": parseLengthPercentageOrAutoDeclaration,
194
+ "margin-block-start": parseLengthPercentageOrAutoDeclaration,
195
+ "margin-bottom": parseSizeWithAutoDeclaration,
196
+ "margin-inline": parseMarginInline,
197
+ "margin-inline-end": parseLengthPercentageOrAutoDeclaration,
198
+ "margin-inline-start": parseLengthPercentageOrAutoDeclaration,
199
+ "margin-left": parseSizeWithAutoDeclaration,
200
+ "margin-right": parseSizeWithAutoDeclaration,
201
+ "margin-top": parseSizeWithAutoDeclaration,
202
+ "max-block-size": parseSizeDeclaration,
203
+ "max-height": parseSizeDeclaration,
204
+ "max-inline-size": parseSizeDeclaration,
205
+ "max-width": parseSizeDeclaration,
206
+ "min-block-size": parseSizeDeclaration,
207
+ "min-height": parseSizeDeclaration,
208
+ "min-inline-size": parseSizeDeclaration,
209
+ "min-width": parseSizeDeclaration,
210
+ "opacity": ({ value }) => round(value),
211
+ "outline-color": parseColorDeclaration,
212
+ "outline-style": parseOutlineStyle,
213
+ "outline-width": parseBorderSideWidthDeclaration,
214
+ "overflow": parseOverflow,
215
+ "padding": parsePadding,
216
+ "padding-block": parsePaddingBlock,
217
+ "padding-block-end": parseLengthPercentageDeclaration,
218
+ "padding-block-start": parseLengthPercentageDeclaration,
219
+ "padding-bottom": parseSizeDeclaration,
220
+ "padding-inline": parsePaddingInline,
221
+ "padding-inline-end": parseLengthPercentageDeclaration,
222
+ "padding-inline-start": parseLengthPercentageDeclaration,
223
+ "padding-left": parseSizeDeclaration,
224
+ "padding-right": parseSizeDeclaration,
225
+ "padding-top": parseSizeDeclaration,
226
+ "position": parsePosition,
227
+ "right": parseSizeWithAutoDeclaration,
228
+ "rotate": parseRotate,
229
+ "row-gap": parseGap,
230
+ "scale": parseScale,
231
+ "stroke": parseSVGPaint,
232
+ "stroke-width": parseLengthDeclaration,
233
+ "text-align": parseTextAlign,
234
+ "text-decoration": parseTextDecoration,
235
+ "text-decoration-color": parseColorDeclaration,
236
+ "text-decoration-line": parseTextDecorationLineDeclaration,
237
+ "text-decoration-style": parseTextDecorationStyle,
238
+ "text-shadow": parseTextShadow,
239
+ "text-transform": ({ value }) => value.case,
240
+ "top": parseSizeWithAutoDeclaration,
241
+ "transform": parseTransform,
242
+ "transition": addTransitionValue,
243
+ "transition-delay": addTransitionValue,
244
+ "transition-duration": addTransitionValue,
245
+ "transition-property": addTransitionValue,
246
+ "transition-timing-function": addTransitionValue,
247
+ "translate": parseTranslate,
248
+ "user-select": parseUserSelect,
249
+ "vertical-align": parseVerticalAlign,
250
+ "visibility": parseVisibility,
251
+ "width": parseSizeWithAutoDeclaration,
252
+ "z-index": parseZIndex,
253
+ };
254
+
255
+ // This is missing LightningCSS types
256
+ (parsers as Record<string, Parser>)["pointer-events"] =
257
+ parsePointerEvents as Parser;
258
+
259
+ const validProperties = new Set(Object.keys(parsers));
260
+
261
+ export function parseDeclaration(
262
+ declaration: Declaration,
263
+ builder: StylesheetBuilder,
264
+ ) {
265
+ if ("vendorPrefix" in declaration && declaration.vendorPrefix.length) {
266
+ return;
267
+ }
268
+
269
+ if (
270
+ "value" in declaration &&
271
+ typeof declaration.value === "object" &&
272
+ "vendorPrefix" in declaration.value &&
273
+ Array.isArray(declaration.value.vendorPrefix) &&
274
+ declaration.value.vendorPrefix.length
275
+ ) {
276
+ return;
277
+ }
278
+
279
+ if (declaration.property === "unparsed") {
280
+ parseUnparsedDeclaration(declaration, builder);
281
+ } else if (declaration.property === "custom") {
282
+ parseCustomDeclaration(declaration, builder);
283
+ } else {
284
+ parseWithParser(declaration, builder);
285
+ }
286
+ }
287
+
288
+ function parseWithParser(declaration: Declaration, builder: StylesheetBuilder) {
289
+ if (declaration.property in parsers) {
290
+ const parser = parsers[declaration.property] as Parser;
291
+
292
+ builder.descriptorProperty = declaration.property;
293
+
294
+ builder.setWarningProperty(declaration.property);
295
+ const value = parser(declaration, builder, declaration.property);
296
+
297
+ if (value !== undefined) {
298
+ builder.addDescriptor(
299
+ propertyRename[declaration.property] ?? declaration.property,
300
+ value,
301
+ );
302
+ }
303
+ } else {
304
+ builder.addWarning("property", declaration.property);
305
+ }
306
+ }
307
+
308
+ function parseInsetBlock(
309
+ { value }: DeclarationType<"inset-block">,
310
+ builder: StylesheetBuilder,
311
+ ) {
312
+ builder.addShorthand("inset-block", {
313
+ "inset-block-start": parseLengthPercentageOrAuto(value.blockStart, builder),
314
+ "inset-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder),
315
+ });
316
+ }
317
+
318
+ function parseInsetInline(
319
+ { value }: DeclarationType<"inset-inline">,
320
+ builder: StylesheetBuilder,
321
+ ) {
322
+ builder.addShorthand("inset-inline", {
323
+ "inset-block-start": parseLengthPercentageOrAuto(
324
+ value.inlineStart,
325
+ builder,
326
+ ),
327
+ "inset-block-end": parseLengthPercentageOrAuto(value.inlineEnd, builder),
328
+ });
329
+ }
330
+
331
+ function parseInset(
332
+ { value }: DeclarationType<"inset">,
333
+ builder: StylesheetBuilder,
334
+ ) {
335
+ builder.addShorthand("inset", {
336
+ top: parseLengthPercentageOrAuto(value.top, builder),
337
+ bottom: parseLengthPercentageOrAuto(value.bottom, builder),
338
+ left: parseLengthPercentageOrAuto(value.left, builder),
339
+ right: parseLengthPercentageOrAuto(value.right, builder),
340
+ });
341
+ }
342
+
343
+ function parseBorderRadius(
344
+ { value }: DeclarationType<"border-radius">,
345
+ builder: StylesheetBuilder,
346
+ ) {
347
+ builder.addShorthand("border-radius", {
348
+ "border-bottom-left-radius": parseSize2DDimensionPercentage(
349
+ value.bottomLeft,
350
+ builder,
351
+ ),
352
+ "border-bottom-right-radius": parseSize2DDimensionPercentage(
353
+ value.bottomRight,
354
+ builder,
355
+ ),
356
+ "border-top-left-radius": parseSize2DDimensionPercentage(
357
+ value.topLeft,
358
+ builder,
359
+ ),
360
+ "border-top-right-radius": parseSize2DDimensionPercentage(
361
+ value.topRight,
362
+ builder,
363
+ ),
364
+ });
365
+ }
366
+
367
+ function parseBorderColor(
368
+ declaration: DeclarationType<
369
+ "border-color" | "border-block-color" | "border-inline-color"
370
+ >,
371
+ builder: StylesheetBuilder,
372
+ ) {
373
+ if (declaration.property === "border-color") {
374
+ builder.addShorthand("border-color", {
375
+ "border-top-color": parseColor(declaration.value.top, builder),
376
+ "border-bottom-color": parseColor(declaration.value.bottom, builder),
377
+ "border-left-color": parseColor(declaration.value.left, builder),
378
+ "border-right-color": parseColor(declaration.value.right, builder),
379
+ });
380
+ } else {
381
+ const start = parseColor(declaration.value.start, builder);
382
+ const end = parseColor(declaration.value.end, builder);
383
+
384
+ if (start === end) {
385
+ builder.addDescriptor(declaration.property, start);
386
+ } else if (declaration.property === "border-block-color") {
387
+ builder.addDescriptor("border-top-color", start);
388
+ builder.addDescriptor("border-bottom-color", end);
389
+ } else {
390
+ builder.addDescriptor("border-left-color", start);
391
+ builder.addDescriptor("border-right-color", end);
392
+ }
393
+ }
394
+ }
395
+
396
+ function parseBorderWidth(
397
+ { value }: DeclarationType<"border-width">,
398
+ builder: StylesheetBuilder,
399
+ ) {
400
+ builder.addShorthand("border-width", {
401
+ "border-top-width": parseBorderSideWidth(value.top, builder),
402
+ "border-bottom-width": parseBorderSideWidth(value.bottom, builder),
403
+ "border-left-width": parseBorderSideWidth(value.left, builder),
404
+ "border-right-width": parseBorderSideWidth(value.right, builder),
405
+ });
406
+ }
407
+
408
+ function parseBorder(
409
+ { value }: DeclarationType<"border">,
410
+ builder: StylesheetBuilder,
411
+ ) {
412
+ builder.addShorthand("border", {
413
+ "border-width": parseBorderSideWidth(value.width, builder),
414
+ "border-style": parseBorderStyle(value.style, builder),
415
+ "border-color": parseColor(value.color, builder),
416
+ });
417
+ }
418
+
419
+ function parseBorderSide(
420
+ {
421
+ value,
422
+ property,
423
+ }: DeclarationType<
424
+ "border-top" | "border-bottom" | "border-left" | "border-right"
425
+ >,
426
+ builder: StylesheetBuilder,
427
+ ) {
428
+ builder.addDescriptor(property + "-color", parseColor(value.color, builder));
429
+ builder.addDescriptor(
430
+ property + "-width",
431
+ parseBorderSideWidth(value.width, builder),
432
+ );
433
+ }
434
+
435
+ function parseBorderBlock(
436
+ { value }: DeclarationType<"border-block">,
437
+ builder: StylesheetBuilder,
438
+ ) {
439
+ builder.addDescriptor("border-block-color", parseColor(value.color, builder));
440
+ builder.addDescriptor(
441
+ "border-block-width",
442
+ parseBorderSideWidth(value.width, builder),
443
+ );
444
+ builder.addDescriptor(
445
+ "border-block-style",
446
+ parseBorderStyle(value.style, builder),
447
+ );
448
+ }
449
+
450
+ function parseBorderBlockStart(
451
+ { value }: DeclarationType<"border-block-start">,
452
+ builder: StylesheetBuilder,
453
+ ) {
454
+ builder.addDescriptor(
455
+ "border-block-start-color",
456
+ parseColor(value.color, builder),
457
+ );
458
+ builder.addDescriptor(
459
+ "border-block-start-width",
460
+ parseBorderSideWidth(value.width, builder),
461
+ );
462
+ }
463
+
464
+ function parseBorderBlockEnd(
465
+ { value }: DeclarationType<"border-block-end">,
466
+ builder: StylesheetBuilder,
467
+ ) {
468
+ builder.addDescriptor(
469
+ "border-block-end-color",
470
+ parseColor(value.color, builder),
471
+ );
472
+ builder.addDescriptor(
473
+ "border-block-end-width",
474
+ parseBorderSideWidth(value.width, builder),
475
+ );
476
+ }
477
+
478
+ function parseBorderInline(
479
+ { value }: DeclarationType<"border-inline">,
480
+ builder: StylesheetBuilder,
481
+ ) {
482
+ builder.addDescriptor(
483
+ "border-inline-color",
484
+ parseColor(value.color, builder),
485
+ );
486
+ builder.addDescriptor(
487
+ "border-inline-width",
488
+ parseBorderSideWidth(value.width, builder),
489
+ );
490
+ builder.addDescriptor(
491
+ "border-inline-style",
492
+ parseBorderStyle(value.style, builder),
493
+ );
494
+ }
495
+
496
+ function parseBorderInlineStart(
497
+ { value }: DeclarationType<"border-inline-start">,
498
+ builder: StylesheetBuilder,
499
+ ) {
500
+ builder.addDescriptor(
501
+ "border-inline-start-color",
502
+ parseColor(value.color, builder),
503
+ );
504
+ builder.addDescriptor(
505
+ "border-inline-start-width",
506
+ parseBorderSideWidth(value.width, builder),
507
+ );
508
+ builder.addDescriptor(
509
+ "border-inline-start-style",
510
+ parseBorderStyle(value.style, builder),
511
+ );
512
+ }
513
+
514
+ function parseBorderInlineEnd(
515
+ { value }: DeclarationType<"border-inline-end">,
516
+ builder: StylesheetBuilder,
517
+ ) {
518
+ builder.addDescriptor(
519
+ "border-inline-end-color",
520
+ parseColor(value.color, builder),
521
+ );
522
+ builder.addDescriptor(
523
+ "border-inline-end-width",
524
+ parseBorderSideWidth(value.width, builder),
525
+ );
526
+ builder.addDescriptor(
527
+ "border-inline-end-style",
528
+ parseBorderStyle(value.style, builder),
529
+ );
530
+ }
531
+
532
+ export function parseBorderInlineWidth(
533
+ declaration: DeclarationType<"border-inline-width">,
534
+ builder: StylesheetBuilder,
535
+ ) {
536
+ builder.addDescriptor(
537
+ "border-inline-width",
538
+ parseBorderSideWidth(declaration.value.start, builder),
539
+ );
540
+ }
541
+
542
+ export function parseBorderInlineStyle(
543
+ declaration: DeclarationType<
544
+ | "border-inline-style"
545
+ | "border-inline-start-style"
546
+ | "border-inline-end-style"
547
+ >,
548
+ builder: StylesheetBuilder,
549
+ ) {
550
+ if (typeof declaration.value === "string") {
551
+ builder.addDescriptor(
552
+ declaration.property,
553
+ parseBorderStyle(declaration.value, builder),
554
+ );
555
+ } else if (declaration.value.start === declaration.value.end) {
556
+ builder.addDescriptor(
557
+ declaration.property,
558
+ parseBorderStyle(declaration.value.start, builder),
559
+ );
560
+ } else {
561
+ builder.addDescriptor(
562
+ "border-inline-start-style",
563
+ parseBorderStyle(declaration.value.start, builder),
564
+ );
565
+ builder.addDescriptor(
566
+ "border-inline-end-style",
567
+ parseBorderStyle(declaration.value.end, builder),
568
+ );
569
+ }
570
+ }
571
+
572
+ function parseFlexFlow(
573
+ { value }: DeclarationType<"flex-flow">,
574
+ builder: StylesheetBuilder,
575
+ ) {
576
+ builder.addDescriptor("flexWrap", value.wrap);
577
+ builder.addDescriptor("flexDirection", value.direction);
578
+ }
579
+
580
+ function parseFlex(
581
+ { value }: DeclarationType<"flex">,
582
+ builder: StylesheetBuilder,
583
+ ) {
584
+ builder.addDescriptor("flex-grow", value.grow);
585
+ builder.addDescriptor("flex-shrink", value.shrink);
586
+ builder.addDescriptor(
587
+ "flex-basis",
588
+ parseLengthPercentageOrAuto(value.basis, builder),
589
+ );
590
+ }
591
+
592
+ function parseMargin(
593
+ { value }: DeclarationType<"margin">,
594
+ builder: StylesheetBuilder,
595
+ ) {
596
+ builder.addShorthand("margin", {
597
+ "margin-top": parseSize(value.top, builder, { allowAuto: true }),
598
+ "margin-bottom": parseSize(value.bottom, builder, { allowAuto: true }),
599
+ "margin-left": parseSize(value.left, builder, { allowAuto: true }),
600
+ "margin-right": parseSize(value.right, builder, { allowAuto: true }),
601
+ });
602
+ }
603
+
604
+ function parseMarginBlock(
605
+ { value }: DeclarationType<"margin-block">,
606
+ builder: StylesheetBuilder,
607
+ ) {
608
+ builder.addShorthand("margin-block", {
609
+ "margin-block-start": parseLengthPercentageOrAuto(
610
+ value.blockStart,
611
+ builder,
612
+ { allowAuto: true },
613
+ ),
614
+ "margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder, {
615
+ allowAuto: true,
616
+ }),
617
+ });
618
+ }
619
+
620
+ function parseMarginInline(
621
+ { value }: DeclarationType<"margin-inline">,
622
+ builder: StylesheetBuilder,
623
+ ) {
624
+ builder.addShorthand("margin-inline", {
625
+ "margin-inline-start": parseLengthPercentageOrAuto(
626
+ value.inlineStart,
627
+ builder,
628
+ { allowAuto: true },
629
+ ),
630
+ "margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder, {
631
+ allowAuto: true,
632
+ }),
633
+ });
634
+ }
635
+
636
+ function parsePadding(
637
+ { value }: DeclarationType<"padding">,
638
+ builder: StylesheetBuilder,
639
+ ) {
640
+ builder.addShorthand("padding", {
641
+ "padding-top": parseSize(value.top, builder),
642
+ "padding-bottom": parseSize(value.bottom, builder),
643
+ "padding-left": parseSize(value.left, builder),
644
+ "padding-right": parseSize(value.right, builder),
645
+ });
646
+ }
647
+
648
+ function parsePaddingBlock(
649
+ { value }: DeclarationType<"padding-block">,
650
+ builder: StylesheetBuilder,
651
+ ) {
652
+ builder.addShorthand("padding-block", {
653
+ "padding-block-start": parseLengthPercentageOrAuto(
654
+ value.blockStart,
655
+ builder,
656
+ ),
657
+ "padding-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder),
658
+ });
659
+ }
660
+
661
+ function parsePaddingInline(
662
+ { value }: DeclarationType<"padding-inline">,
663
+ builder: StylesheetBuilder,
664
+ ) {
665
+ builder.addShorthand("padding-inline", {
666
+ "padding-inline-start": parseLengthPercentageOrAuto(
667
+ value.inlineStart,
668
+ builder,
669
+ ),
670
+ "padding-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder),
671
+ });
672
+ }
673
+
674
+ function parseFont(
675
+ { value }: DeclarationType<"font">,
676
+ builder: StylesheetBuilder,
677
+ ) {
678
+ builder.addDescriptor("font-family", value.family[0]);
679
+ builder.addDescriptor(
680
+ "line-height",
681
+ parseLineHeight(value.lineHeight, builder),
682
+ );
683
+ builder.addDescriptor("font-size", parseFontSize(value.size, builder));
684
+ builder.addDescriptor("font-style", parseFontStyle(value.style, builder));
685
+ builder.addDescriptor(
686
+ "font-variant-caps",
687
+ parseFontVariantCaps(value.variantCaps, builder),
688
+ );
689
+ builder.addDescriptor("font-weight", parseFontWeight(value.weight, builder));
690
+ }
691
+
692
+ function parseTransform(
693
+ { value }: DeclarationType<"transform">,
694
+ builder: StylesheetBuilder,
695
+ ) {
696
+ builder.addDescriptor("transform", [
697
+ {},
698
+ "transform",
699
+ value.flatMap((t): StyleDescriptor[] => {
700
+ switch (t.type) {
701
+ case "perspective":
702
+ return [[{}, "perspective", parseLength(t.value, builder)]];
703
+ case "translate":
704
+ return [
705
+ [
706
+ {},
707
+ "translateX",
708
+ parseLengthOrCoercePercentageToRuntime(t.value[0], builder),
709
+ ],
710
+ [
711
+ [
712
+ {},
713
+ "translateY",
714
+ parseLengthOrCoercePercentageToRuntime(t.value[1], builder),
715
+ ],
716
+ ],
717
+ ];
718
+ case "translateX":
719
+ return [
720
+ [
721
+ {},
722
+ "translateX",
723
+ parseLengthOrCoercePercentageToRuntime(t.value, builder),
724
+ ],
725
+ ];
726
+ case "translateY":
727
+ return [
728
+ [
729
+ {},
730
+ "translateY",
731
+ parseLengthOrCoercePercentageToRuntime(t.value, builder),
732
+ ],
733
+ ];
734
+ case "rotate":
735
+ return [[{}, "rotate", parseAngle(t.value, builder)]];
736
+ case "rotateX":
737
+ return [[{}, "rotateX", parseAngle(t.value, builder)]];
738
+ case "rotateY":
739
+ return [[{}, "rotateY", parseAngle(t.value, builder)]];
740
+ case "rotateZ":
741
+ return [[{}, "rotateZ", parseAngle(t.value, builder)]];
742
+ case "scale":
743
+ return [
744
+ [{}, "scaleX", parseLength(t.value[0], builder)],
745
+ [{}, "scaleY", parseLength(t.value[1], builder)],
746
+ ];
747
+ case "scaleX":
748
+ return [[{}, "scaleX", parseLength(t.value, builder)]];
749
+ case "scaleY":
750
+ return [[{}, "scaleY", parseLength(t.value, builder)]];
751
+ case "skew":
752
+ return [
753
+ [{}, "skewX", parseAngle(t.value[0], builder)],
754
+ [{}, "skewY", parseAngle(t.value[1], builder)],
755
+ ];
756
+ case "skewX":
757
+ return [[{}, "skewX", parseAngle(t.value, builder)]];
758
+ case "skewY":
759
+ return [[{}, "skewY", parseAngle(t.value, builder)]];
760
+ case "translateZ":
761
+ case "translate3d":
762
+ case "scaleZ":
763
+ case "scale3d":
764
+ case "rotate3d":
765
+ case "matrix":
766
+ case "matrix3d":
767
+ return [[]];
768
+ }
769
+ }),
770
+ ]);
771
+ return;
772
+ }
773
+
774
+ function parseTranslate(
775
+ { value }: DeclarationType<"translate">,
776
+ builder: StylesheetBuilder,
777
+ ) {
778
+ builder.addDescriptor("translateX", [
779
+ {},
780
+ "translateX",
781
+ parseTranslateProp(value, "x", builder),
782
+ ]);
783
+ builder.addDescriptor("translateY", [
784
+ {},
785
+ "translateY",
786
+ parseTranslateProp(value, "y", builder),
787
+ ]);
788
+ }
789
+
790
+ function parseRotate(
791
+ { value }: DeclarationType<"rotate">,
792
+ builder: StylesheetBuilder,
793
+ ) {
794
+ if (value.x) {
795
+ builder.addDescriptor("rotateX", [
796
+ {},
797
+ "rotateX",
798
+ parseAngle(value.angle, builder),
799
+ ]);
800
+ }
801
+
802
+ if (value.y) {
803
+ builder.addDescriptor("rotateY", [
804
+ {},
805
+ "rotateY",
806
+ parseAngle(value.angle, builder),
807
+ ]);
808
+ }
809
+
810
+ if (value.z) {
811
+ builder.addDescriptor("rotateZ", [
812
+ {},
813
+ "rotateZ",
814
+ parseAngle(value.angle, builder),
815
+ ]);
816
+ }
817
+ }
818
+
819
+ function parseScale(
820
+ { value }: DeclarationType<"scale">,
821
+ builder: StylesheetBuilder,
822
+ ) {
823
+ builder.addDescriptor("scaleX", [
824
+ {},
825
+ "scaleX",
826
+ parseScaleValue(value, "x", builder),
827
+ ]);
828
+ builder.addDescriptor("scaleY", [
829
+ {},
830
+ "scaleY",
831
+ parseScaleValue(value, "y", builder),
832
+ ]);
833
+ }
834
+
835
+ export function parseScaleValue(
836
+ translate: Scale,
837
+ prop: keyof Extract<Scale, object>,
838
+ builder: StylesheetBuilder,
839
+ ): StyleDescriptor {
840
+ if (translate === "none") {
841
+ return 0;
842
+ }
843
+
844
+ return parseLength(translate[prop], builder);
845
+ }
846
+
847
+ function parseLetterSpacing(
848
+ { value }: DeclarationType<"letter-spacing">,
849
+ builder: StylesheetBuilder,
850
+ ) {
851
+ if (value.type === "normal") {
852
+ return;
853
+ }
854
+
855
+ return parseLength(value.value, builder);
856
+ }
857
+
858
+ function parseTextDecoration(
859
+ { value }: DeclarationType<"text-decoration">,
860
+ builder: StylesheetBuilder,
861
+ ) {
862
+ builder.addDescriptor(
863
+ "text-decoration-color",
864
+ parseColor(value.color, builder),
865
+ );
866
+ builder.addDescriptor(
867
+ "text-decoration-line",
868
+ parseTextDecorationLine(value.line, builder),
869
+ );
870
+ }
871
+
872
+ function parseZIndex(
873
+ { value }: DeclarationType<"z-index">,
874
+ builder: StylesheetBuilder,
875
+ ): StyleDescriptor {
876
+ if (value.type === "integer") {
877
+ return parseLength(value.value, builder);
878
+ } else {
879
+ builder.addWarning("value", value.type);
880
+ return;
881
+ }
882
+ }
883
+
884
+ function parseContainerType(
885
+ _declaration: DeclarationType<"container-type">,
886
+ builder: StylesheetBuilder,
887
+ ) {
888
+ builder.addContainer(["___default___"]);
889
+ return;
890
+ }
891
+
892
+ function parseContainerName(
893
+ { value }: DeclarationType<"container-name">,
894
+ builder: StylesheetBuilder,
895
+ ) {
896
+ builder.addContainer(value.type === "none" ? false : value.value);
897
+ return;
898
+ }
899
+
900
+ function parseContainer(
901
+ { value }: DeclarationType<"container">,
902
+ builder: StylesheetBuilder,
903
+ ) {
904
+ builder.addContainer(value.name.type === "none" ? false : value.name.value);
905
+ return;
906
+ }
907
+
908
+ export function parseUnparsedDeclaration(
909
+ declaration: Extract<Declaration, { property: "unparsed" }>,
910
+ builder: StylesheetBuilder,
911
+ ) {
912
+ let property = declaration.value.propertyId.property;
913
+
914
+ if (!(property in parsers)) {
915
+ builder.addWarning("property", property);
916
+ return;
917
+ }
918
+
919
+ builder.setWarningProperty(property);
920
+
921
+ /**
922
+ * React Native doesn't support all the logical properties
923
+ */
924
+ const rename = propertyRename[property];
925
+ if (rename) {
926
+ property = rename;
927
+ }
928
+
929
+ /**
930
+ * Unparsed shorthand properties need to be parsed at runtime
931
+ */
932
+ builder.descriptorProperty = property;
933
+
934
+ if (unparsedRuntimeParsing.has(property)) {
935
+ const args = parseUnparsed(declaration.value.value, builder, property);
936
+
937
+ if (property === "animation") {
938
+ builder.addDescriptor("animation", [{}, property, args]);
939
+ } else {
940
+ builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
941
+ }
942
+ } else {
943
+ const value = parseUnparsed(declaration.value.value, builder, property);
944
+
945
+ builder.addDescriptor(property, value);
946
+
947
+ if (property === "font-size") {
948
+ builder.addDescriptor("--__rn-css-em", value);
949
+ }
950
+
951
+ if (property === "color") {
952
+ if (
953
+ !isStyleFunction(value) ||
954
+ value[1] !== "var" ||
955
+ value[2] !== "-css-color"
956
+ ) {
957
+ builder.addDescriptor("--__rn-css-color", value);
958
+ }
959
+ }
960
+ }
961
+ }
962
+
963
+ export function parseCustomDeclaration(
964
+ declaration: Extract<Declaration, { property: "custom" }>,
965
+ builder: StylesheetBuilder,
966
+ ) {
967
+ const property = declaration.value.name;
968
+
969
+ if (property === "-webkit-line-clamp") {
970
+ builder.addDescriptor(
971
+ property,
972
+ parseUnparsed(declaration.value.value, builder, property),
973
+ );
974
+ } else if (property === "-rn-ripple-style") {
975
+ if (
976
+ parseUnparsed(declaration.value.value, builder, property) === "borderless"
977
+ ) {
978
+ builder.addDescriptor(property, true);
979
+ }
980
+ } else if (property === "-rn-ripple-layer") {
981
+ if (
982
+ parseUnparsed(declaration.value.value, builder, property) === "foreground"
983
+ ) {
984
+ builder.addDescriptor(property, true);
985
+ }
986
+ } else if (property === "object-fit") {
987
+ // https://github.com/parcel-bundler/lightningcss/issues/1046
988
+ parseObjectFit(declaration.value, builder);
989
+ } else if (property === "object-position") {
990
+ // https://github.com/parcel-bundler/lightningcss/issues/1047
991
+ parseObjectPosition(declaration.value, builder);
992
+ } else if (property === "outline-offset") {
993
+ // https://github.com/parcel-bundler/lightningcss/issues/1048
994
+ builder.addDescriptor(
995
+ property,
996
+ parseUnparsed(declaration.value.value, builder, property),
997
+ );
998
+ } else if (property === "corner-shape") {
999
+ parseCornerShape(declaration.value, builder);
1000
+ } else if (
1001
+ validProperties.has(property) ||
1002
+ property.startsWith("--") ||
1003
+ property.startsWith("-rn-")
1004
+ ) {
1005
+ builder.addDescriptor(
1006
+ property,
1007
+ parseUnparsed(declaration.value.value, builder, property),
1008
+ );
1009
+ } else {
1010
+ builder.addWarning("property", declaration.value.name);
1011
+ }
1012
+ }
1013
+
1014
+ export function reduceParseUnparsed(
1015
+ tokenOrValues: TokenOrValue[],
1016
+ builder: StylesheetBuilder,
1017
+ property: string,
1018
+ allowAuto: boolean,
1019
+ ): StyleDescriptor {
1020
+ const result = tokenOrValues
1021
+ .map((tokenOrValue) =>
1022
+ parseUnparsed(tokenOrValue, builder, property, allowAuto),
1023
+ )
1024
+ .filter((v) => v !== undefined);
1025
+
1026
+ if (result.length === 0) {
1027
+ return undefined;
1028
+ }
1029
+
1030
+ let currentGroup: StyleDescriptor = [];
1031
+ let groups: StyleDescriptor[] = [currentGroup];
1032
+
1033
+ for (const value of result) {
1034
+ if ((value as unknown) === CommaSeparator) {
1035
+ currentGroup = [];
1036
+ groups.push(currentGroup);
1037
+ } else {
1038
+ currentGroup.push(value);
1039
+ }
1040
+ }
1041
+
1042
+ // Groups are the tokens grouped together by comma location
1043
+ // If a group only has 1 item, it shouldn't be an array
1044
+ groups = groups.flatMap((group): StyleDescriptor[] => {
1045
+ if (!Array.isArray(group)) {
1046
+ return [];
1047
+ }
1048
+
1049
+ if (group.length === 0) {
1050
+ return [];
1051
+ } else if (group.length === 1) {
1052
+ const first = group[0];
1053
+
1054
+ if (first === undefined) {
1055
+ return [];
1056
+ } else {
1057
+ return [first];
1058
+ }
1059
+ } else if (
1060
+ // This is a special case for <ratio> values
1061
+ group.includes("/") &&
1062
+ group.every((item) =>
1063
+ typeof item === "string" && item === "/"
1064
+ ? item
1065
+ : typeof item === "number",
1066
+ )
1067
+ ) {
1068
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
1069
+ return [group.join(" ")];
1070
+ } else {
1071
+ return [group];
1072
+ }
1073
+ });
1074
+
1075
+ return groups.length === 1 ? groups[0] : groups;
1076
+ }
1077
+
1078
+ export function unparsedFunction(
1079
+ token: Extract<TokenOrValue, { type: "function" }>,
1080
+ builder: StylesheetBuilder,
1081
+ property: string,
1082
+ allowAuto: boolean,
1083
+ ): StyleFunction {
1084
+ return [
1085
+ {},
1086
+ toRNProperty(token.value.name),
1087
+ reduceParseUnparsed(token.value.arguments, builder, property, allowAuto),
1088
+ ];
1089
+ }
1090
+
1091
+ /**
1092
+ * When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
1093
+ * This export function best efforts parsing it into a export function that we can evaluate at runtime
1094
+ */
1095
+ export function parseUnparsed(
1096
+ tokenOrValue:
1097
+ | TokenOrValue
1098
+ | TokenOrValue[]
1099
+ | string
1100
+ | number
1101
+ | undefined
1102
+ | null,
1103
+ builder: StylesheetBuilder,
1104
+ property: string,
1105
+ allowAuto = allowAutoProperties.has(property),
1106
+ ): StyleDescriptor {
1107
+ if (tokenOrValue === undefined || tokenOrValue === null) {
1108
+ return;
1109
+ }
1110
+
1111
+ if (typeof tokenOrValue === "string") {
1112
+ if (tokenOrValue === "true") {
1113
+ return true;
1114
+ } else if (tokenOrValue === "false") {
1115
+ return false;
1116
+ } else if (tokenOrValue === "currentcolor") {
1117
+ return [{}, "var", "__rn-css-color"] as const;
1118
+ } else {
1119
+ return tokenOrValue;
1120
+ }
1121
+ }
1122
+
1123
+ if (typeof tokenOrValue === "number") {
1124
+ return round(tokenOrValue);
1125
+ }
1126
+
1127
+ if (Array.isArray(tokenOrValue)) {
1128
+ const args = reduceParseUnparsed(
1129
+ tokenOrValue,
1130
+ builder,
1131
+ property,
1132
+ allowAuto,
1133
+ );
1134
+ if (!args) return;
1135
+ if (Array.isArray(args) && args.length === 1) {
1136
+ return args[0];
1137
+ } else if (
1138
+ (property === "filter" || property === "transform") &&
1139
+ isStyleFunction(args)
1140
+ ) {
1141
+ return [args];
1142
+ } else {
1143
+ return args;
1144
+ }
1145
+ }
1146
+
1147
+ switch (tokenOrValue.type) {
1148
+ case "unresolved-color": {
1149
+ return parseUnresolvedColor(
1150
+ tokenOrValue.value,
1151
+ builder,
1152
+ property,
1153
+ allowAuto,
1154
+ );
1155
+ }
1156
+ case "var": {
1157
+ let args: StyleDescriptor = tokenOrValue.value.name.ident.slice(2);
1158
+ const fallback = parseUnparsed(
1159
+ tokenOrValue.value.fallback,
1160
+ builder,
1161
+ property,
1162
+ allowAuto,
1163
+ );
1164
+ if (fallback !== undefined) {
1165
+ args = [args, fallback];
1166
+ }
1167
+
1168
+ return [{}, "var", args, 1];
1169
+ }
1170
+ case "function": {
1171
+ switch (tokenOrValue.value.name) {
1172
+ case "blur":
1173
+ case "brightness":
1174
+ case "contrast":
1175
+ case "cubic-bezier":
1176
+ case "drop-shadow":
1177
+ case "fontScale":
1178
+ case "getPixelSizeForLayoutSize":
1179
+ case "grayscale":
1180
+ case "hsl":
1181
+ case "hsla":
1182
+ case "hue-rotate":
1183
+ case "invert":
1184
+ case "opacity":
1185
+ case "pixelScale":
1186
+ case "platformColor":
1187
+ case "rgb":
1188
+ case "rgba":
1189
+ case "rotate":
1190
+ case "rotateX":
1191
+ case "rotateY":
1192
+ case "roundToNearestPixel":
1193
+ case "saturate":
1194
+ case "scale":
1195
+ case "scaleX":
1196
+ case "scaleY":
1197
+ case "sepia":
1198
+ case "shadow":
1199
+ case "skewX":
1200
+ case "skewY":
1201
+ case "steps":
1202
+ case "translate":
1203
+ case "translateX":
1204
+ case "translateY":
1205
+ return unparsedFunction(tokenOrValue, builder, property, allowAuto);
1206
+ case "linear-gradient":
1207
+ case "radial-gradient":
1208
+ // These are special as React Native requires the '-' in their name
1209
+ return [
1210
+ {},
1211
+ tokenOrValue.value.name,
1212
+ reduceParseUnparsed(
1213
+ tokenOrValue.value.arguments,
1214
+ builder,
1215
+ property,
1216
+ allowAuto,
1217
+ ),
1218
+ ];
1219
+ case "hairlineWidth":
1220
+ return [{}, tokenOrValue.value.name, []];
1221
+ case "calc":
1222
+ case "max":
1223
+ case "min":
1224
+ case "clamp":
1225
+ return parseCalcFn(
1226
+ tokenOrValue.value.name,
1227
+ tokenOrValue.value.arguments,
1228
+ builder,
1229
+ property,
1230
+ );
1231
+ case "color-mix":
1232
+ return parseColorMix(tokenOrValue.value.arguments, builder, property);
1233
+ default: {
1234
+ builder.addWarning("value", `${tokenOrValue.value.name}()`);
1235
+ return;
1236
+ }
1237
+ }
1238
+ }
1239
+ case "length":
1240
+ return parseLength(tokenOrValue.value, builder);
1241
+ case "angle":
1242
+ return parseAngle(tokenOrValue.value, builder);
1243
+ case "token":
1244
+ switch (tokenOrValue.value.type) {
1245
+ case "string":
1246
+ case "ident": {
1247
+ const value = tokenOrValue.value.value;
1248
+ if (!allowAuto && value === "auto") {
1249
+ builder.addWarning("value", value);
1250
+ return;
1251
+ }
1252
+
1253
+ if (value === "inherit" || value === "initial") {
1254
+ builder.addWarning("value", value);
1255
+ return;
1256
+ } else if (value === "currentcolor") {
1257
+ return [{}, "var", "__rn-css-color"] as const;
1258
+ }
1259
+
1260
+ if (value === "true") {
1261
+ return true;
1262
+ } else if (value === "false") {
1263
+ return false;
1264
+ } else if (value === "infinity") {
1265
+ return Number.MAX_SAFE_INTEGER;
1266
+ } else {
1267
+ return value;
1268
+ }
1269
+ }
1270
+ case "number": {
1271
+ return round(tokenOrValue.value.value);
1272
+ }
1273
+ case "function":
1274
+ builder.addWarning("value", tokenOrValue.value.value);
1275
+ return;
1276
+ case "percentage":
1277
+ return `${round(tokenOrValue.value.value * 100)}%`;
1278
+ case "dimension":
1279
+ return parseDimension(tokenOrValue.value, builder);
1280
+ case "comma":
1281
+ return CommaSeparator as unknown as StyleDescriptor;
1282
+ case "delim": {
1283
+ if (tokenOrValue.value.value === "/") {
1284
+ return tokenOrValue.value.value;
1285
+ }
1286
+ return;
1287
+ }
1288
+ case "at-keyword":
1289
+ case "hash":
1290
+ case "id-hash":
1291
+ case "unquoted-url":
1292
+ case "white-space":
1293
+ case "comment":
1294
+ case "colon":
1295
+ case "semicolon":
1296
+ case "include-match":
1297
+ case "dash-match":
1298
+ case "prefix-match":
1299
+ case "suffix-match":
1300
+ case "substring-match":
1301
+ case "cdo":
1302
+ case "cdc":
1303
+ case "parenthesis-block":
1304
+ case "square-bracket-block":
1305
+ case "curly-bracket-block":
1306
+ case "bad-url":
1307
+ case "bad-string":
1308
+ case "close-parenthesis":
1309
+ case "close-square-bracket":
1310
+ case "close-curly-bracket":
1311
+ return;
1312
+ default: {
1313
+ tokenOrValue.value satisfies never;
1314
+ return;
1315
+ }
1316
+ }
1317
+ case "color":
1318
+ return parseColor(tokenOrValue.value, builder);
1319
+ case "env":
1320
+ return parseEnv(tokenOrValue.value, builder);
1321
+ case "time":
1322
+ return parseTime(tokenOrValue.value);
1323
+ case "url":
1324
+ case "resolution":
1325
+ case "dashed-ident":
1326
+ case "animation-name":
1327
+ return;
1328
+ default: {
1329
+ tokenOrValue satisfies never;
1330
+ }
1331
+ }
1332
+
1333
+ return;
1334
+ }
1335
+
1336
+ export function parseLengthDeclaration(
1337
+ declaration: {
1338
+ value:
1339
+ | number
1340
+ | Length
1341
+ | DimensionPercentageFor_LengthValue
1342
+ | NumberOrPercentage
1343
+ | LengthValue;
1344
+ },
1345
+ builder: StylesheetBuilder,
1346
+ ) {
1347
+ return parseLength(declaration.value, builder);
1348
+ }
1349
+
1350
+ export function parseLength(
1351
+ length:
1352
+ | number
1353
+ | Length
1354
+ | DimensionPercentageFor_LengthValue
1355
+ | NumberOrPercentage
1356
+ | LengthValue,
1357
+ builder: StylesheetBuilder,
1358
+ ): StyleDescriptor {
1359
+ const { inlineRem = 14 } = builder.getOptions();
1360
+
1361
+ if (typeof length === "number") {
1362
+ return round(length);
1363
+ }
1364
+
1365
+ if ("unit" in length) {
1366
+ switch (length.unit) {
1367
+ case "px": {
1368
+ if (length.value === Infinity) {
1369
+ return Number.MAX_SAFE_INTEGER;
1370
+ } else if (length.value === -Infinity) {
1371
+ return Number.MIN_SAFE_INTEGER;
1372
+ } else {
1373
+ // Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
1374
+ const value = Math.max(
1375
+ Math.min(length.value, Number.MAX_SAFE_INTEGER),
1376
+ Number.MIN_SAFE_INTEGER,
1377
+ );
1378
+ return round(value);
1379
+ }
1380
+ }
1381
+ case "rem":
1382
+ if (typeof inlineRem === "number") {
1383
+ return length.value * inlineRem;
1384
+ } else {
1385
+ return [{}, "rem", round(length.value)];
1386
+ }
1387
+ case "vw":
1388
+ case "vh":
1389
+ case "em":
1390
+ return [{}, length.unit, round(length.value), 1];
1391
+ case "in":
1392
+ case "cm":
1393
+ case "mm":
1394
+ case "q":
1395
+ case "pt":
1396
+ case "pc":
1397
+ case "ex":
1398
+ case "rex":
1399
+ case "ch":
1400
+ case "rch":
1401
+ case "cap":
1402
+ case "rcap":
1403
+ case "ic":
1404
+ case "ric":
1405
+ case "lh":
1406
+ case "rlh":
1407
+ case "lvw":
1408
+ case "svw":
1409
+ case "dvw":
1410
+ case "cqw":
1411
+ case "lvh":
1412
+ case "svh":
1413
+ case "dvh":
1414
+ case "cqh":
1415
+ case "vi":
1416
+ case "svi":
1417
+ case "lvi":
1418
+ case "dvi":
1419
+ case "cqi":
1420
+ case "vb":
1421
+ case "svb":
1422
+ case "lvb":
1423
+ case "dvb":
1424
+ case "cqb":
1425
+ case "vmin":
1426
+ case "svmin":
1427
+ case "lvmin":
1428
+ case "dvmin":
1429
+ case "cqmin":
1430
+ case "vmax":
1431
+ case "svmax":
1432
+ case "lvmax":
1433
+ case "dvmax":
1434
+ case "cqmax":
1435
+ builder.addWarning("value", `${length.value}${length.unit}`);
1436
+ return undefined;
1437
+ default: {
1438
+ length.unit satisfies never;
1439
+ }
1440
+ }
1441
+ } else {
1442
+ switch (length.type) {
1443
+ case "calc": {
1444
+ // TODO: Add the calc polyfill
1445
+ return undefined;
1446
+ }
1447
+ case "number": {
1448
+ return round(length.value);
1449
+ }
1450
+ case "percentage": {
1451
+ return `${round(length.value * 100)}%`;
1452
+ }
1453
+ case "dimension":
1454
+ case "value": {
1455
+ return parseLength(length.value, builder);
1456
+ }
1457
+ }
1458
+ }
1459
+
1460
+ return;
1461
+ }
1462
+
1463
+ export function parseAngle(angle: Angle | number, builder: StylesheetBuilder) {
1464
+ if (typeof angle === "number") {
1465
+ return `${angle}deg`;
1466
+ }
1467
+
1468
+ switch (angle.type) {
1469
+ case "deg":
1470
+ case "rad":
1471
+ return `${angle.value}${angle.type}`;
1472
+ default:
1473
+ builder.addWarning("value", `${angle.value} ${angle.type}`);
1474
+ return undefined;
1475
+ }
1476
+ }
1477
+
1478
+ export function parseSizeDeclaration(
1479
+ declaration: { value: Size | MaxSize },
1480
+ builder: StylesheetBuilder,
1481
+ ) {
1482
+ return parseSize(declaration.value, builder);
1483
+ }
1484
+
1485
+ export function parseSizeWithAutoDeclaration(
1486
+ declaration: { value: Size | MaxSize },
1487
+ builder: StylesheetBuilder,
1488
+ ) {
1489
+ return parseSize(declaration.value, builder, { allowAuto: true });
1490
+ }
1491
+
1492
+ export function parsePointerEvents(
1493
+ { value }: { value: string },
1494
+ builder: StylesheetBuilder,
1495
+ ) {
1496
+ switch (value) {
1497
+ case "none":
1498
+ case "box-none":
1499
+ case "box-only":
1500
+ case "auto":
1501
+ return value;
1502
+ case "visible":
1503
+ case "visiblePainted":
1504
+ case "visibleFill":
1505
+ case "visibleStroke":
1506
+ case "painted":
1507
+ case "fill":
1508
+ case "stroke":
1509
+ builder.addWarning("value", value);
1510
+ }
1511
+
1512
+ return;
1513
+ }
1514
+
1515
+ export function parseSize(
1516
+ size: Size | MaxSize,
1517
+ builder: StylesheetBuilder,
1518
+ options?: { allowAuto?: boolean },
1519
+ ): StyleDescriptor;
1520
+ export function parseSize(
1521
+ size: Size | MaxSize,
1522
+ builder: StylesheetBuilder,
1523
+ property: string,
1524
+ options?: { allowAuto?: boolean },
1525
+ ): StyleDescriptor;
1526
+ export function parseSize(
1527
+ size: Size | MaxSize,
1528
+ builder: StylesheetBuilder,
1529
+ options?: string | { allowAuto?: boolean },
1530
+ { allowAuto = false } = {},
1531
+ ) {
1532
+ allowAuto =
1533
+ (typeof options === "object" ? options.allowAuto : allowAuto) ?? false;
1534
+
1535
+ switch (size.type) {
1536
+ case "length-percentage":
1537
+ return parseLength(size.value, builder);
1538
+ case "none":
1539
+ return size.type;
1540
+ case "auto":
1541
+ if (allowAuto) {
1542
+ return size.type;
1543
+ } else {
1544
+ builder.addWarning("value", size.type);
1545
+ return undefined;
1546
+ }
1547
+ case "min-content":
1548
+ case "max-content":
1549
+ case "fit-content":
1550
+ case "fit-content-function":
1551
+ case "stretch":
1552
+ case "contain":
1553
+ builder.addWarning("value", size.type);
1554
+ return undefined;
1555
+ default: {
1556
+ size satisfies never;
1557
+ }
1558
+ }
1559
+
1560
+ return;
1561
+ }
1562
+
1563
+ export function parseColorOrAutoDeclaration(
1564
+ { value }: { value: ColorOrAuto },
1565
+ builder: StylesheetBuilder,
1566
+ ) {
1567
+ if (value.type === "auto") {
1568
+ builder.addWarning("value", `Invalid color value ${value.type}`);
1569
+ return;
1570
+ } else {
1571
+ return parseColor(value.value, builder);
1572
+ }
1573
+ }
1574
+
1575
+ export function parseFontColorDeclaration(
1576
+ declaration: Extract<Declaration, { value: CssColor }>,
1577
+ builder: StylesheetBuilder,
1578
+ ) {
1579
+ parseColorDeclaration(declaration, builder);
1580
+
1581
+ if (
1582
+ typeof declaration.value !== "object" ||
1583
+ declaration.value.type !== "currentcolor"
1584
+ ) {
1585
+ builder.addDescriptor(
1586
+ "--__rn-css-color",
1587
+ parseColor(declaration.value, builder),
1588
+ );
1589
+ }
1590
+ }
1591
+
1592
+ export function parseColorDeclaration(
1593
+ declaration: Extract<Declaration, { value: CssColor }>,
1594
+ builder: StylesheetBuilder,
1595
+ ) {
1596
+ builder.addDescriptor(
1597
+ declaration.property,
1598
+ parseColor(declaration.value, builder),
1599
+ );
1600
+ }
1601
+
1602
+ export function parseColor(cssColor: CssColor, builder: StylesheetBuilder) {
1603
+ if (typeof cssColor === "string") {
1604
+ if (namedColors.has(cssColor)) {
1605
+ return cssColor;
1606
+ }
1607
+ return;
1608
+ }
1609
+
1610
+ let color: Color | undefined;
1611
+
1612
+ const { hexColors = true, colorPrecision } = builder.getOptions();
1613
+
1614
+ switch (cssColor.type) {
1615
+ case "currentcolor":
1616
+ return [{}, "var", "__rn-css-color"] as const;
1617
+ case "light-dark": {
1618
+ const extraRule: StyleRule = {
1619
+ s: [],
1620
+ m: [["=", "prefers-color-scheme", "dark"]],
1621
+ };
1622
+
1623
+ builder.addUnnamedDescriptor(
1624
+ parseColor(cssColor.dark, builder),
1625
+ false,
1626
+ extraRule,
1627
+ );
1628
+ builder.addExtraRule(extraRule);
1629
+ return parseColor(cssColor.light, builder);
1630
+ }
1631
+ case "rgb": {
1632
+ color = new Color({
1633
+ space: "sRGB",
1634
+ coords: [cssColor.r / 255, cssColor.g / 255, cssColor.b / 255],
1635
+ alpha: cssColor.alpha,
1636
+ });
1637
+ break;
1638
+ }
1639
+ case "hsl":
1640
+ color = new Color({
1641
+ space: cssColor.type,
1642
+ coords: [cssColor.h, cssColor.s, cssColor.l],
1643
+ alpha: cssColor.alpha,
1644
+ });
1645
+ break;
1646
+ case "hwb":
1647
+ color = new Color({
1648
+ space: cssColor.type,
1649
+ coords: [cssColor.h, cssColor.w, cssColor.b],
1650
+ alpha: cssColor.alpha,
1651
+ });
1652
+ break;
1653
+ case "lab":
1654
+ color = new Color({
1655
+ space: cssColor.type,
1656
+ coords: [cssColor.l, cssColor.a, cssColor.b],
1657
+ alpha: cssColor.alpha,
1658
+ });
1659
+ break;
1660
+ case "lch":
1661
+ color = new Color({
1662
+ space: cssColor.type,
1663
+ coords: [cssColor.l, cssColor.c, cssColor.h],
1664
+ alpha: cssColor.alpha,
1665
+ });
1666
+ break;
1667
+ case "oklab":
1668
+ color = new Color({
1669
+ space: cssColor.type,
1670
+ coords: [cssColor.l, cssColor.a, cssColor.b],
1671
+ alpha: cssColor.alpha,
1672
+ });
1673
+ break;
1674
+ case "oklch":
1675
+ color = new Color({
1676
+ space: cssColor.type,
1677
+ coords: [cssColor.l, cssColor.c, cssColor.h],
1678
+ alpha: cssColor.alpha,
1679
+ });
1680
+ break;
1681
+ case "srgb":
1682
+ color = new Color({
1683
+ space: cssColor.type,
1684
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1685
+ alpha: cssColor.alpha,
1686
+ });
1687
+ break;
1688
+ case "srgb-linear":
1689
+ color = new Color({
1690
+ space: cssColor.type,
1691
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1692
+ alpha: cssColor.alpha,
1693
+ });
1694
+ break;
1695
+ case "display-p3":
1696
+ color = new Color({
1697
+ space: "p3",
1698
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1699
+ alpha: cssColor.alpha,
1700
+ });
1701
+ break;
1702
+ case "a98-rgb":
1703
+ color = new Color({
1704
+ space: "a98rgb",
1705
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1706
+ alpha: cssColor.alpha,
1707
+ });
1708
+ break;
1709
+ case "prophoto-rgb":
1710
+ color = new Color({
1711
+ space: "prophoto",
1712
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1713
+ alpha: cssColor.alpha,
1714
+ });
1715
+ break;
1716
+ case "rec2020":
1717
+ color = new Color({
1718
+ space: cssColor.type,
1719
+ coords: [cssColor.r, cssColor.g, cssColor.b],
1720
+ alpha: cssColor.alpha,
1721
+ });
1722
+ break;
1723
+ case "xyz-d50":
1724
+ color = new Color({
1725
+ space: cssColor.type,
1726
+ coords: [cssColor.x, cssColor.y, cssColor.z],
1727
+ alpha: cssColor.alpha,
1728
+ });
1729
+ break;
1730
+ case "xyz-d65":
1731
+ color = new Color({
1732
+ space: cssColor.type,
1733
+ coords: [cssColor.x, cssColor.y, cssColor.z],
1734
+ alpha: cssColor.alpha,
1735
+ });
1736
+ break;
1737
+ default: {
1738
+ cssColor satisfies never;
1739
+ }
1740
+ }
1741
+
1742
+ if (!hexColors || colorPrecision) {
1743
+ return color?.toString({ precision: colorPrecision ?? 3 });
1744
+ } else {
1745
+ return color?.toString({ format: "hex" });
1746
+ }
1747
+ }
1748
+
1749
+ export function parseLengthPercentageDeclaration(
1750
+ value: { value: LengthPercentageOrAuto },
1751
+ builder: StylesheetBuilder,
1752
+ ) {
1753
+ return parseLengthPercentageOrAuto(value.value, builder);
1754
+ }
1755
+
1756
+ export function parseLengthPercentageOrAutoDeclaration(
1757
+ value: { value: LengthPercentageOrAuto },
1758
+ builder: StylesheetBuilder,
1759
+ ) {
1760
+ return parseLengthPercentageOrAuto(value.value, builder, { allowAuto: true });
1761
+ }
1762
+
1763
+ export function parseLengthPercentageOrAuto(
1764
+ lengthPercentageOrAuto: LengthPercentageOrAuto,
1765
+ builder: StylesheetBuilder,
1766
+ { allowAuto = false } = {},
1767
+ ) {
1768
+ switch (lengthPercentageOrAuto.type) {
1769
+ case "auto":
1770
+ if (allowAuto) {
1771
+ return lengthPercentageOrAuto.type;
1772
+ } else {
1773
+ builder.addWarning("value", lengthPercentageOrAuto.type);
1774
+ return undefined;
1775
+ }
1776
+ case "length-percentage":
1777
+ return parseLength(lengthPercentageOrAuto.value, builder);
1778
+ default: {
1779
+ lengthPercentageOrAuto satisfies never;
1780
+ }
1781
+ }
1782
+
1783
+ return;
1784
+ }
1785
+
1786
+ export function parseJustifyContent(
1787
+ declaration: DeclarationType<"justify-content">,
1788
+ builder: StylesheetBuilder,
1789
+ ) {
1790
+ const allowed = new Set([
1791
+ "flex-start",
1792
+ "flex-end",
1793
+ "center",
1794
+ "space-between",
1795
+ "space-around",
1796
+ "space-evenly",
1797
+ ]);
1798
+
1799
+ let value: string | undefined;
1800
+
1801
+ switch (declaration.value.type) {
1802
+ case "normal":
1803
+ case "left":
1804
+ case "right":
1805
+ value = declaration.value.type;
1806
+ break;
1807
+ case "content-distribution":
1808
+ case "content-position":
1809
+ value = declaration.value.value;
1810
+ break;
1811
+ default: {
1812
+ declaration.value satisfies never;
1813
+ }
1814
+ }
1815
+
1816
+ if (value && !allowed.has(value)) {
1817
+ builder.addWarning("value", value);
1818
+ return;
1819
+ }
1820
+
1821
+ return value;
1822
+ }
1823
+
1824
+ export function parseAlignContent(
1825
+ declaration: DeclarationType<"align-content">,
1826
+ builder: StylesheetBuilder,
1827
+ ) {
1828
+ const allowed = new Set([
1829
+ "flex-start",
1830
+ "flex-end",
1831
+ "center",
1832
+ "stretch",
1833
+ "space-between",
1834
+ "space-around",
1835
+ "space-evenly",
1836
+ ]);
1837
+
1838
+ let value: string | undefined;
1839
+
1840
+ switch (declaration.value.type) {
1841
+ case "normal":
1842
+ case "baseline-position":
1843
+ value = declaration.value.type;
1844
+ break;
1845
+ case "content-distribution":
1846
+ case "content-position":
1847
+ value = declaration.value.value;
1848
+ break;
1849
+ default: {
1850
+ declaration.value satisfies never;
1851
+ }
1852
+ }
1853
+
1854
+ if (value && !allowed.has(value)) {
1855
+ builder.addWarning("value", value);
1856
+ return;
1857
+ }
1858
+
1859
+ return value;
1860
+ }
1861
+
1862
+ export function parseAlignItems(
1863
+ alignItems: DeclarationType<"align-items">,
1864
+ builder: StylesheetBuilder,
1865
+ ) {
1866
+ const allowed = new Set([
1867
+ "auto",
1868
+ "flex-start",
1869
+ "flex-end",
1870
+ "center",
1871
+ "stretch",
1872
+ "baseline",
1873
+ ]);
1874
+
1875
+ let value: string | undefined;
1876
+
1877
+ switch (alignItems.value.type) {
1878
+ case "normal":
1879
+ value = "auto";
1880
+ break;
1881
+ case "stretch":
1882
+ value = alignItems.value.type;
1883
+ break;
1884
+ case "baseline-position":
1885
+ value = "baseline";
1886
+ break;
1887
+ case "self-position":
1888
+ value = alignItems.value.value;
1889
+ break;
1890
+ default: {
1891
+ alignItems.value satisfies never;
1892
+ }
1893
+ }
1894
+
1895
+ if (value && !allowed.has(value)) {
1896
+ builder.addWarning("value", value);
1897
+ return;
1898
+ }
1899
+
1900
+ return value;
1901
+ }
1902
+
1903
+ export function parseAlignSelf(
1904
+ alignSelf: DeclarationType<"align-self">,
1905
+ builder: StylesheetBuilder,
1906
+ ) {
1907
+ const allowed = new Set([
1908
+ "auto",
1909
+ "flex-start",
1910
+ "flex-end",
1911
+ "center",
1912
+ "stretch",
1913
+ "baseline",
1914
+ ]);
1915
+
1916
+ let value: string | undefined;
1917
+
1918
+ switch (alignSelf.value.type) {
1919
+ case "normal":
1920
+ case "auto":
1921
+ value = "auto";
1922
+ break;
1923
+ case "stretch":
1924
+ value = alignSelf.value.type;
1925
+ break;
1926
+ case "baseline-position":
1927
+ value = "baseline";
1928
+ break;
1929
+ case "self-position":
1930
+ value = alignSelf.value.value;
1931
+ break;
1932
+ default: {
1933
+ alignSelf.value satisfies never;
1934
+ }
1935
+ }
1936
+
1937
+ if (value && !allowed.has(value)) {
1938
+ builder.addWarning("value", value);
1939
+ return;
1940
+ }
1941
+
1942
+ return value;
1943
+ }
1944
+
1945
+ export function parseFontWeightDeclaration(
1946
+ declaration: DeclarationType<"font-weight">,
1947
+ builder: StylesheetBuilder,
1948
+ ) {
1949
+ return parseFontWeight(declaration.value, builder);
1950
+ }
1951
+
1952
+ export function parseFontWeight(
1953
+ fontWeight: FontWeight,
1954
+ builder: StylesheetBuilder,
1955
+ ) {
1956
+ switch (fontWeight.type) {
1957
+ case "absolute":
1958
+ if (fontWeight.value.type === "weight") {
1959
+ return fontWeight.value.value;
1960
+ } else {
1961
+ return fontWeight.value.type;
1962
+ }
1963
+ case "bolder":
1964
+ case "lighter":
1965
+ builder.addWarning("value", fontWeight.type);
1966
+ return;
1967
+ default: {
1968
+ fontWeight satisfies never;
1969
+ }
1970
+ }
1971
+
1972
+ return;
1973
+ }
1974
+
1975
+ export function parseTextShadow(
1976
+ declaration: DeclarationType<"text-shadow">,
1977
+ builder: StylesheetBuilder,
1978
+ ) {
1979
+ const [textShadow] = declaration.value;
1980
+
1981
+ if (!textShadow) {
1982
+ return;
1983
+ }
1984
+ builder.addDescriptor(
1985
+ "textShadowColor",
1986
+ parseColor(textShadow.color, builder),
1987
+ );
1988
+ builder.addDescriptor(
1989
+ "&.textShadowOffset.width",
1990
+ parseLength(textShadow.xOffset, builder),
1991
+ );
1992
+ builder.addDescriptor(
1993
+ "&.textShadowOffset.height",
1994
+ parseLength(textShadow.yOffset, builder),
1995
+ );
1996
+ builder.addDescriptor(
1997
+ "textShadowRadius",
1998
+ parseLength(textShadow.blur, builder),
1999
+ );
2000
+ }
2001
+
2002
+ export function parseTextDecorationStyle(
2003
+ declaration: DeclarationType<"text-decoration-style">,
2004
+ builder: StylesheetBuilder,
2005
+ ) {
2006
+ const allowed = new Set(["solid", "double", "dotted", "dashed"]);
2007
+
2008
+ if (allowed.has(declaration.value)) {
2009
+ return declaration.value;
2010
+ }
2011
+
2012
+ builder.addWarning("value", declaration.value);
2013
+ return;
2014
+ }
2015
+
2016
+ export function parseTextDecorationLineDeclaration(
2017
+ declaration: DeclarationType<"text-decoration-line">,
2018
+ builder: StylesheetBuilder,
2019
+ ) {
2020
+ return parseTextDecorationLine(declaration.value, builder);
2021
+ }
2022
+
2023
+ export function parseTextDecorationLine(
2024
+ value: DeclarationType<"text-decoration-line">["value"],
2025
+ builder: StylesheetBuilder,
2026
+ ) {
2027
+ if (!Array.isArray(value)) {
2028
+ if (value === "none") {
2029
+ return value;
2030
+ }
2031
+ builder.addWarning("value", value);
2032
+ return;
2033
+ }
2034
+
2035
+ const set = new Set(value);
2036
+
2037
+ if (set.has("underline")) {
2038
+ if (set.has("line-through")) {
2039
+ return "underline line-through";
2040
+ } else {
2041
+ return "underline";
2042
+ }
2043
+ } else if (set.has("line-through")) {
2044
+ return "line-through";
2045
+ }
2046
+
2047
+ builder.addWarning("value", value.join(" "));
2048
+ return undefined;
2049
+ }
2050
+
2051
+ export function parsePosition(
2052
+ { value }: DeclarationType<"position">,
2053
+ builder: StylesheetBuilder,
2054
+ ) {
2055
+ if (
2056
+ value.type === "absolute" ||
2057
+ value.type === "relative" ||
2058
+ value.type === "static"
2059
+ ) {
2060
+ return value.type;
2061
+ }
2062
+
2063
+ builder.addWarning("value", value.type);
2064
+ return;
2065
+ }
2066
+
2067
+ export function parseOverflow(
2068
+ { value }: DeclarationType<"overflow">,
2069
+ builder: StylesheetBuilder,
2070
+ ) {
2071
+ const allowed = new Set(["visible", "hidden"]);
2072
+
2073
+ if (allowed.has(value.x)) {
2074
+ return value.x;
2075
+ }
2076
+
2077
+ builder.addWarning("value", value.x);
2078
+ return undefined;
2079
+ }
2080
+
2081
+ export function parseBorderStyleDeclaration(
2082
+ declaration: Extract<
2083
+ DeclarationType<Declaration["property"]>,
2084
+ { value: LineStyle | BorderStyle }
2085
+ >,
2086
+ builder: StylesheetBuilder,
2087
+ ) {
2088
+ return parseBorderStyle(declaration.value, builder);
2089
+ }
2090
+
2091
+ export function parseBorderStyle(
2092
+ value: BorderStyle | LineStyle,
2093
+ builder: StylesheetBuilder,
2094
+ ) {
2095
+ const allowed = new Set(["solid", "dotted", "dashed"]);
2096
+
2097
+ if (typeof value === "string") {
2098
+ if (allowed.has(value)) {
2099
+ return value;
2100
+ } else {
2101
+ builder.addWarning("value", value);
2102
+ return undefined;
2103
+ }
2104
+ } else if (
2105
+ value.top === value.bottom &&
2106
+ value.top === value.left &&
2107
+ value.top === value.right &&
2108
+ allowed.has(value.top)
2109
+ ) {
2110
+ return value.top;
2111
+ }
2112
+
2113
+ builder.addWarning("value", value.top);
2114
+
2115
+ return undefined;
2116
+ }
2117
+
2118
+ export function parseBorderBlockWidth(
2119
+ declaration: DeclarationType<"border-block-width">,
2120
+ builder: StylesheetBuilder,
2121
+ ) {
2122
+ const start = parseBorderSideWidth(declaration.value.start, builder);
2123
+ const end = parseBorderSideWidth(declaration.value.end, builder);
2124
+
2125
+ if (start === end) {
2126
+ builder.addDescriptor("border-block-width", start);
2127
+ } else {
2128
+ builder.addDescriptor("border-block-start-width", start);
2129
+ builder.addDescriptor("border-block-end-width", end);
2130
+ }
2131
+ }
2132
+
2133
+ function parseBorderBlockStyle(
2134
+ declaration: DeclarationType<"border-block-style">,
2135
+ builder: StylesheetBuilder,
2136
+ ) {
2137
+ const start = parseBorderStyle(declaration.value.start, builder);
2138
+ const end = parseBorderStyle(declaration.value.end, builder);
2139
+
2140
+ if (start == end) {
2141
+ builder.addDescriptor("border-block-style", start);
2142
+ } else {
2143
+ builder.addDescriptor("border-block-start-style", start);
2144
+ builder.addDescriptor("border-block-end-style", end);
2145
+ }
2146
+ }
2147
+
2148
+ export function parseBorderSideWidthDeclaration(
2149
+ declaration: Extract<Declaration, { value: BorderSideWidth }>,
2150
+ builder: StylesheetBuilder,
2151
+ ) {
2152
+ builder.addDescriptor(
2153
+ declaration.property,
2154
+ parseBorderSideWidth(declaration.value, builder),
2155
+ );
2156
+ }
2157
+
2158
+ export function parseBorderSideWidth(
2159
+ value: BorderSideWidth,
2160
+ builder: StylesheetBuilder,
2161
+ ) {
2162
+ if (value.type === "length") {
2163
+ return parseLength(value.value, builder);
2164
+ }
2165
+
2166
+ builder.addWarning("value", value.type);
2167
+ return undefined;
2168
+ }
2169
+
2170
+ export function parseVerticalAlign(
2171
+ { value }: DeclarationType<"vertical-align">,
2172
+ builder: StylesheetBuilder,
2173
+ ) {
2174
+ if (value.type === "length") {
2175
+ return undefined;
2176
+ }
2177
+
2178
+ const allowed = new Set(["auto", "top", "bottom", "middle"]);
2179
+
2180
+ if (allowed.has(value.value)) {
2181
+ return value.value;
2182
+ }
2183
+
2184
+ builder.addWarning("value", value.value);
2185
+ return undefined;
2186
+ }
2187
+
2188
+ function parseFontFamily({ value }: DeclarationType<"font-family">) {
2189
+ // React Native only allows one font family - better hope this is the right one :)
2190
+ return value[0];
2191
+ }
2192
+
2193
+ export function parseLineHeightDeclaration(
2194
+ declaration: DeclarationType<"line-height">,
2195
+ builder: StylesheetBuilder,
2196
+ ) {
2197
+ builder.addDescriptor("line-height", [
2198
+ {},
2199
+ "lineHeight",
2200
+ [parseLineHeight(declaration.value, builder)],
2201
+ 1,
2202
+ ]);
2203
+ }
2204
+
2205
+ export function parseLineHeight(
2206
+ value: LineHeight,
2207
+ builder: StylesheetBuilder,
2208
+ ): StyleDescriptor {
2209
+ switch (value.type) {
2210
+ case "normal":
2211
+ return undefined;
2212
+ case "number":
2213
+ return [{}, "em", [value.value], 1];
2214
+ case "length": {
2215
+ const length = value.value;
2216
+
2217
+ switch (length.type) {
2218
+ case "dimension":
2219
+ return parseLength(length, builder);
2220
+ case "percentage":
2221
+ case "calc":
2222
+ builder.addWarning(
2223
+ "style",
2224
+ "line-height",
2225
+ typeof length.value === "number"
2226
+ ? length.value
2227
+ : JSON.stringify(length.value),
2228
+ );
2229
+ return;
2230
+ default: {
2231
+ length satisfies never;
2232
+ }
2233
+ }
2234
+
2235
+ return;
2236
+ }
2237
+ default: {
2238
+ value satisfies never;
2239
+ }
2240
+ }
2241
+
2242
+ return;
2243
+ }
2244
+
2245
+ export function parseFontSizeDeclaration(
2246
+ declaration: DeclarationType<"font-size">,
2247
+ builder: StylesheetBuilder,
2248
+ ) {
2249
+ const fontSize = parseFontSize(declaration.value, builder);
2250
+ builder.addDescriptor("fontSize", fontSize);
2251
+ builder.addDescriptor("--__rn-css-em", fontSize);
2252
+ }
2253
+
2254
+ export function parseFontSize(value: FontSize, builder: StylesheetBuilder) {
2255
+ switch (value.type) {
2256
+ case "length":
2257
+ return parseLength(value.value, builder);
2258
+ case "absolute":
2259
+ case "relative":
2260
+ builder.addWarning("value", value.value);
2261
+ return undefined;
2262
+ default: {
2263
+ value satisfies never;
2264
+ }
2265
+ }
2266
+
2267
+ return;
2268
+ }
2269
+
2270
+ export function parseFontStyleDeclaration(
2271
+ declaration: DeclarationType<"font-style">,
2272
+ builder: StylesheetBuilder,
2273
+ ) {
2274
+ return parseFontStyle(declaration.value, builder);
2275
+ }
2276
+
2277
+ export function parseFontStyle(value: FontStyle, builder: StylesheetBuilder) {
2278
+ switch (value.type) {
2279
+ case "normal":
2280
+ case "italic":
2281
+ return value.type;
2282
+ case "oblique":
2283
+ builder.addWarning("value", value.type);
2284
+ return undefined;
2285
+ default: {
2286
+ value satisfies never;
2287
+ }
2288
+ }
2289
+
2290
+ return;
2291
+ }
2292
+
2293
+ export function parseFontVariantCapsDeclaration(
2294
+ declaration: DeclarationType<"font-variant-caps">,
2295
+ builder: StylesheetBuilder,
2296
+ ) {
2297
+ return parseFontVariantCaps(declaration.value, builder);
2298
+ }
2299
+
2300
+ export function parseFontVariantCaps(
2301
+ value: FontVariantCaps,
2302
+ builder: StylesheetBuilder,
2303
+ ) {
2304
+ const allowed = new Set([
2305
+ "small-caps",
2306
+ "oldstyle-nums",
2307
+ "lining-nums",
2308
+ "tabular-nums",
2309
+ "proportional-nums",
2310
+ ]);
2311
+ if (allowed.has(value)) {
2312
+ return value;
2313
+ }
2314
+
2315
+ builder.addWarning("value", value);
2316
+ return undefined;
2317
+ }
2318
+
2319
+ export function parseLengthOrCoercePercentageToRuntime(
2320
+ value: Length | DimensionPercentageFor_LengthValue | NumberOrPercentage,
2321
+ builder: StylesheetBuilder,
2322
+ ): StyleDescriptor {
2323
+ return parseLength(value, builder);
2324
+ }
2325
+
2326
+ export function parseGap(
2327
+ declaration: DeclarationType<"gap" | "column-gap" | "row-gap">,
2328
+ builder: StylesheetBuilder,
2329
+ ) {
2330
+ if ("column" in declaration.value) {
2331
+ const row = parseGapValue(declaration.value.row, builder);
2332
+ const column = parseGapValue(declaration.value.column, builder);
2333
+
2334
+ if (row !== column) {
2335
+ builder.addDescriptor("row-gap", row);
2336
+ builder.addDescriptor("column-gap", column);
2337
+ } else {
2338
+ builder.addDescriptor("gap", row);
2339
+ }
2340
+ } else if (declaration.value.type === "normal") {
2341
+ builder.addWarning("value", declaration.value.type);
2342
+ } else {
2343
+ return parseLength(declaration.value.value, builder);
2344
+ }
2345
+
2346
+ return;
2347
+ }
2348
+
2349
+ function parseGapValue(
2350
+ value: GapValue,
2351
+ builder: StylesheetBuilder,
2352
+ ): StyleDescriptor {
2353
+ if (value.type === "normal") {
2354
+ return;
2355
+ } else {
2356
+ return parseLength(value.value, builder);
2357
+ }
2358
+ }
2359
+
2360
+ export function parseTextAlign(
2361
+ { value }: DeclarationType<"text-align">,
2362
+ builder: StylesheetBuilder,
2363
+ ) {
2364
+ const allowed = new Set(["auto", "left", "right", "center", "justify"]);
2365
+ if (allowed.has(value)) {
2366
+ return value;
2367
+ }
2368
+
2369
+ builder.addWarning("value", value);
2370
+ return undefined;
2371
+ }
2372
+
2373
+ export function parseBoxShadow(
2374
+ { value }: DeclarationType<"box-shadow">,
2375
+ builder: StylesheetBuilder,
2376
+ ) {
2377
+ for (const [index, shadow] of value.entries()) {
2378
+ builder.addDescriptor(
2379
+ `&.boxShadow.[${index}].color`,
2380
+ parseColor(shadow.color, builder),
2381
+ );
2382
+ builder.addDescriptor(
2383
+ `&.boxShadow.[${index}].offsetX`,
2384
+ parseLength(shadow.xOffset, builder),
2385
+ );
2386
+ builder.addDescriptor(
2387
+ `&.boxShadow.[${index}].offsetY`,
2388
+ parseLength(shadow.yOffset, builder),
2389
+ );
2390
+ builder.addDescriptor(
2391
+ `&.boxShadow.[${index}].blurRadius`,
2392
+ parseLength(shadow.blur, builder),
2393
+ );
2394
+ builder.addDescriptor(
2395
+ `&.boxShadow.[${index}].spreadDistance`,
2396
+ parseLength(shadow.spread, builder),
2397
+ );
2398
+ builder.addDescriptor(
2399
+ `&.boxShadow.[${index}].inset`,
2400
+ shadow.inset ? true : undefined,
2401
+ );
2402
+ }
2403
+ }
2404
+
2405
+ export function parseBoxSizing(
2406
+ declaration: DeclarationType<"box-sizing">,
2407
+ builder: StylesheetBuilder,
2408
+ ) {
2409
+ if (["border-box", "content-box"].includes(declaration.value)) {
2410
+ return declaration.value;
2411
+ }
2412
+
2413
+ builder.addWarning("value", declaration.value);
2414
+ return undefined;
2415
+ }
2416
+
2417
+ export function parseDisplay(
2418
+ { value }: DeclarationType<"display">,
2419
+ builder: StylesheetBuilder,
2420
+ ) {
2421
+ if (value.type === "keyword") {
2422
+ if (value.value === "none" || value.value === "contents") {
2423
+ return value.value;
2424
+ } else {
2425
+ builder.addWarning("value", value.value);
2426
+ return;
2427
+ }
2428
+ } else {
2429
+ if (value.outside === "block") {
2430
+ switch (value.inside.type) {
2431
+ case "flow":
2432
+ if (value.isListItem) {
2433
+ builder.addWarning("value", "list-item");
2434
+ } else {
2435
+ builder.addWarning("value", "block");
2436
+ }
2437
+ return;
2438
+ case "flex":
2439
+ return value.inside.type;
2440
+ case "flow-root":
2441
+ case "table":
2442
+ case "box":
2443
+ case "grid":
2444
+ case "ruby":
2445
+ builder.addWarning("value", value.inside.type);
2446
+ return;
2447
+ }
2448
+ } else {
2449
+ switch (value.inside.type) {
2450
+ case "flow":
2451
+ builder.addWarning("value", "inline");
2452
+ return;
2453
+ case "flow-root":
2454
+ builder.addWarning("value", "inline-block");
2455
+ return;
2456
+ case "table":
2457
+ builder.addWarning("value", "inline-table");
2458
+ return;
2459
+ case "flex":
2460
+ builder.addWarning("value", "inline-flex");
2461
+ return;
2462
+ case "box":
2463
+ case "grid":
2464
+ builder.addWarning("value", "inline-grid");
2465
+ return;
2466
+ case "ruby":
2467
+ builder.addWarning("value", value.inside.type);
2468
+ return;
2469
+ }
2470
+ }
2471
+ }
2472
+ }
2473
+
2474
+ export function parseDirection(
2475
+ declaration: DeclarationType<"direction">,
2476
+ builder: StylesheetBuilder,
2477
+ ) {
2478
+ if (["ltr", "rtl"].includes(declaration.value)) {
2479
+ builder.addDescriptor("direction", declaration.value);
2480
+ builder.addDescriptor("--__rn-css-direction", declaration.value);
2481
+ }
2482
+
2483
+ builder.addWarning("value", declaration.value);
2484
+ return;
2485
+ }
2486
+
2487
+ export function parseAspectRatio({
2488
+ value,
2489
+ }: DeclarationType<"aspect-ratio">): StyleDescriptor {
2490
+ if (!value.ratio) {
2491
+ return;
2492
+ } else if (value.auto) {
2493
+ return "auto";
2494
+ } else {
2495
+ const [width, height] = value.ratio;
2496
+ if (width === height) {
2497
+ return 1;
2498
+ } else {
2499
+ return `${width}/${height}`;
2500
+ }
2501
+ }
2502
+ }
2503
+
2504
+ export function parseBackfaceVisibility(
2505
+ { value }: DeclarationType<"backface-visibility">,
2506
+ builder: StylesheetBuilder,
2507
+ ): StyleDescriptor {
2508
+ if (["visible", "hidden"].includes(value)) {
2509
+ return value;
2510
+ } else {
2511
+ builder.addWarning("value", value);
2512
+ return;
2513
+ }
2514
+ }
2515
+
2516
+ export function parseDimension(
2517
+ { unit, value }: Extract<Token, { type: "dimension" }>,
2518
+ builder: StylesheetBuilder,
2519
+ ): StyleDescriptor {
2520
+ switch (unit) {
2521
+ case "px":
2522
+ if (value === Infinity) {
2523
+ return 9999;
2524
+ } else {
2525
+ return value;
2526
+ }
2527
+ case "%":
2528
+ return `${value}%`;
2529
+ case "rnh":
2530
+ case "rnw":
2531
+ return [{}, unit, [value / 100], 1];
2532
+ default: {
2533
+ builder.addWarning("value", `${value}${unit}`);
2534
+ return;
2535
+ }
2536
+ }
2537
+ }
2538
+
2539
+ export function parseUserSelect(
2540
+ { value }: DeclarationType<"user-select">,
2541
+ builder: StylesheetBuilder,
2542
+ ) {
2543
+ const allowed = ["auto", "text", "none", "contain", "all"];
2544
+ if (allowed.includes(value)) {
2545
+ return value;
2546
+ } else {
2547
+ builder.addWarning("value", value);
2548
+ return;
2549
+ }
2550
+ }
2551
+
2552
+ export function parseSVGPaint(
2553
+ { value, property }: DeclarationType<"fill" | "stroke">,
2554
+ builder: StylesheetBuilder,
2555
+ ) {
2556
+ let parsedValue: StyleDescriptor | undefined;
2557
+
2558
+ if (value.type === "none") {
2559
+ parsedValue = "transparent";
2560
+ } else if (value.type === "color") {
2561
+ parsedValue = parseColor(value.value, builder);
2562
+ } else {
2563
+ return;
2564
+ }
2565
+
2566
+ builder.addDescriptor(property, parsedValue);
2567
+ }
2568
+
2569
+ export function round(number: number) {
2570
+ return Math.round((number + Number.EPSILON) * 10000) / 10000;
2571
+ }
2572
+
2573
+ export function parseDimensionPercentageFor_LengthValue(
2574
+ value: DimensionPercentageFor_LengthValue,
2575
+ builder: StylesheetBuilder,
2576
+ ) {
2577
+ if (value.type === "calc") {
2578
+ return undefined;
2579
+ } else if (value.type === "percentage") {
2580
+ return `${value.value}%`;
2581
+ } else {
2582
+ return parseLength(value.value, builder);
2583
+ }
2584
+ }
2585
+
2586
+ const allowAutoProperties = new Set(["pointer-events"]);
2587
+
2588
+ export function parseEnv(
2589
+ value: EnvironmentVariable,
2590
+ builder: StylesheetBuilder,
2591
+ ): StyleFunction | undefined {
2592
+ switch (value.name.type) {
2593
+ case "ua":
2594
+ switch (value.name.value) {
2595
+ case "safe-area-inset-top":
2596
+ case "safe-area-inset-right":
2597
+ case "safe-area-inset-bottom":
2598
+ case "safe-area-inset-left": {
2599
+ const fallback = parseUnparsed(
2600
+ value.fallback,
2601
+ builder,
2602
+ value.name.value,
2603
+ );
2604
+
2605
+ return fallback
2606
+ ? [{}, "var", [`react-native-css-${value.name.value}`, fallback], 1]
2607
+ : [{}, "var", [`react-native-css-${value.name.value}`], 1];
2608
+ }
2609
+ case "viewport-segment-width":
2610
+ case "viewport-segment-height":
2611
+ case "viewport-segment-top":
2612
+ case "viewport-segment-left":
2613
+ case "viewport-segment-bottom":
2614
+ case "viewport-segment-right":
2615
+ }
2616
+ break;
2617
+ case "custom":
2618
+ case "unknown":
2619
+ }
2620
+
2621
+ return;
2622
+ }
2623
+
2624
+ export function parseCalcFn(
2625
+ name: string,
2626
+ tokens: TokenOrValue[],
2627
+ builder: StylesheetBuilder,
2628
+ property: string,
2629
+ ): StyleDescriptor {
2630
+ const args = parseCalcArguments(tokens, builder, property);
2631
+ if (args) {
2632
+ return [{}, name, args];
2633
+ }
2634
+
2635
+ return;
2636
+ }
2637
+
2638
+ export function parseColorMix(
2639
+ tokens: TokenOrValue[],
2640
+ builder: StylesheetBuilder,
2641
+ property: string,
2642
+ ): StyleDescriptor {
2643
+ const [inToken, whitespace, colorSpace, comma, ...rest] = tokens;
2644
+ if (
2645
+ typeof inToken !== "object" ||
2646
+ inToken.type !== "token" ||
2647
+ inToken.value.type !== "ident" ||
2648
+ inToken.value.value !== "in"
2649
+ ) {
2650
+ return;
2651
+ }
2652
+
2653
+ if (
2654
+ typeof whitespace !== "object" ||
2655
+ whitespace.type !== "token" ||
2656
+ whitespace.value.type !== "white-space"
2657
+ ) {
2658
+ return;
2659
+ }
2660
+
2661
+ if (
2662
+ typeof comma !== "object" ||
2663
+ comma.type !== "token" ||
2664
+ comma.value.type !== "comma"
2665
+ ) {
2666
+ return;
2667
+ }
2668
+
2669
+ const colorSpaceArg = parseUnparsed(colorSpace, builder, property);
2670
+ if (typeof colorSpaceArg !== "string") {
2671
+ return;
2672
+ }
2673
+
2674
+ let nextToken = rest.shift();
2675
+
2676
+ const leftColorArg = parseUnparsed(nextToken, builder, property);
2677
+
2678
+ if (!leftColorArg) {
2679
+ return;
2680
+ }
2681
+
2682
+ nextToken = rest.shift();
2683
+
2684
+ let leftColorPercentage: StyleDescriptor | undefined;
2685
+ if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
2686
+ leftColorPercentage = parseUnparsed(nextToken, builder, property);
2687
+ nextToken = rest.shift();
2688
+ }
2689
+
2690
+ if (
2691
+ typeof nextToken !== "object" ||
2692
+ nextToken.type !== "token" ||
2693
+ nextToken.value.type !== "comma"
2694
+ ) {
2695
+ return;
2696
+ }
2697
+
2698
+ nextToken = rest.shift();
2699
+
2700
+ const rightColorArg = parseUnparsed(nextToken, builder, property);
2701
+
2702
+ if (rightColorArg === "transparent") {
2703
+ // Ignore the rest, treat as single color with alpha
2704
+ return [{}, "colorMix", [colorSpaceArg, leftColorArg, leftColorPercentage]];
2705
+ }
2706
+
2707
+ nextToken = rest.shift();
2708
+ let rightColorPercentage: StyleDescriptor | undefined;
2709
+ if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
2710
+ rightColorPercentage = parseUnparsed(nextToken, builder, property);
2711
+ nextToken = rest.shift();
2712
+ }
2713
+
2714
+ // We should have expired all tokens now
2715
+ if (nextToken) {
2716
+ return;
2717
+ }
2718
+
2719
+ return [
2720
+ {},
2721
+ "colorMix",
2722
+ [
2723
+ colorSpaceArg,
2724
+ leftColorArg,
2725
+ leftColorPercentage,
2726
+ rightColorArg,
2727
+ rightColorPercentage,
2728
+ ],
2729
+ ];
2730
+ }
2731
+
2732
+ export function parseCalcArguments(
2733
+ [...args]: TokenOrValue[],
2734
+ builder: StylesheetBuilder,
2735
+ property: string,
2736
+ ) {
2737
+ const parsed: StyleDescriptor[] = [];
2738
+
2739
+ for (const arg of args) {
2740
+ switch (arg.type) {
2741
+ case "env": {
2742
+ parsed.push(parseEnv(arg.value, builder));
2743
+ break;
2744
+ }
2745
+ case "var":
2746
+ case "function":
2747
+ case "unresolved-color": {
2748
+ const value = parseUnparsed(arg, builder, property);
2749
+
2750
+ if (value === undefined) {
2751
+ return undefined;
2752
+ }
2753
+
2754
+ parsed.push(value);
2755
+ break;
2756
+ }
2757
+ case "length": {
2758
+ const value = parseLength(arg.value, builder);
2759
+ if (value !== undefined) {
2760
+ parsed.push(value);
2761
+ }
2762
+ break;
2763
+ }
2764
+ case "color":
2765
+ case "url":
2766
+ case "angle":
2767
+ case "time":
2768
+ case "resolution":
2769
+ case "dashed-ident":
2770
+ break;
2771
+ case "token":
2772
+ switch (arg.value.type) {
2773
+ case "delim":
2774
+ switch (arg.value.value) {
2775
+ case "+":
2776
+ case "-":
2777
+ case "*":
2778
+ case "/":
2779
+ parsed.push(arg.value.value);
2780
+ break;
2781
+ }
2782
+ break;
2783
+ case "percentage":
2784
+ parsed.push(`${round(arg.value.value * 100)}%`);
2785
+ break;
2786
+ case "number": {
2787
+ parsed.push(round(arg.value.value));
2788
+ break;
2789
+ }
2790
+ case "parenthesis-block": {
2791
+ parsed.push("(");
2792
+ break;
2793
+ }
2794
+ case "close-parenthesis":
2795
+ parsed.push(")");
2796
+ break;
2797
+ case "string":
2798
+ case "function":
2799
+ case "ident":
2800
+ case "at-keyword":
2801
+ case "hash":
2802
+ case "id-hash":
2803
+ case "unquoted-url":
2804
+ case "dimension":
2805
+ case "white-space":
2806
+ case "comment":
2807
+ case "colon":
2808
+ case "semicolon":
2809
+ case "comma":
2810
+ case "include-match":
2811
+ case "dash-match":
2812
+ case "prefix-match":
2813
+ case "suffix-match":
2814
+ case "substring-match":
2815
+ case "cdo":
2816
+ case "cdc":
2817
+ case "square-bracket-block":
2818
+ case "curly-bracket-block":
2819
+ case "bad-url":
2820
+ case "bad-string":
2821
+ case "close-square-bracket":
2822
+ case "close-curly-bracket":
2823
+ }
2824
+ }
2825
+ }
2826
+
2827
+ return parsed;
2828
+ }
2829
+
2830
+ export function parseTranslateProp(
2831
+ value: Translate,
2832
+ prop: keyof Extract<Translate, object>,
2833
+ builder: StylesheetBuilder,
2834
+ ): StyleDescriptor {
2835
+ if (value === "none") {
2836
+ return 0;
2837
+ }
2838
+
2839
+ return parseLength(value[prop], builder);
2840
+ }
2841
+
2842
+ export function parseUnresolvedColor(
2843
+ color: UnresolvedColor,
2844
+ builder: StylesheetBuilder,
2845
+ property: string,
2846
+ allowAuto: boolean,
2847
+ ): StyleDescriptor {
2848
+ switch (color.type) {
2849
+ case "rgb":
2850
+ return [
2851
+ {},
2852
+ "rgba",
2853
+ [
2854
+ round(color.r * 255),
2855
+ round(color.g * 255),
2856
+ round(color.b * 255),
2857
+ parseUnparsed(color.alpha, builder, property),
2858
+ ],
2859
+ ];
2860
+ case "hsl":
2861
+ return [
2862
+ {},
2863
+ color.type,
2864
+ [
2865
+ color.h,
2866
+ color.s,
2867
+ color.l,
2868
+ parseUnparsed(color.alpha, builder, property),
2869
+ ],
2870
+ ];
2871
+ case "light-dark": {
2872
+ const extraRule = builder.extendRule({
2873
+ m: [["=", "prefers-color-scheme", "dark"]],
2874
+ });
2875
+ builder.addUnnamedDescriptor(
2876
+ reduceParseUnparsed(color.dark, builder, property, allowAuto),
2877
+ false,
2878
+ extraRule,
2879
+ );
2880
+ builder.addExtraRule(extraRule);
2881
+ return reduceParseUnparsed(color.light, builder, property, allowAuto);
2882
+ }
2883
+ default:
2884
+ color satisfies never;
2885
+ }
2886
+
2887
+ return;
2888
+ }
2889
+
2890
+ export function allEqual(...params: unknown[]) {
2891
+ return params.every((param, index, array) => {
2892
+ return index === 0 ? true : equal(array[0], param);
2893
+ });
2894
+ }
2895
+ export function equal(a: unknown, b: unknown) {
2896
+ if (a === b) return true;
2897
+ if (typeof a !== typeof b) return false;
2898
+ if (a === null || b === null) return false;
2899
+ if (Array.isArray(a) && Array.isArray(b)) {
2900
+ if (a.length !== b.length) return false;
2901
+ for (let i = 0; i < a.length; i++) {
2902
+ if (!equal(a[i], b[i])) return false;
2903
+ }
2904
+ return true;
2905
+ }
2906
+ if (typeof a === "object" && typeof b === "object") {
2907
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
2908
+ for (const key in a) {
2909
+ if (
2910
+ !equal(
2911
+ (a as Record<string, unknown>)[key],
2912
+ (b as Record<string, unknown>)[key],
2913
+ )
2914
+ )
2915
+ return false;
2916
+ }
2917
+ return true;
2918
+ }
2919
+
2920
+ return false;
2921
+ }
2922
+
2923
+ export function parseTime(time: Time) {
2924
+ return round(time.type === "milliseconds" ? time.value : time.value * 1000);
2925
+ }
2926
+
2927
+ export function parseSize2DDimensionPercentageDeclaration(
2928
+ declaration: { value: Size2DFor_DimensionPercentageFor_LengthValue },
2929
+ builder: StylesheetBuilder,
2930
+ ) {
2931
+ return parseSize2DDimensionPercentage(declaration.value, builder);
2932
+ }
2933
+
2934
+ export function parseSize2DDimensionPercentage(
2935
+ value: Size2DFor_DimensionPercentageFor_LengthValue,
2936
+ builder: StylesheetBuilder,
2937
+ ) {
2938
+ return parseLength(value[0], builder);
2939
+ }
2940
+
2941
+ export function addTransitionValue(
2942
+ declaration: Extract<
2943
+ Declaration,
2944
+ { property: `transition${string}` | "transition" }
2945
+ >,
2946
+ builder: StylesheetBuilder,
2947
+ ) {
2948
+ switch (declaration.property) {
2949
+ case "transition": {
2950
+ const grouped: Record<string, unknown[]> = {};
2951
+
2952
+ for (const animation of declaration.value) {
2953
+ for (const [key, value] of Object.entries(animation)) {
2954
+ grouped[key] ??= [];
2955
+ grouped[key].push(value);
2956
+ }
2957
+ }
2958
+
2959
+ for (const [property, value] of Object.entries(grouped)) {
2960
+ addTransitionValue(
2961
+ {
2962
+ property: `transition-${kebabCase(property)}`,
2963
+ value,
2964
+ } as Extract<
2965
+ Declaration,
2966
+ { property: `transition${string}` | "transition" }
2967
+ >,
2968
+ builder,
2969
+ );
2970
+ }
2971
+ break;
2972
+ }
2973
+ case "transition-property": {
2974
+ builder.addDescriptor(
2975
+ declaration.property,
2976
+ declaration.value
2977
+ .map((v) => v.property)
2978
+ .filter(
2979
+ (v) =>
2980
+ (v in parsers && !["visibility"].includes(v)) ||
2981
+ v === "all" ||
2982
+ v === "none",
2983
+ )
2984
+ .map((v) => toRNProperty(v)),
2985
+ );
2986
+ return;
2987
+ }
2988
+ case "transition-duration":
2989
+ builder.addDescriptor(
2990
+ declaration.property,
2991
+ declaration.value.map((t) => parseTime(t)),
2992
+ );
2993
+ return;
2994
+ case "transition-delay":
2995
+ builder.addDescriptor(
2996
+ declaration.property,
2997
+ declaration.value.map((t) => parseTime(t)),
2998
+ );
2999
+ return;
3000
+ case "transition-timing-function":
3001
+ builder.addDescriptor(
3002
+ declaration.property,
3003
+ parseEasingFunction(declaration.value),
3004
+ );
3005
+ return;
3006
+ }
3007
+ }
3008
+
3009
+ export function addAnimationValue(
3010
+ declaration: Extract<
3011
+ Declaration,
3012
+ { property: `animation${string}` | "animation" }
3013
+ >,
3014
+ builder: StylesheetBuilder,
3015
+ ) {
3016
+ switch (declaration.property) {
3017
+ case "animation": {
3018
+ const grouped: Record<string, unknown[]> = {};
3019
+
3020
+ for (const animation of declaration.value) {
3021
+ for (const [key, value] of Object.entries(animation)) {
3022
+ grouped[key] ??= [];
3023
+ grouped[key].push(value);
3024
+ }
3025
+ }
3026
+
3027
+ for (const [property, value] of Object.entries(grouped)) {
3028
+ addAnimationValue(
3029
+ {
3030
+ property: `animation-${kebabCase(property)}`,
3031
+ value,
3032
+ } as Extract<
3033
+ Declaration,
3034
+ { property: `animation${string}` | "animation" }
3035
+ >,
3036
+ builder,
3037
+ );
3038
+ }
3039
+ break;
3040
+ }
3041
+ case "animation-delay": {
3042
+ builder.addDescriptor(
3043
+ declaration.property,
3044
+ declaration.value.map((t) => parseTime(t)),
3045
+ );
3046
+ break;
3047
+ }
3048
+ case "animation-direction": {
3049
+ builder.addDescriptor(declaration.property, declaration.value);
3050
+ break;
3051
+ }
3052
+ case "animation-duration": {
3053
+ builder.addDescriptor(
3054
+ declaration.property,
3055
+ declaration.value.map((t) => parseTime(t)),
3056
+ );
3057
+ break;
3058
+ }
3059
+ case "animation-fill-mode": {
3060
+ builder.addDescriptor(declaration.property, declaration.value);
3061
+ break;
3062
+ }
3063
+ case "animation-iteration-count": {
3064
+ builder.addDescriptor(
3065
+ declaration.property,
3066
+ parseIterationCount(declaration.value),
3067
+ );
3068
+ break;
3069
+ }
3070
+ case "animation-name": {
3071
+ builder.addDescriptor(
3072
+ declaration.property,
3073
+ declaration.value.map((v) =>
3074
+ v.type === "none"
3075
+ ? "none"
3076
+ : ([{}, "animationName", [v.value], 1] as StyleDescriptor),
3077
+ ),
3078
+ );
3079
+ break;
3080
+ }
3081
+ case "animation-play-state": {
3082
+ builder.addDescriptor(declaration.property, declaration.value);
3083
+ break;
3084
+ }
3085
+ case "animation-timing-function": {
3086
+ builder.addDescriptor(
3087
+ declaration.property,
3088
+ parseEasingFunction(declaration.value),
3089
+ );
3090
+ break;
3091
+ }
3092
+ }
3093
+ }
3094
+
3095
+ export function kebabCase(str: string) {
3096
+ return str.replace(
3097
+ /[A-Z]+(?![a-z])|[A-Z]/g,
3098
+ ($, ofs) => (ofs ? "-" : "") + $.toLowerCase(),
3099
+ );
3100
+ }
3101
+
3102
+ function parseBackgroundImage(
3103
+ declaration: DeclarationType<"background-image">,
3104
+ builder: StylesheetBuilder,
3105
+ ) {
3106
+ builder.addDescriptor(
3107
+ "experimental_backgroundImage",
3108
+ declaration.value.flatMap((image): StyleDescriptor[] => {
3109
+ switch (image.type) {
3110
+ case "gradient": {
3111
+ const gradient = parseGradient(image.value, builder);
3112
+ return gradient ? [gradient] : [];
3113
+ }
3114
+ case "none":
3115
+ return ["none"];
3116
+ }
3117
+
3118
+ return [];
3119
+ }),
3120
+ );
3121
+ return;
3122
+ }
3123
+
3124
+ function parseGradient(
3125
+ gradient: Gradient,
3126
+ builder: StylesheetBuilder,
3127
+ ): StyleDescriptor {
3128
+ switch (gradient.type) {
3129
+ case "linear": {
3130
+ return [
3131
+ {},
3132
+ "linear-gradient",
3133
+ [
3134
+ parseLineDirection(gradient.direction, builder),
3135
+ ...gradient.items.map((item) => parseGradientItem(item, builder)),
3136
+ ],
3137
+ ];
3138
+ }
3139
+ }
3140
+
3141
+ return;
3142
+ }
3143
+
3144
+ function parseLineDirection(
3145
+ lineDirection: LineDirection,
3146
+ builder: StylesheetBuilder,
3147
+ ): StyleDescriptor {
3148
+ switch (lineDirection.type) {
3149
+ case "corner":
3150
+ return `to ${lineDirection.horizontal} ${lineDirection.vertical}`;
3151
+ case "horizontal":
3152
+ case "vertical":
3153
+ return `to ${lineDirection.value}`;
3154
+ case "angle":
3155
+ return parseAngle(lineDirection.value, builder);
3156
+ default: {
3157
+ lineDirection satisfies never;
3158
+ }
3159
+ }
3160
+
3161
+ return;
3162
+ }
3163
+
3164
+ function parseGradientItem(
3165
+ item: GradientItemFor_DimensionPercentageFor_LengthValue,
3166
+ builder: StylesheetBuilder,
3167
+ ): StyleDescriptor {
3168
+ switch (item.type) {
3169
+ case "color-stop": {
3170
+ const args: StyleDescriptor[] = [parseColor(item.color, builder)];
3171
+ if (item.position) {
3172
+ args.push(parseLength(item.position, builder));
3173
+ }
3174
+
3175
+ return [{}, "@colorStop", args, 1];
3176
+ }
3177
+ case "hint":
3178
+ return parseLength(item.value, builder);
3179
+ }
3180
+ }
3181
+
3182
+ function parseObjectFit(
3183
+ declaration: CustomProperty,
3184
+ builder: StylesheetBuilder,
3185
+ ) {
3186
+ builder.addMapping({
3187
+ "object-fit": ["contentFit"],
3188
+ });
3189
+ builder.addDescriptor(
3190
+ "object-fit",
3191
+ parseUnparsed(declaration.value, builder, "object-fit"),
3192
+ );
3193
+ }
3194
+
3195
+ function parseObjectPosition(
3196
+ declaration: CustomProperty,
3197
+ builder: StylesheetBuilder,
3198
+ ) {
3199
+ builder.addMapping({
3200
+ "object-position": ["contentPosition"],
3201
+ });
3202
+ builder.addDescriptor("object-position", [
3203
+ {},
3204
+ "join",
3205
+ [parseUnparsed(declaration.value, builder, "object-position"), " "],
3206
+ ]);
3207
+ }
3208
+
3209
+ function parseCornerShape(
3210
+ declaration: CustomProperty,
3211
+ builder: StylesheetBuilder,
3212
+ ) {
3213
+ const shape = parseUnparsed(declaration.value, builder, "corner-shape");
3214
+
3215
+ if (shape === "round") {
3216
+ builder.addDescriptor("borderCurve", "circular");
3217
+ } else if (shape === "squircle") {
3218
+ builder.addDescriptor("borderCurve", "continuous");
3219
+ }
3220
+ }
3221
+
3222
+ function parseVisibility(
3223
+ declaration: DeclarationType<"visibility">,
3224
+ builder: StylesheetBuilder,
3225
+ ) {
3226
+ if (declaration.value === "visible") {
3227
+ builder.addDescriptor("opacity", 1);
3228
+ } else if (declaration.value === "hidden") {
3229
+ builder.addDescriptor("opacity", 0);
3230
+ } else {
3231
+ builder.addWarning("value", declaration.value);
3232
+ }
3233
+ }
3234
+
3235
+ function parseOutlineStyle(
3236
+ declaration: DeclarationType<"outline-style">,
3237
+ builder: StylesheetBuilder,
3238
+ ) {
3239
+ const allowed = ["solid", "dotted", "dashed"];
3240
+
3241
+ if (
3242
+ declaration.value.type !== "auto" &&
3243
+ allowed.includes(declaration.value.value)
3244
+ ) {
3245
+ builder.addDescriptor("outlineStyle", declaration.value.value);
3246
+ } else {
3247
+ builder.addWarning(
3248
+ "value",
3249
+ declaration.value.type === "auto" ? "auto" : declaration.value.value,
3250
+ );
3251
+ }
3252
+ }
3253
+
3254
+ function parseFilter(
3255
+ declaration: DeclarationType<"filter">,
3256
+ builder: StylesheetBuilder,
3257
+ ) {
3258
+ if (declaration.value.type === "none") {
3259
+ return "unset";
3260
+ }
3261
+
3262
+ return declaration.value.value
3263
+ .map((value) => {
3264
+ switch (value.type) {
3265
+ case "opacity":
3266
+ case "blur":
3267
+ case "brightness":
3268
+ case "contrast":
3269
+ case "grayscale":
3270
+ case "invert":
3271
+ case "saturate":
3272
+ case "sepia":
3273
+ return {
3274
+ [value.type]: parseLength(value.value, builder),
3275
+ } as unknown as StyleDescriptor;
3276
+ case "hue-rotate":
3277
+ return {
3278
+ [value.type]: parseAngle(value.value, builder),
3279
+ } as unknown as StyleDescriptor;
3280
+ case "drop-shadow":
3281
+ return [
3282
+ {},
3283
+ toRNProperty(value.type),
3284
+ [
3285
+ parseLength(value.value.xOffset, builder),
3286
+ parseLength(value.value.yOffset, builder),
3287
+ parseLength(value.value.blur, builder),
3288
+ parseColor(value.value.color, builder),
3289
+ ],
3290
+ ] as unknown as StyleDescriptor;
3291
+ case "url":
3292
+ return;
3293
+ }
3294
+ })
3295
+ .filter((value) => value !== undefined);
3296
+ }
3297
+
3298
+ const namedColors = new Set([
3299
+ "aliceblue",
3300
+ "antiquewhite",
3301
+ "aqua",
3302
+ "aquamarine",
3303
+ "azure",
3304
+ "beige",
3305
+ "bisque",
3306
+ "black",
3307
+ "blanchedalmond",
3308
+ "blue",
3309
+ "blueviolet",
3310
+ "brown",
3311
+ "burlywood",
3312
+ "cadetblue",
3313
+ "chartreuse",
3314
+ "chocolate",
3315
+ "coral",
3316
+ "cornflowerblue",
3317
+ "cornsilk",
3318
+ "crimson",
3319
+ "cyan",
3320
+ "darkblue",
3321
+ "darkcyan",
3322
+ "darkgoldenrod",
3323
+ "darkgray",
3324
+ "darkgreen",
3325
+ "darkgrey",
3326
+ "darkkhaki",
3327
+ "darkmagenta",
3328
+ "darkolivegreen",
3329
+ "darkorange",
3330
+ "darkorchid",
3331
+ "darkred",
3332
+ "darksalmon",
3333
+ "darkseagreen",
3334
+ "darkslateblue",
3335
+ "darkslategrey",
3336
+ "darkturquoise",
3337
+ "darkviolet",
3338
+ "deeppink",
3339
+ "deepskyblue",
3340
+ "dimgray",
3341
+ "dimgrey",
3342
+ "dodgerblue",
3343
+ "firebrick",
3344
+ "floralwhite",
3345
+ "forestgreen",
3346
+ "fuchsia",
3347
+ "gainsboro",
3348
+ "ghostwhite",
3349
+ "gold",
3350
+ "goldenrod",
3351
+ "gray",
3352
+ "green",
3353
+ "greenyellow",
3354
+ "grey",
3355
+ "honeydew",
3356
+ "hotpink",
3357
+ "indianred",
3358
+ "indigo",
3359
+ "ivory",
3360
+ "khaki",
3361
+ "lavender",
3362
+ "lavenderblush",
3363
+ "lawngreen",
3364
+ "lemonchiffon",
3365
+ "lightblue",
3366
+ "lightcoral",
3367
+ "lightcyan",
3368
+ "lightgoldenrodyellow",
3369
+ "lightgray",
3370
+ "lightgreen",
3371
+ "lightgrey",
3372
+ "lightpink",
3373
+ "lightsalmon",
3374
+ "lightseagreen",
3375
+ "lightskyblue",
3376
+ "lightslategrey",
3377
+ "lightsteelblue",
3378
+ "lightyellow",
3379
+ "lime",
3380
+ "limegreen",
3381
+ "linen",
3382
+ "magenta",
3383
+ "maroon",
3384
+ "mediumaquamarine",
3385
+ "mediumblue",
3386
+ "mediumorchid",
3387
+ "mediumpurple",
3388
+ "mediumseagreen",
3389
+ "mediumslateblue",
3390
+ "mediumspringgreen",
3391
+ "mediumturquoise",
3392
+ "mediumvioletred",
3393
+ "midnightblue",
3394
+ "mintcream",
3395
+ "mistyrose",
3396
+ "moccasin",
3397
+ "navajowhite",
3398
+ "navy",
3399
+ "oldlace",
3400
+ "olive",
3401
+ "olivedrab",
3402
+ "orange",
3403
+ "orangered",
3404
+ "orchid",
3405
+ "palegoldenrod",
3406
+ "palegreen",
3407
+ "paleturquoise",
3408
+ "palevioletred",
3409
+ "papayawhip",
3410
+ "peachpuff",
3411
+ "peru",
3412
+ "pink",
3413
+ "plum",
3414
+ "powderblue",
3415
+ "purple",
3416
+ "rebeccapurple",
3417
+ "red",
3418
+ "rosybrown",
3419
+ "royalblue",
3420
+ "saddlebrown",
3421
+ "salmon",
3422
+ "sandybrown",
3423
+ "seagreen",
3424
+ "seashell",
3425
+ "sienna",
3426
+ "silver",
3427
+ "skyblue",
3428
+ "slateblue",
3429
+ "slategray",
3430
+ "snow",
3431
+ "springgreen",
3432
+ "steelblue",
3433
+ "tan",
3434
+ "teal",
3435
+ "thistle",
3436
+ "tomato",
3437
+ "turquoise",
3438
+ "violet",
3439
+ "wheat",
3440
+ "white",
3441
+ "whitesmoke",
3442
+ "yellow",
3443
+ "yellowgreen",
3444
+ ]);