@semcore/core 16.0.0-prerelease.2 → 16.0.0-prerelease.21

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 (644) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/lib/LastInteractionType.d.ts +1 -1
  3. package/lib/LastInteractionType.js.map +1 -0
  4. package/lib/LastInteractionType.mjs +51 -0
  5. package/lib/LastInteractionType.mjs.map +1 -0
  6. package/lib/{types/core-types → core-types}/Component.d.ts +2 -2
  7. package/lib/core-types/Component.js.map +1 -1
  8. package/lib/core-types/Component.mjs +28 -31
  9. package/lib/core-types/Component.mjs.map +1 -1
  10. package/lib/core-types/UnknownProperties.mjs +0 -1
  11. package/lib/core-types/symbols.mjs +20 -10
  12. package/lib/coreFactory.js.map +1 -0
  13. package/lib/coreFactory.mjs +324 -0
  14. package/lib/coreFactory.mjs.map +1 -0
  15. package/lib/enhancement/Children.mjs +35 -50
  16. package/lib/enhancement/Root.mjs +21 -35
  17. package/lib/enhancement/bindHandler.mjs +10 -9
  18. package/lib/enhancement/dataName.mjs +5 -4
  19. package/lib/enhancement/enhance.mjs +4 -3
  20. package/lib/enhancement/functionDefaultProps.mjs +5 -5
  21. package/lib/enhancement/hoistProps.mjs +22 -32
  22. package/lib/enhancement/i18n.mjs +8 -8
  23. package/lib/enhancement/inheritedName.mjs +5 -4
  24. package/lib/enhancement/staticChildren.mjs +35 -38
  25. package/lib/enhancement/style.mjs +15 -17
  26. package/lib/enhancement/uncontrolledProps.mjs +28 -44
  27. package/lib/esm/LastInteractionType.mjs +51 -0
  28. package/lib/esm/core-types/Component.mjs +51 -0
  29. package/lib/esm/core-types/symbols.mjs +20 -0
  30. package/lib/esm/coreFactory.mjs +324 -0
  31. package/lib/esm/enhancement/Children.mjs +96 -0
  32. package/lib/esm/enhancement/Root.mjs +56 -0
  33. package/lib/{es6/enhancement/bindHandler.js → esm/enhancement/bindHandler.mjs} +10 -9
  34. package/lib/esm/enhancement/dataName.mjs +13 -0
  35. package/lib/{es6/enhancement/enhance.js → esm/enhancement/enhance.mjs} +4 -3
  36. package/lib/{es6/enhancement/functionDefaultProps.js → esm/enhancement/functionDefaultProps.mjs} +5 -5
  37. package/lib/{es6/enhancement/hoistProps.js → esm/enhancement/hoistProps.mjs} +25 -35
  38. package/lib/esm/enhancement/i18n.mjs +20 -0
  39. package/lib/{es6/enhancement/inheritedName.js → esm/enhancement/inheritedName.mjs} +6 -5
  40. package/lib/{es6/enhancement/staticChildren.js → esm/enhancement/staticChildren.mjs} +38 -41
  41. package/lib/{es6/enhancement/style.js → esm/enhancement/style.mjs} +16 -18
  42. package/lib/{es6/enhancement/uncontrolledProps.js → esm/enhancement/uncontrolledProps.mjs} +30 -46
  43. package/lib/esm/index.mjs +24 -0
  44. package/lib/esm/register.mjs +31 -0
  45. package/lib/esm/styled/index.mjs +8 -0
  46. package/lib/esm/styled/reshadow-core.mjs +234 -0
  47. package/lib/esm/styled/sstyled.mjs +121 -0
  48. package/lib/{es6/utils/assignProps.js → esm/utils/assignProps.mjs} +32 -30
  49. package/lib/esm/utils/canUseDOM.mjs +6 -0
  50. package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
  51. package/lib/esm/utils/createHoc.mjs +44 -0
  52. package/lib/esm/utils/enhances/WithI18n.mjs +78 -0
  53. package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
  54. package/lib/esm/utils/getDisplayName.mjs +6 -0
  55. package/lib/esm/utils/logger.mjs +35 -0
  56. package/lib/{es6/utils/pick.js → esm/utils/pick.mjs} +4 -2
  57. package/lib/esm/utils/ref.mjs +87 -0
  58. package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -0
  59. package/lib/index.js.map +1 -0
  60. package/lib/index.mjs +24 -0
  61. package/lib/index.mjs.map +1 -0
  62. package/lib/register.mjs +13 -11
  63. package/lib/styled/index.mjs +8 -6
  64. package/lib/styled/reshadow-core.mjs +92 -101
  65. package/lib/styled/reshadow-core.mjs.map +1 -1
  66. package/lib/styled/sstyled.mjs +40 -61
  67. package/lib/theme/dark.json +2 -2
  68. package/lib/theme/light.json +3 -3
  69. package/lib/theme/processor.mjs +4 -4
  70. package/lib/theme/themes/auto.css +5 -5
  71. package/lib/theme/themes/dark.css +2 -2
  72. package/lib/{types/theme → theme}/themes/dark.d.ts +1 -1
  73. package/lib/theme/themes/dark.js +1 -1
  74. package/lib/theme/themes/dark.js.map +1 -1
  75. package/lib/theme/themes/dark.mjs +1 -1
  76. package/lib/theme/themes/dark.mjs.map +1 -1
  77. package/lib/theme/themes/default.css +3 -3
  78. package/lib/theme/themes/default.d.ts +1 -1
  79. package/lib/theme/themes/default.js +2 -2
  80. package/lib/theme/themes/default.js.map +1 -1
  81. package/lib/theme/themes/default.mjs +2 -2
  82. package/lib/theme/themes/default.mjs.map +1 -1
  83. package/lib/theme/themes/light.css +3 -3
  84. package/lib/{types/theme → theme}/themes/light.d.ts +1 -1
  85. package/lib/theme/themes/light.js +2 -2
  86. package/lib/theme/themes/light.js.map +1 -1
  87. package/lib/theme/themes/light.mjs +2 -2
  88. package/lib/theme/themes/light.mjs.map +1 -1
  89. package/lib/theme/utils.mjs +9 -9
  90. package/lib/theme/utils.mjs.map +1 -1
  91. package/lib/utils/CSSinJS.mjs +1 -1
  92. package/lib/utils/ScreenReaderOnly.mjs +1 -1
  93. package/lib/utils/ThemeProvider.mjs +4 -4
  94. package/lib/utils/addonText.d.ts +1 -1
  95. package/lib/utils/addonTextChildren.mjs +1 -1
  96. package/lib/utils/assignProps.mjs +35 -33
  97. package/lib/utils/canUseDOM.mjs +5 -3
  98. package/lib/utils/capitalizeFirstLetter.mjs +4 -2
  99. package/lib/utils/color.mjs +2 -2
  100. package/lib/utils/createHoc.mjs +27 -29
  101. package/lib/utils/enhances/WithAutoFocus.mjs +6 -6
  102. package/lib/utils/enhances/WithCSS.mjs +6 -6
  103. package/lib/utils/enhances/WithI18n.mjs +38 -43
  104. package/lib/utils/enhances/WithKeyboardFocus.mjs +6 -6
  105. package/lib/utils/enhances/WithRef.mjs +1 -1
  106. package/lib/utils/enhances/a11yEnhance.mjs +2 -2
  107. package/lib/utils/enhances/animatedSizeEnhance.mjs +15 -15
  108. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  109. package/lib/utils/enhances/autoFocusEnhance.mjs +2 -2
  110. package/lib/utils/enhances/contextEnhance.mjs +4 -4
  111. package/lib/utils/enhances/i18nEnhance.mjs +39 -40
  112. package/lib/utils/enhances/keyboardFocusEnhance.mjs +1 -1
  113. package/lib/utils/eventEmitter.mjs +3 -3
  114. package/lib/utils/findComponent.d.ts +2 -2
  115. package/lib/utils/findComponent.js.map +1 -1
  116. package/lib/utils/findComponent.mjs.map +1 -1
  117. package/lib/utils/focus-lock/isFocusable.mjs +1 -1
  118. package/lib/utils/getAccessibleName.mjs +1 -1
  119. package/lib/utils/getDisplayName.mjs +5 -3
  120. package/lib/utils/getEventTarget.mjs +1 -1
  121. package/lib/utils/hasLabels.mjs +1 -1
  122. package/lib/utils/injectStyle.mjs +1 -1
  123. package/lib/utils/isInteractiveElement.d.ts +1 -0
  124. package/lib/utils/isInteractiveElement.js +34 -0
  125. package/lib/utils/isInteractiveElement.js.map +1 -0
  126. package/lib/utils/isInteractiveElement.mjs +28 -0
  127. package/lib/utils/isInteractiveElement.mjs.map +1 -0
  128. package/lib/utils/isNode.mjs +1 -1
  129. package/lib/utils/logger.mjs +19 -16
  130. package/lib/utils/pick.mjs +4 -2
  131. package/lib/utils/propsForElement.mjs +1 -1
  132. package/lib/utils/ref.d.ts +4 -2
  133. package/lib/utils/ref.js +2 -1
  134. package/lib/utils/ref.js.map +1 -1
  135. package/lib/utils/ref.mjs +50 -46
  136. package/lib/utils/ref.mjs.map +1 -1
  137. package/lib/utils/syncScroll.mjs +1 -1
  138. package/lib/utils/uncontroll.mjs +1 -1
  139. package/lib/utils/uniqueID.mjs +2 -2
  140. package/lib/utils/use/useEnhancedEffect.mjs +4 -3
  141. package/lib/utils/use/useEventListener.js +1 -1
  142. package/lib/utils/use/useEventListener.js.map +1 -1
  143. package/lib/utils/use/useEventListener.mjs +1 -1
  144. package/lib/utils/use/useEventListener.mjs.map +1 -1
  145. package/lib/utils/use/useFocusLock.mjs +2 -2
  146. package/lib/utils/useCssVariable.mjs +3 -3
  147. package/lib/utils/zIndexStacking.mjs +3 -3
  148. package/package.json +44 -20
  149. package/vite.config.ts +24 -0
  150. package/lib/cjs/LastInteractionType.js.map +0 -1
  151. package/lib/cjs/core-types/Component.js +0 -59
  152. package/lib/cjs/core-types/Component.js.map +0 -1
  153. package/lib/cjs/core-types/UnknownProperties.js +0 -2
  154. package/lib/cjs/core-types/UnknownProperties.js.map +0 -1
  155. package/lib/cjs/core-types/reshadow.d.js +0 -2
  156. package/lib/cjs/core-types/reshadow.d.js.map +0 -1
  157. package/lib/cjs/core-types/symbols.js +0 -25
  158. package/lib/cjs/core-types/symbols.js.map +0 -1
  159. package/lib/cjs/coreFactory.js.map +0 -1
  160. package/lib/cjs/enhancement/Children.js +0 -119
  161. package/lib/cjs/enhancement/Children.js.map +0 -1
  162. package/lib/cjs/enhancement/Root.js +0 -78
  163. package/lib/cjs/enhancement/Root.js.map +0 -1
  164. package/lib/cjs/enhancement/bindHandler.js +0 -54
  165. package/lib/cjs/enhancement/bindHandler.js.map +0 -1
  166. package/lib/cjs/enhancement/dataName.js +0 -20
  167. package/lib/cjs/enhancement/dataName.js.map +0 -1
  168. package/lib/cjs/enhancement/enhance.js +0 -22
  169. package/lib/cjs/enhancement/enhance.js.map +0 -1
  170. package/lib/cjs/enhancement/functionDefaultProps.js +0 -36
  171. package/lib/cjs/enhancement/functionDefaultProps.js.map +0 -1
  172. package/lib/cjs/enhancement/hoistProps.js +0 -97
  173. package/lib/cjs/enhancement/hoistProps.js.map +0 -1
  174. package/lib/cjs/enhancement/i18n.js +0 -28
  175. package/lib/cjs/enhancement/i18n.js.map +0 -1
  176. package/lib/cjs/enhancement/inheritedName.js +0 -23
  177. package/lib/cjs/enhancement/inheritedName.js.map +0 -1
  178. package/lib/cjs/enhancement/staticChildren.js +0 -135
  179. package/lib/cjs/enhancement/staticChildren.js.map +0 -1
  180. package/lib/cjs/enhancement/style.js +0 -60
  181. package/lib/cjs/enhancement/style.js.map +0 -1
  182. package/lib/cjs/enhancement/uncontrolledProps.js +0 -131
  183. package/lib/cjs/enhancement/uncontrolledProps.js.map +0 -1
  184. package/lib/cjs/index.js.map +0 -1
  185. package/lib/cjs/register.js +0 -37
  186. package/lib/cjs/register.js.map +0 -1
  187. package/lib/cjs/styled/index.js +0 -32
  188. package/lib/cjs/styled/index.js.map +0 -1
  189. package/lib/cjs/styled/reshadow-core.js +0 -256
  190. package/lib/cjs/styled/reshadow-core.js.map +0 -1
  191. package/lib/cjs/styled/sstyled.js +0 -149
  192. package/lib/cjs/styled/sstyled.js.map +0 -1
  193. package/lib/cjs/theme/dark.json +0 -2506
  194. package/lib/cjs/theme/exclude-tokens.json +0 -10
  195. package/lib/cjs/theme/light.json +0 -2584
  196. package/lib/cjs/theme/processor.js +0 -315
  197. package/lib/cjs/theme/processor.js.map +0 -1
  198. package/lib/cjs/theme/themes/auto.css +0 -1465
  199. package/lib/cjs/theme/themes/dark.css +0 -723
  200. package/lib/cjs/theme/themes/dark.js +0 -385
  201. package/lib/cjs/theme/themes/dark.js.map +0 -1
  202. package/lib/cjs/theme/themes/default.css +0 -742
  203. package/lib/cjs/theme/themes/default.js +0 -394
  204. package/lib/cjs/theme/themes/default.js.map +0 -1
  205. package/lib/cjs/theme/themes/light.css +0 -742
  206. package/lib/cjs/theme/themes/light.js +0 -394
  207. package/lib/cjs/theme/themes/light.js.map +0 -1
  208. package/lib/cjs/theme/utils.js +0 -297
  209. package/lib/cjs/theme/utils.js.map +0 -1
  210. package/lib/cjs/utils/CSSinJS.js +0 -36
  211. package/lib/cjs/utils/CSSinJS.js.map +0 -1
  212. package/lib/cjs/utils/ScreenReaderOnly.js +0 -31
  213. package/lib/cjs/utils/ScreenReaderOnly.js.map +0 -1
  214. package/lib/cjs/utils/ThemeProvider.js +0 -82
  215. package/lib/cjs/utils/ThemeProvider.js.map +0 -1
  216. package/lib/cjs/utils/addonText.js +0 -18
  217. package/lib/cjs/utils/addonText.js.map +0 -1
  218. package/lib/cjs/utils/addonTextChildren.js +0 -45
  219. package/lib/cjs/utils/addonTextChildren.js.map +0 -1
  220. package/lib/cjs/utils/ariaProps.js +0 -22
  221. package/lib/cjs/utils/ariaProps.js.map +0 -1
  222. package/lib/cjs/utils/assignProps.js +0 -93
  223. package/lib/cjs/utils/assignProps.js.map +0 -1
  224. package/lib/cjs/utils/canUseDOM.js +0 -10
  225. package/lib/cjs/utils/canUseDOM.js.map +0 -1
  226. package/lib/cjs/utils/capitalizeFirstLetter.js +0 -10
  227. package/lib/cjs/utils/capitalizeFirstLetter.js.map +0 -1
  228. package/lib/cjs/utils/color.js +0 -208
  229. package/lib/cjs/utils/color.js.map +0 -1
  230. package/lib/cjs/utils/compose.js +0 -21
  231. package/lib/cjs/utils/compose.js.map +0 -1
  232. package/lib/cjs/utils/createHoc.js +0 -55
  233. package/lib/cjs/utils/createHoc.js.map +0 -1
  234. package/lib/cjs/utils/createUUID.js +0 -15
  235. package/lib/cjs/utils/createUUID.js.map +0 -1
  236. package/lib/cjs/utils/cssToIntDefault.js +0 -22
  237. package/lib/cjs/utils/cssToIntDefault.js.map +0 -1
  238. package/lib/cjs/utils/enhances/WithAutoFocus.js +0 -75
  239. package/lib/cjs/utils/enhances/WithAutoFocus.js.map +0 -1
  240. package/lib/cjs/utils/enhances/WithCSS.js +0 -93
  241. package/lib/cjs/utils/enhances/WithCSS.js.map +0 -1
  242. package/lib/cjs/utils/enhances/WithI18n.js +0 -95
  243. package/lib/cjs/utils/enhances/WithI18n.js.map +0 -1
  244. package/lib/cjs/utils/enhances/WithKeyboardFocus.js +0 -93
  245. package/lib/cjs/utils/enhances/WithKeyboardFocus.js.map +0 -1
  246. package/lib/cjs/utils/enhances/WithRef.js +0 -26
  247. package/lib/cjs/utils/enhances/WithRef.js.map +0 -1
  248. package/lib/cjs/utils/enhances/a11yEnhance.js +0 -74
  249. package/lib/cjs/utils/enhances/a11yEnhance.js.map +0 -1
  250. package/lib/cjs/utils/enhances/animatedSizeEnhance.js +0 -98
  251. package/lib/cjs/utils/enhances/animatedSizeEnhance.js.map +0 -1
  252. package/lib/cjs/utils/enhances/autoFocusEnhance.js +0 -46
  253. package/lib/cjs/utils/enhances/autoFocusEnhance.js.map +0 -1
  254. package/lib/cjs/utils/enhances/contextEnhance.js +0 -22
  255. package/lib/cjs/utils/enhances/contextEnhance.js.map +0 -1
  256. package/lib/cjs/utils/enhances/i18nEnhance.js +0 -101
  257. package/lib/cjs/utils/enhances/i18nEnhance.js.map +0 -1
  258. package/lib/cjs/utils/enhances/keyboardFocusEnhance.js +0 -63
  259. package/lib/cjs/utils/enhances/keyboardFocusEnhance.js.map +0 -1
  260. package/lib/cjs/utils/enhances/resolveColorEnhance.js +0 -25
  261. package/lib/cjs/utils/enhances/resolveColorEnhance.js.map +0 -1
  262. package/lib/cjs/utils/eventEmitter.js +0 -41
  263. package/lib/cjs/utils/eventEmitter.js.map +0 -1
  264. package/lib/cjs/utils/findComponent.js +0 -106
  265. package/lib/cjs/utils/findComponent.js.map +0 -1
  266. package/lib/cjs/utils/fire.js +0 -23
  267. package/lib/cjs/utils/fire.js.map +0 -1
  268. package/lib/cjs/utils/focus-lock/focusBorders.js +0 -72
  269. package/lib/cjs/utils/focus-lock/focusBorders.js.map +0 -1
  270. package/lib/cjs/utils/focus-lock/getFocusableIn.js +0 -26
  271. package/lib/cjs/utils/focus-lock/getFocusableIn.js.map +0 -1
  272. package/lib/cjs/utils/focus-lock/isFocusInside.js +0 -16
  273. package/lib/cjs/utils/focus-lock/isFocusInside.js.map +0 -1
  274. package/lib/cjs/utils/focus-lock/isFocusable.js +0 -51
  275. package/lib/cjs/utils/focus-lock/isFocusable.js.map +0 -1
  276. package/lib/cjs/utils/focus-lock/setFocus.js +0 -63
  277. package/lib/cjs/utils/focus-lock/setFocus.js.map +0 -1
  278. package/lib/cjs/utils/getAccessibleName.js +0 -56
  279. package/lib/cjs/utils/getAccessibleName.js.map +0 -1
  280. package/lib/cjs/utils/getDisplayName.js +0 -10
  281. package/lib/cjs/utils/getDisplayName.js.map +0 -1
  282. package/lib/cjs/utils/getEventTarget.js +0 -53
  283. package/lib/cjs/utils/getEventTarget.js.map +0 -1
  284. package/lib/cjs/utils/getOriginChildren.js +0 -18
  285. package/lib/cjs/utils/getOriginChildren.js.map +0 -1
  286. package/lib/cjs/utils/getRandomInt.js +0 -11
  287. package/lib/cjs/utils/getRandomInt.js.map +0 -1
  288. package/lib/cjs/utils/getValue.js +0 -16
  289. package/lib/cjs/utils/getValue.js.map +0 -1
  290. package/lib/cjs/utils/hasLabels.js +0 -47
  291. package/lib/cjs/utils/hasLabels.js.map +0 -1
  292. package/lib/cjs/utils/hasParent.js +0 -14
  293. package/lib/cjs/utils/hasParent.js.map +0 -1
  294. package/lib/cjs/utils/if.js +0 -16
  295. package/lib/cjs/utils/if.js.map +0 -1
  296. package/lib/cjs/utils/ifChildren.js +0 -17
  297. package/lib/cjs/utils/ifChildren.js.map +0 -1
  298. package/lib/cjs/utils/injectStyle.js +0 -49
  299. package/lib/cjs/utils/injectStyle.js.map +0 -1
  300. package/lib/cjs/utils/inputProps.js +0 -22
  301. package/lib/cjs/utils/inputProps.js.map +0 -1
  302. package/lib/cjs/utils/isNode.js +0 -28
  303. package/lib/cjs/utils/isNode.js.map +0 -1
  304. package/lib/cjs/utils/isPromise.js +0 -10
  305. package/lib/cjs/utils/isPromise.js.map +0 -1
  306. package/lib/cjs/utils/isRetina.js +0 -15
  307. package/lib/cjs/utils/isRetina.js.map +0 -1
  308. package/lib/cjs/utils/logger.js +0 -40
  309. package/lib/cjs/utils/logger.js.map +0 -1
  310. package/lib/cjs/utils/numericChecker.js +0 -33
  311. package/lib/cjs/utils/numericChecker.js.map +0 -1
  312. package/lib/cjs/utils/ownerDocument.js +0 -10
  313. package/lib/cjs/utils/ownerDocument.js.map +0 -1
  314. package/lib/cjs/utils/pick.js +0 -19
  315. package/lib/cjs/utils/pick.js.map +0 -1
  316. package/lib/cjs/utils/propsForElement.js +0 -59
  317. package/lib/cjs/utils/propsForElement.js.map +0 -1
  318. package/lib/cjs/utils/rafTrottle.js +0 -33
  319. package/lib/cjs/utils/rafTrottle.js.map +0 -1
  320. package/lib/cjs/utils/reactToText.js +0 -33
  321. package/lib/cjs/utils/reactToText.js.map +0 -1
  322. package/lib/cjs/utils/ref.js +0 -95
  323. package/lib/cjs/utils/ref.js.map +0 -1
  324. package/lib/cjs/utils/setRef.js +0 -10
  325. package/lib/cjs/utils/setRef.js.map +0 -1
  326. package/lib/cjs/utils/syncScroll.js +0 -61
  327. package/lib/cjs/utils/syncScroll.js.map +0 -1
  328. package/lib/cjs/utils/uncontroll.js +0 -47
  329. package/lib/cjs/utils/uncontroll.js.map +0 -1
  330. package/lib/cjs/utils/uniqueID.js +0 -42
  331. package/lib/cjs/utils/uniqueID.js.map +0 -1
  332. package/lib/cjs/utils/use/useColorResolver.js +0 -208
  333. package/lib/cjs/utils/use/useColorResolver.js.map +0 -1
  334. package/lib/cjs/utils/use/useCss.js +0 -20
  335. package/lib/cjs/utils/use/useCss.js.map +0 -1
  336. package/lib/cjs/utils/use/useEnhancedEffect.js +0 -13
  337. package/lib/cjs/utils/use/useEnhancedEffect.js.map +0 -1
  338. package/lib/cjs/utils/use/useEventCallback.js +0 -25
  339. package/lib/cjs/utils/use/useEventCallback.js.map +0 -1
  340. package/lib/cjs/utils/use/useEventListener.js +0 -33
  341. package/lib/cjs/utils/use/useEventListener.js.map +0 -1
  342. package/lib/cjs/utils/use/useFocusLock.js +0 -289
  343. package/lib/cjs/utils/use/useFocusLock.js.map +0 -1
  344. package/lib/cjs/utils/use/usePreventScroll.js +0 -78
  345. package/lib/cjs/utils/use/usePreventScroll.js.map +0 -1
  346. package/lib/cjs/utils/useCssVariable.js +0 -55
  347. package/lib/cjs/utils/useCssVariable.js.map +0 -1
  348. package/lib/cjs/utils/zIndexStacking.js +0 -48
  349. package/lib/cjs/utils/zIndexStacking.js.map +0 -1
  350. package/lib/es6/LastInteractionType.js +0 -49
  351. package/lib/es6/LastInteractionType.js.map +0 -1
  352. package/lib/es6/core-types/Component.js +0 -54
  353. package/lib/es6/core-types/Component.js.map +0 -1
  354. package/lib/es6/core-types/UnknownProperties.js +0 -2
  355. package/lib/es6/core-types/UnknownProperties.js.map +0 -1
  356. package/lib/es6/core-types/reshadow.d.js +0 -2
  357. package/lib/es6/core-types/reshadow.d.js.map +0 -1
  358. package/lib/es6/core-types/symbols.js +0 -10
  359. package/lib/es6/core-types/symbols.js.map +0 -1
  360. package/lib/es6/coreFactory.js +0 -343
  361. package/lib/es6/coreFactory.js.map +0 -1
  362. package/lib/es6/enhancement/Children.js +0 -111
  363. package/lib/es6/enhancement/Children.js.map +0 -1
  364. package/lib/es6/enhancement/Root.js +0 -70
  365. package/lib/es6/enhancement/Root.js.map +0 -1
  366. package/lib/es6/enhancement/bindHandler.js.map +0 -1
  367. package/lib/es6/enhancement/dataName.js +0 -12
  368. package/lib/es6/enhancement/dataName.js.map +0 -1
  369. package/lib/es6/enhancement/enhance.js.map +0 -1
  370. package/lib/es6/enhancement/functionDefaultProps.js.map +0 -1
  371. package/lib/es6/enhancement/hoistProps.js.map +0 -1
  372. package/lib/es6/enhancement/i18n.js +0 -20
  373. package/lib/es6/enhancement/i18n.js.map +0 -1
  374. package/lib/es6/enhancement/inheritedName.js.map +0 -1
  375. package/lib/es6/enhancement/staticChildren.js.map +0 -1
  376. package/lib/es6/enhancement/style.js.map +0 -1
  377. package/lib/es6/enhancement/uncontrolledProps.js.map +0 -1
  378. package/lib/es6/index.js +0 -9
  379. package/lib/es6/index.js.map +0 -1
  380. package/lib/es6/register.js +0 -29
  381. package/lib/es6/register.js.map +0 -1
  382. package/lib/es6/styled/index.js +0 -6
  383. package/lib/es6/styled/index.js.map +0 -1
  384. package/lib/es6/styled/reshadow-core.js +0 -243
  385. package/lib/es6/styled/reshadow-core.js.map +0 -1
  386. package/lib/es6/styled/sstyled.js +0 -142
  387. package/lib/es6/styled/sstyled.js.map +0 -1
  388. package/lib/es6/theme/dark.json +0 -2506
  389. package/lib/es6/theme/exclude-tokens.json +0 -10
  390. package/lib/es6/theme/light.json +0 -2584
  391. package/lib/es6/theme/processor.js +0 -307
  392. package/lib/es6/theme/processor.js.map +0 -1
  393. package/lib/es6/theme/themes/auto.css +0 -1465
  394. package/lib/es6/theme/themes/dark.css +0 -723
  395. package/lib/es6/theme/themes/dark.js +0 -378
  396. package/lib/es6/theme/themes/dark.js.map +0 -1
  397. package/lib/es6/theme/themes/default.css +0 -742
  398. package/lib/es6/theme/themes/default.js +0 -387
  399. package/lib/es6/theme/themes/default.js.map +0 -1
  400. package/lib/es6/theme/themes/light.css +0 -742
  401. package/lib/es6/theme/themes/light.js +0 -387
  402. package/lib/es6/theme/themes/light.js.map +0 -1
  403. package/lib/es6/theme/utils.js +0 -286
  404. package/lib/es6/theme/utils.js.map +0 -1
  405. package/lib/es6/utils/CSSinJS.js +0 -28
  406. package/lib/es6/utils/CSSinJS.js.map +0 -1
  407. package/lib/es6/utils/ScreenReaderOnly.js +0 -24
  408. package/lib/es6/utils/ScreenReaderOnly.js.map +0 -1
  409. package/lib/es6/utils/ThemeProvider.js +0 -71
  410. package/lib/es6/utils/ThemeProvider.js.map +0 -1
  411. package/lib/es6/utils/addonText.js +0 -11
  412. package/lib/es6/utils/addonText.js.map +0 -1
  413. package/lib/es6/utils/addonTextChildren.js +0 -37
  414. package/lib/es6/utils/addonTextChildren.js.map +0 -1
  415. package/lib/es6/utils/ariaProps.js +0 -16
  416. package/lib/es6/utils/ariaProps.js.map +0 -1
  417. package/lib/es6/utils/assignProps.js.map +0 -1
  418. package/lib/es6/utils/canUseDOM.js +0 -4
  419. package/lib/es6/utils/canUseDOM.js.map +0 -1
  420. package/lib/es6/utils/capitalizeFirstLetter.js +0 -4
  421. package/lib/es6/utils/capitalizeFirstLetter.js.map +0 -1
  422. package/lib/es6/utils/color.js +0 -196
  423. package/lib/es6/utils/color.js.map +0 -1
  424. package/lib/es6/utils/compose.js +0 -15
  425. package/lib/es6/utils/compose.js.map +0 -1
  426. package/lib/es6/utils/createHoc.js +0 -46
  427. package/lib/es6/utils/createHoc.js.map +0 -1
  428. package/lib/es6/utils/createUUID.js +0 -9
  429. package/lib/es6/utils/createUUID.js.map +0 -1
  430. package/lib/es6/utils/cssToIntDefault.js +0 -16
  431. package/lib/es6/utils/cssToIntDefault.js.map +0 -1
  432. package/lib/es6/utils/enhances/WithAutoFocus.js +0 -67
  433. package/lib/es6/utils/enhances/WithAutoFocus.js.map +0 -1
  434. package/lib/es6/utils/enhances/WithCSS.js +0 -79
  435. package/lib/es6/utils/enhances/WithCSS.js.map +0 -1
  436. package/lib/es6/utils/enhances/WithI18n.js +0 -83
  437. package/lib/es6/utils/enhances/WithI18n.js.map +0 -1
  438. package/lib/es6/utils/enhances/WithKeyboardFocus.js +0 -84
  439. package/lib/es6/utils/enhances/WithKeyboardFocus.js.map +0 -1
  440. package/lib/es6/utils/enhances/WithRef.js +0 -18
  441. package/lib/es6/utils/enhances/WithRef.js.map +0 -1
  442. package/lib/es6/utils/enhances/a11yEnhance.js +0 -66
  443. package/lib/es6/utils/enhances/a11yEnhance.js.map +0 -1
  444. package/lib/es6/utils/enhances/animatedSizeEnhance.js +0 -90
  445. package/lib/es6/utils/enhances/animatedSizeEnhance.js.map +0 -1
  446. package/lib/es6/utils/enhances/autoFocusEnhance.js +0 -38
  447. package/lib/es6/utils/enhances/autoFocusEnhance.js.map +0 -1
  448. package/lib/es6/utils/enhances/contextEnhance.js +0 -14
  449. package/lib/es6/utils/enhances/contextEnhance.js.map +0 -1
  450. package/lib/es6/utils/enhances/i18nEnhance.js +0 -92
  451. package/lib/es6/utils/enhances/i18nEnhance.js.map +0 -1
  452. package/lib/es6/utils/enhances/keyboardFocusEnhance.js +0 -57
  453. package/lib/es6/utils/enhances/keyboardFocusEnhance.js.map +0 -1
  454. package/lib/es6/utils/enhances/resolveColorEnhance.js +0 -17
  455. package/lib/es6/utils/enhances/resolveColorEnhance.js.map +0 -1
  456. package/lib/es6/utils/eventEmitter.js +0 -34
  457. package/lib/es6/utils/eventEmitter.js.map +0 -1
  458. package/lib/es6/utils/findComponent.js +0 -95
  459. package/lib/es6/utils/findComponent.js.map +0 -1
  460. package/lib/es6/utils/fire.js +0 -15
  461. package/lib/es6/utils/fire.js.map +0 -1
  462. package/lib/es6/utils/focus-lock/focusBorders.js +0 -62
  463. package/lib/es6/utils/focus-lock/focusBorders.js.map +0 -1
  464. package/lib/es6/utils/focus-lock/getFocusableIn.js +0 -19
  465. package/lib/es6/utils/focus-lock/getFocusableIn.js.map +0 -1
  466. package/lib/es6/utils/focus-lock/isFocusInside.js +0 -9
  467. package/lib/es6/utils/focus-lock/isFocusInside.js.map +0 -1
  468. package/lib/es6/utils/focus-lock/isFocusable.js +0 -43
  469. package/lib/es6/utils/focus-lock/isFocusable.js.map +0 -1
  470. package/lib/es6/utils/focus-lock/setFocus.js +0 -55
  471. package/lib/es6/utils/focus-lock/setFocus.js.map +0 -1
  472. package/lib/es6/utils/getAccessibleName.js +0 -49
  473. package/lib/es6/utils/getAccessibleName.js.map +0 -1
  474. package/lib/es6/utils/getDisplayName.js +0 -4
  475. package/lib/es6/utils/getDisplayName.js.map +0 -1
  476. package/lib/es6/utils/getEventTarget.js +0 -45
  477. package/lib/es6/utils/getEventTarget.js.map +0 -1
  478. package/lib/es6/utils/getOriginChildren.js +0 -10
  479. package/lib/es6/utils/getOriginChildren.js.map +0 -1
  480. package/lib/es6/utils/getRandomInt.js +0 -5
  481. package/lib/es6/utils/getRandomInt.js.map +0 -1
  482. package/lib/es6/utils/getValue.js +0 -10
  483. package/lib/es6/utils/getValue.js.map +0 -1
  484. package/lib/es6/utils/hasLabels.js +0 -39
  485. package/lib/es6/utils/hasLabels.js.map +0 -1
  486. package/lib/es6/utils/hasParent.js +0 -7
  487. package/lib/es6/utils/hasParent.js.map +0 -1
  488. package/lib/es6/utils/if.js +0 -9
  489. package/lib/es6/utils/if.js.map +0 -1
  490. package/lib/es6/utils/ifChildren.js +0 -10
  491. package/lib/es6/utils/ifChildren.js.map +0 -1
  492. package/lib/es6/utils/injectStyle.js +0 -41
  493. package/lib/es6/utils/injectStyle.js.map +0 -1
  494. package/lib/es6/utils/inputProps.js +0 -14
  495. package/lib/es6/utils/inputProps.js.map +0 -1
  496. package/lib/es6/utils/isNode.js +0 -21
  497. package/lib/es6/utils/isNode.js.map +0 -1
  498. package/lib/es6/utils/isPromise.js +0 -4
  499. package/lib/es6/utils/isPromise.js.map +0 -1
  500. package/lib/es6/utils/isRetina.js +0 -9
  501. package/lib/es6/utils/isRetina.js.map +0 -1
  502. package/lib/es6/utils/logger.js +0 -32
  503. package/lib/es6/utils/logger.js.map +0 -1
  504. package/lib/es6/utils/numericChecker.js +0 -27
  505. package/lib/es6/utils/numericChecker.js.map +0 -1
  506. package/lib/es6/utils/ownerDocument.js +0 -4
  507. package/lib/es6/utils/ownerDocument.js.map +0 -1
  508. package/lib/es6/utils/pick.js.map +0 -1
  509. package/lib/es6/utils/propsForElement.js +0 -50
  510. package/lib/es6/utils/propsForElement.js.map +0 -1
  511. package/lib/es6/utils/rafTrottle.js +0 -26
  512. package/lib/es6/utils/rafTrottle.js.map +0 -1
  513. package/lib/es6/utils/reactToText.js +0 -26
  514. package/lib/es6/utils/reactToText.js.map +0 -1
  515. package/lib/es6/utils/ref.js +0 -83
  516. package/lib/es6/utils/ref.js.map +0 -1
  517. package/lib/es6/utils/setRef.js +0 -3
  518. package/lib/es6/utils/setRef.js.map +0 -1
  519. package/lib/es6/utils/syncScroll.js +0 -54
  520. package/lib/es6/utils/syncScroll.js.map +0 -1
  521. package/lib/es6/utils/uncontroll.js +0 -38
  522. package/lib/es6/utils/uncontroll.js.map +0 -1
  523. package/lib/es6/utils/uniqueID.js +0 -33
  524. package/lib/es6/utils/uniqueID.js.map +0 -1
  525. package/lib/es6/utils/use/useColorResolver.js +0 -200
  526. package/lib/es6/utils/use/useColorResolver.js.map +0 -1
  527. package/lib/es6/utils/use/useCss.js +0 -12
  528. package/lib/es6/utils/use/useCss.js.map +0 -1
  529. package/lib/es6/utils/use/useEnhancedEffect.js +0 -5
  530. package/lib/es6/utils/use/useEnhancedEffect.js.map +0 -1
  531. package/lib/es6/utils/use/useEventCallback.js +0 -19
  532. package/lib/es6/utils/use/useEventCallback.js.map +0 -1
  533. package/lib/es6/utils/use/useEventListener.js +0 -25
  534. package/lib/es6/utils/use/useEventListener.js.map +0 -1
  535. package/lib/es6/utils/use/useFocusLock.js +0 -266
  536. package/lib/es6/utils/use/useFocusLock.js.map +0 -1
  537. package/lib/es6/utils/use/usePreventScroll.js +0 -70
  538. package/lib/es6/utils/use/usePreventScroll.js.map +0 -1
  539. package/lib/es6/utils/useCssVariable.js +0 -46
  540. package/lib/es6/utils/useCssVariable.js.map +0 -1
  541. package/lib/es6/utils/zIndexStacking.js +0 -38
  542. package/lib/es6/utils/zIndexStacking.js.map +0 -1
  543. package/lib/esm/_virtual/_commonjsHelpers.mjs +0 -6
  544. package/lib/esm/_virtual/index.mjs +0 -4
  545. package/lib/esm/_virtual/index2.mjs +0 -4
  546. package/lib/esm/_virtual/react-is.development.mjs +0 -4
  547. package/lib/esm/_virtual/react-is.production.min.mjs +0 -4
  548. package/lib/types/LastInteractionType.d.ts +0 -11
  549. package/lib/types/core-types/UnknownProperties.d.ts +0 -3
  550. package/lib/types/core-types/symbols.d.ts +0 -9
  551. package/lib/types/register.d.ts +0 -8
  552. package/lib/types/styled/index.d.ts +0 -11
  553. package/lib/types/styled/reshadow-core.d.ts +0 -37
  554. package/lib/types/styled/sstyled.d.ts +0 -17
  555. package/lib/types/theme/themes/default.d.ts +0 -387
  556. package/lib/types/utils/CSSinJS.d.ts +0 -5
  557. package/lib/types/utils/ScreenReaderOnly.d.ts +0 -8
  558. package/lib/types/utils/ThemeProvider.d.ts +0 -15
  559. package/lib/types/utils/addonText.d.ts +0 -2
  560. package/lib/types/utils/addonTextChildren.d.ts +0 -3
  561. package/lib/types/utils/ariaProps.d.ts +0 -12
  562. package/lib/types/utils/assignProps.d.ts +0 -11
  563. package/lib/types/utils/canUseDOM.d.ts +0 -1
  564. package/lib/types/utils/capitalizeFirstLetter.d.ts +0 -1
  565. package/lib/types/utils/color.d.ts +0 -5
  566. package/lib/types/utils/compose.d.ts +0 -1
  567. package/lib/types/utils/createHoc.d.ts +0 -3
  568. package/lib/types/utils/createUUID.d.ts +0 -1
  569. package/lib/types/utils/cssToIntDefault.d.ts +0 -8
  570. package/lib/types/utils/enhances/WithAutoFocus.d.ts +0 -14
  571. package/lib/types/utils/enhances/WithCSS.d.ts +0 -41
  572. package/lib/types/utils/enhances/WithI18n.d.ts +0 -43
  573. package/lib/types/utils/enhances/WithKeyboardFocus.d.ts +0 -45
  574. package/lib/types/utils/enhances/WithRef.d.ts +0 -3
  575. package/lib/types/utils/enhances/a11yEnhance.d.ts +0 -10
  576. package/lib/types/utils/enhances/animatedSizeEnhance.d.ts +0 -12
  577. package/lib/types/utils/enhances/autoFocusEnhance.d.ts +0 -10
  578. package/lib/types/utils/enhances/contextEnhance.d.ts +0 -3
  579. package/lib/types/utils/enhances/i18nEnhance.d.ts +0 -25
  580. package/lib/types/utils/enhances/keyboardFocusEnhance.d.ts +0 -27
  581. package/lib/types/utils/enhances/resolveColorEnhance.d.ts +0 -2
  582. package/lib/types/utils/eventEmitter.d.ts +0 -9
  583. package/lib/types/utils/findComponent.d.ts +0 -12
  584. package/lib/types/utils/fire.d.ts +0 -2
  585. package/lib/types/utils/focus-lock/focusBorders.d.ts +0 -4
  586. package/lib/types/utils/focus-lock/getFocusableIn.d.ts +0 -1
  587. package/lib/types/utils/focus-lock/isFocusInside.d.ts +0 -1
  588. package/lib/types/utils/focus-lock/isFocusable.d.ts +0 -1
  589. package/lib/types/utils/focus-lock/setFocus.d.ts +0 -1
  590. package/lib/types/utils/getAccessibleName.d.ts +0 -1
  591. package/lib/types/utils/getDisplayName.d.ts +0 -2
  592. package/lib/types/utils/getEventTarget.d.ts +0 -1
  593. package/lib/types/utils/getOriginChildren.d.ts +0 -2
  594. package/lib/types/utils/getRandomInt.d.ts +0 -1
  595. package/lib/types/utils/getValue.d.ts +0 -1
  596. package/lib/types/utils/hasLabels.d.ts +0 -7
  597. package/lib/types/utils/hasParent.d.ts +0 -1
  598. package/lib/types/utils/if.d.ts +0 -11
  599. package/lib/types/utils/ifChildren.d.ts +0 -8
  600. package/lib/types/utils/injectStyle.d.ts +0 -2
  601. package/lib/types/utils/inputProps.d.ts +0 -2
  602. package/lib/types/utils/isNode.d.ts +0 -1
  603. package/lib/types/utils/isPromise.d.ts +0 -1
  604. package/lib/types/utils/isRetina.d.ts +0 -1
  605. package/lib/types/utils/logger.d.ts +0 -9
  606. package/lib/types/utils/numericChecker.d.ts +0 -5
  607. package/lib/types/utils/ownerDocument.d.ts +0 -1
  608. package/lib/types/utils/pick.d.ts +0 -1
  609. package/lib/types/utils/propsForElement.d.ts +0 -3
  610. package/lib/types/utils/rafTrottle.d.ts +0 -2
  611. package/lib/types/utils/reactToText.d.ts +0 -3
  612. package/lib/types/utils/ref.d.ts +0 -8
  613. package/lib/types/utils/setRef.d.ts +0 -2
  614. package/lib/types/utils/syncScroll.d.ts +0 -1
  615. package/lib/types/utils/uncontroll.d.ts +0 -4
  616. package/lib/types/utils/uniqueID.d.ts +0 -12
  617. package/lib/types/utils/use/useColorResolver.d.ts +0 -1
  618. package/lib/types/utils/use/useCss.d.ts +0 -4
  619. package/lib/types/utils/use/useEnhancedEffect.d.ts +0 -3
  620. package/lib/types/utils/use/useEventCallback.d.ts +0 -4
  621. package/lib/types/utils/use/useEventListener.d.ts +0 -2
  622. package/lib/types/utils/use/useFocusLock.d.ts +0 -10
  623. package/lib/types/utils/use/usePreventScroll.d.ts +0 -2
  624. package/lib/types/utils/useCssVariable.d.ts +0 -8
  625. package/lib/types/utils/zIndexStacking.d.ts +0 -8
  626. /package/lib/{cjs/LastInteractionType.js → LastInteractionType.js} +0 -0
  627. /package/lib/{types/coreFactory.d.ts → coreFactory.d.ts} +0 -0
  628. /package/lib/{cjs/coreFactory.js → coreFactory.js} +0 -0
  629. /package/lib/{types/enhancement → enhancement}/Children.d.ts +0 -0
  630. /package/lib/{types/enhancement → enhancement}/Root.d.ts +0 -0
  631. /package/lib/{types/enhancement → enhancement}/bindHandler.d.ts +0 -0
  632. /package/lib/{types/enhancement → enhancement}/dataName.d.ts +0 -0
  633. /package/lib/{types/enhancement → enhancement}/enhance.d.ts +0 -0
  634. /package/lib/{types/enhancement → enhancement}/functionDefaultProps.d.ts +0 -0
  635. /package/lib/{types/enhancement → enhancement}/hoistProps.d.ts +0 -0
  636. /package/lib/{types/enhancement → enhancement}/i18n.d.ts +0 -0
  637. /package/lib/{types/enhancement → enhancement}/inheritedName.d.ts +0 -0
  638. /package/lib/{types/enhancement → enhancement}/staticChildren.d.ts +0 -0
  639. /package/lib/{types/enhancement → enhancement}/style.d.ts +0 -0
  640. /package/lib/{types/enhancement → enhancement}/uncontrolledProps.d.ts +0 -0
  641. /package/lib/{types/index.d.ts → index.d.ts} +0 -0
  642. /package/lib/{cjs/index.js → index.js} +0 -0
  643. /package/lib/{types/theme → theme}/processor.d.ts +0 -0
  644. /package/lib/{types/theme → theme}/utils.d.ts +0 -0
@@ -0,0 +1,51 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ import canUseDOM from "./utils/canUseDOM.mjs";
5
+ var LastInteractionType = /* @__PURE__ */ function() {
6
+ function LastInteractionType2() {
7
+ _classCallCheck(this, LastInteractionType2);
8
+ _defineProperty(this, "lastFocusSource", "none");
9
+ this.handleKeyDown = this.handleKeyDown.bind(this);
10
+ this.handleMouseDown = this.handleMouseDown.bind(this);
11
+ if (canUseDOM()) {
12
+ document.addEventListener("mousedown", this.handleMouseDown, {
13
+ capture: true
14
+ });
15
+ document.addEventListener("keydown", this.handleKeyDown, {
16
+ capture: true
17
+ });
18
+ }
19
+ }
20
+ _createClass(LastInteractionType2, [{
21
+ key: "type",
22
+ get: function get() {
23
+ return this.lastFocusSource;
24
+ }
25
+ }, {
26
+ key: "isKeyboard",
27
+ value: function isKeyboard() {
28
+ return this.lastFocusSource === "keyboard";
29
+ }
30
+ }, {
31
+ key: "isMouse",
32
+ value: function isMouse() {
33
+ return this.lastFocusSource === "mouse";
34
+ }
35
+ }, {
36
+ key: "handleMouseDown",
37
+ value: function handleMouseDown() {
38
+ this.lastFocusSource = "mouse";
39
+ }
40
+ }, {
41
+ key: "handleKeyDown",
42
+ value: function handleKeyDown() {
43
+ this.lastFocusSource = "keyboard";
44
+ }
45
+ }]);
46
+ return LastInteractionType2;
47
+ }();
48
+ var lastInteraction = new LastInteractionType();
49
+ export {
50
+ lastInteraction
51
+ };
@@ -0,0 +1,51 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
+ import { PureComponent } from "react";
8
+ var Root = void 0;
9
+ var RootComponent = /* @__PURE__ */ function(_PureComponent) {
10
+ _inherits(RootComponent2, _PureComponent);
11
+ var _super = _createSuper(RootComponent2);
12
+ function RootComponent2() {
13
+ var _this;
14
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
+ args[_key] = arguments[_key];
16
+ }
17
+ _classCallCheck(this, RootComponent2);
18
+ _this = _super.call.apply(_super, [this].concat(args));
19
+ _defineProperty(_assertThisInitialized(_this), "Root", void 0);
20
+ _defineProperty(_assertThisInitialized(_this), "isControlled", false);
21
+ return _this;
22
+ }
23
+ _createClass(RootComponent2, [{
24
+ key: "handlers",
25
+ get: function get() {
26
+ return {};
27
+ }
28
+ }, {
29
+ key: "asProps",
30
+ get: function get() {
31
+ return {};
32
+ }
33
+ }]);
34
+ return RootComponent2;
35
+ }(PureComponent);
36
+ var Component = RootComponent;
37
+ var Intergalactic;
38
+ (function(_Intergalactic) {
39
+ var InternalTypings;
40
+ /* @__PURE__ */ (function(_InternalTypings) {
41
+ })(InternalTypings || (InternalTypings = _Intergalactic.InternalTypings || (_Intergalactic.InternalTypings = {})));
42
+ })(Intergalactic || (Intergalactic = {}));
43
+ var wrapIntergalacticComponent = function wrapIntergalacticComponent2(wrapper) {
44
+ return wrapper;
45
+ };
46
+ export {
47
+ Component,
48
+ Intergalactic,
49
+ Root,
50
+ wrapIntergalacticComponent
51
+ };
@@ -0,0 +1,20 @@
1
+ var CORE_COMPONENT = Symbol("CORE_COMPONENT");
2
+ var CORE_INSTANCE = Symbol("CORE_INSTANCE");
3
+ var CORE_AS_PROPS = Symbol("CORE_AS_PROPS");
4
+ var CORE_INIT = Symbol("CORE_INIT");
5
+ var CONTEXT_COMPONENT = Symbol("CONTEXT_COMPONENT");
6
+ var CREATE_COMPONENT = Symbol("CREATE_COMPONENT");
7
+ var PARENT_COMPONENTS = Symbol("PARENT_COMPONENTS");
8
+ var CHILDREN_COMPONENT = Symbol("CHILDREN_COMPONENT");
9
+ var INHERITED_NAME = Symbol("INHERITED_NAME");
10
+ export {
11
+ CHILDREN_COMPONENT,
12
+ CONTEXT_COMPONENT,
13
+ CORE_AS_PROPS,
14
+ CORE_COMPONENT,
15
+ CORE_INIT,
16
+ CORE_INSTANCE,
17
+ CREATE_COMPONENT,
18
+ INHERITED_NAME,
19
+ PARENT_COMPONENTS
20
+ };
@@ -0,0 +1,324 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _get from "@babel/runtime/helpers/esm/get";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
5
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
7
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
8
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
9
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
10
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
11
+ import _extends from "@babel/runtime/helpers/esm/extends";
12
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
+ import React from "react";
14
+ import hoistNonReactStatics from "hoist-non-react-statics";
15
+ import { useForkRef } from "./utils/ref.mjs";
16
+ import useEnhancedEffect from "./utils/use/useEnhancedEffect.mjs";
17
+ import assignProps$1 from "./utils/assignProps.mjs";
18
+ import { Component } from "./core-types/Component.mjs";
19
+ import Enhancement$1 from "./enhancement/Children.mjs";
20
+ import Enhancement$2 from "./enhancement/Root.mjs";
21
+ import Enhancement$3 from "./enhancement/uncontrolledProps.mjs";
22
+ import Enhancement$5 from "./enhancement/functionDefaultProps.mjs";
23
+ import Enhancement$4, { ROOT_COMPONENT, getterMethodNameByDisplayName, STATIC_COMPONENT } from "./enhancement/staticChildren.mjs";
24
+ import Enhancement$6 from "./enhancement/inheritedName.mjs";
25
+ import Enhancement$a from "./enhancement/hoistProps.mjs";
26
+ import Enhancement$7 from "./enhancement/dataName.mjs";
27
+ import Enhancement$8 from "./enhancement/enhance.mjs";
28
+ import Enhancement$9 from "./enhancement/style.mjs";
29
+ import Enhancement from "./enhancement/bindHandler.mjs";
30
+ import i18nAppLocaleEnhance from "./enhancement/i18n.mjs";
31
+ import { CORE_AS_PROPS, CORE_INSTANCE, CORE_INIT, CORE_COMPONENT, PARENT_COMPONENTS, CONTEXT_COMPONENT, CREATE_COMPONENT } from "./core-types/symbols.mjs";
32
+ var _excluded = ["forwardRef"], _excluded2 = ["forwardRef", "__WRAPPER_PROPS_BIND__"], _excluded3 = ["ref"];
33
+ function isEmptyObject(obj) {
34
+ return Object.getOwnPropertyNames(obj).length === 0 && Object.getOwnPropertySymbols && // For IE 11
35
+ Object.getOwnPropertySymbols(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
36
+ }
37
+ function createGetField(enhancements, Component2, isFunction) {
38
+ return function getField(key) {
39
+ return enhancements.filter(function(enhancement) {
40
+ if (!enhancement.condition) {
41
+ return true;
42
+ }
43
+ return enhancement.condition(Component2, isFunction);
44
+ }).reduce(function(acc, item) {
45
+ if (item[key]) {
46
+ acc.push(item[key]);
47
+ }
48
+ return acc;
49
+ }, []);
50
+ };
51
+ }
52
+ function createForwardWrapper(Component2, wrapperProps, statics, isFunction) {
53
+ var RootComponent = Component2[ROOT_COMPONENT];
54
+ var getterMethodName = getterMethodNameByDisplayName(Component2 === null || Component2 === void 0 ? void 0 : Component2.displayName);
55
+ var getterMethod = RootComponent !== null && RootComponent !== void 0 && RootComponent.prototype ? RootComponent.prototype[getterMethodName] : void 0;
56
+ var useGetterIndex = (getterMethod === null || getterMethod === void 0 ? void 0 : getterMethod.length) >= 2;
57
+ function WrapperForwardRefWithBind(_ref, ref) {
58
+ var _ref$forwardRef = _ref.forwardRef, forwardRef = _ref$forwardRef === void 0 ? null : _ref$forwardRef, other = _objectWithoutProperties(_ref, _excluded);
59
+ return /* @__PURE__ */ React.createElement(BindingWrapper, _extends({}, other, {
60
+ forwardRef: useForkRef(ref, forwardRef)
61
+ }));
62
+ }
63
+ function WrapperForwardRef(_ref2, ref) {
64
+ var _ref2$forwardRef = _ref2.forwardRef, forwardRef = _ref2$forwardRef === void 0 ? null : _ref2$forwardRef, __WRAPPER_PROPS_BIND__ = _ref2.__WRAPPER_PROPS_BIND__, other = _objectWithoutProperties(_ref2, _excluded2);
65
+ var _reduce = (__WRAPPER_PROPS_BIND__ || wrapperProps).reduce(function(acc, enhancement) {
66
+ return enhancement(acc, WrapperComponent, isFunction);
67
+ }, other), _reduce$ref = _reduce.ref, enhancementRef = _reduce$ref === void 0 ? null : _reduce$ref, props = _objectWithoutProperties(_reduce, _excluded3);
68
+ return /* @__PURE__ */ React.createElement(Component2, _extends({}, props, {
69
+ forwardRef: useForkRef(enhancementRef, ref, forwardRef)
70
+ }));
71
+ }
72
+ var BindingWrapper = /* @__PURE__ */ function(_React$Component) {
73
+ _inherits(BindingWrapper2, _React$Component);
74
+ var _super = _createSuper(BindingWrapper2);
75
+ function BindingWrapper2() {
76
+ var _this;
77
+ _classCallCheck(this, BindingWrapper2);
78
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
79
+ args[_key] = arguments[_key];
80
+ }
81
+ _this = _super.call.apply(_super, [this].concat(args));
82
+ _defineProperty(_assertThisInitialized(_this), "index", -1);
83
+ return _this;
84
+ }
85
+ _createClass(BindingWrapper2, [{
86
+ key: "render",
87
+ value: function render() {
88
+ var _this2 = this;
89
+ return /* @__PURE__ */ React.createElement(WrapperForwardRef, _extends({}, this.props, {
90
+ __WRAPPER_PROPS_BIND__: wrapperProps.map(function(fn) {
91
+ return fn.bind(_this2);
92
+ })
93
+ }));
94
+ }
95
+ }]);
96
+ return BindingWrapper2;
97
+ }(React.Component);
98
+ var WrapperComponent = /* @__PURE__ */ React.forwardRef(useGetterIndex ? WrapperForwardRefWithBind : WrapperForwardRef);
99
+ hoistNonReactStatics(WrapperComponent, Component2);
100
+ WrapperComponent.displayName = Component2.displayName;
101
+ WrapperComponent.defaultProps = Component2.defaultProps;
102
+ statics.forEach(function(enhancement) {
103
+ return Object.assign(WrapperComponent, enhancement(WrapperComponent, Component2, isFunction));
104
+ });
105
+ return WrapperComponent;
106
+ }
107
+ function wrapClass(OriginComponent, enhancements, Context) {
108
+ var getField = createGetField(enhancements, OriginComponent, false);
109
+ var inits = getField("init");
110
+ var props = getField("asProps");
111
+ var renders = getField("render");
112
+ var statics = getField("static");
113
+ var wrapperProps = getField("wrapperProps");
114
+ var contexts = getField("context");
115
+ var Component2 = /* @__PURE__ */ function(_OriginComponent2) {
116
+ _inherits(Component3, _OriginComponent2);
117
+ var _super2 = _createSuper(Component3);
118
+ function Component3(props2, context) {
119
+ var _this3;
120
+ _classCallCheck(this, Component3);
121
+ _this3 = _super2.call(this, props2, context);
122
+ _defineProperty(_assertThisInitialized(_this3), CORE_AS_PROPS, null);
123
+ _defineProperty(_assertThisInitialized(_this3), CORE_INSTANCE, WrapperComponent);
124
+ _defineProperty(_assertThisInitialized(_this3), CORE_INIT, false);
125
+ inits.forEach(function(enhancement) {
126
+ return enhancement.call(_assertThisInitialized(_this3), props2, WrapperComponent, false);
127
+ });
128
+ _this3[CORE_INIT] = true;
129
+ return _this3;
130
+ }
131
+ _createClass(Component3, [{
132
+ key: "asProps",
133
+ get: function get() {
134
+ var _this4 = this;
135
+ if (!this[CORE_INIT]) {
136
+ throw new Error("Can not call asProps in constructor");
137
+ }
138
+ if (!this[CORE_AS_PROPS]) {
139
+ this[CORE_AS_PROPS] = props.reduce(function(acc, enhancement) {
140
+ return enhancement.call(_this4, acc, WrapperComponent, false);
141
+ }, this.props);
142
+ }
143
+ return this[CORE_AS_PROPS];
144
+ }
145
+ }, {
146
+ key: "setContext",
147
+ value: function setContext() {
148
+ var _this5 = this;
149
+ var contextProps = _get(_getPrototypeOf(Component3.prototype), "setContext", this) ? _get(_getPrototypeOf(Component3.prototype), "setContext", this).call(this) : {};
150
+ return contexts.reduce(function(acc, enhancement) {
151
+ return enhancement.call(_this5, acc, WrapperComponent, false);
152
+ }, contextProps);
153
+ }
154
+ }, {
155
+ key: "render",
156
+ value: function render() {
157
+ var _this6 = this;
158
+ this[CORE_AS_PROPS] = null;
159
+ if (!_get(_getPrototypeOf(Component3.prototype), "render", this)) {
160
+ throw new Error("Component `render` method is not defined");
161
+ }
162
+ var asProps = this.asProps;
163
+ var ctx = this.setContext();
164
+ var render2 = renders.reduce(function(acc, enhancement) {
165
+ return enhancement.call(_this6, acc, asProps, WrapperComponent, false);
166
+ }, _get(_getPrototypeOf(Component3.prototype), "render", this).call(this));
167
+ if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
168
+ return /* @__PURE__ */ React.createElement(Context.Provider, {
169
+ value: _objectSpread(_objectSpread({}, asProps), ctx)
170
+ }, render2);
171
+ } else {
172
+ return render2;
173
+ }
174
+ }
175
+ }]);
176
+ return Component3;
177
+ }(OriginComponent);
178
+ var WrapperComponent = createForwardWrapper(Component2, wrapperProps, statics, false);
179
+ return WrapperComponent;
180
+ }
181
+ function wrapFunction(OriginComponent, enhancements, Context) {
182
+ var getField = createGetField(enhancements, OriginComponent, true);
183
+ var inits = getField("init");
184
+ var props = getField("asProps");
185
+ var renders = getField("render");
186
+ var statics = getField("static");
187
+ var wrapperProps = getField("wrapperProps");
188
+ var contexts = getField("context");
189
+ var Component2 = /* @__PURE__ */ React.memo(function FunctionMemoComponent(other) {
190
+ var selfRef = React.useRef({});
191
+ var firstRender = React.useRef(true);
192
+ useEnhancedEffect(function() {
193
+ firstRender.current = false;
194
+ }, []);
195
+ if (firstRender.current) {
196
+ inits.forEach(function(enhancement) {
197
+ return enhancement.call(selfRef.current, other, WrapperComponent, true);
198
+ });
199
+ }
200
+ var asProps = props.reduce(function(acc, enhancement) {
201
+ return enhancement.call(selfRef.current, acc, WrapperComponent, true);
202
+ }, other);
203
+ var ctx = contexts.reduce(function(acc, enhancement) {
204
+ return enhancement.call(selfRef.current, acc, WrapperComponent, true);
205
+ }, {});
206
+ var render = renders.reduce(function(acc, enhancement) {
207
+ return enhancement.call(selfRef.current, acc, asProps, WrapperComponent, true);
208
+ }, /* @__PURE__ */ React.createElement(OriginComponent, asProps));
209
+ if (!WrapperComponent[STATIC_COMPONENT] && !isEmptyObject(ctx)) {
210
+ return /* @__PURE__ */ React.createElement(Context.Provider, {
211
+ value: _objectSpread(_objectSpread({}, asProps), ctx)
212
+ }, render);
213
+ } else {
214
+ return render;
215
+ }
216
+ });
217
+ Object.assign(Component2, OriginComponent);
218
+ var WrapperComponent = createForwardWrapper(Component2, wrapperProps, statics, true);
219
+ return WrapperComponent;
220
+ }
221
+ function wrapCore(OriginComponent, enhancements, Context) {
222
+ var Component2 = function Component3(_ref3) {
223
+ var Root = _ref3.Root;
224
+ var defaultProps = OriginComponent.defaultProps || {};
225
+ return /* @__PURE__ */ React.createElement(Root, _extends({}, defaultProps, {
226
+ render: OriginComponent
227
+ }));
228
+ };
229
+ hoistNonReactStatics(Component2, OriginComponent);
230
+ Component2.displayName = OriginComponent.displayName;
231
+ return wrapFunction(Component2, enhancements, Context);
232
+ }
233
+ function createComposeComponent(OriginComponent, Context, enhancements) {
234
+ if (React.PureComponent.isPrototypeOf(OriginComponent) || React.Component.isPrototypeOf(OriginComponent)) {
235
+ if (OriginComponent.prototype instanceof Component) {
236
+ return wrapClass(OriginComponent, enhancements, Context);
237
+ } else {
238
+ throw new Error("Must inherit from our component");
239
+ }
240
+ } else if (typeof OriginComponent === "function") {
241
+ return wrapFunction(OriginComponent, enhancements, Context);
242
+ } else if (OriginComponent[CORE_COMPONENT]) {
243
+ return wrapCore(OriginComponent, enhancements, Context);
244
+ } else {
245
+ throw new Error("Must be a React component");
246
+ }
247
+ }
248
+ function assignProps(p1, p2) {
249
+ return assignProps$1(p2, p1);
250
+ }
251
+ function createComponent(OriginComponent) {
252
+ var childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
253
+ var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
254
+ var _options$context = options.context, context = _options$context === void 0 ? /* @__PURE__ */ React.createContext({}) : _options$context, _options$parent = options.parent, parent = _options$parent === void 0 ? [] : _options$parent, _options$enhancements = options.enhancements, enhancements = _options$enhancements === void 0 ? [] : _options$enhancements;
255
+ var parents = Array.isArray(parent) ? parent : [parent];
256
+ if (parents.length) {
257
+ var wholeFamily = parents.reduce(function(acc, parent2) {
258
+ if (parent2[PARENT_COMPONENTS]) {
259
+ acc = [].concat(_toConsumableArray(parent2[PARENT_COMPONENTS]), _toConsumableArray(acc));
260
+ }
261
+ return acc;
262
+ }, parents);
263
+ OriginComponent[PARENT_COMPONENTS] = wholeFamily;
264
+ parents = wholeFamily;
265
+ }
266
+ if (OriginComponent[CORE_COMPONENT]) {
267
+ parents.push(OriginComponent);
268
+ }
269
+ var Component2 = createComposeComponent(OriginComponent, context, [].concat(_toConsumableArray(enhancements.map(function(f) {
270
+ return f(context, parents, createComponent, childComponents);
271
+ })), [
272
+ i18nAppLocaleEnhance(),
273
+ Enhancement(),
274
+ Enhancement$1(context, parents),
275
+ // root must be under the children
276
+ Enhancement$2(),
277
+ Enhancement$3(),
278
+ Enhancement$4(childComponents, createComponent, {
279
+ context,
280
+ parent,
281
+ enhancements
282
+ }),
283
+ // functionDefaultProps must be under the staticChild
284
+ Enhancement$5(),
285
+ // inheritedName must be under the staticChild
286
+ Enhancement$6(),
287
+ // dataName must be under the staticChild
288
+ Enhancement$7(),
289
+ // enhanceEnhancement must be under the functionDefaultPropsEnhancement
290
+ Enhancement$8(),
291
+ Enhancement$9(childComponents, context),
292
+ // must be the last one so any properties can be raised
293
+ Enhancement$a(childComponents, context)
294
+ ]));
295
+ Component2[CONTEXT_COMPONENT] = context;
296
+ Component2._______childrenComponents = childComponents;
297
+ Component2[CREATE_COMPONENT] = function() {
298
+ var _OriginComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : OriginComponent;
299
+ var _childComponents = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : childComponents;
300
+ var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : options;
301
+ return createComponent(_OriginComponent, _childComponents, _options);
302
+ };
303
+ Component2[CORE_COMPONENT] = true;
304
+ return Component2;
305
+ }
306
+ function createBaseComponent(OriginComponent) {
307
+ var Component2 = null;
308
+ if (!React.PureComponent.isPrototypeOf(OriginComponent) && !React.Component.isPrototypeOf(OriginComponent) && typeof OriginComponent === "function") {
309
+ Component2 = /* @__PURE__ */ React.forwardRef(OriginComponent);
310
+ Component2.displayName = OriginComponent.displayName;
311
+ Component2.defaultProps = _objectSpread({
312
+ "data-ui-name": OriginComponent.displayName
313
+ }, OriginComponent.defaultProps);
314
+ Component2[CORE_COMPONENT] = true;
315
+ } else {
316
+ throw new Error("createBaseComponent accepts only functional component");
317
+ }
318
+ return Component2;
319
+ }
320
+ export {
321
+ assignProps,
322
+ createBaseComponent,
323
+ createComponent
324
+ };
@@ -0,0 +1,96 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import React from "react";
6
+ import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
7
+ var _excluded = ["handlers", "getters"], _excluded2 = ["handlers"];
8
+ var CHILDREN_SELF = Symbol("CHILDREN_SELF");
9
+ var GETTER_REG = /^get[\w]+Props$/;
10
+ function splitPropsAndGetters(props) {
11
+ return Object.entries(props).reduce(function(acc, _ref) {
12
+ var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
13
+ if (GETTER_REG.exec(key) === null) {
14
+ acc.props[key] = value;
15
+ } else {
16
+ acc.getters[key] = value;
17
+ }
18
+ return acc;
19
+ }, {
20
+ props: {},
21
+ getters: {}
22
+ });
23
+ }
24
+ function getterToArray(getter) {
25
+ if (!Array.isArray(getter)) {
26
+ return typeof getter === "function" ? [getter] : [];
27
+ }
28
+ return getter;
29
+ }
30
+ function mergeObjects() {
31
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
32
+ var b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
33
+ var core = _objectSpread(_objectSpread({}, a), b);
34
+ return Object.keys(core).reduce(function(acc, key) {
35
+ a[key] = getterToArray(a[key]);
36
+ b[key] = getterToArray(b[key]);
37
+ acc[key] = [].concat(_toConsumableArray(a[key]), _toConsumableArray(b[key]));
38
+ return acc;
39
+ }, {});
40
+ }
41
+ function assignGettersChain(getters) {
42
+ return function() {
43
+ var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
44
+ return getters.reduce(function(acc, getter) {
45
+ return getter(acc);
46
+ }, props);
47
+ };
48
+ }
49
+ function createChildren(Context, contexts) {
50
+ var Children = function Children2() {
51
+ var children = Children2.origin;
52
+ if (typeof children === "function") {
53
+ var _reduce = [].concat(_toConsumableArray(contexts), [Context]).reduce(function(acc, ctx) {
54
+ var _ref3 = React.useContext(ctx), handlers2 = _ref3.handlers, propsAndGetters = _objectWithoutProperties(_ref3, _excluded2);
55
+ var _splitPropsAndGetters = splitPropsAndGetters(propsAndGetters), props2 = _splitPropsAndGetters.props, getters2 = _splitPropsAndGetters.getters;
56
+ return Object.assign({}, acc, _objectSpread({
57
+ handlers: Object.assign({}, acc.handlers, handlers2),
58
+ getters: mergeObjects(acc.getters, getters2)
59
+ }, props2));
60
+ }, Children2.props), _reduce$handlers = _reduce.handlers, handlers = _reduce$handlers === void 0 ? {} : _reduce$handlers, _reduce$getters = _reduce.getters, getters = _reduce$getters === void 0 ? {} : _reduce$getters, props = _objectWithoutProperties(_reduce, _excluded);
61
+ var mergedGetters = Object.entries(getters).reduce(function(acc, _ref4) {
62
+ var _ref5 = _slicedToArray(_ref4, 2), key = _ref5[0], value = _ref5[1];
63
+ acc[key] = assignGettersChain(value);
64
+ return acc;
65
+ }, {});
66
+ return children(_objectSpread(_objectSpread({}, props), mergedGetters), handlers);
67
+ } else if (children === void 0) {
68
+ return null;
69
+ }
70
+ return children;
71
+ };
72
+ Children.origin = null;
73
+ Children.props = {};
74
+ Children[CHILDREN_COMPONENT] = true;
75
+ return Children;
76
+ }
77
+ function Enhancement(Context, parent) {
78
+ return {
79
+ init: function init() {
80
+ var contexts = (Array.isArray(parent) ? parent : [parent]).map(function(component) {
81
+ return component[CONTEXT_COMPONENT];
82
+ }).filter(Boolean);
83
+ this[CHILDREN_SELF] = createChildren(Context, contexts);
84
+ },
85
+ asProps: function asProps(props) {
86
+ this[CHILDREN_SELF].origin = props.children;
87
+ this[CHILDREN_SELF].props = props;
88
+ return _objectSpread(_objectSpread({}, props), {}, {
89
+ Children: this[CHILDREN_SELF]
90
+ });
91
+ }
92
+ };
93
+ }
94
+ export {
95
+ Enhancement as default
96
+ };
@@ -0,0 +1,56 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
+ import React from "react";
5
+ import assignProps from "../utils/assignProps.mjs";
6
+ import { useForkRef } from "../utils/ref.mjs";
7
+ var _excluded = ["render"], _excluded2 = ["Root", "styles", "children", "Children", "forwardRef"];
8
+ function createRootRender() {
9
+ var Root = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
10
+ var Tag = _ref.render, source = _objectWithoutProperties(_ref, _excluded);
11
+ var _Root$props = Root.props, _Root = _Root$props.Root, styles = _Root$props.styles, children = _Root$props.children, Children = _Root$props.Children, _Root$props$forwardRe = _Root$props.forwardRef, forwardRef = _Root$props$forwardRe === void 0 ? null : _Root$props$forwardRe, props = _objectWithoutProperties(_Root$props, _excluded2);
12
+ var clearProps = Object.entries(props).reduce(function(props2, _ref2) {
13
+ var _ref3 = _slicedToArray(_ref2, 2), name = _ref3[0], value = _ref3[1];
14
+ if (value !== void 0) {
15
+ props2[name] = value;
16
+ }
17
+ return props2;
18
+ }, {});
19
+ var child = {};
20
+ if (typeof Children.origin !== "undefined") {
21
+ child.children = /* @__PURE__ */ React.createElement(Children, null);
22
+ }
23
+ var other = assignProps(_objectSpread(_objectSpread({}, clearProps), {}, {
24
+ ref: useForkRef(forwardRef, ref)
25
+ }), _objectSpread(_objectSpread({}, child), source));
26
+ if (!Tag) {
27
+ throw new Error("`render` prop of Root is not provided");
28
+ }
29
+ if (Tag === React.Fragment) return /* @__PURE__ */ React.createElement(React.Fragment, null, other.children);
30
+ return /* @__PURE__ */ React.createElement(Tag, other);
31
+ });
32
+ Root.props = {};
33
+ return Root;
34
+ }
35
+ function Enhancement() {
36
+ return {
37
+ init: function init() {
38
+ this.Root = createRootRender();
39
+ },
40
+ asProps: function asProps(props, WrapperComponent, isFunction) {
41
+ if (isFunction) {
42
+ return _objectSpread(_objectSpread({}, props), {}, {
43
+ Root: this.Root
44
+ });
45
+ }
46
+ return props;
47
+ },
48
+ render: function render(_render, props) {
49
+ this.Root.props = props;
50
+ return _render;
51
+ }
52
+ };
53
+ }
54
+ export {
55
+ Enhancement as default
56
+ };
@@ -6,15 +6,15 @@ function arraysEqual(a, b) {
6
6
  return true;
7
7
  }
8
8
  function handlerBinder(fn) {
9
- return function () {
9
+ return function() {
10
10
  for (var _len = arguments.length, depsArgs = new Array(_len), _key = 0; _key < _len; _key++) {
11
11
  depsArgs[_key] = arguments[_key];
12
12
  }
13
13
  var memoizeds = [];
14
14
  if (handlerBinder.hasher.has(fn)) {
15
15
  memoizeds = handlerBinder.hasher.get(fn);
16
- var memoized = memoizeds.find(function (memoized) {
17
- return arraysEqual(memoized.deps, depsArgs);
16
+ var memoized = memoizeds.find(function(memoized2) {
17
+ return arraysEqual(memoized2.deps, depsArgs);
18
18
  });
19
19
  if (memoized) return memoized.fn;
20
20
  }
@@ -27,7 +27,7 @@ function handlerBinder(fn) {
27
27
  return bindFn;
28
28
  };
29
29
  }
30
- handlerBinder.hasher = new WeakMap();
30
+ handlerBinder.hasher = /* @__PURE__ */ new WeakMap();
31
31
  function Enhancement() {
32
32
  return {
33
33
  condition: function condition(Component, isFunction) {
@@ -35,13 +35,14 @@ function Enhancement() {
35
35
  },
36
36
  init: function init() {
37
37
  var _this = this;
38
- Object.keys(this).filter(function (field) {
39
- return field.startsWith('bindHandler');
40
- }).forEach(function (name) {
38
+ Object.keys(this).filter(function(field) {
39
+ return field.startsWith("bindHandler");
40
+ }).forEach(function(name) {
41
41
  _this[name] = handlerBinder(_this[name].bind(_this));
42
42
  });
43
43
  }
44
44
  };
45
45
  }
46
- export default Enhancement;
47
- //# sourceMappingURL=bindHandler.js.map
46
+ export {
47
+ Enhancement as default
48
+ };
@@ -0,0 +1,13 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ function Enhancement() {
3
+ return {
4
+ wrapperProps: function wrapperProps(props, WrapperComponent) {
5
+ return _objectSpread({
6
+ "data-ui-name": WrapperComponent.displayName
7
+ }, props);
8
+ }
9
+ };
10
+ }
11
+ export {
12
+ Enhancement as default
13
+ };
@@ -5,11 +5,12 @@ function Enhancement() {
5
5
  return Boolean((_Component$enhance = Component.enhance) === null || _Component$enhance === void 0 ? void 0 : _Component$enhance.length);
6
6
  },
7
7
  wrapperProps: function wrapperProps(props, WrapperComponent) {
8
- return WrapperComponent.enhance.reduce(function (acc, enhance) {
8
+ return WrapperComponent.enhance.reduce(function(acc, enhance) {
9
9
  return enhance(acc);
10
10
  }, props);
11
11
  }
12
12
  };
13
13
  }
14
- export default Enhancement;
15
- //# sourceMappingURL=enhance.js.map
14
+ export {
15
+ Enhancement as default
16
+ };