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

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

// stylelint-disable max-line-length

/// Generates a base light select schema.
/// @type {Map}
/// @prop {Map} toggle-button-background [color: ('gray', 300)] - The select toggle button background color.
/// @prop {Map} toggle-button-background-focus [color: ('gray', 400)] - The select toggle button background color when the select is focused.
/// @prop {Map} toggle-button-foreground [color: ('gray', 700)] - The select toggle button foreground color.
/// @prop {Map} toggle-button-foreground-focus [color: ('gray', 900)] - The select toggle button foreground color when the select is focused.
/// @prop {Map} toggle-button-foreground-filled [color: ('gray', 900)] - The select toggle button foreground color when the select is filled.
/// @prop {Map} toggle-button-background-disabled [color: ('gray', 100] - The select toggle button background color when the select is disabled.
/// @prop {Map} toggle-button-foreground-disabled [color: ('gray', 400)] - The select toggle button foreground color when the select is disabled.
/// @prop {Map} toggle-button-background-focus--border [color: ('gray', 300)] - The select toggle button background color when the select is focused in material border and line variants.
/// @prop {Number} default-size [2] - The default size used for the select component.
$light-select: (
    toggle-button-background-focus--border: (
        color: (
            'gray',
            300,
        ),
    ),
    toggle-button-background: (
        color: (
            'gray',
            300,
        ),
    ),
    toggle-button-background-focus: (
        color: (
            'gray',
            400,
        ),
    ),
    toggle-button-foreground: (
        color: (
            'gray',
            700,
        ),
    ),
    toggle-button-foreground-focus: (
        color: (
            'gray',
            900,
        ),
    ),
    toggle-button-foreground-filled: (
        color: (
            'gray',
            900,
        ),
    ),
    toggle-button-background-disabled: (
        color: (
            'gray',
            100,
        ),
    ),
    toggle-button-foreground-disabled: (
        color: (
            'gray',
            400,
        ),
    ),
    default-size: 2,
);

/// Generates a material select schema.
/// @type {Map}
/// @prop {Map} toggle-button-foreground-disabled [color: ('gray', 500)] - The select toggle button foreground color when the select is disabled.
/// @requires {Map} $light-select
$material-select: extend(
    $light-select,
    (
        toggle-button-foreground-disabled: (
            color: (
                'gray',
                500,
            ),
        ),
        _meta: (
            theme: 'material',
            variant: 'light',
        ),
    )
);

/// Generates a fluent select schema.
/// @type {Map}
/// @prop {Map} toggle-button-background [color: ('gray', 100)] - The select toggle button background color.
/// @prop {Map} toggle-button-background-focus [color: ('gray', 100)] - The select toggle button background color when the select is focused.
/// @prop {Map} toggle-button-foreground-focus [color: ('gray', 700)] - The select toggle button foreground color when the select is focused.
/// @prop {Map} toggle-button-foreground-filled [color: ('gray', 700)] - The select toggle button foreground color when the select is focused.
/// @requires {Map} $light-select
$fluent-select: extend(
    $light-select,
    (
        toggle-button-background: (
            color: (
                'gray',
                100,
            ),
        ),
        toggle-button-background-focus: (
            color: (
                'gray',
                100,
            ),
        ),
        toggle-button-foreground-focus: (
            color: (
                'gray',
                700,
            ),
        ),
        toggle-button-foreground-filled: (
            color: (
                'gray',
                700,
            ),
        ),
        _meta: (
            theme: 'fluent',
            variant: 'light',
        ),
    )
);

/// Generates a bootstrap select schema.
/// @type {Map}
/// @prop {Map} toggle-button-foreground [color: ('gray', 800)] - The select toggle button foreground color.
/// @prop {Map} toggle-button-foreground-focus [color: ('gray', 800)] - The select toggle button foreground color when the select is focused.
/// @prop {Map} toggle-button-foreground-filled [color: ('gray', 800)] - The select toggle button foreground color when the select is focused.
/// @requires {Map} $light-select
$bootstrap-select: extend(
    $light-select,
    (
        toggle-button-foreground: (
            color: (
                'gray',
                800,
            ),
        ),
        toggle-button-foreground-focus: (
            color: (
                'gray',
                800,
            ),
        ),
        toggle-button-foreground-filled: (
            color: (
                'gray',
                800,
            ),
        ),
        _meta: (
            theme: 'bootstrap',
            variant: 'light',
        ),
    )
);

/// Generates an indigo select schema.
/// @type {Map}
/// @prop {Map} toggle-button-foreground [color: ('gray', 600)] - The select toggle button foreground color.
/// @prop {Map} toggle-button-foreground-filled [color: ('gray', 600)] - The select toggle button foreground color when the select is filled.
/// @prop {Map} toggle-button-foreground-focus [color: ('gray', 700)] - The select toggle button foreground color when the select is focused.
/// @prop {Map} toggle-button-background [transparent] - The select toggle button background color.
/// @prop {Map} toggle-button-background-focus [transparent] - The select toggle button background color when the select is focused.
/// @prop {Map} toggle-button-background-focus--border [transparent] - The select toggle button background color when the select is focused.
/// @prop {Color} toggle-button-background-disabled [transparent] - The select toggle button background color when the select is disabled.
/// @prop {Map} toggle-button-foreground-disabled [color: ('gray', 900, .2)] - The select toggle button foreground color when the select is disabled.
/// @requires {Map} $light-select
$indigo-select: extend(
    $light-select,
    (
        toggle-button-background: transparent,
        toggle-button-background-focus: transparent,
        toggle-button-background-focus--border: transparent,
        toggle-button-background-disabled: transparent,
        toggle-button-foreground: (
            color: (
                'gray',
                600,
            ),
        ),
        toggle-button-foreground-filled: (
            color: (
                'gray',
                600,
            ),
        ),
        toggle-button-foreground-focus: (
            color: (
                'gray',
                700,
            ),
        ),
        toggle-button-foreground-disabled: (
            color: (
                'gray',
                900,
                0.2,
            ),
        ),
        _meta: (
            theme: 'indigo',
            variant: 'light',
        ),
    )
);
