import { proxyCustomElement, HTMLElement, h, Host, Fragment } from '@stencil/core/internal/client';
import { a as getHostAttrs } from './index2.js';

const bsLabelCss = "bs-label{display:inline-block;width:100%}bs-label :where(label,legend){--label-color:var(--bs-ink-base);color:var(--label-color);display:inline-block;font-size:var(--bs-text-sm);font-weight:600;line-height:var(--bs-leading-base);width:100%}bs-label :where([data-required]){color:var(--bs-ink-red)}bs-label :where(label[data-disabled],[data-disabled] [data-required],[data-disabled] label){--label-color:var(--bs-ink-disabled)}.bs-boolean label,.bs-boolean bs-label{font-size:var(--bs-text-base);font-weight:400;line-height:1.5;width:auto}.bs-boolean bs-label label{padding-inline-end:0.5em}.bs-boolean input+bs-label label{padding-inline:0.5em 0}.bs-boolean[data-size=sm] bs-label,.bs-boolean[data-size=sm] bs-label label{font-size:var(--bs-text-xs);line-height:100%}";

const BsLabel = /*@__PURE__*/ proxyCustomElement(class BsLabel extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    /** Native attributes to pass through to the input element. */
    this.attrs = {};
    this.disabled = undefined;
    this.for = undefined;
    this.hide = undefined;
    this.passAttrs = '';
    this.required = undefined;
  }
  componentWillLoad() {
    this.attrs = getHostAttrs(this.hostEl, this.passAttrs.split(','));
  }
  render() {
    return (h(Host, { class: this.hide ? 'visually-hidden' : '' }, h("label", Object.assign({ "data-disabled": this.disabled, htmlFor: this.for }, this.attrs), h("span", { "data-slot": true }, h("slot", null)), this.required && (h(Fragment, null, h("span", { "data-required": true, "aria-hidden": "true" }, " *"), h("span", { class: "visually-hidden" }, "required"))))));
  }
  get hostEl() { return this; }
  static get style() { return bsLabelCss; }
}, [4, "bs-label", {
    "disabled": [4],
    "for": [1],
    "hide": [4],
    "passAttrs": [1, "pass-attrs"],
    "required": [4]
  }]);
function defineCustomElement() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["bs-label"];
  components.forEach(tagName => { switch (tagName) {
    case "bs-label":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, BsLabel);
      }
      break;
  } });
}

export { BsLabel as B, defineCustomElement as d };

//# sourceMappingURL=bs-label2.js.map