@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
@@ -8,38 +8,66 @@
8
8
  styled = styled && Object.prototype.hasOwnProperty.call(styled, 'default') ? 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
  }
@@ -108,50 +136,18 @@
108
136
 
109
137
  var isUndefined = (val) => val === undefined;
110
138
 
111
- var get = (object, path, defaultValue) => {
112
- if (!path || !isObject(object)) {
139
+ var get = (obj, path, defaultValue) => {
140
+ if (!path || !isObject(obj)) {
113
141
  return defaultValue;
114
142
  }
115
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
116
- return isUndefined(result) || result === object
117
- ? isUndefined(object[path])
143
+ const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
144
+ return isUndefined(result) || result === obj
145
+ ? isUndefined(obj[path])
118
146
  ? defaultValue
119
- : object[path]
147
+ : obj[path]
120
148
  : result;
121
149
  };
122
150
 
123
- var isBoolean = (value) => typeof value === 'boolean';
124
-
125
- var isKey = (value) => /^\w*$/.test(value);
126
-
127
- var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
128
-
129
- var set = (object, path, value) => {
130
- let index = -1;
131
- const tempPath = isKey(path) ? [path] : stringToPath(path);
132
- const length = tempPath.length;
133
- const lastIndex = length - 1;
134
- while (++index < length) {
135
- const key = tempPath[index];
136
- let newValue = value;
137
- if (index !== lastIndex) {
138
- const objValue = object[key];
139
- newValue =
140
- isObject(objValue) || Array.isArray(objValue)
141
- ? objValue
142
- : !isNaN(+tempPath[index + 1])
143
- ? []
144
- : {};
145
- }
146
- if (key === '__proto__') {
147
- return;
148
- }
149
- object[key] = newValue;
150
- object = object[key];
151
- }
152
- return object;
153
- };
154
-
155
151
  const EVENTS = {
156
152
  BLUR: 'blur',
157
153
  FOCUS_OUT: 'focusout',
@@ -230,13 +226,15 @@
230
226
 
231
227
  var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
232
228
 
233
- var shouldSubscribeByName = (name, signalName, exact) => !name ||
234
- !signalName ||
235
- name === signalName ||
236
- convertToArrayPayload(name).some((currentName) => currentName &&
237
- (exact
238
- ? currentName === signalName
239
- : currentName.startsWith(signalName) ||
229
+ var shouldSubscribeByName = (name, signalName, exact) => exact && signalName
230
+ ? name === signalName ||
231
+ (Array.isArray(name) &&
232
+ name.some((currentName) => currentName && exact && currentName === signalName))
233
+ : !name ||
234
+ !signalName ||
235
+ name === signalName ||
236
+ convertToArrayPayload(name).some((currentName) => currentName &&
237
+ (currentName.startsWith(signalName) ||
240
238
  signalName.startsWith(currentName)));
241
239
 
242
240
  function useSubscribe(props) {
@@ -294,7 +292,6 @@
294
292
  isLoading: false,
295
293
  dirtyFields: false,
296
294
  touchedFields: false,
297
- validatingFields: false,
298
295
  isValidating: false,
299
296
  isValid: false,
300
297
  errors: false,
@@ -345,7 +342,7 @@
345
342
  *
346
343
  * @example
347
344
  * ```tsx
348
- * const { control } = useForm();
345
+ * const { watch } = useForm();
349
346
  * const values = useWatch({
350
347
  * name: "fieldName"
351
348
  * control,
@@ -371,6 +368,33 @@
371
368
  return value;
372
369
  }
373
370
 
371
+ var isKey = (value) => /^\w*$/.test(value);
372
+
373
+ var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
374
+
375
+ function set(object, path, value) {
376
+ let index = -1;
377
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
378
+ const length = tempPath.length;
379
+ const lastIndex = length - 1;
380
+ while (++index < length) {
381
+ const key = tempPath[index];
382
+ let newValue = value;
383
+ if (index !== lastIndex) {
384
+ const objValue = object[key];
385
+ newValue =
386
+ isObject(objValue) || Array.isArray(objValue)
387
+ ? objValue
388
+ : !isNaN(+tempPath[index + 1])
389
+ ? []
390
+ : {};
391
+ }
392
+ object[key] = newValue;
393
+ object = object[key];
394
+ }
395
+ return object;
396
+ }
397
+
374
398
  /**
375
399
  * 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.
376
400
  *
@@ -408,18 +432,17 @@
408
432
  const formState = useFormState({
409
433
  control,
410
434
  name,
411
- exact: true,
412
435
  });
413
436
  const _registerProps = React__default.useRef(control.register(name, {
414
437
  ...props.rules,
415
438
  value,
416
- ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
417
439
  }));
440
+ _registerProps.current = control.register(name, props.rules);
418
441
  React__default.useEffect(() => {
419
442
  const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
420
443
  const updateMounted = (name, value) => {
421
444
  const field = get(control._fields, name);
422
- if (field && field._f) {
445
+ if (field) {
423
446
  field._f.mount = value;
424
447
  }
425
448
  };
@@ -440,22 +463,17 @@
440
463
  };
441
464
  }, [name, control, isArrayField, shouldUnregister]);
442
465
  React__default.useEffect(() => {
443
- if (get(control._fields, name)) {
444
- control._updateDisabledField({
445
- disabled,
446
- fields: control._fields,
447
- name,
448
- value: get(control._fields, name)._f.value,
449
- });
450
- }
466
+ control._updateDisabledField({
467
+ disabled,
468
+ fields: control._fields,
469
+ name,
470
+ });
451
471
  }, [disabled, name, control]);
452
472
  return {
453
473
  field: {
454
474
  name,
455
475
  value,
456
- ...(isBoolean(disabled) || formState.disabled
457
- ? { disabled: formState.disabled || disabled }
458
- : {}),
476
+ disabled,
459
477
  onChange: React__default.useCallback((event) => _registerProps.current.onChange({
460
478
  target: {
461
479
  value: getEventValue(event),
@@ -470,7 +488,7 @@
470
488
  },
471
489
  type: EVENTS.BLUR,
472
490
  }), [name, control]),
473
- ref: React__default.useCallback((elm) => {
491
+ ref: (elm) => {
474
492
  const field = get(control._fields, name);
475
493
  if (field && elm) {
476
494
  field._f.ref = {
@@ -480,7 +498,7 @@
480
498
  reportValidity: () => elm.reportValidity(),
481
499
  };
482
500
  }
483
- }, [control._fields, name]),
501
+ },
484
502
  },
485
503
  formState,
486
504
  fieldState: Object.defineProperties({}, {
@@ -496,10 +514,6 @@
496
514
  enumerable: true,
497
515
  get: () => !!get(formState.touchedFields, name),
498
516
  },
499
- isValidating: {
500
- enumerable: true,
501
- get: () => !!get(formState.validatingFields, name),
502
- },
503
517
  error: {
504
518
  enumerable: true,
505
519
  get: () => get(formState.errors, name),
@@ -532,27 +546,31 @@
532
546
  });
533
547
 
534
548
  var _excluded = ["ref"];
549
+
535
550
  var _templateObject$5, _templateObject2;
536
551
  var OptionsRow = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n"])));
537
552
  var Options = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n flex-direction: row;\n flex-basis: 60%;\n"])));
553
+
538
554
  var CommunicationPreferenceOptionsRenderer = function CommunicationPreferenceOptionsRenderer(_ref) {
539
555
  var control = _ref.control,
540
- name = _ref.name,
541
- isDisabled = _ref.isDisabled,
542
- options = _ref.options,
543
- defaultValue = _ref.defaultValue,
544
- setValue = _ref.setValue;
556
+ name = _ref.name,
557
+ isDisabled = _ref.isDisabled,
558
+ options = _ref.options,
559
+ defaultValue = _ref.defaultValue,
560
+ setValue = _ref.setValue;
561
+
545
562
  var _useController = useController({
546
- name: name,
547
- control: control,
548
- defaultValue: defaultValue
549
- }),
550
- _useController$field = _useController.field,
551
- ref = _useController$field.ref,
552
- inputProps = _objectWithoutProperties(_useController$field, _excluded),
553
- _useController$fieldS = _useController.fieldState,
554
- invalid = _useController$fieldS.invalid,
555
- error = _useController$fieldS.error;
563
+ name: name,
564
+ control: control,
565
+ defaultValue: defaultValue
566
+ }),
567
+ _useController$field = _useController.field,
568
+ ref = _useController$field.ref,
569
+ inputProps = _objectWithoutProperties(_useController$field, _excluded),
570
+ _useController$fieldS = _useController.fieldState,
571
+ invalid = _useController$fieldS.invalid,
572
+ error = _useController$fieldS.error;
573
+
556
574
  React.useEffect(function () {
557
575
  if (defaultValue) {
558
576
  setValue(name, defaultValue);