@semcore/core 16.0.0-prerelease.9 → 16.0.1-prerelease.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 (530) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/README.md +1 -31
  3. package/lib/{LastInteractionType.cjs → LastInteractionType.js} +4 -6
  4. package/lib/LastInteractionType.js.map +1 -0
  5. package/lib/LastInteractionType.mjs +1 -2
  6. package/lib/LastInteractionType.mjs.map +1 -1
  7. package/lib/core-types/Component.d.ts +11 -13
  8. package/lib/core-types/Component.js +88 -0
  9. package/lib/core-types/Component.js.map +1 -0
  10. package/lib/core-types/Component.mjs +11 -14
  11. package/lib/core-types/Component.mjs.map +1 -1
  12. package/lib/core-types/UnknownProperties.js +2 -0
  13. package/lib/core-types/UnknownProperties.js.map +1 -0
  14. package/lib/core-types/UnknownProperties.mjs.map +1 -1
  15. package/lib/core-types/reshadow.d.js +2 -0
  16. package/lib/core-types/reshadow.d.js.map +1 -0
  17. package/lib/core-types/reshadow.d.mjs.map +1 -1
  18. package/lib/core-types/symbols.js +16 -0
  19. package/lib/core-types/symbols.js.map +1 -0
  20. package/lib/core-types/symbols.mjs.map +1 -1
  21. package/lib/coreFactory.d.ts +4 -4
  22. package/lib/{coreFactory.cjs → coreFactory.js} +38 -39
  23. package/lib/coreFactory.js.map +1 -0
  24. package/lib/coreFactory.mjs +39 -34
  25. package/lib/coreFactory.mjs.map +1 -1
  26. package/lib/enhancement/{Children.cjs → Children.js} +10 -11
  27. package/lib/enhancement/Children.js.map +1 -0
  28. package/lib/enhancement/Children.mjs +8 -8
  29. package/lib/enhancement/Children.mjs.map +1 -1
  30. package/lib/enhancement/Root.d.ts +1 -1
  31. package/lib/enhancement/{Root.cjs → Root.js} +6 -7
  32. package/lib/enhancement/Root.js.map +1 -0
  33. package/lib/enhancement/Root.mjs +2 -6
  34. package/lib/enhancement/Root.mjs.map +1 -1
  35. package/lib/enhancement/bindHandler.d.ts +1 -1
  36. package/lib/enhancement/{bindHandler.cjs → bindHandler.js} +3 -4
  37. package/lib/enhancement/bindHandler.js.map +1 -0
  38. package/lib/enhancement/bindHandler.mjs +1 -1
  39. package/lib/enhancement/bindHandler.mjs.map +1 -1
  40. package/lib/enhancement/{dataName.cjs → dataName.js} +3 -4
  41. package/lib/enhancement/dataName.js.map +1 -0
  42. package/lib/enhancement/dataName.mjs.map +1 -1
  43. package/lib/enhancement/{enhance.cjs → enhance.js} +2 -3
  44. package/lib/enhancement/enhance.js.map +1 -0
  45. package/lib/enhancement/enhance.mjs.map +1 -1
  46. package/lib/enhancement/{functionDefaultProps.cjs → functionDefaultProps.js} +2 -3
  47. package/lib/enhancement/functionDefaultProps.js.map +1 -0
  48. package/lib/enhancement/functionDefaultProps.mjs.map +1 -1
  49. package/lib/enhancement/hoistProps.d.ts +1 -1
  50. package/lib/enhancement/{hoistProps.cjs → hoistProps.js} +6 -8
  51. package/lib/enhancement/hoistProps.js.map +1 -0
  52. package/lib/enhancement/hoistProps.mjs +2 -2
  53. package/lib/enhancement/hoistProps.mjs.map +1 -1
  54. package/lib/enhancement/{i18n.cjs → i18n.js} +3 -4
  55. package/lib/enhancement/i18n.js.map +1 -0
  56. package/lib/enhancement/i18n.mjs.map +1 -1
  57. package/lib/enhancement/{inheritedName.cjs → inheritedName.js} +3 -4
  58. package/lib/enhancement/inheritedName.js.map +1 -0
  59. package/lib/enhancement/inheritedName.mjs.map +1 -1
  60. package/lib/enhancement/{staticChildren.cjs → staticChildren.js} +6 -9
  61. package/lib/enhancement/staticChildren.js.map +1 -0
  62. package/lib/enhancement/staticChildren.mjs +1 -1
  63. package/lib/enhancement/staticChildren.mjs.map +1 -1
  64. package/lib/enhancement/{style.cjs → style.js} +5 -7
  65. package/lib/enhancement/style.js.map +1 -0
  66. package/lib/enhancement/style.mjs +2 -3
  67. package/lib/enhancement/style.mjs.map +1 -1
  68. package/lib/enhancement/{uncontrolledProps.cjs → uncontrolledProps.js} +5 -7
  69. package/lib/enhancement/uncontrolledProps.js.map +1 -0
  70. package/lib/enhancement/uncontrolledProps.mjs +2 -3
  71. package/lib/enhancement/uncontrolledProps.mjs.map +1 -1
  72. package/lib/esm/LastInteractionType.mjs +1 -2
  73. package/lib/esm/core-types/Component.mjs +11 -14
  74. package/lib/esm/coreFactory.mjs +39 -34
  75. package/lib/esm/enhancement/Children.mjs +8 -8
  76. package/lib/esm/enhancement/Root.mjs +2 -6
  77. package/lib/esm/enhancement/bindHandler.mjs +1 -1
  78. package/lib/esm/enhancement/hoistProps.mjs +2 -2
  79. package/lib/esm/enhancement/staticChildren.mjs +1 -1
  80. package/lib/esm/enhancement/style.mjs +2 -3
  81. package/lib/esm/enhancement/uncontrolledProps.mjs +2 -3
  82. package/lib/esm/index.mjs +3 -2
  83. package/lib/esm/register.mjs +1 -2
  84. package/lib/esm/styled/index.mjs +8 -0
  85. package/lib/esm/styled/reshadow-core.mjs +219 -3
  86. package/lib/esm/styled/sstyled.mjs +1 -1
  87. package/lib/esm/utils/assignProps.mjs +10 -0
  88. package/lib/esm/utils/createHoc.mjs +47 -0
  89. package/lib/esm/utils/enhances/WithI18n.mjs +41 -15
  90. package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
  91. package/lib/esm/utils/getDisplayName.mjs +6 -0
  92. package/lib/esm/utils/logger.mjs +1 -2
  93. package/lib/esm/utils/ref.mjs +46 -2
  94. package/lib/index.d.ts +5 -5
  95. package/lib/{index.cjs → index.js} +5 -5
  96. package/lib/index.js.map +1 -0
  97. package/lib/index.mjs +3 -2
  98. package/lib/index.mjs.map +1 -1
  99. package/lib/{register.cjs → register.js} +5 -8
  100. package/lib/register.js.map +1 -0
  101. package/lib/register.mjs +1 -2
  102. package/lib/register.mjs.map +1 -1
  103. package/lib/styled/index.d.ts +1 -2
  104. package/lib/styled/{index.cjs → index.js} +1 -1
  105. package/lib/styled/index.js.map +1 -0
  106. package/lib/styled/index.mjs +8 -6
  107. package/lib/styled/index.mjs.map +1 -1
  108. package/lib/styled/{reshadow-core.cjs → reshadow-core.js} +28 -51
  109. package/lib/styled/reshadow-core.js.map +1 -0
  110. package/lib/styled/reshadow-core.mjs +219 -3
  111. package/lib/styled/reshadow-core.mjs.map +1 -1
  112. package/lib/styled/sstyled.d.ts +2 -2
  113. package/lib/styled/{sstyled.cjs → sstyled.js} +4 -4
  114. package/lib/styled/sstyled.js.map +1 -0
  115. package/lib/styled/sstyled.mjs +1 -1
  116. package/lib/styled/sstyled.mjs.map +1 -1
  117. package/lib/theme/dark.json +4 -4
  118. package/lib/theme/light.json +4 -44
  119. package/lib/theme/{processor.cjs → processor.js} +62 -64
  120. package/lib/theme/processor.js.map +1 -0
  121. package/lib/theme/processor.mjs +52 -53
  122. package/lib/theme/processor.mjs.map +1 -1
  123. package/lib/theme/themes/auto.css +228 -6
  124. package/lib/theme/themes/dark.css +114 -3
  125. package/lib/theme/themes/dark.d.ts +92 -1
  126. package/lib/theme/themes/{dark.cjs → dark.js} +95 -5
  127. package/lib/theme/themes/dark.js.map +1 -0
  128. package/lib/theme/themes/dark.mjs +93 -2
  129. package/lib/theme/themes/dark.mjs.map +1 -1
  130. package/lib/theme/themes/default.css +114 -3
  131. package/lib/theme/themes/default.d.ts +92 -1
  132. package/lib/theme/themes/{light.cjs → default.js} +95 -5
  133. package/lib/theme/themes/default.js.map +1 -0
  134. package/lib/theme/themes/default.mjs +93 -2
  135. package/lib/theme/themes/default.mjs.map +1 -1
  136. package/lib/theme/themes/light.css +114 -3
  137. package/lib/theme/themes/light.d.ts +92 -1
  138. package/lib/theme/themes/{default.cjs → light.js} +95 -5
  139. package/lib/theme/themes/light.js.map +1 -0
  140. package/lib/theme/themes/light.mjs +93 -2
  141. package/lib/theme/themes/light.mjs.map +1 -1
  142. package/lib/theme/utils.d.ts +2 -1
  143. package/lib/theme/{utils.cjs → utils.js} +37 -33
  144. package/lib/theme/utils.js.map +1 -0
  145. package/lib/theme/utils.mjs +31 -23
  146. package/lib/theme/utils.mjs.map +1 -1
  147. package/lib/utils/CSSinJS.d.ts +1 -1
  148. package/lib/utils/{CSSinJS.cjs → CSSinJS.js} +5 -6
  149. package/lib/utils/CSSinJS.js.map +1 -0
  150. package/lib/utils/CSSinJS.mjs +2 -2
  151. package/lib/utils/CSSinJS.mjs.map +1 -1
  152. package/lib/utils/ScreenReaderOnly.d.ts +1 -1
  153. package/lib/utils/{ScreenReaderOnly.cjs → ScreenReaderOnly.js} +3 -4
  154. package/lib/utils/ScreenReaderOnly.js.map +1 -0
  155. package/lib/utils/ScreenReaderOnly.mjs.map +1 -1
  156. package/lib/utils/ThemeProvider.d.ts +1 -1
  157. package/lib/utils/{ThemeProvider.cjs → ThemeProvider.js} +6 -10
  158. package/lib/utils/ThemeProvider.js.map +1 -0
  159. package/lib/utils/ThemeProvider.mjs.map +1 -1
  160. package/lib/utils/addonText.d.ts +1 -1
  161. package/lib/utils/{addonText.cjs → addonText.js} +2 -2
  162. package/lib/utils/addonText.js.map +1 -0
  163. package/lib/utils/addonText.mjs.map +1 -1
  164. package/lib/utils/addonTextChildren.d.ts +1 -1
  165. package/lib/utils/{addonTextChildren.cjs → addonTextChildren.js} +4 -5
  166. package/lib/utils/addonTextChildren.js.map +1 -0
  167. package/lib/utils/addonTextChildren.mjs +1 -1
  168. package/lib/utils/addonTextChildren.mjs.map +1 -1
  169. package/lib/utils/ariaProps.d.ts +1 -1
  170. package/lib/utils/{ariaProps.cjs → ariaProps.js} +1 -1
  171. package/lib/utils/ariaProps.js.map +1 -0
  172. package/lib/utils/ariaProps.mjs.map +1 -1
  173. package/lib/utils/assignProps.d.ts +1 -1
  174. package/lib/utils/{assignProps.cjs → assignProps.js} +3 -3
  175. package/lib/utils/assignProps.js.map +1 -0
  176. package/lib/utils/assignProps.mjs +10 -0
  177. package/lib/utils/assignProps.mjs.map +1 -1
  178. package/lib/utils/{canUseDOM.cjs → canUseDOM.js} +1 -1
  179. package/lib/utils/canUseDOM.js.map +1 -0
  180. package/lib/utils/canUseDOM.mjs.map +1 -1
  181. package/lib/utils/{capitalizeFirstLetter.cjs → capitalizeFirstLetter.js} +1 -1
  182. package/lib/utils/capitalizeFirstLetter.js.map +1 -0
  183. package/lib/utils/capitalizeFirstLetter.mjs.map +1 -1
  184. package/lib/utils/{color.cjs → color.js} +19 -19
  185. package/lib/utils/color.js.map +1 -0
  186. package/lib/utils/color.mjs +16 -15
  187. package/lib/utils/color.mjs.map +1 -1
  188. package/lib/utils/{compose.cjs → compose.js} +1 -1
  189. package/lib/utils/compose.js.map +1 -0
  190. package/lib/utils/compose.mjs.map +1 -1
  191. package/lib/utils/createHoc.d.ts +1 -1
  192. package/lib/utils/{createHoc.cjs → createHoc.js} +12 -12
  193. package/lib/utils/createHoc.js.map +1 -0
  194. package/lib/utils/createHoc.mjs +24 -23
  195. package/lib/utils/createHoc.mjs.map +1 -1
  196. package/lib/utils/{createUUID.cjs → createUUID.js} +1 -1
  197. package/lib/utils/createUUID.js.map +1 -0
  198. package/lib/utils/createUUID.mjs.map +1 -1
  199. package/lib/utils/cssToIntDefault.d.ts +1 -1
  200. package/lib/utils/{cssToIntDefault.cjs → cssToIntDefault.js} +3 -3
  201. package/lib/utils/cssToIntDefault.js.map +1 -0
  202. package/lib/utils/cssToIntDefault.mjs +2 -2
  203. package/lib/utils/cssToIntDefault.mjs.map +1 -1
  204. package/lib/utils/enhances/WithAutoFocus.d.ts +3 -3
  205. package/lib/utils/enhances/{WithAutoFocus.cjs → WithAutoFocus.js} +13 -13
  206. package/lib/utils/enhances/WithAutoFocus.js.map +1 -0
  207. package/lib/utils/enhances/WithAutoFocus.mjs +11 -9
  208. package/lib/utils/enhances/WithAutoFocus.mjs.map +1 -1
  209. package/lib/utils/enhances/WithCSS.d.ts +4 -4
  210. package/lib/utils/enhances/{WithCSS.cjs → WithCSS.js} +16 -21
  211. package/lib/utils/enhances/WithCSS.js.map +1 -0
  212. package/lib/utils/enhances/WithCSS.mjs +8 -8
  213. package/lib/utils/enhances/WithCSS.mjs.map +1 -1
  214. package/lib/utils/enhances/WithI18n.d.ts +3 -3
  215. package/lib/utils/enhances/{WithI18n.cjs → WithI18n.js} +20 -23
  216. package/lib/utils/enhances/WithI18n.js.map +1 -0
  217. package/lib/utils/enhances/WithI18n.mjs +41 -15
  218. package/lib/utils/enhances/WithI18n.mjs.map +1 -1
  219. package/lib/utils/enhances/WithKeyboardFocus.d.ts +4 -3
  220. package/lib/utils/enhances/{WithKeyboardFocus.cjs → WithKeyboardFocus.js} +29 -25
  221. package/lib/utils/enhances/WithKeyboardFocus.js.map +1 -0
  222. package/lib/utils/enhances/WithKeyboardFocus.mjs +26 -19
  223. package/lib/utils/enhances/WithKeyboardFocus.mjs.map +1 -1
  224. package/lib/utils/enhances/WithRef.d.ts +1 -1
  225. package/lib/utils/enhances/{WithRef.cjs → WithRef.js} +4 -5
  226. package/lib/utils/enhances/WithRef.js.map +1 -0
  227. package/lib/utils/enhances/WithRef.mjs +1 -1
  228. package/lib/utils/enhances/WithRef.mjs.map +1 -1
  229. package/lib/utils/enhances/{a11yEnhance.cjs → a11yEnhance.js} +10 -11
  230. package/lib/utils/enhances/a11yEnhance.js.map +1 -0
  231. package/lib/utils/enhances/a11yEnhance.mjs +7 -7
  232. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -1
  233. package/lib/utils/enhances/animatedSizeEnhance.d.ts +1 -1
  234. package/lib/utils/enhances/{animatedSizeEnhance.cjs → animatedSizeEnhance.js} +13 -11
  235. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -0
  236. package/lib/utils/enhances/animatedSizeEnhance.mjs +11 -7
  237. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -1
  238. package/lib/utils/enhances/autoFocusEnhance.d.ts +1 -1
  239. package/lib/utils/enhances/{autoFocusEnhance.cjs → autoFocusEnhance.js} +3 -4
  240. package/lib/utils/enhances/autoFocusEnhance.js.map +1 -0
  241. package/lib/utils/enhances/autoFocusEnhance.mjs.map +1 -1
  242. package/lib/utils/enhances/{contextEnhance.cjs → contextEnhance.js} +3 -4
  243. package/lib/utils/enhances/contextEnhance.js.map +1 -0
  244. package/lib/utils/enhances/contextEnhance.mjs.map +1 -1
  245. package/lib/utils/enhances/i18nEnhance.d.ts +2 -2
  246. package/lib/utils/enhances/{i18nEnhance.cjs → i18nEnhance.js} +11 -11
  247. package/lib/utils/enhances/i18nEnhance.js.map +1 -0
  248. package/lib/utils/enhances/i18nEnhance.mjs +36 -37
  249. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -1
  250. package/lib/utils/enhances/keyboardFocusEnhance.d.ts +1 -1
  251. package/lib/utils/enhances/{keyboardFocusEnhance.cjs → keyboardFocusEnhance.js} +8 -8
  252. package/lib/utils/enhances/keyboardFocusEnhance.js.map +1 -0
  253. package/lib/utils/enhances/keyboardFocusEnhance.mjs +2 -2
  254. package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +1 -1
  255. package/lib/utils/enhances/{resolveColorEnhance.cjs → resolveColorEnhance.js} +5 -6
  256. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -0
  257. package/lib/utils/enhances/resolveColorEnhance.mjs +2 -2
  258. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -1
  259. package/lib/utils/{eventEmitter.cjs → eventEmitter.js} +3 -4
  260. package/lib/utils/eventEmitter.js.map +1 -0
  261. package/lib/utils/eventEmitter.mjs.map +1 -1
  262. package/lib/utils/findComponent.d.ts +2 -2
  263. package/lib/utils/{findComponent.cjs → findComponent.js} +15 -16
  264. package/lib/utils/findComponent.js.map +1 -0
  265. package/lib/utils/findComponent.mjs +12 -12
  266. package/lib/utils/findComponent.mjs.map +1 -1
  267. package/lib/utils/{fire.cjs → fire.js} +2 -2
  268. package/lib/utils/fire.js.map +1 -0
  269. package/lib/utils/fire.mjs.map +1 -1
  270. package/lib/utils/focus-lock/{focusBorders.cjs → focusBorders.js} +13 -17
  271. package/lib/utils/focus-lock/focusBorders.js.map +1 -0
  272. package/lib/utils/focus-lock/focusBorders.mjs +8 -8
  273. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -1
  274. package/lib/utils/focus-lock/{getFocusableIn.cjs → getFocusableIn.js} +3 -4
  275. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -0
  276. package/lib/utils/focus-lock/getFocusableIn.mjs +1 -1
  277. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -1
  278. package/lib/utils/focus-lock/{isFocusInside.cjs → isFocusInside.js} +2 -3
  279. package/lib/utils/focus-lock/isFocusInside.js.map +1 -0
  280. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -1
  281. package/lib/utils/focus-lock/{isFocusable.cjs → isFocusable.js} +3 -4
  282. package/lib/utils/focus-lock/isFocusable.js.map +1 -0
  283. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -1
  284. package/lib/utils/focus-lock/{setFocus.cjs → setFocus.js} +5 -6
  285. package/lib/utils/focus-lock/setFocus.js.map +1 -0
  286. package/lib/utils/focus-lock/setFocus.mjs +2 -2
  287. package/lib/utils/focus-lock/setFocus.mjs.map +1 -1
  288. package/lib/utils/{getAccessibleName.cjs → getAccessibleName.js} +2 -2
  289. package/lib/utils/getAccessibleName.js.map +1 -0
  290. package/lib/utils/getAccessibleName.mjs.map +1 -1
  291. package/lib/utils/getDisplayName.d.ts +1 -1
  292. package/lib/utils/{getDisplayName.cjs → getDisplayName.js} +1 -1
  293. package/lib/utils/getDisplayName.js.map +1 -0
  294. package/lib/utils/getDisplayName.mjs +5 -3
  295. package/lib/utils/getDisplayName.mjs.map +1 -1
  296. package/lib/utils/{getEventTarget.cjs → getEventTarget.js} +3 -4
  297. package/lib/utils/getEventTarget.js.map +1 -0
  298. package/lib/utils/getEventTarget.mjs.map +1 -1
  299. package/lib/utils/{getOriginChildren.cjs → getOriginChildren.js} +4 -5
  300. package/lib/utils/getOriginChildren.js.map +1 -0
  301. package/lib/utils/getOriginChildren.mjs +1 -1
  302. package/lib/utils/getOriginChildren.mjs.map +1 -1
  303. package/lib/utils/{getRandomInt.cjs → getRandomInt.js} +1 -1
  304. package/lib/utils/getRandomInt.js.map +1 -0
  305. package/lib/utils/getRandomInt.mjs.map +1 -1
  306. package/lib/utils/{getValue.cjs → getValue.js} +2 -4
  307. package/lib/utils/getValue.js.map +1 -0
  308. package/lib/utils/getValue.mjs +1 -3
  309. package/lib/utils/getValue.mjs.map +1 -1
  310. package/lib/utils/{hasLabels.cjs → hasLabels.js} +6 -7
  311. package/lib/utils/hasLabels.js.map +1 -0
  312. package/lib/utils/hasLabels.mjs +3 -3
  313. package/lib/utils/hasLabels.mjs.map +1 -1
  314. package/lib/utils/{hasParent.cjs → hasParent.js} +3 -4
  315. package/lib/utils/hasParent.js.map +1 -0
  316. package/lib/utils/hasParent.mjs +3 -2
  317. package/lib/utils/hasParent.mjs.map +1 -1
  318. package/lib/utils/if.d.ts +2 -2
  319. package/lib/utils/{if.cjs → if.js} +2 -3
  320. package/lib/utils/if.js.map +1 -0
  321. package/lib/utils/if.mjs.map +1 -1
  322. package/lib/utils/ifChildren.d.ts +1 -1
  323. package/lib/utils/{ifChildren.cjs → ifChildren.js} +2 -3
  324. package/lib/utils/ifChildren.js.map +1 -0
  325. package/lib/utils/ifChildren.mjs.map +1 -1
  326. package/lib/utils/{injectStyle.cjs → injectStyle.js} +4 -6
  327. package/lib/utils/injectStyle.js.map +1 -0
  328. package/lib/utils/injectStyle.mjs +1 -2
  329. package/lib/utils/injectStyle.mjs.map +1 -1
  330. package/lib/utils/{inputProps.cjs → inputProps.js} +2 -3
  331. package/lib/utils/inputProps.js.map +1 -0
  332. package/lib/utils/inputProps.mjs.map +1 -1
  333. package/lib/utils/isInteractiveElement.d.ts +1 -0
  334. package/lib/utils/isInteractiveElement.js +34 -0
  335. package/lib/utils/isInteractiveElement.js.map +1 -0
  336. package/lib/utils/isInteractiveElement.mjs +28 -0
  337. package/lib/utils/isInteractiveElement.mjs.map +1 -0
  338. package/lib/utils/{isNode.cjs → isNode.js} +2 -2
  339. package/lib/utils/isNode.js.map +1 -0
  340. package/lib/utils/isNode.mjs.map +1 -1
  341. package/lib/utils/{isPromise.cjs → isPromise.js} +1 -1
  342. package/lib/utils/isPromise.js.map +1 -0
  343. package/lib/utils/isPromise.mjs.map +1 -1
  344. package/lib/utils/{isRetina.cjs → isRetina.js} +1 -1
  345. package/lib/utils/isRetina.js.map +1 -0
  346. package/lib/utils/isRetina.mjs.map +1 -1
  347. package/lib/utils/{logger.cjs → logger.js} +5 -8
  348. package/lib/utils/logger.js.map +1 -0
  349. package/lib/utils/logger.mjs +1 -2
  350. package/lib/utils/logger.mjs.map +1 -1
  351. package/lib/utils/{numericChecker.cjs → numericChecker.js} +1 -1
  352. package/lib/utils/numericChecker.js.map +1 -0
  353. package/lib/utils/numericChecker.mjs.map +1 -1
  354. package/lib/utils/{ownerDocument.cjs → ownerDocument.js} +1 -1
  355. package/lib/utils/ownerDocument.js.map +1 -0
  356. package/lib/utils/ownerDocument.mjs.map +1 -1
  357. package/lib/utils/{pick.cjs → pick.js} +1 -1
  358. package/lib/utils/pick.js.map +1 -0
  359. package/lib/utils/pick.mjs.map +1 -1
  360. package/lib/utils/propsForElement.d.ts +1 -1
  361. package/lib/utils/{propsForElement.cjs → propsForElement.js} +3 -4
  362. package/lib/utils/propsForElement.js.map +1 -0
  363. package/lib/utils/propsForElement.mjs.map +1 -1
  364. package/lib/utils/{rafTrottle.cjs → rafTrottle.js} +2 -3
  365. package/lib/utils/rafTrottle.js.map +1 -0
  366. package/lib/utils/rafTrottle.mjs.map +1 -1
  367. package/lib/utils/reactToText.d.ts +1 -1
  368. package/lib/utils/{reactToText.cjs → reactToText.js} +2 -3
  369. package/lib/utils/reactToText.js.map +1 -0
  370. package/lib/utils/reactToText.mjs.map +1 -1
  371. package/lib/utils/ref.d.ts +4 -2
  372. package/lib/utils/{ref.cjs → ref.js} +4 -3
  373. package/lib/utils/ref.js.map +1 -0
  374. package/lib/utils/ref.mjs +46 -2
  375. package/lib/utils/ref.mjs.map +1 -1
  376. package/lib/utils/{setRef.cjs → setRef.js} +2 -3
  377. package/lib/utils/setRef.js.map +1 -0
  378. package/lib/utils/setRef.mjs.map +1 -1
  379. package/lib/utils/{syncScroll.cjs → syncScroll.js} +3 -3
  380. package/lib/utils/syncScroll.js.map +1 -0
  381. package/lib/utils/syncScroll.mjs +1 -1
  382. package/lib/utils/syncScroll.mjs.map +1 -1
  383. package/lib/utils/uncontroll.d.ts +1 -1
  384. package/lib/utils/{uncontroll.cjs → uncontroll.js} +2 -2
  385. package/lib/utils/uncontroll.js.map +1 -0
  386. package/lib/utils/uncontroll.mjs.map +1 -1
  387. package/lib/utils/uniqueID.d.ts +1 -1
  388. package/lib/utils/{uniqueID.cjs → uniqueID.js} +6 -6
  389. package/lib/utils/uniqueID.js.map +1 -0
  390. package/lib/utils/uniqueID.mjs +3 -0
  391. package/lib/utils/uniqueID.mjs.map +1 -1
  392. package/lib/utils/use/{useColorResolver.cjs → useColorResolver.js} +8 -107
  393. package/lib/utils/use/useColorResolver.js.map +1 -0
  394. package/lib/utils/use/useColorResolver.mjs +5 -103
  395. package/lib/utils/use/useColorResolver.mjs.map +1 -1
  396. package/lib/utils/use/useCss.d.ts +1 -1
  397. package/lib/utils/use/{useCss.cjs → useCss.js} +3 -4
  398. package/lib/utils/use/useCss.js.map +1 -0
  399. package/lib/utils/use/useCss.mjs.map +1 -1
  400. package/lib/utils/use/{useEnhancedEffect.cjs → useEnhancedEffect.js} +3 -4
  401. package/lib/utils/use/useEnhancedEffect.js.map +1 -0
  402. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -1
  403. package/lib/utils/use/{useEventCallback.cjs → useEventCallback.js} +2 -2
  404. package/lib/utils/use/useEventCallback.js.map +1 -0
  405. package/lib/utils/use/useEventCallback.mjs.map +1 -1
  406. package/lib/utils/use/{useEventListener.cjs → useEventListener.js} +4 -5
  407. package/lib/utils/use/useEventListener.js.map +1 -0
  408. package/lib/utils/use/useEventListener.mjs +1 -1
  409. package/lib/utils/use/useEventListener.mjs.map +1 -1
  410. package/lib/utils/use/useFocusLock.d.ts +1 -1
  411. package/lib/utils/use/{useFocusLock.cjs → useFocusLock.js} +9 -12
  412. package/lib/utils/use/useFocusLock.js.map +1 -0
  413. package/lib/utils/use/useFocusLock.mjs +4 -4
  414. package/lib/utils/use/useFocusLock.mjs.map +1 -1
  415. package/lib/utils/use/{usePreventScroll.cjs → usePreventScroll.js} +3 -3
  416. package/lib/utils/use/usePreventScroll.js.map +1 -0
  417. package/lib/utils/use/usePreventScroll.mjs +1 -1
  418. package/lib/utils/use/usePreventScroll.mjs.map +1 -1
  419. package/lib/utils/useCssVariable.d.ts +2 -2
  420. package/lib/utils/{useCssVariable.cjs → useCssVariable.js} +4 -6
  421. package/lib/utils/useCssVariable.js.map +1 -0
  422. package/lib/utils/useCssVariable.mjs.map +1 -1
  423. package/lib/utils/{zIndexStacking.cjs → zIndexStacking.js} +7 -10
  424. package/lib/utils/zIndexStacking.js.map +1 -0
  425. package/lib/utils/zIndexStacking.mjs +2 -2
  426. package/lib/utils/zIndexStacking.mjs.map +1 -1
  427. package/package.json +45 -23
  428. package/vite.config.ts +1 -1
  429. package/lib/LastInteractionType.cjs.map +0 -1
  430. package/lib/core-types/Component.cjs +0 -59
  431. package/lib/core-types/Component.cjs.map +0 -1
  432. package/lib/core-types/UnknownProperties.cjs +0 -2
  433. package/lib/core-types/UnknownProperties.cjs.map +0 -1
  434. package/lib/core-types/reshadow.d.cjs +0 -2
  435. package/lib/core-types/reshadow.d.cjs.map +0 -1
  436. package/lib/core-types/symbols.cjs +0 -25
  437. package/lib/core-types/symbols.cjs.map +0 -1
  438. package/lib/coreFactory.cjs.map +0 -1
  439. package/lib/enhancement/Children.cjs.map +0 -1
  440. package/lib/enhancement/Root.cjs.map +0 -1
  441. package/lib/enhancement/bindHandler.cjs.map +0 -1
  442. package/lib/enhancement/dataName.cjs.map +0 -1
  443. package/lib/enhancement/enhance.cjs.map +0 -1
  444. package/lib/enhancement/functionDefaultProps.cjs.map +0 -1
  445. package/lib/enhancement/hoistProps.cjs.map +0 -1
  446. package/lib/enhancement/i18n.cjs.map +0 -1
  447. package/lib/enhancement/inheritedName.cjs.map +0 -1
  448. package/lib/enhancement/staticChildren.cjs.map +0 -1
  449. package/lib/enhancement/style.cjs.map +0 -1
  450. package/lib/enhancement/uncontrolledProps.cjs.map +0 -1
  451. package/lib/index.cjs.map +0 -1
  452. package/lib/register.cjs.map +0 -1
  453. package/lib/styled/index.cjs.map +0 -1
  454. package/lib/styled/reshadow-core.cjs.map +0 -1
  455. package/lib/styled/sstyled.cjs.map +0 -1
  456. package/lib/theme/processor.cjs.map +0 -1
  457. package/lib/theme/themes/dark.cjs.map +0 -1
  458. package/lib/theme/themes/default.cjs.map +0 -1
  459. package/lib/theme/themes/light.cjs.map +0 -1
  460. package/lib/theme/utils.cjs.map +0 -1
  461. package/lib/utils/CSSinJS.cjs.map +0 -1
  462. package/lib/utils/ScreenReaderOnly.cjs.map +0 -1
  463. package/lib/utils/ThemeProvider.cjs.map +0 -1
  464. package/lib/utils/addonText.cjs.map +0 -1
  465. package/lib/utils/addonTextChildren.cjs.map +0 -1
  466. package/lib/utils/ariaProps.cjs.map +0 -1
  467. package/lib/utils/assignProps.cjs.map +0 -1
  468. package/lib/utils/canUseDOM.cjs.map +0 -1
  469. package/lib/utils/capitalizeFirstLetter.cjs.map +0 -1
  470. package/lib/utils/color.cjs.map +0 -1
  471. package/lib/utils/compose.cjs.map +0 -1
  472. package/lib/utils/createHoc.cjs.map +0 -1
  473. package/lib/utils/createUUID.cjs.map +0 -1
  474. package/lib/utils/cssToIntDefault.cjs.map +0 -1
  475. package/lib/utils/enhances/WithAutoFocus.cjs.map +0 -1
  476. package/lib/utils/enhances/WithCSS.cjs.map +0 -1
  477. package/lib/utils/enhances/WithI18n.cjs.map +0 -1
  478. package/lib/utils/enhances/WithKeyboardFocus.cjs.map +0 -1
  479. package/lib/utils/enhances/WithRef.cjs.map +0 -1
  480. package/lib/utils/enhances/a11yEnhance.cjs.map +0 -1
  481. package/lib/utils/enhances/animatedSizeEnhance.cjs.map +0 -1
  482. package/lib/utils/enhances/autoFocusEnhance.cjs.map +0 -1
  483. package/lib/utils/enhances/contextEnhance.cjs.map +0 -1
  484. package/lib/utils/enhances/i18nEnhance.cjs.map +0 -1
  485. package/lib/utils/enhances/keyboardFocusEnhance.cjs.map +0 -1
  486. package/lib/utils/enhances/resolveColorEnhance.cjs.map +0 -1
  487. package/lib/utils/eventEmitter.cjs.map +0 -1
  488. package/lib/utils/findComponent.cjs.map +0 -1
  489. package/lib/utils/fire.cjs.map +0 -1
  490. package/lib/utils/focus-lock/focusBorders.cjs.map +0 -1
  491. package/lib/utils/focus-lock/getFocusableIn.cjs.map +0 -1
  492. package/lib/utils/focus-lock/isFocusInside.cjs.map +0 -1
  493. package/lib/utils/focus-lock/isFocusable.cjs.map +0 -1
  494. package/lib/utils/focus-lock/setFocus.cjs.map +0 -1
  495. package/lib/utils/getAccessibleName.cjs.map +0 -1
  496. package/lib/utils/getDisplayName.cjs.map +0 -1
  497. package/lib/utils/getEventTarget.cjs.map +0 -1
  498. package/lib/utils/getOriginChildren.cjs.map +0 -1
  499. package/lib/utils/getRandomInt.cjs.map +0 -1
  500. package/lib/utils/getValue.cjs.map +0 -1
  501. package/lib/utils/hasLabels.cjs.map +0 -1
  502. package/lib/utils/hasParent.cjs.map +0 -1
  503. package/lib/utils/if.cjs.map +0 -1
  504. package/lib/utils/ifChildren.cjs.map +0 -1
  505. package/lib/utils/injectStyle.cjs.map +0 -1
  506. package/lib/utils/inputProps.cjs.map +0 -1
  507. package/lib/utils/isNode.cjs.map +0 -1
  508. package/lib/utils/isPromise.cjs.map +0 -1
  509. package/lib/utils/isRetina.cjs.map +0 -1
  510. package/lib/utils/logger.cjs.map +0 -1
  511. package/lib/utils/numericChecker.cjs.map +0 -1
  512. package/lib/utils/ownerDocument.cjs.map +0 -1
  513. package/lib/utils/pick.cjs.map +0 -1
  514. package/lib/utils/propsForElement.cjs.map +0 -1
  515. package/lib/utils/rafTrottle.cjs.map +0 -1
  516. package/lib/utils/reactToText.cjs.map +0 -1
  517. package/lib/utils/ref.cjs.map +0 -1
  518. package/lib/utils/setRef.cjs.map +0 -1
  519. package/lib/utils/syncScroll.cjs.map +0 -1
  520. package/lib/utils/uncontroll.cjs.map +0 -1
  521. package/lib/utils/uniqueID.cjs.map +0 -1
  522. package/lib/utils/use/useColorResolver.cjs.map +0 -1
  523. package/lib/utils/use/useCss.cjs.map +0 -1
  524. package/lib/utils/use/useEnhancedEffect.cjs.map +0 -1
  525. package/lib/utils/use/useEventCallback.cjs.map +0 -1
  526. package/lib/utils/use/useEventListener.cjs.map +0 -1
  527. package/lib/utils/use/useFocusLock.cjs.map +0 -1
  528. package/lib/utils/use/usePreventScroll.cjs.map +0 -1
  529. package/lib/utils/useCssVariable.cjs.map +0 -1
  530. package/lib/utils/zIndexStacking.cjs.map +0 -1
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import React from "react";
6
- import { CONTEXT_COMPONENT, CHILDREN_COMPONENT } from "../core-types/symbols.mjs";
6
+ import { CHILDREN_COMPONENT, CONTEXT_COMPONENT } from "../core-types/symbols.mjs";
7
7
  var _excluded = ["handlers", "getters"], _excluded2 = ["handlers"];
8
8
  var CHILDREN_SELF = Symbol("CHILDREN_SELF");
9
9
  var GETTER_REG = /^get[\w]+Props$/;
@@ -47,8 +47,8 @@ function assignGettersChain(getters) {
47
47
  };
48
48
  }
49
49
  function createChildren(Context, contexts) {
50
- var Children = function Children2() {
51
- var children = Children2.origin;
50
+ var _Children = function Children() {
51
+ var children = _Children.origin;
52
52
  if (typeof children === "function") {
53
53
  var _reduce = [].concat(_toConsumableArray(contexts), [Context]).reduce(function(acc, ctx) {
54
54
  var _ref3 = React.useContext(ctx), handlers2 = _ref3.handlers, propsAndGetters = _objectWithoutProperties(_ref3, _excluded2);
@@ -57,7 +57,7 @@ function createChildren(Context, contexts) {
57
57
  handlers: Object.assign({}, acc.handlers, handlers2),
58
58
  getters: mergeObjects(acc.getters, getters2)
59
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);
60
+ }, _Children.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
61
  var mergedGetters = Object.entries(getters).reduce(function(acc, _ref4) {
62
62
  var _ref5 = _slicedToArray(_ref4, 2), key = _ref5[0], value = _ref5[1];
63
63
  acc[key] = assignGettersChain(value);
@@ -69,10 +69,10 @@ function createChildren(Context, contexts) {
69
69
  }
70
70
  return children;
71
71
  };
72
- Children.origin = null;
73
- Children.props = {};
74
- Children[CHILDREN_COMPONENT] = true;
75
- return Children;
72
+ _Children.origin = null;
73
+ _Children.props = {};
74
+ _Children[CHILDREN_COMPONENT] = true;
75
+ return _Children;
76
76
  }
77
77
  function Enhancement(Context, parent) {
78
78
  return {
@@ -8,11 +8,7 @@ var _excluded = ["render"], _excluded2 = ["Root", "styles", "children", "Childre
8
8
  function createRootRender() {
9
9
  var Root = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
10
10
  var Tag = _ref.render, source = _objectWithoutProperties(_ref, _excluded);
11
- var _Root$props = Root.props;
12
- _Root$props.Root;
13
- _Root$props.styles;
14
- _Root$props.children;
15
- var 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);
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);
16
12
  var clearProps = Object.entries(props).reduce(function(props2, _ref2) {
17
13
  var _ref3 = _slicedToArray(_ref2, 2), name = _ref3[0], value = _ref3[1];
18
14
  if (value !== void 0) {
@@ -41,7 +37,7 @@ function Enhancement() {
41
37
  init: function init() {
42
38
  this.Root = createRootRender();
43
39
  },
44
- asProps: function asProps(props, WrapperComponent, isFunction) {
40
+ asProps: function asProps(props, _WrapperComponent, isFunction) {
45
41
  if (isFunction) {
46
42
  return _objectSpread(_objectSpread({}, props), {}, {
47
43
  Root: this.Root
@@ -30,7 +30,7 @@ function handlerBinder(fn) {
30
30
  handlerBinder.hasher = /* @__PURE__ */ new WeakMap();
31
31
  function Enhancement() {
32
32
  return {
33
- condition: function condition(Component, isFunction) {
33
+ condition: function condition(_Component, isFunction) {
34
34
  return !isFunction;
35
35
  },
36
36
  init: function init() {
@@ -4,8 +4,8 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
5
  import React from "react";
6
6
  import assignProps from "../utils/assignProps.mjs";
7
- import useEnhancedEffect from "../utils/use/useEnhancedEffect.mjs";
8
7
  import pick from "../utils/pick.mjs";
8
+ import useEnhancedEffect from "../utils/use/useEnhancedEffect.mjs";
9
9
  var HOIST_CONTEXT = Symbol("HOIST_CONTEXT");
10
10
  var HOIST_SELF = Symbol("HOIST_SELF");
11
11
  var HOIST_SET = Symbol("HOIST_SET");
@@ -28,7 +28,7 @@ function Enhancement(childComponents, Context) {
28
28
  return Boolean((_Component$hoistProps = Component2.hoistProps) === null || _Component$hoistProps === void 0 ? void 0 : _Component$hoistProps.length);
29
29
  });
30
30
  },
31
- init: function init(props, WrapperComponent, isFunction) {
31
+ init: function init(_props, _WrapperComponent, isFunction) {
32
32
  var _this = this;
33
33
  if (isFunction) {
34
34
  this[HOIST_SELF] = React.useState({});
@@ -3,8 +3,8 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import React from "react";
5
5
  import assignProps from "../utils/assignProps.mjs";
6
- import pick from "../utils/pick.mjs";
7
6
  import logger from "../utils/logger.mjs";
7
+ import pick from "../utils/pick.mjs";
8
8
  function assign(target, source) {
9
9
  return Object.defineProperties(target, Object.keys(source).reduce(function(descriptors, key) {
10
10
  descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import React from "react";
5
5
  import { STATIC_COMPONENT } from "./staticChildren.mjs";
6
+ import "../styled/index.mjs";
6
7
  import { sstyled } from "../styled/sstyled.mjs";
7
8
  var _excluded = ["_styles", "styles"], _excluded2 = ["styles"];
8
9
  var STYLES_CONTEXT = Symbol("STYLES_CONTEXT");
@@ -27,9 +28,7 @@ function Enhancement(childComponents, Context) {
27
28
  return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, STYLES_CONTEXT, this[STYLES_SELF]));
28
29
  },
29
30
  asProps: function asProps(_ref) {
30
- _ref._styles;
31
- _ref.styles;
32
- var props = _objectWithoutProperties(_ref, _excluded);
31
+ var _styles = _ref._styles, styles = _ref.styles, props = _objectWithoutProperties(_ref, _excluded);
33
32
  return _objectSpread(_objectSpread({}, props), {}, {
34
33
  styles: this[STYLES_SELF]
35
34
  });
@@ -41,7 +41,6 @@ function uncontrolledProp(self, propName, propValue, propDefaultValue, propHandl
41
41
  function uncontrolledUniversal(props, config, uncontrolledProp2) {
42
42
  var handlerProps = {};
43
43
  var uncontrolledProps = Object.keys(config).reduce(function(result, propName) {
44
- var _objectSpread2;
45
44
  var handlerName = handlerProp(propName);
46
45
  var defaultPropName = defaultProp(propName);
47
46
  var propDefaultValue = result[defaultPropName], propValue = result[propName], propHandler = result[handlerName], other = _objectWithoutProperties(result, [defaultPropName, propName, handlerName].map(_toPropertyKey));
@@ -61,7 +60,7 @@ function uncontrolledUniversal(props, config, uncontrolledProp2) {
61
60
  };
62
61
  var _uncontrolledProp = uncontrolledProp2(propName, propValue, propDefaultValue, propHandler, chainHandler), _uncontrolledProp2 = _slicedToArray(_uncontrolledProp, 2), value = _uncontrolledProp2[0], handler = _uncontrolledProp2[1];
63
62
  handlerProps[propName] = handler;
64
- return _objectSpread(_objectSpread({}, other), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, propName, value), _defineProperty(_objectSpread2, handlerName, function(eventOrValue) {
63
+ return _objectSpread(_objectSpread({}, other), {}, _defineProperty(_defineProperty({}, propName, value), handlerName, function(eventOrValue) {
65
64
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
66
65
  args[_key2 - 1] = arguments[_key2];
67
66
  }
@@ -70,7 +69,7 @@ function uncontrolledUniversal(props, config, uncontrolledProp2) {
70
69
  result2.push(eventOrValue);
71
70
  }
72
71
  return handler.apply(void 0, _toConsumableArray(result2));
73
- }), _objectSpread2));
72
+ }));
74
73
  }, props);
75
74
  return [uncontrolledProps, handlerProps];
76
75
  }
package/lib/esm/index.mjs CHANGED
@@ -1,8 +1,9 @@
1
- import { assignProps, createBaseComponent, createComponent } from "./coreFactory.mjs";
2
1
  import { Component, Intergalactic, Root, wrapIntergalacticComponent } from "./core-types/Component.mjs";
3
2
  import { CHILDREN_COMPONENT, CONTEXT_COMPONENT, CORE_INSTANCE, CREATE_COMPONENT, INHERITED_NAME } from "./core-types/symbols.mjs";
4
- import { default as default2 } from "./register.mjs";
3
+ import { assignProps, createBaseComponent, createComponent } from "./coreFactory.mjs";
5
4
  import { lastInteraction } from "./LastInteractionType.mjs";
5
+ import { default as default2 } from "./register.mjs";
6
+ import "./styled/index.mjs";
6
7
  import { sstyled } from "./styled/sstyled.mjs";
7
8
  export {
8
9
  CHILDREN_COMPONENT,
@@ -6,7 +6,7 @@ var Register = /* @__PURE__ */ function() {
6
6
  _classCallCheck(this, Register2);
7
7
  _defineProperty(this, "data", {});
8
8
  }
9
- _createClass(Register2, [{
9
+ return _createClass(Register2, [{
10
10
  key: "get",
11
11
  value: function get(name, defaultValue) {
12
12
  if (name in this.data) {
@@ -22,7 +22,6 @@ var Register = /* @__PURE__ */ function() {
22
22
  return this.data[name];
23
23
  }
24
24
  }]);
25
- return Register2;
26
25
  }();
27
26
  const register = new Register();
28
27
  export {
@@ -0,0 +1,8 @@
1
+ import { css, styled, use } from "./reshadow-core.mjs";
2
+ import { sstyled } from "./sstyled.mjs";
3
+ export {
4
+ css,
5
+ sstyled,
6
+ styled,
7
+ use
8
+ };
@@ -1,5 +1,70 @@
1
- import "@babel/runtime/helpers/esm/typeof";
2
- import "@babel/runtime/helpers/esm/defineProperty";
1
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ var _Symbol = function _Symbol2(key) {
4
+ return typeof Symbol !== "undefined" ? Symbol(key) : key;
5
+ };
6
+ var KEYS = {
7
+ __id__: _Symbol("__id__"),
8
+ __store__: _Symbol("__store__"),
9
+ __prev__: _Symbol("__prev__"),
10
+ __use__: _Symbol("__use__"),
11
+ __elements__: "__elements__",
12
+ __style__: "$$style",
13
+ __styles__: "styles",
14
+ __css__: "__css__",
15
+ __hash__: "__hash__",
16
+ /**
17
+ * This prop is needed for the interop between different component frameworks
18
+ */
19
+ __classProp__: "className"
20
+ };
21
+ var index = 0;
22
+ var use = function use2(obj) {
23
+ var result = {};
24
+ result[KEYS.__use__] = obj;
25
+ return result;
26
+ };
27
+ var create = function create2(args) {
28
+ var len = args.length;
29
+ var newStyle = {};
30
+ var id = "";
31
+ var vars = null;
32
+ var uses = null;
33
+ for (var i = 0; i < len; i++) {
34
+ var _style = args[i];
35
+ if (!_style) continue;
36
+ if (!_style[KEYS.__id__]) {
37
+ _style[KEYS.__id__] = ++index;
38
+ _style[KEYS.__store__] = _defineProperty({}, "_" + _style[KEYS.__id__], _style);
39
+ }
40
+ id += "_" + _style[KEYS.__id__];
41
+ if (_style[KEYS.__style__]) {
42
+ vars = Object.assign(vars || {}, _style[KEYS.__style__]);
43
+ }
44
+ if (_style[KEYS.__use__]) {
45
+ uses = Object.assign(uses || {}, _style[KEYS.__use__]);
46
+ }
47
+ if (_style[KEYS.__store__][id]) {
48
+ newStyle = _style[KEYS.__store__][id];
49
+ continue;
50
+ }
51
+ newStyle = Object.create(newStyle);
52
+ for (var key in _style) {
53
+ if (key in KEYS) continue;
54
+ newStyle[key] = appendClassName(_style[key], newStyle[key]);
55
+ }
56
+ _style[KEYS.__store__][id] = newStyle;
57
+ newStyle[KEYS.__id__] = index;
58
+ newStyle[KEYS.__store__] = _defineProperty({}, "_" + _style[KEYS.__id__], newStyle);
59
+ }
60
+ if (vars || use) {
61
+ newStyle = Object.create(newStyle);
62
+ newStyle[KEYS.__style__] = vars;
63
+ newStyle[KEYS.__use__] = uses;
64
+ }
65
+ return newStyle;
66
+ };
67
+ var isSSR = !(typeof window !== "undefined" && window.document && window.document.createElement);
3
68
  var serverMap = {};
4
69
  var getStyles = function getStyles2() {
5
70
  return {
@@ -13,6 +78,157 @@ var getStyles = function getStyles2() {
13
78
  }
14
79
  };
15
80
  };
81
+ var clearStyles = function clearStyles2() {
82
+ serverStyles = "";
83
+ };
84
+ var RESHADOW_ID = "__reshadow__";
85
+ var appendChildToDocumentHead = function appendChildToDocumentHead2(element) {
86
+ return document.head.appendChild(element);
87
+ };
88
+ var css = function css2(code, hash) {
89
+ var id = "reshadow-".concat(hash);
90
+ if (isSSR) {
91
+ serverMap[id] = code;
92
+ return;
93
+ }
94
+ var container = document.getElementById(RESHADOW_ID);
95
+ if (!container) {
96
+ container = document.createElement("object");
97
+ container.id = RESHADOW_ID;
98
+ if (document.head) {
99
+ appendChildToDocumentHead(container);
100
+ } else {
101
+ document.addEventListener("DOMContentLoaded", function() {
102
+ appendChildToDocumentHead(container);
103
+ });
104
+ }
105
+ }
106
+ var css3 = document.getElementById(id);
107
+ if (!css3) {
108
+ css3 = document.createElement("style");
109
+ css3.id = id;
110
+ css3.type = "text/css";
111
+ container.appendChild(css3);
112
+ }
113
+ css3.innerHTML = code;
114
+ };
115
+ var styles = {};
116
+ var style;
117
+ var stack = [];
118
+ var _styled = function styled(elem) {
119
+ var curr = stack.pop() || [];
120
+ styles = curr[0] || styles;
121
+ style = curr[1] || style;
122
+ _styled[KEYS.__styles__] = styles;
123
+ _styled[KEYS.__style__] = style;
124
+ return elem;
125
+ };
126
+ _styled[KEYS.__styles__] = styles;
127
+ var set = function set2(args, newStyle) {
128
+ var newStyles = create(args);
129
+ stack.push([styles, style]);
130
+ styles = newStyles;
131
+ style = newStyle;
132
+ if (styles[KEYS.__style__]) {
133
+ style = style ? Object.assign({}, style, styles[KEYS.__style__]) : styles[KEYS.__style__];
134
+ }
135
+ _styled[KEYS.__styles__] = styles;
136
+ _styled[KEYS.__style__] = style;
137
+ };
138
+ var USE_PREFIX = "use--";
139
+ var ELEMENT_PREFIX = "__";
140
+ var MOD_PREFIX = "_";
141
+ var MOD_SEPARATOR = "_";
142
+ var parseElement = function parseElement2(name) {
143
+ return name.replace(ELEMENT_PREFIX, "");
144
+ };
145
+ var parseAttribute = function parseAttribute2(name) {
146
+ return name.replace(MOD_PREFIX, "").split(MOD_SEPARATOR);
147
+ };
148
+ var appendClassName = function appendClassName2(className) {
149
+ var cn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
150
+ if (className) {
151
+ cn += (cn ? " " : "") + className;
152
+ }
153
+ return cn;
154
+ };
155
+ var appendElement = function appendElement2(styles2, key) {
156
+ var cn = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
157
+ return appendClassName(styles2[ELEMENT_PREFIX + key], cn);
158
+ };
159
+ var appendModifier = function appendModifier2(styles2, key, value) {
160
+ var cn = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
161
+ if (value === void 0 || value === null || value === false || value === "") return cn;
162
+ cn = appendClassName(styles2[MOD_PREFIX + key], cn);
163
+ if (typeof value === "boolean" || _typeof(value) === "object" || typeof value === "function") return cn;
164
+ cn = appendClassName(styles2[MOD_SEPARATOR + key + MOD_SEPARATOR + value], cn);
165
+ return cn;
166
+ };
167
+ function map(element) {
168
+ var currStyles = _styled[KEYS.__styles__];
169
+ var nextProps = {};
170
+ var cn = appendElement(currStyles, element);
171
+ var vars = null;
172
+ var uses = currStyles[KEYS.__use__] || {};
173
+ var len = arguments.length;
174
+ var useProps;
175
+ for (var i = len - 1; i > 0; i--) {
176
+ var currProps = arguments[i];
177
+ if (!currProps) continue;
178
+ useProps = useProps || currProps[KEYS.__use__];
179
+ if (!vars && KEYS.__style__ in currProps) {
180
+ vars = _styled[KEYS.__style__];
181
+ }
182
+ for (var key in currProps) {
183
+ if (key === KEYS.__use__ || key === KEYS.__style__ || key in nextProps) {
184
+ continue;
185
+ }
186
+ var value = currProps[key];
187
+ cn = appendModifier(currStyles, key, value, cn);
188
+ var valueType = _typeof(value);
189
+ if (valueType === "string" || valueType === "boolean" || valueType === "number") {
190
+ var useKey = key + "_" + value;
191
+ if (key + "_true" in uses || useKey in uses) {
192
+ cn = appendModifier(currStyles, USE_PREFIX + key, value, cn);
193
+ if (uses[useKey]) {
194
+ continue;
195
+ }
196
+ }
197
+ }
198
+ nextProps[key] = value;
199
+ }
200
+ }
201
+ if (useProps) {
202
+ for (var _key in useProps) {
203
+ var _value = useProps[_key];
204
+ cn = appendModifier(currStyles, USE_PREFIX + _key, _value, cn);
205
+ }
206
+ }
207
+ cn = appendClassName(nextProps[KEYS.__classProp__], cn);
208
+ if (cn) nextProps[KEYS.__classProp__] = cn;
209
+ if (vars) {
210
+ nextProps.style = typeof style === "string" ? vars + (nextProps.style || "") : Object.assign({}, vars, nextProps.style || {});
211
+ }
212
+ return nextProps;
213
+ }
16
214
  export {
17
- getStyles
215
+ ELEMENT_PREFIX,
216
+ KEYS,
217
+ MOD_PREFIX,
218
+ MOD_SEPARATOR,
219
+ RESHADOW_ID,
220
+ USE_PREFIX,
221
+ appendClassName,
222
+ appendElement,
223
+ appendModifier,
224
+ clearStyles,
225
+ create,
226
+ css,
227
+ getStyles,
228
+ map,
229
+ parseAttribute,
230
+ parseElement,
231
+ set,
232
+ _styled as styled,
233
+ use
18
234
  };
@@ -109,7 +109,7 @@ function sstyled() {
109
109
  }
110
110
  };
111
111
  }
112
- sstyled.css = function(css) {
112
+ sstyled.css = function(_css) {
113
113
  throw new Error("Enable babel plugin");
114
114
  };
115
115
  sstyled.insert = insert;
@@ -1,6 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _cn from "classnames";
3
3
  import { forkRef } from "./ref.mjs";
4
+ import "../styled/index.mjs";
4
5
  import { sstyled } from "../styled/sstyled.mjs";
5
6
  function callAllEventHandlers() {
6
7
  for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -19,6 +20,14 @@ function callAllEventHandlers() {
19
20
  });
20
21
  };
21
22
  }
23
+ function assignHandlers(props, source) {
24
+ return Object.keys(source).reduce(function(proxySource, propName) {
25
+ if (typeof source[propName] === "function" && propName.startsWith("on")) {
26
+ proxySource[propName] = callAllEventHandlers(props[propName], source[propName]);
27
+ }
28
+ return proxySource;
29
+ }, {});
30
+ }
22
31
  function assignHandlersInner(props, source) {
23
32
  return Object.keys(source).reduce(function(proxySource, propName) {
24
33
  if (propName !== "ref" && propName.startsWith("on")) {
@@ -71,6 +80,7 @@ function assignProps() {
71
80
  return newProps;
72
81
  }
73
82
  export {
83
+ assignHandlers,
74
84
  callAllEventHandlers,
75
85
  assignProps as default
76
86
  };
@@ -0,0 +1,47 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
8
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
9
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
10
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
11
+ import hoistNonReactStatics from "hoist-non-react-statics";
12
+ import React, { PureComponent } from "react";
13
+ import getDisplayName from "./getDisplayName.mjs";
14
+ var _excluded = ["forwardedRef"];
15
+ function _callSuper(t, o, e) {
16
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
17
+ }
18
+ function createHoc(EnhancedComponent) {
19
+ return function createWrapper() {
20
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
21
+ return function(WrappedComponent) {
22
+ var Component = /* @__PURE__ */ function(_PureComponent) {
23
+ function Component2() {
24
+ _classCallCheck(this, Component2);
25
+ return _callSuper(this, Component2, arguments);
26
+ }
27
+ _inherits(Component2, _PureComponent);
28
+ return _createClass(Component2, [{
29
+ key: "render",
30
+ value: function render() {
31
+ var _WrappedComponent$def = _objectSpread(_objectSpread({}, WrappedComponent.defaultProps), this.props), forwardedRef = _WrappedComponent$def.forwardedRef, others = _objectWithoutProperties(_WrappedComponent$def, _excluded);
32
+ return /* @__PURE__ */ React.createElement(EnhancedComponent, _extends({}, options, this.props), function(enhancedComponentProps) {
33
+ return /* @__PURE__ */ React.createElement(WrappedComponent, _extends({
34
+ forwardedRef
35
+ }, others, enhancedComponentProps));
36
+ });
37
+ }
38
+ }]);
39
+ }(PureComponent);
40
+ _defineProperty(Component, "displayName", getDisplayName(WrappedComponent));
41
+ return hoistNonReactStatics(Component, WrappedComponent);
42
+ };
43
+ };
44
+ }
45
+ export {
46
+ createHoc as default
47
+ };
@@ -1,15 +1,20 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
4
+ import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
4
6
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { createContext, Component } from "react";
8
- import { createIntlCache } from "@formatjs/intl";
8
+ import { createIntlCache, createIntl } from "@formatjs/intl";
9
+ import React, { createContext, Component } from "react";
10
+ import createHoc from "../createHoc.mjs";
11
+ import { useAsyncI18nMessages } from "./i18nEnhance.mjs";
12
+ function _callSuper(t, o, e) {
13
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
14
+ }
9
15
  var Context = /* @__PURE__ */ createContext(void 0);
10
- Context.Provider;
11
- Context.Consumer;
12
- createIntlCache();
16
+ var I18nProvider = Context.Provider, I18nConsumer = Context.Consumer;
17
+ var messagesCache = createIntlCache();
13
18
  function getText(dictionaries, locale) {
14
19
  return function(key) {
15
20
  var dictionary = dictionaries[locale];
@@ -17,24 +22,23 @@ function getText(dictionaries, locale) {
17
22
  };
18
23
  }
19
24
  var WithI18n = /* @__PURE__ */ function(_Component) {
20
- _inherits(WithI18n2, _Component);
21
- var _super = _createSuper(WithI18n2);
22
25
  function WithI18n2() {
23
26
  var _this;
24
27
  _classCallCheck(this, WithI18n2);
25
28
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
29
  args[_key] = arguments[_key];
27
30
  }
28
- _this = _super.call.apply(_super, [this].concat(args));
29
- _defineProperty(_assertThisInitialized(_this), "context", void 0);
30
- _defineProperty(_assertThisInitialized(_this), "getText", function(dictionary, selfLocale) {
31
+ _this = _callSuper(this, WithI18n2, [].concat(args));
32
+ _defineProperty(_this, "context", void 0);
33
+ _defineProperty(_this, "getText", function(dictionary, selfLocale) {
31
34
  var _this$props = _this.props, locale = _this$props.locale, getText2 = _this$props.getText;
32
35
  var contextLocale = _this.context;
33
36
  return getText2(dictionary, selfLocale || locale || contextLocale);
34
37
  });
35
38
  return _this;
36
39
  }
37
- _createClass(WithI18n2, [{
40
+ _inherits(WithI18n2, _Component);
41
+ return _createClass(WithI18n2, [{
38
42
  key: "render",
39
43
  value: function render() {
40
44
  var _ref = this.props, children = _ref.children;
@@ -43,12 +47,34 @@ var WithI18n = /* @__PURE__ */ function(_Component) {
43
47
  });
44
48
  }
45
49
  }]);
46
- return WithI18n2;
47
50
  }(Component);
48
51
  _defineProperty(WithI18n, "contextType", Context);
49
52
  _defineProperty(WithI18n, "defaultProps", {
50
53
  getText
51
54
  });
55
+ var useI18n = function useI18n2(dictionary) {
56
+ var _React$useContext;
57
+ var locale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en";
58
+ var fallbackDictionary = arguments.length > 2 ? arguments[2] : void 0;
59
+ var lang = (_React$useContext = React.useContext(Context)) !== null && _React$useContext !== void 0 ? _React$useContext : locale;
60
+ var resolvedDictionary = useAsyncI18nMessages(dictionary, lang, fallbackDictionary);
61
+ var intl = React.useMemo(function() {
62
+ return createIntl({
63
+ locale: lang,
64
+ messages: resolvedDictionary
65
+ }, messagesCache);
66
+ }, [resolvedDictionary, lang]);
67
+ return React.useCallback(function(messageId, variables) {
68
+ return intl.formatMessage({
69
+ id: messageId !== null && messageId !== void 0 ? messageId : ""
70
+ }, variables);
71
+ }, [intl]);
72
+ };
73
+ const WithI18n$1 = createHoc(WithI18n);
52
74
  export {
53
- Context
75
+ Context,
76
+ I18nConsumer,
77
+ I18nProvider,
78
+ WithI18n$1 as default,
79
+ useI18n
54
80
  };