UNPKG

zent

Version:

一套前端设计语言和基于React的实现

24 lines (23 loc) 761 B
import { jsx as _jsx } from "react/jsx-runtime"; import reactCSS from '../helpers/reactcss'; export var Swatch = function (_a) { var color = _a.color, style = _a.style, onClick = _a.onClick, _b = _a.title, title = _b === void 0 ? color : _b; var styles = reactCSS({ default: { swatch: { background: color, height: '100%', width: '100%', cursor: 'pointer', }, }, custom: { swatch: style, }, }, 'custom'); var handleClick = function (e) { onClick(color, e); }; return _jsx("div", { style: styles.swatch, onClick: handleClick, title: title, "data-zv": '10.0.17' }, void 0); }; export default Swatch;