@uifabric/experiments
Version:
Experimental React components for building experiences for Microsoft 365.
73 lines • 2.95 kB
JavaScript
// Temporary import file to experiment with next version of foundation.
import { composed } from '@uifabric/foundation/lib/next/composed';
import { useButtonState as state } from '../Button.state';
import { ButtonStyles as styles } from '../Button.styles';
import { ButtonSlots as slots, ButtonView as view } from '../Button.view';
/* eslint-disable deprecation/deprecation */
var baseTokens = function (props, theme) {
var palette = theme.palette, semanticColors = theme.semanticColors;
return {
backgroundColor: palette.white,
backgroundColorHovered: palette.neutralLighter,
backgroundColorPressed: semanticColors.buttonBackgroundPressed,
borderRadius: 0,
borderWidth: 0,
childrenGap: 8,
contentPadding: '0px 8px',
color: semanticColors.buttonText,
colorHovered: semanticColors.buttonTextHovered,
colorPressed: semanticColors.buttonTextPressed,
cursor: 'pointer',
highContrastBorderColor: 'transparent',
highContrastBorderColorHovered: 'transparent',
highContrastBorderColorPressed: 'transparent',
highContrastColorHovered: 'Highlight',
highContrastColorPressed: 'Highlight',
highContrastIconColorHovered: 'Highlight',
highContrastIconColorPressed: 'Highlight',
iconColor: semanticColors.buttonText,
iconColorHovered: palette.themeDarkAlt,
iconColorPressed: palette.themeDark,
minHeight: 0,
minWidth: 40,
textWeight: 'normal',
};
};
var disabledTokens = function (props, theme) {
var palette = theme.palette, semanticColors = theme.semanticColors;
return {
backgroundColor: palette.white,
backgroundColorHovered: palette.white,
backgroundColorPressed: palette.white,
color: semanticColors.buttonTextDisabled,
colorHovered: semanticColors.buttonTextDisabled,
colorPressed: semanticColors.buttonTextDisabled,
cursor: 'default',
highContrastColor: 'GrayText',
highContrastColorHovered: 'GrayText',
highContrastColorPressed: 'GrayText',
highContrastIconColor: 'GrayText',
highContrastIconColorHovered: 'GrayText',
highContrastIconColorPressed: 'GrayText',
iconColor: semanticColors.disabledBodySubtext,
iconColorHovered: semanticColors.disabledBodySubtext,
iconColorPressed: semanticColors.disabledBodySubtext,
};
};
var CommandBarButtonTokens = function (props, theme) { return [
baseTokens,
props.disabled && disabledTokens,
]; };
/**
* @deprecated This component was experimental and is not longer being developed on, nor will it be supported in the
* future.
*/
export var CommandBarButton = composed({
displayName: 'CommandBarButton',
slots: slots,
state: state,
styles: styles,
tokens: CommandBarButtonTokens,
view: view,
});
//# sourceMappingURL=CommandBarButton.js.map