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

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

/// Generates a base light toast schema.
/// @type {Map}
/// @prop {Map} background [color: ('gray', 700)] - The background color used for the toast.
/// @prop {Map} border-color [color: ('gray', 700)] - The border color used for the toast.
/// @prop {Map} text-color [contrast-color: ('gray', 700)] - The text-color used for the toast.
/// @prop {Number} elevation [0] - The elevation level, between 0-24, to be used for the toast.
/// @prop {Map} border-radius [border-radius: (rem(26px), rem(0), rem(26px))] - The border radius used for toast.
/// @prop {Map} typography [text: (value: 'body-2')] - The typography styles used for the component.
/// @requires {Map} $default-elevation-toast
$light-toast: extend(
    $default-elevation-toast,
    (
        background: (
            color: (
                'gray',
                700,
            ),
        ),

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

        text-color: (
            contrast-color: (
                'gray',
                700,
            ),
        ),

        border-radius: (
            border-radius: (
                rem(26px),
                rem(0),
                rem(26px),
            ),
        ),

        typography: (
            text: (
                value: 'body-2',
            ),
        ),
    )
);

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

/// Generates a fluent toast schema.
/// @type {Map}
/// @prop {Map} background [color: ('gray', 100)] - The background color used for the toast.
/// @prop {Map} border-color [color: ('gray', 100)] - The border color used for the toast.
/// @prop {Map} text-color [contrast-color: ('gray', 100)] - The text-color used for the toast.
/// @prop {Map} border-radius [border-radius: (rem(2px), rem(0), rem(26px))] - The border radius used for toast.
/// @prop {Map} typography [text: (value: 'caption')] - The typography styles used for the component.
/// @requires {Map} $light-toast
$fluent-toast: extend(
    $light-toast,
    (
        background: (
            color: (
                'gray',
                100,
            ),
        ),

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

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

        border-radius: (
            border-radius: (
                rem(0),
                rem(0),
                rem(26px),
            ),
        ),

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

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

/// Generates a bootstrap toast schema.
/// @type {Map}
/// @prop {Map} background [color: ('surface')] - The background color used for the toast.
/// @prop {Map} border-color [color: ('gray', 300)] - The border color used for the toast.
/// @prop {Map} text-color [color: ('gray', 900)] - The text-color used for the toast.
/// @prop {Number} elevation [10] - The elevation level, between 0-24, to be used for the toast.
/// @prop {Map} border-radius [border-radius: (rem(4px), rem(0), rem(26px))] - The border radius used for toast.
/// @requires {Map} $light-toast
/// @requires {Map} $bootstrap-elevation-toast
$bootstrap-toast: extend(
    $light-toast,
    $bootstrap-elevation-toast,
    (
        background: (
            color: (
                'surface',
            ),
        ),

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

        text-color: (
            color: (
                'gray',
                900,
            ),
        ),

        border-radius: (
            border-radius: (
                rem(4px),
                rem(0),
                rem(26px),
            ),
        ),

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

/// Generates an indigo toast schema.
/// @type {Map}
/// @prop {Map} background [color: ('gray', 200)] - The background color used for the toast.
/// @prop {Color} border-color [transparent] - The border color used for the toast.
/// @prop {Map} text-color [color: ('gray', 700)] - The text-color used for the toast.
/// @prop {Map} border-radius [border-radius: (rem(6px), rem(0), rem(26px))] - The border radius used for toast.
/// @prop {Number} elevation [10] - The elevation level, between 0-24, to be used for the toast.
/// @requires {Map} $indigo-elevation-toast
$indigo-toast: extend(
    $indigo-elevation-toast,
    (
        background: (
            color: (
                'gray',
                200,
            ),
        ),

        border-color: transparent,

        text-color: (
            color: (
                'gray',
                700,
            ),
        ),

        border-radius: (
            border-radius: (
                rem(6px),
                rem(0),
                rem(26px),
            ),
        ),
        _meta: (
            theme: 'indigo',
            variant: 'light',
        ),
    )
);
