@moda/om 19.4.3 → 19.6.0

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.
package/README.md CHANGED
@@ -7,10 +7,10 @@ Moda Operandi's design system expressed as React components.
7
7
  ## Meta
8
8
 
9
9
  - **State**: development
10
- - **Point people**: [@jmcriffey](https://github.com/jmcriffey)
10
+ - **Point people**: Ecommerce Team
11
11
  - **URLS**:
12
12
  - **Documentation**: https://moda-om-documentation.netlify.com/
13
- - **Storybook**: https://moda-om-storybook.netlify.com/
13
+ - **Storybook**: https://moda-om-storybook.netlify.app/
14
14
 
15
15
  ## Developing
16
16
 
@@ -69,6 +69,12 @@ Once you want to commit something, `git add` it then run the commitizen CLI. If
69
69
 
70
70
  When you're happy push to a feature branch and once the code is in `main`, semantic release will detect how to version it and automatically publish it to NPM.
71
71
 
72
+ - **Netlify deploy config** is located here: https://app.netlify.com/sites/moda-om-storybook/configuration/deploys
73
+
74
+ - **Netlify site overview**: https://app.netlify.com/sites/moda-om-storybook/overview
75
+
76
+ (settings specified in netlify.toml override any corresponding settings in the Netlify UI)
77
+
72
78
  ## Usage
73
79
 
74
80
  ### Getting Started
package/dist/index.cjs.js CHANGED
@@ -1035,7 +1035,7 @@ function _arrayWithoutHoles(r) {
1035
1035
  function _createForOfIteratorHelper(r, e) {
1036
1036
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1037
1037
  if (!t) {
1038
- if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
1038
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
1039
1039
  t && (r = t);
1040
1040
  var n = 0,
1041
1041
  F = function () {};
@@ -1163,8 +1163,8 @@ function _objectWithoutProperties(e, t) {
1163
1163
  r,
1164
1164
  i = _objectWithoutPropertiesLoose(e, t);
1165
1165
  if (Object.getOwnPropertySymbols) {
1166
- var n = Object.getOwnPropertySymbols(e);
1167
- for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1166
+ var s = Object.getOwnPropertySymbols(e);
1167
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1168
1168
  }
1169
1169
  return i;
1170
1170
  }
@@ -1172,7 +1172,7 @@ function _objectWithoutPropertiesLoose(r, e) {
1172
1172
  if (null == r) return {};
1173
1173
  var t = {};
1174
1174
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
1175
- if (e.indexOf(n) >= 0) continue;
1175
+ if (e.includes(n)) continue;
1176
1176
  t[n] = r[n];
1177
1177
  }
1178
1178
  return t;
@@ -3344,24 +3344,24 @@ var isInert = function isInert(node) {
3344
3344
  var isVisibleUncached = function isVisibleUncached(node, checkParent) {
3345
3345
  return !node || isTopNode(node) || !isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node));
3346
3346
  };
3347
- var isVisibleCached = function isVisibleCached(visibilityCache, node) {
3347
+ var _isVisibleCached = function isVisibleCached(visibilityCache, node) {
3348
3348
  var cached = visibilityCache.get(node);
3349
3349
  if (cached !== undefined) {
3350
3350
  return cached;
3351
3351
  }
3352
- var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));
3352
+ var result = isVisibleUncached(node, _isVisibleCached.bind(undefined, visibilityCache));
3353
3353
  visibilityCache.set(node, result);
3354
3354
  return result;
3355
3355
  };
3356
3356
  var isAutoFocusAllowedUncached = function isAutoFocusAllowedUncached(node, checkParent) {
3357
3357
  return node && !isTopNode(node) ? isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false : true;
3358
3358
  };
3359
- var isAutoFocusAllowedCached = function isAutoFocusAllowedCached(cache, node) {
3359
+ var _isAutoFocusAllowedCached = function isAutoFocusAllowedCached(cache, node) {
3360
3360
  var cached = cache.get(node);
3361
3361
  if (cached !== undefined) {
3362
3362
  return cached;
3363
3363
  }
3364
- var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));
3364
+ var result = isAutoFocusAllowedUncached(node, _isAutoFocusAllowedCached.bind(undefined, cache));
3365
3365
  cache.set(node, result);
3366
3366
  return result;
3367
3367
  };
@@ -3445,9 +3445,9 @@ var tabbables = ['button:enabled', 'select:enabled', 'textarea:enabled', 'input:
3445
3445
 
3446
3446
  var queryTabbables = tabbables.join(',');
3447
3447
  var queryGuardTabbables = "".concat(queryTabbables, ", [data-focus-guard]");
3448
- var getFocusablesWithShadowDom = function getFocusablesWithShadowDom(parent, withGuards) {
3448
+ var _getFocusablesWithShadowDom = function getFocusablesWithShadowDom(parent, withGuards) {
3449
3449
  return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {
3450
- return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));
3450
+ return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], _getFocusablesWithShadowDom(child));
3451
3451
  }, []);
3452
3452
  };
3453
3453
  var getFocusablesWithIFrame = function getFocusablesWithIFrame(parent, withGuards) {
@@ -3461,7 +3461,7 @@ var getFocusablesWithIFrame = function getFocusablesWithIFrame(parent, withGuard
3461
3461
  var getFocusables = function getFocusables(parents, withGuards) {
3462
3462
  return parents.reduce(function (acc, parent) {
3463
3463
  var _a;
3464
- var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);
3464
+ var focusableWithShadowDom = _getFocusablesWithShadowDom(parent, withGuards);
3465
3465
  var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) {
3466
3466
  return getFocusablesWithIFrame(node, withGuards);
3467
3467
  }));
@@ -3494,7 +3494,7 @@ var getParentAutofocusables = function getParentAutofocusables(parent) {
3494
3494
  */
3495
3495
  var filterFocusable = function filterFocusable(nodes, visibilityCache) {
3496
3496
  return toArray(nodes).filter(function (node) {
3497
- return isVisibleCached(visibilityCache, node);
3497
+ return _isVisibleCached(visibilityCache, node);
3498
3498
  }).filter(function (node) {
3499
3499
  return notHiddenInput(node);
3500
3500
  });
@@ -3504,7 +3504,7 @@ var filterAutoFocusable = function filterAutoFocusable(nodes, cache) {
3504
3504
  cache = new Map();
3505
3505
  }
3506
3506
  return toArray(nodes).filter(function (node) {
3507
- return isAutoFocusAllowedCached(cache, node);
3507
+ return _isAutoFocusAllowedCached(cache, node);
3508
3508
  });
3509
3509
  };
3510
3510
  /**
@@ -3544,9 +3544,9 @@ var parentAutofocusables = function parentAutofocusables(topNode, visibilityCach
3544
3544
  /*
3545
3545
  * Determines if element is contained in scope, including nested shadow DOMs
3546
3546
  */
3547
- var contains$1 = function contains(scope, element) {
3547
+ var _contains = function contains(scope, element) {
3548
3548
  if (scope.shadowRoot) {
3549
- return contains(scope.shadowRoot, element);
3549
+ return _contains(scope.shadowRoot, element);
3550
3550
  } else {
3551
3551
  if (Object.getPrototypeOf(scope).contains !== undefined && Object.getPrototypeOf(scope).contains.call(scope, element)) {
3552
3552
  return true;
@@ -3556,11 +3556,11 @@ var contains$1 = function contains(scope, element) {
3556
3556
  if (child instanceof HTMLIFrameElement) {
3557
3557
  var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;
3558
3558
  if (iframeBody) {
3559
- return contains(iframeBody, element);
3559
+ return _contains(iframeBody, element);
3560
3560
  }
3561
3561
  return false;
3562
3562
  }
3563
- return contains(child, element);
3563
+ return _contains(child, element);
3564
3564
  });
3565
3565
  }
3566
3566
  };
@@ -3597,8 +3597,8 @@ var filterNested = function filterNested(nodes) {
3597
3597
  * @param node
3598
3598
  * @returns {*}
3599
3599
  */
3600
- var getTopParent = function getTopParent(node) {
3601
- return node.parentNode ? getTopParent(node.parentNode) : node;
3600
+ var _getTopParent = function getTopParent(node) {
3601
+ return node.parentNode ? _getTopParent(node.parentNode) : node;
3602
3602
  };
3603
3603
  /**
3604
3604
  * returns all "focus containers" inside a given node
@@ -3609,7 +3609,7 @@ var getAllAffectedNodes = function getAllAffectedNodes(node) {
3609
3609
  var nodes = asArray(node);
3610
3610
  return nodes.filter(Boolean).reduce(function (acc, currentNode) {
3611
3611
  var group = currentNode.getAttribute(FOCUS_GROUP);
3612
- acc.push.apply(acc, group ? filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, "=\"").concat(group, "\"]:not([").concat(FOCUS_DISABLED, "=\"disabled\"])")))) : [currentNode]);
3612
+ acc.push.apply(acc, group ? filterNested(toArray(_getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, "=\"").concat(group, "\"]:not([").concat(FOCUS_DISABLED, "=\"disabled\"])")))) : [currentNode]);
3613
3613
  return acc;
3614
3614
  }, []);
3615
3615
  };
@@ -3629,7 +3629,7 @@ var safeProbe = function safeProbe(cb) {
3629
3629
  * returns current active element. If the active element is a "container" itself(shadowRoot or iframe) returns active element inside it
3630
3630
  * @param [inDocument]
3631
3631
  */
3632
- var getActiveElement = function getActiveElement(inDocument) {
3632
+ var _getActiveElement = function getActiveElement(inDocument) {
3633
3633
  if (inDocument === void 0) {
3634
3634
  inDocument = document;
3635
3635
  }
@@ -3637,9 +3637,9 @@ var getActiveElement = function getActiveElement(inDocument) {
3637
3637
  return undefined;
3638
3638
  }
3639
3639
  var activeElement = inDocument.activeElement;
3640
- return activeElement.shadowRoot ? getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function () {
3640
+ return activeElement.shadowRoot ? _getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function () {
3641
3641
  return activeElement.contentWindow.document;
3642
- }) ? getActiveElement(activeElement.contentWindow.document) : activeElement;
3642
+ }) ? _getActiveElement(activeElement.contentWindow.document) : activeElement;
3643
3643
  };
3644
3644
 
3645
3645
  var focusInFrame = function focusInFrame(frame, activeElement) {
@@ -3657,13 +3657,13 @@ var focusInsideIframe = function focusInsideIframe(topNode, activeElement) {
3657
3657
  var focusInside = function focusInside(topNode, activeElement) {
3658
3658
  // const activeElement = document && getActiveElement();
3659
3659
  if (activeElement === void 0) {
3660
- activeElement = getActiveElement(getFirst(topNode).ownerDocument);
3660
+ activeElement = _getActiveElement(getFirst(topNode).ownerDocument);
3661
3661
  }
3662
3662
  if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) {
3663
3663
  return false;
3664
3664
  }
3665
3665
  return getAllAffectedNodes(topNode).some(function (node) {
3666
- return contains$1(node, activeElement) || focusInsideIframe(node, activeElement);
3666
+ return _contains(node, activeElement) || focusInsideIframe(node, activeElement);
3667
3667
  });
3668
3668
  };
3669
3669
 
@@ -3679,13 +3679,13 @@ var focusIsHidden = function focusIsHidden(inDocument) {
3679
3679
  if (inDocument === void 0) {
3680
3680
  inDocument = document;
3681
3681
  }
3682
- var activeElement = getActiveElement(inDocument);
3682
+ var activeElement = _getActiveElement(inDocument);
3683
3683
  if (!activeElement) {
3684
3684
  return false;
3685
3685
  }
3686
3686
  // this does not support setting FOCUS_ALLOW within shadow dom
3687
3687
  return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) {
3688
- return contains$1(node, activeElement);
3688
+ return _contains(node, activeElement);
3689
3689
  });
3690
3690
  };
3691
3691
 
@@ -3838,13 +3838,13 @@ var pickAutofocus = function pickAutofocus(nodesIndexes, orderedNodes, groups) {
3838
3838
  return pickFirstFocus(filterAutoFocusable(orderedNodes));
3839
3839
  };
3840
3840
 
3841
- var getParents = function getParents(node, parents) {
3841
+ var _getParents = function getParents(node, parents) {
3842
3842
  if (parents === void 0) {
3843
3843
  parents = [];
3844
3844
  }
3845
3845
  parents.push(node);
3846
3846
  if (node.parentNode) {
3847
- getParents(node.parentNode.host || node.parentNode, parents);
3847
+ _getParents(node.parentNode.host || node.parentNode, parents);
3848
3848
  }
3849
3849
  return parents;
3850
3850
  };
@@ -3855,8 +3855,8 @@ var getParents = function getParents(node, parents) {
3855
3855
  * @returns {boolean|*}
3856
3856
  */
3857
3857
  var getCommonParent = function getCommonParent(nodeA, nodeB) {
3858
- var parentsA = getParents(nodeA);
3859
- var parentsB = getParents(nodeB);
3858
+ var parentsA = _getParents(nodeA);
3859
+ var parentsB = _getParents(nodeB);
3860
3860
  // tslint:disable-next-line:prefer-for-of
3861
3861
  for (var i = 0; i < parentsA.length; i += 1) {
3862
3862
  var currentParent = parentsA[i];
@@ -3876,7 +3876,7 @@ var getTopCommonParent = function getTopCommonParent(baseActiveElement, leftEntr
3876
3876
  rightEntries.filter(Boolean).forEach(function (subEntry) {
3877
3877
  var common = getCommonParent(activeElement, subEntry);
3878
3878
  if (common) {
3879
- if (!topCommon || contains$1(common, topCommon)) {
3879
+ if (!topCommon || _contains(common, topCommon)) {
3880
3880
  topCommon = common;
3881
3881
  } else {
3882
3882
  topCommon = getCommonParent(common, topCommon);
@@ -3920,7 +3920,7 @@ var reorderNodes = function reorderNodes(srcNodes, dstNodes) {
3920
3920
  * @param lastNode
3921
3921
  */
3922
3922
  var focusSolver = function focusSolver(topNode, lastNode) {
3923
- var activeElement = getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
3923
+ var activeElement = _getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
3924
3924
  var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
3925
3925
  var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);
3926
3926
  var visibilityCache = new Map();
@@ -4153,7 +4153,7 @@ var getRelativeFocusable = function getRelativeFocusable(element, scope, useTabb
4153
4153
  }
4154
4154
  var shards = asArray(scope);
4155
4155
  if (shards.every(function (shard) {
4156
- return !contains$1(shard, element);
4156
+ return !_contains(shard, element);
4157
4157
  })) {
4158
4158
  console.error('Active element is not contained in the scope');
4159
4159
  return {};
@@ -4769,9 +4769,9 @@ var handleScroll = function handleScroll(axis, endTarget, event, sourceDelta, no
4769
4769
  // self content
4770
4770
  targetInLock && (endTarget.contains(target) || endTarget === target));
4771
4771
  // handle epsilon around 0 (non standard zoom levels)
4772
- if (isDeltaPositive && (Math.abs(availableScroll) < 1 || !noOverscroll )) {
4772
+ if (isDeltaPositive && (Math.abs(availableScroll) < 1 || !noOverscroll)) {
4773
4773
  shouldCancelScroll = true;
4774
- } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || !noOverscroll )) {
4774
+ } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || !noOverscroll)) {
4775
4775
  shouldCancelScroll = true;
4776
4776
  }
4777
4777
  return shouldCancelScroll;
@@ -4965,15 +4965,15 @@ var counterMap = new WeakMap();
4965
4965
  var uncontrolledNodes = new WeakMap();
4966
4966
  var markerMap = {};
4967
4967
  var lockCount = 0;
4968
- var unwrapHost = function unwrapHost(node) {
4969
- return node && (node.host || unwrapHost(node.parentNode));
4968
+ var _unwrapHost = function unwrapHost(node) {
4969
+ return node && (node.host || _unwrapHost(node.parentNode));
4970
4970
  };
4971
4971
  var correctTargets = function correctTargets(parent, targets) {
4972
4972
  return targets.map(function (target) {
4973
4973
  if (parent.contains(target)) {
4974
4974
  return target;
4975
4975
  }
4976
- var correctedTarget = unwrapHost(target);
4976
+ var correctedTarget = _unwrapHost(target);
4977
4977
  if (correctedTarget && parent.contains(correctedTarget)) {
4978
4978
  return correctedTarget;
4979
4979
  }
@@ -5000,21 +5000,21 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
5000
5000
  var hiddenNodes = [];
5001
5001
  var elementsToKeep = new Set();
5002
5002
  var elementsToStop = new Set(targets);
5003
- var keep = function keep(el) {
5003
+ var _keep = function keep(el) {
5004
5004
  if (!el || elementsToKeep.has(el)) {
5005
5005
  return;
5006
5006
  }
5007
5007
  elementsToKeep.add(el);
5008
- keep(el.parentNode);
5008
+ _keep(el.parentNode);
5009
5009
  };
5010
- targets.forEach(keep);
5011
- var deep = function deep(parent) {
5010
+ targets.forEach(_keep);
5011
+ var _deep = function deep(parent) {
5012
5012
  if (!parent || elementsToStop.has(parent)) {
5013
5013
  return;
5014
5014
  }
5015
5015
  Array.prototype.forEach.call(parent.children, function (node) {
5016
5016
  if (elementsToKeep.has(node)) {
5017
- deep(node);
5017
+ _deep(node);
5018
5018
  } else {
5019
5019
  var attr = node.getAttribute(controlAttribute);
5020
5020
  var alreadyHidden = attr !== null && attr !== 'false';
@@ -5035,7 +5035,7 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
5035
5035
  }
5036
5036
  });
5037
5037
  };
5038
- deep(parentNode);
5038
+ _deep(parentNode);
5039
5039
  elementsToKeep.clear();
5040
5040
  lockCount++;
5041
5041
  return function () {
@@ -5499,12 +5499,8 @@ var T = function T() {
5499
5499
  return true;
5500
5500
  };
5501
5501
 
5502
- var _placeholder = {
5503
- '@@functional/placeholder': true
5504
- };
5505
-
5506
5502
  function _isPlaceholder(a) {
5507
- return a === _placeholder;
5503
+ return a != null && _typeof$1(a) === 'object' && a['@@functional/placeholder'] === true;
5508
5504
  }
5509
5505
 
5510
5506
  /**
@@ -10166,7 +10162,7 @@ var Search20 = function Search20(_a) {
10166
10162
  };
10167
10163
  Search20.displayName = 'Search20';
10168
10164
 
10169
- var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "value"];
10165
+ var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value"];
10170
10166
  var DEFAULT_INPUT_VALUE = '';
10171
10167
  var SearchInput = function SearchInput(_ref) {
10172
10168
  var className = _ref.className,
@@ -10174,6 +10170,8 @@ var SearchInput = function SearchInput(_ref) {
10174
10170
  onClear = _ref.onClear,
10175
10171
  _ref$roundBorders = _ref.roundBorders,
10176
10172
  roundBorders = _ref$roundBorders === void 0 ? false : _ref$roundBorders,
10173
+ _ref$noBorders = _ref.noBorders,
10174
+ noBorders = _ref$noBorders === void 0 ? false : _ref$noBorders,
10177
10175
  _ref$value = _ref.value,
10178
10176
  value = _ref$value === void 0 ? DEFAULT_INPUT_VALUE : _ref$value,
10179
10177
  rest = _objectWithoutProperties(_ref, _excluded$l);
@@ -10202,7 +10200,8 @@ var SearchInput = function SearchInput(_ref) {
10202
10200
  className: "SearchInput__icon"
10203
10201
  }, /*#__PURE__*/React.createElement(Search20, null)), /*#__PURE__*/React.createElement(TextInput, _extends$1({
10204
10202
  className: classNames('SearchInput__input', {
10205
- 'SearchInput__input--round-borders': roundBorders
10203
+ 'SearchInput__input--round-borders': roundBorders,
10204
+ 'SearchInput__input--no-borders': noBorders
10206
10205
  }),
10207
10206
  onChange: handleChange,
10208
10207
  value: controlledValue,