@bonlineza/luxity-lib 2.34.3 → 2.34.5

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