@aurodesignsystem/auro-skeleton 2.2.0-beta.1 → 3.0.0-beta.1
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.
- package/.husky/commit-msg +0 -3
- package/.husky/pre-commit +0 -3
- package/CHANGELOG.md +23 -0
- package/README.md +3 -12
- package/demo/api.md +3 -4
- package/demo/index.md +4 -2
- package/dist/auro-skeleton.d.ts +5 -0
- package/dist/auro-skeleton.d.ts.map +1 -1
- package/dist/auro-skeleton__bundled.js +93 -25
- package/index.js +2 -13
- package/package.json +31 -31
- package/src/auro-skeleton.js +15 -3
- package/src/color-css.js +2 -2
- package/src/style-css.js +1 -1
- package/src/tokens-css.js +2 -2
package/.husky/commit-msg
CHANGED
package/.husky/pre-commit
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Semantic Release Automated Changelog
|
|
2
2
|
|
|
3
|
+
# [3.0.0-beta.1](https://github.com/AlaskaAirlines/auro-skeleton/compare/v2.2.0-beta.1...v3.0.0-beta.1) (2024-09-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* resolve minor color theming issues ([894b6fd](https://github.com/AlaskaAirlines/auro-skeleton/commit/894b6fdb1291e3e1e71fc7cbe75b1aec6d07400d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add tag name as attribute when custom registered ([d8c3f71](https://github.com/AlaskaAirlines/auro-skeleton/commit/d8c3f7118403265723841a54b5f255f396f9af80))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Performance Improvements
|
|
17
|
+
|
|
18
|
+
* refactor custom component registration config ([147af17](https://github.com/AlaskaAirlines/auro-skeleton/commit/147af17a0872d461579250175f7f4a16b7c29b06))
|
|
19
|
+
* update dependencies ([438c6b1](https://github.com/AlaskaAirlines/auro-skeleton/commit/438c6b18befb197a11c493f7d9fadb24ef989ea7))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* trigger major release for color theme support #31
|
|
25
|
+
|
|
3
26
|
# [2.2.0-beta.1](https://github.com/AlaskaAirlines/auro-skeleton/compare/v2.1.5...v2.2.0-beta.1) (2024-07-09)
|
|
4
27
|
|
|
5
28
|
|
package/README.md
CHANGED
|
@@ -62,15 +62,6 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
62
62
|
|
|
63
63
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
64
64
|
|
|
65
|
-
### CSS Custom Property fallbacks
|
|
66
|
-
|
|
67
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/cssFallbacks.md) -->
|
|
68
|
-
[CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) are [not supported](https://auro.alaskaair.com/support/custom-properties) in older browsers. For this, fallback properties are pre-generated and included with the npm.
|
|
69
|
-
|
|
70
|
-
Any update to the Auro Design Tokens will be immediately reflected with browsers that support CSS custom properties, legacy browsers will require updated components with pre-generated fallback properties.
|
|
71
|
-
|
|
72
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
73
|
-
|
|
74
65
|
### Define dependency in project component
|
|
75
66
|
|
|
76
67
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentImportDescription.md) -->
|
|
@@ -109,9 +100,9 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
109
100
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/bundleUseModBrowsers.md) -->
|
|
110
101
|
|
|
111
102
|
```html
|
|
112
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.
|
|
113
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.
|
|
114
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-skeleton@
|
|
103
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@4.9.2/dist/tokens/CSSCustomProperties.css" />
|
|
104
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@5.1.2/dist/bundled/essentials.css" />
|
|
105
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-skeleton@3.0.0-beta.1/dist/auro-skeleton__bundled.js" type="module"></script>
|
|
115
106
|
```
|
|
116
107
|
|
|
117
108
|
<!-- AURO-GENERATED-CONTENT:END -->
|
package/demo/api.md
CHANGED
|
@@ -91,10 +91,9 @@ The component may be restyled using the following code sample and changing the v
|
|
|
91
91
|
@import './../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables';
|
|
92
92
|
|
|
93
93
|
:host {
|
|
94
|
-
--ds-auro-skeleton-
|
|
95
|
-
--ds-auro-skeleton-
|
|
96
|
-
--ds-auro-skeleton-
|
|
97
|
-
--ds-auro-skeleton-background-gradient-color-three: var(--ds-color-background-subtle-default, #{$ds-color-background-subtle-default});
|
|
94
|
+
--ds-auro-skeleton-container-color: var(--ds-color-container-subtle-default, #{$ds-color-container-subtle-default});
|
|
95
|
+
--ds-auro-skeleton-container-gradient-color-one: var(--ds-color-container-subtle-default, #{$ds-color-container-subtle-default});
|
|
96
|
+
--ds-auro-skeleton-container-gradient-color-two: var(--ds-color-container-tertiary-default, #{$ds-color-container-tertiary-default});
|
|
98
97
|
}
|
|
99
98
|
```
|
|
100
99
|
<!-- AURO-GENERATED-CONTENT:END -->
|
package/demo/index.md
CHANGED
|
@@ -129,8 +129,10 @@ There are two important parts of every Auro component. The <a href="https://deve
|
|
|
129
129
|
To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our `registerComponent(name)` method and pass in a unique name.
|
|
130
130
|
|
|
131
131
|
```js
|
|
132
|
-
import './
|
|
133
|
-
|
|
132
|
+
import { AuroSkeleton } from './src/auro-skeleton.js';
|
|
133
|
+
import * as RuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
134
|
+
|
|
135
|
+
RuntimeUtils.default.prototype.registerComponent('custom-skeleton', AuroSkeleton);
|
|
134
136
|
```
|
|
135
137
|
|
|
136
138
|
This will create a new custom element that you can use in your HTML that will function identically to the `<auro-skeleton>` element.
|
package/dist/auro-skeleton.d.ts
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
export class AuroSkeleton extends LitElement {
|
|
7
7
|
static get properties(): {};
|
|
8
8
|
static get styles(): import("lit").CSSResult[];
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private runtimeUtils;
|
|
13
|
+
firstUpdated(): void;
|
|
9
14
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
15
|
}
|
|
11
16
|
import { LitElement } from "lit";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auro-skeleton.d.ts","sourceRoot":"","sources":["../src/auro-skeleton.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auro-skeleton.d.ts","sourceRoot":"","sources":["../src/auro-skeleton.js"],"names":[],"mappings":"AAeA;;;;GAIG;AAGH;IAWE,4BAIC;IAED,+CAMC;IAnBC;;OAEG;IACH,qBAAiD;IAkBnD,qBAGC;IAMD,+CAIC;CACF;2BAvDgC,KAAK"}
|
|
@@ -3,32 +3,102 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const t
|
|
6
|
+
const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$1=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)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$1&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$1.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$1.set(s,t));}return t}toString(){return this.cssText}};const r$1=t=>new n$2("string"==typeof t?t:t+"",void 0,s),i$1=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===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)},S$1=(s,o)=>{if(e$1)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$1?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$1(e)})(t):t;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/const{is:i
|
|
12
|
+
*/const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h$2,getOwnPropertySymbols:o,getPrototypeOf:n$1}=Object,a=globalThis,c$1=a.trustedTypes,l=c$1?c$1.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l: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$2=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f$2};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class b 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=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d("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("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...h$2(t),...o(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 !1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,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(!0),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),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),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$2)(this[t],s))return;this.P(t,s,i);}!1===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;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)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[d("elementProperties")]=new Map,b[d("finalized")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push("2.0.4");
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
16
16
|
* Copyright 2017 Google LLC
|
|
17
17
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
19
|
+
const n=globalThis,c=n.trustedTypes,h$1=c?c.createPolicy("lit-html",{createHTML:t=>t}):void 0,f$1="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,m="?"+v,_=`<${m}>`,w=document,lt=()=>w.createComment(""),st=t=>null===t||"object"!=typeof t&&"function"!=typeof t,g=Array.isArray,$=t=>g(t)||"function"==typeof t?.[Symbol.iterator],x="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,k=/>/g,O=RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),S=/'/g,j=/"/g,M=/^(?:script|style|textarea|title)$/i,P=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),ke=P(1),R=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),V=new WeakMap,I=w.createTreeWalker(w,129);function N(t,i){if(!g(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==h$1?h$1.createHTML(i):i}const U=(t,i)=>{const s=t.length-1,e=[];let h,o=2===i?"<svg>":3===i?"<math>":"",n=T;for(let i=0;i<s;i++){const s=t[i];let r,l,c=-1,a=0;for(;a<s.length&&(n.lastIndex=a,l=n.exec(s),null!==l);)a=n.lastIndex,n===T?"!--"===l[1]?n=E:void 0!==l[1]?n=k:void 0!==l[2]?(M.test(l[2])&&(h=RegExp("</"+l[2],"g")),n=O):void 0!==l[3]&&(n=O):n===O?">"===l[0]?(n=h??T,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,r=l[1],n=void 0===l[3]?O:'"'===l[3]?j:S):n===j||n===S?n=O:n===E||n===k?n=T:(n=O,h=void 0);const u=n===O&&t[i+1].startsWith("/>")?" ":"";o+=n===T?s+_:c>=0?(e.push(r),s.slice(0,c)+f$1+s.slice(c)+v+u):s+v+(-2===c?i:u);}return [N(t,o+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class B{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let h=0,o=0;const n=t.length-1,r=this.parts,[l,a]=U(t,i);if(this.el=B.createElement(l,s),I.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(e=I.nextNode())&&r.length<n;){if(1===e.nodeType){if(e.hasAttributes())for(const t of e.getAttributeNames())if(t.endsWith(f$1)){const i=a[o++],s=e.getAttribute(t).split(v),n=/([.?@])?(.*)/.exec(i);r.push({type:1,index:h,name:n[2],strings:s,ctor:"."===n[1]?Y:"?"===n[1]?Z:"@"===n[1]?q:G}),e.removeAttribute(t);}else t.startsWith(v)&&(r.push({type:6,index:h}),e.removeAttribute(t));if(M.test(e.tagName)){const t=e.textContent.split(v),i=t.length-1;if(i>0){e.textContent=c?c.emptyScript:"";for(let s=0;s<i;s++)e.append(t[s],lt()),I.nextNode(),r.push({type:2,index:++h});e.append(t[i],lt());}}}else if(8===e.nodeType)if(e.data===m)r.push({type:2,index:h});else {let t=-1;for(;-1!==(t=e.data.indexOf(v,t+1));)r.push({type:7,index:h}),t+=v.length-1;}h++;}}static createElement(t,i){const s=w.createElement("template");return s.innerHTML=t,s}}function z(t,i,s=t,e){if(i===R)return i;let h=void 0!==e?s.o?.[e]:s.l;const o=st(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s.o??=[])[e]=h:s.l=h),void 0!==h&&(i=z(t,h._$AS(t,i.values),h,e)),i}class F{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??w).importNode(i,!0);I.currentNode=e;let h=I.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new et(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new K(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=I.nextNode(),o++);}return I.currentNode=w,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 et{get _$AU(){return this._$AM?._$AU??this.v}constructor(t,i,s,e){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this.v=e?.isConnected??!0;}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=z(this,t,i),st(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==R&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):$(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!==D&&st(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.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=B.createElement(N(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new F(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=V.get(t.strings);return void 0===i&&V.set(t.strings,i=new B(t)),i}k(t){g(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 et(this.O(lt()),this.O(lt()),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?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){void 0===this._$AM&&(this.v=t,this._$AP?.(t));}}class G{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=D,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=D;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=z(this,t,i,0),o=!st(t)||t!==this._$AH&&t!==R,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=z(this,e[s+n],i,n),r===R&&(r=this._$AH[n]),o||=!st(r)||r!==this._$AH[n],r===D?t=D:t!==D&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class Y extends G{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===D?void 0:t;}}class Z extends G{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==D);}}class q extends G{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=z(this,t,i,0)??D)===R)return;const s=this._$AH,e=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==D&&(s===D||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 K{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){z(this,t);}}const Re=n.litHtmlPolyfillSupport;Re?.(B,et),(n.litHtmlVersions??=[]).push("3.2.0");const Q=(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 et(i.insertBefore(lt(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/class
|
|
25
|
+
*/class h extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=Q(e,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1);}render(){return R}}h._$litElement$=!0,h["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:h});const f=globalThis.litElementPolyfillSupport;f?.({LitElement:h});(globalThis.litElementVersions??=[]).push("4.1.0");
|
|
26
26
|
|
|
27
|
-
var styleCss = i$
|
|
27
|
+
var styleCss = i$1`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;animation-duration:2s;animation-fill-mode:backwards;animation-iteration-count:infinite;animation-name:place-holder-shimmer;animation-timing-function:linear;background-repeat:no-repeat;background-size:1000px 100%}:host([shape=circle]){width:auto;border-radius:50%}:host([shape=oval]){border-radius:9999px}:host([shape=rectangle]){border-radius:var(--ds-border-radius, 0.375rem)}@keyframes place-holder-shimmer{from{background-position:-1000px 0}to{background-position:1000px 0}}`;
|
|
28
28
|
|
|
29
|
-
var colorCss = i$
|
|
29
|
+
var colorCss = i$1`:host{background-color:var(--ds-auro-skeleton-container-color);background-image:linear-gradient(to right, var(--ds-auro-skeleton-container-gradient-color-one) 10%, var(--ds-auro-skeleton-container-gradient-color-two) 40%, var(--ds-auro-skeleton-container-gradient-color-one) 60%)}`;
|
|
30
30
|
|
|
31
|
-
var tokensCss = i$
|
|
31
|
+
var tokensCss = i$1`:host{--ds-auro-skeleton-container-color: var(--ds-color-container-subtle-default, #f7f8fa);--ds-auro-skeleton-container-gradient-color-one: var(--ds-color-container-subtle-default, #f7f8fa);--ds-auro-skeleton-container-gradient-color-two: var(--ds-color-container-tertiary-default, rgba(0, 0, 0, 0.03))}`;
|
|
32
|
+
|
|
33
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
34
|
+
// See LICENSE in the project root for license information.
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
39
|
+
|
|
40
|
+
class AuroLibraryRuntimeUtils {
|
|
41
|
+
|
|
42
|
+
/* eslint-disable jsdoc/require-param */
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This will register a new custom element with the browser.
|
|
46
|
+
* @param {String} name - The name of the custom element.
|
|
47
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
registerComponent(name, componentClass) {
|
|
51
|
+
if (!customElements.get(name)) {
|
|
52
|
+
customElements.define(name, class extends componentClass {});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
closestElement(
|
|
61
|
+
selector, // selector like in .closest()
|
|
62
|
+
base = this, // extra functionality to skip a parent
|
|
63
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
64
|
+
!el || el === document || el === window
|
|
65
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
66
|
+
: found
|
|
67
|
+
? found // found a selector INside this element
|
|
68
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
69
|
+
) {
|
|
70
|
+
return __Closest(base);
|
|
71
|
+
}
|
|
72
|
+
/* eslint-enable jsdoc/require-param */
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 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.
|
|
76
|
+
* @param {Object} elem - The element to check.
|
|
77
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
78
|
+
* @returns {void}
|
|
79
|
+
*/
|
|
80
|
+
handleComponentTagRename(elem, tagName) {
|
|
81
|
+
const tag = tagName.toLowerCase();
|
|
82
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
83
|
+
|
|
84
|
+
if (elemTag !== tag) {
|
|
85
|
+
elem.setAttribute(tag, true);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Validates if an element is a specific Auro component.
|
|
91
|
+
* @param {Object} elem - The element to validate.
|
|
92
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
93
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
94
|
+
*/
|
|
95
|
+
elementMatch(elem, tagName) {
|
|
96
|
+
const tag = tagName.toLowerCase();
|
|
97
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
98
|
+
|
|
99
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
32
102
|
|
|
33
103
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
34
104
|
// See LICENSE in the project root for license information.
|
|
@@ -42,10 +112,15 @@ var tokensCss = i$2`:host{--ds-auro-skeleton-background-color:var(--ds-color-bac
|
|
|
42
112
|
*/
|
|
43
113
|
|
|
44
114
|
// build the component class
|
|
45
|
-
class AuroSkeleton extends
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
115
|
+
class AuroSkeleton extends h {
|
|
116
|
+
constructor() {
|
|
117
|
+
super();
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @private
|
|
121
|
+
*/
|
|
122
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
123
|
+
}
|
|
49
124
|
|
|
50
125
|
// function to define props used within the scope of this component
|
|
51
126
|
static get properties() {
|
|
@@ -62,12 +137,17 @@ class AuroSkeleton extends s {
|
|
|
62
137
|
];
|
|
63
138
|
}
|
|
64
139
|
|
|
140
|
+
firstUpdated() {
|
|
141
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
142
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-skeleton');
|
|
143
|
+
}
|
|
144
|
+
|
|
65
145
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
66
146
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
67
147
|
|
|
68
148
|
// function that renders the HTML and CSS into the scope of the component
|
|
69
149
|
render() {
|
|
70
|
-
return
|
|
150
|
+
return ke`
|
|
71
151
|
<span class="util_displayHiddenVisually">Loading...</span>
|
|
72
152
|
`;
|
|
73
153
|
}
|
|
@@ -79,16 +159,4 @@ if (!customElements.get("auro-skeleton")) {
|
|
|
79
159
|
customElements.define("auro-skeleton", AuroSkeleton);
|
|
80
160
|
}
|
|
81
161
|
|
|
82
|
-
|
|
83
|
-
* Register Custom Element.
|
|
84
|
-
* @param {Object} name - Name to use for custom element.
|
|
85
|
-
* @returns {void}
|
|
86
|
-
*/
|
|
87
|
-
const registerComponent = (name = 'custom-skeleton') => {
|
|
88
|
-
// alias definition
|
|
89
|
-
if (!customElements.get(name)) {
|
|
90
|
-
customElements.define(name, class extends AuroSkeleton {});
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export { registerComponent };
|
|
162
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent('custom-skeleton', AuroSkeleton);
|
package/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import { AuroSkeleton } from './src/auro-skeleton.js';
|
|
2
|
+
import * as RuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
* Register Custom Element.
|
|
5
|
-
* @param {Object} name - Name to use for custom element.
|
|
6
|
-
* @returns {void}
|
|
7
|
-
*/
|
|
8
|
-
const registerComponent = (name = 'custom-skeleton') => {
|
|
9
|
-
// alias definition
|
|
10
|
-
if (!customElements.get(name)) {
|
|
11
|
-
customElements.define(name, class extends AuroSkeleton {});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { registerComponent }
|
|
4
|
+
RuntimeUtils.default.prototype.registerComponent('custom-skeleton', AuroSkeleton);
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem/auro-skeleton",
|
|
10
|
-
"version": "
|
|
10
|
+
"version": "3.0.0-beta.1",
|
|
11
11
|
"description": "auro-skeleton HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -21,53 +21,53 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"chalk": "^5.3.0",
|
|
24
|
-
"lit": "^3.
|
|
24
|
+
"lit": "^3.2.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@aurodesignsystem/design-tokens": "^4.
|
|
28
|
-
"@aurodesignsystem/webcorestylesheets": "^5.
|
|
27
|
+
"@aurodesignsystem/design-tokens": "^4.9.2",
|
|
28
|
+
"@aurodesignsystem/webcorestylesheets": "^5.1.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@aurodesignsystem/auro-library": "^2.
|
|
32
|
-
"@aurodesignsystem/design-tokens": "^4.
|
|
33
|
-
"@aurodesignsystem/eslint-config": "^1.3.
|
|
34
|
-
"@aurodesignsystem/webcorestylesheets": "^5.1.
|
|
35
|
-
"@commitlint/cli": "^19.
|
|
36
|
-
"@commitlint/config-conventional": "^19.
|
|
31
|
+
"@aurodesignsystem/auro-library": "^2.8.0",
|
|
32
|
+
"@aurodesignsystem/design-tokens": "^4.9.2",
|
|
33
|
+
"@aurodesignsystem/eslint-config": "^1.3.2",
|
|
34
|
+
"@aurodesignsystem/webcorestylesheets": "^5.1.2",
|
|
35
|
+
"@commitlint/cli": "^19.5.0",
|
|
36
|
+
"@commitlint/config-conventional": "^19.5.0",
|
|
37
37
|
"@open-wc/testing": "^4.0.0",
|
|
38
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
38
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
39
39
|
"@semantic-release/changelog": "^6.0.3",
|
|
40
40
|
"@semantic-release/git": "^10.0.1",
|
|
41
41
|
"@semantic-release/npm": "^12.0.1",
|
|
42
42
|
"@web/dev-server": "^0.4.5",
|
|
43
|
-
"@web/test-runner": "^0.
|
|
44
|
-
"autoprefixer": "^10.4.
|
|
43
|
+
"@web/test-runner": "^0.19.0",
|
|
44
|
+
"autoprefixer": "^10.4.20",
|
|
45
45
|
"compression": "^1.7.4",
|
|
46
46
|
"concat": "^1.0.3",
|
|
47
|
-
"concurrently": "^
|
|
47
|
+
"concurrently": "^9.0.1",
|
|
48
48
|
"copyfiles": "^2.4.1",
|
|
49
|
-
"core-js": "^3.
|
|
50
|
-
"eslint": "^
|
|
51
|
-
"eslint-plugin-jsdoc": "^
|
|
52
|
-
"husky": "^9.
|
|
49
|
+
"core-js": "^3.38.1",
|
|
50
|
+
"eslint": "^9.11.1",
|
|
51
|
+
"eslint-plugin-jsdoc": "^50.3.0",
|
|
52
|
+
"husky": "^9.1.6",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"markdown-magic": "^2.6.1",
|
|
55
|
-
"nodemon": "^3.1.
|
|
55
|
+
"nodemon": "^3.1.7",
|
|
56
56
|
"npm-run-all": "^4.1.5",
|
|
57
|
-
"postcss": "^8.4.
|
|
58
|
-
"postcss-discard-comments": "^7.0.
|
|
57
|
+
"postcss": "^8.4.47",
|
|
58
|
+
"postcss-discard-comments": "^7.0.3",
|
|
59
59
|
"postcss-selector-replace": "^1.0.2",
|
|
60
|
-
"rollup": "^4.
|
|
60
|
+
"rollup": "^4.22.5",
|
|
61
61
|
"rollup-plugin-serve": "^1.1.1",
|
|
62
|
-
"sass": "^1.
|
|
63
|
-
"semantic-release": "^24.
|
|
64
|
-
"stylelint": "^16.
|
|
62
|
+
"sass": "^1.79.3",
|
|
63
|
+
"semantic-release": "^24.1.2",
|
|
64
|
+
"stylelint": "^16.9.0",
|
|
65
65
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
|
66
66
|
"stylelint-config-standard": "^36.0.0",
|
|
67
67
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
68
68
|
"stylelint-order": "^6.0.4",
|
|
69
|
-
"stylelint-scss": "^6.
|
|
70
|
-
"typescript": "^5.
|
|
69
|
+
"stylelint-scss": "^6.7.0",
|
|
70
|
+
"typescript": "^5.6.2",
|
|
71
71
|
"wc-sass-render": "^1.4.0",
|
|
72
72
|
"web-component-analyzer": "^2.0.0",
|
|
73
73
|
"whatwg-fetch": "^3.6.20",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"build:ci": "npm-run-all sweep build:release",
|
|
145
145
|
"build:api": "wca analyze 'src/auro-skeleton.js' --outFiles docs/api.md",
|
|
146
146
|
"build:dev:assets": "npm-run-all build:sass:component postCss:component sass:render build:docs",
|
|
147
|
-
"build:docs": "node scripts/generateDocs.mjs",
|
|
147
|
+
"build:docs": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/generateDocs.mjs",
|
|
148
148
|
"build:sass": "npm-run-all build:sass:component postCss:component sass:render",
|
|
149
149
|
"build:sass:component": "sass --no-source-map src:src",
|
|
150
150
|
"build:watch": "nodemon -e scss,js,html --watch src --watch apiExamples/**/* --exec npm run build:dev:assets",
|
|
@@ -155,10 +155,10 @@
|
|
|
155
155
|
"dist:js": "copyfiles -u 1 -V './src/**/*.js' ./dist",
|
|
156
156
|
"esLint": "./node_modules/.bin/eslint src/**/*.js",
|
|
157
157
|
"linters": "npm-run-all scssLint esLint",
|
|
158
|
-
"preCommit": "node scripts/pre-commit.mjs",
|
|
159
|
-
"postCss:component": "node scripts/postCss.mjs",
|
|
158
|
+
"preCommit": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/pre-commit.mjs",
|
|
159
|
+
"postCss:component": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/postCss.mjs",
|
|
160
160
|
"postinstall": "node packageScripts/postinstall.mjs",
|
|
161
|
-
"sass:render": "sass-render src/*.css -t ./scripts/staticStyles-template.js",
|
|
161
|
+
"sass:render": "sass-render src/*.css -t ./node_modules/@aurodesignsystem/auro-library/scripts/build/staticStyles-template.js",
|
|
162
162
|
"serve": "web-dev-server --open demo/ --node-resolve --watch",
|
|
163
163
|
"sweep": "rm -rf ./demo/css ./dist | rm ./src/*.css ./src/*-css.js",
|
|
164
164
|
"test": "wtr --coverage",
|
package/src/auro-skeleton.js
CHANGED
|
@@ -10,6 +10,8 @@ import styleCss from "./style-css.js";
|
|
|
10
10
|
import colorCss from "./color-css.js";
|
|
11
11
|
import tokensCss from "./tokens-css.js";
|
|
12
12
|
|
|
13
|
+
import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
14
|
+
|
|
13
15
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
14
16
|
/**
|
|
15
17
|
* The auro-skeleton element provides users a way to indicate the loading of asynchronous content on a page.
|
|
@@ -19,9 +21,14 @@ import tokensCss from "./tokens-css.js";
|
|
|
19
21
|
|
|
20
22
|
// build the component class
|
|
21
23
|
export class AuroSkeleton extends LitElement {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
// function to define props used within the scope of this component
|
|
27
34
|
static get properties() {
|
|
@@ -38,6 +45,11 @@ export class AuroSkeleton extends LitElement {
|
|
|
38
45
|
];
|
|
39
46
|
}
|
|
40
47
|
|
|
48
|
+
firstUpdated() {
|
|
49
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
50
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-skeleton');
|
|
51
|
+
}
|
|
52
|
+
|
|
41
53
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
42
54
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
43
55
|
|
package/src/color-css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {css} from 'lit';
|
|
2
|
-
export default css`:host{background-color:var(--ds-auro-skeleton-
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css`:host{background-color:var(--ds-auro-skeleton-container-color);background-image:linear-gradient(to right, var(--ds-auro-skeleton-container-gradient-color-one) 10%, var(--ds-auro-skeleton-container-gradient-color-two) 40%, var(--ds-auro-skeleton-container-gradient-color-one) 60%)}`;
|
package/src/style-css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {css} from 'lit';
|
|
1
|
+
import { css } from 'lit';
|
|
2
2
|
export default css`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;animation-duration:2s;animation-fill-mode:backwards;animation-iteration-count:infinite;animation-name:place-holder-shimmer;animation-timing-function:linear;background-repeat:no-repeat;background-size:1000px 100%}:host([shape=circle]){width:auto;border-radius:50%}:host([shape=oval]){border-radius:9999px}:host([shape=rectangle]){border-radius:var(--ds-border-radius, 0.375rem)}@keyframes place-holder-shimmer{from{background-position:-1000px 0}to{background-position:1000px 0}}`;
|
package/src/tokens-css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {css} from 'lit';
|
|
2
|
-
export default css`:host{--ds-auro-skeleton-
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css`:host{--ds-auro-skeleton-container-color: var(--ds-color-container-subtle-default, #f7f8fa);--ds-auro-skeleton-container-gradient-color-one: var(--ds-color-container-subtle-default, #f7f8fa);--ds-auro-skeleton-container-gradient-color-two: var(--ds-color-container-tertiary-default, rgba(0, 0, 0, 0.03))}`;
|