@uifabric/experiments
Version:
Experimental React components for building experiences for Microsoft 365.
81 lines • 3.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// Temporary import file to experiment with next version of foundation.
var composed_1 = require("@uifabric/foundation/lib-commonjs/next/composed");
var Styling_1 = require("../../../Styling");
var Button_state_1 = require("../Button.state");
var Button_styles_1 = require("../Button.styles");
var Button_view_1 = require("../Button.view");
/* eslint-disable deprecation/deprecation */
var baseTokens = function (props, theme) {
var palette = theme.palette, semanticColors = theme.semanticColors;
return {
backgroundColor: 'transparent',
backgroundColorHovered: palette.neutralLighter,
backgroundColorPressed: semanticColors.buttonBackgroundPressed,
borderColor: 'transparent',
borderColorHovered: 'transparent',
borderColorPressed: 'transparent',
borderRadius: '50%',
borderStyle: 'solid',
borderWidth: 1,
contentPadding: 0,
cursor: 'pointer',
highContrastBackgroundColor: 'WindowText',
highContrastBackgroundColorHovered: 'Highlight',
highContrastBackgroundColorPressed: 'Highlight',
highContrastBorderColor: 'transparent',
highContrastBorderColorHovered: 'transparent',
highContrastBorderColorPressed: 'transparent',
highContrastIconColor: 'Window',
highContrastIconColorHovered: 'Window',
highContrastIconColorPressed: 'Window',
iconColor: palette.themePrimary,
iconColorHovered: palette.themeDarkAlt,
iconColorPressed: palette.themeDark,
iconSize: 16,
lineHeight: 1,
minHeight: 32,
minWidth: 32,
msHighContrastAdjust: 'none',
outlineColor: 'transparent',
textFamily: 'inherit',
textSize: 14,
textWeight: Styling_1.FontWeights.semibold,
};
};
var disabledTokens = function (props, theme) {
var semanticColors = theme.semanticColors;
return {
backgroundColor: semanticColors.inputBackground,
backgroundColorHovered: semanticColors.inputBackground,
backgroundColorPressed: semanticColors.inputBackground,
cursor: 'default',
highContrastBackgroundColor: 'Window',
highContrastBackgroundColorHovered: 'Window',
highContrastBackgroundColorPressed: 'Window',
highContrastIconColor: 'GrayText',
highContrastIconColorHovered: 'GrayText',
highContrastIconColorPressed: 'GrayText',
iconColor: semanticColors.disabledText,
iconColorHovered: semanticColors.disabledText,
iconColorPressed: semanticColors.disabledText,
};
};
var IconButtonTokens = 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.
*/
exports.IconButton = composed_1.composed({
displayName: 'IconButton',
slots: Button_view_1.ButtonSlots,
state: Button_state_1.useButtonState,
styles: Button_styles_1.ButtonStyles,
tokens: IconButtonTokens,
view: Button_view_1.ButtonView,
});
//# sourceMappingURL=IconButton.js.map