UNPKG

@wix/design-system

Version:

@wix/design-system

29 lines 1.29 kB
import React from 'react'; import { skins, dataHooks } from './constants'; import { stVars as colors } from '../Foundation/stylable/colors.st.css.js'; import Box from '../Box'; import { st, classes } from './PreviewWidget.st.css.js'; /** Preview content widget*/ class PreviewWidget extends React.PureComponent { render() { const { dataHook, skin, contentOutline, backgroundColor, height, width, children, className, scrollable, } = this.props; const rootStyles = { height: `${height}`, width: `${width}`, background: skin === skins.custom && (colors[backgroundColor] || backgroundColor), }; return (React.createElement("div", { className: st(classes.root, { skin, contentOutline, scrollable }, className), "data-hook": dataHook, style: rootStyles }, React.createElement("div", { "data-hook": dataHooks.contentArea, className: classes.contentArea }, children))); } } PreviewWidget.displayName = 'PreviewWidget'; PreviewWidget.defaultProps = { skin: 'neutral', contentOutline: 'shadow', height: 'auto', width: '100%', scrollable: false, children: React.createElement(Box, { height: "50px", width: "50px" }), }; export default PreviewWidget; //# sourceMappingURL=PreviewWidget.js.map