@moda/om 17.2.1 → 17.4.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/dist/index.esm.js CHANGED
@@ -1286,14 +1286,15 @@ var classnames = {exports: {}};
1286
1286
  }
1287
1287
  }
1288
1288
  } else if (argType === 'object') {
1289
- if (arg.toString === Object.prototype.toString) {
1290
- for (var key in arg) {
1291
- if (hasOwn.call(arg, key) && arg[key]) {
1292
- classes.push(key);
1293
- }
1294
- }
1295
- } else {
1289
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
1296
1290
  classes.push(arg.toString());
1291
+ continue;
1292
+ }
1293
+
1294
+ for (var key in arg) {
1295
+ if (hasOwn.call(arg, key) && arg[key]) {
1296
+ classes.push(key);
1297
+ }
1297
1298
  }
1298
1299
  }
1299
1300
  }
@@ -1583,9 +1584,6 @@ function useMergeRefs(refs, defaultValue) {
1583
1584
  });
1584
1585
  }
1585
1586
 
1586
- // Only Node.JS has a process variable that is of [[Class]] process
1587
- Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
1588
-
1589
1587
  function ItoI(a) {
1590
1588
  return a;
1591
1589
  }
@@ -3385,6 +3383,7 @@ FocusLock.defaultProps = {
3385
3383
  onActivation: undefined,
3386
3384
  onDeactivation: undefined
3387
3385
  };
3386
+ var FocusLockUI = FocusLock;
3388
3387
 
3389
3388
  function deferAction(action) {
3390
3389
  // Hidding setImmediate from Webpack to avoid inserting polyfill
@@ -3398,28 +3397,9 @@ function deferAction(action) {
3398
3397
  }
3399
3398
  }
3400
3399
 
3401
- process.env.NODE_ENV !== "production" ? {
3402
- children: propTypes.exports.node.isRequired,
3403
- disabled: propTypes.exports.bool,
3404
- className: propTypes.exports.string
3405
- } : {};
3406
-
3407
- process.env.NODE_ENV !== "production" ? {
3408
- children: propTypes.exports.node.isRequired,
3409
- disabled: propTypes.exports.bool,
3410
- className: propTypes.exports.string
3411
- } : {};
3412
-
3413
- process.env.NODE_ENV !== "production" ? {
3414
- children: propTypes.exports.node.isRequired,
3415
- className: propTypes.exports.string
3416
- } : {};
3417
-
3418
3400
  var effectCar = createSidecarMedium();
3419
3401
  var focusHiddenMarker = 'data-focus-on-hidden';
3420
3402
 
3421
- _assign({}, RemoveScroll.classNames);
3422
-
3423
3403
  var FocusOn$1 = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
3424
3404
  var _a = React.useState(false),
3425
3405
  lockProps = _a[0],
@@ -3461,7 +3441,7 @@ var FocusOn$1 = /*#__PURE__*/React.forwardRef(function (props, parentRef) {
3461
3441
  enabled: enabled && scrollLock
3462
3442
  });
3463
3443
 
3464
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FocusLock, {
3444
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FocusLockUI, {
3465
3445
  ref: parentRef,
3466
3446
  sideCar: sideCar,
3467
3447
  disabled: !(lockProps && enabled && focusLock),
@@ -4277,6 +4257,8 @@ var setFocus = function setFocus(topNode, lastNode, options) {
4277
4257
  }
4278
4258
  };
4279
4259
 
4260
+ var moveFocusInside = setFocus; //
4261
+
4280
4262
  /* eslint-disable no-mixed-operators */
4281
4263
 
4282
4264
  var focusOnBody = function focusOnBody() {
@@ -4395,7 +4377,7 @@ var activateTrap = function activateTrap() {
4395
4377
 
4396
4378
  document.body.focus();
4397
4379
  } else {
4398
- result = setFocus(workingArea, lastActiveFocus, {
4380
+ result = moveFocusInside(workingArea, lastActiveFocus, {
4399
4381
  focusOptions: focusOptions
4400
4382
  });
4401
4383
  lastPortaledElement = {};
@@ -4535,7 +4517,7 @@ mediumFocus.assignSyncMedium(onFocus);
4535
4517
  mediumBlur.assignMedium(onBlur);
4536
4518
  mediumEffect.assignMedium(function (cb) {
4537
4519
  return cb({
4538
- moveFocusInside: setFocus,
4520
+ moveFocusInside: moveFocusInside,
4539
4521
  focusInside: focusInside
4540
4522
  });
4541
4523
  });
@@ -5929,6 +5911,7 @@ var SKU_COLORS = {
5929
5911
  'rose gold': '#b76e79',
5930
5912
  'royal blue': '#0049ff',
5931
5913
  animal: undefined,
5914
+ berry: '#8f1e47',
5932
5915
  black: '#000',
5933
5916
  blue: '#3755a4',
5934
5917
  bronze: '#cd7f2e',
@@ -5959,7 +5942,9 @@ var SKU_COLORS = {
5959
5942
  silver: '#c0c0c0',
5960
5943
  stripe: undefined,
5961
5944
  tan: '#baa094',
5945
+ taupe: '#483c32',
5962
5946
  turquoise: '#1e83a8',
5947
+ universal: undefined,
5963
5948
  white: '#fff',
5964
5949
  yellow: '#ffca44'
5965
5950
  };
@@ -9572,6 +9557,8 @@ var T = function T() {
9572
9557
  return true;
9573
9558
  };
9574
9559
 
9560
+ var otherwise = T;
9561
+
9575
9562
  function _isPlaceholder(a) {
9576
9563
  return a != null && _typeof(a) === 'object' && a['@@functional/placeholder'] === true;
9577
9564
  }
@@ -10732,6 +10719,8 @@ var cond = /*#__PURE__*/_curry1(function cond(pairs) {
10732
10719
  });
10733
10720
  });
10734
10721
 
10722
+ var cond$1 = cond;
10723
+
10735
10724
  var _Set = /*#__PURE__*/function () {
10736
10725
  function _Set() {
10737
10726
  /* globals Set */
@@ -11009,6 +10998,7 @@ var uniqBy = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable([], _xuniqBy, func
11009
10998
  */
11010
10999
 
11011
11000
  var uniq = /*#__PURE__*/uniqBy(identity);
11001
+ var uniq$1 = uniq;
11012
11002
 
11013
11003
  function _isNumber(x) {
11014
11004
  return Object.prototype.toString.call(x) === '[object Number]';
@@ -11047,6 +11037,8 @@ var range = /*#__PURE__*/_curry2(function range(from, to) {
11047
11037
  return result;
11048
11038
  });
11049
11039
 
11040
+ var range$1 = range;
11041
+
11050
11042
  var __assign$2 = undefined && undefined.__assign || function () {
11051
11043
  __assign$2 = Object.assign || function (t) {
11052
11044
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -11147,7 +11139,7 @@ var MultiSelect = function MultiSelect(_ref) {
11147
11139
  dispatch({
11148
11140
  type: 'SELECT',
11149
11141
  payload: {
11150
- value: uniq([].concat(_toConsumableArray(values), [option.value]))
11142
+ value: uniq$1([].concat(_toConsumableArray(values), [option.value]))
11151
11143
  }
11152
11144
  });
11153
11145
  }, [dispatch, values]);
@@ -11348,7 +11340,7 @@ var DefinitionList = function DefinitionList(_ref) {
11348
11340
  }, rest), /*#__PURE__*/React__default.createElement("dt", null, term), /*#__PURE__*/React__default.createElement("dd", null, children));
11349
11341
  };
11350
11342
 
11351
- var _excluded$f = ["name", "children", "className", "virtual", "icon", "data-testid", "defaultExpanded", "expanded", "onToggle"];
11343
+ var _excluded$f = ["name", "children", "className", "virtual", "icon", "data-testid", "defaultExpanded", "expanded", "onToggle", "background", "border"];
11352
11344
  var Expandable = function Expandable(_ref) {
11353
11345
  var name = _ref.name,
11354
11346
  children = _ref.children,
@@ -11362,6 +11354,10 @@ var Expandable = function Expandable(_ref) {
11362
11354
  defaultExpanded = _ref$defaultExpanded === void 0 ? false : _ref$defaultExpanded,
11363
11355
  __expanded__ = _ref.expanded,
11364
11356
  onToggle = _ref.onToggle,
11357
+ _ref$background = _ref.background,
11358
+ background = _ref$background === void 0 ? 'light' : _ref$background,
11359
+ _ref$border = _ref.border,
11360
+ border = _ref$border === void 0 ? true : _ref$border,
11365
11361
  rest = _objectWithoutProperties(_ref, _excluded$f);
11366
11362
 
11367
11363
  var _useState = useState(defaultExpanded),
@@ -11379,13 +11375,13 @@ var Expandable = function Expandable(_ref) {
11379
11375
  onToggle === null || onToggle === void 0 ? void 0 : onToggle();
11380
11376
  }, [onToggle]);
11381
11377
  return /*#__PURE__*/React__default.createElement("div", _extends$1({
11382
- className: classNames('Expandable', {
11383
- 'Expandable--expanded': expanded
11378
+ className: classNames('Expandable', "Expandable--".concat(background, "-background"), {
11379
+ 'Expandable--expanded': expanded,
11380
+ 'Expandable--with-border': border,
11381
+ 'Expandable--plus-minus': icon === 'plus-minus'
11384
11382
  }, className)
11385
11383
  }, rest), /*#__PURE__*/React__default.createElement(Clickable, {
11386
- className: classNames('Expandable__name', {
11387
- 'Expandable__name--plusMinus': icon === 'plus-minus'
11388
- }),
11384
+ className: "Expandable__name",
11389
11385
  onClick: handleClick,
11390
11386
  "data-testid": dataTestId
11391
11387
  }, name, icon !== 'plus-minus' && /*#__PURE__*/React__default.createElement("div", {
@@ -11908,23 +11904,23 @@ var whenCurrentPageIsGreaterThanHalfTheTotal = function whenCurrentPageIsGreater
11908
11904
  };
11909
11905
 
11910
11906
  var showAllPages = function showAllPages(_, totalPages) {
11911
- return range(1, totalPages + 1);
11907
+ return range$1(1, totalPages + 1);
11912
11908
  };
11913
11909
 
11914
11910
  var showFirstNPagesAndLastPage = function showFirstNPagesAndLastPage(_, totalPages, maxPages) {
11915
- return [].concat(_toConsumableArray(range(1, maxPages)), [totalPages]);
11911
+ return [].concat(_toConsumableArray(range$1(1, maxPages)), [totalPages]);
11916
11912
  };
11917
11913
 
11918
11914
  var showTheLastNPages = function showTheLastNPages(_, totalPages, maxPages) {
11919
- return [1].concat(_toConsumableArray(range(totalPages - maxPages + 2, totalPages + 1)));
11915
+ return [1].concat(_toConsumableArray(range$1(totalPages - maxPages + 2, totalPages + 1)));
11920
11916
  };
11921
11917
 
11922
11918
  var showAGroupOfPagesCenteredOnTheCurrentPage = function showAGroupOfPagesCenteredOnTheCurrentPage(page, totalPages, maxPages) {
11923
11919
  var diff = Math.floor((maxPages - 2) / 2);
11924
- return [1].concat(_toConsumableArray(range(page - diff, page + diff + 1)), [totalPages]);
11920
+ return [1].concat(_toConsumableArray(range$1(page - diff, page + diff + 1)), [totalPages]);
11925
11921
  };
11926
11922
 
11927
- var determinePagesToShow = cond([[whenThereAreFewerPagesThanWeDisplay, showAllPages], [whenCurrentPageIsLessThanHalfTheTotal, showFirstNPagesAndLastPage], [whenCurrentPageIsGreaterThanHalfTheTotal, showTheLastNPages], [T, showAGroupOfPagesCenteredOnTheCurrentPage]]);
11923
+ var determinePagesToShow = cond$1([[whenThereAreFewerPagesThanWeDisplay, showAllPages], [whenCurrentPageIsLessThanHalfTheTotal, showFirstNPagesAndLastPage], [whenCurrentPageIsGreaterThanHalfTheTotal, showTheLastNPages], [otherwise, showAGroupOfPagesCenteredOnTheCurrentPage]]);
11928
11924
  var Paginator = function Paginator(_ref) {
11929
11925
  var selectedPage = _ref.selectedPage,
11930
11926
  totalPages = _ref.totalPages,