@ape.swap/bonds-sdk 1.0.158 → 1.0.159
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/dist/components/Flex/index.d.ts +3 -0
- package/dist/components/Flex/index.js +29 -0
- package/dist/components/ProgressBar/ProgressBar.js +1 -2
- package/dist/components/ProgressBar/ProgressBarWrapper.js +5 -2
- package/dist/components/Skeleton/index.d.ts +4 -0
- package/dist/components/Skeleton/index.js +31 -0
- package/dist/components/Skeleton/styles.d.ts +5 -0
- package/dist/components/Skeleton/styles.js +40 -0
- package/dist/components/Skeleton/types.d.ts +18 -0
- package/dist/components/Skeleton/types.js +10 -0
- package/dist/components/Text/index.d.ts +4 -0
- package/dist/components/Text/index.js +35 -0
- package/dist/components/Text/types.d.ts +23 -0
- package/dist/components/Text/types.js +13 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/index.js +66 -0
- package/dist/components/Tooltip/styles.d.ts +4 -0
- package/dist/components/Tooltip/styles.js +60 -0
- package/dist/components/Tooltip/types.d.ts +17 -0
- package/dist/components/Tooltip/types.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
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 "theme-ui/jsx-runtime";
|
|
24
|
+
import { Flex as ThemeUIFlex } from 'theme-ui';
|
|
25
|
+
var Flex = function (_a) {
|
|
26
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
27
|
+
return _jsx(ThemeUIFlex, __assign({}, props, { children: children }));
|
|
28
|
+
};
|
|
29
|
+
export default Flex;
|
|
@@ -10,8 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "theme-ui/jsx-runtime";
|
|
13
|
-
import { Box } from 'theme-ui';
|
|
14
|
-
import { Flex } from '../uikit';
|
|
13
|
+
import { Box, Flex } from 'theme-ui';
|
|
15
14
|
var ProgressBar = function (_a) {
|
|
16
15
|
var value = _a.value, _b = _a.color, color = _b === void 0 ? 'text' : _b;
|
|
17
16
|
return (_jsx(Flex, __assign({ sx: { width: ['100px', '100px', '100px', '100%'], alignItems: 'center', flexDirection: 'row', mt: '5px' } }, { children: _jsx(Box, __assign({ sx: {
|
|
@@ -13,10 +13,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { useTranslation } from '../../contexts/Localization';
|
|
15
15
|
import { styles } from './styles';
|
|
16
|
-
import { Flex
|
|
16
|
+
import { Flex } from 'theme-ui';
|
|
17
|
+
import TooltipBubble from '../Tooltip';
|
|
18
|
+
import Skeleton from '../Skeleton';
|
|
19
|
+
import Text from '../Text';
|
|
17
20
|
var ProgressBarWrapper = function (_a) {
|
|
18
21
|
var title = _a.title, value = _a.value, style = _a.style, showTooltip = _a.showTooltip, toolTipPlacement = _a.toolTipPlacement, toolTipTransform = _a.toolTipTransform, toolTip = _a.toolTip;
|
|
19
22
|
var t = useTranslation().t;
|
|
20
|
-
return (_jsxs(Flex, __assign({ sx: style }, { children: [_jsx(Flex, __assign({ sx: { alignItems: 'center' } }, { children: _jsx(Text, __assign({ sx: styles.titleText }, { children: t("".concat(title)) })) })), showTooltip ? (_jsx(Flex, { sx: { alignItems: 'center', width: '100%' } })) : (_jsx(Flex, __assign({ sx: { justifyContent: 'center', alignItems: 'center' } }, { children: value ? value : _jsx(Skeleton, { sx: styles.skeleton }) })))] })));
|
|
23
|
+
return (_jsxs(Flex, __assign({ sx: style }, { children: [_jsx(Flex, __assign({ sx: { alignItems: 'center' } }, { children: _jsx(Text, __assign({ sx: styles.titleText }, { children: t("".concat(title)) })) })), showTooltip ? (_jsx(Flex, __assign({ sx: { alignItems: 'center', width: '100%' } }, { children: _jsx(TooltipBubble, __assign({ placement: toolTipPlacement, transformTip: toolTipTransform, body: _jsx(Flex, __assign({ sx: { justifyContent: 'center' } }, { children: toolTip })), width: "250px" }, { children: _jsx(Flex, __assign({ sx: { justifyContent: 'center', alignItems: 'center', width: '127px' } }, { children: value ? value : _jsx(Skeleton, { sx: styles.skeleton }) })) })) }))) : (_jsx(Flex, __assign({ sx: { justifyContent: 'center', alignItems: 'center' } }, { children: value ? value : _jsx(Skeleton, { sx: styles.skeleton }) })))] })));
|
|
21
24
|
};
|
|
22
25
|
export default React.memo(ProgressBarWrapper);
|
|
@@ -0,0 +1,31 @@
|
|
|
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 "theme-ui/jsx-runtime";
|
|
24
|
+
import { Box } from 'theme-ui';
|
|
25
|
+
import { animation as ANIMATION, variant as VARIANT } from './types';
|
|
26
|
+
import styles from './styles';
|
|
27
|
+
var Skeleton = function (_a) {
|
|
28
|
+
var _b = _a.variant, variant = _b === void 0 ? VARIANT.RECT : _b, _c = _a.animation, animation = _c === void 0 ? ANIMATION.PULSE : _c, props = __rest(_a, ["variant", "animation"]);
|
|
29
|
+
return (_jsx(Box, __assign({}, props, { sx: __assign(__assign({}, (animation === ANIMATION.WAVES ? styles.waves : styles.pulse)), { height: props.height, width: props.width, borderRadius: variant === VARIANT.RECT ? '10px' : '50%' }) })));
|
|
30
|
+
};
|
|
31
|
+
export default Skeleton;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { keyframes } from '@emotion/react';
|
|
2
|
+
export var waves = keyframes({
|
|
3
|
+
from: { left: '-150px' },
|
|
4
|
+
to: { left: '100%' },
|
|
5
|
+
});
|
|
6
|
+
export var pulse = keyframes({
|
|
7
|
+
'0%': { opacity: 1 },
|
|
8
|
+
'50%': { opacity: 0.4 },
|
|
9
|
+
'100%': { opacity: 1 },
|
|
10
|
+
});
|
|
11
|
+
var styles = {
|
|
12
|
+
waves: {
|
|
13
|
+
position: 'relative',
|
|
14
|
+
overflow: 'hidden',
|
|
15
|
+
transform: 'translate3d(0, 0, 0)',
|
|
16
|
+
borderRadius: '',
|
|
17
|
+
minHeight: '20px',
|
|
18
|
+
display: 'block',
|
|
19
|
+
backgroundColor: 'backgroundDisabled',
|
|
20
|
+
'&:before': {
|
|
21
|
+
content: "\"\"",
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
backgroundImage: 'linear-gradient(90deg, transparent, rgba(243, 243, 243, 0.3), transparent)',
|
|
24
|
+
top: 0,
|
|
25
|
+
left: '-150px',
|
|
26
|
+
height: '100%',
|
|
27
|
+
width: '250px',
|
|
28
|
+
animation: "".concat(waves, " 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite"),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
pulse: {
|
|
32
|
+
animation: "".concat(pulse, " 2s infinite ease-out"),
|
|
33
|
+
transform: 'translate3d(0, 0, 0)',
|
|
34
|
+
borderRadius: '2px',
|
|
35
|
+
minHeight: '20px',
|
|
36
|
+
display: 'block',
|
|
37
|
+
backgroundColor: 'backgroundDisabled',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export default styles;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BoxProps } from 'theme-ui';
|
|
2
|
+
export declare enum animation {
|
|
3
|
+
WAVES = "waves",
|
|
4
|
+
PULSE = "pulse"
|
|
5
|
+
}
|
|
6
|
+
export declare enum variant {
|
|
7
|
+
RECT = "rect",
|
|
8
|
+
CIRCLE = "circle"
|
|
9
|
+
}
|
|
10
|
+
type Animation = `${animation}`;
|
|
11
|
+
type Variant = `${variant}`;
|
|
12
|
+
export interface SkeletonProps extends BoxProps {
|
|
13
|
+
animation?: Animation;
|
|
14
|
+
variant?: Variant;
|
|
15
|
+
width?: string | number;
|
|
16
|
+
height?: string | number;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var animation;
|
|
2
|
+
(function (animation) {
|
|
3
|
+
animation["WAVES"] = "waves";
|
|
4
|
+
animation["PULSE"] = "pulse";
|
|
5
|
+
})(animation || (animation = {}));
|
|
6
|
+
export var variant;
|
|
7
|
+
(function (variant) {
|
|
8
|
+
variant["RECT"] = "rect";
|
|
9
|
+
variant["CIRCLE"] = "circle";
|
|
10
|
+
})(variant || (variant = {}));
|
|
@@ -0,0 +1,35 @@
|
|
|
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 "theme-ui/jsx-runtime";
|
|
24
|
+
import { Text as ThemeUIText } from 'theme-ui';
|
|
25
|
+
import { variants } from './types';
|
|
26
|
+
var Text = function (_a) {
|
|
27
|
+
var _b = _a.variant, variant = _b === void 0 ? variants.NORMAL : _b, _c = _a.weight, weight = _c === void 0 ? variants.NORMAL : _c, size = _a.size, children = _a.children, _d = _a.color, color = _d === void 0 ? 'text' : _d, props = __rest(_a, ["variant", "weight", "size", "children", "color"]);
|
|
28
|
+
return (_jsx(ThemeUIText, __assign({}, props, { sx: {
|
|
29
|
+
variant: variant === variants.LINK ? "flex.".concat(variant) : "text.".concat(variant),
|
|
30
|
+
color: color,
|
|
31
|
+
fontWeight: weight,
|
|
32
|
+
fontSize: size,
|
|
33
|
+
} }, { children: children })));
|
|
34
|
+
};
|
|
35
|
+
export default Text;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TextProps as ThemeUITextProps } from 'theme-ui';
|
|
2
|
+
export declare enum variants {
|
|
3
|
+
SMALL = "sm",
|
|
4
|
+
NORMAL = "md",
|
|
5
|
+
LARGE = "lg",
|
|
6
|
+
LINK = "link"
|
|
7
|
+
}
|
|
8
|
+
export declare enum weights {
|
|
9
|
+
LIGHT = "light",
|
|
10
|
+
NORMAL = "normal",
|
|
11
|
+
BOLD = "bold"
|
|
12
|
+
}
|
|
13
|
+
type variantProps = `${variants}`;
|
|
14
|
+
type weightProps = `${weights}` | number;
|
|
15
|
+
type sizeProps = string;
|
|
16
|
+
export interface TextProps extends Omit<ThemeUITextProps, 'sx'> {
|
|
17
|
+
variant?: variantProps;
|
|
18
|
+
weight?: weightProps;
|
|
19
|
+
color?: string;
|
|
20
|
+
size?: sizeProps;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var variants;
|
|
2
|
+
(function (variants) {
|
|
3
|
+
variants["SMALL"] = "sm";
|
|
4
|
+
variants["NORMAL"] = "md";
|
|
5
|
+
variants["LARGE"] = "lg";
|
|
6
|
+
variants["LINK"] = "link";
|
|
7
|
+
})(variants || (variants = {}));
|
|
8
|
+
export var weights;
|
|
9
|
+
(function (weights) {
|
|
10
|
+
weights["LIGHT"] = "light";
|
|
11
|
+
weights["NORMAL"] = "normal";
|
|
12
|
+
weights["BOLD"] = "bold";
|
|
13
|
+
})(weights || (weights = {}));
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
var _a;
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
25
|
+
import { Box } from 'theme-ui';
|
|
26
|
+
import { placements } from './types';
|
|
27
|
+
import style, { container } from './styles';
|
|
28
|
+
var placementStyles = (_a = {},
|
|
29
|
+
_a[placements.BOTTOMLEFT] = {
|
|
30
|
+
top: 'calc(100% + 15px)',
|
|
31
|
+
left: 0,
|
|
32
|
+
},
|
|
33
|
+
_a[placements.BOTTOMRIGHT] = {
|
|
34
|
+
top: 'calc(100% + 15px)',
|
|
35
|
+
right: 0,
|
|
36
|
+
},
|
|
37
|
+
_a[placements.TOPLEFT] = {
|
|
38
|
+
bottom: 'calc(100% + 15px)',
|
|
39
|
+
left: 0,
|
|
40
|
+
},
|
|
41
|
+
_a[placements.TOPRIGHT] = {
|
|
42
|
+
bottom: 'calc(100% + 15px)',
|
|
43
|
+
right: 0,
|
|
44
|
+
},
|
|
45
|
+
_a[placements.ONLYCONTAINERRIGHT] = {
|
|
46
|
+
top: 'calc(100% + 15px)',
|
|
47
|
+
right: 0,
|
|
48
|
+
},
|
|
49
|
+
_a);
|
|
50
|
+
var TooltipBubble = function (_a) {
|
|
51
|
+
var width = _a.width, _b = _a.placement, placement = _b === void 0 ? placements.BOTTOMRIGHT : _b, body = _a.body, backgroundColor = _a.backgroundColor, hideTooltip = _a.hideTooltip, children = _a.children, transformTip = _a.transformTip, props = __rest(_a, ["width", "placement", "body", "backgroundColor", "hideTooltip", "children", "transformTip"]);
|
|
52
|
+
var backgroundColorStyle = backgroundColor
|
|
53
|
+
? {
|
|
54
|
+
backgroundColor: backgroundColor,
|
|
55
|
+
'&:before': {
|
|
56
|
+
borderBottomColor: placement === placements.BOTTOMLEFT || placement === placements.BOTTOMRIGHT ? backgroundColor : undefined,
|
|
57
|
+
borderTopColor: placement === placements.TOPLEFT || placement === placements.TOPRIGHT ? backgroundColor : undefined,
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
: {};
|
|
61
|
+
var handleClick = function (event) {
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
};
|
|
64
|
+
return (_jsxs(Box, __assign({ sx: container(hideTooltip), onClick: handleClick }, { children: [_jsx(Box, __assign({ sx: __assign({ position: 'absolute' }, (placementStyles[placement] || {})) }, { children: _jsx(Box, __assign({ sx: __assign(__assign(__assign(__assign({ position: 'relative' }, style.default), style[placement]), backgroundColorStyle), { width: width, transform: transformTip }) }, props, { children: body })) })), children] })));
|
|
65
|
+
};
|
|
66
|
+
export default TooltipBubble;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 baseStyle = {
|
|
13
|
+
p: 9,
|
|
14
|
+
borderRadius: 'normal',
|
|
15
|
+
background: 'white2',
|
|
16
|
+
width: 'max-content',
|
|
17
|
+
zIndex: 'modal',
|
|
18
|
+
boxShadow: "0px 0px 30px rgb(200,200,200, .4)",
|
|
19
|
+
};
|
|
20
|
+
var baseDirectionArrow = {
|
|
21
|
+
content: '""',
|
|
22
|
+
display: 'block',
|
|
23
|
+
width: 0,
|
|
24
|
+
border: '12px solid transparent',
|
|
25
|
+
};
|
|
26
|
+
var topArrow = __assign(__assign({ bottom: 0 }, baseDirectionArrow), { borderBottom: 0, borderTopWidth: '15px', borderTopStyle: 'solid', transform: 'translate(-50%, calc(100%))' });
|
|
27
|
+
var bottomArrow = __assign(__assign({ top: 0 }, baseDirectionArrow), { borderTop: 0, borderBottomWidth: '15px', borderBottomStyle: 'solid', transform: 'translate(-50%, calc(-100%))' });
|
|
28
|
+
export var container = function (hide) { return ({
|
|
29
|
+
position: 'relative',
|
|
30
|
+
display: 'inline-block',
|
|
31
|
+
'& > div:first-of-type': {
|
|
32
|
+
display: 'none',
|
|
33
|
+
},
|
|
34
|
+
'&:hover > div:first-of-type': {
|
|
35
|
+
display: hide ? 'none' : 'block',
|
|
36
|
+
},
|
|
37
|
+
}); };
|
|
38
|
+
var styles = {
|
|
39
|
+
default: __assign({ color: 'text', fontSize: 0, lineHeight: '18px', fontWeight: 'normal' }, baseStyle),
|
|
40
|
+
bottomRight: {
|
|
41
|
+
'&::before': __assign(__assign({ position: 'absolute' }, bottomArrow), { right: '3%', borderBottomColor: 'white2' }),
|
|
42
|
+
},
|
|
43
|
+
bottomLeft: {
|
|
44
|
+
'&::before': __assign(__assign({ position: 'absolute' }, bottomArrow), { left: 'calc(3% + 15px)', borderBottomColor: 'white2' }),
|
|
45
|
+
},
|
|
46
|
+
topRight: {
|
|
47
|
+
'&::before': __assign(__assign({ position: 'absolute' }, topArrow), { right: '3%', borderTopColor: 'white2' }),
|
|
48
|
+
},
|
|
49
|
+
topLeft: {
|
|
50
|
+
'&::before': __assign(__assign({ position: 'absolute' }, topArrow), { left: 'calc(3% + 15px)', borderTopColor: 'white2' }),
|
|
51
|
+
},
|
|
52
|
+
onlyContainerRight: {
|
|
53
|
+
'&::before': {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
right: '3%',
|
|
56
|
+
borderBottomColor: 'white2',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export default styles;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from 'theme-ui';
|
|
3
|
+
export declare enum placements {
|
|
4
|
+
TOPRIGHT = "topRight",
|
|
5
|
+
TOPLEFT = "topLeft",
|
|
6
|
+
BOTTOMRIGHT = "bottomRight",
|
|
7
|
+
BOTTOMLEFT = "bottomLeft",
|
|
8
|
+
ONLYCONTAINERRIGHT = "onlyContainerRight"
|
|
9
|
+
}
|
|
10
|
+
export type placementProps = `${placements}`;
|
|
11
|
+
export interface TooltipProps extends BoxProps {
|
|
12
|
+
width?: string;
|
|
13
|
+
placement?: placementProps;
|
|
14
|
+
body: ReactNode;
|
|
15
|
+
hideTooltip?: boolean;
|
|
16
|
+
transformTip?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var placements;
|
|
2
|
+
(function (placements) {
|
|
3
|
+
placements["TOPRIGHT"] = "topRight";
|
|
4
|
+
placements["TOPLEFT"] = "topLeft";
|
|
5
|
+
placements["BOTTOMRIGHT"] = "bottomRight";
|
|
6
|
+
placements["BOTTOMLEFT"] = "bottomLeft";
|
|
7
|
+
placements["ONLYCONTAINERRIGHT"] = "onlyContainerRight";
|
|
8
|
+
})(placements || (placements = {}));
|