@makeen.io/material-ui-kit
Version:
Makeen UI components kit. Based on material-ui.
31 lines (14 loc) • 2.24 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";function _templateObject3() {var data = _taggedTemplateLiteral(["\n font-size: 10px;\n font-weight: 600;\n color: ", ";\n\n .MuiSwitch-colorPrimary.Mui-checked:not(.Mui-disabled) {\n color: ", ";\n }\n .MuiSwitch-colorPrimary + .MuiSwitch-track {\n opacity: 1;\n background-color: ", ";\n }\n .MuiSwitch-colorPrimary.Mui-checked + .MuiSwitch-track {\n background-color: ", ";\n }\n"]);_templateObject3 = function _templateObject3() {return data;};return data;}function _templateObject2() {var data = _taggedTemplateLiteral(["\n font-size: 15px;\n font-weight: bold;\n"]);_templateObject2 = function _templateObject2() {return data;};return data;}function _templateObject() {var data = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"]);_templateObject = function _templateObject() {return data;};return data;}import React from "react";
import MaterialSwitch from "@material-ui/core/Switch";
import styled from "styled-components";
var SwitchWrapper = styled.div(_templateObject());
var ConditionLabel = styled.div(_templateObject2());
export default styled(function (_ref) {var conditional = _ref.conditional,leftLabel = _ref.leftLabel,rightLabel = _ref.rightLabel,className = _ref.className,props = _objectWithoutProperties(_ref, ["conditional", "leftLabel", "rightLabel", "className"]);return /*#__PURE__*/React.createElement(SwitchWrapper, { className: className },
conditional && /*#__PURE__*/React.createElement(ConditionLabel, null, leftLabel), /*#__PURE__*/
React.createElement(MaterialSwitch, _extends({}, props)),
conditional && /*#__PURE__*/React.createElement(ConditionLabel, null, rightLabel));})(_templateObject3(),
function (props) {return props.theme.palette.controlFillColor;},
function (props) {return props.theme.palette.controlPrimaryColor;},
function (props) {return props.theme.palette.controlSecondaryBackgroundColor;},
function (props) {return props.theme.palette.controlPrimaryBackgroundColor;});
//# sourceMappingURL=index.js.map