Source

styledComponents/getDisabledCss.js

"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
Object.defineProperty(exports, "__esModule", { value: true });
var macro_1 = require("styled-components/macro");
/**
 * Get style of a disabled element
 *
 * @param opacity
 * @param cursor
 * @category styledComponents
 * @module getDisabledCss
 */
var getDisabledCss = function (opacity, cursor) {
    if (opacity === void 0) { opacity = 0.5; }
    if (cursor === void 0) { cursor = 'default'; }
    return (0, macro_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  ", "\n"], ["\n  ", "\n"])), function (_a) {
        var disabled = _a.disabled;
        return disabled ? (0, macro_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n    &,\n    &::hover,\n    &::active {\n      opacity: ", ";\n      cursor: ", ";  \n    }\n  "], ["\n    &,\n    &::hover,\n    &::active {\n      opacity: ", ";\n      cursor: ", ";  \n    }\n  "])), opacity, cursor) : '';
    });
};
exports.default = getDisabledCss;
var templateObject_1, templateObject_2;