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

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

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

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

        button-color: (
            color: (
                'secondary',
                500,
            ),
        ),

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

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

        _meta: (
            name: 'snackbar',
            variant: 'light',
        ),
    )
);

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

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

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

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

        border-radius: (
            border-radius: (
                rem(0),
                rem(0),
                rem(24px),
            ),
        ),
        typography: (
            text: (
                value: 'caption',
            ),
        ),
        _meta: (
            theme: 'fluent',
        ),
    )
);

/// Generates a bootstrap snackbar schema.
/// @type Map
/// @prop {Map} background [color: ('surface')] - The background color used in the snackbar.
/// @prop {Map} text-color [contrast-color: ('surface')] - The text color used in the snackbar.
/// @prop {Map} button-color [color: ('primary', 500)] - The button color used in the snackbar.
/// @prop {Number} elevation [10] - The elevation level, between 0-24, to be used in the snackbar.
/// @requires $light-snackbar
/// @requires $bootstrap-elevation-snackbar
$bootstrap-snackbar: extend(
    $light-snackbar,
    $bootstrap-elevation-snackbar,
    (
        background: (
            color: (
                'surface',
            ),
        ),

        text-color: (
            contrast-color: (
                'surface',
            ),
        ),

        button-color: (
            color: (
                'primary',
                500,
            ),
        ),
        _meta: (
            theme: 'bootstrap',
        ),
    )
);

/// Generates an indigo snackbar schema.
/// @type Map
/// @prop {Map} background [color: ('gray', 200)] - The background color used in the snackbar.
/// @prop {Map} text-color [color: ('gray', 700)] - The text color used in the snackbar.
/// @prop {Map} button-color [color: ('gray', 700)] - The button color used in the snackbar.
/// @prop {List} border-radius [(rem(6px), rem(0), rem(24px))] - The border radius used for snackbar.
/// @requires $light-snackbar
/// @requires $indigo-elevation-snackbar
$indigo-snackbar: extend(
    $light-snackbar,
    $indigo-elevation-snackbar,
    (
        background: (
            color: (
                'gray',
                200,
            ),
        ),

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

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

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