@use '../../../../utils/map' as *;
@use '../../../../typography/functions' as *;
@use '../elevation/tile-manager' as *;

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

/// Generates a light base tile manager schema.
/// @type Map
/// @prop {Map} background [color: ('gray', 100)] - The background color of the tile manager component.
/// @prop {Map} tile-background [color: ('surface', 500)] - The background color of the tile component inside the tile manager.
/// @prop {Map} title-color [color: ('gray', 900)] - The title color of the tile component.
/// @prop {Map} header-background [color: ('surface', 500)] - The background color of the tile header component.
/// @prop {Map} content-background [color: ('surface', 500)] - The background color of the tile component content.
/// @prop {Map} content-color [color: ('gray', 700)] - The text color of the tile component content.
/// @prop {Color} border-color [transparent] - The border color of the tile component.
/// @prop {Map} hover-border-color [color: ('gray', 400)] - The border color of the tile component on hover.
/// @prop {Map} placeholder-background [color: ('primary', 100, .3)] - The background color of the ghost element that appears during drag and drop and while resizing.
/// @prop {Map} overlay-background [color: ('primary', 100, .6)] - The background color of the ghost element that appears on top of the tile that will be swapped.
/// @prop {Map} ghost-border [color: ('primary', 500)] - The border color of the ghost element that appears during drag and drop and while resizing.
/// @prop {Color} divider-color [transparent] - The color of the divider component inside the tile header.
/// @prop {Number} border-radius [rem(4px)] - The border radius of the tile component.
/// @prop {Number} default-size [2] - The default size used for the tile manager component.
/// @requires $default-elevation-tile
$light-tile-manager: extend(
    $default-elevation-tile,
    (
        background: (
            color: (
                'gray',
                100,
            ),
        ),

        tile-background: (
            color: (
                'surface',
                500,
            ),
        ),

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

        header-background: (
            color: (
                'surface',
                500,
            ),
        ),

        content-background: (
            color: (
                'surface',
                500,
            ),
        ),

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

        border-color: transparent,

        hover-border-color: (
            color: (
                'gray',
                400,
            ),
        ),

        placeholder-background: (
            color: (
                'primary',
                100,
                0.3,
            ),
        ),

        overlay-background: (
            color: (
                'primary',
                100,
                0.6,
            ),
        ),

        ghost-border: (
            color: (
                'primary',
                500,
            ),
        ),

        divider-color: transparent,
        border-radius: rem(4px),
        default-size: 2,
        _meta: (
            name: 'tile-manager',
            variant: 'light',
        ),
    )
);

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

/// Generates a fluent tile manager schema.
/// @type Map
/// @prop {Map} placeholder-background [color: ('primary', 100, .2)] - The background color of the ghost element that appears during drag and drop and while resizing.
/// @prop {Map} overlay-background [color: ('primary', 100, .5)] - The background color of the ghost element that appears on top of the tile that will be swapped.
/// @prop {Number} border-radius [0] - The border radius of the tile component.
/// @requires $light-tile-manager
$fluent-tile-manager: extend(
    $light-tile-manager,
    $default-elevation-tile,
    (
        placeholder-background: (
            color: (
                'primary',
                100,
                0.2,
            ),
        ),

        overlay-background: (
            color: (
                'primary',
                100,
                0.5,
            ),
        ),

        border-radius: 0,

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

/// Generates a bootstrap tile manager schema.
/// @type Map
/// @prop {Map} background [color: ('gray', 200)] - The background color of the tile manager component.
/// @prop {Map} border-color [color: ('gray', 300)] - The border color of the tile component.
/// @prop {Map} placeholder-background [color: ('primary', 300, .15)] - The background color of the ghost element that appears during drag and drop and while resizing.
/// @prop {Map} overlay-background [color: ('primary', 300, .4)] - The background color of the ghost element that appears on top of the tile that will be swapped.
/// @requires $light-tile-manager
$bootstrap-tile-manager: extend(
    $light-tile-manager,
    $default-elevation-tile,
    (
        background: (
            color: (
                'gray',
                200,
            ),
        ),

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

        placeholder-background: (
            color: (
                'primary',
                300,
                0.15,
            ),
        ),

        overlay-background: (
            color: (
                'primary',
                300,
                0.4,
            ),
        ),

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

/// Generates an indigo tile manager schema.
/// @type Map
/// @prop {Map} background [color: ('surface', 500)] - The background color of the tile manager component.
/// @prop {Map} tile-background [contrast-color: ('gray', 900)] - The background color of the tile component inside the tile manager.
/// @prop {Map} title-color [color: ('gray', 800)] - The title color of the tile component.
/// @prop {Map} header-background [contrast-color: ('gray', 900)] - The background color of the tile header component.
/// @prop {Map} content-background [contrast-color: ('gray', 900)] - The background color of the tile component content.
/// @prop {Map} border-color [color: ('gray', 400)] - The border color of the tile component.
/// @prop {Map} hover-border-color [color: ('gray', 500)] - The border color of the tile component on hover.
/// @prop {Map} placeholder-background [color: ('primary', 100, .2)] - The background color of the ghost element that appears during drag and drop and while resizing.
/// @prop {Number} border-radius [rem(6px)] - The border radius of the tile component.
/// @requires $light-tile-manager
$indigo-tile-manager: extend(
    $light-tile-manager,
    $default-elevation-tile,
    (
        background: (
            color: (
                'surface',
                500,
            ),
        ),

        tile-background: (
            contrast-color: (
                'gray',
                900,
            ),
        ),

        title-color: (
            color: (
                'gray',
                800,
            ),
        ),

        header-background: (
            contrast-color: (
                'gray',
                900,
            ),
        ),

        content-background: (
            contrast-color: (
                'gray',
                900,
            ),
        ),

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

        hover-border-color: (
            color: (
                'gray',
                500,
            ),
        ),

        placeholder-background: (
            color: (
                'primary',
                100,
                0.2,
            ),
        ),

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