'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-305226cb.js');
const index$1 = require('./index-f92a5850.js');
const getButtonOrLink = require('./getButtonOrLink-b46cd381.js');
require('./v4-c23234d2.js');

const bsButtonCss = "bs-button{display:inline-block;}bs-button .bs-button{--btn-main:var(--bs-blue-base);--btn-secondary:var(--bs-blue-medium);--btn-highlight:var(--bs-blue-100);--btn-padding:var(--bs-space-1) var(--bs-space-4) calc(var(--bs-space-1) * 1.5);--btn-focus-pseudo-width:calc(100% + 0.5rem);align-items:center;background-color:var(--btn-main);border:none;border-radius:0.25rem;color:var(--bs-white);cursor:pointer;display:inline-flex;font-size:var(--bs-text-md);font-weight:600;justify-content:center;line-height:1.5;outline:2px solid transparent;padding:var(--btn-padding);position:relative;text-decoration:none;transition:all 100ms ease-in-out;vertical-align:middle}bs-button .bs-button:hover{background-color:var(--btn-secondary)}bs-button .bs-button:active{background-color:var(--btn-secondary);transform:scale(0.97);transform-origin:center;box-shadow:inset 0px 0px 4px 1px var(--btn-main)}bs-button .bs-button::before{border-color:transparent;border-radius:0.5rem;border-style:solid;border-width:0.125rem;content:\"\";height:calc(100% + 0.5rem);inset:-0.25rem;left:auto;position:absolute;right:auto;transition:border-color 0.125s ease-in-out;width:var(--btn-focus-pseudo-width)}bs-button .bs-button:focus::before{border-color:var(--btn-main)}bs-button .bs-button:focus-visible::before{border-color:var(--btn-main);box-shadow:none}bs-button .bs-button:focus:not(:focus-visible)::before{border-color:transparent;box-shadow:none}bs-button .bs-button:where([data-ghost]){--btn-light:var(--bs-blue-10);--btn-secondary:var(--bs-blue-10);background-color:transparent;box-shadow:inset 0 0 0 1px var(--btn-main);color:var(--btn-main)}bs-button .bs-button:where([data-ghost])::before{border-radius:0.4375rem}bs-button .bs-button:where([data-ghost]):hover,bs-button .bs-button:where([data-ghost]):focus{background-color:var(--btn-light)}bs-button .bs-button:where([data-ghost]):active{box-shadow:inset 0 0 0 1px var(--btn-main), inset 0px 0px 4px 1px var(--btn-highlight)}bs-button .bs-button:where([data-variant^=\"secondary\"]){--btn-main:var(--bs-plum-400);--btn-secondary:var(--bs-plum-300);--btn-light:var(--bs-plum-10);--btn-highlight:var(--bs-plum-100)}bs-button .dark .bs-button:where([data-variant^=\"secondary\"]){--btn-main:var(--bs-plum-200);--btn-secondary:var(--bs-plum-300);--btn-light:var(--bs-navy-400);--btn-highlight:var(--bs-plum-400)}bs-button .bs-button:where([data-variant^=\"positive\"]){--btn-main:var(--bs-purple-400);--btn-secondary:var(--bs-purple-300);--btn-light:var(--bs-purple-10);--btn-highlight:var(--bs-purple-100)}bs-button .bs-button:where([data-variant^=\"warning\"]){--btn-main:var(--bs-orange-warning);--btn-secondary:var(--bs-orange-300);--btn-light:var(--bs-orange-10);--btn-highlight:var(--bs-orange-100)}bs-button .bs-button:where([data-variant^=\"negative\"]){--btn-main:var(--bs-red-400);--btn-secondary:var(--bs-red-300);--btn-light:var(--bs-red-10);--btn-highlight:var(--bs-red-100)}bs-button .bs-button:where([data-text]){--btn-padding:0 0;--btn-focus-pseudo-width:calc(100% + 1.25rem);background-color:transparent;color:var(--bs-blue-500);cursor:pointer;font-size:var(--bs-text-md);font-weight:400;line-height:150%}bs-button .bs-button:where([data-text]):hover{color:var(--bs-blue-base);background-color:transparent;text-decoration:underline}bs-button .bs-button:where([data-text]):has(svg):hover{text-decoration:none}bs-button .bs-button:where([data-text]):active{box-shadow:none}bs-button .bs-button:where([data-size^=\"sm\"]){font-size:var(--bs-text-sm)}bs-button .bs-button:where([data-text][data-size^=\"sm\"]){font-size:var(--bs-text-base)}bs-button :where(button:disabled),bs-button .bs-button:where([aria-disabled=\"true\"]){pointer-events:none}bs-button .bs-button:where(:disabled),bs-button .bs-button:where([aria-disabled=\"true\"]){color:var(--bs-gray-400);background-color:var(--bs-gray-200)}bs-button .bs-button:where([data-ghost]):disabled,bs-button .bs-button:where([data-ghost])[aria-disabled=true]{box-shadow:inset 0 0 0 1px var(--bs-gray-400)}bs-button .bs-button:where([data-text]):disabled,bs-button .bs-button:where([data-text][aria-disabled=\"true\"]){background-color:transparent}bs-button .bs-button :where(svg:not([height])){height:var(--bs-text-base)}bs-button .bs-button:where([data-size^=\"sm\"]) :where(svg:not([height])){height:var(--bs-text-xs)}bs-button a.bs-button{align-items:center;display:inline-flex;outline:none;vertical-align:middle}bs-button .bs-button{width:100%;height:100%}.dark .bs-button:where([data-variant^=\"secondary\"]){--btn-main:var(--bs-plum-200);--btn-secondary:var(--bs-plum-300);--btn-light:var(--bs-navy-400);--btn-highlight:var(--bs-plum-400)}";

const BsButton = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    /** Native attributes to pass through to the input element. */
    this.attrs = {};
    this.variant = undefined;
    this.disabled = undefined;
    this.ghostBtn = undefined;
    this.href = undefined;
    this.passAttrs = '';
    this.textBtn = undefined;
    this.size = undefined;
  }
  handleClick(e) {
    if (this.disabled) {
      e.preventDefault();
      e.stopPropagation();
    }
  }
  componentWillLoad() {
    this.attrs = index$1.getHostAttrs(this.hostEl, [
      'download',
      'target',
      'type',
      'title',
      ...this.passAttrs.split(','),
    ]);
  }
  render() {
    const { rootTag: TagName, buttonOrLinkAttrs } = getButtonOrLink.getButtonOrLink(this, 'button');
    return (index.h(index.Host, { "data-disabled": this.disabled || undefined }, index.h(TagName, Object.assign({ "data-slot": true, class: "bs-button", "data-ghost": this.ghostBtn, "data-size": this.size, "data-text": this.textBtn, "data-variant": this.variant, disabled: this.disabled, href: this.href }, this.attrs, buttonOrLinkAttrs), index.h("slot", null))));
  }
  get hostEl() { return index.getElement(this); }
};
BsButton.style = bsButtonCss;

exports.bs_button = BsButton;

//# sourceMappingURL=bs-button.cjs.entry.js.map