From 7695b972c49ef96d5c66f5cc952810ed2997a953 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Wed, 16 Jun 2021 12:31:46 +0200 Subject: [PATCH] Revert adding a new value of `none` (or `minimal`) to the allowed values for the `size` prop --- packages/components/CHANGELOG.md | 1 - packages/components/src/card/card-body/README.md | 2 +- packages/components/src/card/card-footer/README.md | 2 +- packages/components/src/card/card-header/README.md | 2 +- packages/components/src/card/card/README.md | 2 +- packages/components/src/card/styles.js | 1 - .../src/card/test/__snapshots__/index.js.snap | 4 ++-- packages/components/src/card/test/index.js | 10 +++++----- packages/components/src/card/types.ts | 2 +- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 0f8e935030fb19..85e0a4aff77db5 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -4,7 +4,6 @@ ### New Feature -- Add `minimal` as one of the possible values for the `size` prop in `Card`, `CardBody`, `CardHeader`, and `CardFooter` ([#32566](https://github.com/WordPress/gutenberg/pull/32566)). - Update the border color used in `CardBody`, `CardHeader`, `CardFooter`, and `CardDivider` to a different shade of gray, in order to match the color used in other components ([#32566](https://github.com/WordPress/gutenberg/pull/32566)). ### Deprecation diff --git a/packages/components/src/card/card-body/README.md b/packages/components/src/card/card-body/README.md index fb207456b38553..014720bcc52c03 100644 --- a/packages/components/src/card/card-body/README.md +++ b/packages/components/src/card/card-body/README.md @@ -38,4 +38,4 @@ Determines the amount of padding within the component. - Required: No - Default: `medium` -- Allowed values: `minimal`, `xSmall`, `small`, `medium`, `large` +- Allowed values: `xSmall`, `small`, `medium`, `large` diff --git a/packages/components/src/card/card-footer/README.md b/packages/components/src/card/card-footer/README.md index 9b41de816fbed2..e7f15d846b4fbd 100644 --- a/packages/components/src/card/card-footer/README.md +++ b/packages/components/src/card/card-footer/README.md @@ -71,4 +71,4 @@ Determines the amount of padding within the component. - Required: No - Default: `medium` -- Allowed values: `minimal`, `xSmall`, `small`, `medium`, `large` +- Allowed values: `xSmall`, `small`, `medium`, `large` diff --git a/packages/components/src/card/card-header/README.md b/packages/components/src/card/card-header/README.md index 8074972a26aed3..87f2f6178a9c82 100644 --- a/packages/components/src/card/card-header/README.md +++ b/packages/components/src/card/card-header/README.md @@ -39,4 +39,4 @@ Determines the amount of padding within the component. - Required: No - Default: `medium` -- Allowed values: `minimal`, `xSmall`, `small`, `medium`, `large` +- Allowed values: `xSmall`, `small`, `medium`, `large` diff --git a/packages/components/src/card/card/README.md b/packages/components/src/card/card/README.md index 7ee743cdd3cb24..8b9f507464150b 100644 --- a/packages/components/src/card/card/README.md +++ b/packages/components/src/card/card/README.md @@ -62,7 +62,7 @@ Determines the amount of padding within the component. - Required: No - Default: `medium` -- Allowed values: `minimal`, `xSmall`, `small`, `medium`, `large` +- Allowed values: `xSmall`, `small`, `medium`, `large` ### Inherited props diff --git a/packages/components/src/card/styles.js b/packages/components/src/card/styles.js index 0b23e0008a7425..823d7e16fce8bf 100644 --- a/packages/components/src/card/styles.js +++ b/packages/components/src/card/styles.js @@ -98,7 +98,6 @@ export const cardPaddings = { xSmall: css` padding: ${ CONFIG.cardPaddingXSmall }; `, - minimal: '', }; export const shady = css` diff --git a/packages/components/src/card/test/__snapshots__/index.js.snap b/packages/components/src/card/test/__snapshots__/index.js.snap index 2439e177baeb7a..7e4b4968dc9db2 100644 --- a/packages/components/src/card/test/__snapshots__/index.js.snap +++ b/packages/components/src/card/test/__snapshots__/index.js.snap @@ -97,7 +97,7 @@ Snapshot Diff: >
@@ -105,7 +105,7 @@ Snapshot Diff:
diff --git a/packages/components/src/card/test/index.js b/packages/components/src/card/test/index.js index 0f6d70834b7145..170e758ae2f49e 100644 --- a/packages/components/src/card/test/index.js +++ b/packages/components/src/card/test/index.js @@ -75,21 +75,21 @@ describe( 'Card', () => { it( 'should add different amounts of white space when using the size prop', () => { // The `size` prop has a default value of "medium" - const { container: withSize } = render( + const { container: withSizeDefault } = render( Header Code is Poetry ); - const { container: withSizeMinimal } = render( - + const { container: withSizeLarge } = render( + Header Code is Poetry ); - expect( withSize.firstChild ).toMatchDiffSnapshot( - withSizeMinimal.firstChild + expect( withSizeDefault.firstChild ).toMatchDiffSnapshot( + withSizeLarge.firstChild ); } ); diff --git a/packages/components/src/card/types.ts b/packages/components/src/card/types.ts index 433e66f50a8712..eed2958c90d07c 100644 --- a/packages/components/src/card/types.ts +++ b/packages/components/src/card/types.ts @@ -9,7 +9,7 @@ import type { CSSProperties } from 'react'; */ import type { Props as SurfaceProps } from '../surface/types'; -export type SizeOptions = 'xSmall' | 'small' | 'medium' | 'large' | 'minimal'; +export type SizeOptions = 'xSmall' | 'small' | 'medium' | 'large'; type SizeableProps = { /**