Skip to content

Commit

Permalink
[fix] add live region root check to alert component (#55)
Browse files Browse the repository at this point in the history
* [fix] add liveRegionRoots to prevent unnecessary usage of ReactDOM createRoot method

* Publish

 - @ciceksepeti/cui-accordion@0.0.15
 - @ciceksepeti/cui-alert-dialog@0.1.5
 - @ciceksepeti/cui-alert@0.11.5
 - @ciceksepeti/cui-checkbox@0.0.19
 - @ciceksepeti/cui@0.11.7
 - @ciceksepeti/cui-dialog@0.11.5
 - @ciceksepeti/cui-focus-trap@0.1.5
 - @ciceksepeti/cui-hooks@0.11.5
 - @ciceksepeti/cui-listbox@0.0.20
 - @ciceksepeti/cui-popover@0.5.0
 - @ciceksepeti/cui-portal@0.1.5
 - @ciceksepeti/cui-radio-group@0.0.16
 - @ciceksepeti/cui-skip-nav@0.1.5
 - @ciceksepeti/cui-tabs@0.0.16
 - @ciceksepeti/cui-utils@0.11.5
 - @ciceksepeti/cui-visually-hidden@0.1.5

* [chore] remove unnecessary blank lines

---------

Co-authored-by: Emir Akar <emir.akar@csadmins-MacBook-Pro.local>
  • Loading branch information
eakarr and Emir Akar committed Feb 13, 2024
1 parent a4fc6ca commit d0b9470
Show file tree
Hide file tree
Showing 34 changed files with 316 additions and 85 deletions.
12 changes: 12 additions & 0 deletions packages/accordion/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.0.15](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-accordion@0.0.11...@ciceksepeti/cui-accordion@0.0.15) (2024-02-13)



## 0.0.26 (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-accordion





## [0.0.14](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-accordion@0.0.11...@ciceksepeti/cui-accordion@0.0.14) (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-accordion
Expand Down
6 changes: 3 additions & 3 deletions packages/accordion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-accordion",
"version": "0.0.14",
"version": "0.0.15",
"description": "ÇiçekSepeti Accordion Component",
"author": "ciceksepeti",
"main": "dist/src/index.js",
Expand All @@ -20,8 +20,8 @@
"url": "git+https://github.com/ciceksepetitech/cactus-ui.git"
},
"dependencies": {
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-utils": "0.11.4"
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-utils": "0.11.5"
},
"peerDependencies": {
"react": ">=16",
Expand Down
12 changes: 12 additions & 0 deletions packages/alert-dialog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.1.5](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-alert-dialog@0.1.1...@ciceksepeti/cui-alert-dialog@0.1.5) (2024-02-13)



## 0.0.26 (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-alert-dialog





## [0.1.4](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-alert-dialog@0.1.1...@ciceksepeti/cui-alert-dialog@0.1.4) (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-alert-dialog
Expand Down
8 changes: 4 additions & 4 deletions packages/alert-dialog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-alert-dialog",
"version": "0.1.4",
"version": "0.1.5",
"description": "ÇiçekSepeti Alert Dialog Component",
"author": "ciceksepeti",
"sideEffects": [
Expand All @@ -24,9 +24,9 @@
"url": "git+https://github.com/ciceksepetitech/cactus-ui.git"
},
"dependencies": {
"@ciceksepeti/cui-dialog": "0.11.4",
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-utils": "0.11.4"
"@ciceksepeti/cui-dialog": "0.11.5",
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-utils": "0.11.5"
},
"peerDependencies": {
"react": ">=16",
Expand Down
12 changes: 12 additions & 0 deletions packages/alert/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.11.5](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-alert@0.11.1...@ciceksepeti/cui-alert@0.11.5) (2024-02-13)



## 0.0.26 (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-alert





## [0.11.4](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-alert@0.11.1...@ciceksepeti/cui-alert@0.11.4) (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-alert
Expand Down
8 changes: 4 additions & 4 deletions packages/alert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-alert",
"version": "0.11.4",
"version": "0.11.5",
"description": "ÇiçekSepeti Accessible Alert Component",
"author": "ciceksepeti",
"main": "dist/src/index.js",
Expand All @@ -20,9 +20,9 @@
"url": "git+https://github.com/ciceksepetitech/cactus-ui.git"
},
"dependencies": {
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-utils": "0.11.4",
"@ciceksepeti/cui-visually-hidden": "0.1.4"
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-utils": "0.11.5",
"@ciceksepeti/cui-visually-hidden": "0.1.5"
},
"peerDependencies": {
"react": ">=16",
Expand Down
21 changes: 20 additions & 1 deletion packages/alert/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ const liveRegionContainers: LiveRegionElementTypes = {
assertive: null
};

/**
* holds references to created live roots
*/
const liveRegionRoots: LiveRegionRoots = {
off: null,
polite: null,
assertive: null
};

/**
* creates functions for a created alert
* @param liveRegionType
Expand Down Expand Up @@ -108,7 +117,13 @@ const renderAlertsToRegions = () => {
const regionElements = liveRegionContainerElements[liveRegionType];

if (container) {
const root = ReactDOM.createRoot(container as Element);
let root = liveRegionRoots[liveRegionType];

if (!root) {
const _root = ReactDOM.createRoot(container as Element);
liveRegionRoots[liveRegionType] = _root;
root = _root;
}

root.render(
<VisuallyHidden as="div">
Expand Down Expand Up @@ -198,6 +213,10 @@ type LiveRegionElementTypes<T extends HTMLElement = HTMLDivElement> = {
[key in LiveRegionType]: T | null;
};

type LiveRegionRoots = {
[key in LiveRegionType]: ReactDOM.Root | null;
};

type LiveRegionKeys = {
[key in LiveRegionType]: number;
};
Expand Down
15 changes: 15 additions & 0 deletions packages/checkbox/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.0.19](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-checkbox@0.0.13...@ciceksepeti/cui-checkbox@0.0.19) (2024-02-13)



## 0.0.26 (2024-02-12)


### Bug Fixes

* listbox input search rerender trigger issue fix ([#47](https://github.com/ciceksepetitech/cactus-ui/issues/47)) ([d426f09](https://github.com/ciceksepetitech/cactus-ui/commit/d426f0918db2ef14614ed144b4713e2f80fa73c4))





## [0.0.18](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-checkbox@0.0.13...@ciceksepeti/cui-checkbox@0.0.18) (2024-02-12)


Expand Down
6 changes: 3 additions & 3 deletions packages/checkbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-checkbox",
"version": "0.0.18",
"version": "0.0.19",
"description": "ÇiçekSepeti Checkbox Component",
"author": "ciceksepeti",
"main": "dist/src/index.js",
Expand All @@ -24,8 +24,8 @@
"url": "git+https://github.com/ciceksepetitech/cactus-ui.git"
},
"dependencies": {
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-utils": "0.11.4"
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-utils": "0.11.5"
},
"peerDependencies": {
"react": ">=16",
Expand Down
15 changes: 15 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.11.7](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui@0.11.1...@ciceksepeti/cui@0.11.7) (2024-02-13)



## 0.0.26 (2024-02-12)


### Bug Fixes

* listbox input search rerender trigger issue fix ([#47](https://github.com/ciceksepetitech/cactus-ui/issues/47)) ([d426f09](https://github.com/ciceksepetitech/cactus-ui/commit/d426f0918db2ef14614ed144b4713e2f80fa73c4))





## [0.11.6](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui@0.11.1...@ciceksepeti/cui@0.11.6) (2024-02-12)


Expand Down
30 changes: 15 additions & 15 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui",
"version": "0.11.6",
"version": "0.11.7",
"description": "ÇiçekSepeti Cactus UI All Packages",
"author": "cs",
"main": "dist/src/index.js",
Expand All @@ -23,21 +23,21 @@
"styles.css"
],
"dependencies": {
"@ciceksepeti/cui-accordion": "0.0.14",
"@ciceksepeti/cui-alert": "0.11.4",
"@ciceksepeti/cui-alert-dialog": "0.1.4",
"@ciceksepeti/cui-checkbox": "0.0.18",
"@ciceksepeti/cui-dialog": "0.11.4",
"@ciceksepeti/cui-focus-trap": "0.1.4",
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-accordion": "0.0.15",
"@ciceksepeti/cui-alert": "0.11.5",
"@ciceksepeti/cui-alert-dialog": "0.1.5",
"@ciceksepeti/cui-checkbox": "0.0.19",
"@ciceksepeti/cui-dialog": "0.11.5",
"@ciceksepeti/cui-focus-trap": "0.1.5",
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-listbox": "0.0.10",
"@ciceksepeti/cui-popover": "0.4.0",
"@ciceksepeti/cui-portal": "0.1.4",
"@ciceksepeti/cui-radio-group": "0.0.15",
"@ciceksepeti/cui-skip-nav": "0.1.4",
"@ciceksepeti/cui-tabs": "0.0.15",
"@ciceksepeti/cui-utils": "0.11.4",
"@ciceksepeti/cui-visually-hidden": "0.1.4"
"@ciceksepeti/cui-popover": "0.5.0",
"@ciceksepeti/cui-portal": "0.1.5",
"@ciceksepeti/cui-radio-group": "0.0.16",
"@ciceksepeti/cui-skip-nav": "0.1.5",
"@ciceksepeti/cui-tabs": "0.0.16",
"@ciceksepeti/cui-utils": "0.11.5",
"@ciceksepeti/cui-visually-hidden": "0.1.5"
},
"devDependencies": {
"gulp": "^4.0.2",
Expand Down
12 changes: 12 additions & 0 deletions packages/dialog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.11.5](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-dialog@0.11.1...@ciceksepeti/cui-dialog@0.11.5) (2024-02-13)



## 0.0.26 (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-dialog





## [0.11.4](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-dialog@0.11.1...@ciceksepeti/cui-dialog@0.11.4) (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-dialog
Expand Down
12 changes: 6 additions & 6 deletions packages/dialog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-dialog",
"version": "0.11.4",
"version": "0.11.5",
"description": "ÇiçekSepeti Accessible Dialog Component",
"author": "ciceksepeti",
"main": "dist/src/index.js",
Expand All @@ -24,11 +24,11 @@
"url": "git+https://github.com/ciceksepetitech/cactus-ui.git"
},
"dependencies": {
"@ciceksepeti/cui-focus-trap": "0.1.4",
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-portal": "0.1.4",
"@ciceksepeti/cui-utils": "0.11.4",
"@ciceksepeti/cui-visually-hidden": "0.1.4",
"@ciceksepeti/cui-focus-trap": "0.1.5",
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-portal": "0.1.5",
"@ciceksepeti/cui-utils": "0.11.5",
"@ciceksepeti/cui-visually-hidden": "0.1.5",
"react-remove-scroll": "^2.4.3"
},
"peerDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/focus-trap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.1.5](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-focus-trap@0.1.1...@ciceksepeti/cui-focus-trap@0.1.5) (2024-02-13)



## 0.0.26 (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-focus-trap





## [0.1.4](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-focus-trap@0.1.1...@ciceksepeti/cui-focus-trap@0.1.4) (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-focus-trap
Expand Down
6 changes: 3 additions & 3 deletions packages/focus-trap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-focus-trap",
"version": "0.1.4",
"version": "0.1.5",
"description": "ÇiçekSepeti Focus Trap Component",
"author": "ciceksepeti",
"main": "dist/src/index.js",
Expand All @@ -20,8 +20,8 @@
"url": "git+https://github.com/ciceksepetitech/cactus-ui.git"
},
"dependencies": {
"@ciceksepeti/cui-hooks": "0.11.4",
"@ciceksepeti/cui-utils": "0.11.4"
"@ciceksepeti/cui-hooks": "0.11.5",
"@ciceksepeti/cui-utils": "0.11.5"
},
"peerDependencies": {
"react": ">=16",
Expand Down
12 changes: 12 additions & 0 deletions packages/hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.11.5](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-hooks@0.11.1...@ciceksepeti/cui-hooks@0.11.5) (2024-02-13)



## 0.0.26 (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-hooks





## [0.11.4](https://github.com/ciceksepetitech/cactus-ui/compare/@ciceksepeti/cui-hooks@0.11.1...@ciceksepeti/cui-hooks@0.11.4) (2024-02-12)

**Note:** Version bump only for package @ciceksepeti/cui-hooks
Expand Down
4 changes: 2 additions & 2 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciceksepeti/cui-hooks",
"version": "0.11.4",
"version": "0.11.5",
"description": "ÇiçekSepeti Component Hooks",
"author": "cs",
"main": "dist/src/index.js",
Expand All @@ -15,7 +15,7 @@
"README.md"
],
"dependencies": {
"@ciceksepeti/cui-utils": "0.11.4"
"@ciceksepeti/cui-utils": "0.11.5"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit d0b9470

Please sign in to comment.