UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

90 lines 3.09 kB
import { HighContrastSelector, focusClear } from '../../Styling'; function getBeakStyle(beakWidth, beakStyle) { var beakStyleWidth = beakWidth; // This is here to support the old way of setting the beak size until version 1.0.0. // beakStyle is now deprecated and will be be removed at version 1.0.0 if (beakStyle === 'ms-Callout-smallbeak') { beakStyleWidth = 16; } return { height: beakStyleWidth, width: beakStyleWidth }; } export var getStyles = function (props) { var theme = props.theme, className = props.className, overflowYHidden = props.overflowYHidden, calloutWidth = props.calloutWidth, contentMaxHeight = props.contentMaxHeight, beakWidth = props.beakWidth, backgroundColor = props.backgroundColor, beakStyle = props.beakStyle; var palette = theme.palette; return { container: [ 'ms-Callout-container', { position: 'relative', } ], root: [ 'ms-Callout', { 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 } ], beak: [ 'ms-Callout-beak', { position: 'absolute', backgroundColor: palette.white, boxShadow: 'inherit', border: 'inherit', boxSizing: 'border-box', transform: 'rotate(45deg)' }, getBeakStyle(beakWidth, beakStyle), backgroundColor && { backgroundColor: backgroundColor } ], beakCurtain: [ 'ms-Callout-beakCurtain', { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0, backgroundColor: palette.white, } ], calloutMain: [ 'ms-Callout-main', { backgroundColor: palette.white, overflowX: 'hidden', overflowY: 'auto', position: 'relative', maxHeight: contentMaxHeight }, overflowYHidden && { overflowY: 'hidden' }, backgroundColor && { backgroundColor: backgroundColor } ], }; var _a; }; //# sourceMappingURL=CalloutContent.styles.js.map