@zag-js/focus-visible 0.0.0-dev-20230601110239 → 0.0.0-dev-20230605130234

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,8 +1,7 @@
1
1
  type Modality = "keyboard" | "pointer" | "virtual";
2
2
  type FocusVisibleCallback = (isFocusVisible: boolean) => void;
3
- declare function trackFocusVisible(fn: FocusVisibleCallback): () => void;
4
- declare function trackInteractionModality(fn: (value: Modality | null) => void): () => void;
5
- declare function setInteractionModality(value: Modality): void;
6
- declare function getInteractionModality(): Modality | null;
7
-
8
- export { getInteractionModality, setInteractionModality, trackFocusVisible, trackInteractionModality };
3
+ export declare function trackFocusVisible(fn: FocusVisibleCallback): () => void;
4
+ export declare function trackInteractionModality(fn: (value: Modality | null) => void): () => void;
5
+ export declare function setInteractionModality(value: Modality): void;
6
+ export declare function getInteractionModality(): Modality | null;
7
+ export {};
package/dist/index.js CHANGED
@@ -1,40 +1,16 @@
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
- getInteractionModality: () => getInteractionModality,
24
- setInteractionModality: () => setInteractionModality,
25
- trackFocusVisible: () => trackFocusVisible,
26
- trackInteractionModality: () => trackInteractionModality
27
- });
28
- module.exports = __toCommonJS(src_exports);
29
- var hasSetup = false;
30
- var modality = null;
31
- var hasEventBeforeFocus = false;
32
- var hasBlurredWindowRecently = false;
33
- var handlers = /* @__PURE__ */ new Set();
5
+ let hasSetup = false;
6
+ let modality = null;
7
+ let hasEventBeforeFocus = false;
8
+ let hasBlurredWindowRecently = false;
9
+ const handlers = /* @__PURE__ */ new Set();
34
10
  function trigger(modality2, event) {
35
11
  handlers.forEach((handler) => handler(modality2, event));
36
12
  }
37
- var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
13
+ const isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
38
14
  function isValidKey(e) {
39
15
  return !(e.metaKey || !isMac && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
40
16
  }
@@ -139,10 +115,8 @@ function setInteractionModality(value) {
139
115
  function getInteractionModality() {
140
116
  return modality;
141
117
  }
142
- // Annotate the CommonJS export names for ESM import in node:
143
- 0 && (module.exports = {
144
- getInteractionModality,
145
- setInteractionModality,
146
- trackFocusVisible,
147
- trackInteractionModality
148
- });
118
+
119
+ exports.getInteractionModality = getInteractionModality;
120
+ exports.setInteractionModality = setInteractionModality;
121
+ exports.trackFocusVisible = trackFocusVisible;
122
+ exports.trackInteractionModality = trackInteractionModality;
package/dist/index.mjs CHANGED
@@ -1,13 +1,12 @@
1
- // src/index.ts
2
- var hasSetup = false;
3
- var modality = null;
4
- var hasEventBeforeFocus = false;
5
- var hasBlurredWindowRecently = false;
6
- var handlers = /* @__PURE__ */ new Set();
1
+ let hasSetup = false;
2
+ let modality = null;
3
+ let hasEventBeforeFocus = false;
4
+ let hasBlurredWindowRecently = false;
5
+ const handlers = /* @__PURE__ */ new Set();
7
6
  function trigger(modality2, event) {
8
7
  handlers.forEach((handler) => handler(modality2, event));
9
8
  }
10
- var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
9
+ const isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
11
10
  function isValidKey(e) {
12
11
  return !(e.metaKey || !isMac && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
13
12
  }
@@ -112,9 +111,5 @@ function setInteractionModality(value) {
112
111
  function getInteractionModality() {
113
112
  return modality;
114
113
  }
115
- export {
116
- getInteractionModality,
117
- setInteractionModality,
118
- trackFocusVisible,
119
- trackInteractionModality
120
- };
114
+
115
+ export { getInteractionModality, setInteractionModality, trackFocusVisible, trackInteractionModality };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/focus-visible",
3
- "version": "0.0.0-dev-20230601110239",
3
+ "version": "0.0.0-dev-20230605130234",
4
4
  "description": "Focus visible polyfill utility based on WICG",
5
5
  "keywords": [
6
6
  "js",
@@ -39,9 +39,7 @@
39
39
  "./package.json": "./package.json"
40
40
  },
41
41
  "scripts": {
42
- "build-fast": "tsup src",
43
- "start": "pnpm build --watch",
44
- "build": "tsup src --dts",
42
+ "build": "vite build -c ../../../vite.config.ts",
45
43
  "test": "jest --config ../../../jest.config.js --rootDir tests",
46
44
  "lint": "eslint src --ext .ts,.tsx",
47
45
  "test-ci": "pnpm test --ci --runInBand -u",