@xfers/design-system 3.1.35-dev.900fabe9cb → 3.1.35-dev.95248e7808
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 +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/components/CopyBox/CopyBox.js +9 -9
- package/dist/components/CopyBox/CopyBox.js.map +1 -1
- package/dist/components/CopyBox/styles.js +3 -3
- package/dist/components/CopyBox/styles.js.map +1 -1
- package/dist/types/components/CopyBox/styles.d.ts +2 -4
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,19 +28,19 @@ var CopyToClipboard_1 = require("src/icons/CopyToClipboard");
|
|
|
28
28
|
var theme_1 = require("src/theme/theme");
|
|
29
29
|
var Typography_1 = require("src/constants/Typography/Typography");
|
|
30
30
|
var types_1 = require("./types");
|
|
31
|
-
var
|
|
31
|
+
var styles_1 = require("./styles");
|
|
32
32
|
var CopyBox = function (_a) {
|
|
33
33
|
var value = _a.value, _b = _a.allowCopy, allowCopy = _b === void 0 ? true : _b, _c = _a.valueToCopy, valueToCopy = _c === void 0 ? value : _c, _d = _a.isBlockchainAddress, isBlockchainAddress = _d === void 0 ? true : _d, _e = _a.showCopyIcon, showCopyIcon = _e === void 0 ? true : _e, icon = _a.icon, _f = _a.iconSize, iconSize = _f === void 0 ? types_1.ICON_SIZE.DEFAULT : _f, labelText = _a.labelText, labelTooltip = _a.labelTooltip, helperText = _a.helperText, _g = _a.helperTextType, helperTextType = _g === void 0 ? types_1.HELPER_TEXT.DEFAULT : _g, onButtonClick = _a.onButtonClick, props = __rest(_a, ["value", "allowCopy", "valueToCopy", "isBlockchainAddress", "showCopyIcon", "icon", "iconSize", "labelText", "labelTooltip", "helperText", "helperTextType", "onButtonClick"]);
|
|
34
|
-
return (react_1.default.createElement(
|
|
35
|
-
react_1.default.createElement(
|
|
34
|
+
return (react_1.default.createElement(styles_1.Container, __assign({}, props),
|
|
35
|
+
react_1.default.createElement(styles_1.LabelContainer, null,
|
|
36
36
|
labelText && (react_1.default.createElement(Typography_1.Typography.Body, { size: "md", color: theme_1.straitsXTheme.color.base.onNeutral }, labelText)),
|
|
37
|
-
labelTooltip &&
|
|
38
|
-
react_1.default.createElement(
|
|
39
|
-
react_1.default.createElement(
|
|
40
|
-
icon &&
|
|
37
|
+
labelTooltip && react_1.default.createElement(styles_1.TooltipContainer, null, labelTooltip)),
|
|
38
|
+
react_1.default.createElement(styles_1.CopyContainer, null,
|
|
39
|
+
react_1.default.createElement(styles_1.TextContainer, null,
|
|
40
|
+
icon && react_1.default.createElement(styles_1.IconContainer, { iconSize: iconSize }, icon),
|
|
41
41
|
react_1.default.createElement(Typography_1.Typography.Body, { size: "lg" },
|
|
42
|
-
react_1.default.createElement(
|
|
43
|
-
allowCopy && (react_1.default.createElement(
|
|
42
|
+
react_1.default.createElement(styles_1.TextValueStyles, { isBlockchainAddress: isBlockchainAddress }, value))),
|
|
43
|
+
allowCopy && (react_1.default.createElement(styles_1.CopyButton, { type: "secondary", onClick: function () {
|
|
44
44
|
if (onButtonClick !== undefined)
|
|
45
45
|
onButtonClick();
|
|
46
46
|
copy_to_clipboard_1.default(valueToCopy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyBox.js","sourceRoot":"","sources":["../../../src/components/CopyBox/CopyBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,uDAAoC;AACpC,6DAAuD;AACvD,yCAA+C;AAC/C,kEAAgE;AAChE,iCAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"CopyBox.js","sourceRoot":"","sources":["../../../src/components/CopyBox/CopyBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,uDAAoC;AACpC,6DAAuD;AACvD,yCAA+C;AAC/C,kEAAgE;AAChE,iCAAgD;AAChD,mCASiB;AAiBjB,IAAM,OAAO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,8BAAC,yBAAe,OAAG,CACpB,CAAC,CAAC,CAAC,CACF,8BAAC,uBAAU,CAAC,KAAK,IACf,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,qBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,WAGzB,CACpB,CACU,CACd,CACa;QACf,UAAU,IAAI,CACb,8BAAC,uBAAU,CAAC,IAAI,IACd,IAAI,EAAC,IAAI,EACT,KAAK,EACH,cAAc,KAAK,mBAAW,CAAC,KAAK;gBAClC,CAAC,CAAC,qBAAa,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ;gBACrC,CAAC,CAAC,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,IAGhD,UAAU,CACK,CACnB,CACS,CACb,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,OAAO,CAAA"}
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.CopyButton = exports.
|
|
7
|
+
exports.CopyButton = exports.TextValueStyles = exports.TextContainer = exports.CopyContainer = exports.IconContainer = exports.TooltipContainer = exports.LabelContainer = exports.Container = void 0;
|
|
8
8
|
var theme_1 = require("src/theme/theme");
|
|
9
9
|
var styled_1 = require("@emotion/styled");
|
|
10
10
|
var Button_1 = require("src/components/Button");
|
|
@@ -16,8 +16,8 @@ exports.IconContainer = styled_1.default.div(templateObject_4 || (templateObject
|
|
|
16
16
|
return props.iconSize === types_1.ICON_SIZE.WIDE ? '48px' : '24px';
|
|
17
17
|
});
|
|
18
18
|
exports.CopyContainer = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n background: ", ";\n border-radius: 12px;\n border: 1px solid ", ";\n min-height: 48px;\n"], ["\n display: flex;\n background: ", ";\n border-radius: 12px;\n border: 1px solid ", ";\n min-height: 48px;\n"])), theme_1.straitsXTheme.color.surface.disabledSurface, theme_1.straitsXTheme.color.base.line);
|
|
19
|
-
exports.TextContainer = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 8px;\n padding
|
|
20
|
-
exports.
|
|
19
|
+
exports.TextContainer = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n flex: 1 1 0px;\n"], ["\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n flex: 1 1 0px;\n"])));
|
|
20
|
+
exports.TextValueStyles = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n line-height: '24px';\n word-break: ", ";\n max-height: ", ";\n"], ["\n color: ", ";\n line-height: '24px';\n word-break: ", ";\n max-height: ", ";\n"])), theme_1.straitsXTheme.color.base.onNeutral, function (props) {
|
|
21
21
|
return props.isBlockchainAddress ? 'break-all' : 'break-word';
|
|
22
22
|
}, function (props) { return (props.isBlockchainAddress ? '48px' : 'auto'); });
|
|
23
23
|
exports.CopyButton = styled_1.default(Button_1.default)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border-top-left-radius: 0px !important;\n border-bottom-left-radius: 0px !important;\n border-top-right-radius: 12px !important;\n border-bottom-right-radius: 12px !important;\n border: 1px solid ", " !important;\n background: ", "!important;\n padding: 12px !important;\n min-width: unset !important;\n min-height: unset !important;\n height: auto !important;\n > svg {\n margin: 0px !important;\n }\n"], ["\n border-top-left-radius: 0px !important;\n border-bottom-left-radius: 0px !important;\n border-top-right-radius: 12px !important;\n border-bottom-right-radius: 12px !important;\n border: 1px solid ", " !important;\n background: ", "!important;\n padding: 12px !important;\n min-width: unset !important;\n min-height: unset !important;\n height: auto !important;\n > svg {\n margin: 0px !important;\n }\n"])), theme_1.straitsXTheme.color.base.line, theme_1.straitsXTheme.color.surface.neutral);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/CopyBox/styles.ts"],"names":[],"mappings":";;;;;;;AAAA,yCAA+C;AAC/C,0CAAoC;AACpC,gDAA0C;AAC1C,iCAAmC;AAEtB,QAAA,SAAS,GAAG,gBAAM,CAAC,GAAG,iIAAA,8DAIlC,KAAA;AAEY,QAAA,cAAc,GAAG,gBAAM,CAAC,GAAG,8HAAA,2DAIvC,KAAA;AACY,QAAA,gBAAgB,GAAG,gBAAM,CAAC,GAAG,iHAAA,8CAGzC,KAAA;AACY,QAAA,aAAa,GAAG,gBAAM,CAAC,GAAG,6LAAyB,iFAKnD,EAC4C,uCAGxD,KAJY,UAAA,KAAK;IACZ,OAAA,KAAK,CAAC,QAAQ,KAAK,iBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;AAAnD,CAAmD,EAGxD;AACY,QAAA,aAAa,GAAG,gBAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/CopyBox/styles.ts"],"names":[],"mappings":";;;;;;;AAAA,yCAA+C;AAC/C,0CAAoC;AACpC,gDAA0C;AAC1C,iCAAmC;AAEtB,QAAA,SAAS,GAAG,gBAAM,CAAC,GAAG,iIAAA,8DAIlC,KAAA;AAEY,QAAA,cAAc,GAAG,gBAAM,CAAC,GAAG,8HAAA,2DAIvC,KAAA;AACY,QAAA,gBAAgB,GAAG,gBAAM,CAAC,GAAG,iHAAA,8CAGzC,KAAA;AACY,QAAA,aAAa,GAAG,gBAAM,CAAC,GAAG,6LAAyB,iFAKnD,EAC4C,uCAGxD,KAJY,UAAA,KAAK;IACZ,OAAA,KAAK,CAAC,QAAQ,KAAK,iBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;AAAnD,CAAmD,EAGxD;AACY,QAAA,aAAa,GAAG,gBAAM,CAAC,GAAG,sLAAA,oCAEvB,EAA2C,iDAErC,EAA6B,0BAElD,KAJe,qBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,EAErC,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAElD;AACY,QAAA,aAAa,GAAG,gBAAM,CAAC,GAAG,uKAAA,oGAMtC,KAAA;AAEY,QAAA,eAAe,GAAG,gBAAM,CAAC,GAAG,yJAAkC,aAChE,EAAkC,2CAE7B,EAC0C,mBAC1C,EAAsD,KACrE,KALU,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAE7B,UAAA,KAAK;IACjB,OAAA,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY;AAAtD,CAAsD,EAC1C,UAAA,KAAK,IAAI,OAAA,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAA7C,CAA6C,EACrE;AAEY,QAAA,UAAU,GAAG,gBAAM,CAAC,gBAAM,CAAC,yeAAA,8MAKlB,EAA6B,8BACnC,EAAmC,sLAQlD,KATqB,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EACnC,qBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAQlD"}
|
|
@@ -6,11 +6,9 @@ export declare const TooltipContainer: import("@emotion/styled-base").StyledComp
|
|
|
6
6
|
export declare const IconContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
7
|
iconSize: ICON_SIZE;
|
|
8
8
|
}, object>;
|
|
9
|
-
export declare const CopyContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
10
|
-
allowCopy: boolean;
|
|
11
|
-
}, object>;
|
|
9
|
+
export declare const CopyContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
12
10
|
export declare const TextContainer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
13
|
-
export declare const
|
|
11
|
+
export declare const TextValueStyles: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
14
12
|
isBlockchainAddress: boolean;
|
|
15
13
|
}, object>;
|
|
16
14
|
export declare const CopyButton: import("@emotion/styled-base").StyledComponent<{
|