@aurodesignsystem-dev/auro-toast 0.0.0-pr121.18 → 0.0.0-pr121.19
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/demo/basic.min.js
CHANGED
|
@@ -802,6 +802,13 @@ class AuroToaster extends i$2 {
|
|
|
802
802
|
this._observer?.disconnect();
|
|
803
803
|
clearTimeout(this._assertiveResetTimer);
|
|
804
804
|
this.removeEventListener('toast-request-announce', this._onToastRequestAnnounce);
|
|
805
|
+
|
|
806
|
+
// Reset the live region to polite so a reconnected toaster does not
|
|
807
|
+
// inherit a stale assertive state left behind by a cleared timer.
|
|
808
|
+
const liveRegion = this.shadowRoot?.querySelector('[aria-live]');
|
|
809
|
+
if (liveRegion) {
|
|
810
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
811
|
+
}
|
|
805
812
|
}
|
|
806
813
|
|
|
807
814
|
/**
|
|
@@ -103,7 +103,7 @@ import{css as e,LitElement as t,html as s}from"lit";import{unsafeStatic as a,lit
|
|
|
103
103
|
</div>
|
|
104
104
|
`:void 0}
|
|
105
105
|
`}}var Z=e`.toaster-wrapper{position:fixed;z-index:var(--ds-depth-modal, 300);right:2%;bottom:2%;left:2%;display:flex;flex-direction:column-reverse;align-items:flex-end;gap:var(--ds-size-200, 1rem);pointer-events:none}@media (width >= 1024px){.toaster-wrapper{right:1%;left:unset;width:100%}}
|
|
106
|
-
`;class ee extends t{static get styles(){return[Z]}constructor(){super(),this._assertiveResetTimer=void 0,this._announcedErrorToasts=new WeakSet,this._onToastRequestAnnounce=e=>e.preventDefault()}static register(e="auro-toaster"){c.prototype.registerComponent(e,ee)}connectedCallback(){super.connectedCallback(),this.addEventListener("toast-request-announce",this._onToastRequestAnnounce),this._observer=new MutationObserver(e=>{for(const t of e){const e=t.target;if(!/^auro-toast(_|$)/u.test(e.localName??""))continue;const s="error"===e.getAttribute?.("variant"),a=e.hasAttribute?.("visible");s&&a&&this._setAssertiveTemporarily()}}),this._observer.observe(this,{subtree:!0,attributeFilter:["visible"]})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect(),clearTimeout(this._assertiveResetTimer),this.removeEventListener("toast-request-announce",this._onToastRequestAnnounce)}_setAssertiveTemporarily(){const e=this.shadowRoot?.querySelector("[aria-live]");e&&(clearTimeout(this._assertiveResetTimer),e.setAttribute("aria-live","assertive"),this._assertiveResetTimer=setTimeout(()=>{e.setAttribute("aria-live","polite")},3e3))}render(){return s`
|
|
106
|
+
`;class ee extends t{static get styles(){return[Z]}constructor(){super(),this._assertiveResetTimer=void 0,this._announcedErrorToasts=new WeakSet,this._onToastRequestAnnounce=e=>e.preventDefault()}static register(e="auro-toaster"){c.prototype.registerComponent(e,ee)}connectedCallback(){super.connectedCallback(),this.addEventListener("toast-request-announce",this._onToastRequestAnnounce),this._observer=new MutationObserver(e=>{for(const t of e){const e=t.target;if(!/^auro-toast(_|$)/u.test(e.localName??""))continue;const s="error"===e.getAttribute?.("variant"),a=e.hasAttribute?.("visible");s&&a&&this._setAssertiveTemporarily()}}),this._observer.observe(this,{subtree:!0,attributeFilter:["visible"]})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect(),clearTimeout(this._assertiveResetTimer),this.removeEventListener("toast-request-announce",this._onToastRequestAnnounce);const e=this.shadowRoot?.querySelector("[aria-live]");e&&e.setAttribute("aria-live","polite")}_setAssertiveTemporarily(){const e=this.shadowRoot?.querySelector("[aria-live]");e&&(clearTimeout(this._assertiveResetTimer),e.setAttribute("aria-live","assertive"),this._assertiveResetTimer=setTimeout(()=>{e.setAttribute("aria-live","polite")},3e3))}render(){return s`
|
|
107
107
|
<div class="toaster-wrapper" aria-live="polite" aria-atomic="false">
|
|
108
108
|
<slot @slotchange="${this._onSlotChange}"></slot>
|
|
109
109
|
</div>
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AuroToast,a as AuroToaster}from"./auro-toaster-
|
|
1
|
+
export{A as AuroToast,a as AuroToaster}from"./auro-toaster-jZvkUugt.js";import"lit";import"lit/static-html.js";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";
|
package/dist/registered.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as i,a as t}from"./auro-toaster-
|
|
1
|
+
import{A as i,a as t}from"./auro-toaster-jZvkUugt.js";import"lit";import"lit/static-html.js";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";i.register(),t.register();
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem-dev/auro-toast",
|
|
10
|
-
"version": "0.0.0-pr121.
|
|
10
|
+
"version": "0.0.0-pr121.19",
|
|
11
11
|
"description": "auro-toast HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"@aurodesignsystem/auro-library": "^5.5.4",
|
|
33
33
|
"@aurodesignsystem/design-tokens": "^8.7.0",
|
|
34
34
|
"@aurodesignsystem/webcorestylesheets": "^10.1.4",
|
|
35
|
-
"husky": "^9.1.7"
|
|
35
|
+
"husky": "^9.1.7",
|
|
36
|
+
"sinon": "^21.1.2"
|
|
36
37
|
},
|
|
37
38
|
"browserslist": [
|
|
38
39
|
"last 2 Chrome versions",
|