@zag-js/live-region 0.10.2 → 0.10.3

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/dist/index.d.ts CHANGED
@@ -1,14 +1,12 @@
1
- type LiveRegionOptions = {
1
+ export type LiveRegionOptions = {
2
2
  level: "polite" | "assertive";
3
3
  document?: Document;
4
4
  root?: HTMLElement | null;
5
5
  delay?: number;
6
6
  };
7
- type LiveRegion = ReturnType<typeof createLiveRegion>;
8
- declare function createLiveRegion(opts?: Partial<LiveRegionOptions>): {
7
+ export type LiveRegion = ReturnType<typeof createLiveRegion>;
8
+ export declare function createLiveRegion(opts?: Partial<LiveRegionOptions>): {
9
9
  announce: (message: string, delay?: number) => void;
10
10
  destroy: () => void;
11
11
  toJSON(): string;
12
12
  };
13
-
14
- export { LiveRegion, LiveRegionOptions, createLiveRegion };
package/dist/index.js CHANGED
@@ -1,30 +1,10 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19
4
 
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- createLiveRegion: () => createLiveRegion
24
- });
25
- module.exports = __toCommonJS(src_exports);
26
- var import_visually_hidden = require("@zag-js/visually-hidden");
27
- var ID = "__live-region__";
5
+ const visuallyHidden = require('@zag-js/visually-hidden');
6
+
7
+ const ID = "__live-region__";
28
8
  function createLiveRegion(opts = {}) {
29
9
  const { level = "polite", document: doc = document, root, delay: _delay = 0 } = opts;
30
10
  const win = doc.defaultView ?? window;
@@ -39,7 +19,7 @@ function createLiveRegion(opts = {}) {
39
19
  const role = level !== "assertive" ? "status" : "alert";
40
20
  region.setAttribute("aria-live", level);
41
21
  region.setAttribute("role", role);
42
- (0, import_visually_hidden.setVisuallyHidden)(region);
22
+ visuallyHidden.setVisuallyHidden(region);
43
23
  parent.appendChild(region);
44
24
  win.setTimeout(() => {
45
25
  region.textContent = message;
@@ -57,7 +37,5 @@ function createLiveRegion(opts = {}) {
57
37
  }
58
38
  };
59
39
  }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- createLiveRegion
63
- });
40
+
41
+ exports.createLiveRegion = createLiveRegion;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- // src/index.ts
2
- import { setVisuallyHidden } from "@zag-js/visually-hidden";
3
- var ID = "__live-region__";
1
+ import { setVisuallyHidden } from '@zag-js/visually-hidden';
2
+
3
+ const ID = "__live-region__";
4
4
  function createLiveRegion(opts = {}) {
5
5
  const { level = "polite", document: doc = document, root, delay: _delay = 0 } = opts;
6
6
  const win = doc.defaultView ?? window;
@@ -33,6 +33,5 @@ function createLiveRegion(opts = {}) {
33
33
  }
34
34
  };
35
35
  }
36
- export {
37
- createLiveRegion
38
- };
36
+
37
+ export { createLiveRegion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/live-region",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Implementing live region for screen readers",
5
5
  "keywords": [
6
6
  "js",
@@ -17,7 +17,7 @@
17
17
  "src"
18
18
  ],
19
19
  "dependencies": {
20
- "@zag-js/visually-hidden": "0.10.2"
20
+ "@zag-js/visually-hidden": "0.10.3"
21
21
  },
22
22
  "devDependencies": {
23
23
  "clean-package": "2.2.0"
@@ -41,9 +41,7 @@
41
41
  "./package.json": "./package.json"
42
42
  },
43
43
  "scripts": {
44
- "build-fast": "tsup src",
45
- "start": "pnpm build --watch",
46
- "build": "tsup src --dts",
44
+ "build": "vite build -c ../../../vite.config.ts",
47
45
  "test": "jest --config ../../../jest.config.js --rootDir tests",
48
46
  "lint": "eslint src --ext .ts,.tsx",
49
47
  "test-ci": "pnpm test --ci --runInBand -u",