@koine/react 2.0.0-beta.10 → 2.0.0-beta.11
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/package.json +11 -11
- package/Alert/Alert.js +0 -33
- package/Alert/Alert.stories.js +0 -39
- package/Alert/index.js +0 -6
- package/Animations/Reveal.js +0 -53
- package/Animations/Underline.js +0 -26
- package/Animations/index.js +0 -8
- package/Animations/useReveal.js +0 -83
- package/Autocomplete/AutocompleteDownshift.js +0 -167
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -362
- package/Autocomplete/AutocompleteMui.js +0 -183
- package/Autocomplete/AutocompleteReach.js +0 -121
- package/Autocomplete/components.js +0 -132
- package/Autocomplete/helpers.js +0 -34
- package/Autocomplete/index.js +0 -15
- package/Bg/BgColor.js +0 -64
- package/Bg/BgPhoto.js +0 -82
- package/Bg/BgSvg.js +0 -31
- package/Bg/index.js +0 -8
- package/Breadcrumbs/Breadcrumbs.js +0 -103
- package/Breadcrumbs/index.js +0 -6
- package/Buttons/Button.js +0 -106
- package/Buttons/ButtonComposite.js +0 -116
- package/Buttons/ButtonFab.js +0 -27
- package/Buttons/ButtonLink.js +0 -29
- package/Buttons/IconButton.js +0 -41
- package/Buttons/index.js +0 -10
- package/Calendar/CalendarDaygridCell.js +0 -105
- package/Calendar/CalendarDaygridNav.js +0 -63
- package/Calendar/CalendarDaygridTable.js +0 -126
- package/Calendar/CalendarLegend.js +0 -39
- package/Calendar/calendar-api-google.js +0 -110
- package/Calendar/index.js +0 -11
- package/Calendar/types.js +0 -4
- package/Calendar/useCalendar.js +0 -235
- package/Calendar/utils.js +0 -252
- package/Carousel/Carousel.js +0 -387
- package/Carousel/CarouselCss.js +0 -64
- package/Carousel/index.js +0 -6
- package/Collapsable/Collapsable.js +0 -11
- package/Collapsable/CollapsableReach.js +0 -251
- package/Collapsable/index.js +0 -7
- package/Debug/Debug.js +0 -34
- package/Debug/index.js +0 -6
- package/Details/Details.js +0 -117
- package/Details/Details.stories.js +0 -39
- package/Details/index.js +0 -6
- package/Dialog/DialogMui.js +0 -143
- package/Dialog/DialogMui.stories.js +0 -38
- package/Dialog/css/bare.js +0 -55
- package/Dialog/css/index.stories.js +0 -93
- package/Dialog/index.js +0 -11
- package/Dialog/m/bare.js +0 -125
- package/Dialog/m/basic.js +0 -50
- package/Dialog/m/index.js +0 -14
- package/Dialog/sc/bare.js +0 -83
- package/Dialog/sc/framer.js +0 -26
- package/Dialog/sc/framerMaterial.js +0 -26
- package/Dialog/sc/index.stories.js +0 -75
- package/Dialog/sc/material.js +0 -78
- package/Dialog/tw/bare.js +0 -55
- package/Dialog/tw/elegant.js +0 -54
- package/Dialog/tw/framer.js +0 -26
- package/Dialog/tw/framerMaterial.js +0 -26
- package/Dialog/tw/index.stories.js +0 -113
- package/Dialog/tw/material.js +0 -54
- package/Editor/Editor--tiptap.js +0 -72
- package/Editor/components.js +0 -59
- package/Editor/index.js +0 -6
- package/FaviconTags.js +0 -73
- package/Form/Form.js +0 -130
- package/Form/index.js +0 -6
- package/Form/sc/bare.js +0 -55
- package/Forms/Checkbox/Checkbox.js +0 -62
- package/Forms/Checkbox/index.js +0 -6
- package/Forms/Feedback/Feedback.js +0 -25
- package/Forms/Feedback/index.js +0 -6
- package/Forms/Field/Field.js +0 -75
- package/Forms/Field/FieldControl.js +0 -69
- package/Forms/Field/FieldHint.js +0 -17
- package/Forms/Field/index.js +0 -7
- package/Forms/Input/Input.js +0 -67
- package/Forms/Input/index.js +0 -6
- package/Forms/InputGroup/InputGroup.js +0 -85
- package/Forms/InputGroup/index.js +0 -6
- package/Forms/Label/Label.js +0 -46
- package/Forms/Label/index.js +0 -6
- package/Forms/Password/Password.js +0 -72
- package/Forms/Password/index.js +0 -6
- package/Forms/Radio/Radio.js +0 -68
- package/Forms/Radio/index.js +0 -6
- package/Forms/Switch/Switch.js +0 -80
- package/Forms/Switch/index.js +0 -6
- package/Forms/Textarea/Textarea.js +0 -45
- package/Forms/Textarea/TextareaRich.js +0 -58
- package/Forms/Textarea/index.js +0 -7
- package/Forms/Toggle/Toggle-tailwind.js +0 -99
- package/Forms/Toggle/Toggle.js +0 -175
- package/Forms/Toggle/index.js +0 -6
- package/Forms/Toggle/useToggle-tailwind.js +0 -202
- package/Forms/Toggle/useToggle.js +0 -145
- package/Forms/antispam.js +0 -59
- package/Forms/helpers.js +0 -72
- package/Forms/index.js +0 -19
- package/Forms/styles.js +0 -94
- package/Gauge/Gauge.js +0 -111
- package/Grid/Grid.js +0 -106
- package/Grid/index.js +0 -6
- package/Hamburger/Hamburger.js +0 -90
- package/Hamburger/index.js +0 -6
- package/Header/index.js +0 -6
- package/Header/useHeader.js +0 -54
- package/Hidden/Hidden.js +0 -21
- package/Hidden/index.js +0 -6
- package/Img/index.js +0 -6
- package/Img/sc/bare.js +0 -43
- package/Img/types.js +0 -6
- package/Link/Link.js +0 -13
- package/Link/LinkBlank.js +0 -52
- package/Link/index.js +0 -7
- package/Menu/Menu.js +0 -22
- package/Menu/MenuMui.js +0 -165
- package/Menu/index.js +0 -6
- package/MenuItem/MenuItem.js +0 -31
- package/MenuItem/MenuItemMui.js +0 -32
- package/MenuItem/index.js +0 -6
- package/MenuItem/useMenuItem.js +0 -96
- package/Meta/Meta.js +0 -26
- package/Meta/index.js +0 -12
- package/NoJs/NoJs.js +0 -28
- package/NoJs/index.js +0 -12
- package/Pagination/PaginationNav.js +0 -126
- package/Pagination/PaginationResults.js +0 -45
- package/Pagination/index.js +0 -7
- package/Pill/Pill.js +0 -62
- package/Pill/index.js +0 -6
- package/Progress/ProgressCircular.js +0 -62
- package/Progress/ProgressLinear.js +0 -53
- package/Progress/ProgressOverlay.js +0 -75
- package/Progress/index.js +0 -8
- package/Rating/Rating.js +0 -188
- package/Rating/index.js +0 -85
- package/Select/SelectDownshift.js +0 -47
- package/Select/components.js +0 -44
- package/Select/index.js +0 -13
- package/Sidebar/Sidebar.js +0 -74
- package/Sidebar/index.js +0 -6
- package/Spacing/Spacing.js +0 -55
- package/Spacing/index.js +0 -6
- package/Sticky/Sticky.js +0 -228
- package/Sticky/StickyCss.js +0 -20
- package/Sticky/index.js +0 -19
- package/Tabs/TabsMui.js +0 -91
- package/Tabs/TabsMui.stories.js +0 -38
- package/Tabs/index.js +0 -6
- package/Tabs/sc/bare.js +0 -86
- package/Tabs/sc/index.stories.js +0 -1
- package/Tabs/tw/bare.js +0 -45
- package/Tabs/tw/index.stories.js +0 -46
- package/Tabs/tw/material.js +0 -44
- package/Tabs/useTabs.js +0 -66
- package/Typography/CopyPasteVisible.js +0 -17
- package/Typography/Native.js +0 -90
- package/Typography/ReadMore.js +0 -125
- package/Typography/TextLoop.js +0 -108
- package/Typography/TypeStairs.js +0 -71
- package/Typography/index.js +0 -10
- package/css/index.js +0 -33
- package/helpers/classed.js +0 -66
- package/helpers/classed.stories.js +0 -140
- package/helpers/createUseMediaQueryWidth.js +0 -193
- package/helpers/extend-component.js +0 -32
- package/helpers/index.js +0 -9
- package/helpers/mergeRefs.js +0 -30
- package/hooks/index.js +0 -92
- package/hooks/types.js +0 -6
- package/hooks/useAsyncFn.js +0 -56
- package/hooks/useDateLocale.js +0 -51
- package/hooks/useFirstMountState.js +0 -28
- package/hooks/useFixedOffset.js +0 -67
- package/hooks/useFocus.js +0 -30
- package/hooks/useInterval.js +0 -44
- package/hooks/useIsomorphicLayoutEffect.js +0 -23
- package/hooks/useKeyUp.js +0 -40
- package/hooks/useMeasure.js +0 -189
- package/hooks/useMountedState.js +0 -31
- package/hooks/useNavigateAway.js +0 -69
- package/hooks/usePrevious.js +0 -33
- package/hooks/usePreviousRef.js +0 -27
- package/hooks/useScrollPosition.js +0 -83
- package/hooks/useScrollThreshold.js +0 -52
- package/hooks/useScrollTo.js +0 -39
- package/hooks/useSmoothScroll.js +0 -49
- package/hooks/useSpinDelay.js +0 -59
- package/hooks/useTraceUpdate.js +0 -39
- package/hooks/useUpdateEffect.js +0 -30
- package/hooks/useWindowSize.js +0 -43
- package/index.js +0 -10
- package/m/MotionProvider.js +0 -27
- package/m/index.js +0 -10
- package/m/lite.js +0 -12
- package/m/max.js +0 -12
- package/sc/index.js +0 -49
- package/scm/index.js +0 -40
- package/shared/index.js +0 -13
- package/styles/Body.js +0 -28
- package/styles/Global.js +0 -55
- package/styles/index.js +0 -142
- package/styles/media.js +0 -139
- package/styles/spacing.js +0 -70
- package/styles/styled.js +0 -58
- package/styles/theme--vanilla.js +0 -82
- package/styles/theme.js +0 -49
- package/tw/index.js +0 -33
- package/twm/index.js +0 -33
- package/types.js +0 -4
package/Hamburger/Hamburger.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Simplified from https://github.com/luukdv/hamburger-react
|
|
5
|
-
*/ "use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
Object.defineProperty(exports, "Hamburger", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function() {
|
|
12
|
-
return Hamburger;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
16
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
17
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
18
|
-
const HamburgerLabel = _styledcomponents.default.div`
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 30px;
|
|
21
|
-
font-size: ${({ $toggled })=>$toggled ? "0" : "9px"};
|
|
22
|
-
text-transform: uppercase;
|
|
23
|
-
left: 7px;
|
|
24
|
-
letter-spacing: 3px;
|
|
25
|
-
`;
|
|
26
|
-
const area = 48;
|
|
27
|
-
const lines = 3;
|
|
28
|
-
const width = 32;
|
|
29
|
-
const room = Math.round((area - width) / 2);
|
|
30
|
-
const barHeightRaw = width / 12;
|
|
31
|
-
const barHeight = Math.round(barHeightRaw);
|
|
32
|
-
const space = 0.5;
|
|
33
|
-
const marginRaw = width / (lines * (space + (lines === 3 ? 1 : 1.25)));
|
|
34
|
-
const margin = Math.round(marginRaw);
|
|
35
|
-
const height = barHeight * lines + margin * (lines - 1);
|
|
36
|
-
const topOffset = Math.round((area - height) / 2);
|
|
37
|
-
const translate = 4.6325;
|
|
38
|
-
const deviation = (barHeightRaw - barHeight + (marginRaw - margin)) / (lines === 3 ? 1 : 2);
|
|
39
|
-
const move = parseFloat((width / translate - deviation / (4 / 3)).toFixed(2));
|
|
40
|
-
const time = 0.4;
|
|
41
|
-
const easing = "cubic-bezier(0, 0, 0, 1)";
|
|
42
|
-
const transition = `${time}s ${easing}`;
|
|
43
|
-
const burgerStyles = {
|
|
44
|
-
marginRight: "-8px",
|
|
45
|
-
position: "relative",
|
|
46
|
-
width: `${area}px`,
|
|
47
|
-
height: `${area}px`,
|
|
48
|
-
userSelect: "none",
|
|
49
|
-
outline: "0px",
|
|
50
|
-
cursor: "pointer",
|
|
51
|
-
transition
|
|
52
|
-
};
|
|
53
|
-
const barStyles = {
|
|
54
|
-
position: "absolute",
|
|
55
|
-
width: `${width}px`,
|
|
56
|
-
height: `${barHeight}px`,
|
|
57
|
-
left: `${room}px`,
|
|
58
|
-
background: "currentColor",
|
|
59
|
-
transition
|
|
60
|
-
};
|
|
61
|
-
const Hamburger = ({ toggled, ...props })=>{
|
|
62
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
63
|
-
style: {
|
|
64
|
-
...burgerStyles,
|
|
65
|
-
transform: `${toggled ? `rotate(90deg)` : "none"}`
|
|
66
|
-
},
|
|
67
|
-
tabIndex: 0,
|
|
68
|
-
...props,
|
|
69
|
-
children: [
|
|
70
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
71
|
-
style: {
|
|
72
|
-
...barStyles,
|
|
73
|
-
top: `${topOffset}px`,
|
|
74
|
-
transform: `${toggled ? `rotate(-45deg) translate(0px, ${move}px)` : "none"}`
|
|
75
|
-
}
|
|
76
|
-
}),
|
|
77
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
78
|
-
style: {
|
|
79
|
-
...barStyles,
|
|
80
|
-
top: `${topOffset + barHeight + margin}px`,
|
|
81
|
-
transform: `${toggled ? `rotate(45deg) translate(0, -${move}px)` : "none"}`
|
|
82
|
-
}
|
|
83
|
-
}),
|
|
84
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(HamburgerLabel, {
|
|
85
|
-
$toggled: toggled,
|
|
86
|
-
children: "Menu"
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
});
|
|
90
|
-
};
|
package/Hamburger/index.js
DELETED
package/Header/index.js
DELETED
package/Header/useHeader.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
useHeader: function() {
|
|
13
|
-
return useHeader;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _react = require("react");
|
|
20
|
-
const _useScrollPosition = require("../hooks/useScrollPosition");
|
|
21
|
-
const _media = require("../styles/media");
|
|
22
|
-
const _theme = require("../styles/theme");
|
|
23
|
-
const useHeader = ()=>{
|
|
24
|
-
const [isSticky, setIsSticky] = (0, _react.useState)(false);
|
|
25
|
-
const { header: themed } = (0, _theme.useTheme)();
|
|
26
|
-
const isDesktopLayout = (0, _media.useMedia)(`min:${themed.breakpoint}`);
|
|
27
|
-
const valueIdx = isDesktopLayout ? 1 : 0;
|
|
28
|
-
const [headerHeight, setHeaderHeight] = (0, _react.useState)(themed.height[valueIdx]);
|
|
29
|
-
const [placeholderHeight, setPlaceholderHeight] = (0, _react.useState)(themed.height[valueIdx]);
|
|
30
|
-
const [logoWidth, setLogoWidth] = (0, _react.useState)(themed.logoWidth[valueIdx]);
|
|
31
|
-
(0, _useScrollPosition.useScrollPosition)((currentPosition)=>{
|
|
32
|
-
const isPastThreshold = currentPosition.y * -1 > 40;
|
|
33
|
-
if (isSticky !== isPastThreshold) setIsSticky(isPastThreshold);
|
|
34
|
-
}, [
|
|
35
|
-
isSticky
|
|
36
|
-
]);
|
|
37
|
-
(0, _react.useEffect)(()=>{
|
|
38
|
-
const valueIdx = isDesktopLayout ? 1 : 0;
|
|
39
|
-
setPlaceholderHeight(themed.height[valueIdx]);
|
|
40
|
-
setHeaderHeight(isSticky ? themed.heightSticky[valueIdx] : themed.height[valueIdx]);
|
|
41
|
-
setLogoWidth(isSticky ? themed.logoWidthSticky[valueIdx] : themed.logoWidth[valueIdx]);
|
|
42
|
-
}, [
|
|
43
|
-
themed,
|
|
44
|
-
isSticky,
|
|
45
|
-
isDesktopLayout
|
|
46
|
-
]);
|
|
47
|
-
return [
|
|
48
|
-
isSticky,
|
|
49
|
-
placeholderHeight,
|
|
50
|
-
headerHeight,
|
|
51
|
-
logoWidth
|
|
52
|
-
];
|
|
53
|
-
};
|
|
54
|
-
const _default = useHeader;
|
package/Hidden/Hidden.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "Hidden", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return Hidden;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
|
-
const Hidden = _styledcomponents.default.div`
|
|
14
|
-
${(p)=>`${p.$min ? `
|
|
15
|
-
@media (min-width: ${p.theme.breakpoints[p.$min]}px) {
|
|
16
|
-
display: none;
|
|
17
|
-
}` : ""} ${p.$max ? `
|
|
18
|
-
@media (max-width: ${p.theme.breakpoints[p.$max]}px) {
|
|
19
|
-
display: none;
|
|
20
|
-
}` : ""}`}
|
|
21
|
-
`;
|
package/Hidden/index.js
DELETED
package/Img/index.js
DELETED
package/Img/sc/bare.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "KoineImg", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return KoineImg;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
|
-
const KoineImg = _styledcomponents.default.img``; // export const KoineImg = styled.img<KoineImgProps>`
|
|
14
|
-
// object-fit: ${(p) => p.$fit || "cover"};
|
|
15
|
-
// `;
|
|
16
|
-
// /**
|
|
17
|
-
// * Replacement core component for native `<img />`
|
|
18
|
-
// *
|
|
19
|
-
// * Features:
|
|
20
|
-
// * - lazy load
|
|
21
|
-
// * - proportion cage
|
|
22
|
-
// */
|
|
23
|
-
// export const Img = ({
|
|
24
|
-
// className,
|
|
25
|
-
// style = {},
|
|
26
|
-
// lazyProps,
|
|
27
|
-
// ...props
|
|
28
|
-
// }: ImgProps) => {
|
|
29
|
-
// let { width, height, src } = props;
|
|
30
|
-
// width = width ? `${width}px` : "100%";
|
|
31
|
-
// height = height ? `${height}px` : "100%";
|
|
32
|
-
// const imgProps = { width, height, src };
|
|
33
|
-
// return (
|
|
34
|
-
// <ImgRoot style={{ width, height, ...style }} className={className}>
|
|
35
|
-
// <LazyLoad {...lazyProps}>
|
|
36
|
-
// <ImgNative {...imgProps} />
|
|
37
|
-
// </LazyLoad>
|
|
38
|
-
// <noscript>
|
|
39
|
-
// <img {...imgProps} />
|
|
40
|
-
// </noscript>
|
|
41
|
-
// </ImgRoot>
|
|
42
|
-
// );
|
|
43
|
-
// };
|
package/Img/types.js
DELETED
package/Link/Link.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "KoineLink", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return KoineLink;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
|
-
const KoineLink = _styledcomponents.default.a``;
|
package/Link/LinkBlank.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
LinkBlankA: function() {
|
|
13
|
-
return LinkBlankA;
|
|
14
|
-
},
|
|
15
|
-
LinkBlankIcon: function() {
|
|
16
|
-
return LinkBlankIcon;
|
|
17
|
-
},
|
|
18
|
-
LinkBlank: function() {
|
|
19
|
-
return LinkBlank;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _md = require("react-icons/md");
|
|
25
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
26
|
-
const _media = require("../styles/media");
|
|
27
|
-
const LinkBlankA = _styledcomponents.default.a.attrs({
|
|
28
|
-
target: "_blank",
|
|
29
|
-
rel: "noopener"
|
|
30
|
-
})``;
|
|
31
|
-
const LinkBlankIcon = (0, _styledcomponents.default)(_md.MdLaunch)`
|
|
32
|
-
color: var(---grey100);
|
|
33
|
-
font-size: inherit;
|
|
34
|
-
margin-left: 3px;
|
|
35
|
-
line-height: inherit;
|
|
36
|
-
vertical-align: middle;
|
|
37
|
-
width: 0px;
|
|
38
|
-
transition: width 0.1s ease-in-out;
|
|
39
|
-
${_media.max.sm} {
|
|
40
|
-
width: 20px;
|
|
41
|
-
opacity: 0.8;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
const LinkBlank = ({ children, target, rel, ...props })=>{
|
|
45
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(LinkBlankA, {
|
|
46
|
-
...props,
|
|
47
|
-
children: [
|
|
48
|
-
children,
|
|
49
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkBlankIcon, {})
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
};
|
package/Link/index.js
DELETED
package/Menu/Menu.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "Menu", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return Menu;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
|
-
const Menu = _styledcomponents.default.ul`
|
|
14
|
-
z-index: 3;
|
|
15
|
-
position: absolute;
|
|
16
|
-
list-style-type: none;
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
background: #fff;
|
|
20
|
-
width: 100%;
|
|
21
|
-
box-shadow: var(--shadow);
|
|
22
|
-
`;
|
package/Menu/MenuMui.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// import React, { forwardRef, useId, useMemo, useRef, useState } from "react";
|
|
2
|
-
// import useEventCallback from "@mui/utils/useEventCallback";
|
|
3
|
-
// import {
|
|
4
|
-
// motion as m,
|
|
5
|
-
// AnimatePresence,
|
|
6
|
-
// type HTMLMotionProps,
|
|
7
|
-
// } from "framer-motion";
|
|
8
|
-
// import {
|
|
9
|
-
// useMenu,
|
|
10
|
-
// MenuUnstyledContext,
|
|
11
|
-
// type MenuUnstyledContextType,
|
|
12
|
-
// type MenuUnstyledActions,
|
|
13
|
-
// } from "@mui/base/MenuUnstyled";
|
|
14
|
-
// import ModalUnstyled from "@mui/base/ModalUnstyled";
|
|
15
|
-
// import ClickAwayListener from "@mui/base/ClickAwayListener";
|
|
16
|
-
// import { usePopper, type PopperChildrenProps } from "react-popper";
|
|
17
|
-
// import clsx from "@koine/utils/clsx";
|
|
18
|
-
// const MenuRoot = m.div;
|
|
19
|
-
// const MenuBackdrop = () => <div className="fixed inset-0" />;
|
|
20
|
-
// /**
|
|
21
|
-
// * Props we control, cannot be overriden from implementers
|
|
22
|
-
// */
|
|
23
|
-
// type MenuButtonOwnProps = {
|
|
24
|
-
// "aria-controls"?: string;
|
|
25
|
-
// "aria-haspopup": true | "true";
|
|
26
|
-
// "aria-expanded"?: true | "true";
|
|
27
|
-
// onClick: (event: React.MouseEvent<HTMLButtonElement>) => unknown;
|
|
28
|
-
// onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => unknown;
|
|
29
|
-
// };
|
|
30
|
-
// type MenuButtonProps = Omit<
|
|
31
|
-
// React.ComponentPropsWithRef<"button">,
|
|
32
|
-
// keyof MenuButtonOwnProps
|
|
33
|
-
// > &
|
|
34
|
-
// MenuButtonOwnProps;
|
|
35
|
-
// export type MenuItemsProps = {
|
|
36
|
-
// /**
|
|
37
|
-
// * Closes the parent menu
|
|
38
|
-
// */
|
|
39
|
-
// close: () => unknown;
|
|
40
|
-
// };
|
|
41
|
-
// /**
|
|
42
|
-
// * Props we control, cannot be overriden from implementers
|
|
43
|
-
// */
|
|
44
|
-
// type MenuOwnProps = ReturnType<typeof useMenu>["getListboxProps"] & {
|
|
45
|
-
// onKeyDown: (event: React.KeyboardEvent) => unknown;
|
|
46
|
-
// style: React.StyleHTMLAttributes<HTMLDivElement>;
|
|
47
|
-
// };
|
|
48
|
-
// export type MenuProps = Omit<
|
|
49
|
-
// Omit<HTMLMotionProps<"div">, "children"> & {
|
|
50
|
-
// placement?: PopperChildrenProps["placement"];
|
|
51
|
-
// Button: (props: MenuButtonProps) => JSX.Element;
|
|
52
|
-
// children: (props: MenuItemsProps) => React.ReactNode;
|
|
53
|
-
// },
|
|
54
|
-
// keyof MenuOwnProps
|
|
55
|
-
// >;
|
|
56
|
-
// export const Menu = forwardRef(function Menu(props: MenuProps, ref) {
|
|
57
|
-
// const { Button, placement, children, className, ...htmlAttributes } = props;
|
|
58
|
-
// const id = useId();
|
|
59
|
-
// const buttonRef = useRef<HTMLButtonElement>(null);
|
|
60
|
-
// const menuActions = useRef<MenuUnstyledActions>(null);
|
|
61
|
-
// const [popperElement, setPopperElement] = useState(null);
|
|
62
|
-
// const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
63
|
-
// const open = Boolean(anchorEl);
|
|
64
|
-
// const { styles } = usePopper(anchorEl, popperElement, {
|
|
65
|
-
// placement,
|
|
66
|
-
// // strategy: "absolute",
|
|
67
|
-
// });
|
|
68
|
-
// const {
|
|
69
|
-
// registerItem,
|
|
70
|
-
// unregisterItem,
|
|
71
|
-
// getListboxProps,
|
|
72
|
-
// getItemProps,
|
|
73
|
-
// getItemState,
|
|
74
|
-
// } = useMenu({
|
|
75
|
-
// listboxId: id,
|
|
76
|
-
// listboxRef: setPopperElement,
|
|
77
|
-
// // these two make the Tab key behaviour correct, closing the menu on Tab
|
|
78
|
-
// // press and re-focusing the Button trigger element
|
|
79
|
-
// open,
|
|
80
|
-
// onClose: () => setAnchorEl(null),
|
|
81
|
-
// });
|
|
82
|
-
// const contextValue: MenuUnstyledContextType = {
|
|
83
|
-
// registerItem,
|
|
84
|
-
// unregisterItem,
|
|
85
|
-
// getItemState,
|
|
86
|
-
// getItemProps,
|
|
87
|
-
// open,
|
|
88
|
-
// };
|
|
89
|
-
// const handleButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
90
|
-
// if (open) {
|
|
91
|
-
// setAnchorEl(null);
|
|
92
|
-
// } else {
|
|
93
|
-
// setAnchorEl(event.currentTarget);
|
|
94
|
-
// }
|
|
95
|
-
// };
|
|
96
|
-
// const handleButtonKeyDown = (
|
|
97
|
-
// event: React.KeyboardEvent<HTMLButtonElement>
|
|
98
|
-
// ) => {
|
|
99
|
-
// if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
100
|
-
// event.preventDefault();
|
|
101
|
-
// setAnchorEl(event.currentTarget);
|
|
102
|
-
// if (event.key === "ArrowUp") {
|
|
103
|
-
// menuActions.current?.highlightLastItem();
|
|
104
|
-
// }
|
|
105
|
-
// }
|
|
106
|
-
// };
|
|
107
|
-
// const close = useEventCallback(() => {
|
|
108
|
-
// setAnchorEl(null);
|
|
109
|
-
// buttonRef.current?.focus();
|
|
110
|
-
// });
|
|
111
|
-
// const renderChildren = useMemo(() => {
|
|
112
|
-
// const childrenProps: MenuItemsProps = { close };
|
|
113
|
-
// return children(childrenProps);
|
|
114
|
-
// }, [children, close]);
|
|
115
|
-
// return (
|
|
116
|
-
// <>
|
|
117
|
-
// <Button
|
|
118
|
-
// ref={buttonRef}
|
|
119
|
-
// id={id}
|
|
120
|
-
// aria-haspopup="true"
|
|
121
|
-
// aria-controls={open ? id : undefined}
|
|
122
|
-
// aria-expanded={open ? "true" : undefined}
|
|
123
|
-
// onClick={handleButtonClick}
|
|
124
|
-
// onKeyDown={handleButtonKeyDown}
|
|
125
|
-
// />
|
|
126
|
-
// <AnimatePresence>
|
|
127
|
-
// {open && (
|
|
128
|
-
// <ModalUnstyled
|
|
129
|
-
// slots={{ backdrop: MenuBackdrop }}
|
|
130
|
-
// onClose={close}
|
|
131
|
-
// onBackdropClick={close}
|
|
132
|
-
// open={open}
|
|
133
|
-
// >
|
|
134
|
-
// <div>
|
|
135
|
-
// <ClickAwayListener onClickAway={close}>
|
|
136
|
-
// <MenuRoot
|
|
137
|
-
// initial={{
|
|
138
|
-
// opacity: 0,
|
|
139
|
-
// }}
|
|
140
|
-
// animate={{
|
|
141
|
-
// opacity: 1,
|
|
142
|
-
// }}
|
|
143
|
-
// exit={{
|
|
144
|
-
// opacity: 0,
|
|
145
|
-
// }}
|
|
146
|
-
// className={clsx(className)}
|
|
147
|
-
// style={styles["popper"]}
|
|
148
|
-
// {...htmlAttributes}
|
|
149
|
-
// {...getListboxProps()}
|
|
150
|
-
// aria-labelledby={id}
|
|
151
|
-
// >
|
|
152
|
-
// <MenuUnstyledContext.Provider value={contextValue}>
|
|
153
|
-
// {renderChildren}
|
|
154
|
-
// </MenuUnstyledContext.Provider>
|
|
155
|
-
// </MenuRoot>
|
|
156
|
-
// </ClickAwayListener>
|
|
157
|
-
// </div>
|
|
158
|
-
// </ModalUnstyled>
|
|
159
|
-
// )}
|
|
160
|
-
// </AnimatePresence>
|
|
161
|
-
// </>
|
|
162
|
-
// );
|
|
163
|
-
// });
|
|
164
|
-
// export default Menu;
|
|
165
|
-
"use strict";
|
package/Menu/index.js
DELETED
package/MenuItem/MenuItem.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "MenuItem", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return MenuItem;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _styledcomponents = /*#__PURE__*/ _interop_require_default._(require("styled-components"));
|
|
13
|
-
const MenuItem = _styledcomponents.default.li`
|
|
14
|
-
padding: 8px 16px;
|
|
15
|
-
|
|
16
|
-
&[aria-selected="true"] {
|
|
17
|
-
background: var(--accent400);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** DEP: this is just for MultiselectMui? */
|
|
21
|
-
&.Mui-focused,
|
|
22
|
-
&[data-focus="true"] {
|
|
23
|
-
background: var(--accent300);
|
|
24
|
-
color: white;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&:not([disabled]):hover {
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
background: var(--accent300);
|
|
30
|
-
}
|
|
31
|
-
`;
|
package/MenuItem/MenuItemMui.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// import React, { forwardRef } from "react";
|
|
2
|
-
// import { useMenuItem } from "@mui/base/MenuItemUnstyled";
|
|
3
|
-
// // import { useMenuItem } from "./useMenuItem";
|
|
4
|
-
// import clsx from "@koine/utils/clsx";
|
|
5
|
-
// import { type MenuItemsProps } from "../Menu/MenuMui";
|
|
6
|
-
// import { Polymorphic } from "../typings";
|
|
7
|
-
// export type MenuItemProps = React.PropsWithChildren<Partial<MenuItemsProps>>;
|
|
8
|
-
// export const MenuItem = forwardRef(function MenuItem<
|
|
9
|
-
// T extends React.ElementType = "button"
|
|
10
|
-
// >(props: Polymorphic.Props<T, MenuItemProps>, ref: Polymorphic.Ref<T>) {
|
|
11
|
-
// const {
|
|
12
|
-
// as: As = "button",
|
|
13
|
-
// children,
|
|
14
|
-
// className,
|
|
15
|
-
// disabled: disabledProp,
|
|
16
|
-
// ...other
|
|
17
|
-
// } = props;
|
|
18
|
-
// const { getRootProps, disabled, focusVisible } = useMenuItem({
|
|
19
|
-
// ref,
|
|
20
|
-
// disabled: disabledProp,
|
|
21
|
-
// });
|
|
22
|
-
// return (
|
|
23
|
-
// <As
|
|
24
|
-
// className={clsx(focusVisible && "", disabled && "", className)}
|
|
25
|
-
// {...getRootProps(other)}
|
|
26
|
-
// >
|
|
27
|
-
// {children}
|
|
28
|
-
// </As>
|
|
29
|
-
// );
|
|
30
|
-
// }) as Polymorphic.ComponentForwarded<"button", MenuItemProps>;
|
|
31
|
-
// export default MenuItem;
|
|
32
|
-
"use strict";
|