From f19f8bbab7b7ac67c2b3860444e24bc500e62080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kry=C5=A1p=C3=ADn?= Date: Mon, 26 Jun 2023 10:55:10 +0200 Subject: [PATCH] BREAKING CHANGE(web-react): Remove `size` prop from `Icon` in favor of `boxSize` #DS-647 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Migration Guide Instead of the `size` prop, use `boxSize` in `Icon` component. - `` → `` Please refer back to this guide or reach out to our team if you encounter any issues during migration. --- .../web-react/src/components/Icon/Icon.tsx | 26 +++---------------- .../web-react/src/components/Icon/README.md | 13 ++++------ packages/web-react/src/types/icon.ts | 2 -- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/packages/web-react/src/components/Icon/Icon.tsx b/packages/web-react/src/components/Icon/Icon.tsx index 8bd7194b63..bb793da3ae 100644 --- a/packages/web-react/src/components/Icon/Icon.tsx +++ b/packages/web-react/src/components/Icon/Icon.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useDeprecationMessage, useIcon, useStyleProps } from '../../hooks'; +import { useIcon, useStyleProps } from '../../hooks'; import { IconProps } from '../../types'; const defaultProps = { @@ -8,28 +8,10 @@ const defaultProps = { }; export const Icon = (props: IconProps): JSX.Element => { - const { - boxSize, - name, - title, - /** @deprecated Will be removed in the next major version. */ - size, - ariaHidden, - ...restProps - } = props; + const { boxSize, name, title, ariaHidden, ...restProps } = props; let icon = useIcon(name); const { styleProps, props: otherProps } = useStyleProps(restProps); - useDeprecationMessage({ - method: 'property', - trigger: !!size, - componentName: 'Icon', - propertyProps: { - deprecatedName: 'size', - newName: 'boxSize', - }, - }); - if (title) { icon = `${title}${icon}`; } @@ -40,8 +22,8 @@ export const Icon = (props: IconProps): JSX.Element => {