diff --git a/.changeset/tasty-hornets-do.md b/.changeset/tasty-hornets-do.md new file mode 100644 index 00000000..eca28937 --- /dev/null +++ b/.changeset/tasty-hornets-do.md @@ -0,0 +1,5 @@ +--- +"@cambly/syntax-core": minor +--- + +Card: remove deprecated size prop diff --git a/packages/syntax-core/src/Card/Card.test.tsx b/packages/syntax-core/src/Card/Card.test.tsx index c482a595..3bab618f 100644 --- a/packages/syntax-core/src/Card/Card.test.tsx +++ b/packages/syntax-core/src/Card/Card.test.tsx @@ -16,36 +16,6 @@ describe("card", () => { expect(screen.getByText(/text/)).toBeInTheDocument(); }); - it("should have the right width for sm", () => { - render( - - <> -

title

-

text

- -
, - ); - expect(screen.getByTestId("card-sm")).toHaveStyle({ - width: "100%", - maxWidth: "352px", - }); - }); - - it("should have the right width for lg", () => { - render( - - <> -

title

-

text

- -
, - ); - expect(screen.getByTestId("card-lg")).toHaveStyle({ - width: "100%", - maxWidth: "744px", - }); - }); - it("should stretch to the width of the container", () => { render( diff --git a/packages/syntax-core/src/Card/Card.tsx b/packages/syntax-core/src/Card/Card.tsx index 3ec19aee..e0ed1dee 100644 --- a/packages/syntax-core/src/Card/Card.tsx +++ b/packages/syntax-core/src/Card/Card.tsx @@ -1,8 +1,6 @@ import Box from "../Box/Box"; import type allColors from "../colors/allColors"; -const DeprecatedCardSizes = ["sm", "lg"] as const; - type CardType = { /** * Test id for the button @@ -17,16 +15,6 @@ type CardType = { * The child components to render within Card. */ children: JSX.Element; - /** - * The size of the card - * - * `sm`: 352px - * `lg`: 744px - * - * @deprecated Card width should be controlled by the parent container - * @defaultValue `undefined` - */ - size?: (typeof DeprecatedCardSizes)[number]; }; /** @@ -35,21 +23,14 @@ type CardType = { export default function Card({ backgroundColor = "white", children, - size, "data-testid": dataTestId, }: CardType): JSX.Element { - const sizeWidth = { - sm: 352, - lg: 744, - } as const; - return (