@bonlineza/luxity-lib 2.34.1 → 2.34.3

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 (86) hide show
  1. package/Accordion.js +76 -116
  2. package/AddInterest.js +434 -768
  3. package/BrandSelector.js +176 -336
  4. package/Checkbox.js +68 -101
  5. package/CheckboxButton.js +79 -124
  6. package/CommunicationPreferenceOptionsRenderer.js +107 -125
  7. package/CommunicationPreferenceSection.js +114 -134
  8. package/CommunicationPreferences.js +443 -339
  9. package/CountryCodeSelect.js +7 -10
  10. package/CurrencyInputFormatter.js +29 -56
  11. package/CurrencySelect.js +188 -19
  12. package/GALink.js +6 -16
  13. package/GenderSelector.js +88 -142
  14. package/GraphQLDropdownSelector.js +505 -939
  15. package/GraphQLMultiSelector.js +141 -274
  16. package/IconHeader.js +11 -25
  17. package/IconWrapper.js +3 -7
  18. package/InterestCatSelector.js +34 -74
  19. package/InterestItem.js +103 -187
  20. package/Interests.js +485 -890
  21. package/InterestsSubheading.js +5 -10
  22. package/InvertedTextButton.js +27 -63
  23. package/LuxityAppSideNav.js +18 -21
  24. package/LuxityDesktopHeader.js +360 -211
  25. package/LuxityFooter.js +464 -260
  26. package/LuxityGraphQLDropdownSelector.js +519 -969
  27. package/LuxityGraphQLMultiselector.js +167 -321
  28. package/LuxityMobileHeader.js +453 -283
  29. package/LuxityPageReady.js +74 -136
  30. package/LuxitySideNav.js +355 -159
  31. package/MaterialSelector.js +525 -976
  32. package/ModelSelector.js +525 -976
  33. package/NotificationDropDown.js +111 -209
  34. package/Notify.js +0 -1
  35. package/OutlinePrimaryButton.js +26 -58
  36. package/PriceRangeSelector.js +168 -281
  37. package/PrimaryButton.js +26 -58
  38. package/RadioButtons.js +114 -140
  39. package/RangeSlider.js +152 -242
  40. package/RareStepFooter.js +27 -41
  41. package/RareStepHeader.js +139 -190
  42. package/ReactSelectWrapper.js +0 -1
  43. package/SecondaryButton.js +26 -58
  44. package/ShoeSizeRangeSelector.js +162 -260
  45. package/ShoeSizeSelector.js +158 -263
  46. package/SimpleErrorBoundary.js +59 -106
  47. package/StyleSelector.js +176 -336
  48. package/TextButton.js +26 -58
  49. package/Tooltip.js +17 -39
  50. package/Tracking.js +0 -1
  51. package/WrapperButton.js +20 -43
  52. package/build/bundle.css +1 -1
  53. package/build/bundle.js +1321 -1697
  54. package/package.json +1 -1
  55. package/svg/Accessories.js +6 -13
  56. package/svg/Account.js +6 -13
  57. package/svg/Add.js +6 -13
  58. package/svg/ArrowRight.js +6 -13
  59. package/svg/Bags.js +6 -13
  60. package/svg/BurgerMenu.js +6 -13
  61. package/svg/Calendar.js +6 -13
  62. package/svg/CalendarCircled.js +6 -13
  63. package/svg/CheckCircled.js +6 -13
  64. package/svg/Close.js +6 -13
  65. package/svg/Clothing.js +6 -13
  66. package/svg/Dot.js +6 -13
  67. package/svg/Edit.js +6 -13
  68. package/svg/Eye.js +6 -13
  69. package/svg/FileAttach.js +6 -13
  70. package/svg/FileAttachCircled.js +6 -13
  71. package/svg/LightBulb.js +6 -13
  72. package/svg/Logo.js +6 -13
  73. package/svg/LuxityMenu.js +6 -13
  74. package/svg/Minus.js +6 -13
  75. package/svg/MobileAvatar.js +6 -13
  76. package/svg/MyOrder.js +6 -13
  77. package/svg/MyPayment.js +6 -13
  78. package/svg/MyProfile.js +8 -14
  79. package/svg/MySale.js +6 -13
  80. package/svg/Notification.js +6 -13
  81. package/svg/PointerDown.js +6 -13
  82. package/svg/Search.js +6 -13
  83. package/svg/Shoes.js +6 -13
  84. package/svg/SvgWrapper.js +3 -7
  85. package/svg/Trash.js +6 -13
  86. package/svg/Watches.js +6 -13
package/InterestItem.js CHANGED
@@ -8,186 +8,123 @@
8
8
  var styled__default = 'default' in styled ? styled['default'] : styled;
9
9
  numeral = numeral && Object.prototype.hasOwnProperty.call(numeral, 'default') ? numeral['default'] : numeral;
10
10
 
11
- function ownKeys(object, enumerableOnly) {
12
- var keys = Object.keys(object);
13
-
14
- if (Object.getOwnPropertySymbols) {
15
- var symbols = Object.getOwnPropertySymbols(object);
16
- enumerableOnly && (symbols = symbols.filter(function (sym) {
17
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
18
- })), keys.push.apply(keys, symbols);
19
- }
20
-
21
- return keys;
11
+ function _assertThisInitialized(e) {
12
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
13
+ return e;
22
14
  }
23
-
24
- function _objectSpread2(target) {
25
- for (var i = 1; i < arguments.length; i++) {
26
- var source = null != arguments[i] ? arguments[i] : {};
27
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
28
- _defineProperty(target, key, source[key]);
29
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
30
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
31
- });
32
- }
33
-
34
- return target;
15
+ function _callSuper(t, o, e) {
16
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
35
17
  }
36
-
37
- function _classCallCheck(instance, Constructor) {
38
- if (!(instance instanceof Constructor)) {
39
- throw new TypeError("Cannot call a class as a function");
40
- }
18
+ function _classCallCheck(a, n) {
19
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
41
20
  }
42
-
43
- function _defineProperties(target, props) {
44
- for (var i = 0; i < props.length; i++) {
45
- var descriptor = props[i];
46
- descriptor.enumerable = descriptor.enumerable || false;
47
- descriptor.configurable = true;
48
- if ("value" in descriptor) descriptor.writable = true;
49
- Object.defineProperty(target, descriptor.key, descriptor);
21
+ function _defineProperties(e, r) {
22
+ for (var t = 0; t < r.length; t++) {
23
+ var o = r[t];
24
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
50
25
  }
51
26
  }
52
-
53
- function _createClass(Constructor, protoProps, staticProps) {
54
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
55
- if (staticProps) _defineProperties(Constructor, staticProps);
56
- Object.defineProperty(Constructor, "prototype", {
57
- writable: false
58
- });
59
- return Constructor;
27
+ function _createClass(e, r, t) {
28
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
29
+ writable: !1
30
+ }), e;
60
31
  }
61
-
62
- function _defineProperty(obj, key, value) {
63
- if (key in obj) {
64
- Object.defineProperty(obj, key, {
65
- value: value,
66
- enumerable: true,
67
- configurable: true,
68
- writable: true
69
- });
70
- } else {
71
- obj[key] = value;
72
- }
73
-
74
- return obj;
32
+ function _defineProperty(e, r, t) {
33
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
34
+ value: t,
35
+ enumerable: !0,
36
+ configurable: !0,
37
+ writable: !0
38
+ }) : e[r] = t, e;
75
39
  }
76
-
77
40
  function _extends() {
78
- _extends = Object.assign ? Object.assign.bind() : function (target) {
79
- for (var i = 1; i < arguments.length; i++) {
80
- var source = arguments[i];
81
-
82
- for (var key in source) {
83
- if (Object.prototype.hasOwnProperty.call(source, key)) {
84
- target[key] = source[key];
85
- }
86
- }
41
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
42
+ for (var e = 1; e < arguments.length; e++) {
43
+ var t = arguments[e];
44
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
87
45
  }
88
-
89
- return target;
90
- };
91
- return _extends.apply(this, arguments);
46
+ return n;
47
+ }, _extends.apply(null, arguments);
92
48
  }
93
-
94
- function _inherits(subClass, superClass) {
95
- if (typeof superClass !== "function" && superClass !== null) {
96
- throw new TypeError("Super expression must either be null or a function");
97
- }
98
-
99
- subClass.prototype = Object.create(superClass && superClass.prototype, {
49
+ function _getPrototypeOf(t) {
50
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
51
+ return t.__proto__ || Object.getPrototypeOf(t);
52
+ }, _getPrototypeOf(t);
53
+ }
54
+ function _inherits(t, e) {
55
+ if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
56
+ t.prototype = Object.create(e && e.prototype, {
100
57
  constructor: {
101
- value: subClass,
102
- writable: true,
103
- configurable: true
58
+ value: t,
59
+ writable: !0,
60
+ configurable: !0
104
61
  }
105
- });
106
- Object.defineProperty(subClass, "prototype", {
107
- writable: false
108
- });
109
- if (superClass) _setPrototypeOf(subClass, superClass);
110
- }
111
-
112
- function _getPrototypeOf(o) {
113
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
114
- return o.__proto__ || Object.getPrototypeOf(o);
115
- };
116
- return _getPrototypeOf(o);
117
- }
118
-
119
- function _setPrototypeOf(o, p) {
120
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
121
- o.__proto__ = p;
122
- return o;
123
- };
124
- return _setPrototypeOf(o, p);
62
+ }), Object.defineProperty(t, "prototype", {
63
+ writable: !1
64
+ }), e && _setPrototypeOf(t, e);
125
65
  }
126
-
127
66
  function _isNativeReflectConstruct() {
128
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
129
- if (Reflect.construct.sham) return false;
130
- if (typeof Proxy === "function") return true;
131
-
132
67
  try {
133
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
134
- return true;
135
- } catch (e) {
136
- return false;
137
- }
68
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
69
+ } catch (t) {}
70
+ return (_isNativeReflectConstruct = function () {
71
+ return !!t;
72
+ })();
138
73
  }
139
-
140
- function _assertThisInitialized(self) {
141
- if (self === void 0) {
142
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
74
+ function ownKeys(e, r) {
75
+ var t = Object.keys(e);
76
+ if (Object.getOwnPropertySymbols) {
77
+ var o = Object.getOwnPropertySymbols(e);
78
+ r && (o = o.filter(function (r) {
79
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
80
+ })), t.push.apply(t, o);
143
81
  }
144
-
145
- return self;
82
+ return t;
146
83
  }
147
-
148
- function _possibleConstructorReturn(self, call) {
149
- if (call && (typeof call === "object" || typeof call === "function")) {
150
- return call;
151
- } else if (call !== void 0) {
152
- throw new TypeError("Derived constructors may only return object or undefined");
84
+ function _objectSpread2(e) {
85
+ for (var r = 1; r < arguments.length; r++) {
86
+ var t = null != arguments[r] ? arguments[r] : {};
87
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
88
+ _defineProperty(e, r, t[r]);
89
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
90
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
91
+ });
153
92
  }
154
-
155
- return _assertThisInitialized(self);
93
+ return e;
156
94
  }
157
-
158
- function _createSuper(Derived) {
159
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
160
-
161
- return function _createSuperInternal() {
162
- var Super = _getPrototypeOf(Derived),
163
- result;
164
-
165
- if (hasNativeReflectConstruct) {
166
- var NewTarget = _getPrototypeOf(this).constructor;
167
-
168
- result = Reflect.construct(Super, arguments, NewTarget);
169
- } else {
170
- result = Super.apply(this, arguments);
171
- }
172
-
173
- return _possibleConstructorReturn(this, result);
174
- };
95
+ function _possibleConstructorReturn(t, e) {
96
+ if (e && ("object" == typeof e || "function" == typeof e)) return e;
97
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
98
+ return _assertThisInitialized(t);
175
99
  }
176
-
177
- function _taggedTemplateLiteral(strings, raw) {
178
- if (!raw) {
179
- raw = strings.slice(0);
180
- }
181
-
182
- return Object.freeze(Object.defineProperties(strings, {
100
+ function _setPrototypeOf(t, e) {
101
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
102
+ return t.__proto__ = e, t;
103
+ }, _setPrototypeOf(t, e);
104
+ }
105
+ function _taggedTemplateLiteral(e, t) {
106
+ return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
183
107
  raw: {
184
- value: Object.freeze(raw)
108
+ value: Object.freeze(t)
185
109
  }
186
110
  }));
187
111
  }
112
+ function _toPrimitive(t, r) {
113
+ if ("object" != typeof t || !t) return t;
114
+ var e = t[Symbol.toPrimitive];
115
+ if (void 0 !== e) {
116
+ var i = e.call(t, r || "default");
117
+ if ("object" != typeof i) return i;
118
+ throw new TypeError("@@toPrimitive must return a primitive value.");
119
+ }
120
+ return ("string" === r ? String : Number)(t);
121
+ }
122
+ function _toPropertyKey(t) {
123
+ var i = _toPrimitive(t, "string");
124
+ return "symbol" == typeof i ? i : i + "";
125
+ }
188
126
 
189
- /** @format */
190
-
127
+ // Register a locale for South African currency confiuguration
191
128
  numeral.register('locale', 'en-ZA', {
192
129
  delimiters: {
193
130
  thousands: ',',
@@ -208,12 +145,12 @@
208
145
  });
209
146
  numeral.locale('en-ZA');
210
147
  String.locale = numeral.locale;
148
+
211
149
  /**
212
150
  * Curreny Formatter
213
151
  * @param {number} number - the number to be formatted
214
152
  * @param {boolean} round - flag to indicate if the number needs to be rounded off
215
153
  */
216
-
217
154
  function fC(number) {
218
155
  var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
219
156
  var parsedNumber = parseFloat(number);
@@ -221,6 +158,7 @@
221
158
  }
222
159
 
223
160
  /** @format */
161
+
224
162
  var request = {
225
163
  fetching: false,
226
164
  failed: false,
@@ -368,48 +306,35 @@
368
306
 
369
307
  var _templateObject$2, _templateObject2, _templateObject3, _templateObject4;
370
308
  var MALE = genders.MALE,
371
- FEMALE = genders.FEMALE,
372
- UNISEX = genders.UNISEX;
373
-
309
+ FEMALE = genders.FEMALE,
310
+ UNISEX = genders.UNISEX;
374
311
  var TrashIcon = function TrashIcon(_ref) {
375
312
  var onClick = _ref.onClick,
376
- id = _ref.id;
313
+ id = _ref.id;
377
314
  return /*#__PURE__*/React__default.createElement(IconWrapper, {
378
315
  onClick: onClick,
379
316
  id: id
380
317
  }, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Trash, null)));
381
318
  };
382
-
383
319
  var InterestItem = /*#__PURE__*/function (_React$Component) {
384
- _inherits(InterestItem, _React$Component);
385
-
386
- var _super = _createSuper(InterestItem);
387
-
388
320
  function InterestItem(props) {
389
321
  var _this;
390
-
391
322
  _classCallCheck(this, InterestItem);
392
-
393
- _this = _super.call(this, props);
394
-
395
- _defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
323
+ _this = _callSuper(this, InterestItem, [props]);
324
+ _defineProperty(_this, "deleteInterestItem", function () {
396
325
  var id = _this.props.data.id;
397
-
398
326
  _this.setState({
399
327
  delete: _objectSpread2(_objectSpread2({}, request), {}, {
400
328
  fetching: true
401
329
  })
402
330
  });
403
-
404
331
  var url = _this.props.deleteInterestApi(id);
405
-
406
332
  simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
407
333
  _this.setState({
408
334
  delete: _objectSpread2(_objectSpread2({}, request), {}, {
409
335
  success: true
410
336
  })
411
337
  });
412
-
413
338
  _this.props.onDeleted(_this.props.data);
414
339
  }, function () {
415
340
  return _this.setState({
@@ -417,32 +342,25 @@
417
342
  });
418
343
  });
419
344
  });
420
-
421
- _defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
345
+ _defineProperty(_this, "getGender", function (gender) {
422
346
  switch (gender) {
423
347
  case MALE:
424
348
  return 'Male';
425
-
426
349
  case FEMALE:
427
350
  return 'Female';
428
-
429
351
  case UNISEX:
430
352
  default:
431
353
  return 'Unisex';
432
354
  }
433
355
  });
434
-
435
- _defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
356
+ _defineProperty(_this, "getCategory", function (category) {
436
357
  if (category === interestCategories.APPAREL) {
437
358
  return 'CLOTHING';
438
359
  }
439
-
440
360
  return category;
441
361
  });
442
-
443
- _defineProperty(_assertThisInitialized(_this), "render", function () {
362
+ _defineProperty(_this, "render", function () {
444
363
  var _data$min_shoe_size, _data$max_shoe_size;
445
-
446
364
  var data = _this.props.data;
447
365
  var success = _this.state.delete.success;
448
366
  return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
@@ -492,16 +410,14 @@
492
410
  }
493
411
  }));
494
412
  });
495
-
496
413
  _this.state = {
497
414
  delete: _objectSpread2({}, request)
498
415
  };
499
416
  return _this;
500
417
  }
501
-
418
+ _inherits(InterestItem, _React$Component);
502
419
  return _createClass(InterestItem);
503
420
  }(React__default.Component);
504
-
505
421
  var SheoSizeContentDiv = styled__default.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
506
422
  var InterestItemTitle = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
507
423
  var InterestItemContainer = styled__default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
@@ -517,11 +433,11 @@
517
433
  return props.theme.marginPaddings[0];
518
434
  }, media.xs);
519
435
  var ThemedInterestItem = themed(InterestItem);
436
+
520
437
  /**
521
438
  * The Interest Item view shows the selected interest configuration,
522
439
  * and gives user control to delete it.
523
440
  */
524
-
525
441
  var index = (function (props) {
526
442
  return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
527
443
  });