@stokr/components-library 2.3.71 → 2.3.73
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/enable-2fa-flow.js +1 -1
- package/dist/components/InfoBox/InfoBox.js +81 -0
- package/dist/components/Payment/PaymentDetailsCard.js +202 -87
- package/dist/index.js +11 -0
- package/dist/static/images/external-link-icon.svg +3 -0
- package/dist/styles/colors.js +2 -1
- package/package.json +1 -1
|
@@ -88,9 +88,9 @@ const Enable2FAFlow = _ref => {
|
|
|
88
88
|
noPadding: true
|
|
89
89
|
}, showSuccess ? /*#__PURE__*/_react.default.createElement(_Sucess2FA.default, {
|
|
90
90
|
onClick: () => {
|
|
91
|
+
onSuccess && onSuccess();
|
|
91
92
|
setshowSuccess(false);
|
|
92
93
|
setShowFlow(false);
|
|
93
|
-
onSuccess && onSuccess();
|
|
94
94
|
},
|
|
95
95
|
subTitleLeft: "Your log in 2FA authentication is now set",
|
|
96
96
|
textRight: "You will now be asked for your 2FA code next time you log in."
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.InfoBox = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const VARIANTS = {
|
|
12
|
+
warning: {
|
|
13
|
+
background: '#FFFBEB',
|
|
14
|
+
border: _colors.default.warningOrange,
|
|
15
|
+
iconColor: 'black'
|
|
16
|
+
},
|
|
17
|
+
info: {
|
|
18
|
+
background: '#F8FAFC',
|
|
19
|
+
border: _colors.default.blueDark,
|
|
20
|
+
iconColor: 'black'
|
|
21
|
+
},
|
|
22
|
+
error: {
|
|
23
|
+
background: '#FDEDEC',
|
|
24
|
+
border: _colors.default.darkRed,
|
|
25
|
+
iconColor: 'black'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const Container = _styledComponents.default.div.withConfig({
|
|
29
|
+
displayName: "InfoBox__Container",
|
|
30
|
+
componentId: "sc-fb6dfq-0"
|
|
31
|
+
})(["position:relative;display:flex;overflow:hidden;align-items:flex-start;align-items:center;gap:12px;padding:12px 20px 12px 16px;background:", ";border:1px solid ", ";border-radius:8px;font-size:12px;line-height:18px;letter-spacing:0.6px;font-weight:400;color:", ";&:before{content:'';display:block;width:4px;position:absolute;height:100%;left:0px;background:", ";}"], props => props.$bg, props => props.$border, _colors.default.black, props => props.$border);
|
|
32
|
+
const DefaultIcon = _styledComponents.default.i.attrs({
|
|
33
|
+
className: 'ion ion-md-information-circle-outline'
|
|
34
|
+
}).withConfig({
|
|
35
|
+
displayName: "InfoBox__DefaultIcon",
|
|
36
|
+
componentId: "sc-fb6dfq-1"
|
|
37
|
+
})(["flex-shrink:0;font-size:18px;line-height:18px;color:", ";margin-top:1px;"], props => props.$color);
|
|
38
|
+
const CustomIconWrapper = _styledComponents.default.span.withConfig({
|
|
39
|
+
displayName: "InfoBox__CustomIconWrapper",
|
|
40
|
+
componentId: "sc-fb6dfq-2"
|
|
41
|
+
})(["flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:1px;"]);
|
|
42
|
+
const Content = _styledComponents.default.div.withConfig({
|
|
43
|
+
displayName: "InfoBox__Content",
|
|
44
|
+
componentId: "sc-fb6dfq-3"
|
|
45
|
+
})(["flex:1;min-width:0;"]);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* InfoBox - A flexible alert/info banner with variant support.
|
|
49
|
+
*
|
|
50
|
+
* @param {'warning'|'info'|'error'} variant - Visual style variant
|
|
51
|
+
* @param {node} children - Content to display (supports mixed bold/normal text via JSX)
|
|
52
|
+
* @param {node} icon - Custom icon node; when provided, replaces the default circled "i"
|
|
53
|
+
* @param {object} style - Optional inline styles for the container
|
|
54
|
+
* @param {string} className - Optional className for the container
|
|
55
|
+
*/
|
|
56
|
+
const InfoBox = _ref => {
|
|
57
|
+
let {
|
|
58
|
+
variant = 'warning',
|
|
59
|
+
children,
|
|
60
|
+
icon,
|
|
61
|
+
style,
|
|
62
|
+
className
|
|
63
|
+
} = _ref;
|
|
64
|
+
const theme = VARIANTS[variant] || VARIANTS.warning;
|
|
65
|
+
const renderIcon = () => {
|
|
66
|
+
if (icon) {
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(CustomIconWrapper, null, icon);
|
|
68
|
+
}
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(DefaultIcon, {
|
|
70
|
+
$color: theme.iconColor
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(Container, {
|
|
74
|
+
$bg: theme.background,
|
|
75
|
+
$border: theme.border,
|
|
76
|
+
style: style,
|
|
77
|
+
className: className
|
|
78
|
+
}, renderIcon(), /*#__PURE__*/_react.default.createElement(Content, null, children));
|
|
79
|
+
};
|
|
80
|
+
exports.InfoBox = InfoBox;
|
|
81
|
+
var _default = exports.default = InfoBox;
|
|
@@ -8,7 +8,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
10
10
|
var _InfoIcon = require("../InfoIcon/InfoIcon");
|
|
11
|
+
var _ArrowSimple = require("../icons/ArrowSimple");
|
|
11
12
|
var _formatCurrencyValue = require("../../utils/formatCurrencyValue");
|
|
13
|
+
var _externalLinkIcon = _interopRequireDefault(require("../../static/images/external-link-icon.svg"));
|
|
12
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
15
|
const CardContainer = _styledComponents.default.div.withConfig({
|
|
14
16
|
displayName: "PaymentDetailsCard__CardContainer",
|
|
@@ -17,7 +19,7 @@ const CardContainer = _styledComponents.default.div.withConfig({
|
|
|
17
19
|
const CardTitle = _styledComponents.default.div.withConfig({
|
|
18
20
|
displayName: "PaymentDetailsCard__CardTitle",
|
|
19
21
|
componentId: "sc-e830fo-1"
|
|
20
|
-
})(["font-size:
|
|
22
|
+
})(["font-size:10px;letter-spacing:1.12px;font-weight:500;color:", ";background:", ";padding:12px 24px;margin:-20px -32px 20px -32px;border-radius:9px 9px 0 0;text-align:start;text-transform:uppercase;"], _colors.default.white, _colors.default.futureBlack);
|
|
21
23
|
const AmountSection = _styledComponents.default.div.withConfig({
|
|
22
24
|
displayName: "PaymentDetailsCard__AmountSection",
|
|
23
25
|
componentId: "sc-e830fo-2"
|
|
@@ -25,75 +27,118 @@ const AmountSection = _styledComponents.default.div.withConfig({
|
|
|
25
27
|
const AmountLabel = _styledComponents.default.div.withConfig({
|
|
26
28
|
displayName: "PaymentDetailsCard__AmountLabel",
|
|
27
29
|
componentId: "sc-e830fo-3"
|
|
28
|
-
})(["font-size:11px;font-weight:400;line-height:20px;text-transform:uppercase;letter-spacing:2px;margin-bottom:
|
|
30
|
+
})(["font-size:11px;font-weight:400;line-height:20px;text-transform:uppercase;letter-spacing:2px;margin-bottom:8px;color:", ";text-align:start;"], _colors.default.grayBlue);
|
|
31
|
+
const AmountSubtitle = _styledComponents.default.div.withConfig({
|
|
32
|
+
displayName: "PaymentDetailsCard__AmountSubtitle",
|
|
33
|
+
componentId: "sc-e830fo-4"
|
|
34
|
+
})(["font-size:12px;font-weight:400;line-height:18px;letter-spacing:0.6px;color:#90A1B9;margin-top:8px;text-align:start;"]);
|
|
29
35
|
const AmountDisplay = _styledComponents.default.div.withConfig({
|
|
30
36
|
displayName: "PaymentDetailsCard__AmountDisplay",
|
|
31
|
-
componentId: "sc-e830fo-
|
|
37
|
+
componentId: "sc-e830fo-5"
|
|
32
38
|
})(["display:flex;align-items:center;gap:16px;"]);
|
|
39
|
+
const AmountLeft = _styledComponents.default.div.withConfig({
|
|
40
|
+
displayName: "PaymentDetailsCard__AmountLeft",
|
|
41
|
+
componentId: "sc-e830fo-6"
|
|
42
|
+
})(["display:flex;align-items:center;gap:16px;flex:1;min-width:0;"]);
|
|
43
|
+
const CurrencyTicker = _styledComponents.default.div.withConfig({
|
|
44
|
+
displayName: "PaymentDetailsCard__CurrencyTicker",
|
|
45
|
+
componentId: "sc-e830fo-7"
|
|
46
|
+
})(["font-size:22px;font-weight:300;color:#90A1B9;letter-spacing:0.8px;line-height:28px;flex-shrink:0;margin-left:auto;"]);
|
|
33
47
|
const CurrencyLogo = _styledComponents.default.div.withConfig({
|
|
34
48
|
displayName: "PaymentDetailsCard__CurrencyLogo",
|
|
35
|
-
componentId: "sc-e830fo-
|
|
36
|
-
})(["width:
|
|
49
|
+
componentId: "sc-e830fo-8"
|
|
50
|
+
})(["width:24px;height:24px;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
51
|
const CurrencyIcon = _styledComponents.default.img.withConfig({
|
|
38
52
|
displayName: "PaymentDetailsCard__CurrencyIcon",
|
|
39
|
-
componentId: "sc-e830fo-
|
|
53
|
+
componentId: "sc-e830fo-9"
|
|
40
54
|
})(["width:100%;height:100%;object-fit:contain;"]);
|
|
41
55
|
const AmountValue = _styledComponents.default.div.withConfig({
|
|
42
56
|
displayName: "PaymentDetailsCard__AmountValue",
|
|
43
|
-
componentId: "sc-e830fo-
|
|
44
|
-
})(["font-size:34px;font-weight:
|
|
57
|
+
componentId: "sc-e830fo-10"
|
|
58
|
+
})(["font-size:34px;font-weight:300;text-transform:uppercase;line-height:40px;letter-spacing:1.5px;word-wrap:break-word;color:", ";"], _colors.default.futureBlack);
|
|
45
59
|
const Separator = _styledComponents.default.hr.withConfig({
|
|
46
60
|
displayName: "PaymentDetailsCard__Separator",
|
|
47
|
-
componentId: "sc-e830fo-
|
|
48
|
-
})(["border:none;border-top:1px solid
|
|
61
|
+
componentId: "sc-e830fo-11"
|
|
62
|
+
})(["border:none;border-top:1px solid #E2E8F0;margin:20px 0px;"]);
|
|
63
|
+
const ArrowSeparatorWrapper = _styledComponents.default.div.withConfig({
|
|
64
|
+
displayName: "PaymentDetailsCard__ArrowSeparatorWrapper",
|
|
65
|
+
componentId: "sc-e830fo-12"
|
|
66
|
+
})(["position:relative;display:flex;align-items:center;margin:20px 0;&::before,&::after{content:'';flex:1;height:1px;background:#E2E8F0;}"]);
|
|
67
|
+
const ArrowCircle = _styledComponents.default.div.withConfig({
|
|
68
|
+
displayName: "PaymentDetailsCard__ArrowCircle",
|
|
69
|
+
componentId: "sc-e830fo-13"
|
|
70
|
+
})(["display:flex;align-items:center;justify-content:center;margin:0 16px;height:0;color:#CBD5E1;"]);
|
|
71
|
+
const SectionHeader = _styledComponents.default.div.withConfig({
|
|
72
|
+
displayName: "PaymentDetailsCard__SectionHeader",
|
|
73
|
+
componentId: "sc-e830fo-14"
|
|
74
|
+
})(["font-size:11px;font-weight:400;line-height:20px;text-transform:uppercase;letter-spacing:2px;color:", ";text-align:start;margin-bottom:4px;"], _colors.default.grayBlue);
|
|
49
75
|
const DetailsSection = _styledComponents.default.div.withConfig({
|
|
50
76
|
displayName: "PaymentDetailsCard__DetailsSection",
|
|
51
|
-
componentId: "sc-e830fo-
|
|
52
|
-
})(["margin-bottom:", ";"], props => props.noMargin ? '0' : '
|
|
77
|
+
componentId: "sc-e830fo-15"
|
|
78
|
+
})(["margin-bottom:", ";"], props => props.noMargin ? '0' : '20px');
|
|
53
79
|
const DetailRow = _styledComponents.default.div.withConfig({
|
|
54
80
|
displayName: "PaymentDetailsCard__DetailRow",
|
|
55
|
-
componentId: "sc-e830fo-
|
|
56
|
-
})(["display:flex;justify-content:space-between;align-items:flex-start;padding:
|
|
81
|
+
componentId: "sc-e830fo-16"
|
|
82
|
+
})(["display:flex;justify-content:space-between;align-items:flex-start;padding:6px 0;&:first-child{padding-top:0;}&:last-child{padding:6px 0 0 0;}"]);
|
|
57
83
|
const DetailLabel = _styledComponents.default.div.withConfig({
|
|
58
84
|
displayName: "PaymentDetailsCard__DetailLabel",
|
|
59
|
-
componentId: "sc-e830fo-
|
|
60
|
-
})(["display:flex;align-items:center;gap:10px;font-size:14px;font-weight:
|
|
85
|
+
componentId: "sc-e830fo-17"
|
|
86
|
+
})(["display:flex;align-items:center;gap:10px;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0.5px;color:#56606f;i{font-size:14px;}"]);
|
|
61
87
|
const DetailValue = _styledComponents.default.div.withConfig({
|
|
62
88
|
displayName: "PaymentDetailsCard__DetailValue",
|
|
63
|
-
componentId: "sc-e830fo-
|
|
64
|
-
})(["font-size:14px;font-weight:600;line-height:20px;letter-spacing:0.5px;word-wrap:break-word;text-align:right;max-width:60%;color:", ";"], _colors.default.
|
|
89
|
+
componentId: "sc-e830fo-18"
|
|
90
|
+
})(["font-size:14px;font-weight:600;line-height:20px;letter-spacing:0.5px;word-wrap:break-word;text-align:right;max-width:60%;color:", ";"], _colors.default.futureBlack);
|
|
65
91
|
const PlaceholderValue = _styledComponents.default.span.withConfig({
|
|
66
92
|
displayName: "PaymentDetailsCard__PlaceholderValue",
|
|
67
|
-
componentId: "sc-e830fo-
|
|
68
|
-
})(["color
|
|
93
|
+
componentId: "sc-e830fo-19"
|
|
94
|
+
})(["color:", ";font-weight:300;font-size:14px;letter-spacing:0.5px;"], _colors.default.grayBlue);
|
|
95
|
+
const ExternalLink = _styledComponents.default.a.withConfig({
|
|
96
|
+
displayName: "PaymentDetailsCard__ExternalLink",
|
|
97
|
+
componentId: "sc-e830fo-20"
|
|
98
|
+
})(["color:", ";text-decoration:underline;font-size:14px;font-weight:600;letter-spacing:0.5px;display:inline-flex;align-items:center;gap:6px;&:hover{text-decoration:underline;}svg{width:12px;height:12px;flex-shrink:0;}"], _colors.default.futureBlack);
|
|
69
99
|
const InfoSectionContainer = _styledComponents.default.div.withConfig({
|
|
70
100
|
displayName: "PaymentDetailsCard__InfoSectionContainer",
|
|
71
|
-
componentId: "sc-e830fo-
|
|
101
|
+
componentId: "sc-e830fo-21"
|
|
72
102
|
})(["margin-top:24px;"]);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
103
|
+
const BannerSlot = _styledComponents.default.div.withConfig({
|
|
104
|
+
displayName: "PaymentDetailsCard__BannerSlot",
|
|
105
|
+
componentId: "sc-e830fo-22"
|
|
106
|
+
})(["margin-top:8px;"]);
|
|
107
|
+
const ExternalLinkIconImg = _styledComponents.default.img.withConfig({
|
|
108
|
+
displayName: "PaymentDetailsCard__ExternalLinkIconImg",
|
|
109
|
+
componentId: "sc-e830fo-23"
|
|
110
|
+
})(["width:12px;height:12px;flex-shrink:0;"]);
|
|
77
111
|
const DetailItem = _ref => {
|
|
78
112
|
let {
|
|
79
113
|
label,
|
|
80
114
|
value,
|
|
81
115
|
tooltip,
|
|
82
116
|
placeholder,
|
|
83
|
-
isCustom
|
|
117
|
+
isCustom,
|
|
118
|
+
href,
|
|
119
|
+
target
|
|
84
120
|
} = _ref;
|
|
85
|
-
// If value is a custom component (React element), render it directly
|
|
86
121
|
const renderValue = () => {
|
|
87
122
|
if (isCustom && value) {
|
|
88
123
|
return value;
|
|
89
124
|
}
|
|
125
|
+
if (href) {
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(ExternalLink, {
|
|
127
|
+
href: href,
|
|
128
|
+
target: target || '_blank',
|
|
129
|
+
rel: "noopener noreferrer"
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement(ExternalLinkIconImg, {
|
|
131
|
+
src: _externalLinkIcon.default,
|
|
132
|
+
alt: ""
|
|
133
|
+
}), value || placeholder || '-');
|
|
134
|
+
}
|
|
90
135
|
if (value !== undefined && value !== null && value !== '') {
|
|
91
136
|
return value;
|
|
92
137
|
}
|
|
93
138
|
if (placeholder) {
|
|
94
139
|
return /*#__PURE__*/_react.default.createElement(PlaceholderValue, null, placeholder);
|
|
95
140
|
}
|
|
96
|
-
return
|
|
141
|
+
return "-";
|
|
97
142
|
};
|
|
98
143
|
return /*#__PURE__*/_react.default.createElement(DetailRow, null, /*#__PURE__*/_react.default.createElement(DetailLabel, null, label, tooltip && /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, {
|
|
99
144
|
containerStyle: {
|
|
@@ -105,88 +150,158 @@ const DetailItem = _ref => {
|
|
|
105
150
|
})), /*#__PURE__*/_react.default.createElement(DetailValue, null, renderValue()));
|
|
106
151
|
};
|
|
107
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Renders a single amount block with icon, value, and optional currency ticker.
|
|
155
|
+
*/
|
|
156
|
+
const AmountBlock = _ref2 => {
|
|
157
|
+
let {
|
|
158
|
+
config
|
|
159
|
+
} = _ref2;
|
|
160
|
+
if (!config) return null;
|
|
161
|
+
if (/*#__PURE__*/_react.default.isValidElement(config)) {
|
|
162
|
+
return config;
|
|
163
|
+
}
|
|
164
|
+
const {
|
|
165
|
+
label = 'Amount',
|
|
166
|
+
subtitle,
|
|
167
|
+
amount,
|
|
168
|
+
currency,
|
|
169
|
+
currencyColor,
|
|
170
|
+
icon,
|
|
171
|
+
showTicker = true,
|
|
172
|
+
banner
|
|
173
|
+
} = config;
|
|
174
|
+
const formattedAmount = amount !== undefined && amount !== null && amount !== '' ? (0, _formatCurrencyValue.formatCurrencyValue)(currency, amount, 2, {
|
|
175
|
+
valueFirst: true
|
|
176
|
+
}) : null;
|
|
177
|
+
const currencyIcon = (0, _formatCurrencyValue.getCurrencyIcon)(currency, icon);
|
|
178
|
+
const logoColor = currencyColor || _colors.default.black;
|
|
179
|
+
const ticker = showTicker ? (currency || '').toUpperCase() : null;
|
|
180
|
+
const displayValue = formattedAmount ? formattedAmount.replace(/\s*\S+$/, '') : null;
|
|
181
|
+
const renderCurrencyLogo = () => {
|
|
182
|
+
if (currencyIcon) {
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement(CurrencyLogo, {
|
|
184
|
+
color: "transparent"
|
|
185
|
+
}, /*#__PURE__*/_react.default.createElement(CurrencyIcon, {
|
|
186
|
+
src: currencyIcon,
|
|
187
|
+
alt: currency || 'currency'
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
return /*#__PURE__*/_react.default.createElement(CurrencyLogo, {
|
|
191
|
+
color: logoColor
|
|
192
|
+
}, currency ? currency.charAt(0).toUpperCase() : '');
|
|
193
|
+
};
|
|
194
|
+
return /*#__PURE__*/_react.default.createElement(AmountSection, null, /*#__PURE__*/_react.default.createElement(AmountLabel, {
|
|
195
|
+
hasSubtitle: !!subtitle
|
|
196
|
+
}, label), /*#__PURE__*/_react.default.createElement(AmountDisplay, null, /*#__PURE__*/_react.default.createElement(AmountLeft, null, renderCurrencyLogo(), /*#__PURE__*/_react.default.createElement(AmountValue, null, displayValue !== null ? displayValue : "-")), ticker && /*#__PURE__*/_react.default.createElement(CurrencyTicker, null, ticker)), subtitle && /*#__PURE__*/_react.default.createElement(AmountSubtitle, null, subtitle), banner && /*#__PURE__*/_react.default.createElement(BannerSlot, null, banner));
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Renders a group of detail rows, optionally with a section header.
|
|
201
|
+
*/
|
|
202
|
+
const DetailGroup = _ref3 => {
|
|
203
|
+
let {
|
|
204
|
+
group,
|
|
205
|
+
isLast
|
|
206
|
+
} = _ref3;
|
|
207
|
+
const {
|
|
208
|
+
sectionTitle,
|
|
209
|
+
items
|
|
210
|
+
} = group;
|
|
211
|
+
return /*#__PURE__*/_react.default.createElement(DetailsSection, {
|
|
212
|
+
noMargin: isLast
|
|
213
|
+
}, sectionTitle && /*#__PURE__*/_react.default.createElement(SectionHeader, null, sectionTitle), items.map((detail, index) => /*#__PURE__*/_react.default.createElement(DetailItem, {
|
|
214
|
+
key: detail.key || index,
|
|
215
|
+
label: detail.label,
|
|
216
|
+
value: detail.value,
|
|
217
|
+
tooltip: detail.tooltip,
|
|
218
|
+
placeholder: detail.placeholder,
|
|
219
|
+
isCustom: detail.isCustom,
|
|
220
|
+
href: detail.href,
|
|
221
|
+
target: detail.target
|
|
222
|
+
})));
|
|
223
|
+
};
|
|
224
|
+
|
|
108
225
|
/**
|
|
109
226
|
* PaymentDetailsCard - Fully customizable details card
|
|
110
227
|
*
|
|
111
|
-
* @param {string} title - Optional card title
|
|
112
|
-
* @param {object|node} amountSection -
|
|
113
|
-
* - If object: { label, amount, currency, currencyColor, icon }
|
|
228
|
+
* @param {string} title - Optional card title (displayed in header bar)
|
|
229
|
+
* @param {object|node} amountSection - Single amount config or custom node (backward compat)
|
|
230
|
+
* - If object: { label, subtitle, amount, currency, currencyColor, icon, showTicker, banner }
|
|
114
231
|
* - If node: renders custom component
|
|
115
|
-
* @param {array}
|
|
116
|
-
* - { label,
|
|
232
|
+
* @param {array} amountSections - Array of amount configs for multiple amount blocks
|
|
233
|
+
* - Each: { label, subtitle, amount, currency, currencyColor, icon, showTicker, banner }
|
|
234
|
+
* @param {array} details - Flat array of detail items (backward compat)
|
|
235
|
+
* - { label, value, tooltip, placeholder, isCustom, href, target }
|
|
236
|
+
* @param {array} detailGroups - Array of grouped detail sections with optional headers
|
|
237
|
+
* - { sectionTitle, items: [{ label, value, tooltip, placeholder, isCustom, href, target }] }
|
|
117
238
|
* @param {node} infoSection - Optional custom node for bottom info section
|
|
118
239
|
* @param {boolean} showSeparators - Whether to show separators between sections
|
|
240
|
+
* @param {boolean} showArrowSeparator - Show a down-arrow separator between amount sections
|
|
241
|
+
* @param {object} containerStyle - Optional inline style for the container
|
|
119
242
|
*/
|
|
120
|
-
const PaymentDetailsCard =
|
|
243
|
+
const PaymentDetailsCard = _ref4 => {
|
|
121
244
|
let {
|
|
122
245
|
title,
|
|
123
246
|
amountSection,
|
|
247
|
+
amountSections,
|
|
124
248
|
details,
|
|
249
|
+
detailGroups,
|
|
125
250
|
infoSection,
|
|
126
251
|
showSeparators = true,
|
|
252
|
+
showArrowSeparator = false,
|
|
127
253
|
containerStyle
|
|
128
|
-
} =
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
currency,
|
|
143
|
-
currencyColor,
|
|
144
|
-
icon
|
|
145
|
-
} = amountSection;
|
|
146
|
-
const displayAmount = (0, _formatCurrencyValue.formatCurrencyValue)(currency, amount, 2, {
|
|
147
|
-
valueFirst: true
|
|
254
|
+
} = _ref4;
|
|
255
|
+
const allAmountSections = amountSections || (amountSection ? [amountSection] : []);
|
|
256
|
+
const renderAmountSections = () => {
|
|
257
|
+
if (allAmountSections.length === 0) return null;
|
|
258
|
+
return allAmountSections.map((section, index) => {
|
|
259
|
+
const isLast = index === allAmountSections.length - 1;
|
|
260
|
+
const useArrow = showArrowSeparator && !isLast && allAmountSections.length > 1;
|
|
261
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
262
|
+
key: index
|
|
263
|
+
}, /*#__PURE__*/_react.default.createElement(AmountBlock, {
|
|
264
|
+
config: section
|
|
265
|
+
}), showSeparators && !isLast && (useArrow ? /*#__PURE__*/_react.default.createElement(ArrowSeparatorWrapper, null, /*#__PURE__*/_react.default.createElement(ArrowCircle, null, /*#__PURE__*/_react.default.createElement(_ArrowSimple.ArrowSimple, {
|
|
266
|
+
direction: "bottom"
|
|
267
|
+
}))) : /*#__PURE__*/_react.default.createElement(Separator, null)), showSeparators && isLast && (detailGroups || details) && /*#__PURE__*/_react.default.createElement(Separator, null));
|
|
148
268
|
});
|
|
149
|
-
const currencyIcon = (0, _formatCurrencyValue.getCurrencyIcon)(currency, icon);
|
|
150
|
-
const logoColor = currencyColor || _colors.default.black;
|
|
151
|
-
const renderCurrencyLogo = () => {
|
|
152
|
-
if (currencyIcon) {
|
|
153
|
-
return /*#__PURE__*/_react.default.createElement(CurrencyLogo, {
|
|
154
|
-
color: 'transparent'
|
|
155
|
-
}, /*#__PURE__*/_react.default.createElement(CurrencyIcon, {
|
|
156
|
-
src: currencyIcon,
|
|
157
|
-
alt: currency || 'currency'
|
|
158
|
-
}));
|
|
159
|
-
}
|
|
160
|
-
return /*#__PURE__*/_react.default.createElement(CurrencyLogo, {
|
|
161
|
-
color: logoColor
|
|
162
|
-
}, currency ? currency.charAt(0).toUpperCase() : '');
|
|
163
|
-
};
|
|
164
|
-
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));
|
|
165
269
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
270
|
+
const renderDetails = () => {
|
|
271
|
+
if (detailGroups && detailGroups.length > 0) {
|
|
272
|
+
return detailGroups.map((group, index) => {
|
|
273
|
+
const isLast = index === detailGroups.length - 1 && !infoSection;
|
|
274
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
275
|
+
key: group.key || index
|
|
276
|
+
}, /*#__PURE__*/_react.default.createElement(DetailGroup, {
|
|
277
|
+
group: group,
|
|
278
|
+
isLast: isLast
|
|
279
|
+
}));
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
if (details && details.length > 0) {
|
|
283
|
+
return /*#__PURE__*/_react.default.createElement(DetailsSection, {
|
|
284
|
+
noMargin: !infoSection
|
|
285
|
+
}, details.map((detail, index) => /*#__PURE__*/_react.default.createElement(DetailItem, {
|
|
286
|
+
key: detail.key || index,
|
|
287
|
+
label: detail.label,
|
|
288
|
+
value: detail.value,
|
|
289
|
+
tooltip: detail.tooltip,
|
|
290
|
+
placeholder: detail.placeholder,
|
|
291
|
+
isCustom: detail.isCustom,
|
|
292
|
+
href: detail.href,
|
|
293
|
+
target: detail.target
|
|
294
|
+
})));
|
|
295
|
+
}
|
|
296
|
+
return null;
|
|
180
297
|
};
|
|
181
|
-
|
|
182
|
-
// Render info section
|
|
183
298
|
const renderInfoSection = () => {
|
|
184
299
|
if (!infoSection) return null;
|
|
185
300
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showSeparators && /*#__PURE__*/_react.default.createElement(Separator, null), /*#__PURE__*/_react.default.createElement(InfoSectionContainer, null, infoSection));
|
|
186
301
|
};
|
|
187
302
|
return /*#__PURE__*/_react.default.createElement(CardContainer, {
|
|
188
303
|
style: containerStyle
|
|
189
|
-
}, title && /*#__PURE__*/_react.default.createElement(CardTitle, null, title),
|
|
304
|
+
}, title && /*#__PURE__*/_react.default.createElement(CardTitle, null, title), renderAmountSections(), renderDetails(), renderInfoSection());
|
|
190
305
|
};
|
|
191
306
|
exports.PaymentDetailsCard = PaymentDetailsCard;
|
|
192
307
|
var _default = exports.default = PaymentDetailsCard;
|
package/dist/index.js
CHANGED
|
@@ -1553,4 +1553,15 @@ Object.keys(_Snackbar).forEach(function (key) {
|
|
|
1553
1553
|
return _Snackbar[key];
|
|
1554
1554
|
}
|
|
1555
1555
|
});
|
|
1556
|
+
});
|
|
1557
|
+
var _InfoBox = require("./components/InfoBox/InfoBox");
|
|
1558
|
+
Object.keys(_InfoBox).forEach(function (key) {
|
|
1559
|
+
if (key === "default" || key === "__esModule") return;
|
|
1560
|
+
if (key in exports && exports[key] === _InfoBox[key]) return;
|
|
1561
|
+
Object.defineProperty(exports, key, {
|
|
1562
|
+
enumerable: true,
|
|
1563
|
+
get: function () {
|
|
1564
|
+
return _InfoBox[key];
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1556
1567
|
});
|
|
@@ -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 d="M4.33347 1.66667H3.13347C2.38673 1.66667 2.01308 1.66667 1.72787 1.81199C1.47698 1.93982 1.27315 2.14365 1.14533 2.39453C1 2.67975 1 3.05339 1 3.80013V8.8668C1 9.61353 1 9.98673 1.14533 10.2719C1.27315 10.5228 1.47698 10.727 1.72787 10.8548C2.0128 11 2.38599 11 3.13127 11H8.20207C8.94733 11 9.32 11 9.60493 10.8548C9.8558 10.727 10.0603 10.5226 10.1881 10.2717C10.3333 9.9868 10.3333 9.614 10.3333 8.86873V7.66667M11 4.33333V1M11 1H7.66667M11 1L6.33333 5.66667" stroke="#BCBCBC" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/styles/colors.js
CHANGED