188 lines
6.7 KiB
JavaScript
188 lines
6.7 KiB
JavaScript
import { __assign } from "tslib";
|
|
import { concatStyleSets, getFocusStyle, HighContrastSelector, getHighContrastNoAdjustStyle } from '../../../Styling';
|
|
import { memoizeFunction } from '../../../Utilities';
|
|
import { getStyles as getBaseButtonStyles } from '../BaseButton.styles';
|
|
import { getStyles as getSplitButtonStyles } from '../SplitButton/SplitButton.styles';
|
|
import { ButtonGlobalClassNames } from '../BaseButton.classNames';
|
|
export var getStyles = memoizeFunction(function (theme, customStyles, focusInset, focusColor) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
var baseButtonStyles = getBaseButtonStyles(theme);
|
|
var baseSplitButtonStyles = getSplitButtonStyles(theme);
|
|
var p = theme.palette, semanticColors = theme.semanticColors;
|
|
var commandButtonHighContrastFocus = {
|
|
left: 4,
|
|
top: 4,
|
|
bottom: 4,
|
|
right: 4,
|
|
border: 'none',
|
|
};
|
|
var commandButtonStyles = {
|
|
root: [
|
|
getFocusStyle(theme, {
|
|
inset: 2,
|
|
highContrastStyle: commandButtonHighContrastFocus,
|
|
borderColor: 'transparent',
|
|
}),
|
|
theme.fonts.medium,
|
|
(_a = {
|
|
minWidth: '40px',
|
|
backgroundColor: p.white,
|
|
color: p.neutralPrimary,
|
|
padding: '0 4px',
|
|
border: 'none',
|
|
borderRadius: 0
|
|
},
|
|
_a[HighContrastSelector] = {
|
|
border: 'none',
|
|
},
|
|
_a),
|
|
],
|
|
rootHovered: (_b = {
|
|
backgroundColor: p.neutralLighter,
|
|
color: p.neutralDark
|
|
},
|
|
_b[HighContrastSelector] = {
|
|
color: 'Highlight',
|
|
},
|
|
_b[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.themeDarkAlt,
|
|
},
|
|
_b[".".concat(ButtonGlobalClassNames.msButtonMenuIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_b),
|
|
rootPressed: (_c = {
|
|
backgroundColor: p.neutralLight,
|
|
color: p.neutralDark
|
|
},
|
|
_c[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.themeDark,
|
|
},
|
|
_c[".".concat(ButtonGlobalClassNames.msButtonMenuIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_c),
|
|
rootChecked: (_d = {
|
|
backgroundColor: p.neutralLight,
|
|
color: p.neutralDark
|
|
},
|
|
_d[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.themeDark,
|
|
},
|
|
_d[".".concat(ButtonGlobalClassNames.msButtonMenuIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_d),
|
|
rootCheckedHovered: (_e = {
|
|
backgroundColor: p.neutralQuaternaryAlt
|
|
},
|
|
_e[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.themeDark,
|
|
},
|
|
_e[".".concat(ButtonGlobalClassNames.msButtonMenuIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_e),
|
|
rootExpanded: (_f = {
|
|
backgroundColor: p.neutralLight,
|
|
color: p.neutralDark
|
|
},
|
|
_f[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.themeDark,
|
|
},
|
|
_f[".".concat(ButtonGlobalClassNames.msButtonMenuIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_f),
|
|
rootExpandedHovered: {
|
|
backgroundColor: p.neutralQuaternaryAlt,
|
|
},
|
|
rootDisabled: (_g = {
|
|
backgroundColor: p.white
|
|
},
|
|
_g[".".concat(ButtonGlobalClassNames.msButtonIcon)] = (_h = {
|
|
color: semanticColors.disabledBodySubtext
|
|
},
|
|
_h[HighContrastSelector] = __assign({ color: 'GrayText' }, getHighContrastNoAdjustStyle()),
|
|
_h),
|
|
_g[HighContrastSelector] = __assign({ color: 'GrayText', backgroundColor: 'Window' }, getHighContrastNoAdjustStyle()),
|
|
_g),
|
|
// Split button styles
|
|
splitButtonContainer: (_j = {
|
|
height: '100%'
|
|
},
|
|
_j[HighContrastSelector] = {
|
|
border: 'none',
|
|
},
|
|
_j),
|
|
splitButtonDividerDisabled: (_k = {},
|
|
_k[HighContrastSelector] = {
|
|
backgroundColor: 'Window',
|
|
},
|
|
_k),
|
|
splitButtonDivider: {
|
|
backgroundColor: p.neutralTertiaryAlt,
|
|
},
|
|
splitButtonMenuButton: {
|
|
backgroundColor: p.white,
|
|
border: 'none',
|
|
borderTopRightRadius: '0',
|
|
borderBottomRightRadius: '0',
|
|
color: p.neutralSecondary,
|
|
':hover': (_l = {
|
|
backgroundColor: p.neutralLighter,
|
|
color: p.neutralDark
|
|
},
|
|
_l[HighContrastSelector] = {
|
|
color: 'Highlight',
|
|
},
|
|
_l[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_l),
|
|
':active': (_m = {
|
|
backgroundColor: p.neutralLight
|
|
},
|
|
_m[".".concat(ButtonGlobalClassNames.msButtonIcon)] = {
|
|
color: p.neutralPrimary,
|
|
},
|
|
_m),
|
|
},
|
|
splitButtonMenuButtonDisabled: (_o = {
|
|
backgroundColor: p.white
|
|
},
|
|
_o[HighContrastSelector] = __assign({ color: 'GrayText', border: 'none', backgroundColor: 'Window' }, getHighContrastNoAdjustStyle()),
|
|
_o),
|
|
splitButtonMenuButtonChecked: {
|
|
backgroundColor: p.neutralLight,
|
|
color: p.neutralDark,
|
|
':hover': {
|
|
backgroundColor: p.neutralQuaternaryAlt,
|
|
},
|
|
},
|
|
splitButtonMenuButtonExpanded: {
|
|
backgroundColor: p.neutralLight,
|
|
color: p.black,
|
|
':hover': {
|
|
backgroundColor: p.neutralQuaternaryAlt,
|
|
},
|
|
},
|
|
splitButtonMenuIcon: {
|
|
color: p.neutralPrimary,
|
|
},
|
|
splitButtonMenuIconDisabled: {
|
|
color: p.neutralTertiary,
|
|
},
|
|
label: {
|
|
fontWeight: 'normal', // theme.fontWeights.semibold,
|
|
},
|
|
icon: {
|
|
color: p.themePrimary,
|
|
},
|
|
menuIcon: {
|
|
color: p.neutralSecondary,
|
|
},
|
|
};
|
|
return concatStyleSets(baseButtonStyles, baseSplitButtonStyles, commandButtonStyles, customStyles);
|
|
});
|
|
//# sourceMappingURL=CommandBarButton.styles.js.map
|