/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-43d3dd9
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import THEMES from '../../../data/themes.js';
import { tasty } from '../../../tasty/index.js';
import { Item } from '../Item/index.js';
const FILL_STYLES = Object.keys(THEMES).reduce((map, type) => {
    map[`theme=${type}`] =
        type === 'special' ? THEMES[type].fill : THEMES[type].color;
    return map;
}, {});
const BadgeElement = tasty(Item, {
    qa: 'Badge',
    role: 'status',
    size: 'inline',
    styles: {
        radius: 'round',
        color: '#white',
        fill: {
            '': '#purple',
            ...FILL_STYLES,
        },
        preset: {
            '': 'tag',
            'size=xsmall': 't4',
            'size=small | size=medium': 't3',
            'size=large | size=xlarge': 't2',
        },
        '$inline-padding': {
            '': 'max($min-inline-padding, (($size - 1lh - 2bw) / 2 + $inline-compensation))',
            'size=inline': '.5x',
        },
        Label: {
            textAlign: 'center',
            placeSelf: 'center',
        },
    },
});
function Badge(allProps, ref) {
    let { type, theme = 'special', children, size = 'inline', ...props } = allProps;
    const badgeTheme = theme ?? type;
    return (_jsx(BadgeElement, { ref: ref, size: size, "data-type": "primary", "data-theme": badgeTheme, ...props, children: children }));
}
const _Badge = forwardRef(Badge);
_Badge.displayName = 'Badge';
export { _Badge as Badge };

        