@hanzogui/react-native-web-internals 2.0.0

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 +240 -0
  3. package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +407 -0
  4. package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +121 -0
  5. package/dist/cjs/StyleSheet/__tests__/index-test.cjs +404 -0
  6. package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +108 -0
  7. package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +36 -0
  8. package/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +87 -0
  9. package/dist/cjs/StyleSheet/compiler/hash.cjs +26 -0
  10. package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +36 -0
  11. package/dist/cjs/StyleSheet/compiler/index.cjs +318 -0
  12. package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +40 -0
  13. package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +43 -0
  14. package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +48 -0
  15. package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +37 -0
  16. package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +110 -0
  17. package/dist/cjs/StyleSheet/dom/index.cjs +67 -0
  18. package/dist/cjs/StyleSheet/index.cjs +57 -0
  19. package/dist/cjs/StyleSheet/preprocess.cjs +101 -0
  20. package/dist/cjs/StyleSheet/validate.cjs +69 -0
  21. package/dist/cjs/TextAncestorContext.cjs +27 -0
  22. package/dist/cjs/colorProps.cjs +37 -0
  23. package/dist/cjs/index.cjs +103 -0
  24. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +50 -0
  25. package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +40 -0
  26. package/dist/cjs/modules/AccessibilityUtil/index.cjs +33 -0
  27. package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +26 -0
  28. package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +57 -0
  29. package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +47 -0
  30. package/dist/cjs/modules/AssetRegistry/index.cjs +33 -0
  31. package/dist/cjs/modules/ImageLoader/index.cjs +111 -0
  32. package/dist/cjs/modules/InteractionManager.cjs +184 -0
  33. package/dist/cjs/modules/Platform/__tests__/index-test.cjs +48 -0
  34. package/dist/cjs/modules/Platform/index.cjs +30 -0
  35. package/dist/cjs/modules/TextInputState/index.cjs +55 -0
  36. package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +90 -0
  37. package/dist/cjs/modules/UIManager/index.cjs +60 -0
  38. package/dist/cjs/modules/canUseDOM.cjs +26 -0
  39. package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +156 -0
  40. package/dist/cjs/modules/createDOMProps/index.cjs +179 -0
  41. package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +344 -0
  42. package/dist/cjs/modules/createEventHandle/index.cjs +67 -0
  43. package/dist/cjs/modules/dismissKeyboard/index.cjs +29 -0
  44. package/dist/cjs/modules/forwardedProps/index.cjs +161 -0
  45. package/dist/cjs/modules/getBoundingClientRect/index.cjs +28 -0
  46. package/dist/cjs/modules/invariant.cjs +36 -0
  47. package/dist/cjs/modules/isSelectionValid/index.cjs +35 -0
  48. package/dist/cjs/modules/isWebColor/index.cjs +26 -0
  49. package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +42 -0
  50. package/dist/cjs/modules/mergeRefs/index.cjs +42 -0
  51. package/dist/cjs/modules/modality/__tests__/index-test.cjs +32 -0
  52. package/dist/cjs/modules/modality/index.cjs +135 -0
  53. package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +30 -0
  54. package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +35 -0
  55. package/dist/cjs/modules/normalizeColor/index.cjs +39 -0
  56. package/dist/cjs/modules/pick/index.cjs +30 -0
  57. package/dist/cjs/modules/processColor/__tests__/index-test.cjs +66 -0
  58. package/dist/cjs/modules/processColor/index.cjs +42 -0
  59. package/dist/cjs/modules/requestIdleCallback/index.cjs +44 -0
  60. package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +35 -0
  61. package/dist/cjs/modules/setValueForStyles/index.cjs +35 -0
  62. package/dist/cjs/modules/unitlessNumbers/index.cjs +85 -0
  63. package/dist/cjs/modules/useElementLayout/index.cjs +39 -0
  64. package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +408 -0
  65. package/dist/cjs/modules/useEvent/index.cjs +45 -0
  66. package/dist/cjs/modules/useHover/__tests__/index-test.cjs +273 -0
  67. package/dist/cjs/modules/useHover/index.cjs +97 -0
  68. package/dist/cjs/modules/useLayoutEffect/index.cjs +39 -0
  69. package/dist/cjs/modules/useLocale/index.cjs +66 -0
  70. package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +83 -0
  71. package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +102 -0
  72. package/dist/cjs/modules/useMergeRefs/index.cjs +43 -0
  73. package/dist/cjs/modules/usePlatformMethods/index.cjs +35 -0
  74. package/dist/cjs/modules/useStable/__tests__/index-test.cjs +92 -0
  75. package/dist/cjs/modules/useStable/index.cjs +42 -0
  76. package/dist/cjs/styleTypes.cjs +16 -0
  77. package/dist/cjs/types.cjs +16 -0
  78. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +219 -0
  79. package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +1 -0
  80. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +408 -0
  81. package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +1 -0
  82. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +100 -0
  83. package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +1 -0
  84. package/dist/esm/StyleSheet/__tests__/index-test.mjs +383 -0
  85. package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +1 -0
  86. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +109 -0
  87. package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +1 -0
  88. package/dist/esm/StyleSheet/__tests__/validate-test.mjs +37 -0
  89. package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +1 -0
  90. package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +63 -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 +13 -0
  95. package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -0
  96. package/dist/esm/StyleSheet/compiler/index.mjs +292 -0
  97. package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -0
  98. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +17 -0
  99. package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -0
  100. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +20 -0
  101. package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -0
  102. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +25 -0
  103. package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -0
  104. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +14 -0
  105. package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -0
  106. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +87 -0
  107. package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -0
  108. package/dist/esm/StyleSheet/dom/index.mjs +44 -0
  109. package/dist/esm/StyleSheet/dom/index.mjs.map +1 -0
  110. package/dist/esm/StyleSheet/index.mjs +33 -0
  111. package/dist/esm/StyleSheet/index.mjs.map +1 -0
  112. package/dist/esm/StyleSheet/preprocess.mjs +75 -0
  113. package/dist/esm/StyleSheet/preprocess.mjs.map +1 -0
  114. package/dist/esm/StyleSheet/validate.mjs +46 -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 +29 -0
  125. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +1 -0
  126. package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +19 -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 +34 -0
  133. package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -0
  134. package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +24 -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 +87 -0
  139. package/dist/esm/modules/ImageLoader/index.mjs.map +1 -0
  140. package/dist/esm/modules/InteractionManager.mjs +161 -0
  141. package/dist/esm/modules/InteractionManager.mjs.map +1 -0
  142. package/dist/esm/modules/Platform/__tests__/index-test.mjs +27 -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 +32 -0
  147. package/dist/esm/modules/TextInputState/index.mjs.map +1 -0
  148. package/dist/esm/modules/UIManager/__tests__/index-test.mjs +69 -0
  149. package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +1 -0
  150. package/dist/esm/modules/UIManager/index.mjs +37 -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 +135 -0
  155. package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +1 -0
  156. package/dist/esm/modules/createDOMProps/index.mjs +155 -0
  157. package/dist/esm/modules/createDOMProps/index.mjs.map +1 -0
  158. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +323 -0
  159. package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +1 -0
  160. package/dist/esm/modules/createEventHandle/index.mjs +42 -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 +5 -0
  167. package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -0
  168. package/dist/esm/modules/invariant.mjs +12 -0
  169. package/dist/esm/modules/invariant.mjs.map +1 -0
  170. package/dist/esm/modules/isSelectionValid/index.mjs +12 -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 +21 -0
  175. package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +1 -0
  176. package/dist/esm/modules/mergeRefs/index.mjs +19 -0
  177. package/dist/esm/modules/mergeRefs/index.mjs.map +1 -0
  178. package/dist/esm/modules/modality/__tests__/index-test.mjs +33 -0
  179. package/dist/esm/modules/modality/__tests__/index-test.mjs.map +1 -0
  180. package/dist/esm/modules/modality/index.mjs +109 -0
  181. package/dist/esm/modules/modality/index.mjs.map +1 -0
  182. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +9 -0
  183. package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +1 -0
  184. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +12 -0
  185. package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -0
  186. package/dist/esm/modules/normalizeColor/index.mjs +16 -0
  187. package/dist/esm/modules/normalizeColor/index.mjs.map +1 -0
  188. package/dist/esm/modules/pick/index.mjs +7 -0
  189. package/dist/esm/modules/pick/index.mjs.map +1 -0
  190. package/dist/esm/modules/processColor/__tests__/index-test.mjs +45 -0
  191. package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +1 -0
  192. package/dist/esm/modules/processColor/index.mjs +8 -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 +12 -0
  197. package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -0
  198. package/dist/esm/modules/setValueForStyles/index.mjs +12 -0
  199. package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -0
  200. package/dist/esm/modules/unitlessNumbers/index.mjs +62 -0
  201. package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -0
  202. package/dist/esm/modules/useElementLayout/index.mjs +16 -0
  203. package/dist/esm/modules/useElementLayout/index.mjs.map +1 -0
  204. package/dist/esm/modules/useEvent/__tests__/index-test.mjs +387 -0
  205. package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +1 -0
  206. package/dist/esm/modules/useEvent/index.mjs +22 -0
  207. package/dist/esm/modules/useEvent/index.mjs.map +1 -0
  208. package/dist/esm/modules/useHover/__tests__/index-test.mjs +252 -0
  209. package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +1 -0
  210. package/dist/esm/modules/useHover/index.mjs +74 -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 +30 -0
  215. package/dist/esm/modules/useLocale/index.mjs.map +1 -0
  216. package/dist/esm/modules/useLocale/isLocaleRTL.mjs +60 -0
  217. package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -0
  218. package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +81 -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 +12 -0
  223. package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -0
  224. package/dist/esm/modules/useStable/__tests__/index-test.mjs +71 -0
  225. package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +1 -0
  226. package/dist/esm/modules/useStable/index.mjs +8 -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,87 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var createReactDOMStyle_exports = {};
22
+ __export(createReactDOMStyle_exports, {
23
+ createReactDOMStyle: () => createReactDOMStyle,
24
+ createTransformValue: () => createTransformValue
25
+ });
26
+ module.exports = __toCommonJS(createReactDOMStyle_exports);
27
+ var import_canUseDOM = require("../../modules/canUseDOM.cjs"),
28
+ import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
29
+ const emptyObject = {},
30
+ supportsCSS3TextDecoration = !import_canUseDOM.canUseDOM || window.CSS != null && window.CSS.supports != null && (window.CSS.supports("text-decoration-line", "none") || window.CSS.supports("-webkit-text-decoration-line", "none")),
31
+ ignoredProps = {
32
+ elevation: !0,
33
+ overlayColor: !0,
34
+ resizeMode: !0,
35
+ tintColor: !0
36
+ },
37
+ MONOSPACE_FONT_STACK = "monospace,monospace",
38
+ SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',
39
+ STYLE_SHORT_FORM_EXPANSIONS = {
40
+ borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
41
+ borderRadius: ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
42
+ borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
43
+ borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
44
+ marginHorizontal: ["marginRight", "marginLeft"],
45
+ marginVertical: ["marginTop", "marginBottom"],
46
+ overflow: ["overflowX", "overflowY"],
47
+ overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
48
+ paddingHorizontal: ["paddingRight", "paddingLeft"],
49
+ paddingVertical: ["paddingTop", "paddingBottom"]
50
+ },
51
+ mapTransform = transform => {
52
+ const type = Object.keys(transform)[0],
53
+ value = transform[type];
54
+ if (type === "matrix" || type === "matrix3d") return `${type}(${value.join(",")})`;
55
+ {
56
+ const normalizedValue = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value, type);
57
+ return `${type}(${normalizedValue})`;
58
+ }
59
+ },
60
+ createTransformValue = style => {
61
+ let transform = style.transform;
62
+ return Array.isArray(style.transform) && (transform = style.transform.map(mapTransform).join(" ")), transform;
63
+ },
64
+ createReactDOMStyle = (style, isInline) => {
65
+ if (!style) return emptyObject;
66
+ const resolvedStyle = {};
67
+ for (const prop in style) {
68
+ const value = style[prop];
69
+ if (
70
+ // Ignore everything with a null value
71
+ !(value == null ||
72
+ // Ignore some React Native styles
73
+ ignoredProps[prop])) if (prop === "aspectRatio") resolvedStyle[prop] = value.toString();else if (prop === "backgroundClip") value === "text" && (resolvedStyle.backgroundClip = value, resolvedStyle.WebkitBackgroundClip = value);else if (prop === "flex") value === -1 ? (resolvedStyle.flexGrow = 0, resolvedStyle.flexShrink = 1, resolvedStyle.flexBasis = "auto") : resolvedStyle.flex = value;else if (prop === "font") resolvedStyle[prop] = value.replace("System", SYSTEM_FONT_STACK);else if (prop === "fontFamily") {
74
+ if (value.indexOf("System") > -1) {
75
+ const stack = value.split(/,\s*/);
76
+ stack[stack.indexOf("System")] = SYSTEM_FONT_STACK, resolvedStyle[prop] = stack.join(",");
77
+ } else value === "monospace" ? resolvedStyle[prop] = MONOSPACE_FONT_STACK : resolvedStyle[prop] = value;
78
+ } else if (prop === "fontVariant") Array.isArray(value) && value.length > 0 && (resolvedStyle.fontVariant = value.join(" "));else if (prop === "textAlignVertical") resolvedStyle.verticalAlign = value === "center" ? "middle" : value;else if (prop === "textDecorationLine") supportsCSS3TextDecoration ? resolvedStyle.textDecorationLine = value : resolvedStyle.textDecoration = value;else if (prop === "transform" || prop === "transformMatrix") resolvedStyle.transform = createTransformValue(style);else if (prop === "writingDirection") resolvedStyle.direction = value;else {
79
+ const value2 = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(style[prop], prop),
80
+ longFormProperties = STYLE_SHORT_FORM_EXPANSIONS[prop];
81
+ isInline && prop === "margin" ? (style.marginHorizontal == null && (resolvedStyle.marginLeft = value2, resolvedStyle.marginRight = value2), style.marginVertical == null && (resolvedStyle.marginTop = value2, resolvedStyle.marginBottom = value2)) : isInline && prop === "padding" ? (style.paddingHorizontal == null && (resolvedStyle.paddingLeft = value2, resolvedStyle.paddingRight = value2), style.paddingVertical == null && (resolvedStyle.paddingTop = value2, resolvedStyle.paddingBottom = value2)) : longFormProperties ? longFormProperties.forEach((longForm, i) => {
82
+ style[longForm] == null && (resolvedStyle[longForm] = value2);
83
+ }) : resolvedStyle[prop] = Array.isArray(value2) ? value2.join(",") : value2;
84
+ }
85
+ }
86
+ return resolvedStyle;
87
+ };
@@ -0,0 +1,26 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var hash_exports = {};
22
+ __export(hash_exports, {
23
+ default: () => import_simple_hash.simpleHash
24
+ });
25
+ module.exports = __toCommonJS(hash_exports);
26
+ var import_simple_hash = require("@hanzogui/simple-hash");
@@ -0,0 +1,36 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var hyphenateStyleName_exports = {};
22
+ __export(hyphenateStyleName_exports, {
23
+ hyphenateStyleName: () => hyphenateStyleName
24
+ });
25
+ module.exports = __toCommonJS(hyphenateStyleName_exports);
26
+ const uppercasePattern = /[A-Z]/g,
27
+ msPattern = /^ms-/,
28
+ cache = {};
29
+ function toHyphenLower(match) {
30
+ return "-" + match.toLowerCase();
31
+ }
32
+ function hyphenateStyleName(name) {
33
+ if (name in cache) return cache[name];
34
+ const hName = name.replace(uppercasePattern, toHyphenLower);
35
+ return cache[name] = msPattern.test(hName) ? "-" + hName : hName;
36
+ }
@@ -0,0 +1,318 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var compiler_exports = {};
22
+ __export(compiler_exports, {
23
+ atomic: () => atomic,
24
+ classic: () => classic,
25
+ inline: () => inline,
26
+ stringifyValueWithProperty: () => stringifyValueWithProperty
27
+ });
28
+ module.exports = __toCommonJS(compiler_exports);
29
+ var import_simple_hash = require("@hanzogui/simple-hash"),
30
+ import_createReactDOMStyle = require("./createReactDOMStyle.cjs"),
31
+ import_hyphenateStyleName = require("./hyphenateStyleName.cjs"),
32
+ import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
33
+ const cache = /* @__PURE__ */new Map(),
34
+ emptyObject = {},
35
+ classicGroup = 1,
36
+ atomicGroup = 2.2,
37
+ customGroup = {
38
+ borderColor: 2,
39
+ borderRadius: 2,
40
+ borderStyle: 2,
41
+ borderWidth: 2,
42
+ display: 2,
43
+ flex: 2,
44
+ margin: 2,
45
+ overflow: 2,
46
+ overscrollBehavior: 2,
47
+ padding: 2,
48
+ marginHorizontal: 2.1,
49
+ marginVertical: 2.1,
50
+ paddingHorizontal: 2.1,
51
+ paddingVertical: 2.1
52
+ },
53
+ borderTopLeftRadius = "borderTopLeftRadius",
54
+ borderTopRightRadius = "borderTopRightRadius",
55
+ borderBottomLeftRadius = "borderBottomLeftRadius",
56
+ borderBottomRightRadius = "borderBottomRightRadius",
57
+ borderLeftColor = "borderLeftColor",
58
+ borderLeftStyle = "borderLeftStyle",
59
+ borderLeftWidth = "borderLeftWidth",
60
+ borderRightColor = "borderRightColor",
61
+ borderRightStyle = "borderRightStyle",
62
+ borderRightWidth = "borderRightWidth",
63
+ right = "right",
64
+ marginLeft = "marginLeft",
65
+ marginRight = "marginRight",
66
+ paddingLeft = "paddingLeft",
67
+ paddingRight = "paddingRight",
68
+ left = "left",
69
+ PROPERTIES_FLIP = {
70
+ [borderTopLeftRadius]: borderTopRightRadius,
71
+ [borderTopRightRadius]: borderTopLeftRadius,
72
+ [borderBottomLeftRadius]: borderBottomRightRadius,
73
+ [borderBottomRightRadius]: borderBottomLeftRadius,
74
+ [borderLeftColor]: borderRightColor,
75
+ [borderLeftStyle]: borderRightStyle,
76
+ [borderLeftWidth]: borderRightWidth,
77
+ [borderRightColor]: borderLeftColor,
78
+ [borderRightStyle]: borderLeftStyle,
79
+ [borderRightWidth]: borderLeftWidth,
80
+ [left]: right,
81
+ [marginLeft]: marginRight,
82
+ [marginRight]: marginLeft,
83
+ [paddingLeft]: paddingRight,
84
+ [paddingRight]: paddingLeft,
85
+ [right]: left
86
+ },
87
+ PROPERTIES_I18N = {
88
+ borderTopStartRadius: borderTopLeftRadius,
89
+ borderTopEndRadius: borderTopRightRadius,
90
+ borderBottomStartRadius: borderBottomLeftRadius,
91
+ borderBottomEndRadius: borderBottomRightRadius,
92
+ borderStartColor: borderLeftColor,
93
+ borderStartStyle: borderLeftStyle,
94
+ borderStartWidth: borderLeftWidth,
95
+ borderEndColor: borderRightColor,
96
+ borderEndStyle: borderRightStyle,
97
+ borderEndWidth: borderRightWidth,
98
+ end: right,
99
+ marginStart: marginLeft,
100
+ marginEnd: marginRight,
101
+ paddingStart: paddingLeft,
102
+ paddingEnd: paddingRight,
103
+ start: left
104
+ },
105
+ PROPERTIES_VALUE = ["clear", "float", "textAlign"];
106
+ function atomic(style) {
107
+ const compiledStyle = {
108
+ $$css: !0
109
+ },
110
+ compiledRules = [];
111
+ function atomicCompile(prop, value) {
112
+ const valueString = stringifyValueWithProperty(value, prop),
113
+ cacheKey = prop + valueString,
114
+ cachedResult = cache.get(cacheKey);
115
+ let identifier;
116
+ if (cachedResult != null) identifier = cachedResult[0], compiledRules.push(cachedResult[1]);else {
117
+ identifier = createIdentifier("r", prop, value);
118
+ const order = customGroup[prop] || atomicGroup,
119
+ orderedRules = [createAtomicRules(identifier, prop, value), order];
120
+ compiledRules.push(orderedRules), cache.set(cacheKey, [identifier, orderedRules]);
121
+ }
122
+ return identifier;
123
+ }
124
+ return Object.keys(style).sort().forEach(prop => {
125
+ const value = style[prop];
126
+ if (value != null) {
127
+ let localizeableValue;
128
+ if (PROPERTIES_VALUE.indexOf(prop) > -1) {
129
+ const left2 = atomicCompile(prop, "left"),
130
+ right2 = atomicCompile(prop, "right");
131
+ value === "start" ? localizeableValue = [left2, right2] : value === "end" && (localizeableValue = [right2, left2]);
132
+ }
133
+ const propPolyfill = PROPERTIES_I18N[prop];
134
+ if (propPolyfill != null) {
135
+ const ltr = atomicCompile(propPolyfill, value),
136
+ rtl = atomicCompile(PROPERTIES_FLIP[propPolyfill], value);
137
+ localizeableValue = [ltr, rtl];
138
+ }
139
+ if (prop === "transitionProperty") {
140
+ const values = Array.isArray(value) ? value : [value],
141
+ polyfillIndices = [];
142
+ for (let i = 0; i < values.length; i++) {
143
+ const val = values[i];
144
+ typeof val == "string" && PROPERTIES_I18N[val] != null && polyfillIndices.push(i);
145
+ }
146
+ if (polyfillIndices.length > 0) {
147
+ const ltrPolyfillValues = [...values],
148
+ rtlPolyfillValues = [...values];
149
+ polyfillIndices.forEach(i => {
150
+ const ltrVal = ltrPolyfillValues[i];
151
+ if (typeof ltrVal == "string") {
152
+ const ltrPolyfill = PROPERTIES_I18N[ltrVal],
153
+ rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];
154
+ ltrPolyfillValues[i] = ltrPolyfill, rtlPolyfillValues[i] = rtlPolyfill;
155
+ const ltr = atomicCompile(prop, ltrPolyfillValues),
156
+ rtl = atomicCompile(prop, rtlPolyfillValues);
157
+ localizeableValue = [ltr, rtl];
158
+ }
159
+ });
160
+ }
161
+ }
162
+ localizeableValue == null ? localizeableValue = atomicCompile(prop, value) : compiledStyle.$$css$localize = !0, compiledStyle[prop] = localizeableValue;
163
+ }
164
+ }), [compiledStyle, compiledRules];
165
+ }
166
+ function classic(style, name) {
167
+ const compiledStyle = {
168
+ $$css: !0
169
+ },
170
+ compiledRules = [],
171
+ {
172
+ animationKeyframes,
173
+ ...rest
174
+ } = style,
175
+ identifier = createIdentifier("css", name, style),
176
+ selector = `.${identifier}`;
177
+ let animationName;
178
+ if (animationKeyframes != null) {
179
+ const [animationNames, keyframesRules] = processKeyframesValue(animationKeyframes);
180
+ animationName = animationNames.join(","), compiledRules.push(...keyframesRules);
181
+ }
182
+ const block = createDeclarationBlock({
183
+ ...rest,
184
+ animationName
185
+ });
186
+ return compiledRules.push(`${selector}${block}`), compiledStyle[identifier] = identifier, [compiledStyle, [[compiledRules, classicGroup]]];
187
+ }
188
+ function inline(originalStyle, isRTL) {
189
+ const style = originalStyle || emptyObject,
190
+ frozenProps = {},
191
+ nextStyle = {};
192
+ for (const originalProp in style) {
193
+ const originalValue = style[originalProp];
194
+ let prop = originalProp,
195
+ value = originalValue;
196
+ if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) continue;
197
+ PROPERTIES_VALUE.indexOf(originalProp) > -1 && (originalValue === "start" ? value = isRTL ? "right" : "left" : originalValue === "end" && (value = isRTL ? "left" : "right"));
198
+ const propPolyfill = PROPERTIES_I18N[originalProp];
199
+ if (propPolyfill != null && (prop = isRTL ? PROPERTIES_FLIP[propPolyfill] : propPolyfill), originalProp === "transitionProperty") {
200
+ const originalValues = Array.isArray(originalValue) ? originalValue : [originalValue];
201
+ originalValues.forEach((val, i) => {
202
+ if (typeof val == "string") {
203
+ const valuePolyfill = PROPERTIES_I18N[val];
204
+ valuePolyfill != null && (originalValues[i] = isRTL ? PROPERTIES_FLIP[valuePolyfill] : valuePolyfill);
205
+ }
206
+ });
207
+ }
208
+ frozenProps[prop] || (nextStyle[prop] = value), PROPERTIES_I18N.hasOwnProperty(originalProp) && (frozenProps[prop] = !0);
209
+ }
210
+ return (0, import_createReactDOMStyle.createReactDOMStyle)(nextStyle, !0);
211
+ }
212
+ function stringifyValueWithProperty(value, property) {
213
+ const normalizedValue = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value, property);
214
+ return typeof normalizedValue != "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
215
+ }
216
+ function createAtomicRules(identifier, property, value) {
217
+ const rules = [],
218
+ selector = `.${identifier}`;
219
+ switch (property) {
220
+ case "animationKeyframes":
221
+ {
222
+ const [animationNames, keyframesRules] = processKeyframesValue(value),
223
+ block = createDeclarationBlock({
224
+ animationName: animationNames.join(",")
225
+ });
226
+ rules.push(`${selector}${block}`, ...keyframesRules);
227
+ break;
228
+ }
229
+ // Equivalent to using '::placeholder'
230
+ case "placeholderTextColor":
231
+ {
232
+ const block = createDeclarationBlock({
233
+ color: value,
234
+ opacity: 1
235
+ });
236
+ rules.push(`${selector}::-webkit-input-placeholder${block}`, `${selector}::-moz-placeholder${block}`, `${selector}:-ms-input-placeholder${block}`, `${selector}::placeholder${block}`);
237
+ break;
238
+ }
239
+ // Polyfill for additional 'pointer-events' values
240
+ // See d13f78622b233a0afc0c7a200c0a0792c8ca9e58
241
+ case "pointerEvents":
242
+ {
243
+ let finalValue = value;
244
+ if (value === "auto" || value === "box-only") {
245
+ if (finalValue = "auto!important", value === "box-only") {
246
+ const block2 = createDeclarationBlock({
247
+ pointerEvents: "none"
248
+ });
249
+ rules.push(`${selector}>*${block2}`);
250
+ }
251
+ } else if ((value === "none" || value === "box-none") && (finalValue = "none!important", value === "box-none")) {
252
+ const block2 = createDeclarationBlock({
253
+ pointerEvents: "auto"
254
+ });
255
+ rules.push(`${selector}>*${block2}`);
256
+ }
257
+ const block = createDeclarationBlock({
258
+ pointerEvents: finalValue
259
+ });
260
+ rules.push(`${selector}${block}`);
261
+ break;
262
+ }
263
+ // Polyfill for draft spec
264
+ // https://drafts.csswg.org/css-scrollbars-1/
265
+ case "scrollbarWidth":
266
+ {
267
+ value === "none" && rules.push(`${selector}::-webkit-scrollbar{display:none}`);
268
+ const block = createDeclarationBlock({
269
+ scrollbarWidth: value
270
+ });
271
+ rules.push(`${selector}${block}`);
272
+ break;
273
+ }
274
+ default:
275
+ {
276
+ const block = createDeclarationBlock({
277
+ [property]: value
278
+ });
279
+ rules.push(`${selector}${block}`);
280
+ break;
281
+ }
282
+ }
283
+ return rules;
284
+ }
285
+ function createDeclarationBlock(style) {
286
+ const domStyle = (0, import_createReactDOMStyle.createReactDOMStyle)(style);
287
+ return `{${Object.keys(domStyle).map(property => {
288
+ const value = domStyle[property],
289
+ prop = (0, import_hyphenateStyleName.hyphenateStyleName)(property);
290
+ return Array.isArray(value) ? value.map(v => `${prop}:${v}`).join(";") : `${prop}:${value}`;
291
+ }).sort().join(";")};}`;
292
+ }
293
+ function createIdentifier(prefix, name, value) {
294
+ const hashedString = (0, import_simple_hash.simpleHash)(name + stringifyValueWithProperty(value, name));
295
+ return process.env.NODE_ENV !== "production" ? `${prefix}-${name}-${hashedString}` : `${prefix}-${hashedString}`;
296
+ }
297
+ function createKeyframes(keyframes) {
298
+ const prefixes = ["-webkit-", ""],
299
+ identifier = createIdentifier("r", "animation", keyframes),
300
+ steps = "{" + Object.keys(keyframes).map(stepName => {
301
+ const rule = keyframes[stepName],
302
+ block = createDeclarationBlock(rule);
303
+ return `${stepName}${block}`;
304
+ }).join("") + "}",
305
+ rules = prefixes.map(prefix => `@${prefix}keyframes ${identifier}${steps}`);
306
+ return [identifier, rules];
307
+ }
308
+ function processKeyframesValue(keyframesValue) {
309
+ if (typeof keyframesValue == "number") throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);
310
+ const animationNames = [],
311
+ rules = [];
312
+ return (Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue]).forEach(keyframes => {
313
+ if (typeof keyframes == "string") animationNames.push(keyframes);else {
314
+ const [identifier, keyframesRules] = createKeyframes(keyframes);
315
+ animationNames.push(identifier), rules.push(...keyframesRules);
316
+ }
317
+ }), [animationNames, rules];
318
+ }
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var normalizeColor_exports = {};
22
+ __export(normalizeColor_exports, {
23
+ normalizeColor: () => normalizeColor
24
+ });
25
+ module.exports = __toCommonJS(normalizeColor_exports);
26
+ var import_isWebColor = require("../../modules/isWebColor/index.cjs"),
27
+ import_processColor = require("../../modules/processColor/index.cjs");
28
+ const normalizeColor = (color, opacity = 1) => {
29
+ if (color == null) return;
30
+ if (typeof color == "string" && (0, import_isWebColor.isWebColor)(color)) return color;
31
+ const colorInt = (0, import_processColor.processColor)(color);
32
+ if (colorInt != null) {
33
+ const r = colorInt >> 16 & 255,
34
+ g = colorInt >> 8 & 255,
35
+ b = colorInt & 255,
36
+ alpha = ((colorInt >> 24 & 255) / 255 * opacity).toFixed(2);
37
+ return `rgba(${r},${g},${b},${alpha})`;
38
+ }
39
+ if (typeof color == "string") return color;
40
+ };
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var normalizeValueWithProperty_exports = {};
22
+ __export(normalizeValueWithProperty_exports, {
23
+ normalizeValueWithProperty: () => normalizeValueWithProperty
24
+ });
25
+ module.exports = __toCommonJS(normalizeValueWithProperty_exports);
26
+ var import_unitlessNumbers = require("../../modules/unitlessNumbers/index.cjs"),
27
+ import_normalizeColor = require("./normalizeColor.cjs");
28
+ const colorProps = {
29
+ backgroundColor: !0,
30
+ borderColor: !0,
31
+ borderTopColor: !0,
32
+ borderRightColor: !0,
33
+ borderBottomColor: !0,
34
+ borderLeftColor: !0,
35
+ color: !0,
36
+ shadowColor: !0,
37
+ textDecorationColor: !0,
38
+ textShadowColor: !0
39
+ };
40
+ function normalizeValueWithProperty(value, property) {
41
+ let returnValue = value;
42
+ return (property == null || !import_unitlessNumbers.unitlessNumbers[property]) && typeof value == "number" ? returnValue = `${value}px` : property != null && colorProps[property] && (returnValue = (0, import_normalizeColor.normalizeColor)(value)), returnValue;
43
+ }
@@ -0,0 +1,48 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var resolveShadowValue_exports = {};
22
+ __export(resolveShadowValue_exports, {
23
+ resolveShadowValue: () => resolveShadowValue
24
+ });
25
+ module.exports = __toCommonJS(resolveShadowValue_exports);
26
+ var import_normalizeColor = require("./normalizeColor.cjs"),
27
+ import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
28
+ const defaultOffset = {
29
+ height: 0,
30
+ width: 0
31
+ },
32
+ resolveShadowValue = style => {
33
+ const {
34
+ shadowColor,
35
+ shadowOffset,
36
+ shadowOpacity,
37
+ shadowRadius
38
+ } = style,
39
+ {
40
+ height,
41
+ width
42
+ } = shadowOffset || defaultOffset,
43
+ offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width),
44
+ offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height),
45
+ blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0),
46
+ color = (0, import_normalizeColor.normalizeColor)(shadowColor || "black", shadowOpacity);
47
+ if (color != null && offsetX != null && offsetY != null && blurRadius != null) return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
48
+ };
@@ -0,0 +1,37 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var createCSSStyleSheet_exports = {};
22
+ __export(createCSSStyleSheet_exports, {
23
+ createCSSStyleSheet: () => createCSSStyleSheet
24
+ });
25
+ module.exports = __toCommonJS(createCSSStyleSheet_exports);
26
+ var import_canUseDOM = require("../../modules/canUseDOM.cjs");
27
+ function createCSSStyleSheet(id, rootNode, textContent) {
28
+ if (import_canUseDOM.canUseDOM) {
29
+ const root = rootNode ?? document;
30
+ let element = root.getElementById(id);
31
+ if (element == null) if (element = document.createElement("style"), element.setAttribute("id", id), typeof textContent == "string" && element.appendChild(document.createTextNode(textContent)), root instanceof ShadowRoot) root.insertBefore(element, root.firstChild);else {
32
+ const head = root.head;
33
+ head && head.appendChild(element);
34
+ }
35
+ return element.sheet;
36
+ } else return null;
37
+ }