@shelf/react-outside-click 0.1.4 → 0.1.5

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.
@@ -1,2 +1,2 @@
1
1
  import type { ClickOutsideHandler, Options, Ref } from '../types.js';
2
- export declare const useClickOutside: (ref: Ref, onOutsideClick: ClickOutsideHandler, options?: Options) => void;
2
+ export declare const useClickOutside: (ref: Ref<HTMLElement>, onOutsideClick: ClickOutsideHandler, options?: Options) => void;
package/lib/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode, RefObject } from 'react';
2
2
  export type ClickOutsideHandler = (event: MouseEvent) => void;
3
- export type Ref<T extends HTMLElement = HTMLElement> = RefObject<T>;
3
+ export type Ref<T extends HTMLElement = HTMLElement> = RefObject<T | null>;
4
4
  export type Options = {
5
5
  disabled?: boolean;
6
6
  mouseEvent?: 'mousedown' | 'mouseup';
package/package.json CHANGED
@@ -1,76 +1,39 @@
1
1
  {
2
2
  "name": "@shelf/react-outside-click",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "React library for handling outside clicks of a specified element",
5
- "license": "MIT",
6
- "author": {
7
- "name": "Andrii Butsa",
8
- "email": "andrii.butsa@shelf.io",
9
- "url": "https://shelf.io"
5
+ "keywords": [
6
+ "react",
7
+ "outside click",
8
+ "click outside",
9
+ "hooks"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/shelfio/libs-frontend.git",
14
+ "directory": "packages/react-outside-click"
10
15
  },
16
+ "license": "UNLICENSED",
17
+ "author": "Shelf",
11
18
  "sideEffects": false,
12
19
  "type": "module",
13
20
  "exports": "./lib/index.js",
14
- "main": "lib/index.js",
21
+ "module": "lib/index.js",
15
22
  "types": "lib/index.d.ts",
16
23
  "files": [
17
- "lib"
24
+ "lib",
25
+ "CHANGELOG.md"
18
26
  ],
19
27
  "scripts": {
20
- "build": "rm -rf lib/ && tsc",
21
- "coverage": "yarn test --coverage",
22
- "lint": "yarn lint:ci --fix",
23
- "lint:ci": "eslint . --ext .js,.ts,.tsx,.json",
24
- "prepack": "yarn build",
25
- "size": "size-limit",
26
- "test": "TZ=UTC jest src",
28
+ "build": "rm -rf lib/ && tsc --noEmit false",
29
+ "coverage": "pnpm test --coverage",
30
+ "lint:size": "size-limit",
31
+ "test": "TZ=UTC jest",
27
32
  "type-check": "tsc --noEmit"
28
33
  },
29
- "lint-staged": {
30
- "*.{html,md,yml}": "prettier --write",
31
- "*.{ts,js,json,tsx,jsx}": "eslint --fix",
32
- ".circleci/config.yml": ".husky/validate-circleci-config.sh"
33
- },
34
- "prettier": "@shelf/prettier-config",
35
- "dependencies": {},
36
- "devDependencies": {
37
- "@shelf/eslint-config": "2.29.3",
38
- "@shelf/prettier-config": "1.0.0",
39
- "@shelf/tsconfig": "0.0.11",
40
- "@size-limit/esbuild-why": "8.2.6",
41
- "@size-limit/preset-small-lib": "8.2.6",
42
- "@testing-library/jest-dom": "5.17.0",
43
- "@testing-library/react": "14.0.0",
44
- "@types/jest": "29.5.4",
45
- "@types/node": "16",
46
- "@types/react": "18.2.21",
47
- "eslint": "8.48.0",
48
- "husky": "8.0.3",
49
- "jest": "29.6.4",
50
- "jest-environment-jsdom": "29.6.4",
51
- "lint-staged": "13.3.0",
52
- "prettier": "2.8.8",
53
- "react": "18.2.0",
54
- "react-dom": "18.2.0",
55
- "size-limit": "8.2.6",
56
- "ts-jest": "29.1.1",
57
- "ts-jest-resolver": "2.0.0",
58
- "typescript": "5.1.6"
59
- },
60
34
  "peerDependencies": {
61
- "react": "^17.0.0 || ^18.0.0",
62
- "react-dom": "^17.0.0 || ^18.0.0"
63
- },
64
- "engines": {
65
- "node": ">=14"
66
- },
67
- "publishConfig": {
68
- "access": "public"
35
+ "react": "^17 || ^18 || ^19",
36
+ "react-dom": "^17 || ^18 || ^19"
69
37
  },
70
- "size-limit": [
71
- {
72
- "path": "lib/index.js",
73
- "limit": "425 B"
74
- }
75
- ]
38
+ "gitHead": "a9a9a3a81990304ac530ac70c1434ac4ffd9e5df"
76
39
  }
package/.husky/_/husky.sh DELETED
@@ -1,31 +0,0 @@
1
- #!/bin/sh
2
- if [ -z "$husky_skip_init" ]; then
3
- debug () {
4
- if [ "$HUSKY_DEBUG" = "1" ]; then
5
- echo "husky (debug) - $1"
6
- fi
7
- }
8
-
9
- readonly hook_name="$(basename "$0")"
10
- debug "starting $hook_name..."
11
-
12
- if [ "$HUSKY" = "0" ]; then
13
- debug "HUSKY env variable is set to 0, skipping hook"
14
- exit 0
15
- fi
16
-
17
- if [ -f ~/.huskyrc ]; then
18
- debug "sourcing ~/.huskyrc"
19
- . ~/.huskyrc
20
- fi
21
-
22
- export readonly husky_skip_init=1
23
- sh -e "$0" "$@"
24
- exitCode="$?"
25
-
26
- if [ $exitCode != 0 ]; then
27
- echo "husky - $hook_name hook exited with code $exitCode (error)"
28
- fi
29
-
30
- exit $exitCode
31
- fi
package/license DELETED
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Gemshelf Inc. (shelf.io)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.