@7shifts/sous-chef 3.71.0 → 3.72.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 +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +29 -26
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +47 -44
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -767,7 +767,7 @@ const TooltipElement = ({
|
|
|
767
767
|
};
|
|
768
768
|
const Tooltip = forwardRef(TooltipElement);
|
|
769
769
|
|
|
770
|
-
var styles$1g = {"button":"_pgOR3","button--loading":"_2yB9-","button__spinner":"_ppC-S","button--size-min-width-100":"_GtXOQ","button--size-full-width":"_Y-OxO","button--icon-only":"_3EfuT","button--default":"_ICNz7","button--primary":"_XwJWT","button--danger":"_gr3Dh","button--upsell":"_ME8te","button--marketing":"_mI-Dx","button--hollow":"_orywo","button--hollow-contrast":"_obtsl","button--link-contrast":"_00jK4","button--link-primary":"_JPwJ7","button--link-danger":"_9TprN","button--link-upsell":"_tktX-","button--link-toolbar":"_r3SQl","button--link-icon":"_oFBLN"};
|
|
770
|
+
var styles$1g = {"button":"_pgOR3","button--loading":"_2yB9-","button__spinner":"_ppC-S","button--size-min-width-100":"_GtXOQ","button--size-full-width":"_Y-OxO","button--icon-only":"_3EfuT","button--default":"_ICNz7","button--primary":"_XwJWT","button--danger":"_gr3Dh","button--upsell":"_ME8te","button--marketing":"_mI-Dx","button--hollow":"_orywo","button--hollow-contrast":"_obtsl","button--link-contrast":"_00jK4","button--link-primary":"_JPwJ7","button--link-danger":"_9TprN","button--link-upsell":"_tktX-","button--link-toolbar":"_r3SQl","button--link-icon":"_oFBLN","disabled-button-wrapper":"_yTBTz"};
|
|
771
771
|
|
|
772
772
|
const BUTTON_SIZES = {
|
|
773
773
|
FULL_WIDTH: 'full-width',
|
|
@@ -854,54 +854,57 @@ const ButtonComponent = (_ref, ref) => {
|
|
|
854
854
|
const contrastSpinner = [BUTTON_THEMES.PRIMARY, BUTTON_THEMES.DANGER, BUTTON_THEMES.UPSELL, BUTTON_THEMES.MARKETING, BUTTON_THEMES.LINK_CONTRAST];
|
|
855
855
|
const childrenArr = Children.toArray(children);
|
|
856
856
|
const isIconOnly = childrenArr.length === 1 && typeof childrenArr[0] != 'string';
|
|
857
|
+
const ButtonElementResult = React__default.createElement(ButtonElement, {
|
|
858
|
+
id: id,
|
|
859
|
+
onClick: onClick,
|
|
860
|
+
onMouseEnter: onMouseEnter,
|
|
861
|
+
onMouseLeave: onMouseLeave,
|
|
862
|
+
onBlur: onBlur,
|
|
863
|
+
onFocus: onFocus,
|
|
864
|
+
onKeyDown: onKeyDown,
|
|
865
|
+
className: classnames(styles$1g['button'], {
|
|
866
|
+
[styles$1g['button--default']]: theme === BUTTON_THEMES.DEFAULT,
|
|
867
|
+
[styles$1g['button--primary']]: theme === BUTTON_THEMES.PRIMARY,
|
|
868
|
+
[styles$1g['button--danger']]: theme === BUTTON_THEMES.DANGER,
|
|
869
|
+
[styles$1g['button--upsell']]: theme === BUTTON_THEMES.UPSELL,
|
|
870
|
+
[styles$1g['button--marketing']]: theme === BUTTON_THEMES.MARKETING,
|
|
871
|
+
[styles$1g['button--hollow']]: theme === BUTTON_THEMES.HOLLOW,
|
|
872
|
+
[styles$1g['button--hollow-contrast']]: theme === BUTTON_THEMES.HOLLOW_CONTRAST,
|
|
873
|
+
[styles$1g['button--link-primary']]: theme === BUTTON_THEMES.LINK_PRIMARY,
|
|
874
|
+
[styles$1g['button--link-danger']]: theme === BUTTON_THEMES.LINK_DANGER,
|
|
875
|
+
[styles$1g['button--link-upsell']]: theme === BUTTON_THEMES.LINK_UPSELL,
|
|
876
|
+
[styles$1g['button--link-toolbar']]: theme === BUTTON_THEMES.LINK_TOOLBAR,
|
|
877
|
+
[styles$1g['button--link-contrast']]: theme === BUTTON_THEMES.LINK_CONTRAST,
|
|
878
|
+
[styles$1g['button--link-icon']]: theme === BUTTON_THEMES.LINK_ICON,
|
|
879
|
+
[styles$1g['button--loading']]: loading,
|
|
880
|
+
[styles$1g['button--icon-only']]: isIconOnly,
|
|
881
|
+
[styles$1g['button--size-min-width-100']]: size === BUTTON_SIZES.MIN_WIDTH_100,
|
|
882
|
+
[styles$1g['button--size-full-width']]: size === BUTTON_SIZES.FULL_WIDTH
|
|
883
|
+
}),
|
|
884
|
+
type: type,
|
|
885
|
+
disabled: disabled || loading,
|
|
886
|
+
href: href,
|
|
887
|
+
ref: ref,
|
|
888
|
+
target: target,
|
|
889
|
+
"data-testid": testId,
|
|
890
|
+
position: positionProps,
|
|
891
|
+
dataProps: dataProps
|
|
892
|
+
}, React__default.createElement(Inline, {
|
|
893
|
+
space: 8,
|
|
894
|
+
alignItems: "center"
|
|
895
|
+
}, children), loading && React__default.createElement("div", {
|
|
896
|
+
className: styles$1g['button__spinner']
|
|
897
|
+
}, React__default.createElement(Spinner, {
|
|
898
|
+
theme: contrastSpinner.includes(theme) ? SPINNER_THEMES.CONTRAST : SPINNER_THEMES.DISABLED
|
|
899
|
+
})));
|
|
857
900
|
return (
|
|
858
901
|
// The ref is passed here as the Tooltip component passes down a new ref to the Button component
|
|
859
902
|
React__default.createElement(Tooltip, {
|
|
860
903
|
overlay: title,
|
|
861
904
|
ref: ref
|
|
862
|
-
}, React__default.createElement(
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
onMouseEnter: onMouseEnter,
|
|
866
|
-
onMouseLeave: onMouseLeave,
|
|
867
|
-
onBlur: onBlur,
|
|
868
|
-
onFocus: onFocus,
|
|
869
|
-
onKeyDown: onKeyDown,
|
|
870
|
-
className: classnames(styles$1g['button'], {
|
|
871
|
-
[styles$1g['button--default']]: theme === BUTTON_THEMES.DEFAULT,
|
|
872
|
-
[styles$1g['button--primary']]: theme === BUTTON_THEMES.PRIMARY,
|
|
873
|
-
[styles$1g['button--danger']]: theme === BUTTON_THEMES.DANGER,
|
|
874
|
-
[styles$1g['button--upsell']]: theme === BUTTON_THEMES.UPSELL,
|
|
875
|
-
[styles$1g['button--marketing']]: theme === BUTTON_THEMES.MARKETING,
|
|
876
|
-
[styles$1g['button--hollow']]: theme === BUTTON_THEMES.HOLLOW,
|
|
877
|
-
[styles$1g['button--hollow-contrast']]: theme === BUTTON_THEMES.HOLLOW_CONTRAST,
|
|
878
|
-
[styles$1g['button--link-primary']]: theme === BUTTON_THEMES.LINK_PRIMARY,
|
|
879
|
-
[styles$1g['button--link-danger']]: theme === BUTTON_THEMES.LINK_DANGER,
|
|
880
|
-
[styles$1g['button--link-upsell']]: theme === BUTTON_THEMES.LINK_UPSELL,
|
|
881
|
-
[styles$1g['button--link-toolbar']]: theme === BUTTON_THEMES.LINK_TOOLBAR,
|
|
882
|
-
[styles$1g['button--link-contrast']]: theme === BUTTON_THEMES.LINK_CONTRAST,
|
|
883
|
-
[styles$1g['button--link-icon']]: theme === BUTTON_THEMES.LINK_ICON,
|
|
884
|
-
[styles$1g['button--loading']]: loading,
|
|
885
|
-
[styles$1g['button--icon-only']]: isIconOnly,
|
|
886
|
-
[styles$1g['button--size-min-width-100']]: size === BUTTON_SIZES.MIN_WIDTH_100,
|
|
887
|
-
[styles$1g['button--size-full-width']]: size === BUTTON_SIZES.FULL_WIDTH
|
|
888
|
-
}),
|
|
889
|
-
type: type,
|
|
890
|
-
disabled: disabled || loading,
|
|
891
|
-
href: href,
|
|
892
|
-
ref: ref,
|
|
893
|
-
target: target,
|
|
894
|
-
"data-testid": testId,
|
|
895
|
-
position: positionProps,
|
|
896
|
-
dataProps: dataProps
|
|
897
|
-
}, React__default.createElement(Inline, {
|
|
898
|
-
space: 8,
|
|
899
|
-
alignItems: "center"
|
|
900
|
-
}, children), loading && React__default.createElement("div", {
|
|
901
|
-
className: styles$1g['button__spinner']
|
|
902
|
-
}, React__default.createElement(Spinner, {
|
|
903
|
-
theme: contrastSpinner.includes(theme) ? SPINNER_THEMES.CONTRAST : SPINNER_THEMES.DISABLED
|
|
904
|
-
}))))
|
|
905
|
+
}, title && disabled ? React__default.createElement("div", {
|
|
906
|
+
className: styles$1g['disabled-button-wrapper']
|
|
907
|
+
}, ButtonElementResult) : ButtonElementResult)
|
|
905
908
|
);
|
|
906
909
|
};
|
|
907
910
|
const ButtonElement = forwardRef((_ref2, ref) => {
|