@koine/react 1.0.9 → 1.0.12

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 (359) hide show
  1. package/Alert/Alert.js +7 -13
  2. package/Animations/Reveal.js +12 -10
  3. package/Animations/Underline.js +3 -13
  4. package/Animations/useReveal.js +18 -17
  5. package/Autocomplete/AutocompleteDownshift.js +1 -1
  6. package/Autocomplete/AutocompleteDownshiftMultiselect.js +1 -1
  7. package/Autocomplete/AutocompleteMui.js +61 -56
  8. package/Autocomplete/AutocompleteReach.js +1 -1
  9. package/Autocomplete/components.js +17 -72
  10. package/Autocomplete/helpers.js +1 -1
  11. package/Bg/BgColor.js +14 -24
  12. package/Bg/BgPhoto.js +11 -54
  13. package/Bg/BgSvg.js +6 -9
  14. package/Breadcrumbs/Breadcrumbs.js +14 -54
  15. package/Buttons/Button.js +8 -73
  16. package/Buttons/ButtonComposite.js +20 -41
  17. package/Buttons/ButtonFab.js +4 -6
  18. package/Buttons/ButtonLink.js +7 -6
  19. package/Buttons/IconButton.js +5 -17
  20. package/Calendar/CalendarDaygridCell.js +20 -14
  21. package/Calendar/CalendarDaygridNav.js +10 -9
  22. package/Calendar/CalendarDaygridTable.js +32 -30
  23. package/Calendar/CalendarLegend.js +7 -2
  24. package/Calendar/calendar-api-google.js +101 -68
  25. package/Calendar/useCalendar.js +114 -113
  26. package/Calendar/utils.js +73 -74
  27. package/Carousel/Carousel.js +1 -1
  28. package/Carousel/CarouselCss.js +14 -27
  29. package/Collapsable/Collapsable.d.ts +1 -1
  30. package/Collapsable/Collapsable.js +1 -1
  31. package/Collapsable/CollapsableReach.d.ts +4 -64
  32. package/Collapsable/CollapsableReach.js +247 -129
  33. package/Collapsable/index.d.ts +1 -1
  34. package/Collapsable/index.js +2 -1
  35. package/Debug/Debug.js +5 -17
  36. package/Details/Details.d.ts +114 -0
  37. package/Details/Details.js +65 -0
  38. package/Details/index.d.ts +1 -0
  39. package/Details/index.js +1 -0
  40. package/{Forms/Form → Details}/package.json +1 -1
  41. package/Dialog/DialogMui.d.ts +1 -1
  42. package/Dialog/DialogMui.js +22 -20
  43. package/Dialog/css/bare.js +17 -15
  44. package/Dialog/m/bare.js +17 -13
  45. package/Dialog/m/basic.js +2 -2
  46. package/Dialog/m/index.js +4 -4
  47. package/Dialog/sc/bare.js +25 -43
  48. package/Dialog/sc/framer.js +6 -6
  49. package/Dialog/sc/framerMaterial.js +6 -6
  50. package/Dialog/sc/material.js +17 -37
  51. package/Dialog/tw/bare.js +25 -19
  52. package/Dialog/tw/elegant.js +17 -15
  53. package/Dialog/tw/framer.js +6 -6
  54. package/Dialog/tw/framerMaterial.js +6 -6
  55. package/Dialog/tw/material.js +17 -15
  56. package/Editor/Editor--tiptap.js +14 -11
  57. package/Editor/components.js +6 -24
  58. package/Favicon/FaviconTags.js +2 -1
  59. package/Form/Form.d.ts +111 -0
  60. package/Form/Form.js +61 -0
  61. package/{Forms/Form → Form}/index.d.ts +0 -0
  62. package/{Forms/Form → Form}/index.js +0 -0
  63. package/Form/package.json +6 -0
  64. package/Form/sc/bare.d.ts +33 -0
  65. package/Form/sc/bare.js +20 -0
  66. package/Forms/Checkbox/Checkbox.js +9 -15
  67. package/Forms/Feedback/Feedback.js +6 -7
  68. package/Forms/Field/Field.js +15 -26
  69. package/Forms/Field/FieldControl.js +19 -15
  70. package/Forms/Field/FieldHint.js +3 -5
  71. package/Forms/Input/Input.js +10 -16
  72. package/Forms/InputGroup/InputGroup.js +9 -36
  73. package/Forms/Label/Label.js +5 -23
  74. package/Forms/Password/Password.js +10 -23
  75. package/Forms/Radio/Radio.js +15 -18
  76. package/Forms/Switch/Switch.js +9 -39
  77. package/Forms/Textarea/Textarea.js +6 -7
  78. package/Forms/Textarea/TextareaRich.js +10 -24
  79. package/Forms/Toggle/Toggle.js +21 -68
  80. package/Forms/Toggle/useToggle.js +29 -29
  81. package/Forms/antispam.js +12 -12
  82. package/Forms/helpers.js +8 -7
  83. package/Forms/index.d.ts +0 -1
  84. package/Forms/index.js +0 -1
  85. package/Forms/styles.js +12 -43
  86. package/Gauge/Gauge.js +1 -1
  87. package/Grid/Grid.js +25 -51
  88. package/Hamburger/Hamburger.js +35 -47
  89. package/Header/useHeader.js +12 -12
  90. package/Hidden/Hidden.js +9 -13
  91. package/Img/sc/bare.js +3 -1
  92. package/Link/Link.js +3 -1
  93. package/Link/LinkBlank.js +8 -17
  94. package/Menu/Menu.js +3 -10
  95. package/MenuItem/MenuItem.js +3 -19
  96. package/Meta/Meta.js +3 -2
  97. package/NoJs/NoJs.js +2 -2
  98. package/Pagination/PaginationNav.js +26 -48
  99. package/Pagination/PaginationResults.js +7 -6
  100. package/Pill/Pill.js +6 -36
  101. package/Progress/ProgressCircular.js +9 -30
  102. package/Progress/ProgressLinear.js +8 -16
  103. package/Progress/ProgressOverlay.js +11 -27
  104. package/Rating/Rating.js +26 -45
  105. package/Rating/index.js +19 -15
  106. package/Select/SelectDownshift.js +1 -1
  107. package/Select/components.js +6 -12
  108. package/Sidebar/Sidebar.js +13 -38
  109. package/Spacing/Spacing.js +12 -12
  110. package/Sticky/Sticky.js +1 -1
  111. package/Sticky/StickyCss.js +4 -2
  112. package/Tabs/TabsMui.d.ts +244 -0
  113. package/Tabs/TabsMui.js +46 -0
  114. package/Tabs/index.d.ts +1 -1
  115. package/Tabs/index.js +1 -1
  116. package/Tabs/sc/bare.d.ts +5 -0
  117. package/Tabs/sc/bare.js +87 -0
  118. package/Tabs/tw/bare.d.ts +248 -0
  119. package/Tabs/tw/bare.js +17 -0
  120. package/Tabs/tw/material.d.ts +472 -0
  121. package/Tabs/tw/material.js +18 -0
  122. package/Tabs/useTabs.d.ts +43 -0
  123. package/Tabs/useTabs.js +44 -0
  124. package/Typography/CopyPasteVisible.js +3 -5
  125. package/Typography/Native.js +12 -45
  126. package/Typography/ReadMore.js +26 -52
  127. package/Typography/TextLoop.js +19 -22
  128. package/Typography/TypeStairs.js +20 -16
  129. package/css/index.js +1 -0
  130. package/helpers/classed.js +22 -18
  131. package/helpers/extend-component.js +6 -6
  132. package/hooks/index.d.ts +8 -0
  133. package/hooks/index.js +8 -0
  134. package/hooks/types.d.ts +8 -0
  135. package/hooks/types.js +1 -0
  136. package/hooks/useAsyncFn.d.ts +26 -0
  137. package/hooks/useAsyncFn.js +36 -0
  138. package/hooks/useDateLocale.js +22 -13
  139. package/hooks/useEffectOnce.d.ts +5 -0
  140. package/hooks/useEffectOnce.js +8 -0
  141. package/hooks/useFirstMountState.d.ts +4 -0
  142. package/hooks/useFirstMountState.js +12 -0
  143. package/hooks/useFocus.js +3 -3
  144. package/hooks/useId.d.ts +4 -0
  145. package/hooks/useId.js +8 -0
  146. package/hooks/useIsomorphicLayoutEffect.d.ts +5 -0
  147. package/hooks/useIsomorphicLayoutEffect.js +8 -0
  148. package/hooks/useMount.d.ts +4 -0
  149. package/hooks/useMount.js +9 -0
  150. package/hooks/useMountedState.d.ts +4 -0
  151. package/hooks/useMountedState.js +15 -0
  152. package/hooks/usePrevious.js +2 -2
  153. package/hooks/useScrollPosition.js +21 -16
  154. package/hooks/useScrollTo.js +7 -5
  155. package/hooks/useTraceUpdate.js +4 -3
  156. package/hooks/useUpdateEffect.d.ts +5 -0
  157. package/hooks/useUpdateEffect.js +14 -0
  158. package/hooks/useWindowSize.js +3 -3
  159. package/m/MotionProvider.js +4 -2
  160. package/node/Alert/Alert.js +9 -16
  161. package/node/Alert/index.js +1 -1
  162. package/node/Animations/Reveal.js +15 -13
  163. package/node/Animations/Underline.js +5 -16
  164. package/node/Animations/index.js +1 -1
  165. package/node/Animations/useReveal.js +19 -18
  166. package/node/Autocomplete/AutocompleteMui.js +69 -64
  167. package/node/Autocomplete/components.js +26 -82
  168. package/node/Autocomplete/helpers.js +2 -2
  169. package/node/Bg/BgColor.js +18 -29
  170. package/node/Bg/BgPhoto.js +15 -59
  171. package/node/Bg/BgSvg.js +8 -12
  172. package/node/Bg/index.js +1 -1
  173. package/node/Breadcrumbs/Breadcrumbs.js +20 -61
  174. package/node/Breadcrumbs/index.js +1 -1
  175. package/node/Buttons/Button.js +10 -76
  176. package/node/Buttons/ButtonComposite.js +23 -45
  177. package/node/Buttons/ButtonFab.js +6 -9
  178. package/node/Buttons/ButtonLink.js +10 -10
  179. package/node/Buttons/IconButton.js +7 -20
  180. package/node/Buttons/index.js +1 -1
  181. package/node/Calendar/CalendarDaygridCell.js +24 -18
  182. package/node/Calendar/CalendarDaygridNav.js +14 -13
  183. package/node/Calendar/CalendarDaygridTable.js +39 -38
  184. package/node/Calendar/CalendarLegend.js +8 -3
  185. package/node/Calendar/calendar-api-google.js +105 -73
  186. package/node/Calendar/index.js +1 -1
  187. package/node/Calendar/useCalendar.js +117 -116
  188. package/node/Calendar/utils.js +82 -84
  189. package/node/Carousel/CarouselCss.js +17 -31
  190. package/node/Carousel/index.js +1 -1
  191. package/node/Collapsable/Collapsable.js +2 -2
  192. package/node/Collapsable/CollapsableReach.js +246 -134
  193. package/node/Collapsable/index.js +3 -2
  194. package/node/Debug/Debug.js +7 -20
  195. package/node/Debug/index.js +1 -1
  196. package/node/Details/Details.js +67 -0
  197. package/node/Details/index.js +4 -0
  198. package/node/Dialog/DialogMui.js +12 -11
  199. package/node/Dialog/css/bare.js +11 -10
  200. package/node/Dialog/m/bare.js +18 -14
  201. package/node/Dialog/m/basic.js +1 -1
  202. package/node/Dialog/m/index.js +4 -4
  203. package/node/Dialog/sc/bare.js +22 -41
  204. package/node/Dialog/sc/framer.js +5 -5
  205. package/node/Dialog/sc/framerMaterial.js +5 -5
  206. package/node/Dialog/sc/material.js +12 -33
  207. package/node/Dialog/tw/bare.js +19 -14
  208. package/node/Dialog/tw/elegant.js +11 -9
  209. package/node/Dialog/tw/framer.js +5 -5
  210. package/node/Dialog/tw/framerMaterial.js +5 -5
  211. package/node/Dialog/tw/material.js +11 -9
  212. package/node/Editor/Editor--tiptap.js +19 -17
  213. package/node/Editor/components.js +9 -28
  214. package/node/Editor/index.js +1 -1
  215. package/node/Favicon/FaviconTags.js +3 -2
  216. package/node/Favicon/index.js +1 -1
  217. package/node/Form/Form.js +65 -0
  218. package/node/{Forms/Form → Form}/index.js +1 -1
  219. package/node/Form/sc/bare.js +23 -0
  220. package/node/Forms/Checkbox/Checkbox.js +13 -20
  221. package/node/Forms/Checkbox/index.js +1 -1
  222. package/node/Forms/Feedback/Feedback.js +8 -10
  223. package/node/Forms/Feedback/index.js +1 -1
  224. package/node/Forms/Field/Field.js +18 -30
  225. package/node/Forms/Field/FieldControl.js +26 -22
  226. package/node/Forms/Field/FieldHint.js +4 -7
  227. package/node/Forms/Field/index.js +1 -1
  228. package/node/Forms/Input/Input.js +15 -22
  229. package/node/Forms/Input/index.js +1 -1
  230. package/node/Forms/InputGroup/InputGroup.js +14 -42
  231. package/node/Forms/InputGroup/index.js +1 -1
  232. package/node/Forms/Label/Label.js +6 -25
  233. package/node/Forms/Label/index.js +1 -1
  234. package/node/Forms/Password/Password.js +16 -30
  235. package/node/Forms/Password/index.js +1 -1
  236. package/node/Forms/Radio/Radio.js +21 -25
  237. package/node/Forms/Radio/index.js +1 -1
  238. package/node/Forms/Switch/Switch.js +15 -46
  239. package/node/Forms/Switch/index.js +1 -1
  240. package/node/Forms/Textarea/Textarea.js +11 -13
  241. package/node/Forms/Textarea/TextareaRich.js +16 -31
  242. package/node/Forms/Textarea/index.js +1 -1
  243. package/node/Forms/Toggle/Toggle.js +24 -72
  244. package/node/Forms/Toggle/index.js +1 -1
  245. package/node/Forms/Toggle/useToggle.js +33 -33
  246. package/node/Forms/antispam.js +14 -14
  247. package/node/Forms/helpers.js +9 -8
  248. package/node/Forms/index.js +1 -2
  249. package/node/Forms/styles.js +16 -48
  250. package/node/Gauge/Gauge.js +1 -1
  251. package/node/Grid/Grid.js +24 -51
  252. package/node/Grid/index.js +1 -1
  253. package/node/Hamburger/Hamburger.js +37 -50
  254. package/node/Hamburger/index.js +1 -1
  255. package/node/Header/index.js +1 -1
  256. package/node/Header/useHeader.js +16 -16
  257. package/node/Hidden/Hidden.js +10 -15
  258. package/node/Hidden/index.js +1 -1
  259. package/node/Img/index.js +1 -1
  260. package/node/Img/sc/bare.js +4 -3
  261. package/node/Link/Link.js +4 -3
  262. package/node/Link/LinkBlank.js +11 -21
  263. package/node/Link/index.js +1 -1
  264. package/node/Menu/Menu.js +4 -12
  265. package/node/Menu/index.js +1 -1
  266. package/node/MenuItem/MenuItem.js +4 -21
  267. package/node/MenuItem/index.js +1 -1
  268. package/node/Meta/Meta.js +4 -3
  269. package/node/Meta/index.js +1 -1
  270. package/node/NoJs/NoJs.js +3 -3
  271. package/node/NoJs/index.js +1 -1
  272. package/node/Pagination/PaginationNav.js +30 -53
  273. package/node/Pagination/PaginationResults.js +10 -10
  274. package/node/Pagination/index.js +1 -1
  275. package/node/Pill/Pill.js +7 -38
  276. package/node/Pill/index.js +1 -1
  277. package/node/Progress/ProgressCircular.js +11 -33
  278. package/node/Progress/ProgressLinear.js +11 -20
  279. package/node/Progress/ProgressOverlay.js +18 -35
  280. package/node/Progress/index.js +1 -1
  281. package/node/Rating/Rating.js +28 -48
  282. package/node/Rating/index.js +20 -16
  283. package/node/Select/components.js +11 -18
  284. package/node/Sidebar/Sidebar.js +21 -47
  285. package/node/Sidebar/index.js +1 -1
  286. package/node/Spacing/Spacing.js +16 -17
  287. package/node/Spacing/index.js +1 -1
  288. package/node/Sticky/StickyCss.js +5 -3
  289. package/node/Sticky/index.js +1 -1
  290. package/node/Tabs/TabsMui.js +49 -0
  291. package/node/Tabs/index.js +2 -2
  292. package/node/Tabs/sc/bare.js +87 -0
  293. package/node/Tabs/tw/bare.js +20 -0
  294. package/node/Tabs/tw/material.js +21 -0
  295. package/node/Tabs/useTabs.js +48 -0
  296. package/node/Typography/CopyPasteVisible.js +4 -7
  297. package/node/Typography/Native.js +14 -48
  298. package/node/Typography/ReadMore.js +30 -57
  299. package/node/Typography/TextLoop.js +22 -25
  300. package/node/Typography/TypeStairs.js +22 -18
  301. package/node/Typography/index.js +1 -1
  302. package/node/css/index.js +2 -1
  303. package/node/helpers/classed.js +23 -19
  304. package/node/helpers/extend-component.js +7 -7
  305. package/node/helpers/index.js +1 -1
  306. package/node/hooks/index.js +9 -1
  307. package/node/hooks/types.js +2 -0
  308. package/node/hooks/useAsyncFn.js +40 -0
  309. package/node/hooks/useDateLocale.js +23 -37
  310. package/node/hooks/useEffectOnce.js +12 -0
  311. package/node/hooks/useFirstMountState.js +16 -0
  312. package/node/hooks/useFocus.js +4 -4
  313. package/node/hooks/useId.js +12 -0
  314. package/node/hooks/useIsomorphicLayoutEffect.js +11 -0
  315. package/node/hooks/useMount.js +13 -0
  316. package/node/hooks/useMountedState.js +19 -0
  317. package/node/hooks/usePrevious.js +3 -3
  318. package/node/hooks/useScrollPosition.js +23 -19
  319. package/node/hooks/useScrollTo.js +9 -7
  320. package/node/hooks/useTraceUpdate.js +5 -4
  321. package/node/hooks/useUpdateEffect.js +18 -0
  322. package/node/hooks/useWindowSize.js +4 -4
  323. package/node/index.js +1 -1
  324. package/node/m/MotionProvider.js +6 -4
  325. package/node/m/index.js +1 -1
  326. package/node/m/lite.js +1 -1
  327. package/node/m/max.js +1 -1
  328. package/node/sc/index.js +4 -2
  329. package/node/scm/index.js +2 -1
  330. package/node/shared/index.js +1 -1
  331. package/node/styles/Body.js +5 -10
  332. package/node/styles/Global.js +5 -37
  333. package/node/styles/index.js +1 -1
  334. package/node/styles/media.js +42 -38
  335. package/node/styles/spacing.js +15 -16
  336. package/node/styles/styled.js +7 -21
  337. package/node/styles/theme--vanilla.js +21 -19
  338. package/node/styles/theme.js +9 -9
  339. package/node/tw/index.js +2 -1
  340. package/node/twm/index.js +2 -1
  341. package/package.json +20 -9
  342. package/sc/index.d.ts +1 -0
  343. package/sc/index.js +1 -0
  344. package/scm/index.js +1 -0
  345. package/styles/Body.js +4 -8
  346. package/styles/Global.js +4 -36
  347. package/styles/media.js +41 -36
  348. package/styles/spacing.js +15 -16
  349. package/styles/styled.js +7 -21
  350. package/styles/theme--vanilla.js +21 -19
  351. package/styles/theme.js +11 -11
  352. package/tw/index.js +1 -0
  353. package/twm/index.js +1 -0
  354. package/Forms/Form/Form.d.ts +0 -31
  355. package/Forms/Form/Form.js +0 -62
  356. package/Tabs/Tabs.d.ts +0 -27
  357. package/Tabs/Tabs.js +0 -62
  358. package/node/Forms/Form/Form.js +0 -67
  359. package/node/Tabs/Tabs.js +0 -67
@@ -1,135 +1,253 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ "use strict";
2
2
  /**
3
3
  * @file
4
4
  *
5
5
  * Maybe do a simplified version following this example:
6
6
  * https://codesandbox.io/s/framer-motion-accordion-qx958?file=/src/Example.tsx
7
7
  */
8
- import { forwardRef, useCallback, useEffect, useId, useRef, useState, } from "react";
9
- import styled from "styled-components";
10
- import { m } from "framer-motion";
11
- import { Disclosure, DisclosureButton, DisclosurePanel, } from "@reach/disclosure";
12
- import { BsBoxArrowInDown as IconCollapse } from "react-icons/bs";
13
- import { btnStyleReset } from "../Buttons";
14
- import { useWindowSize } from "../hooks/useWindowSize";
15
- import { InputInvisible } from "../Forms/styles";
16
- /**
17
- * `overflow-anchor: none;` keeps the same scrolling position
18
- * @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Accordion/Accordion.js#L54
19
- */
20
- export const CollapsableRoot = styled(Disclosure) `
21
- overflow-anchor: none;
22
- `;
23
- export const CollapsableHeadRoot = styled(m.label).attrs((props) => ({
24
- htmlFor: `${props.id}-input`,
25
- })) `
26
- ${btnStyleReset}
27
- width: 100%;
28
- padding: 0;
29
- text-align: left;
30
- display: flex;
31
- justify-content: space-between;
32
- align-items: center;
33
- cursor: pointer;
34
- `;
35
- export const CollapsableHeadSpace = styled.div `
36
- flex: 1;
37
- padding-left: 20px;
38
- `;
39
- export const CollapsableHeadAction = styled.div `
40
- padding-left: 20px;
41
- `;
42
- export const CollaspableHeadLine = styled(m.div) `
43
- width: 0%;
44
- height: 1px;
45
- background: #bbb;
46
- `;
47
- export const collapsableHeadLineMotion = {
48
- hover: {
49
- width: "100%",
50
- transition: {
51
- duration: 0.4,
52
- },
53
- },
54
- };
55
- export const CollapsableHeadText = styled.div ``;
56
- export const CollapsableHeadIcon = styled(m.div) ``;
57
- export const CollapsableHead = ({ $expanded, id, onClick, HeadRoot = CollapsableHeadRoot, HeadAction = CollapsableHeadAction, HeadIcon = CollapsableHeadIcon, children, }) => {
58
- return (_jsxs(DisclosureButton, { onClick: onClick,
59
- // tabIndex={0}
60
- // role="tab"
61
- initial: "rest", whileHover: "hover", "$expanded": $expanded, as: HeadRoot, id: id, children: [_jsx(CollapsableHeadText, { children: children }), _jsx(CollapsableHeadSpace, { children: _jsx(CollaspableHeadLine, { variants: collapsableHeadLineMotion, animate: $expanded ? "hover" : "" }) }), HeadAction && (_jsx(HeadAction, { children: HeadIcon && (_jsx(HeadIcon, { animate: { rotate: $expanded ? 180 : 0 }, children: _jsx(IconCollapse, {}) })) }))] }));
62
- };
63
- export const CollapsableInput = styled(InputInvisible).attrs({
64
- type: "checkbox",
65
- }) ``;
66
- export const CollasableBodyWrap = styled(DisclosurePanel) `
67
- /* this is because @reach adds the "hidden" attribute */
68
-
69
- &[hidden] {
70
- display: block;
71
- }
72
- `;
73
- export const CollapsableBodyRoot = styled(m.div) `
74
- .no-js & {
75
- transition: margin-top 0.2s ease;
76
- }
77
- .no-js ${CollapsableInput}:checked + ${CollasableBodyWrap} & {
78
- margin-top: 0 !important;
79
- opacity: 1 !important;
80
- }
81
- `;
82
- export const CollapsableBody = forwardRef(function CollapsableBody(props, ref) {
83
- return _jsx(CollapsableBodyRoot, { ref: ref, ...props });
84
- });
85
- export const Collapsable = ({ expanded: propExpanded, recalc, onChange, id, head, body,
86
- // autoCollapse,
87
- components = {}, ariaExpand = "Expand", ariaCollapse = "Collapse", ...props }) => {
88
- const isControlled = typeof propExpanded !== "undefined";
89
- const [stateExpanded, setStateExpanded] = useState(propExpanded);
90
- const [height, setHeight] = useState(0);
91
- const hash = id ? `#${id}` : "";
92
- const winSize = useWindowSize();
93
- const expanded = isControlled ? propExpanded : stateExpanded;
94
- const [overflow, setOverflow] = useState(expanded ? "unset" : "hidden");
95
- const content = useRef(null);
96
- const defaultId = useId();
97
- id = id || defaultId;
98
- const handleClick = useCallback(() => {
99
- if (hash) {
100
- window.history.replaceState(null, "", expanded ? window.location.pathname + window.location.search : hash);
101
- }
102
- if (onChange) {
103
- onChange();
104
- }
105
- if (!isControlled) {
106
- setStateExpanded((prevExpanded) => !prevExpanded);
107
- }
108
- }, [expanded, hash, onChange, isControlled]);
109
- const handleAnimationStart = useCallback(() => {
110
- setOverflow("hidden");
111
- }, []);
112
- const handleAnimationComplete = useCallback(() => {
113
- setOverflow(expanded ? "unset" : "hidden");
114
- }, [expanded]);
115
- useEffect(() => {
116
- if (content.current) {
117
- setHeight(Math.ceil(content.current.offsetHeight));
118
- }
119
- }, [winSize, recalc]);
120
- // deeplink on mount
121
- useEffect(() => {
122
- if (!isControlled && hash && window.location.hash === hash) {
123
- setStateExpanded(true);
124
- }
125
- }, [hash, isControlled]);
126
- return (_jsxs(CollapsableRoot, { id: id, ...props, open: expanded || false, children: [head !== null && (_jsx(CollapsableHead, { id: id, "$expanded": expanded, onClick: handleClick, ...components, children: head })), _jsx(CollapsableInput, { id: `${id}-input` }), _jsx(CollasableBodyWrap, { "$expanded": expanded, style: { overflow }, children: _jsx(CollapsableBody, { ref: content, "$expanded": expanded,
127
- // aria-expanded={expanded}
128
- // aria-label={expanded ? ariaCollapse : ariaExpand}
129
- style: {
130
- pointerEvents: expanded ? "all" : "none",
131
- }, onAnimationStart: handleAnimationStart, onAnimationComplete: handleAnimationComplete, animate: {
132
- marginTop: expanded ? 0 : height ? `-${height}px` : "-100vh",
133
- opacity: expanded ? 1 : 0.4,
134
- }, children: body }) })] }));
135
- };
8
+ // import { forwardRef, useCallback, useEffect, /* useId, */ useRef, useState } from "react";
9
+ // import styled from "styled-components";
10
+ // import { MotionProps, m } from "framer-motion";
11
+ // import {
12
+ // Disclosure,
13
+ // DisclosureButton,
14
+ // DisclosurePanel,
15
+ // } from "@reach/disclosure";
16
+ // import { BsBoxArrowInDown as IconCollapse } from "react-icons/bs";
17
+ // import { btnStyleReset } from "../Buttons";
18
+ // import { useWindowSize } from "../hooks/useWindowSize";
19
+ // import { InputInvisible } from "../Forms/styles";
20
+ // import { useId } from "../hooks/useId";
21
+ // export type CollapsableStyledProps = {
22
+ // $expanded?: boolean;
23
+ // };
24
+ // /**
25
+ // * `overflow-anchor: none;` keeps the same scrolling position
26
+ // * @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Accordion/Accordion.js#L54
27
+ // */
28
+ // export const CollapsableRoot = styled(Disclosure)`
29
+ // overflow-anchor: none;
30
+ // `;
31
+ // export const CollapsableHeadRoot = styled(m.label).attrs(
32
+ // (props: Pick<CollapsableHeadProps, "id">) => ({
33
+ // htmlFor: `${props.id}-input`,
34
+ // })
35
+ // )<Pick<CollapsableStyledProps, "$expanded">>`
36
+ // ${btnStyleReset}
37
+ // width: 100%;
38
+ // padding: 0;
39
+ // text-align: left;
40
+ // display: flex;
41
+ // justify-content: space-between;
42
+ // align-items: center;
43
+ // cursor: pointer;
44
+ // `;
45
+ // export const CollapsableHeadSpace = styled.div`
46
+ // flex: 1;
47
+ // padding-left: 20px;
48
+ // `;
49
+ // export const CollapsableHeadAction = styled.div`
50
+ // padding-left: 20px;
51
+ // `;
52
+ // export const CollaspableHeadLine = styled(m.div)`
53
+ // width: 0%;
54
+ // height: 1px;
55
+ // background: #bbb;
56
+ // `;
57
+ // export const collapsableHeadLineMotion = {
58
+ // hover: {
59
+ // width: "100%",
60
+ // transition: {
61
+ // duration: 0.4,
62
+ // },
63
+ // },
64
+ // };
65
+ // export const CollapsableHeadText = styled.div``;
66
+ // export const CollapsableHeadIcon = styled(m.div)``;
67
+ // export type CollapsableHeadProps = React.PropsWithChildren<
68
+ // Pick<CollapsableStyledProps, "$expanded"> &
69
+ // CollapsableComponents & {
70
+ // id: CollapsableProps["id"];
71
+ // onClick: (...args: any) => any;
72
+ // }
73
+ // >;
74
+ // export const CollapsableHead = ({
75
+ // $expanded,
76
+ // id,
77
+ // onClick,
78
+ // HeadRoot = CollapsableHeadRoot,
79
+ // HeadAction = CollapsableHeadAction,
80
+ // HeadIcon = CollapsableHeadIcon,
81
+ // children,
82
+ // }: CollapsableHeadProps) => {
83
+ // return (
84
+ // <DisclosureButton
85
+ // onClick={onClick}
86
+ // // tabIndex={0}
87
+ // // role="tab"
88
+ // initial="rest"
89
+ // whileHover="hover"
90
+ // $expanded={$expanded}
91
+ // as={HeadRoot}
92
+ // id={id}
93
+ // >
94
+ // <CollapsableHeadText>{children}</CollapsableHeadText>
95
+ // <CollapsableHeadSpace>
96
+ // <CollaspableHeadLine
97
+ // variants={collapsableHeadLineMotion}
98
+ // animate={$expanded ? "hover" : ""}
99
+ // />
100
+ // </CollapsableHeadSpace>
101
+ // {HeadAction && (
102
+ // <HeadAction>
103
+ // {HeadIcon && (
104
+ // <HeadIcon animate={{ rotate: $expanded ? 180 : 0 }}>
105
+ // <IconCollapse />
106
+ // </HeadIcon>
107
+ // )}
108
+ // </HeadAction>
109
+ // )}
110
+ // </DisclosureButton>
111
+ // );
112
+ // };
113
+ // export const CollapsableInput = styled(InputInvisible).attrs({
114
+ // type: "checkbox",
115
+ // })``;
116
+ // export const CollasableBodyWrap = styled(
117
+ // DisclosurePanel
118
+ // )<CollapsableStyledProps>`
119
+ // /* this is because @reach adds the "hidden" attribute */
120
+ // &[hidden] {
121
+ // display: block;
122
+ // }
123
+ // `;
124
+ // export const CollapsableBodyRoot = styled(m.div)`
125
+ // .no-js & {
126
+ // transition: margin-top 0.2s ease;
127
+ // }
128
+ // .no-js ${CollapsableInput}:checked + ${CollasableBodyWrap} & {
129
+ // margin-top: 0 !important;
130
+ // opacity: 1 !important;
131
+ // }
132
+ // `;
133
+ // export type CollapsableBodyProps = MotionProps &
134
+ // Pick<CollapsableStyledProps, "$expanded"> & {
135
+ // children?: React.ReactNode;
136
+ // style?: React.CSSProperties;
137
+ // };
138
+ // export const CollapsableBody = forwardRef<HTMLDivElement, CollapsableBodyProps>(
139
+ // function CollapsableBody(props, ref) {
140
+ // return <CollapsableBodyRoot ref={ref} {...props} />;
141
+ // }
142
+ // );
143
+ // export type CollapsableComponents = {
144
+ // HeadRoot?: typeof CollapsableHeadRoot;
145
+ // HeadAction?: null | typeof CollapsableHeadAction | React.FC<any>;
146
+ // HeadIcon?: null | typeof CollapsableHeadIcon | React.FC<any>;
147
+ // };
148
+ // export type CollapsableProps = React.ComponentPropsWithoutRef<"div"> & {
149
+ // id?: string;
150
+ // expanded?: boolean;
151
+ // /** Used to trigger a recalculation effect */
152
+ // recalc?: any;
153
+ // onChange?: () => any;
154
+ // head: null | React.ReactNode;
155
+ // body: React.ReactNode;
156
+ // /** Amount of milliseconds after which the component collapses */
157
+ // // autoCollapse?: number;
158
+ // components?: CollapsableComponents;
159
+ // /** @default "Expand" */
160
+ // ariaExpand?: string;
161
+ // /** @default "Collapse" */
162
+ // ariaCollapse?: string;
163
+ // };
164
+ // export const Collapsable = ({
165
+ // expanded: propExpanded,
166
+ // recalc,
167
+ // onChange,
168
+ // id,
169
+ // head,
170
+ // body,
171
+ // // autoCollapse,
172
+ // components = {},
173
+ // ariaExpand = "Expand",
174
+ // ariaCollapse = "Collapse",
175
+ // ...props
176
+ // }: CollapsableProps) => {
177
+ // const isControlled = typeof propExpanded !== "undefined";
178
+ // const [stateExpanded, setStateExpanded] = useState(propExpanded);
179
+ // const [height, setHeight] = useState(0);
180
+ // const hash = id ? `#${id}` : "";
181
+ // const winSize = useWindowSize();
182
+ // const expanded = isControlled ? propExpanded : stateExpanded;
183
+ // const [overflow, setOverflow] = useState(expanded ? "unset" : "hidden");
184
+ // const content = useRef<HTMLDivElement>(null);
185
+ // const defaultId = useId();
186
+ // id = id || defaultId;
187
+ // const handleClick = useCallback(() => {
188
+ // if (hash) {
189
+ // window.history.replaceState(
190
+ // null,
191
+ // "",
192
+ // expanded ? window.location.pathname + window.location.search : hash
193
+ // );
194
+ // }
195
+ // if (onChange) {
196
+ // onChange();
197
+ // }
198
+ // if (!isControlled) {
199
+ // setStateExpanded((prevExpanded) => !prevExpanded);
200
+ // }
201
+ // }, [expanded, hash, onChange, isControlled]);
202
+ // const handleAnimationStart = useCallback(() => {
203
+ // setOverflow("hidden");
204
+ // }, []);
205
+ // const handleAnimationComplete = useCallback(() => {
206
+ // setOverflow(expanded ? "unset" : "hidden");
207
+ // }, [expanded]);
208
+ // useEffect(() => {
209
+ // if (content.current) {
210
+ // setHeight(Math.ceil(content.current.offsetHeight));
211
+ // }
212
+ // }, [winSize, recalc]);
213
+ // // deeplink on mount
214
+ // useEffect(() => {
215
+ // if (!isControlled && hash && window.location.hash === hash) {
216
+ // setStateExpanded(true);
217
+ // }
218
+ // }, [hash, isControlled]);
219
+ // return (
220
+ // <CollapsableRoot id={id} {...props} open={expanded || false}>
221
+ // {head !== null && (
222
+ // <CollapsableHead
223
+ // id={id}
224
+ // $expanded={expanded}
225
+ // onClick={handleClick}
226
+ // {...components}
227
+ // >
228
+ // {head}
229
+ // </CollapsableHead>
230
+ // )}
231
+ // <CollapsableInput id={`${id}-input`} />
232
+ // <CollasableBodyWrap $expanded={expanded} style={{ overflow }}>
233
+ // <CollapsableBody
234
+ // ref={content}
235
+ // $expanded={expanded}
236
+ // // aria-expanded={expanded}
237
+ // // aria-label={expanded ? ariaCollapse : ariaExpand}
238
+ // style={{
239
+ // pointerEvents: expanded ? "all" : "none",
240
+ // }}
241
+ // onAnimationStart={handleAnimationStart}
242
+ // onAnimationComplete={handleAnimationComplete}
243
+ // animate={{
244
+ // marginTop: expanded ? 0 : height ? `-${height}px` : "-100vh",
245
+ // opacity: expanded ? 1 : 0.4,
246
+ // }}
247
+ // >
248
+ // {body}
249
+ // </CollapsableBody>
250
+ // </CollasableBodyWrap>
251
+ // </CollapsableRoot>
252
+ // );
253
+ // };
@@ -1 +1 @@
1
- export * from "./CollapsableReach";
1
+ export * from "./Collapsable";
@@ -1 +1,2 @@
1
- export * from "./CollapsableReach";
1
+ export * from "./Collapsable";
2
+ // export * from "./CollapsableReach";
package/Debug/Debug.js CHANGED
@@ -1,21 +1,9 @@
1
+ import { __makeTemplateObject } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import styled from "styled-components";
3
- const Root = styled.div `
4
- background: #f4f4f4;
5
- border: 1px solid #ddd;
6
- border-left: 3px solid #f36d33;
7
- color: #666;
8
- page-break-inside: avoid;
9
- font-family: monospace;
10
- font-size: small;
11
- line-height: 1.6;
12
- margin-bottom: 1.6em;
13
- max-width: 100%;
14
- overflow: auto;
15
- padding: 1em 1.5em;
16
- display: block;
17
- word-wrap: break-word;
18
- `;
19
- export const Debug = ({ data }) => {
4
+ var Root = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: #f4f4f4;\n border: 1px solid #ddd;\n border-left: 3px solid #f36d33;\n color: #666;\n page-break-inside: avoid;\n font-family: monospace;\n font-size: small;\n line-height: 1.6;\n margin-bottom: 1.6em;\n max-width: 100%;\n overflow: auto;\n padding: 1em 1.5em;\n display: block;\n word-wrap: break-word;\n"], ["\n background: #f4f4f4;\n border: 1px solid #ddd;\n border-left: 3px solid #f36d33;\n color: #666;\n page-break-inside: avoid;\n font-family: monospace;\n font-size: small;\n line-height: 1.6;\n margin-bottom: 1.6em;\n max-width: 100%;\n overflow: auto;\n padding: 1em 1.5em;\n display: block;\n word-wrap: break-word;\n"])));
5
+ export var Debug = function (_a) {
6
+ var data = _a.data;
20
7
  return _jsx(Root, { children: JSON.stringify(data, undefined, 2) });
21
8
  };
9
+ var templateObject_1;
@@ -0,0 +1,114 @@
1
+ /// <reference types="react" />
2
+ import { type WithComponents, type Simplify } from "../helpers";
3
+ export declare type OwnProps = React.ComponentProps<"details"> & {
4
+ open?: boolean;
5
+ onChange?: () => any;
6
+ summary: null | React.ReactNode;
7
+ /** Amount of milliseconds after which the component collapses */
8
+ /** @default "Expand" */
9
+ ariaExpand?: string;
10
+ /** @default "Collapse" */
11
+ ariaCollapse?: string;
12
+ id?: string;
13
+ /** Used to trigger a recalculation effect */
14
+ recalc?: any;
15
+ };
16
+ export declare type Components = {
17
+ Root: {
18
+ type: "details";
19
+ props: React.PropsWithChildren<{}>;
20
+ };
21
+ Summary: {
22
+ type: "summary";
23
+ props: React.PropsWithChildren<{
24
+ $open: OwnProps["open"];
25
+ } & Pick<OwnProps, "onChange">>;
26
+ };
27
+ Body: {
28
+ type: "div";
29
+ props: React.PropsWithChildren<{
30
+ $open: OwnProps["open"];
31
+ } & Pick<OwnProps, "onChange">>;
32
+ motionable: true;
33
+ };
34
+ Content: {
35
+ type: "div";
36
+ props: React.PropsWithChildren<{
37
+ $open: OwnProps["open"];
38
+ "aria-expanded"?: React.AriaAttributes["aria-expanded"];
39
+ "aria-label"?: React.AriaAttributes["aria-label"];
40
+ } & Pick<OwnProps, "onChange">>;
41
+ motionable: true;
42
+ };
43
+ };
44
+ export declare type ComponentsProps = {
45
+ [Name in keyof Components]: Components[Name]["props"];
46
+ };
47
+ export declare type Props = Simplify<WithComponents<OwnProps, Components>>;
48
+ export declare type DetailsProps = Props;
49
+ export declare type KoineDetailsProps = Props;
50
+ export declare const Root: import("react").ElementType<Pick<import("react").DetailedHTMLProps<import("react").DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "key" | keyof import("react").DetailsHTMLAttributes<HTMLDetailsElement>> & {
51
+ children?: import("react").ReactNode;
52
+ }>;
53
+ export declare const Summary: import("react").ElementType<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & {
54
+ $open: OwnProps["open"];
55
+ } & Pick<OwnProps, "onChange"> & {
56
+ children?: import("react").ReactNode;
57
+ }>;
58
+ export declare const Body: import("react").ElementType<Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "style" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "onAnimationEnd"> & {
59
+ $open: OwnProps["open"];
60
+ } & Pick<OwnProps, "onChange"> & {
61
+ children?: import("react").ReactNode;
62
+ }>;
63
+ export declare const Content: import("react").ElementType<Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "style" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "onAnimationEnd"> & {
64
+ $open: OwnProps["open"];
65
+ "aria-expanded"?: React.AriaAttributes["aria-expanded"];
66
+ "aria-label"?: React.AriaAttributes["aria-label"];
67
+ } & Pick<OwnProps, "onChange"> & {
68
+ children?: import("react").ReactNode;
69
+ }>;
70
+ export declare const KoineDetails: ((props: Pick<Simplify<WithComponents<OwnProps, Components>>, "key" | "summary" | keyof import("react").DetailsHTMLAttributes<HTMLDetailsElement> | "ariaExpand" | "ariaCollapse" | "recalc" | keyof Components> & import("react").RefAttributes<HTMLDivElement>) => import("react").FunctionComponentElement<any>) & {
71
+ Root: import("react").ElementType<Pick<import("react").DetailedHTMLProps<import("react").DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "key" | keyof import("react").DetailsHTMLAttributes<HTMLDetailsElement>> & {
72
+ children?: import("react").ReactNode;
73
+ }>;
74
+ Summary: import("react").ElementType<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & {
75
+ $open: OwnProps["open"];
76
+ } & Pick<OwnProps, "onChange"> & {
77
+ children?: import("react").ReactNode;
78
+ }>;
79
+ Body: import("react").ElementType<Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "style" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "onAnimationEnd"> & {
80
+ $open: OwnProps["open"];
81
+ } & Pick<OwnProps, "onChange"> & {
82
+ children?: import("react").ReactNode;
83
+ }>;
84
+ Content: import("react").ElementType<Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "style" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "onAnimationEnd"> & {
85
+ $open: OwnProps["open"];
86
+ "aria-expanded"?: React.AriaAttributes["aria-expanded"];
87
+ "aria-label"?: React.AriaAttributes["aria-label"];
88
+ } & Pick<OwnProps, "onChange"> & {
89
+ children?: import("react").ReactNode;
90
+ }>;
91
+ } & {
92
+ defaultProps: {
93
+ Root: import("react").ElementType<Pick<import("react").DetailedHTMLProps<import("react").DetailsHTMLAttributes<HTMLDetailsElement>, HTMLDetailsElement>, "key" | keyof import("react").DetailsHTMLAttributes<HTMLDetailsElement>> & {
94
+ children?: import("react").ReactNode;
95
+ }>;
96
+ Summary: import("react").ElementType<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & {
97
+ $open: OwnProps["open"];
98
+ } & Pick<OwnProps, "onChange"> & {
99
+ children?: import("react").ReactNode;
100
+ }>;
101
+ Body: import("react").ElementType<Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "style" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "onAnimationEnd"> & {
102
+ $open: OwnProps["open"];
103
+ } & Pick<OwnProps, "onChange"> & {
104
+ children?: import("react").ReactNode;
105
+ }>;
106
+ Content: import("react").ElementType<Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "style" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "onAnimationEnd"> & {
107
+ $open: OwnProps["open"];
108
+ "aria-expanded"?: React.AriaAttributes["aria-expanded"];
109
+ "aria-label"?: React.AriaAttributes["aria-label"];
110
+ } & Pick<OwnProps, "onChange"> & {
111
+ children?: import("react").ReactNode;
112
+ }>;
113
+ };
114
+ };
@@ -0,0 +1,65 @@
1
+ import { __assign, __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, useCallback, useEffect,
4
+ /* useId, */ useRef, useState, } from "react";
5
+ import { useWindowSize } from "../hooks/useWindowSize";
6
+ import { extendComponent, } from "../helpers";
7
+ import { useId } from "../hooks/useId";
8
+ export var Root = "details";
9
+ export var Summary = "summary";
10
+ export var Body = "div";
11
+ export var Content = "div";
12
+ /**
13
+ * FIXME: it actually works even without forwardRef, check if we do need it
14
+ *
15
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
16
+ */
17
+ var DetailsWithRef = forwardRef(function Details(_a, ref) {
18
+ var id = _a.id, propOpen = _a.open, recalc = _a.recalc, summary = _a.summary, children = _a.children, _Root = _a.Root, _Summary = _a.Summary, _Body = _a.Body, _Content = _a.Content, onChange = _a.onChange, props = __rest(_a, ["id", "open", "recalc", "summary", "children", "Root", "Summary", "Body", "Content", "onChange"]);
19
+ var isControlled = typeof propOpen !== "undefined";
20
+ var _b = useState(propOpen), stateOpen = _b[0], setStateOpen = _b[1];
21
+ var _c = useState(0), height = _c[0], setHeight = _c[1];
22
+ var hash = id ? "#".concat(id) : "";
23
+ var winSize = useWindowSize();
24
+ var open = isControlled ? propOpen : stateOpen;
25
+ var _d = useState(open ? "unset" : "hidden"), overflow = _d[0], setOverflow = _d[1];
26
+ var content = useRef(null);
27
+ var defaultId = useId();
28
+ id = id || defaultId;
29
+ var handleClick = useCallback(function () {
30
+ if (hash) {
31
+ window.history.replaceState(null, "", open ? window.location.pathname + window.location.search : hash);
32
+ }
33
+ if (onChange) {
34
+ onChange();
35
+ }
36
+ if (!isControlled) {
37
+ setStateOpen(function (prevOpen) { return !prevOpen; });
38
+ }
39
+ }, [open, hash, onChange, isControlled]);
40
+ useEffect(function () {
41
+ if (content.current) {
42
+ setHeight(Math.ceil(content.current.offsetHeight));
43
+ }
44
+ }, [winSize, recalc]);
45
+ // deeplink on mount
46
+ useEffect(function () {
47
+ if (!isControlled && hash && window.location.hash === hash) {
48
+ setStateOpen(true);
49
+ }
50
+ }, [hash, isControlled]);
51
+ return (_jsxs(Root, __assign({}, props, { open: open || false }, { children: [_jsx(Summary, __assign({ "$open": open, onClick: handleClick }, { children: summary || " " })), _jsx(Body, __assign({ "$open": open, style: { overflow: overflow } }, { children: _jsx(Content
52
+ // ref={content}
53
+ , __assign({ "$open": open,
54
+ // aria-expanded={open}
55
+ // aria-label={open ? ariaCollapse : ariaExpand}
56
+ style: {
57
+ pointerEvents: open ? "all" : "none",
58
+ } }, { children: children })) }))] })));
59
+ });
60
+ export var KoineDetails = extendComponent(DetailsWithRef, {
61
+ Root: Root,
62
+ Summary: Summary,
63
+ Body: Body,
64
+ Content: Content,
65
+ });
@@ -0,0 +1 @@
1
+ export * from "./Details";
@@ -0,0 +1 @@
1
+ export * from "./Details";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "module": "./index.js",
4
- "main": "../../node/Forms/Form/index.js",
4
+ "main": "../node/Details/index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import ModalUnstyled, { type ModalUnstyledProps } from "@mui/base/ModalUnstyled";
3
3
  import { type MotionProps } from "framer-motion";
4
4
  import { type WithComponents, type Simplify } from "../helpers";
5
- declare type ReducedModalUnstyledProps = Omit<ModalUnstyledProps, "onClose" | "BackdropComponent" | "classes" | "closeAfterTransition" | "components" | "componentsProps">;
5
+ declare type ReducedModalUnstyledProps = Omit<ModalUnstyledProps, "onClose" | "BackdropComponent" | "classes" | "closeAfterTransition" | "component" | "components" | "componentsProps">;
6
6
  export declare type OwnProps = React.PropsWithChildren<ReducedModalUnstyledProps & {
7
7
  onClose: (event: object, reason?: string) => any;
8
8
  title?: string;