@koine/react 2.0.0-beta.5 → 2.0.0-beta.7

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 (177) hide show
  1. package/Alert/Alert.js +7 -3
  2. package/Alert/Alert.mjs +7 -3
  3. package/Alert/Alert.stories.js +4 -1
  4. package/Alert/Alert.stories.mjs +4 -1
  5. package/Animations/Reveal.js +5 -3
  6. package/Animations/Reveal.mjs +5 -3
  7. package/Animations/Underline.d.ts +1 -1
  8. package/Autocomplete/AutocompleteMui.js +57 -28
  9. package/Autocomplete/AutocompleteMui.mjs +57 -28
  10. package/Autocomplete/components.d.ts +12 -16
  11. package/Bg/BgColor.d.ts +2 -7
  12. package/Bg/BgColor.js +15 -10
  13. package/Bg/BgColor.mjs +15 -10
  14. package/Bg/BgPhoto.js +8 -6
  15. package/Bg/BgPhoto.mjs +8 -6
  16. package/Bg/BgSvg.js +8 -6
  17. package/Bg/BgSvg.mjs +8 -6
  18. package/Breadcrumbs/Breadcrumbs.js +30 -17
  19. package/Breadcrumbs/Breadcrumbs.mjs +30 -17
  20. package/Buttons/Button.d.ts +1 -1
  21. package/Buttons/ButtonComposite.js +52 -19
  22. package/Buttons/ButtonComposite.mjs +52 -19
  23. package/Buttons/ButtonFab.d.ts +1 -3
  24. package/Buttons/ButtonLink.js +3 -2
  25. package/Buttons/ButtonLink.mjs +3 -2
  26. package/Buttons/IconButton.d.ts +1 -3
  27. package/Calendar/CalendarDaygridCell.js +75 -52
  28. package/Calendar/CalendarDaygridCell.mjs +75 -52
  29. package/Calendar/CalendarDaygridNav.js +31 -17
  30. package/Calendar/CalendarDaygridNav.mjs +31 -17
  31. package/Calendar/CalendarDaygridTable.js +40 -15
  32. package/Calendar/CalendarDaygridTable.mjs +40 -15
  33. package/Calendar/CalendarLegend.js +20 -7
  34. package/Calendar/CalendarLegend.mjs +20 -7
  35. package/Carousel/CarouselCss.d.ts +2 -19
  36. package/Carousel/CarouselCss.js +10 -8
  37. package/Carousel/CarouselCss.mjs +10 -8
  38. package/Debug/Debug.js +4 -1
  39. package/Debug/Debug.mjs +4 -1
  40. package/Details/Details.js +27 -19
  41. package/Details/Details.mjs +27 -19
  42. package/Details/Details.stories.js +2 -1
  43. package/Details/Details.stories.mjs +2 -1
  44. package/Dialog/DialogMui.d.ts +9 -326
  45. package/Dialog/DialogMui.js +24 -11
  46. package/Dialog/DialogMui.mjs +24 -11
  47. package/Dialog/DialogMui.stories.js +2 -1
  48. package/Dialog/DialogMui.stories.mjs +2 -1
  49. package/Dialog/css/bare.d.ts +9 -327
  50. package/Dialog/css/index.stories.js +11 -3
  51. package/Dialog/css/index.stories.mjs +11 -3
  52. package/Dialog/m/bare.d.ts +2 -398
  53. package/Dialog/m/bare.js +114 -69
  54. package/Dialog/m/bare.mjs +114 -69
  55. package/Dialog/sc/bare.d.ts +27 -405
  56. package/Dialog/sc/framer.d.ts +15 -422
  57. package/Dialog/sc/framerMaterial.d.ts +15 -422
  58. package/Dialog/sc/index.stories.js +5 -4
  59. package/Dialog/sc/index.stories.mjs +5 -4
  60. package/Dialog/sc/material.d.ts +27 -405
  61. package/Dialog/tw/bare.d.ts +9 -327
  62. package/Dialog/tw/elegant.d.ts +9 -327
  63. package/Dialog/tw/framer.d.ts +3 -354
  64. package/Dialog/tw/framerMaterial.d.ts +3 -354
  65. package/Dialog/tw/index.stories.js +6 -5
  66. package/Dialog/tw/index.stories.mjs +6 -5
  67. package/Dialog/tw/material.d.ts +9 -327
  68. package/Editor/Editor--tiptap.js +29 -14
  69. package/Editor/Editor--tiptap.mjs +29 -14
  70. package/Editor/components.d.ts +3 -5
  71. package/FaviconTags.js +52 -38
  72. package/FaviconTags.mjs +52 -38
  73. package/Form/Form.js +33 -16
  74. package/Form/Form.mjs +33 -16
  75. package/Form/sc/bare.d.ts +11 -11
  76. package/Forms/Checkbox/Checkbox.d.ts +4 -4
  77. package/Forms/Checkbox/Checkbox.js +15 -1
  78. package/Forms/Checkbox/Checkbox.mjs +15 -1
  79. package/Forms/Feedback/Feedback.js +5 -3
  80. package/Forms/Feedback/Feedback.mjs +5 -3
  81. package/Forms/Field/Field.d.ts +2 -4
  82. package/Forms/Field/Field.js +11 -5
  83. package/Forms/Field/Field.mjs +11 -5
  84. package/Forms/Field/FieldControl.js +20 -6
  85. package/Forms/Field/FieldControl.mjs +20 -6
  86. package/Forms/Field/FieldHint.d.ts +1 -1
  87. package/Forms/Input/Input.d.ts +5 -5
  88. package/Forms/Input/Input.js +15 -7
  89. package/Forms/Input/Input.mjs +15 -7
  90. package/Forms/InputGroup/InputGroup.d.ts +4 -4
  91. package/Forms/InputGroup/InputGroup.js +17 -7
  92. package/Forms/InputGroup/InputGroup.mjs +17 -7
  93. package/Forms/Label/Label.d.ts +1 -1
  94. package/Forms/Password/Password.d.ts +1 -1
  95. package/Forms/Password/Password.js +25 -11
  96. package/Forms/Password/Password.mjs +25 -11
  97. package/Forms/Radio/Radio.js +30 -11
  98. package/Forms/Radio/Radio.mjs +30 -11
  99. package/Forms/Switch/Switch.d.ts +2 -2
  100. package/Forms/Switch/Switch.js +13 -1
  101. package/Forms/Switch/Switch.mjs +13 -1
  102. package/Forms/Textarea/Textarea.d.ts +1 -1
  103. package/Forms/Textarea/Textarea.js +15 -7
  104. package/Forms/Textarea/Textarea.mjs +15 -7
  105. package/Forms/Textarea/TextareaRich.js +20 -12
  106. package/Forms/Textarea/TextareaRich.mjs +20 -12
  107. package/Forms/Toggle/Toggle.d.ts +7 -7
  108. package/Forms/Toggle/Toggle.js +48 -29
  109. package/Forms/Toggle/Toggle.mjs +49 -30
  110. package/Forms/Toggle/useToggle.js +21 -15
  111. package/Forms/Toggle/useToggle.mjs +21 -15
  112. package/Forms/styles.d.ts +3 -7
  113. package/Forms/styles.js +2 -1
  114. package/Forms/styles.mjs +2 -1
  115. package/Grid/Grid.d.ts +4 -28
  116. package/Hamburger/Hamburger.js +24 -17
  117. package/Hamburger/Hamburger.mjs +25 -18
  118. package/Hidden/Hidden.d.ts +1 -1
  119. package/Img/sc/bare.d.ts +1 -1
  120. package/Link/Link.d.ts +1 -3
  121. package/Link/LinkBlank.d.ts +2 -5
  122. package/Link/LinkBlank.js +8 -1
  123. package/Link/LinkBlank.mjs +8 -1
  124. package/Menu/Menu.d.ts +1 -1
  125. package/MenuItem/MenuItem.d.ts +1 -4
  126. package/Meta/Meta.js +2 -1
  127. package/Meta/Meta.mjs +2 -1
  128. package/NoJs/NoJs.js +2 -1
  129. package/NoJs/NoJs.mjs +2 -1
  130. package/Pagination/PaginationNav.js +42 -23
  131. package/Pagination/PaginationNav.mjs +42 -23
  132. package/Pagination/PaginationResults.js +25 -20
  133. package/Pagination/PaginationResults.mjs +25 -20
  134. package/Pill/Pill.d.ts +4 -4
  135. package/Progress/ProgressCircular.js +14 -12
  136. package/Progress/ProgressCircular.mjs +14 -12
  137. package/Progress/ProgressLinear.js +21 -19
  138. package/Progress/ProgressLinear.mjs +21 -19
  139. package/Progress/ProgressOverlay.js +20 -14
  140. package/Progress/ProgressOverlay.mjs +20 -14
  141. package/Rating/Rating.d.ts +5 -5
  142. package/Rating/Rating.js +61 -35
  143. package/Rating/Rating.mjs +61 -35
  144. package/Select/components.d.ts +1 -1
  145. package/Select/components.js +5 -3
  146. package/Select/components.mjs +5 -3
  147. package/Sidebar/Sidebar.js +17 -8
  148. package/Sidebar/Sidebar.mjs +17 -8
  149. package/Spacing/Spacing.js +5 -2
  150. package/Spacing/Spacing.mjs +5 -2
  151. package/Sticky/StickyCss.js +2 -1
  152. package/Sticky/StickyCss.mjs +2 -1
  153. package/Tabs/TabsMui.d.ts +7 -296
  154. package/Tabs/TabsMui.js +11 -2
  155. package/Tabs/TabsMui.mjs +11 -2
  156. package/Tabs/TabsMui.stories.js +2 -1
  157. package/Tabs/TabsMui.stories.mjs +2 -1
  158. package/Tabs/tw/bare.d.ts +7 -296
  159. package/Tabs/tw/index.stories.js +3 -2
  160. package/Tabs/tw/index.stories.mjs +3 -2
  161. package/Tabs/tw/material.d.ts +7 -332
  162. package/Typography/CopyPasteVisible.d.ts +1 -1
  163. package/Typography/Native.d.ts +5 -5
  164. package/Typography/ReadMore.js +33 -18
  165. package/Typography/ReadMore.mjs +33 -18
  166. package/Typography/TextLoop.js +43 -35
  167. package/Typography/TextLoop.mjs +43 -35
  168. package/Typography/TypeStairs.js +27 -19
  169. package/Typography/TypeStairs.mjs +27 -19
  170. package/helpers/classed.stories.js +40 -22
  171. package/helpers/classed.stories.mjs +40 -22
  172. package/m/MotionProvider.js +5 -3
  173. package/m/MotionProvider.mjs +5 -3
  174. package/package.json +5 -25
  175. package/styles/Body.d.ts +2 -2
  176. package/styles/theme--vanilla.js +5 -3
  177. package/styles/theme--vanilla.mjs +5 -3
package/Dialog/m/bare.mjs CHANGED
@@ -1,70 +1,115 @@
1
- import { AnimatePresence, m } from "framer-motion";
2
- import { forwardRef, useMemo, useRef } from "react";
3
- import { MdClear as IconClose } from "react-icons/md";
1
+ // FIXME: cannot build this
4
2
  import { extendComponent } from "../../helpers";
5
- import { Backdrop, Body, Close, Container, Header, Paper, Root } from "../DialogMui";
6
- import { mRootStyle } from "./index";
7
- /**
8
- * About nested `AnimatePresence` and animated dialogs with framer @see:
9
- *
10
- * - https://github.com/framer/motion/issues/478
11
- * - https://codesandbox.io/s/clever-banzai-7km49?file=/src/Modal.js
12
- */ const Dialog = /*#__PURE__*/ forwardRef(function Dialog({ children, title, $scrollPaper, Root, Backdrop, Container, Paper, Close, Header, Body, mBackdrop, mPaper, onClose, ...props }, ref) {
13
- const BackdropMotion = useMemo(()=>(props)=>/*#__PURE__*/ React.createElement(AnimatePresence, null, props.open && /*#__PURE__*/ React.createElement(Backdrop, {
14
- ...mBackdrop,
15
- ...props
16
- })), [
17
- Backdrop,
18
- mBackdrop
19
- ]);
20
- // FIXME: extract this logic either in a useDialog hook or in a useclickOutside hook
21
- // click handling is taken from
22
- // @see https://github.com/mui/material-ui/blob/c758b6c0b30f0831110458a746690b33147c45df/packages/mui-material/src/Dialog/Dialog.js#L205-L226
23
- const backdropClick = useRef();
24
- const handleMouseDown = (event)=>{
25
- // We don't want to close the dialog when clicking the dialog content.
26
- // Make sure the event starts and ends on the same DOM element.
27
- backdropClick.current = event.target === event.currentTarget;
28
- };
29
- const handleBackdropClick = (event)=>{
30
- // Ignore the events not coming from the "backdrop".
31
- if (!backdropClick.current) {
32
- return;
33
- }
34
- backdropClick.current = null;
35
- // if (onBackdropClick) onBackdropClick(event);
36
- if (onClose) {
37
- onClose(event, "backdropClick");
38
- }
39
- };
40
- return /*#__PURE__*/ React.createElement(Root, {
41
- keepMounted: true,
42
- slots: {
43
- backdrop: BackdropMotion
44
- },
45
- onClick: handleBackdropClick,
46
- onClose: onClose,
47
- ref: ref,
48
- ...props,
49
- style: mRootStyle(props)
50
- }, /*#__PURE__*/ React.createElement(Container, {
51
- $scrollPaper: $scrollPaper,
52
- onMouseDown: handleMouseDown
53
- }, /*#__PURE__*/ React.createElement(AnimatePresence, null, props.open && // @ts-expect-error framer props collision...
54
- /*#__PURE__*/ React.createElement(Paper, {
55
- ...mPaper,
56
- "aria-label": title || "",
57
- $scrollPaper: $scrollPaper
58
- }, title && /*#__PURE__*/ React.createElement(Header, null, title), /*#__PURE__*/ React.createElement(Close, {
59
- onClick: onClose
60
- }, /*#__PURE__*/ React.createElement(IconClose, null)), /*#__PURE__*/ React.createElement(Body, null, children)))));
61
- });
62
- export const KoineDialog = extendComponent(Dialog, {
63
- Root,
64
- Backdrop: m(Backdrop),
65
- Container,
66
- Paper: m(Paper),
67
- Close,
68
- Header,
69
- Body
70
- });
3
+ const Dialog = ()=>null;
4
+ export const KoineDialog = extendComponent(Dialog, {}); // import { AnimatePresence, m } from "framer-motion";
5
+ // import { forwardRef, useMemo, useRef } from "react";
6
+ // import { MdClear as IconClose } from "react-icons/md";
7
+ // import { extendComponent } from "../../helpers";
8
+ // import {
9
+ // Backdrop,
10
+ // Body,
11
+ // Close,
12
+ // Container,
13
+ // Header,
14
+ // type KoineDialogProps,
15
+ // Paper,
16
+ // Root,
17
+ // } from "../DialogMui";
18
+ // import { mRootStyle } from "./index";
19
+ // // import { KoineDialog as _ } from "../DialogMui";
20
+ // export type { KoineDialogProps } from "../DialogMui";
21
+ // /**
22
+ // * About nested `AnimatePresence` and animated dialogs with framer @see:
23
+ // *
24
+ // * - https://github.com/framer/motion/issues/478
25
+ // * - https://codesandbox.io/s/clever-banzai-7km49?file=/src/Modal.js
26
+ // */
27
+ // const Dialog = forwardRef<HTMLDivElement, KoineDialogProps>(function Dialog(
28
+ // {
29
+ // children,
30
+ // title,
31
+ // $scrollPaper,
32
+ // Root,
33
+ // Backdrop,
34
+ // Container,
35
+ // Paper,
36
+ // Close,
37
+ // Header,
38
+ // Body,
39
+ // mBackdrop,
40
+ // mPaper,
41
+ // onClose,
42
+ // ...props
43
+ // },
44
+ // ref
45
+ // ) {
46
+ // const BackdropMotion: KoineDialogProps["Backdrop"] = useMemo(
47
+ // () => (props) =>
48
+ // (
49
+ // <AnimatePresence>
50
+ // {/* @ts-expect-error framer props collision... */}
51
+ // {props.open && <Backdrop {...mBackdrop} {...props} />}
52
+ // </AnimatePresence>
53
+ // ),
54
+ // [Backdrop, mBackdrop]
55
+ // );
56
+ // // FIXME: extract this logic either in a useDialog hook or in a useclickOutside hook
57
+ // // click handling is taken from
58
+ // // @see https://github.com/mui/material-ui/blob/c758b6c0b30f0831110458a746690b33147c45df/packages/mui-material/src/Dialog/Dialog.js#L205-L226
59
+ // const backdropClick = useRef<boolean | null>();
60
+ // const handleMouseDown: React.MouseEventHandler = (event) => {
61
+ // // We don't want to close the dialog when clicking the dialog content.
62
+ // // Make sure the event starts and ends on the same DOM element.
63
+ // backdropClick.current = event.target === event.currentTarget;
64
+ // };
65
+ // const handleBackdropClick: React.MouseEventHandler = (event) => {
66
+ // // Ignore the events not coming from the "backdrop".
67
+ // if (!backdropClick.current) {
68
+ // return;
69
+ // }
70
+ // backdropClick.current = null;
71
+ // // if (onBackdropClick) onBackdropClick(event);
72
+ // if (onClose) {
73
+ // onClose(event, "backdropClick");
74
+ // }
75
+ // };
76
+ // return (
77
+ // <Root
78
+ // keepMounted
79
+ // slots={{ backdrop: BackdropMotion }}
80
+ // onClick={handleBackdropClick}
81
+ // onClose={onClose}
82
+ // ref={ref}
83
+ // {...props}
84
+ // style={mRootStyle({ open: props.open, style: props.style })}
85
+ // >
86
+ // <Container $scrollPaper={$scrollPaper} onMouseDown={handleMouseDown}>
87
+ // <AnimatePresence>
88
+ // {props.open && (
89
+ // // @ts-expect-error framer props collision...
90
+ // <Paper
91
+ // {...mPaper}
92
+ // aria-label={title || ""}
93
+ // $scrollPaper={$scrollPaper}
94
+ // >
95
+ // {title && <Header>{title}</Header>}
96
+ // <Close onClick={onClose}>
97
+ // <IconClose />
98
+ // </Close>
99
+ // <Body>{children}</Body>
100
+ // </Paper>
101
+ // )}
102
+ // </AnimatePresence>
103
+ // </Container>
104
+ // </Root>
105
+ // );
106
+ // });
107
+ // export const KoineDialog = extendComponent(Dialog, {
108
+ // Root,
109
+ // Backdrop: m(Backdrop),
110
+ // Container,
111
+ // Paper: m(Paper),
112
+ // Close,
113
+ // Header,
114
+ // Body,
115
+ // });