function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys, key, i;
    if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
        sourceKeys = Reflect.ownKeys(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
        return target;
    }
    target = _object_without_properties_loose(source, excluded);
    if (Object.getOwnPropertySymbols) {
        sourceKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
    }
    return target;
}
import React from 'react';
import styled, { css } from 'styled-components';
import { applySkeletonGradient, applyRoundness } from '../../mixins';
import * as typography from '../../tokens/typography';
import { DEFAULT_TEXT_SIZE, DEFAULT_ROUNDNESS } from './Skeleton';
var StyledVisibleLine = styled.div.withConfig({
    displayName: "LineSkeleton__StyledVisibleLine",
    componentId: "sc-fa3b5b49-0"
})([
    "position:relative;overflow:hidden;width:100%;"
]);
var StyledLine = styled.div.withConfig({
    displayName: "LineSkeleton__StyledLine",
    componentId: "sc-fa3b5b49-1"
})([
    "display:flex;align-items:center;width:100%;",
    " & ",
    "{",
    " ",
    "}"
], function(param) {
    var $size = param.$size;
    return css([
        "height:",
        ";& ",
        "{height:",
        ";}"
    ], typography[$size].lineHeight, StyledVisibleLine, typography[$size].fontSize);
}, StyledVisibleLine, applyRoundness, applySkeletonGradient);
/**
 * Размеры компонента задаются с помощью констант и соответствуют размерам [типографических элементов](/?path=/docs/).
 */ export var LineSkeleton = function LineSkeleton(_0) {
    var _0_size = _0.size, size = _0_size === void 0 ? DEFAULT_TEXT_SIZE : _0_size, _0_roundness = _0.roundness, roundness = _0_roundness === void 0 ? DEFAULT_ROUNDNESS : _0_roundness, rest = _object_without_properties(_0, [
        "size",
        "roundness"
    ]);
    return /*#__PURE__*/ React.createElement(StyledLine, _object_spread({
        $size: size,
        roundness: roundness
    }, rest), /*#__PURE__*/ React.createElement(StyledVisibleLine, null));
};
