@7shifts/sous-chef 3.60.0 → 3.61.1

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.js CHANGED
@@ -12515,7 +12515,10 @@ var usePhoneFieldControllers = function usePhoneFieldControllers(_ref) {
12515
12515
  }
12516
12516
  };
12517
12517
  var _useState = React.useState(function () {
12518
- return parseMeta(phoneFieldValue || '');
12518
+ var initialValues = parseMeta(phoneFieldValue || '');
12519
+ // We don't want to show the initial parsing error until the value is touched
12520
+ initialValues.parsingError = '';
12521
+ return initialValues;
12519
12522
  }),
12520
12523
  meta = _useState[0],
12521
12524
  setMeta = _useState[1];
@@ -13646,7 +13649,7 @@ var CHIP_THEME = {
13646
13649
  DANGER: 'danger'
13647
13650
  };
13648
13651
 
13649
- var styles$4 = {"chip":"_Cg5Nf","chip--marketing":"_b60R5","chip--success":"_ItVyo","chip--upsell":"_iUCAH","chip--warning":"_RbXoR","chip--info":"_NiP9z","chip--danger":"_2ltep"};
13652
+ var styles$4 = {"chip":"_Cg5Nf","chip__children":"_e3zFF","chip--marketing":"_b60R5","chip--success":"_ItVyo","chip--upsell":"_iUCAH","chip--warning":"_RbXoR","chip--info":"_NiP9z","chip--danger":"_2ltep"};
13650
13653
 
13651
13654
  var Chip = function Chip(_ref) {
13652
13655
  var _classnames;
@@ -13654,10 +13657,28 @@ var Chip = function Chip(_ref) {
13654
13657
  _ref$theme = _ref.theme,
13655
13658
  theme = _ref$theme === void 0 ? CHIP_THEME.MARKETING : _ref$theme,
13656
13659
  testId = _ref.testId;
13660
+ var formattedChildren = React__default["default"].Children.map(children, function (child) {
13661
+ if (React__default["default"].isValidElement(child)) {
13662
+ return updateIconSize(child);
13663
+ }
13664
+ return child;
13665
+ });
13657
13666
  return React__default["default"].createElement("div", {
13658
13667
  "data-testid": testId,
13659
13668
  className: classnames__default["default"](styles$4['chip'], (_classnames = {}, _classnames[styles$4['chip--marketing']] = theme === CHIP_THEME.MARKETING, _classnames[styles$4['chip--success']] = theme === CHIP_THEME.SUCCESS, _classnames[styles$4['chip--upsell']] = theme === CHIP_THEME.UPSELL, _classnames[styles$4['chip--warning']] = theme === CHIP_THEME.WARNING, _classnames[styles$4['chip--info']] = theme === CHIP_THEME.INFO, _classnames[styles$4['chip--danger']] = theme === CHIP_THEME.DANGER, _classnames))
13660
- }, children);
13669
+ }, React__default["default"].createElement("div", {
13670
+ className: styles$4['chip__children']
13671
+ }, formattedChildren));
13672
+ };
13673
+ var updateIconSize = function updateIconSize(child) {
13674
+ var _child$type$displayNa, _child$type;
13675
+ var isIcon = (_child$type$displayNa = (_child$type = child.type) == null || (_child$type = _child$type.displayName) == null ? void 0 : _child$type.startsWith('Icon')) != null ? _child$type$displayNa : false;
13676
+ if (!isIcon) {
13677
+ return child;
13678
+ }
13679
+ return React__default["default"].cloneElement(child, _extends({}, child.props, {
13680
+ size: "small"
13681
+ }));
13661
13682
  };
13662
13683
 
13663
13684
  var styles$3 = {"pill":"_vOTWZ","pill--default":"_j2h8A","pill--success":"_lFih-","pill--danger":"_sLhtK","pill--warning":"_DKrCl","pill--info":"_8TTGV","pill--upsell":"_0-TG8"};