@hanzogui/react-native-web-internals 2.0.0-rc.41-hanzoai.5

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 (420) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +265 -0
  3. package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +419 -0
  4. package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +160 -0
  5. package/dist/cjs/StyleSheet/__tests__/index-test.cjs +436 -0
  6. package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +121 -0
  7. package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +51 -0
  8. package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +160 -0
  9. package/dist/cjs/StyleSheet/compiler/hash.cjs +28 -0
  10. package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +40 -0
  11. package/dist/cjs/StyleSheet/compiler/index.cjs +379 -0
  12. package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +36 -0
  13. package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +50 -0
  14. package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +52 -0
  15. package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +52 -0
  16. package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +135 -0
  17. package/dist/cjs/StyleSheet/dom/index.cjs +89 -0
  18. package/dist/cjs/StyleSheet/index.cjs +64 -0
  19. package/dist/cjs/StyleSheet/preprocess.cjs +114 -0
  20. package/dist/cjs/StyleSheet/validate.cjs +92 -0
  21. package/dist/cjs/TextAncestorContext.cjs +29 -0
  22. package/dist/cjs/colorProps.cjs +39 -0
  23. package/dist/cjs/index.cjs +105 -0
  24. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +57 -0
  25. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +46 -0
  26. package/dist/cjs/modules/AccessibilityUtil/index.cjs +35 -0
  27. package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +28 -0
  28. package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +64 -0
  29. package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +51 -0
  30. package/dist/cjs/modules/AssetRegistry/index.cjs +35 -0
  31. package/dist/cjs/modules/ImageLoader/index.cjs +157 -0
  32. package/dist/cjs/modules/InteractionManager.cjs +240 -0
  33. package/dist/cjs/modules/Platform/__tests__/index-test.cjs +56 -0
  34. package/dist/cjs/modules/Platform/index.cjs +32 -0
  35. package/dist/cjs/modules/TextInputState/index.cjs +70 -0
  36. package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +111 -0
  37. package/dist/cjs/modules/UIManager/index.cjs +65 -0
  38. package/dist/cjs/modules/canUseDOM.cjs +28 -0
  39. package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +177 -0
  40. package/dist/cjs/modules/createDOMProps/index.cjs +387 -0
  41. package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +422 -0
  42. package/dist/cjs/modules/createEventHandle/index.cjs +88 -0
  43. package/dist/cjs/modules/dismissKeyboard/index.cjs +31 -0
  44. package/dist/cjs/modules/forwardedProps/index.cjs +163 -0
  45. package/dist/cjs/modules/getBoundingClientRect/index.cjs +35 -0
  46. package/dist/cjs/modules/invariant.cjs +42 -0
  47. package/dist/cjs/modules/isSelectionValid/index.cjs +36 -0
  48. package/dist/cjs/modules/isWebColor/index.cjs +28 -0
  49. package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +48 -0
  50. package/dist/cjs/modules/mergeRefs/index.cjs +45 -0
  51. package/dist/cjs/modules/modality/__tests__/index-test.cjs +59 -0
  52. package/dist/cjs/modules/modality/index.cjs +212 -0
  53. package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +38 -0
  54. package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +41 -0
  55. package/dist/cjs/modules/normalizeColor/index.cjs +44 -0
  56. package/dist/cjs/modules/pick/index.cjs +38 -0
  57. package/dist/cjs/modules/processColor/__tests__/index-test.cjs +85 -0
  58. package/dist/cjs/modules/processColor/index.cjs +50 -0
  59. package/dist/cjs/modules/requestIdleCallback/index.cjs +46 -0
  60. package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +55 -0
  61. package/dist/cjs/modules/setValueForStyles/index.cjs +46 -0
  62. package/dist/cjs/modules/unitlessNumbers/index.cjs +89 -0
  63. package/dist/cjs/modules/useElementLayout/index.cjs +44 -0
  64. package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +490 -0
  65. package/dist/cjs/modules/useEvent/index.cjs +57 -0
  66. package/dist/cjs/modules/useHover/__tests__/index-test.cjs +382 -0
  67. package/dist/cjs/modules/useHover/index.cjs +140 -0
  68. package/dist/cjs/modules/useLayoutEffect/index.cjs +41 -0
  69. package/dist/cjs/modules/useLocale/index.cjs +69 -0
  70. package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +88 -0
  71. package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +125 -0
  72. package/dist/cjs/modules/useMergeRefs/index.cjs +45 -0
  73. package/dist/cjs/modules/usePlatformMethods/index.cjs +42 -0
  74. package/dist/cjs/modules/useStable/__tests__/index-test.cjs +122 -0
  75. package/dist/cjs/modules/useStable/index.cjs +47 -0
  76. package/dist/cjs/styleTypes.cjs +18 -0
  77. package/dist/cjs/types.cjs +18 -0
  78. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +242 -0
  79. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +1 -0
  80. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +420 -0
  81. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +1 -0
  82. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +137 -0
  83. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +1 -0
  84. package/dist/esm/StyleSheet/__tests__/index-test.mjs +413 -0
  85. package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +1 -0
  86. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +122 -0
  87. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +1 -0
  88. package/dist/esm/StyleSheet/__tests__/validate-test.mjs +52 -0
  89. package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +1 -0
  90. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +134 -0
  91. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -0
  92. package/dist/esm/StyleSheet/compiler/hash.mjs +3 -0
  93. package/dist/esm/StyleSheet/compiler/hash.mjs.map +1 -0
  94. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +15 -0
  95. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -0
  96. package/dist/esm/StyleSheet/compiler/index.mjs +351 -0
  97. package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -0
  98. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +11 -0
  99. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -0
  100. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +25 -0
  101. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -0
  102. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +27 -0
  103. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -0
  104. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +27 -0
  105. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -0
  106. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +110 -0
  107. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -0
  108. package/dist/esm/StyleSheet/dom/index.mjs +64 -0
  109. package/dist/esm/StyleSheet/dom/index.mjs.map +1 -0
  110. package/dist/esm/StyleSheet/index.mjs +38 -0
  111. package/dist/esm/StyleSheet/index.mjs.map +1 -0
  112. package/dist/esm/StyleSheet/preprocess.mjs +86 -0
  113. package/dist/esm/StyleSheet/preprocess.mjs.map +1 -0
  114. package/dist/esm/StyleSheet/validate.mjs +67 -0
  115. package/dist/esm/StyleSheet/validate.mjs.map +1 -0
  116. package/dist/esm/TextAncestorContext.mjs +4 -0
  117. package/dist/esm/TextAncestorContext.mjs.map +1 -0
  118. package/dist/esm/colorProps.mjs +14 -0
  119. package/dist/esm/colorProps.mjs.map +1 -0
  120. package/dist/esm/index.js +45 -0
  121. package/dist/esm/index.js.map +1 -0
  122. package/dist/esm/index.mjs +45 -0
  123. package/dist/esm/index.mjs.map +1 -0
  124. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +34 -0
  125. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +1 -0
  126. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +23 -0
  127. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +1 -0
  128. package/dist/esm/modules/AccessibilityUtil/index.mjs +10 -0
  129. package/dist/esm/modules/AccessibilityUtil/index.mjs.map +1 -0
  130. package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +3 -0
  131. package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +1 -0
  132. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +39 -0
  133. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -0
  134. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +26 -0
  135. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -0
  136. package/dist/esm/modules/AssetRegistry/index.mjs +9 -0
  137. package/dist/esm/modules/AssetRegistry/index.mjs.map +1 -0
  138. package/dist/esm/modules/ImageLoader/index.mjs +131 -0
  139. package/dist/esm/modules/ImageLoader/index.mjs.map +1 -0
  140. package/dist/esm/modules/InteractionManager.mjs +215 -0
  141. package/dist/esm/modules/InteractionManager.mjs.map +1 -0
  142. package/dist/esm/modules/Platform/__tests__/index-test.mjs +33 -0
  143. package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +1 -0
  144. package/dist/esm/modules/Platform/index.mjs +7 -0
  145. package/dist/esm/modules/Platform/index.mjs.map +1 -0
  146. package/dist/esm/modules/TextInputState/index.mjs +45 -0
  147. package/dist/esm/modules/TextInputState/index.mjs.map +1 -0
  148. package/dist/esm/modules/UIManager/__tests__/index-test.mjs +88 -0
  149. package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +1 -0
  150. package/dist/esm/modules/UIManager/index.mjs +40 -0
  151. package/dist/esm/modules/UIManager/index.mjs.map +1 -0
  152. package/dist/esm/modules/canUseDOM.mjs +3 -0
  153. package/dist/esm/modules/canUseDOM.mjs.map +1 -0
  154. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +154 -0
  155. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +1 -0
  156. package/dist/esm/modules/createDOMProps/index.mjs +361 -0
  157. package/dist/esm/modules/createDOMProps/index.mjs.map +1 -0
  158. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +399 -0
  159. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +1 -0
  160. package/dist/esm/modules/createEventHandle/index.mjs +61 -0
  161. package/dist/esm/modules/createEventHandle/index.mjs.map +1 -0
  162. package/dist/esm/modules/dismissKeyboard/index.mjs +6 -0
  163. package/dist/esm/modules/dismissKeyboard/index.mjs.map +1 -0
  164. package/dist/esm/modules/forwardedProps/index.mjs +128 -0
  165. package/dist/esm/modules/forwardedProps/index.mjs.map +1 -0
  166. package/dist/esm/modules/getBoundingClientRect/index.mjs +10 -0
  167. package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -0
  168. package/dist/esm/modules/invariant.mjs +16 -0
  169. package/dist/esm/modules/invariant.mjs.map +1 -0
  170. package/dist/esm/modules/isSelectionValid/index.mjs +11 -0
  171. package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -0
  172. package/dist/esm/modules/isWebColor/index.mjs +3 -0
  173. package/dist/esm/modules/isWebColor/index.mjs.map +1 -0
  174. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +25 -0
  175. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +1 -0
  176. package/dist/esm/modules/mergeRefs/index.mjs +20 -0
  177. package/dist/esm/modules/mergeRefs/index.mjs.map +1 -0
  178. package/dist/esm/modules/modality/__tests__/index-test.mjs +60 -0
  179. package/dist/esm/modules/modality/__tests__/index-test.mjs.map +1 -0
  180. package/dist/esm/modules/modality/index.mjs +184 -0
  181. package/dist/esm/modules/modality/index.mjs.map +1 -0
  182. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +15 -0
  183. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +1 -0
  184. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +16 -0
  185. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -0
  186. package/dist/esm/modules/normalizeColor/index.mjs +19 -0
  187. package/dist/esm/modules/normalizeColor/index.mjs.map +1 -0
  188. package/dist/esm/modules/pick/index.mjs +13 -0
  189. package/dist/esm/modules/pick/index.mjs.map +1 -0
  190. package/dist/esm/modules/processColor/__tests__/index-test.mjs +62 -0
  191. package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +1 -0
  192. package/dist/esm/modules/processColor/index.mjs +14 -0
  193. package/dist/esm/modules/processColor/index.mjs.map +1 -0
  194. package/dist/esm/modules/requestIdleCallback/index.mjs +20 -0
  195. package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -0
  196. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +30 -0
  197. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -0
  198. package/dist/esm/modules/setValueForStyles/index.mjs +21 -0
  199. package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -0
  200. package/dist/esm/modules/unitlessNumbers/index.mjs +64 -0
  201. package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -0
  202. package/dist/esm/modules/useElementLayout/index.mjs +19 -0
  203. package/dist/esm/modules/useElementLayout/index.mjs.map +1 -0
  204. package/dist/esm/modules/useEvent/__tests__/index-test.mjs +467 -0
  205. package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +1 -0
  206. package/dist/esm/modules/useEvent/index.mjs +32 -0
  207. package/dist/esm/modules/useEvent/index.mjs.map +1 -0
  208. package/dist/esm/modules/useHover/__tests__/index-test.mjs +359 -0
  209. package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +1 -0
  210. package/dist/esm/modules/useHover/index.mjs +115 -0
  211. package/dist/esm/modules/useHover/index.mjs.map +1 -0
  212. package/dist/esm/modules/useLayoutEffect/index.mjs +5 -0
  213. package/dist/esm/modules/useLayoutEffect/index.mjs.map +1 -0
  214. package/dist/esm/modules/useLocale/index.mjs +31 -0
  215. package/dist/esm/modules/useLocale/index.mjs.map +1 -0
  216. package/dist/esm/modules/useLocale/isLocaleRTL.mjs +63 -0
  217. package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -0
  218. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +102 -0
  219. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +1 -0
  220. package/dist/esm/modules/useMergeRefs/index.mjs +9 -0
  221. package/dist/esm/modules/useMergeRefs/index.mjs.map +1 -0
  222. package/dist/esm/modules/usePlatformMethods/index.mjs +17 -0
  223. package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -0
  224. package/dist/esm/modules/useStable/__tests__/index-test.mjs +99 -0
  225. package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +1 -0
  226. package/dist/esm/modules/useStable/index.mjs +11 -0
  227. package/dist/esm/modules/useStable/index.mjs.map +1 -0
  228. package/dist/esm/styleTypes.mjs +2 -0
  229. package/dist/esm/styleTypes.mjs.map +1 -0
  230. package/dist/esm/types.mjs +2 -0
  231. package/dist/esm/types.mjs.map +1 -0
  232. package/package.json +58 -0
  233. package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +236 -0
  234. package/src/StyleSheet/__tests__/compiler-test.tsx +426 -0
  235. package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +169 -0
  236. package/src/StyleSheet/__tests__/index-test.tsx +406 -0
  237. package/src/StyleSheet/__tests__/preprocess-test.tsx +107 -0
  238. package/src/StyleSheet/__tests__/validate-test.tsx +42 -0
  239. package/src/StyleSheet/compiler/createReactDOMStyle.tsx +215 -0
  240. package/src/StyleSheet/compiler/hash.tsx +1 -0
  241. package/src/StyleSheet/compiler/hyphenateStyleName.tsx +25 -0
  242. package/src/StyleSheet/compiler/index.tsx +478 -0
  243. package/src/StyleSheet/compiler/normalizeColor.tsx +35 -0
  244. package/src/StyleSheet/compiler/normalizeValueWithProperty.tsx +34 -0
  245. package/src/StyleSheet/compiler/resolveShadowValue.tsx +26 -0
  246. package/src/StyleSheet/dom/createCSSStyleSheet.tsx +42 -0
  247. package/src/StyleSheet/dom/createOrderedCSSStyleSheet.tsx +195 -0
  248. package/src/StyleSheet/dom/index.tsx +92 -0
  249. package/src/StyleSheet/index.tsx +99 -0
  250. package/src/StyleSheet/preprocess.tsx +119 -0
  251. package/src/StyleSheet/validate.tsx +90 -0
  252. package/src/TextAncestorContext.tsx +13 -0
  253. package/src/colorProps.tsx +12 -0
  254. package/src/index.tsx +58 -0
  255. package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +44 -0
  256. package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +25 -0
  257. package/src/modules/AccessibilityUtil/index.tsx +18 -0
  258. package/src/modules/AccessibilityUtil/isDisabled.tsx +13 -0
  259. package/src/modules/AccessibilityUtil/propsToAccessibilityComponent.tsx +54 -0
  260. package/src/modules/AccessibilityUtil/propsToAriaRole.tsx +37 -0
  261. package/src/modules/AssetRegistry/index.tsx +32 -0
  262. package/src/modules/ImageLoader/index.tsx +165 -0
  263. package/src/modules/InteractionManager.tsx +315 -0
  264. package/src/modules/Platform/__tests__/index-test.tsx +45 -0
  265. package/src/modules/Platform/index.tsx +15 -0
  266. package/src/modules/TextInputState/index.tsx +62 -0
  267. package/src/modules/UIManager/__tests__/index-test.tsx +87 -0
  268. package/src/modules/UIManager/index.tsx +68 -0
  269. package/src/modules/canUseDOM.tsx +14 -0
  270. package/src/modules/createDOMProps/__tests__/index-test.tsx +138 -0
  271. package/src/modules/createDOMProps/index.tsx +436 -0
  272. package/src/modules/createEventHandle/__tests__/index-test.tsx +459 -0
  273. package/src/modules/createEventHandle/index.tsx +100 -0
  274. package/src/modules/dismissKeyboard/index.tsx +14 -0
  275. package/src/modules/forwardedProps/index.tsx +145 -0
  276. package/src/modules/getBoundingClientRect/index.tsx +17 -0
  277. package/src/modules/invariant.ts +23 -0
  278. package/src/modules/isSelectionValid/index.tsx +20 -0
  279. package/src/modules/isWebColor/index.tsx +14 -0
  280. package/src/modules/mergeRefs/__tests__/index-test.tsx +32 -0
  281. package/src/modules/mergeRefs/index.tsx +36 -0
  282. package/src/modules/modality/__tests__/index-test.tsx +66 -0
  283. package/src/modules/modality/index.tsx +228 -0
  284. package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +23 -0
  285. package/src/modules/multiplyStyleLengthValue/index.tsx +26 -0
  286. package/src/modules/normalizeColor/index.tsx +32 -0
  287. package/src/modules/pick/index.tsx +25 -0
  288. package/src/modules/processColor/__tests__/index-test.tsx +78 -0
  289. package/src/modules/processColor/index.tsx +28 -0
  290. package/src/modules/requestIdleCallback/index.tsx +35 -0
  291. package/src/modules/setValueForStyles/dangerousStyleValue.tsx +74 -0
  292. package/src/modules/setValueForStyles/index.tsx +39 -0
  293. package/src/modules/unitlessNumbers/index.tsx +77 -0
  294. package/src/modules/useElementLayout/index.tsx +28 -0
  295. package/src/modules/useEvent/__tests__/index-test.tsx +511 -0
  296. package/src/modules/useEvent/index.tsx +64 -0
  297. package/src/modules/useHover/__tests__/index-test.tsx +342 -0
  298. package/src/modules/useHover/index.tsx +181 -0
  299. package/src/modules/useLayoutEffect/index.ts +15 -0
  300. package/src/modules/useLocale/index.tsx +57 -0
  301. package/src/modules/useLocale/isLocaleRTL.tsx +74 -0
  302. package/src/modules/useMergeRefs/__tests__/index-test.tsx +91 -0
  303. package/src/modules/useMergeRefs/index.tsx +22 -0
  304. package/src/modules/usePlatformMethods/index.tsx +40 -0
  305. package/src/modules/useStable/__tests__/index-test.tsx +101 -0
  306. package/src/modules/useStable/index.tsx +24 -0
  307. package/src/styleTypes.ts +321 -0
  308. package/src/types.ts +77 -0
  309. package/types/StyleSheet/compiler/createReactDOMStyle.d.ts +18 -0
  310. package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -0
  311. package/types/StyleSheet/compiler/hash.d.ts +2 -0
  312. package/types/StyleSheet/compiler/hash.d.ts.map +1 -0
  313. package/types/StyleSheet/compiler/hyphenateStyleName.d.ts +10 -0
  314. package/types/StyleSheet/compiler/hyphenateStyleName.d.ts.map +1 -0
  315. package/types/StyleSheet/compiler/index.d.ts +39 -0
  316. package/types/StyleSheet/compiler/index.d.ts.map +1 -0
  317. package/types/StyleSheet/compiler/normalizeColor.d.ts +10 -0
  318. package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -0
  319. package/types/StyleSheet/compiler/normalizeValueWithProperty.d.ts +10 -0
  320. package/types/StyleSheet/compiler/normalizeValueWithProperty.d.ts.map +1 -0
  321. package/types/StyleSheet/compiler/resolveShadowValue.d.ts +10 -0
  322. package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -0
  323. package/types/StyleSheet/dom/createCSSStyleSheet.d.ts +10 -0
  324. package/types/StyleSheet/dom/createCSSStyleSheet.d.ts.map +1 -0
  325. package/types/StyleSheet/dom/createOrderedCSSStyleSheet.d.ts +29 -0
  326. package/types/StyleSheet/dom/createOrderedCSSStyleSheet.d.ts.map +1 -0
  327. package/types/StyleSheet/dom/index.d.ts +15 -0
  328. package/types/StyleSheet/dom/index.d.ts.map +1 -0
  329. package/types/StyleSheet/index.d.ts +69 -0
  330. package/types/StyleSheet/index.d.ts.map +1 -0
  331. package/types/StyleSheet/preprocess.d.ts +16 -0
  332. package/types/StyleSheet/preprocess.d.ts.map +1 -0
  333. package/types/StyleSheet/validate.d.ts +10 -0
  334. package/types/StyleSheet/validate.d.ts.map +1 -0
  335. package/types/TextAncestorContext.d.ts +11 -0
  336. package/types/TextAncestorContext.d.ts.map +1 -0
  337. package/types/colorProps.d.ts +13 -0
  338. package/types/colorProps.d.ts.map +1 -0
  339. package/types/index.d.ts +45 -0
  340. package/types/index.d.ts.map +1 -0
  341. package/types/modules/AccessibilityUtil/index.d.ts +16 -0
  342. package/types/modules/AccessibilityUtil/index.d.ts.map +1 -0
  343. package/types/modules/AccessibilityUtil/isDisabled.d.ts +10 -0
  344. package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -0
  345. package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts +10 -0
  346. package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -0
  347. package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts +12 -0
  348. package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -0
  349. package/types/modules/AssetRegistry/index.d.ts +22 -0
  350. package/types/modules/AssetRegistry/index.d.ts.map +1 -0
  351. package/types/modules/ImageLoader/index.d.ts +27 -0
  352. package/types/modules/ImageLoader/index.d.ts.map +1 -0
  353. package/types/modules/InteractionManager.d.ts +48 -0
  354. package/types/modules/InteractionManager.d.ts.map +1 -0
  355. package/types/modules/Platform/index.d.ts +15 -0
  356. package/types/modules/Platform/index.d.ts.map +1 -0
  357. package/types/modules/TextInputState/index.d.ts +38 -0
  358. package/types/modules/TextInputState/index.d.ts.map +1 -0
  359. package/types/modules/UIManager/index.d.ts +23 -0
  360. package/types/modules/UIManager/index.d.ts.map +1 -0
  361. package/types/modules/canUseDOM.d.ts +10 -0
  362. package/types/modules/canUseDOM.d.ts.map +1 -0
  363. package/types/modules/createDOMProps/index.d.ts +12 -0
  364. package/types/modules/createDOMProps/index.d.ts.map +1 -0
  365. package/types/modules/createEventHandle/index.d.ts +20 -0
  366. package/types/modules/createEventHandle/index.d.ts.map +1 -0
  367. package/types/modules/dismissKeyboard/index.d.ts +10 -0
  368. package/types/modules/dismissKeyboard/index.d.ts.map +1 -0
  369. package/types/modules/forwardedProps/index.d.ts +383 -0
  370. package/types/modules/forwardedProps/index.d.ts.map +1 -0
  371. package/types/modules/getBoundingClientRect/index.d.ts +10 -0
  372. package/types/modules/getBoundingClientRect/index.d.ts.map +1 -0
  373. package/types/modules/invariant.d.ts +3 -0
  374. package/types/modules/invariant.d.ts.map +1 -0
  375. package/types/modules/isSelectionValid/index.d.ts +10 -0
  376. package/types/modules/isSelectionValid/index.d.ts.map +1 -0
  377. package/types/modules/isWebColor/index.d.ts +10 -0
  378. package/types/modules/isWebColor/index.d.ts.map +1 -0
  379. package/types/modules/mergeRefs/index.d.ts +11 -0
  380. package/types/modules/mergeRefs/index.d.ts.map +1 -0
  381. package/types/modules/modality/index.d.ts +17 -0
  382. package/types/modules/modality/index.d.ts.map +1 -0
  383. package/types/modules/multiplyStyleLengthValue/index.d.ts +10 -0
  384. package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -0
  385. package/types/modules/normalizeColor/index.d.ts +10 -0
  386. package/types/modules/normalizeColor/index.d.ts.map +1 -0
  387. package/types/modules/pick/index.d.ts +12 -0
  388. package/types/modules/pick/index.d.ts.map +1 -0
  389. package/types/modules/processColor/index.d.ts +11 -0
  390. package/types/modules/processColor/index.d.ts.map +1 -0
  391. package/types/modules/requestIdleCallback/index.d.ts +3 -0
  392. package/types/modules/requestIdleCallback/index.d.ts.map +1 -0
  393. package/types/modules/setValueForStyles/dangerousStyleValue.d.ts +11 -0
  394. package/types/modules/setValueForStyles/dangerousStyleValue.d.ts.map +1 -0
  395. package/types/modules/setValueForStyles/index.d.ts +9 -0
  396. package/types/modules/setValueForStyles/index.d.ts.map +1 -0
  397. package/types/modules/unitlessNumbers/index.d.ts +60 -0
  398. package/types/modules/unitlessNumbers/index.d.ts.map +1 -0
  399. package/types/modules/useElementLayout/index.d.ts +4 -0
  400. package/types/modules/useElementLayout/index.d.ts.map +1 -0
  401. package/types/modules/useEvent/index.d.ts +24 -0
  402. package/types/modules/useEvent/index.d.ts.map +1 -0
  403. package/types/modules/useHover/index.d.ts +21 -0
  404. package/types/modules/useHover/index.d.ts.map +1 -0
  405. package/types/modules/useLayoutEffect/index.d.ts +13 -0
  406. package/types/modules/useLayoutEffect/index.d.ts.map +1 -0
  407. package/types/modules/useLocale/index.d.ts +14 -0
  408. package/types/modules/useLocale/index.d.ts.map +1 -0
  409. package/types/modules/useLocale/isLocaleRTL.d.ts +13 -0
  410. package/types/modules/useLocale/isLocaleRTL.d.ts.map +1 -0
  411. package/types/modules/useMergeRefs/index.d.ts +11 -0
  412. package/types/modules/useMergeRefs/index.d.ts.map +1 -0
  413. package/types/modules/usePlatformMethods/index.d.ts +18 -0
  414. package/types/modules/usePlatformMethods/index.d.ts.map +1 -0
  415. package/types/modules/useStable/index.d.ts +10 -0
  416. package/types/modules/useStable/index.d.ts.map +1 -0
  417. package/types/styleTypes.d.ts +211 -0
  418. package/types/styleTypes.d.ts.map +1 -0
  419. package/types/types.d.ts +46 -0
  420. package/types/types.d.ts.map +1 -0
@@ -0,0 +1,160 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+ var import_createOrderedCSSStyleSheet = __toESM(require("../dom/createOrderedCSSStyleSheet.cjs"), 1);
26
+ const insertStyleElement = () => {
27
+ const element = document.createElement("style");
28
+ const head = document.head;
29
+ head.insertBefore(element, head.firstChild);
30
+ return element;
31
+ };
32
+ const removeStyleElement = element => {
33
+ document.head.removeChild(element);
34
+ };
35
+ describe("createOrderedCSSStyleSheet", () => {
36
+ describe("#insert", () => {
37
+ test("insertion order for same group", () => {
38
+ const sheet = (0, import_createOrderedCSSStyleSheet.default)();
39
+ expect(sheet.getTextContent()).toMatchInlineSnapshot('""');
40
+ sheet.insert(".a {}", 0);
41
+ expect(sheet.getTextContent()).toMatchInlineSnapshot(`
42
+ "[stylesheet-group=\\"0\\"]{}
43
+ .a {}"
44
+ `);
45
+ sheet.insert(".b {}", 0);
46
+ expect(sheet.getTextContent()).toMatchInlineSnapshot(`
47
+ "[stylesheet-group=\\"0\\"]{}
48
+ .a {}
49
+ .b {}"
50
+ `);
51
+ sheet.insert(".c {}", 0);
52
+ expect(sheet.getTextContent()).toMatchInlineSnapshot(`
53
+ "[stylesheet-group=\\"0\\"]{}
54
+ .a {}
55
+ .b {}
56
+ .c {}"
57
+ `);
58
+ });
59
+ test("deduplication for same group", () => {
60
+ const sheet = (0, import_createOrderedCSSStyleSheet.default)();
61
+ sheet.insert(".a {}", 0);
62
+ sheet.insert(".a {}", 0);
63
+ sheet.insert(".a {}", 0);
64
+ expect(sheet.getTextContent()).toMatchInlineSnapshot(`
65
+ "[stylesheet-group=\\"0\\"]{}
66
+ .a {}"
67
+ `);
68
+ });
69
+ test("order for same group", () => {
70
+ const sheet = (0, import_createOrderedCSSStyleSheet.default)();
71
+ sheet.insert(".c {}", 0);
72
+ sheet.insert(".b {}", 0);
73
+ sheet.insert(".a {}", 0);
74
+ expect(sheet.getTextContent()).toMatchInlineSnapshot(`
75
+ "[stylesheet-group=\\"0\\"]{}
76
+ .a {}
77
+ .b {}
78
+ .c {}"
79
+ `);
80
+ });
81
+ test("insertion order for different groups", () => {
82
+ const sheet = (0, import_createOrderedCSSStyleSheet.default)();
83
+ sheet.insert(".nine-1 {}", 9.9);
84
+ sheet.insert(".nine-2 {}", 9.9);
85
+ sheet.insert(".three {}", 3);
86
+ sheet.insert(".one {}", 1);
87
+ sheet.insert(".two {}", 2.2);
88
+ sheet.insert(".four-1 {}", 4);
89
+ sheet.insert(".four-2 {}", 4);
90
+ sheet.insert(".twenty {}", 20);
91
+ sheet.insert(".ten {}", 10);
92
+ sheet.insert(".twenty-point2 {}", 20.2);
93
+ expect(sheet.getTextContent()).toMatchInlineSnapshot(`
94
+ "[stylesheet-group=\\"1\\"]{}
95
+ .one {}
96
+ [stylesheet-group=\\"2.2\\"]{}
97
+ .two {}
98
+ [stylesheet-group=\\"3\\"]{}
99
+ .three {}
100
+ [stylesheet-group=\\"4\\"]{}
101
+ .four-1 {}
102
+ .four-2 {}
103
+ [stylesheet-group=\\"9.9\\"]{}
104
+ .nine-1 {}
105
+ .nine-2 {}
106
+ [stylesheet-group=\\"10\\"]{}
107
+ .ten {}
108
+ [stylesheet-group=\\"20\\"]{}
109
+ .twenty {}
110
+ [stylesheet-group=\\"20.2\\"]{}
111
+ .twenty-point2 {}"
112
+ `);
113
+ });
114
+ });
115
+ describe("client-side hydration", () => {
116
+ let element;
117
+ beforeEach(() => {
118
+ if (element != null) {
119
+ removeStyleElement(element);
120
+ }
121
+ element = insertStyleElement();
122
+ });
123
+ test("from SSR CSS", () => {
124
+ const serverSheet = (0, import_createOrderedCSSStyleSheet.default)();
125
+ serverSheet.insert(".one { width: 10px; }", 1);
126
+ serverSheet.insert(".two-1 { height: 20px; }", 2);
127
+ serverSheet.insert(".two-2 { color: red; }", 2);
128
+ serverSheet.insert("@keyframes anim { 0% { opacity: 1; } }", 2);
129
+ const textContent = serverSheet.getTextContent();
130
+ element.appendChild(document.createTextNode(textContent));
131
+ const clientSheet = (0, import_createOrderedCSSStyleSheet.default)(element.sheet);
132
+ expect(clientSheet.getTextContent()).toMatchInlineSnapshot(`
133
+ "[stylesheet-group=\\"1\\"] {}
134
+ .one {width: 10px;}
135
+ [stylesheet-group=\\"2\\"] {}
136
+ .two-1 {height: 20px;}
137
+ .two-2 {color: red;}
138
+ @keyframes anim {
139
+ 0% {opacity: 1;}
140
+ }"
141
+ `);
142
+ });
143
+ test("works when the group marker is in single quotes", () => {
144
+ const serverSheet = (0, import_createOrderedCSSStyleSheet.default)();
145
+ serverSheet.insert(".a { color: red }", 0);
146
+ serverSheet.insert(".b { color: red }", 1);
147
+ const textContent = serverSheet.getTextContent().replace(/"/g, "'");
148
+ element.appendChild(document.createTextNode(textContent));
149
+ const clientSheet = (0, import_createOrderedCSSStyleSheet.default)(element.sheet);
150
+ clientSheet.insert(".c { color: red }", 0);
151
+ expect(clientSheet.getTextContent()).toMatchInlineSnapshot(`
152
+ "[stylesheet-group='0'] {}
153
+ .a {color: red;}
154
+ .c { color: red }
155
+ [stylesheet-group='1'] {}
156
+ .b {color: red;}"
157
+ `);
158
+ });
159
+ });
160
+ });
@@ -0,0 +1,436 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
+ value: mod,
23
+ enumerable: true
24
+ }) : target, mod));
25
+ var import__ = __toESM(require("../index.cjs"), 1);
26
+ describe("StyleSheet", () => {
27
+ test("getSheet", () => {
28
+ expect(import__.default.getSheet()).toMatchInlineSnapshot(`
29
+ {
30
+ "id": "react-native-stylesheet",
31
+ "textContent": "[stylesheet-group=\\"0\\"]{}
32
+ body{margin:0;}
33
+ button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
34
+ html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}
35
+ input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}
36
+ [stylesheet-group=\\"2.2\\"]{}
37
+ .r-bottom-1p0dtai{bottom:0px;}
38
+ .r-left-1d2f490{left:0px;}
39
+ .r-position-u8s1d{position:absolute;}
40
+ .r-right-zchlnj{right:0px;}
41
+ .r-top-ipm5af{top:0px;}",
42
+ }
43
+ `);
44
+ });
45
+ test("absoluteFill", () => {
46
+ expect(import__.default.absoluteFill).toMatchInlineSnapshot(`
47
+ {
48
+ "bottom": 0,
49
+ "left": 0,
50
+ "position": "absolute",
51
+ "right": 0,
52
+ "top": 0,
53
+ }
54
+ `);
55
+ });
56
+ test("absoluteFillObject", () => {
57
+ expect(import__.default.absoluteFillObject).toMatchInlineSnapshot(`
58
+ {
59
+ "bottom": 0,
60
+ "left": 0,
61
+ "position": "absolute",
62
+ "right": 0,
63
+ "top": 0,
64
+ }
65
+ `);
66
+ });
67
+ test("compose", () => {
68
+ expect(import__.default.compose(1, 2)).toEqual([1, 2]);
69
+ expect(import__.default.compose(1, null)).toBe(1);
70
+ expect(import__.default.compose(null, 2)).toBe(2);
71
+ });
72
+ describe("create", () => {
73
+ test("returns original style objects", () => {
74
+ const style = import__.default.create({
75
+ root: {
76
+ position: "absolute"
77
+ }
78
+ });
79
+ expect(style.root).toMatchInlineSnapshot(`
80
+ {
81
+ "position": "absolute",
82
+ }
83
+ `);
84
+ });
85
+ test("e2e resolves to classname", () => {
86
+ const style = import__.default.create({
87
+ root: {
88
+ position: "absolute"
89
+ }
90
+ });
91
+ expect((0, import__.default)(style.root)).toMatchInlineSnapshot(`
92
+ [
93
+ "r-position-u8s1d",
94
+ null,
95
+ ]
96
+ `);
97
+ });
98
+ test("e2e flattens shadow style properties", () => {
99
+ const style = import__.default.create({
100
+ root: {
101
+ shadowColor: "rgba(50,60,70,0.5)",
102
+ shadowOffset: {
103
+ width: 1,
104
+ height: 2
105
+ },
106
+ shadowOpacity: 0.5,
107
+ shadowRadius: 3,
108
+ textShadowColor: "rgba(50,60,70,0.50)",
109
+ textShadowOffset: {
110
+ width: 5,
111
+ height: 10
112
+ },
113
+ textShadowRadius: 15
114
+ }
115
+ });
116
+ expect((0, import__.default)(style.root)).toMatchInlineSnapshot(`
117
+ [
118
+ "r-boxShadow-o3ayyy r-textShadow-1x2q051",
119
+ null,
120
+ ]
121
+ `);
122
+ });
123
+ });
124
+ describe("flatten", () => {
125
+ test("should merge style objects", () => {
126
+ const style = import__.default.flatten([{
127
+ opacity: 1
128
+ }, {
129
+ order: 2
130
+ }]);
131
+ expect(style).toMatchInlineSnapshot(`
132
+ {
133
+ "opacity": 1,
134
+ "order": 2,
135
+ }
136
+ `);
137
+ });
138
+ test("should override style properties", () => {
139
+ const style = import__.default.flatten([{
140
+ backgroundColor: "#000",
141
+ order: 1
142
+ }, {
143
+ backgroundColor: "#023c69",
144
+ order: null
145
+ }]);
146
+ expect(style).toMatchInlineSnapshot(`
147
+ {
148
+ "backgroundColor": "#023c69",
149
+ "order": null,
150
+ }
151
+ `);
152
+ });
153
+ test("should overwrite properties with `undefined`", () => {
154
+ const style = import__.default.flatten([{
155
+ backgroundColor: "#000"
156
+ }, {
157
+ backgroundColor: void 0
158
+ }]);
159
+ expect(style).toMatchInlineSnapshot(`
160
+ {
161
+ "backgroundColor": undefined,
162
+ }
163
+ `);
164
+ });
165
+ test("should not fail on falsy values", () => {
166
+ expect(() => import__.default.flatten([null, false, void 0])).not.toThrow();
167
+ });
168
+ test("should recursively flatten arrays", () => {
169
+ const style = import__.default.flatten([null, [], [{
170
+ order: 2
171
+ }, {
172
+ opacity: 1
173
+ }], {
174
+ order: 3
175
+ }]);
176
+ expect(style).toMatchInlineSnapshot(`
177
+ {
178
+ "opacity": 1,
179
+ "order": 3,
180
+ }
181
+ `);
182
+ });
183
+ });
184
+ test("hairlineWidth", () => {
185
+ expect(Number.isInteger(import__.default.hairlineWidth) === true).toBeTruthy();
186
+ });
187
+ describe("resolve", () => {
188
+ test("empty", () => {
189
+ expect((0, import__.default)()).toMatchInlineSnapshot(`
190
+ [
191
+ "",
192
+ null,
193
+ ]
194
+ `);
195
+ expect((0, import__.default)({})).toMatchInlineSnapshot(`
196
+ [
197
+ "",
198
+ null,
199
+ ]
200
+ `);
201
+ expect((0, import__.default)([])).toMatchInlineSnapshot(`
202
+ [
203
+ "",
204
+ null,
205
+ ]
206
+ `);
207
+ });
208
+ test("transforms compiled object to className", () => {
209
+ expect((0, import__.default)([{
210
+ $$css: true,
211
+ position: "position-absolute",
212
+ opacity: "opacity-05",
213
+ width: "width-200"
214
+ }])).toMatchInlineSnapshot(`
215
+ [
216
+ "position-absolute opacity-05 width-200",
217
+ null,
218
+ ]
219
+ `);
220
+ });
221
+ test("transforms array of compiled objects to className", () => {
222
+ expect((0, import__.default)([{
223
+ $$css: true,
224
+ borderWidth: "borderWidth-0",
225
+ borderColor: "borderColor-red",
226
+ display: "display-flex",
227
+ width: "width-100"
228
+ }, {
229
+ $$css: true,
230
+ position: "position-absolute",
231
+ opacity: "opacity-05"
232
+ }, [{
233
+ $$css: true,
234
+ width: "width-200"
235
+ }]])).toMatchInlineSnapshot(`
236
+ [
237
+ "borderWidth-0 borderColor-red display-flex position-absolute opacity-05 width-200",
238
+ null,
239
+ ]
240
+ `);
241
+ });
242
+ test("dedupes class names and inline styles", () => {
243
+ const styleACompiled = {
244
+ $$css: true,
245
+ backgroundColor: "backgroundColor-red",
246
+ display: "display-block"
247
+ };
248
+ const styleBCompiled = {
249
+ $$css: true,
250
+ backgroundColor: "backgroundColor-green",
251
+ color: "color-green"
252
+ };
253
+ const styleBInline = {
254
+ backgroundColor: "rgba(0,0,255,1.00)",
255
+ color: null
256
+ };
257
+ const [className1, inlineStyle1] = (0, import__.default)([styleACompiled, styleBCompiled, styleBInline]);
258
+ expect(className1).toBe("display-block");
259
+ expect(inlineStyle1).toEqual({
260
+ backgroundColor: "rgba(0,0,255,1.00)"
261
+ });
262
+ const [className2, inlineStyle2] = (0, import__.default)([styleACompiled, styleBInline, styleBCompiled]);
263
+ expect(className2).toBe("display-block backgroundColor-green color-green");
264
+ expect(inlineStyle2).toEqual(null);
265
+ });
266
+ test("long form inline style properties take precedence over static shorthand properties", () => {
267
+ const styles1 = import__.default.create({
268
+ test: {
269
+ paddingHorizontal: "40px"
270
+ }
271
+ });
272
+ const inlineStyle1 = {
273
+ padding: "8px",
274
+ paddingHorizontal: "40px"
275
+ };
276
+ expect((0, import__.default)([styles1.test, inlineStyle1])).toMatchInlineSnapshot(`
277
+ [
278
+ "",
279
+ {
280
+ "paddingBottom": "8px",
281
+ "paddingLeft": "40px",
282
+ "paddingRight": "40px",
283
+ "paddingTop": "8px",
284
+ },
285
+ ]
286
+ `);
287
+ const styles2 = import__.default.create({
288
+ test: {
289
+ marginVertical: "40px"
290
+ }
291
+ });
292
+ const inlineStyle2 = {
293
+ margin: "8px",
294
+ marginVertical: "40px"
295
+ };
296
+ expect((0, import__.default)([styles2.test, inlineStyle2])).toMatchInlineSnapshot(`
297
+ [
298
+ "",
299
+ {
300
+ "marginBottom": "40px",
301
+ "marginLeft": "8px",
302
+ "marginRight": "8px",
303
+ "marginTop": "40px",
304
+ },
305
+ ]
306
+ `);
307
+ });
308
+ test("polyfills logical styles", () => {
309
+ const inlineA = {
310
+ start: "12.34%"
311
+ };
312
+ const inlineB = {
313
+ textAlign: "start"
314
+ };
315
+ const inlineC = {
316
+ marginEnd: 10
317
+ };
318
+ const a = import__.default.create({
319
+ x: {
320
+ ...inlineA
321
+ }
322
+ }).x;
323
+ const b = import__.default.create({
324
+ x: {
325
+ ...inlineB
326
+ }
327
+ }).x;
328
+ const c = import__.default.create({
329
+ x: {
330
+ ...inlineC
331
+ }
332
+ }).x;
333
+ const writingDirection = "rtl";
334
+ const inlineStyle = [inlineA, inlineB, inlineC];
335
+ expect((0, import__.default)(inlineStyle)).toMatchInlineSnapshot(`
336
+ [
337
+ "",
338
+ {
339
+ "left": "12.34%",
340
+ "marginRight": "10px",
341
+ "textAlign": "left",
342
+ },
343
+ ]
344
+ `);
345
+ expect((0, import__.default)(inlineStyle, {
346
+ writingDirection
347
+ })).toMatchInlineSnapshot(`
348
+ [
349
+ "",
350
+ {
351
+ "marginLeft": "10px",
352
+ "right": "12.34%",
353
+ "textAlign": "right",
354
+ },
355
+ ]
356
+ `);
357
+ expect((0, import__.default)([inlineStyle, {
358
+ marginLeft: 1,
359
+ marginEnd: 0,
360
+ marginStart: 0,
361
+ marginRight: 11
362
+ }], {
363
+ writingDirection
364
+ })).toMatchInlineSnapshot(`
365
+ [
366
+ "",
367
+ {
368
+ "marginLeft": "0px",
369
+ "marginRight": "0px",
370
+ "right": "12.34%",
371
+ "textAlign": "right",
372
+ },
373
+ ]
374
+ `);
375
+ expect((0, import__.default)([inlineStyle, {
376
+ marginEnd: null,
377
+ marginLeft: 11
378
+ }], {
379
+ writingDirection
380
+ })).toMatchInlineSnapshot(`
381
+ [
382
+ "",
383
+ {
384
+ "marginLeft": "11px",
385
+ "right": "12.34%",
386
+ "textAlign": "right",
387
+ },
388
+ ]
389
+ `);
390
+ const staticStyle = [a, b, c];
391
+ expect((0, import__.default)(staticStyle)).toMatchInlineSnapshot(`
392
+ [
393
+ "r-left-2s0hu9 r-textAlign-fdjqy7 r-marginRight-zso239",
394
+ null,
395
+ ]
396
+ `);
397
+ expect((0, import__.default)(staticStyle, {
398
+ writingDirection
399
+ })).toMatchInlineSnapshot(`
400
+ [
401
+ "r-right-1bnbe1j r-textAlign-1ff274t r-marginLeft-1n0xq6e",
402
+ null,
403
+ ]
404
+ `);
405
+ expect((0, import__.default)([staticStyle, {
406
+ marginLeft: 1,
407
+ marginEnd: 0,
408
+ marginStart: 0,
409
+ marginRight: 11
410
+ }], {
411
+ writingDirection
412
+ })).toMatchInlineSnapshot(`
413
+ [
414
+ "r-right-1bnbe1j r-textAlign-1ff274t",
415
+ {
416
+ "marginLeft": "0px",
417
+ "marginRight": "0px",
418
+ },
419
+ ]
420
+ `);
421
+ expect((0, import__.default)([staticStyle, {
422
+ marginEnd: null,
423
+ marginLeft: 11
424
+ }], {
425
+ writingDirection
426
+ })).toMatchInlineSnapshot(`
427
+ [
428
+ "r-right-1bnbe1j r-textAlign-1ff274t",
429
+ {
430
+ "marginLeft": "11px",
431
+ },
432
+ ]
433
+ `);
434
+ });
435
+ });
436
+ });