import{__decorate as t}from"../../_virtual/_tslib.js";import'./../../external/@lit/reactive-element/reactive-element.js';import{html as e}from'./../../external/lit-html/lit-html.js';import{LitElement as i}from'./../../external/lit-element/lit-element.js';import{customElement as s}from'./../../external/@lit/reactive-element/decorators/custom-element.js';import{property as o}from'./../../external/@lit/reactive-element/decorators/property.js';import{state as r}from'./../../external/@lit/reactive-element/decorators/state.js';import'./../../external/@lit/reactive-element/decorators/query-assigned-elements.js';import{ifDefined as n}from'./../../external/lit-html/directives/if-defined.js';import{classMap as l}from'./../../external/lit-html/directives/class-map.js';import{BUTTON_TYPES as d,BUTTON_KINDS as a,BUTTON_SIZES as m,BUTTON_ICON_POSITION as p}from"./defs.js";import c from"./button.scss.js";let h=class extends i{constructor(){super(...arguments),this.internals=this.attachInternals(),this.description="",this.type=d.BUTTON,this.kind=a.PRIMARY_APP,this.href="",this.size=m.MEDIUM,this.iconPosition=p.CENTER,this.disabled=!1,this.destructive=!1}render(){const t={[a.PRIMARY_APP]:"primary-app",[a.PRIMARY_WEB]:"primary-web",[a.SECONDARY]:"secondary",[a.TERTIARY]:"tertiary"}[this.kind],i={[`kd-btn--${t}${this.destructive?"-destructive":""}`]:!0,[`kd-btn--${t}`]:!this.destructive,"kd-btn--large":this.size===m.LARGE,"kd-btn--small":this.size===m.SMALL,"kd-btn--medium":this.size===m.MEDIUM,[`kd-btn--icon-${this.iconPosition}`]:!!this.iconPosition};return e`
      ${""!==this.href?e`
            <a
              class=${l(i)}
              href=${this.href}
              ?disabled=${this.disabled}
              aria-label=${n(this.description||void 0)}
              @click=${t=>this.handleClick(t)}
            >
              <span><slot></slot><slot name="icon"></slot></span>
            </a>
          `:e`
            <button
              class=${l(i)}
              type=${this.type}
              ?disabled=${this.disabled}
              aria-label=${n(this.description||void 0)}
              @click=${t=>this.handleClick(t)}
            >
              <span><slot></slot><slot name="icon"></slot></span>
            </button>
          `}
    `}handleClick(t){this.internals.form&&("submit"===this.type?this.internals.form.submit():"reset"===this.type&&this.internals.form.reset());const e=new CustomEvent("on-click",{detail:{origEvent:t}});this.dispatchEvent(e)}};h.styles=[c],h.formAssociated=!0,t([r()],h.prototype,"internals",void 0),t([o({type:String})],h.prototype,"description",void 0),t([o({type:String})],h.prototype,"type",void 0),t([o({type:String})],h.prototype,"kind",void 0),t([o({type:String})],h.prototype,"href",void 0),t([o({type:String})],h.prototype,"size",void 0),t([o({type:String})],h.prototype,"iconPosition",void 0),t([o({type:Boolean,reflect:!0})],h.prototype,"disabled",void 0),t([o({type:Boolean,reflect:!0})],h.prototype,"destructive",void 0),h=t([s("kd-button")],h);export{h as Button};
//# sourceMappingURL=button.js.map
