@zag-js/live-region
Advanced tools
Comparing version 0.1.4 to 0.2.0
@@ -47,9 +47,10 @@ "use strict"; | ||
function createLiveRegion(opts = {}) { | ||
var _a; | ||
const { level = "polite", document: doc = document, root, delay: _delay = 0 } = opts; | ||
const win = doc.defaultView ?? window; | ||
const parent = root ?? doc.body; | ||
const win = (_a = doc.defaultView) != null ? _a : window; | ||
const parent = root != null ? root : doc.body; | ||
function announce(message, delay) { | ||
const oldRegion = doc.getElementById(ID); | ||
oldRegion == null ? void 0 : oldRegion.remove(); | ||
delay = delay ?? _delay; | ||
delay = delay != null ? delay : _delay; | ||
const region = doc.createElement("span"); | ||
@@ -56,0 +57,0 @@ region.id = ID; |
{ | ||
"name": "@zag-js/live-region", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Implementing live region for screen readers", | ||
@@ -22,3 +22,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.1.13" | ||
"@zag-js/dom-utils": "0.2.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6965
146