@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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [17.4.0](https://github.com/ModaOperandi/om/compare/v17.3.0...v17.4.0) (2022-09-27)
7
+
8
+
9
+ ### Features
10
+
11
+ * **expandable:** dark background ([#2934](https://github.com/ModaOperandi/om/issues/2934)) ([8fb3bf3](https://github.com/ModaOperandi/om/commit/8fb3bf3fab3fccd3cbc53332438771bddca1c801))
12
+
13
+ # [17.3.0](https://github.com/ModaOperandi/om/compare/v17.2.1...v17.3.0) (2022-08-23)
14
+
15
+
16
+ ### Features
17
+
18
+ * **colorswatch:** add new colors ([#2854](https://github.com/ModaOperandi/om/issues/2854)) ([a087080](https://github.com/ModaOperandi/om/commit/a0870807d284aab16815673720dca147a895fa09))
19
+
6
20
  ## [17.2.1](https://github.com/ModaOperandi/om/compare/v17.2.0...v17.2.1) (2022-08-22)
7
21
 
8
22
 
package/dist/index.cjs.js CHANGED
@@ -1313,14 +1313,15 @@ var classnames = {exports: {}};
1313
1313
  }
1314
1314
  }
1315
1315
  } else if (argType === 'object') {
1316
- if (arg.toString === Object.prototype.toString) {
1317
- for (var key in arg) {
1318
- if (hasOwn.call(arg, key) && arg[key]) {
1319
- classes.push(key);
1320
- }
1321
- }
1322
- } else {
1316
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
1323
1317
  classes.push(arg.toString());
1318
+ continue;
1319
+ }
1320
+
1321
+ for (var key in arg) {
1322
+ if (hasOwn.call(arg, key) && arg[key]) {
1323
+ classes.push(key);
1324
+ }
1324
1325
  }
1325
1326
  }
1326
1327
  }
@@ -1610,9 +1611,6 @@ function useMergeRefs(refs, defaultValue) {
1610
1611
  });
1611
1612
  }
1612
1613
 
1613
- // Only Node.JS has a process variable that is of [[Class]] process
1614
- Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
1615
-
1616
1614
  function ItoI(a) {
1617
1615
  return a;
1618
1616
  }
@@ -3412,6 +3410,7 @@ FocusLock.defaultProps = {
3412
3410
  onActivation: undefined,
3413
3411
  onDeactivation: undefined
3414
3412
  };
3413
+ var FocusLockUI = FocusLock;
3415
3414
 
3416
3415
  function deferAction(action) {
3417
3416
  // Hidding setImmediate from Webpack to avoid inserting polyfill
@@ -3425,28 +3424,9 @@ function deferAction(action) {
3425
3424
  }
3426
3425
  }
3427
3426
 
3428
- process.env.NODE_ENV !== "production" ? {
3429
- children: propTypes.exports.node.isRequired,
3430
- disabled: propTypes.exports.bool,
3431
- className: propTypes.exports.string
3432
- } : {};
3433
-
3434
- process.env.NODE_ENV !== "production" ? {
3435
- children: propTypes.exports.node.isRequired,
3436
- disabled: propTypes.exports.bool,
3437
- className: propTypes.exports.string
3438
- } : {};
3439
-
3440
- process.env.NODE_ENV !== "production" ? {
3441
- children: propTypes.exports.node.isRequired,
3442
- className: propTypes.exports.string
3443
- } : {};
3444
-
3445
3427
  var effectCar = createSidecarMedium();
3446
3428
  var focusHiddenMarker = 'data-focus-on-hidden';
3447
3429
 
3448
- _assign({}, RemoveScroll.classNames);
3449
-
3450
3430
  var FocusOn$1 = /*#__PURE__*/React__namespace.forwardRef(function (props, parentRef) {
3451
3431
  var _a = React__namespace.useState(false),
3452
3432
  lockProps = _a[0],
@@ -3488,7 +3468,7 @@ var FocusOn$1 = /*#__PURE__*/React__namespace.forwardRef(function (props, parent
3488
3468
  enabled: enabled && scrollLock
3489
3469
  });
3490
3470
 
3491
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(FocusLock, {
3471
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(FocusLockUI, {
3492
3472
  ref: parentRef,
3493
3473
  sideCar: sideCar,
3494
3474
  disabled: !(lockProps && enabled && focusLock),
@@ -4304,6 +4284,8 @@ var setFocus = function setFocus(topNode, lastNode, options) {
4304
4284
  }
4305
4285
  };
4306
4286
 
4287
+ var moveFocusInside = setFocus; //
4288
+
4307
4289
  /* eslint-disable no-mixed-operators */
4308
4290
 
4309
4291
  var focusOnBody = function focusOnBody() {
@@ -4422,7 +4404,7 @@ var activateTrap = function activateTrap() {
4422
4404
 
4423
4405
  document.body.focus();
4424
4406
  } else {
4425
- result = setFocus(workingArea, lastActiveFocus, {
4407
+ result = moveFocusInside(workingArea, lastActiveFocus, {
4426
4408
  focusOptions: focusOptions
4427
4409
  });
4428
4410
  lastPortaledElement = {};
@@ -4562,7 +4544,7 @@ mediumFocus.assignSyncMedium(onFocus);
4562
4544
  mediumBlur.assignMedium(onBlur);
4563
4545
  mediumEffect.assignMedium(function (cb) {
4564
4546
  return cb({
4565
- moveFocusInside: setFocus,
4547
+ moveFocusInside: moveFocusInside,
4566
4548
  focusInside: focusInside
4567
4549
  });
4568
4550
  });
@@ -5956,6 +5938,7 @@ var SKU_COLORS = {
5956
5938
  'rose gold': '#b76e79',
5957
5939
  'royal blue': '#0049ff',
5958
5940
  animal: undefined,
5941
+ berry: '#8f1e47',
5959
5942
  black: '#000',
5960
5943
  blue: '#3755a4',
5961
5944
  bronze: '#cd7f2e',
@@ -5986,7 +5969,9 @@ var SKU_COLORS = {
5986
5969
  silver: '#c0c0c0',
5987
5970
  stripe: undefined,
5988
5971
  tan: '#baa094',
5972
+ taupe: '#483c32',
5989
5973
  turquoise: '#1e83a8',
5974
+ universal: undefined,
5990
5975
  white: '#fff',
5991
5976
  yellow: '#ffca44'
5992
5977
  };
@@ -9599,6 +9584,8 @@ var T = function T() {
9599
9584
  return true;
9600
9585
  };
9601
9586
 
9587
+ var otherwise = T;
9588
+
9602
9589
  function _isPlaceholder(a) {
9603
9590
  return a != null && _typeof(a) === 'object' && a['@@functional/placeholder'] === true;
9604
9591
  }
@@ -10759,6 +10746,8 @@ var cond = /*#__PURE__*/_curry1(function cond(pairs) {
10759
10746
  });
10760
10747
  });
10761
10748
 
10749
+ var cond$1 = cond;
10750
+
10762
10751
  var _Set = /*#__PURE__*/function () {
10763
10752
  function _Set() {
10764
10753
  /* globals Set */
@@ -11036,6 +11025,7 @@ var uniqBy = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable([], _xuniqBy, func
11036
11025
  */
11037
11026
 
11038
11027
  var uniq = /*#__PURE__*/uniqBy(identity);
11028
+ var uniq$1 = uniq;
11039
11029
 
11040
11030
  function _isNumber(x) {
11041
11031
  return Object.prototype.toString.call(x) === '[object Number]';
@@ -11074,6 +11064,8 @@ var range = /*#__PURE__*/_curry2(function range(from, to) {
11074
11064
  return result;
11075
11065
  });
11076
11066
 
11067
+ var range$1 = range;
11068
+
11077
11069
  var __assign$2 = undefined && undefined.__assign || function () {
11078
11070
  __assign$2 = Object.assign || function (t) {
11079
11071
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -11174,7 +11166,7 @@ var MultiSelect = function MultiSelect(_ref) {
11174
11166
  dispatch({
11175
11167
  type: 'SELECT',
11176
11168
  payload: {
11177
- value: uniq([].concat(_toConsumableArray(values), [option.value]))
11169
+ value: uniq$1([].concat(_toConsumableArray(values), [option.value]))
11178
11170
  }
11179
11171
  });
11180
11172
  }, [dispatch, values]);
@@ -11375,7 +11367,7 @@ var DefinitionList = function DefinitionList(_ref) {
11375
11367
  }, rest), /*#__PURE__*/React__default["default"].createElement("dt", null, term), /*#__PURE__*/React__default["default"].createElement("dd", null, children));
11376
11368
  };
11377
11369
 
11378
- var _excluded$f = ["name", "children", "className", "virtual", "icon", "data-testid", "defaultExpanded", "expanded", "onToggle"];
11370
+ var _excluded$f = ["name", "children", "className", "virtual", "icon", "data-testid", "defaultExpanded", "expanded", "onToggle", "background", "border"];
11379
11371
  var Expandable = function Expandable(_ref) {
11380
11372
  var name = _ref.name,
11381
11373
  children = _ref.children,
@@ -11389,6 +11381,10 @@ var Expandable = function Expandable(_ref) {
11389
11381
  defaultExpanded = _ref$defaultExpanded === void 0 ? false : _ref$defaultExpanded,
11390
11382
  __expanded__ = _ref.expanded,
11391
11383
  onToggle = _ref.onToggle,
11384
+ _ref$background = _ref.background,
11385
+ background = _ref$background === void 0 ? 'light' : _ref$background,
11386
+ _ref$border = _ref.border,
11387
+ border = _ref$border === void 0 ? true : _ref$border,
11392
11388
  rest = _objectWithoutProperties(_ref, _excluded$f);
11393
11389
 
11394
11390
  var _useState = React.useState(defaultExpanded),
@@ -11406,13 +11402,13 @@ var Expandable = function Expandable(_ref) {
11406
11402
  onToggle === null || onToggle === void 0 ? void 0 : onToggle();
11407
11403
  }, [onToggle]);
11408
11404
  return /*#__PURE__*/React__default["default"].createElement("div", _extends$1({
11409
- className: classNames('Expandable', {
11410
- 'Expandable--expanded': expanded
11405
+ className: classNames('Expandable', "Expandable--".concat(background, "-background"), {
11406
+ 'Expandable--expanded': expanded,
11407
+ 'Expandable--with-border': border,
11408
+ 'Expandable--plus-minus': icon === 'plus-minus'
11411
11409
  }, className)
11412
11410
  }, rest), /*#__PURE__*/React__default["default"].createElement(Clickable, {
11413
- className: classNames('Expandable__name', {
11414
- 'Expandable__name--plusMinus': icon === 'plus-minus'
11415
- }),
11411
+ className: "Expandable__name",
11416
11412
  onClick: handleClick,
11417
11413
  "data-testid": dataTestId
11418
11414
  }, name, icon !== 'plus-minus' && /*#__PURE__*/React__default["default"].createElement("div", {
@@ -11935,23 +11931,23 @@ var whenCurrentPageIsGreaterThanHalfTheTotal = function whenCurrentPageIsGreater
11935
11931
  };
11936
11932
 
11937
11933
  var showAllPages = function showAllPages(_, totalPages) {
11938
- return range(1, totalPages + 1);
11934
+ return range$1(1, totalPages + 1);
11939
11935
  };
11940
11936
 
11941
11937
  var showFirstNPagesAndLastPage = function showFirstNPagesAndLastPage(_, totalPages, maxPages) {
11942
- return [].concat(_toConsumableArray(range(1, maxPages)), [totalPages]);
11938
+ return [].concat(_toConsumableArray(range$1(1, maxPages)), [totalPages]);
11943
11939
  };
11944
11940
 
11945
11941
  var showTheLastNPages = function showTheLastNPages(_, totalPages, maxPages) {
11946
- return [1].concat(_toConsumableArray(range(totalPages - maxPages + 2, totalPages + 1)));
11942
+ return [1].concat(_toConsumableArray(range$1(totalPages - maxPages + 2, totalPages + 1)));
11947
11943
  };
11948
11944
 
11949
11945
  var showAGroupOfPagesCenteredOnTheCurrentPage = function showAGroupOfPagesCenteredOnTheCurrentPage(page, totalPages, maxPages) {
11950
11946
  var diff = Math.floor((maxPages - 2) / 2);
11951
- return [1].concat(_toConsumableArray(range(page - diff, page + diff + 1)), [totalPages]);
11947
+ return [1].concat(_toConsumableArray(range$1(page - diff, page + diff + 1)), [totalPages]);
11952
11948
  };
11953
11949
 
11954
- var determinePagesToShow = cond([[whenThereAreFewerPagesThanWeDisplay, showAllPages], [whenCurrentPageIsLessThanHalfTheTotal, showFirstNPagesAndLastPage], [whenCurrentPageIsGreaterThanHalfTheTotal, showTheLastNPages], [T, showAGroupOfPagesCenteredOnTheCurrentPage]]);
11950
+ var determinePagesToShow = cond$1([[whenThereAreFewerPagesThanWeDisplay, showAllPages], [whenCurrentPageIsLessThanHalfTheTotal, showFirstNPagesAndLastPage], [whenCurrentPageIsGreaterThanHalfTheTotal, showTheLastNPages], [otherwise, showAGroupOfPagesCenteredOnTheCurrentPage]]);
11955
11951
  var Paginator = function Paginator(_ref) {
11956
11952
  var selectedPage = _ref.selectedPage,
11957
11953
  totalPages = _ref.totalPages,