@xfers/design-system 3.1.25 → 3.1.27
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.
|
@@ -32,44 +32,15 @@ require("antd/es/tooltip/style/css");
|
|
|
32
32
|
var styled_1 = require("@emotion/styled");
|
|
33
33
|
var emotion_1 = require("emotion");
|
|
34
34
|
var breakPoints_1 = require("src/constants/breakPoints");
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var theme_1 = require("src/theme/theme");
|
|
39
|
-
var Typography_1 = require("../Typography");
|
|
40
|
-
var defaultOverlayStyle = emotion_1.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: 200px;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n box-shadow: none;\n\n .ant-tooltip-inner {\n padding: 12px;\n border-radius: 8px;\n box-shadow: none;\n background-color: ", ";\n }\n\n ", " {\n max-width: 250px;\n }\n\n .ant-tooltip-arrow {\n width: 16px;\n height: 16px;\n\n .ant-tooltip-arrow-content {\n background-color: ", ";\n box-shadow: none;\n width: 16px;\n height: 16px;\n }\n }\n\n &.ant-tooltip-placement-topRight .ant-tooltip-arrow,\n &.ant-tooltip-placement-topLeft .ant-tooltip-arrow,\n &.ant-tooltip-placement-top .ant-tooltip-arrow {\n bottom: -3px;\n }\n &.ant-tooltip-placement-bottomRight .ant-tooltip-arrow,\n &.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,\n &.ant-tooltip-placement-bottom .ant-tooltip-arrow {\n top: -3px;\n }\n &.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,\n &.ant-tooltip-placement-rightTop .ant-tooltip-arrow,\n &.ant-tooltip-placement-right .ant-tooltip-arrow {\n left: -3px;\n }\n &.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,\n &.ant-tooltip-placement-leftTop .ant-tooltip-arrow,\n &.ant-tooltip-placement-left .ant-tooltip-arrow {\n right: -3px;\n }\n"], ["\n max-width: 200px;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n box-shadow: none;\n\n .ant-tooltip-inner {\n padding: 12px;\n border-radius: 8px;\n box-shadow: none;\n background-color: ", ";\n }\n\n ", " {\n max-width: 250px;\n }\n\n .ant-tooltip-arrow {\n width: 16px;\n height: 16px;\n\n .ant-tooltip-arrow-content {\n background-color: ", ";\n box-shadow: none;\n width: 16px;\n height: 16px;\n }\n }\n\n &.ant-tooltip-placement-topRight .ant-tooltip-arrow,\n &.ant-tooltip-placement-topLeft .ant-tooltip-arrow,\n &.ant-tooltip-placement-top .ant-tooltip-arrow {\n bottom: -3px;\n }\n &.ant-tooltip-placement-bottomRight .ant-tooltip-arrow,\n &.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,\n &.ant-tooltip-placement-bottom .ant-tooltip-arrow {\n top: -3px;\n }\n &.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,\n &.ant-tooltip-placement-rightTop .ant-tooltip-arrow,\n &.ant-tooltip-placement-right .ant-tooltip-arrow {\n left: -3px;\n }\n &.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,\n &.ant-tooltip-placement-leftTop .ant-tooltip-arrow,\n &.ant-tooltip-placement-left .ant-tooltip-arrow {\n right: -3px;\n }\n"])), fontStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, TypographyStyles_1.FONT_WEIGHT.REGULAR, theme_1.straitsXTheme.text.white, theme_1.straitsXTheme.brand.primary.contrast, breakPoints_1.DESKTOP_BREAKPOINT, theme_1.straitsXTheme.brand.primary.contrast);
|
|
41
|
-
var Container = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n line-height: 22px;\n"], ["\n line-height: 22px;\n"])));
|
|
42
|
-
var FooterContainer = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: 24px;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin-left: 20px;\n }\n"], ["\n margin-top: 24px;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin-left: 20px;\n }\n"])));
|
|
43
|
-
var Badge = styled_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n margin-left: 8px;\n padding: 2px 6px;\n background-color: ", ";\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n border-radius: 4px;\n"], ["\n display: inline-block;\n margin-left: 8px;\n padding: 2px 6px;\n background-color: ", ";\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n border-radius: 4px;\n"])), ColorStyles_1.GREEN_COLORS.G400, theme_1.straitsXTheme.text.white, TypographyStyles_1.FONT_SIZE.SMALL, TypographyStyles_1.FONT_WEIGHT.BOLD);
|
|
44
|
-
var ActionButton = styled_1.default.a(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-weight: ", ";\n color: ", ";\n &:hover {\n color: ", ";\n }\n"], ["\n font-weight: ", ";\n color: ", ";\n &:hover {\n color: ", ";\n }\n"])), TypographyStyles_1.FONT_WEIGHT.BOLD, theme_1.straitsXTheme.brand.action.default, theme_1.straitsXTheme.brand.action.hover);
|
|
45
|
-
var DismissButton = styled_1.default.a(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-weight: ", ";\n color: ", ";\n &:hover {\n color: ", ";\n }\n"], ["\n font-weight: ", ";\n color: ", ";\n &:hover {\n color: ", ";\n }\n"])), TypographyStyles_1.FONT_WEIGHT.BOLD, theme_1.straitsXTheme.text.white, theme_1.straitsXTheme.text.white);
|
|
35
|
+
var defaultOverlayStyle = emotion_1.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-shadow: none;\n max-width: 200px;\n\n & .ant-tooltip-inner {\n border-radius: 5px;\n box-shadow: 0px 4px 15px rgba(149, 149, 149, 0.25);\n transform: translateX(10px);\n background-color: rgba(0, 0, 0, 0.95);\n }\n\n ", " {\n max-width: 260px;\n }\n"], ["\n box-shadow: none;\n max-width: 200px;\n\n & .ant-tooltip-inner {\n border-radius: 5px;\n box-shadow: 0px 4px 15px rgba(149, 149, 149, 0.25);\n transform: translateX(10px);\n background-color: rgba(0, 0, 0, 0.95);\n }\n\n ", " {\n max-width: 260px;\n }\n"])), breakPoints_1.DESKTOP_BREAKPOINT);
|
|
36
|
+
var Container = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 7px;\n font-family: 'Hanken Grotesk', Inter;\n font-style: normal;\n font-weight: 500;\n font-size: 15px;\n line-height: 22px;\n color: #ffffff;\n\n h1 {\n font-family: 'Hanken Grotesk', Inter;\n font-style: normal;\n font-weight: bold;\n font-size: 16px;\n line-height: 19px;\n margin: 0;\n color: #ffffff;\n margin-bottom: 10px;\n }\n"], ["\n padding: 7px;\n font-family: 'Hanken Grotesk', Inter;\n font-style: normal;\n font-weight: 500;\n font-size: 15px;\n line-height: 22px;\n color: #ffffff;\n\n h1 {\n font-family: 'Hanken Grotesk', Inter;\n font-style: normal;\n font-weight: bold;\n font-size: 16px;\n line-height: 19px;\n margin: 0;\n color: #ffffff;\n margin-bottom: 10px;\n }\n"])));
|
|
37
|
+
var FooterContainer = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: 20px;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin-left: 20px;\n }\n"], ["\n margin-top: 20px;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin-left: 20px;\n }\n"])));
|
|
46
38
|
function default_1(_a) {
|
|
47
|
-
var children = _a.children, _b = _a.placement, placement = _b === void 0 ? 'bottomRight' : _b, _c = _a.overlayClassName, overlayClassName = _c === void 0 ? defaultOverlayStyle : _c,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onDismiss();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var onActionButtonClick = function (e) {
|
|
55
|
-
e.preventDefault();
|
|
56
|
-
if (onAction) {
|
|
57
|
-
onAction();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
return (react_1.default.createElement(tooltip_1.default, __assign({ overlayClassName: overlayClassName, arrowPointAtCenter: arrowPointAtCenter, color: color, placement: placement, title: react_1.default.createElement(Container, null,
|
|
61
|
-
title && (react_1.default.createElement(Typography_1.P1Bold, { style: {
|
|
62
|
-
fontSize: TypographyStyles_1.FONT_SIZE.P1,
|
|
63
|
-
marginBottom: '16px',
|
|
64
|
-
color: theme_1.straitsXTheme.text.white
|
|
65
|
-
} },
|
|
66
|
-
title,
|
|
67
|
-
isNew === true && react_1.default.createElement(Badge, null, "New"))),
|
|
68
|
-
content,
|
|
69
|
-
(actionTitle || dismissTitle) && (react_1.default.createElement(FooterContainer, null,
|
|
70
|
-
react_1.default.createElement(DismissButton, { onClick: onDismissButtonClick }, dismissTitle),
|
|
71
|
-
react_1.default.createElement(ActionButton, { onClick: onActionButtonClick }, actionTitle)))), mouseEnterDelay: mouseEnterDelay, mouseLeaveDelay: mouseLeaveDelay }, rest), children));
|
|
39
|
+
var children = _a.children, _b = _a.placement, placement = _b === void 0 ? 'bottomRight' : _b, _c = _a.overlayClassName, overlayClassName = _c === void 0 ? defaultOverlayStyle : _c, color = _a.color, title = _a.title, footer = _a.footer, _d = _a.mouseEnterDelay, mouseEnterDelay = _d === void 0 ? 0 : _d, _e = _a.mouseLeaveDelay, mouseLeaveDelay = _e === void 0 ? 0 : _e, rest = __rest(_a, ["children", "placement", "overlayClassName", "color", "title", "footer", "mouseEnterDelay", "mouseLeaveDelay"]);
|
|
40
|
+
return (react_1.default.createElement(tooltip_1.default, __assign({ overlayClassName: overlayClassName, arrowPointAtCenter: true, color: color, placement: placement, title: react_1.default.createElement(Container, null,
|
|
41
|
+
title,
|
|
42
|
+
footer && react_1.default.createElement(FooterContainer, null, footer)), mouseEnterDelay: mouseEnterDelay, mouseLeaveDelay: mouseLeaveDelay }, rest), children));
|
|
72
43
|
}
|
|
73
44
|
exports.default = default_1;
|
|
74
|
-
var templateObject_1, templateObject_2, templateObject_3
|
|
45
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
75
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,2CAAqC;AACrC,qCAAkC;AAElC,0CAAoC;AACpC,mCAA6B;AAC7B,yDAA8D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,2CAAqC;AACrC,qCAAkC;AAElC,0CAAoC;AACpC,mCAA6B;AAC7B,yDAA8D;AA6B9D,IAAM,mBAAmB,GAAG,aAAG,0VAAA,mPAW3B,EAAkB,kCAGrB,KAHG,gCAAkB,CAGrB,CAAA;AAED,IAAM,SAAS,GAAG,gBAAM,CAAC,GAAG,kcAAA,+XAmB3B,IAAA,CAAA;AAED,IAAM,eAAe,GAAG,gBAAM,CAAC,GAAG,kLAAA,+GAQjC,IAAA,CAAA;AAED,mBAAwB,EAUhB;IATN,IAAA,QAAQ,cAAA,EACR,iBAAyB,EAAzB,SAAS,mBAAG,aAAa,KAAA,EACzB,wBAAsC,EAAtC,gBAAgB,mBAAG,mBAAmB,KAAA,EACtC,KAAK,WAAA,EACL,KAAK,WAAA,EACL,MAAM,YAAA,EACN,uBAAmB,EAAnB,eAAe,mBAAG,CAAC,KAAA,EACnB,uBAAmB,EAAnB,eAAe,mBAAG,CAAC,KAAA,EAChB,IAAI,cATe,+GAUvB,CADQ;IAEP,OAAO,CACL,8BAAC,iBAAO,aACN,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,QAClB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,KAAK,EACH,8BAAC,SAAS;YACP,KAAK;YACL,MAAM,IAAI,8BAAC,eAAe,QAAE,MAAM,CAAmB,CAC5C,EAEd,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,IAC5B,IAAI,GAEP,QAAQ,CACD,CACX,CAAA;AACH,CAAC;AA9BD,4BA8BC"}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'antd/es/tooltip/style/css';
|
|
3
3
|
declare type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
4
|
+
declare type RenderFunction = () => React.ReactNode;
|
|
4
5
|
declare type Props = {
|
|
5
6
|
children: React.ReactElement;
|
|
6
|
-
|
|
7
|
+
title: React.ReactNode | RenderFunction;
|
|
8
|
+
footer?: React.ReactNode | RenderFunction;
|
|
7
9
|
placement?: TooltipPlacement;
|
|
8
10
|
overlayClassName?: string;
|
|
9
11
|
mouseEnterDelay?: number;
|
|
10
12
|
mouseLeaveDelay?: number;
|
|
11
|
-
arrowPointAtCenter?: boolean;
|
|
12
13
|
color?: string;
|
|
13
|
-
overlayStyle?: object;
|
|
14
|
-
title?: string;
|
|
15
|
-
content?: string | React.ReactElement;
|
|
16
|
-
actionTitle?: string;
|
|
17
|
-
dismissTitle?: string;
|
|
18
|
-
onAction?: () => void;
|
|
19
|
-
onDismiss?: () => void;
|
|
20
14
|
};
|
|
21
|
-
export default function ({ children, placement, overlayClassName,
|
|
15
|
+
export default function ({ children, placement, overlayClassName, color, title, footer, mouseEnterDelay, mouseLeaveDelay, ...rest }: Props): JSX.Element;
|
|
22
16
|
export {};
|