@m3e/button 1.0.3 → 1.0.4

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.
package/dist/index.min.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{unsafeCSS as e,css as t,LitElement as o,nothing as r,html as a}from"lit";import{DesignToken as l,KeyboardClick as n,LinkButton as s,FormSubmitter as i,Focusable as c,DisabledInteractive as d,Disabled as u,AttachInternals as b,Role as v,ResizeController as h,FocusController as p,PressedController as m,renderPseudoLink as y,debounce as $,hasAssignedNodes as f}from"@m3e/core";function g(e,t,o,r){var a,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(l<3?a(n):l>3?a(t,o,n):a(t,o))||n);return l>3&&n&&Object.defineProperty(t,o,n),n}function x(e,t,o,r){if("a"===o&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?r:"a"===o?r.call(e):r?r.value:t.get(e)}"function"==typeof SuppressedError&&SuppressedError;
6
+ import{unsafeCSS as e,css as t,LitElement as o,nothing as r,html as a}from"lit";import{DesignToken as l,KeyboardClick as n,LinkButton as s,FormSubmitter as i,Focusable as c,DisabledInteractive as d,Disabled as u,AttachInternals as b,Role as h,ResizeController as v,FocusController as p,PressedController as m,renderPseudoLink as y,debounce as $,hasAssignedNodes as f}from"@m3e/core";function g(e,t,o,r){var a,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(l<3?a(n):l>3?a(t,o,n):a(t,o))||n);return l>3&&n&&Object.defineProperty(t,o,n),n}function x(e,t,o,r){if("a"===o&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?r:"a"===o?r.call(e):r?r.value:t.get(e)}"function"==typeof SuppressedError&&SuppressedError;
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
@@ -122,6 +122,7 @@ function K(e,t){return(t,o,r)=>((e,t,o)=>(o.configurable=!0,o.enumerable=!0,Refl
122
122
  display: inline-block;
123
123
  outline: none;
124
124
  user-select: none;
125
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
125
126
  }
126
127
  .base {
127
128
  box-sizing: border-box;
@@ -444,7 +445,7 @@ function K(e,t){return(t,o,r)=>((e,t,o)=>(o.configurable=!0,o.enumerable=!0,Refl
444
445
  :host([variant="outlined"]) .base {
445
446
  outline-style: solid;
446
447
  }
447
- `];var te,oe,re,ae,le;let ne=class extends(n(s(i(c(d(u(b(v(o,"button"),!0)))))))){constructor(){super(),te.add(this),oe.set(this,e=>x(this,te,"m",re).call(this,e)),this.variant="text",this.shape="rounded",this.size="small",this.toggle=!1,this.selected=!1,new h(this,{callback:()=>{this.grouped&&this._handleResize()}}),new p(this,{callback:e=>{!this.disabledInteractive&&this._base&&(e?x(this,te,"m",le).call(this):this.grouped||this._base?.style.removeProperty("--_button-shape"))}}),new m(this,{isPressedKey:e=>" "===e,minPressedDuration:150,callback:e=>{if(!this.disabled&&!this.disabledInteractive){this.classList.toggle("-pressed",e),this.classList.toggle("-resting",!e);const t=this.closest("m3e-button-group");if(t){const o=this.getBoundingClientRect().width,r=[...t.querySelectorAll("m3e-button,m3e-icon-button")],a=r.indexOf(this);for(let t=0;t<r.length;t++){const l=r[t];t===a-1||t===a+1?(l.style.setProperty("--_adjacent-button-width",`${o}px`),l.classList.toggle("-adjacent-pressed",e)):(l.style.removeProperty("--_adjacent-button-width"),l.classList.remove("-adjacent-pressed"))}}}}})}get grouped(){return this.classList.contains("-grouped")}render(){return a`<div class="base">
448
+ `];var te,oe,re,ae,le;let ne=class extends(n(s(i(c(d(u(b(h(o,"button"),!0)))))))){constructor(){super(),te.add(this),oe.set(this,e=>x(this,te,"m",re).call(this,e)),this.variant="text",this.shape="rounded",this.size="small",this.toggle=!1,this.selected=!1,new v(this,{callback:()=>{this.grouped&&this._handleResize()}}),new p(this,{callback:e=>{!this.disabledInteractive&&this._base&&(e?x(this,te,"m",le).call(this):this.grouped||this._base?.style.removeProperty("--_button-shape"))}}),new m(this,{isPressedKey:e=>" "===e,minPressedDuration:150,callback:e=>{if(!this.disabled&&!this.disabledInteractive){this.classList.toggle("-pressed",e),this.classList.toggle("-resting",!e);const t=this.closest("m3e-button-group");if(t){const o=this.getBoundingClientRect().width,r=[...t.querySelectorAll("m3e-button,m3e-icon-button")],a=r.indexOf(this);for(let t=0;t<r.length;t++){const l=r[t];t===a-1||t===a+1?(l.style.setProperty("--_adjacent-button-width",`${o}px`),l.classList.toggle("-adjacent-pressed",e)):(l.style.removeProperty("--_adjacent-button-width"),l.classList.remove("-adjacent-pressed"))}}}}})}get grouped(){return this.classList.contains("-grouped")}render(){return a`<div class="base">
448
449
  <m3e-elevation class="elevation" ?disabled="${this.disabled||this.disabledInteractive}"></m3e-elevation>
449
450
  <m3e-state-layer class="state-layer" ?disabled="${this.disabled||this.disabledInteractive}"></m3e-state-layer>
450
451
  <m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring>