Source

styledComponents/getClickableCss.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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var macro_1 = require("styled-components/macro");
var createHoverableOnlyCss_1 = __importDefault(require("./createHoverableOnlyCss"));
var getDisabledCss_1 = __importDefault(require("./getDisabledCss"));
/**
 * Get common css to make an element looks and feels clickable.
 *
 * @param hoverOpacity
 * @param activeOpacity
 * @param disabledOpacity
 * @param disabledCursor
 * @category styledComponents
 * @module getClickableCss
 */
var getClickableCss = function (hoverOpacity, activeOpacity, disabledOpacity, disabledCursor) {
    if (hoverOpacity === void 0) { hoverOpacity = 0.7; }
    if (activeOpacity === void 0) { activeOpacity = 0.5; }
    return (0, macro_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  cursor: pointer;\n  user-select: none;\n  transition: opacity 0.1s ease-in-out;\n  ", "\n\n  ", "\n"], ["\n  cursor: pointer;\n  user-select: none;\n  transition: opacity 0.1s ease-in-out;\n  ", "\n\n  ", "\n"])), (0, createHoverableOnlyCss_1.default)((0, macro_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n    &::hover {\n      opacity: ", ";\n    }\n\n    &::active {\n      opacity: ", ";\n    }\n  "], ["\n    &::hover {\n      opacity: ", ";\n    }\n\n    &::active {\n      opacity: ", ";\n    }\n  "])), hoverOpacity, activeOpacity)), (0, getDisabledCss_1.default)(disabledOpacity, disabledCursor));
};
exports.default = getClickableCss;
var templateObject_1, templateObject_2;