@limetech/lime-elements
Version:
2 lines • 4.13 kB
JavaScript
import{r as o,h as e,H as t,g as r}from"./p-288f0842.js";import{g as i}from"./p-cea519d5.js";import{g as s}from"./p-d1947575.js";const a='@charset "UTF-8";:host(limel-shortcut){--badge-text-color:var(\n --shortcut-badge-text-color,\n rgb(var(--color-white))\n );--badge-background-color:var(\n --shortcut-badge-background-color,\n rgb(var(--color-red-default))\n );position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:0.0625rem}:host(limel-shortcut) *{box-sizing:border-box}:host(limel-shortcut[disabled]) a{opacity:0.5;box-shadow:unset;cursor:not-allowed}a{all:unset;text-align:center;height:calc(100% - 1rem);width:calc(100% - 1rem);padding:0.5rem;border-radius:var(--shortcut-border-radius, 1rem);background-color:var(--shortcut-background-color, var(--lime-elevated-surface-background-color))}limel-icon{display:flex;height:100%;width:100%;justify-content:center;color:var(--shortcut-icon-color, rgb(var(--contrast-1000)));border-radius:var(--shortcut-border-radius, 1rem)}span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:100%;color:var(--shortcut-label-color, rgb(var(--contrast-1100)));font-size:0.75rem;text-align:center}limel-badge{position:absolute;top:-0.25rem;right:0.125rem}limel-3d-hover-effect-glow{border-radius:var(--shortcut-border-radius, 1rem)}:host(limel-shortcut){isolation:isolate;transform-style:preserve-3d;perspective:1000px}@media (prefers-reduced-motion){:host(limel-shortcut){perspective:2000px}}a{position:relative;transition-duration:0.8s;transition-property:transform, box-shadow, background-color;transition-timing-function:ease-out;transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);cursor:pointer;box-shadow:var(--button-shadow-normal)}a:focus{outline:none}a:hover,a:focus,a:focus-visible,a:focus-within{will-change:background-color, box-shadow, transform}a:hover,a:focus,a:focus-visible,a:active{transition-duration:0.2s}a:hover,a:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}a:hover{transform:scale3d(1.01, 1.01, 1.01) rotate3d(var(--limel-3d-hover-effect-rotate3d))}a:focus-visible{outline:none;transform:scale3d(1.01, 1.01, 1.01)}a:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.5}@media (prefers-reduced-motion){a:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.2}}a:hover,a:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}a:active{transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);box-shadow:var(--button-shadow-pressed)}a:focus-visible{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-hovered)}a:focus-visible:active{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-pressed)}';const l=class{constructor(t){o(this,t);this.renderLabel=()=>{if(this.label){return e("span",{"aria-hidden":"true"},this.label)}};this.getAriaLabel=()=>{var o,e;if(this.label&&((o=this.link)===null||o===void 0?void 0:o.title)){return this.label+". "+this.link.title}if(this.label){return this.label}if((e=this.link)===null||e===void 0?void 0:e.title){return this.link.title}};this.renderNotification=()=>{if(this.badge){return e("limel-badge",{label:this.badge})}};this.icon=undefined;this.label=null;this.disabled=false;this.badge=undefined;this.link=undefined}componentWillLoad(){const{handleMouseEnter:o,handleMouseLeave:e}=s(this.host);this.handleMouseEnter=o;this.handleMouseLeave=e}render(){var o,r,s,a,l;const d=i((o=this.link)===null||o===void 0?void 0:o.target,(r=this.link)===null||r===void 0?void 0:r.rel);return e(t,{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},e("a",{"aria-disabled":this.disabled,href:(s=this.link)===null||s===void 0?void 0:s.href,target:(a=this.link)===null||a===void 0?void 0:a.target,rel:d,tabindex:"0","aria-label":this.getAriaLabel(),title:(l=this.link)===null||l===void 0?void 0:l.title},e("limel-icon",{name:this.icon}),e("limel-3d-hover-effect-glow",null)),this.renderLabel(),this.renderNotification())}get host(){return r(this)}};l.style=a;export{l as limel_shortcut};
//# sourceMappingURL=p-3a61deb1.entry.js.map