@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { m } from "framer-motion";
|
|
2
3
|
import { MdKeyboardArrowRight as IconDelimiter } from "react-icons/md";
|
|
3
4
|
import styled, { css } from "styled-components";
|
|
@@ -58,21 +59,33 @@ export const KoineBreadcrumbs = ({ items = [], Link, ...props })=>{
|
|
|
58
59
|
if (!items.length) {
|
|
59
60
|
return null;
|
|
60
61
|
}
|
|
61
|
-
return /*#__PURE__*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
return /*#__PURE__*/ _jsx(Root, {
|
|
63
|
+
...props,
|
|
64
|
+
children: /*#__PURE__*/ _jsx(Inner, {
|
|
65
|
+
children: items.map((item, idx)=>/*#__PURE__*/ _jsxs(Item, {
|
|
66
|
+
initial: {
|
|
67
|
+
opacity: 0,
|
|
68
|
+
x: 20
|
|
69
|
+
},
|
|
70
|
+
animate: {
|
|
71
|
+
opacity: 1,
|
|
72
|
+
x: 0,
|
|
73
|
+
transition: {
|
|
74
|
+
delay: idx * 0.2
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
children: [
|
|
78
|
+
item.url && /*#__PURE__*/ _jsx(ItemLink, {
|
|
79
|
+
as: Link,
|
|
80
|
+
href: item.url,
|
|
81
|
+
children: titleCase(item.title)
|
|
82
|
+
}),
|
|
83
|
+
!item.url && /*#__PURE__*/ _jsx(ItemCurrent, {
|
|
84
|
+
children: titleCase(item.title)
|
|
85
|
+
}),
|
|
86
|
+
idx < items.length - 1 && /*#__PURE__*/ _jsx(ItemSeparator, {})
|
|
87
|
+
]
|
|
88
|
+
}, idx))
|
|
89
|
+
})
|
|
90
|
+
});
|
|
78
91
|
};
|
package/Buttons/Button.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const btnStyleReset: import("styled-components").FlattenSimpleInt
|
|
|
8
8
|
export declare const btnStyleBase: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<KoineButtonUiProps, import("styled-components").DefaultTheme>>;
|
|
9
9
|
export declare const btnStyleContained: import("styled-components").FlattenSimpleInterpolation;
|
|
10
10
|
export declare const btnStyleOutlined: import("styled-components").FlattenSimpleInterpolation;
|
|
11
|
-
export declare const KoineButton:
|
|
11
|
+
export declare const KoineButton: any;
|
|
12
12
|
export type KoineButtonUiProps = {
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
$variant?: "contained" | "outlined";
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "KoineButtonComposite", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
13
|
const _react = require("react");
|
|
13
14
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
14
15
|
const Root = _styledcomponents.default.span`
|
|
@@ -46,19 +47,40 @@ const Sub = _styledcomponents.default.span`
|
|
|
46
47
|
}
|
|
47
48
|
`;
|
|
48
49
|
const Text = _styledcomponents.default.span``;
|
|
49
|
-
const Inner = /*#__PURE__*/ (0, _react.memo)(({ textMain, textSub, text, $reverse, $icon })=>/*#__PURE__*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
const Inner = /*#__PURE__*/ (0, _react.memo)(({ textMain, textSub, text, $reverse, $icon })=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
51
|
+
children: [
|
|
52
|
+
$reverse ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
53
|
+
children: [
|
|
54
|
+
textSub && /*#__PURE__*/ (0, _jsxruntime.jsx)(Sub, {
|
|
55
|
+
$icon: $icon,
|
|
56
|
+
$reverse: $reverse,
|
|
57
|
+
children: textSub
|
|
58
|
+
}),
|
|
59
|
+
textMain && /*#__PURE__*/ (0, _jsxruntime.jsx)(Main, {
|
|
60
|
+
$icon: $icon,
|
|
61
|
+
$reverse: $reverse,
|
|
62
|
+
children: textMain
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
66
|
+
children: [
|
|
67
|
+
textMain && /*#__PURE__*/ (0, _jsxruntime.jsx)(Main, {
|
|
68
|
+
$icon: $icon,
|
|
69
|
+
$reverse: $reverse,
|
|
70
|
+
children: textMain
|
|
71
|
+
}),
|
|
72
|
+
textSub && /*#__PURE__*/ (0, _jsxruntime.jsx)(Sub, {
|
|
73
|
+
$icon: $icon,
|
|
74
|
+
$reverse: $reverse,
|
|
75
|
+
children: textSub
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}),
|
|
79
|
+
text && /*#__PURE__*/ (0, _jsxruntime.jsx)(Text, {
|
|
80
|
+
children: text
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}));
|
|
62
84
|
const KoineButtonComposite = ({ Icon, iconProps = {}, textMain, textSub, textReverse, text, Button = "button", ButtonLink = "a", ...props })=>{
|
|
63
85
|
const Btn = props.href ? ButtonLink : Button;
|
|
64
86
|
const styledProps = {
|
|
@@ -72,12 +94,23 @@ const KoineButtonComposite = ({ Icon, iconProps = {}, textMain, textSub, textRev
|
|
|
72
94
|
text,
|
|
73
95
|
...styledProps
|
|
74
96
|
};
|
|
75
|
-
return /*#__PURE__*/
|
|
97
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(Root, {
|
|
76
98
|
as: Btn,
|
|
77
99
|
...props,
|
|
78
|
-
...styledProps
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
...styledProps,
|
|
101
|
+
children: [
|
|
102
|
+
Icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(ButtonCompositeIcon, {
|
|
103
|
+
as: Icon,
|
|
104
|
+
...iconProps
|
|
105
|
+
}),
|
|
106
|
+
Icon ? /*#__PURE__*/ (0, _jsxruntime.jsx)(BesidesIcon, {
|
|
107
|
+
...styledProps,
|
|
108
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Inner, {
|
|
109
|
+
...innerProps
|
|
110
|
+
})
|
|
111
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(Inner, {
|
|
112
|
+
...innerProps
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
});
|
|
83
116
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { memo } from "react";
|
|
2
3
|
import styled from "styled-components";
|
|
3
4
|
const Root = styled.span`
|
|
@@ -35,19 +36,40 @@ const Sub = styled.span`
|
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
37
38
|
const Text = styled.span``;
|
|
38
|
-
const Inner = /*#__PURE__*/ memo(({ textMain, textSub, text, $reverse, $icon })=>/*#__PURE__*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
const Inner = /*#__PURE__*/ memo(({ textMain, textSub, text, $reverse, $icon })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
40
|
+
children: [
|
|
41
|
+
$reverse ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
42
|
+
children: [
|
|
43
|
+
textSub && /*#__PURE__*/ _jsx(Sub, {
|
|
44
|
+
$icon: $icon,
|
|
45
|
+
$reverse: $reverse,
|
|
46
|
+
children: textSub
|
|
47
|
+
}),
|
|
48
|
+
textMain && /*#__PURE__*/ _jsx(Main, {
|
|
49
|
+
$icon: $icon,
|
|
50
|
+
$reverse: $reverse,
|
|
51
|
+
children: textMain
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
55
|
+
children: [
|
|
56
|
+
textMain && /*#__PURE__*/ _jsx(Main, {
|
|
57
|
+
$icon: $icon,
|
|
58
|
+
$reverse: $reverse,
|
|
59
|
+
children: textMain
|
|
60
|
+
}),
|
|
61
|
+
textSub && /*#__PURE__*/ _jsx(Sub, {
|
|
62
|
+
$icon: $icon,
|
|
63
|
+
$reverse: $reverse,
|
|
64
|
+
children: textSub
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
text && /*#__PURE__*/ _jsx(Text, {
|
|
69
|
+
children: text
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}));
|
|
51
73
|
export const KoineButtonComposite = ({ Icon, iconProps = {}, textMain, textSub, textReverse, text, Button = "button", ButtonLink = "a", ...props })=>{
|
|
52
74
|
const Btn = props.href ? ButtonLink : Button;
|
|
53
75
|
const styledProps = {
|
|
@@ -61,12 +83,23 @@ export const KoineButtonComposite = ({ Icon, iconProps = {}, textMain, textSub,
|
|
|
61
83
|
text,
|
|
62
84
|
...styledProps
|
|
63
85
|
};
|
|
64
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/ _jsxs(Root, {
|
|
65
87
|
as: Btn,
|
|
66
88
|
...props,
|
|
67
|
-
...styledProps
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
89
|
+
...styledProps,
|
|
90
|
+
children: [
|
|
91
|
+
Icon && /*#__PURE__*/ _jsx(ButtonCompositeIcon, {
|
|
92
|
+
as: Icon,
|
|
93
|
+
...iconProps
|
|
94
|
+
}),
|
|
95
|
+
Icon ? /*#__PURE__*/ _jsx(BesidesIcon, {
|
|
96
|
+
...styledProps,
|
|
97
|
+
children: /*#__PURE__*/ _jsx(Inner, {
|
|
98
|
+
...innerProps
|
|
99
|
+
})
|
|
100
|
+
}) : /*#__PURE__*/ _jsx(Inner, {
|
|
101
|
+
...innerProps
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
72
105
|
};
|
package/Buttons/ButtonFab.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconButtonProps } from "./IconButton";
|
|
3
3
|
export declare const buttonFab: import("styled-components").FlattenSimpleInterpolation;
|
|
4
|
-
export declare const IconButtonFab:
|
|
5
|
-
disabled?: boolean | undefined;
|
|
6
|
-
}, never>;
|
|
4
|
+
export declare const IconButtonFab: any;
|
|
7
5
|
export type IconButtonFabProps = IconButtonProps & React.ComponentPropsWithRef<"button">;
|
package/Buttons/ButtonLink.js
CHANGED
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "KoineButtonLink", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
13
|
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
14
|
const _Button = require("./Button");
|
|
14
15
|
const Root = (0, _styledcomponents.default)(_Button.KoineButton)`
|
|
@@ -16,11 +17,11 @@ const Root = (0, _styledcomponents.default)(_Button.KoineButton)`
|
|
|
16
17
|
`;
|
|
17
18
|
const KoineButtonLink = ({ href, Link = "a", ...props })=>{
|
|
18
19
|
const isRelative = href && href.startsWith("/");
|
|
19
|
-
return isRelative ? /*#__PURE__*/
|
|
20
|
+
return isRelative ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Root, {
|
|
20
21
|
href: href,
|
|
21
22
|
...props,
|
|
22
23
|
as: Link
|
|
23
|
-
}) : /*#__PURE__*/
|
|
24
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(Root, {
|
|
24
25
|
href: href,
|
|
25
26
|
...props,
|
|
26
27
|
as: "a"
|
package/Buttons/ButtonLink.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import styled from "styled-components";
|
|
2
3
|
import { KoineButton } from "./Button";
|
|
3
4
|
const Root = styled(KoineButton)`
|
|
@@ -5,11 +6,11 @@ const Root = styled(KoineButton)`
|
|
|
5
6
|
`;
|
|
6
7
|
export const KoineButtonLink = ({ href, Link = "a", ...props })=>{
|
|
7
8
|
const isRelative = href && href.startsWith("/");
|
|
8
|
-
return isRelative ? /*#__PURE__*/
|
|
9
|
+
return isRelative ? /*#__PURE__*/ _jsx(Root, {
|
|
9
10
|
href: href,
|
|
10
11
|
...props,
|
|
11
12
|
as: Link
|
|
12
|
-
}) : /*#__PURE__*/
|
|
13
|
+
}) : /*#__PURE__*/ _jsx(Root, {
|
|
13
14
|
href: href,
|
|
14
15
|
...props,
|
|
15
16
|
as: "a"
|
package/Buttons/IconButton.d.ts
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
import { KoineButtonUiProps } from "./Button";
|
|
3
3
|
export declare const iconBtnStyleReset: import("styled-components").FlattenSimpleInterpolation;
|
|
4
4
|
export declare const iconBtnStyleBase: import("styled-components").FlattenSimpleInterpolation;
|
|
5
|
-
export declare const IconButton:
|
|
6
|
-
disabled?: boolean | undefined;
|
|
7
|
-
}, never>;
|
|
5
|
+
export declare const IconButton: any;
|
|
8
6
|
export type IconButtonUiProps = KoineButtonUiProps & {
|
|
9
7
|
disabled?: boolean;
|
|
10
8
|
};
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "CalendarDaygridCell", {
|
|
|
8
8
|
return CalendarDaygridCell;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
11
12
|
const _react = require("react");
|
|
12
13
|
const _md = require("react-icons/md");
|
|
13
14
|
const _utils = require("./utils");
|
|
@@ -27,56 +28,78 @@ const CalendarDaygridCell = ({ eventClicked, setEventClicked, // eventHovered,
|
|
|
27
28
|
setEventHovered, view, maxEvents, events, calendarsMap, Cell = "div", CellOverflow = "div", CellEvent = "div", CellEventBtn = "div", CellEventTitle = "span", CellEventStart = "span" })=>{
|
|
28
29
|
const [isExpanded, expand] = (0, _react.useState)(false);
|
|
29
30
|
const eventsWithoutPlaceholders = events.filter((event)=>!event.placeholder);
|
|
30
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
31
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Cell, {
|
|
32
|
+
children: events.map((event, i)=>{
|
|
33
|
+
if (i === maxEvents && !isExpanded) {
|
|
34
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(CellOverflow, {
|
|
35
|
+
onClick: ()=>expand(true),
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_md.MdAdd, {}),
|
|
38
|
+
eventsWithoutPlaceholders.length - maxEvents
|
|
39
|
+
]
|
|
40
|
+
}, "overflowMessage" + i);
|
|
41
|
+
}
|
|
42
|
+
if (i > maxEvents && !isExpanded) return null;
|
|
43
|
+
if (event.placeholder) {
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Fragment, {
|
|
45
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(CellEvent, {
|
|
46
|
+
$placeholder: true,
|
|
47
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(CellEventBtn, {
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
style: {
|
|
50
|
+
visibility: "hidden"
|
|
51
|
+
},
|
|
52
|
+
$placeholder: true,
|
|
53
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(CellEventTitle, {
|
|
54
|
+
children: "\xa0"
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}, event.key);
|
|
59
|
+
}
|
|
60
|
+
const styleEvent = {
|
|
61
|
+
zIndex: event.firstOfMulti ? 1 : 0,
|
|
62
|
+
position: "relative",
|
|
63
|
+
width: event.firstOfMulti ? `${100 * event.width}%` : "100%"
|
|
64
|
+
};
|
|
65
|
+
if (!calendarsMap[event.calendar.id].on) {
|
|
66
|
+
// @ts-expect-error nevermind
|
|
67
|
+
styleBtn.display = "none";
|
|
68
|
+
}
|
|
69
|
+
const styledProps = {
|
|
70
|
+
$view: view,
|
|
71
|
+
$selected: eventClicked?.uid === event.uid,
|
|
72
|
+
$past: event.isPast,
|
|
73
|
+
$color: event.color,
|
|
74
|
+
$isOutOfRange: event.$isOutOfRange,
|
|
75
|
+
$isToday: event.$isToday
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_react.Fragment, {
|
|
78
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(CellEvent, {
|
|
79
|
+
style: styleEvent,
|
|
80
|
+
...styledProps,
|
|
81
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(CellEventBtn, {
|
|
82
|
+
role: "button",
|
|
83
|
+
style: styleBtn,
|
|
84
|
+
...styledProps,
|
|
85
|
+
onClick: ()=>setEventClicked((prev)=>prev?.uid === event.uid ? null : event),
|
|
86
|
+
onMouseEnter: ()=>setEventHovered(event),
|
|
87
|
+
onMouseLeave: ()=>setEventHovered(null),
|
|
88
|
+
children: event.allDay ? /*#__PURE__*/ (0, _jsxruntime.jsx)(CellEventTitle, {
|
|
89
|
+
children: event.title
|
|
90
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(CellEventStart, {
|
|
93
|
+
children: (0, _utils.getDisplayTime)(event.start)
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(CellEventTitle, {
|
|
96
|
+
children: event.title
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
}, event.key);
|
|
103
|
+
})
|
|
104
|
+
});
|
|
82
105
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { Fragment, useState } from "react";
|
|
2
3
|
import { MdAdd as IconExpand } from "react-icons/md";
|
|
3
4
|
import { getDisplayTime } from "./utils";
|
|
@@ -17,56 +18,78 @@ export const CalendarDaygridCell = ({ eventClicked, setEventClicked, // eventHov
|
|
|
17
18
|
setEventHovered, view, maxEvents, events, calendarsMap, Cell = "div", CellOverflow = "div", CellEvent = "div", CellEventBtn = "div", CellEventTitle = "span", CellEventStart = "span" })=>{
|
|
18
19
|
const [isExpanded, expand] = useState(false);
|
|
19
20
|
const eventsWithoutPlaceholders = events.filter((event)=>!event.placeholder);
|
|
20
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
71
|
-
|
|
21
|
+
return /*#__PURE__*/ _jsx(Cell, {
|
|
22
|
+
children: events.map((event, i)=>{
|
|
23
|
+
if (i === maxEvents && !isExpanded) {
|
|
24
|
+
return /*#__PURE__*/ _jsxs(CellOverflow, {
|
|
25
|
+
onClick: ()=>expand(true),
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ _jsx(IconExpand, {}),
|
|
28
|
+
eventsWithoutPlaceholders.length - maxEvents
|
|
29
|
+
]
|
|
30
|
+
}, "overflowMessage" + i);
|
|
31
|
+
}
|
|
32
|
+
if (i > maxEvents && !isExpanded) return null;
|
|
33
|
+
if (event.placeholder) {
|
|
34
|
+
return /*#__PURE__*/ _jsx(Fragment, {
|
|
35
|
+
children: /*#__PURE__*/ _jsx(CellEvent, {
|
|
36
|
+
$placeholder: true,
|
|
37
|
+
children: /*#__PURE__*/ _jsx(CellEventBtn, {
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
style: {
|
|
40
|
+
visibility: "hidden"
|
|
41
|
+
},
|
|
42
|
+
$placeholder: true,
|
|
43
|
+
children: /*#__PURE__*/ _jsx(CellEventTitle, {
|
|
44
|
+
children: "\xa0"
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}, event.key);
|
|
49
|
+
}
|
|
50
|
+
const styleEvent = {
|
|
51
|
+
zIndex: event.firstOfMulti ? 1 : 0,
|
|
52
|
+
position: "relative",
|
|
53
|
+
width: event.firstOfMulti ? `${100 * event.width}%` : "100%"
|
|
54
|
+
};
|
|
55
|
+
if (!calendarsMap[event.calendar.id].on) {
|
|
56
|
+
// @ts-expect-error nevermind
|
|
57
|
+
styleBtn.display = "none";
|
|
58
|
+
}
|
|
59
|
+
const styledProps = {
|
|
60
|
+
$view: view,
|
|
61
|
+
$selected: eventClicked?.uid === event.uid,
|
|
62
|
+
$past: event.isPast,
|
|
63
|
+
$color: event.color,
|
|
64
|
+
$isOutOfRange: event.$isOutOfRange,
|
|
65
|
+
$isToday: event.$isToday
|
|
66
|
+
};
|
|
67
|
+
return /*#__PURE__*/ _jsx(Fragment, {
|
|
68
|
+
children: /*#__PURE__*/ _jsx(CellEvent, {
|
|
69
|
+
style: styleEvent,
|
|
70
|
+
...styledProps,
|
|
71
|
+
children: /*#__PURE__*/ _jsx(CellEventBtn, {
|
|
72
|
+
role: "button",
|
|
73
|
+
style: styleBtn,
|
|
74
|
+
...styledProps,
|
|
75
|
+
onClick: ()=>setEventClicked((prev)=>prev?.uid === event.uid ? null : event),
|
|
76
|
+
onMouseEnter: ()=>setEventHovered(event),
|
|
77
|
+
onMouseLeave: ()=>setEventHovered(null),
|
|
78
|
+
children: event.allDay ? /*#__PURE__*/ _jsx(CellEventTitle, {
|
|
79
|
+
children: event.title
|
|
80
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
81
|
+
children: [
|
|
82
|
+
/*#__PURE__*/ _jsx(CellEventStart, {
|
|
83
|
+
children: getDisplayTime(event.start)
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx(CellEventTitle, {
|
|
86
|
+
children: event.title
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
}, event.key);
|
|
93
|
+
})
|
|
94
|
+
});
|
|
72
95
|
};
|