"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get addFocus () {
        return addFocus;
    },
    get syntheticFocus () {
        return syntheticFocus;
    }
});
var _styledcomponents = require("styled-components");
var _tokens = require("../tokens");
require("focus-visible");
var syntheticFocus = function syntheticFocus(ruleset, focused) {
    return (0, _styledcomponents.css)([
        "&.focus-visible:focus,&[data-focus-visible-added]{outline:none;",
        "}",
        ";"
    ], ruleset, focused && ruleset);
};
var addFocus = function addFocus(param) {
    var lowPerformance = param.lowPerformance, focused = param.focused, _param_outlined = param.outlined, outlined = _param_outlined === void 0 ? true : _param_outlined, _param_outlineSize = param.outlineSize, outlineSize = _param_outlineSize === void 0 ? '0.125rem' : _param_outlineSize, _param_outlineOffset = param.outlineOffset, outlineOffset = _param_outlineOffset === void 0 ? outlineSize : _param_outlineOffset, _param_outlineColor = param.outlineColor, outlineColor = _param_outlineColor === void 0 ? _tokens.buttonFocused : _param_outlineColor, _param_outlineRadius = param.outlineRadius, outlineRadius = _param_outlineRadius === void 0 ? 0 : _param_outlineRadius, _param_synthesizeFocus = param.synthesizeFocus, synthesizeFocus = _param_synthesizeFocus === void 0 ? syntheticFocus : _param_synthesizeFocus;
    return outlined && (0, _styledcomponents.css)([
        "position:relative;&::before{content:'';position:absolute;top:-",
        ";left:-",
        ";right:-",
        ";bottom:-",
        ";display:block;box-sizing:content-box;border:",
        " solid transparent;border-radius:",
        ";transition:",
        ";pointer-events:none;}",
        ""
    ], outlineOffset, outlineOffset, outlineOffset, outlineOffset, outlineSize, outlineRadius, lowPerformance ? 'unset' : 'box-shadow 0.2s ease-in-out', synthesizeFocus((0, _styledcomponents.css)([
        "&::before{box-shadow:0 0 0 ",
        " ",
        ";}"
    ], outlineSize, outlineColor), focused));
};
