UNPKG

@gssfed/vital-ui-kit-react

Version:
44 lines (37 loc) 1.59 kB
var _templateObject = _taggedTemplateLiteral(['\n position: absolute;\n margin: 0;\n padding: 0;\n border-radius: 5px;\n left: 0;\n height: ', ';\n top: 0;\n width: ', ';\n pointer-events: none;\n background-color: ', '\n ', ';\n'], ['\n position: absolute;\n margin: 0;\n padding: 0;\n border-radius: 5px;\n left: 0;\n height: ', ';\n top: 0;\n width: ', ';\n pointer-events: none;\n background-color: ', '\n ', ';\n']); function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } import * as React from 'react'; import styled from 'styled-components'; import constants from './constants'; import { borderRightRadius, stateColor } from '../utils'; var Root = styled.div(_templateObject, function (props) { return constants[props.size].trackHeight; }, function (props) { return props.width + 'px'; }, function (props) { return stateColor(props, props.disabled ? props.theme.disabledBackground : props.theme.background); }, borderRightRadius(0)); var Selection = function Selection(_ref) { var size = _ref.size, disabled = _ref.disabled, width = _ref.width, alarm = _ref.alarm, warning = _ref.warning, success = _ref.success; return React.createElement(Root, { size: size, disabled: disabled, width: width, alarm: alarm, warning: warning, success: success }); }; Selection.defaultProps = { size: 'medium', disabled: false, alarm: false, warning: false, success: false }; export default Selection;