@bonlineza/luxity-lib 2.34.2 → 2.34.4

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 +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 +246 -189
  25. package/LuxityFooter.js +276 -374
  26. package/LuxityGraphQLDropdownSelector.js +969 -519
  27. package/LuxityGraphQLMultiselector.js +321 -167
  28. package/LuxityMobileHeader.js +534 -219
  29. package/LuxityPageReady.js +136 -74
  30. package/LuxitySideNav.js +402 -137
  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/TextButton.js +58 -26
  49. package/Tooltip.js +39 -17
  50. package/Tracking.js +1 -0
  51. package/WrapperButton.js +43 -20
  52. package/build/bundle.css +1 -1
  53. package/build/bundle.js +1701 -1254
  54. package/package.json +1 -1
  55. package/svg/Accessories.js +13 -6
  56. package/svg/Account.js +13 -6
  57. package/svg/Add.js +13 -6
  58. package/svg/ArrowRight.js +13 -6
  59. package/svg/Bags.js +13 -6
  60. package/svg/BurgerMenu.js +13 -6
  61. package/svg/Calendar.js +13 -6
  62. package/svg/CalendarCircled.js +13 -6
  63. package/svg/CheckCircled.js +13 -6
  64. package/svg/Close.js +13 -6
  65. package/svg/Clothing.js +13 -6
  66. package/svg/Dot.js +13 -6
  67. package/svg/Edit.js +13 -6
  68. package/svg/Eye.js +13 -6
  69. package/svg/FileAttach.js +13 -6
  70. package/svg/FileAttachCircled.js +13 -6
  71. package/svg/LightBulb.js +13 -6
  72. package/svg/Logo.js +13 -6
  73. package/svg/LuxityMenu.js +13 -6
  74. package/svg/Minus.js +13 -6
  75. package/svg/MobileAvatar.js +13 -6
  76. package/svg/MyOrder.js +13 -6
  77. package/svg/MyPayment.js +13 -6
  78. package/svg/MyProfile.js +14 -8
  79. package/svg/MySale.js +13 -6
  80. package/svg/Notification.js +13 -6
  81. package/svg/PointerDown.js +13 -6
  82. package/svg/Search.js +13 -6
  83. package/svg/Shoes.js +13 -6
  84. package/svg/SvgWrapper.js +7 -3
  85. package/svg/Trash.js +13 -6
  86. 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 s = Object.getOwnPropertySymbols(e);
26
- for (r = 0; r < s.length; r++) o = s[r], t.includes(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 (e.includes(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
  }
@@ -172,50 +200,18 @@
172
200
 
173
201
  var isUndefined = (val) => val === undefined;
174
202
 
175
- var get = (object, path, defaultValue) => {
176
- if (!path || !isObject(object)) {
203
+ var get = (obj, path, defaultValue) => {
204
+ if (!path || !isObject(obj)) {
177
205
  return defaultValue;
178
206
  }
179
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
180
- return isUndefined(result) || result === object
181
- ? 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])
182
210
  ? defaultValue
183
- : object[path]
211
+ : obj[path]
184
212
  : result;
185
213
  };
186
214
 
187
- var isBoolean = (value) => typeof value === 'boolean';
188
-
189
- var isKey = (value) => /^\w*$/.test(value);
190
-
191
- var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
192
-
193
- var set = (object, path, value) => {
194
- let index = -1;
195
- const tempPath = isKey(path) ? [path] : stringToPath(path);
196
- const length = tempPath.length;
197
- const lastIndex = length - 1;
198
- while (++index < length) {
199
- const key = tempPath[index];
200
- let newValue = value;
201
- if (index !== lastIndex) {
202
- const objValue = object[key];
203
- newValue =
204
- isObject(objValue) || Array.isArray(objValue)
205
- ? objValue
206
- : !isNaN(+tempPath[index + 1])
207
- ? []
208
- : {};
209
- }
210
- if (key === '__proto__') {
211
- return;
212
- }
213
- object[key] = newValue;
214
- object = object[key];
215
- }
216
- return object;
217
- };
218
-
219
215
  const EVENTS = {
220
216
  BLUR: 'blur',
221
217
  FOCUS_OUT: 'focusout',
@@ -294,13 +290,15 @@
294
290
 
295
291
  var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
296
292
 
297
- var shouldSubscribeByName = (name, signalName, exact) => !name ||
298
- !signalName ||
299
- name === signalName ||
300
- convertToArrayPayload(name).some((currentName) => currentName &&
301
- (exact
302
- ? currentName === signalName
303
- : 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) ||
304
302
  signalName.startsWith(currentName)));
305
303
 
306
304
  function useSubscribe(props) {
@@ -358,7 +356,6 @@
358
356
  isLoading: false,
359
357
  dirtyFields: false,
360
358
  touchedFields: false,
361
- validatingFields: false,
362
359
  isValidating: false,
363
360
  isValid: false,
364
361
  errors: false,
@@ -409,7 +406,7 @@
409
406
  *
410
407
  * @example
411
408
  * ```tsx
412
- * const { control } = useForm();
409
+ * const { watch } = useForm();
413
410
  * const values = useWatch({
414
411
  * name: "fieldName"
415
412
  * control,
@@ -435,6 +432,33 @@
435
432
  return value;
436
433
  }
437
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
+
438
462
  /**
439
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.
440
464
  *
@@ -472,18 +496,17 @@
472
496
  const formState = useFormState({
473
497
  control,
474
498
  name,
475
- exact: true,
476
499
  });
477
500
  const _registerProps = React__default.useRef(control.register(name, {
478
501
  ...props.rules,
479
502
  value,
480
- ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
481
503
  }));
504
+ _registerProps.current = control.register(name, props.rules);
482
505
  React__default.useEffect(() => {
483
506
  const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
484
507
  const updateMounted = (name, value) => {
485
508
  const field = get(control._fields, name);
486
- if (field && field._f) {
509
+ if (field) {
487
510
  field._f.mount = value;
488
511
  }
489
512
  };
@@ -504,22 +527,17 @@
504
527
  };
505
528
  }, [name, control, isArrayField, shouldUnregister]);
506
529
  React__default.useEffect(() => {
507
- if (get(control._fields, name)) {
508
- control._updateDisabledField({
509
- disabled,
510
- fields: control._fields,
511
- name,
512
- value: get(control._fields, name)._f.value,
513
- });
514
- }
530
+ control._updateDisabledField({
531
+ disabled,
532
+ fields: control._fields,
533
+ name,
534
+ });
515
535
  }, [disabled, name, control]);
516
536
  return {
517
537
  field: {
518
538
  name,
519
539
  value,
520
- ...(isBoolean(disabled) || formState.disabled
521
- ? { disabled: formState.disabled || disabled }
522
- : {}),
540
+ disabled,
523
541
  onChange: React__default.useCallback((event) => _registerProps.current.onChange({
524
542
  target: {
525
543
  value: getEventValue(event),
@@ -534,7 +552,7 @@
534
552
  },
535
553
  type: EVENTS.BLUR,
536
554
  }), [name, control]),
537
- ref: React__default.useCallback((elm) => {
555
+ ref: (elm) => {
538
556
  const field = get(control._fields, name);
539
557
  if (field && elm) {
540
558
  field._f.ref = {
@@ -544,7 +562,7 @@
544
562
  reportValidity: () => elm.reportValidity(),
545
563
  };
546
564
  }
547
- }, [control._fields, name]),
565
+ },
548
566
  },
549
567
  formState,
550
568
  fieldState: Object.defineProperties({}, {
@@ -560,10 +578,6 @@
560
578
  enumerable: true,
561
579
  get: () => !!get(formState.touchedFields, name),
562
580
  },
563
- isValidating: {
564
- enumerable: true,
565
- get: () => !!get(formState.validatingFields, name),
566
- },
567
581
  error: {
568
582
  enumerable: true,
569
583
  get: () => get(formState.errors, name),
@@ -596,27 +610,31 @@
596
610
  });
597
611
 
598
612
  var _excluded = ["ref"];
613
+
599
614
  var _templateObject$5, _templateObject2;
600
615
  var OptionsRow = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
601
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
+
602
618
  var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
603
619
  var control = _ref.control,
604
- name = _ref.name,
605
- isDisabled = _ref.isDisabled,
606
- options = _ref.options,
607
- defaultValue = _ref.defaultValue,
608
- setValue = _ref.setValue;
620
+ name = _ref.name,
621
+ isDisabled = _ref.isDisabled,
622
+ options = _ref.options,
623
+ defaultValue = _ref.defaultValue,
624
+ setValue = _ref.setValue;
625
+
609
626
  var _useController = useController({
610
- name: name,
611
- control: control,
612
- defaultValue: defaultValue
613
- }),
614
- _useController$field = _useController.field,
615
- ref = _useController$field.ref,
616
- inputProps = _objectWithoutProperties(_useController$field, _excluded),
617
- _useController$fieldS = _useController.fieldState,
618
- invalid = _useController$fieldS.invalid,
619
- 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
+
620
638
  React.useEffect(function () {
621
639
  if (defaultValue) {
622
640
  setValue(name, defaultValue);
@@ -646,15 +664,16 @@
646
664
  return props.theme.colors.primary;
647
665
  });
648
666
  var SectionHeading = styled__default.div(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n padding: 5px 10px;\n"])));
667
+
649
668
  var CommunicationPreferenceSection = function CommunicationPreferenceSection(_ref) {
650
669
  var section_heading = _ref.section_heading,
651
- description = _ref.description,
652
- control = _ref.control,
653
- name = _ref.name,
654
- isDisabled = _ref.isDisabled,
655
- options = _ref.options,
656
- defaultValue = _ref.defaultValue,
657
- 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;
658
677
  return /*#__PURE__*/React__default.createElement(SectionContainer, null, /*#__PURE__*/React__default.createElement(SectionHeading, null, section_heading), /*#__PURE__*/React__default.createElement(CommunicationPreferenceOptionsRenderer, {
659
678
  description: description,
660
679
  control: control,
@@ -665,6 +684,7 @@
665
684
  setValue: setValue
666
685
  }));
667
686
  };
687
+
668
688
  var index = themed(CommunicationPreferenceSection);
669
689
 
670
690
  return index;