office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
95 lines • 3.1 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var Styling_1 = require("../../Styling");
function getBeakStyle(beakWidth) {
return {
height: beakWidth,
width: beakWidth
};
}
var GlobalClassNames = {
container: 'ms-Callout-container',
root: 'ms-Callout',
beak: 'ms-Callout-beak',
beakCurtain: 'ms-Callout-beakCurtain',
calloutMain: 'ms-Callout-main'
};
exports.getStyles = function (props) {
var _a;
var theme = props.theme, className = props.className, overflowYHidden = props.overflowYHidden, calloutWidth = props.calloutWidth, beakWidth = props.beakWidth, backgroundColor = props.backgroundColor, calloutMaxWidth = props.calloutMaxWidth;
var classNames = Styling_1.getGlobalClassNames(GlobalClassNames, theme);
var palette = theme.palette, effects = theme.effects;
return {
container: [
classNames.container,
{
position: 'relative'
}
],
root: [
classNames.root,
theme.fonts.medium,
{
position: 'absolute',
boxSizing: 'border-box',
borderRadius: effects.roundedCorner2,
boxShadow: effects.elevation16,
selectors: (_a = {},
_a[Styling_1.HighContrastSelector] = {
borderWidth: 1,
borderStyle: 'solid',
borderColor: 'WindowText'
},
_a)
},
Styling_1.focusClear(),
className,
!!calloutWidth && { width: calloutWidth },
!!calloutMaxWidth && { maxWidth: calloutMaxWidth }
],
beak: [
classNames.beak,
{
position: 'absolute',
backgroundColor: palette.white,
boxShadow: 'inherit',
border: 'inherit',
boxSizing: 'border-box',
transform: 'rotate(45deg)'
},
getBeakStyle(beakWidth),
backgroundColor && {
backgroundColor: backgroundColor
}
],
beakCurtain: [
classNames.beakCurtain,
{
position: 'absolute',
top: 0,
right: 0,
bottom: 0,
left: 0,
backgroundColor: palette.white,
borderRadius: effects.roundedCorner2
}
],
calloutMain: [
classNames.calloutMain,
{
backgroundColor: palette.white,
overflowX: 'hidden',
overflowY: 'auto',
position: 'relative',
borderRadius: effects.roundedCorner2
},
overflowYHidden && {
overflowY: 'hidden'
},
backgroundColor && {
backgroundColor: backgroundColor
}
]
};
};
//# sourceMappingURL=CalloutContent.styles.js.map
;