@aurodesignsystem-dev/auro-icon 0.0.0-pr205.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,453 @@
1
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2
+ // See LICENSE in the project root for license information.
3
+
4
+ // ---------------------------------------------------------------------
5
+
6
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
7
+
8
+ class AuroLibraryRuntimeUtils {
9
+
10
+ /* eslint-disable jsdoc/require-param */
11
+
12
+ /**
13
+ * This will register a new custom element with the browser.
14
+ * @param {String} name - The name of the custom element.
15
+ * @param {Object} componentClass - The class to register as a custom element.
16
+ * @returns {void}
17
+ */
18
+ registerComponent(name, componentClass) {
19
+ if (!customElements.get(name)) {
20
+ customElements.define(name, class extends componentClass {});
21
+ }
22
+ }
23
+
24
+ /**
25
+ * Finds and returns the closest HTML Element based on a selector.
26
+ * @returns {void}
27
+ */
28
+ closestElement(
29
+ selector, // selector like in .closest()
30
+ base = this, // extra functionality to skip a parent
31
+ __Closest = (el, found = el && el.closest(selector)) =>
32
+ !el || el === document || el === window
33
+ ? null // standard .closest() returns null for non-found selectors also
34
+ : found
35
+ ? found // found a selector INside this element
36
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
37
+ ) {
38
+ return __Closest(base);
39
+ }
40
+ /* eslint-enable jsdoc/require-param */
41
+
42
+ /**
43
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
44
+ * @param {Object} elem - The element to check.
45
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
46
+ * @returns {void}
47
+ */
48
+ handleComponentTagRename(elem, tagName) {
49
+ const tag = tagName.toLowerCase();
50
+ const elemTag = elem.tagName.toLowerCase();
51
+
52
+ if (elemTag !== tag) {
53
+ elem.setAttribute(tag, true);
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Validates if an element is a specific Auro component.
59
+ * @param {Object} elem - The element to validate.
60
+ * @param {String} tagName - The name of the Auro component to check against.
61
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
62
+ */
63
+ elementMatch(elem, tagName) {
64
+ const tag = tagName.toLowerCase();
65
+ const elemTag = elem.tagName.toLowerCase();
66
+
67
+ return elemTag === tag || elem.hasAttribute(tag);
68
+ }
69
+ }
70
+
71
+ /**
72
+ * @license
73
+ * Copyright 2019 Google LLC
74
+ * SPDX-License-Identifier: BSD-3-Clause
75
+ */
76
+ const t$2=globalThis,e$4=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$4=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s$2),i$4=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$2(o,t,s$2)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
77
+
78
+ /**
79
+ * @license
80
+ * Copyright 2017 Google LLC
81
+ * SPDX-License-Identifier: BSD-3-Clause
82
+ */const{is:i$3,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$3,getPrototypeOf:n$1}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$3(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$3(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.0");
83
+
84
+ /**
85
+ * @license
86
+ * Copyright 2017 Google LLC
87
+ * SPDX-License-Identifier: BSD-3-Clause
88
+ */
89
+ const t$1=globalThis,i$2=t$1.trustedTypes,s$1=i$2?i$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$2="?"+h,n=`<${o$2}>`,r=document,l=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e$2+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$2)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$2?i$2.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$2)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t$1.litHtmlPolyfillSupport;j?.(N,R),(t$1.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
90
+
91
+ /**
92
+ * @license
93
+ * Copyright 2017 Google LLC
94
+ * SPDX-License-Identifier: BSD-3-Clause
95
+ */const s=globalThis;let i$1 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}};i$1._$litElement$=true,i$1["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i$1});const o$1=s.litElementPolyfillSupport;o$1?.({LitElement:i$1});(s.litElementVersions??=[]).push("4.2.0");
96
+
97
+ /**
98
+ * @license
99
+ * Copyright 2017 Google LLC
100
+ * SPDX-License-Identifier: BSD-3-Clause
101
+ */
102
+ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
103
+
104
+ /**
105
+ * @license
106
+ * Copyright 2018 Google LLC
107
+ * SPDX-License-Identifier: BSD-3-Clause
108
+ */const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
109
+
110
+ var error = {"role":"img","color":"currentColor","title":"","desc":"Error alert indicator.","width":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","height":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","xmlns":"http://www.w3.org/2000/svg","xmlns_xlink":"http://www.w3.org/1999/xlink","viewBox":"0 0 24 24","path":"/icons","style":"ico_squareLarge","type":"icon","name":"error","category":"alert","deprecated":true,"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
111
+
112
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
113
+ // See LICENSE in the project root for license information.
114
+
115
+
116
+ /**
117
+ * @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
118
+ * @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
119
+ * @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
120
+ */
121
+
122
+ class AuroElement extends i$1 {
123
+
124
+ // function to define props used within the scope of this component
125
+ static get properties() {
126
+ return {
127
+ hidden: { type: Boolean,
128
+ reflect: true },
129
+ hiddenVisually: { type: Boolean,
130
+ reflect: true },
131
+ hiddenAudible: { type: Boolean,
132
+ reflect: true },
133
+ };
134
+ }
135
+
136
+ /**
137
+ * @private Function that determines state of aria-hidden
138
+ */
139
+ hideAudible(value) {
140
+ if (value) {
141
+ return 'true'
142
+ }
143
+
144
+ return 'false'
145
+ }
146
+ }
147
+
148
+ /* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
149
+
150
+ const _fetchMap = new Map();
151
+
152
+ /**
153
+ * A callback to parse Response body.
154
+ *
155
+ * @callback ResponseParser
156
+ * @param {Fetch.Response} response
157
+ * @returns {Promise}
158
+ */
159
+
160
+ /**
161
+ * A minimal in-memory map to de-duplicate Fetch API media requests.
162
+ *
163
+ * @param {String} uri
164
+ * @param {Object} [options={}]
165
+ * @param {ResponseParser} [options.responseParser=(response) => response.text()]
166
+ * @returns {Promise}
167
+ */
168
+ const cacheFetch = (uri, options = {}) => {
169
+ const responseParser =
170
+ options.responseParser || ((response) => response.text());
171
+ if (!_fetchMap.has(uri)) {
172
+ _fetchMap.set(uri, fetch(uri).then(responseParser));
173
+ }
174
+ return _fetchMap.get(uri);
175
+ };
176
+
177
+ var styleCss$1 = i$4`:focus:not(:focus-visible){outline:3px solid transparent}.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}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, .25rem);line-height:1.8}
178
+ `;
179
+
180
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
181
+ // See LICENSE in the project root for license information.
182
+
183
+
184
+ // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
185
+ /**
186
+ * @slot - Hidden from visibility, used for a11y if icon description is needed
187
+ */
188
+
189
+ // build the component class
190
+ class BaseIcon extends AuroElement {
191
+ constructor() {
192
+ super();
193
+ this.onDark = false;
194
+ }
195
+
196
+ // function to define props used within the scope of this component
197
+ static get properties() {
198
+ return {
199
+ ...AuroElement.properties,
200
+
201
+ /**
202
+ * Set value for on-dark version of auro-icon.
203
+ */
204
+ onDark: {
205
+ type: Boolean,
206
+ reflect: true,
207
+ },
208
+
209
+ /**
210
+ * @private
211
+ */
212
+ svg: {
213
+ attribute: false,
214
+ reflect: true,
215
+ },
216
+ };
217
+ }
218
+
219
+ static get styles() {
220
+ return styleCss$1;
221
+ }
222
+
223
+ /**
224
+ * Async function to fetch requested icon from npm CDN.
225
+ * @private
226
+ * @param {string} category - Icon category.
227
+ * @param {string} name - Icon name.
228
+ * @returns {SVGElement} DOM - Ready HTML to be appended.
229
+ */
230
+ async fetchIcon(category, name) {
231
+ let iconHTML = "";
232
+
233
+ if (category === "logos") {
234
+ iconHTML = await cacheFetch(`${this.uri}/${category}/${name}.svg`);
235
+ } else {
236
+ iconHTML = await cacheFetch(`${this.uri}/icons/${category}/${name}.svg`);
237
+ }
238
+
239
+ const dom = new DOMParser().parseFromString(iconHTML, "text/html");
240
+
241
+ return dom.body.querySelector("svg");
242
+ }
243
+
244
+ // lifecycle function
245
+ async firstUpdated() {
246
+ try {
247
+ if (!this.customSvg) {
248
+ const svg = await this.fetchIcon(this.category, this.name);
249
+
250
+ if (svg) {
251
+ this.svg = svg;
252
+ } else if (!svg) {
253
+ const penDOM = new DOMParser().parseFromString(
254
+ error.svg,
255
+ "text/html",
256
+ );
257
+
258
+ this.svg = penDOM.body.firstChild;
259
+ }
260
+ }
261
+ // eslint-disable-next-line no-unused-vars
262
+ } catch (_err) {
263
+ this.svg = undefined;
264
+ }
265
+ }
266
+ }
267
+
268
+ var styleCss = i$4`.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;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]){--ds-auro-alaska-color: #FFF}
269
+ `;
270
+
271
+ var tokensCss = i$4`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
272
+ `;
273
+
274
+ /**
275
+ * @license
276
+ * Copyright 2018 Google LLC
277
+ * SPDX-License-Identifier: BSD-3-Clause
278
+ */const o=o=>o??E;
279
+
280
+ var colorCss = i$4`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
281
+ `;
282
+
283
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
284
+ // See LICENSE in the project root for license information.
285
+
286
+
287
+ class AuroIcon extends BaseIcon {
288
+ constructor() {
289
+ super();
290
+
291
+ this.variant = undefined;
292
+ this.privateDefaults();
293
+ }
294
+
295
+ /**
296
+ * Internal Defaults.
297
+ * @private
298
+ * @returns {void}
299
+ */
300
+ privateDefaults() {
301
+ this.uri = "https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist";
302
+ this.runtimeUtils = new AuroLibraryRuntimeUtils();
303
+ }
304
+
305
+ // function to define props used within the scope of this component
306
+ static get properties() {
307
+ return {
308
+ ...BaseIcon.properties,
309
+
310
+ /**
311
+ * Set aria-hidden value. Default is `true`. Option is `false`.
312
+ */
313
+ ariaHidden: {
314
+ type: String,
315
+ reflect: true,
316
+ },
317
+
318
+ /**
319
+ * The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
320
+ */
321
+ category: {
322
+ type: String,
323
+ reflect: true,
324
+ },
325
+
326
+ /**
327
+ * Allows custom color to be set.
328
+ */
329
+ customColor: {
330
+ type: Boolean,
331
+ reflect: true,
332
+ },
333
+
334
+ /**
335
+ * When true, auro-icon will render a custom SVG inside the default slot.
336
+ */
337
+ customSvg: {
338
+ type: Boolean,
339
+ },
340
+
341
+ /**
342
+ * Exposes content in slot as icon label.
343
+ */
344
+ label: {
345
+ type: Boolean,
346
+ reflect: true,
347
+ },
348
+
349
+ /**
350
+ * The name of the icon you are looking for without the file extension. See https://auro.alaskaair.com/icons/usage.
351
+ */
352
+ name: {
353
+ type: String,
354
+ reflect: true,
355
+ },
356
+
357
+ /**
358
+ * The style of the icon. The accepted variants are `accent1`, `disabled`, `muted`, `statusDefault`, `statusInfo`, `statusSuccess`, `statusWarning`, `statusError`, `statusInfoSubtle`, `statusSuccessSubtle`, `statusWarningSubtle`, `statusErrorSubtle`, `fareBasicEconomy`, `fareBusiness`, `fareEconomy`, `fareFirst`, `farePremiumEconomy`, `tierOneWorldEmerald`, `tierOneWorldSapphire`, `tierOneWorldRuby`.
359
+ */
360
+ variant: {
361
+ type: String,
362
+ reflect: true,
363
+ },
364
+ };
365
+ }
366
+
367
+ static get styles() {
368
+ return [BaseIcon.styles, tokensCss, styleCss$1, colorCss];
369
+ }
370
+
371
+ /**
372
+ * This will register this element with the browser.
373
+ * @param {string} [name="auro-icon"] - The name of element that you want to register to.
374
+ *
375
+ * @example
376
+ * AuroIcon.register("custom-icon") // this will register this element to <custom-icon/>
377
+ *
378
+ */
379
+ static register(name = "auro-icon") {
380
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroIcon);
381
+ }
382
+
383
+ connectedCallback() {
384
+ super.connectedCallback();
385
+
386
+ // Add the tag name as an attribute if it is different than the component name
387
+ this.runtimeUtils.handleComponentTagRename(this, "auro-icon");
388
+ }
389
+
390
+ /**
391
+ * @private
392
+ * @returns {void} Exposes CSS parts for styling from parent components.
393
+ */
394
+ exposeCssParts() {
395
+ this.setAttribute("exportparts", "svg:iconSvg");
396
+ }
397
+
398
+ async firstUpdated() {
399
+ await super.firstUpdated();
400
+
401
+ /**
402
+ * icons provide a description for screen readers. Icon only instances Auro-button
403
+ * depend on this description to provide context for the user using a screen reader.
404
+ * Removes the SVG description for screen reader if ariaHidden is set to true.
405
+ */
406
+ if (this.hasAttribute("ariaHidden") && this.svg) {
407
+ const svgDesc = this.svg.querySelector("desc");
408
+
409
+ if (svgDesc) {
410
+ svgDesc.remove();
411
+ this.svg.removeAttribute("aria-labelledby");
412
+ }
413
+ }
414
+ }
415
+
416
+ // function that renders the HTML and CSS into the scope of the component
417
+ render() {
418
+ const labelClasses = {
419
+ labelWrapper: true,
420
+ util_displayHiddenVisually: !this.label,
421
+ };
422
+
423
+ const svgClasses = {
424
+ svgWrapper: true,
425
+ };
426
+
427
+ return x`
428
+ <div class="componentWrapper">
429
+ <div
430
+ class="${e(svgClasses)}"
431
+ title="${o(this.title || undefined)}">
432
+ <span aria-hidden="${o(this.ariaHidden || true)}" part="svg">
433
+ ${
434
+ this.customSvg
435
+ ? x`
436
+ <slot name="svg"></slot>
437
+ `
438
+ : x`
439
+ ${this.svg}
440
+ `
441
+ }
442
+ </span>
443
+ </div>
444
+
445
+ <div class="${e(labelClasses)}">
446
+ <slot></slot>
447
+ </div>
448
+ </div>
449
+ `;
450
+ }
451
+ }
452
+
453
+ export { AuroIcon as A, BaseIcon as B, AuroLibraryRuntimeUtils as a, e, styleCss as s, tokensCss as t, x };
@@ -0,0 +1,56 @@
1
+ <!--
2
+ Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
3
+ See LICENSE in the project root for license information.
4
+
5
+ HTML in this document is standardized and NOT to be edited.
6
+ All demo code should be added/edited in ./demo/index.md
7
+
8
+ With the exception of adding custom elements if needed for the demo.
9
+
10
+ ----------------------- DO NOT EDIT -----------------------------
11
+
12
+ -->
13
+
14
+ <!DOCTYPE html>
15
+ <html lang="en">
16
+ <head>
17
+ <meta charset="UTF-8" />
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
19
+ <title>Auro Web Component Demo | auro-icon</title>
20
+
21
+ <!-- Prism.js Stylesheet -->
22
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
23
+
24
+ <!-- Legacy reference is still needed to support auro-icon's use of legacy token values at this time -->
25
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
26
+
27
+ <!-- Design Token Alaska Theme -->
28
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
29
+
30
+ <!-- Webcore Stylesheet Alaska Theme -->
31
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
32
+
33
+ <!-- Demo Specific Styles -->
34
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
35
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
36
+ </head>
37
+ <body class="auro-markdown">
38
+ <main></main>
39
+
40
+ <script type="module">
41
+ import 'https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js';
42
+ import 'https://cdn.jsdelivr.net/npm/prismjs@latest/prism.js';
43
+ fetch('./index.md')
44
+ .then((response) => response.text())
45
+ .then((text) => {
46
+ const rawHtml = marked.parse(text);
47
+ document.querySelector('main').innerHTML = rawHtml;
48
+ Prism.highlightAll();
49
+ });
50
+ </script>
51
+ <script src="./index.min.js" data-demo-script="true" type="module"></script>
52
+
53
+ <!-- If additional elements are needed for the demo, add them here. -->
54
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
55
+ </body>
56
+ </html>
package/demo/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { AuroIcon } from "../src/index";
2
+
3
+ AuroIcon.register();
4
+ AuroIcon.register("custom-icon");
package/demo/index.md ADDED
@@ -0,0 +1,112 @@
1
+ <!--
2
+ The index.md file is a compiled document. No edits should be made directly to this file.
3
+ README.md is created by running `npm run build:docs`.
4
+ This file is generated based on a template fetched from `../docs/partials/index.md`
5
+ -->
6
+
7
+ # Icon
8
+
9
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../docs/partials/description.md) -->
10
+ <!-- The below content is automatically added from ../docs/partials/description.md -->
11
+ Icons can be used to represent concepts or provide context to options and/or actions within an experience.
12
+
13
+ The `<auro-icon>` web component comes pre-configured with all the available [Auro Icons](https://auro.alaskaair.com/icons) . Simply add the `category` and `name` of the icon for quick and easy results.
14
+ <!-- AURO-GENERATED-CONTENT:END -->
15
+
16
+ ## Example(s)
17
+
18
+ ### Default
19
+
20
+ <div class="exampleWrapper">
21
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/basic.html) -->
22
+ <!-- The below content is automatically added from ../apiExamples/basic.html -->
23
+ <auro-icon category="interface" name="pin-trip"></auro-icon>
24
+ <!-- AURO-GENERATED-CONTENT:END -->
25
+ </div>
26
+ <auro-accordion alignRight>
27
+ <span slot="trigger">See code</span>
28
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/basic.html) -->
29
+ <!-- The below code snippet is automatically added from ../apiExamples/basic.html -->
30
+
31
+ ```html
32
+ <auro-icon category="interface" name="pin-trip"></auro-icon>
33
+ ```
34
+ <!-- AURO-GENERATED-CONTENT:END -->
35
+ </auro-accordion>
36
+
37
+ ### Accessibility
38
+
39
+ #### aria-hidden
40
+
41
+ By default `aria-hidden` on the SVG inside the `auro-icon` element is set to `true`. Using the `ariaHidden` attribute on `auro-icon` you can set that value to `false`. This will allow the screen reader to announce the content from the SVG's `title` element.
42
+
43
+ <div class="exampleWrapper">
44
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/ariaHidden.html) -->
45
+ <!-- The below content is automatically added from ../apiExamples/ariaHidden.html -->
46
+ <auro-icon category="interface" name="pin-trip" ariaHidden="false"></auro-icon>
47
+ <!-- AURO-GENERATED-CONTENT:END -->
48
+ </div>
49
+ <auro-accordion alignRight>
50
+ <span slot="trigger">See code</span>
51
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/ariaHidden.html) -->
52
+ <!-- The below code snippet is automatically added from ../apiExamples/ariaHidden.html -->
53
+
54
+ ```html
55
+ <auro-icon category="interface" name="pin-trip" ariaHidden="false"></auro-icon>
56
+ ```
57
+ <!-- AURO-GENERATED-CONTENT:END -->
58
+ </auro-accordion>
59
+
60
+ #### Alter the accessibility description
61
+
62
+ If the description you intend to be read back is different than the content in the default `title` element of the SVG, leave the `aria-hidden="true"` default on the SVG and enter the custom description into the `auro-icon` slot.
63
+
64
+ <div class="exampleWrapper">
65
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/accessDescr.html) -->
66
+ <!-- The below content is automatically added from ../apiExamples/accessDescr.html -->
67
+ <auro-icon category="interface" name="pin-trip">Your trip starts here!</auro-icon>
68
+ <!-- AURO-GENERATED-CONTENT:END -->
69
+ </div>
70
+ <auro-accordion alignRight>
71
+ <span slot="trigger">See code</span>
72
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/accessDescr.html) -->
73
+ <!-- The below code snippet is automatically added from ../apiExamples/accessDescr.html -->
74
+
75
+ ```html
76
+ <auro-icon category="interface" name="pin-trip">Your trip starts here!</auro-icon>
77
+ ```
78
+ <!-- AURO-GENERATED-CONTENT:END -->
79
+ </auro-accordion>
80
+
81
+ ## Recommended Use and Version Control
82
+
83
+ There are two important parts of every Auro component. The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element. The class is exported and then used as part of defining the Web Component. When importing this component as described in the <a href="#install">install</a> section, the class is imported and the `auro-icon` custom element is defined automatically.
84
+
85
+ To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our `AuroIcon.register(name)` method and pass in a unique name.
86
+
87
+ ```js
88
+ import { AuroIcon, AuroAlaska } from '@aurodesignsystem/auro-icon/class';
89
+
90
+ AuroIcon.register('custom-icon');
91
+ AuroAlaska.register('custom-alaska');
92
+ ```
93
+
94
+ This will create a new custom element that you can use in your HTML that will function identically to the `auro-icon` element.
95
+ If you want to use `<auro-alaska>` without registering, add `import @aurodesignsystem/auro-icon` instead of `import @aurodesignsystem/auro-icon/src/auro-alaska.js`.
96
+
97
+ <div class="exampleWrapper">
98
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/custom.html) -->
99
+ <!-- The below content is automatically added from ../apiExamples/custom.html -->
100
+ <custom-icon category="interface" name="pin-trip"></custom-icon>
101
+ <!-- AURO-GENERATED-CONTENT:END -->
102
+ </div>
103
+ <auro-accordion alignRight>
104
+ <span slot="trigger">See code</span>
105
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/custom.html) -->
106
+ <!-- The below code snippet is automatically added from ../apiExamples/custom.html -->
107
+
108
+ ```html
109
+ <custom-icon category="interface" name="pin-trip"></custom-icon>
110
+ ```
111
+ <!-- AURO-GENERATED-CONTENT:END -->
112
+ </auro-accordion>
@@ -0,0 +1,4 @@
1
+ import { A as AuroIcon } from './auro-icon.min.js';
2
+
3
+ AuroIcon.register();
4
+ AuroIcon.register("custom-icon");