@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,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;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StatusTag = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _InfoIcon = _interopRequireDefault(require("../InfoIcon/InfoIcon"));
|
|
9
|
+
var _Icon = require("../Icon/Icon.style");
|
|
10
|
+
var _checkIcon = require("../../static/images/check-icon.svg");
|
|
11
|
+
var _crossIcon = require("../../static/images/cross-icon.svg");
|
|
12
|
+
var _sentIcon = require("../../static/images/sent-icon.svg");
|
|
13
|
+
var _documentIcon = require("../../static/images/document-icon.svg");
|
|
14
|
+
var _transferIcon = require("../../static/images/transfer-icon.svg");
|
|
15
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
16
|
+
var _StatusTag = require("./StatusTag.styles");
|
|
17
|
+
const _excluded = ["variant", "icon", "text", "tooltip", "tooltipProps", "iconColor", "hoverColor", "disableHoverColor", "minWidth", "className", "containerStyle", "iconStyle", "textStyle", "onClick", "center"];
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
22
|
+
const PaidIcon = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
iconColor,
|
|
25
|
+
hoverColor,
|
|
26
|
+
disableHoverColor
|
|
27
|
+
} = _ref;
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(_StatusTag.PaidIconWrapper, {
|
|
29
|
+
iconColor: iconColor,
|
|
30
|
+
hoverColor: hoverColor,
|
|
31
|
+
disableHoverColor: disableHoverColor
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement(_checkIcon.ReactComponent, null));
|
|
33
|
+
};
|
|
34
|
+
const DeclinedIcon = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
iconColor,
|
|
37
|
+
hoverColor,
|
|
38
|
+
disableHoverColor
|
|
39
|
+
} = _ref2;
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_StatusTag.DeclinedIconWrapper, {
|
|
41
|
+
iconColor: iconColor,
|
|
42
|
+
hoverColor: hoverColor,
|
|
43
|
+
disableHoverColor: disableHoverColor
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_crossIcon.ReactComponent, null));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Variant configuration - maps variant to icon and colors only
|
|
48
|
+
const variantConfig = {
|
|
49
|
+
pending: {
|
|
50
|
+
icon: /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
51
|
+
icon: _Icon.iconsMap.inProgress,
|
|
52
|
+
size: 12
|
|
53
|
+
}),
|
|
54
|
+
iconColor: _colors.default.grey2,
|
|
55
|
+
hoverColor: _colors.default.warningOrange,
|
|
56
|
+
disableHoverColor: false
|
|
57
|
+
},
|
|
58
|
+
initiated: {
|
|
59
|
+
icon: /*#__PURE__*/_react.default.createElement(_sentIcon.ReactComponent, {
|
|
60
|
+
width: 12,
|
|
61
|
+
height: 12
|
|
62
|
+
}),
|
|
63
|
+
iconColor: _colors.default.grey2,
|
|
64
|
+
hoverColor: _colors.default.blue,
|
|
65
|
+
disableHoverColor: false
|
|
66
|
+
},
|
|
67
|
+
confirmed: {
|
|
68
|
+
icon: /*#__PURE__*/_react.default.createElement(_documentIcon.ReactComponent, {
|
|
69
|
+
width: 12,
|
|
70
|
+
height: 12
|
|
71
|
+
}),
|
|
72
|
+
iconColor: _colors.default.grey2,
|
|
73
|
+
hoverColor: _colors.default.blue,
|
|
74
|
+
disableHoverColor: false
|
|
75
|
+
},
|
|
76
|
+
declined: {
|
|
77
|
+
icon: (iconColor, hoverColor, disableHoverColor) => /*#__PURE__*/_react.default.createElement(DeclinedIcon, {
|
|
78
|
+
iconColor: iconColor,
|
|
79
|
+
hoverColor: hoverColor,
|
|
80
|
+
disableHoverColor: disableHoverColor
|
|
81
|
+
}),
|
|
82
|
+
iconColor: _colors.default.grey2,
|
|
83
|
+
hoverColor: _colors.default.darkRed,
|
|
84
|
+
disableHoverColor: false
|
|
85
|
+
},
|
|
86
|
+
paid: {
|
|
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
|
|
97
|
+
}),
|
|
98
|
+
iconColor: _colors.default.grey2,
|
|
99
|
+
hoverColor: _colors.default.freshGreen,
|
|
100
|
+
disableHoverColor: false
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const StatusTag = _ref3 => {
|
|
104
|
+
var _variantData$disableH;
|
|
105
|
+
let {
|
|
106
|
+
variant,
|
|
107
|
+
icon,
|
|
108
|
+
text,
|
|
109
|
+
tooltip,
|
|
110
|
+
tooltipProps,
|
|
111
|
+
iconColor,
|
|
112
|
+
hoverColor,
|
|
113
|
+
disableHoverColor,
|
|
114
|
+
minWidth,
|
|
115
|
+
className,
|
|
116
|
+
containerStyle,
|
|
117
|
+
iconStyle,
|
|
118
|
+
textStyle,
|
|
119
|
+
onClick,
|
|
120
|
+
center
|
|
121
|
+
} = _ref3,
|
|
122
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
123
|
+
// If variant is provided, use its configuration (but allow overrides)
|
|
124
|
+
const variantData = variant ? variantConfig[variant] : null;
|
|
125
|
+
|
|
126
|
+
// Determine colors - variant config can be overridden by props
|
|
127
|
+
const finalIconColor = iconColor !== undefined ? iconColor : (variantData === null || variantData === void 0 ? void 0 : variantData.iconColor) || _colors.default.grey2;
|
|
128
|
+
const finalHoverColor = hoverColor !== undefined ? hoverColor : variantData === null || variantData === void 0 ? void 0 : variantData.hoverColor;
|
|
129
|
+
const finalDisableHoverColor = disableHoverColor !== undefined ? disableHoverColor : (_variantData$disableH = variantData === null || variantData === void 0 ? void 0 : variantData.disableHoverColor) !== null && _variantData$disableH !== void 0 ? _variantData$disableH : false;
|
|
130
|
+
|
|
131
|
+
// Determine which icon to use - handle function icons (for paid/declined)
|
|
132
|
+
let finalIcon = null;
|
|
133
|
+
if (icon) {
|
|
134
|
+
finalIcon = icon;
|
|
135
|
+
} else if (variantData !== null && variantData !== void 0 && variantData.icon) {
|
|
136
|
+
if (typeof variantData.icon === 'function') {
|
|
137
|
+
// Icon is a function (paid/declined) - pass color props
|
|
138
|
+
finalIcon = variantData.icon(finalIconColor, finalHoverColor, finalDisableHoverColor);
|
|
139
|
+
} else {
|
|
140
|
+
// Icon is a React element (pending/initiated/confirmed)
|
|
141
|
+
finalIcon = variantData.icon;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const content = /*#__PURE__*/_react.default.createElement(_StatusTag.StatusTagContainer, _extends({
|
|
145
|
+
className: className,
|
|
146
|
+
style: containerStyle,
|
|
147
|
+
onClick: onClick,
|
|
148
|
+
hasClick: !!onClick
|
|
149
|
+
}, props), /*#__PURE__*/_react.default.createElement(_StatusTag.StatusTagWrapper, {
|
|
150
|
+
minWidth: minWidth,
|
|
151
|
+
center: center
|
|
152
|
+
}, finalIcon && /*#__PURE__*/_react.default.createElement(_StatusTag.IconWrapper, {
|
|
153
|
+
iconColor: finalIconColor,
|
|
154
|
+
hoverColor: finalHoverColor,
|
|
155
|
+
disableHoverColor: finalDisableHoverColor,
|
|
156
|
+
style: iconStyle,
|
|
157
|
+
isCustomIcon: typeof (variantData === null || variantData === void 0 ? void 0 : variantData.icon) === 'function'
|
|
158
|
+
}, finalIcon), text && /*#__PURE__*/_react.default.createElement(_StatusTag.StatusText, {
|
|
159
|
+
style: textStyle
|
|
160
|
+
}, text)));
|
|
161
|
+
|
|
162
|
+
// Wrap with InfoIcon tooltip if tooltip is provided
|
|
163
|
+
if (tooltip) {
|
|
164
|
+
return /*#__PURE__*/_react.default.createElement(_InfoIcon.default, _extends({
|
|
165
|
+
title: tooltip,
|
|
166
|
+
position: "top",
|
|
167
|
+
noIcon: true,
|
|
168
|
+
noMarginLeft: true,
|
|
169
|
+
noMarginRight: true
|
|
170
|
+
}, tooltipProps), content);
|
|
171
|
+
}
|
|
172
|
+
return content;
|
|
173
|
+
};
|
|
174
|
+
exports.StatusTag = StatusTag;
|
|
175
|
+
var _default = exports.default = StatusTag;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithTooltips = exports.WithHoverColor = exports.UsingChildren = exports.TableUniformity = exports.Default = exports.CustomIcon = exports.Clickable = exports.AllVariants = exports.AllStatesInRow = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _StatusTag = _interopRequireDefault(require("./StatusTag"));
|
|
9
|
+
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
10
|
+
var _Icon = require("../Icon/Icon.style");
|
|
11
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
12
|
+
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
var _default = exports.default = {
|
|
15
|
+
title: 'Components Library/StatusTag',
|
|
16
|
+
component: _StatusTag.default,
|
|
17
|
+
decorators: [Story => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(Story, null))],
|
|
18
|
+
argTypes: {
|
|
19
|
+
variant: {
|
|
20
|
+
control: {
|
|
21
|
+
type: 'select'
|
|
22
|
+
},
|
|
23
|
+
options: ['pending', 'initiated', 'confirmed', 'declined', 'paid', null],
|
|
24
|
+
description: 'Built-in variant (uses default icon and colors)'
|
|
25
|
+
},
|
|
26
|
+
text: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'Text to display next to the icon'
|
|
29
|
+
},
|
|
30
|
+
icon: {
|
|
31
|
+
control: false,
|
|
32
|
+
description: 'Custom icon component (overrides variant icon)'
|
|
33
|
+
},
|
|
34
|
+
tooltip: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'Tooltip text (uses InfoIcon)'
|
|
37
|
+
},
|
|
38
|
+
iconColor: {
|
|
39
|
+
control: 'color',
|
|
40
|
+
description: 'Default icon color (defaults to grey)'
|
|
41
|
+
},
|
|
42
|
+
hoverColor: {
|
|
43
|
+
control: 'color',
|
|
44
|
+
description: 'Icon color on hover'
|
|
45
|
+
},
|
|
46
|
+
disableHoverColor: {
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
description: 'Disable hover color change (for pre-colored icons)',
|
|
49
|
+
defaultValue: false
|
|
50
|
+
},
|
|
51
|
+
minWidth: {
|
|
52
|
+
control: 'text',
|
|
53
|
+
description: 'Minimum width (for table uniformity)'
|
|
54
|
+
},
|
|
55
|
+
onClick: {
|
|
56
|
+
action: 'clicked',
|
|
57
|
+
description: 'Click handler'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}; // Default example
|
|
61
|
+
const Default = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
62
|
+
variant: "pending",
|
|
63
|
+
text: "Pending"
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
// All variants
|
|
67
|
+
exports.Default = Default;
|
|
68
|
+
const AllVariants = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
style: {
|
|
70
|
+
display: 'flex',
|
|
71
|
+
flexDirection: 'column',
|
|
72
|
+
gap: '16px'
|
|
73
|
+
}
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
75
|
+
variant: "pending",
|
|
76
|
+
text: "Pending"
|
|
77
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
78
|
+
variant: "initiated",
|
|
79
|
+
text: "Initiated"
|
|
80
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
81
|
+
variant: "confirmed",
|
|
82
|
+
text: "Confirmed"
|
|
83
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
84
|
+
variant: "declined",
|
|
85
|
+
text: "Declined"
|
|
86
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
87
|
+
variant: "paid",
|
|
88
|
+
text: "Paid"
|
|
89
|
+
})));
|
|
90
|
+
|
|
91
|
+
// Using children instead of text prop
|
|
92
|
+
exports.AllVariants = AllVariants;
|
|
93
|
+
const UsingChildren = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
style: {
|
|
95
|
+
display: 'flex',
|
|
96
|
+
flexDirection: 'column',
|
|
97
|
+
gap: '16px'
|
|
98
|
+
}
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
100
|
+
variant: "pending"
|
|
101
|
+
}, "Pending"), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
102
|
+
variant: "initiated"
|
|
103
|
+
}, "Initiated"), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
104
|
+
variant: "paid"
|
|
105
|
+
}, "Paid")));
|
|
106
|
+
|
|
107
|
+
// With hover color change
|
|
108
|
+
exports.UsingChildren = UsingChildren;
|
|
109
|
+
const WithHoverColor = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
style: {
|
|
111
|
+
display: 'flex',
|
|
112
|
+
flexDirection: 'column',
|
|
113
|
+
gap: '16px'
|
|
114
|
+
}
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
116
|
+
style: {
|
|
117
|
+
marginBottom: '8px',
|
|
118
|
+
fontSize: '14px'
|
|
119
|
+
}
|
|
120
|
+
}, "Pending (hover to see color change)"), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
121
|
+
variant: "pending",
|
|
122
|
+
text: "Pending"
|
|
123
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
124
|
+
style: {
|
|
125
|
+
marginBottom: '8px',
|
|
126
|
+
fontSize: '14px'
|
|
127
|
+
}
|
|
128
|
+
}, "Custom hover color"), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
129
|
+
variant: "pending",
|
|
130
|
+
text: "Custom Hover",
|
|
131
|
+
hoverColor: _colors.default.blue
|
|
132
|
+
}))));
|
|
133
|
+
|
|
134
|
+
// Custom icon
|
|
135
|
+
exports.WithHoverColor = WithHoverColor;
|
|
136
|
+
const CustomIcon = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
137
|
+
style: {
|
|
138
|
+
display: 'flex',
|
|
139
|
+
flexDirection: 'column',
|
|
140
|
+
gap: '16px'
|
|
141
|
+
}
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
143
|
+
icon: /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
144
|
+
icon: _Icon.iconsMap.check,
|
|
145
|
+
size: 12
|
|
146
|
+
}),
|
|
147
|
+
text: "Custom Icon",
|
|
148
|
+
hoverColor: _colors.default.freshGreen
|
|
149
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
150
|
+
icon: /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
151
|
+
icon: _Icon.iconsMap.warning,
|
|
152
|
+
size: 12
|
|
153
|
+
}),
|
|
154
|
+
text: "Warning",
|
|
155
|
+
hoverColor: _colors.default.warningOrange
|
|
156
|
+
})));
|
|
157
|
+
|
|
158
|
+
// With tooltips
|
|
159
|
+
exports.CustomIcon = CustomIcon;
|
|
160
|
+
const WithTooltips = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
+
style: {
|
|
162
|
+
display: 'flex',
|
|
163
|
+
flexDirection: 'column',
|
|
164
|
+
gap: '16px'
|
|
165
|
+
}
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
167
|
+
variant: "pending",
|
|
168
|
+
text: "Pending",
|
|
169
|
+
tooltip: "This transaction is awaiting confirmation"
|
|
170
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
171
|
+
variant: "initiated",
|
|
172
|
+
text: "Initiated",
|
|
173
|
+
tooltip: "Transaction has been initiated and is in progress"
|
|
174
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
175
|
+
variant: "paid",
|
|
176
|
+
text: "Paid",
|
|
177
|
+
tooltip: "Payment has been successfully completed"
|
|
178
|
+
})));
|
|
179
|
+
|
|
180
|
+
// Table uniformity
|
|
181
|
+
exports.WithTooltips = WithTooltips;
|
|
182
|
+
const TableUniformity = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
183
|
+
style: {
|
|
184
|
+
display: 'flex',
|
|
185
|
+
flexDirection: 'column',
|
|
186
|
+
gap: '8px'
|
|
187
|
+
}
|
|
188
|
+
}, /*#__PURE__*/_react.default.createElement("h4", {
|
|
189
|
+
style: {
|
|
190
|
+
marginBottom: '8px',
|
|
191
|
+
fontSize: '14px'
|
|
192
|
+
}
|
|
193
|
+
}, "All tags with same minWidth (for table columns)"), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
194
|
+
variant: "pending",
|
|
195
|
+
text: "Pending",
|
|
196
|
+
minWidth: "120px",
|
|
197
|
+
center: true
|
|
198
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
199
|
+
variant: "initiated",
|
|
200
|
+
text: "Initiated",
|
|
201
|
+
minWidth: "120px",
|
|
202
|
+
center: true
|
|
203
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
204
|
+
variant: "confirmed",
|
|
205
|
+
text: "Confirmed",
|
|
206
|
+
minWidth: "120px",
|
|
207
|
+
center: true
|
|
208
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
209
|
+
variant: "declined",
|
|
210
|
+
text: "Declined",
|
|
211
|
+
minWidth: "120px",
|
|
212
|
+
center: true
|
|
213
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
214
|
+
variant: "paid",
|
|
215
|
+
text: "Paid",
|
|
216
|
+
minWidth: "120px",
|
|
217
|
+
center: true
|
|
218
|
+
})));
|
|
219
|
+
|
|
220
|
+
// Clickable
|
|
221
|
+
exports.TableUniformity = TableUniformity;
|
|
222
|
+
const Clickable = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
223
|
+
style: {
|
|
224
|
+
display: 'flex',
|
|
225
|
+
flexDirection: 'column',
|
|
226
|
+
gap: '16px'
|
|
227
|
+
}
|
|
228
|
+
}, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
229
|
+
variant: "pending",
|
|
230
|
+
text: "Clickable Pending",
|
|
231
|
+
onClick: () => alert('Clicked!')
|
|
232
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
233
|
+
variant: "paid",
|
|
234
|
+
text: "Clickable Paid",
|
|
235
|
+
onClick: () => alert('Paid clicked!')
|
|
236
|
+
})));
|
|
237
|
+
|
|
238
|
+
// All states in a row
|
|
239
|
+
exports.Clickable = Clickable;
|
|
240
|
+
const AllStatesInRow = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
241
|
+
style: {
|
|
242
|
+
display: 'flex',
|
|
243
|
+
flexWrap: 'wrap',
|
|
244
|
+
gap: '12px'
|
|
245
|
+
}
|
|
246
|
+
}, /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
247
|
+
variant: "pending",
|
|
248
|
+
text: "Pending"
|
|
249
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
250
|
+
variant: "initiated",
|
|
251
|
+
text: "Initiated"
|
|
252
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
253
|
+
variant: "confirmed",
|
|
254
|
+
text: "Confirmed"
|
|
255
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
256
|
+
variant: "declined",
|
|
257
|
+
text: "Declined"
|
|
258
|
+
}), /*#__PURE__*/_react.default.createElement(_StatusTag.default, {
|
|
259
|
+
variant: "paid",
|
|
260
|
+
text: "Paid"
|
|
261
|
+
})));
|
|
262
|
+
exports.AllStatesInRow = AllStatesInRow;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StatusText = exports.StatusTagWrapper = exports.StatusTagContainer = exports.PaidIconWrapper = exports.IconWrapper = exports.DeclinedIconWrapper = 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 StatusTagContainer = exports.StatusTagContainer = _styledComponents.default.div.withConfig({
|
|
11
|
+
displayName: "StatusTagstyles__StatusTagContainer",
|
|
12
|
+
componentId: "sc-24azs1-0"
|
|
13
|
+
})(["display:inline-flex;cursor:", ";transition:opacity 0.2s ease;&:hover{opacity:", ";}"], props => props.hasClick ? 'pointer' : 'default', props => props.hasClick ? 0.8 : 1);
|
|
14
|
+
const StatusTagWrapper = exports.StatusTagWrapper = _styledComponents.default.div.withConfig({
|
|
15
|
+
displayName: "StatusTagstyles__StatusTagWrapper",
|
|
16
|
+
componentId: "sc-24azs1-1"
|
|
17
|
+
})(["display:flex;align-items:center;gap:6px;padding:6px 10px;background-color:transparent;border:1px solid ", ";border-radius:4px;white-space:nowrap;min-width:", ";justify-content:", ";"], _colors.default.lightGrey, props => props.minWidth || 'auto', props => props.center ? 'center' : 'flex-start');
|
|
18
|
+
const IconWrapper = exports.IconWrapper = _styledComponents.default.div.withConfig({
|
|
19
|
+
displayName: "StatusTagstyles__IconWrapper",
|
|
20
|
+
componentId: "sc-24azs1-2"
|
|
21
|
+
})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;width:12px;height:12px;color:", ";transition:color 0.2s ease;svg{width:100%;height:100%;display:block;}", " ", ""], props => props.iconColor || _colors.default.grey2, props => !props.isCustomIcon && "\n svg path,\n svg circle,\n svg rect,\n svg line {\n ".concat(!props.disableHoverColor ? "fill: currentColor;" : '', "\n }\n "), props => !props.disableHoverColor && props.hoverColor && "\n ".concat(StatusTagContainer, ":hover & {\n color: ").concat(props.hoverColor, ";\n }\n "));
|
|
22
|
+
const StatusText = exports.StatusText = _styledComponents.default.span.withConfig({
|
|
23
|
+
displayName: "StatusTagstyles__StatusText",
|
|
24
|
+
componentId: "sc-24azs1-3"
|
|
25
|
+
})(["font-size:12px;font-weight:600;line-height:18px;color:", ";letter-spacing:0.6px;"], _colors.default.black);
|
|
26
|
+
|
|
27
|
+
// Paid icon wrapper (check + green circle)
|
|
28
|
+
const PaidIconWrapper = exports.PaidIconWrapper = _styledComponents.default.div.withConfig({
|
|
29
|
+
displayName: "StatusTagstyles__PaidIconWrapper",
|
|
30
|
+
componentId: "sc-24azs1-4"
|
|
31
|
+
})(["width:12px;height:12px;border-radius:50%;background-color:", ";display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background-color 0.2s ease;svg{width:8px;height:8px;}svg path{stroke:", ";}", ""], props => props.iconColor || _colors.default.grey2, _colors.default.white, props => !props.disableHoverColor && props.hoverColor && "\n ".concat(StatusTagContainer, ":hover & {\n background-color: ").concat(props.hoverColor, ";\n }\n "));
|
|
32
|
+
|
|
33
|
+
// Declined icon wrapper (cross + red circle)
|
|
34
|
+
const DeclinedIconWrapper = exports.DeclinedIconWrapper = _styledComponents.default.div.withConfig({
|
|
35
|
+
displayName: "StatusTagstyles__DeclinedIconWrapper",
|
|
36
|
+
componentId: "sc-24azs1-5"
|
|
37
|
+
})(["width:12px;height:12px;border-radius:50%;background-color:", ";display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background-color 0.2s ease;svg{width:6px;height:6px;}svg path{stroke:", ";}", ""], props => props.iconColor || _colors.default.grey2, _colors.default.white, props => !props.disableHoverColor && props.hoverColor && "\n ".concat(StatusTagContainer, ":hover & {\n background-color: ").concat(props.hoverColor, ";\n }\n "));
|