Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(React): remove deprecated v11 props #11104

Merged
174 changes: 130 additions & 44 deletions packages/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

exports[`Public API should only change with a semver change 1`] = `
Array [
"active01",
"activeDanger",
"activeLightUI",
"activePrimary",
"activeSecondary",
"activeTertiary",
"activeUI",
"background",
"backgroundActive",
"backgroundBrand",
Expand All @@ -24,27 +31,42 @@ Array [
"blue70",
"blue80",
"blue90",
"body01",
"body02",
"bodyCompact01",
"bodyCompact02",
"bodyLong01",
"bodyLong02",
"bodyShort01",
"bodyShort02",
"borderDisabled",
"borderInteractive",
"borderInverse",
"borderStrong01",
"borderStrong02",
"borderStrong03",
"borderSubtle00",
"borderSubtle01",
"borderSubtle02",
"borderSubtle03",
"borderSubtleSelected01",
"borderSubtleSelected02",
"borderSubtleSelected03",
"borderStrong",
"borderSubtle",
"borderSubtleSelected",
"brand01",
"brand02",
"brand03",
"breakpoint",
"breakpointDown",
"breakpointUp",
"breakpoints",
"buttonDangerActive",
"buttonDangerHover",
"buttonDangerPrimary",
"buttonDangerSecondary",
"buttonDisabled",
"buttonPrimary",
"buttonPrimaryActive",
"buttonPrimaryHover",
"buttonSecondary",
"buttonSecondaryActive",
"buttonSecondaryHover",
"buttonSeparator",
"buttonTertiary",
"buttonTertiaryActive",
"buttonTertiaryHover",
"caption01",
"caption02",
"code01",
Expand Down Expand Up @@ -78,6 +100,13 @@ Array [
"cyan70",
"cyan80",
"cyan90",
"danger",
"danger01",
"danger02",
"decorative01",
"disabled01",
"disabled02",
"disabled03",
"display01",
"display02",
"display03",
Expand All @@ -93,13 +122,22 @@ Array [
"expressiveParagraph01",
"fast01",
"fast02",
"field",
"field01",
"field02",
"field03",
"fieldHover01",
"fieldHover02",
"fieldHover03",
"fieldHover",
"fluid",
"fluidDisplay01",
"fluidDisplay02",
"fluidDisplay03",
"fluidDisplay04",
"fluidHeading03",
"fluidHeading04",
"fluidHeading05",
"fluidHeading06",
"fluidParagraph01",
"fluidQuotation01",
"fluidQuotation02",
"fluidSpacing",
"fluidSpacing01",
"fluidSpacing02",
Expand All @@ -112,8 +150,10 @@ Array [
"fontFamily",
"fontWeight",
"fontWeights",
"formatTokenName",
"g10",
"g100",
"g80",
"g90",
"getTypeSize",
"gray",
Expand All @@ -140,9 +180,29 @@ Array [
"green90",
"heading01",
"heading02",
"heading03",
"heading04",
"heading05",
"heading06",
"heading07",
"headingCompact01",
"headingCompact02",
"helperText01",
"helperText02",
"highlight",
"hoverDanger",
"hoverField",
"hoverLightUI",
"hoverPrimary",
"hoverPrimaryText",
"hoverRow",
"hoverSecondary",
"hoverSelectedUI",
"hoverTertiary",
"hoverUI",
"icon01",
"icon02",
"icon03",
"iconDisabled",
"iconInverse",
"iconOnColor",
Expand All @@ -153,38 +213,44 @@ Array [
"iconSize01",
"iconSize02",
"interactive",
"interactive01",
"interactive02",
"interactive03",
"interactive04",
"inverse01",
"inverse02",
"inverseFocusUi",
"inverseHoverUI",
"inverseLink",
"inverseSupport01",
"inverseSupport02",
"inverseSupport03",
"inverseSupport04",
"label01",
"label02",
"layer01",
"layer02",
"layer03",
"layerAccent01",
"layerAccent02",
"layerAccent03",
"layerAccentActive01",
"layerAccentActive02",
"layerAccentActive03",
"layerAccentHover01",
"layerAccentHover02",
"layerAccentHover03",
"layerActive01",
"layerActive02",
"layerActive03",
"layerHover01",
"layerHover02",
"layerHover03",
"layerSelected01",
"layerSelected02",
"layerSelected03",
"layer",
"layerAccent",
"layerAccentActive",
"layerAccentHover",
"layerActive",
"layerHover",
"layerSelected",
"layerSelectedDisabled",
"layerSelectedHover01",
"layerSelectedHover02",
"layerSelectedHover03",
"layerSelectedHover",
"layerSelectedInverse",
"layout",
"layout01",
"layout02",
"layout03",
"layout04",
"layout05",
"layout06",
"layout07",
"legal01",
"legal02",
"link01",
"link02",
"linkInverse",
"linkInverseActive",
"linkInverseHover",
"linkPrimary",
"linkPrimaryHover",
"linkSecondary",
Expand All @@ -210,6 +276,7 @@ Array [
"orange60",
"orange70",
"overlay",
"overlay01",
"print",
"productiveHeading01",
"productiveHeading02",
Expand Down Expand Up @@ -247,13 +314,17 @@ Array [
"reset",
"rgba",
"scale",
"selectedLightUI",
"selectedUI",
"shadow",
"size2XLarge",
"sizeLarge",
"sizeMedium",
"sizeSmall",
"sizeXLarge",
"sizeXSmall",
"skeleton01",
"skeleton02",
"skeletonBackground",
"skeletonElement",
"slow01",
Expand All @@ -273,9 +344,10 @@ Array [
"spacing12",
"spacing13",
"styles",
"supportCautionMajor",
"supportCautionMinor",
"supportCautionUndefined",
"support01",
"support02",
"support03",
"support04",
"supportError",
"supportErrorInverse",
"supportInfo",
Expand All @@ -295,6 +367,11 @@ Array [
"teal70",
"teal80",
"teal90",
"text01",
"text02",
"text03",
"text04",
"text05",
"textDisabled",
"textError",
"textHelper",
Expand All @@ -306,8 +383,17 @@ Array [
"textSecondary",
"themes",
"toggleOff",
"tokens",
"ui01",
"ui02",
"ui03",
"ui04",
"ui05",
"uiBackground",
"unstable__meta",
"unstable_tokens",
"v10",
"v9",
"visitedLink",
"warmGray",
"warmGray10",
"warmGray100",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React from 'react';
import cx from 'classnames';
import { ChevronRight } from '@carbon/icons-react';
import SkeletonText from '../SkeletonText';
import deprecate from '../../prop-types/deprecate';
import { usePrefix } from '../../internal/usePrefix';

function AccordionSkeleton({ align, open, count, className, ...rest }) {
Expand Down Expand Up @@ -62,11 +61,6 @@ AccordionSkeleton.propTypes = {
* `false` to not display the first item opened
*/
open: PropTypes.bool,

/**
* Set unique identifier to generate unique item keys
*/
uid: deprecate(PropTypes.any),
};

AccordionSkeleton.defaultProps = {
Expand Down
26 changes: 1 addition & 25 deletions packages/react/src/components/Accordion/AccordionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ import React, { useState } from 'react';
import { Text } from '../Text';
import { match, keys } from '../../internal/keyboard';
import { useId } from '../../internal/useId';
import deprecate from '../../prop-types/deprecate';
import { usePrefix } from '../../internal/usePrefix';

const defaultRenderToggle = (props) => <button type="button" {...props} />;

function AccordionItem({
children,
className: customClassName,
iconDescription, // eslint-disable-line
open = false,
onHeadingClick,
renderExpando = defaultRenderToggle, // remove renderExpando in next major release
renderToggle,
title = 'title',
disabled,
Expand All @@ -42,7 +38,7 @@ function AccordionItem({
[customClassName]: !!customClassName,
});

const Toggle = renderToggle || renderExpando; // remove renderExpando in next major release
const Toggle = renderToggle;

if (open !== prevIsOpen) {
setAnimation(isOpen ? 'collapsing' : 'expanding');
Expand Down Expand Up @@ -115,17 +111,6 @@ AccordionItem.propTypes = {
*/
disabled: PropTypes.bool,

/**
* The description of the expand icon.
*/
iconDescription: deprecate(
PropTypes.string,
'The `iconDescription` prop has been deprecated as it is no longer ' +
'required. Feel free to remove this prop from <AccordionItem>. This ' +
'prop will be removed in the next major release of ' +
'`carbon-components-react`'
),

/**
* The handler of the massaged `click` event.
*/
Expand All @@ -141,15 +126,6 @@ AccordionItem.propTypes = {
*/
open: PropTypes.bool,

/**
* The callback function to render the expand button.
* Can be a React component class.
*/
renderExpando: deprecate(
dakahn marked this conversation as resolved.
Show resolved Hide resolved
PropTypes.func,
'The `renderExpando` prop has been deprecated and will be removed in the next major release of Carbon. Use the `renderToggle` prop instead.'
),

/**
* The callback function to render the expand button.
* Can be a React component class.
Expand Down
Loading