UNPKG

vcc-ui

Version:

VCC UI is a collection of React UI Components that can be used for developing front-end applications at Volvo Car Corporation.

40 lines (39 loc) 1.33 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from "react"; import { COLORS } from "../../constants/colors"; import { Block } from "../block"; export var Checkbox = function Checkbox(props) { return React.createElement(Block, _extends({ as: "input", type: "checkbox" }, props, { extend: { boxSizing: "border-box", background: "white", border: "1px solid #ddd", appearance: "none", width: "20px", height: "20px", margin: 0, padding: 0, display: "flex", justifyContent: "center", alignItems: "center", position: "relative", cursor: "pointer", ":checked": { ":before": { boxSizing: "border-box", transform: "translateY(-1px) rotate(45deg)", display: "block", content: "''", width: "5px", position: "absolute", height: "10px", borderRight: "2px solid ".concat(COLORS.blue), borderBottom: "2px solid ".concat(COLORS.blue) } } } })); };