@use '../../../../utils/map' as *;
@use '../../../../typography/functions' as *;
@use '../elevation/badge' as *;

////
/// @package theming
/// @group schemas
/// @access public
////

/// Generates a light badge schema.
/// @type {Map}
/// @prop {Map} icon-color [contrast-color: ('primary', 900)] - The icon color used.
/// @prop {Map} text-color [contrast-color: ('primary', 900)] - The text color used.
/// @prop {Map} border-color [color: ('gray', 50)] - The border color used.
/// @prop {Map} background-color [color: ('primary', 500)] - The background color used.
/// @prop {Number} elevation [1] - The elevation level, between 0-24, to be used for the badge shadow.
/// @prop {Number} border-radius [0] - The border radius used for badge.
/// @prop {Map} typography [text: (value: 'caption')] - The typography styles used for the component.
/// @requires {Map} $default-elevation-badge
$light-badge: extend(
    $default-elevation-badge,
    (
        icon-color: (
            contrast-color: (
                'primary',
                900,
            ),
        ),

        text-color: (
            contrast-color: (
                'primary',
                900,
            ),
        ),

        border-color: (
            color: (
                'gray',
                50,
            ),
        ),

        background-color: (
            color: (
                'primary',
                500,
            ),
        ),

        border-radius: 0,

        typography: (
            text: (
                value: 'caption',
            ),
        ),
    )
);

/// Generates a material badge schema.
/// @type {Map}
/// @requires {Map} $light-badge
$material-badge: extend(
    $light-badge,
    (
        _meta: (
            theme: 'material',
            variant: 'light',
        ),
    )
);

/// Generates a fluent badge schema.
/// @type {Map}
/// @requires {Map} $light-badge
$fluent-badge: extend(
    $light-badge,
    (
        _meta: (
            theme: 'fluent',
            variant: 'light',
        ),
    )
);

/// Generates a bootstrap badge schema.
/// @type {Map}
/// @prop {Map} icon-color [contrast-color: ('primary', 100)] - The icon color used.
/// @prop {Map} text-color [contrast-color: ('primary', 100)] - The text color used.
/// @prop {Number} border-radius [rem(4px)] - The border radius used for badge.
/// @requires {Map} $light-badge
$bootstrap-badge: extend(
    $light-badge,
    (
        icon-color: (
            contrast-color: (
                'primary',
                100,
            ),
        ),

        text-color: (
            contrast-color: (
                'primary',
                100,
            ),
        ),

        border-radius: rem(4px),
        _meta: (
            theme: 'bootstrap',
            variant: 'light',
        ),
    )
);

/// Generates an indigo badge schema.
/// @type {Map}
/// @prop {Map} background-color [color: ('primary', 400)] - The background color used.
/// @prop {Map} typography [text: (value: 'button')] - The typography styles used for the component.
/// @requires {Map} $light-badge
/// @requires {Map} $indigo-elevation-badge
$indigo-badge: extend(
    $light-badge,
    $indigo-elevation-badge,
    (
        background-color: (
            color: (
                'primary',
                400,
            ),
        ),

        typography: (
            text: (
                value: 'button',
            ),
        ),

        _meta: (
            theme: 'indigo',
            variant: 'light',
        ),
    )
);
