@stokr/components-library 2.3.64 → 2.3.65-beta.10
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/dist/components/2FA/main-flow.js +28 -7
- package/dist/components/2FA/main-flow.stories.js +144 -15
- package/dist/components/AdminDashboard/Table/ReactTable.js +123 -7
- package/dist/components/AdminDashboard/Table/ReactTable.stories.js +509 -2
- package/dist/components/Chips/Chip.js +1 -2
- package/dist/components/Icon/Icon.stories.js +108 -0
- package/dist/components/InfoIcon/InfoIcon.js +9 -4
- package/dist/components/InfoIcon/InfoIcon.styles.js +3 -3
- package/dist/components/Input/Input.js +33 -33
- package/dist/components/Input/Input.stories.js +83 -8
- package/dist/components/Input/MultiSelect.js +319 -0
- package/dist/components/Input/MultiSelect.stories.js +264 -0
- package/dist/components/Input/SearchInput.js +78 -0
- package/dist/components/Input/SearchInput.stories.js +366 -0
- package/dist/components/Input/SearchInput.styles.js +25 -0
- package/dist/components/Input/Select.js +51 -28
- package/dist/components/Input/Select.stories.js +345 -6
- package/dist/components/Modal/SideModal.js +82 -0
- package/dist/components/Modal/SideModal.stories.js +342 -0
- package/dist/components/Modal/SideModal.styles.js +21 -0
- package/dist/components/Payment/PaymentDetailsCard.js +189 -0
- package/dist/components/Payment/PaymentDetailsCard.stories.js +198 -0
- package/dist/components/Payment/PaymentDisplay.js +2 -12
- package/dist/components/ProfileBox/ProfileBox.js +2 -1
- package/dist/components/Snackbar/Snackbar.js +193 -0
- package/dist/components/Snackbar/Snackbar.stories.js +292 -0
- package/dist/components/Snackbar/Snackbar.styles.js +97 -0
- package/dist/components/Snackbar/SnackbarProvider.js +81 -0
- package/dist/components/Snackbar/index.js +32 -0
- package/dist/components/Snackbar/useSnackbar.js +43 -0
- package/dist/components/StatusTag/StatusTag.js +175 -0
- package/dist/components/StatusTag/StatusTag.stories.js +262 -0
- package/dist/components/StatusTag/StatusTag.styles.js +37 -0
- package/dist/components/StepsProgress/StepIndicator.js +59 -0
- package/dist/components/StepsProgress/StepIndicator.stories.js +153 -0
- package/dist/components/StepsProgress/StepIndicator.styles.js +30 -0
- package/dist/components/TextLink/TextLink.stories.js +35 -0
- package/dist/components/TextLink/TextLink.styles.js +1 -1
- package/dist/components/Timeline/Timeline.js +0 -2
- package/dist/components/Timeline/TimelineStep.js +2 -2
- package/dist/components/logo/Logo.stories.js +260 -0
- package/dist/constants/globalVariables.js +41 -2
- package/dist/context/Checkbox/CheckboxContext.js +80 -7
- package/dist/index.js +66 -0
- package/dist/static/images/bmn2-logo.svg +9 -0
- package/dist/static/images/document-icon.svg +3 -0
- package/dist/static/images/plus-icon.svg +4 -0
- package/dist/static/images/search-icon.svg +3 -0
- package/dist/static/images/sent-icon.svg +10 -0
- package/dist/static/images/transfer-icon.svg +10 -0
- package/dist/utils/formatCurrencyValue.js +43 -3
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.08578 1.58578C1.5 2.17157 1.5 3.11438 1.5 5V7C1.5 8.8856 1.5 9.82845 2.08578 10.4142C2.67157 11 3.61438 11 5.5 11H6.5C8.3856 11 9.32845 11 9.9142 10.4142C10.5 9.82845 10.5 8.8856 10.5 7V5C10.5 3.11438 10.5 2.17157 9.9142 1.58578C9.32845 1 8.3856 1 6.5 1H5.5C3.61438 1 2.67157 1 2.08578 1.58578ZM4 4.625C3.7929 4.625 3.625 4.79289 3.625 5C3.625 5.2071 3.7929 5.375 4 5.375H8C8.2071 5.375 8.375 5.2071 8.375 5C8.375 4.79289 8.2071 4.625 8 4.625H4ZM4 6.625C3.7929 6.625 3.625 6.7929 3.625 7C3.625 7.2071 3.7929 7.375 4 7.375H6.5C6.7071 7.375 6.875 7.2071 6.875 7C6.875 6.7929 6.7071 6.625 6.5 6.625H4Z" fill="#0050CA"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M7 11.0827V2.91602" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M2.91797 7H11.0846" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M7.33333 4C9.17427 4 10.6667 5.49239 10.6667 7.33333M11.1059 11.1033L14 14M12.6667 7.33333C12.6667 10.2789 10.2789 12.6667 7.33333 12.6667C4.38781 12.6667 2 10.2789 2 7.33333C2 4.38781 4.38781 2 7.33333 2C10.2789 2 12.6667 4.38781 12.6667 7.33333Z" stroke="#9B9B9B" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_4481_24713)">
|
|
3
|
+
<path d="M11.9389 0.491782C11.8855 0.44493 11.8095 0.43406 11.7451 0.463943L0.103795 5.8728C0.0411228 5.90193 0.000764077 5.96446 1.07135e-05 6.03356C-0.00074265 6.10265 0.0382887 6.16604 0.100352 6.1965L3.39481 7.81329C3.45522 7.84296 3.52726 7.83625 3.58121 7.79593L6.78433 5.40188L4.26975 7.98843C4.23388 8.02534 4.21558 8.07589 4.21953 8.12719L4.46989 11.3878C4.47545 11.46 4.52389 11.5218 4.59273 11.5444C4.61113 11.5505 4.63004 11.5534 4.64873 11.5534C4.69999 11.5534 4.74986 11.5314 4.78455 11.4912L6.53314 9.46498L8.69475 10.4978C8.74168 10.5202 8.79599 10.5212 8.84367 10.5004C8.89135 10.4797 8.92765 10.4393 8.94322 10.3897L11.9918 0.680374C12.0131 0.612571 11.9923 0.538634 11.9389 0.491782Z" fill="#0050CA"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_4481_24713">
|
|
7
|
+
<rect width="12" height="12" fill="white"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_5576_18558)">
|
|
3
|
+
<path d="M4.10179 5.87885C4.29705 6.07415 4.29705 6.3907 4.10179 6.586L3.18757 7.5002H7.99822C8.27437 7.5002 8.49822 7.72404 8.49822 8.00019C8.49822 8.27634 8.27437 8.5002 7.99822 8.5002H3.18757L4.10179 9.41439C4.29705 9.60964 4.29705 9.92625 4.10179 10.1215C3.90653 10.3168 3.58994 10.3168 3.39468 10.1215L1.62691 8.35374C1.43165 8.15849 1.43165 7.84189 1.62691 7.64665L3.39468 5.87885C3.58994 5.6836 3.90653 5.6836 4.10179 5.87885ZM7.89462 1.87887C8.0749 1.69863 8.35849 1.68476 8.55462 1.83728L8.60172 1.87887L10.3695 3.64664C10.5498 3.82688 10.5636 4.11049 10.4111 4.30664L10.3695 4.35375L8.60172 6.1215C8.40647 6.3168 8.08992 6.3168 7.89462 6.1215C7.71439 5.94126 7.70052 5.65763 7.85303 5.4615L7.89462 5.4144L8.80887 4.50019H3.99817C3.72203 4.50019 3.49817 4.27633 3.49817 4.00019C3.49817 3.74377 3.69119 3.53244 3.93986 3.50355L3.99817 3.50019H8.80887L7.89462 2.58598C7.69937 2.39072 7.69937 2.07413 7.89462 1.87887Z" fill="#3D9626"/>
|
|
4
|
+
</g>
|
|
5
|
+
<defs>
|
|
6
|
+
<clipPath id="clip0_5576_18558">
|
|
7
|
+
<rect width="12" height="12" fill="white"/>
|
|
8
|
+
</clipPath>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -3,9 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getProjectCurrencySign = exports.getCurrencySymbol = exports.formatCurrencyValue = void 0;
|
|
6
|
+
exports.getProjectCurrencySign = exports.getLiquidAssetIcon = exports.getCurrencySymbol = exports.getCurrencyIcon = exports.formatCurrencyValue = void 0;
|
|
7
|
+
var _usdcLogo = _interopRequireDefault(require("../static/images/usdc-logo.svg"));
|
|
8
|
+
var _usdqLogo = _interopRequireDefault(require("../static/images/usdq-logo.png"));
|
|
9
|
+
var _bitcoinLogo = _interopRequireDefault(require("../static/images/bitcoin-logo.svg"));
|
|
10
|
+
var _bmn2Logo = _interopRequireDefault(require("../static/images/bmn2-logo.svg"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
12
|
const formatCurrencyValue = function (currency, value) {
|
|
8
13
|
let tokenDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
14
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
15
|
+
const {
|
|
16
|
+
valueFirst = false
|
|
17
|
+
} = options;
|
|
9
18
|
const [symbol, decimals] = {
|
|
10
19
|
tether: ['USDT', 2],
|
|
11
20
|
gemini: ['GUSD', 2],
|
|
@@ -27,7 +36,8 @@ const formatCurrencyValue = function (currency, value) {
|
|
|
27
36
|
'usdc-fb': ['USDC', 2],
|
|
28
37
|
'usdq-fb': ['USDQ', 2]
|
|
29
38
|
}[currency] || [currency, tokenDecimals];
|
|
30
|
-
|
|
39
|
+
const formattedValue = parseFloat(Math.abs(value)).toFixed(decimals);
|
|
40
|
+
return valueFirst ? "".concat(formattedValue, " ").concat(symbol) : "".concat(symbol, " ").concat(formattedValue);
|
|
31
41
|
};
|
|
32
42
|
exports.formatCurrencyValue = formatCurrencyValue;
|
|
33
43
|
const getCurrencySymbol = currencySelected => ({
|
|
@@ -51,4 +61,34 @@ exports.getCurrencySymbol = getCurrencySymbol;
|
|
|
51
61
|
const getProjectCurrencySign = tokenCurrency => {
|
|
52
62
|
return tokenCurrency === 'EUR' ? '€' : tokenCurrency === 'USD' ? '$' : tokenCurrency === 'BTC' ? '₿' : '';
|
|
53
63
|
};
|
|
54
|
-
exports.getProjectCurrencySign = getProjectCurrencySign;
|
|
64
|
+
exports.getProjectCurrencySign = getProjectCurrencySign;
|
|
65
|
+
const getCurrencyIcon = (currency, customIcon) => {
|
|
66
|
+
if (customIcon) return customIcon;
|
|
67
|
+
if (!currency) return null;
|
|
68
|
+
switch (currency.toLowerCase()) {
|
|
69
|
+
case 'btc':
|
|
70
|
+
case 'bitcoin':
|
|
71
|
+
return _bitcoinLogo.default;
|
|
72
|
+
case 'usdc':
|
|
73
|
+
return _usdcLogo.default;
|
|
74
|
+
case 'usdq':
|
|
75
|
+
return _usdqLogo.default;
|
|
76
|
+
case 'bmn2':
|
|
77
|
+
return _bmn2Logo.default;
|
|
78
|
+
default:
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
//uses secondary asset id to get liquid icon
|
|
84
|
+
exports.getCurrencyIcon = getCurrencyIcon;
|
|
85
|
+
const getLiquidAssetIcon = async assetId => {
|
|
86
|
+
const url = "https://liquid.network/api/v1/asset/".concat(assetId, "/icon");
|
|
87
|
+
return new Promise(resolve => {
|
|
88
|
+
const img = new Image();
|
|
89
|
+
img.onload = () => resolve(url);
|
|
90
|
+
img.onerror = () => resolve(null);
|
|
91
|
+
img.src = url;
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
exports.getLiquidAssetIcon = getLiquidAssetIcon;
|