@react-native/debugger-frontend
Version:
Debugger frontend for React Native based on Chrome DevTools
2 lines (1 loc) • 2 kB
JavaScript
import"../icon_button/icon_button.js";import*as t from"../../lit/lit.js";var o={cssText:`:host{width:fit-content;height:fit-content}.floating-button{padding:0;margin:0;background:0;border:0;position:relative;width:var(--sys-size-8);height:var(--sys-size-8);box-shadow:var(--sys-elevation-level2);border-radius:var(--sys-shape-corner-extra-small);display:flex;justify-content:center;align-items:center;:host-context(:not(.theme-with-dark-background)) &{background-color:var(--sys-color-tonal-container)}:host-context(.theme-with-dark-background) &{background-color:var(--sys-color-primary)}& .icon{width:var(--sys-size-7);height:var(--sys-size-7)}:host-context(:not(.theme-with-dark-background)) & .icon{color:var(--sys-color-on-tonal-container)}:host-context(.theme-with-dark-background) & .icon{color:var(--sys-color-on-primary)}&:not(:disabled):hover::after,\n &:not(:disabled):hover::before{content:"";height:100%;width:100%;border-radius:inherit;position:absolute;top:0;left:0}&:not(:disabled):hover::after{background-color:var(--sys-color-state-hover-on-subtle)}&:not(:disabled):active::before{background-color:var(--sys-color-state-ripple-neutral-on-subtle)}&:focus-visible{outline:2px solid var(--sys-color-state-focus-ring);outline-offset:2px}&:disabled .icon{color:var(--sys-color-state-disabled)}}\n/*# sourceURL=${import.meta.resolve("./floatingButton.css")} */\n`};const e=new CSSStyleSheet;e.replaceSync(o.cssText);const{html:s,Directives:{ifDefined:a}}=t;class n extends HTMLElement{#t=this.attachShadow({mode:"open"});#o;constructor(t){super(),this.#o=t}connectedCallback(){this.#t.adoptedStyleSheets=[e],this.#e()}set data(t){this.#o=t}#e(){t.render(s`<button class="floating-button" title=${a(this.#o.title)} .disabled=${Boolean(this.#o.disabled)}><devtools-icon class="icon" name=${this.#o.iconName}></devtools-icon></button>`,this.#t,{host:this})}}customElements.define("devtools-floating-button",n);var r=Object.freeze({__proto__:null,FloatingButton:n});export{r as FloatingButton};