UNPKG

@aidenlx/player

Version:

Headless web components that make integrating media on the a web a breeze.

26 lines (23 loc) 1.37 kB
import{a as i}from"./chunk.KCC3AAG2.js";import{H as p,U as a,V as r,Y as c,Z as u,a as s,b as n,ia as d,ja as h,k as o}from"./chunk.PWTX2M5C.js";var f=d` :host { display: table; contain: content; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; } :host([hidden]) { display: none; } :host(:focus) { outline: none; } :host(:focus-visible) { outline: 1px auto Highlight; outline: 1px auto -webkit-focus-ring-color; } :host(.focus-visible) { outline: 1px auto Highlight; outline: 1px auto -webkit-focus-ring-color; } `;var l=class extends h{constructor(){super();this.pressed=!1;this.disabled=!1;this.$n=o(this,"click",e=>{this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0});p(this),["pointerdown","keydown"].forEach(e=>{o(this,e,t=>{this.disabled||c(t)&&!u(t)||this.ze(t)})})}static get styles(){return[f]}static get parts(){return[]}connectedCallback(){super.connectedCallback(),r(this,"tabindex","0"),r(this,"role","button"),this.ei()}updated(e){e.has("pressed")&&this.ei()}ei(){a(this,"aria-pressed",this.pressed?"true":"false")}render(){return this.Me()}Me(){return n`<slot></slot>`}ze(e){this.pressed=!this.pressed}};s([i({type:Boolean})],l.prototype,"pressed",2),s([i({type:Boolean,reflect:!0})],l.prototype,"disabled",2);export{l as a};