Skip to content

Commit

Permalink
Revert adding a new value of none (or minimal) to the allowed val…
Browse files Browse the repository at this point in the history
…ues for the `size` prop
  • Loading branch information
ciampo committed Jun 16, 2021
1 parent 0032632 commit 7695b97
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 14 deletions.
1 change: 0 additions & 1 deletion packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/card/card-body/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
2 changes: 1 addition & 1 deletion packages/components/src/card/card-footer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
2 changes: 1 addition & 1 deletion packages/components/src/card/card-header/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
2 changes: 1 addition & 1 deletion packages/components/src/card/card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion packages/components/src/card/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const cardPaddings = {
xSmall: css`
padding: ${ CONFIG.cardPaddingXSmall };
`,
minimal: '',
};

export const shady = css`
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/card/test/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ Snapshot Diff:
>
<div
- class="components-flex components-card__header components-card-header css-z1wxd8-Flex-ItemsRow-Header-borderRadius-borderColor-medium css-1mm2cvy-View em57xhy0"
+ class="components-flex components-card__header components-card-header css-15dwmv7-Flex-ItemsRow-Header-borderRadius-borderColor css-1mm2cvy-View em57xhy0"
+ class="components-flex components-card__header components-card-header css-xx0c0v-Flex-ItemsRow-Header-borderRadius-borderColor-large css-1mm2cvy-View em57xhy0"
data-wp-c16t="true"
data-wp-component="CardHeader"
>
Header
</div>
<div
- class="components-scrollable components-card__body components-card-body css-1s8bpb2-Scrollable-scrollableScrollbar-scrollY-Body-borderRadius-medium css-1mm2cvy-View em57xhy0"
+ class="components-scrollable components-card__body components-card-body css-1h3akp0-Scrollable-scrollableScrollbar-scrollY-Body-borderRadius css-1mm2cvy-View em57xhy0"
+ class="components-scrollable components-card__body components-card-body css-ocisz3-Scrollable-scrollableScrollbar-scrollY-Body-borderRadius-large css-1mm2cvy-View em57xhy0"
data-wp-c16t="true"
data-wp-component="CardBody"
>
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/card/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<Card>
<CardHeader>Header</CardHeader>
<CardBody>Code is Poetry</CardBody>
</Card>
);
const { container: withSizeMinimal } = render(
<Card size="minimal">
const { container: withSizeLarge } = render(
<Card size="large">
<CardHeader>Header</CardHeader>
<CardBody>Code is Poetry</CardBody>
</Card>
);

expect( withSize.firstChild ).toMatchDiffSnapshot(
withSizeMinimal.firstChild
expect( withSizeDefault.firstChild ).toMatchDiffSnapshot(
withSizeLarge.firstChild
);
} );

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/card/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
/**
Expand Down

0 comments on commit 7695b97

Please sign in to comment.