From eaa315d854afff131e3a1147ca76d97acc67eb24 Mon Sep 17 00:00:00 2001 From: Joe Krill Date: Wed, 25 Sep 2019 04:45:36 -0400 Subject: [PATCH] styled-system: LayoutProps extends OverflowProps (#38553) * styled-system: LayoutProps extends OverflowProps As is clear from the actual layout implementation: https://github.com/styled-system/styled-system/blob/15a4233c085ff14c77ba61508e4737a2ec641081/packages/layout/src/index.js * Ensure correct spacing * Remove unused imports and superfluous overflow --- types/styled-system/index.d.ts | 5 +++-- types/styled-system/styled-system-tests.tsx | 20 +++++--------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index b0dc2029be..e4c91f56c5 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -46,7 +46,7 @@ export interface LowLevelStyleFunctionArguments { export function style( // tslint:disable-next-line no-unnecessary-generics - args: LowLevelStyleFunctionArguments + args: LowLevelStyleFunctionArguments, ): { [cssProp: string]: string; }; @@ -848,7 +848,8 @@ export interface LayoutProps MaxHeightProps, DisplayProps, VerticalAlignProps, - SizeProps {} + SizeProps, + OverflowProps {} export const layout: styleFn; diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index 3d65962b58..3579a1ca1a 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -38,8 +38,6 @@ import { GridProps, shadow, ShadowProps, - overflow, - OverflowProps, } from 'styled-system'; // tslint:disable-next-line:strict-export-declare-modifiers @@ -61,8 +59,7 @@ interface BoxProps ShadowProps, TypographyProps, ColorStyleProps, - ColorProps, - OverflowProps { + ColorProps { boxStyle?: string; } @@ -81,7 +78,6 @@ const boxStyles = compose( shadow, colorStyle, boxStyle, - overflow, ); const Box: React.ComponentType = styled(boxStyles); @@ -99,7 +95,7 @@ interface ButtonProps extends SpaceProps, ButtonStyleProps, ColorProps {} const testButtonStyles = compose( buttonStyle, space, - styles.textColor + styles.textColor, ); const TestButton: React.ComponentType = styled(testButtonStyles); @@ -108,8 +104,8 @@ interface SpacerProps extends MarginProps, PaddingProps {} const Spacer: React.ComponentType = styled( compose( margin, - padding - ) + padding, + ), ); const test = () => ( @@ -328,12 +324,11 @@ const test = () => ( - - + @@ -344,27 +339,22 @@ const test = () => ( - - - - - // position (responsive)