@semcore/core 2.39.4 → 16.0.0-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 (543) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -2
  3. package/lib/LastInteractionType.d.ts +11 -0
  4. package/lib/LastInteractionType.js +57 -0
  5. package/lib/LastInteractionType.js.map +1 -0
  6. package/lib/LastInteractionType.mjs +51 -0
  7. package/lib/LastInteractionType.mjs.map +1 -0
  8. package/lib/core-types/Component.d.ts +189 -0
  9. package/lib/core-types/Component.js +59 -0
  10. package/lib/core-types/Component.js.map +1 -0
  11. package/lib/core-types/Component.mjs +51 -0
  12. package/lib/core-types/Component.mjs.map +1 -0
  13. package/lib/core-types/UnknownProperties.d.ts +3 -0
  14. package/lib/core-types/UnknownProperties.js +2 -0
  15. package/lib/core-types/UnknownProperties.js.map +1 -0
  16. package/lib/core-types/UnknownProperties.mjs +2 -0
  17. package/lib/core-types/UnknownProperties.mjs.map +1 -0
  18. package/lib/core-types/reshadow.d.js +2 -0
  19. package/lib/core-types/reshadow.d.js.map +1 -0
  20. package/lib/core-types/reshadow.d.mjs +2 -0
  21. package/lib/core-types/reshadow.d.mjs.map +1 -0
  22. package/lib/core-types/symbols.d.ts +9 -0
  23. package/lib/core-types/symbols.js +25 -0
  24. package/lib/core-types/symbols.js.map +1 -0
  25. package/lib/core-types/symbols.mjs +20 -0
  26. package/lib/core-types/symbols.mjs.map +1 -0
  27. package/lib/coreFactory.d.ts +27 -0
  28. package/lib/coreFactory.js +352 -0
  29. package/lib/coreFactory.js.map +1 -0
  30. package/lib/coreFactory.mjs +324 -0
  31. package/lib/coreFactory.mjs.map +1 -0
  32. package/lib/enhancement/Children.d.ts +5 -0
  33. package/lib/enhancement/Children.js +119 -0
  34. package/lib/enhancement/Children.js.map +1 -0
  35. package/lib/enhancement/Children.mjs +96 -0
  36. package/lib/enhancement/Children.mjs.map +1 -0
  37. package/lib/enhancement/Root.d.ts +6 -0
  38. package/lib/enhancement/Root.js +78 -0
  39. package/lib/enhancement/Root.js.map +1 -0
  40. package/lib/enhancement/Root.mjs +56 -0
  41. package/lib/enhancement/Root.mjs.map +1 -0
  42. package/lib/enhancement/bindHandler.d.ts +5 -0
  43. package/lib/enhancement/bindHandler.js +54 -0
  44. package/lib/enhancement/bindHandler.js.map +1 -0
  45. package/lib/enhancement/bindHandler.mjs +48 -0
  46. package/lib/enhancement/bindHandler.mjs.map +1 -0
  47. package/lib/enhancement/dataName.d.ts +4 -0
  48. package/lib/enhancement/dataName.js +20 -0
  49. package/lib/enhancement/dataName.js.map +1 -0
  50. package/lib/enhancement/dataName.mjs +13 -0
  51. package/lib/enhancement/dataName.mjs.map +1 -0
  52. package/lib/enhancement/enhance.d.ts +5 -0
  53. package/lib/enhancement/enhance.js +22 -0
  54. package/lib/enhancement/enhance.js.map +1 -0
  55. package/lib/enhancement/enhance.mjs +16 -0
  56. package/lib/enhancement/enhance.mjs.map +1 -0
  57. package/lib/enhancement/functionDefaultProps.d.ts +8 -0
  58. package/lib/enhancement/functionDefaultProps.js +36 -0
  59. package/lib/enhancement/functionDefaultProps.js.map +1 -0
  60. package/lib/enhancement/functionDefaultProps.mjs +29 -0
  61. package/lib/enhancement/functionDefaultProps.mjs.map +1 -0
  62. package/lib/enhancement/hoistProps.d.ts +10 -0
  63. package/lib/enhancement/hoistProps.js +97 -0
  64. package/lib/enhancement/hoistProps.js.map +1 -0
  65. package/lib/enhancement/hoistProps.mjs +78 -0
  66. package/lib/enhancement/hoistProps.mjs.map +1 -0
  67. package/lib/enhancement/i18n.d.ts +4 -0
  68. package/lib/enhancement/i18n.js +28 -0
  69. package/lib/enhancement/i18n.js.map +1 -0
  70. package/lib/enhancement/i18n.mjs +20 -0
  71. package/lib/enhancement/i18n.mjs.map +1 -0
  72. package/lib/enhancement/inheritedName.d.ts +8 -0
  73. package/lib/enhancement/inheritedName.js +23 -0
  74. package/lib/enhancement/inheritedName.js.map +1 -0
  75. package/lib/enhancement/inheritedName.mjs +16 -0
  76. package/lib/enhancement/inheritedName.mjs.map +1 -0
  77. package/lib/enhancement/staticChildren.d.ts +13 -0
  78. package/lib/enhancement/staticChildren.js +135 -0
  79. package/lib/enhancement/staticChildren.js.map +1 -0
  80. package/lib/enhancement/staticChildren.mjs +120 -0
  81. package/lib/enhancement/staticChildren.mjs.map +1 -0
  82. package/lib/enhancement/style.d.ts +9 -0
  83. package/lib/enhancement/style.js +60 -0
  84. package/lib/enhancement/style.js.map +1 -0
  85. package/lib/enhancement/style.mjs +49 -0
  86. package/lib/enhancement/style.mjs.map +1 -0
  87. package/lib/enhancement/uncontrolledProps.d.ts +7 -0
  88. package/lib/enhancement/uncontrolledProps.js +131 -0
  89. package/lib/enhancement/uncontrolledProps.js.map +1 -0
  90. package/lib/enhancement/uncontrolledProps.mjs +107 -0
  91. package/lib/enhancement/uncontrolledProps.mjs.map +1 -0
  92. package/lib/esm/LastInteractionType.mjs +51 -0
  93. package/lib/esm/core-types/Component.mjs +51 -0
  94. package/lib/esm/core-types/symbols.mjs +20 -0
  95. package/lib/esm/coreFactory.mjs +324 -0
  96. package/lib/esm/enhancement/Children.mjs +96 -0
  97. package/lib/esm/enhancement/Root.mjs +56 -0
  98. package/lib/esm/enhancement/bindHandler.mjs +48 -0
  99. package/lib/esm/enhancement/dataName.mjs +13 -0
  100. package/lib/esm/enhancement/enhance.mjs +16 -0
  101. package/lib/esm/enhancement/functionDefaultProps.mjs +29 -0
  102. package/lib/esm/enhancement/hoistProps.mjs +78 -0
  103. package/lib/esm/enhancement/i18n.mjs +20 -0
  104. package/lib/esm/enhancement/inheritedName.mjs +16 -0
  105. package/lib/esm/enhancement/staticChildren.mjs +120 -0
  106. package/lib/esm/enhancement/style.mjs +49 -0
  107. package/lib/esm/enhancement/uncontrolledProps.mjs +107 -0
  108. package/lib/esm/index.mjs +22 -4
  109. package/lib/esm/register.mjs +31 -0
  110. package/lib/esm/styled/index.mjs +8 -0
  111. package/lib/esm/styled/reshadow-core.mjs +234 -0
  112. package/lib/esm/styled/sstyled.mjs +121 -0
  113. package/lib/esm/utils/assignProps.mjs +86 -0
  114. package/lib/esm/utils/canUseDOM.mjs +6 -0
  115. package/lib/esm/utils/capitalizeFirstLetter.mjs +6 -0
  116. package/lib/esm/utils/createHoc.mjs +44 -0
  117. package/lib/esm/utils/enhances/WithI18n.mjs +78 -0
  118. package/lib/esm/utils/enhances/i18nEnhance.mjs +91 -0
  119. package/lib/esm/utils/getDisplayName.mjs +6 -0
  120. package/lib/esm/utils/logger.mjs +35 -0
  121. package/lib/esm/utils/pick.mjs +15 -0
  122. package/lib/esm/utils/ref.mjs +87 -0
  123. package/lib/esm/utils/use/useEnhancedEffect.mjs +6 -0
  124. package/lib/index.d.ts +11 -0
  125. package/lib/index.js +103 -0
  126. package/lib/index.js.map +1 -0
  127. package/lib/index.mjs +24 -0
  128. package/lib/index.mjs.map +1 -0
  129. package/lib/register.d.ts +8 -0
  130. package/lib/register.js +37 -0
  131. package/lib/register.js.map +1 -0
  132. package/lib/register.mjs +31 -0
  133. package/lib/register.mjs.map +1 -0
  134. package/lib/styled/index.d.ts +11 -0
  135. package/lib/styled/index.js +32 -0
  136. package/lib/styled/index.js.map +1 -0
  137. package/lib/styled/index.mjs +8 -0
  138. package/lib/styled/index.mjs.map +1 -0
  139. package/lib/styled/reshadow-core.d.ts +37 -0
  140. package/lib/styled/reshadow-core.js +256 -0
  141. package/lib/styled/reshadow-core.js.map +1 -0
  142. package/lib/styled/reshadow-core.mjs +234 -0
  143. package/lib/styled/reshadow-core.mjs.map +1 -0
  144. package/lib/styled/sstyled.d.ts +17 -0
  145. package/lib/styled/sstyled.js +149 -0
  146. package/lib/styled/sstyled.js.map +1 -0
  147. package/lib/styled/sstyled.mjs +121 -0
  148. package/lib/styled/sstyled.mjs.map +1 -0
  149. package/lib/theme/dark.json +2506 -0
  150. package/lib/theme/exclude-tokens.json +10 -0
  151. package/lib/theme/light.json +2584 -0
  152. package/lib/theme/processor.d.ts +1 -0
  153. package/lib/theme/processor.js +315 -0
  154. package/lib/theme/processor.js.map +1 -0
  155. package/lib/theme/processor.mjs +307 -0
  156. package/lib/theme/processor.mjs.map +1 -0
  157. package/lib/theme/themes/auto.css +1465 -0
  158. package/lib/theme/themes/dark.css +723 -0
  159. package/lib/theme/themes/dark.d.ts +378 -0
  160. package/lib/theme/themes/dark.js +385 -0
  161. package/lib/theme/themes/dark.js.map +1 -0
  162. package/lib/theme/themes/dark.mjs +378 -0
  163. package/lib/theme/themes/dark.mjs.map +1 -0
  164. package/lib/theme/themes/default.css +742 -0
  165. package/lib/theme/themes/default.d.ts +387 -0
  166. package/lib/theme/themes/default.js +394 -0
  167. package/lib/theme/themes/default.js.map +1 -0
  168. package/lib/theme/themes/default.mjs +387 -0
  169. package/lib/theme/themes/default.mjs.map +1 -0
  170. package/lib/theme/themes/light.css +742 -0
  171. package/lib/theme/themes/light.d.ts +387 -0
  172. package/lib/theme/themes/light.js +394 -0
  173. package/lib/theme/themes/light.js.map +1 -0
  174. package/lib/theme/themes/light.mjs +387 -0
  175. package/lib/theme/themes/light.mjs.map +1 -0
  176. package/lib/theme/utils.d.ts +52 -0
  177. package/lib/theme/utils.js +297 -0
  178. package/lib/theme/utils.js.map +1 -0
  179. package/lib/theme/utils.mjs +286 -0
  180. package/lib/theme/utils.mjs.map +1 -0
  181. package/lib/utils/CSSinJS.d.ts +5 -0
  182. package/lib/utils/CSSinJS.js +36 -0
  183. package/lib/utils/CSSinJS.js.map +1 -0
  184. package/lib/utils/CSSinJS.mjs +28 -0
  185. package/lib/utils/CSSinJS.mjs.map +1 -0
  186. package/lib/utils/ScreenReaderOnly.d.ts +8 -0
  187. package/lib/utils/ScreenReaderOnly.js +31 -0
  188. package/lib/utils/ScreenReaderOnly.js.map +1 -0
  189. package/lib/utils/ScreenReaderOnly.mjs +24 -0
  190. package/lib/utils/ScreenReaderOnly.mjs.map +1 -0
  191. package/lib/utils/ThemeProvider.d.ts +15 -0
  192. package/lib/utils/ThemeProvider.js +82 -0
  193. package/lib/utils/ThemeProvider.js.map +1 -0
  194. package/lib/utils/ThemeProvider.mjs +71 -0
  195. package/lib/utils/ThemeProvider.mjs.map +1 -0
  196. package/lib/utils/addonText.d.ts +2 -0
  197. package/lib/utils/addonText.js +18 -0
  198. package/lib/utils/addonText.js.map +1 -0
  199. package/lib/utils/addonText.mjs +11 -0
  200. package/lib/utils/addonText.mjs.map +1 -0
  201. package/lib/utils/addonTextChildren.d.ts +3 -0
  202. package/lib/utils/addonTextChildren.js +45 -0
  203. package/lib/utils/addonTextChildren.js.map +1 -0
  204. package/lib/utils/addonTextChildren.mjs +37 -0
  205. package/lib/utils/addonTextChildren.mjs.map +1 -0
  206. package/lib/utils/ariaProps.d.ts +12 -0
  207. package/lib/utils/ariaProps.js +22 -0
  208. package/lib/utils/ariaProps.js.map +1 -0
  209. package/lib/utils/ariaProps.mjs +16 -0
  210. package/lib/utils/ariaProps.mjs.map +1 -0
  211. package/lib/utils/assignProps.d.ts +11 -0
  212. package/lib/utils/assignProps.js +93 -0
  213. package/lib/utils/assignProps.js.map +1 -0
  214. package/lib/utils/assignProps.mjs +86 -0
  215. package/lib/utils/assignProps.mjs.map +1 -0
  216. package/lib/utils/canUseDOM.d.ts +1 -0
  217. package/lib/utils/canUseDOM.js +10 -0
  218. package/lib/utils/canUseDOM.js.map +1 -0
  219. package/lib/utils/canUseDOM.mjs +6 -0
  220. package/lib/utils/canUseDOM.mjs.map +1 -0
  221. package/lib/utils/capitalizeFirstLetter.d.ts +1 -0
  222. package/lib/utils/capitalizeFirstLetter.js +10 -0
  223. package/lib/utils/capitalizeFirstLetter.js.map +1 -0
  224. package/lib/utils/capitalizeFirstLetter.mjs +6 -0
  225. package/lib/utils/capitalizeFirstLetter.mjs.map +1 -0
  226. package/lib/utils/color.d.ts +5 -0
  227. package/lib/utils/color.js +208 -0
  228. package/lib/utils/color.js.map +1 -0
  229. package/lib/utils/color.mjs +196 -0
  230. package/lib/utils/color.mjs.map +1 -0
  231. package/lib/utils/compose.d.ts +1 -0
  232. package/lib/utils/compose.js +21 -0
  233. package/lib/utils/compose.js.map +1 -0
  234. package/lib/utils/compose.mjs +15 -0
  235. package/lib/utils/compose.mjs.map +1 -0
  236. package/lib/utils/createHoc.d.ts +3 -0
  237. package/lib/utils/createHoc.js +55 -0
  238. package/lib/utils/createHoc.js.map +1 -0
  239. package/lib/utils/createHoc.mjs +44 -0
  240. package/lib/utils/createHoc.mjs.map +1 -0
  241. package/lib/utils/createUUID.d.ts +1 -0
  242. package/lib/utils/createUUID.js +15 -0
  243. package/lib/utils/createUUID.js.map +1 -0
  244. package/lib/utils/createUUID.mjs +9 -0
  245. package/lib/utils/createUUID.mjs.map +1 -0
  246. package/lib/utils/cssToIntDefault.d.ts +8 -0
  247. package/lib/utils/cssToIntDefault.js +22 -0
  248. package/lib/utils/cssToIntDefault.js.map +1 -0
  249. package/lib/utils/cssToIntDefault.mjs +16 -0
  250. package/lib/utils/cssToIntDefault.mjs.map +1 -0
  251. package/lib/utils/enhances/WithAutoFocus.d.ts +14 -0
  252. package/lib/utils/enhances/WithAutoFocus.js +75 -0
  253. package/lib/utils/enhances/WithAutoFocus.js.map +1 -0
  254. package/lib/utils/enhances/WithAutoFocus.mjs +67 -0
  255. package/lib/utils/enhances/WithAutoFocus.mjs.map +1 -0
  256. package/lib/utils/enhances/WithCSS.d.ts +41 -0
  257. package/lib/utils/enhances/WithCSS.js +93 -0
  258. package/lib/utils/enhances/WithCSS.js.map +1 -0
  259. package/lib/utils/enhances/WithCSS.mjs +79 -0
  260. package/lib/utils/enhances/WithCSS.mjs.map +1 -0
  261. package/lib/utils/enhances/WithI18n.d.ts +43 -0
  262. package/lib/utils/enhances/WithI18n.js +95 -0
  263. package/lib/utils/enhances/WithI18n.js.map +1 -0
  264. package/lib/utils/enhances/WithI18n.mjs +78 -0
  265. package/lib/utils/enhances/WithI18n.mjs.map +1 -0
  266. package/lib/utils/enhances/WithKeyboardFocus.d.ts +45 -0
  267. package/lib/utils/enhances/WithKeyboardFocus.js +93 -0
  268. package/lib/utils/enhances/WithKeyboardFocus.js.map +1 -0
  269. package/lib/utils/enhances/WithKeyboardFocus.mjs +84 -0
  270. package/lib/utils/enhances/WithKeyboardFocus.mjs.map +1 -0
  271. package/lib/utils/enhances/WithRef.d.ts +3 -0
  272. package/lib/utils/enhances/WithRef.js +26 -0
  273. package/lib/utils/enhances/WithRef.js.map +1 -0
  274. package/lib/utils/enhances/WithRef.mjs +18 -0
  275. package/lib/utils/enhances/WithRef.mjs.map +1 -0
  276. package/lib/utils/enhances/a11yEnhance.d.ts +10 -0
  277. package/lib/utils/enhances/a11yEnhance.js +74 -0
  278. package/lib/utils/enhances/a11yEnhance.js.map +1 -0
  279. package/lib/utils/enhances/a11yEnhance.mjs +66 -0
  280. package/lib/utils/enhances/a11yEnhance.mjs.map +1 -0
  281. package/lib/utils/enhances/animatedSizeEnhance.d.ts +12 -0
  282. package/lib/utils/enhances/animatedSizeEnhance.js +98 -0
  283. package/lib/utils/enhances/animatedSizeEnhance.js.map +1 -0
  284. package/lib/utils/enhances/animatedSizeEnhance.mjs +90 -0
  285. package/lib/utils/enhances/animatedSizeEnhance.mjs.map +1 -0
  286. package/lib/utils/enhances/autoFocusEnhance.d.ts +10 -0
  287. package/lib/utils/enhances/autoFocusEnhance.js +46 -0
  288. package/lib/utils/enhances/autoFocusEnhance.js.map +1 -0
  289. package/lib/utils/enhances/autoFocusEnhance.mjs +38 -0
  290. package/lib/utils/enhances/autoFocusEnhance.mjs.map +1 -0
  291. package/lib/utils/enhances/contextEnhance.d.ts +3 -0
  292. package/lib/utils/enhances/contextEnhance.js +22 -0
  293. package/lib/utils/enhances/contextEnhance.js.map +1 -0
  294. package/lib/utils/enhances/contextEnhance.mjs +14 -0
  295. package/lib/utils/enhances/contextEnhance.mjs.map +1 -0
  296. package/lib/utils/enhances/i18nEnhance.d.ts +25 -0
  297. package/lib/utils/enhances/i18nEnhance.js +101 -0
  298. package/lib/utils/enhances/i18nEnhance.js.map +1 -0
  299. package/lib/utils/enhances/i18nEnhance.mjs +91 -0
  300. package/lib/utils/enhances/i18nEnhance.mjs.map +1 -0
  301. package/lib/utils/enhances/keyboardFocusEnhance.d.ts +27 -0
  302. package/lib/utils/enhances/keyboardFocusEnhance.js +63 -0
  303. package/lib/utils/enhances/keyboardFocusEnhance.js.map +1 -0
  304. package/lib/utils/enhances/keyboardFocusEnhance.mjs +57 -0
  305. package/lib/utils/enhances/keyboardFocusEnhance.mjs.map +1 -0
  306. package/lib/utils/enhances/resolveColorEnhance.d.ts +2 -0
  307. package/lib/utils/enhances/resolveColorEnhance.js +25 -0
  308. package/lib/utils/enhances/resolveColorEnhance.js.map +1 -0
  309. package/lib/utils/enhances/resolveColorEnhance.mjs +17 -0
  310. package/lib/utils/enhances/resolveColorEnhance.mjs.map +1 -0
  311. package/lib/utils/eventEmitter.d.ts +9 -0
  312. package/lib/utils/eventEmitter.js +41 -0
  313. package/lib/utils/eventEmitter.js.map +1 -0
  314. package/lib/utils/eventEmitter.mjs +34 -0
  315. package/lib/utils/eventEmitter.mjs.map +1 -0
  316. package/lib/utils/findComponent.d.ts +12 -0
  317. package/lib/utils/findComponent.js +106 -0
  318. package/lib/utils/findComponent.js.map +1 -0
  319. package/lib/utils/findComponent.mjs +95 -0
  320. package/lib/utils/findComponent.mjs.map +1 -0
  321. package/lib/utils/fire.d.ts +2 -0
  322. package/lib/utils/fire.js +23 -0
  323. package/lib/utils/fire.js.map +1 -0
  324. package/lib/utils/fire.mjs +15 -0
  325. package/lib/utils/fire.mjs.map +1 -0
  326. package/lib/utils/focus-lock/focusBorders.d.ts +4 -0
  327. package/lib/utils/focus-lock/focusBorders.js +72 -0
  328. package/lib/utils/focus-lock/focusBorders.js.map +1 -0
  329. package/lib/utils/focus-lock/focusBorders.mjs +62 -0
  330. package/lib/utils/focus-lock/focusBorders.mjs.map +1 -0
  331. package/lib/utils/focus-lock/getFocusableIn.d.ts +1 -0
  332. package/lib/utils/focus-lock/getFocusableIn.js +26 -0
  333. package/lib/utils/focus-lock/getFocusableIn.js.map +1 -0
  334. package/lib/utils/focus-lock/getFocusableIn.mjs +19 -0
  335. package/lib/utils/focus-lock/getFocusableIn.mjs.map +1 -0
  336. package/lib/utils/focus-lock/isFocusInside.d.ts +1 -0
  337. package/lib/utils/focus-lock/isFocusInside.js +16 -0
  338. package/lib/utils/focus-lock/isFocusInside.js.map +1 -0
  339. package/lib/utils/focus-lock/isFocusInside.mjs +9 -0
  340. package/lib/utils/focus-lock/isFocusInside.mjs.map +1 -0
  341. package/lib/utils/focus-lock/isFocusable.d.ts +1 -0
  342. package/lib/utils/focus-lock/isFocusable.js +51 -0
  343. package/lib/utils/focus-lock/isFocusable.js.map +1 -0
  344. package/lib/utils/focus-lock/isFocusable.mjs +43 -0
  345. package/lib/utils/focus-lock/isFocusable.mjs.map +1 -0
  346. package/lib/utils/focus-lock/setFocus.d.ts +1 -0
  347. package/lib/utils/focus-lock/setFocus.js +63 -0
  348. package/lib/utils/focus-lock/setFocus.js.map +1 -0
  349. package/lib/utils/focus-lock/setFocus.mjs +55 -0
  350. package/lib/utils/focus-lock/setFocus.mjs.map +1 -0
  351. package/lib/utils/getAccessibleName.d.ts +1 -0
  352. package/lib/utils/getAccessibleName.js +56 -0
  353. package/lib/utils/getAccessibleName.js.map +1 -0
  354. package/lib/utils/getAccessibleName.mjs +49 -0
  355. package/lib/utils/getAccessibleName.mjs.map +1 -0
  356. package/lib/utils/getDisplayName.d.ts +2 -0
  357. package/lib/utils/getDisplayName.js +10 -0
  358. package/lib/utils/getDisplayName.js.map +1 -0
  359. package/lib/utils/getDisplayName.mjs +6 -0
  360. package/lib/utils/getDisplayName.mjs.map +1 -0
  361. package/lib/utils/getEventTarget.d.ts +1 -0
  362. package/lib/utils/getEventTarget.js +53 -0
  363. package/lib/utils/getEventTarget.js.map +1 -0
  364. package/lib/utils/getEventTarget.mjs +45 -0
  365. package/lib/utils/getEventTarget.mjs.map +1 -0
  366. package/lib/utils/getOriginChildren.d.ts +2 -0
  367. package/lib/utils/getOriginChildren.js +18 -0
  368. package/lib/utils/getOriginChildren.js.map +1 -0
  369. package/lib/utils/getOriginChildren.mjs +10 -0
  370. package/lib/utils/getOriginChildren.mjs.map +1 -0
  371. package/lib/utils/getRandomInt.d.ts +1 -0
  372. package/lib/utils/getRandomInt.js +11 -0
  373. package/lib/utils/getRandomInt.js.map +1 -0
  374. package/lib/utils/getRandomInt.mjs +5 -0
  375. package/lib/utils/getRandomInt.mjs.map +1 -0
  376. package/lib/utils/getValue.d.ts +1 -0
  377. package/lib/utils/getValue.js +16 -0
  378. package/lib/utils/getValue.js.map +1 -0
  379. package/lib/utils/getValue.mjs +10 -0
  380. package/lib/utils/getValue.mjs.map +1 -0
  381. package/lib/utils/hasLabels.d.ts +7 -0
  382. package/lib/utils/hasLabels.js +47 -0
  383. package/lib/utils/hasLabels.js.map +1 -0
  384. package/lib/utils/hasLabels.mjs +39 -0
  385. package/lib/utils/hasLabels.mjs.map +1 -0
  386. package/lib/utils/hasParent.d.ts +1 -0
  387. package/lib/utils/hasParent.js +14 -0
  388. package/lib/utils/hasParent.js.map +1 -0
  389. package/lib/utils/hasParent.mjs +7 -0
  390. package/lib/utils/hasParent.mjs.map +1 -0
  391. package/lib/utils/if.d.ts +11 -0
  392. package/lib/utils/if.js +16 -0
  393. package/lib/utils/if.js.map +1 -0
  394. package/lib/utils/if.mjs +9 -0
  395. package/lib/utils/if.mjs.map +1 -0
  396. package/lib/utils/ifChildren.d.ts +8 -0
  397. package/lib/utils/ifChildren.js +17 -0
  398. package/lib/utils/ifChildren.js.map +1 -0
  399. package/lib/utils/ifChildren.mjs +10 -0
  400. package/lib/utils/ifChildren.mjs.map +1 -0
  401. package/lib/utils/injectStyle.d.ts +2 -0
  402. package/lib/utils/injectStyle.js +49 -0
  403. package/lib/utils/injectStyle.js.map +1 -0
  404. package/lib/utils/injectStyle.mjs +41 -0
  405. package/lib/utils/injectStyle.mjs.map +1 -0
  406. package/lib/utils/inputProps.d.ts +2 -0
  407. package/lib/utils/inputProps.js +22 -0
  408. package/lib/utils/inputProps.js.map +1 -0
  409. package/lib/utils/inputProps.mjs +14 -0
  410. package/lib/utils/inputProps.mjs.map +1 -0
  411. package/lib/utils/isInteractiveElement.d.ts +1 -0
  412. package/lib/utils/isInteractiveElement.js +34 -0
  413. package/lib/utils/isInteractiveElement.js.map +1 -0
  414. package/lib/utils/isInteractiveElement.mjs +28 -0
  415. package/lib/utils/isInteractiveElement.mjs.map +1 -0
  416. package/lib/utils/isNode.d.ts +1 -0
  417. package/lib/utils/isNode.js +28 -0
  418. package/lib/utils/isNode.js.map +1 -0
  419. package/lib/utils/isNode.mjs +21 -0
  420. package/lib/utils/isNode.mjs.map +1 -0
  421. package/lib/utils/isPromise.d.ts +1 -0
  422. package/lib/utils/isPromise.js +10 -0
  423. package/lib/utils/isPromise.js.map +1 -0
  424. package/lib/utils/isPromise.mjs +4 -0
  425. package/lib/utils/isPromise.mjs.map +1 -0
  426. package/lib/utils/isRetina.d.ts +1 -0
  427. package/lib/utils/isRetina.js +15 -0
  428. package/lib/utils/isRetina.js.map +1 -0
  429. package/lib/utils/isRetina.mjs +9 -0
  430. package/lib/utils/isRetina.mjs.map +1 -0
  431. package/lib/utils/logger.d.ts +9 -0
  432. package/lib/utils/logger.js +40 -0
  433. package/lib/utils/logger.js.map +1 -0
  434. package/lib/utils/logger.mjs +35 -0
  435. package/lib/utils/logger.mjs.map +1 -0
  436. package/lib/utils/numericChecker.d.ts +5 -0
  437. package/lib/utils/numericChecker.js +33 -0
  438. package/lib/utils/numericChecker.js.map +1 -0
  439. package/lib/utils/numericChecker.mjs +27 -0
  440. package/lib/utils/numericChecker.mjs.map +1 -0
  441. package/lib/utils/ownerDocument.d.ts +1 -0
  442. package/lib/utils/ownerDocument.js +10 -0
  443. package/lib/utils/ownerDocument.js.map +1 -0
  444. package/lib/utils/ownerDocument.mjs +4 -0
  445. package/lib/utils/ownerDocument.mjs.map +1 -0
  446. package/lib/utils/pick.d.ts +1 -0
  447. package/lib/utils/pick.js +19 -0
  448. package/lib/utils/pick.js.map +1 -0
  449. package/lib/utils/pick.mjs +15 -0
  450. package/lib/utils/pick.mjs.map +1 -0
  451. package/lib/utils/propsForElement.d.ts +3 -0
  452. package/lib/utils/propsForElement.js +59 -0
  453. package/lib/utils/propsForElement.js.map +1 -0
  454. package/lib/utils/propsForElement.mjs +50 -0
  455. package/lib/utils/propsForElement.mjs.map +1 -0
  456. package/lib/utils/rafTrottle.d.ts +2 -0
  457. package/lib/utils/rafTrottle.js +33 -0
  458. package/lib/utils/rafTrottle.js.map +1 -0
  459. package/lib/utils/rafTrottle.mjs +26 -0
  460. package/lib/utils/rafTrottle.mjs.map +1 -0
  461. package/lib/utils/reactToText.d.ts +3 -0
  462. package/lib/utils/reactToText.js +33 -0
  463. package/lib/utils/reactToText.js.map +1 -0
  464. package/lib/utils/reactToText.mjs +26 -0
  465. package/lib/utils/reactToText.mjs.map +1 -0
  466. package/lib/utils/ref.d.ts +10 -0
  467. package/lib/utils/ref.js +96 -0
  468. package/lib/utils/ref.js.map +1 -0
  469. package/lib/utils/ref.mjs +87 -0
  470. package/lib/utils/ref.mjs.map +1 -0
  471. package/lib/utils/setRef.d.ts +2 -0
  472. package/lib/utils/setRef.js +10 -0
  473. package/lib/utils/setRef.js.map +1 -0
  474. package/lib/utils/setRef.mjs +3 -0
  475. package/lib/utils/setRef.mjs.map +1 -0
  476. package/lib/utils/syncScroll.d.ts +1 -0
  477. package/lib/utils/syncScroll.js +61 -0
  478. package/lib/utils/syncScroll.js.map +1 -0
  479. package/lib/utils/syncScroll.mjs +54 -0
  480. package/lib/utils/syncScroll.mjs.map +1 -0
  481. package/lib/utils/uncontroll.d.ts +4 -0
  482. package/lib/utils/uncontroll.js +47 -0
  483. package/lib/utils/uncontroll.js.map +1 -0
  484. package/lib/utils/uncontroll.mjs +38 -0
  485. package/lib/utils/uncontroll.mjs.map +1 -0
  486. package/lib/utils/uniqueID.d.ts +12 -0
  487. package/lib/utils/uniqueID.js +42 -0
  488. package/lib/utils/uniqueID.js.map +1 -0
  489. package/lib/utils/uniqueID.mjs +33 -0
  490. package/lib/utils/uniqueID.mjs.map +1 -0
  491. package/lib/utils/use/useColorResolver.d.ts +1 -0
  492. package/lib/utils/use/useColorResolver.js +208 -0
  493. package/lib/utils/use/useColorResolver.js.map +1 -0
  494. package/lib/utils/use/useColorResolver.mjs +200 -0
  495. package/lib/utils/use/useColorResolver.mjs.map +1 -0
  496. package/lib/utils/use/useCss.d.ts +4 -0
  497. package/lib/utils/use/useCss.js +20 -0
  498. package/lib/utils/use/useCss.js.map +1 -0
  499. package/lib/utils/use/useCss.mjs +12 -0
  500. package/lib/utils/use/useCss.mjs.map +1 -0
  501. package/lib/utils/use/useEnhancedEffect.d.ts +3 -0
  502. package/lib/utils/use/useEnhancedEffect.js +13 -0
  503. package/lib/utils/use/useEnhancedEffect.js.map +1 -0
  504. package/lib/utils/use/useEnhancedEffect.mjs +6 -0
  505. package/lib/utils/use/useEnhancedEffect.mjs.map +1 -0
  506. package/lib/utils/use/useEventCallback.d.ts +4 -0
  507. package/lib/utils/use/useEventCallback.js +25 -0
  508. package/lib/utils/use/useEventCallback.js.map +1 -0
  509. package/lib/utils/use/useEventCallback.mjs +19 -0
  510. package/lib/utils/use/useEventCallback.mjs.map +1 -0
  511. package/lib/utils/use/useEventListener.d.ts +2 -0
  512. package/lib/utils/use/useEventListener.js +33 -0
  513. package/lib/utils/use/useEventListener.js.map +1 -0
  514. package/lib/utils/use/useEventListener.mjs +25 -0
  515. package/lib/utils/use/useEventListener.mjs.map +1 -0
  516. package/lib/utils/use/useFocusLock.d.ts +10 -0
  517. package/lib/utils/use/useFocusLock.js +289 -0
  518. package/lib/utils/use/useFocusLock.js.map +1 -0
  519. package/lib/utils/use/useFocusLock.mjs +266 -0
  520. package/lib/utils/use/useFocusLock.mjs.map +1 -0
  521. package/lib/utils/use/usePreventScroll.d.ts +2 -0
  522. package/lib/utils/use/usePreventScroll.js +78 -0
  523. package/lib/utils/use/usePreventScroll.js.map +1 -0
  524. package/lib/utils/use/usePreventScroll.mjs +70 -0
  525. package/lib/utils/use/usePreventScroll.mjs.map +1 -0
  526. package/lib/utils/useCssVariable.d.ts +8 -0
  527. package/lib/utils/useCssVariable.js +55 -0
  528. package/lib/utils/useCssVariable.js.map +1 -0
  529. package/lib/utils/useCssVariable.mjs +46 -0
  530. package/lib/utils/useCssVariable.mjs.map +1 -0
  531. package/lib/utils/zIndexStacking.d.ts +8 -0
  532. package/lib/utils/zIndexStacking.js +48 -0
  533. package/lib/utils/zIndexStacking.js.map +1 -0
  534. package/lib/utils/zIndexStacking.mjs +38 -0
  535. package/lib/utils/zIndexStacking.mjs.map +1 -0
  536. package/package.json +297 -10
  537. package/tsconfig-utils.json +4 -0
  538. package/vite.config.ts +24 -0
  539. package/lib/cjs/index.js +0 -23
  540. package/lib/cjs/index.js.map +0 -1
  541. package/lib/es6/index.js +0 -4
  542. package/lib/es6/index.js.map +0 -1
  543. package/lib/types/index.d.ts +0 -3
@@ -0,0 +1,20 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import React from "react";
4
+ import { Context } from "../utils/enhances/WithI18n.mjs";
5
+ var _excluded = ["locale"];
6
+ function i18nAppLocaleEnhance() {
7
+ return {
8
+ wrapperProps: function wrapperProps(props) {
9
+ var locale = props.locale, other = _objectWithoutProperties(props, _excluded);
10
+ var contextLocale = React.useContext(Context);
11
+ if (!locale && !contextLocale) return props;
12
+ return _objectSpread(_objectSpread({}, other), {}, {
13
+ locale: locale !== null && locale !== void 0 ? locale : contextLocale
14
+ });
15
+ }
16
+ };
17
+ }
18
+ export {
19
+ i18nAppLocaleEnhance as default
20
+ };
@@ -0,0 +1,16 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import { INHERITED_NAME } from "../core-types/symbols.mjs";
4
+ function Enhancement() {
5
+ return {
6
+ condition: function condition(Component) {
7
+ return Boolean(Component.displayName);
8
+ },
9
+ "static": function _static(WrapperComponent) {
10
+ return _defineProperty({}, INHERITED_NAME, _toConsumableArray(new Set([].concat(_toConsumableArray(WrapperComponent[INHERITED_NAME] || []), [WrapperComponent.displayName]))));
11
+ }
12
+ };
13
+ }
14
+ export {
15
+ Enhancement as default
16
+ };
@@ -0,0 +1,120 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import React from "react";
5
+ import assignProps from "../utils/assignProps.mjs";
6
+ import pick from "../utils/pick.mjs";
7
+ import logger from "../utils/logger.mjs";
8
+ function assign(target, source) {
9
+ return Object.defineProperties(target, Object.keys(source).reduce(function(descriptors, key) {
10
+ descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
11
+ return descriptors;
12
+ }, {}));
13
+ }
14
+ function getterMethodName(name) {
15
+ return "get".concat(name, "Props");
16
+ }
17
+ function getterMethodNameByDisplayName() {
18
+ var displayName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
19
+ var displayNames = displayName.split(".");
20
+ var name = displayNames.slice(-(displayNames.length - 1)).join("");
21
+ return getterMethodName(name);
22
+ }
23
+ function flatGetterMethodNames(childComponents, parentName) {
24
+ return Object.entries(childComponents).reduce(function(acc, _ref) {
25
+ var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], value = _ref2[1];
26
+ if (Array.isArray(value)) {
27
+ acc.push.apply(acc, _toConsumableArray(flatGetterMethodNames(value[1], name)));
28
+ }
29
+ name = parentName ? "".concat(parentName).concat(name) : name;
30
+ acc.push(getterMethodName(name));
31
+ return acc;
32
+ }, []);
33
+ }
34
+ var STATIC_COMPONENT = Symbol("STATIC_COMPONENT");
35
+ var ROOT_COMPONENT = Symbol("ROOT_COMPONENT");
36
+ var SELF_GETTER_METHOD = Symbol("SELF_GETTER_METHOD");
37
+ function Enhancement(childComponents, createComponent, options) {
38
+ var getterMethodNames = flatGetterMethodNames(childComponents);
39
+ return {
40
+ condition: function condition(Component) {
41
+ return Boolean(Component[STATIC_COMPONENT] || Object.keys(childComponents).length);
42
+ },
43
+ init: function init(props, WrapperComponent) {
44
+ var _this = this;
45
+ var getterMethods = pick(this, getterMethodNames);
46
+ this[SELF_GETTER_METHOD] = function() {
47
+ var selfGetterMethod = getterMethodNameByDisplayName(WrapperComponent.displayName);
48
+ logger.warn(true, "Getter `".concat(selfGetterMethod, "` can't be fired as it is a getter of static component"), props["data-ui-name"] || WrapperComponent.displayName);
49
+ };
50
+ assign(this, getterMethodNames.reduce(function(acc, name) {
51
+ var getterMethod = getterMethods[name];
52
+ if (!getterMethod) return acc;
53
+ acc[name] = function() {
54
+ var childrenProps = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
55
+ var getterProps = getterMethod.call(_this, childrenProps, acc[name].index);
56
+ return assignProps(childrenProps, getterProps);
57
+ };
58
+ acc[name].index = -1;
59
+ acc[name].cache = /* @__PURE__ */ new Set();
60
+ return acc;
61
+ }, {}));
62
+ },
63
+ "static": function _static(WrapperComponent, Component) {
64
+ if (Object.keys(childComponents).length && !WrapperComponent.displayName) {
65
+ throw new Error('"displayName" is not defined');
66
+ }
67
+ return Object.entries(childComponents).reduce(function(acc, _ref3) {
68
+ var _ref4 = _slicedToArray(_ref3, 2), name = _ref4[0], value = _ref4[1];
69
+ var childComponents2 = {};
70
+ if (Array.isArray(value)) {
71
+ childComponents2 = value[1];
72
+ value = value[0];
73
+ }
74
+ var prevStaticComponent = value[STATIC_COMPONENT];
75
+ var prevDisplayName = value.displayName;
76
+ value.displayName = "".concat(WrapperComponent.displayName, ".").concat(name);
77
+ value[STATIC_COMPONENT] = true;
78
+ value[ROOT_COMPONENT] = Component[ROOT_COMPONENT] || Component;
79
+ acc[name] = createComponent(value, childComponents2, options);
80
+ value.displayName = prevDisplayName;
81
+ value[STATIC_COMPONENT] = prevStaticComponent;
82
+ return acc;
83
+ }, {});
84
+ },
85
+ context: function context(_context) {
86
+ return _objectSpread(_objectSpread({}, _context), pick(this, getterMethodNames));
87
+ },
88
+ wrapperProps: function wrapperProps(props, WrapperComponent) {
89
+ if (!WrapperComponent[STATIC_COMPONENT]) return props;
90
+ var context = React.useContext(options.context);
91
+ var getterMethod = context[getterMethodNameByDisplayName(WrapperComponent.displayName)];
92
+ if (getterMethod) {
93
+ if (!getterMethod.cache.has(this)) {
94
+ getterMethod.cache.add(this);
95
+ getterMethod.index++;
96
+ if (this) this.index = getterMethod.index;
97
+ }
98
+ if (this) getterMethod.index = this.index;
99
+ return getterMethod(props);
100
+ }
101
+ return props;
102
+ },
103
+ render: function render(_render) {
104
+ var _this2 = this;
105
+ getterMethodNames.forEach(function(name) {
106
+ if (_this2[name] === void 0) return;
107
+ _this2[name].index = -1;
108
+ _this2[name].cache.clear();
109
+ });
110
+ return _render;
111
+ }
112
+ };
113
+ }
114
+ export {
115
+ ROOT_COMPONENT,
116
+ STATIC_COMPONENT,
117
+ Enhancement as default,
118
+ getterMethodName,
119
+ getterMethodNameByDisplayName
120
+ };
@@ -0,0 +1,49 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import React from "react";
5
+ import "../styled/index.mjs";
6
+ import { STATIC_COMPONENT } from "./staticChildren.mjs";
7
+ import { sstyled } from "../styled/sstyled.mjs";
8
+ var _excluded = ["_styles", "styles"], _excluded2 = ["styles"];
9
+ var STYLES_CONTEXT = Symbol("STYLES_CONTEXT");
10
+ var STYLES_SELF = Symbol("STYLES_SELF");
11
+ function Enhancement(childComponents, Context) {
12
+ return {
13
+ condition: function condition(Component) {
14
+ return Boolean(Component.style || Component[STATIC_COMPONENT]);
15
+ },
16
+ init: function init(props, WrapperComponent) {
17
+ if (props.styles) {
18
+ this[STYLES_SELF] = props.styles;
19
+ }
20
+ if (WrapperComponent.style) {
21
+ this[STYLES_SELF] = sstyled.merge(WrapperComponent.style, props._styles);
22
+ }
23
+ },
24
+ context: function context(_context) {
25
+ if (!this[STYLES_SELF] || !Object.keys(childComponents).length) {
26
+ return _context;
27
+ }
28
+ return _objectSpread(_objectSpread({}, _context), {}, _defineProperty({}, STYLES_CONTEXT, this[STYLES_SELF]));
29
+ },
30
+ asProps: function asProps(_ref) {
31
+ var _styles = _ref._styles, styles = _ref.styles, props = _objectWithoutProperties(_ref, _excluded);
32
+ return _objectSpread(_objectSpread({}, props), {}, {
33
+ styles: this[STYLES_SELF]
34
+ });
35
+ },
36
+ wrapperProps: function wrapperProps(_ref2) {
37
+ var styles = _ref2.styles, props = _objectWithoutProperties(_ref2, _excluded2);
38
+ var context = React.useContext(Context);
39
+ return _objectSpread(_objectSpread({}, props), {}, {
40
+ _styles: styles,
41
+ styles: context[STYLES_CONTEXT]
42
+ });
43
+ }
44
+ };
45
+ }
46
+ export {
47
+ STYLES_CONTEXT,
48
+ Enhancement as default
49
+ };
@@ -0,0 +1,107 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _toArray from "@babel/runtime/helpers/esm/toArray";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
6
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { callAllEventHandlers } from "../utils/assignProps.mjs";
9
+ import capitalizeFirstLetter from "../utils/capitalizeFirstLetter.mjs";
10
+ function assign(target, source) {
11
+ return Object.defineProperties(target, Object.keys(source).reduce(function(descriptors, key) {
12
+ descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
13
+ return descriptors;
14
+ }, {}));
15
+ }
16
+ function defaultProp(prop) {
17
+ return "default".concat(capitalizeFirstLetter(prop));
18
+ }
19
+ function handlerProp(prop) {
20
+ if (prop === "value") prop = "";
21
+ if (prop === "checked") prop = "";
22
+ return "on".concat(capitalizeFirstLetter(prop), "Change");
23
+ }
24
+ function isControlled(propValue) {
25
+ return propValue !== void 0;
26
+ }
27
+ function uncontrolledProp(self, propName, propValue, propDefaultValue, propHandler, chainHandler) {
28
+ function getValue() {
29
+ return isControlled(propValue) ? propValue : propName in self.state ? self.state[propName] : propDefaultValue;
30
+ }
31
+ return [getValue(), function(value) {
32
+ var oldValue = getValue();
33
+ if (oldValue === value) return false;
34
+ if (!isControlled(propValue)) self.setState(_defineProperty({}, propName, value));
35
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
36
+ args[_key - 1] = arguments[_key];
37
+ }
38
+ return callAllEventHandlers.apply(void 0, [propHandler].concat(_toConsumableArray(chainHandler))).apply(void 0, [value].concat(args));
39
+ }];
40
+ }
41
+ function uncontrolledUniversal(props, config, uncontrolledProp2) {
42
+ var handlerProps = {};
43
+ var uncontrolledProps = Object.keys(config).reduce(function(result, propName) {
44
+ var _objectSpread2;
45
+ var handlerName = handlerProp(propName);
46
+ var defaultPropName = defaultProp(propName);
47
+ var propDefaultValue = result[defaultPropName], propValue = result[propName], propHandler = result[handlerName], other = _objectWithoutProperties(result, [defaultPropName, propName, handlerName].map(_toPropertyKey));
48
+ if (propDefaultValue === void 0) {
49
+ console.warn(defaultPropName, 'must be installed in "defaultProps"');
50
+ }
51
+ var setter = config[propName];
52
+ var chainHandler = [];
53
+ if (Array.isArray(setter)) {
54
+ var _setter = setter;
55
+ var _setter2 = _toArray(_setter);
56
+ setter = _setter2[0];
57
+ chainHandler = _setter2.slice(1);
58
+ }
59
+ setter = setter || function(v) {
60
+ return v;
61
+ };
62
+ var _uncontrolledProp = uncontrolledProp2(propName, propValue, propDefaultValue, propHandler, chainHandler), _uncontrolledProp2 = _slicedToArray(_uncontrolledProp, 2), value = _uncontrolledProp2[0], handler = _uncontrolledProp2[1];
63
+ handlerProps[propName] = handler;
64
+ return _objectSpread(_objectSpread({}, other), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, propName, value), _defineProperty(_objectSpread2, handlerName, function(eventOrValue) {
65
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
66
+ args[_key2 - 1] = arguments[_key2];
67
+ }
68
+ var result2 = [setter.apply(void 0, [eventOrValue].concat(args))].concat(args);
69
+ if (eventOrValue !== null && eventOrValue !== void 0 && eventOrValue.target) {
70
+ result2.push(eventOrValue);
71
+ }
72
+ return handler.apply(void 0, _toConsumableArray(result2));
73
+ }), _objectSpread2));
74
+ }, props);
75
+ return [uncontrolledProps, handlerProps];
76
+ }
77
+ function uncontrolled(self, props, config) {
78
+ return uncontrolledUniversal(props, config, uncontrolledProp.bind(void 0, self));
79
+ }
80
+ function Enhancement() {
81
+ return {
82
+ condition: function condition(Component) {
83
+ return Boolean(Component.prototype.uncontrolledProps);
84
+ },
85
+ init: function init() {
86
+ this.state = this.state || {};
87
+ assign(this, {
88
+ get handlers() {
89
+ var _uncontrolled = uncontrolled(this, this.props, this.uncontrolledProps()), _uncontrolled2 = _slicedToArray(_uncontrolled, 2), uncontrolledHandlers = _uncontrolled2[1];
90
+ return uncontrolledHandlers;
91
+ }
92
+ });
93
+ },
94
+ context: function context(_context) {
95
+ return _objectSpread(_objectSpread({}, _context), {}, {
96
+ handlers: this.handlers
97
+ });
98
+ },
99
+ asProps: function asProps(props) {
100
+ var _uncontrolled3 = uncontrolled(this, props, this.uncontrolledProps()), _uncontrolled4 = _slicedToArray(_uncontrolled3, 1), uncontrolledProps = _uncontrolled4[0];
101
+ return uncontrolledProps;
102
+ }
103
+ };
104
+ }
105
+ export {
106
+ Enhancement as default
107
+ };
package/lib/esm/index.mjs CHANGED
@@ -1,6 +1,24 @@
1
- import createComponent__default from "@semcore/utils/lib/core";
2
- export * from "@semcore/utils/lib/core";
3
- import { default as default2 } from "@semcore/utils/lib/core";
1
+ import { assignProps, createBaseComponent, createComponent } from "./coreFactory.mjs";
2
+ import "./styled/index.mjs";
3
+ import { Component, Intergalactic, Root, wrapIntergalacticComponent } from "./core-types/Component.mjs";
4
+ import { CHILDREN_COMPONENT, CONTEXT_COMPONENT, CORE_INSTANCE, CREATE_COMPONENT, INHERITED_NAME } from "./core-types/symbols.mjs";
5
+ import { default as default2 } from "./register.mjs";
6
+ import { lastInteraction } from "./LastInteractionType.mjs";
7
+ import { sstyled } from "./styled/sstyled.mjs";
4
8
  export {
5
- default2 as default
9
+ CHILDREN_COMPONENT,
10
+ CONTEXT_COMPONENT,
11
+ CORE_INSTANCE,
12
+ CREATE_COMPONENT,
13
+ Component,
14
+ INHERITED_NAME,
15
+ Intergalactic,
16
+ Root,
17
+ assignProps,
18
+ createBaseComponent,
19
+ createComponent,
20
+ lastInteraction,
21
+ default2 as register,
22
+ sstyled,
23
+ wrapIntergalacticComponent
6
24
  };
@@ -0,0 +1,31 @@
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
+ var Register = /* @__PURE__ */ function() {
5
+ function Register2() {
6
+ _classCallCheck(this, Register2);
7
+ _defineProperty(this, "data", {});
8
+ }
9
+ _createClass(Register2, [{
10
+ key: "get",
11
+ value: function get(name, defaultValue) {
12
+ if (name in this.data) {
13
+ return this.data[name];
14
+ } else {
15
+ return this.set(name, defaultValue);
16
+ }
17
+ }
18
+ }, {
19
+ key: "set",
20
+ value: function set(name, value) {
21
+ this.data[name] = value;
22
+ return this.data[name];
23
+ }
24
+ }]);
25
+ return Register2;
26
+ }();
27
+ const register = new Register();
28
+ export {
29
+ Register,
30
+ register as default
31
+ };
@@ -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
+ };
@@ -0,0 +1,234 @@
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);
68
+ var serverMap = {};
69
+ var getStyles = function getStyles2() {
70
+ return {
71
+ map: serverMap,
72
+ get css() {
73
+ var serverStyles2 = "";
74
+ for (var id in serverMap) {
75
+ serverStyles2 += '<style type="text/css" id="'.concat(id, '">').concat(serverMap[id], "</style>");
76
+ }
77
+ return serverStyles2;
78
+ }
79
+ };
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 styled2(elem) {
119
+ var curr = stack.pop() || [];
120
+ styles = curr[0] || styles;
121
+ style = curr[1] || style;
122
+ styled2[KEYS.__styles__] = styles;
123
+ styled2[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
+ }
214
+ export {
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,
233
+ use
234
+ };