@stokr/components-library 2.3.65-beta.4 → 2.3.65-beta.6
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/Icon/Icon.stories.js +108 -0
- package/dist/components/Input/MultiSelect.js +292 -0
- package/dist/components/Input/MultiSelect.stories.js +198 -0
- package/dist/components/Payment/PaymentDetailsCard.js +189 -0
- package/dist/components/Payment/PaymentDetailsCard.stories.js +198 -0
- package/dist/components/StatusTag/StatusTag.js +11 -4
- package/dist/components/StepsProgress/StepIndicator.js +58 -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/index.js +33 -0
- package/dist/static/images/bmn2-logo.svg +9 -0
- package/dist/static/images/plus-icon.svg +4 -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,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.PaymentDetailsCard = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
10
|
+
var _InfoIcon = require("../InfoIcon/InfoIcon");
|
|
11
|
+
var _formatCurrencyValue = require("../../utils/formatCurrencyValue");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const CardContainer = _styledComponents.default.div.withConfig({
|
|
14
|
+
displayName: "PaymentDetailsCard__CardContainer",
|
|
15
|
+
componentId: "sc-e830fo-0"
|
|
16
|
+
})(["background:", ";border-radius:15px;border:1px solid ", ";padding:20px 32px;"], _colors.default.white, _colors.default.lightGrey);
|
|
17
|
+
const CardTitle = _styledComponents.default.div.withConfig({
|
|
18
|
+
displayName: "PaymentDetailsCard__CardTitle",
|
|
19
|
+
componentId: "sc-e830fo-1"
|
|
20
|
+
})(["font-size:16px;font-weight:600;margin-bottom:20px;color:", ";"], _colors.default.black);
|
|
21
|
+
const AmountSection = _styledComponents.default.div.withConfig({
|
|
22
|
+
displayName: "PaymentDetailsCard__AmountSection",
|
|
23
|
+
componentId: "sc-e830fo-2"
|
|
24
|
+
})([""]);
|
|
25
|
+
const AmountLabel = _styledComponents.default.div.withConfig({
|
|
26
|
+
displayName: "PaymentDetailsCard__AmountLabel",
|
|
27
|
+
componentId: "sc-e830fo-3"
|
|
28
|
+
})(["font-size:14px;font-weight:300;line-height:20px;letter-spacing:0.08px;margin-bottom:12px;color:", ";"], _colors.default.grey2);
|
|
29
|
+
const AmountDisplay = _styledComponents.default.div.withConfig({
|
|
30
|
+
displayName: "PaymentDetailsCard__AmountDisplay",
|
|
31
|
+
componentId: "sc-e830fo-4"
|
|
32
|
+
})(["display:flex;align-items:center;gap:16px;"]);
|
|
33
|
+
const CurrencyLogo = _styledComponents.default.div.withConfig({
|
|
34
|
+
displayName: "PaymentDetailsCard__CurrencyLogo",
|
|
35
|
+
componentId: "sc-e830fo-5"
|
|
36
|
+
})(["width:32px;height:32px;border-radius:50%;background-color:", ";display:flex;align-items:center;justify-content:center;flex-shrink:0;color:", ";font-size:14px;font-weight:600;overflow:hidden;"], props => props.color || _colors.default.black, _colors.default.white);
|
|
37
|
+
const CurrencyIcon = _styledComponents.default.img.withConfig({
|
|
38
|
+
displayName: "PaymentDetailsCard__CurrencyIcon",
|
|
39
|
+
componentId: "sc-e830fo-6"
|
|
40
|
+
})(["width:100%;height:100%;object-fit:contain;"]);
|
|
41
|
+
const AmountValue = _styledComponents.default.div.withConfig({
|
|
42
|
+
displayName: "PaymentDetailsCard__AmountValue",
|
|
43
|
+
componentId: "sc-e830fo-7"
|
|
44
|
+
})(["font-size:34px;font-weight:800;text-transform:uppercase;line-height:40px;letter-spacing:1.5px;word-wrap:break-word;"]);
|
|
45
|
+
const Separator = _styledComponents.default.hr.withConfig({
|
|
46
|
+
displayName: "PaymentDetailsCard__Separator",
|
|
47
|
+
componentId: "sc-e830fo-8"
|
|
48
|
+
})(["border:none;border-top:1px solid ", ";margin:20px -32px;"], _colors.default.lightGrey);
|
|
49
|
+
const DetailsSection = _styledComponents.default.div.withConfig({
|
|
50
|
+
displayName: "PaymentDetailsCard__DetailsSection",
|
|
51
|
+
componentId: "sc-e830fo-9"
|
|
52
|
+
})(["margin-bottom:", ";"], props => props.noMargin ? '0' : '24px');
|
|
53
|
+
const DetailRow = _styledComponents.default.div.withConfig({
|
|
54
|
+
displayName: "PaymentDetailsCard__DetailRow",
|
|
55
|
+
componentId: "sc-e830fo-10"
|
|
56
|
+
})(["display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px;&:last-child{margin-bottom:0;}"]);
|
|
57
|
+
const DetailLabel = _styledComponents.default.div.withConfig({
|
|
58
|
+
displayName: "PaymentDetailsCard__DetailLabel",
|
|
59
|
+
componentId: "sc-e830fo-11"
|
|
60
|
+
})(["display:flex;align-items:center;gap:10px;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0.1px;"]);
|
|
61
|
+
const DetailValue = _styledComponents.default.div.withConfig({
|
|
62
|
+
displayName: "PaymentDetailsCard__DetailValue",
|
|
63
|
+
componentId: "sc-e830fo-12"
|
|
64
|
+
})(["font-size:16px;font-weight:700;line-height:24px;letter-spacing:0.1px;word-wrap:break-word;text-align:right;max-width:60%;color:", ";"], _colors.default.black);
|
|
65
|
+
const PlaceholderValue = _styledComponents.default.span.withConfig({
|
|
66
|
+
displayName: "PaymentDetailsCard__PlaceholderValue",
|
|
67
|
+
componentId: "sc-e830fo-13"
|
|
68
|
+
})(["color:", ";font-weight:400;"], _colors.default.grey2);
|
|
69
|
+
const InfoSectionContainer = _styledComponents.default.div.withConfig({
|
|
70
|
+
displayName: "PaymentDetailsCard__InfoSectionContainer",
|
|
71
|
+
componentId: "sc-e830fo-14"
|
|
72
|
+
})(["margin-top:24px;"]);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Renders a single detail row
|
|
76
|
+
*/
|
|
77
|
+
const DetailItem = _ref => {
|
|
78
|
+
let {
|
|
79
|
+
label,
|
|
80
|
+
value,
|
|
81
|
+
tooltip,
|
|
82
|
+
placeholder,
|
|
83
|
+
isCustom
|
|
84
|
+
} = _ref;
|
|
85
|
+
// If value is a custom component (React element), render it directly
|
|
86
|
+
const renderValue = () => {
|
|
87
|
+
if (isCustom && value) {
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
if (placeholder) {
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(PlaceholderValue, null, placeholder);
|
|
95
|
+
}
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(PlaceholderValue, null, "-");
|
|
97
|
+
};
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(DetailRow, null, /*#__PURE__*/_react.default.createElement(DetailLabel, null, label, tooltip && /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, {
|
|
99
|
+
containerStyle: {
|
|
100
|
+
width: 14,
|
|
101
|
+
height: 14
|
|
102
|
+
},
|
|
103
|
+
title: tooltip,
|
|
104
|
+
noMargin: true
|
|
105
|
+
})), /*#__PURE__*/_react.default.createElement(DetailValue, null, renderValue()));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* PaymentDetailsCard - Fully customizable details card
|
|
110
|
+
*
|
|
111
|
+
* @param {string} title - Optional card title
|
|
112
|
+
* @param {object|node} amountSection - Amount section config or custom node
|
|
113
|
+
* - If object: { label, amount, currency, currencyColor, icon }
|
|
114
|
+
* - If node: renders custom component
|
|
115
|
+
* @param {array} details - Array of detail items
|
|
116
|
+
* - { label, value (string|node), tooltip, placeholder, isCustom }
|
|
117
|
+
* @param {node} infoSection - Optional custom node for bottom info section
|
|
118
|
+
* @param {boolean} showSeparators - Whether to show separators between sections
|
|
119
|
+
*/
|
|
120
|
+
const PaymentDetailsCard = _ref2 => {
|
|
121
|
+
let {
|
|
122
|
+
title,
|
|
123
|
+
amountSection,
|
|
124
|
+
details,
|
|
125
|
+
infoSection,
|
|
126
|
+
showSeparators = true
|
|
127
|
+
} = _ref2;
|
|
128
|
+
// Render amount section
|
|
129
|
+
const renderAmountSection = () => {
|
|
130
|
+
if (!amountSection) return null;
|
|
131
|
+
|
|
132
|
+
// If it's a React element, render it directly
|
|
133
|
+
if (/*#__PURE__*/_react.default.isValidElement(amountSection)) {
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, amountSection, showSeparators && /*#__PURE__*/_react.default.createElement(Separator, null));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Otherwise, render the default amount layout
|
|
138
|
+
const {
|
|
139
|
+
label = 'Amount',
|
|
140
|
+
amount,
|
|
141
|
+
currency,
|
|
142
|
+
currencyColor,
|
|
143
|
+
icon
|
|
144
|
+
} = amountSection;
|
|
145
|
+
const displayAmount = (0, _formatCurrencyValue.formatCurrencyValue)(currency, amount, 2, {
|
|
146
|
+
valueFirst: true
|
|
147
|
+
});
|
|
148
|
+
const currencyIcon = (0, _formatCurrencyValue.getCurrencyIcon)(currency, icon);
|
|
149
|
+
const logoColor = currencyColor || _colors.default.black;
|
|
150
|
+
const renderCurrencyLogo = () => {
|
|
151
|
+
if (currencyIcon) {
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement(CurrencyLogo, {
|
|
153
|
+
color: 'transparent'
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(CurrencyIcon, {
|
|
155
|
+
src: currencyIcon,
|
|
156
|
+
alt: currency || 'currency'
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement(CurrencyLogo, {
|
|
160
|
+
color: logoColor
|
|
161
|
+
}, currency ? currency.charAt(0).toUpperCase() : '?');
|
|
162
|
+
};
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(AmountSection, null, /*#__PURE__*/_react.default.createElement(AmountLabel, null, label), /*#__PURE__*/_react.default.createElement(AmountDisplay, null, renderCurrencyLogo(), /*#__PURE__*/_react.default.createElement(AmountValue, null, displayAmount))), showSeparators && /*#__PURE__*/_react.default.createElement(Separator, null));
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Render details section
|
|
167
|
+
const renderDetailsSection = () => {
|
|
168
|
+
if (!details || details.length === 0) return null;
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement(DetailsSection, {
|
|
170
|
+
noMargin: !infoSection
|
|
171
|
+
}, details.map((detail, index) => /*#__PURE__*/_react.default.createElement(DetailItem, {
|
|
172
|
+
key: detail.key || index,
|
|
173
|
+
label: detail.label,
|
|
174
|
+
value: detail.value,
|
|
175
|
+
tooltip: detail.tooltip,
|
|
176
|
+
placeholder: detail.placeholder,
|
|
177
|
+
isCustom: detail.isCustom
|
|
178
|
+
})));
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// Render info section
|
|
182
|
+
const renderInfoSection = () => {
|
|
183
|
+
if (!infoSection) return null;
|
|
184
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showSeparators && /*#__PURE__*/_react.default.createElement(Separator, null), /*#__PURE__*/_react.default.createElement(InfoSectionContainer, null, infoSection));
|
|
185
|
+
};
|
|
186
|
+
return /*#__PURE__*/_react.default.createElement(CardContainer, null, title && /*#__PURE__*/_react.default.createElement(CardTitle, null, title), renderAmountSection(), renderDetailsSection(), renderInfoSection());
|
|
187
|
+
};
|
|
188
|
+
exports.PaymentDetailsCard = PaymentDetailsCard;
|
|
189
|
+
var _default = exports.default = PaymentDetailsCard;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithoutSeparators = exports.WithTooltips = exports.WithPlaceholders = exports.WithCustomInfoSection = exports.WithCustomAmountSection = exports.WithBitcoin = exports.DetailsOnly = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _PaymentDetailsCard = _interopRequireDefault(require("./PaymentDetailsCard"));
|
|
9
|
+
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
10
|
+
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
11
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const StoryContainer = _styledComponents.default.div.withConfig({
|
|
15
|
+
displayName: "PaymentDetailsCardstories__StoryContainer",
|
|
16
|
+
componentId: "sc-1bzi48y-0"
|
|
17
|
+
})(["max-width:500px;padding:20px;background:", ";"], _colors.default.offWhite);
|
|
18
|
+
var _default = exports.default = {
|
|
19
|
+
title: 'Components Library/Payment/PaymentDetailsCard',
|
|
20
|
+
component: _PaymentDetailsCard.default,
|
|
21
|
+
decorators: [Story => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(StoryContainer, null, /*#__PURE__*/_react.default.createElement(Story, null))))]
|
|
22
|
+
};
|
|
23
|
+
const Default = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
24
|
+
title: "Payment Details",
|
|
25
|
+
amountSection: {
|
|
26
|
+
label: 'Amount to pay',
|
|
27
|
+
amount: 1250.5,
|
|
28
|
+
currency: 'USDC'
|
|
29
|
+
},
|
|
30
|
+
details: [{
|
|
31
|
+
label: 'Reference',
|
|
32
|
+
value: 'INV-2024-001234'
|
|
33
|
+
}, {
|
|
34
|
+
label: 'Date',
|
|
35
|
+
value: 'Dec 19, 2024'
|
|
36
|
+
}, {
|
|
37
|
+
label: 'Status',
|
|
38
|
+
value: 'Pending'
|
|
39
|
+
}]
|
|
40
|
+
});
|
|
41
|
+
exports.Default = Default;
|
|
42
|
+
const WithBitcoin = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
43
|
+
amountSection: {
|
|
44
|
+
label: 'Transfer amount',
|
|
45
|
+
amount: 0.054321,
|
|
46
|
+
currency: 'BTC'
|
|
47
|
+
},
|
|
48
|
+
details: [{
|
|
49
|
+
label: 'Network',
|
|
50
|
+
value: 'Bitcoin Mainnet'
|
|
51
|
+
}, {
|
|
52
|
+
label: 'Fee',
|
|
53
|
+
value: '0.00001 BTC'
|
|
54
|
+
}, {
|
|
55
|
+
label: 'Confirmations',
|
|
56
|
+
value: '3/6'
|
|
57
|
+
}]
|
|
58
|
+
});
|
|
59
|
+
exports.WithBitcoin = WithBitcoin;
|
|
60
|
+
const WithTooltips = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
61
|
+
amountSection: {
|
|
62
|
+
label: 'Investment amount',
|
|
63
|
+
amount: 50000,
|
|
64
|
+
currency: 'USDT'
|
|
65
|
+
},
|
|
66
|
+
details: [{
|
|
67
|
+
label: 'Token price',
|
|
68
|
+
value: '$1.25',
|
|
69
|
+
tooltip: 'Current token price at the time of investment'
|
|
70
|
+
}, {
|
|
71
|
+
label: 'Tokens received',
|
|
72
|
+
value: '40,000 TKN',
|
|
73
|
+
tooltip: 'Number of tokens you will receive'
|
|
74
|
+
}, {
|
|
75
|
+
label: 'Lock-up period',
|
|
76
|
+
value: '12 months',
|
|
77
|
+
tooltip: 'Tokens will be locked for this period'
|
|
78
|
+
}]
|
|
79
|
+
});
|
|
80
|
+
exports.WithTooltips = WithTooltips;
|
|
81
|
+
const WithPlaceholders = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
82
|
+
title: "Pending Payment",
|
|
83
|
+
amountSection: {
|
|
84
|
+
label: 'Amount',
|
|
85
|
+
amount: 500,
|
|
86
|
+
currency: 'USDC'
|
|
87
|
+
},
|
|
88
|
+
details: [{
|
|
89
|
+
label: 'Transaction ID',
|
|
90
|
+
value: null,
|
|
91
|
+
placeholder: 'Awaiting confirmation'
|
|
92
|
+
}, {
|
|
93
|
+
label: 'Recipient',
|
|
94
|
+
value: 'John Doe'
|
|
95
|
+
}, {
|
|
96
|
+
label: 'Status',
|
|
97
|
+
value: null,
|
|
98
|
+
placeholder: 'Processing...'
|
|
99
|
+
}]
|
|
100
|
+
});
|
|
101
|
+
exports.WithPlaceholders = WithPlaceholders;
|
|
102
|
+
const WithCustomInfoSection = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
103
|
+
title: "Order Confirmation",
|
|
104
|
+
amountSection: {
|
|
105
|
+
label: 'Total amount',
|
|
106
|
+
amount: 2500,
|
|
107
|
+
currency: 'USDC'
|
|
108
|
+
},
|
|
109
|
+
details: [{
|
|
110
|
+
label: 'Order ID',
|
|
111
|
+
value: 'ORD-789456'
|
|
112
|
+
}, {
|
|
113
|
+
label: 'Items',
|
|
114
|
+
value: '3 tokens'
|
|
115
|
+
}],
|
|
116
|
+
infoSection: /*#__PURE__*/_react.default.createElement("div", {
|
|
117
|
+
style: {
|
|
118
|
+
padding: '12px',
|
|
119
|
+
background: _colors.default.lightGrey,
|
|
120
|
+
borderRadius: '4px',
|
|
121
|
+
fontSize: '14px',
|
|
122
|
+
color: _colors.default.grey2
|
|
123
|
+
}
|
|
124
|
+
}, "\u24D8 Your payment will be processed within 24 hours. You will receive a confirmation email once complete.")
|
|
125
|
+
});
|
|
126
|
+
exports.WithCustomInfoSection = WithCustomInfoSection;
|
|
127
|
+
const WithoutSeparators = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
128
|
+
title: "Compact View",
|
|
129
|
+
amountSection: {
|
|
130
|
+
label: 'Amount',
|
|
131
|
+
amount: 100,
|
|
132
|
+
currency: 'USDC'
|
|
133
|
+
},
|
|
134
|
+
details: [{
|
|
135
|
+
label: 'From',
|
|
136
|
+
value: 'Wallet A'
|
|
137
|
+
}, {
|
|
138
|
+
label: 'To',
|
|
139
|
+
value: 'Wallet B'
|
|
140
|
+
}],
|
|
141
|
+
showSeparators: false
|
|
142
|
+
});
|
|
143
|
+
exports.WithoutSeparators = WithoutSeparators;
|
|
144
|
+
const DetailsOnly = () => /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
145
|
+
title: "Account Information",
|
|
146
|
+
details: [{
|
|
147
|
+
label: 'Account holder',
|
|
148
|
+
value: 'Jane Smith'
|
|
149
|
+
}, {
|
|
150
|
+
label: 'Account type',
|
|
151
|
+
value: 'Premium'
|
|
152
|
+
}, {
|
|
153
|
+
label: 'Member since',
|
|
154
|
+
value: 'Jan 2023'
|
|
155
|
+
}, {
|
|
156
|
+
label: 'Total investments',
|
|
157
|
+
value: '$125,000'
|
|
158
|
+
}]
|
|
159
|
+
});
|
|
160
|
+
exports.DetailsOnly = DetailsOnly;
|
|
161
|
+
const WithCustomAmountSection = () => {
|
|
162
|
+
const CustomAmount = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
163
|
+
style: {
|
|
164
|
+
textAlign: 'center',
|
|
165
|
+
padding: '20px 0'
|
|
166
|
+
}
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
style: {
|
|
169
|
+
fontSize: '14px',
|
|
170
|
+
color: _colors.default.grey2,
|
|
171
|
+
marginBottom: '8px'
|
|
172
|
+
}
|
|
173
|
+
}, "You are investing"), /*#__PURE__*/_react.default.createElement("div", {
|
|
174
|
+
style: {
|
|
175
|
+
fontSize: '48px',
|
|
176
|
+
fontWeight: '800',
|
|
177
|
+
color: _colors.default.black
|
|
178
|
+
}
|
|
179
|
+
}, "$10,000"), /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
+
style: {
|
|
181
|
+
fontSize: '14px',
|
|
182
|
+
color: _colors.default.freshGreen,
|
|
183
|
+
marginTop: '8px'
|
|
184
|
+
}
|
|
185
|
+
}, "\u2713 Best rate available"));
|
|
186
|
+
return /*#__PURE__*/_react.default.createElement(_PaymentDetailsCard.default, {
|
|
187
|
+
title: "Custom Investment",
|
|
188
|
+
amountSection: /*#__PURE__*/_react.default.createElement(CustomAmount, null),
|
|
189
|
+
details: [{
|
|
190
|
+
label: 'Exchange rate',
|
|
191
|
+
value: '1 USD = 0.92 EUR'
|
|
192
|
+
}, {
|
|
193
|
+
label: 'Fees',
|
|
194
|
+
value: '$0.00'
|
|
195
|
+
}]
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
exports.WithCustomAmountSection = WithCustomAmountSection;
|
|
@@ -11,6 +11,7 @@ var _checkIcon = require("../../static/images/check-icon.svg");
|
|
|
11
11
|
var _crossIcon = require("../../static/images/cross-icon.svg");
|
|
12
12
|
var _sentIcon = require("../../static/images/sent-icon.svg");
|
|
13
13
|
var _documentIcon = require("../../static/images/document-icon.svg");
|
|
14
|
+
var _transferIcon = require("../../static/images/transfer-icon.svg");
|
|
14
15
|
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
15
16
|
var _StatusTag = require("./StatusTag.styles");
|
|
16
17
|
const _excluded = ["variant", "icon", "text", "tooltip", "tooltipProps", "iconColor", "hoverColor", "disableHoverColor", "minWidth", "className", "containerStyle", "iconStyle", "textStyle", "onClick", "center"];
|
|
@@ -83,10 +84,16 @@ const variantConfig = {
|
|
|
83
84
|
disableHoverColor: false
|
|
84
85
|
},
|
|
85
86
|
paid: {
|
|
86
|
-
icon: (iconColor, hoverColor, disableHoverColor) =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
// icon: (iconColor, hoverColor, disableHoverColor) => (
|
|
88
|
+
// <PaidIcon
|
|
89
|
+
// iconColor={iconColor}
|
|
90
|
+
// hoverColor={hoverColor}
|
|
91
|
+
// disableHoverColor={disableHoverColor}
|
|
92
|
+
// />
|
|
93
|
+
// ),
|
|
94
|
+
icon: /*#__PURE__*/_react.default.createElement(_transferIcon.ReactComponent, {
|
|
95
|
+
width: 14,
|
|
96
|
+
height: 14
|
|
90
97
|
}),
|
|
91
98
|
iconColor: _colors.default.grey2,
|
|
92
99
|
hoverColor: _colors.default.freshGreen,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _StepIndicator = require("./StepIndicator.styles");
|
|
10
|
+
var _checkIcon = require("../../static/images/check-icon.svg");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const StepIndicator = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
steps,
|
|
15
|
+
currentStep,
|
|
16
|
+
onStepClick,
|
|
17
|
+
showLabels = true,
|
|
18
|
+
marginBottom
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_StepIndicator.StepIndicatorContainer, {
|
|
21
|
+
marginBottom: marginBottom
|
|
22
|
+
}, steps.map((step, index) => {
|
|
23
|
+
const isCompleted = index < currentStep;
|
|
24
|
+
const isActive = index === currentStep;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
26
|
+
key: step.id
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_StepIndicator.StepItem, {
|
|
28
|
+
onClick: () => onStepClick && onStepClick(index),
|
|
29
|
+
style: {
|
|
30
|
+
cursor: onStepClick ? 'pointer' : 'default'
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement(_StepIndicator.StepCircle, {
|
|
33
|
+
isCompleted: isCompleted,
|
|
34
|
+
isActive: isActive
|
|
35
|
+
}, isCompleted ? /*#__PURE__*/_react.default.createElement(_checkIcon.ReactComponent, {
|
|
36
|
+
width: 14,
|
|
37
|
+
height: 11
|
|
38
|
+
}) : index + 1), showLabels && /*#__PURE__*/_react.default.createElement(_StepIndicator.StepLabel, null, step.label)), index < steps.length - 1 && /*#__PURE__*/_react.default.createElement(_StepIndicator.StepConnector, {
|
|
39
|
+
isCompleted: isCompleted
|
|
40
|
+
}));
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
StepIndicator.propTypes = {
|
|
44
|
+
steps: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
45
|
+
id: _propTypes.default.string.isRequired,
|
|
46
|
+
label: _propTypes.default.string.isRequired
|
|
47
|
+
})).isRequired,
|
|
48
|
+
currentStep: _propTypes.default.number.isRequired,
|
|
49
|
+
onStepClick: _propTypes.default.func,
|
|
50
|
+
showLabels: _propTypes.default.bool,
|
|
51
|
+
marginBottom: _propTypes.default.string
|
|
52
|
+
};
|
|
53
|
+
StepIndicator.defaultProps = {
|
|
54
|
+
onStepClick: null,
|
|
55
|
+
showLabels: true,
|
|
56
|
+
marginBottom: '32px'
|
|
57
|
+
};
|
|
58
|
+
var _default = exports.default = StepIndicator;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithoutLabels = exports.SecondStep = exports.ManySteps = exports.LastStep = exports.Interactive = exports.Default = exports.CustomMargin = exports.AllCompleted = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _StepIndicator = _interopRequireDefault(require("./StepIndicator"));
|
|
9
|
+
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
10
|
+
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
var _default = exports.default = {
|
|
14
|
+
title: 'Components Library/StepIndicator',
|
|
15
|
+
component: _StepIndicator.default,
|
|
16
|
+
decorators: [Story => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(Story, null))],
|
|
17
|
+
argTypes: {
|
|
18
|
+
currentStep: {
|
|
19
|
+
control: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
min: 0,
|
|
22
|
+
max: 3
|
|
23
|
+
},
|
|
24
|
+
description: 'Current active step (0-indexed)'
|
|
25
|
+
},
|
|
26
|
+
showLabels: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Show or hide step labels'
|
|
29
|
+
},
|
|
30
|
+
marginBottom: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Bottom margin of the component'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const sampleSteps = [{
|
|
37
|
+
id: 'step1',
|
|
38
|
+
label: 'Details'
|
|
39
|
+
}, {
|
|
40
|
+
id: 'step2',
|
|
41
|
+
label: 'Review'
|
|
42
|
+
}, {
|
|
43
|
+
id: 'step3',
|
|
44
|
+
label: 'Confirm'
|
|
45
|
+
}];
|
|
46
|
+
|
|
47
|
+
// Default - first step active
|
|
48
|
+
const Default = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
49
|
+
steps: sampleSteps,
|
|
50
|
+
currentStep: 0
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
// Second step active (first completed)
|
|
54
|
+
exports.Default = Default;
|
|
55
|
+
const SecondStep = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
56
|
+
steps: sampleSteps,
|
|
57
|
+
currentStep: 1
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
// Last step active (all previous completed)
|
|
61
|
+
exports.SecondStep = SecondStep;
|
|
62
|
+
const LastStep = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
63
|
+
steps: sampleSteps,
|
|
64
|
+
currentStep: 2
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
// All steps completed
|
|
68
|
+
exports.LastStep = LastStep;
|
|
69
|
+
const AllCompleted = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
70
|
+
steps: sampleSteps,
|
|
71
|
+
currentStep: 3
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
// Interactive example
|
|
75
|
+
exports.AllCompleted = AllCompleted;
|
|
76
|
+
const Interactive = () => {
|
|
77
|
+
const [currentStep, setCurrentStep] = (0, _react.useState)(0);
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
79
|
+
steps: sampleSteps,
|
|
80
|
+
currentStep: currentStep,
|
|
81
|
+
onStepClick: index => setCurrentStep(index)
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
style: {
|
|
84
|
+
marginTop: '24px'
|
|
85
|
+
}
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
87
|
+
onClick: () => setCurrentStep(prev => Math.max(0, prev - 1)),
|
|
88
|
+
disabled: currentStep === 0,
|
|
89
|
+
style: {
|
|
90
|
+
marginRight: '8px',
|
|
91
|
+
padding: '8px 16px'
|
|
92
|
+
}
|
|
93
|
+
}, "Previous"), /*#__PURE__*/_react.default.createElement("button", {
|
|
94
|
+
onClick: () => setCurrentStep(prev => Math.min(sampleSteps.length, prev + 1)),
|
|
95
|
+
disabled: currentStep >= sampleSteps.length,
|
|
96
|
+
style: {
|
|
97
|
+
padding: '8px 16px'
|
|
98
|
+
}
|
|
99
|
+
}, "Next")), /*#__PURE__*/_react.default.createElement("p", {
|
|
100
|
+
style: {
|
|
101
|
+
marginTop: '16px',
|
|
102
|
+
fontSize: '14px',
|
|
103
|
+
color: '#666'
|
|
104
|
+
}
|
|
105
|
+
}, "Current step: ", currentStep, " (click on steps to navigate)"));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Without labels
|
|
109
|
+
exports.Interactive = Interactive;
|
|
110
|
+
const WithoutLabels = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
111
|
+
steps: sampleSteps,
|
|
112
|
+
currentStep: 1,
|
|
113
|
+
showLabels: false
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
// More steps
|
|
117
|
+
exports.WithoutLabels = WithoutLabels;
|
|
118
|
+
const ManySteps = () => {
|
|
119
|
+
const manySteps = [{
|
|
120
|
+
id: 'step1',
|
|
121
|
+
label: 'Account'
|
|
122
|
+
}, {
|
|
123
|
+
id: 'step2',
|
|
124
|
+
label: 'Personal'
|
|
125
|
+
}, {
|
|
126
|
+
id: 'step3',
|
|
127
|
+
label: 'Documents'
|
|
128
|
+
}, {
|
|
129
|
+
id: 'step4',
|
|
130
|
+
label: 'Review'
|
|
131
|
+
}, {
|
|
132
|
+
id: 'step5',
|
|
133
|
+
label: 'Complete'
|
|
134
|
+
}];
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
136
|
+
steps: manySteps,
|
|
137
|
+
currentStep: 2
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Custom margin
|
|
142
|
+
exports.ManySteps = ManySteps;
|
|
143
|
+
const CustomMargin = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
144
|
+
steps: sampleSteps,
|
|
145
|
+
currentStep: 1,
|
|
146
|
+
marginBottom: "0"
|
|
147
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
148
|
+
style: {
|
|
149
|
+
margin: 0,
|
|
150
|
+
fontSize: '14px'
|
|
151
|
+
}
|
|
152
|
+
}, "Content immediately below (no margin)"));
|
|
153
|
+
exports.CustomMargin = CustomMargin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepLabel = exports.StepItem = exports.StepIndicatorContainer = exports.StepConnector = exports.StepCircle = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
const StepIndicatorContainer = exports.StepIndicatorContainer = _styledComponents.default.div.withConfig({
|
|
12
|
+
displayName: "StepIndicatorstyles__StepIndicatorContainer",
|
|
13
|
+
componentId: "sc-ywoddn-0"
|
|
14
|
+
})(["display:flex;align-items:center;gap:16px;margin-bottom:", ";"], props => props.marginBottom || '32px');
|
|
15
|
+
const StepItem = exports.StepItem = _styledComponents.default.div.withConfig({
|
|
16
|
+
displayName: "StepIndicatorstyles__StepItem",
|
|
17
|
+
componentId: "sc-ywoddn-1"
|
|
18
|
+
})(["display:flex;align-items:center;gap:12px;"]);
|
|
19
|
+
const StepCircle = exports.StepCircle = _styledComponents.default.div.withConfig({
|
|
20
|
+
displayName: "StepIndicatorstyles__StepCircle",
|
|
21
|
+
componentId: "sc-ywoddn-2"
|
|
22
|
+
})(["width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:600;transition:all 0.2s ease;", " ", " ", ""], props => props.isCompleted && (0, _styledComponents.css)(["background-color:", ";color:", ";svg path{stroke:", ";}"], _colors.default.progressGreen, _colors.default.white, _colors.default.white), props => props.isActive && !props.isCompleted && (0, _styledComponents.css)(["background-color:", ";color:", ";"], _colors.default.black, _colors.default.white), props => !props.isActive && !props.isCompleted && (0, _styledComponents.css)(["background-color:", ";color:", ";"], _colors.default.grey, _colors.default.black));
|
|
23
|
+
const StepLabel = exports.StepLabel = _styledComponents.default.span.withConfig({
|
|
24
|
+
displayName: "StepIndicatorstyles__StepLabel",
|
|
25
|
+
componentId: "sc-ywoddn-3"
|
|
26
|
+
})(["font-size:16px;font-weight:600;line-height:24px;letter-spacing:0.6px;word-wrap:break-word;"]);
|
|
27
|
+
const StepConnector = exports.StepConnector = _styledComponents.default.div.withConfig({
|
|
28
|
+
displayName: "StepIndicatorstyles__StepConnector",
|
|
29
|
+
componentId: "sc-ywoddn-4"
|
|
30
|
+
})(["flex:1;height:2px;max-width:80px;background-color:", ";"], props => props.isCompleted ? _colors.default.progressGreen : _colors.default.grey);
|