@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.css +7 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +26 -3
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -12578,7 +12578,12 @@ const usePhoneFieldControllers = ({
|
|
|
12578
12578
|
};
|
|
12579
12579
|
}
|
|
12580
12580
|
};
|
|
12581
|
-
const [meta, setMeta] = useState(() =>
|
|
12581
|
+
const [meta, setMeta] = useState(() => {
|
|
12582
|
+
const initialValues = parseMeta(phoneFieldValue || '');
|
|
12583
|
+
// We don't want to show the initial parsing error until the value is touched
|
|
12584
|
+
initialValues.parsingError = '';
|
|
12585
|
+
return initialValues;
|
|
12586
|
+
});
|
|
12582
12587
|
let controllers = {
|
|
12583
12588
|
id,
|
|
12584
12589
|
error: error || meta.parsingError,
|
|
@@ -13714,13 +13719,19 @@ const CHIP_THEME = {
|
|
|
13714
13719
|
DANGER: 'danger'
|
|
13715
13720
|
};
|
|
13716
13721
|
|
|
13717
|
-
var styles$4 = {"chip":"_Cg5Nf","chip--marketing":"_b60R5","chip--success":"_ItVyo","chip--upsell":"_iUCAH","chip--warning":"_RbXoR","chip--info":"_NiP9z","chip--danger":"_2ltep"};
|
|
13722
|
+
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
13723
|
|
|
13719
13724
|
const Chip = ({
|
|
13720
13725
|
children,
|
|
13721
13726
|
theme: _theme = CHIP_THEME.MARKETING,
|
|
13722
13727
|
testId
|
|
13723
13728
|
}) => {
|
|
13729
|
+
const formattedChildren = React__default.Children.map(children, child => {
|
|
13730
|
+
if (React__default.isValidElement(child)) {
|
|
13731
|
+
return updateIconSize(child);
|
|
13732
|
+
}
|
|
13733
|
+
return child;
|
|
13734
|
+
});
|
|
13724
13735
|
return React__default.createElement("div", {
|
|
13725
13736
|
"data-testid": testId,
|
|
13726
13737
|
className: classnames(styles$4['chip'], {
|
|
@@ -13731,7 +13742,19 @@ const Chip = ({
|
|
|
13731
13742
|
[styles$4['chip--info']]: _theme === CHIP_THEME.INFO,
|
|
13732
13743
|
[styles$4['chip--danger']]: _theme === CHIP_THEME.DANGER
|
|
13733
13744
|
})
|
|
13734
|
-
},
|
|
13745
|
+
}, React__default.createElement("div", {
|
|
13746
|
+
className: styles$4['chip__children']
|
|
13747
|
+
}, formattedChildren));
|
|
13748
|
+
};
|
|
13749
|
+
const updateIconSize = child => {
|
|
13750
|
+
var _child$type$displayNa, _child$type;
|
|
13751
|
+
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;
|
|
13752
|
+
if (!isIcon) {
|
|
13753
|
+
return child;
|
|
13754
|
+
}
|
|
13755
|
+
return React__default.cloneElement(child, _extends({}, child.props, {
|
|
13756
|
+
size: "small"
|
|
13757
|
+
}));
|
|
13735
13758
|
};
|
|
13736
13759
|
|
|
13737
13760
|
var styles$3 = {"pill":"_vOTWZ","pill--default":"_j2h8A","pill--success":"_lFih-","pill--danger":"_sLhtK","pill--warning":"_DKrCl","pill--info":"_8TTGV","pill--upsell":"_0-TG8"};
|