@stokr/components-library 0.9.1 → 0.9.2
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.
|
@@ -34,6 +34,7 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
34
34
|
radio = _ref.radio,
|
|
35
35
|
sideOptions = _ref.sideOptions,
|
|
36
36
|
src = _ref.src,
|
|
37
|
+
noHead = _ref.noHead,
|
|
37
38
|
noBody = _ref.noBody,
|
|
38
39
|
noBorderBottom = _ref.noBorderBottom,
|
|
39
40
|
flexHead = _ref.flexHead,
|
|
@@ -44,7 +45,8 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
44
45
|
copiedAddressToClipboard = _useState2[0],
|
|
45
46
|
setCopiedAddressToClipboard = _useState2[1];
|
|
46
47
|
return /*#__PURE__*/_react.default.createElement(_CryptoAddress.Container, null, /*#__PURE__*/_react.default.createElement(_RadioWrap.default, {
|
|
47
|
-
radio: radio
|
|
48
|
+
radio: radio,
|
|
49
|
+
hide: radio && radio.hide
|
|
48
50
|
}, /*#__PURE__*/_react.default.createElement(_ComponentWrap.default, {
|
|
49
51
|
wrapped: wrapped,
|
|
50
52
|
borderTop: borderTop,
|
|
@@ -53,6 +55,7 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
53
55
|
withOptions: !!sideOptions
|
|
54
56
|
}, radio && !radio.hide && /*#__PURE__*/_react.default.createElement(_CryptoAddress.CheckMark, null), /*#__PURE__*/_react.default.createElement(_CryptoAddress.Head, {
|
|
55
57
|
noBody: noBody,
|
|
58
|
+
noHead: noHead,
|
|
56
59
|
flexHead: flexHead
|
|
57
60
|
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.Title, {
|
|
58
61
|
color: titleColor
|
|
@@ -78,7 +81,13 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
78
81
|
noBody: noBody
|
|
79
82
|
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.DataBox, null, data.value && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, {
|
|
80
83
|
fontSize: fontSize
|
|
81
|
-
}, data.unit && "".concat(data.unit, " "), data.
|
|
84
|
+
}, data.unit && "".concat(data.unit, " "), data.shortAddress ? /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
|
|
85
|
+
position: "top",
|
|
86
|
+
title: data.value,
|
|
87
|
+
theme: "light",
|
|
88
|
+
arrow: true,
|
|
89
|
+
duration: 200
|
|
90
|
+
}, (0, _getShortAddress.default)(data.value)) : data.value, data.tooltip && /*#__PURE__*/_react.default.createElement("div", null, copyToClipBoard(data.value, copiedAddressToClipboard, setCopiedAddressToClipboard))), data.eqValue && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Equal, null, '= ', data.eqUnit && "".concat(data.eqUnit, " "), data.eqValue)), /*#__PURE__*/_react.default.createElement(_CryptoAddress.InfoBox, null, /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, null, info.unit && /*#__PURE__*/_react.default.createElement("strong", null, info.unit), info.value), info.eqValue && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Equal, null, info.noEqualsToSign ? ' ' : '= ', info.eqUnit && /*#__PURE__*/_react.default.createElement("strong", null, info.eqUnit), info.eqValue))), sideOptions && /*#__PURE__*/_react.default.createElement(_CryptoAddress.OptionsWrapper, null, sideOptions)))));
|
|
82
91
|
};
|
|
83
92
|
exports.CryptoAddress = CryptoAddress;
|
|
84
93
|
var copyToClipBoard = function copyToClipBoard(value, isCopied, setCopy) {
|
|
@@ -118,7 +127,8 @@ CryptoAddress.propTypes = {
|
|
|
118
127
|
info: dataShape,
|
|
119
128
|
sideOptions: _propTypes.default.node,
|
|
120
129
|
// fontSize from IIS
|
|
121
|
-
fontSize: _propTypes.default.number
|
|
130
|
+
fontSize: _propTypes.default.number,
|
|
131
|
+
noHead: _propTypes.default.bool
|
|
122
132
|
};
|
|
123
133
|
//address not required in IIS, instead wrapping {address &&( .. now doing both which is redundant
|
|
124
134
|
|
|
@@ -129,11 +139,13 @@ CryptoAddress.defaultProps = {
|
|
|
129
139
|
borderBottom: false,
|
|
130
140
|
radio: null,
|
|
131
141
|
address: '',
|
|
142
|
+
noHead: false,
|
|
132
143
|
data: {
|
|
133
144
|
value: '',
|
|
134
145
|
unit: '',
|
|
135
146
|
eqValue: '',
|
|
136
|
-
eqUnit: ''
|
|
147
|
+
eqUnit: '',
|
|
148
|
+
tooltip: false
|
|
137
149
|
},
|
|
138
150
|
info: {
|
|
139
151
|
value: '',
|
|
@@ -24,12 +24,15 @@ exports.Container = Container;
|
|
|
24
24
|
var Head = _styledComponents.default.div.withConfig({
|
|
25
25
|
displayName: "CryptoAddressstyles__Head",
|
|
26
26
|
componentId: "sc-1wjvdgu-1"
|
|
27
|
-
})(["position:relative;margin-bottom:5px;&:after{content:'';display:block;width:100%;height:0;clear:both;}", " ", ""], function (_ref) {
|
|
27
|
+
})(["position:relative;margin-bottom:5px;&:after{content:'';display:block;width:100%;height:0;clear:both;}", " ", " ", ""], function (_ref) {
|
|
28
28
|
var noBody = _ref.noBody;
|
|
29
29
|
return noBody && "margin-bottom: 0";
|
|
30
30
|
}, function (_ref2) {
|
|
31
31
|
var flexHead = _ref2.flexHead;
|
|
32
32
|
return flexHead && "\n display:flex;\n justify-content:space-between;\n align-items:center;\n flex-wrap:wrap;\n ";
|
|
33
|
+
}, function (_ref3) {
|
|
34
|
+
var noHead = _ref3.noHead;
|
|
35
|
+
return noHead && "display: none";
|
|
33
36
|
});
|
|
34
37
|
//think I took flexhead out of CL ..
|
|
35
38
|
//seems it is something passed from Algorand
|
|
@@ -38,8 +41,8 @@ exports.Head = Head;
|
|
|
38
41
|
var Body = _styledComponents.default.div.withConfig({
|
|
39
42
|
displayName: "CryptoAddressstyles__Body",
|
|
40
43
|
componentId: "sc-1wjvdgu-2"
|
|
41
|
-
})(["position:relative;&:after{content:'';display:block;width:100%;height:0;clear:both;}", ""], function (
|
|
42
|
-
var noBody =
|
|
44
|
+
})(["position:relative;&:after{content:'';display:block;width:100%;height:0;clear:both;}", ""], function (_ref4) {
|
|
45
|
+
var noBody = _ref4.noBody;
|
|
43
46
|
return noBody && "display: none";
|
|
44
47
|
});
|
|
45
48
|
exports.Body = Body;
|
|
@@ -14,6 +14,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
14
14
|
var RadioWrap = function RadioWrap(_ref) {
|
|
15
15
|
var children = _ref.children,
|
|
16
16
|
radio = _ref.radio;
|
|
17
|
+
var handleOnClick = function handleOnClick(e) {
|
|
18
|
+
if (radio) {
|
|
19
|
+
radio.handleCheckedAddressRadio(e.target.id);
|
|
20
|
+
radio.handleSelectedCryptoAddress(radio.address);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
17
23
|
return radio ? /*#__PURE__*/_react.default.createElement(_CryptoAddress.Radio, {
|
|
18
24
|
hide: radio.hide
|
|
19
25
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
@@ -24,7 +30,8 @@ var RadioWrap = function RadioWrap(_ref) {
|
|
|
24
30
|
checked: radio.checked,
|
|
25
31
|
disabled: radio.disabled,
|
|
26
32
|
onChange: radio.onChange,
|
|
27
|
-
onBlur: radio.onBlur
|
|
33
|
+
onBlur: radio.onBlur,
|
|
34
|
+
onClick: handleOnClick
|
|
28
35
|
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
29
36
|
htmlFor: radio.id
|
|
30
37
|
}, children)) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children);
|