@adamjanicki/ui 1.8.3 → 1.8.4
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/build/components/Accordion/Accordion.js +1 -0
- package/build/components/Accordion/index.d.ts +1 -0
- package/build/components/Accordion/index.js +1 -0
- package/build/components/Alert/Alert.js +1 -0
- package/build/components/Alert/index.d.ts +1 -0
- package/build/components/Alert/index.js +1 -0
- package/build/components/Animated/Animated.js +1 -0
- package/build/components/Animated/index.d.ts +1 -0
- package/build/components/Animated/index.js +1 -0
- package/build/components/Avatar/Avatar.js +1 -0
- package/build/components/Avatar/index.d.ts +1 -0
- package/build/components/Avatar/index.js +1 -0
- package/build/components/Badge/Badge.js +1 -0
- package/build/components/Badge/index.d.ts +1 -0
- package/build/components/Badge/index.js +1 -0
- package/build/components/Banner/Banner.js +1 -0
- package/build/components/Banner/index.d.ts +1 -0
- package/build/components/Banner/index.js +1 -0
- package/build/components/Box/Box.js +1 -0
- package/build/components/Box/index.d.ts +1 -0
- package/build/components/Box/index.js +1 -0
- package/{components → build/components}/Button/Button.d.ts +0 -21
- package/build/components/Button/Button.js +1 -0
- package/build/components/Button/IconButton.d.ts +25 -0
- package/build/components/Button/IconButton.js +1 -0
- package/build/components/Button/index.d.ts +3 -0
- package/build/components/Button/index.js +1 -0
- package/build/components/Carousel/Carousel.js +1 -0
- package/build/components/Carousel/index.d.ts +1 -0
- package/build/components/Carousel/index.js +1 -0
- package/build/components/ClickOutside/ClickOutside.js +1 -0
- package/build/components/ClickOutside/index.d.ts +1 -0
- package/build/components/ClickOutside/index.js +1 -0
- package/build/components/ErrorBoundary/ErrorBoundary.js +1 -0
- package/build/components/ErrorBoundary/index.d.ts +1 -0
- package/build/components/ErrorBoundary/index.js +1 -0
- package/build/components/Hamburger/DoubleCross.js +1 -0
- package/build/components/Hamburger/DoubleFlip.js +1 -0
- package/build/components/Hamburger/DoubleSpin.js +1 -0
- package/build/components/Hamburger/Hamburger.js +1 -0
- package/build/components/Hamburger/TripleFade.js +1 -0
- package/build/components/Hamburger/TripleFlip.js +1 -0
- package/build/components/Hamburger/TriplePrestige.js +1 -0
- package/build/components/Hamburger/TripleSpin.js +1 -0
- package/{components → build/components}/Hamburger/index.d.ts +2 -3
- package/build/components/Hamburger/index.js +1 -0
- package/build/components/Icon/Icon.js +1 -0
- package/build/components/Icon/icons.js +1 -0
- package/build/components/Icon/index.d.ts +1 -0
- package/build/components/Icon/index.js +1 -0
- package/build/components/Input/IconInput.js +1 -0
- package/build/components/Input/Input.js +1 -0
- package/build/components/Input/TextArea.js +1 -0
- package/build/components/Input/index.d.ts +3 -0
- package/build/components/Input/index.js +1 -0
- package/build/components/Layer/Layer.js +1 -0
- package/build/components/Layer/index.d.ts +1 -0
- package/build/components/Layer/index.js +1 -0
- package/build/components/Modal/Modal.js +1 -0
- package/build/components/Modal/index.d.ts +1 -0
- package/build/components/Modal/index.js +1 -0
- package/build/components/Select/Select.js +1 -0
- package/build/components/Select/index.d.ts +1 -0
- package/build/components/Select/index.js +1 -0
- package/build/components/Spinner/Spinner.js +1 -0
- package/build/components/Spinner/index.d.ts +1 -0
- package/build/components/Spinner/index.js +1 -0
- package/build/components/ui.js +1 -0
- package/build/functions/assertDefined.js +1 -0
- package/build/functions/classNames.js +1 -0
- package/build/functions/getDeviceType.js +1 -0
- package/build/functions/index.d.ts +4 -0
- package/build/functions/index.js +1 -0
- package/build/functions/scrollToId.js +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFocusTrap.js +1 -0
- package/build/hooks/useMediaQuery.js +1 -0
- package/build/hooks/useMergeRefs.js +1 -0
- package/build/hooks/useScroll.js +1 -0
- package/build/hooks/useScrollLock.js +1 -0
- package/build/hooks/useScrollToHash.js +1 -0
- package/build/hooks/useWindowResize.js +1 -0
- package/{index.d.ts → build/index.d.ts} +1 -3
- package/build/index.js +1 -0
- package/{components/Link → build/navigation}/Link.d.ts +4 -4
- package/build/navigation/Link.js +1 -0
- package/build/navigation/PathParamsContext.js +1 -0
- package/build/navigation/Route.js +1 -0
- package/build/navigation/Router.js +1 -0
- package/build/navigation/RouterContext.js +1 -0
- package/{router → build/navigation}/Routes.d.ts +1 -1
- package/build/navigation/Routes.js +1 -0
- package/build/navigation/history.js +1 -0
- package/build/navigation/hooks/useLocation.js +1 -0
- package/build/navigation/hooks/useNavigate.js +1 -0
- package/build/navigation/hooks/usePathParams.js +1 -0
- package/build/navigation/hooks/useRouterContext.js +1 -0
- package/build/navigation/hooks/useSearchParams.js +1 -0
- package/build/navigation/href.js +1 -0
- package/{router → build/navigation}/index.d.ts +1 -0
- package/build/navigation/index.js +1 -0
- package/build/navigation/path.js +1 -0
- package/build/navigation/string.js +1 -0
- package/build/navigation/types.js +0 -0
- package/build/utils/transformVfx.js +1 -0
- package/{utils → build/utils}/types.d.ts +1 -1
- package/build/utils/types.js +0 -0
- package/package.json +19 -8
- package/components/Accordion/Accordion.js +0 -56
- package/components/Accordion/index.d.ts +0 -2
- package/components/Accordion/index.js +0 -2
- package/components/Alert/Alert.js +0 -31
- package/components/Alert/index.d.ts +0 -2
- package/components/Alert/index.js +0 -2
- package/components/Animated/Animated.js +0 -94
- package/components/Animated/index.d.ts +0 -2
- package/components/Animated/index.js +0 -2
- package/components/Avatar/Avatar.js +0 -57
- package/components/Avatar/index.d.ts +0 -2
- package/components/Avatar/index.js +0 -2
- package/components/Badge/Badge.js +0 -31
- package/components/Badge/index.d.ts +0 -2
- package/components/Badge/index.js +0 -2
- package/components/Banner/Banner.js +0 -31
- package/components/Banner/index.d.ts +0 -2
- package/components/Banner/index.js +0 -2
- package/components/Box/Box.js +0 -3
- package/components/Box/index.d.ts +0 -2
- package/components/Box/index.js +0 -2
- package/components/Button/Button.js +0 -52
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.js +0 -3
- package/components/Carousel/Carousel.js +0 -106
- package/components/Carousel/index.d.ts +0 -2
- package/components/Carousel/index.js +0 -2
- package/components/ClickOutside/ClickOutside.js +0 -55
- package/components/ClickOutside/index.d.ts +0 -2
- package/components/ClickOutside/index.js +0 -2
- package/components/ErrorBoundary/ErrorBoundary.js +0 -61
- package/components/ErrorBoundary/index.d.ts +0 -2
- package/components/ErrorBoundary/index.js +0 -2
- package/components/Hamburger/DoubleCross.js +0 -39
- package/components/Hamburger/DoubleFlip.js +0 -39
- package/components/Hamburger/DoubleSpin.js +0 -40
- package/components/Hamburger/Hamburger.js +0 -66
- package/components/Hamburger/TripleFade.js +0 -40
- package/components/Hamburger/TripleFlip.js +0 -40
- package/components/Hamburger/TriplePrestige.js +0 -40
- package/components/Hamburger/TripleSpin.js +0 -41
- package/components/Hamburger/index.js +0 -9
- package/components/Icon/Icon.js +0 -32
- package/components/Icon/icons.js +0 -179
- package/components/Icon/index.d.ts +0 -2
- package/components/Icon/index.js +0 -2
- package/components/Input/IconInput.js +0 -33
- package/components/Input/Input.js +0 -31
- package/components/Input/TextArea.js +0 -31
- package/components/Input/index.d.ts +0 -5
- package/components/Input/index.js +0 -5
- package/components/Layer/Layer.js +0 -63
- package/components/Layer/index.d.ts +0 -2
- package/components/Layer/index.js +0 -2
- package/components/Link/Link.js +0 -75
- package/components/Link/index.d.ts +0 -3
- package/components/Link/index.js +0 -3
- package/components/Modal/Modal.js +0 -48
- package/components/Modal/index.d.ts +0 -2
- package/components/Modal/index.js +0 -2
- package/components/Select/Select.js +0 -34
- package/components/Select/index.d.ts +0 -2
- package/components/Select/index.js +0 -2
- package/components/Spinner/Spinner.js +0 -31
- package/components/Spinner/index.d.ts +0 -2
- package/components/Spinner/index.js +0 -2
- package/components/ui.js +0 -44
- package/functions/assertDefined.js +0 -13
- package/functions/classNames.js +0 -16
- package/functions/getDeviceType.js +0 -17
- package/functions/index.d.ts +0 -5
- package/functions/index.js +0 -5
- package/functions/scrollToId.js +0 -17
- package/hooks/index.js +0 -7
- package/hooks/useFocusTrap.js +0 -48
- package/hooks/useMediaQuery.js +0 -28
- package/hooks/useMergeRefs.js +0 -24
- package/hooks/useScroll.js +0 -23
- package/hooks/useScrollLock.js +0 -45
- package/hooks/useScrollToHash.js +0 -21
- package/hooks/useWindowResize.js +0 -13
- package/index.js +0 -31
- package/router/PathParamsContext.js +0 -3
- package/router/Route.js +0 -6
- package/router/Router.js +0 -36
- package/router/RouterContext.js +0 -3
- package/router/Routes.js +0 -31
- package/router/history.js +0 -46
- package/router/hooks/useLocation.js +0 -10
- package/router/hooks/useNavigate.js +0 -10
- package/router/hooks/usePathParams.js +0 -15
- package/router/hooks/useRouterContext.js +0 -9
- package/router/hooks/useSearchParams.js +0 -47
- package/router/href.js +0 -43
- package/router/index.js +0 -7
- package/router/path.js +0 -38
- package/router/string.js +0 -6
- package/router/types.js +0 -1
- package/utils/transformVfx.js +0 -212
- package/utils/types.js +0 -1
- /package/{components → build/components}/Accordion/Accordion.d.ts +0 -0
- /package/{components → build/components}/Alert/Alert.d.ts +0 -0
- /package/{components → build/components}/Animated/Animated.d.ts +0 -0
- /package/{components → build/components}/Avatar/Avatar.d.ts +0 -0
- /package/{components → build/components}/Badge/Badge.d.ts +0 -0
- /package/{components → build/components}/Banner/Banner.d.ts +0 -0
- /package/{components → build/components}/Box/Box.d.ts +0 -0
- /package/{components → build/components}/Carousel/Carousel.d.ts +0 -0
- /package/{components → build/components}/ClickOutside/ClickOutside.d.ts +0 -0
- /package/{components → build/components}/ErrorBoundary/ErrorBoundary.d.ts +0 -0
- /package/{components → build/components}/Hamburger/DoubleCross.d.ts +0 -0
- /package/{components → build/components}/Hamburger/DoubleFlip.d.ts +0 -0
- /package/{components → build/components}/Hamburger/DoubleSpin.d.ts +0 -0
- /package/{components → build/components}/Hamburger/Hamburger.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TripleFade.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TripleFlip.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TriplePrestige.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TripleSpin.d.ts +0 -0
- /package/{components → build/components}/Icon/Icon.d.ts +0 -0
- /package/{components → build/components}/Icon/icons.d.ts +0 -0
- /package/{components → build/components}/Input/IconInput.d.ts +0 -0
- /package/{components → build/components}/Input/Input.d.ts +0 -0
- /package/{components → build/components}/Input/TextArea.d.ts +0 -0
- /package/{components → build/components}/Layer/Layer.d.ts +0 -0
- /package/{components → build/components}/Modal/Modal.d.ts +0 -0
- /package/{components → build/components}/Select/Select.d.ts +0 -0
- /package/{components → build/components}/Spinner/Spinner.d.ts +0 -0
- /package/{components → build/components}/ui.d.ts +0 -0
- /package/{functions → build/functions}/assertDefined.d.ts +0 -0
- /package/{functions → build/functions}/classNames.d.ts +0 -0
- /package/{functions → build/functions}/getDeviceType.d.ts +0 -0
- /package/{functions → build/functions}/scrollToId.d.ts +0 -0
- /package/{hooks → build/hooks}/index.d.ts +0 -0
- /package/{hooks → build/hooks}/useFocusTrap.d.ts +0 -0
- /package/{hooks → build/hooks}/useMediaQuery.d.ts +0 -0
- /package/{hooks → build/hooks}/useMergeRefs.d.ts +0 -0
- /package/{hooks → build/hooks}/useScroll.d.ts +0 -0
- /package/{hooks → build/hooks}/useScrollLock.d.ts +0 -0
- /package/{hooks → build/hooks}/useScrollToHash.d.ts +0 -0
- /package/{hooks → build/hooks}/useWindowResize.d.ts +0 -0
- /package/{router → build/navigation}/PathParamsContext.d.ts +0 -0
- /package/{router → build/navigation}/Route.d.ts +0 -0
- /package/{router → build/navigation}/Router.d.ts +0 -0
- /package/{router → build/navigation}/RouterContext.d.ts +0 -0
- /package/{router → build/navigation}/history.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useLocation.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useNavigate.d.ts +0 -0
- /package/{router → build/navigation}/hooks/usePathParams.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useRouterContext.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useSearchParams.d.ts +0 -0
- /package/{router → build/navigation}/href.d.ts +0 -0
- /package/{router → build/navigation}/path.d.ts +0 -0
- /package/{router → build/navigation}/string.d.ts +0 -0
- /package/{router → build/navigation}/types.d.ts +0 -0
- /package/{style.css → build/style.css} +0 -0
- /package/{utils → build/utils}/transformVfx.d.ts +0 -0
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
|
-
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
25
|
-
import { classNames } from "../../functions";
|
|
26
|
-
import Button from "../Button";
|
|
27
|
-
import Box from "../Box/Box";
|
|
28
|
-
import Icon from "../Icon";
|
|
29
|
-
var DEFAULT_DURATION_S = 1;
|
|
30
|
-
var itemVfx = { width: "full", height: "full", stretch: "max" };
|
|
31
|
-
var Carousel = React.forwardRef(function (_a, ref) {
|
|
32
|
-
var _b, _c;
|
|
33
|
-
var children = _a.children, hideArrows = _a.hideArrows, vfx = _a.vfx, hideDots = _a.hideDots, dotProps = _a.dotProps, leftArrowProps = _a.leftArrowProps, rightArrowProps = _a.rightArrowProps, autoplayInterval = _a.autoplayInterval, duration = _a.duration, rest = __rest(_a, ["children", "hideArrows", "vfx", "hideDots", "dotProps", "leftArrowProps", "rightArrowProps", "autoplayInterval", "duration"]);
|
|
34
|
-
// min duration
|
|
35
|
-
duration = Math.max(duration !== null && duration !== void 0 ? duration : DEFAULT_DURATION_S, 0.1);
|
|
36
|
-
autoplayInterval = autoplayInterval
|
|
37
|
-
? Math.max(duration, autoplayInterval)
|
|
38
|
-
: undefined;
|
|
39
|
-
var length = children.length;
|
|
40
|
-
var _d = useState({
|
|
41
|
-
cur: 0,
|
|
42
|
-
delta: 0,
|
|
43
|
-
animating: false,
|
|
44
|
-
}), state = _d[0], setState = _d[1];
|
|
45
|
-
var intervalRef = useRef(null);
|
|
46
|
-
var cur = state.cur, delta = state.delta, animating = state.animating;
|
|
47
|
-
var next = safeMod(cur + delta, length);
|
|
48
|
-
var startTransition = useCallback(function (delta) {
|
|
49
|
-
if (animating || delta === 0)
|
|
50
|
-
return;
|
|
51
|
-
setState(function (old) { return (__assign(__assign({}, old), { delta: delta, animating: true })); });
|
|
52
|
-
}, [animating]);
|
|
53
|
-
var onTransitionEnd = function () {
|
|
54
|
-
setState(function (_a) {
|
|
55
|
-
var delta = _a.delta, cur = _a.cur;
|
|
56
|
-
return ({
|
|
57
|
-
delta: delta,
|
|
58
|
-
animating: false,
|
|
59
|
-
cur: safeMod(cur + delta, length),
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
useEffect(function () {
|
|
64
|
-
if (autoplayInterval) {
|
|
65
|
-
intervalRef.current = window.setInterval(function () {
|
|
66
|
-
startTransition(1);
|
|
67
|
-
}, autoplayInterval * 1000);
|
|
68
|
-
}
|
|
69
|
-
return function () {
|
|
70
|
-
var interval = intervalRef.current;
|
|
71
|
-
intervalRef.current = null;
|
|
72
|
-
if (interval) {
|
|
73
|
-
clearInterval(interval);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}, [autoplayInterval, startTransition]);
|
|
77
|
-
if (length <= 0)
|
|
78
|
-
return null;
|
|
79
|
-
var animatingStyles = animating
|
|
80
|
-
? {
|
|
81
|
-
transform: "translateX(".concat(-(delta / Math.abs(delta)) * 100, "%)"),
|
|
82
|
-
transition: "transform ".concat(duration, "s ease-in-out"),
|
|
83
|
-
}
|
|
84
|
-
: undefined;
|
|
85
|
-
return (_jsxs(Box, __assign({}, rest, { vfx: __assign({ maxWidth: "full", width: "fit", pos: "relative", overflow: "hidden" }, vfx), ref: ref, children: [_jsxs(Box, { vfx: {
|
|
86
|
-
axis: delta >= 0 ? "x" : "-x",
|
|
87
|
-
width: "full",
|
|
88
|
-
height: "full",
|
|
89
|
-
}, style: animatingStyles, onTransitionEnd: onTransitionEnd, children: [_jsx(Box, { vfx: itemVfx, children: children[cur] }), _jsx(Box, { vfx: itemVfx, "aria-hidden": true, children: children[next] })] }), length > 1 && (_jsxs(_Fragment, { children: [!hideArrows && (_jsxs(_Fragment, { children: [_jsx(Button, { vfx: {
|
|
90
|
-
axis: "x",
|
|
91
|
-
align: "center",
|
|
92
|
-
justify: "center",
|
|
93
|
-
radius: "max",
|
|
94
|
-
padding: "none",
|
|
95
|
-
}, className: classNames("aui-carousel-arrow", leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.className), style: __assign({ left: 8 }, leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.style), "aria-label": "previous", onClick: function () { return startTransition(-1); }, children: (_b = leftArrowProps === null || leftArrowProps === void 0 ? void 0 : leftArrowProps.children) !== null && _b !== void 0 ? _b : (_jsx(Icon, { icon: "chevron-left", size: "xs", style: { marginRight: 2 } })) }), _jsx(Button, { vfx: {
|
|
96
|
-
axis: "x",
|
|
97
|
-
align: "center",
|
|
98
|
-
justify: "center",
|
|
99
|
-
radius: "max",
|
|
100
|
-
padding: "none",
|
|
101
|
-
}, className: classNames("aui-carousel-arrow", rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.className), style: __assign({ right: 8 }, rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.style), "aria-label": "next", onClick: function () { return startTransition(1); }, children: (_c = rightArrowProps === null || rightArrowProps === void 0 ? void 0 : rightArrowProps.children) !== null && _c !== void 0 ? _c : (_jsx(Icon, { icon: "chevron-right", size: "xs", style: { marginLeft: 2 } })) })] })), !hideDots && (_jsx(Box, { vfx: { axis: "x", align: "center", gap: "xxs" }, className: "aui-carousel-dots", children: children.map(function (_, i) { return (_jsx(Button, { className: classNames("aui-carousel-dot", dotProps === null || dotProps === void 0 ? void 0 : dotProps.className), vfx: { radius: "max", padding: "none" }, disabled: cur === i || animating, onClick: function () { return startTransition(i - cur); }, style: dotProps === null || dotProps === void 0 ? void 0 : dotProps.style }, i)); }) }))] }))] })));
|
|
102
|
-
});
|
|
103
|
-
function safeMod(n, m) {
|
|
104
|
-
return ((n % m) + m) % m;
|
|
105
|
-
}
|
|
106
|
-
export default Carousel;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { cloneElement, useCallback, useEffect, useRef } from "react";
|
|
2
|
-
import useMergeRefs from "../../hooks/useMergeRefs";
|
|
3
|
-
var mouseEvents = {
|
|
4
|
-
click: "onClick",
|
|
5
|
-
mousedown: "onMouseDown",
|
|
6
|
-
mouseup: "onMouseUp",
|
|
7
|
-
};
|
|
8
|
-
var ClickOutside = function (_a) {
|
|
9
|
-
var _b;
|
|
10
|
-
var children = _a.children, onClickOutside = _a.onClickOutside, _c = _a.mouseEvent, mouseEvent = _c === void 0 ? "click" : _c;
|
|
11
|
-
var ref = useRef(null);
|
|
12
|
-
var clickWithinChildRef = useRef(false);
|
|
13
|
-
var startedRef = useRef(false);
|
|
14
|
-
useEffect(function () {
|
|
15
|
-
var timeout = window.setTimeout(function () {
|
|
16
|
-
startedRef.current = true;
|
|
17
|
-
}, 0);
|
|
18
|
-
return function () {
|
|
19
|
-
clearTimeout(timeout);
|
|
20
|
-
startedRef.current = false;
|
|
21
|
-
};
|
|
22
|
-
}, []);
|
|
23
|
-
var handleClickOutside = useCallback(function (event) {
|
|
24
|
-
var _a;
|
|
25
|
-
var clickedWithinChild = clickWithinChildRef.current;
|
|
26
|
-
clickWithinChildRef.current = false;
|
|
27
|
-
var childElement = ref.current;
|
|
28
|
-
if (!startedRef.current || !childElement || clickedWithinChild)
|
|
29
|
-
return;
|
|
30
|
-
var path = ((_a = event.composedPath) === null || _a === void 0 ? void 0 : _a.call(event)) || [];
|
|
31
|
-
var isInside = path.includes(childElement) ||
|
|
32
|
-
childElement.contains(event.target);
|
|
33
|
-
if (!isInside) {
|
|
34
|
-
onClickOutside(event);
|
|
35
|
-
}
|
|
36
|
-
}, [onClickOutside]);
|
|
37
|
-
useEffect(function () {
|
|
38
|
-
document.addEventListener(mouseEvent, handleClickOutside);
|
|
39
|
-
return function () { return document.removeEventListener(mouseEvent, handleClickOutside); };
|
|
40
|
-
}, [handleClickOutside, mouseEvent]);
|
|
41
|
-
var mergedRef = useMergeRefs(ref, children.props.ref);
|
|
42
|
-
var mouseEventPropName = mouseEvents[mouseEvent];
|
|
43
|
-
return cloneElement(children, (_b = {
|
|
44
|
-
ref: mergedRef
|
|
45
|
-
},
|
|
46
|
-
_b[mouseEventPropName] = function (event) {
|
|
47
|
-
var _a, _b;
|
|
48
|
-
// point of this is to let us know that click originated
|
|
49
|
-
// from the child element, so we can ignore it
|
|
50
|
-
clickWithinChildRef.current = true;
|
|
51
|
-
(_b = (_a = children.props) === null || _a === void 0 ? void 0 : _a[mouseEventPropName]) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
52
|
-
},
|
|
53
|
-
_b));
|
|
54
|
-
};
|
|
55
|
-
export default ClickOutside;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import React from "react";
|
|
18
|
-
var ErrorBoundary = /** @class */ (function (_super) {
|
|
19
|
-
__extends(ErrorBoundary, _super);
|
|
20
|
-
function ErrorBoundary() {
|
|
21
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
-
_this.state = { error: null };
|
|
23
|
-
_this.resetErrorBoundary = function () {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
if (_this.state.error !== null) {
|
|
26
|
-
_this.setState({ error: null });
|
|
27
|
-
(_b = (_a = _this.props).onReset) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
ErrorBoundary.getDerivedStateFromError = function (error) {
|
|
33
|
-
return { error: error };
|
|
34
|
-
};
|
|
35
|
-
ErrorBoundary.prototype.componentDidCatch = function (error, info) {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
(_b = (_a = this.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error, info);
|
|
38
|
-
};
|
|
39
|
-
ErrorBoundary.prototype.componentDidUpdate = function (prevProps) {
|
|
40
|
-
if (this.depsUpdated(this.props.deps, prevProps.deps)) {
|
|
41
|
-
this.resetErrorBoundary();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
ErrorBoundary.prototype.depsUpdated = function (nextDeps, prevDeps) {
|
|
45
|
-
if (!nextDeps || !prevDeps)
|
|
46
|
-
return false;
|
|
47
|
-
if (nextDeps.length !== prevDeps.length)
|
|
48
|
-
return true;
|
|
49
|
-
return nextDeps.some(function (dep, i) { return !Object.is(dep, prevDeps[i]); });
|
|
50
|
-
};
|
|
51
|
-
ErrorBoundary.prototype.render = function () {
|
|
52
|
-
var _a = this.props, Fallback = _a.Fallback, children = _a.children;
|
|
53
|
-
var error = this.state.error;
|
|
54
|
-
if (!error) {
|
|
55
|
-
return children;
|
|
56
|
-
}
|
|
57
|
-
return _jsx(Fallback, { error: error, reset: this.resetErrorBoundary });
|
|
58
|
-
};
|
|
59
|
-
return ErrorBoundary;
|
|
60
|
-
}(React.Component));
|
|
61
|
-
export default ErrorBoundary;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { defaultAngles } from "./Hamburger";
|
|
26
|
-
var DoubleCross = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = defaultAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
bottom: { transform: bottomTransform },
|
|
35
|
-
};
|
|
36
|
-
}, [direction]);
|
|
37
|
-
return _jsx(Hamburger, __assign({}, rest, { double: true, openStyle: openStyle }));
|
|
38
|
-
};
|
|
39
|
-
export default DoubleCross;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { flipAngles } from "./Hamburger";
|
|
26
|
-
var DoubleFlip = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = flipAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
bottom: { transform: bottomTransform },
|
|
35
|
-
};
|
|
36
|
-
}, [direction]);
|
|
37
|
-
return _jsx(Hamburger, __assign({}, rest, { double: true, openStyle: openStyle }));
|
|
38
|
-
};
|
|
39
|
-
export default DoubleFlip;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { defaultAngles } from "./Hamburger";
|
|
26
|
-
var DoubleSpin = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = defaultAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
bottom: { transform: bottomTransform },
|
|
35
|
-
outer: { transform: "rotate(180deg)" },
|
|
36
|
-
};
|
|
37
|
-
}, [direction]);
|
|
38
|
-
return _jsx(Hamburger, __assign({}, rest, { double: true, openStyle: openStyle }));
|
|
39
|
-
};
|
|
40
|
-
export default DoubleSpin;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import { UnstyledButton } from "../Button";
|
|
26
|
-
export var defaultAngles = {
|
|
27
|
-
right: 45,
|
|
28
|
-
left: -45,
|
|
29
|
-
};
|
|
30
|
-
export var flipAngles = {
|
|
31
|
-
right: -135,
|
|
32
|
-
left: -225,
|
|
33
|
-
};
|
|
34
|
-
var Hamburger = function (props) {
|
|
35
|
-
var _a = props.size, size = _a === void 0 ? 36 : _a, _b = props.duration, duration = _b === void 0 ? 0.25 : _b, double = props.double, openStyle = props.openStyle, open = props.open, style = props.style, rounded = props.rounded, inputLineHeight = props.lineHeight, buttonProps = __rest(props, ["size", "duration", "double", "openStyle", "open", "style", "rounded", "lineHeight"]);
|
|
36
|
-
var lineHeight = inputLineHeight || Math.max(1, Math.round(size / 20));
|
|
37
|
-
var buttonStyle = {
|
|
38
|
-
width: size,
|
|
39
|
-
height: size,
|
|
40
|
-
display: "flex",
|
|
41
|
-
position: "relative",
|
|
42
|
-
justifyContent: "center",
|
|
43
|
-
alignItems: "center",
|
|
44
|
-
transition: "transform ".concat(duration, "s ease"),
|
|
45
|
-
};
|
|
46
|
-
var commonLineStyle = {
|
|
47
|
-
height: lineHeight,
|
|
48
|
-
width: size * 0.7,
|
|
49
|
-
backgroundColor: "currentColor",
|
|
50
|
-
position: "absolute",
|
|
51
|
-
transition: "transform ".concat(duration, "s ease, opacity ").concat(duration, "s ease"),
|
|
52
|
-
borderRadius: rounded ? 10000 : 0,
|
|
53
|
-
};
|
|
54
|
-
var yTranslateMagnitude = useMemo(function () { return size / (double ? 7 : 4); }, [size, double]);
|
|
55
|
-
var outer = openStyle.outer, top = openStyle.top, middle = openStyle.middle, bottom = openStyle.bottom;
|
|
56
|
-
var outerStyle = open ? outer : {};
|
|
57
|
-
var topStyle = open
|
|
58
|
-
? top
|
|
59
|
-
: { transform: "translateY(-".concat(yTranslateMagnitude, "px)") };
|
|
60
|
-
var bottomStyle = open
|
|
61
|
-
? bottom
|
|
62
|
-
: { transform: "translateY(".concat(yTranslateMagnitude, "px)") };
|
|
63
|
-
var middleStyle = open ? middle : {};
|
|
64
|
-
return (_jsxs(UnstyledButton, __assign({ style: __assign(__assign(__assign({}, style), outerStyle), buttonStyle) }, buttonProps, { "aria-label": buttonProps["aria-label"] || "hamburger", "aria-expanded": open, children: [_jsx("span", { style: __assign(__assign({}, commonLineStyle), topStyle) }), !double && _jsx("span", { style: __assign(__assign({}, commonLineStyle), middleStyle) }), _jsx("span", { style: __assign(__assign({}, commonLineStyle), bottomStyle) })] })));
|
|
65
|
-
};
|
|
66
|
-
export default Hamburger;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { defaultAngles } from "./Hamburger";
|
|
26
|
-
var TripleFade = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = defaultAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
middle: { opacity: 0 },
|
|
35
|
-
bottom: { transform: bottomTransform },
|
|
36
|
-
};
|
|
37
|
-
}, [direction]);
|
|
38
|
-
return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
|
|
39
|
-
};
|
|
40
|
-
export default TripleFade;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { flipAngles } from "./Hamburger";
|
|
26
|
-
var TripleFlip = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = flipAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
middle: { transform: "scale(0)" },
|
|
35
|
-
bottom: { transform: bottomTransform },
|
|
36
|
-
};
|
|
37
|
-
}, [direction]);
|
|
38
|
-
return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
|
|
39
|
-
};
|
|
40
|
-
export default TripleFlip;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { defaultAngles } from "./Hamburger";
|
|
26
|
-
var TriplePrestige = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = defaultAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
middle: { transform: "scale(0)" },
|
|
35
|
-
bottom: { transform: bottomTransform },
|
|
36
|
-
};
|
|
37
|
-
}, [direction]);
|
|
38
|
-
return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
|
|
39
|
-
};
|
|
40
|
-
export default TriplePrestige;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { useMemo } from "react";
|
|
25
|
-
import Hamburger, { defaultAngles } from "./Hamburger";
|
|
26
|
-
var TripleSpin = function (props) {
|
|
27
|
-
var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
|
|
28
|
-
var openStyle = useMemo(function () {
|
|
29
|
-
var topAngle = defaultAngles[direction];
|
|
30
|
-
var topTransform = "rotate(".concat(topAngle, "deg)");
|
|
31
|
-
var bottomTransform = "rotate(".concat(-topAngle, "deg)");
|
|
32
|
-
return {
|
|
33
|
-
top: { transform: topTransform },
|
|
34
|
-
middle: { opacity: 0 },
|
|
35
|
-
bottom: { transform: bottomTransform },
|
|
36
|
-
outer: { transform: "rotate(180deg)" },
|
|
37
|
-
};
|
|
38
|
-
}, [direction]);
|
|
39
|
-
return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
|
|
40
|
-
};
|
|
41
|
-
export default TripleSpin;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import TriplePrestige from "./TriplePrestige";
|
|
2
|
-
export { TriplePrestige };
|
|
3
|
-
export default TriplePrestige;
|
|
4
|
-
export { default as DoubleCross } from "./DoubleCross";
|
|
5
|
-
export { default as DoubleFlip } from "./DoubleFlip";
|
|
6
|
-
export { default as DoubleSpin } from "./DoubleSpin";
|
|
7
|
-
export { default as TripleFade } from "./TripleFade";
|
|
8
|
-
export { default as TripleFlip } from "./TripleFlip";
|
|
9
|
-
export { default as TripleSpin } from "./TripleSpin";
|
package/components/Icon/Icon.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import React from "react";
|
|
25
|
-
import icons from "./icons";
|
|
26
|
-
import { classNames } from "../../functions";
|
|
27
|
-
import ui from "../ui";
|
|
28
|
-
var Icon = React.forwardRef(function (_a, ref) {
|
|
29
|
-
var icon = _a.icon, className = _a.className, _b = _a.size, size = _b === void 0 ? "s" : _b, rest = __rest(_a, ["icon", "className", "size"]);
|
|
30
|
-
return (_jsx(ui.svg, __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", className: classNames("aui-icon", "aui-icon-".concat(size), className) }, rest, { ref: ref, children: _jsx("path", { d: icons[icon] }) })));
|
|
31
|
-
});
|
|
32
|
-
export default Icon;
|