@7shifts/sous-chef 3.60.0 → 3.61.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.css +7 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +20 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13646,7 +13646,7 @@ var CHIP_THEME = {
|
|
|
13646
13646
|
DANGER: 'danger'
|
|
13647
13647
|
};
|
|
13648
13648
|
|
|
13649
|
-
var styles$4 = {"chip":"_Cg5Nf","chip--marketing":"_b60R5","chip--success":"_ItVyo","chip--upsell":"_iUCAH","chip--warning":"_RbXoR","chip--info":"_NiP9z","chip--danger":"_2ltep"};
|
|
13649
|
+
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
13650
|
|
|
13651
13651
|
var Chip = function Chip(_ref) {
|
|
13652
13652
|
var _classnames;
|
|
@@ -13654,10 +13654,28 @@ var Chip = function Chip(_ref) {
|
|
|
13654
13654
|
_ref$theme = _ref.theme,
|
|
13655
13655
|
theme = _ref$theme === void 0 ? CHIP_THEME.MARKETING : _ref$theme,
|
|
13656
13656
|
testId = _ref.testId;
|
|
13657
|
+
var formattedChildren = React__default["default"].Children.map(children, function (child) {
|
|
13658
|
+
if (React__default["default"].isValidElement(child)) {
|
|
13659
|
+
return updateIconSize(child);
|
|
13660
|
+
}
|
|
13661
|
+
return child;
|
|
13662
|
+
});
|
|
13657
13663
|
return React__default["default"].createElement("div", {
|
|
13658
13664
|
"data-testid": testId,
|
|
13659
13665
|
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
|
-
},
|
|
13666
|
+
}, React__default["default"].createElement("div", {
|
|
13667
|
+
className: styles$4['chip__children']
|
|
13668
|
+
}, formattedChildren));
|
|
13669
|
+
};
|
|
13670
|
+
var updateIconSize = function updateIconSize(child) {
|
|
13671
|
+
var _child$type$displayNa, _child$type;
|
|
13672
|
+
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;
|
|
13673
|
+
if (!isIcon) {
|
|
13674
|
+
return child;
|
|
13675
|
+
}
|
|
13676
|
+
return React__default["default"].cloneElement(child, _extends({}, child.props, {
|
|
13677
|
+
size: "small"
|
|
13678
|
+
}));
|
|
13661
13679
|
};
|
|
13662
13680
|
|
|
13663
13681
|
var styles$3 = {"pill":"_vOTWZ","pill--default":"_j2h8A","pill--success":"_lFih-","pill--danger":"_sLhtK","pill--warning":"_DKrCl","pill--info":"_8TTGV","pill--upsell":"_0-TG8"};
|