Skip to content

Commit

Permalink
perf: update library to 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-mota committed Nov 15, 2024
1 parent 59f811d commit f68a9c7
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 9 deletions.
78 changes: 74 additions & 4 deletions demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShad

/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */

class AuroLibraryRuntimeUtils {
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {

/* eslint-disable jsdoc/require-param */

Expand Down Expand Up @@ -146,7 +146,7 @@ class AuroLibraryRuntimeUtils {

return elemTag === tag || elem.hasAttribute(tag);
}
}
};

var externalLink = {"role":"img","color":"currentColor","title":"Link to external site.","desc":"This indicates a link to an external site that may not follow the same accessibility or privacy policies as Alaska Airlines. By selecting a partner link you agree to share your data with these sites.","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":"external-link-stroke","category":"interface","svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"external-link-stroke__title external-link-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 id=\"external-link-stroke__title\">Link to external site.</title><desc id=\"external-link-stroke__desc\">This indicates a link to an external site that may not follow the same accessibility or privacy policies as Alaska Airlines. By selecting a partner link you agree to share your data with these sites.</desc><path d=\"M7 6.25h5a.75.75 0 0 1 .102 1.494L12 7.75H7a1.25 1.25 0 0 0-1.244 1.123L5.75 9v8c0 .648.492 1.18 1.122 1.244L7 18.25h8a1.25 1.25 0 0 0 1.244-1.122L16.25 17v-5a.75.75 0 0 1 1.493-.101l.007.101v5a2.75 2.75 0 0 1-2.582 2.745L15 19.75H7a2.75 2.75 0 0 1-2.745-2.582L4.25 17V9a2.75 2.75 0 0 1 2.582-2.745zh5zm12.025-2 .125.015.11.032.128.061c.18.108.317.29.353.522l.009.12v5a.75.75 0 0 1-1.493.102L18.25 10V6.811l-6.72 6.72a.75.75 0 0 1-1.133-.977l.073-.084 6.718-6.72H14a.75.75 0 0 1-.743-.648L13.25 5a.75.75 0 0 1 .648-.743L14 4.25z\"/></svg>"};

Expand Down Expand Up @@ -186,7 +186,7 @@ class ComponentBase extends h {
/**
* @private
*/
this.runtimeUtils = new AuroLibraryRuntimeUtils();
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();

/*
If the component requires a touch detection,
Expand Down Expand Up @@ -695,6 +695,76 @@ var tokensCss$1 = i$1`:host{--ds-auro-icon-color: var(--ds-color-icon-primary-de

var colorCss$1 = i$1`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[accent]){--ds-auro-icon-color: var(--ds-color-icon-accent-default, #a2c270)}:host(:not([onDark])[disabled]){--ds-auro-icon-color: var(--ds-color-icon-ui-primary-disabled-default, #adadad)}:host(:not([onDark])[emphasis]){--ds-auro-icon-color: var(--ds-color-icon-emphasis-default, #2a2a2a)}:host(:not([onDark])[error]){--ds-auro-icon-color: var(--ds-color-icon-error-default, #cc1816)}:host(:not([onDark])[info]){--ds-auro-icon-color: var(--ds-color-icon-info-default, #326aa5)}:host(:not([onDark])[secondary]){--ds-auro-icon-color: var(--ds-color-icon-secondary-default, #7e8894)}:host(:not([onDark])[subtle]){--ds-auro-icon-color: var(--ds-color-icon-subtle-default, #a0c9f1)}:host(:not([onDark])[success]){--ds-auro-icon-color: var(--ds-color-icon-success-default, #40a080)}:host(:not([onDark])[tertiary]){--ds-auro-icon-color: var(--ds-color-icon-tertiary-default, #afb9c6)}:host(:not([onDark])[warning]){--ds-auro-icon-color: var(--ds-color-icon-warning-default, #c49432)}:host([onDark]){--ds-auro-icon-color: var(--ds-color-icon-primary-inverse, #f7f7f7)}:host([onDark][accent]){--ds-auro-icon-color: var(--ds-color-icon-accent-inverse, #badd81)}:host([onDark][disabled]){--ds-auro-icon-color: var(--ds-color-icon-ui-primary-disabled-inverse, #7e7e7e)}:host([onDark][emphasis]){--ds-auro-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}:host([onDark][error]){--ds-auro-icon-color: var(--ds-color-icon-error-inverse, #f9aca6)}:host([onDark][info]){--ds-auro-icon-color: var(--ds-color-icon-info-inverse, #89b2d4)}:host([onDark][secondary]){--ds-auro-icon-color: var(--ds-color-icon-secondary-inverse, #ccd2db)}:host([onDark][subtle]){--ds-auro-icon-color: var(--ds-color-icon-subtle-inverse, #326aa5)}:host([onDark][success]){--ds-auro-icon-color: var(--ds-color-icon-success-inverse, #8eceb9)}:host([onDark][tertiary]){--ds-auro-icon-color: var(--ds-color-icon-tertiary-inverse, #939fad)}:host([onDark][warning]){--ds-auro-icon-color: var(--ds-color-icon-warning-inverse, #f2c153)}`;

// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
// See LICENSE in the project root for license information.

// ---------------------------------------------------------------------

/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */

class AuroLibraryRuntimeUtils {

/* eslint-disable jsdoc/require-param */

/**
* This will register a new custom element with the browser.
* @param {String} name - The name of the custom element.
* @param {Object} componentClass - The class to register as a custom element.
* @returns {void}
*/
registerComponent(name, componentClass) {
if (!customElements.get(name)) {
customElements.define(name, class extends componentClass {});
}
}

/**
* Finds and returns the closest HTML Element based on a selector.
* @returns {void}
*/
closestElement(
selector, // selector like in .closest()
base = this, // extra functionality to skip a parent
__Closest = (el, found = el && el.closest(selector)) =>
!el || el === document || el === window
? null // standard .closest() returns null for non-found selectors also
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
) {
return __Closest(base);
}
/* eslint-enable jsdoc/require-param */

/**
* 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.
* @param {Object} elem - The element to check.
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
* @returns {void}
*/
handleComponentTagRename(elem, tagName) {
const tag = tagName.toLowerCase();
const elemTag = elem.tagName.toLowerCase();

if (elemTag !== tag) {
elem.setAttribute(tag, true);
}
}

/**
* Validates if an element is a specific Auro component.
* @param {Object} elem - The element to validate.
* @param {String} tagName - The name of the Auro component to check against.
* @returns {Boolean} - Returns true if the element is the specified Auro component.
*/
elementMatch(elem, tagName) {
const tag = tagName.toLowerCase();
const elemTag = elem.tagName.toLowerCase();

return elemTag === tag || elem.hasAttribute(tag);
}
}

// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
// See LICENSE in the project root for license information.

Expand Down Expand Up @@ -965,7 +1035,7 @@ class AuroHyperlink extends ComponentBase {
*
*/
static register(name = "auro-hyperlink") {
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHyperlink);
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroHyperlink);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@aurodesignsystem/auro-icon": "^6.0.2",
"@aurodesignsystem/auro-library": "^3.0.1",
"@aurodesignsystem/auro-library": "^3.0.2",
"chalk": "^5.3.0",
"lit": "^3.2.1"
},
Expand Down

0 comments on commit f68a9c7

Please sign in to comment.