"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const components_1 = require("../../components/index.js");
const theme_1 = require("../../gravity-blocks/context/theme/index.js");
const sub_blocks_1 = require("../../models/constructor-items/sub-blocks.js");
const utils_1 = require("../../utils/index.js");
const Content_1 = tslib_1.__importDefault(require("../Content/Content.js"));
const b = (0, utils_1.block)('basic-card');
const BasicCard = (props) => {
    const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = sub_blocks_1.IconPosition.Top, controlPosition = 'content', size = 's', gravityIcon, 
    /** @deprecated This property will be removed in future versions */
    hoverBackgroundColor, ...cardParams } = props;
    const titleId = (0, uikit_1.useUniqId)();
    const descriptionId = (0, uikit_1.useUniqId)();
    const areControlsInFooter = controlPosition === 'footer';
    const theme = (0, theme_1.useTheme)();
    const themedIcon = (0, utils_1.getThemedValue)(icon, theme);
    const themedGravityIcon = (0, utils_1.getThemedValue)(gravityIcon, theme);
    return ((0, jsx_runtime_1.jsx)(components_1.CardBase, { className: b(), contentClassName: b('content'), ...cardParams, extraProps: {
            'aria-describedby': descriptionId,
            'aria-labelledby': titleId,
            ...(hoverBackgroundColor && {
                style: {
                    '--hover-background-color': hoverBackgroundColor,
                },
            }),
        }, children: (0, jsx_runtime_1.jsx)(components_1.CardBase.Content, { children: (0, jsx_runtime_1.jsx)(components_1.IconWrapper, { icon: themedIcon ? { value: themedIcon, position: iconPosition } : undefined, gravityIcon: themedGravityIcon
                    ? { value: themedGravityIcon, position: iconPosition }
                    : undefined, className: b('wrapper'), size: size, children: (0, jsx_runtime_1.jsx)(Content_1.default, { title: title, titleId: titleId, text: text, textId: descriptionId, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, size: size, colSizes: { all: 12, md: 12 }, controlPosition: areControlsInFooter ? 'bottom' : 'default' }) }) }) }));
};
exports.default = BasicCard;
//# sourceMappingURL=BasicCard.js.map
