@tamagui/react-native-web-internals 2.7.7 → 3.0.0-beta.1097.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +150 -136
  2. package/dist/cjs/StyleSheet/compiler/hash.cjs +14 -18
  3. package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +20 -24
  4. package/dist/cjs/StyleSheet/compiler/index.cjs +294 -321
  5. package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +19 -23
  6. package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +31 -35
  7. package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +26 -38
  8. package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +36 -40
  9. package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +107 -111
  10. package/dist/cjs/StyleSheet/dom/index.cjs +69 -72
  11. package/dist/cjs/StyleSheet/index.cjs +32 -34
  12. package/dist/cjs/StyleSheet/preprocess.cjs +73 -94
  13. package/dist/cjs/StyleSheet/validate.cjs +71 -75
  14. package/dist/cjs/TextAncestorContext.cjs +14 -18
  15. package/dist/cjs/colorProps.cjs +24 -28
  16. package/dist/cjs/index.cjs +48 -50
  17. package/dist/cjs/modules/AccessibilityUtil/index.cjs +17 -21
  18. package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +14 -18
  19. package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +45 -49
  20. package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +33 -39
  21. package/dist/cjs/modules/AssetRegistry/index.cjs +17 -19
  22. package/dist/cjs/modules/ImageLoader/index.cjs +134 -141
  23. package/dist/cjs/modules/InteractionManager.cjs +211 -219
  24. package/dist/cjs/modules/Platform/index.cjs +17 -21
  25. package/dist/cjs/modules/TextInputState/index.cjs +54 -58
  26. package/dist/cjs/modules/UIManager/index.cjs +45 -51
  27. package/dist/cjs/modules/canUseDOM.cjs +14 -18
  28. package/dist/cjs/modules/createDOMProps/index.cjs +284 -359
  29. package/dist/cjs/modules/createEventHandle/index.cjs +56 -62
  30. package/dist/cjs/modules/dismissKeyboard/index.cjs +15 -19
  31. package/dist/cjs/modules/forwardedProps/index.cjs +127 -130
  32. package/dist/cjs/modules/getBoundingClientRect/index.cjs +21 -25
  33. package/dist/cjs/modules/invariant.cjs +25 -27
  34. package/dist/cjs/modules/isSelectionValid/index.cjs +21 -25
  35. package/dist/cjs/modules/isWebColor/index.cjs +14 -18
  36. package/dist/cjs/modules/mergeRefs/index.cjs +30 -34
  37. package/dist/cjs/modules/modality/index.cjs +130 -134
  38. package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +24 -28
  39. package/dist/cjs/modules/normalizeColor/index.cjs +27 -31
  40. package/dist/cjs/modules/pick/index.cjs +21 -27
  41. package/dist/cjs/modules/processColor/index.cjs +27 -36
  42. package/dist/cjs/modules/requestIdleCallback/index.cjs +27 -29
  43. package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +38 -42
  44. package/dist/cjs/modules/setValueForStyles/index.cjs +27 -34
  45. package/dist/cjs/modules/unitlessNumbers/index.cjs +73 -75
  46. package/dist/cjs/modules/useElementLayout/index.cjs +23 -31
  47. package/dist/cjs/modules/useEvent/index.cjs +39 -43
  48. package/dist/cjs/modules/useHover/index.cjs +112 -118
  49. package/dist/cjs/modules/useLayoutEffect/index.cjs +17 -26
  50. package/dist/cjs/modules/useLocale/index.cjs +32 -43
  51. package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +65 -76
  52. package/dist/cjs/modules/useMergeRefs/index.cjs +18 -29
  53. package/dist/cjs/modules/usePlatformMethods/index.cjs +23 -30
  54. package/dist/cjs/modules/useStable/index.cjs +23 -32
  55. package/dist/cjs/styleTypes.cjs +9 -11
  56. package/dist/cjs/types.cjs +9 -11
  57. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +137 -119
  58. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -1
  59. package/dist/esm/StyleSheet/compiler/hash.mjs +2 -2
  60. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +7 -6
  61. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -1
  62. package/dist/esm/StyleSheet/compiler/index.mjs +279 -302
  63. package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -1
  64. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +7 -5
  65. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -1
  66. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +19 -17
  67. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -1
  68. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +14 -20
  69. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -1
  70. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +24 -22
  71. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -1
  72. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +94 -93
  73. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -1
  74. package/dist/esm/StyleSheet/dom/index.mjs +57 -54
  75. package/dist/esm/StyleSheet/dom/index.mjs.map +1 -1
  76. package/dist/esm/StyleSheet/index.mjs +18 -17
  77. package/dist/esm/StyleSheet/index.mjs.map +1 -1
  78. package/dist/esm/StyleSheet/preprocess.mjs +58 -75
  79. package/dist/esm/StyleSheet/preprocess.mjs.map +1 -1
  80. package/dist/esm/StyleSheet/validate.mjs +58 -57
  81. package/dist/esm/StyleSheet/validate.mjs.map +1 -1
  82. package/dist/esm/TextAncestorContext.mjs +2 -0
  83. package/dist/esm/TextAncestorContext.mjs.map +1 -1
  84. package/dist/esm/colorProps.mjs +11 -10
  85. package/dist/esm/colorProps.mjs.map +1 -1
  86. package/dist/esm/index.js +22 -15
  87. package/dist/esm/index.mjs +22 -15
  88. package/dist/esm/modules/AccessibilityUtil/index.mjs +5 -3
  89. package/dist/esm/modules/AccessibilityUtil/index.mjs.map +1 -1
  90. package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +2 -1
  91. package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +1 -1
  92. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +33 -31
  93. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -1
  94. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +20 -21
  95. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -1
  96. package/dist/esm/modules/AssetRegistry/index.mjs +3 -2
  97. package/dist/esm/modules/AssetRegistry/index.mjs.map +1 -1
  98. package/dist/esm/modules/ImageLoader/index.mjs +120 -124
  99. package/dist/esm/modules/ImageLoader/index.mjs.map +1 -1
  100. package/dist/esm/modules/InteractionManager.mjs +199 -201
  101. package/dist/esm/modules/InteractionManager.mjs.map +1 -1
  102. package/dist/esm/modules/Platform/index.mjs +4 -3
  103. package/dist/esm/modules/Platform/index.mjs.map +1 -1
  104. package/dist/esm/modules/TextInputState/index.mjs +42 -40
  105. package/dist/esm/modules/TextInputState/index.mjs.map +1 -1
  106. package/dist/esm/modules/UIManager/index.mjs +33 -33
  107. package/dist/esm/modules/UIManager/index.mjs.map +1 -1
  108. package/dist/esm/modules/canUseDOM.mjs +1 -0
  109. package/dist/esm/modules/canUseDOM.mjs.map +1 -1
  110. package/dist/esm/modules/createDOMProps/index.mjs +271 -342
  111. package/dist/esm/modules/createDOMProps/index.mjs.map +1 -1
  112. package/dist/esm/modules/createEventHandle/index.mjs +44 -44
  113. package/dist/esm/modules/createEventHandle/index.mjs.map +1 -1
  114. package/dist/esm/modules/dismissKeyboard/index.mjs +3 -1
  115. package/dist/esm/modules/dismissKeyboard/index.mjs.map +1 -1
  116. package/dist/esm/modules/forwardedProps/index.mjs +104 -104
  117. package/dist/esm/modules/forwardedProps/index.mjs.map +1 -1
  118. package/dist/esm/modules/getBoundingClientRect/index.mjs +8 -7
  119. package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -1
  120. package/dist/esm/modules/invariant.mjs +11 -10
  121. package/dist/esm/modules/invariant.mjs.map +1 -1
  122. package/dist/esm/modules/isSelectionValid/index.mjs +8 -7
  123. package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -1
  124. package/dist/esm/modules/isWebColor/index.mjs +2 -1
  125. package/dist/esm/modules/isWebColor/index.mjs.map +1 -1
  126. package/dist/esm/modules/mergeRefs/index.mjs +17 -16
  127. package/dist/esm/modules/mergeRefs/index.mjs.map +1 -1
  128. package/dist/esm/modules/modality/index.mjs +115 -115
  129. package/dist/esm/modules/modality/index.mjs.map +1 -1
  130. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +11 -10
  131. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -1
  132. package/dist/esm/modules/normalizeColor/index.mjs +15 -13
  133. package/dist/esm/modules/normalizeColor/index.mjs.map +1 -1
  134. package/dist/esm/modules/pick/index.mjs +8 -9
  135. package/dist/esm/modules/pick/index.mjs.map +1 -1
  136. package/dist/esm/modules/processColor/index.mjs +12 -10
  137. package/dist/esm/modules/processColor/index.mjs.map +1 -1
  138. package/dist/esm/modules/requestIdleCallback/index.mjs +14 -12
  139. package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -1
  140. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +27 -25
  141. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -1
  142. package/dist/esm/modules/setValueForStyles/index.mjs +15 -16
  143. package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -1
  144. package/dist/esm/modules/unitlessNumbers/index.mjs +60 -57
  145. package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -1
  146. package/dist/esm/modules/useElementLayout/index.mjs +12 -14
  147. package/dist/esm/modules/useElementLayout/index.mjs.map +1 -1
  148. package/dist/esm/modules/useEvent/index.mjs +28 -26
  149. package/dist/esm/modules/useEvent/index.mjs.map +1 -1
  150. package/dist/esm/modules/useHover/index.mjs +101 -101
  151. package/dist/esm/modules/useHover/index.mjs.map +1 -1
  152. package/dist/esm/modules/useLayoutEffect/index.mjs +2 -0
  153. package/dist/esm/modules/useLayoutEffect/index.mjs.map +1 -1
  154. package/dist/esm/modules/useLocale/index.mjs +15 -17
  155. package/dist/esm/modules/useLocale/index.mjs.map +1 -1
  156. package/dist/esm/modules/useLocale/isLocaleRTL.mjs +52 -58
  157. package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -1
  158. package/dist/esm/modules/useMergeRefs/index.mjs +3 -3
  159. package/dist/esm/modules/useMergeRefs/index.mjs.map +1 -1
  160. package/dist/esm/modules/usePlatformMethods/index.mjs +11 -12
  161. package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -1
  162. package/dist/esm/modules/useStable/index.mjs +8 -6
  163. package/dist/esm/modules/useStable/index.mjs.map +1 -1
  164. package/dist/esm/styleTypes.mjs +0 -2
  165. package/dist/esm/types.mjs +0 -2
  166. package/package.json +10 -10
  167. package/src/StyleSheet/compiler/index.tsx +2 -5
  168. package/src/StyleSheet/preprocess.tsx +1 -4
  169. package/src/modules/createDOMProps/index.tsx +8 -22
  170. package/src/modules/forwardedProps/index.tsx +0 -1
  171. package/src/modules/mergeRefs/index.tsx +1 -1
  172. package/src/modules/pick/index.tsx +2 -4
  173. package/src/modules/setValueForStyles/dangerousStyleValue.tsx +1 -1
  174. package/src/modules/setValueForStyles/index.tsx +0 -3
  175. package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -1
  176. package/types/StyleSheet/compiler/index.d.ts.map +1 -1
  177. package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -1
  178. package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -1
  179. package/types/StyleSheet/index.d.ts +15 -16
  180. package/types/StyleSheet/index.d.ts.map +1 -1
  181. package/types/StyleSheet/preprocess.d.ts +1 -1
  182. package/types/StyleSheet/preprocess.d.ts.map +1 -1
  183. package/types/colorProps.d.ts.map +1 -1
  184. package/types/modules/AccessibilityUtil/index.d.ts +6 -5
  185. package/types/modules/AccessibilityUtil/index.d.ts.map +1 -1
  186. package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -1
  187. package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -1
  188. package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -1
  189. package/types/modules/ImageLoader/index.d.ts +1 -1
  190. package/types/modules/ImageLoader/index.d.ts.map +1 -1
  191. package/types/modules/InteractionManager.d.ts +3 -3
  192. package/types/modules/InteractionManager.d.ts.map +1 -1
  193. package/types/modules/Platform/index.d.ts.map +1 -1
  194. package/types/modules/TextInputState/index.d.ts.map +1 -1
  195. package/types/modules/UIManager/index.d.ts +1 -6
  196. package/types/modules/UIManager/index.d.ts.map +1 -1
  197. package/types/modules/createDOMProps/index.d.ts.map +1 -1
  198. package/types/modules/forwardedProps/index.d.ts +70 -74
  199. package/types/modules/forwardedProps/index.d.ts.map +1 -1
  200. package/types/modules/getBoundingClientRect/index.d.ts.map +1 -1
  201. package/types/modules/isWebColor/index.d.ts.map +1 -1
  202. package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -1
  203. package/types/modules/normalizeColor/index.d.ts.map +1 -1
  204. package/types/modules/pick/index.d.ts.map +1 -1
  205. package/types/modules/processColor/index.d.ts.map +1 -1
  206. package/types/modules/requestIdleCallback/index.d.ts +3 -1
  207. package/types/modules/requestIdleCallback/index.d.ts.map +1 -1
  208. package/types/modules/setValueForStyles/index.d.ts.map +1 -1
  209. package/types/modules/unitlessNumbers/index.d.ts.map +1 -1
  210. package/types/modules/useLayoutEffect/index.d.ts +1 -1
  211. package/types/modules/useLayoutEffect/index.d.ts.map +1 -1
  212. package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +0 -265
  213. package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +0 -419
  214. package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +0 -160
  215. package/dist/cjs/StyleSheet/__tests__/index-test.cjs +0 -436
  216. package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +0 -121
  217. package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +0 -51
  218. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +0 -57
  219. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +0 -46
  220. package/dist/cjs/modules/Platform/__tests__/index-test.cjs +0 -56
  221. package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +0 -111
  222. package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +0 -177
  223. package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +0 -422
  224. package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +0 -48
  225. package/dist/cjs/modules/modality/__tests__/index-test.cjs +0 -59
  226. package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +0 -38
  227. package/dist/cjs/modules/processColor/__tests__/index-test.cjs +0 -85
  228. package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +0 -490
  229. package/dist/cjs/modules/useHover/__tests__/index-test.cjs +0 -382
  230. package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +0 -125
  231. package/dist/cjs/modules/useStable/__tests__/index-test.cjs +0 -122
  232. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +0 -242
  233. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +0 -1
  234. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +0 -420
  235. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +0 -1
  236. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +0 -137
  237. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +0 -1
  238. package/dist/esm/StyleSheet/__tests__/index-test.mjs +0 -413
  239. package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +0 -1
  240. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +0 -122
  241. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +0 -1
  242. package/dist/esm/StyleSheet/__tests__/validate-test.mjs +0 -52
  243. package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +0 -1
  244. package/dist/esm/StyleSheet/compiler/hash.mjs.map +0 -1
  245. package/dist/esm/index.js.map +0 -1
  246. package/dist/esm/index.mjs.map +0 -1
  247. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +0 -34
  248. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +0 -1
  249. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +0 -23
  250. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +0 -1
  251. package/dist/esm/modules/Platform/__tests__/index-test.mjs +0 -33
  252. package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +0 -1
  253. package/dist/esm/modules/UIManager/__tests__/index-test.mjs +0 -88
  254. package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +0 -1
  255. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +0 -154
  256. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +0 -1
  257. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +0 -399
  258. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +0 -1
  259. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +0 -25
  260. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +0 -1
  261. package/dist/esm/modules/modality/__tests__/index-test.mjs +0 -60
  262. package/dist/esm/modules/modality/__tests__/index-test.mjs.map +0 -1
  263. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +0 -15
  264. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +0 -1
  265. package/dist/esm/modules/processColor/__tests__/index-test.mjs +0 -62
  266. package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +0 -1
  267. package/dist/esm/modules/useEvent/__tests__/index-test.mjs +0 -467
  268. package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +0 -1
  269. package/dist/esm/modules/useHover/__tests__/index-test.mjs +0 -359
  270. package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +0 -1
  271. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +0 -102
  272. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +0 -1
  273. package/dist/esm/modules/useStable/__tests__/index-test.mjs +0 -99
  274. package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +0 -1
  275. package/dist/esm/styleTypes.mjs.map +0 -1
  276. package/dist/esm/types.mjs.map +0 -1
  277. package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +0 -236
  278. package/src/StyleSheet/__tests__/compiler-test.tsx +0 -426
  279. package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +0 -169
  280. package/src/StyleSheet/__tests__/index-test.tsx +0 -406
  281. package/src/StyleSheet/__tests__/preprocess-test.tsx +0 -107
  282. package/src/StyleSheet/__tests__/validate-test.tsx +0 -42
  283. package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +0 -44
  284. package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +0 -25
  285. package/src/modules/Platform/__tests__/index-test.tsx +0 -45
  286. package/src/modules/UIManager/__tests__/index-test.tsx +0 -87
  287. package/src/modules/createDOMProps/__tests__/index-test.tsx +0 -138
  288. package/src/modules/createEventHandle/__tests__/index-test.tsx +0 -459
  289. package/src/modules/mergeRefs/__tests__/index-test.tsx +0 -32
  290. package/src/modules/modality/__tests__/index-test.tsx +0 -66
  291. package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +0 -23
  292. package/src/modules/processColor/__tests__/index-test.tsx +0 -78
  293. package/src/modules/useEvent/__tests__/index-test.tsx +0 -511
  294. package/src/modules/useHover/__tests__/index-test.tsx +0 -342
  295. package/src/modules/useMergeRefs/__tests__/index-test.tsx +0 -91
  296. package/src/modules/useStable/__tests__/index-test.tsx +0 -101
@@ -1,236 +0,0 @@
1
- /**
2
- * Copyright (c) Nicolas Gallagher.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import createReactDOMStyle from '../compiler/createReactDOMStyle'
9
-
10
- const reactNativeStyle = {
11
- boxShadow: '1px 1px 1px 1px #000',
12
- borderWidthLeft: 2,
13
- borderWidth: 1,
14
- borderWidthRight: 3,
15
- display: 'flex',
16
- marginVertical: 0,
17
- opacity: 0,
18
- shadowColor: 'red',
19
- shadowOffset: { width: 1, height: 2 },
20
- resizeMode: 'contain',
21
- }
22
-
23
- describe('compiler/createReactDOMStyle', () => {
24
- test('noop on DOM styles', () => {
25
- const firstStyle = createReactDOMStyle(reactNativeStyle)
26
- const secondStyle = createReactDOMStyle(firstStyle)
27
- expect(firstStyle).toEqual(secondStyle)
28
- })
29
-
30
- test('shortform -> longform for inline styles', () => {
31
- const style = {
32
- borderStyle: 'solid',
33
- boxSizing: 'border-box',
34
- borderBottomColor: 'white',
35
- borderBottomWidth: 1,
36
- borderWidth: 0,
37
- marginTop: 50,
38
- marginVertical: 25,
39
- margin: 10,
40
- overflow: 'hidden',
41
- overscrollBehavior: 'contain',
42
- paddingLeft: 50,
43
- paddingHorizontal: 25,
44
- padding: 10,
45
- }
46
-
47
- expect(createReactDOMStyle(style, true)).toMatchInlineSnapshot(`
48
- {
49
- "borderBottomColor": "rgba(255,255,255,1.00)",
50
- "borderBottomStyle": "solid",
51
- "borderBottomWidth": "1px",
52
- "borderLeftStyle": "solid",
53
- "borderLeftWidth": "0px",
54
- "borderRightStyle": "solid",
55
- "borderRightWidth": "0px",
56
- "borderTopStyle": "solid",
57
- "borderTopWidth": "0px",
58
- "boxSizing": "border-box",
59
- "marginBottom": "25px",
60
- "marginLeft": "10px",
61
- "marginRight": "10px",
62
- "marginTop": "50px",
63
- "overflowX": "hidden",
64
- "overflowY": "hidden",
65
- "overscrollBehaviorX": "contain",
66
- "overscrollBehaviorY": "contain",
67
- "paddingBottom": "10px",
68
- "paddingLeft": "50px",
69
- "paddingRight": "25px",
70
- "paddingTop": "10px",
71
- }
72
- `)
73
- })
74
-
75
- test('aspectRatio', () => {
76
- expect(createReactDOMStyle({ aspectRatio: 9 / 16 })).toEqual({
77
- aspectRatio: '0.5625',
78
- })
79
- })
80
-
81
- describe('flexbox styles', () => {
82
- test('flex: -1', () => {
83
- expect(createReactDOMStyle({ flex: -1 })).toEqual({
84
- flexGrow: 0,
85
- flexShrink: 1,
86
- flexBasis: 'auto',
87
- })
88
- })
89
-
90
- test('flex: 0', () => {
91
- expect(createReactDOMStyle({ flex: 0 })).toEqual({
92
- flex: 0,
93
- })
94
- })
95
-
96
- test('flex: 1', () => {
97
- expect(createReactDOMStyle({ flex: 1 })).toEqual({
98
- flex: 1,
99
- })
100
- })
101
-
102
- test('flex: 10', () => {
103
- expect(createReactDOMStyle({ flex: 10 })).toEqual({
104
- flex: 10,
105
- })
106
- })
107
-
108
- test('flexBasis overrides', () => {
109
- // is flex-basis applied?
110
- expect(createReactDOMStyle({ flexBasis: '25%' })).toEqual({
111
- flexBasis: '25%',
112
- })
113
-
114
- // can flex-basis override the 'flex' expansion?
115
- expect(createReactDOMStyle({ flex: 1, flexBasis: '25%' })).toEqual({
116
- flex: 1,
117
- flexBasis: '25%',
118
- })
119
- })
120
-
121
- test('flexShrink overrides', () => {
122
- // is flex-shrink applied?
123
- expect(createReactDOMStyle({ flexShrink: 1 })).toEqual({
124
- flexShrink: 1,
125
- })
126
-
127
- // can flex-shrink override the 'flex' expansion?
128
- expect(createReactDOMStyle({ flex: 1, flexShrink: 2 })).toEqual({
129
- flex: 1,
130
- flexShrink: 2,
131
- })
132
- })
133
- })
134
-
135
- describe('fontFamily', () => {
136
- test('general case', () => {
137
- expect(createReactDOMStyle({ fontFamily: 'Georgia, Times, serif' }))
138
- .toMatchInlineSnapshot(`
139
- {
140
- "fontFamily": "Georgia, Times, serif",
141
- }
142
- `)
143
- })
144
-
145
- test('"monospace"', () => {
146
- expect(createReactDOMStyle({ fontFamily: 'monospace' })).toMatchInlineSnapshot(`
147
- {
148
- "fontFamily": "monospace,monospace",
149
- }
150
- `)
151
- })
152
-
153
- test('"System"', () => {
154
- expect(createReactDOMStyle({ fontFamily: 'System' })).toMatchInlineSnapshot(`
155
- {
156
- "fontFamily": "-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
157
- }
158
- `)
159
- expect(createReactDOMStyle({ font: '14px System' })).toMatchInlineSnapshot(`
160
- {
161
- "font": "14px -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
162
- }
163
- `)
164
- })
165
-
166
- test('"Noto, System"', () => {
167
- expect(createReactDOMStyle({ fontFamily: 'Noto, System' })).toMatchInlineSnapshot(`
168
- {
169
- "fontFamily": "Noto,-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
170
- }
171
- `)
172
- expect(createReactDOMStyle({ font: '14px Noto, System' })).toMatchInlineSnapshot(`
173
- {
174
- "font": "14px Noto, -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif",
175
- }
176
- `)
177
- })
178
-
179
- test('"Noto, BlinkMacSystemFont"', () => {
180
- expect(createReactDOMStyle({ fontFamily: 'Noto, BlinkMacSystemFont' }))
181
- .toMatchInlineSnapshot(`
182
- {
183
- "fontFamily": "Noto,BlinkMacSystemFont",
184
- }
185
- `)
186
- })
187
- })
188
-
189
- test('fontVariant', () => {
190
- expect(
191
- createReactDOMStyle({ fontVariant: ['common-ligatures', 'small-caps'] })
192
- ).toEqual({
193
- fontVariant: 'common-ligatures small-caps',
194
- })
195
- })
196
-
197
- test('textAlignVertical', () => {
198
- expect(
199
- createReactDOMStyle({
200
- textAlignVertical: 'center',
201
- })
202
- ).toEqual({
203
- verticalAlign: 'middle',
204
- })
205
- })
206
-
207
- describe('transform', () => {
208
- // passthrough if transform value is ever a string
209
- test('string', () => {
210
- const transform = 'perspective(50px) scaleX(20) translateX(20px) rotate(20deg)'
211
- const style = { transform }
212
- const resolved = createReactDOMStyle(style)
213
-
214
- expect(resolved).toEqual({ transform })
215
- })
216
-
217
- test('array', () => {
218
- const style = {
219
- transform: [
220
- { perspective: 50 },
221
- { scaleX: 20 },
222
- { translateX: 20 },
223
- { rotate: '20deg' },
224
- { matrix: [1, 2, 3, 4, 5, 6] },
225
- { matrix3d: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] },
226
- ],
227
- }
228
- const resolved = createReactDOMStyle(style)
229
-
230
- expect(resolved).toEqual({
231
- transform:
232
- 'perspective(50px) scaleX(20) translateX(20px) rotate(20deg) matrix(1,2,3,4,5,6) matrix3d(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)',
233
- })
234
- })
235
- })
236
- })
@@ -1,426 +0,0 @@
1
- /**
2
- * Copyright (c) Nicolas Gallagher.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- import { atomic, classic, inline } from '../compiler'
9
-
10
- describe('StyleSheet/compile', () => {
11
- describe('atomic', () => {
12
- test('converts style to atomic CSS', () => {
13
- const result = atomic({
14
- animationDirection: ['alternate', 'alternate-reverse'],
15
- animationKeyframes: [
16
- { '0%': { top: 0 }, '50%': { top: 5 }, '100%': { top: 10 } },
17
- { from: { left: 0 }, to: { left: 10 } },
18
- ],
19
- fontFamily: 'System',
20
- marginHorizontal: 10,
21
- marginStart: 1,
22
- marginEnd: 2,
23
- placeholderTextColor: 'gray',
24
- scrollbarWidth: 'none',
25
- pointerEvents: 'box-only',
26
- start: '12.34%',
27
- textAlign: 'start',
28
- transform: [
29
- {
30
- translateX: 50,
31
- scale: -1,
32
- },
33
- ],
34
- })
35
-
36
- expect(result).toMatchInlineSnapshot(`
37
- [
38
- {
39
- "$$css": true,
40
- "$$css$localize": true,
41
- "animationDirection": "r-animationDirection-1kmv48j",
42
- "animationKeyframes": "r-animationKeyframes-zacbmr",
43
- "fontFamily": "r-fontFamily-1qd0xha",
44
- "marginEnd": [
45
- "r-marginRight-a5pmau",
46
- "r-marginLeft-9cviqr",
47
- ],
48
- "marginHorizontal": "r-marginHorizontal-vlx1xi",
49
- "marginStart": [
50
- "r-marginLeft-13kc5u0",
51
- "r-marginRight-1knfw1x",
52
- ],
53
- "placeholderTextColor": "r-placeholderTextColor-1418aci",
54
- "pointerEvents": "r-pointerEvents-ah5dr5",
55
- "scrollbarWidth": "r-scrollbarWidth-2eszeu",
56
- "start": [
57
- "r-left-2s0hu9",
58
- "r-right-1bnbe1j",
59
- ],
60
- "textAlign": [
61
- "r-textAlign-fdjqy7",
62
- "r-textAlign-1ff274t",
63
- ],
64
- "transform": "r-transform-1ehiua4",
65
- },
66
- [
67
- [
68
- [
69
- ".r-animationDirection-1kmv48j{animation-direction:alternate,alternate-reverse;}",
70
- ],
71
- 2.2,
72
- ],
73
- [
74
- [
75
- ".r-animationKeyframes-zacbmr{animation-name:r-animation-8jhqzh,r-animation-5azpl5;}",
76
- "@-webkit-keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
77
- "@keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
78
- "@-webkit-keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
79
- "@keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
80
- ],
81
- 2.2,
82
- ],
83
- [
84
- [
85
- ".r-fontFamily-1qd0xha{font-family:-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif;}",
86
- ],
87
- 2.2,
88
- ],
89
- [
90
- [
91
- ".r-marginRight-a5pmau{margin-right:2px;}",
92
- ],
93
- 2.2,
94
- ],
95
- [
96
- [
97
- ".r-marginLeft-9cviqr{margin-left:2px;}",
98
- ],
99
- 2.2,
100
- ],
101
- [
102
- [
103
- ".r-marginHorizontal-vlx1xi{margin-left:10px;margin-right:10px;}",
104
- ],
105
- 2.1,
106
- ],
107
- [
108
- [
109
- ".r-marginLeft-13kc5u0{margin-left:1px;}",
110
- ],
111
- 2.2,
112
- ],
113
- [
114
- [
115
- ".r-marginRight-1knfw1x{margin-right:1px;}",
116
- ],
117
- 2.2,
118
- ],
119
- [
120
- [
121
- ".r-placeholderTextColor-1418aci::-webkit-input-placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
122
- ".r-placeholderTextColor-1418aci::-moz-placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
123
- ".r-placeholderTextColor-1418aci:-ms-input-placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
124
- ".r-placeholderTextColor-1418aci::placeholder{color:rgba(128,128,128,1.00);opacity:1;}",
125
- ],
126
- 2.2,
127
- ],
128
- [
129
- [
130
- ".r-pointerEvents-ah5dr5>*{pointer-events:none;}",
131
- ".r-pointerEvents-ah5dr5{pointer-events:auto!important;}",
132
- ],
133
- 2.2,
134
- ],
135
- [
136
- [
137
- ".r-scrollbarWidth-2eszeu::-webkit-scrollbar{display:none}",
138
- ".r-scrollbarWidth-2eszeu{scrollbar-width:none;}",
139
- ],
140
- 2.2,
141
- ],
142
- [
143
- [
144
- ".r-left-2s0hu9{left:12.34%;}",
145
- ],
146
- 2.2,
147
- ],
148
- [
149
- [
150
- ".r-right-1bnbe1j{right:12.34%;}",
151
- ],
152
- 2.2,
153
- ],
154
- [
155
- [
156
- ".r-textAlign-fdjqy7{text-align:left;}",
157
- ],
158
- 2.2,
159
- ],
160
- [
161
- [
162
- ".r-textAlign-1ff274t{text-align:right;}",
163
- ],
164
- 2.2,
165
- ],
166
- [
167
- [
168
- ".r-transform-1ehiua4{transform:translateX(50px);}",
169
- ],
170
- 2.2,
171
- ],
172
- ],
173
- ]
174
- `)
175
- })
176
- })
177
-
178
- describe('classic', () => {
179
- test('converts style to classic CSS', () => {
180
- const result = classic(
181
- {
182
- animationDirection: ['alternate', 'alternate-reverse'],
183
- animationKeyframes: [
184
- { '0%': { top: 0 }, '50%': { top: 5 }, '100%': { top: 10 } },
185
- { from: { left: 0 }, to: { left: 10 } },
186
- ],
187
- marginHorizontal: 10,
188
- font: '14px System',
189
- transform: [
190
- {
191
- translateX: 50,
192
- scale: -1,
193
- },
194
- ],
195
- },
196
- 'text'
197
- )
198
- expect(result).toMatchInlineSnapshot(`
199
- [
200
- {
201
- "$$css": true,
202
- "css-text-1jr0ypv": "css-text-1jr0ypv",
203
- },
204
- [
205
- [
206
- [
207
- "@-webkit-keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
208
- "@keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}",
209
- "@-webkit-keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
210
- "@keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}",
211
- ".css-text-1jr0ypv{animation-direction:alternate,alternate-reverse;animation-name:r-animation-8jhqzh,r-animation-5azpl5;font:14px -apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif;margin-left:10px;margin-right:10px;transform:translateX(50px);}",
212
- ],
213
- 1,
214
- ],
215
- ],
216
- ]
217
- `)
218
- })
219
- })
220
-
221
- describe('inline', () => {
222
- test('converts style to inline styles', () => {
223
- const result = inline({
224
- marginHorizontal: 10,
225
- display: 'flex',
226
- flexShrink: 1,
227
- })
228
-
229
- expect(result).toMatchInlineSnapshot(`
230
- {
231
- "display": "flex",
232
- "flexShrink": 1,
233
- "marginLeft": "10px",
234
- "marginRight": "10px",
235
- }
236
- `)
237
- })
238
-
239
- describe('logical style polyfill', () => {
240
- ;[false, true].forEach((isRTL) => {
241
- const dir = isRTL ? 'rtl' : 'ltr'
242
-
243
- test(`ignores "left" properties for ${dir}`, () => {
244
- const initial = {
245
- borderLeftColor: 'rgba(255,0,0,1.00)',
246
- borderLeftStyle: 'solid',
247
- borderLeftWidth: '1px',
248
- left: '1px',
249
- marginLeft: '5px',
250
- paddingLeft: '10px',
251
- }
252
- expect(inline(initial, isRTL)).toEqual(initial)
253
- })
254
-
255
- test(`ignores "right" properties for ${dir}`, () => {
256
- const initial = {
257
- borderRightColor: 'rgba(255,0,0,1.00)',
258
- borderRightStyle: 'solid',
259
- borderRightWidth: '1px',
260
- right: '1px',
261
- marginRight: '5px',
262
- paddingRight: '10px',
263
- }
264
- expect(inline(initial, isRTL)).toEqual(initial)
265
- })
266
-
267
- test(`ignores "left" values for ${dir}`, () => {
268
- const initial = {
269
- clear: 'left',
270
- float: 'left',
271
- textAlign: 'left',
272
- transitionProperty: 'left',
273
- }
274
- expect(inline(initial, isRTL)).toEqual(initial)
275
- })
276
-
277
- test(`ignores "right" values for ${dir}`, () => {
278
- const initial = {
279
- clear: 'right',
280
- float: 'right',
281
- textAlign: 'right',
282
- transitionProperty: 'right',
283
- }
284
- expect(inline(initial, isRTL)).toEqual(initial)
285
- })
286
-
287
- test(`converts "start" properties for ${dir}`, () => {
288
- const initial = {
289
- borderStartColor: 'red',
290
- borderStartStyle: 'solid',
291
- borderStartWidth: 1,
292
- start: 1,
293
- marginStart: 5,
294
- paddingStart: 10,
295
- }
296
-
297
- const expectedLTR = {
298
- borderLeftColor: 'rgba(255,0,0,1.00)',
299
- borderLeftStyle: 'solid',
300
- borderLeftWidth: '1px',
301
- left: '1px',
302
- marginLeft: '5px',
303
- paddingLeft: '10px',
304
- }
305
- const expectedRTL = {
306
- borderRightColor: 'rgba(255,0,0,1.00)',
307
- borderRightStyle: 'solid',
308
- borderRightWidth: '1px',
309
- right: '1px',
310
- marginRight: '5px',
311
- paddingRight: '10px',
312
- }
313
- expect(inline(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR)
314
- })
315
-
316
- test(`converts "end" properties for ${dir}`, () => {
317
- const initial = {
318
- borderEndColor: 'red',
319
- borderEndStyle: 'solid',
320
- borderEndWidth: 1,
321
- end: 1,
322
- marginEnd: 5,
323
- paddingEnd: 10,
324
- }
325
-
326
- const expectedLTR = {
327
- borderRightColor: 'rgba(255,0,0,1.00)',
328
- borderRightStyle: 'solid',
329
- borderRightWidth: '1px',
330
- right: '1px',
331
- marginRight: '5px',
332
- paddingRight: '10px',
333
- }
334
- const expectedRTL = {
335
- borderLeftColor: 'rgba(255,0,0,1.00)',
336
- borderLeftStyle: 'solid',
337
- borderLeftWidth: '1px',
338
- left: '1px',
339
- marginLeft: '5px',
340
- paddingLeft: '10px',
341
- }
342
- expect(inline(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR)
343
- })
344
-
345
- test(`converts "start" values for ${dir}`, () => {
346
- const initial = {
347
- clear: 'start',
348
- float: 'start',
349
- textAlign: 'start',
350
- transitionProperty: 'start',
351
- }
352
-
353
- const expectedLTR = {
354
- clear: 'left',
355
- float: 'left',
356
- textAlign: 'left',
357
- transitionProperty: 'left',
358
- }
359
- const expectedRTL = {
360
- clear: 'right',
361
- float: 'right',
362
- textAlign: 'right',
363
- transitionProperty: 'right',
364
- }
365
- expect(inline(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR)
366
- })
367
-
368
- test(`converts "end" values for ${dir}`, () => {
369
- const initial = {
370
- clear: 'end',
371
- float: 'end',
372
- textAlign: 'end',
373
- transitionProperty: 'end',
374
- }
375
-
376
- const expectedLTR = {
377
- clear: 'right',
378
- float: 'right',
379
- textAlign: 'right',
380
- transitionProperty: 'right',
381
- }
382
- const expectedRTL = {
383
- clear: 'left',
384
- float: 'left',
385
- textAlign: 'left',
386
- transitionProperty: 'left',
387
- }
388
- expect(inline(initial, isRTL)).toEqual(isRTL ? expectedRTL : expectedLTR)
389
- })
390
-
391
- test('end/start properties take precedence over left/right', () => {
392
- const initialLTR = {
393
- borderStartWidth: 10,
394
- borderLeftWidth: 0,
395
- end: 10,
396
- right: 0,
397
- marginStart: 10,
398
- marginLeft: 0,
399
- }
400
- const expectedLTR = {
401
- borderLeftWidth: '10px',
402
- marginLeft: '10px',
403
- right: '10px',
404
- }
405
-
406
- const initialRTL = {
407
- borderStartWidth: 10,
408
- borderRightWidth: 0,
409
- end: 10,
410
- left: 0,
411
- marginStart: 10,
412
- marginRight: 0,
413
- }
414
- const expectedRTL = {
415
- borderRightWidth: '10px',
416
- marginRight: '10px',
417
- left: '10px',
418
- }
419
- expect(inline(isRTL ? initialRTL : initialLTR, isRTL)).toEqual(
420
- isRTL ? expectedRTL : expectedLTR
421
- )
422
- })
423
- })
424
- })
425
- })
426
- })