From f6fc4976b49f7659eb170ba29e9cbee8add0d9d1 Mon Sep 17 00:00:00 2001 From: Pedro Duarte Date: Fri, 3 May 2019 01:05:05 +0100 Subject: [PATCH] Add missing props to Margin and Padding (#35158) --- types/styled-system/index.d.ts | 4 +-- types/styled-system/styled-system-tests.tsx | 30 ++++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index b8b13c7261..e14185d996 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -127,7 +127,7 @@ export interface SpaceProps { export const space: styleFn; -export interface MarginProps extends Pick {} +export interface MarginProps extends Pick {} export interface MarginTopProps extends Pick {} export interface MarginBottomProps extends Pick {} export interface MarginLeftProps extends Pick {} @@ -139,7 +139,7 @@ export const marginBottom: styleFn; export const marginLeft: styleFn; export const marginRight: styleFn; -export interface PaddingProps extends Pick {} +export interface PaddingProps extends Pick {} export interface PaddingTopProps extends Pick {} export interface PaddingBottomProps extends Pick {} export interface PaddingLeftProps extends Pick {} diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index 4d74adb952..b5ec71ae53 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -73,8 +73,8 @@ import { GridRowGapProps, GridRowProps, gridTemplateColumns, - gridTemplateRows, GridTemplateColumnsProps, + gridTemplateRows, GridTemplateRowsProps, height, HeightProps, @@ -90,6 +90,8 @@ import { LetterSpacingProps, lineHeight, LineHeightProps, + margin, + MarginProps, maxHeight, MaxHeightProps, maxWidth, @@ -98,6 +100,8 @@ import { MinHeightProps, minWidth, MinWidthProps, + padding, + PaddingProps, position, PositionProps, right, @@ -290,6 +294,15 @@ const TestButton: React.ComponentType = styled` ${styles.textColor} `; +interface SpacerProps + extends MarginProps, + PaddingProps {} + +const Spacer: React.ComponentType = styled` + ${margin}; + ${padding}; +`; + const test = () => (
// width: 50% @@ -546,6 +559,19 @@ const test = () => ( + + + + + + + + + + + + +
); @@ -678,10 +704,12 @@ export const justifySelfPropTypes = justifySelf.propTypes; export const leftPropTypes = left.propTypes; export const letterSpacingPropTypes = letterSpacing.propTypes; export const lineHeightPropTypes = lineHeight.propTypes; +export const marginPropTypes = margin.propTypes; export const maxHeightPropTypes = maxHeight.propTypes; export const maxWidthPropTypes = maxWidth.propTypes; export const minHeightPropTypes = minHeight.propTypes; export const minWidthPropTypes = minWidth.propTypes; +export const paddingPropTypes = padding.propTypes; export const positionPropTypes = position.propTypes; export const rightPropTypes = right.propTypes; export const sizePropTypes = size.propTypes;