@bonlineza/luxity-lib 2.39.6 → 2.39.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.
Files changed (92) hide show
  1. package/Accordion.js +352 -342
  2. package/AddInterest.js +3141 -3135
  3. package/AddProductInterest.js +7584 -1011
  4. package/BrandSelector.js +861 -854
  5. package/Checkbox.js +250 -240
  6. package/CheckboxButton.js +236 -229
  7. package/CommunicationPreferenceOptionsRenderer.js +568 -560
  8. package/CommunicationPreferenceSection.js +659 -651
  9. package/CommunicationPreferences.js +2402 -2394
  10. package/ConditionSelector.js +859 -852
  11. package/CountryCodeSelect.js +6650 -79
  12. package/CurrencyInputFormatter.js +96 -86
  13. package/CurrencySelect.js +227 -219
  14. package/DropdownSelector.js +6820 -211
  15. package/GALink.js +51 -43
  16. package/GenderSelector.js +362 -355
  17. package/GraphQLDropdownSelector.js +11878 -5308
  18. package/GraphQLMultiSelector.js +601 -593
  19. package/IconHeader.js +126 -118
  20. package/IconWrapper.js +25 -17
  21. package/InterestCatSelector.js +432 -424
  22. package/InterestItem.js +470 -462
  23. package/Interests.js +11286 -4716
  24. package/InterestsSubheading.js +41 -33
  25. package/InvertedTextButton.js +175 -167
  26. package/LuxityAppSideNav.js +189 -181
  27. package/LuxityDesktopHeader.js +1363 -1355
  28. package/LuxityFooter.js +2236 -2228
  29. package/LuxityGraphQLDropdownSelector.js +11963 -5393
  30. package/LuxityGraphQLMultiselector.js +785 -778
  31. package/LuxityMobileHeader.js +1794 -1786
  32. package/LuxityPageReady.js +209 -199
  33. package/LuxityProductInterestItem.js +367 -359
  34. package/LuxitySideNav.js +673 -665
  35. package/MaterialSelector.js +11993 -5423
  36. package/ModelSelector.js +11993 -5423
  37. package/NotificationDropDown.js +7029 -459
  38. package/Notify.js +32 -20
  39. package/OutlinePrimaryButton.js +142 -134
  40. package/PriceRangeSelector.js +1270 -1264
  41. package/PrimaryButton.js +137 -129
  42. package/RadioButtons.js +318 -308
  43. package/RangeSlider.js +1039 -1033
  44. package/RareStepFooter.js +264 -257
  45. package/RareStepHeader.js +808 -801
  46. package/ReactSelectWrapper.js +6604 -33
  47. package/SecondaryButton.js +152 -144
  48. package/ShoeSizeRangeSelector.js +1153 -1147
  49. package/ShoeSizeSelector.js +1154 -1146
  50. package/SimpleErrorBoundary.js +138 -130
  51. package/StyleSelector.js +861 -854
  52. package/TextButton.js +143 -135
  53. package/Tooltip.js +184 -176
  54. package/Tracking.js +25 -15
  55. package/WrapperButton.js +58 -50
  56. package/build/bundle.css +1 -1
  57. package/build/bundle.js +17236 -10632
  58. package/build/constants.js +45 -32
  59. package/package.json +2 -2
  60. package/svg/Accessories.js +42 -34
  61. package/svg/Account.js +38 -30
  62. package/svg/Add.js +39 -31
  63. package/svg/ArrowRight.js +36 -28
  64. package/svg/Bags.js +48 -40
  65. package/svg/BurgerMenu.js +32 -24
  66. package/svg/Calendar.js +106 -98
  67. package/svg/CalendarCircled.js +108 -100
  68. package/svg/CheckCircled.js +40 -32
  69. package/svg/Close.js +37 -29
  70. package/svg/Clothing.js +44 -36
  71. package/svg/Dot.js +40 -32
  72. package/svg/Edit.js +35 -27
  73. package/svg/Eye.js +36 -28
  74. package/svg/FileAttach.js +36 -28
  75. package/svg/FileAttachCircled.js +38 -30
  76. package/svg/Jewellery.js +57 -49
  77. package/svg/LightBulb.js +66 -58
  78. package/svg/Logo.js +140 -132
  79. package/svg/LuxityMenu.js +36 -28
  80. package/svg/Minus.js +37 -29
  81. package/svg/MobileAvatar.js +36 -28
  82. package/svg/MyOrder.js +44 -36
  83. package/svg/MyPayment.js +44 -36
  84. package/svg/MyProfile.js +52 -44
  85. package/svg/MySale.js +39 -31
  86. package/svg/Notification.js +38 -30
  87. package/svg/PointerDown.js +36 -28
  88. package/svg/Search.js +35 -27
  89. package/svg/Shoes.js +45 -37
  90. package/svg/SvgWrapper.js +21 -13
  91. package/svg/Trash.js +40 -32
  92. package/svg/Watches.js +55 -47
package/RadioButtons.js CHANGED
@@ -1,340 +1,350 @@
1
- import React, { forwardRef, useState, useEffect, Fragment } from 'react';
2
- import styled, { ThemeProvider } from 'styled-components';
3
-
4
- function ownKeys(object, enumerableOnly) {
5
- var keys = Object.keys(object);
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('styled-components')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'styled-components'], factory) :
4
+ (global = global || self, factory(global.RadioButtons = {}, global.React, global.styled));
5
+ }(this, (function (exports, React, styled) { 'use strict';
6
+
7
+ var React__default = 'default' in React ? React['default'] : React;
8
+ var styled__default = 'default' in styled ? styled['default'] : styled;
9
+
10
+ function ownKeys(object, enumerableOnly) {
11
+ var keys = Object.keys(object);
12
+
13
+ if (Object.getOwnPropertySymbols) {
14
+ var symbols = Object.getOwnPropertySymbols(object);
15
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
16
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
17
+ })), keys.push.apply(keys, symbols);
18
+ }
6
19
 
7
- if (Object.getOwnPropertySymbols) {
8
- var symbols = Object.getOwnPropertySymbols(object);
9
- enumerableOnly && (symbols = symbols.filter(function (sym) {
10
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11
- })), keys.push.apply(keys, symbols);
20
+ return keys;
12
21
  }
13
22
 
14
- return keys;
15
- }
23
+ function _objectSpread2(target) {
24
+ for (var i = 1; i < arguments.length; i++) {
25
+ var source = null != arguments[i] ? arguments[i] : {};
26
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
27
+ _defineProperty(target, key, source[key]);
28
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
29
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
30
+ });
31
+ }
16
32
 
17
- function _objectSpread2(target) {
18
- for (var i = 1; i < arguments.length; i++) {
19
- var source = null != arguments[i] ? arguments[i] : {};
20
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
21
- _defineProperty(target, key, source[key]);
22
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
23
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
24
- });
33
+ return target;
25
34
  }
26
35
 
27
- return target;
28
- }
36
+ function _defineProperty(obj, key, value) {
37
+ if (key in obj) {
38
+ Object.defineProperty(obj, key, {
39
+ value: value,
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true
43
+ });
44
+ } else {
45
+ obj[key] = value;
46
+ }
29
47
 
30
- function _defineProperty(obj, key, value) {
31
- if (key in obj) {
32
- Object.defineProperty(obj, key, {
33
- value: value,
34
- enumerable: true,
35
- configurable: true,
36
- writable: true
37
- });
38
- } else {
39
- obj[key] = value;
48
+ return obj;
40
49
  }
41
50
 
42
- return obj;
43
- }
51
+ function _extends() {
52
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
53
+ for (var i = 1; i < arguments.length; i++) {
54
+ var source = arguments[i];
44
55
 
45
- function _extends() {
46
- _extends = Object.assign ? Object.assign.bind() : function (target) {
47
- for (var i = 1; i < arguments.length; i++) {
48
- var source = arguments[i];
49
-
50
- for (var key in source) {
51
- if (Object.prototype.hasOwnProperty.call(source, key)) {
52
- target[key] = source[key];
56
+ for (var key in source) {
57
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
58
+ target[key] = source[key];
59
+ }
53
60
  }
54
61
  }
55
- }
56
-
57
- return target;
58
- };
59
- return _extends.apply(this, arguments);
60
- }
61
62
 
62
- function _taggedTemplateLiteral(strings, raw) {
63
- if (!raw) {
64
- raw = strings.slice(0);
63
+ return target;
64
+ };
65
+ return _extends.apply(this, arguments);
65
66
  }
66
67
 
67
- return Object.freeze(Object.defineProperties(strings, {
68
- raw: {
69
- value: Object.freeze(raw)
68
+ function _taggedTemplateLiteral(strings, raw) {
69
+ if (!raw) {
70
+ raw = strings.slice(0);
70
71
  }
71
- }));
72
- }
73
72
 
74
- function _slicedToArray(arr, i) {
75
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
76
- }
73
+ return Object.freeze(Object.defineProperties(strings, {
74
+ raw: {
75
+ value: Object.freeze(raw)
76
+ }
77
+ }));
78
+ }
77
79
 
78
- function _arrayWithHoles(arr) {
79
- if (Array.isArray(arr)) return arr;
80
- }
80
+ function _slicedToArray(arr, i) {
81
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
82
+ }
81
83
 
82
- function _iterableToArrayLimit(arr, i) {
83
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
84
+ function _arrayWithHoles(arr) {
85
+ if (Array.isArray(arr)) return arr;
86
+ }
84
87
 
85
- if (_i == null) return;
86
- var _arr = [];
87
- var _n = true;
88
- var _d = false;
88
+ function _iterableToArrayLimit(arr, i) {
89
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
89
90
 
90
- var _s, _e;
91
+ if (_i == null) return;
92
+ var _arr = [];
93
+ var _n = true;
94
+ var _d = false;
91
95
 
92
- try {
93
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
94
- _arr.push(_s.value);
96
+ var _s, _e;
95
97
 
96
- if (i && _arr.length === i) break;
97
- }
98
- } catch (err) {
99
- _d = true;
100
- _e = err;
101
- } finally {
102
98
  try {
103
- if (!_n && _i["return"] != null) _i["return"]();
99
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
100
+ _arr.push(_s.value);
101
+
102
+ if (i && _arr.length === i) break;
103
+ }
104
+ } catch (err) {
105
+ _d = true;
106
+ _e = err;
104
107
  } finally {
105
- if (_d) throw _e;
108
+ try {
109
+ if (!_n && _i["return"] != null) _i["return"]();
110
+ } finally {
111
+ if (_d) throw _e;
112
+ }
106
113
  }
114
+
115
+ return _arr;
107
116
  }
108
117
 
109
- return _arr;
110
- }
111
-
112
- function _unsupportedIterableToArray(o, minLen) {
113
- if (!o) return;
114
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
115
- var n = Object.prototype.toString.call(o).slice(8, -1);
116
- if (n === "Object" && o.constructor) n = o.constructor.name;
117
- if (n === "Map" || n === "Set") return Array.from(o);
118
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
119
- }
120
-
121
- function _arrayLikeToArray(arr, len) {
122
- if (len == null || len > arr.length) len = arr.length;
123
-
124
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
125
-
126
- return arr2;
127
- }
128
-
129
- function _nonIterableRest() {
130
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
131
- }
132
-
133
- var _templateObject;
134
- var RadioButtonsContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
135
-
136
- var _templateObject$1;
137
- var ButtonListWrapper = styled.div(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n display: flex;\n flex-grow: 1;\n flex-wrap: ", ";\n"])), function (_ref) {
138
- var noWrap = _ref.noWrap;
139
- return noWrap ? 'nowrap' : 'wrap';
140
- });
141
-
142
- var _templateObject$2;
143
- var Title = styled.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n flex-basis: 40%;\n"])), function (props) {
144
- return props.theme.colors.base;
145
- });
146
-
147
- var _templateObject$3;
148
- var RadioButtonLabel = styled.label(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n display: flex;\n margin-bottom: ", ";\n margin-right: ", ";\n"])), function (props) {
149
- return props.theme.marginPaddings[0];
150
- }, function (props) {
151
- return props.theme.marginPaddings[0];
152
- });
153
-
154
- var _templateObject$4;
155
- var RadioButtonCircle = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n height: 20px;\n width: 20px;\n border-radius: 50%;\n margin-right: 5px;\n border: 1px solid ", ";\n display: flex;\n"])), function (props) {
156
- return props.theme.colors.base;
157
- });
158
-
159
- var _templateObject$5;
160
- var RadioButtonCircleInner = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n height: 8px;\n width: 8px;\n border-radius: 50%;\n margin: auto;\n"])));
161
-
162
- var _templateObject$6;
163
- var RadioButtonInput = styled.input(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n display: none;\n :checked ~ ", " {\n ", " {\n background-color: ", ";\n }\n }\n"])), RadioButtonCircle, RadioButtonCircleInner, function (props) {
164
- return props.theme.colors.base;
165
- });
166
-
167
- var _templateObject$7;
168
- var RadioButtonText = styled.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
169
-
170
- var RadioButtonsFormWrapper = function RadioButtonsFormWrapper(_ref) {
171
- var name = _ref.name,
172
- _ref$title = _ref.title,
173
- title = _ref$title === void 0 ? '' : _ref$title,
174
- controlRef = _ref.controlRef,
175
- _ref$options = _ref.options,
176
- options = _ref$options === void 0 ? [] : _ref$options,
177
- _ref$errors = _ref.errors,
178
- errors = _ref$errors === void 0 ? {} : _ref$errors;
179
- var optsWithControlRef = options.map(function (option) {
180
- return _objectSpread2(_objectSpread2({}, option), {}, {
181
- actionCallback: function actionCallback() {
182
- return controlRef(name, option.value);
183
- }
184
- });
185
- });
186
- return /*#__PURE__*/React.createElement(RadioButtons$1, {
187
- name: name,
188
- title: title,
189
- options: optsWithControlRef,
190
- errors: errors,
191
- noWrap: true
192
- });
193
- };
194
-
195
- var _templateObject$8;
196
- var inputMarginRight = '0.2em';
197
- var CheckboxLabel = styled.label(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"], ["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"])), function (props) {
198
- var _props$theme;
199
-
200
- return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
201
- }, function (props) {
202
- return props.theme.fontSizes[4];
203
- }, function (props) {
204
- return props.theme.colors.ntrlMin;
205
- }, inputMarginRight, function (props) {
206
- return props.theme.colors.primary;
207
- }, function (props) {
208
- return props.theme.borderRadius;
209
- }, function (props) {
210
- return props.theme.colors.primary;
211
- });
212
- var ErrorMessage = styled.div({
213
- color: function color(props) {
214
- return props.theme.colors.primary;
118
+ function _unsupportedIterableToArray(o, minLen) {
119
+ if (!o) return;
120
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
121
+ var n = Object.prototype.toString.call(o).slice(8, -1);
122
+ if (n === "Object" && o.constructor) n = o.constructor.name;
123
+ if (n === "Map" || n === "Set") return Array.from(o);
124
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
125
+ }
126
+
127
+ function _arrayLikeToArray(arr, len) {
128
+ if (len == null || len > arr.length) len = arr.length;
129
+
130
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
131
+
132
+ return arr2;
215
133
  }
216
- });
217
-
218
- var theme = {
219
- breakpoints: ['40em', '52em', '64em'],
220
- space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
221
- fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
222
- marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
223
- letterSpacings: ['-0.5px', '0px', '+0.5px'],
224
- radii: ['0px', '2px', '4px', '8px'],
225
- borderRadius: '6px',
226
- colors: {
227
- primary: '#000',
228
- base: '#4e4949',
229
- baseLt: '#817c7c',
230
- borderColor: '#d8d8d8',
231
- ntrlMin: '#fff',
232
- ntrlMinTen: '#e6e6e6',
233
- gray: '#efefef',
234
- darkerGray: '#454141'
235
- },
236
- rareStepColors: {
237
- primary: '#202b58',
238
- secondary: '#ef5c2d',
239
- ntrlMin: '#ffffff',
240
- ntrl40: '#f4f4f4',
241
- ntrl50: '#808080',
242
- ntrl60: '#e8e8e8',
243
- ntrl70: '#252525',
244
- ntrlMax: '#000000'
245
- },
246
- rareStepFontWeights: {
247
- normal: 400,
248
- medium: 500,
249
- semiBold: 600,
250
- bold: 700
251
- },
252
- rareStepFontSize: {
253
- h1: '36px',
254
- h2: '30px',
255
- h3: '24px',
256
- h4: '20px',
257
- h5: '16px',
258
- h6: '14px',
259
- footerTitle: '16px'
260
- },
261
- rareStepPageSizes: {
262
- mobile: '500px',
263
- tablet: '768px',
264
- desktop: '992px',
265
- screenl: '1280px',
266
- screenxl: '1680px',
267
- screenxxl: '1920px',
268
- container: '1600px'
134
+
135
+ function _nonIterableRest() {
136
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
269
137
  }
270
- };
271
-
272
- var themed = (function (Component) {
273
- return /*#__PURE__*/forwardRef(function (props, ref) {
274
- return /*#__PURE__*/React.createElement(ThemeProvider, {
275
- theme: theme
276
- }, /*#__PURE__*/React.createElement(Component, _extends({}, props, {
277
- ref: ref
278
- })));
138
+
139
+ var _templateObject;
140
+ var RadioButtonsContainer = styled__default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
141
+
142
+ var _templateObject$1;
143
+ var ButtonListWrapper = styled__default.div(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n display: flex;\n flex-grow: 1;\n flex-wrap: ", ";\n"])), function (_ref) {
144
+ var noWrap = _ref.noWrap;
145
+ return noWrap ? 'nowrap' : 'wrap';
146
+ });
147
+
148
+ var _templateObject$2;
149
+ var Title = styled__default.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n flex-basis: 40%;\n"])), function (props) {
150
+ return props.theme.colors.base;
151
+ });
152
+
153
+ var _templateObject$3;
154
+ var RadioButtonLabel = styled__default.label(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n display: flex;\n margin-bottom: ", ";\n margin-right: ", ";\n"])), function (props) {
155
+ return props.theme.marginPaddings[0];
156
+ }, function (props) {
157
+ return props.theme.marginPaddings[0];
279
158
  });
280
- });
281
-
282
- var FormWrapper = RadioButtonsFormWrapper;
283
-
284
- /**
285
- * RadioButtons component can show multiple radios, a title and an error message
286
- */
287
- var RadioButtons = function RadioButtons(_ref) {
288
- var options = _ref.options,
289
- name = _ref.name,
290
- noWrap = _ref.noWrap,
291
- title = _ref.title,
292
- errors = _ref.errors;
293
-
294
- var _useState = useState(errors[name]),
295
- _useState2 = _slicedToArray(_useState, 2),
296
- errMsg = _useState2[0],
297
- setErrMsg = _useState2[1];
298
-
299
- useEffect(function () {
300
- setErrMsg(errors[name]);
301
- }, [errors, name]);
302
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(RadioButtonsContainer, null, /*#__PURE__*/React.createElement(Title, null, title), /*#__PURE__*/React.createElement(ButtonListWrapper, {
303
- noWrap: noWrap
304
- }, options.map(function (_ref2, index) {
305
- var _ref2$actionCallback = _ref2.actionCallback,
306
- actionCallback = _ref2$actionCallback === void 0 ? function () {
307
- return null;
308
- } : _ref2$actionCallback,
309
- _ref2$value = _ref2.value,
310
- value = _ref2$value === void 0 ? '' : _ref2$value,
311
- _ref2$innerText = _ref2.innerText,
312
- innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
313
- _ref2$checked = _ref2.checked,
314
- checked = _ref2$checked === void 0 ? false : _ref2$checked;
315
- return /*#__PURE__*/React.createElement(RadioButtonLabel, {
316
- key: "".concat(name, "-").concat(index),
317
- htmlFor: "".concat(name, "_").concat(index)
318
- }, /*#__PURE__*/React.createElement(RadioButtonInput, {
319
- id: "".concat(name, "_").concat(index),
320
- type: "radio",
159
+
160
+ var _templateObject$4;
161
+ var RadioButtonCircle = styled__default.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n height: 20px;\n width: 20px;\n border-radius: 50%;\n margin-right: 5px;\n border: 1px solid ", ";\n display: flex;\n"])), function (props) {
162
+ return props.theme.colors.base;
163
+ });
164
+
165
+ var _templateObject$5;
166
+ var RadioButtonCircleInner = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n height: 8px;\n width: 8px;\n border-radius: 50%;\n margin: auto;\n"])));
167
+
168
+ var _templateObject$6;
169
+ var RadioButtonInput = styled__default.input(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n display: none;\n :checked ~ ", " {\n ", " {\n background-color: ", ";\n }\n }\n"])), RadioButtonCircle, RadioButtonCircleInner, function (props) {
170
+ return props.theme.colors.base;
171
+ });
172
+
173
+ var _templateObject$7;
174
+ var RadioButtonText = styled__default.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
175
+
176
+ var RadioButtonsFormWrapper = function RadioButtonsFormWrapper(_ref) {
177
+ var name = _ref.name,
178
+ _ref$title = _ref.title,
179
+ title = _ref$title === void 0 ? '' : _ref$title,
180
+ controlRef = _ref.controlRef,
181
+ _ref$options = _ref.options,
182
+ options = _ref$options === void 0 ? [] : _ref$options,
183
+ _ref$errors = _ref.errors,
184
+ errors = _ref$errors === void 0 ? {} : _ref$errors;
185
+ var optsWithControlRef = options.map(function (option) {
186
+ return _objectSpread2(_objectSpread2({}, option), {}, {
187
+ actionCallback: function actionCallback() {
188
+ return controlRef(name, option.value);
189
+ }
190
+ });
191
+ });
192
+ return /*#__PURE__*/React__default.createElement(RadioButtons$1, {
321
193
  name: name,
322
- defaultChecked: checked,
323
- onChange: function onChange() {
324
- setErrMsg('');
325
- actionCallback(name, value);
326
- },
327
- value: value
328
- }), /*#__PURE__*/React.createElement(RadioButtonCircle, null, /*#__PURE__*/React.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React.createElement(RadioButtonText, null, innerText));
329
- }))), errMsg && /*#__PURE__*/React.createElement(ErrorMessage, null, errMsg));
330
- };
331
-
332
- RadioButtons.defaultProps = {
333
- noWrap: false,
334
- title: '',
335
- errors: {}
336
- };
337
- var RadioButtons$1 = themed(RadioButtons);
338
-
339
- export default RadioButtons$1;
340
- export { FormWrapper };
194
+ title: title,
195
+ options: optsWithControlRef,
196
+ errors: errors,
197
+ noWrap: true
198
+ });
199
+ };
200
+
201
+ var _templateObject$8;
202
+ var inputMarginRight = '0.2em';
203
+ var CheckboxLabel = styled__default.label(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"], ["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"])), function (props) {
204
+ var _props$theme;
205
+
206
+ return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
207
+ }, function (props) {
208
+ return props.theme.fontSizes[4];
209
+ }, function (props) {
210
+ return props.theme.colors.ntrlMin;
211
+ }, inputMarginRight, function (props) {
212
+ return props.theme.colors.primary;
213
+ }, function (props) {
214
+ return props.theme.borderRadius;
215
+ }, function (props) {
216
+ return props.theme.colors.primary;
217
+ });
218
+ var ErrorMessage = styled__default.div({
219
+ color: function color(props) {
220
+ return props.theme.colors.primary;
221
+ }
222
+ });
223
+
224
+ var theme = {
225
+ breakpoints: ['40em', '52em', '64em'],
226
+ space: ['0px', '4px', '8px', '16px', '32px', '64px', '128px', '256px', '512px'],
227
+ fontSizes: ['12px', '14px', '16px', '20px', '24px', '32px', '48px', '64px', '72px'],
228
+ marginPaddings: ['0.5rem', '1rem', '1.5rem', '2rem', '2.5rem', '3rem', '3.5rem', '4rem', '4.5rem', '5rem', '5.5rem', '6rem'],
229
+ letterSpacings: ['-0.5px', '0px', '+0.5px'],
230
+ radii: ['0px', '2px', '4px', '8px'],
231
+ borderRadius: '6px',
232
+ colors: {
233
+ primary: '#000',
234
+ base: '#4e4949',
235
+ baseLt: '#817c7c',
236
+ borderColor: '#d8d8d8',
237
+ ntrlMin: '#fff',
238
+ ntrlMinTen: '#e6e6e6',
239
+ gray: '#efefef',
240
+ darkerGray: '#454141'
241
+ },
242
+ rareStepColors: {
243
+ primary: '#202b58',
244
+ secondary: '#ef5c2d',
245
+ ntrlMin: '#ffffff',
246
+ ntrl40: '#f4f4f4',
247
+ ntrl50: '#808080',
248
+ ntrl60: '#e8e8e8',
249
+ ntrl70: '#252525',
250
+ ntrlMax: '#000000'
251
+ },
252
+ rareStepFontWeights: {
253
+ normal: 400,
254
+ medium: 500,
255
+ semiBold: 600,
256
+ bold: 700
257
+ },
258
+ rareStepFontSize: {
259
+ h1: '36px',
260
+ h2: '30px',
261
+ h3: '24px',
262
+ h4: '20px',
263
+ h5: '16px',
264
+ h6: '14px',
265
+ footerTitle: '16px'
266
+ },
267
+ rareStepPageSizes: {
268
+ mobile: '500px',
269
+ tablet: '768px',
270
+ desktop: '992px',
271
+ screenl: '1280px',
272
+ screenxl: '1680px',
273
+ screenxxl: '1920px',
274
+ container: '1600px'
275
+ }
276
+ };
277
+
278
+ var themed = (function (Component) {
279
+ return /*#__PURE__*/React.forwardRef(function (props, ref) {
280
+ return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
281
+ theme: theme
282
+ }, /*#__PURE__*/React__default.createElement(Component, _extends({}, props, {
283
+ ref: ref
284
+ })));
285
+ });
286
+ });
287
+
288
+ var FormWrapper = RadioButtonsFormWrapper;
289
+
290
+ /**
291
+ * RadioButtons component can show multiple radios, a title and an error message
292
+ */
293
+ var RadioButtons = function RadioButtons(_ref) {
294
+ var options = _ref.options,
295
+ name = _ref.name,
296
+ noWrap = _ref.noWrap,
297
+ title = _ref.title,
298
+ errors = _ref.errors;
299
+
300
+ var _useState = React.useState(errors[name]),
301
+ _useState2 = _slicedToArray(_useState, 2),
302
+ errMsg = _useState2[0],
303
+ setErrMsg = _useState2[1];
304
+
305
+ React.useEffect(function () {
306
+ setErrMsg(errors[name]);
307
+ }, [errors, name]);
308
+ return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(RadioButtonsContainer, null, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement(ButtonListWrapper, {
309
+ noWrap: noWrap
310
+ }, options.map(function (_ref2, index) {
311
+ var _ref2$actionCallback = _ref2.actionCallback,
312
+ actionCallback = _ref2$actionCallback === void 0 ? function () {
313
+ return null;
314
+ } : _ref2$actionCallback,
315
+ _ref2$value = _ref2.value,
316
+ value = _ref2$value === void 0 ? '' : _ref2$value,
317
+ _ref2$innerText = _ref2.innerText,
318
+ innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
319
+ _ref2$checked = _ref2.checked,
320
+ checked = _ref2$checked === void 0 ? false : _ref2$checked;
321
+ return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
322
+ key: "".concat(name, "-").concat(index),
323
+ htmlFor: "".concat(name, "_").concat(index)
324
+ }, /*#__PURE__*/React__default.createElement(RadioButtonInput, {
325
+ id: "".concat(name, "_").concat(index),
326
+ type: "radio",
327
+ name: name,
328
+ defaultChecked: checked,
329
+ onChange: function onChange() {
330
+ setErrMsg('');
331
+ actionCallback(name, value);
332
+ },
333
+ value: value
334
+ }), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
335
+ }))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errMsg));
336
+ };
337
+
338
+ RadioButtons.defaultProps = {
339
+ noWrap: false,
340
+ title: '',
341
+ errors: {}
342
+ };
343
+ var RadioButtons$1 = themed(RadioButtons);
344
+
345
+ exports.FormWrapper = FormWrapper;
346
+ exports.default = RadioButtons$1;
347
+
348
+ Object.defineProperty(exports, '__esModule', { value: true });
349
+
350
+ })));