@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.
- package/Alert/Alert.js +7 -13
- package/Animations/Reveal.js +12 -10
- package/Animations/Underline.js +3 -13
- package/Animations/useReveal.js +18 -17
- package/Autocomplete/AutocompleteDownshift.js +1 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +1 -1
- package/Autocomplete/AutocompleteMui.js +61 -56
- package/Autocomplete/AutocompleteReach.js +1 -1
- package/Autocomplete/components.js +17 -72
- package/Autocomplete/helpers.js +1 -1
- package/Bg/BgColor.js +14 -24
- package/Bg/BgPhoto.js +11 -54
- package/Bg/BgSvg.js +6 -9
- package/Breadcrumbs/Breadcrumbs.js +14 -54
- package/Buttons/Button.js +8 -73
- package/Buttons/ButtonComposite.js +20 -41
- package/Buttons/ButtonFab.js +4 -6
- package/Buttons/ButtonLink.js +7 -6
- package/Buttons/IconButton.js +5 -17
- package/Calendar/CalendarDaygridCell.js +20 -14
- package/Calendar/CalendarDaygridNav.js +10 -9
- package/Calendar/CalendarDaygridTable.js +32 -30
- package/Calendar/CalendarLegend.js +7 -2
- package/Calendar/calendar-api-google.js +101 -68
- package/Calendar/useCalendar.js +114 -113
- package/Calendar/utils.js +73 -74
- package/Carousel/Carousel.js +1 -1
- package/Carousel/CarouselCss.js +14 -27
- package/Collapsable/Collapsable.d.ts +1 -1
- package/Collapsable/Collapsable.js +1 -1
- package/Collapsable/CollapsableReach.d.ts +4 -64
- package/Collapsable/CollapsableReach.js +247 -129
- package/Collapsable/index.d.ts +1 -1
- package/Collapsable/index.js +2 -1
- package/Debug/Debug.js +5 -17
- package/Details/Details.d.ts +114 -0
- package/Details/Details.js +65 -0
- package/Details/index.d.ts +1 -0
- package/Details/index.js +1 -0
- package/{Forms/Form → Details}/package.json +1 -1
- package/Dialog/DialogMui.d.ts +1 -1
- package/Dialog/DialogMui.js +22 -20
- package/Dialog/css/bare.js +17 -15
- package/Dialog/m/bare.js +17 -13
- package/Dialog/m/basic.js +2 -2
- package/Dialog/m/index.js +4 -4
- package/Dialog/sc/bare.js +25 -43
- package/Dialog/sc/framer.js +6 -6
- package/Dialog/sc/framerMaterial.js +6 -6
- package/Dialog/sc/material.js +17 -37
- package/Dialog/tw/bare.js +25 -19
- package/Dialog/tw/elegant.js +17 -15
- package/Dialog/tw/framer.js +6 -6
- package/Dialog/tw/framerMaterial.js +6 -6
- package/Dialog/tw/material.js +17 -15
- package/Editor/Editor--tiptap.js +14 -11
- package/Editor/components.js +6 -24
- package/Favicon/FaviconTags.js +2 -1
- package/Form/Form.d.ts +111 -0
- package/Form/Form.js +61 -0
- package/{Forms/Form → Form}/index.d.ts +0 -0
- package/{Forms/Form → Form}/index.js +0 -0
- package/Form/package.json +6 -0
- package/Form/sc/bare.d.ts +33 -0
- package/Form/sc/bare.js +20 -0
- package/Forms/Checkbox/Checkbox.js +9 -15
- package/Forms/Feedback/Feedback.js +6 -7
- package/Forms/Field/Field.js +15 -26
- package/Forms/Field/FieldControl.js +19 -15
- package/Forms/Field/FieldHint.js +3 -5
- package/Forms/Input/Input.js +10 -16
- package/Forms/InputGroup/InputGroup.js +9 -36
- package/Forms/Label/Label.js +5 -23
- package/Forms/Password/Password.js +10 -23
- package/Forms/Radio/Radio.js +15 -18
- package/Forms/Switch/Switch.js +9 -39
- package/Forms/Textarea/Textarea.js +6 -7
- package/Forms/Textarea/TextareaRich.js +10 -24
- package/Forms/Toggle/Toggle.js +21 -68
- package/Forms/Toggle/useToggle.js +29 -29
- package/Forms/antispam.js +12 -12
- package/Forms/helpers.js +8 -7
- package/Forms/index.d.ts +0 -1
- package/Forms/index.js +0 -1
- package/Forms/styles.js +12 -43
- package/Gauge/Gauge.js +1 -1
- package/Grid/Grid.js +25 -51
- package/Hamburger/Hamburger.js +35 -47
- package/Header/useHeader.js +12 -12
- package/Hidden/Hidden.js +9 -13
- package/Img/sc/bare.js +3 -1
- package/Link/Link.js +3 -1
- package/Link/LinkBlank.js +8 -17
- package/Menu/Menu.js +3 -10
- package/MenuItem/MenuItem.js +3 -19
- package/Meta/Meta.js +3 -2
- package/NoJs/NoJs.js +2 -2
- package/Pagination/PaginationNav.js +26 -48
- package/Pagination/PaginationResults.js +7 -6
- package/Pill/Pill.js +6 -36
- package/Progress/ProgressCircular.js +9 -30
- package/Progress/ProgressLinear.js +8 -16
- package/Progress/ProgressOverlay.js +11 -27
- package/Rating/Rating.js +26 -45
- package/Rating/index.js +19 -15
- package/Select/SelectDownshift.js +1 -1
- package/Select/components.js +6 -12
- package/Sidebar/Sidebar.js +13 -38
- package/Spacing/Spacing.js +12 -12
- package/Sticky/Sticky.js +1 -1
- package/Sticky/StickyCss.js +4 -2
- package/Tabs/TabsMui.d.ts +244 -0
- package/Tabs/TabsMui.js +46 -0
- package/Tabs/index.d.ts +1 -1
- package/Tabs/index.js +1 -1
- package/Tabs/sc/bare.d.ts +5 -0
- package/Tabs/sc/bare.js +87 -0
- package/Tabs/tw/bare.d.ts +248 -0
- package/Tabs/tw/bare.js +17 -0
- package/Tabs/tw/material.d.ts +472 -0
- package/Tabs/tw/material.js +18 -0
- package/Tabs/useTabs.d.ts +43 -0
- package/Tabs/useTabs.js +44 -0
- package/Typography/CopyPasteVisible.js +3 -5
- package/Typography/Native.js +12 -45
- package/Typography/ReadMore.js +26 -52
- package/Typography/TextLoop.js +19 -22
- package/Typography/TypeStairs.js +20 -16
- package/css/index.js +1 -0
- package/helpers/classed.js +22 -18
- package/helpers/extend-component.js +6 -6
- package/hooks/index.d.ts +8 -0
- package/hooks/index.js +8 -0
- package/hooks/types.d.ts +8 -0
- package/hooks/types.js +1 -0
- package/hooks/useAsyncFn.d.ts +26 -0
- package/hooks/useAsyncFn.js +36 -0
- package/hooks/useDateLocale.js +22 -13
- package/hooks/useEffectOnce.d.ts +5 -0
- package/hooks/useEffectOnce.js +8 -0
- package/hooks/useFirstMountState.d.ts +4 -0
- package/hooks/useFirstMountState.js +12 -0
- package/hooks/useFocus.js +3 -3
- package/hooks/useId.d.ts +4 -0
- package/hooks/useId.js +8 -0
- package/hooks/useIsomorphicLayoutEffect.d.ts +5 -0
- package/hooks/useIsomorphicLayoutEffect.js +8 -0
- package/hooks/useMount.d.ts +4 -0
- package/hooks/useMount.js +9 -0
- package/hooks/useMountedState.d.ts +4 -0
- package/hooks/useMountedState.js +15 -0
- package/hooks/usePrevious.js +2 -2
- package/hooks/useScrollPosition.js +21 -16
- package/hooks/useScrollTo.js +7 -5
- package/hooks/useTraceUpdate.js +4 -3
- package/hooks/useUpdateEffect.d.ts +5 -0
- package/hooks/useUpdateEffect.js +14 -0
- package/hooks/useWindowSize.js +3 -3
- package/m/MotionProvider.js +4 -2
- package/node/Alert/Alert.js +9 -16
- package/node/Alert/index.js +1 -1
- package/node/Animations/Reveal.js +15 -13
- package/node/Animations/Underline.js +5 -16
- package/node/Animations/index.js +1 -1
- package/node/Animations/useReveal.js +19 -18
- package/node/Autocomplete/AutocompleteMui.js +69 -64
- package/node/Autocomplete/components.js +26 -82
- package/node/Autocomplete/helpers.js +2 -2
- package/node/Bg/BgColor.js +18 -29
- package/node/Bg/BgPhoto.js +15 -59
- package/node/Bg/BgSvg.js +8 -12
- package/node/Bg/index.js +1 -1
- package/node/Breadcrumbs/Breadcrumbs.js +20 -61
- package/node/Breadcrumbs/index.js +1 -1
- package/node/Buttons/Button.js +10 -76
- package/node/Buttons/ButtonComposite.js +23 -45
- package/node/Buttons/ButtonFab.js +6 -9
- package/node/Buttons/ButtonLink.js +10 -10
- package/node/Buttons/IconButton.js +7 -20
- package/node/Buttons/index.js +1 -1
- package/node/Calendar/CalendarDaygridCell.js +24 -18
- package/node/Calendar/CalendarDaygridNav.js +14 -13
- package/node/Calendar/CalendarDaygridTable.js +39 -38
- package/node/Calendar/CalendarLegend.js +8 -3
- package/node/Calendar/calendar-api-google.js +105 -73
- package/node/Calendar/index.js +1 -1
- package/node/Calendar/useCalendar.js +117 -116
- package/node/Calendar/utils.js +82 -84
- package/node/Carousel/CarouselCss.js +17 -31
- package/node/Carousel/index.js +1 -1
- package/node/Collapsable/Collapsable.js +2 -2
- package/node/Collapsable/CollapsableReach.js +246 -134
- package/node/Collapsable/index.js +3 -2
- package/node/Debug/Debug.js +7 -20
- package/node/Debug/index.js +1 -1
- package/node/Details/Details.js +67 -0
- package/node/Details/index.js +4 -0
- package/node/Dialog/DialogMui.js +12 -11
- package/node/Dialog/css/bare.js +11 -10
- package/node/Dialog/m/bare.js +18 -14
- package/node/Dialog/m/basic.js +1 -1
- package/node/Dialog/m/index.js +4 -4
- package/node/Dialog/sc/bare.js +22 -41
- package/node/Dialog/sc/framer.js +5 -5
- package/node/Dialog/sc/framerMaterial.js +5 -5
- package/node/Dialog/sc/material.js +12 -33
- package/node/Dialog/tw/bare.js +19 -14
- package/node/Dialog/tw/elegant.js +11 -9
- package/node/Dialog/tw/framer.js +5 -5
- package/node/Dialog/tw/framerMaterial.js +5 -5
- package/node/Dialog/tw/material.js +11 -9
- package/node/Editor/Editor--tiptap.js +19 -17
- package/node/Editor/components.js +9 -28
- package/node/Editor/index.js +1 -1
- package/node/Favicon/FaviconTags.js +3 -2
- package/node/Favicon/index.js +1 -1
- package/node/Form/Form.js +65 -0
- package/node/{Forms/Form → Form}/index.js +1 -1
- package/node/Form/sc/bare.js +23 -0
- package/node/Forms/Checkbox/Checkbox.js +13 -20
- package/node/Forms/Checkbox/index.js +1 -1
- package/node/Forms/Feedback/Feedback.js +8 -10
- package/node/Forms/Feedback/index.js +1 -1
- package/node/Forms/Field/Field.js +18 -30
- package/node/Forms/Field/FieldControl.js +26 -22
- package/node/Forms/Field/FieldHint.js +4 -7
- package/node/Forms/Field/index.js +1 -1
- package/node/Forms/Input/Input.js +15 -22
- package/node/Forms/Input/index.js +1 -1
- package/node/Forms/InputGroup/InputGroup.js +14 -42
- package/node/Forms/InputGroup/index.js +1 -1
- package/node/Forms/Label/Label.js +6 -25
- package/node/Forms/Label/index.js +1 -1
- package/node/Forms/Password/Password.js +16 -30
- package/node/Forms/Password/index.js +1 -1
- package/node/Forms/Radio/Radio.js +21 -25
- package/node/Forms/Radio/index.js +1 -1
- package/node/Forms/Switch/Switch.js +15 -46
- package/node/Forms/Switch/index.js +1 -1
- package/node/Forms/Textarea/Textarea.js +11 -13
- package/node/Forms/Textarea/TextareaRich.js +16 -31
- package/node/Forms/Textarea/index.js +1 -1
- package/node/Forms/Toggle/Toggle.js +24 -72
- package/node/Forms/Toggle/index.js +1 -1
- package/node/Forms/Toggle/useToggle.js +33 -33
- package/node/Forms/antispam.js +14 -14
- package/node/Forms/helpers.js +9 -8
- package/node/Forms/index.js +1 -2
- package/node/Forms/styles.js +16 -48
- package/node/Gauge/Gauge.js +1 -1
- package/node/Grid/Grid.js +24 -51
- package/node/Grid/index.js +1 -1
- package/node/Hamburger/Hamburger.js +37 -50
- package/node/Hamburger/index.js +1 -1
- package/node/Header/index.js +1 -1
- package/node/Header/useHeader.js +16 -16
- package/node/Hidden/Hidden.js +10 -15
- package/node/Hidden/index.js +1 -1
- package/node/Img/index.js +1 -1
- package/node/Img/sc/bare.js +4 -3
- package/node/Link/Link.js +4 -3
- package/node/Link/LinkBlank.js +11 -21
- package/node/Link/index.js +1 -1
- package/node/Menu/Menu.js +4 -12
- package/node/Menu/index.js +1 -1
- package/node/MenuItem/MenuItem.js +4 -21
- package/node/MenuItem/index.js +1 -1
- package/node/Meta/Meta.js +4 -3
- package/node/Meta/index.js +1 -1
- package/node/NoJs/NoJs.js +3 -3
- package/node/NoJs/index.js +1 -1
- package/node/Pagination/PaginationNav.js +30 -53
- package/node/Pagination/PaginationResults.js +10 -10
- package/node/Pagination/index.js +1 -1
- package/node/Pill/Pill.js +7 -38
- package/node/Pill/index.js +1 -1
- package/node/Progress/ProgressCircular.js +11 -33
- package/node/Progress/ProgressLinear.js +11 -20
- package/node/Progress/ProgressOverlay.js +18 -35
- package/node/Progress/index.js +1 -1
- package/node/Rating/Rating.js +28 -48
- package/node/Rating/index.js +20 -16
- package/node/Select/components.js +11 -18
- package/node/Sidebar/Sidebar.js +21 -47
- package/node/Sidebar/index.js +1 -1
- package/node/Spacing/Spacing.js +16 -17
- package/node/Spacing/index.js +1 -1
- package/node/Sticky/StickyCss.js +5 -3
- package/node/Sticky/index.js +1 -1
- package/node/Tabs/TabsMui.js +49 -0
- package/node/Tabs/index.js +2 -2
- package/node/Tabs/sc/bare.js +87 -0
- package/node/Tabs/tw/bare.js +20 -0
- package/node/Tabs/tw/material.js +21 -0
- package/node/Tabs/useTabs.js +48 -0
- package/node/Typography/CopyPasteVisible.js +4 -7
- package/node/Typography/Native.js +14 -48
- package/node/Typography/ReadMore.js +30 -57
- package/node/Typography/TextLoop.js +22 -25
- package/node/Typography/TypeStairs.js +22 -18
- package/node/Typography/index.js +1 -1
- package/node/css/index.js +2 -1
- package/node/helpers/classed.js +23 -19
- package/node/helpers/extend-component.js +7 -7
- package/node/helpers/index.js +1 -1
- package/node/hooks/index.js +9 -1
- package/node/hooks/types.js +2 -0
- package/node/hooks/useAsyncFn.js +40 -0
- package/node/hooks/useDateLocale.js +23 -37
- package/node/hooks/useEffectOnce.js +12 -0
- package/node/hooks/useFirstMountState.js +16 -0
- package/node/hooks/useFocus.js +4 -4
- package/node/hooks/useId.js +12 -0
- package/node/hooks/useIsomorphicLayoutEffect.js +11 -0
- package/node/hooks/useMount.js +13 -0
- package/node/hooks/useMountedState.js +19 -0
- package/node/hooks/usePrevious.js +3 -3
- package/node/hooks/useScrollPosition.js +23 -19
- package/node/hooks/useScrollTo.js +9 -7
- package/node/hooks/useTraceUpdate.js +5 -4
- package/node/hooks/useUpdateEffect.js +18 -0
- package/node/hooks/useWindowSize.js +4 -4
- package/node/index.js +1 -1
- package/node/m/MotionProvider.js +6 -4
- package/node/m/index.js +1 -1
- package/node/m/lite.js +1 -1
- package/node/m/max.js +1 -1
- package/node/sc/index.js +4 -2
- package/node/scm/index.js +2 -1
- package/node/shared/index.js +1 -1
- package/node/styles/Body.js +5 -10
- package/node/styles/Global.js +5 -37
- package/node/styles/index.js +1 -1
- package/node/styles/media.js +42 -38
- package/node/styles/spacing.js +15 -16
- package/node/styles/styled.js +7 -21
- package/node/styles/theme--vanilla.js +21 -19
- package/node/styles/theme.js +9 -9
- package/node/tw/index.js +2 -1
- package/node/twm/index.js +2 -1
- package/package.json +20 -9
- package/sc/index.d.ts +1 -0
- package/sc/index.js +1 -0
- package/scm/index.js +1 -0
- package/styles/Body.js +4 -8
- package/styles/Global.js +4 -36
- package/styles/media.js +41 -36
- package/styles/spacing.js +15 -16
- package/styles/styled.js +7 -21
- package/styles/theme--vanilla.js +21 -19
- package/styles/theme.js +11 -11
- package/tw/index.js +1 -0
- package/twm/index.js +1 -0
- package/Forms/Form/Form.d.ts +0 -31
- package/Forms/Form/Form.js +0 -62
- package/Tabs/Tabs.d.ts +0 -27
- package/Tabs/Tabs.js +0 -62
- package/node/Forms/Form/Form.js +0 -67
- package/node/Tabs/Tabs.js +0 -67
package/Dialog/DialogMui.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef, useRef } from "react";
|
|
3
4
|
import ModalUnstyled from "@mui/base/ModalUnstyled";
|
|
4
5
|
import { MdClear as IconClose } from "react-icons/md";
|
|
5
6
|
import { extendComponent, } from "../helpers";
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
7
|
+
export var Root = ModalUnstyled;
|
|
8
|
+
export var Backdrop = "div";
|
|
9
|
+
export var Container = "div";
|
|
10
|
+
export var Paper = "div";
|
|
11
|
+
export var Close = "button";
|
|
12
|
+
export var Header = "div";
|
|
13
|
+
export var Body = "div";
|
|
13
14
|
// const Dialog = ({
|
|
14
15
|
// children,
|
|
15
16
|
// title,
|
|
@@ -45,16 +46,17 @@ export const Body = "div";
|
|
|
45
46
|
*
|
|
46
47
|
* FIXME: it actually works even without forwardRef, check if we do need it
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
var DialogWithRef = forwardRef(function Dialog(_a, ref) {
|
|
50
|
+
var children = _a.children, title = _a.title, $scrollPaper = _a.$scrollPaper, _Root = _a.Root, _Backdrop = _a.Backdrop, _Container = _a.Container, _Paper = _a.Paper, _Close = _a.Close, _Header = _a.Header, _Body = _a.Body, onClose = _a.onClose, props = __rest(_a, ["children", "title", "$scrollPaper", "Root", "Backdrop", "Container", "Paper", "Close", "Header", "Body", "onClose"]);
|
|
49
51
|
// click handling is taken from
|
|
50
52
|
// @see https://github.com/mui/material-ui/blob/c758b6c0b30f0831110458a746690b33147c45df/packages/mui-material/src/Dialog/Dialog.js#L205-L226
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
var backdropClick = useRef();
|
|
54
|
+
var handleMouseDown = function (event) {
|
|
53
55
|
// We don't want to close the dialog when clicking the dialog content.
|
|
54
56
|
// Make sure the event starts and ends on the same DOM element.
|
|
55
57
|
backdropClick.current = event.target === event.currentTarget;
|
|
56
58
|
};
|
|
57
|
-
|
|
59
|
+
var handleBackdropClick = function (event) {
|
|
58
60
|
// Ignore the events not coming from the "backdrop".
|
|
59
61
|
if (!backdropClick.current) {
|
|
60
62
|
return;
|
|
@@ -65,14 +67,14 @@ const DialogWithRef = forwardRef(function Dialog({ children, title, $scrollPaper
|
|
|
65
67
|
onClose(event, "backdropClick");
|
|
66
68
|
}
|
|
67
69
|
};
|
|
68
|
-
return (_jsx(Root, { BackdropComponent: Backdrop, onClick: handleBackdropClick, onClose: onClose, ref: ref,
|
|
70
|
+
return (_jsx(Root, __assign({ BackdropComponent: Backdrop, onClick: handleBackdropClick, onClose: onClose, ref: ref }, props, { children: _jsx(Container, __assign({ "$scrollPaper": $scrollPaper, onMouseDown: handleMouseDown }, { children: _jsxs(Paper, __assign({ "aria-label": title || "", "$scrollPaper": $scrollPaper }, { children: [title && _jsx(Header, { children: title }), _jsx(Close, __assign({ onClick: onClose }, { children: _jsx(IconClose, {}) })), _jsx(Body, { children: children })] })) })) })));
|
|
69
71
|
});
|
|
70
|
-
export
|
|
71
|
-
Root,
|
|
72
|
-
Backdrop,
|
|
73
|
-
Container,
|
|
74
|
-
Paper,
|
|
75
|
-
Close,
|
|
76
|
-
Header,
|
|
77
|
-
Body,
|
|
72
|
+
export var KoineDialog = extendComponent(DialogWithRef, {
|
|
73
|
+
Root: Root,
|
|
74
|
+
Backdrop: Backdrop,
|
|
75
|
+
Container: Container,
|
|
76
|
+
Paper: Paper,
|
|
77
|
+
Close: Close,
|
|
78
|
+
Header: Header,
|
|
79
|
+
Body: Body,
|
|
78
80
|
});
|
package/Dialog/css/bare.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import { classed, extendComponent } from "../../helpers";
|
|
2
3
|
import * as _ from "../DialogMui";
|
|
3
4
|
// export type { KoineDialogProps } from "../DialogMui";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
Root,
|
|
13
|
-
Backdrop,
|
|
14
|
-
Container,
|
|
15
|
-
Paper,
|
|
16
|
-
Close,
|
|
17
|
-
Header,
|
|
18
|
-
Body,
|
|
5
|
+
export var Root = classed(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["dialog"], ["dialog"])));
|
|
6
|
+
export var Backdrop = classed(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["dialogBackdrop"], ["dialogBackdrop"])));
|
|
7
|
+
export var Container = classed(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["dialogContainer"], ["dialogContainer"])));
|
|
8
|
+
export var Paper = classed(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["dialogPaper"], ["dialogPaper"])));
|
|
9
|
+
export var Close = classed(_.Close)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\"dialogClose"], ["\"dialogClose"])));
|
|
10
|
+
export var Header = classed(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["dialogHeader"], ["dialogHeader"])));
|
|
11
|
+
export var Body = classed(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["dialogBody"], ["dialogBody"])));
|
|
12
|
+
export var KoineDialog = extendComponent(_.KoineDialog, {
|
|
13
|
+
Root: Root,
|
|
14
|
+
Backdrop: Backdrop,
|
|
15
|
+
Container: Container,
|
|
16
|
+
Paper: Paper,
|
|
17
|
+
Close: Close,
|
|
18
|
+
Header: Header,
|
|
19
|
+
Body: Body,
|
|
19
20
|
});
|
|
21
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/Dialog/m/bare.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef, useMemo, useRef } from "react";
|
|
3
4
|
import { MdClear as IconClose } from "react-icons/md";
|
|
@@ -11,18 +12,21 @@ import { Root, Backdrop, Container, Paper, Close, Header, Body, } from "../Dialo
|
|
|
11
12
|
* - https://github.com/framer/motion/issues/478
|
|
12
13
|
* - https://codesandbox.io/s/clever-banzai-7km49?file=/src/Modal.js
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var Dialog = forwardRef(function Dialog(_a, ref) {
|
|
16
|
+
var children = _a.children, title = _a.title, $scrollPaper = _a.$scrollPaper, Root = _a.Root, Backdrop = _a.Backdrop, Container = _a.Container, Paper = _a.Paper, Close = _a.Close, Header = _a.Header, Body = _a.Body, mBackdrop = _a.mBackdrop, mPaper = _a.mPaper, onClose = _a.onClose, props = __rest(_a, ["children", "title", "$scrollPaper", "Root", "Backdrop", "Container", "Paper", "Close", "Header", "Body", "mBackdrop", "mPaper", "onClose"]);
|
|
17
|
+
var BackdropMotion = useMemo(function () { return function (props) {
|
|
18
|
+
return (_jsx(AnimatePresence, { children: props.open && _jsx(Backdrop, __assign({}, mBackdrop, props)) }));
|
|
19
|
+
}; }, [Backdrop, mBackdrop]);
|
|
16
20
|
// FIXME: extract this logic either in a useDialog hook or in a useclickOutside hook
|
|
17
21
|
// click handling is taken from
|
|
18
22
|
// @see https://github.com/mui/material-ui/blob/c758b6c0b30f0831110458a746690b33147c45df/packages/mui-material/src/Dialog/Dialog.js#L205-L226
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
var backdropClick = useRef();
|
|
24
|
+
var handleMouseDown = function (event) {
|
|
21
25
|
// We don't want to close the dialog when clicking the dialog content.
|
|
22
26
|
// Make sure the event starts and ends on the same DOM element.
|
|
23
27
|
backdropClick.current = event.target === event.currentTarget;
|
|
24
28
|
};
|
|
25
|
-
|
|
29
|
+
var handleBackdropClick = function (event) {
|
|
26
30
|
// Ignore the events not coming from the "backdrop".
|
|
27
31
|
if (!backdropClick.current) {
|
|
28
32
|
return;
|
|
@@ -33,16 +37,16 @@ const Dialog = forwardRef(function Dialog({ children, title, $scrollPaper, Root,
|
|
|
33
37
|
onClose(event, "backdropClick");
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
|
-
return (_jsx(Root, { keepMounted: true, BackdropComponent: BackdropMotion, onClick: handleBackdropClick, onClose: onClose, ref: ref,
|
|
40
|
+
return (_jsx(Root, __assign({ keepMounted: true, BackdropComponent: BackdropMotion, onClick: handleBackdropClick, onClose: onClose, ref: ref }, props, { style: mRootStyle(props) }, { children: _jsx(Container, __assign({ "$scrollPaper": $scrollPaper, onMouseDown: handleMouseDown }, { children: _jsx(AnimatePresence, { children: props.open && (
|
|
37
41
|
// @ts-expect-error framer props collision...
|
|
38
|
-
_jsxs(Paper, {
|
|
42
|
+
_jsxs(Paper, __assign({}, mPaper, { "aria-label": title || "", "$scrollPaper": $scrollPaper }, { children: [title && _jsx(Header, { children: title }), _jsx(Close, __assign({ onClick: onClose }, { children: _jsx(IconClose, {}) })), _jsx(Body, { children: children })] }))) }) })) })));
|
|
39
43
|
});
|
|
40
|
-
export
|
|
41
|
-
Root,
|
|
44
|
+
export var KoineDialog = extendComponent(Dialog, {
|
|
45
|
+
Root: Root,
|
|
42
46
|
Backdrop: m(Backdrop),
|
|
43
|
-
Container,
|
|
47
|
+
Container: Container,
|
|
44
48
|
Paper: m(Paper),
|
|
45
|
-
Close,
|
|
46
|
-
Header,
|
|
47
|
-
Body,
|
|
49
|
+
Close: Close,
|
|
50
|
+
Header: Header,
|
|
51
|
+
Body: Body,
|
|
48
52
|
});
|
package/Dialog/m/basic.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./index";
|
|
2
|
-
export
|
|
2
|
+
export var dialogBackdropMotion = {
|
|
3
3
|
initial: {
|
|
4
4
|
opacity: 0,
|
|
5
5
|
},
|
|
@@ -12,7 +12,7 @@ export const dialogBackdropMotion = {
|
|
|
12
12
|
opacity: 0,
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export var dialogPaperMotion = {
|
|
16
16
|
initial: {
|
|
17
17
|
// scale: .9,
|
|
18
18
|
translateY: -60,
|
package/Dialog/m/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
export var mRootStyle = function (props) {
|
|
3
|
+
return (__assign({ pointerEvents: props.open ? "all" : "none" }, (props.style || {})));
|
|
4
|
+
};
|
package/Dialog/sc/bare.js
CHANGED
|
@@ -1,61 +1,43 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import styled from "styled-components";
|
|
2
3
|
import { extendComponent } from "../../helpers";
|
|
3
4
|
import { inset0 } from "../../styles/styled";
|
|
4
5
|
import { IconButton } from "../../Buttons";
|
|
5
6
|
import * as _ from "../DialogMui";
|
|
6
|
-
export
|
|
7
|
-
z-index: 1300;
|
|
8
|
-
position: fixed;
|
|
9
|
-
${inset0}
|
|
10
|
-
`;
|
|
7
|
+
export var Root = styled(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n z-index: 1300;\n position: fixed;\n ", "\n"], ["\n z-index: 1300;\n position: fixed;\n ", "\n"])), inset0);
|
|
11
8
|
// export const Backdrop = (props) => {
|
|
12
9
|
// return <div {...props} />;
|
|
13
10
|
// }
|
|
14
|
-
export
|
|
15
|
-
z-index: -1;
|
|
16
|
-
position: fixed;
|
|
17
|
-
${inset0}
|
|
18
|
-
backdrop-filter: blur(0px);
|
|
19
|
-
-webkit-tap-highlight-color: transparent;
|
|
20
|
-
`;
|
|
11
|
+
export var Backdrop = styled(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: -1;\n position: fixed;\n ", "\n backdrop-filter: blur(0px);\n -webkit-tap-highlight-color: transparent;\n"], ["\n z-index: -1;\n position: fixed;\n ", "\n backdrop-filter: blur(0px);\n -webkit-tap-highlight-color: transparent;\n"])), inset0);
|
|
21
12
|
/**
|
|
22
13
|
* @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Dialog/Dialog.js#L64-L85
|
|
23
14
|
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
: "overflow: hidden auto; text-align: center; &:after { content: ''; display: inline-block; vertical-align: middle; height: 100%; width: 0; }"}
|
|
30
|
-
`;
|
|
15
|
+
export var Container = styled(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 100%;\n outline: 0;\n ", "\n"], ["\n height: 100%;\n outline: 0;\n ", "\n"])), function (p) {
|
|
16
|
+
return p.$scrollPaper
|
|
17
|
+
? "display: flex; justify-content: center; align-items: center;"
|
|
18
|
+
: "overflow: hidden auto; text-align: center; &:after { content: ''; display: inline-block; vertical-align: middle; height: 100%; width: 0; }";
|
|
19
|
+
});
|
|
31
20
|
/**
|
|
32
21
|
* @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Dialog/Dialog.js#L104-L157
|
|
33
22
|
*/
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export
|
|
41
|
-
position: absolute;
|
|
42
|
-
`;
|
|
43
|
-
export const Header = styled(_.Header) ``;
|
|
23
|
+
export var Paper = styled(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n ", "\n"], ["\n position: relative;\n ", "\n"])), function (p) {
|
|
24
|
+
return p.$scrollPaper
|
|
25
|
+
? "display: flex; flex-direction: column; max-height: calc(100%-64px);"
|
|
26
|
+
: "display: inline-block; vertical-align: middle; text-align: initial;";
|
|
27
|
+
});
|
|
28
|
+
export var Close = styled(IconButton)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n"], ["\n position: absolute;\n"])));
|
|
29
|
+
export var Header = styled(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject([""], [""])));
|
|
44
30
|
/**
|
|
45
31
|
* @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/DialogContent/DialogContent.js#L29-L44
|
|
46
32
|
*/
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Container,
|
|
57
|
-
Paper,
|
|
58
|
-
Close,
|
|
59
|
-
Header,
|
|
60
|
-
Body,
|
|
33
|
+
export var Body = styled(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n flex: 1 1 auto;\n -webkit-overflow-scrolling: touch;\n overflow-y: auto;\n overflow: auto;\n"], ["\n flex: 1 1 auto;\n -webkit-overflow-scrolling: touch;\n overflow-y: auto;\n overflow: auto;\n"])));
|
|
34
|
+
export var KoineDialog = extendComponent(_.KoineDialog, {
|
|
35
|
+
Root: Root,
|
|
36
|
+
Backdrop: Backdrop,
|
|
37
|
+
Container: Container,
|
|
38
|
+
Paper: Paper,
|
|
39
|
+
Close: Close,
|
|
40
|
+
Header: Header,
|
|
41
|
+
Body: Body,
|
|
61
42
|
});
|
|
43
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/Dialog/sc/framer.js
CHANGED
|
@@ -3,14 +3,14 @@ import { extendComponent } from "../../helpers";
|
|
|
3
3
|
import { dialogBackdropMotion, dialogPaperMotion } from "../m/basic";
|
|
4
4
|
import { KoineDialog as _ } from "../m/bare";
|
|
5
5
|
import { Root, Backdrop, Container, Paper, Close, Header, Body } from "./bare";
|
|
6
|
-
export
|
|
7
|
-
Root,
|
|
6
|
+
export var KoineDialog = extendComponent(_, {
|
|
7
|
+
Root: Root,
|
|
8
8
|
Backdrop: m(Backdrop),
|
|
9
|
-
Container,
|
|
9
|
+
Container: Container,
|
|
10
10
|
Paper: m(Paper),
|
|
11
|
-
Close,
|
|
12
|
-
Header,
|
|
13
|
-
Body,
|
|
11
|
+
Close: Close,
|
|
12
|
+
Header: Header,
|
|
13
|
+
Body: Body,
|
|
14
14
|
mBackdrop: dialogBackdropMotion,
|
|
15
15
|
mPaper: dialogPaperMotion,
|
|
16
16
|
});
|
|
@@ -3,14 +3,14 @@ import { extendComponent } from "../../helpers";
|
|
|
3
3
|
import { dialogBackdropMotion, dialogPaperMotion } from "../m/basic";
|
|
4
4
|
import { KoineDialog as _ } from "../m/bare";
|
|
5
5
|
import { Root, Backdrop, Container, Paper, Close, Header, Body, } from "./material";
|
|
6
|
-
export
|
|
7
|
-
Root,
|
|
6
|
+
export var KoineDialog = extendComponent(_, {
|
|
7
|
+
Root: Root,
|
|
8
8
|
Backdrop: m(Backdrop),
|
|
9
|
-
Container,
|
|
9
|
+
Container: Container,
|
|
10
10
|
Paper: m(Paper),
|
|
11
|
-
Close,
|
|
12
|
-
Header,
|
|
13
|
-
Body,
|
|
11
|
+
Close: Close,
|
|
12
|
+
Header: Header,
|
|
13
|
+
Body: Body,
|
|
14
14
|
mBackdrop: dialogBackdropMotion,
|
|
15
15
|
mPaper: dialogPaperMotion,
|
|
16
16
|
});
|
package/Dialog/sc/material.js
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import styled from "styled-components";
|
|
2
3
|
import { extendComponent } from "../../helpers";
|
|
3
4
|
import { KoineDialog as _ } from "./bare";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
top: 0;
|
|
20
|
-
right: 0;
|
|
21
|
-
padding: 8px;
|
|
22
|
-
font-size: 2rem;
|
|
23
|
-
opacity: 0.5;
|
|
24
|
-
`;
|
|
25
|
-
export const Header = styled(_.Header) `
|
|
26
|
-
padding: 16px;
|
|
27
|
-
font-size: 1.25rem;
|
|
28
|
-
`;
|
|
29
|
-
export const Body = styled(_.Body) `
|
|
30
|
-
padding: 16px;
|
|
31
|
-
border-top: 1px solid rgba(0, 0, 0, 0.08);
|
|
32
|
-
`;
|
|
33
|
-
export const KoineDialog = extendComponent(_, {
|
|
34
|
-
Root,
|
|
35
|
-
Backdrop,
|
|
36
|
-
Container,
|
|
37
|
-
Paper,
|
|
38
|
-
Close,
|
|
39
|
-
Header,
|
|
40
|
-
Body,
|
|
5
|
+
export var Root = styled(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
6
|
+
export var Backdrop = styled(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: rgba(0, 0, 0, 0.5);\n filter: backdrop-blur(4px);\n"], ["\n background: rgba(0, 0, 0, 0.5);\n filter: backdrop-blur(4px);\n"])));
|
|
7
|
+
export var Container = styled(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
|
|
8
|
+
export var Paper = styled(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n max-width: 640px;\n margin: 64px;\n border-radius: 4px;\n background: white;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);\n"], ["\n max-width: 640px;\n margin: 64px;\n border-radius: 4px;\n background: white;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);\n"])));
|
|
9
|
+
export var Close = styled(_.Close)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n padding: 8px;\n font-size: 2rem;\n opacity: 0.5;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n padding: 8px;\n font-size: 2rem;\n opacity: 0.5;\n"])));
|
|
10
|
+
export var Header = styled(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: 16px;\n font-size: 1.25rem;\n"], ["\n padding: 16px;\n font-size: 1.25rem;\n"])));
|
|
11
|
+
export var Body = styled(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding: 16px;\n border-top: 1px solid rgba(0, 0, 0, 0.08);\n"], ["\n padding: 16px;\n border-top: 1px solid rgba(0, 0, 0, 0.08);\n"])));
|
|
12
|
+
export var KoineDialog = extendComponent(_, {
|
|
13
|
+
Root: Root,
|
|
14
|
+
Backdrop: Backdrop,
|
|
15
|
+
Container: Container,
|
|
16
|
+
Paper: Paper,
|
|
17
|
+
Close: Close,
|
|
18
|
+
Header: Header,
|
|
19
|
+
Body: Body,
|
|
41
20
|
});
|
|
21
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/Dialog/tw/bare.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import { classed, extendComponent } from "../../helpers";
|
|
2
3
|
import * as _ from "../DialogMui";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
4
|
+
export var Root = classed(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["< class=\"dialog fixed z-[1300] inset-0"], ["< class=\"dialog fixed z-[1300] inset-0"])));
|
|
5
|
+
export var Backdrop = classed(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["< class=\"dialogBackdrop fixed -z-[1] inset-0 [-webkit-tap-highlight-color:transparent]"], ["< class=\"dialogBackdrop fixed -z-[1] inset-0 [-webkit-tap-highlight-color:transparent]"])));
|
|
5
6
|
/**
|
|
6
7
|
* @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Dialog/Dialog.js#L64-L85
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export var Container = classed(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["< class=\"dialogContainer h-full outline-0 ", ""], ["< class=\"dialogContainer h-full outline-0 ", ""])), function (p) {
|
|
10
|
+
return p.$scrollPaper
|
|
11
|
+
? "flex justify-center items-center"
|
|
12
|
+
: "overflow-y-auto overflow-x-hidden text-center [after:content:''] after:inline-block after:align-middle after:h-full after:w-0";
|
|
13
|
+
});
|
|
11
14
|
/**
|
|
12
15
|
* @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Dialog/Dialog.js#L104-L157
|
|
13
16
|
*/
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
export var Paper = classed(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["< class=\"dialogPaper relative ", ""], ["< class=\"dialogPaper relative ", ""])), function (p) {
|
|
18
|
+
return p.$scrollPaper
|
|
19
|
+
? "flex flex-col max-h-[calc(100%-64px)]"
|
|
20
|
+
: "inline-block align-middle [text-align:initial]";
|
|
21
|
+
});
|
|
22
|
+
export var Close = classed(_.Close)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["< class=\"dialogClose"], ["< class=\"dialogClose"])));
|
|
23
|
+
export var Header = classed(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["< class=\"dialogHeader"], ["< class=\"dialogHeader"])));
|
|
19
24
|
/**
|
|
20
25
|
* @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/DialogContent/DialogContent.js#L29-L44
|
|
21
26
|
* The arbitrary rule webkit-overflow-scrolling is to add iOS momentum scrolling for iOS < 13.0,
|
|
@@ -24,13 +29,14 @@ export const Header = classed(_.Header) `< class="dialogHeader`;
|
|
|
24
29
|
* @see https://github.com/tailwindlabs/tailwindcss.com/issues/483
|
|
25
30
|
* @see https://v2.tailwindcss.com/docs/upgrading-to-v2#the-scrolling-touch-and-scrolling-auto-utilities-have-been-removed
|
|
26
31
|
*/
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
Root,
|
|
30
|
-
Backdrop,
|
|
31
|
-
Container,
|
|
32
|
-
Paper,
|
|
33
|
-
Close,
|
|
34
|
-
Header,
|
|
35
|
-
Body,
|
|
32
|
+
export var Body = classed(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["< class=\"dialogBody flex-1 basis-auto overflow-y-auto [-webkit-overflow-scrolling:touch]"], ["< class=\"dialogBody flex-1 basis-auto overflow-y-auto [-webkit-overflow-scrolling:touch]"])));
|
|
33
|
+
export var KoineDialog = extendComponent(_.KoineDialog, {
|
|
34
|
+
Root: Root,
|
|
35
|
+
Backdrop: Backdrop,
|
|
36
|
+
Container: Container,
|
|
37
|
+
Paper: Paper,
|
|
38
|
+
Close: Close,
|
|
39
|
+
Header: Header,
|
|
40
|
+
Body: Body,
|
|
36
41
|
});
|
|
42
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/Dialog/tw/elegant.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import { classed, extendComponent } from "../../helpers";
|
|
2
3
|
import { KoineDialog as _ } from "./bare";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
Root,
|
|
12
|
-
Backdrop,
|
|
13
|
-
Container,
|
|
14
|
-
Paper,
|
|
15
|
-
Close,
|
|
16
|
-
Header,
|
|
17
|
-
Body,
|
|
4
|
+
export var Root = classed(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
5
|
+
export var Backdrop = classed(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["< class=\"bg-white/[.5] backdrop-blur-sm"], ["< class=\"bg-white/[.5] backdrop-blur-sm"])));
|
|
6
|
+
export var Container = classed(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
|
|
7
|
+
export var Paper = classed(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["< class=\"bg-white shadow-xl m-8 max-w-screen-sm border border-gray-400"], ["< class=\"bg-white shadow-xl m-8 max-w-screen-sm border border-gray-400"])));
|
|
8
|
+
export var Close = classed(_.Close)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["< class=\"absolute top-0 right-0 p-8 text-2xl opacity-20 hover:opacity-100 focus:opacity-100"], ["< class=\"absolute top-0 right-0 p-8 text-2xl opacity-20 hover:opacity-100 focus:opacity-100"])));
|
|
9
|
+
export var Header = classed(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["< class=\"p-8 text-2xl bold italic"], ["< class=\"p-8 text-2xl bold italic"])));
|
|
10
|
+
export var Body = classed(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["< class=\"p-8 pt-4"], ["< class=\"p-8 pt-4"])));
|
|
11
|
+
export var KoineDialog = extendComponent(_, {
|
|
12
|
+
Root: Root,
|
|
13
|
+
Backdrop: Backdrop,
|
|
14
|
+
Container: Container,
|
|
15
|
+
Paper: Paper,
|
|
16
|
+
Close: Close,
|
|
17
|
+
Header: Header,
|
|
18
|
+
Body: Body,
|
|
18
19
|
});
|
|
20
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/Dialog/tw/framer.js
CHANGED
|
@@ -3,14 +3,14 @@ import { extendComponent } from "../../helpers";
|
|
|
3
3
|
import { dialogBackdropMotion, dialogPaperMotion } from "../m/basic";
|
|
4
4
|
import { KoineDialog as _ } from "../m/bare";
|
|
5
5
|
import { Root, Backdrop, Container, Paper, Close, Header, Body } from "./bare";
|
|
6
|
-
export
|
|
7
|
-
Root,
|
|
6
|
+
export var KoineDialog = extendComponent(_, {
|
|
7
|
+
Root: Root,
|
|
8
8
|
Backdrop: m(Backdrop),
|
|
9
|
-
Container,
|
|
9
|
+
Container: Container,
|
|
10
10
|
Paper: m(Paper),
|
|
11
|
-
Close,
|
|
12
|
-
Header,
|
|
13
|
-
Body,
|
|
11
|
+
Close: Close,
|
|
12
|
+
Header: Header,
|
|
13
|
+
Body: Body,
|
|
14
14
|
mBackdrop: dialogBackdropMotion,
|
|
15
15
|
mPaper: dialogPaperMotion,
|
|
16
16
|
});
|
|
@@ -3,14 +3,14 @@ import { extendComponent } from "../../helpers";
|
|
|
3
3
|
import { dialogBackdropMotion, dialogPaperMotion } from "../m/basic";
|
|
4
4
|
import { KoineDialog as _ } from "../m/bare";
|
|
5
5
|
import { Root, Backdrop, Container, Paper, Close, Header, Body, } from "./material";
|
|
6
|
-
export
|
|
7
|
-
Root,
|
|
6
|
+
export var KoineDialog = extendComponent(_, {
|
|
7
|
+
Root: Root,
|
|
8
8
|
Backdrop: m(Backdrop),
|
|
9
|
-
Container,
|
|
9
|
+
Container: Container,
|
|
10
10
|
Paper: m(Paper),
|
|
11
|
-
Close,
|
|
12
|
-
Header,
|
|
13
|
-
Body,
|
|
11
|
+
Close: Close,
|
|
12
|
+
Header: Header,
|
|
13
|
+
Body: Body,
|
|
14
14
|
mBackdrop: dialogBackdropMotion,
|
|
15
15
|
mPaper: dialogPaperMotion,
|
|
16
16
|
});
|
package/Dialog/tw/material.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import { classed, extendComponent } from "../../helpers";
|
|
2
3
|
import { KoineDialog as _ } from "./bare";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
Root,
|
|
12
|
-
Backdrop,
|
|
13
|
-
Container,
|
|
14
|
-
Paper,
|
|
15
|
-
Close,
|
|
16
|
-
Header,
|
|
17
|
-
Body,
|
|
4
|
+
export var Root = classed(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
5
|
+
export var Backdrop = classed(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["< class=\"bg-black/[.5] backdrop-blur-sm"], ["< class=\"bg-black/[.5] backdrop-blur-sm"])));
|
|
6
|
+
export var Container = classed(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
|
|
7
|
+
export var Paper = classed(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["< class=\"rounded bg-white shadow-xl m-8 max-w-screen-sm"], ["< class=\"rounded bg-white shadow-xl m-8 max-w-screen-sm"])));
|
|
8
|
+
export var Close = classed(_.Close)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["< class=\"absolute top-0 right-0 p-4 text-2xl opacity-50"], ["< class=\"absolute top-0 right-0 p-4 text-2xl opacity-50"])));
|
|
9
|
+
export var Header = classed(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["< class=\"p-4 text-xl"], ["< class=\"p-4 text-xl"])));
|
|
10
|
+
export var Body = classed(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["< class=\"p-4 border-t border-gray-200"], ["< class=\"p-4 border-t border-gray-200"])));
|
|
11
|
+
export var KoineDialog = extendComponent(_, {
|
|
12
|
+
Root: Root,
|
|
13
|
+
Backdrop: Backdrop,
|
|
14
|
+
Container: Container,
|
|
15
|
+
Paper: Paper,
|
|
16
|
+
Close: Close,
|
|
17
|
+
Header: Header,
|
|
18
|
+
Body: Body,
|
|
18
19
|
});
|
|
20
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/Editor/Editor--tiptap.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useCallback } from "react";
|
|
3
4
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
4
5
|
import StarterKit from "@tiptap/starter-kit";
|
|
5
6
|
import { EditorGlobalStyles, EditorRoot, EditorBarRoot, EditorBarBtn, EditorIconBold, EditorIconItalic, } from "./components";
|
|
6
|
-
export
|
|
7
|
-
|
|
7
|
+
export var EditorBar = function (_a) {
|
|
8
|
+
var editor = _a.editor;
|
|
9
|
+
var handleClick = useCallback(function (e, type) {
|
|
8
10
|
e.preventDefault();
|
|
9
|
-
editor
|
|
11
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().focus()["toggle".concat(type)]().run();
|
|
10
12
|
}, [editor]);
|
|
11
13
|
if (!editor) {
|
|
12
14
|
return null;
|
|
13
15
|
}
|
|
14
|
-
return (_jsxs(EditorBarRoot, { children: [_jsx(EditorBarBtn,
|
|
16
|
+
return (_jsxs(EditorBarRoot, { children: [_jsx(EditorBarBtn, __assign({ onClick: function (e) {
|
|
17
|
+
return handleClick(e, "Bold");
|
|
18
|
+
}, className: editor.isActive("bold") ? "is-active" : "" }, { children: _jsx(EditorIconBold, {}) })), _jsx(EditorBarBtn, __assign({ onClick: function (e) {
|
|
19
|
+
return handleClick(e, "Italic");
|
|
20
|
+
}, className: editor.isActive("bold") ? "is-active" : "" }, { children: _jsx(EditorIconItalic, {}) }))] }));
|
|
15
21
|
};
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...(options || {}),
|
|
21
|
-
});
|
|
22
|
-
return (_jsxs(EditorRoot, { children: [_jsx(EditorGlobalStyles, {}), _jsx(EditorBar, { editor: editor }), _jsx(EditorContent, { className: "EditorContent", editor: editor, ...props })] }));
|
|
22
|
+
export var Editor = function (_a) {
|
|
23
|
+
var options = _a.options, props = __rest(_a, ["options"]);
|
|
24
|
+
var editor = useEditor(__assign({ extensions: [StarterKit], content: "" }, (options || {})));
|
|
25
|
+
return (_jsxs(EditorRoot, { children: [_jsx(EditorGlobalStyles, {}), _jsx(EditorBar, { editor: editor }), _jsx(EditorContent, __assign({ className: "EditorContent", editor: editor }, props))] }));
|
|
23
26
|
};
|