import { Component, h, Host, Prop } from '@stencil/core';
import { light } from '../../theme/light';
function convertThemeToCSSVariables(theme) {
  return {
    '--font-family': theme.fontFamily,
    '--font-family-title': theme.fontFamilyTitle,
    '--font-family-src': theme.fontFamilySrc,
    '--font-size-small': '12px',
    '--font-size-medium': '16px',
    '--font-size-large': '20px',
    '--color-primary': theme.colorPrimary,
    '--color-primary-light': theme.colorPrimaryLight,
    '--color-primary-lightest': theme.colorPrimaryLightest,
    '--color-secondary': theme.colorSecondary,
    '--color-secondary-light': theme.colorSecondaryLight,
    '--color-secondary-lightest': theme.colorSecondaryLightest,
    '--color-danger': theme.colorDanger,
    '--color-danger-light': theme.colorDangerLight,
    '--color-danger-lightest': theme.colorDangerLightest,
    '--color-warning': theme.colorWarning,
    '--color-warning-light': theme.colorWarningLight,
    '--color-warning-lightest': theme.colorWarningLightest,
    '--color-neutral': theme.colorNeutral,
    '--color-neutral-light': theme.colorNeutralLight,
    '--color-neutral-lightest': theme.colorNeutralLightest,
    '--color-disabled': theme.colorDisabled,
    '--color-text': theme.colorText,
    '--color-text-title': theme.colorTextTitle,
    '--color-text-secondary': theme.colorTextSecondary,
    '--color-border': theme.colorBorder,
    // '--color-border-secondary': theme.colorBorderSecondary,
    '--color-background-primary': theme.colorBackgroundPrimary,
    '--color-background-secondary': theme.colorBackgroundSecondary,
    '--color-elevated-item-background': theme.colorElevatedItemBackground,
    '--color-elevated-item-shadow': theme.colorElevatedItemShadow,
    '--color-input-background': theme.colorInputBackground,
    '--color-tooltip-background': theme.colorTooltipBackground,
    '--color-tooltip-text': theme.colorTooltipTextColor,
    '--color-highlighted-code-background': theme.colorHighlightedCodeBackground,
    '--corner-radius': theme.cornerRadius,
    '--spacing-unit': theme.spacingUnit,
    '--line-height': theme.lineHeight,
  };
}
export class ThemeProvider {
  constructor() {
    this.theme = light;
  }
  render() {
    return (h(Host, { class: {
        'fit-height': this.fitHeight,
        'with-background': this.colorBackground,
      }, style: convertThemeToCSSVariables(Object.assign(Object.assign({}, this.theme), { fontFamily: this.fontFamily || this.theme.fontFamily, fontFamilySrc: this.fontFamilyTitle || this.theme.fontFamilyTitle })) },
      h("slot", null)));
  }
  static get is() { return "dvn-theme-provider"; }
  static get originalStyleUrls() { return {
    "$": ["dvn-theme-provider.css"]
  }; }
  static get styleUrls() { return {
    "$": ["dvn-theme-provider.css"]
  }; }
  static get properties() { return {
    "theme": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "AlacaTheme",
        "resolved": "AlacaTheme",
        "references": {
          "AlacaTheme": {
            "location": "import",
            "path": "../../theme"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "light"
    },
    "fitHeight": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "fit-height",
      "reflect": false
    },
    "colorBackground": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "color-background",
      "reflect": false
    },
    "fontFamily": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "font-family",
      "reflect": false
    },
    "fontFamilyTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "font-family-title",
      "reflect": false
    }
  }; }
}
