@alaskaairux/auro-icon
Version:
Auro custom auro-icon element
15 lines (14 loc) • 4.1 kB
JavaScript
import{d as o,A as e,c as r,B as s,h as t,a}from"./baseIcon-91fe438d.js";
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const i=new WeakMap,l=o((o=>r=>{const s=i.get(r);if(void 0===o&&r instanceof e){if(void 0!==s||!i.has(r)){const o=r.committer.name;r.committer.element.removeAttribute(o)}}else o!==s&&r.setValue(o);i.set(r,o)}));var n=r`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;line-height:unset}:host .primary{color:var(--auro-color-icon-primary-on-light)}:host .emphasis{color:var(--auro-color-icon-emphasis-on-light)}:host .accent{color:var(--auro-color-icon-accent-on-light)}:host .disabled{color:var(--auro-color-icon-disabled-on-light)}:host .error{color:var(--auro-color-alert-error-on-light)}:host .success{color:var(--auro-color-alert-success-on-light)}:host .advisory{color:var(--auro-color-alert-advisory-on-light)}:host .warning{color:var(--auro-color-alert-warning-on-light)}:host([onDark]) .logo{color:var(--auro-color-base-white)}:host([onDark]) .primary{color:var(--auro-color-icon-primary-on-dark)}:host([onDark]) .emphasis{color:var(--auro-color-icon-emphasis-on-dark)}:host([onDark]) .accent{color:var(--auro-color-icon-accent-on-dark)}:host([onDark]) .disabled{color:var(--auro-color-icon-disabled-on-dark)}:host([onDark]) .error{color:var(--auro-color-alert-error-on-dark)}:host([onDark]) .success{color:var(--auro-color-alert-success-on-dark)}:host([onDark]) .advisory{color:var(--auro-color-alert-advisory-on-dark)}:host([customSize]){--auro-size-lg:100%;width:100%;height:100%}.label{display:flex;align-items:flex-start}.label svg{margin:0 var(--auro-size-xxs)}`;class c extends s{constructor(){super(),this.uri="https://unpkg.com/@alaskaairux/icons@latest/dist",this.privateDefaults()}privateDefaults(){this.primary=!1,this.label=!1,this.emphasis=!1,this.accent=!1,this.disabled=!1,this.error=!1,this.success=!1,this.advisory=!1,this.warning=!1,this.customColor=!1}static get properties(){return{...super.properties,category:{type:String,reflect:!0},name:{type:String,reflect:!0},primary:{type:Boolean,reflect:!0},label:{type:Boolean,reflect:!0},emphasis:{type:Boolean,reflect:!0},accent:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{type:Boolean,reflect:!0},success:{type:Boolean,reflect:!0},advisory:{type:Boolean,reflect:!0},warning:{type:Boolean,reflect:!0},customColor:{type:Boolean},ariaHidden:{type:String,reflect:!0},uri:{type:String}}}static get styles(){return[super.styles,r`${n}`]}render(){const o={primary:!this.alaska&&!this.alaskaTagline&&!this.customColor,emphasis:this.emphasis,accent:this.accent,disabled:this.disabled,error:this.error,success:this.success,advisory:this.advisory,warning:this.warning,label:this.label},e={labelContainer:!0,util_displayHiddenVisually:!this.label};return t`<div class="${a(o)}" title="${l(this.title?this.title:void 0)}"><span aria-hidden="${l(!this.ariaHidden||this.ariaHidden)}">${this.svg}</span><div class="${a(e)}"><slot></slot></div></div>`}}customElements.get("auro-icon")||customElements.define("auro-icon",c);const d=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"custom-icon";customElements.get(o)||customElements.define(o,class extends c{})};export{d as registerComponent};