@use "sass:map";
@use "../core/_index.scss" as *;

/// The border radius of the Tooltip.
/// @group tooltip
$kendo-tooltip-border-radius: k-border-radius(md) !default;
/// The horizontal padding of the Tooltip.
/// @group tooltip
$kendo-tooltip-padding-x: k-spacing(2) !default;
/// The vertical padding of the Tooltip.
/// @group tooltip
$kendo-tooltip-padding-y: k-spacing(2) !default;
/// The width of the border around the Tooltip.
/// @group tooltip
$kendo-tooltip-border-width: 0px !default;
/// The font family of the Tooltip.
/// @group tooltip
$kendo-tooltip-font-family: var( --kendo-font-family, inherit ) !default;
/// The font size of the Tooltip.
/// @group tooltip
$kendo-tooltip-font-size: var( --kendo-font-size-sm, inherit ) !default;
/// The line height of the Tooltip.
/// @group tooltip
$kendo-tooltip-line-height: var( --kendo-line-height, normal ) !default;

/// The font size of the Tooltip title.
/// @group tooltip
$kendo-tooltip-title-font-size: calc( var( --kendo-font-size-sm, .75rem ) * 1.25 ) !default;
/// The line height of the Tooltip title.
/// @group tooltip
$kendo-tooltip-title-line-height: var( --kendo-line-heigh-xs, normal ) !default;
/// The margin of the Tooltip title.
/// @group tooltip
$kendo-tooltip-title-margin: k-spacing(1) !default;

/// The size of the Tooltip callout.
/// @group tooltip
$kendo-tooltip-callout-size: k-spacing(2) !default;

/// The default background of the Tooltip.
/// @group tooltip
$kendo-tooltip-bg: if($kendo-enable-color-system, k-color( app-surface ), $kendo-color-white) !default;
/// The default text color of the Tooltip.
/// @group tooltip
$kendo-tooltip-text: var( --kendo-component-text, initial ) !default;
/// The default border color of the Tooltip.
/// @group tooltip
$kendo-tooltip-border: transparent !default;
/// The box-shadow of the Tooltip.
/// @group tooltip
$kendo-tooltip-shadow: var( --kendo-box-shadow-depth-2, none ) !default;

/// The text color of the Tooltip button.
/// @group tooltip
$kendo-tooltip-button-text: if($kendo-enable-color-system, k-color( subtle ), k-get-theme-color-var( neutral-130, initial )) !default;

/// Theme variations for the tooltip.
$kendo-tooltip-brand-colors: (
    secondary: if($kendo-enable-color-system, secondary, neutral),
    tertiary: tertiary,
    success: success,
    warning: warning,
    error: error,
    info: info
 ) !default;

// Matrix with tooltip theme colors in the order: bg, color, border
$_tc-tooltip-matrix: (
    (normal: if($kendo-enable-color-system, (color-subtle, color-on-subtle, color-subtle), (20, 160, 20))),
) !default;

$_tc-tooltip-primary-matrix: (
    (normal: if($kendo-enable-color-system, (color, on-color, color), (100, $kendo-color-white, 100))),
) !default;

$_tc-tooltip-dark-matrix: (
    (normal: if($kendo-enable-color-system, (color, on-color, color), (160, $kendo-color-white, 160))),
) !default;

$_tc-tooltip-light-matrix: (
    (normal: if($kendo-enable-color-system, (color, on-color, color), (50, 160, 50))),
) !default;

/// Theme colors map for the tooltip variations.
$kendo-tooltip-theme-colors: () !default;

@each $ui-states in $_tc-tooltip-primary-matrix {
    $kendo-tooltip-theme-colors: map.deep-merge(
        $kendo-tooltip-theme-colors,
        k-generate-theme-variation( primary, primary, $ui-states )
    );
}

@each $ui-states in $_tc-tooltip-matrix {
    @each $brand-color, $palette in $kendo-tooltip-brand-colors {
        $kendo-tooltip-theme-colors: map.deep-merge(
            $kendo-tooltip-theme-colors,
            k-generate-theme-variation( $brand-color, $palette, $ui-states )
        );
    };
}

@each $ui-states in $_tc-tooltip-dark-matrix {
    $kendo-tooltip-theme-colors: map.deep-merge(
        $kendo-tooltip-theme-colors,
        k-generate-theme-variation( dark, if($kendo-enable-color-system, dark, neutral), $ui-states )
    );
}

@each $ui-states in $_tc-tooltip-light-matrix {
    $kendo-tooltip-theme-colors: map.deep-merge(
        $kendo-tooltip-theme-colors,
        k-generate-theme-variation( light, if($kendo-enable-color-system, light, neutral), $ui-states )
    );
}
