Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kind-oranges-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed deprecation warning on Card
3 changes: 1 addition & 2 deletions polaris-react/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export type {
CardSubsectionProps,
} from './components';

/** @deprecated Use LegacyCard or AlphaCard instead. */
export interface CardProps {
/** Title content for the card */
title?: React.ReactNode;
Expand Down Expand Up @@ -48,7 +47,7 @@ export interface CardProps {
// subcomponents so explicitly state the subcomponents in the type definition.
// Letting this be implicit works in this project but fails in projects that use
// generated *.d.ts files.

/** @deprecated Use AlphaCard instead. */
export const Card: React.FunctionComponent<CardProps> & {
// eslint-disable-next-line import/no-deprecated
Header: typeof Header;
Expand Down
3 changes: 3 additions & 0 deletions polaris-react/src/components/Card/tests/Card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Button} from '../../Button';
import {Popover} from '../../Popover';
import {ActionList} from '../../ActionList';
import {WithinContentContext} from '../../../utilities/within-content-context';
// eslint-disable-next-line import/no-deprecated
import {Card} from '../Card';
// eslint-disable-next-line import/no-deprecated
import {Section} from '../components';
Expand Down Expand Up @@ -61,6 +62,7 @@ describe('<Card />', () => {
<Card.Header />
</Card>,
);
// eslint-disable-next-line import/no-deprecated
expect(card).toContainReactComponent(Card.Header);
});

Expand All @@ -72,6 +74,7 @@ describe('<Card />', () => {
);

expect(card).toContainReactComponent(Button);
// eslint-disable-next-line import/no-deprecated
expect(card).toContainReactComponent(Card.Header);
});

Expand Down