Skip to content

Commit

Permalink
chore(release): v2.56.1-rc.0 (#6622)
Browse files Browse the repository at this point in the history
* chore(telemetry): update telemetry config

* chore(release): publish [skip ci]

 - [email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]

* chore(release): publish [skip ci]

 - [email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]
 - @carbon/[email protected]

* 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 <[email protected]>

* chore(release): publish [skip ci]

 - @carbon/[email protected]

---------

Co-authored-by: carbon-bot <[email protected]>
Co-authored-by: elysia <[email protected]>
Co-authored-by: Sean Anderson <[email protected]>
Co-authored-by: elysia <[email protected]>
  • Loading branch information
5 people authored Dec 18, 2024
1 parent 09f917a commit 1a5e915
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 7 deletions.
11 changes: 11 additions & 0 deletions packages/ibm-products/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]...@carbon/[email protected]) (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/[email protected]...@carbon/[email protected]) (2024-12-18)

**Note:** Version bump only for package @carbon/ibm-products
Expand Down
2 changes: 1 addition & 1 deletion packages/ibm-products/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
21 changes: 21 additions & 0 deletions packages/ibm-products/src/global/js/utils/useId.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 1a5e915

Please sign in to comment.