UNPKG

@roo-ui/components

Version:

48 lines (32 loc) 2.74 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _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; }; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _styledComponents = require('styled-components'); var _styledComponents2 = _interopRequireDefault(_styledComponents); var _styledSystem = require('styled-system'); var _polished = require('polished'); var _cleanTag = require('clean-tag'); var _cleanTag2 = _interopRequireDefault(_cleanTag); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Radio = function Radio(props) { return _react2.default.createElement( RadioWrapper, null, _react2.default.createElement(RadioInput, _extends({ type: 'radio' }, props)), _react2.default.createElement(RadioIcon, null) ); }; var RadioWrapper = (0, _styledComponents2.default)(_cleanTag2.default.div).withConfig({ displayName: 'Radio__RadioWrapper' })(['display:inline-block;position:relative;']); var RadioInput = _styledComponents2.default.input.withConfig({ displayName: 'Radio__RadioInput' })(['appearance:none;opacity:0;position:absolute;z-index:0;&:focus{box-shadow:none;}']); var RadioIcon = (0, _styledComponents2.default)(_cleanTag2.default.div).withConfig({ displayName: 'Radio__RadioIcon' })(['display:inline-block;position:relative;vertical-align:middle;margin-bottom:', ';margin-right:', ';height:', ';width:', ';background-color:', ';border:', ';border-color:', ';border-radius:50%;z-index:1;input:checked + &,input:focus + &,input:hover + &{border-color:', ';transition:', '}input:checked + &{&:after{position:absolute;display:block;content:\'\';top:', ';left:', ';height:', ';width:', ';border-radius:50%;background-color:', ';}}input:disabled + &{background-color:', ';border-color:', ';}'], (0, _polished.rem)('2px'), (0, _styledSystem.themeGet)('space.2'), (0, _polished.rem)('20px'), (0, _polished.rem)('20px'), (0, _styledSystem.themeGet)('colors.white'), (0, _styledSystem.themeGet)('borders.2'), (0, _styledSystem.themeGet)('colors.grey.2'), (0, _styledSystem.themeGet)('colors.brand.secondary'), (0, _styledSystem.themeGet)('transitions.default'), (0, _styledSystem.themeGet)('space.1'), (0, _styledSystem.themeGet)('space.1'), (0, _styledSystem.themeGet)('space.2'), (0, _styledSystem.themeGet)('space.2'), (0, _styledSystem.themeGet)('colors.grey.0'), (0, _styledSystem.themeGet)('colors.grey.2'), (0, _styledSystem.themeGet)('colors.grey.2')); exports.default = Radio;