mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
20 KiB
JSON
1 line
20 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { refType } from '@material-ui/utils';\nimport SwitchBase from '../internal/SwitchBase';\nimport CheckBoxOutlineBlankIcon from '../internal/svg-icons/CheckBoxOutlineBlank';\nimport CheckBoxIcon from '../internal/svg-icons/CheckBox';\nimport { alpha } from '../styles/colorManipulator';\nimport IndeterminateCheckBoxIcon from '../internal/svg-icons/IndeterminateCheckBox';\nimport capitalize from '../utils/capitalize';\nimport withStyles from '../styles/withStyles';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n color: theme.palette.text.secondary\n },\n\n /* Pseudo-class applied to the root element if `checked={true}`. */\n checked: {},\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Pseudo-class applied to the root element if `indeterminate={true}`. */\n indeterminate: {},\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n '&$checked': {\n color: theme.palette.primary.main,\n '&:hover': {\n backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n '&$disabled': {\n color: theme.palette.action.disabled\n }\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n '&$checked': {\n color: theme.palette.secondary.main,\n '&:hover': {\n backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n '&$disabled': {\n color: theme.palette.action.disabled\n }\n }\n };\n};\nvar defaultCheckedIcon = /*#__PURE__*/React.createElement(CheckBoxIcon, null);\nvar defaultIcon = /*#__PURE__*/React.createElement(CheckBoxOutlineBlankIcon, null);\nvar defaultIndeterminateIcon = /*#__PURE__*/React.createElement(IndeterminateCheckBoxIcon, null);\nvar Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {\n var _props$checkedIcon = props.checkedIcon,\n checkedIcon = _props$checkedIcon === void 0 ? defaultCheckedIcon : _props$checkedIcon,\n classes = props.classes,\n _props$color = props.color,\n color = _props$color === void 0 ? 'secondary' : _props$color,\n _props$icon = props.icon,\n iconProp = _props$icon === void 0 ? defaultIcon : _props$icon,\n _props$indeterminate = props.indeterminate,\n indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,\n _props$indeterminateI = props.indeterminateIcon,\n indeterminateIconProp = _props$indeterminateI === void 0 ? defaultIndeterminateIcon : _props$indeterminateI,\n inputProps = props.inputProps,\n _props$size = props.size,\n size = _props$size === void 0 ? 'medium' : _props$size,\n other = _objectWithoutProperties(props, [\"checkedIcon\", \"classes\", \"color\", \"icon\", \"indeterminate\", \"indeterminateIcon\", \"inputProps\", \"size\"]);\n\n var icon = indeterminate ? indeterminateIconProp : iconProp;\n var indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;\n return /*#__PURE__*/React.createElement(SwitchBase, _extends({\n type: \"checkbox\",\n classes: {\n root: clsx(classes.root, classes[\"color\".concat(capitalize(color))], indeterminate && classes.indeterminate),\n checked: classes.checked,\n disabled: classes.disabled\n }
|