@stokr/components-library 2.3.65-beta.1 → 2.3.65-beta.10

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.
Files changed (49) hide show
  1. package/dist/components/2FA/main-flow.js +28 -7
  2. package/dist/components/2FA/main-flow.stories.js +144 -15
  3. package/dist/components/AdminDashboard/Table/ReactTable.js +123 -7
  4. package/dist/components/AdminDashboard/Table/ReactTable.stories.js +509 -2
  5. package/dist/components/Chips/Chip.js +1 -2
  6. package/dist/components/Icon/Icon.stories.js +108 -0
  7. package/dist/components/Input/Input.js +33 -33
  8. package/dist/components/Input/Input.stories.js +83 -8
  9. package/dist/components/Input/MultiSelect.js +319 -0
  10. package/dist/components/Input/MultiSelect.stories.js +264 -0
  11. package/dist/components/Input/SearchInput.js +78 -0
  12. package/dist/components/Input/SearchInput.stories.js +366 -0
  13. package/dist/components/Input/SearchInput.styles.js +25 -0
  14. package/dist/components/Input/Select.js +51 -28
  15. package/dist/components/Input/Select.stories.js +345 -6
  16. package/dist/components/Modal/SideModal.js +82 -0
  17. package/dist/components/Modal/SideModal.stories.js +342 -0
  18. package/dist/components/Modal/SideModal.styles.js +21 -0
  19. package/dist/components/Payment/PaymentDetailsCard.js +189 -0
  20. package/dist/components/Payment/PaymentDetailsCard.stories.js +198 -0
  21. package/dist/components/Payment/PaymentDisplay.js +2 -12
  22. package/dist/components/ProfileBox/ProfileBox.js +2 -1
  23. package/dist/components/Snackbar/Snackbar.js +193 -0
  24. package/dist/components/Snackbar/Snackbar.stories.js +292 -0
  25. package/dist/components/Snackbar/Snackbar.styles.js +97 -0
  26. package/dist/components/Snackbar/SnackbarProvider.js +81 -0
  27. package/dist/components/Snackbar/index.js +32 -0
  28. package/dist/components/Snackbar/useSnackbar.js +43 -0
  29. package/dist/components/StatusTag/StatusTag.js +175 -0
  30. package/dist/components/StatusTag/StatusTag.stories.js +262 -0
  31. package/dist/components/StatusTag/StatusTag.styles.js +37 -0
  32. package/dist/components/StepsProgress/StepIndicator.js +59 -0
  33. package/dist/components/StepsProgress/StepIndicator.stories.js +153 -0
  34. package/dist/components/StepsProgress/StepIndicator.styles.js +30 -0
  35. package/dist/components/TextLink/TextLink.stories.js +35 -0
  36. package/dist/components/TextLink/TextLink.styles.js +1 -1
  37. package/dist/components/Timeline/TimelineStep.js +2 -2
  38. package/dist/components/logo/Logo.stories.js +260 -0
  39. package/dist/constants/globalVariables.js +41 -2
  40. package/dist/context/Checkbox/CheckboxContext.js +0 -1
  41. package/dist/index.js +66 -0
  42. package/dist/static/images/bmn2-logo.svg +9 -0
  43. package/dist/static/images/document-icon.svg +3 -0
  44. package/dist/static/images/plus-icon.svg +4 -0
  45. package/dist/static/images/search-icon.svg +3 -0
  46. package/dist/static/images/sent-icon.svg +10 -0
  47. package/dist/static/images/transfer-icon.svg +10 -0
  48. package/dist/utils/formatCurrencyValue.js +43 -3
  49. package/package.json +1 -1
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.WithoutCheckboxes = exports.WithPreselectedValues = exports.WithManyOptions = exports.MultipleFilters = exports.Disabled = exports.Default = exports.CustomWidth = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _MultiSelect = require("./MultiSelect");
9
+ var _global = _interopRequireDefault(require("../../styles/global"));
10
+ var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
11
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ 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); }
14
+ 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); }
15
+ const StoryContainer = _styledComponents.default.div.withConfig({
16
+ displayName: "MultiSelectstories__StoryContainer",
17
+ componentId: "sc-1vk8pre-0"
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;"]);
23
+ var _default = exports.default = {
24
+ title: 'Components Library/Inputs/MultiSelect',
25
+ component: _MultiSelect.MultiSelect,
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))))]
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
+ }];
58
+ const countryOptions = [{
59
+ key: 'us',
60
+ value: 'us',
61
+ label: 'United States'
62
+ }, {
63
+ key: 'uk',
64
+ value: 'uk',
65
+ label: 'United Kingdom'
66
+ }, {
67
+ key: 'de',
68
+ value: 'de',
69
+ label: 'Germany'
70
+ }, {
71
+ key: 'fr',
72
+ value: 'fr',
73
+ label: 'France'
74
+ }, {
75
+ key: 'es',
76
+ value: 'es',
77
+ label: 'Spain'
78
+ }, {
79
+ key: 'it',
80
+ value: 'it',
81
+ label: 'Italy'
82
+ }];
83
+
84
+ // Controlled wrapper for interactive stories
85
+ const ControlledMultiSelect = props => {
86
+ const [value, setValue] = (0, _react.useState)(props.value || []);
87
+ const handleChange = _ref => {
88
+ let {
89
+ value: newValue
90
+ } = _ref;
91
+ setValue(newValue);
92
+ console.log('Selected values:', newValue);
93
+ };
94
+ return /*#__PURE__*/_react.default.createElement(_MultiSelect.MultiSelect, _extends({}, props, {
95
+ value: value,
96
+ onChange: handleChange
97
+ }));
98
+ };
99
+
100
+ // Default - Status filter like in the design
101
+ const Default = () => /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
102
+ id: "status",
103
+ name: "status",
104
+ placeholder: "Status",
105
+ options: statusOptions
106
+ });
107
+
108
+ // With preselected values showing count badge
109
+ exports.Default = Default;
110
+ const WithPreselectedValues = () => /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
111
+ id: "status",
112
+ name: "status",
113
+ placeholder: "Status",
114
+ options: statusOptions,
115
+ value: ['initiated', 'confirmed']
116
+ });
117
+
118
+ // Multiple filters side by side (like in the screenshot)
119
+ exports.WithPreselectedValues = WithPreselectedValues;
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, {
161
+ id: "countries",
162
+ name: "countries",
163
+ placeholder: "Countries",
164
+ options: countryOptions,
165
+ showCheckboxes: false,
166
+ showCountBadge: false
167
+ });
168
+
169
+ // With many options
170
+ exports.WithoutCheckboxes = WithoutCheckboxes;
171
+ const WithManyOptions = () => {
172
+ const manyOptions = Array.from({
173
+ length: 20
174
+ }, (_, i) => ({
175
+ key: "option-".concat(i),
176
+ value: "option-".concat(i),
177
+ label: "Option ".concat(i + 1)
178
+ }));
179
+ return /*#__PURE__*/_react.default.createElement(ControlledMultiSelect, {
180
+ id: "many",
181
+ name: "many",
182
+ placeholder: "Select",
183
+ options: manyOptions,
184
+ menuHeight: 250
185
+ });
186
+ };
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;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.SearchInput = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _SearchInput = require("./SearchInput.styles");
9
+ var _searchIcon = require("../../static/images/search-icon.svg");
10
+ const _excluded = ["value", "onChange", "placeholder", "icon", "showIcon", "disabled", "variant", "onFocus", "onBlur", "className", "containerStyle", "inputStyle", "iconStyle", "id", "name", "aria-label", "aria-describedby"];
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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
+ 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; }
14
+ 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; }
15
+ const SearchInput = _ref => {
16
+ let {
17
+ value = '',
18
+ onChange,
19
+ placeholder = 'Search',
20
+ icon,
21
+ showIcon = true,
22
+ disabled = false,
23
+ variant = 'filled',
24
+ // 'filled' or 'outlined'
25
+ onFocus,
26
+ onBlur,
27
+ className,
28
+ containerStyle,
29
+ inputStyle,
30
+ iconStyle,
31
+ id,
32
+ name,
33
+ 'aria-label': ariaLabel,
34
+ 'aria-describedby': ariaDescribedBy
35
+ } = _ref,
36
+ props = _objectWithoutProperties(_ref, _excluded);
37
+ const handleChange = e => {
38
+ if (onChange) {
39
+ onChange(e.target.value, e);
40
+ }
41
+ };
42
+ const handleFocus = e => {
43
+ if (onFocus) {
44
+ onFocus(e);
45
+ }
46
+ };
47
+ const handleBlur = e => {
48
+ if (onBlur) {
49
+ onBlur(e);
50
+ }
51
+ };
52
+ const inputId = id || "search-input-".concat(Math.random().toString(36).substr(2, 9));
53
+ const inputName = name || inputId;
54
+ return /*#__PURE__*/_react.default.createElement(_SearchInput.SearchInputContainer, {
55
+ className: className,
56
+ style: containerStyle
57
+ }, /*#__PURE__*/_react.default.createElement(_SearchInput.SearchInputWrapper, {
58
+ disabled: disabled,
59
+ variant: variant
60
+ }, showIcon && /*#__PURE__*/_react.default.createElement(_SearchInput.SearchIconWrapper, {
61
+ style: iconStyle
62
+ }, icon || /*#__PURE__*/_react.default.createElement(_searchIcon.ReactComponent, null)), /*#__PURE__*/_react.default.createElement(_SearchInput.SearchInputField, _extends({
63
+ id: inputId,
64
+ name: inputName,
65
+ type: "search",
66
+ value: value,
67
+ onChange: handleChange,
68
+ onFocus: handleFocus,
69
+ onBlur: handleBlur,
70
+ placeholder: placeholder,
71
+ disabled: disabled,
72
+ "aria-label": ariaLabel || placeholder,
73
+ "aria-describedby": ariaDescribedBy,
74
+ style: inputStyle
75
+ }, props))));
76
+ };
77
+ exports.SearchInput = SearchInput;
78
+ var _default = exports.default = SearchInput;