@makeen.io/material-ui-kit
Version:
Makeen UI components kit. Based on material-ui.
81 lines (31 loc) • 4.61 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";function _templateObject5() {var data = _taggedTemplateLiteral(["\n font-size: 13px;\n margin-left: 5px;\n margin-right: 5px;\n font-weight: ", ";\n color: ", ";\n"]);_templateObject5 = function _templateObject5() {return data;};return data;}function _templateObject4() {var data = _taggedTemplateLiteral(["\n margin-left: 5px;\n margin-right: 5px;\n color: ", ";\n\n & > span {\n display: flex;\n align-items: center;\n }\n"]);_templateObject4 = function _templateObject4() {return data;};return data;}function _templateObject3() {var data = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 10px;\n position: relative;\n"]);_templateObject3 = function _templateObject3() {return data;};return data;}function _templateObject2() {var data = _taggedTemplateLiteral(["\n & {\n font-size: 13px;\n padding-top: 5px;\n width: 90px;\n height: 40px;\n margin: auto;\n font-weight: bold;\n color: ", ";\n }\n"]);_templateObject2 = function _templateObject2() {return data;};return data;}function _templateObject() {var data = _taggedTemplateLiteral(["\n & {\n width: 136px;\n padding: 15px 10px 5px 10px;\n border-radius: 4px;\n text-align: center;\n position: relative;\n border: 1px solid\n ", ";\n }\n\n .tail {\n width: 0;\n margin: auto;\n height: 0;\n left: 50%;\n transform: translateX(-50%);\n position: absolute;\n bottom: -10px;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-top: 9px solid\n ", ";\n }\n"]);_templateObject = function _templateObject() {return data;};return data;}import React from "react";
import { Typography } from "@material-ui/core";
import _ from "lodash";
import styled from "styled-components";
var TapperWrapper = styled(function (_ref) {var active = _ref.active,disabled = _ref.disabled,props = _objectWithoutProperties(_ref, ["active", "disabled"]);return /*#__PURE__*/React.createElement("div", _extends({}, props));})(_templateObject(),
function (props) {return props.active && props.disabled ?
props.theme.palette.text.secondary :
props.active ?
props.theme.palette.primary.main :
props.theme.palette.tertiary.border;},
function (props) {return props.active && props.disabled ?
props.theme.palette.text.secondary :
props.theme.palette.primary.main;});
var TapperLabelWrapper = styled(function (_ref2) {var active = _ref2.active,props = _objectWithoutProperties(_ref2, ["active"]);return /*#__PURE__*/React.createElement(Typography, _extends({}, props));})(_templateObject2(),
function (props) {return props.theme.palette.text[props.active ? "primary" : "secondary"];});
var TapperIconCounterWrapper = styled.div(_templateObject3());
var TapperIconWrapper = styled(function (_ref3) {var active = _ref3.active,props = _objectWithoutProperties(_ref3, ["active"]);return /*#__PURE__*/React.createElement("div", _extends({}, props));})(_templateObject4(),
function (props) {return props.theme.palette.text[props.active ? "primary" : "secondary"];});
var TapperCountWrapper = styled(function (_ref4) {var active = _ref4.active,props = _objectWithoutProperties(_ref4, ["active"]);return /*#__PURE__*/React.createElement("div", _extends({}, props));})(_templateObject5(),
function (props) {return props.active ? "500" : "normal";},
function (props) {return props.theme.palette.text[props.active ? "primary" : "secondary"];});
export default (function (_ref5) {var label = _ref5.label,IconComponent = _ref5.IconComponent,count = _ref5.count,active = _ref5.active,onClick = _ref5.onClick,disabled = _ref5.disabled;return /*#__PURE__*/React.createElement(TapperWrapper, { onClick: disabled ?
function () {
/* */} :
onClick, active: active, disabled: !!disabled, className: "explorer-tap-radio" }, /*#__PURE__*/
React.createElement(TapperLabelWrapper, { active: active }, label), /*#__PURE__*/
React.createElement(TapperIconCounterWrapper, null, /*#__PURE__*/
React.createElement(TapperIconWrapper, { active: active }, IconComponent), /*#__PURE__*/
React.createElement(TapperCountWrapper, { active: active }, _.isNumber(count) ? count.toLocaleString() : count)),
active && /*#__PURE__*/React.createElement("div", { className: "tail" }));});
//# sourceMappingURL=TapRadio.js.map