@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.js CHANGED
@@ -797,7 +797,7 @@ var TooltipElement = function TooltipElement(_ref, forwardedRef) {
797
797
  };
798
798
  var Tooltip = React.forwardRef(TooltipElement);
799
799
 
800
- 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"};
800
+ 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"};
801
801
 
802
802
  var BUTTON_SIZES = {
803
803
  FULL_WIDTH: 'full-width',
@@ -884,36 +884,39 @@ var ButtonComponent = function ButtonComponent(_ref, ref) {
884
884
  var contrastSpinner = [BUTTON_THEMES.PRIMARY, BUTTON_THEMES.DANGER, BUTTON_THEMES.UPSELL, BUTTON_THEMES.MARKETING, BUTTON_THEMES.LINK_CONTRAST];
885
885
  var childrenArr = React.Children.toArray(children);
886
886
  var isIconOnly = childrenArr.length === 1 && typeof childrenArr[0] != 'string';
887
+ var ButtonElementResult = React__default["default"].createElement(ButtonElement, {
888
+ id: id,
889
+ onClick: onClick,
890
+ onMouseEnter: onMouseEnter,
891
+ onMouseLeave: onMouseLeave,
892
+ onBlur: onBlur,
893
+ onFocus: onFocus,
894
+ onKeyDown: onKeyDown,
895
+ className: classnames__default["default"](styles$1g['button'], (_classnames = {}, _classnames[styles$1g['button--default']] = theme === BUTTON_THEMES.DEFAULT, _classnames[styles$1g['button--primary']] = theme === BUTTON_THEMES.PRIMARY, _classnames[styles$1g['button--danger']] = theme === BUTTON_THEMES.DANGER, _classnames[styles$1g['button--upsell']] = theme === BUTTON_THEMES.UPSELL, _classnames[styles$1g['button--marketing']] = theme === BUTTON_THEMES.MARKETING, _classnames[styles$1g['button--hollow']] = theme === BUTTON_THEMES.HOLLOW, _classnames[styles$1g['button--hollow-contrast']] = theme === BUTTON_THEMES.HOLLOW_CONTRAST, _classnames[styles$1g['button--link-primary']] = theme === BUTTON_THEMES.LINK_PRIMARY, _classnames[styles$1g['button--link-danger']] = theme === BUTTON_THEMES.LINK_DANGER, _classnames[styles$1g['button--link-upsell']] = theme === BUTTON_THEMES.LINK_UPSELL, _classnames[styles$1g['button--link-toolbar']] = theme === BUTTON_THEMES.LINK_TOOLBAR, _classnames[styles$1g['button--link-contrast']] = theme === BUTTON_THEMES.LINK_CONTRAST, _classnames[styles$1g['button--link-icon']] = theme === BUTTON_THEMES.LINK_ICON, _classnames[styles$1g['button--loading']] = loading, _classnames[styles$1g['button--icon-only']] = isIconOnly, _classnames[styles$1g['button--size-min-width-100']] = size === BUTTON_SIZES.MIN_WIDTH_100, _classnames[styles$1g['button--size-full-width']] = size === BUTTON_SIZES.FULL_WIDTH, _classnames)),
896
+ type: type,
897
+ disabled: disabled || loading,
898
+ href: href,
899
+ ref: ref,
900
+ target: target,
901
+ "data-testid": testId,
902
+ position: positionProps,
903
+ dataProps: dataProps
904
+ }, React__default["default"].createElement(Inline, {
905
+ space: 8,
906
+ alignItems: "center"
907
+ }, children), loading && React__default["default"].createElement("div", {
908
+ className: styles$1g['button__spinner']
909
+ }, React__default["default"].createElement(Spinner, {
910
+ theme: contrastSpinner.includes(theme) ? SPINNER_THEMES.CONTRAST : SPINNER_THEMES.DISABLED
911
+ })));
887
912
  return (
888
913
  // The ref is passed here as the Tooltip component passes down a new ref to the Button component
889
914
  React__default["default"].createElement(Tooltip, {
890
915
  overlay: title,
891
916
  ref: ref
892
- }, React__default["default"].createElement(ButtonElement, {
893
- id: id,
894
- onClick: onClick,
895
- onMouseEnter: onMouseEnter,
896
- onMouseLeave: onMouseLeave,
897
- onBlur: onBlur,
898
- onFocus: onFocus,
899
- onKeyDown: onKeyDown,
900
- className: classnames__default["default"](styles$1g['button'], (_classnames = {}, _classnames[styles$1g['button--default']] = theme === BUTTON_THEMES.DEFAULT, _classnames[styles$1g['button--primary']] = theme === BUTTON_THEMES.PRIMARY, _classnames[styles$1g['button--danger']] = theme === BUTTON_THEMES.DANGER, _classnames[styles$1g['button--upsell']] = theme === BUTTON_THEMES.UPSELL, _classnames[styles$1g['button--marketing']] = theme === BUTTON_THEMES.MARKETING, _classnames[styles$1g['button--hollow']] = theme === BUTTON_THEMES.HOLLOW, _classnames[styles$1g['button--hollow-contrast']] = theme === BUTTON_THEMES.HOLLOW_CONTRAST, _classnames[styles$1g['button--link-primary']] = theme === BUTTON_THEMES.LINK_PRIMARY, _classnames[styles$1g['button--link-danger']] = theme === BUTTON_THEMES.LINK_DANGER, _classnames[styles$1g['button--link-upsell']] = theme === BUTTON_THEMES.LINK_UPSELL, _classnames[styles$1g['button--link-toolbar']] = theme === BUTTON_THEMES.LINK_TOOLBAR, _classnames[styles$1g['button--link-contrast']] = theme === BUTTON_THEMES.LINK_CONTRAST, _classnames[styles$1g['button--link-icon']] = theme === BUTTON_THEMES.LINK_ICON, _classnames[styles$1g['button--loading']] = loading, _classnames[styles$1g['button--icon-only']] = isIconOnly, _classnames[styles$1g['button--size-min-width-100']] = size === BUTTON_SIZES.MIN_WIDTH_100, _classnames[styles$1g['button--size-full-width']] = size === BUTTON_SIZES.FULL_WIDTH, _classnames)),
901
- type: type,
902
- disabled: disabled || loading,
903
- href: href,
904
- ref: ref,
905
- target: target,
906
- "data-testid": testId,
907
- position: positionProps,
908
- dataProps: dataProps
909
- }, React__default["default"].createElement(Inline, {
910
- space: 8,
911
- alignItems: "center"
912
- }, children), loading && React__default["default"].createElement("div", {
913
- className: styles$1g['button__spinner']
914
- }, React__default["default"].createElement(Spinner, {
915
- theme: contrastSpinner.includes(theme) ? SPINNER_THEMES.CONTRAST : SPINNER_THEMES.DISABLED
916
- }))))
917
+ }, title && disabled ? React__default["default"].createElement("div", {
918
+ className: styles$1g['disabled-button-wrapper']
919
+ }, ButtonElementResult) : ButtonElementResult)
917
920
  );
918
921
  };
919
922
  var ButtonElement = React.forwardRef(function (_ref2, ref) {