UNPKG

@wix/design-system

Version:

@wix/design-system

17 lines 1.16 kB
import React from 'react'; import { st, classes } from './SkeletonRectangle.st.css.js'; import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from './constants'; import { DEFAULT_SKIN } from '../SkeletonGroup/SkeletonGroup.constants'; import Box from '../Box'; import { SkeletonGroupContext } from '../SkeletonGroup'; function SkeletonRectangle(props) { const { dataHook, className, height = DEFAULT_HEIGHT, width = DEFAULT_WIDTH, margin, marginLeft, marginRight, marginTop, marginBottom, } = props; return (React.createElement(SkeletonGroupContext.Consumer, null, context => { const skin = (context && context.skin) || DEFAULT_SKIN; return (React.createElement("div", { "data-hook": dataHook, className: className, "data-height": height, "data-width": width, "data-skin": skin }, React.createElement(Box, { height: height, width: width, margin: margin, marginLeft: marginLeft, marginRight: marginRight, marginTop: marginTop, marginBottom: marginBottom, className: st(classes.root, { skin }) }))); })); } SkeletonRectangle.displayName = 'SkeletonRectangle'; export default SkeletonRectangle; //# sourceMappingURL=SkeletonRectangle.js.map