@bonlineza/luxity-lib 2.36.1-uk-platform.1 → 2.36.2

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 (94) hide show
  1. package/Accordion.js +116 -76
  2. package/AddInterest.js +777 -440
  3. package/AddProductInterest.js +644 -485
  4. package/BrandSelector.js +336 -176
  5. package/Checkbox.js +101 -68
  6. package/CheckboxButton.js +124 -79
  7. package/CommunicationPreferenceOptionsRenderer.js +169 -159
  8. package/CommunicationPreferenceSection.js +178 -166
  9. package/CommunicationPreferences.js +427 -549
  10. package/ConditionSelector.js +336 -174
  11. package/CountryCodeSelect.js +10 -7
  12. package/CurrencyInputFormatter.js +56 -29
  13. package/CurrencySelect.js +49 -23
  14. package/DropdownSelector.js +92 -68
  15. package/GALink.js +16 -6
  16. package/GenderSelector.js +142 -88
  17. package/GraphQLDropdownSelector.js +1508 -929
  18. package/GraphQLMultiSelector.js +274 -141
  19. package/IconHeader.js +25 -11
  20. package/IconWrapper.js +7 -3
  21. package/InterestCatSelector.js +74 -34
  22. package/InterestItem.js +187 -103
  23. package/Interests.js +1463 -913
  24. package/InterestsSubheading.js +10 -5
  25. package/InvertedTextButton.js +63 -27
  26. package/LuxityAppSideNav.js +21 -18
  27. package/LuxityDesktopHeader.js +451 -298
  28. package/LuxityFooter.js +321 -430
  29. package/LuxityGraphQLDropdownSelector.js +1540 -945
  30. package/LuxityGraphQLMultiselector.js +321 -167
  31. package/LuxityMobileHeader.js +544 -353
  32. package/LuxityPageReady.js +136 -74
  33. package/LuxityProductInterestItem.js +175 -97
  34. package/LuxitySideNav.js +244 -176
  35. package/MaterialSelector.js +1547 -951
  36. package/ModelSelector.js +1547 -951
  37. package/NotificationDropDown.js +218 -118
  38. package/Notify.js +1 -0
  39. package/OutlinePrimaryButton.js +58 -26
  40. package/PriceRangeSelector.js +281 -168
  41. package/PrimaryButton.js +58 -26
  42. package/RadioButtons.js +140 -114
  43. package/RangeSlider.js +242 -152
  44. package/RareStepFooter.js +41 -27
  45. package/RareStepHeader.js +190 -139
  46. package/ReactSelectWrapper.js +1 -0
  47. package/SecondaryButton.js +58 -26
  48. package/ShoeSizeRangeSelector.js +260 -162
  49. package/ShoeSizeSelector.js +263 -158
  50. package/SimpleErrorBoundary.js +106 -59
  51. package/StyleSelector.js +336 -176
  52. package/TestComponent.js +15 -0
  53. package/TextButton.js +58 -26
  54. package/Tooltip.js +39 -17
  55. package/Tracking.js +1 -0
  56. package/WrapperButton.js +43 -20
  57. package/build/CountryCodeSelect/index.js +18 -0
  58. package/build/ReactSelectWrapper/index.js +34 -0
  59. package/build/bundle.css +1 -1
  60. package/build/bundle.js +2616 -1974
  61. package/package.json +1 -1
  62. package/postcss.config.js +6 -0
  63. package/svg/Accessories.js +13 -6
  64. package/svg/Account.js +13 -6
  65. package/svg/Add.js +13 -6
  66. package/svg/ArrowRight.js +13 -6
  67. package/svg/Bags.js +13 -6
  68. package/svg/BurgerMenu.js +13 -6
  69. package/svg/Calendar.js +13 -6
  70. package/svg/CalendarCircled.js +13 -6
  71. package/svg/CheckCircled.js +13 -6
  72. package/svg/Close.js +13 -6
  73. package/svg/Clothing.js +13 -6
  74. package/svg/Dot.js +13 -6
  75. package/svg/Edit.js +13 -6
  76. package/svg/Eye.js +13 -6
  77. package/svg/FileAttach.js +13 -6
  78. package/svg/FileAttachCircled.js +13 -6
  79. package/svg/LightBulb.js +13 -6
  80. package/svg/Logo.js +13 -6
  81. package/svg/LuxityMenu.js +13 -6
  82. package/svg/Minus.js +13 -6
  83. package/svg/MobileAvatar.js +13 -6
  84. package/svg/MyOrder.js +13 -6
  85. package/svg/MyPayment.js +13 -6
  86. package/svg/MyProfile.js +14 -8
  87. package/svg/MySale.js +13 -6
  88. package/svg/Notification.js +13 -6
  89. package/svg/PointerDown.js +13 -6
  90. package/svg/Search.js +13 -6
  91. package/svg/Shoes.js +13 -6
  92. package/svg/SvgWrapper.js +7 -3
  93. package/svg/Trash.js +13 -6
  94. package/svg/Watches.js +13 -6
@@ -8,38 +8,66 @@
8
8
  var styled__default = 'default' in styled ? styled['default'] : styled;
9
9
 
10
10
  function _extends() {
11
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
12
- for (var e = 1; e < arguments.length; e++) {
13
- var t = arguments[e];
14
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
11
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
12
+ for (var i = 1; i < arguments.length; i++) {
13
+ var source = arguments[i];
14
+
15
+ for (var key in source) {
16
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
17
+ target[key] = source[key];
18
+ }
19
+ }
15
20
  }
16
- return n;
17
- }, _extends.apply(null, arguments);
21
+
22
+ return target;
23
+ };
24
+ return _extends.apply(this, arguments);
18
25
  }
19
- function _objectWithoutProperties(e, t) {
20
- if (null == e) return {};
21
- var o,
22
- r,
23
- i = _objectWithoutPropertiesLoose(e, t);
24
- if (Object.getOwnPropertySymbols) {
25
- var n = Object.getOwnPropertySymbols(e);
26
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
26
+
27
+ function _objectWithoutPropertiesLoose(source, excluded) {
28
+ if (source == null) return {};
29
+ var target = {};
30
+ var sourceKeys = Object.keys(source);
31
+ var key, i;
32
+
33
+ for (i = 0; i < sourceKeys.length; i++) {
34
+ key = sourceKeys[i];
35
+ if (excluded.indexOf(key) >= 0) continue;
36
+ target[key] = source[key];
27
37
  }
28
- return i;
38
+
39
+ return target;
29
40
  }
30
- function _objectWithoutPropertiesLoose(r, e) {
31
- if (null == r) return {};
32
- var t = {};
33
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
34
- if (-1 !== e.indexOf(n)) continue;
35
- t[n] = r[n];
41
+
42
+ function _objectWithoutProperties(source, excluded) {
43
+ if (source == null) return {};
44
+
45
+ var target = _objectWithoutPropertiesLoose(source, excluded);
46
+
47
+ var key, i;
48
+
49
+ if (Object.getOwnPropertySymbols) {
50
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
51
+
52
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
53
+ key = sourceSymbolKeys[i];
54
+ if (excluded.indexOf(key) >= 0) continue;
55
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
56
+ target[key] = source[key];
57
+ }
36
58
  }
37
- return t;
59
+
60
+ return target;
38
61
  }
39
- function _taggedTemplateLiteral(e, t) {
40
- return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
62
+
63
+ function _taggedTemplateLiteral(strings, raw) {
64
+ if (!raw) {
65
+ raw = strings.slice(0);
66
+ }
67
+
68
+ return Object.freeze(Object.defineProperties(strings, {
41
69
  raw: {
42
- value: Object.freeze(t)
70
+ value: Object.freeze(raw)
43
71
  }
44
72
  }));
45
73
  }
@@ -142,14 +170,13 @@
142
170
  function cloneObject(data) {
143
171
  let copy;
144
172
  const isArray = Array.isArray(data);
145
- const isFileListInstance = typeof FileList !== 'undefined' ? data instanceof FileList : false;
146
173
  if (data instanceof Date) {
147
174
  copy = new Date(data);
148
175
  }
149
176
  else if (data instanceof Set) {
150
177
  copy = new Set(data);
151
178
  }
152
- else if (!(isWeb && (data instanceof Blob || isFileListInstance)) &&
179
+ else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) &&
153
180
  (isArray || isObject(data))) {
154
181
  copy = isArray ? [] : {};
155
182
  if (!isArray && !isPlainObject(data)) {
@@ -173,50 +200,18 @@
173
200
 
174
201
  var isUndefined = (val) => val === undefined;
175
202
 
176
- var get = (object, path, defaultValue) => {
177
- if (!path || !isObject(object)) {
203
+ var get = (obj, path, defaultValue) => {
204
+ if (!path || !isObject(obj)) {
178
205
  return defaultValue;
179
206
  }
180
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
181
- return isUndefined(result) || result === object
182
- ? isUndefined(object[path])
207
+ const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
208
+ return isUndefined(result) || result === obj
209
+ ? isUndefined(obj[path])
183
210
  ? defaultValue
184
- : object[path]
211
+ : obj[path]
185
212
  : result;
186
213
  };
187
214
 
188
- var isBoolean = (value) => typeof value === 'boolean';
189
-
190
- var isKey = (value) => /^\w*$/.test(value);
191
-
192
- var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
193
-
194
- var set = (object, path, value) => {
195
- let index = -1;
196
- const tempPath = isKey(path) ? [path] : stringToPath(path);
197
- const length = tempPath.length;
198
- const lastIndex = length - 1;
199
- while (++index < length) {
200
- const key = tempPath[index];
201
- let newValue = value;
202
- if (index !== lastIndex) {
203
- const objValue = object[key];
204
- newValue =
205
- isObject(objValue) || Array.isArray(objValue)
206
- ? objValue
207
- : !isNaN(+tempPath[index + 1])
208
- ? []
209
- : {};
210
- }
211
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
212
- return;
213
- }
214
- object[key] = newValue;
215
- object = object[key];
216
- }
217
- return object;
218
- };
219
-
220
215
  const EVENTS = {
221
216
  BLUR: 'blur',
222
217
  FOCUS_OUT: 'focusout',
@@ -295,13 +290,15 @@
295
290
 
296
291
  var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
297
292
 
298
- var shouldSubscribeByName = (name, signalName, exact) => !name ||
299
- !signalName ||
300
- name === signalName ||
301
- convertToArrayPayload(name).some((currentName) => currentName &&
302
- (exact
303
- ? currentName === signalName
304
- : currentName.startsWith(signalName) ||
293
+ var shouldSubscribeByName = (name, signalName, exact) => exact && signalName
294
+ ? name === signalName ||
295
+ (Array.isArray(name) &&
296
+ name.some((currentName) => currentName && exact && currentName === signalName))
297
+ : !name ||
298
+ !signalName ||
299
+ name === signalName ||
300
+ convertToArrayPayload(name).some((currentName) => currentName &&
301
+ (currentName.startsWith(signalName) ||
305
302
  signalName.startsWith(currentName)));
306
303
 
307
304
  function useSubscribe(props) {
@@ -359,7 +356,6 @@
359
356
  isLoading: false,
360
357
  dirtyFields: false,
361
358
  touchedFields: false,
362
- validatingFields: false,
363
359
  isValidating: false,
364
360
  isValid: false,
365
361
  errors: false,
@@ -384,7 +380,7 @@
384
380
  _mounted.current = false;
385
381
  };
386
382
  }, [control]);
387
- return React__default.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
383
+ return getProxyFormState(formState, control, _localProxyFormState.current, false);
388
384
  }
389
385
 
390
386
  var isString = (value) => typeof value === 'string';
@@ -410,7 +406,7 @@
410
406
  *
411
407
  * @example
412
408
  * ```tsx
413
- * const { control } = useForm();
409
+ * const { watch } = useForm();
414
410
  * const values = useWatch({
415
411
  * name: "fieldName"
416
412
  * control,
@@ -436,6 +432,33 @@
436
432
  return value;
437
433
  }
438
434
 
435
+ var isKey = (value) => /^\w*$/.test(value);
436
+
437
+ var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
438
+
439
+ function set(object, path, value) {
440
+ let index = -1;
441
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
442
+ const length = tempPath.length;
443
+ const lastIndex = length - 1;
444
+ while (++index < length) {
445
+ const key = tempPath[index];
446
+ let newValue = value;
447
+ if (index !== lastIndex) {
448
+ const objValue = object[key];
449
+ newValue =
450
+ isObject(objValue) || Array.isArray(objValue)
451
+ ? objValue
452
+ : !isNaN(+tempPath[index + 1])
453
+ ? []
454
+ : {};
455
+ }
456
+ object[key] = newValue;
457
+ object = object[key];
458
+ }
459
+ return object;
460
+ }
461
+
439
462
  /**
440
463
  * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
441
464
  *
@@ -473,79 +496,17 @@
473
496
  const formState = useFormState({
474
497
  control,
475
498
  name,
476
- exact: true,
477
499
  });
478
500
  const _registerProps = React__default.useRef(control.register(name, {
479
501
  ...props.rules,
480
502
  value,
481
- ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
482
503
  }));
483
- const fieldState = React__default.useMemo(() => Object.defineProperties({}, {
484
- invalid: {
485
- enumerable: true,
486
- get: () => !!get(formState.errors, name),
487
- },
488
- isDirty: {
489
- enumerable: true,
490
- get: () => !!get(formState.dirtyFields, name),
491
- },
492
- isTouched: {
493
- enumerable: true,
494
- get: () => !!get(formState.touchedFields, name),
495
- },
496
- isValidating: {
497
- enumerable: true,
498
- get: () => !!get(formState.validatingFields, name),
499
- },
500
- error: {
501
- enumerable: true,
502
- get: () => get(formState.errors, name),
503
- },
504
- }), [formState, name]);
505
- const field = React__default.useMemo(() => ({
506
- name,
507
- value,
508
- ...(isBoolean(disabled) || formState.disabled
509
- ? { disabled: formState.disabled || disabled }
510
- : {}),
511
- onChange: (event) => _registerProps.current.onChange({
512
- target: {
513
- value: getEventValue(event),
514
- name: name,
515
- },
516
- type: EVENTS.CHANGE,
517
- }),
518
- onBlur: () => _registerProps.current.onBlur({
519
- target: {
520
- value: get(control._formValues, name),
521
- name: name,
522
- },
523
- type: EVENTS.BLUR,
524
- }),
525
- ref: (elm) => {
526
- const field = get(control._fields, name);
527
- if (field && elm) {
528
- field._f.ref = {
529
- focus: () => elm.focus(),
530
- select: () => elm.select(),
531
- setCustomValidity: (message) => elm.setCustomValidity(message),
532
- reportValidity: () => elm.reportValidity(),
533
- };
534
- }
535
- },
536
- }), [
537
- name,
538
- control._formValues,
539
- disabled,
540
- formState.disabled,
541
- value,
542
- control._fields,
543
- ]);
504
+ _registerProps.current = control.register(name, props.rules);
544
505
  React__default.useEffect(() => {
545
506
  const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
546
507
  const updateMounted = (name, value) => {
547
508
  const field = get(control._fields, name);
548
- if (field && field._f) {
509
+ if (field) {
549
510
  field._f.mount = value;
550
511
  }
551
512
  };
@@ -557,7 +518,6 @@
557
518
  set(control._formValues, name, value);
558
519
  }
559
520
  }
560
- !isArrayField && control.register(name);
561
521
  return () => {
562
522
  (isArrayField
563
523
  ? _shouldUnregisterField && !control._state.action
@@ -573,11 +533,57 @@
573
533
  name,
574
534
  });
575
535
  }, [disabled, name, control]);
576
- return React__default.useMemo(() => ({
577
- field,
536
+ return {
537
+ field: {
538
+ name,
539
+ value,
540
+ disabled,
541
+ onChange: React__default.useCallback((event) => _registerProps.current.onChange({
542
+ target: {
543
+ value: getEventValue(event),
544
+ name: name,
545
+ },
546
+ type: EVENTS.CHANGE,
547
+ }), [name]),
548
+ onBlur: React__default.useCallback(() => _registerProps.current.onBlur({
549
+ target: {
550
+ value: get(control._formValues, name),
551
+ name: name,
552
+ },
553
+ type: EVENTS.BLUR,
554
+ }), [name, control]),
555
+ ref: (elm) => {
556
+ const field = get(control._fields, name);
557
+ if (field && elm) {
558
+ field._f.ref = {
559
+ focus: () => elm.focus(),
560
+ select: () => elm.select(),
561
+ setCustomValidity: (message) => elm.setCustomValidity(message),
562
+ reportValidity: () => elm.reportValidity(),
563
+ };
564
+ }
565
+ },
566
+ },
578
567
  formState,
579
- fieldState,
580
- }), [field, formState, fieldState]);
568
+ fieldState: Object.defineProperties({}, {
569
+ invalid: {
570
+ enumerable: true,
571
+ get: () => !!get(formState.errors, name),
572
+ },
573
+ isDirty: {
574
+ enumerable: true,
575
+ get: () => !!get(formState.dirtyFields, name),
576
+ },
577
+ isTouched: {
578
+ enumerable: true,
579
+ get: () => !!get(formState.touchedFields, name),
580
+ },
581
+ error: {
582
+ enumerable: true,
583
+ get: () => get(formState.errors, name),
584
+ },
585
+ }),
586
+ };
581
587
  }
582
588
 
583
589
  var _templateObject;
@@ -604,27 +610,31 @@
604
610
  });
605
611
 
606
612
  var _excluded = ["ref"];
613
+
607
614
  var _templateObject$5, _templateObject2;
608
615
  var OptionsRow = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
609
616
  var Options = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n flex-basis: 60%;\n"])));
617
+
610
618
  var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
611
619
  var control = _ref.control,
612
- name = _ref.name,
613
- isDisabled = _ref.isDisabled,
614
- options = _ref.options,
615
- defaultValue = _ref.defaultValue,
616
- setValue = _ref.setValue;
620
+ name = _ref.name,
621
+ isDisabled = _ref.isDisabled,
622
+ options = _ref.options,
623
+ defaultValue = _ref.defaultValue,
624
+ setValue = _ref.setValue;
625
+
617
626
  var _useController = useController({
618
- name: name,
619
- control: control,
620
- defaultValue: defaultValue
621
- }),
622
- _useController$field = _useController.field,
623
- ref = _useController$field.ref,
624
- inputProps = _objectWithoutProperties(_useController$field, _excluded),
625
- _useController$fieldS = _useController.fieldState,
626
- invalid = _useController$fieldS.invalid,
627
- error = _useController$fieldS.error;
627
+ name: name,
628
+ control: control,
629
+ defaultValue: defaultValue
630
+ }),
631
+ _useController$field = _useController.field,
632
+ ref = _useController$field.ref,
633
+ inputProps = _objectWithoutProperties(_useController$field, _excluded),
634
+ _useController$fieldS = _useController.fieldState,
635
+ invalid = _useController$fieldS.invalid,
636
+ error = _useController$fieldS.error;
637
+
628
638
  React.useEffect(function () {
629
639
  if (defaultValue) {
630
640
  setValue(name, defaultValue);
@@ -654,15 +664,16 @@
654
664
  return props.theme.colors.primary;
655
665
  });
656
666
  var SectionHeading = styled__default.div(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding: 5px 10px;\n"])));
667
+
657
668
  var CommunicationPreferenceSection = function CommunicationPreferenceSection(_ref) {
658
669
  var section_heading = _ref.section_heading,
659
- description = _ref.description,
660
- control = _ref.control,
661
- name = _ref.name,
662
- isDisabled = _ref.isDisabled,
663
- options = _ref.options,
664
- defaultValue = _ref.defaultValue,
665
- setValue = _ref.setValue;
670
+ description = _ref.description,
671
+ control = _ref.control,
672
+ name = _ref.name,
673
+ isDisabled = _ref.isDisabled,
674
+ options = _ref.options,
675
+ defaultValue = _ref.defaultValue,
676
+ setValue = _ref.setValue;
666
677
  return /*#__PURE__*/React__default.createElement(SectionContainer, null, /*#__PURE__*/React__default.createElement(SectionHeading, null, section_heading), /*#__PURE__*/React__default.createElement(CommunicationPreferenceOptionsRenderer, {
667
678
  description: description,
668
679
  control: control,
@@ -673,6 +684,7 @@
673
684
  setValue: setValue
674
685
  }));
675
686
  };
687
+
676
688
  var index = themed(CommunicationPreferenceSection);
677
689
 
678
690
  return index;