@xfers/design-system 3.1.26 → 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.
- package/cjs/index.js +6 -6
- package/cjs/index.js.map +1 -1
- package/dist/components/Tooltip/index.js +30 -38
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/types/components/Tooltip/index.d.ts +7 -15
- package/es/icons.js +1 -1
- package/es/index.js +4 -4
- package/es/index.js.map +1 -1
- package/es/logos.js +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,28 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
+
t[p[i]] = s[p[i]];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
6
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
29
|
var react_1 = require("react");
|
|
8
30
|
var tooltip_1 = require("antd/es/tooltip");
|
|
@@ -10,45 +32,15 @@ require("antd/es/tooltip/style/css");
|
|
|
10
32
|
var styled_1 = require("@emotion/styled");
|
|
11
33
|
var emotion_1 = require("emotion");
|
|
12
34
|
var breakPoints_1 = require("src/constants/breakPoints");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var theme_1 = require("src/theme/theme");
|
|
17
|
-
var Typography_1 = require("../Typography");
|
|
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"])));
|
|
18
38
|
function default_1(_a) {
|
|
19
|
-
var children = _a.children, _b = _a.placement, placement = _b === void 0 ? 'bottomRight' : _b, _c = _a.overlayClassName, overlayClassName = _c === void 0 ? defaultOverlayStyle : _c,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onDismiss();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var onActionButtonClick = function (e) {
|
|
27
|
-
e.preventDefault();
|
|
28
|
-
if (onAction) {
|
|
29
|
-
onAction();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var overlayStyle = maxWidth ? { maxWidth: maxWidth } : undefined;
|
|
33
|
-
return (react_1.default.createElement(tooltip_1.default, { overlayClassName: overlayClassName, arrowPointAtCenter: arrowPointAtCenter, trigger: trigger, color: color, placement: placement, overlayStyle: overlayStyle, title: react_1.default.createElement(Container, null,
|
|
34
|
-
title && (react_1.default.createElement(Typography_1.P1Bold, { style: {
|
|
35
|
-
fontSize: TypographyStyles_1.FONT_SIZE.P1,
|
|
36
|
-
marginBottom: '16px',
|
|
37
|
-
color: theme_1.straitsXTheme.text.white
|
|
38
|
-
} },
|
|
39
|
-
title,
|
|
40
|
-
isNew === true && react_1.default.createElement(Badge, null, "New"))),
|
|
41
|
-
content,
|
|
42
|
-
(actionTitle || dismissTitle) && (react_1.default.createElement(FooterContainer, null,
|
|
43
|
-
react_1.default.createElement(DismissButton, { onClick: onDismissButtonClick }, dismissTitle),
|
|
44
|
-
react_1.default.createElement(ActionButton, { onClick: onActionButtonClick }, actionTitle)))), mouseEnterDelay: mouseEnterDelay, mouseLeaveDelay: mouseLeaveDelay }, 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));
|
|
45
43
|
}
|
|
46
44
|
exports.default = default_1;
|
|
47
|
-
var
|
|
48
|
-
var Container = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n line-height: 22px;\n"], ["\n line-height: 22px;\n"])));
|
|
49
|
-
var FooterContainer = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 24px 0 0 0;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin: 0 0 0 20px;\n }\n"], ["\n margin: 24px 0 0 0;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin: 0 0 0 20px;\n }\n"])));
|
|
50
|
-
var Badge = styled_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n margin: 0 0 0 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: 0 0 0 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);
|
|
51
|
-
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);
|
|
52
|
-
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);
|
|
53
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
45
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
54
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":"
|
|
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,24 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'antd/es/tooltip/style/css';
|
|
3
|
-
declare type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
4
|
-
declare type
|
|
3
|
+
declare type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
4
|
+
declare type RenderFunction = () => React.ReactNode;
|
|
5
5
|
declare type Props = {
|
|
6
6
|
children: React.ReactElement;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
isNew?: boolean;
|
|
10
|
-
color?: string;
|
|
7
|
+
title: React.ReactNode | RenderFunction;
|
|
8
|
+
footer?: React.ReactNode | RenderFunction;
|
|
11
9
|
placement?: TooltipPlacement;
|
|
12
|
-
|
|
13
|
-
arrowPointAtCenter?: boolean;
|
|
10
|
+
overlayClassName?: string;
|
|
14
11
|
mouseEnterDelay?: number;
|
|
15
12
|
mouseLeaveDelay?: number;
|
|
16
|
-
|
|
17
|
-
dismissTitle?: string;
|
|
18
|
-
maxWidth?: string;
|
|
19
|
-
onAction?: () => void;
|
|
20
|
-
onDismiss?: () => void;
|
|
21
|
-
overlayClassName?: string;
|
|
13
|
+
color?: string;
|
|
22
14
|
};
|
|
23
|
-
export default function ({ children, placement, overlayClassName,
|
|
15
|
+
export default function ({ children, placement, overlayClassName, color, title, footer, mouseEnterDelay, mouseLeaveDelay, ...rest }: Props): JSX.Element;
|
|
24
16
|
export {};
|