@zag-js/focus-visible 0.1.2 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Chakra UI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # @zag-js/focus-visible
2
2
 
3
-
4
-
5
3
  ## Installation
6
4
 
7
5
  ```sh
@@ -12,11 +10,8 @@ npm i @zag-js/focus-visible
12
10
 
13
11
  ## Contribution
14
12
 
15
- Yes please! See the
16
- [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md)
17
- for details.
13
+ Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.
18
14
 
19
15
  ## Licence
20
16
 
21
- This project is licensed under the terms of the
22
- [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
17
+ This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  declare type Modality = "keyboard" | "pointer" | "virtual";
2
2
  declare type FocusVisibleCallback = (isFocusVisible: boolean) => void;
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;
7
- export {};
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 };
package/dist/index.js CHANGED
@@ -134,3 +134,10 @@ function setInteractionModality(value) {
134
134
  function getInteractionModality() {
135
135
  return modality;
136
136
  }
137
+ // Annotate the CommonJS export names for ESM import in node:
138
+ 0 && (module.exports = {
139
+ getInteractionModality,
140
+ setInteractionModality,
141
+ trackFocusVisible,
142
+ trackInteractionModality
143
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/focus-visible",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Focus visible polyfill utility based on WICG",
5
5
  "keywords": [
6
6
  "js",
@@ -19,19 +19,19 @@
19
19
  "files": [
20
20
  "dist/**/*"
21
21
  ],
22
- "scripts": {
23
- "build:fast": "yarn zag build",
24
- "start": "yarn zag build --watch",
25
- "build": "yarn zag build --prod",
26
- "test": "jest --config ../../../jest.config.js --rootDir tests",
27
- "lint": "eslint src --ext .ts,.tsx",
28
- "test:ci": "yarn test --ci --runInBand --updateSnapshot",
29
- "test:watch": "yarn test --watchAll"
30
- },
31
22
  "publishConfig": {
32
23
  "access": "public"
33
24
  },
34
25
  "bugs": {
35
26
  "url": "https://github.com/chakra-ui/zag/issues"
27
+ },
28
+ "scripts": {
29
+ "build-fast": "tsup src/index.ts --format=esm,cjs",
30
+ "start": "pnpm build --watch",
31
+ "build": "tsup src/index.ts --format=esm,cjs --dts",
32
+ "test": "jest --config ../../../jest.config.js --rootDir tests",
33
+ "lint": "eslint src --ext .ts,.tsx",
34
+ "test-ci": "pnpm test --ci --runInBand -u",
35
+ "test-watch": "pnpm test --watchAll"
36
36
  }
37
- }
37
+ }