diff --git a/CHANGELOG.md b/CHANGELOG.md index 7337d4c..cb43119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,19 @@ and this project adheres to ## [Unreleased] +## [6.2.0] - 2024-09-20 + +### Added + +- Added useFocusTrap hook +- Added extendSession endpoint + +### Changed + +- Refactored Spinner.css to use CSS variable for color +- Refactored Modal component to use useFocusTrap hook +- Refactored Alert component to use useFocusTrap hook + ## [6.1.1] - 2024-08-30 ### Added @@ -361,7 +374,8 @@ and this project adheres to ## [0.0.7] - 2019-09-02 [unreleased]: - https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.1.1...master + https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.2.0...dev +[6.2.0]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.1.1...v6.2.0 [6.1.1]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.1.0...v6.1.1 [6.1.0]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.3...v6.1.0 [6.0.3]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.2...v6.0.3 diff --git a/package-lock.json b/package-lock.json index 07bd196..03e4e59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "foris", - "version": "6.1.1", + "version": "6.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "foris", - "version": "6.1.1", + "version": "6.2.0", "license": "GPL-3.0", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.6.0", diff --git a/package.json b/package.json index 749ae12..4853f11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foris", - "version": "6.1.1", + "version": "6.2.0", "description": "Foris JS library is a set of components and utils for reForis application and plugins.", "author": "CZ.NIC, z.s.p.o.", "repository": { diff --git a/src/bootstrap/Alert.js b/src/bootstrap/Alert.js index 7b7af79..577a753 100644 --- a/src/bootstrap/Alert.js +++ b/src/bootstrap/Alert.js @@ -5,10 +5,12 @@ * See /LICENSE for more information. */ -import React from "react"; +import React, { useRef } from "react"; import PropTypes from "prop-types"; +import { useFocusTrap } from "../utils/hooks"; + export const ALERT_TYPES = Object.freeze({ PRIMARY: "primary", SECONDARY: "secondary", @@ -37,11 +39,15 @@ Alert.defaultProps = { }; function Alert({ type, onDismiss, children }) { + const alertRef = useRef(); + useFocusTrap(alertRef, !!onDismiss); return (
{onDismiss && (