@use 'sass:map';
@use 'sass:meta';
@use '../../config';
@use '../../functions' as *;
@use '../../schemas/' as *;
@use '../../../utils/map' as *;
@use '../../../color/functions' as *;
@use '../../../elevations/' as *;

////
/// @package theming
/// @group themes
/// @access public
/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
////

/// Dock Manager Theme
///
/// NOTE: This component uses a pass-through pattern with meta.keywords($rest).
/// All tokens are directly passed to the schema without automatic derivation.
/// Each token must be set individually for full customization.
///
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
/// @param {Color} $accent-color [null] - Sets the pinned header background color, the joystick background and border colors, as well as the context menu background color.
/// @param {Color} $active-color [null] - Sets the active text and border colors for tabs, panes, and menus.
/// @param {Color} $border-color [null] - Sets the global border color in the dock manager. Also sets the pane content background and the context menu active background colors.
/// @param {Color} $button-text [null] - Sets the button text color.
/// @param {Color} $context-menu-background [null] - Sets the background color for context menus.
/// @param {Color} $context-menu-background-active [null] - Sets the background color for active context menus.
/// @param {Color} $context-menu-color [null] - Sets the text color for context menus.
/// @param {Color} $context-menu-color-active [null] - Sets the text color for active context menus.
/// @param {Color} $dock-background [null] - Sets the background color of the dock manager.
/// @param {Color} $dock-text [null] - Sets the text color of the dock manager.
/// @param {Color} $drop-shadow-background [null] - Sets the drop-shadow background color.
/// @param {Color} $floating-pane-border-color [null] - Sets the border color for floating panes.
/// @param {Color} $flyout-shadow-color [null] - Sets the flyout shadow color.
/// @param {Color} $joystick-background [null] - Sets the background color of the joystick.
/// @param {Color} $joystick-background-active [null] - Sets the background color of the joysticks.
/// @param {Color} $joystick-border-color [null] - Sets the border color of the joystick.
/// @param {Color} $joystick-icon-color [null] - Sets the color for the joystick icons.
/// @param {Color} $joystick-icon-color-active [null] - Sets the color of the active joystick icons.
/// @param {Color} $pane-content-background [null] - Sets the background color of the content panes.
/// @param {Color} $pane-content-text [null] - Sets the text color of the content panes.
/// @param {Color} $pane-header-background [null] - Sets the background color for pane headers.
/// @param {Color} $pane-header-text [null] - Sets the text color for pane headers.
/// @param {Color} $pinned-header-background [null] - Sets the background colors of pinned headers.
/// @param {Color} $pinned-header-text [null] - Sets the text colors of pinned headers.
/// @param {Color} $background-color [null] - Sets the base dock manager color as well as the pane headers and tabs background colors.
/// @param {Color} $splitter-background [null] - Sets the background color for the splitters.
/// @param {Color} $splitter-handle [null] - Sets the background color for the splitter handles.
/// @param {Color} $tab-background [null] - Sets the background color for tabs.
/// @param {Color} $tab-background-active [null] - Sets the background color for active tabs.
/// @param {Color} $tab-border-color [null] - Sets the border color for tabs.
/// @param {Color} $tab-border-color-active [null] - Sets the border color for active tabs.
/// @param {Color} $tab-text [null] - Sets the text color for tabs.
/// @param {Color} $tab-text-active [null] - Sets the text color for active tabs.
/// @param {Color} $text-color [null] - Sets the text color for most elements in the dock manager. Used as the default joystick icon color.
/// @requires $light-material-schema
/// @example scss - Change the background and icon colors in icon dock-managers
///   $my-dock-manager-theme: dock-manager-theme();
///   // Pass the theme to the css-vars() mixin
///   @include css-vars($my-dock-manager-theme);
@function dock-manager-theme($schema: $light-material-schema, $rest...) {
    $selector: 'igc-dockmanager';
    $dock-manager-schema: ();

    @if map.has-key($schema, 'dockmanager') {
        $dock-manager-schema: map.get($schema, 'dockmanager');
    } @else {
        $dock-manager-schema: $schema;
    }

    $theme: digest-schema($dock-manager-schema);

    @return extend(
        $theme,
        (
            selector: $selector,
            prefix: 'igc',
        ),
        meta.keywords($rest)
    );
}
