@stokr/components-library 2.3.65-beta.3 → 2.3.65-beta.5
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 +187 -0
- package/dist/components/Input/MultiSelect.stories.js +141 -0
- 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 +188 -0
- package/dist/components/Payment/PaymentDetailsCard.stories.js +198 -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/TextLink/TextLink.stories.js +25 -0
- package/dist/index.js +33 -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/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,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithoutCloseButton = exports.WithContent = exports.NoDimmerClose = exports.LongContent = exports.DifferentWidths = exports.Basic = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _SideModal = _interopRequireDefault(require("./SideModal"));
|
|
9
|
+
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
10
|
+
var _Button = _interopRequireDefault(require("../Button/Button.styles"));
|
|
11
|
+
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
12
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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); }
|
|
15
|
+
var _default = exports.default = {
|
|
16
|
+
title: 'Components Library/Modal/SideModal',
|
|
17
|
+
component: _SideModal.default,
|
|
18
|
+
decorators: [Story => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(Story, null))],
|
|
19
|
+
argTypes: {
|
|
20
|
+
isOpen: {
|
|
21
|
+
control: 'boolean',
|
|
22
|
+
description: 'Controls modal visibility'
|
|
23
|
+
},
|
|
24
|
+
width: {
|
|
25
|
+
control: {
|
|
26
|
+
type: 'range',
|
|
27
|
+
min: 20,
|
|
28
|
+
max: 90,
|
|
29
|
+
step: 5
|
|
30
|
+
},
|
|
31
|
+
description: 'Width as percentage of screen',
|
|
32
|
+
defaultValue: 40
|
|
33
|
+
},
|
|
34
|
+
minWidth: {
|
|
35
|
+
control: 'number',
|
|
36
|
+
description: 'Minimum width in pixels',
|
|
37
|
+
defaultValue: 400
|
|
38
|
+
},
|
|
39
|
+
closeOnDimmerClick: {
|
|
40
|
+
control: 'boolean',
|
|
41
|
+
description: 'Close modal when clicking dimmed area',
|
|
42
|
+
defaultValue: true
|
|
43
|
+
},
|
|
44
|
+
showCloseButton: {
|
|
45
|
+
control: 'boolean',
|
|
46
|
+
description: 'Show close button',
|
|
47
|
+
defaultValue: true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}; // Basic example
|
|
51
|
+
const Basic = () => {
|
|
52
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
54
|
+
onClick: () => setIsOpen(true)
|
|
55
|
+
}, "Open Side Modal"), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
56
|
+
isOpen: isOpen,
|
|
57
|
+
onClose: () => setIsOpen(false)
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
style: {
|
|
60
|
+
padding: '40px'
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
63
|
+
style: {
|
|
64
|
+
marginBottom: '20px'
|
|
65
|
+
}
|
|
66
|
+
}, "Basic Side Modal"), /*#__PURE__*/_react.default.createElement("p", {
|
|
67
|
+
style: {
|
|
68
|
+
marginBottom: '16px',
|
|
69
|
+
lineHeight: '1.6'
|
|
70
|
+
}
|
|
71
|
+
}, "This is a basic side modal that slides in from the right. It takes 40% of the screen width by default."), /*#__PURE__*/_react.default.createElement("p", {
|
|
72
|
+
style: {
|
|
73
|
+
marginBottom: '16px',
|
|
74
|
+
lineHeight: '1.6'
|
|
75
|
+
}
|
|
76
|
+
}, "You can close it by clicking the X button, clicking outside, or pressing Escape."), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
77
|
+
onClick: () => setIsOpen(false)
|
|
78
|
+
}, "Close Modal"))));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Different widths
|
|
82
|
+
exports.Basic = Basic;
|
|
83
|
+
const DifferentWidths = () => {
|
|
84
|
+
const [isOpen30, setIsOpen30] = (0, _react.useState)(false);
|
|
85
|
+
const [isOpen40, setIsOpen40] = (0, _react.useState)(false);
|
|
86
|
+
const [isOpen60, setIsOpen60] = (0, _react.useState)(false);
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
style: {
|
|
89
|
+
display: 'flex',
|
|
90
|
+
flexDirection: 'column',
|
|
91
|
+
gap: '16px'
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
94
|
+
onClick: () => setIsOpen30(true)
|
|
95
|
+
}, "Open 30% Width"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
96
|
+
onClick: () => setIsOpen40(true)
|
|
97
|
+
}, "Open 40% Width"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
98
|
+
onClick: () => setIsOpen60(true)
|
|
99
|
+
}, "Open 60% Width")), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
100
|
+
isOpen: isOpen30,
|
|
101
|
+
onClose: () => setIsOpen30(false),
|
|
102
|
+
width: 30,
|
|
103
|
+
minWidth: 300
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
+
style: {
|
|
106
|
+
padding: '40px'
|
|
107
|
+
}
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, "30% Width Modal"), /*#__PURE__*/_react.default.createElement("p", null, "This modal takes 30% of the screen width."))), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
109
|
+
isOpen: isOpen40,
|
|
110
|
+
onClose: () => setIsOpen40(false),
|
|
111
|
+
width: 40,
|
|
112
|
+
minWidth: 400
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
+
style: {
|
|
115
|
+
padding: '40px'
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, "40% Width Modal"), /*#__PURE__*/_react.default.createElement("p", null, "This modal takes 40% of the screen width (default)."))), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
118
|
+
isOpen: isOpen60,
|
|
119
|
+
onClose: () => setIsOpen60(false),
|
|
120
|
+
width: 60,
|
|
121
|
+
minWidth: 500
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
+
style: {
|
|
124
|
+
padding: '40px'
|
|
125
|
+
}
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, "60% Width Modal"), /*#__PURE__*/_react.default.createElement("p", null, "This modal takes 60% of the screen width."))));
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// With content example (like payout details)
|
|
130
|
+
exports.DifferentWidths = DifferentWidths;
|
|
131
|
+
const WithContent = () => {
|
|
132
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
134
|
+
onClick: () => setIsOpen(true)
|
|
135
|
+
}, "View Payout Details"), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
136
|
+
isOpen: isOpen,
|
|
137
|
+
onClose: () => setIsOpen(false)
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
+
style: {
|
|
140
|
+
padding: '40px'
|
|
141
|
+
}
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement("h1", {
|
|
143
|
+
style: {
|
|
144
|
+
fontSize: '24px',
|
|
145
|
+
fontWeight: 'bold',
|
|
146
|
+
marginBottom: '8px',
|
|
147
|
+
textTransform: 'uppercase'
|
|
148
|
+
}
|
|
149
|
+
}, "PAYOUT DETAILS"), /*#__PURE__*/_react.default.createElement("p", {
|
|
150
|
+
style: {
|
|
151
|
+
color: _colors.default.grey2,
|
|
152
|
+
marginBottom: '32px'
|
|
153
|
+
}
|
|
154
|
+
}, "View all payout information here."), /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
+
style: {
|
|
156
|
+
marginBottom: '32px'
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement("h3", {
|
|
159
|
+
style: {
|
|
160
|
+
marginBottom: '16px',
|
|
161
|
+
fontSize: '16px'
|
|
162
|
+
}
|
|
163
|
+
}, "Status"), /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
+
style: {
|
|
165
|
+
display: 'flex',
|
|
166
|
+
flexDirection: 'column',
|
|
167
|
+
gap: '16px'
|
|
168
|
+
}
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
style: {
|
|
171
|
+
display: 'flex',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
gap: '8px'
|
|
174
|
+
}
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
176
|
+
style: {
|
|
177
|
+
color: _colors.default.freshGreen
|
|
178
|
+
}
|
|
179
|
+
}, "\u2713"), /*#__PURE__*/_react.default.createElement("span", {
|
|
180
|
+
style: {
|
|
181
|
+
fontWeight: 'bold'
|
|
182
|
+
}
|
|
183
|
+
}, "Initiated"), /*#__PURE__*/_react.default.createElement("span", {
|
|
184
|
+
style: {
|
|
185
|
+
color: _colors.default.grey2,
|
|
186
|
+
fontSize: '12px'
|
|
187
|
+
}
|
|
188
|
+
}, "12. AUG 2025 11:57")), /*#__PURE__*/_react.default.createElement("p", {
|
|
189
|
+
style: {
|
|
190
|
+
color: _colors.default.grey2,
|
|
191
|
+
fontSize: '14px',
|
|
192
|
+
marginLeft: '24px'
|
|
193
|
+
}
|
|
194
|
+
}, "Awaiting receipt of your funds.")))), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
|
+
style: {
|
|
196
|
+
backgroundColor: _colors.default.grey3,
|
|
197
|
+
padding: '20px',
|
|
198
|
+
borderRadius: '8px',
|
|
199
|
+
marginBottom: '24px'
|
|
200
|
+
}
|
|
201
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
style: {
|
|
203
|
+
marginBottom: '16px'
|
|
204
|
+
}
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
206
|
+
style: {
|
|
207
|
+
color: _colors.default.grey2,
|
|
208
|
+
fontSize: '12px'
|
|
209
|
+
}
|
|
210
|
+
}, "Amount"), /*#__PURE__*/_react.default.createElement("div", {
|
|
211
|
+
style: {
|
|
212
|
+
display: 'flex',
|
|
213
|
+
alignItems: 'center',
|
|
214
|
+
gap: '8px'
|
|
215
|
+
}
|
|
216
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
217
|
+
style: {
|
|
218
|
+
fontSize: '20px',
|
|
219
|
+
fontWeight: 'bold'
|
|
220
|
+
}
|
|
221
|
+
}, "13.23145 BTC"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
222
|
+
style: {
|
|
223
|
+
marginBottom: '16px'
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
226
|
+
style: {
|
|
227
|
+
color: _colors.default.grey2,
|
|
228
|
+
fontSize: '12px'
|
|
229
|
+
}
|
|
230
|
+
}, "Wallet address"), /*#__PURE__*/_react.default.createElement("div", {
|
|
231
|
+
style: {
|
|
232
|
+
fontWeight: 'bold'
|
|
233
|
+
}
|
|
234
|
+
}, "GAYiyo[...]LGXg")), /*#__PURE__*/_react.default.createElement("div", {
|
|
235
|
+
style: {
|
|
236
|
+
marginBottom: '16px'
|
|
237
|
+
}
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
239
|
+
style: {
|
|
240
|
+
color: _colors.default.grey2,
|
|
241
|
+
fontSize: '12px'
|
|
242
|
+
}
|
|
243
|
+
}, "Period"), /*#__PURE__*/_react.default.createElement("div", {
|
|
244
|
+
style: {
|
|
245
|
+
fontWeight: 'bold'
|
|
246
|
+
}
|
|
247
|
+
}, "01.10.2025. - 31.11.2025.")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", {
|
|
248
|
+
style: {
|
|
249
|
+
color: _colors.default.grey2,
|
|
250
|
+
fontSize: '12px'
|
|
251
|
+
}
|
|
252
|
+
}, "Type"), /*#__PURE__*/_react.default.createElement("div", {
|
|
253
|
+
style: {
|
|
254
|
+
fontWeight: 'bold'
|
|
255
|
+
}
|
|
256
|
+
}, "Interest"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
257
|
+
style: {
|
|
258
|
+
backgroundColor: _colors.default.grey3,
|
|
259
|
+
padding: '20px',
|
|
260
|
+
borderRadius: '8px',
|
|
261
|
+
marginBottom: '24px'
|
|
262
|
+
}
|
|
263
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
264
|
+
style: {
|
|
265
|
+
color: _colors.default.grey2,
|
|
266
|
+
fontSize: '14px',
|
|
267
|
+
marginBottom: '8px'
|
|
268
|
+
}
|
|
269
|
+
}, "To modify payout details or cancel this transaction, contact our support team at", ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
270
|
+
href: "mailto:support@stokr.io",
|
|
271
|
+
style: {
|
|
272
|
+
color: _colors.default.blue,
|
|
273
|
+
textDecoration: 'none'
|
|
274
|
+
}
|
|
275
|
+
}, "support@stokr.io"), ".")), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
276
|
+
onClick: () => setIsOpen(false)
|
|
277
|
+
}, "Close"))));
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// Without close button
|
|
281
|
+
exports.WithContent = WithContent;
|
|
282
|
+
const WithoutCloseButton = () => {
|
|
283
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
284
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
285
|
+
onClick: () => setIsOpen(true)
|
|
286
|
+
}, "Open Modal (No Close Button)"), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
287
|
+
isOpen: isOpen,
|
|
288
|
+
onClose: () => setIsOpen(false),
|
|
289
|
+
showCloseButton: false
|
|
290
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
291
|
+
style: {
|
|
292
|
+
padding: '40px'
|
|
293
|
+
}
|
|
294
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, "Modal Without Close Button"), /*#__PURE__*/_react.default.createElement("p", null, "This modal doesn't have a close button. You can only close it by:"), /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement("li", null, "Clicking outside (on the dimmed area)"), /*#__PURE__*/_react.default.createElement("li", null, "Pressing Escape key"), /*#__PURE__*/_react.default.createElement("li", null, "Using the close button below")), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
295
|
+
onClick: () => setIsOpen(false)
|
|
296
|
+
}, "Close Modal"))));
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// Don't close on dimmer click
|
|
300
|
+
exports.WithoutCloseButton = WithoutCloseButton;
|
|
301
|
+
const NoDimmerClose = () => {
|
|
302
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
303
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
304
|
+
onClick: () => setIsOpen(true)
|
|
305
|
+
}, "Open Modal (No Dimmer Close)"), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
306
|
+
isOpen: isOpen,
|
|
307
|
+
onClose: () => setIsOpen(false),
|
|
308
|
+
closeOnDimmerClick: false
|
|
309
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
310
|
+
style: {
|
|
311
|
+
padding: '40px'
|
|
312
|
+
}
|
|
313
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, "Modal That Doesn't Close on Dimmer Click"), /*#__PURE__*/_react.default.createElement("p", null, "This modal won't close when you click outside. You must use the close button or Escape key."), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
314
|
+
onClick: () => setIsOpen(false)
|
|
315
|
+
}, "Close Modal"))));
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// Long content (scrollable)
|
|
319
|
+
exports.NoDimmerClose = NoDimmerClose;
|
|
320
|
+
const LongContent = () => {
|
|
321
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
322
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
323
|
+
onClick: () => setIsOpen(true)
|
|
324
|
+
}, "Open Modal with Long Content"), /*#__PURE__*/_react.default.createElement(_SideModal.default, {
|
|
325
|
+
isOpen: isOpen,
|
|
326
|
+
onClose: () => setIsOpen(false)
|
|
327
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
328
|
+
style: {
|
|
329
|
+
padding: '40px'
|
|
330
|
+
}
|
|
331
|
+
}, /*#__PURE__*/_react.default.createElement("h2", null, "Long Content Modal"), /*#__PURE__*/_react.default.createElement("p", null, "This modal has scrollable content:"), Array.from({
|
|
332
|
+
length: 50
|
|
333
|
+
}, (_, i) => /*#__PURE__*/_react.default.createElement("p", {
|
|
334
|
+
key: i,
|
|
335
|
+
style: {
|
|
336
|
+
marginBottom: '16px'
|
|
337
|
+
}
|
|
338
|
+
}, "This is paragraph ", i + 1, ". The modal should be scrollable when content exceeds the viewport height.")), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
339
|
+
onClick: () => setIsOpen(false)
|
|
340
|
+
}, "Close Modal"))));
|
|
341
|
+
};
|
|
342
|
+
exports.LongContent = LongContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SideModalRoot = exports.SideModalBox = exports.Dimmer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const SideModalRoot = exports.SideModalRoot = _styledComponents.default.div.withConfig({
|
|
11
|
+
displayName: "SideModalstyles__SideModalRoot",
|
|
12
|
+
componentId: "sc-f9ztpn-0"
|
|
13
|
+
})(["position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;"]);
|
|
14
|
+
const Dimmer = exports.Dimmer = _styledComponents.default.div.withConfig({
|
|
15
|
+
displayName: "SideModalstyles__Dimmer",
|
|
16
|
+
componentId: "sc-f9ztpn-1"
|
|
17
|
+
})(["position:absolute;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);display:flex;justify-content:flex-end;align-items:stretch;opacity:", ";transition:opacity 0.3s ease-in-out;pointer-events:", ";"], props => props.isVisible ? 1 : 0, props => props.isVisible ? 'auto' : 'none');
|
|
18
|
+
const SideModalBox = exports.SideModalBox = _styledComponents.default.div.withConfig({
|
|
19
|
+
displayName: "SideModalstyles__SideModalBox",
|
|
20
|
+
componentId: "sc-f9ztpn-2"
|
|
21
|
+
})(["position:relative;width:", "%;min-width:", "px;max-width:90%;height:100%;background-color:", ";box-shadow:-2px 0 8px rgba(0,0,0,0.15);display:flex;flex-direction:column;overflow-y:auto;transform:translateX(", ");transition:transform 0.3s ease-in-out;z-index:1;pointer-events:auto;@media (max-width:768px){width:90%;min-width:90%;max-width:90%;}"], props => props.width, props => props.minWidth, _colors.default.white, props => props.isVisible ? '0' : '100%');
|
|
@@ -0,0 +1,188 @@
|
|
|
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 _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
|
+
var _default = exports.default = PaymentDetailsCard;
|