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] 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;