UNPKG

@freshworks/crayons

Version:
1 lines 1.53 kB
import{r as t,h as o,i as s}from"./p-c5706edf.js";import{h as i}from"./p-c9855591.js";let e=class{constructor(o){t(this,o),this.placement="top",this.fallbackPlacements=["top"],this.content="",this.distance="10",this.trigger="hover",this.hoist=!1,this.custom=null}componentWillLoad(){null===this.custom&&(this.custom=i(this.host,"tooltip-content"))}async show(){return this.popoverRef.show(),!0}async hide(){return this.popoverRef.hide(),!0}render(){return o("fw-popover",{trigger:this.trigger,placement:this.placement,fallbackPlacements:this.fallbackPlacements,sameWidth:!1,distance:this.distance,"disable-transition":"true","has-border":"false",hoist:this.hoist,ref:t=>this.popoverRef=t},o("slot",{slot:"popover-trigger"}),this.custom?o("div",{class:"tooltip",slot:"popover-content",role:"tooltip"},o("slot",{name:"tooltip-content"})):this.content.trim().length&&o("div",{class:"tooltip",slot:"popover-content",role:"tooltip"},this.content.trim()))}get host(){return s(this)}};e.style=':host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}:host{--fw-popover-border-radius:4px}.tooltip{color:#fff;background:#12344d;border-radius:4px;font-size:12px;font-weight:600;line-height:18px;padding:6px 8px;max-width:236px;overflow:visible;overflow-wrap:anywhere;word-break:break-word}';export{e as fw_tooltip}