@platform/react
Version:
React refs and helpers.
20 lines (19 loc) • 773 B
JavaScript
import * as React from 'react';
import { color, css } from '@platform/css';
export const Foo = ({ children, background = true, padding = 8, block = true, width, height, minWidth, minHeight, maxWidth, maxHeight, style, onClick, onMouseDown, onMouseUp, }) => {
const styles = {
backgroundColor: color.format(background),
display: block ? 'block' : 'inline-block',
padding,
borderRadius: 3,
fontSize: 14,
border: `dashed 1px ${color.format(-0.1)}`,
width,
height,
minWidth,
minHeight,
maxWidth,
maxHeight,
};
return (React.createElement("div", Object.assign({}, css(styles, style), { onClick: onClick, onMouseDown: onMouseDown, onMouseUp: onMouseUp }), children));
};