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

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

/// Generates a base light splitter schema.
/// @type Map
/// @prop {Map} bar-color [color: ('gray', 200)] - The background color of the bar.
/// @prop {Map} handle-color [color: ('gray', 400)] - The color for the bar drag handle.
/// @prop {Map} expander-color [color: ('gray', 400)] - The color for the arrow expander's.
/// @prop {List} border-radius [(rem(2px), rem(0), rem(2px))] - The border radius used for splitter.
/// @prop {Map} focus-color [color: ('primary', 500)] - The color used for focused splitter bar.
/// @prop {Map} bar-color-active [color: ('gray', 300)] - The background color of the bar when pressed.
/// @prop {Map} handle-color-active [color: ('gray', 600)] - The color for the bar drag handle when pressed.
/// @prop {Map} expander-color-active [color: ('gray', 600)] - The color for the arrow expander's when pressed.
/// @prop {Number} size [4px] - The size of the splitter, it's width for vertical and height for horizontal splitter.
$light-splitter: (
    bar-color: (
        color: (
            'gray',
            200,
        ),
    ),

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

    handle-color: (
        color: (
            'gray',
            400,
        ),
    ),

    expander-color: (
        color: (
            'gray',
            400,
        ),
    ),

    bar-color-active: (
        color: (
            'gray',
            300,
        ),
    ),

    handle-color-active: (
        color: (
            'gray',
            600,
        ),
    ),

    expander-color-active: (
        color: (
            'gray',
            600,
        ),
    ),

    size: rem(4px),
    border-radius: (
        border-radius: (
            rem(2px),
            rem(0),
            rem(2px),
        ),
    ),

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

/// Generates a material splitter schema.
/// @type Map
/// @prop {Map} focus-color [color: ('secondary', 500)] - The color used for focused splitter bar.
/// @requires $light-splitter
$material-splitter: extend(
    $light-splitter,
    (
        focus-color: (
            color: (
                'secondary',
                500,
            ),
        ),
        _meta: (
            theme: 'material',
        ),
    )
);

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

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

/// Generates an indigo splitter schema.
/// @type Map
/// @prop {Map} bar-color [color: ('gray', 400)] - The background color of the bar.
/// @prop {Map} focus-color [color: ('primary', 400)] - The color used for focused splitter bar.
/// @prop {Map} handle-color [color: ('gray', 700)] - The color for the bar drag handle.
/// @prop {Map} expander-color [color: ('gray', 700)] - The color for the arrow expander.
/// @prop {Map} bar-color-active [color: ('gray', 500)] - The background color of the bar when pressed.
/// @prop {Map} handle-color-active [color: ('gray', 900)] - The color for the bar drag handle when pressed.
/// @prop {Map} expander-color-active [color: ('gray', 900)] - The color for the arrow expander's when pressed.
/// @requires $light-splitter
$indigo-splitter: extend(
    $light-splitter,
    (
        bar-color: (
            color: (
                'gray',
                400,
            ),
        ),

        focus-color: (
            color: (
                'primary',
                400,
            ),
        ),

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

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

        bar-color-active: (
            color: (
                'gray',
                500,
            ),
        ),

        handle-color-active: (
            color: (
                'gray',
                900,
            ),
        ),

        expander-color-active: (
            color: (
                'gray',
                900,
            ),
        ),

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