focus-trap-react 11.0.2 → 11.0.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/CHANGELOG.md +6 -0
- package/dist/focus-trap-react.js +0 -1
- package/index.d.ts +20 -19
- package/package.json +19 -8
- package/src/focus-trap-react.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 11.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 095b3d4: Bump focus-trap dependency to v7.6.4 to get fix to manually-paused traps (see [focus-trap|1340](https://github.com/focus-trap/focus-trap/pull/1340) for more info)
|
|
8
|
+
|
|
3
9
|
## 11.0.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/focus-trap-react.js
CHANGED
|
@@ -296,7 +296,6 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
296
296
|
} else {
|
|
297
297
|
var nodesExist = this.focusTrapElements.some(Boolean);
|
|
298
298
|
if (nodesExist) {
|
|
299
|
-
// eslint-disable-next-line react/prop-types -- _createFocusTrap is an internal prop
|
|
300
299
|
this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions);
|
|
301
300
|
if (this.props.active) {
|
|
302
301
|
this.focusTrap.activate();
|
package/index.d.ts
CHANGED
|
@@ -3,40 +3,40 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
export interface FocusTrapProps {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
* __Single container child__ for the trap. Use `containerElements` instead
|
|
7
|
+
* if you need a trap with multiple containers.
|
|
8
|
+
*/
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
* By default, the trap will be active when it mounts, so it's activated by
|
|
13
|
+
* mounting, and deactivated by unmounting. Use this prop to control when
|
|
14
|
+
* it's active while it's mounted, or if it's initially inactive.
|
|
15
|
+
*/
|
|
16
16
|
active?: boolean;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* To pause or unpause the trap while it's `active`. Primarily for use when
|
|
20
|
+
* you need to manage multiple traps in the same view. When paused, the trap
|
|
21
|
+
* retains its various event listeners, but ignores all events.
|
|
22
|
+
*/
|
|
23
23
|
paused?: boolean;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* See Focus-trap's [createOptions](https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions)
|
|
27
|
+
* for more details on available options.
|
|
28
|
+
*/
|
|
29
29
|
focusTrapOptions?: FocusTrapOptions;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
* If specified, these elements will be used as the boundaries for the
|
|
33
|
+
* trap, __instead of the child__ specified in `children` (though
|
|
34
|
+
* `children` will still be rendered).
|
|
35
|
+
*/
|
|
36
36
|
containerElements?: Array<HTMLElement>;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export declare class FocusTrap extends React.Component<FocusTrapProps> {
|
|
39
|
+
export declare class FocusTrap extends React.Component<FocusTrapProps> {}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Default export of the FocusTrap component.
|
|
@@ -44,6 +44,7 @@ export declare class FocusTrap extends React.Component<FocusTrapProps> { }
|
|
|
44
44
|
* @description 🔺 The default export will be removed in a future release. Migrate to the named
|
|
45
45
|
* import `{ FocusTrap }` today to ensure future compatibility.
|
|
46
46
|
*/
|
|
47
|
+
// eslint-disable-next-line no-redeclare -- Valid TypeScript
|
|
47
48
|
declare namespace FocusTrap {
|
|
48
49
|
export type Props = FocusTrapProps;
|
|
49
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "focus-trap-react",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.3",
|
|
4
4
|
"description": "A React component that traps focus.",
|
|
5
5
|
"main": "dist/focus-trap-react.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"demo-bundle": "NODE_ENV=production browserify demo/js -t babelify --extension=.jsx -o demo/demo-bundle.js",
|
|
18
18
|
"start": "npm run build && NODE_ENV=development budo demo/js/index.js:demo-bundle.js --dir demo --live -- -t babelify --extension=.jsx",
|
|
19
|
-
"lint": "eslint \"
|
|
20
|
-
"format": "prettier --write \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows
|
|
21
|
-
"format:check": "prettier --check \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows
|
|
22
|
-
"format:watch": "onchange \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows
|
|
19
|
+
"lint": "eslint \"{*,src/**/*,test/**/*,demo/**/*,cypress/e2e/**/*}.+(js|cjs|mjs|ts|cts|mts)\"",
|
|
20
|
+
"format": "prettier --write \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows/**/*,cypress/**/*}.+(js|cjs|mjs|ts|cts|mts|yml)\"",
|
|
21
|
+
"format:check": "prettier --check \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows/**/*,cypress/**/*}.+(js|cjs|mjs|ts|cts|mts|yml)\"",
|
|
22
|
+
"format:watch": "onchange \"{*,src/**/*,test/**/*,demo/js/**/*,.github/workflows/**/*,cypress/**/*}.+(js|cjs|mjs|ts|cts|mts|yml)\" -- prettier --write {{changed}}",
|
|
23
23
|
"build": "babel src -d dist",
|
|
24
24
|
"test:types": "tsc index.d.ts",
|
|
25
25
|
"test:unit": "jest",
|
|
@@ -60,10 +60,12 @@
|
|
|
60
60
|
"@babel/cli": "^7.26.4",
|
|
61
61
|
"@babel/core": "^7.26.0",
|
|
62
62
|
"@babel/eslint-parser": "^7.25.9",
|
|
63
|
+
"@babel/eslint-plugin": "^7.25.9",
|
|
63
64
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
65
|
"@babel/preset-env": "^7.26.0",
|
|
65
66
|
"@babel/preset-react": "^7.26.3",
|
|
66
67
|
"@changesets/cli": "^2.27.11",
|
|
68
|
+
"@eslint/js": "^9.17.0",
|
|
67
69
|
"@testing-library/cypress": "^10.0.2",
|
|
68
70
|
"@testing-library/dom": "^10.4.0",
|
|
69
71
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -72,6 +74,8 @@
|
|
|
72
74
|
"@types/jquery": "^3.5.32",
|
|
73
75
|
"@types/react": "^19.0.0",
|
|
74
76
|
"@types/react-dom": "^19.0.0",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
78
|
+
"@typescript-eslint/parser": "^8.19.1",
|
|
75
79
|
"all-contributors-cli": "^6.26.1",
|
|
76
80
|
"babel-jest": "^29.7.0",
|
|
77
81
|
"babelify": "^10.0.0",
|
|
@@ -79,11 +83,18 @@
|
|
|
79
83
|
"budo": "^11.8.4",
|
|
80
84
|
"cypress": "^13.17.0",
|
|
81
85
|
"cypress-plugin-tab": "^1.0.5",
|
|
82
|
-
"eslint": "^
|
|
86
|
+
"eslint": "^9.17.0",
|
|
83
87
|
"eslint-config-prettier": "^9.1.0",
|
|
84
|
-
"eslint-
|
|
88
|
+
"eslint-import-resolver-node": "^0.3.9",
|
|
89
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
90
|
+
"eslint-plugin-cypress": "^4.1.0",
|
|
91
|
+
"eslint-plugin-import": "^2.31.0",
|
|
85
92
|
"eslint-plugin-jest": "^28.10.0",
|
|
93
|
+
"eslint-plugin-jest-dom": "^5.5.0",
|
|
86
94
|
"eslint-plugin-react": "^7.37.3",
|
|
95
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
96
|
+
"eslint-plugin-testing-library": "^7.1.1",
|
|
97
|
+
"globals": "^15.13.0",
|
|
87
98
|
"jest": "^29.7.0",
|
|
88
99
|
"jest-environment-jsdom": "^29.7.0",
|
|
89
100
|
"jest-watch-typeahead": "^2.2.2",
|
|
@@ -96,7 +107,7 @@
|
|
|
96
107
|
"typescript": "^5.7.2"
|
|
97
108
|
},
|
|
98
109
|
"dependencies": {
|
|
99
|
-
"focus-trap": "^7.6.
|
|
110
|
+
"focus-trap": "^7.6.4",
|
|
100
111
|
"tabbable": "^6.2.0"
|
|
101
112
|
},
|
|
102
113
|
"peerDependencies": {
|
package/src/focus-trap-react.js
CHANGED
|
@@ -301,7 +301,6 @@ class FocusTrap extends React.Component {
|
|
|
301
301
|
} else {
|
|
302
302
|
const nodesExist = this.focusTrapElements.some(Boolean);
|
|
303
303
|
if (nodesExist) {
|
|
304
|
-
// eslint-disable-next-line react/prop-types -- _createFocusTrap is an internal prop
|
|
305
304
|
this.focusTrap = this.props._createFocusTrap(
|
|
306
305
|
this.focusTrapElements,
|
|
307
306
|
this.internalOptions
|