UNPKG

@makeen.io/material-ui-kit

Version:
50 lines (22 loc) 3.29 kB
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";import _extends from "@babel/runtime/helpers/extends";import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";function _templateObject4() {var data = _taggedTemplateLiteral(["\n .MuiRadio-root {\n color: ", ";\n }\n\n .MuiRadio-colorPrimary.Mui-checked {\n color: ", ";\n }\n\n .MuiSvgIcon-root {\n width: 20px;\n height: 20px;\n font-size: 20px;\n }\n\n .MuiFormControlLabel-root {\n font-size: 13px;\n line-height: 1.85;\n color: ", ";\n }\n"]);_templateObject4 = function _templateObject4() {return data;};return data;}function _templateObject3() {var data = _taggedTemplateLiteral(["\n .MuiFormHelperText-root {\n color: #f44336;\n }\n"]);_templateObject3 = function _templateObject3() {return data;};return data;}function _templateObject2() {var data = _taggedTemplateLiteral(["\n ", "\n "]);_templateObject2 = function _templateObject2() {return data;};return data;}function _templateObject() {var data = _taggedTemplateLiteral(["\n ", ";\n margin-right: 20px;\n\n .MuiTypography-root {\n font-size: 13px;\n }\n"]);_templateObject = function _templateObject() {return data;};return data;}import React from "react"; import FormControl from "@material-ui/core/FormControl"; import FormControlLabel from "@material-ui/core/FormControlLabel"; import FormHelperText from "@material-ui/core/FormHelperText"; import MaterialRadio from "@material-ui/core/Radio"; import RadioGroup from "@material-ui/core/RadioGroup"; import styled, { css } from "styled-components"; var ExplorerRadio = styled(function (props) {return /*#__PURE__*/React.createElement(FormControlLabel, _extends({ classes: { root: "explorer-radio-label" } }, props));})(_templateObject(), function (props) {return css(_templateObject2(), props.radioStyle ? props.radioStyle(props) : "");}); var FormControlWrapper = styled(FormControl)(_templateObject3()); export default styled(function (_ref) {var name = _ref.name,defaultValue = _ref.defaultValue,options = _ref.options,error = _ref.error,register = _ref.register,value = _ref.value,onChange = _ref.onChange,className = _ref.className,rest = _objectWithoutProperties(_ref, ["name", "defaultValue", "options", "error", "register", "value", "onChange", "className"]); var renderOptions = function renderOptions(option) {return /*#__PURE__*/React.createElement(ExplorerRadio, _extends({}, option, { key: option.value, control: /*#__PURE__*/React.createElement(MaterialRadio, { color: "primary", inputRef: register }) }));}; return /*#__PURE__*/React.createElement(FormControlWrapper, { className: className, component: "fieldset" }, /*#__PURE__*/ React.createElement(RadioGroup, _extends({ row: true, name: name, defaultValue: defaultValue, value: value, onChange: onChange }, rest), options.map(renderOptions)), error && /*#__PURE__*/React.createElement(FormHelperText, null, error.message)); })(_templateObject4(), function (props) {return props.theme.palette.controlSecondaryColor;}, function (props) {return props.theme.palette.controlPrimaryColor;}, function (props) {return props.theme.palette.controlLabelColor;}); // .MuiSvgIcon-root //# sourceMappingURL=index.js.map