@use "sass:map";
@use "utilities.scss" as *;
@use "../variables/shadowsDnLight.scss" as *;
@use "../variables/shadowsDnDark.scss" as *;
@forward "../variables/shadowsList.scss";

@mixin ds-shadow($component, $theme: light) {
  $tmpMap: map.get($shadowsDnLight, $component);

  @if $theme == dark {
    $tmpMap: map.get($shadowsDnDark, $component);
  }

  $x: map.get($tmpMap, "x");
  $y: map.get($tmpMap, "y");
  $blur: map.get($tmpMap, "blur");
  $spread: map.get($tmpMap, "spread");
  $color: map.get($tmpMap, "color");

  @if map.get($tmpMap, "type") == "innerShadow" {
    --ds-shadow-#{$component}: inset #{$x}px #{$y}px #{$blur}px #{$spread}px #{$color};
  } @else {
    --ds-shadow-#{$component}: #{$x}px #{$y}px #{$blur}px #{$spread}px #{$color};
  }
}

@function ds-shadow-get-box-shadow($component) {
  @return var($component);
}

@mixin get-shadow-scheme($type: light) {
  @each $key in map.keys($shadowsDnLight) {
    @include ds-shadow($key, $type);
  }
}
