office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
92 lines • 3.05 kB
JavaScript
import { HighContrastSelector, focusClear, getGlobalClassNames } from '../../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'
};
export var getStyles = function (props) {
var theme = props.theme, className = props.className, overflowYHidden = props.overflowYHidden, calloutWidth = props.calloutWidth, beakWidth = props.beakWidth, backgroundColor = props.backgroundColor, calloutMaxWidth = props.calloutMaxWidth;
var classNames = getGlobalClassNames(GlobalClassNames, theme);
var palette = theme.palette;
return {
container: [
classNames.container,
{
position: 'relative'
}
],
root: [
classNames.root,
{
position: 'absolute',
boxSizing: 'border-box',
borderWidth: 1,
borderStyle: 'solid',
borderColor: palette.neutralLight,
boxShadow: '0 0 5px 0px rgba(0,0,0,0.4)',
selectors: (_a = {},
_a[HighContrastSelector] = {
borderWidth: 1,
borderStyle: 'solid',
borderColor: 'WindowText'
},
_a)
},
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
}
],
calloutMain: [
classNames.calloutMain,
{
backgroundColor: palette.white,
overflowX: 'hidden',
overflowY: 'auto',
position: 'relative'
},
overflowYHidden && {
overflowY: 'hidden'
},
backgroundColor && {
backgroundColor: backgroundColor
}
]
};
var _a;
};
//# sourceMappingURL=CalloutContent.styles.js.map