monobill-mintui 0.6.701 → 0.6.703

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,7 +129,11 @@
129
129
  "icon"
130
130
  ],
131
131
  "table": [],
132
- "tabs": [],
132
+ "tabs": [
133
+ "button",
134
+ "spinner",
135
+ "icon"
136
+ ],
133
137
  "tags": [
134
138
  "chip",
135
139
  "icon",
package/dist/alert.css CHANGED
@@ -1,2 +1,2 @@
1
1
  /* mint-ui component style: alert */
2
- @layer theme, base, components, utilities;/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer utilities{.static{position:static}.container{width:100%}}@layer components{mint-alert{box-sizing:border-box;color:var(--mint-color-text,#28372d);background:var(--mint-color-surface-raised,#fff);border:1px solid var(--mint-color-border,#dfe6e0);border-radius:.75rem;padding:0;display:block;overflow:hidden;box-shadow:0 1px 2px #15241a0a}mint-alert[tone=success]{border-color:#bbf7d0}mint-alert[tone=warning]{border-color:#fde68a}mint-alert[tone=danger]{border-color:#fecaca}:where(.dark,.dark *) mint-alert[tone=success]{border-color:#166534}:where(.dark,.dark *) mint-alert[tone=warning]{border-color:#854d0e}:where(.dark,.dark *) mint-alert[tone=danger]{border-color:#991b1b}mint-alert :is(.text-gray-900,.text-gray-800,.dark\:text-white,.dark\:text-gray-100){color:var(--mint-color-text,#28372d)!important}mint-alert :is(.text-gray-700,.text-gray-600,.text-gray-500,.dark\:text-gray-300,.dark\:text-gray-400){color:var(--mint-color-text-secondary,#66736a)!important}mint-alert :is(.bg-white,.dark\:bg-mint-elevated){background-color:var(--mint-color-surface-raised,#fff)!important}mint-alert :is(.bg-gray-50,.bg-gray-100,.dark\:bg-mint-canvas,.dark\:bg-mint-hover){background-color:var(--mint-color-surface-muted,#f6f8f4)!important}mint-alert :is(.border-gray-200,.border-gray-300,.dark\:border-mint-divider){border-color:var(--mint-color-border,#dfe6e0)!important}mint-alert>.mint-alert-header{background:var(--mint-color-surface-muted,#f6f8f4);align-items:center;gap:.75rem;min-height:3.5rem;padding:1rem 1.25rem;display:flex}mint-alert[tone=success]>.mint-alert-header{background:#dcfce7}mint-alert[tone=warning]>.mint-alert-header{background:#fef9c3}mint-alert[tone=danger]>.mint-alert-header{background:#fee2e2}:where(.dark,.dark *) mint-alert>.mint-alert-header{background:#ffffff0d}:where(.dark,.dark *) mint-alert[tone=success]>.mint-alert-header{background:#14532d4d}:where(.dark,.dark *) mint-alert[tone=warning]>.mint-alert-header{background:#713f124d}:where(.dark,.dark *) mint-alert[tone=danger]>.mint-alert-header{background:#7f1d1d4d}mint-alert>.mint-alert-icon{flex-shrink:0;width:1.25rem;height:1.25rem;display:flex}mint-alert[tone=success]>.mint-alert-header>.mint-alert-icon{color:#16a34a}mint-alert[tone=warning]>.mint-alert-header>.mint-alert-icon{color:#ca8a04}mint-alert[tone=danger]>.mint-alert-header>.mint-alert-icon{color:#dc2626}:where(.dark,.dark *) mint-alert[tone=success]>.mint-alert-header>.mint-alert-icon{color:#4ade80}:where(.dark,.dark *) mint-alert[tone=warning]>.mint-alert-header>.mint-alert-icon{color:#facc15}:where(.dark,.dark *) mint-alert[tone=danger]>.mint-alert-header>.mint-alert-icon{color:#f87171}mint-alert>.mint-alert-heading{color:var(--mint-color-text,#28372d);flex:1;margin:0;font-size:1rem;font-weight:600;line-height:1.5}mint-alert>.mint-alert-dismiss{cursor:pointer;background:0 0;border:0;border-radius:.25rem;flex-shrink:0;padding:.25rem}mint-alert>.mint-alert-dismiss:hover{background:#0000001a}:where(.dark,.dark *) mint-alert>.mint-alert-dismiss:hover{background:#ffffff1a}mint-alert>.mint-alert-close-icon{width:1rem;height:1rem;color:var(--mint-color-text-secondary,#66736a)}mint-alert>.mint-alert-body{background:var(--mint-color-surface-raised,#fff);padding:1rem 1.25rem;font-size:.875rem;line-height:1.5}mint-alert>.mint-alert-body>*+*{margin-block-start:.75rem}}
2
+ @layer theme, base, components, utilities;/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer utilities{.static{position:static}.container{width:100%}}@layer components{mint-alert{box-sizing:border-box;color:var(--mint-color-text,#28372d);background:var(--mint-color-surface-raised,#fff);border:1px solid var(--mint-color-border,#dfe6e0);border-radius:.75rem;padding:0;display:block;overflow:hidden;box-shadow:0 1px 2px #15241a0a}mint-alert[tone=success]{border-color:#bbf7d0}mint-alert[tone=warning]{border-color:#fde68a}mint-alert[tone=danger]{border-color:#fecaca}:where(.dark,.dark *) mint-alert[tone=success]{border-color:#166534}:where(.dark,.dark *) mint-alert[tone=warning]{border-color:#854d0e}:where(.dark,.dark *) mint-alert[tone=danger]{border-color:#991b1b}mint-alert :is(.text-gray-900,.text-gray-800,.dark\:text-white,.dark\:text-gray-100){color:var(--mint-color-text,#28372d)!important}mint-alert :is(.text-gray-700,.text-gray-600,.text-gray-500,.dark\:text-gray-300,.dark\:text-gray-400){color:var(--mint-color-text-secondary,#66736a)!important}mint-alert :is(.bg-white,.dark\:bg-mint-elevated){background-color:var(--mint-color-surface-raised,#fff)!important}mint-alert :is(.bg-gray-50,.bg-gray-100,.dark\:bg-mint-canvas,.dark\:bg-mint-hover){background-color:var(--mint-color-surface-muted,#f6f8f4)!important}mint-alert :is(.border-gray-200,.border-gray-300,.dark\:border-mint-divider){border-color:var(--mint-color-border,#dfe6e0)!important}mint-alert>.mint-alert-header{background:var(--mint-color-surface-muted,#f6f8f4);align-items:center;gap:.75rem;min-height:3.5rem;padding:1rem 1.25rem;display:flex}mint-alert[tone=success]>.mint-alert-header{background:#dcfce7}mint-alert[tone=warning]>.mint-alert-header{background:#fef9c3}mint-alert[tone=danger]>.mint-alert-header{background:#fee2e2}:where(.dark,.dark *) mint-alert>.mint-alert-header{background:#ffffff0d}:where(.dark,.dark *) mint-alert[tone=success]>.mint-alert-header{background:#14532d4d}:where(.dark,.dark *) mint-alert[tone=warning]>.mint-alert-header{background:#713f124d}:where(.dark,.dark *) mint-alert[tone=danger]>.mint-alert-header{background:#7f1d1d4d}mint-alert>.mint-alert-header>.mint-alert-icon{flex-shrink:0;width:1.25rem;height:1.25rem;display:flex}mint-alert[tone=success]>.mint-alert-header>.mint-alert-icon{color:#16a34a}mint-alert[tone=warning]>.mint-alert-header>.mint-alert-icon{color:#ca8a04}mint-alert[tone=danger]>.mint-alert-header>.mint-alert-icon{color:#dc2626}:where(.dark,.dark *) mint-alert[tone=success]>.mint-alert-header>.mint-alert-icon{color:#4ade80}:where(.dark,.dark *) mint-alert[tone=warning]>.mint-alert-header>.mint-alert-icon{color:#facc15}:where(.dark,.dark *) mint-alert[tone=danger]>.mint-alert-header>.mint-alert-icon{color:#f87171}mint-alert>.mint-alert-header>.mint-alert-heading{color:var(--mint-color-text,#28372d);flex:1;margin:0;font-size:1rem;font-weight:600;line-height:1.5}mint-alert>.mint-alert-header>.mint-alert-dismiss{cursor:pointer;background:0 0;border:0;border-radius:.25rem;flex-shrink:0;margin-left:auto;padding:.25rem;display:flex}mint-alert>.mint-alert-header>.mint-alert-dismiss:hover{background:#0000001a}:where(.dark,.dark *) mint-alert>.mint-alert-header>.mint-alert-dismiss:hover{background:#ffffff1a}mint-alert>.mint-alert-header>.mint-alert-dismiss>.mint-alert-close-icon{width:1rem;height:1rem;color:var(--mint-color-text-secondary,#66736a)}mint-alert>.mint-alert-body{background:var(--mint-color-surface-raised,#fff);padding:1rem 1.25rem;font-size:.875rem;line-height:1.5}mint-alert>.mint-alert-body>*+*{margin-block-start:.75rem}}
@@ -25,16 +25,13 @@ declare class MintAlert extends HTMLElement {
25
25
  set heading(value: string);
26
26
  get tone(): AlertTone;
27
27
  set tone(value: AlertTone);
28
- get dismissable(): boolean;
29
- set dismissable(value: boolean);
30
- /** Alias with the common spelling for easier typed framework bindings. */
31
28
  get dismissible(): boolean;
32
29
  set dismissible(value: boolean);
33
30
  private cleanupDismissListener;
34
31
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
35
32
  private getHeading;
36
33
  private getTone;
37
- private isDismissable;
34
+ private isDismissible;
38
35
  private getIconName;
39
36
  private getAriaLive;
40
37
  render(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/alert/Alert.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAA;AACtB,OAAO,eAAe,CAAA;AACtB,OAAO,oBAAoB,CAAA;AAC3B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,qBAAqB,CAAA;AAE5B,KAAK,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE1D,cAAM,SAAU,SAAQ,WAAW;IACjC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,eAAe,CAA2B;IAClD,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,eAAe,CAAoC;IAC3D,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,cAAc,CAAgC;IACtD,OAAO,CAAC,oBAAoB,CAAQ;;IAOpC,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,IAAI,IAAI;IAM5B,8FAA8F;IAC9F,IAAI,OAAO,IAAI,MAAM,CAA8C;IACnE,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAuD;IAEhF,IAAI,IAAI,IAAI,SAAS,CAA0B;IAC/C,IAAI,IAAI,CAAC,KAAK,EAAE,SAAS,EAAsC;IAE/D,IAAI,WAAW,IAAI,OAAO,CAAgC;IAC1D,IAAI,WAAW,CAAC,KAAK,EAAE,OAAO,EAA8D;IAE5F,0EAA0E;IAC1E,IAAI,WAAW,IAAI,OAAO,CAA4B;IACtD,IAAI,WAAW,CAAC,KAAK,EAAE,OAAO,EAA8B;IAE5D,OAAO,CAAC,sBAAsB;IAO9B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAKnB,MAAM,IAAI,IAAI;IAUd,OAAO,CAAC,aAAa;IAuHrB,OAAO,CAAC,yBAAyB;CAalC;AAOD,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/alert/Alert.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,CAAA;AACtB,OAAO,eAAe,CAAA;AACtB,OAAO,oBAAoB,CAAA;AAC3B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,qBAAqB,CAAA;AAC5B,OAAO,qBAAqB,CAAA;AAE5B,KAAK,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE1D,cAAM,SAAU,SAAQ,WAAW;IACjC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,eAAe,CAA2B;IAClD,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,eAAe,CAAoC;IAC3D,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,cAAc,CAAgC;IACtD,OAAO,CAAC,oBAAoB,CAAQ;;IAOpC,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,IAAI,IAAI;IAM5B,8FAA8F;IAC9F,IAAI,OAAO,IAAI,MAAM,CAA8C;IACnE,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAuD;IAEhF,IAAI,IAAI,IAAI,SAAS,CAA0B;IAC/C,IAAI,IAAI,CAAC,KAAK,EAAE,SAAS,EAAsC;IAE/D,IAAI,WAAW,IAAI,OAAO,CAAgC;IAC1D,IAAI,WAAW,CAAC,KAAK,EAAE,OAAO,EAA8D;IAE5F,OAAO,CAAC,sBAAsB;IAO9B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IAKnB,MAAM,IAAI,IAAI;IAUd,OAAO,CAAC,aAAa;IAuHrB,OAAO,CAAC,yBAAyB;CAalC;AAOD,eAAe,SAAS,CAAA"}
@@ -45,7 +45,7 @@ var n = class extends HTMLElement {
45
45
  static get observedAttributes() {
46
46
  return [
47
47
  "heading",
48
- "dismissable",
48
+ "dismissible",
49
49
  "tone"
50
50
  ];
51
51
  }
@@ -70,17 +70,11 @@ var n = class extends HTMLElement {
70
70
  set tone(e) {
71
71
  this.setAttribute("tone", e);
72
72
  }
73
- get dismissable() {
74
- return this.isDismissable();
75
- }
76
- set dismissable(e) {
77
- this.setAttribute("dismissable", String(!!e));
78
- }
79
73
  get dismissible() {
80
- return this.dismissable;
74
+ return this.isDismissible();
81
75
  }
82
76
  set dismissible(e) {
83
- this.dismissable = e;
77
+ this.setAttribute("dismissible", String(!!e));
84
78
  }
85
79
  cleanupDismissListener() {
86
80
  this._dismissButton && this._dismissHandler && this._dismissButton.removeEventListener("click", this._dismissHandler), this._dismissHandler = null;
@@ -95,8 +89,8 @@ var n = class extends HTMLElement {
95
89
  let e = this.getAttribute("tone");
96
90
  return e === "info" || e === "success" || e === "warning" || e === "danger" ? e : "info";
97
91
  }
98
- isDismissable() {
99
- return this.getAttribute("dismissable") === "true";
92
+ isDismissible() {
93
+ return this.getAttribute("dismissible") === "true";
100
94
  }
101
95
  getIconName() {
102
96
  switch (this.getTone()) {
@@ -122,7 +116,7 @@ var n = class extends HTMLElement {
122
116
  }
123
117
  renderContent() {
124
118
  this._childObserver?.disconnect();
125
- let e = this.getTone(), t = this.getHeading(), n = this.isDismissable(), r = this.getAriaLive();
119
+ let e = this.getTone(), t = this.getHeading(), n = this.isDismissible(), r = this.getAriaLive();
126
120
  this.setAttribute("role", e === "danger" ? "alert" : "status"), this.setAttribute("aria-live", r), e === "danger" ? this.setAttribute("aria-atomic", "true") : this.removeAttribute("aria-atomic");
127
121
  let i = [];
128
122
  for (this._bodyWrapper ? Array.from(this._bodyWrapper.childNodes).forEach((e) => {
@@ -1 +1 @@
1
- const e=require(`../chunks/icon-B8hR_TFn.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-CzgI_MCf.js`),require(`../chunks/warning-fwqtKFLY.js`),require(`../chunks/close-BNbAeJPY.js`),require(`../chunks/text-CfvRRKGZ.js`),e.a({name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`error`,viewBox:`0 0 24 24`,path:`M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissable`,`tone`]}constructor(){super(),this._headingElement=null,this._iconElement=null,this._dismissButton=null,this._headerWrapper=null,this._bodyWrapper=null,this._dismissHandler=null,this._rendering=!1,this._childObserver=null,this._normalizingChildren=!1}connectedCallback(){this.render()}disconnectedCallback(){this._childObserver?.disconnect(),this._dismissButton?.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}get heading(){return this.getAttribute(`heading`)??``}set heading(e){this.setAttribute(`heading`,String(e??``))}get tone(){return this.getTone()}set tone(e){this.setAttribute(`tone`,e)}get dismissable(){return this.isDismissable()}set dismissable(e){this.setAttribute(`dismissable`,String(!!e))}get dismissible(){return this.dismissable}set dismissible(e){this.dismissable=e}cleanupDismissListener(){this._dismissButton&&this._dismissHandler&&this._dismissButton.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getTone(){let e=this.getAttribute(`tone`);return e===`info`||e===`success`||e===`warning`||e===`danger`?e:`info`}isDismissable(){return this.getAttribute(`dismissable`)===`true`}getIconName(){switch(this.getTone()){case`info`:return`info`;case`success`:return`success`;case`warning`:return`warning`;case`danger`:return`error`;default:return`info`}}getAriaLive(){return this.getTone()===`danger`?`assertive`:`polite`}render(){if(!(this._rendering||!this.isConnected)){this._rendering=!0;try{this.renderContent()}finally{this._rendering=!1}}}renderContent(){this._childObserver?.disconnect();let e=this.getTone(),t=this.getHeading(),n=this.isDismissable(),r=this.getAriaLive();this.setAttribute(`role`,e===`danger`?`alert`:`status`),this.setAttribute(`aria-live`,r),e===`danger`?this.setAttribute(`aria-atomic`,`true`):this.removeAttribute(`aria-atomic`);let i=[];for(this._bodyWrapper?Array.from(this._bodyWrapper.childNodes).forEach(e=>{i.push(e)}):Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&e!==this._iconElement&&e!==this._headingElement&&e!==this._dismissButton&&i.push(e)}),this.cleanupDismissListener();this.firstChild;)this.removeChild(this.firstChild);if(this._headerWrapper=null,this._bodyWrapper=null,this._iconElement=null,this._headingElement=null,this._dismissButton=null,this._headerWrapper=document.createElement(`div`),this._headerWrapper.className=`mint-alert-header`,this._iconElement=document.createElement(`mint-icon`),this._iconElement.setAttribute(`name`,this.getIconName()),this._iconElement.className=`mint-alert-icon`,this._headerWrapper.appendChild(this._iconElement),this._headingElement=document.createElement(`mint-text`),this._headingElement.className=`mint-alert-heading`,this._headingElement.textContent=t||``,this._headerWrapper.appendChild(this._headingElement),n){this._dismissButton=document.createElement(`button`),this._dismissButton.className=`mint-alert-dismiss`,this._dismissButton.setAttribute(`aria-label`,`Dismiss alert`),this._dismissButton.setAttribute(`type`,`button`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`close`),e.className=`mint-alert-close-icon`,this._dismissButton.appendChild(e),this._dismissHandler=e=>{e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`dismissed`,{bubbles:!0,composed:!0})),this.remove()},this._dismissButton.addEventListener(`click`,this._dismissHandler),this._headerWrapper.appendChild(this._dismissButton)}this._bodyWrapper=document.createElement(`div`),this._bodyWrapper.className=`mint-alert-body`,i.forEach(e=>{this._bodyWrapper.appendChild(e)}),this.appendChild(this._headerWrapper),this.appendChild(this._bodyWrapper),this._childObserver||=new MutationObserver(()=>this.normalizeConsumerChildren()),this._childObserver.observe(this,{childList:!0})}normalizeConsumerChildren(){if(!(this._normalizingChildren||!this._bodyWrapper)){this._normalizingChildren=!0;try{Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&this._bodyWrapper.appendChild(e)})}finally{this._normalizingChildren=!1}}}};customElements.get(`mint-alert`)||t.t(`mint-alert`,n),module.exports=n;
1
+ const e=require(`../chunks/icon-B8hR_TFn.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-CzgI_MCf.js`),require(`../chunks/warning-fwqtKFLY.js`),require(`../chunks/close-BNbAeJPY.js`),require(`../chunks/text-CfvRRKGZ.js`),e.a({name:`info`,viewBox:`0 0 24 24`,path:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`success`,viewBox:`0 0 24 24`,path:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.a({name:`error`,viewBox:`0 0 24 24`,path:`M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`heading`,`dismissible`,`tone`]}constructor(){super(),this._headingElement=null,this._iconElement=null,this._dismissButton=null,this._headerWrapper=null,this._bodyWrapper=null,this._dismissHandler=null,this._rendering=!1,this._childObserver=null,this._normalizingChildren=!1}connectedCallback(){this.render()}disconnectedCallback(){this._childObserver?.disconnect(),this._dismissButton?.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}get heading(){return this.getAttribute(`heading`)??``}set heading(e){this.setAttribute(`heading`,String(e??``))}get tone(){return this.getTone()}set tone(e){this.setAttribute(`tone`,e)}get dismissible(){return this.isDismissible()}set dismissible(e){this.setAttribute(`dismissible`,String(!!e))}cleanupDismissListener(){this._dismissButton&&this._dismissHandler&&this._dismissButton.removeEventListener(`click`,this._dismissHandler),this._dismissHandler=null}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHeading(){return this.getAttribute(`heading`)||``}getTone(){let e=this.getAttribute(`tone`);return e===`info`||e===`success`||e===`warning`||e===`danger`?e:`info`}isDismissible(){return this.getAttribute(`dismissible`)===`true`}getIconName(){switch(this.getTone()){case`info`:return`info`;case`success`:return`success`;case`warning`:return`warning`;case`danger`:return`error`;default:return`info`}}getAriaLive(){return this.getTone()===`danger`?`assertive`:`polite`}render(){if(!(this._rendering||!this.isConnected)){this._rendering=!0;try{this.renderContent()}finally{this._rendering=!1}}}renderContent(){this._childObserver?.disconnect();let e=this.getTone(),t=this.getHeading(),n=this.isDismissible(),r=this.getAriaLive();this.setAttribute(`role`,e===`danger`?`alert`:`status`),this.setAttribute(`aria-live`,r),e===`danger`?this.setAttribute(`aria-atomic`,`true`):this.removeAttribute(`aria-atomic`);let i=[];for(this._bodyWrapper?Array.from(this._bodyWrapper.childNodes).forEach(e=>{i.push(e)}):Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&e!==this._iconElement&&e!==this._headingElement&&e!==this._dismissButton&&i.push(e)}),this.cleanupDismissListener();this.firstChild;)this.removeChild(this.firstChild);if(this._headerWrapper=null,this._bodyWrapper=null,this._iconElement=null,this._headingElement=null,this._dismissButton=null,this._headerWrapper=document.createElement(`div`),this._headerWrapper.className=`mint-alert-header`,this._iconElement=document.createElement(`mint-icon`),this._iconElement.setAttribute(`name`,this.getIconName()),this._iconElement.className=`mint-alert-icon`,this._headerWrapper.appendChild(this._iconElement),this._headingElement=document.createElement(`mint-text`),this._headingElement.className=`mint-alert-heading`,this._headingElement.textContent=t||``,this._headerWrapper.appendChild(this._headingElement),n){this._dismissButton=document.createElement(`button`),this._dismissButton.className=`mint-alert-dismiss`,this._dismissButton.setAttribute(`aria-label`,`Dismiss alert`),this._dismissButton.setAttribute(`type`,`button`);let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`close`),e.className=`mint-alert-close-icon`,this._dismissButton.appendChild(e),this._dismissHandler=e=>{e.preventDefault(),e.stopPropagation(),this.dispatchEvent(new CustomEvent(`dismissed`,{bubbles:!0,composed:!0})),this.remove()},this._dismissButton.addEventListener(`click`,this._dismissHandler),this._headerWrapper.appendChild(this._dismissButton)}this._bodyWrapper=document.createElement(`div`),this._bodyWrapper.className=`mint-alert-body`,i.forEach(e=>{this._bodyWrapper.appendChild(e)}),this.appendChild(this._headerWrapper),this.appendChild(this._bodyWrapper),this._childObserver||=new MutationObserver(()=>this.normalizeConsumerChildren()),this._childObserver.observe(this,{childList:!0})}normalizeConsumerChildren(){if(!(this._normalizingChildren||!this._bodyWrapper)){this._normalizingChildren=!0;try{Array.from(this.childNodes).forEach(e=>{e!==this._headerWrapper&&e!==this._bodyWrapper&&this._bodyWrapper.appendChild(e)})}finally{this._normalizingChildren=!1}}}};customElements.get(`mint-alert`)||t.t(`mint-alert`,n),module.exports=n;
@@ -33,7 +33,7 @@ var n = class extends HTMLElement {
33
33
  static get observedAttributes() {
34
34
  return [
35
35
  "heading",
36
- "dismissable",
36
+ "dismissible",
37
37
  "tone"
38
38
  ];
39
39
  }
@@ -58,17 +58,11 @@ var n = class extends HTMLElement {
58
58
  set tone(e) {
59
59
  this.setAttribute("tone", e);
60
60
  }
61
- get dismissable() {
62
- return this.isDismissable();
63
- }
64
- set dismissable(e) {
65
- this.setAttribute("dismissable", String(!!e));
66
- }
67
61
  get dismissible() {
68
- return this.dismissable;
62
+ return this.isDismissible();
69
63
  }
70
64
  set dismissible(e) {
71
- this.dismissable = e;
65
+ this.setAttribute("dismissible", String(!!e));
72
66
  }
73
67
  cleanupDismissListener() {
74
68
  this._dismissButton && this._dismissHandler && this._dismissButton.removeEventListener("click", this._dismissHandler), this._dismissHandler = null;
@@ -83,8 +77,8 @@ var n = class extends HTMLElement {
83
77
  let e = this.getAttribute("tone");
84
78
  return e === "info" || e === "success" || e === "warning" || e === "danger" ? e : "info";
85
79
  }
86
- isDismissable() {
87
- return this.getAttribute("dismissable") === "true";
80
+ isDismissible() {
81
+ return this.getAttribute("dismissible") === "true";
88
82
  }
89
83
  getIconName() {
90
84
  switch (this.getTone()) {
@@ -110,7 +104,7 @@ var n = class extends HTMLElement {
110
104
  }
111
105
  renderContent() {
112
106
  this._childObserver?.disconnect();
113
- let e = this.getTone(), t = this.getHeading(), n = this.isDismissable(), r = this.getAriaLive();
107
+ let e = this.getTone(), t = this.getHeading(), n = this.isDismissible(), r = this.getAriaLive();
114
108
  this.setAttribute("role", e === "danger" ? "alert" : "status"), this.setAttribute("aria-live", r), e === "danger" ? this.setAttribute("aria-atomic", "true") : this.removeAttribute("aria-atomic");
115
109
  let i = [];
116
110
  for (this._bodyWrapper ? Array.from(this._bodyWrapper.childNodes).forEach((e) => {
@@ -1,6 +1,8 @@
1
+ import '../button/index';
1
2
  declare class MintTab extends HTMLElement {
2
3
  static get observedAttributes(): string[];
3
4
  private _clickHandler;
5
+ private _childObserver;
4
6
  constructor();
5
7
  connectedCallback(): void;
6
8
  disconnectedCallback(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tab.ts"],"names":[],"mappings":"AAGA,cAAM,OAAQ,SAAQ,WAAW;IAC/B,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,aAAa,CAAyC;;IAM9D,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAI5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,SAAS,IAAI,MAAM;IAInB,QAAQ,IAAI,OAAO;IAKnB,UAAU,IAAI,OAAO;IAKrB,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAMxB;IAED,MAAM,IAAI,IAAI;IAId,mBAAmB,IAAI,IAAI;IAW3B,oBAAoB,IAAI,IAAI;IAO5B,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;CA0BrC;AAOD,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tab.ts"],"names":[],"mappings":"AAGA,OAAO,iBAAiB,CAAA;AAExB,cAAM,OAAQ,SAAQ,WAAW;IAC/B,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,cAAc,CAAgC;;IAMtD,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAM5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAO9F,SAAS,IAAI,MAAM;IAInB,QAAQ,IAAI,OAAO;IAKnB,UAAU,IAAI,OAAO;IAKrB,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAMxB;IAED,MAAM,IAAI,IAAI;IAmCd,mBAAmB,IAAI,IAAI;IAW3B,oBAAoB,IAAI,IAAI;IAO5B,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;CAgCrC;AAOD,eAAe,OAAO,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabList.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/TabList.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,CAAA;AAEd,KAAK,eAAe,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;AAE/C,cAAM,WAAY,SAAQ,WAAW;IACnC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;;IAMD,iBAAiB,IAAI,IAAI;IAIzB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,WAAW,IAAI,eAAe;IAK9B,MAAM,IAAI,IAAI;CAQf;AAOD,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"TabList.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/TabList.ts"],"names":[],"mappings":"AAGA,OAAO,OAAO,CAAA;AAEd,KAAK,eAAe,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;AAE/C,cAAM,WAAY,SAAQ,WAAW;IACnC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;;IAMD,iBAAiB,IAAI,IAAI;IAIzB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9F,WAAW,IAAI,eAAe;IAK9B,MAAM,IAAI,IAAI;CAYf;AAOD,eAAe,WAAW,CAAA"}
@@ -11,8 +11,12 @@ const __mintLoadStyle = (key, url) => {
11
11
  document.head.append(link)
12
12
  }
13
13
  __mintLoadStyle('theme', '../../theme.css')
14
+ __mintLoadStyle('button', '../../button.css')
15
+ __mintLoadStyle('spinner', '../../spinner.css')
16
+ __mintLoadStyle('icon', '../../icon.css')
14
17
  __mintLoadStyle('tabs', '../../tabs.css')
15
18
  import { t as e } from "../chunks/register-element-BFYmIynH.js";
19
+ import "../chunks/button-CUWUQAt8.js";
16
20
  //#region src/components/tabs/Tab.ts
17
21
  var t = class extends HTMLElement {
18
22
  static get observedAttributes() {
@@ -23,16 +27,20 @@ var t = class extends HTMLElement {
23
27
  ];
24
28
  }
25
29
  constructor() {
26
- super(), this._clickHandler = null;
30
+ super(), this._clickHandler = null, this._childObserver = null;
27
31
  }
28
32
  connectedCallback() {
29
- this.render(), this.setupEventListeners();
33
+ this.render(), this.setupEventListeners(), this._childObserver = new MutationObserver(() => this.render()), this._childObserver.observe(this, {
34
+ childList: !0,
35
+ characterData: !0,
36
+ subtree: !0
37
+ });
30
38
  }
31
39
  disconnectedCallback() {
32
- this.removeEventListeners();
40
+ this.removeEventListeners(), this._childObserver?.disconnect(), this._childObserver = null;
33
41
  }
34
42
  attributeChangedCallback(e, t, n) {
35
- t !== n && this.render();
43
+ t !== n && (this.render(), this.setupEventListeners());
36
44
  }
37
45
  getTarget() {
38
46
  return this.getAttribute("target") || "";
@@ -50,19 +58,31 @@ var t = class extends HTMLElement {
50
58
  set active(e) {
51
59
  e ? this.setAttribute("active", "true") : this.setAttribute("active", "false");
52
60
  }
53
- render() {}
61
+ render() {
62
+ let e = this.querySelector(":scope > mint-button[data-mint-tab-button=\"true\"]");
63
+ e || (e = document.createElement("mint-button"), e.setAttribute("data-mint-tab-button", "true"), e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", "-1")), Array.from(this.childNodes).forEach((t) => {
64
+ t !== e && e.appendChild(t);
65
+ }), e.parentElement !== this && this.appendChild(e), e.setAttribute("variant", this.isActive() ? "solid" : "ghost"), e.setAttribute("tone", "neutral"), this.isDisabled() ? e.setAttribute("disabled", "true") : e.removeAttribute("disabled");
66
+ let t = this.closest("mint-tab-list")?.getAttribute("full-width");
67
+ t !== null && t !== "false" ? e.setAttribute("full-width", "true") : e.removeAttribute("full-width");
68
+ let n = e.querySelector("button");
69
+ n && (n.tabIndex = -1);
70
+ let r = e.textContent?.trim();
71
+ r && (!this.hasAttribute("aria-label") || this.hasAttribute("data-mint-tab-auto-label")) && (this.setAttribute("aria-label", r), this.setAttribute("data-mint-tab-auto-label", "true"));
72
+ }
54
73
  setupEventListeners() {
55
- this.isDisabled() || this._clickHandler || (this._clickHandler = this.handleClick.bind(this), this.addEventListener("click", this._clickHandler));
74
+ this.isDisabled() || this._clickHandler || (this._clickHandler = this.handleClick.bind(this), this.addEventListener("click", this._clickHandler, !0));
56
75
  }
57
76
  removeEventListeners() {
58
- this._clickHandler &&= (this.removeEventListener("click", this._clickHandler), null);
77
+ this._clickHandler &&= (this.removeEventListener("click", this._clickHandler, !0), null);
59
78
  }
60
79
  handleClick(e) {
61
80
  if (this.isDisabled()) {
62
81
  e.preventDefault(), e.stopPropagation();
63
82
  return;
64
83
  }
65
- e.__mintTabsSynthetic || (e.stopPropagation(), this.dispatchEvent(new CustomEvent("tab-click", {
84
+ if (e.__mintTabsSynthetic) return;
85
+ e.stopPropagation(), this.dispatchEvent(new CustomEvent("tab-click", {
66
86
  detail: {
67
87
  tab: this,
68
88
  target: this.getTarget()
@@ -70,7 +90,13 @@ var t = class extends HTMLElement {
70
90
  bubbles: !0,
71
91
  cancelable: !0,
72
92
  composed: !0
73
- })));
93
+ }));
94
+ let t = new MouseEvent("click", {
95
+ bubbles: !0,
96
+ cancelable: !0,
97
+ composed: !0
98
+ });
99
+ t.__mintTabsSynthetic = !0, this.dispatchEvent(t);
74
100
  }
75
101
  };
76
102
  customElements.get("mint-tab") || e("mint-tab", t);
@@ -78,7 +104,7 @@ customElements.get("mint-tab") || e("mint-tab", t);
78
104
  //#region src/components/tabs/TabList.ts
79
105
  var n = class extends HTMLElement {
80
106
  static get observedAttributes() {
81
- return ["position"];
107
+ return ["position", "full-width"];
82
108
  }
83
109
  constructor() {
84
110
  super();
@@ -93,7 +119,9 @@ var n = class extends HTMLElement {
93
119
  return this.getAttribute("position") || "top";
94
120
  }
95
121
  render() {
96
- this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical");
122
+ this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical"), this.querySelectorAll("mint-tab").forEach((e) => {
123
+ e.render?.();
124
+ });
97
125
  }
98
126
  };
99
127
  customElements.get("mint-tab-list") || e("mint-tab-list", n);
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunks/register-element-tCL_F1YI.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`active`,`disabled`,`target`]}constructor(){super(),this._clickHandler=null}connectedCallback(){this.render(),this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getTarget(){return this.getAttribute(`target`)||``}isActive(){let e=this.getAttribute(`active`);return e!==null&&e!==`false`}isDisabled(){return this.getAttribute(`disabled`)===`true`}get active(){return this.isActive()}set active(e){e?this.setAttribute(`active`,`true`):this.setAttribute(`active`,`false`)}render(){}setupEventListeners(){this.isDisabled()||this._clickHandler||(this._clickHandler=this.handleClick.bind(this),this.addEventListener(`click`,this._clickHandler))}removeEventListeners(){this._clickHandler&&=(this.removeEventListener(`click`,this._clickHandler),null)}handleClick(e){if(this.isDisabled()){e.preventDefault(),e.stopPropagation();return}e.__mintTabsSynthetic||(e.stopPropagation(),this.dispatchEvent(new CustomEvent(`tab-click`,{detail:{tab:this,target:this.getTarget()},bubbles:!0,cancelable:!0,composed:!0})))}};customElements.get(`mint-tab`)||e.t(`mint-tab`,t);var n=class extends HTMLElement{static get observedAttributes(){return[`position`]}constructor(){super()}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getPosition(){return this.getAttribute(`position`)||`top`}render(){this.setAttribute(`role`,`tablist`),!this.hasAttribute(`aria-label`)&&!this.hasAttribute(`aria-labelledby`)&&this.setAttribute(`aria-label`,`Tabs`),this.setAttribute(`aria-orientation`,this.getPosition()===`top`?`horizontal`:`vertical`)}};customElements.get(`mint-tab-list`)||e.t(`mint-tab-list`,n);var r=class extends HTMLElement{static get observedAttributes(){return[`id`]}constructor(){super()}connectedCallback(){this.render(),this.checkInitialVisibility()}attributeChangedCallback(e,t,n){t!==n&&e===`id`&&(this.render(),this.checkInitialVisibility())}getId(){return this.getAttribute(`id`)||``}show(){this.removeAttribute(`hidden`)}hide(){this.setAttribute(`hidden`,``)}checkInitialVisibility(){let e=this.closest(`mint-tabs`);if(!e){this.hide();return}let t=e.querySelectorAll(`mint-tab`),n=!1;t.forEach(e=>{let t=e.getAttribute(`active`),r=e.getAttribute(`target`),i=this.getId();t===`true`&&r===i&&(n=!0)}),!n&&t.length>0&&t[0].getAttribute(`target`)===this.getId()&&!e.querySelector(`mint-tab[active="true"]`)&&(n=!0),n?this.show():this.hide()}render(){this.setAttribute(`role`,`tabpanel`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`)}};customElements.get(`mint-tab-content`)||e.t(`mint-tab-content`,r);var i=class e extends HTMLElement{static{this._id=0}constructor(){super(),this._tabClickHandler=null,this._tabKeydownHandler=null,this._mutationObserver=null}connectedCallback(){this.render(),this.setupEventListeners(),this.setupMutationObserver(),this.initializeActiveTab()}disconnectedCallback(){this.removeEventListeners(),this._mutationObserver&&=(this._mutationObserver.disconnect(),null)}render(){let e=this.querySelector(`mint-tab-list`);if(this.querySelectorAll(`mint-tab-content`),!e){console.warn(`mint-tabs: mint-tab-list is required`);return}this.syncAccessibility()}initializeActiveTab(){requestAnimationFrame(()=>{let e=this.querySelectorAll(`mint-tab`),t=null;if(e.forEach(e=>{e.getAttribute(`active`)===`true`&&(t=e)}),!t&&e.length>0&&(t=e[0],t.setAttribute(`active`,`true`)),t){let e=t.getAttribute(`target`);e?this.showContent(e):this.hideAllContent()}else this.hideAllContent();this.syncAccessibility(),this.querySelectorAll(`mint-tab-content`).forEach(e=>{let t=e;t.checkInitialVisibility&&t.checkInitialVisibility()})})}hideAllContent(){this.querySelectorAll(`mint-tab-content`).forEach(e=>{let t=e;t.hide?t.hide():e.style.display=`none`})}showContent(e){this.querySelectorAll(`mint-tab-content`).forEach(e=>{let t=e;t.hide?t.hide():e.style.display=`none`});let t=this.querySelector(`mint-tab-content[id="${e}"]`);t&&(t.show?t.show():t.style.display=`block`)}setupEventListeners(){this._tabClickHandler||(this._tabClickHandler=this.handleTabClick.bind(this),this.addEventListener(`tab-click`,this._tabClickHandler)),this._tabKeydownHandler||(this._tabKeydownHandler=e=>{let t=e.target?.closest(`mint-tab`),n=t?.closest(`mint-tab-list`);if(!t||!n)return;let r=Array.from(n.querySelectorAll(`mint-tab:not([disabled="true"])`)),i=r.indexOf(t);if(i<0||r.length===0)return;let a=n.getAttribute(`position`)===`left`||n.getAttribute(`position`)===`right`,o=i;if(e.key===(a?`ArrowDown`:`ArrowRight`))o=(i+1)%r.length;else if(e.key===(a?`ArrowUp`:`ArrowLeft`))o=(i-1+r.length)%r.length;else if(e.key===`Home`)o=0;else if(e.key===`End`)o=r.length-1;else return;e.preventDefault();let s=r[o];s.focus(),this.activateTab(s)},this.addEventListener(`keydown`,this._tabKeydownHandler))}removeEventListeners(){this._tabClickHandler&&=(this.removeEventListener(`tab-click`,this._tabClickHandler),null),this._tabKeydownHandler&&=(this.removeEventListener(`keydown`,this._tabKeydownHandler),null)}setupMutationObserver(){this._mutationObserver=new MutationObserver(()=>{this.render()});let e=this.querySelector(`mint-tab-list`);e&&this._mutationObserver.observe(e,{attributes:!0,attributeFilter:[`position`]})}handleTabClick(e){let t=e.detail?.tab;t&&this.activateTab(t)}activateTab(e){let t=e.getAttribute(`target`),n=e.closest(`mint-tab-list`);n&&(n.querySelectorAll(`mint-tab`).forEach(t=>{let n=t;t===e?n.active=!0:n.active=!1}),t&&this.showContent(t),this.syncAccessibility())}syncAccessibility(){this.id||=(e._id+=1,`mint-tabs-${e._id}`),Array.from(this.querySelectorAll(`mint-tab-list`)).forEach((e,t)=>{e.setAttribute(`role`,`tablist`),e.setAttribute(`aria-orientation`,e.getAttribute(`position`)===`left`||e.getAttribute(`position`)===`right`?`vertical`:`horizontal`),!e.hasAttribute(`aria-label`)&&!e.hasAttribute(`aria-labelledby`)&&e.setAttribute(`aria-label`,`Tabs`),Array.from(e.querySelectorAll(`mint-tab`)).forEach((e,n)=>{let r=e.id||`${this.id}-tab-${t+1}-${n+1}`;e.id=r,e.setAttribute(`role`,`tab`);let i=e.getAttribute(`active`)===`true`;e.setAttribute(`aria-selected`,String(i)),e.setAttribute(`aria-disabled`,String(e.getAttribute(`disabled`)===`true`)),e.tabIndex=i?0:-1;let a=e.getAttribute(`target`);a?e.setAttribute(`aria-controls`,a):e.removeAttribute(`aria-controls`);let o=a?Array.from(this.querySelectorAll(`mint-tab-content`)).find(e=>e.id===a)??null:null;o&&(o.setAttribute(`role`,`tabpanel`),o.setAttribute(`aria-labelledby`,r),o.hasAttribute(`tabindex`)||(o.tabIndex=0))})})}};customElements.get(`mint-tabs`)||e.t(`mint-tabs`,i),exports.Tab=t,exports.TabContent=r,exports.TabList=n,exports.Tabs=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/button-imX8FM_Q.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`active`,`disabled`,`target`]}constructor(){super(),this._clickHandler=null,this._childObserver=null}connectedCallback(){this.render(),this.setupEventListeners(),this._childObserver=new MutationObserver(()=>this.render()),this._childObserver.observe(this,{childList:!0,characterData:!0,subtree:!0})}disconnectedCallback(){this.removeEventListeners(),this._childObserver?.disconnect(),this._childObserver=null}attributeChangedCallback(e,t,n){t!==n&&(this.render(),this.setupEventListeners())}getTarget(){return this.getAttribute(`target`)||``}isActive(){let e=this.getAttribute(`active`);return e!==null&&e!==`false`}isDisabled(){return this.getAttribute(`disabled`)===`true`}get active(){return this.isActive()}set active(e){e?this.setAttribute(`active`,`true`):this.setAttribute(`active`,`false`)}render(){let e=this.querySelector(`:scope > mint-button[data-mint-tab-button="true"]`);e||(e=document.createElement(`mint-button`),e.setAttribute(`data-mint-tab-button`,`true`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,`-1`)),Array.from(this.childNodes).forEach(t=>{t!==e&&e.appendChild(t)}),e.parentElement!==this&&this.appendChild(e),e.setAttribute(`variant`,this.isActive()?`solid`:`ghost`),e.setAttribute(`tone`,`neutral`),this.isDisabled()?e.setAttribute(`disabled`,`true`):e.removeAttribute(`disabled`);let t=this.closest(`mint-tab-list`)?.getAttribute(`full-width`);t!==null&&t!==`false`?e.setAttribute(`full-width`,`true`):e.removeAttribute(`full-width`);let n=e.querySelector(`button`);n&&(n.tabIndex=-1);let r=e.textContent?.trim();r&&(!this.hasAttribute(`aria-label`)||this.hasAttribute(`data-mint-tab-auto-label`))&&(this.setAttribute(`aria-label`,r),this.setAttribute(`data-mint-tab-auto-label`,`true`))}setupEventListeners(){this.isDisabled()||this._clickHandler||(this._clickHandler=this.handleClick.bind(this),this.addEventListener(`click`,this._clickHandler,!0))}removeEventListeners(){this._clickHandler&&=(this.removeEventListener(`click`,this._clickHandler,!0),null)}handleClick(e){if(this.isDisabled()){e.preventDefault(),e.stopPropagation();return}if(e.__mintTabsSynthetic)return;e.stopPropagation(),this.dispatchEvent(new CustomEvent(`tab-click`,{detail:{tab:this,target:this.getTarget()},bubbles:!0,cancelable:!0,composed:!0}));let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0});t.__mintTabsSynthetic=!0,this.dispatchEvent(t)}};customElements.get(`mint-tab`)||e.t(`mint-tab`,t);var n=class extends HTMLElement{static get observedAttributes(){return[`position`,`full-width`]}constructor(){super()}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getPosition(){return this.getAttribute(`position`)||`top`}render(){this.setAttribute(`role`,`tablist`),!this.hasAttribute(`aria-label`)&&!this.hasAttribute(`aria-labelledby`)&&this.setAttribute(`aria-label`,`Tabs`),this.setAttribute(`aria-orientation`,this.getPosition()===`top`?`horizontal`:`vertical`),this.querySelectorAll(`mint-tab`).forEach(e=>{e.render?.()})}};customElements.get(`mint-tab-list`)||e.t(`mint-tab-list`,n);var r=class extends HTMLElement{static get observedAttributes(){return[`id`]}constructor(){super()}connectedCallback(){this.render(),this.checkInitialVisibility()}attributeChangedCallback(e,t,n){t!==n&&e===`id`&&(this.render(),this.checkInitialVisibility())}getId(){return this.getAttribute(`id`)||``}show(){this.removeAttribute(`hidden`)}hide(){this.setAttribute(`hidden`,``)}checkInitialVisibility(){let e=this.closest(`mint-tabs`);if(!e){this.hide();return}let t=e.querySelectorAll(`mint-tab`),n=!1;t.forEach(e=>{let t=e.getAttribute(`active`),r=e.getAttribute(`target`),i=this.getId();t===`true`&&r===i&&(n=!0)}),!n&&t.length>0&&t[0].getAttribute(`target`)===this.getId()&&!e.querySelector(`mint-tab[active="true"]`)&&(n=!0),n?this.show():this.hide()}render(){this.setAttribute(`role`,`tabpanel`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`)}};customElements.get(`mint-tab-content`)||e.t(`mint-tab-content`,r);var i=class e extends HTMLElement{static{this._id=0}constructor(){super(),this._tabClickHandler=null,this._tabKeydownHandler=null,this._mutationObserver=null}connectedCallback(){this.render(),this.setupEventListeners(),this.setupMutationObserver(),this.initializeActiveTab()}disconnectedCallback(){this.removeEventListeners(),this._mutationObserver&&=(this._mutationObserver.disconnect(),null)}render(){let e=this.querySelector(`mint-tab-list`);if(this.querySelectorAll(`mint-tab-content`),!e){console.warn(`mint-tabs: mint-tab-list is required`);return}this.syncAccessibility()}initializeActiveTab(){requestAnimationFrame(()=>{let e=this.querySelectorAll(`mint-tab`),t=null;if(e.forEach(e=>{e.getAttribute(`active`)===`true`&&(t=e)}),!t&&e.length>0&&(t=e[0],t.setAttribute(`active`,`true`)),t){let e=t.getAttribute(`target`);e?this.showContent(e):this.hideAllContent()}else this.hideAllContent();this.syncAccessibility(),this.querySelectorAll(`mint-tab-content`).forEach(e=>{let t=e;t.checkInitialVisibility&&t.checkInitialVisibility()})})}hideAllContent(){this.querySelectorAll(`mint-tab-content`).forEach(e=>{let t=e;t.hide?t.hide():e.style.display=`none`})}showContent(e){this.querySelectorAll(`mint-tab-content`).forEach(e=>{let t=e;t.hide?t.hide():e.style.display=`none`});let t=this.querySelector(`mint-tab-content[id="${e}"]`);t&&(t.show?t.show():t.style.display=`block`)}setupEventListeners(){this._tabClickHandler||(this._tabClickHandler=this.handleTabClick.bind(this),this.addEventListener(`tab-click`,this._tabClickHandler)),this._tabKeydownHandler||(this._tabKeydownHandler=e=>{let t=e.target?.closest(`mint-tab`),n=t?.closest(`mint-tab-list`);if(!t||!n)return;let r=Array.from(n.querySelectorAll(`mint-tab:not([disabled="true"])`)),i=r.indexOf(t);if(i<0||r.length===0)return;let a=n.getAttribute(`position`)===`left`||n.getAttribute(`position`)===`right`,o=i;if(e.key===(a?`ArrowDown`:`ArrowRight`))o=(i+1)%r.length;else if(e.key===(a?`ArrowUp`:`ArrowLeft`))o=(i-1+r.length)%r.length;else if(e.key===`Home`)o=0;else if(e.key===`End`)o=r.length-1;else return;e.preventDefault();let s=r[o];s.focus(),this.activateTab(s)},this.addEventListener(`keydown`,this._tabKeydownHandler))}removeEventListeners(){this._tabClickHandler&&=(this.removeEventListener(`tab-click`,this._tabClickHandler),null),this._tabKeydownHandler&&=(this.removeEventListener(`keydown`,this._tabKeydownHandler),null)}setupMutationObserver(){this._mutationObserver=new MutationObserver(()=>{this.render()});let e=this.querySelector(`mint-tab-list`);e&&this._mutationObserver.observe(e,{attributes:!0,attributeFilter:[`position`]})}handleTabClick(e){let t=e.detail?.tab;t&&this.activateTab(t)}activateTab(e){let t=e.getAttribute(`target`),n=e.closest(`mint-tab-list`);n&&(n.querySelectorAll(`mint-tab`).forEach(t=>{let n=t;t===e?n.active=!0:n.active=!1}),t&&this.showContent(t),this.syncAccessibility())}syncAccessibility(){this.id||=(e._id+=1,`mint-tabs-${e._id}`),Array.from(this.querySelectorAll(`mint-tab-list`)).forEach((e,t)=>{e.setAttribute(`role`,`tablist`),e.setAttribute(`aria-orientation`,e.getAttribute(`position`)===`left`||e.getAttribute(`position`)===`right`?`vertical`:`horizontal`),!e.hasAttribute(`aria-label`)&&!e.hasAttribute(`aria-labelledby`)&&e.setAttribute(`aria-label`,`Tabs`),Array.from(e.querySelectorAll(`mint-tab`)).forEach((e,n)=>{let r=e.id||`${this.id}-tab-${t+1}-${n+1}`;e.id=r,e.setAttribute(`role`,`tab`);let i=e.getAttribute(`active`)===`true`;e.setAttribute(`aria-selected`,String(i)),e.setAttribute(`aria-disabled`,String(e.getAttribute(`disabled`)===`true`)),e.tabIndex=i?0:-1;let a=e.getAttribute(`target`);a?e.setAttribute(`aria-controls`,a):e.removeAttribute(`aria-controls`);let o=a?Array.from(this.querySelectorAll(`mint-tab-content`)).find(e=>e.id===a)??null:null;o&&(o.setAttribute(`role`,`tabpanel`),o.setAttribute(`aria-labelledby`,r),o.hasAttribute(`tabindex`)||(o.tabIndex=0))})})}};customElements.get(`mint-tabs`)||e.t(`mint-tabs`,i),exports.Tab=t,exports.TabContent=r,exports.TabList=n,exports.Tabs=i;
@@ -1,6 +1,10 @@
1
1
  import '../../theme.css'
2
+ import '../../button.css'
3
+ import '../../spinner.css'
4
+ import '../../icon.css'
2
5
  import '../../tabs.css'
3
6
  import { t as e } from "../chunks/register-element-BFYmIynH.js";
7
+ import "../chunks/button-CUWUQAt8.js";
4
8
  //#region src/components/tabs/Tab.ts
5
9
  var t = class extends HTMLElement {
6
10
  static get observedAttributes() {
@@ -11,16 +15,20 @@ var t = class extends HTMLElement {
11
15
  ];
12
16
  }
13
17
  constructor() {
14
- super(), this._clickHandler = null;
18
+ super(), this._clickHandler = null, this._childObserver = null;
15
19
  }
16
20
  connectedCallback() {
17
- this.render(), this.setupEventListeners();
21
+ this.render(), this.setupEventListeners(), this._childObserver = new MutationObserver(() => this.render()), this._childObserver.observe(this, {
22
+ childList: !0,
23
+ characterData: !0,
24
+ subtree: !0
25
+ });
18
26
  }
19
27
  disconnectedCallback() {
20
- this.removeEventListeners();
28
+ this.removeEventListeners(), this._childObserver?.disconnect(), this._childObserver = null;
21
29
  }
22
30
  attributeChangedCallback(e, t, n) {
23
- t !== n && this.render();
31
+ t !== n && (this.render(), this.setupEventListeners());
24
32
  }
25
33
  getTarget() {
26
34
  return this.getAttribute("target") || "";
@@ -38,19 +46,31 @@ var t = class extends HTMLElement {
38
46
  set active(e) {
39
47
  e ? this.setAttribute("active", "true") : this.setAttribute("active", "false");
40
48
  }
41
- render() {}
49
+ render() {
50
+ let e = this.querySelector(":scope > mint-button[data-mint-tab-button=\"true\"]");
51
+ e || (e = document.createElement("mint-button"), e.setAttribute("data-mint-tab-button", "true"), e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", "-1")), Array.from(this.childNodes).forEach((t) => {
52
+ t !== e && e.appendChild(t);
53
+ }), e.parentElement !== this && this.appendChild(e), e.setAttribute("variant", this.isActive() ? "solid" : "ghost"), e.setAttribute("tone", "neutral"), this.isDisabled() ? e.setAttribute("disabled", "true") : e.removeAttribute("disabled");
54
+ let t = this.closest("mint-tab-list")?.getAttribute("full-width");
55
+ t !== null && t !== "false" ? e.setAttribute("full-width", "true") : e.removeAttribute("full-width");
56
+ let n = e.querySelector("button");
57
+ n && (n.tabIndex = -1);
58
+ let r = e.textContent?.trim();
59
+ r && (!this.hasAttribute("aria-label") || this.hasAttribute("data-mint-tab-auto-label")) && (this.setAttribute("aria-label", r), this.setAttribute("data-mint-tab-auto-label", "true"));
60
+ }
42
61
  setupEventListeners() {
43
- this.isDisabled() || this._clickHandler || (this._clickHandler = this.handleClick.bind(this), this.addEventListener("click", this._clickHandler));
62
+ this.isDisabled() || this._clickHandler || (this._clickHandler = this.handleClick.bind(this), this.addEventListener("click", this._clickHandler, !0));
44
63
  }
45
64
  removeEventListeners() {
46
- this._clickHandler &&= (this.removeEventListener("click", this._clickHandler), null);
65
+ this._clickHandler &&= (this.removeEventListener("click", this._clickHandler, !0), null);
47
66
  }
48
67
  handleClick(e) {
49
68
  if (this.isDisabled()) {
50
69
  e.preventDefault(), e.stopPropagation();
51
70
  return;
52
71
  }
53
- e.__mintTabsSynthetic || (e.stopPropagation(), this.dispatchEvent(new CustomEvent("tab-click", {
72
+ if (e.__mintTabsSynthetic) return;
73
+ e.stopPropagation(), this.dispatchEvent(new CustomEvent("tab-click", {
54
74
  detail: {
55
75
  tab: this,
56
76
  target: this.getTarget()
@@ -58,7 +78,13 @@ var t = class extends HTMLElement {
58
78
  bubbles: !0,
59
79
  cancelable: !0,
60
80
  composed: !0
61
- })));
81
+ }));
82
+ let t = new MouseEvent("click", {
83
+ bubbles: !0,
84
+ cancelable: !0,
85
+ composed: !0
86
+ });
87
+ t.__mintTabsSynthetic = !0, this.dispatchEvent(t);
62
88
  }
63
89
  };
64
90
  customElements.get("mint-tab") || e("mint-tab", t);
@@ -66,7 +92,7 @@ customElements.get("mint-tab") || e("mint-tab", t);
66
92
  //#region src/components/tabs/TabList.ts
67
93
  var n = class extends HTMLElement {
68
94
  static get observedAttributes() {
69
- return ["position"];
95
+ return ["position", "full-width"];
70
96
  }
71
97
  constructor() {
72
98
  super();
@@ -81,7 +107,9 @@ var n = class extends HTMLElement {
81
107
  return this.getAttribute("position") || "top";
82
108
  }
83
109
  render() {
84
- this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical");
110
+ this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical"), this.querySelectorAll("mint-tab").forEach((e) => {
111
+ e.render?.();
112
+ });
85
113
  }
86
114
  };
87
115
  customElements.get("mint-tab-list") || e("mint-tab-list", n);