diff --git a/package-lock.json b/package-lock.json index c4a7f3607..67606de52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gisce/react-ooui", - "version": "2.62.0", + "version": "2.63.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gisce/react-ooui", - "version": "2.62.0", + "version": "2.63.0", "dependencies": { "@ant-design/colors": "^7.2.0", "@ant-design/plots": "^1.0.9", @@ -20,6 +20,7 @@ "antd": "5.13.1", "buffer": "^6.0.3", "file-type-buffer-browser": "git+ssh://git@github.com/mguellsegarra/file-type-buffer-browser.git", + "focus-trap-react": "^11.0.3", "framer-motion": "^11.5.5", "interweave": "^13.0.0", "md5": "^2.3.0", @@ -9445,7 +9446,6 @@ "version": "18.2.7", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.7.tgz", "integrity": "sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==", - "dev": true, "dependencies": { "@types/react": "*" } @@ -14307,6 +14307,29 @@ "uglify-js": "^2.6.2" } }, + "node_modules/focus-trap": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.6.4.tgz", + "integrity": "sha512-xx560wGBk7seZ6y933idtjJQc1l+ck+pI3sKvhKozdBV1dRZoKhkW5xoCaFv9tQiX5RH1xfSxjuNu6g+lmN/gw==", + "dependencies": { + "tabbable": "^6.2.0" + } + }, + "node_modules/focus-trap-react": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/focus-trap-react/-/focus-trap-react-11.0.3.tgz", + "integrity": "sha512-tS1+enWS/gwCHk2WIF3KpM2oz7Y3HsnRImzHZNRgCBLWXzNG4XQVlJgbqdLr4lBKRXGdDBjQYitSh1bf2xe4Ag==", + "dependencies": { + "focus-trap": "^7.6.4", + "tabbable": "^6.2.0" + }, + "peerDependencies": { + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -26671,6 +26694,11 @@ "integrity": "sha512-AsS729u2RHUfEra9xJrE39peJcc2stq2+poBXX8bcM08Y6g9j/i/PUzwNQqkaJde7Ntg1TO7bSREbR5sdosQ+g==", "dev": true }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, "node_modules/tape": { "version": "4.17.0", "resolved": "https://registry.npmjs.org/tape/-/tape-4.17.0.tgz", diff --git a/package.json b/package.json index 8757ddb7d..b59ccec12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gisce/react-ooui", - "version": "2.62.0", + "version": "2.63.0", "engines": { "node": "20.5.0" }, @@ -45,6 +45,7 @@ "antd": "5.13.1", "buffer": "^6.0.3", "file-type-buffer-browser": "git+ssh://git@github.com/mguellsegarra/file-type-buffer-browser.git", + "focus-trap-react": "^11.0.3", "framer-motion": "^11.5.5", "interweave": "^13.0.0", "md5": "^2.3.0", diff --git a/src/ui/FloatingDrawer.tsx b/src/ui/FloatingDrawer.tsx index 301e8e04c..eeb576e1c 100644 --- a/src/ui/FloatingDrawer.tsx +++ b/src/ui/FloatingDrawer.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef, useCallback } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { Typography, Button, Layout, theme } from "antd"; import { CloseOutlined } from "@ant-design/icons"; +import FocusTrap from "focus-trap-react"; const { useToken } = theme; const { Title } = Typography; @@ -97,58 +98,68 @@ export const FloatingDrawer: React.FC = ({ }} onClick={handleOverlayClick} /> - -
- - {title} - -
- - {children} - - {footer && ( -
+ + {title} + +
- )} -
+ {children} + + {footer && ( + + )} + + )} diff --git a/src/widgets/base/LinkInput.tsx b/src/widgets/base/LinkInput.tsx index a951ba77c..47275fc06 100644 --- a/src/widgets/base/LinkInput.tsx +++ b/src/widgets/base/LinkInput.tsx @@ -45,7 +45,7 @@ export const LinkInput = (props: LinkInputProps) => { return ( {!readOnly ? ( - + {editMode ? (