@stokr/components-library 2.3.65-beta.5 → 2.3.65-beta.7
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/Input/MultiSelect.js +161 -29
- package/dist/components/Input/MultiSelect.stories.js +178 -55
- package/dist/components/Input/SearchInput.js +5 -2
- package/dist/components/Input/SearchInput.stories.js +63 -1
- package/dist/components/Input/SearchInput.styles.js +1 -1
- package/dist/components/Payment/PaymentDetailsCard.js +2 -1
- package/dist/components/StepsProgress/StepIndicator.js +59 -0
- package/dist/components/StepsProgress/StepIndicator.stories.js +153 -0
- package/dist/components/StepsProgress/StepIndicator.styles.js +30 -0
- package/dist/components/TextLink/TextLink.stories.js +12 -2
- package/dist/components/TextLink/TextLink.styles.js +1 -1
- package/dist/index.js +22 -0
- package/package.json +1 -1
|
@@ -7,12 +7,15 @@ exports.default = exports.MultiSelect = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _reactSelect = _interopRequireWildcard(require("react-select"));
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
11
|
var _Input = require("./Input.styles");
|
|
12
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
13
|
+
var _checkIcon = require("../../static/images/check-icon.svg");
|
|
11
14
|
var _Select = require("./Select.styles");
|
|
12
|
-
const _excluded = ["
|
|
15
|
+
const _excluded = ["children", "selectProps"],
|
|
16
|
+
_excluded2 = ["id", "name", "label", "options", "search", "error", "touched", "value", "disabled", "menuHeight", "placeholder", "showCheckboxes", "showCountBadge", "closeMenuOnSelect", "hideSelectedOptions", "width", "minMenuWidth", "maxMenuWidth"];
|
|
13
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
18
|
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
|
-
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); }
|
|
16
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
21
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -20,6 +23,64 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
20
23
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
24
|
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; }
|
|
22
25
|
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; }
|
|
26
|
+
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); }
|
|
27
|
+
const CountBadge = _styledComponents.default.span.withConfig({
|
|
28
|
+
displayName: "MultiSelect__CountBadge",
|
|
29
|
+
componentId: "sc-1udb3q8-0"
|
|
30
|
+
})(["display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;background-color:", ";color:", ";border-radius:10px;font-size:12px;font-weight:600;margin-left:8px;"], _colors.default.black, _colors.default.white);
|
|
31
|
+
const CheckboxWrapper = _styledComponents.default.div.withConfig({
|
|
32
|
+
displayName: "MultiSelect__CheckboxWrapper",
|
|
33
|
+
componentId: "sc-1udb3q8-1"
|
|
34
|
+
})(["display:flex;align-items:center;padding:16px 12px;cursor:pointer;transition:background-color 0.15s ease;&:hover{background-color:", ";}"], _colors.default.grey);
|
|
35
|
+
const Checkbox = _styledComponents.default.div.withConfig({
|
|
36
|
+
displayName: "MultiSelect__Checkbox",
|
|
37
|
+
componentId: "sc-1udb3q8-2"
|
|
38
|
+
})(["width:14px;height:14px;border:1px solid ", ";border-radius:3px;margin-right:12px;display:flex;align-items:center;justify-content:center;background-color:", ";transition:all 0.15s ease;flex-shrink:0;svg{opacity:", ";transition:opacity 0.15s ease;width:8px;height:8px;}svg path{stroke:", ";}"], props => props.isSelected ? _colors.default.black : _colors.default.grey2, props => props.isSelected ? _colors.default.white : _colors.default.white, props => props.isSelected ? 1 : 0, _colors.default.blue);
|
|
39
|
+
const OptionLabel = _styledComponents.default.span.withConfig({
|
|
40
|
+
displayName: "MultiSelect__OptionLabel",
|
|
41
|
+
componentId: "sc-1udb3q8-3"
|
|
42
|
+
})(["font-size:14px;color:", ";font-weight:400;letter-spacing:0.6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0;"], _colors.default.black);
|
|
43
|
+
const PlaceholderText = _styledComponents.default.span.withConfig({
|
|
44
|
+
displayName: "MultiSelect__PlaceholderText",
|
|
45
|
+
componentId: "sc-1udb3q8-4"
|
|
46
|
+
})(["font-size:14px;color:", ";font-weight:400;"], _colors.default.black);
|
|
47
|
+
|
|
48
|
+
// Custom Option with Checkbox
|
|
49
|
+
const CheckboxOption = props => {
|
|
50
|
+
const {
|
|
51
|
+
isSelected,
|
|
52
|
+
label,
|
|
53
|
+
innerRef,
|
|
54
|
+
innerProps
|
|
55
|
+
} = props;
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(CheckboxWrapper, _extends({
|
|
57
|
+
ref: innerRef
|
|
58
|
+
}, innerProps), /*#__PURE__*/_react.default.createElement(Checkbox, {
|
|
59
|
+
isSelected: isSelected
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement(_checkIcon.ReactComponent, null)), /*#__PURE__*/_react.default.createElement(OptionLabel, null, label));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Custom ValueContainer that shows count badge
|
|
64
|
+
const CountValueContainer = _ref => {
|
|
65
|
+
let {
|
|
66
|
+
children,
|
|
67
|
+
selectProps
|
|
68
|
+
} = _ref,
|
|
69
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
70
|
+
const {
|
|
71
|
+
value,
|
|
72
|
+
placeholder
|
|
73
|
+
} = selectProps;
|
|
74
|
+
const count = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_reactSelect.components.ValueContainer, _extends({}, props, {
|
|
76
|
+
selectProps: selectProps
|
|
77
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
style: {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
alignItems: 'center'
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(PlaceholderText, null, placeholder), count > 0 && /*#__PURE__*/_react.default.createElement(CountBadge, null, count)), children);
|
|
83
|
+
};
|
|
23
84
|
const DropdownIndicator = props => {
|
|
24
85
|
const {
|
|
25
86
|
selectProps
|
|
@@ -60,9 +121,16 @@ const MultiSelect = props => {
|
|
|
60
121
|
value,
|
|
61
122
|
disabled,
|
|
62
123
|
menuHeight,
|
|
63
|
-
placeholder
|
|
124
|
+
placeholder,
|
|
125
|
+
showCheckboxes = true,
|
|
126
|
+
showCountBadge = true,
|
|
127
|
+
closeMenuOnSelect = false,
|
|
128
|
+
hideSelectedOptions = false,
|
|
129
|
+
width,
|
|
130
|
+
minMenuWidth = 150,
|
|
131
|
+
maxMenuWidth = 300
|
|
64
132
|
} = props,
|
|
65
|
-
otherProps = _objectWithoutProperties(props,
|
|
133
|
+
otherProps = _objectWithoutProperties(props, _excluded2);
|
|
66
134
|
const hasValue = (value === null || value === void 0 ? void 0 : value.length) > 0;
|
|
67
135
|
const [labelUp, setLabelUp] = (0, _react.useState)(hasValue);
|
|
68
136
|
const [hasFocus, setHasFocus] = (0, _react.useState)(false);
|
|
@@ -99,7 +167,11 @@ const MultiSelect = props => {
|
|
|
99
167
|
|
|
100
168
|
// Get selected options from value array
|
|
101
169
|
const selectedOptions = options === null || options === void 0 ? void 0 : options.filter(option => value === null || value === void 0 ? void 0 : value.includes(option.value));
|
|
102
|
-
return /*#__PURE__*/_react.default.createElement(_Input.Wrapper,
|
|
170
|
+
return /*#__PURE__*/_react.default.createElement(_Input.Wrapper, {
|
|
171
|
+
style: {
|
|
172
|
+
width: width || 'auto'
|
|
173
|
+
}
|
|
174
|
+
}, label && /*#__PURE__*/_react.default.createElement(_Input.Label, {
|
|
103
175
|
isUp: labelUp,
|
|
104
176
|
active: hasFocus,
|
|
105
177
|
error: error && touched,
|
|
@@ -116,41 +188,87 @@ const MultiSelect = props => {
|
|
|
116
188
|
placeholder: placeholder,
|
|
117
189
|
isSearchable: search,
|
|
118
190
|
isMulti: true,
|
|
191
|
+
openMenuOnFocus: true,
|
|
192
|
+
closeMenuOnSelect: closeMenuOnSelect,
|
|
193
|
+
hideSelectedOptions: hideSelectedOptions,
|
|
119
194
|
maxMenuHeight: menuHeight,
|
|
120
195
|
styles: {
|
|
121
|
-
control: () =>
|
|
196
|
+
control: (baseStyle, state) => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
197
|
+
display: 'flex',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
// minHeight: '44px',
|
|
200
|
+
padding: '0 10px',
|
|
201
|
+
backgroundColor: _colors.default.white,
|
|
202
|
+
border: "1px solid ".concat(state.isFocused ? _colors.default.grey2 : _colors.default.lightGrey),
|
|
203
|
+
borderRadius: '10px',
|
|
204
|
+
boxShadow: 'none',
|
|
205
|
+
cursor: 'pointer',
|
|
206
|
+
'&:hover': {
|
|
207
|
+
borderColor: _colors.default.grey2
|
|
208
|
+
}
|
|
209
|
+
}),
|
|
122
210
|
menu: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
123
|
-
marginTop:
|
|
211
|
+
marginTop: '4px',
|
|
124
212
|
zIndex: 1000,
|
|
125
|
-
|
|
213
|
+
borderRadius: '8px',
|
|
214
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',
|
|
215
|
+
border: "1px solid ".concat(_colors.default.lightGrey),
|
|
216
|
+
overflow: 'hidden',
|
|
217
|
+
minWidth: minMenuWidth,
|
|
218
|
+
maxWidth: maxMenuWidth,
|
|
219
|
+
width: 'auto'
|
|
220
|
+
}),
|
|
221
|
+
menuList: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
222
|
+
padding: 0
|
|
223
|
+
}),
|
|
224
|
+
option: (baseStyle, state) => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
225
|
+
// When using checkboxes, padding is handled by CheckboxOption
|
|
226
|
+
// Otherwise, add padding for the default option
|
|
227
|
+
padding: showCheckboxes ? 0 : '12px 16px',
|
|
228
|
+
backgroundColor: state.isFocused ? _colors.default.grey : 'transparent',
|
|
229
|
+
color: _colors.default.black,
|
|
230
|
+
cursor: 'pointer',
|
|
231
|
+
fontWeight: state.isSelected ? 600 : 400,
|
|
232
|
+
whiteSpace: 'nowrap',
|
|
233
|
+
overflow: 'hidden',
|
|
234
|
+
textOverflow: 'ellipsis',
|
|
235
|
+
'&:active': {
|
|
236
|
+
backgroundColor: _colors.default.grey
|
|
237
|
+
}
|
|
126
238
|
}),
|
|
127
|
-
option: (baseStyle, state) => _objectSpread({
|
|
128
|
-
fontWeight: state.isSelected || state.isFocused ? 'bold' : 'normal',
|
|
129
|
-
cursor: 'pointer'
|
|
130
|
-
}, _Select.SelectOption),
|
|
131
|
-
selectContainer: () => _Select.SelectContainer,
|
|
132
239
|
valueContainer: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
240
|
+
padding: 0,
|
|
241
|
+
display: 'flex',
|
|
242
|
+
alignItems: 'center'
|
|
243
|
+
}),
|
|
244
|
+
placeholder: () => ({
|
|
245
|
+
display: 'none' // We handle placeholder in ValueContainer
|
|
246
|
+
}),
|
|
247
|
+
multiValue: () => ({
|
|
248
|
+
display: showCountBadge ? 'none' : 'flex' // Hide tags when showing count
|
|
249
|
+
}),
|
|
250
|
+
input: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
251
|
+
margin: 0,
|
|
133
252
|
padding: 0
|
|
134
253
|
}),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
254
|
+
indicatorsContainer: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
255
|
+
padding: 0,
|
|
256
|
+
gap: '4px'
|
|
138
257
|
}),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
padding: '2px 6px'
|
|
258
|
+
dropdownIndicator: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
259
|
+
padding: '4px'
|
|
142
260
|
}),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
backgroundColor: '#e0e0e0'
|
|
147
|
-
}
|
|
261
|
+
clearIndicator: baseStyle => _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
262
|
+
padding: '4px'
|
|
263
|
+
// display: 'none',
|
|
148
264
|
})
|
|
149
265
|
},
|
|
150
266
|
components: {
|
|
151
267
|
DropdownIndicator,
|
|
152
268
|
IndicatorSeparator: null,
|
|
153
|
-
MenuList: SelectMenuListWithScroll
|
|
269
|
+
MenuList: SelectMenuListWithScroll,
|
|
270
|
+
Option: showCheckboxes ? CheckboxOption : _reactSelect.components.Option,
|
|
271
|
+
ValueContainer: showCountBadge ? CountValueContainer : _reactSelect.components.ValueContainer
|
|
154
272
|
}
|
|
155
273
|
})));
|
|
156
274
|
};
|
|
@@ -171,17 +289,31 @@ MultiSelect.propTypes = {
|
|
|
171
289
|
placeholder: _propTypes.default.string,
|
|
172
290
|
onChange: _propTypes.default.func,
|
|
173
291
|
onBlur: _propTypes.default.func,
|
|
174
|
-
onFocus: _propTypes.default.func
|
|
292
|
+
onFocus: _propTypes.default.func,
|
|
293
|
+
showCheckboxes: _propTypes.default.bool,
|
|
294
|
+
showCountBadge: _propTypes.default.bool,
|
|
295
|
+
closeMenuOnSelect: _propTypes.default.bool,
|
|
296
|
+
hideSelectedOptions: _propTypes.default.bool,
|
|
297
|
+
width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
298
|
+
minMenuWidth: _propTypes.default.number,
|
|
299
|
+
maxMenuWidth: _propTypes.default.number
|
|
175
300
|
};
|
|
176
301
|
MultiSelect.defaultProps = {
|
|
177
302
|
label: '',
|
|
178
303
|
value: [],
|
|
179
|
-
search:
|
|
304
|
+
search: false,
|
|
180
305
|
error: false,
|
|
181
306
|
touched: false,
|
|
182
|
-
placeholder: '',
|
|
307
|
+
placeholder: 'Select',
|
|
183
308
|
onChange: () => {},
|
|
184
309
|
onBlur: () => {},
|
|
185
|
-
onFocus: () => {}
|
|
310
|
+
onFocus: () => {},
|
|
311
|
+
showCheckboxes: true,
|
|
312
|
+
showCountBadge: true,
|
|
313
|
+
closeMenuOnSelect: false,
|
|
314
|
+
hideSelectedOptions: false,
|
|
315
|
+
width: undefined,
|
|
316
|
+
minMenuWidth: 150,
|
|
317
|
+
maxMenuWidth: 300
|
|
186
318
|
};
|
|
187
319
|
var _default = exports.default = MultiSelect;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.
|
|
6
|
+
exports.default = exports.WithoutCheckboxes = exports.WithPreselectedValues = exports.WithManyOptions = exports.MultipleFilters = exports.Disabled = exports.Default = exports.CustomWidth = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _MultiSelect = require("./MultiSelect");
|
|
9
9
|
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
@@ -16,11 +16,45 @@ const StoryContainer = _styledComponents.default.div.withConfig({
|
|
|
16
16
|
displayName: "MultiSelectstories__StoryContainer",
|
|
17
17
|
componentId: "sc-1vk8pre-0"
|
|
18
18
|
})(["max-width:400px;padding:40px 20px;"]);
|
|
19
|
+
const FiltersRow = _styledComponents.default.div.withConfig({
|
|
20
|
+
displayName: "MultiSelectstories__FiltersRow",
|
|
21
|
+
componentId: "sc-1vk8pre-1"
|
|
22
|
+
})(["display:flex;gap:12px;flex-wrap:wrap;"]);
|
|
19
23
|
var _default = exports.default = {
|
|
20
24
|
title: 'Components Library/Inputs/MultiSelect',
|
|
21
25
|
component: _MultiSelect.MultiSelect,
|
|
22
26
|
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))))]
|
|
23
27
|
};
|
|
28
|
+
const statusOptions = [{
|
|
29
|
+
key: 'initiated',
|
|
30
|
+
value: 'initiated',
|
|
31
|
+
label: 'Initiated'
|
|
32
|
+
}, {
|
|
33
|
+
key: 'declined',
|
|
34
|
+
value: 'declined',
|
|
35
|
+
label: 'Declined'
|
|
36
|
+
}, {
|
|
37
|
+
key: 'confirmed',
|
|
38
|
+
value: 'confirmed',
|
|
39
|
+
label: 'Confirmed'
|
|
40
|
+
}, {
|
|
41
|
+
key: 'transferred',
|
|
42
|
+
value: 'transferred',
|
|
43
|
+
label: 'Transferred'
|
|
44
|
+
}];
|
|
45
|
+
const typeOptions = [{
|
|
46
|
+
key: 'dividend',
|
|
47
|
+
value: 'dividend',
|
|
48
|
+
label: 'Dividend'
|
|
49
|
+
}, {
|
|
50
|
+
key: 'interest',
|
|
51
|
+
value: 'interest',
|
|
52
|
+
label: 'Interest'
|
|
53
|
+
}, {
|
|
54
|
+
key: 'redemption',
|
|
55
|
+
value: 'redemption',
|
|
56
|
+
label: 'Redemption'
|
|
57
|
+
}];
|
|
24
58
|
const countryOptions = [{
|
|
25
59
|
key: 'us',
|
|
26
60
|
value: 'us',
|
|
@@ -45,35 +79,6 @@ const countryOptions = [{
|
|
|
45
79
|
key: 'it',
|
|
46
80
|
value: 'it',
|
|
47
81
|
label: 'Italy'
|
|
48
|
-
}, {
|
|
49
|
-
key: 'nl',
|
|
50
|
-
value: 'nl',
|
|
51
|
-
label: 'Netherlands'
|
|
52
|
-
}, {
|
|
53
|
-
key: 'ch',
|
|
54
|
-
value: 'ch',
|
|
55
|
-
label: 'Switzerland'
|
|
56
|
-
}];
|
|
57
|
-
const tagOptions = [{
|
|
58
|
-
key: 'tech',
|
|
59
|
-
value: 'tech',
|
|
60
|
-
label: 'Technology'
|
|
61
|
-
}, {
|
|
62
|
-
key: 'finance',
|
|
63
|
-
value: 'finance',
|
|
64
|
-
label: 'Finance'
|
|
65
|
-
}, {
|
|
66
|
-
key: 'health',
|
|
67
|
-
value: 'health',
|
|
68
|
-
label: 'Healthcare'
|
|
69
|
-
}, {
|
|
70
|
-
key: 'education',
|
|
71
|
-
value: 'education',
|
|
72
|
-
label: 'Education'
|
|
73
|
-
}, {
|
|
74
|
-
key: 'retail',
|
|
75
|
-
value: 'retail',
|
|
76
|
-
label: 'Retail'
|
|
77
82
|
}];
|
|
78
83
|
|
|
79
84
|
// Controlled wrapper for interactive stories
|
|
@@ -91,40 +96,81 @@ const ControlledMultiSelect = props => {
|
|
|
91
96
|
onChange: handleChange
|
|
92
97
|
}));
|
|
93
98
|
};
|
|
99
|
+
|
|
100
|
+
// Default - Status filter like in the design
|
|
94
101
|
const Default = () => /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
95
|
-
id: "
|
|
96
|
-
name: "
|
|
97
|
-
|
|
98
|
-
options:
|
|
102
|
+
id: "status",
|
|
103
|
+
name: "status",
|
|
104
|
+
placeholder: "Status",
|
|
105
|
+
options: statusOptions
|
|
99
106
|
});
|
|
107
|
+
|
|
108
|
+
// With preselected values showing count badge
|
|
100
109
|
exports.Default = Default;
|
|
101
110
|
const WithPreselectedValues = () => /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
102
|
-
id: "
|
|
103
|
-
name: "
|
|
104
|
-
|
|
105
|
-
options:
|
|
106
|
-
value: ['
|
|
111
|
+
id: "status",
|
|
112
|
+
name: "status",
|
|
113
|
+
placeholder: "Status",
|
|
114
|
+
options: statusOptions,
|
|
115
|
+
value: ['initiated', 'confirmed']
|
|
107
116
|
});
|
|
117
|
+
|
|
118
|
+
// Multiple filters side by side (like in the screenshot)
|
|
108
119
|
exports.WithPreselectedValues = WithPreselectedValues;
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
const MultipleFilters = () => {
|
|
121
|
+
const [statusValue, setStatusValue] = (0, _react.useState)(['initiated']);
|
|
122
|
+
const [typeValue, setTypeValue] = (0, _react.useState)([]);
|
|
123
|
+
return /*#__PURE__*/_react.default.createElement(FiltersRow, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
style: {
|
|
125
|
+
width: '140px'
|
|
126
|
+
}
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_MultiSelect.MultiSelect, {
|
|
128
|
+
id: "status",
|
|
129
|
+
name: "status",
|
|
130
|
+
placeholder: "Status",
|
|
131
|
+
options: statusOptions,
|
|
132
|
+
value: statusValue,
|
|
133
|
+
onChange: _ref2 => {
|
|
134
|
+
let {
|
|
135
|
+
value
|
|
136
|
+
} = _ref2;
|
|
137
|
+
return setStatusValue(value);
|
|
138
|
+
}
|
|
139
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
+
style: {
|
|
141
|
+
width: '120px'
|
|
142
|
+
}
|
|
143
|
+
}, /*#__PURE__*/_react.default.createElement(_MultiSelect.MultiSelect, {
|
|
144
|
+
id: "type",
|
|
145
|
+
name: "type",
|
|
146
|
+
placeholder: "Type",
|
|
147
|
+
options: typeOptions,
|
|
148
|
+
value: typeValue,
|
|
149
|
+
onChange: _ref3 => {
|
|
150
|
+
let {
|
|
151
|
+
value
|
|
152
|
+
} = _ref3;
|
|
153
|
+
return setTypeValue(value);
|
|
154
|
+
}
|
|
155
|
+
})));
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Without checkboxes (classic multi-select style)
|
|
159
|
+
exports.MultipleFilters = MultipleFilters;
|
|
160
|
+
const WithoutCheckboxes = () => /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
117
161
|
id: "countries",
|
|
118
162
|
name: "countries",
|
|
119
|
-
|
|
163
|
+
placeholder: "Countries",
|
|
120
164
|
options: countryOptions,
|
|
121
|
-
|
|
122
|
-
|
|
165
|
+
showCheckboxes: false,
|
|
166
|
+
showCountBadge: false
|
|
123
167
|
});
|
|
124
|
-
|
|
168
|
+
|
|
169
|
+
// With many options
|
|
170
|
+
exports.WithoutCheckboxes = WithoutCheckboxes;
|
|
125
171
|
const WithManyOptions = () => {
|
|
126
172
|
const manyOptions = Array.from({
|
|
127
|
-
length:
|
|
173
|
+
length: 20
|
|
128
174
|
}, (_, i) => ({
|
|
129
175
|
key: "option-".concat(i),
|
|
130
176
|
value: "option-".concat(i),
|
|
@@ -133,9 +179,86 @@ const WithManyOptions = () => {
|
|
|
133
179
|
return /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
134
180
|
id: "many",
|
|
135
181
|
name: "many",
|
|
136
|
-
|
|
182
|
+
placeholder: "Select",
|
|
137
183
|
options: manyOptions,
|
|
138
|
-
menuHeight:
|
|
184
|
+
menuHeight: 250
|
|
139
185
|
});
|
|
140
186
|
};
|
|
141
|
-
|
|
187
|
+
|
|
188
|
+
// Disabled state
|
|
189
|
+
exports.WithManyOptions = WithManyOptions;
|
|
190
|
+
const Disabled = () => /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
191
|
+
id: "status",
|
|
192
|
+
name: "status",
|
|
193
|
+
placeholder: "Status",
|
|
194
|
+
options: statusOptions,
|
|
195
|
+
value: ['initiated'],
|
|
196
|
+
disabled: true
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Custom width - narrow select with wider menu
|
|
200
|
+
exports.Disabled = Disabled;
|
|
201
|
+
const CustomWidth = () => {
|
|
202
|
+
const longOptions = [{
|
|
203
|
+
key: 'opt1',
|
|
204
|
+
value: 'opt1',
|
|
205
|
+
label: 'Very Long Option Name Here'
|
|
206
|
+
}, {
|
|
207
|
+
key: 'opt2',
|
|
208
|
+
value: 'opt2',
|
|
209
|
+
label: 'Another Long Option'
|
|
210
|
+
}, {
|
|
211
|
+
key: 'opt3',
|
|
212
|
+
value: 'opt3',
|
|
213
|
+
label: 'Short'
|
|
214
|
+
}, {
|
|
215
|
+
key: 'opt4',
|
|
216
|
+
value: 'opt4',
|
|
217
|
+
label: 'Medium Length Option'
|
|
218
|
+
}];
|
|
219
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
style: {
|
|
221
|
+
display: 'flex',
|
|
222
|
+
flexDirection: 'column',
|
|
223
|
+
gap: '24px'
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
226
|
+
style: {
|
|
227
|
+
marginBottom: '8px',
|
|
228
|
+
fontSize: '14px'
|
|
229
|
+
}
|
|
230
|
+
}, "Narrow select (80px), menu expands (150-250px)"), /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
231
|
+
id: "narrow",
|
|
232
|
+
name: "narrow",
|
|
233
|
+
placeholder: "Filter",
|
|
234
|
+
options: longOptions,
|
|
235
|
+
width: 80,
|
|
236
|
+
minMenuWidth: 150,
|
|
237
|
+
maxMenuWidth: 250
|
|
238
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
239
|
+
style: {
|
|
240
|
+
marginBottom: '8px',
|
|
241
|
+
fontSize: '14px'
|
|
242
|
+
}
|
|
243
|
+
}, "Fixed width (200px)"), /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
244
|
+
id: "fixed",
|
|
245
|
+
name: "fixed",
|
|
246
|
+
placeholder: "Status",
|
|
247
|
+
options: statusOptions,
|
|
248
|
+
width: "200px"
|
|
249
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
250
|
+
style: {
|
|
251
|
+
marginBottom: '8px',
|
|
252
|
+
fontSize: '14px'
|
|
253
|
+
}
|
|
254
|
+
}, "Wide menu (up to 400px) for long text"), /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
|
|
255
|
+
id: "wide",
|
|
256
|
+
name: "wide",
|
|
257
|
+
placeholder: "Select",
|
|
258
|
+
options: longOptions,
|
|
259
|
+
width: 120,
|
|
260
|
+
minMenuWidth: 200,
|
|
261
|
+
maxMenuWidth: 400
|
|
262
|
+
})));
|
|
263
|
+
};
|
|
264
|
+
exports.CustomWidth = CustomWidth;
|
|
@@ -7,7 +7,7 @@ exports.default = exports.SearchInput = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _SearchInput = require("./SearchInput.styles");
|
|
9
9
|
var _searchIcon = require("../../static/images/search-icon.svg");
|
|
10
|
-
const _excluded = ["value", "onChange", "placeholder", "icon", "showIcon", "disabled", "onFocus", "onBlur", "className", "containerStyle", "inputStyle", "iconStyle", "id", "name", "aria-label", "aria-describedby"];
|
|
10
|
+
const _excluded = ["value", "onChange", "placeholder", "icon", "showIcon", "disabled", "variant", "onFocus", "onBlur", "className", "containerStyle", "inputStyle", "iconStyle", "id", "name", "aria-label", "aria-describedby"];
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
@@ -20,6 +20,8 @@ const SearchInput = _ref => {
|
|
|
20
20
|
icon,
|
|
21
21
|
showIcon = true,
|
|
22
22
|
disabled = false,
|
|
23
|
+
variant = 'filled',
|
|
24
|
+
// 'filled' or 'outlined'
|
|
23
25
|
onFocus,
|
|
24
26
|
onBlur,
|
|
25
27
|
className,
|
|
@@ -53,7 +55,8 @@ const SearchInput = _ref => {
|
|
|
53
55
|
className: className,
|
|
54
56
|
style: containerStyle
|
|
55
57
|
}, /*#__PURE__*/_react.default.createElement(_SearchInput.SearchInputWrapper, {
|
|
56
|
-
disabled: disabled
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
variant: variant
|
|
57
60
|
}, showIcon && /*#__PURE__*/_react.default.createElement(_SearchInput.SearchIconWrapper, {
|
|
58
61
|
style: iconStyle
|
|
59
62
|
}, icon || /*#__PURE__*/_react.default.createElement(_searchIcon.ReactComponent, null)), /*#__PURE__*/_react.default.createElement(_SearchInput.SearchInputField, _extends({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.WithoutIcon = exports.WithInitialValue = exports.WithCustomIcon = exports.LongText = exports.Disabled = exports.DifferentWidths = exports.Default = exports.CustomStyling = exports.CustomPlaceholder = exports.AllStates = exports.AccessibilityExample = void 0;
|
|
6
|
+
exports.default = exports.WithoutIcon = exports.WithInitialValue = exports.WithCustomIcon = exports.Variants = exports.Outlined = exports.LongText = exports.Disabled = exports.DifferentWidths = exports.Default = exports.CustomStyling = exports.CustomPlaceholder = exports.AllStates = exports.AccessibilityExample = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _SearchInput = _interopRequireDefault(require("./SearchInput"));
|
|
9
9
|
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
@@ -28,6 +28,14 @@ var _default = exports.default = {
|
|
|
28
28
|
description: 'Placeholder text',
|
|
29
29
|
defaultValue: 'Search'
|
|
30
30
|
},
|
|
31
|
+
variant: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'select'
|
|
34
|
+
},
|
|
35
|
+
options: ['filled', 'outlined'],
|
|
36
|
+
description: 'Visual variant of the input',
|
|
37
|
+
defaultValue: 'filled'
|
|
38
|
+
},
|
|
31
39
|
showIcon: {
|
|
32
40
|
control: 'boolean',
|
|
33
41
|
description: 'Show/hide the search icon',
|
|
@@ -276,7 +284,61 @@ AccessibilityExample.decorators = [Story => /*#__PURE__*/_react.default.createEl
|
|
|
276
284
|
}
|
|
277
285
|
}, "Use this search to find products by name, category, or description."))];
|
|
278
286
|
|
|
287
|
+
// Outlined variant
|
|
288
|
+
const Outlined = () => {
|
|
289
|
+
const [value, setValue] = (0, _react.useState)('');
|
|
290
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_SearchInput.default, {
|
|
291
|
+
value: value,
|
|
292
|
+
onChange: setValue,
|
|
293
|
+
placeholder: "Search",
|
|
294
|
+
variant: "outlined"
|
|
295
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
296
|
+
style: {
|
|
297
|
+
marginTop: '12px',
|
|
298
|
+
fontSize: '12px',
|
|
299
|
+
color: _colors.default.grey2
|
|
300
|
+
}
|
|
301
|
+
}, "Current value: ", /*#__PURE__*/_react.default.createElement("strong", null, value || '(empty)')));
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// Both variants side by side
|
|
305
|
+
exports.Outlined = Outlined;
|
|
306
|
+
const Variants = () => {
|
|
307
|
+
const [value1, setValue1] = (0, _react.useState)('');
|
|
308
|
+
const [value2, setValue2] = (0, _react.useState)('');
|
|
309
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
310
|
+
style: {
|
|
311
|
+
marginBottom: '24px'
|
|
312
|
+
}
|
|
313
|
+
}, /*#__PURE__*/_react.default.createElement("h4", {
|
|
314
|
+
style: {
|
|
315
|
+
marginBottom: '8px',
|
|
316
|
+
fontSize: '14px'
|
|
317
|
+
}
|
|
318
|
+
}, "Filled (default)"), /*#__PURE__*/_react.default.createElement(_SearchInput.default, {
|
|
319
|
+
value: value1,
|
|
320
|
+
onChange: setValue1,
|
|
321
|
+
placeholder: "Search",
|
|
322
|
+
variant: "filled"
|
|
323
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
324
|
+
style: {
|
|
325
|
+
marginBottom: '24px'
|
|
326
|
+
}
|
|
327
|
+
}, /*#__PURE__*/_react.default.createElement("h4", {
|
|
328
|
+
style: {
|
|
329
|
+
marginBottom: '8px',
|
|
330
|
+
fontSize: '14px'
|
|
331
|
+
}
|
|
332
|
+
}, "Outlined"), /*#__PURE__*/_react.default.createElement(_SearchInput.default, {
|
|
333
|
+
value: value2,
|
|
334
|
+
onChange: setValue2,
|
|
335
|
+
placeholder: "Search",
|
|
336
|
+
variant: "outlined"
|
|
337
|
+
})));
|
|
338
|
+
};
|
|
339
|
+
|
|
279
340
|
// Custom styling
|
|
341
|
+
exports.Variants = Variants;
|
|
280
342
|
const CustomStyling = () => {
|
|
281
343
|
const [value, setValue] = (0, _react.useState)('');
|
|
282
344
|
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_SearchInput.default, {
|
|
@@ -14,7 +14,7 @@ const SearchInputContainer = exports.SearchInputContainer = _styledComponents.de
|
|
|
14
14
|
const SearchInputWrapper = exports.SearchInputWrapper = _styledComponents.default.div.withConfig({
|
|
15
15
|
displayName: "SearchInputstyles__SearchInputWrapper",
|
|
16
16
|
componentId: "sc-dcxztv-1"
|
|
17
|
-
})(["position:relative;display:flex;align-items:center;width:100%;
|
|
17
|
+
})(["position:relative;display:flex;align-items:center;width:100%;border-radius:8px;padding:0 16px;min-height:40px;transition:all 0.2s ease;background-color:", ";border:", ";", " &:focus-within{background-color:", ";border-color:", ";box-shadow:", ";}&:hover{border-color:", ";}"], props => props.variant === 'outlined' ? 'transparent' : _colors.default.grey3, props => props.variant === 'outlined' ? "1px solid ".concat(_colors.default.lightGrey) : '1px solid transparent', props => props.disabled && "\n opacity: 0.6;\n cursor: not-allowed;\n ", props => props.variant === 'outlined' ? 'transparent' : _colors.default.white, props => props.variant === 'outlined' ? _colors.default.grey2 : 'transparent', props => props.variant === 'outlined' ? 'none' : "0 0 0 2px ".concat(_colors.default.lightGrey), props => props.variant === 'outlined' ? _colors.default.grey2 : 'transparent');
|
|
18
18
|
const SearchIconWrapper = exports.SearchIconWrapper = _styledComponents.default.div.withConfig({
|
|
19
19
|
displayName: "SearchInputstyles__SearchIconWrapper",
|
|
20
20
|
componentId: "sc-dcxztv-2"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.PaymentDetailsCard = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
@@ -185,4 +185,5 @@ const PaymentDetailsCard = _ref2 => {
|
|
|
185
185
|
};
|
|
186
186
|
return /*#__PURE__*/_react.default.createElement(CardContainer, null, title && /*#__PURE__*/_react.default.createElement(CardTitle, null, title), renderAmountSection(), renderDetailsSection(), renderInfoSection());
|
|
187
187
|
};
|
|
188
|
+
exports.PaymentDetailsCard = PaymentDetailsCard;
|
|
188
189
|
var _default = exports.default = PaymentDetailsCard;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StepIndicator = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _StepIndicator = require("./StepIndicator.styles");
|
|
10
|
+
var _checkIcon = require("../../static/images/check-icon.svg");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const StepIndicator = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
steps,
|
|
15
|
+
currentStep,
|
|
16
|
+
onStepClick,
|
|
17
|
+
showLabels = true,
|
|
18
|
+
marginBottom
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_StepIndicator.StepIndicatorContainer, {
|
|
21
|
+
marginBottom: marginBottom
|
|
22
|
+
}, steps.map((step, index) => {
|
|
23
|
+
const isCompleted = index < currentStep;
|
|
24
|
+
const isActive = index === currentStep;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
26
|
+
key: step.id
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_StepIndicator.StepItem, {
|
|
28
|
+
onClick: () => onStepClick && onStepClick(index),
|
|
29
|
+
style: {
|
|
30
|
+
cursor: onStepClick ? 'pointer' : 'default'
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement(_StepIndicator.StepCircle, {
|
|
33
|
+
isCompleted: isCompleted,
|
|
34
|
+
isActive: isActive
|
|
35
|
+
}, isCompleted ? /*#__PURE__*/_react.default.createElement(_checkIcon.ReactComponent, {
|
|
36
|
+
width: 14,
|
|
37
|
+
height: 11
|
|
38
|
+
}) : index + 1), showLabels && /*#__PURE__*/_react.default.createElement(_StepIndicator.StepLabel, null, step.label)), index < steps.length - 1 && /*#__PURE__*/_react.default.createElement(_StepIndicator.StepConnector, {
|
|
39
|
+
isCompleted: isCompleted
|
|
40
|
+
}));
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
exports.StepIndicator = StepIndicator;
|
|
44
|
+
StepIndicator.propTypes = {
|
|
45
|
+
steps: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
46
|
+
id: _propTypes.default.string.isRequired,
|
|
47
|
+
label: _propTypes.default.string.isRequired
|
|
48
|
+
})).isRequired,
|
|
49
|
+
currentStep: _propTypes.default.number.isRequired,
|
|
50
|
+
onStepClick: _propTypes.default.func,
|
|
51
|
+
showLabels: _propTypes.default.bool,
|
|
52
|
+
marginBottom: _propTypes.default.string
|
|
53
|
+
};
|
|
54
|
+
StepIndicator.defaultProps = {
|
|
55
|
+
onStepClick: null,
|
|
56
|
+
showLabels: true,
|
|
57
|
+
marginBottom: '32px'
|
|
58
|
+
};
|
|
59
|
+
var _default = exports.default = StepIndicator;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.WithoutLabels = exports.SecondStep = exports.ManySteps = exports.LastStep = exports.Interactive = exports.Default = exports.CustomMargin = exports.AllCompleted = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _StepIndicator = _interopRequireDefault(require("./StepIndicator"));
|
|
9
|
+
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
10
|
+
var _global = _interopRequireDefault(require("../../styles/global"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
var _default = exports.default = {
|
|
14
|
+
title: 'Components Library/StepIndicator',
|
|
15
|
+
component: _StepIndicator.default,
|
|
16
|
+
decorators: [Story => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(Story, null))],
|
|
17
|
+
argTypes: {
|
|
18
|
+
currentStep: {
|
|
19
|
+
control: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
min: 0,
|
|
22
|
+
max: 3
|
|
23
|
+
},
|
|
24
|
+
description: 'Current active step (0-indexed)'
|
|
25
|
+
},
|
|
26
|
+
showLabels: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Show or hide step labels'
|
|
29
|
+
},
|
|
30
|
+
marginBottom: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Bottom margin of the component'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const sampleSteps = [{
|
|
37
|
+
id: 'step1',
|
|
38
|
+
label: 'Details'
|
|
39
|
+
}, {
|
|
40
|
+
id: 'step2',
|
|
41
|
+
label: 'Review'
|
|
42
|
+
}, {
|
|
43
|
+
id: 'step3',
|
|
44
|
+
label: 'Confirm'
|
|
45
|
+
}];
|
|
46
|
+
|
|
47
|
+
// Default - first step active
|
|
48
|
+
const Default = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
49
|
+
steps: sampleSteps,
|
|
50
|
+
currentStep: 0
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
// Second step active (first completed)
|
|
54
|
+
exports.Default = Default;
|
|
55
|
+
const SecondStep = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
56
|
+
steps: sampleSteps,
|
|
57
|
+
currentStep: 1
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
// Last step active (all previous completed)
|
|
61
|
+
exports.SecondStep = SecondStep;
|
|
62
|
+
const LastStep = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
63
|
+
steps: sampleSteps,
|
|
64
|
+
currentStep: 2
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
// All steps completed
|
|
68
|
+
exports.LastStep = LastStep;
|
|
69
|
+
const AllCompleted = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
70
|
+
steps: sampleSteps,
|
|
71
|
+
currentStep: 3
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
// Interactive example
|
|
75
|
+
exports.AllCompleted = AllCompleted;
|
|
76
|
+
const Interactive = () => {
|
|
77
|
+
const [currentStep, setCurrentStep] = (0, _react.useState)(0);
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
79
|
+
steps: sampleSteps,
|
|
80
|
+
currentStep: currentStep,
|
|
81
|
+
onStepClick: index => setCurrentStep(index)
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
style: {
|
|
84
|
+
marginTop: '24px'
|
|
85
|
+
}
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
87
|
+
onClick: () => setCurrentStep(prev => Math.max(0, prev - 1)),
|
|
88
|
+
disabled: currentStep === 0,
|
|
89
|
+
style: {
|
|
90
|
+
marginRight: '8px',
|
|
91
|
+
padding: '8px 16px'
|
|
92
|
+
}
|
|
93
|
+
}, "Previous"), /*#__PURE__*/_react.default.createElement("button", {
|
|
94
|
+
onClick: () => setCurrentStep(prev => Math.min(sampleSteps.length, prev + 1)),
|
|
95
|
+
disabled: currentStep >= sampleSteps.length,
|
|
96
|
+
style: {
|
|
97
|
+
padding: '8px 16px'
|
|
98
|
+
}
|
|
99
|
+
}, "Next")), /*#__PURE__*/_react.default.createElement("p", {
|
|
100
|
+
style: {
|
|
101
|
+
marginTop: '16px',
|
|
102
|
+
fontSize: '14px',
|
|
103
|
+
color: '#666'
|
|
104
|
+
}
|
|
105
|
+
}, "Current step: ", currentStep, " (click on steps to navigate)"));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Without labels
|
|
109
|
+
exports.Interactive = Interactive;
|
|
110
|
+
const WithoutLabels = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
111
|
+
steps: sampleSteps,
|
|
112
|
+
currentStep: 1,
|
|
113
|
+
showLabels: false
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
// More steps
|
|
117
|
+
exports.WithoutLabels = WithoutLabels;
|
|
118
|
+
const ManySteps = () => {
|
|
119
|
+
const manySteps = [{
|
|
120
|
+
id: 'step1',
|
|
121
|
+
label: 'Account'
|
|
122
|
+
}, {
|
|
123
|
+
id: 'step2',
|
|
124
|
+
label: 'Personal'
|
|
125
|
+
}, {
|
|
126
|
+
id: 'step3',
|
|
127
|
+
label: 'Documents'
|
|
128
|
+
}, {
|
|
129
|
+
id: 'step4',
|
|
130
|
+
label: 'Review'
|
|
131
|
+
}, {
|
|
132
|
+
id: 'step5',
|
|
133
|
+
label: 'Complete'
|
|
134
|
+
}];
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
136
|
+
steps: manySteps,
|
|
137
|
+
currentStep: 2
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Custom margin
|
|
142
|
+
exports.ManySteps = ManySteps;
|
|
143
|
+
const CustomMargin = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_StepIndicator.default, {
|
|
144
|
+
steps: sampleSteps,
|
|
145
|
+
currentStep: 1,
|
|
146
|
+
marginBottom: "0"
|
|
147
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
148
|
+
style: {
|
|
149
|
+
margin: 0,
|
|
150
|
+
fontSize: '14px'
|
|
151
|
+
}
|
|
152
|
+
}, "Content immediately below (no margin)"));
|
|
153
|
+
exports.CustomMargin = CustomMargin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepLabel = exports.StepItem = exports.StepIndicatorContainer = exports.StepConnector = exports.StepCircle = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
const StepIndicatorContainer = exports.StepIndicatorContainer = _styledComponents.default.div.withConfig({
|
|
12
|
+
displayName: "StepIndicatorstyles__StepIndicatorContainer",
|
|
13
|
+
componentId: "sc-ywoddn-0"
|
|
14
|
+
})(["display:flex;align-items:center;gap:16px;margin-bottom:", ";"], props => props.marginBottom || '32px');
|
|
15
|
+
const StepItem = exports.StepItem = _styledComponents.default.div.withConfig({
|
|
16
|
+
displayName: "StepIndicatorstyles__StepItem",
|
|
17
|
+
componentId: "sc-ywoddn-1"
|
|
18
|
+
})(["display:flex;align-items:center;gap:12px;"]);
|
|
19
|
+
const StepCircle = exports.StepCircle = _styledComponents.default.div.withConfig({
|
|
20
|
+
displayName: "StepIndicatorstyles__StepCircle",
|
|
21
|
+
componentId: "sc-ywoddn-2"
|
|
22
|
+
})(["width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:600;transition:all 0.2s ease;", " ", " ", ""], props => props.isCompleted && (0, _styledComponents.css)(["background-color:", ";color:", ";svg path{stroke:", ";}"], _colors.default.progressGreen, _colors.default.white, _colors.default.white), props => props.isActive && !props.isCompleted && (0, _styledComponents.css)(["background-color:", ";color:", ";"], _colors.default.black, _colors.default.white), props => !props.isActive && !props.isCompleted && (0, _styledComponents.css)(["background-color:", ";color:", ";"], _colors.default.grey, _colors.default.black));
|
|
23
|
+
const StepLabel = exports.StepLabel = _styledComponents.default.span.withConfig({
|
|
24
|
+
displayName: "StepIndicatorstyles__StepLabel",
|
|
25
|
+
componentId: "sc-ywoddn-3"
|
|
26
|
+
})(["font-size:16px;font-weight:600;line-height:24px;letter-spacing:0.6px;word-wrap:break-word;"]);
|
|
27
|
+
const StepConnector = exports.StepConnector = _styledComponents.default.div.withConfig({
|
|
28
|
+
displayName: "StepIndicatorstyles__StepConnector",
|
|
29
|
+
componentId: "sc-ywoddn-4"
|
|
30
|
+
})(["flex:1;height:2px;max-width:80px;background-color:", ";"], props => props.isCompleted ? _colors.default.progressGreen : _colors.default.grey);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Default = exports.AsButton = void 0;
|
|
6
|
+
exports.default = exports.IconReversed = exports.Default = exports.ButtonIconReversed = exports.AsButton = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactRouterDom = require("react-router-dom");
|
|
9
9
|
var _TextLink = require("./TextLink.styles");
|
|
@@ -22,4 +22,14 @@ exports.Default = Default;
|
|
|
22
22
|
const AsButton = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_TextLink.TextButton, {
|
|
23
23
|
onClick: () => alert('Clicked!')
|
|
24
24
|
}, "Click Me"));
|
|
25
|
-
exports.AsButton = AsButton;
|
|
25
|
+
exports.AsButton = AsButton;
|
|
26
|
+
const IconReversed = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_TextLink.TextLink, {
|
|
27
|
+
to: "/example",
|
|
28
|
+
reverse: true
|
|
29
|
+
}, "Go Back"));
|
|
30
|
+
exports.IconReversed = IconReversed;
|
|
31
|
+
const ButtonIconReversed = () => /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_TextLink.TextButton, {
|
|
32
|
+
onClick: () => alert('Clicked!'),
|
|
33
|
+
reverse: true
|
|
34
|
+
}, "Previous"));
|
|
35
|
+
exports.ButtonIconReversed = ButtonIconReversed;
|
|
@@ -9,7 +9,7 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
9
9
|
var _theme = _interopRequireDefault(require("../../styles/theme"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
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); }
|
|
12
|
-
const styles = (0, _styledComponents.css)(["background:#fff;border:none;cursor:pointer;position:relative;font-family:'Open Sans';font-weight:bold;font-size:11px;line-height:14px;text-transform:uppercase;display:inline-block;padding-left:18px;padding-right:6px;transition:padding 0.2s;&:before{content:'\\f3d1';font-family:'Ionicons';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:12px;line-height:8px;display:block;width:8px;height:8px;position:absolute;top:50%;left:0;margin-top:-4px;color:", ";}&:hover{padding-left:24px;padding-right:0;}", ""], props => _theme.default.cWarning, props => props.disabled && (0, _styledComponents.css)(["opacity:0.5;pointer-events:none;"]));
|
|
12
|
+
const styles = (0, _styledComponents.css)(["background:#fff;border:none;cursor:pointer;position:relative;font-family:'Open Sans';font-weight:bold;font-size:11px;line-height:14px;text-transform:uppercase;display:inline-block;padding-left:18px;padding-right:6px;transition:padding 0.2s;&:before{content:'\\f3d1';font-family:'Ionicons';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:12px;line-height:8px;display:block;width:8px;height:8px;position:absolute;top:50%;left:0;margin-top:-4px;color:", ";transform:", ";}&:hover{padding-left:24px;padding-right:0;}", ""], props => _theme.default.cWarning, props => props.reverse ? 'rotate(180deg)' : 'none', props => props.disabled && (0, _styledComponents.css)(["opacity:0.5;pointer-events:none;"]));
|
|
13
13
|
const TextLink = exports.TextLink = (0, _styledComponents.default)(_reactRouterDom.Link).withConfig({
|
|
14
14
|
displayName: "TextLinkstyles__TextLink",
|
|
15
15
|
componentId: "sc-h1k34v-0"
|
package/dist/index.js
CHANGED
|
@@ -1444,6 +1444,17 @@ Object.keys(_TimerComponent).forEach(function (key) {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
});
|
|
1446
1446
|
});
|
|
1447
|
+
var _PaymentDetailsCard = require("./components/Payment/PaymentDetailsCard");
|
|
1448
|
+
Object.keys(_PaymentDetailsCard).forEach(function (key) {
|
|
1449
|
+
if (key === "default" || key === "__esModule") return;
|
|
1450
|
+
if (key in exports && exports[key] === _PaymentDetailsCard[key]) return;
|
|
1451
|
+
Object.defineProperty(exports, key, {
|
|
1452
|
+
enumerable: true,
|
|
1453
|
+
get: function () {
|
|
1454
|
+
return _PaymentDetailsCard[key];
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1447
1458
|
var _Timeline = require("./components/Timeline/Timeline");
|
|
1448
1459
|
Object.keys(_Timeline).forEach(function (key) {
|
|
1449
1460
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1476,4 +1487,15 @@ Object.keys(_StatusTag).forEach(function (key) {
|
|
|
1476
1487
|
return _StatusTag[key];
|
|
1477
1488
|
}
|
|
1478
1489
|
});
|
|
1490
|
+
});
|
|
1491
|
+
var _StepIndicator = require("./components/StepsProgress/StepIndicator");
|
|
1492
|
+
Object.keys(_StepIndicator).forEach(function (key) {
|
|
1493
|
+
if (key === "default" || key === "__esModule") return;
|
|
1494
|
+
if (key in exports && exports[key] === _StepIndicator[key]) return;
|
|
1495
|
+
Object.defineProperty(exports, key, {
|
|
1496
|
+
enumerable: true,
|
|
1497
|
+
get: function () {
|
|
1498
|
+
return _StepIndicator[key];
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1479
1501
|
});
|