@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.modern.js
CHANGED
|
@@ -13714,13 +13714,19 @@ const CHIP_THEME = {
|
|
|
13714
13714
|
DANGER: 'danger'
|
|
13715
13715
|
};
|
|
13716
13716
|
|
|
13717
|
-
var styles$4 = {"chip":"_Cg5Nf","chip--marketing":"_b60R5","chip--success":"_ItVyo","chip--upsell":"_iUCAH","chip--warning":"_RbXoR","chip--info":"_NiP9z","chip--danger":"_2ltep"};
|
|
13717
|
+
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"};
|
|
13718
13718
|
|
|
13719
13719
|
const Chip = ({
|
|
13720
13720
|
children,
|
|
13721
13721
|
theme: _theme = CHIP_THEME.MARKETING,
|
|
13722
13722
|
testId
|
|
13723
13723
|
}) => {
|
|
13724
|
+
const formattedChildren = React__default.Children.map(children, child => {
|
|
13725
|
+
if (React__default.isValidElement(child)) {
|
|
13726
|
+
return updateIconSize(child);
|
|
13727
|
+
}
|
|
13728
|
+
return child;
|
|
13729
|
+
});
|
|
13724
13730
|
return React__default.createElement("div", {
|
|
13725
13731
|
"data-testid": testId,
|
|
13726
13732
|
className: classnames(styles$4['chip'], {
|
|
@@ -13731,7 +13737,19 @@ const Chip = ({
|
|
|
13731
13737
|
[styles$4['chip--info']]: _theme === CHIP_THEME.INFO,
|
|
13732
13738
|
[styles$4['chip--danger']]: _theme === CHIP_THEME.DANGER
|
|
13733
13739
|
})
|
|
13734
|
-
},
|
|
13740
|
+
}, React__default.createElement("div", {
|
|
13741
|
+
className: styles$4['chip__children']
|
|
13742
|
+
}, formattedChildren));
|
|
13743
|
+
};
|
|
13744
|
+
const updateIconSize = child => {
|
|
13745
|
+
var _child$type$displayNa, _child$type;
|
|
13746
|
+
const 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;
|
|
13747
|
+
if (!isIcon) {
|
|
13748
|
+
return child;
|
|
13749
|
+
}
|
|
13750
|
+
return React__default.cloneElement(child, _extends({}, child.props, {
|
|
13751
|
+
size: "small"
|
|
13752
|
+
}));
|
|
13735
13753
|
};
|
|
13736
13754
|
|
|
13737
13755
|
var styles$3 = {"pill":"_vOTWZ","pill--default":"_j2h8A","pill--success":"_lFih-","pill--danger":"_sLhtK","pill--warning":"_DKrCl","pill--info":"_8TTGV","pill--upsell":"_0-TG8"};
|