From 09f917a64515151659032808e8aefeb23f21c067 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:21:32 -0500 Subject: [PATCH 1/2] chore(release): v2.56.0 (#6603) * chore(telemetry): update telemetry config * chore(release): publish [skip ci] - jest-config-ibm-cloud-cognitive@1.15.0-rc.0 - @carbon/storybook-addon-theme@2.5.0-rc.0 - @carbon/ibm-cloud-cognitive-core@2.32.0-rc.0 - @carbon/ibm-products@2.56.0-rc.0 - @carbon/ibm-products-styles@2.52.0-rc.0 - @carbon/ibm-products-web-components@0.5.0-rc.0 * chore(release): publish [skip ci] - jest-config-ibm-cloud-cognitive@1.15.0 - @carbon/storybook-addon-theme@2.5.0 - @carbon/ibm-cloud-cognitive-core@2.32.0 - @carbon/ibm-products@2.56.0 - @carbon/ibm-products-styles@2.52.0 - @carbon/ibm-products-web-components@0.5.0 * chore: update yarn.lock * chore: restore upgrade changes * chore: update playwright --------- Co-authored-by: carbon-bot Co-authored-by: Amal K Joy --- .../CHANGELOG.md | 8 ++++ .../package.json | 2 +- .../storybook-addon-carbon-theme/CHANGELOG.md | 8 ++++ .../storybook-addon-carbon-theme/package.json | 2 +- package.json | 2 +- packages/core/CHANGELOG.md | 8 ++++ packages/core/package.json | 4 +- packages/ibm-products-styles/CHANGELOG.md | 8 ++++ packages/ibm-products-styles/package.json | 4 +- .../ibm-products-web-components/CHANGELOG.md | 8 ++++ .../ibm-products-web-components/package.json | 4 +- packages/ibm-products/CHANGELOG.md | 8 ++++ packages/ibm-products/package.json | 6 +-- yarn.lock | 44 +++++++++---------- 14 files changed, 82 insertions(+), 34 deletions(-) diff --git a/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md b/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md index be70211d70..93428a19ab 100644 --- a/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md +++ b/config/jest-config-ibm-cloud-cognitive/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.15.0](https://github.com/carbon-design-system/ibm-products/compare/jest-config-ibm-cloud-cognitive@1.15.0-rc.0...jest-config-ibm-cloud-cognitive@1.15.0) (2024-12-18) + +**Note:** Version bump only for package jest-config-ibm-cloud-cognitive + + + + + # [1.15.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/jest-config-ibm-cloud-cognitive@1.13.0-rc.0...jest-config-ibm-cloud-cognitive@1.15.0-rc.0) (2024-12-09) diff --git a/config/jest-config-ibm-cloud-cognitive/package.json b/config/jest-config-ibm-cloud-cognitive/package.json index 11e56e555d..1b42673ef7 100644 --- a/config/jest-config-ibm-cloud-cognitive/package.json +++ b/config/jest-config-ibm-cloud-cognitive/package.json @@ -1,7 +1,7 @@ { "name": "jest-config-ibm-cloud-cognitive", "private": true, - "version": "1.15.0-rc.0", + "version": "1.15.0", "license": "Apache-2.0", "main": "index.js", "repository": { diff --git a/config/storybook-addon-carbon-theme/CHANGELOG.md b/config/storybook-addon-carbon-theme/CHANGELOG.md index 3c0de70710..fc4f52062f 100644 --- a/config/storybook-addon-carbon-theme/CHANGELOG.md +++ b/config/storybook-addon-carbon-theme/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.5.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/storybook-addon-theme@2.5.0-rc.0...@carbon/storybook-addon-theme@2.5.0) (2024-12-18) + +**Note:** Version bump only for package @carbon/storybook-addon-theme + + + + + # [2.5.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/storybook-addon-theme@2.3.0-rc.0...@carbon/storybook-addon-theme@2.5.0-rc.0) (2024-12-09) **Note:** Version bump only for package @carbon/storybook-addon-theme diff --git a/config/storybook-addon-carbon-theme/package.json b/config/storybook-addon-carbon-theme/package.json index 2e38d52166..7bc3cdc10d 100644 --- a/config/storybook-addon-carbon-theme/package.json +++ b/config/storybook-addon-carbon-theme/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/storybook-addon-theme", "description": "Carbon theme switcher for Storybook", - "version": "2.5.0-rc.0", + "version": "2.5.0", "license": "Apache-2.0", "main": "dist/react.js", "repository": { diff --git a/package.json b/package.json index 6bdc739ea6..b24f23168c 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@babel/preset-react": "^7.17.12", "@commitlint/cli": "^18.6.0", "@commitlint/config-conventional": "^18.6.0", - "@playwright/test": "^1.36.2", + "@playwright/test": "^1.49.1", "@testing-library/dom": "^8.11.4", "@testing-library/react": "^14.0.0", "@testing-library/react-hooks": "^8.0.1", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 231c862b1b..a9191a7c23 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.32.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-cloud-cognitive-core@2.32.0-rc.0...@carbon/ibm-cloud-cognitive-core@2.32.0) (2024-12-18) + +**Note:** Version bump only for package @carbon/ibm-cloud-cognitive-core + + + + + # [2.32.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-cloud-cognitive-core@2.30.0-rc.0...@carbon/ibm-cloud-cognitive-core@2.32.0-rc.0) (2024-12-09) diff --git a/packages/core/package.json b/packages/core/package.json index 879b8e44b7..42c46087f6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-cloud-cognitive-core", "private": true, - "version": "2.32.0-rc.0", + "version": "2.32.0", "license": "Apache-2.0", "main": "scripts/build.js", "repository": { @@ -29,7 +29,7 @@ }, "devDependencies": { "@carbon/grid": "^11.29.0", - "@carbon/ibm-products-styles": "^2.52.0-rc.0", + "@carbon/ibm-products-styles": "^2.52.0", "@carbon/layout": "^11.28.0", "@carbon/motion": "^11.24.0", "@carbon/react": "^1.72.0", diff --git a/packages/ibm-products-styles/CHANGELOG.md b/packages/ibm-products-styles/CHANGELOG.md index 8c1e11f757..54882d9411 100644 --- a/packages/ibm-products-styles/CHANGELOG.md +++ b/packages/ibm-products-styles/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.52.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-styles@2.52.0-rc.0...@carbon/ibm-products-styles@2.52.0) (2024-12-18) + +**Note:** Version bump only for package @carbon/ibm-products-styles + + + + + # [2.52.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-styles@2.50.0-rc.0...@carbon/ibm-products-styles@2.52.0-rc.0) (2024-12-09) diff --git a/packages/ibm-products-styles/package.json b/packages/ibm-products-styles/package.json index 740fea8133..182aa49750 100644 --- a/packages/ibm-products-styles/package.json +++ b/packages/ibm-products-styles/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products-styles", "description": "Carbon for IBM Products styles", - "version": "2.52.0-rc.0", + "version": "2.52.0", "license": "Apache-2.0", "installConfig": { "hoistingLimits": "none" @@ -52,7 +52,7 @@ "cross-env": "^7.0.3", "glob": "^10.3.10", "jest": "^29.7.0", - "jest-config-ibm-cloud-cognitive": "^1.15.0-rc.0", + "jest-config-ibm-cloud-cognitive": "^1.15.0", "jest-environment-jsdom": "^29.7.0", "npm-check-updates": "^17.1.11", "npm-run-all": "^4.1.5", diff --git a/packages/ibm-products-web-components/CHANGELOG.md b/packages/ibm-products-web-components/CHANGELOG.md index 05e249daa5..56fde5c777 100644 --- a/packages/ibm-products-web-components/CHANGELOG.md +++ b/packages/ibm-products-web-components/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.5.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-web-components@0.5.0-rc.0...@carbon/ibm-products-web-components@0.5.0) (2024-12-18) + +**Note:** Version bump only for package @carbon/ibm-products-web-components + + + + + # [0.5.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products-web-components@0.3.0-rc.0...@carbon/ibm-products-web-components@0.5.0-rc.0) (2024-12-09) diff --git a/packages/ibm-products-web-components/package.json b/packages/ibm-products-web-components/package.json index 8c8841f457..1f62e084bb 100644 --- a/packages/ibm-products-web-components/package.json +++ b/packages/ibm-products-web-components/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products-web-components", "description": "Carbon for IBM Products Web Components", - "version": "0.5.0-rc.0", + "version": "0.5.0", "license": "Apache-2.0", "main": "es/index.js", "module": "es/index.js", @@ -49,7 +49,7 @@ "wca": "web-component-analyzer analyze src --outFile custom-elements.json" }, "dependencies": { - "@carbon/ibm-products-styles": "^2.52.0-rc.0", + "@carbon/ibm-products-styles": "^2.52.0", "@carbon/styles": "1.71.0", "@carbon/web-components": "2.19.0", "lit": "^3.1.0" diff --git a/packages/ibm-products/CHANGELOG.md b/packages/ibm-products/CHANGELOG.md index 30046bbfed..79e9407835 100644 --- a/packages/ibm-products/CHANGELOG.md +++ b/packages/ibm-products/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.56.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products@2.56.0-rc.0...@carbon/ibm-products@2.56.0) (2024-12-18) + +**Note:** Version bump only for package @carbon/ibm-products + + + + + # [2.56.0-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products@2.54.0-rc.0...@carbon/ibm-products@2.56.0-rc.0) (2024-12-09) diff --git a/packages/ibm-products/package.json b/packages/ibm-products/package.json index e7a3a1d6f9..f9c8ea92dd 100644 --- a/packages/ibm-products/package.json +++ b/packages/ibm-products/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products", "description": "Carbon for IBM Products", - "version": "2.56.0-rc.0", + "version": "2.56.0", "license": "Apache-2.0", "main": "lib/index.js", "module": "es/index.js", @@ -81,7 +81,7 @@ "fs-extra": "^11.2.0", "glob": "^10.3.10", "jest": "^29.7.0", - "jest-config-ibm-cloud-cognitive": "^1.15.0-rc.0", + "jest-config-ibm-cloud-cognitive": "^1.15.0", "jest-environment-jsdom": "^29.7.0", "namor": "^1.1.2", "npm-check-updates": "^17.1.11", @@ -96,7 +96,7 @@ "dependencies": { "@babel/runtime": "^7.23.9", "@carbon/feature-flags": "^0.24.0", - "@carbon/ibm-products-styles": "^2.52.0-rc.0", + "@carbon/ibm-products-styles": "^2.52.0", "@carbon/telemetry": "^0.1.0", "@dnd-kit/core": "^6.0.8", "@dnd-kit/modifiers": "^7.0.0", diff --git a/yarn.lock b/yarn.lock index cabf19cfae..3454dc89b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1681,7 +1681,7 @@ __metadata: resolution: "@carbon/ibm-cloud-cognitive-core@workspace:packages/core" dependencies: "@carbon/grid": "npm:^11.29.0" - "@carbon/ibm-products-styles": "npm:^2.52.0-rc.0" + "@carbon/ibm-products-styles": "npm:^2.52.0" "@carbon/layout": "npm:^11.28.0" "@carbon/motion": "npm:^11.24.0" "@carbon/react": "npm:^1.72.0" @@ -1722,7 +1722,7 @@ __metadata: languageName: unknown linkType: soft -"@carbon/ibm-products-styles@npm:^2.52.0-rc.0, @carbon/ibm-products-styles@workspace:packages/ibm-products-styles": +"@carbon/ibm-products-styles@npm:^2.52.0, @carbon/ibm-products-styles@workspace:packages/ibm-products-styles": version: 0.0.0-use.local resolution: "@carbon/ibm-products-styles@workspace:packages/ibm-products-styles" dependencies: @@ -1732,7 +1732,7 @@ __metadata: cross-env: "npm:^7.0.3" glob: "npm:^10.3.10" jest: "npm:^29.7.0" - jest-config-ibm-cloud-cognitive: "npm:^1.15.0-rc.0" + jest-config-ibm-cloud-cognitive: "npm:^1.15.0" jest-environment-jsdom: "npm:^29.7.0" npm-check-updates: "npm:^17.1.11" npm-run-all: "npm:^4.1.5" @@ -1752,7 +1752,7 @@ __metadata: version: 0.0.0-use.local resolution: "@carbon/ibm-products-web-components@workspace:packages/ibm-products-web-components" dependencies: - "@carbon/ibm-products-styles": "npm:^2.52.0-rc.0" + "@carbon/ibm-products-styles": "npm:^2.52.0" "@carbon/icons": "npm:^11.53.0" "@carbon/motion": "npm:^11.24.0" "@carbon/styles": "npm:1.71.0" @@ -1811,7 +1811,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.21.5" "@babel/runtime": "npm:^7.23.9" "@carbon/feature-flags": "npm:^0.24.0" - "@carbon/ibm-products-styles": "npm:^2.52.0-rc.0" + "@carbon/ibm-products-styles": "npm:^2.52.0" "@carbon/telemetry": "npm:^0.1.0" "@dnd-kit/core": "npm:^6.0.8" "@dnd-kit/modifiers": "npm:^7.0.0" @@ -1836,7 +1836,7 @@ __metadata: glob: "npm:^10.3.10" immutability-helper: "npm:^3.1.1" jest: "npm:^29.7.0" - jest-config-ibm-cloud-cognitive: "npm:^1.15.0-rc.0" + jest-config-ibm-cloud-cognitive: "npm:^1.15.0" jest-environment-jsdom: "npm:^29.7.0" lodash: "npm:^4.17.21" lottie-web: "npm:^5.12.2" @@ -5030,14 +5030,14 @@ __metadata: languageName: node linkType: hard -"@playwright/test@npm:^1.36.2": - version: 1.43.1 - resolution: "@playwright/test@npm:1.43.1" +"@playwright/test@npm:^1.49.1": + version: 1.49.1 + resolution: "@playwright/test@npm:1.49.1" dependencies: - playwright: "npm:1.43.1" + playwright: "npm:1.49.1" bin: playwright: cli.js - checksum: c49fc94af11472fc7fb781d084191c875aab8afb6cfcd4708168489c55ea4dbde702850e28b7ed05c0f775be8f8b5cac4bf2688a376b9a930d1f5cefdfc45382 + checksum: bb0d5eda58ee0b5bbca732d2aa57782fadf420d101e08e16d5760179459c667907bd8d224ee3d6f43f3088378e377ef63d32ed605fec37605debf217c3efe8da languageName: node linkType: hard @@ -13936,7 +13936,7 @@ __metadata: "@babel/preset-react": "npm:^7.17.12" "@commitlint/cli": "npm:^18.6.0" "@commitlint/config-conventional": "npm:^18.6.0" - "@playwright/test": "npm:^1.36.2" + "@playwright/test": "npm:^1.49.1" "@testing-library/dom": "npm:^8.11.4" "@testing-library/react": "npm:^14.0.0" "@testing-library/react-hooks": "npm:^8.0.1" @@ -14925,7 +14925,7 @@ __metadata: languageName: node linkType: hard -"jest-config-ibm-cloud-cognitive@npm:^1.15.0-rc.0, jest-config-ibm-cloud-cognitive@workspace:config/jest-config-ibm-cloud-cognitive": +"jest-config-ibm-cloud-cognitive@npm:^1.15.0, jest-config-ibm-cloud-cognitive@workspace:config/jest-config-ibm-cloud-cognitive": version: 0.0.0-use.local resolution: "jest-config-ibm-cloud-cognitive@workspace:config/jest-config-ibm-cloud-cognitive" dependencies: @@ -18686,27 +18686,27 @@ __metadata: languageName: node linkType: hard -"playwright-core@npm:1.43.1": - version: 1.43.1 - resolution: "playwright-core@npm:1.43.1" +"playwright-core@npm:1.49.1": + version: 1.49.1 + resolution: "playwright-core@npm:1.49.1" bin: playwright-core: cli.js - checksum: a4a3d9692a87c5a25d5efc99a4fad2b18e8ae4ac5182da932b3d12f932caf6f245e057f4575c769f219b2826abf017ec2ded7a2fa43afed7f62d294af7b359af + checksum: baa39a53024ec7744708410f2b952ac3aa2e1a6d311dabfa303523712848eba142fce5c20f1b2ed2a66fbd9a415d22ea8642b0f70423360aaebd4b41c47d364e languageName: node linkType: hard -"playwright@npm:1.43.1": - version: 1.43.1 - resolution: "playwright@npm:1.43.1" +"playwright@npm:1.49.1": + version: 1.49.1 + resolution: "playwright@npm:1.49.1" dependencies: fsevents: "npm:2.3.2" - playwright-core: "npm:1.43.1" + playwright-core: "npm:1.49.1" dependenciesMeta: fsevents: optional: true bin: playwright: cli.js - checksum: 0c8cf26df58e6fac2cbad77cc060451ca1bb96d4631ca07d83d382a0462a307f33fa47c1ec53fc2b1b78058cdd6e62c9b881a0bd91ddd956cc1e900d866d8af6 + checksum: 49fb063f4a107b8090f66d2d351ebd51fbb66843a8f95a161fa0c0e0b5156515961e75cc10f4249f61b9d2af51f762dda505c62b096d8f61cd47d1ff73ab39d2 languageName: node linkType: hard From 1a5e91511c946869d87f560ed02b6feb68aa3321 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:31:25 -0500 Subject: [PATCH 2/2] chore(release): v2.56.1-rc.0 (#6622) * chore(telemetry): update telemetry config * chore(release): publish [skip ci] - jest-config-ibm-cloud-cognitive@1.15.0-rc.0 - @carbon/storybook-addon-theme@2.5.0-rc.0 - @carbon/ibm-cloud-cognitive-core@2.32.0-rc.0 - @carbon/ibm-products@2.56.0-rc.0 - @carbon/ibm-products-styles@2.52.0-rc.0 - @carbon/ibm-products-web-components@0.5.0-rc.0 * chore(release): publish [skip ci] - jest-config-ibm-cloud-cognitive@1.15.0 - @carbon/storybook-addon-theme@2.5.0 - @carbon/ibm-cloud-cognitive-core@2.32.0 - @carbon/ibm-products@2.56.0 - @carbon/ibm-products-styles@2.52.0 - @carbon/ibm-products-web-components@0.5.0 * fix(EmptyState): added useId handling for older react version (#6620) * fix(EmptyState): added useId handling for older react version * fix(EmptyState): fixed imports for useId --------- Co-authored-by: Sean Anderson * chore(release): publish [skip ci] - @carbon/ibm-products@2.56.1-rc.0 --------- Co-authored-by: carbon-bot Co-authored-by: elysia Co-authored-by: Sean Anderson Co-authored-by: elysia --- packages/ibm-products/CHANGELOG.md | 11 ++++++++++ packages/ibm-products/package.json | 2 +- .../EmptyStates/assets/ErrorIllustration.js | 3 ++- .../EmptyStates/assets/NoDataIllustration.js | 3 ++- .../EmptyStates/assets/NoTagsIllustration.js | 3 ++- .../assets/NotFoundIllustration.js | 3 ++- .../assets/NotificationsIllustration.js | 3 ++- .../assets/UnauthorizedIllustration.js | 3 ++- .../ibm-products/src/global/js/utils/useId.js | 21 +++++++++++++++++++ 9 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 packages/ibm-products/src/global/js/utils/useId.js diff --git a/packages/ibm-products/CHANGELOG.md b/packages/ibm-products/CHANGELOG.md index 79e9407835..cad83a1d5b 100644 --- a/packages/ibm-products/CHANGELOG.md +++ b/packages/ibm-products/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.56.1-rc.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products@2.56.0...@carbon/ibm-products@2.56.1-rc.0) (2024-12-18) + + +### Bug Fixes + +* **EmptyState:** added useId handling for older react version ([#6620](https://github.com/carbon-design-system/ibm-products/issues/6620)) ([45af420](https://github.com/carbon-design-system/ibm-products/commit/45af4204487b79754b6ee9c950c23119e2684a99)) + + + + + # [2.56.0](https://github.com/carbon-design-system/ibm-products/compare/@carbon/ibm-products@2.56.0-rc.0...@carbon/ibm-products@2.56.0) (2024-12-18) **Note:** Version bump only for package @carbon/ibm-products diff --git a/packages/ibm-products/package.json b/packages/ibm-products/package.json index f9c8ea92dd..2ac50eeff2 100644 --- a/packages/ibm-products/package.json +++ b/packages/ibm-products/package.json @@ -1,7 +1,7 @@ { "name": "@carbon/ibm-products", "description": "Carbon for IBM Products", - "version": "2.56.0", + "version": "2.56.1-rc.0", "license": "Apache-2.0", "main": "lib/index.js", "module": "es/index.js", diff --git a/packages/ibm-products/src/components/EmptyStates/assets/ErrorIllustration.js b/packages/ibm-products/src/components/EmptyStates/assets/ErrorIllustration.js index ebe58b6587..099556deec 100644 --- a/packages/ibm-products/src/components/EmptyStates/assets/ErrorIllustration.js +++ b/packages/ibm-products/src/components/EmptyStates/assets/ErrorIllustration.js @@ -6,12 +6,13 @@ */ // Import portions of React that are needed. -import React, { useId } from 'react'; +import React from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../../settings'; +import { useId } from '../../../global/js/utils/useId'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--empty-state`; diff --git a/packages/ibm-products/src/components/EmptyStates/assets/NoDataIllustration.js b/packages/ibm-products/src/components/EmptyStates/assets/NoDataIllustration.js index fa736070b2..af6da233ab 100644 --- a/packages/ibm-products/src/components/EmptyStates/assets/NoDataIllustration.js +++ b/packages/ibm-products/src/components/EmptyStates/assets/NoDataIllustration.js @@ -6,12 +6,13 @@ */ // Import portions of React that are needed. -import React, { useId } from 'react'; +import React from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../../settings'; +import { useId } from '../../../global/js/utils/useId'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--empty-state`; diff --git a/packages/ibm-products/src/components/EmptyStates/assets/NoTagsIllustration.js b/packages/ibm-products/src/components/EmptyStates/assets/NoTagsIllustration.js index 65aede2eca..f88b77e2c2 100644 --- a/packages/ibm-products/src/components/EmptyStates/assets/NoTagsIllustration.js +++ b/packages/ibm-products/src/components/EmptyStates/assets/NoTagsIllustration.js @@ -6,12 +6,13 @@ */ // Import portions of React that are needed. -import React, { useId } from 'react'; +import React from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../../settings'; +import { useId } from '../../../global/js/utils/useId'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--empty-state`; diff --git a/packages/ibm-products/src/components/EmptyStates/assets/NotFoundIllustration.js b/packages/ibm-products/src/components/EmptyStates/assets/NotFoundIllustration.js index a12f64ef98..00b7106e56 100644 --- a/packages/ibm-products/src/components/EmptyStates/assets/NotFoundIllustration.js +++ b/packages/ibm-products/src/components/EmptyStates/assets/NotFoundIllustration.js @@ -6,12 +6,13 @@ */ // Import portions of React that are needed. -import React, { useId } from 'react'; +import React from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../../settings'; +import { useId } from '../../../global/js/utils/useId'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--empty-state`; diff --git a/packages/ibm-products/src/components/EmptyStates/assets/NotificationsIllustration.js b/packages/ibm-products/src/components/EmptyStates/assets/NotificationsIllustration.js index b7284f5cf4..a8f2c0b44a 100644 --- a/packages/ibm-products/src/components/EmptyStates/assets/NotificationsIllustration.js +++ b/packages/ibm-products/src/components/EmptyStates/assets/NotificationsIllustration.js @@ -6,12 +6,13 @@ */ // Import portions of React that are needed. -import React, { useId } from 'react'; +import React from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../../settings'; +import { useId } from '../../../global/js/utils/useId'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--empty-state`; diff --git a/packages/ibm-products/src/components/EmptyStates/assets/UnauthorizedIllustration.js b/packages/ibm-products/src/components/EmptyStates/assets/UnauthorizedIllustration.js index 67a3d407a2..ea8945180a 100644 --- a/packages/ibm-products/src/components/EmptyStates/assets/UnauthorizedIllustration.js +++ b/packages/ibm-products/src/components/EmptyStates/assets/UnauthorizedIllustration.js @@ -6,12 +6,13 @@ */ // Import portions of React that are needed. -import React, { useId } from 'react'; +import React from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../../settings'; +import { useId } from '../../../global/js/utils/useId'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--empty-state`; diff --git a/packages/ibm-products/src/global/js/utils/useId.js b/packages/ibm-products/src/global/js/utils/useId.js new file mode 100644 index 0000000000..5d60e9b7af --- /dev/null +++ b/packages/ibm-products/src/global/js/utils/useId.js @@ -0,0 +1,21 @@ +// +// Copyright IBM Corp. 2021, 2024 +// +// This source code is licensed under the Apache-2.0 license found in the +// LICENSE file in the root directory of this source tree. +// + +import React from 'react'; +import uuidv4 from './uuidv4'; + +// This tricks bundlers so they can't statically analyze this and produce +// compilation warnings/errors. +// https://github.com/webpack/webpack/issues/14814 +// https://github.com/mui/material-ui/issues/41190 +const _React = { ...React }; + +/** + * Uses React 18's built-in `useId()` when available, or falls back to + * using uuidv4 otherwise + */ +export const useId = _React.useId ? _React.useId : uuidv4;