@aurodesignsystem-dev/auro-alert 0.0.0-pr122.0 → 0.0.0-pr124.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.
@@ -1,8 +1,8 @@
1
- import{unsafeStatic as e,literal as t,html as r}from"lit/static-html.js";import{css as a,html as o,LitElement as s}from"lit";import{classMap as i}from"lit/directives/class-map.js";import{ifDefined as n}from"lit/directives/if-defined.js";class l{registerComponent(e,t){customElements.get(e)||customElements.define(e,class extends t{})}closestElement(e,t=this,r=(t,a=t&&t.closest(e))=>t&&t!==document&&t!==window?a||r(t.getRootNode().host):null){return r(t)}handleComponentTagRename(e,t){const r=t.toLowerCase();e.tagName.toLowerCase()!==r&&e.setAttribute(r,!0)}elementMatch(e,t){const r=t.toLowerCase();return e.tagName.toLowerCase()===r||e.hasAttribute(r)}}class c extends s{static get properties(){return{hidden:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0}}}hideAudible(e){return e?"true":"false"}}const d=new Map,u=(e,t={})=>{const r=t.responseParser||(e=>e.text());return d.has(e)||d.set(e,fetch(e).then(r)),d.get(e)};var p=a`: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;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;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
2
- `;class h extends c{constructor(){super(),this.onDark=!1,this.appearance="default"}static get properties(){return{...c.properties,onDark:{type:Boolean,reflect:!0},appearance:{type:String,reflect:!0},svg:{attribute:!1,reflect:!0}}}static get styles(){return p}async fetchIcon(e,t){let r="";return r="logos"===e?await u(`${this.uri}/${e}/${t}.svg`):await u(`${this.uri}/icons/${e}/${t}.svg`),(new DOMParser).parseFromString(r,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const e=await this.fetchIcon(this.category,this.name);if(e)this.svg=e;else if(!e){const e=(new DOMParser).parseFromString('<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>',"text/html");this.svg=e.body.firstChild}}}catch(e){this.svg=void 0}}}a`.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]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
1
+ import{unsafeStatic as e,literal as t,html as r}from"lit/static-html.js";import{css as a,html as o,LitElement as s}from"lit";import{classMap as i}from"lit/directives/class-map.js";import{ifDefined as n}from"lit/directives/if-defined.js";class l{registerComponent(e,t){customElements.get(e)||customElements.define(e,class extends t{})}closestElement(e,t=this,r=(t,a=t&&t.closest(e))=>t&&t!==document&&t!==window?a||r(t.getRootNode().host):null){return r(t)}handleComponentTagRename(e,t){const r=t.toLowerCase();e.tagName.toLowerCase()!==r&&e.setAttribute(r,!0)}elementMatch(e,t){const r=t.toLowerCase();return e.tagName.toLowerCase()===r||e.hasAttribute(r)}getSlotText(e,t){const r=e.shadowRoot?.querySelector(`slot[name="${t}"]`);return(r?.assignedNodes({flatten:!0})||[]).map(e=>e.textContent?.trim()).join(" ").trim()||null}}class c extends s{static get properties(){return{hidden:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0}}}hideAudible(e){return e?"true":"false"}}const d=new Map,u=(e,t={})=>{const r=t.responseParser||(e=>e.text());return d.has(e)||d.set(e,fetch(e).then(r)),d.get(e)};var p=a`: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;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;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
2
+ `;class h extends c{constructor(){super(),this._initializeDefaults()}_initializeDefaults(){this.onDark=!1,this.appearance="default"}static get properties(){return{...c.properties,onDark:{type:Boolean,attribute:"ondark",reflect:!0},appearance:{type:String,reflect:!0},svg:{attribute:!1}}}static get styles(){return p}async fetchIcon(e,t){let r="";return r="logos"===e?await u(`${this.uri}/${e}/${t}.svg`):await u(`${this.uri}/icons/${e}/${t}.svg`),(new DOMParser).parseFromString(r,"text/html").body.querySelector("svg")}async firstUpdated(){await this.loadIcon()}async loadIcon(){this._loadId=(this._loadId||0)+1;const e=this._loadId;if(this.customSvg)return;let t;try{if(this.category&&this.name&&(t=await this.fetchIcon(this.category,this.name)),!t){const e=this.name?.startsWith("tail-")?'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" style="min-width:100%;height:auto;fill:currentColor" viewBox="0 0 142 138" part="svg"><title id="tail-DEFAULT__title">Airplane tail default image with light gray color</title><path fill="url(#paint0_linear_9225_2069)" fill-rule="evenodd" d="M124.093 14.665a3.26 3.26 0 0 1 3.208 3.829L101.097 119.85c-.47 1.087-2.211 3.398-5.692 3.471l-.106.001-80.65.013A659230 659230 0 0 1 99.08 17.412c1.214-1.497 3.275-2.722 5.372-2.747z" clip-rule="evenodd"/><defs><linearGradient id="paint0_linear_9225_2069" x1="114.823" x2="60.061" y1="14.665" y2="123.335" gradientUnits="userSpaceOnUse"><stop offset=".5" stop-color="#707984"/><stop offset=".5" stop-color="#646E7B"/></linearGradient></defs></svg>':'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error-stroke__desc" class="ico_squareLarge" 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-stroke__desc">triangle with exclamation mark.</desc><path d="M12 15.34c-.41 0-.75-.34-.75-.75V9.33c0-.41.34-.75.75-.75s.75.34.75.75v5.26c0 .41-.34.75-.75.75m.87 1.62c0-.48-.39-.88-.88-.88s-.88.39-.88.88.39.88.88.88.88-.39.88-.88M11.98 4.5 3.5 18.97h16.99zm0-1.5c.5 0 1 .25 1.29.74l8.51 14.47c.59 1-.13 2.26-1.29 2.26H3.5c-1.16 0-1.88-1.26-1.29-2.26l8.48-14.47c.29-.49.79-.74 1.29-.74"/></svg>';t=(new DOMParser).parseFromString(e,"text/html").body.querySelector("svg")}}catch(e){t=void 0}e===this._loadId&&(this._sourceSvg=t,this.svg=t?this.prepareSvg(t):void 0)}prepareSvg(e){return e}}a`.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]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
3
3
  `;var v=a`: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)}
4
4
  `,m=a`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
5
- `;class f extends h{constructor(){super(),this.variant=void 0,this.privateDefaults()}privateDefaults(){this.uri="https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist",this.runtimeUtils=new l}static get properties(){return{...h.properties,ariaHidden:{type:String,reflect:!0},category:{type:String,reflect:!0},customColor:{type:Boolean,reflect:!0},customSvg:{type:Boolean},label:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},variant:{type:String,reflect:!0}}}static get styles(){return[h.styles,v,p,m]}static register(e="auro-icon"){l.prototype.registerComponent(e,f)}connectedCallback(){super.connectedCallback(),this.runtimeUtils.handleComponentTagRename(this,"auro-icon")}exposeCssParts(){this.setAttribute("exportparts","svg:iconSvg")}async firstUpdated(){if(await super.firstUpdated(),this.hasAttribute("ariaHidden")&&this.svg){const e=this.svg.querySelector("desc");e&&(e.remove(),this.svg.removeAttribute("aria-labelledby"))}}render(){const e={labelWrapper:!0,util_displayHiddenVisually:!this.label};return o`
5
+ `;class g extends h{constructor(){super(),this._initializeDefaults()}_initializeDefaults(){super._initializeDefaults(),this.variant=void 0,this.uri="https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist",this.runtimeUtils=new l}static get properties(){return{...h.properties,ariaHidden:{type:String,attribute:"ariahidden",reflect:!0},category:{type:String,reflect:!0},customColor:{type:Boolean,attribute:"customcolor",reflect:!0},customSvg:{type:Boolean,attribute:"customsvg"},label:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},variant:{type:String,reflect:!0}}}static get styles(){return[h.styles,v,p,m]}static register(e="auro-icon"){l.prototype.registerComponent(e,g)}connectedCallback(){super.connectedCallback(),this.runtimeUtils.handleComponentTagRename(this,"auro-icon")}exposeCssParts(){this.setAttribute("exportparts","svg:iconSvg")}prepareSvg(e){if(!this.hasAttribute("ariaHidden")||"false"===this.ariaHidden)return e;const t=e.cloneNode(!0),r=t.querySelector("desc");return r&&(r.remove(),t.removeAttribute("aria-labelledby")),t}updated(e){super.updated(e),this._hasRendered?e.has("category")||e.has("name")||e.has("customSvg")?this.loadIcon():e.has("ariaHidden")&&this._sourceSvg&&(this.svg=this.prepareSvg(this._sourceSvg)):this._hasRendered=!0}render(){const e={labelWrapper:!0,util_displayHiddenVisually:!this.label};return o`
6
6
  <div class="componentWrapper">
7
7
  <div
8
8
  class="${i({svgWrapper:!0})}"
@@ -20,10 +20,10 @@ import{unsafeStatic as e,literal as t,html as r}from"lit/static-html.js";import{
20
20
  <slot></slot>
21
21
  </div>
22
22
  </div>
23
- `}}class g{generateElementName(e,t){let r=e;return r+="-",r+=t.replace(/[.]/g,"_"),r}generateTag(r,a,o){const s=this.generateElementName(r,a),i=t`${e(s)}`;return customElements.get(s)||customElements.define(s,class extends o{}),i}}class b{registerComponent(e,t){customElements.get(e)||customElements.define(e,class extends t{})}closestElement(e,t=this,r=(t,a=t&&t.closest(e))=>t&&t!==document&&t!==window?a||r(t.getRootNode().host):null){return r(t)}handleComponentTagRename(e,t){const r=t.toLowerCase();e.tagName.toLowerCase()!==r&&e.setAttribute(r,!0)}elementMatch(e,t){const r=t.toLowerCase();return e.tagName.toLowerCase()===r||e.hasAttribute(r)}getSlotText(e,t){const r=e.shadowRoot?.querySelector(`slot[name="${t}"]`);return(r?.assignedNodes({flatten:!0})||[]).map(e=>e.textContent?.trim()).join(" ").trim()||null}}class y extends s{static get properties(){return{hidden:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0}}}hideAudible(e){return e?"true":"false"}}var x=a`.alert{border-color:var(--ds-auro-alert-border-color);background-color:var(--ds-auro-alert-container-color);color:var(--ds-auro-alert-text-color)}[auro-icon]{color:var(--ds-auro-alert-icon-color)}:host([type=error]){--ds-auro-alert-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-alert-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host([type=warning]){--ds-auro-alert-border-color: var(--ds-basic-color-status-warning, #fac200);--ds-auro-alert-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host([type=information]){--ds-auro-alert-border-color: var(--ds-basic-color-status-info, #01426a);--ds-auro-alert-icon-color: var(--ds-basic-color-status-info, #01426a)}:host([type=success]){--ds-auro-alert-border-color: var(--ds-basic-color-status-success, #447a1f);--ds-auro-alert-icon-color: var(--ds-basic-color-status-success, #447a1f)}
24
- `,k=a`.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}.alert{display:flex;padding:var(--ds-size-100, .5rem);padding-right:var(--ds-size-200, 1rem);padding-left:var(--ds-size-150, .75rem);border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, .375rem);border-left-width:var(--ds-size-100, .5rem)}[auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-100, .5rem)}.content{width:-webkit-fill-available}
25
- `,w=a`:host{--ds-auro-alert-border-color: var(--ds-basic-color-status-default, #afb9c6);--ds-auro-alert-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-alert-icon-color: transparent;--ds-auro-alert-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}
26
- `;class S extends y{constructor(){super();const e=new g;this.iconTag=e.generateTag("auro-icon","9.1.1",f),this.runtimeUtils=new b}static get properties(){return{...y.properties,hidden:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},iconTag:{type:String},noIcon:{type:Boolean,reflect:!0},role:{type:String,reflect:!0},type:{type:String,attribute:"type",reflect:!0}}}static get styles(){return[k,x,w]}static register(e="auro-alert"){b.prototype.registerComponent(e,S)}firstUpdated(){this.runtimeUtils.handleComponentTagRename(this,"auro-alert")}generateIconHtml(e,t){return this.noIcon?r``:r`<${this.iconTag} customColor category="${e}" name="${t}"></${this.iconTag}>`}render(){let e=r``;switch(this.type){case void 0:break;case"error":e=this.generateIconHtml("alert","error-stroke"),this.role="alert",this.typeStr="Error.";break;case"success":e=this.generateIconHtml("interface","check-stroke"),this.role="alert",this.typeStr="Success.";break;case"warning":e=this.generateIconHtml("alert","warning-stroke"),this.role="alert",this.typeStr="Warning.";break;case"information":e=this.generateIconHtml("alert","information-stroke"),this.typeStr="Informational notice."}return r`
23
+ `}}class f{generateElementName(e,t){let r=e;return r+="-",r+=t.replace(/[.]/g,"_"),r}generateTag(r,a,o){const s=this.generateElementName(r,a),i=t`${e(s)}`;return customElements.get(s)||customElements.define(s,class extends o{}),i}}class b{registerComponent(e,t){customElements.get(e)||customElements.define(e,class extends t{})}closestElement(e,t=this,r=(t,a=t&&t.closest(e))=>t&&t!==document&&t!==window?a||r(t.getRootNode().host):null){return r(t)}handleComponentTagRename(e,t){const r=t.toLowerCase();e.tagName.toLowerCase()!==r&&e.setAttribute(r,!0)}elementMatch(e,t){const r=t.toLowerCase();return e.tagName.toLowerCase()===r||e.hasAttribute(r)}getSlotText(e,t){const r=e.shadowRoot?.querySelector(`slot[name="${t}"]`);return(r?.assignedNodes({flatten:!0})||[]).map(e=>e.textContent?.trim()).join(" ").trim()||null}}class y extends s{static get properties(){return{hidden:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0}}}hideAudible(e){return e?"true":"false"}}var w=a`.alert{border-color:var(--ds-auro-alert-border-color);background-color:var(--ds-auro-alert-container-color);color:var(--ds-auro-alert-text-color)}[auro-icon]{color:var(--ds-auro-alert-icon-color)}:host([type=error]){--ds-auro-alert-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-alert-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host([type=warning]){--ds-auro-alert-border-color: var(--ds-basic-color-status-warning, #fac200);--ds-auro-alert-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host([type=information]){--ds-auro-alert-border-color: var(--ds-basic-color-status-info, #01426a);--ds-auro-alert-icon-color: var(--ds-basic-color-status-info, #01426a)}:host([type=success]){--ds-auro-alert-border-color: var(--ds-basic-color-status-success, #447a1f);--ds-auro-alert-icon-color: var(--ds-basic-color-status-success, #447a1f)}
24
+ `,x=a`.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}.alert{display:flex;padding:var(--ds-size-100, .5rem);padding-right:var(--ds-size-200, 1rem);padding-left:var(--ds-size-150, .75rem);border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, .375rem);border-left-width:var(--ds-size-100, .5rem)}[auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-100, .5rem)}.content{width:-webkit-fill-available}
25
+ `,k=a`:host{--ds-auro-alert-border-color: var(--ds-basic-color-status-default, #afb9c6);--ds-auro-alert-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-alert-icon-color: transparent;--ds-auro-alert-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}
26
+ `;class S extends y{constructor(){super();const e=new f;this.iconTag=e.generateTag("auro-icon","9.2.1",g),this.runtimeUtils=new b}static get properties(){return{...y.properties,hidden:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},iconTag:{type:String},noIcon:{type:Boolean,reflect:!0},role:{type:String,reflect:!0},type:{type:String,attribute:"type",reflect:!0}}}static get styles(){return[x,w,k]}static register(e="auro-alert"){b.prototype.registerComponent(e,S)}firstUpdated(){this.runtimeUtils.handleComponentTagRename(this,"auro-alert")}generateIconHtml(e,t){return this.noIcon?r``:r`<${this.iconTag} customColor category="${e}" name="${t}"></${this.iconTag}>`}render(){let e=r``;switch(this.type){case void 0:break;case"error":e=this.generateIconHtml("alert","error-stroke"),this.role="alert",this.typeStr="Error.";break;case"success":e=this.generateIconHtml("interface","check-stroke"),this.role="alert",this.typeStr="Success.";break;case"warning":e=this.generateIconHtml("alert","warning-stroke"),this.role="alert",this.typeStr="Warning.";break;case"information":e=this.generateIconHtml("alert","information-stroke"),this.typeStr="Informational notice."}return r`
27
27
  <div part="alert" class="alert"
28
28
  aria-hidden="${this.hideAudible(this.hiddenAudible)}">
29
29
  ${e}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  import type { AuroAlert } from "src/auro-alert.js";
3
2
 
4
3
  /**
@@ -21,13 +20,14 @@ import type { AuroAlert } from "src/auro-alert.js";
21
20
  */
22
21
  export type ScopedElements<
23
22
  Prefix extends string = "",
24
- Suffix extends string = ""
23
+ Suffix extends string = "",
25
24
  > = {
26
- [Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
25
+ [
26
+ Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`
27
+ ]: CustomElements[Key];
27
28
  };
28
29
 
29
30
  type BaseProps<T extends HTMLElement> = {
30
-
31
31
  /** Content added between the opening and closing tags of the element */
32
32
  children?: any;
33
33
  /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
@@ -50,6 +50,8 @@ type BaseProps<T extends HTMLElement> = {
50
50
  key?: string | number;
51
51
  /** Specifies the language of the element. */
52
52
  lang?: string;
53
+ /** Defines the element's semantic role for accessibility APIs. */
54
+ role?: string;
53
55
  /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
54
56
  part?: string;
55
57
  /** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
@@ -70,127 +72,197 @@ type BaseProps<T extends HTMLElement> = {
70
72
  popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
71
73
  /** Specifies the action to be performed on a popover element being controlled by a control element. */
72
74
  popovertargetaction?: "show" | "hide" | "toggle";
73
-
74
- } ;
75
-
76
- type BaseEvents = {
77
-
78
-
79
75
  };
80
76
 
81
-
77
+ type BaseEvents = {};
82
78
 
83
79
  export type AuroAlertProps = {
84
- /** If present, the component will be hidden both visually and from screen readers */
85
- "hidden"?: AuroAlert['hidden'];
86
- /** If present, the component will be hidden from screen readers, but seen visually */
87
- "hiddenAudible"?: AuroAlert['hiddenAudible'];
88
- /** If present, the component will be hidden visually, but still read by screen readers */
89
- "hiddenVisually"?: AuroAlert['hiddenVisually'];
90
- /** */
91
- "iconTag"?: AuroAlert['iconTag'];
92
- /** Removes icon from alert UI when `type` attribute is set */
93
- "noIcon"?: AuroAlert['noIcon'];
94
- /** */
95
- "role"?: AuroAlert['role'];
96
- /** Component will render visually based on which type value is set */
97
- "type"?: AuroAlert['type'];
98
-
80
+ /** Hides the alert both visually and from screen readers. */
81
+ hidden?: AuroAlert["hidden"];
82
+ /** Hides the alert from screen readers while keeping it visible. */
83
+ hiddenAudible?: AuroAlert["hiddenAudible"];
84
+ /** Hides the alert visually while keeping it available to screen readers. */
85
+ hiddenVisually?: AuroAlert["hiddenVisually"];
86
+ /** Removes the icon from the alert. Applies only when `type` is set, because an alert without a type has no icon. */
87
+ noIcon?: AuroAlert["noIcon"];
88
+ /** Sets the alert's purpose, which controls its icon and border color: `error`, `warning`, `success`, or `information`. Without a value, the alert shows no icon and uses a default border color. */
89
+ type?: AuroAlert["type"];
90
+ };
99
91
 
100
- }
92
+ export type AuroAlertSolidJsProps = {
93
+ /** Hides the alert both visually and from screen readers. */
94
+ "prop:hidden"?: AuroAlert["hidden"];
95
+ /** Hides the alert from screen readers while keeping it visible. */
96
+ "prop:hiddenAudible"?: AuroAlert["hiddenAudible"];
97
+ /** Hides the alert visually while keeping it available to screen readers. */
98
+ "prop:hiddenVisually"?: AuroAlert["hiddenVisually"];
99
+ /** Removes the icon from the alert. Applies only when `type` is set, because an alert without a type has no icon. */
100
+ "prop:noIcon"?: AuroAlert["noIcon"];
101
+ /** Sets the alert's purpose, which controls its icon and border color: `error`, `warning`, `success`, or `information`. Without a value, the alert shows no icon and uses a default border color. */
102
+ "prop:type"?: AuroAlert["type"];
101
103
 
102
- export type CustomElements = {
104
+ /** Set the innerHTML of the element */
105
+ innerHTML?: string;
106
+ /** Set the textContent of the element */
107
+ textContent?: string | number;
108
+ };
103
109
 
110
+ export type CustomElements = {
111
+ /**
112
+ * Shows an inline message that gives feedback about a user action, such as an error, success, warning, or information message.
113
+ *
114
+ * **Key capabilities**
115
+ * - **Alert types**: Set `type` to `error`, `information`, `success`, or `warning` to change the icon and border color.
116
+ * - **Optional icon**: Set `noIcon` to remove the icon.
117
+ * - **Hiding**: Set `hidden` to hide the alert from everyone, `hiddenVisually` to hide it visually but keep it available to screen readers, or `hiddenAudible` to keep it visible but hidden from screen readers.
118
+ * - **Custom content**: The default slot accepts any content, and each `<p>` tag starts a new line.
119
+ *
120
+ * **Example**
121
+ * ```html
122
+ * <auro-alert type="success">Your changes are saved.</auro-alert>
123
+ * ```
124
+ *
125
+ * ## Attributes & Properties
126
+ *
127
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
128
+ *
129
+ * - `hidden`: Hides the alert both visually and from screen readers.
130
+ * - `hiddenAudible`: Hides the alert from screen readers while keeping it visible.
131
+ * - `hiddenVisually`: Hides the alert visually while keeping it available to screen readers.
132
+ * - `noIcon`: Removes the icon from the alert. Applies only when `type` is set, because an alert without a type has no icon.
133
+ * - `type`: Sets the alert's purpose, which controls its icon and border color: `error`, `warning`, `success`, or `information`. Without a value, the alert shows no icon and uses a default border color.
134
+ *
135
+ * ## Slots
136
+ *
137
+ * Areas where markup can be added to the component.
138
+ *
139
+ * - `(default)`: Provide text for the alert. If using multiple lines, separate each line with `<p>` tags.
140
+ *
141
+ * ## Methods
142
+ *
143
+ * Methods that can be called to access component functionality.
144
+ *
145
+ * - `register(name?: string = "auro-alert") => void`: Registers the element with the browser under a tag name.
146
+ *
147
+ * ## CSS Parts
148
+ *
149
+ * Custom selectors for styling elements within the component.
150
+ *
151
+ * - `alert`: The outer container that holds the icon and the message.
152
+ * - `alert-content`: The area next to the icon that holds the alert message.
153
+ */
154
+ "auro-alert": Partial<AuroAlertProps & BaseProps<AuroAlert> & BaseEvents>;
155
+ };
104
156
 
157
+ export type CustomElementsSolidJs = {
105
158
  /**
106
- * The `auro-alert` element is used to provide contextual feedback messages for typical user actions.
107
- *
108
- * ## Attributes & Properties
109
- *
110
- * Component attributes and properties that can be applied to the element or by using JavaScript.
111
- *
112
- * - `hidden`: If present, the component will be hidden both visually and from screen readers
113
- * - `hiddenAudible`: If present, the component will be hidden from screen readers, but seen visually
114
- * - `hiddenVisually`: If present, the component will be hidden visually, but still read by screen readers
115
- * - `iconTag`: undefined
116
- * - `noIcon`: Removes icon from alert UI when `type` attribute is set
117
- * - `role`: undefined
118
- * - `type`: Component will render visually based on which type value is set
119
- *
120
- * ## Slots
121
- *
122
- * Areas where markup can be added to the component.
123
- *
124
- * - `(default)`: Provide text for the alert. If using multiple lines, separate each line with `<p>` tags.
125
- *
126
- * ## Methods
127
- *
128
- * Methods that can be called to access component functionality.
129
- *
130
- * - `register(name?: string = "auro-alert") => void`: This will register this element with the browser.
131
- *
132
- * ## CSS Parts
133
- *
134
- * Custom selectors for styling elements within the component.
135
- *
136
- * - `alert`: Use for customizing the style of the alert container
137
- * - `alert-content`: Use for customizing the style of the alert content
138
- */
139
- "auro-alert": Partial<AuroAlertProps & BaseProps<AuroAlert> & BaseEvents>;
140
- }
159
+ * Shows an inline message that gives feedback about a user action, such as an error, success, warning, or information message.
160
+ *
161
+ * **Key capabilities**
162
+ * - **Alert types**: Set `type` to `error`, `information`, `success`, or `warning` to change the icon and border color.
163
+ * - **Optional icon**: Set `noIcon` to remove the icon.
164
+ * - **Hiding**: Set `hidden` to hide the alert from everyone, `hiddenVisually` to hide it visually but keep it available to screen readers, or `hiddenAudible` to keep it visible but hidden from screen readers.
165
+ * - **Custom content**: The default slot accepts any content, and each `<p>` tag starts a new line.
166
+ *
167
+ * **Example**
168
+ * ```html
169
+ * <auro-alert type="success">Your changes are saved.</auro-alert>
170
+ * ```
171
+ *
172
+ * ## Attributes & Properties
173
+ *
174
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
175
+ *
176
+ * - `hidden`: Hides the alert both visually and from screen readers.
177
+ * - `hiddenAudible`: Hides the alert from screen readers while keeping it visible.
178
+ * - `hiddenVisually`: Hides the alert visually while keeping it available to screen readers.
179
+ * - `noIcon`: Removes the icon from the alert. Applies only when `type` is set, because an alert without a type has no icon.
180
+ * - `type`: Sets the alert's purpose, which controls its icon and border color: `error`, `warning`, `success`, or `information`. Without a value, the alert shows no icon and uses a default border color.
181
+ *
182
+ * ## Slots
183
+ *
184
+ * Areas where markup can be added to the component.
185
+ *
186
+ * - `(default)`: Provide text for the alert. If using multiple lines, separate each line with `<p>` tags.
187
+ *
188
+ * ## Methods
189
+ *
190
+ * Methods that can be called to access component functionality.
191
+ *
192
+ * - `register(name?: string = "auro-alert") => void`: Registers the element with the browser under a tag name.
193
+ *
194
+ * ## CSS Parts
195
+ *
196
+ * Custom selectors for styling elements within the component.
197
+ *
198
+ * - `alert`: The outer container that holds the icon and the message.
199
+ * - `alert-content`: The area next to the icon that holds the alert message.
200
+ */
201
+ "auro-alert": Partial<
202
+ AuroAlertProps & AuroAlertSolidJsProps & BaseProps<AuroAlert> & BaseEvents
203
+ >;
204
+ };
141
205
 
142
- export type CustomCssProperties = {
206
+ export type CustomCssProperties = {};
143
207
 
208
+ declare module "react" {
209
+ namespace JSX {
210
+ interface IntrinsicElements extends CustomElements {}
211
+ }
144
212
  }
145
213
 
214
+ declare module "react/jsx-runtime" {
215
+ namespace JSX {
216
+ interface IntrinsicElements extends CustomElements {}
217
+ }
218
+ }
146
219
 
147
- declare module 'react' {
220
+ declare module "react/jsx-dev-runtime" {
148
221
  namespace JSX {
149
222
  interface IntrinsicElements extends CustomElements {}
150
223
  }
151
-
152
224
  }
153
225
 
154
- declare module 'preact' {
226
+ declare module "preact" {
155
227
  namespace JSX {
156
228
  interface IntrinsicElements extends CustomElements {}
157
229
  }
158
-
159
230
  }
160
231
 
161
- declare module '@builder.io/qwik' {
232
+ declare module "@builder.io/qwik" {
162
233
  namespace JSX {
163
234
  interface IntrinsicElements extends CustomElements {}
164
235
  }
165
-
166
236
  }
167
237
 
168
- declare module '@stencil/core' {
238
+ declare module "@stencil/core" {
169
239
  namespace JSX {
170
240
  interface IntrinsicElements extends CustomElements {}
171
241
  }
172
-
173
242
  }
174
243
 
175
- declare module 'hono/jsx' {
244
+ declare module "hono/jsx" {
176
245
  namespace JSX {
177
246
  interface IntrinsicElements extends CustomElements {}
178
247
  }
179
-
180
248
  }
181
249
 
182
- declare module 'react-native' {
250
+ declare module "react-native" {
183
251
  namespace JSX {
184
252
  interface IntrinsicElements extends CustomElements {}
185
253
  }
186
-
254
+ }
255
+
256
+ declare module "solid-js" {
257
+ namespace JSX {
258
+ interface IntrinsicElements extends CustomElementsSolidJs {}
259
+ }
187
260
  }
188
261
 
189
262
  declare global {
190
263
  namespace JSX {
191
264
  interface IntrinsicElements extends CustomElements {}
192
265
  }
193
-
194
266
  }
195
267
  declare global {
196
268
  namespace svelteHTML {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{A as AuroAlert}from"./auro-alert-C5hNY0oc.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";
1
+ export{A as AuroAlert}from"./auro-alert-BUDoiSly.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";
@@ -1 +1 @@
1
- import{A as i}from"./auro-alert-C5hNY0oc.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";i.register();
1
+ import{A as i}from"./auro-alert-BUDoiSly.js";import"lit/static-html.js";import"lit";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";i.register();
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "================================================================================"
9
9
  ],
10
10
  "name": "@aurodesignsystem-dev/auro-alert",
11
- "version": "0.0.0-pr122.0",
11
+ "version": "0.0.0-pr124.0",
12
12
  "description": "auro-alert HTML custom element",
13
13
  "repository": {
14
14
  "type": "git",
@@ -22,15 +22,15 @@
22
22
  "node": ">=20"
23
23
  },
24
24
  "dependencies": {
25
- "lit": "^3.3.2"
25
+ "lit": "^3.3.3"
26
26
  },
27
27
  "devDependencies": {
28
- "@aurodesignsystem/auro-cli": "^3.5.1",
29
- "@aurodesignsystem/auro-config": "^1.3.1",
30
- "@aurodesignsystem/auro-icon": "^9.1.1",
31
- "@aurodesignsystem/auro-library": "^5.5.4",
32
- "@aurodesignsystem/design-tokens": "^8.12.1",
33
- "@aurodesignsystem/webcorestylesheets": "^10.1.4",
28
+ "@aurodesignsystem/auro-cli": "^5.7.0",
29
+ "@aurodesignsystem/auro-config": "^1.3.2",
30
+ "@aurodesignsystem/auro-icon": "^9.2.1",
31
+ "@aurodesignsystem/auro-library": "^5.14.4",
32
+ "@aurodesignsystem/design-tokens": "^9.4.3",
33
+ "@aurodesignsystem/webcorestylesheets": "^12.0.1",
34
34
  "husky": "^9.1.7"
35
35
  },
36
36
  "browserslist": [