@xfers/design-system 3.1.27 → 3.1.28
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 +38 -30
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/constants/colors.js +1 -1
- package/dist/types/components/Tooltip/index.d.ts +15 -7
- package/dist/types/constants/colors.d.ts +1 -1
- package/es/icons.js +1 -1
- package/es/index.js +2 -2
- package/es/index.js.map +1 -1
- package/es/logos.js +1 -1
- package/package.json +1 -1
|
@@ -3,28 +3,6 @@ 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
|
-
};
|
|
28
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
7
|
var react_1 = require("react");
|
|
30
8
|
var tooltip_1 = require("antd/es/tooltip");
|
|
@@ -32,15 +10,45 @@ require("antd/es/tooltip/style/css");
|
|
|
32
10
|
var styled_1 = require("@emotion/styled");
|
|
33
11
|
var emotion_1 = require("emotion");
|
|
34
12
|
var breakPoints_1 = require("src/constants/breakPoints");
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
13
|
+
var fontStyles_1 = require("src/constants/fontStyles");
|
|
14
|
+
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
15
|
+
var ColorStyles_1 = require("src/shared/ColorStyles");
|
|
16
|
+
var theme_1 = require("src/theme/theme");
|
|
17
|
+
var Typography_1 = require("../Typography");
|
|
38
18
|
function default_1(_a) {
|
|
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,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
var children = _a.children, _b = _a.placement, placement = _b === void 0 ? 'bottomRight' : _b, _c = _a.overlayClassName, overlayClassName = _c === void 0 ? defaultOverlayStyle : _c, _d = _a.arrowPointAtCenter, arrowPointAtCenter = _d === void 0 ? true : _d, _e = _a.trigger, trigger = _e === void 0 ? 'hover' : _e, color = _a.color, title = _a.title, content = _a.content, _f = _a.mouseEnterDelay, mouseEnterDelay = _f === void 0 ? 0 : _f, _g = _a.mouseLeaveDelay, mouseLeaveDelay = _g === void 0 ? 0 : _g, _h = _a.isNew, isNew = _h === void 0 ? false : _h, actionTitle = _a.actionTitle, dismissTitle = _a.dismissTitle, maxWidth = _a.maxWidth, onAction = _a.onAction, onDismiss = _a.onDismiss;
|
|
20
|
+
var onDismissButtonClick = function (e) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
if (onDismiss) {
|
|
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));
|
|
43
45
|
}
|
|
44
46
|
exports.default = default_1;
|
|
45
|
-
var templateObject_1,
|
|
47
|
+
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);
|
|
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;
|
|
46
54
|
//# 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;AAC9D,uDAAoD;AACpD,gEAAoE;AACpE,sDAAqD;AACrD,yCAA+C;AAC/C,4CAAsC;AAiCtC,mBAAwB,EAiBhB;QAhBN,QAAQ,cAAA,EACR,iBAAyB,EAAzB,SAAS,mBAAG,aAAa,KAAA,EACzB,wBAAsC,EAAtC,gBAAgB,mBAAG,mBAAmB,KAAA,EACtC,0BAAyB,EAAzB,kBAAkB,mBAAG,IAAI,KAAA,EACzB,eAAiB,EAAjB,OAAO,mBAAG,OAAO,KAAA,EACjB,KAAK,WAAA,EACL,KAAK,WAAA,EACL,OAAO,aAAA,EACP,uBAAmB,EAAnB,eAAe,mBAAG,CAAC,KAAA,EACnB,uBAAmB,EAAnB,eAAe,mBAAG,CAAC,KAAA,EACnB,aAAa,EAAb,KAAK,mBAAG,KAAK,KAAA,EACb,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,SAAS,eA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US;
|
|
114
114
|
(function (STATUS) {
|
|
115
115
|
STATUS["INFO"] = "#2F8DEE";
|
|
116
|
-
STATUS["POSITIVE"] = "#
|
|
116
|
+
STATUS["POSITIVE"] = "#257C58";
|
|
117
117
|
STATUS["WARNING"] = "#E5C412";
|
|
118
118
|
STATUS["CRITICAL"] = "#B71515";
|
|
119
119
|
})(STATUS = exports.STATUS || (exports.STATUS = {}));
|
|
@@ -1,16 +1,24 @@
|
|
|
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';
|
|
4
|
+
declare type TooltipTrigger = 'hover' | 'click';
|
|
5
5
|
declare type Props = {
|
|
6
6
|
children: React.ReactElement;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
content: string | React.ReactElement;
|
|
8
|
+
title?: string;
|
|
9
|
+
isNew?: boolean;
|
|
10
|
+
color?: string;
|
|
9
11
|
placement?: TooltipPlacement;
|
|
10
|
-
|
|
12
|
+
trigger?: TooltipTrigger;
|
|
13
|
+
arrowPointAtCenter?: boolean;
|
|
11
14
|
mouseEnterDelay?: number;
|
|
12
15
|
mouseLeaveDelay?: number;
|
|
13
|
-
|
|
16
|
+
actionTitle?: string;
|
|
17
|
+
dismissTitle?: string;
|
|
18
|
+
maxWidth?: string;
|
|
19
|
+
onAction?: () => void;
|
|
20
|
+
onDismiss?: () => void;
|
|
21
|
+
overlayClassName?: string;
|
|
14
22
|
};
|
|
15
|
-
export default function ({ children, placement, overlayClassName, color, title,
|
|
23
|
+
export default function ({ children, placement, overlayClassName, arrowPointAtCenter, trigger, color, title, content, mouseEnterDelay, mouseLeaveDelay, isNew, actionTitle, dismissTitle, maxWidth, onAction, onDismiss }: Props): JSX.Element;
|
|
16
24
|
export {};
|