@use "sass:map";

@use "../../../mixins" as *;
@use "../../../utils" as *;
@use "../../palette" as *;
@use "../../text" as *;

$entry-default-accent: (
  "dark": (
    "label-fg": fg(muted, dark),
    "value-fg": fg(core, dark),
    "border-bg": rgba(#fff, 0.07),
    "bg": (
      "outline": #78aeed,
      "overlay": transparent,
      "main": #343434,
    ),
  ),
  "light": (
    "label-fg": fg(muted, light),
    "value-fg": fg(core, light),
    "border-bg": rgba(#000, 0.07),
    "bg": (
      "outline": pcolor(blue, 4),
      "overlay": transparent,
      "main": #f5f5f5,
    ),
  ),
) !default;

@function map-to-entry($theme, $accent, $colors) {
  $bg: map.get($colors, "bg");
  $fg: $bg;

  @return (
    "label-fg": if($theme == "dark", fg-src($bg, base), $bg),
    "value-fg": fg-src($fg, base),
    "border-bg": rgba($bg, 0.07),
    "bg": (
      "overlay": if($theme == "dark", rgba($bg, 0.15), rgba($bg, 0.2)),
      "outline": #{$fg},
    )
  );
}
