@zag-js/live-region
Advanced tools
Comparing version 0.0.0-dev-20220714012600 to 0.0.0-dev-20220714091855
@@ -1,2 +0,2 @@ | ||
export declare type LiveRegionOptions = { | ||
declare type LiveRegionOptions = { | ||
level: "polite" | "assertive"; | ||
@@ -7,4 +7,4 @@ document?: Document; | ||
}; | ||
export declare type LiveRegion = ReturnType<typeof createLiveRegion>; | ||
export declare function createLiveRegion(opts?: Partial<LiveRegionOptions>): { | ||
declare type LiveRegion = ReturnType<typeof createLiveRegion>; | ||
declare function createLiveRegion(opts?: Partial<LiveRegionOptions>): { | ||
announce: (message: string, delay?: number) => void; | ||
@@ -14,1 +14,3 @@ destroy: () => void; | ||
}; | ||
export { LiveRegion, LiveRegionOptions, createLiveRegion }; |
@@ -27,3 +27,3 @@ "use strict"; | ||
// ../dom/src/visually-hidden.ts | ||
// ../dom/dist/index.mjs | ||
var visuallyHiddenStyle = { | ||
@@ -48,10 +48,9 @@ border: "0", | ||
function createLiveRegion(opts = {}) { | ||
var _a; | ||
const { level = "polite", document: doc = document, root, delay: _delay = 0 } = opts; | ||
const win = (_a = doc.defaultView) != null ? _a : window; | ||
const parent = root != null ? root : doc.body; | ||
const win = doc.defaultView ?? window; | ||
const parent = root ?? doc.body; | ||
function announce(message, delay) { | ||
const oldRegion = doc.getElementById(ID); | ||
oldRegion == null ? void 0 : oldRegion.remove(); | ||
delay = delay != null ? delay : _delay; | ||
delay = delay ?? _delay; | ||
const region = doc.createElement("span"); | ||
@@ -81,1 +80,5 @@ region.id = ID; | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
createLiveRegion | ||
}); |
{ | ||
"name": "@zag-js/live-region", | ||
"version": "0.0.0-dev-20220714012600", | ||
"version": "0.0.0-dev-20220714091855", | ||
"description": "Implementing live region for screen readers", | ||
@@ -21,10 +21,4 @@ "keywords": [ | ||
], | ||
"scripts": { | ||
"build:fast": "yarn zag build", | ||
"start": "yarn zag build --watch", | ||
"build": "yarn zag build --prod", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
"lint": "eslint src --ext .ts,.tsx", | ||
"test:ci": "yarn test --ci --runInBand --updateSnapshot", | ||
"test:watch": "yarn test --watchAll" | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.0.0-dev-20220714091855" | ||
}, | ||
@@ -36,3 +30,12 @@ "publishConfig": { | ||
"url": "https://github.com/chakra-ui/zag/issues" | ||
}, | ||
"scripts": { | ||
"build-fast": "tsup src/index.ts --format=esm,cjs", | ||
"start": "pnpm build --watch", | ||
"build": "tsup src/index.ts --format=esm,cjs --dts", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
"lint": "eslint src --ext .ts,.tsx", | ||
"test-ci": "pnpm test --ci --runInBand -u", | ||
"test-watch": "pnpm test --watchAll" | ||
} | ||
} | ||
} |
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
6887
6
144
1