@koine/react 1.0.11 → 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 +12 -26
- package/Collapsable/Collapsable.js +1 -1
- package/Debug/Debug.js +5 -17
- package/Details/Details.js +30 -27
- 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.js +30 -28
- package/Form/sc/bare.js +9 -18
- 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 +19 -67
- package/Forms/Toggle/useToggle.js +29 -29
- package/Forms/antispam.js +12 -12
- package/Forms/helpers.js +7 -6
- 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 +24 -44
- 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.js +19 -16
- package/Tabs/tw/bare.js +13 -11
- package/Tabs/tw/material.js +15 -11
- package/Tabs/useTabs.js +16 -16
- package/Typography/CopyPasteVisible.js +3 -5
- package/Typography/Native.js +12 -45
- package/Typography/ReadMore.js +25 -51
- package/Typography/TextLoop.js +19 -22
- package/Typography/TypeStairs.js +20 -16
- package/helpers/classed.js +21 -18
- package/helpers/extend-component.js +6 -6
- package/hooks/useAsyncFn.js +18 -11
- package/hooks/useDateLocale.js +22 -13
- package/hooks/useEffectOnce.js +1 -1
- package/hooks/useFirstMountState.js +1 -1
- package/hooks/useFocus.js +3 -3
- package/hooks/useId.js +3 -2
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useMount.js +2 -2
- package/hooks/useMountedState.js +4 -4
- package/hooks/usePrevious.js +2 -2
- package/hooks/useScrollPosition.js +20 -15
- package/hooks/useScrollTo.js +7 -5
- package/hooks/useTraceUpdate.js +4 -3
- package/hooks/useUpdateEffect.js +3 -3
- 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 -32
- package/node/Carousel/index.js +1 -1
- package/node/Collapsable/index.js +1 -1
- package/node/Debug/Debug.js +7 -20
- package/node/Debug/index.js +1 -1
- package/node/Details/Details.js +24 -22
- package/node/Details/index.js +1 -1
- 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 +20 -18
- package/node/Form/index.js +1 -1
- package/node/Form/sc/bare.js +12 -22
- 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 +23 -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 +8 -7
- package/node/Forms/index.js +1 -1
- 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 -49
- 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 +16 -14
- package/node/Tabs/index.js +1 -1
- package/node/Tabs/tw/bare.js +9 -8
- package/node/Tabs/tw/material.js +11 -7
- package/node/Tabs/useTabs.js +19 -19
- 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 +1 -1
- package/node/helpers/classed.js +22 -19
- package/node/helpers/extend-component.js +7 -7
- package/node/helpers/index.js +1 -1
- package/node/hooks/index.js +1 -1
- package/node/hooks/useAsyncFn.js +20 -13
- package/node/hooks/useDateLocale.js +23 -37
- package/node/hooks/useEffectOnce.js +2 -2
- package/node/hooks/useFirstMountState.js +2 -2
- package/node/hooks/useFocus.js +4 -4
- package/node/hooks/useId.js +4 -3
- package/node/hooks/useIsomorphicLayoutEffect.js +2 -2
- package/node/hooks/useMount.js +3 -3
- package/node/hooks/useMountedState.js +5 -5
- package/node/hooks/usePrevious.js +3 -3
- package/node/hooks/useScrollPosition.js +23 -18
- package/node/hooks/useScrollTo.js +9 -7
- package/node/hooks/useTraceUpdate.js +5 -4
- package/node/hooks/useUpdateEffect.js +5 -5
- 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 +1 -1
- package/node/scm/index.js +1 -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 +1 -1
- package/node/twm/index.js +1 -1
- package/package.json +3 -2
- 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 +20 -18
- package/styles/theme.js +11 -11
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
|
};
|
package/Editor/components.js
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import styled, { createGlobalStyle } from "styled-components";
|
|
2
3
|
import { IconButton } from "../Buttons/IconButton";
|
|
3
4
|
import { inputPadding, inputBorder, inputFocus } from "../Forms/styles";
|
|
4
5
|
export { MdFormatBold as EditorIconBold, MdFormatItalic as EditorIconItalic, } from "react-icons/md";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: flex-end;
|
|
12
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
13
|
-
/* background: var(--grey900); */
|
|
14
|
-
`;
|
|
15
|
-
export const EditorBarBtn = styled(IconButton) ``;
|
|
16
|
-
export const EditorGlobalStyles = createGlobalStyle `
|
|
17
|
-
.ProseMirror {
|
|
18
|
-
${inputPadding}
|
|
19
|
-
|
|
20
|
-
&:focus {
|
|
21
|
-
outline:none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
> *:first-child {
|
|
25
|
-
margin-top: 0;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
6
|
+
export var EditorRoot = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), inputBorder, inputFocus);
|
|
7
|
+
export var EditorBarRoot = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n /* background: var(--grey900); */\n"], ["\n display: flex;\n justify-content: flex-end;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n /* background: var(--grey900); */\n"])));
|
|
8
|
+
export var EditorBarBtn = styled(IconButton)(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
|
|
9
|
+
export var EditorGlobalStyles = createGlobalStyle(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n .ProseMirror {\n ", "\n \n &:focus {\n outline:none;\n }\n\n > *:first-child {\n margin-top: 0;\n }\n }\n"], ["\n .ProseMirror {\n ", "\n \n &:focus {\n outline:none;\n }\n\n > *:first-child {\n margin-top: 0;\n }\n }\n"])), inputPadding);
|
|
10
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
package/Favicon/FaviconTags.js
CHANGED
|
@@ -9,6 +9,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
9
9
|
*
|
|
10
10
|
* @see https://realfavicongenerator.net/
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export var FaviconTags = function (_a) {
|
|
13
|
+
var name = _a.name, color = _a.color, safariTabColor = _a.safariTabColor, tileColor = _a.tileColor, themeColor = _a.themeColor;
|
|
13
14
|
return (_jsxs(_Fragment, { children: [_jsx("link", { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" }), _jsx("link", { rel: "icon", type: "image/png", sizes: "32x32", href: "/favicon-32x32.png" }), _jsx("link", { rel: "icon", type: "image/png", sizes: "16x16", href: "/favicon-16x16.png" }), _jsx("link", { rel: "manifest", href: "/site.webmanifest" }), _jsx("link", { rel: "mask-icon", href: "/safari-pinned-tab.svg", color: safariTabColor || color }), _jsx("meta", { name: "apple-mobile-web-app-title", content: name }), _jsx("meta", { name: "application-name", content: name }), _jsx("meta", { name: "msapplication-TileColor", content: tileColor || color }), _jsx("meta", { name: "theme-color", content: themeColor || color })] }));
|
|
14
15
|
};
|
package/Form/Form.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
1
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect, useState } from "react";
|
|
3
4
|
// import { type MotionProps } from "framer-motion";
|
|
4
5
|
import { extendComponent, } from "../helpers";
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
export var Root = "form";
|
|
7
|
+
export var Overlay = "div";
|
|
8
|
+
export var Progress = "div";
|
|
9
|
+
export var Collapsable = "div";
|
|
10
|
+
export var Ok = null;
|
|
11
|
+
export var Fail = null;
|
|
12
|
+
export var Form = function (_a) {
|
|
13
|
+
var _Root = _a.Root, _Overlay = _a.Overlay, _Progress = _a.Progress, _Collapsable = _a.Collapsable, ok = _a.ok, fail = _a.fail, loading = _a.loading, _Ok = _a.Ok, _b = _a.okProps, okProps = _b === void 0 ? {
|
|
14
|
+
children: "Sent!",
|
|
15
|
+
} : _b, _Fail = _a.Fail, _c = _a.failProps, failProps = _c === void 0 ? {
|
|
16
|
+
children: "Failed.",
|
|
17
|
+
} : _c, collapseOnOk = _a.collapseOnOk, collapseOnFail = _a.collapseOnFail, _d = _a.okTimeout, okTimeout = _d === void 0 ? 3000 : _d, _e = _a.failTimeout, failTimeout = _e === void 0 ? 3000 : _e, children = _a.children, props = __rest(_a, ["Root", "Overlay", "Progress", "Collapsable", "ok", "fail", "loading", "Ok", "okProps", "Fail", "failProps", "collapseOnOk", "collapseOnFail", "okTimeout", "failTimeout", "children"]);
|
|
18
|
+
var _f = useState(""), open = _f[0], setOpen = _f[1];
|
|
19
|
+
var commonProps = {
|
|
18
20
|
head: null,
|
|
19
21
|
components: {
|
|
20
22
|
HeadIcon: null,
|
|
21
23
|
},
|
|
22
24
|
};
|
|
23
|
-
useEffect(()
|
|
25
|
+
useEffect(function () {
|
|
24
26
|
if (!loading) {
|
|
25
27
|
if (ok)
|
|
26
28
|
setOpen("ok");
|
|
@@ -28,32 +30,32 @@ export const Form = ({ Root: _Root, Overlay: _Overlay, Progress: _Progress, Coll
|
|
|
28
30
|
setOpen("fail");
|
|
29
31
|
}
|
|
30
32
|
}, [ok, fail, loading]);
|
|
31
|
-
useEffect(()
|
|
32
|
-
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
var timeout;
|
|
33
35
|
if (open === "fail" && failTimeout) {
|
|
34
|
-
timeout = setTimeout(()
|
|
36
|
+
timeout = setTimeout(function () { return setOpen(""); }, failTimeout);
|
|
35
37
|
}
|
|
36
38
|
else if (open === "ok" && okTimeout) {
|
|
37
|
-
timeout = setTimeout(()
|
|
39
|
+
timeout = setTimeout(function () { return setOpen(""); }, okTimeout);
|
|
38
40
|
}
|
|
39
|
-
return ()
|
|
41
|
+
return function () {
|
|
40
42
|
if (timeout) {
|
|
41
43
|
clearTimeout(timeout);
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
46
|
}, [open, failTimeout, okTimeout]);
|
|
45
|
-
|
|
47
|
+
var formExpanded = true;
|
|
46
48
|
if (collapseOnFail && fail)
|
|
47
49
|
formExpanded = false;
|
|
48
50
|
if (collapseOnOk && ok)
|
|
49
51
|
formExpanded = false;
|
|
50
|
-
return (_jsxs(Root, { method: "post", noValidate: true,
|
|
52
|
+
return (_jsxs(Root, __assign({ method: "post", noValidate: true }, props, { children: [_jsx(Collapsable, __assign({}, commonProps, { "$open": formExpanded, recalc: loading, body: _jsxs(_Fragment, { children: [children, loading && (_jsx(Overlay, { children: _jsx(Progress, {}) }))] }) })), _jsx(Collapsable, __assign({}, commonProps, { "$open": open === "ok" && !loading, body: _jsx(Ok, __assign({}, okProps)) })), _jsx(Collapsable, __assign({}, commonProps, { "$open": open === "fail" && !loading, body: _jsx(Fail, __assign({}, failProps)) }))] })));
|
|
51
53
|
};
|
|
52
|
-
export
|
|
53
|
-
Root,
|
|
54
|
-
Overlay,
|
|
55
|
-
Progress,
|
|
56
|
-
Collapsable,
|
|
57
|
-
Ok,
|
|
58
|
-
Fail,
|
|
54
|
+
export var KoineForm = extendComponent(Form, {
|
|
55
|
+
Root: Root,
|
|
56
|
+
Overlay: Overlay,
|
|
57
|
+
Progress: Progress,
|
|
58
|
+
Collapsable: Collapsable,
|
|
59
|
+
Ok: Ok,
|
|
60
|
+
Fail: Fail,
|
|
59
61
|
});
|
package/Form/sc/bare.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
1
2
|
import styled from "styled-components";
|
|
2
3
|
import { overlay, centered } from "../../styles/styled";
|
|
3
4
|
import { Collapsable } from "../../Collapsable";
|
|
@@ -5,25 +6,15 @@ import { ProgressCircular } from "../../Progress";
|
|
|
5
6
|
import { Alert } from "../../Alert";
|
|
6
7
|
import { extendComponent } from "../../helpers";
|
|
7
8
|
import * as _ from "../Form";
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${centered}
|
|
15
|
-
background: rgba(var(--bodyBg--rgb),.8);
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
backdrop-filter: blur(2px);
|
|
18
|
-
`;
|
|
19
|
-
export const Feedback = styled(Alert) `
|
|
20
|
-
padding: 2em 0;
|
|
21
|
-
`;
|
|
22
|
-
export const KoineForm = extendComponent(_.KoineForm, {
|
|
23
|
-
Root,
|
|
24
|
-
Overlay,
|
|
9
|
+
export var Root = styled(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
10
|
+
export var Overlay = styled(_.Overlay)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 4;\n ", "\n ", "\n background: rgba(var(--bodyBg--rgb),.8);\n pointer-events: none;\n backdrop-filter: blur(2px);\n"], ["\n z-index: 4;\n ", "\n ", "\n background: rgba(var(--bodyBg--rgb),.8);\n pointer-events: none;\n backdrop-filter: blur(2px);\n"])), overlay, centered);
|
|
11
|
+
export var Feedback = styled(Alert)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 2em 0;\n"], ["\n padding: 2em 0;\n"])));
|
|
12
|
+
export var KoineForm = extendComponent(_.KoineForm, {
|
|
13
|
+
Root: Root,
|
|
14
|
+
Overlay: Overlay,
|
|
25
15
|
Progress: ProgressCircular,
|
|
26
|
-
Collapsable,
|
|
16
|
+
Collapsable: Collapsable,
|
|
27
17
|
Ok: Feedback,
|
|
28
18
|
Fail: Feedback,
|
|
29
19
|
});
|
|
20
|
+
var templateObject_1, templateObject_2, templateObject_3;
|