@platform/react
Version:
React refs and helpers.
25 lines (24 loc) • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Foo = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var css_1 = require("@platform/css");
exports.Foo = function (_a) {
var children = _a.children, _b = _a.background, background = _b === void 0 ? true : _b, _c = _a.padding, padding = _c === void 0 ? 8 : _c, _d = _a.block, block = _d === void 0 ? true : _d, width = _a.width, height = _a.height, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, style = _a.style, onClick = _a.onClick, onMouseDown = _a.onMouseDown, onMouseUp = _a.onMouseUp;
var styles = {
backgroundColor: css_1.color.format(background),
display: block ? 'block' : 'inline-block',
padding: padding,
borderRadius: 3,
fontSize: 14,
border: "dashed 1px " + css_1.color.format(-0.1),
width: width,
height: height,
minWidth: minWidth,
minHeight: minHeight,
maxWidth: maxWidth,
maxHeight: maxHeight,
};
return (React.createElement("div", tslib_1.__assign({}, css_1.css(styles, style), { onClick: onClick, onMouseDown: onMouseDown, onMouseUp: onMouseUp }), children));
};