@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.
- package/Alert/Alert.js +7 -3
- package/Alert/Alert.mjs +7 -3
- package/Alert/Alert.stories.js +4 -1
- package/Alert/Alert.stories.mjs +4 -1
- package/Animations/Reveal.js +5 -3
- package/Animations/Reveal.mjs +5 -3
- package/Animations/Underline.d.ts +1 -1
- package/Autocomplete/AutocompleteMui.js +57 -28
- package/Autocomplete/AutocompleteMui.mjs +57 -28
- package/Autocomplete/components.d.ts +12 -16
- package/Bg/BgColor.d.ts +2 -7
- package/Bg/BgColor.js +15 -10
- package/Bg/BgColor.mjs +15 -10
- package/Bg/BgPhoto.js +8 -6
- package/Bg/BgPhoto.mjs +8 -6
- package/Bg/BgSvg.js +8 -6
- package/Bg/BgSvg.mjs +8 -6
- package/Breadcrumbs/Breadcrumbs.js +30 -17
- package/Breadcrumbs/Breadcrumbs.mjs +30 -17
- package/Buttons/Button.d.ts +1 -1
- package/Buttons/ButtonComposite.js +52 -19
- package/Buttons/ButtonComposite.mjs +52 -19
- package/Buttons/ButtonFab.d.ts +1 -3
- package/Buttons/ButtonLink.js +3 -2
- package/Buttons/ButtonLink.mjs +3 -2
- package/Buttons/IconButton.d.ts +1 -3
- package/Calendar/CalendarDaygridCell.js +75 -52
- package/Calendar/CalendarDaygridCell.mjs +75 -52
- package/Calendar/CalendarDaygridNav.js +31 -17
- package/Calendar/CalendarDaygridNav.mjs +31 -17
- package/Calendar/CalendarDaygridTable.js +40 -15
- package/Calendar/CalendarDaygridTable.mjs +40 -15
- package/Calendar/CalendarLegend.js +20 -7
- package/Calendar/CalendarLegend.mjs +20 -7
- package/Carousel/CarouselCss.d.ts +2 -19
- package/Carousel/CarouselCss.js +10 -8
- package/Carousel/CarouselCss.mjs +10 -8
- package/Debug/Debug.js +4 -1
- package/Debug/Debug.mjs +4 -1
- package/Details/Details.js +27 -19
- package/Details/Details.mjs +27 -19
- package/Details/Details.stories.js +2 -1
- package/Details/Details.stories.mjs +2 -1
- package/Dialog/DialogMui.d.ts +9 -326
- package/Dialog/DialogMui.js +24 -11
- package/Dialog/DialogMui.mjs +24 -11
- package/Dialog/DialogMui.stories.js +2 -1
- package/Dialog/DialogMui.stories.mjs +2 -1
- package/Dialog/css/bare.d.ts +9 -327
- package/Dialog/css/index.stories.js +11 -3
- package/Dialog/css/index.stories.mjs +11 -3
- package/Dialog/m/bare.d.ts +2 -398
- package/Dialog/m/bare.js +114 -69
- package/Dialog/m/bare.mjs +114 -69
- package/Dialog/sc/bare.d.ts +27 -405
- package/Dialog/sc/framer.d.ts +15 -422
- package/Dialog/sc/framerMaterial.d.ts +15 -422
- package/Dialog/sc/index.stories.js +5 -4
- package/Dialog/sc/index.stories.mjs +5 -4
- package/Dialog/sc/material.d.ts +27 -405
- package/Dialog/tw/bare.d.ts +9 -327
- package/Dialog/tw/elegant.d.ts +9 -327
- package/Dialog/tw/framer.d.ts +3 -354
- package/Dialog/tw/framerMaterial.d.ts +3 -354
- package/Dialog/tw/index.stories.js +6 -5
- package/Dialog/tw/index.stories.mjs +6 -5
- package/Dialog/tw/material.d.ts +9 -327
- package/Editor/Editor--tiptap.js +29 -14
- package/Editor/Editor--tiptap.mjs +29 -14
- package/Editor/components.d.ts +3 -5
- package/FaviconTags.js +52 -38
- package/FaviconTags.mjs +52 -38
- package/Form/Form.js +33 -16
- package/Form/Form.mjs +33 -16
- package/Form/sc/bare.d.ts +11 -11
- package/Forms/Checkbox/Checkbox.d.ts +4 -4
- package/Forms/Checkbox/Checkbox.js +15 -1
- package/Forms/Checkbox/Checkbox.mjs +15 -1
- package/Forms/Feedback/Feedback.js +5 -3
- package/Forms/Feedback/Feedback.mjs +5 -3
- package/Forms/Field/Field.d.ts +2 -4
- package/Forms/Field/Field.js +11 -5
- package/Forms/Field/Field.mjs +11 -5
- package/Forms/Field/FieldControl.js +20 -6
- package/Forms/Field/FieldControl.mjs +20 -6
- package/Forms/Field/FieldHint.d.ts +1 -1
- package/Forms/Input/Input.d.ts +5 -5
- package/Forms/Input/Input.js +15 -7
- package/Forms/Input/Input.mjs +15 -7
- package/Forms/InputGroup/InputGroup.d.ts +4 -4
- package/Forms/InputGroup/InputGroup.js +17 -7
- package/Forms/InputGroup/InputGroup.mjs +17 -7
- package/Forms/Label/Label.d.ts +1 -1
- package/Forms/Password/Password.d.ts +1 -1
- package/Forms/Password/Password.js +25 -11
- package/Forms/Password/Password.mjs +25 -11
- package/Forms/Radio/Radio.js +30 -11
- package/Forms/Radio/Radio.mjs +30 -11
- package/Forms/Switch/Switch.d.ts +2 -2
- package/Forms/Switch/Switch.js +13 -1
- package/Forms/Switch/Switch.mjs +13 -1
- package/Forms/Textarea/Textarea.d.ts +1 -1
- package/Forms/Textarea/Textarea.js +15 -7
- package/Forms/Textarea/Textarea.mjs +15 -7
- package/Forms/Textarea/TextareaRich.js +20 -12
- package/Forms/Textarea/TextareaRich.mjs +20 -12
- package/Forms/Toggle/Toggle.d.ts +7 -7
- package/Forms/Toggle/Toggle.js +48 -29
- package/Forms/Toggle/Toggle.mjs +49 -30
- package/Forms/Toggle/useToggle.js +21 -15
- package/Forms/Toggle/useToggle.mjs +21 -15
- package/Forms/styles.d.ts +3 -7
- package/Forms/styles.js +2 -1
- package/Forms/styles.mjs +2 -1
- package/Grid/Grid.d.ts +4 -28
- package/Hamburger/Hamburger.js +24 -17
- package/Hamburger/Hamburger.mjs +25 -18
- package/Hidden/Hidden.d.ts +1 -1
- package/Img/sc/bare.d.ts +1 -1
- package/Link/Link.d.ts +1 -3
- package/Link/LinkBlank.d.ts +2 -5
- package/Link/LinkBlank.js +8 -1
- package/Link/LinkBlank.mjs +8 -1
- package/Menu/Menu.d.ts +1 -1
- package/MenuItem/MenuItem.d.ts +1 -4
- package/Meta/Meta.js +2 -1
- package/Meta/Meta.mjs +2 -1
- package/NoJs/NoJs.js +2 -1
- package/NoJs/NoJs.mjs +2 -1
- package/Pagination/PaginationNav.js +42 -23
- package/Pagination/PaginationNav.mjs +42 -23
- package/Pagination/PaginationResults.js +25 -20
- package/Pagination/PaginationResults.mjs +25 -20
- package/Pill/Pill.d.ts +4 -4
- package/Progress/ProgressCircular.js +14 -12
- package/Progress/ProgressCircular.mjs +14 -12
- package/Progress/ProgressLinear.js +21 -19
- package/Progress/ProgressLinear.mjs +21 -19
- package/Progress/ProgressOverlay.js +20 -14
- package/Progress/ProgressOverlay.mjs +20 -14
- package/Rating/Rating.d.ts +5 -5
- package/Rating/Rating.js +61 -35
- package/Rating/Rating.mjs +61 -35
- package/Select/components.d.ts +1 -1
- package/Select/components.js +5 -3
- package/Select/components.mjs +5 -3
- package/Sidebar/Sidebar.js +17 -8
- package/Sidebar/Sidebar.mjs +17 -8
- package/Spacing/Spacing.js +5 -2
- package/Spacing/Spacing.mjs +5 -2
- package/Sticky/StickyCss.js +2 -1
- package/Sticky/StickyCss.mjs +2 -1
- package/Tabs/TabsMui.d.ts +7 -296
- package/Tabs/TabsMui.js +11 -2
- package/Tabs/TabsMui.mjs +11 -2
- package/Tabs/TabsMui.stories.js +2 -1
- package/Tabs/TabsMui.stories.mjs +2 -1
- package/Tabs/tw/bare.d.ts +7 -296
- package/Tabs/tw/index.stories.js +3 -2
- package/Tabs/tw/index.stories.mjs +3 -2
- package/Tabs/tw/material.d.ts +7 -332
- package/Typography/CopyPasteVisible.d.ts +1 -1
- package/Typography/Native.d.ts +5 -5
- package/Typography/ReadMore.js +33 -18
- package/Typography/ReadMore.mjs +33 -18
- package/Typography/TextLoop.js +43 -35
- package/Typography/TextLoop.mjs +43 -35
- package/Typography/TypeStairs.js +27 -19
- package/Typography/TypeStairs.mjs +27 -19
- package/helpers/classed.stories.js +40 -22
- package/helpers/classed.stories.mjs +40 -22
- package/m/MotionProvider.js +5 -3
- package/m/MotionProvider.mjs +5 -3
- package/package.json +5 -25
- package/styles/Body.d.ts +2 -2
- package/styles/theme--vanilla.js +5 -3
- package/styles/theme--vanilla.mjs +5 -3
package/Dialog/m/bare.mjs
CHANGED
|
@@ -1,70 +1,115 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
// });
|