From ee127a16066e4deb08fd39765f44238e3653ddd3 Mon Sep 17 00:00:00 2001 From: Kamal Bennani Date: Tue, 15 Mar 2022 23:35:38 +0100 Subject: [PATCH 1/6] impr(borders): add typings for the borders namespace --- packages/system/src/styles/borders.ts | 43 ++++++++++++++++++--------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/packages/system/src/styles/borders.ts b/packages/system/src/styles/borders.ts index 076a8006..c7ef1df2 100644 --- a/packages/system/src/styles/borders.ts +++ b/packages/system/src/styles/borders.ts @@ -49,7 +49,7 @@ export const getBorderStyle = themeGetter({ // Border export interface BorderProps { - border?: SystemProp | CSS.Property.Border, T> + border?: SystemProp | number | CSS.Property.Border, T> } export const border = style({ prop: 'border', @@ -57,7 +57,7 @@ export const border = style({ }) export interface BorderTopProps { - borderTop?: SystemProp | CSS.Property.BorderTop, T> + borderTop?: SystemProp | number | CSS.Property.BorderTop, T> } export const borderTop = style({ prop: 'borderTop', @@ -65,7 +65,10 @@ export const borderTop = style({ }) export interface BorderRightProps { - borderRight?: SystemProp | CSS.Property.BorderRight, T> + borderRight?: SystemProp< + ThemeBorder | number | CSS.Property.BorderRight, + T + > } export const borderRight = style({ prop: 'borderRight', @@ -73,7 +76,10 @@ export const borderRight = style({ }) export interface BorderBottomProps { - borderBottom?: SystemProp | CSS.Property.BorderBottom, T> + borderBottom?: SystemProp< + ThemeBorder | number | CSS.Property.BorderBottom, + T + > } export const borderBottom = style({ prop: 'borderBottom', @@ -81,7 +87,7 @@ export const borderBottom = style({ }) export interface BorderLeftProps { - borderLeft?: SystemProp | CSS.Property.BorderLeft, T> + borderLeft?: SystemProp | number | CSS.Property.BorderLeft, T> } export const borderLeft = style({ prop: 'borderLeft', @@ -135,7 +141,10 @@ export const borderLeftColor = style({ }) export interface BorderWidthProps { - borderWidth?: SystemProp | CSS.Property.BorderWidth, T> + borderWidth?: SystemProp< + ThemeBorderWidth | number | CSS.Property.BorderWidth, + T + > } export const borderWidth = style({ prop: 'borderWidth', @@ -144,7 +153,7 @@ export const borderWidth = style({ export interface BorderTopWidthProps { borderTopWidth?: SystemProp< - ThemeBorderWidth | CSS.Property.BorderTopWidth, + ThemeBorderWidth | number | CSS.Property.BorderTopWidth, T > } @@ -155,7 +164,7 @@ export const borderTopWidth = style({ export interface BorderRightWidthProps { borderRightWidth?: SystemProp< - ThemeBorderWidth | CSS.Property.BorderRightWidth, + ThemeBorderWidth | number | CSS.Property.BorderRightWidth, T > } @@ -166,7 +175,7 @@ export const borderRightWidth = style({ export interface BorderBottomWidthProps { borderBottomWidth?: SystemProp< - ThemeBorderWidth | CSS.Property.BorderBottomWidth, + ThemeBorderWidth | number | CSS.Property.BorderBottomWidth, T > } @@ -177,7 +186,7 @@ export const borderBottomWidth = style({ export interface BorderLeftWidthProps { borderLeftWidth?: SystemProp< - ThemeBorderWidth | CSS.Property.BorderLeftWidth, + ThemeBorderWidth | number | CSS.Property.BorderLeftWidth, T > } @@ -248,7 +257,7 @@ export const borderLeftStyle = style({ // Outline export interface OutlineProps { - outline?: SystemProp | CSS.Property.Outline, T> + outline?: SystemProp | number | CSS.Property.Outline, T> } export const outline = style({ prop: 'outline', @@ -264,7 +273,10 @@ export const outlineColor = style({ }) export interface OutlineWidthProps { - outlineWidth?: SystemProp | CSS.Property.OutlineWidth, T> + outlineWidth?: SystemProp< + ThemeBorderWidth | number | CSS.Property.OutlineWidth, + T + > } export const outlineWidth = style({ prop: 'outlineWidth', @@ -293,7 +305,10 @@ export const getRadius = themeGetter({ }) export interface BorderRadiusProps { - borderRadius?: SystemProp | CSS.Property.BorderRadius, T> + borderRadius?: SystemProp< + ThemeRadius | number | CSS.Property.BorderRadius, + T + > } export const borderRadius = style({ prop: 'borderRadius', @@ -408,7 +423,7 @@ export const getRingWidth = themeGetter({ }) export interface RingProps { - ring?: SystemProp, T> + ring?: SystemProp | number, T> } export const ring = style({ prop: 'ring', From af065e2bb4fc4c0851ea38b9ee6cea4d9facf6b8 Mon Sep 17 00:00:00 2001 From: Kamal Bennani Date: Tue, 15 Mar 2022 23:35:54 +0100 Subject: [PATCH 2/6] impr(flexboxes): add typings for the flexboxes namespace --- packages/system/src/styles/flexboxes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/system/src/styles/flexboxes.ts b/packages/system/src/styles/flexboxes.ts index 2e80ecae..9c55028f 100644 --- a/packages/system/src/styles/flexboxes.ts +++ b/packages/system/src/styles/flexboxes.ts @@ -54,7 +54,7 @@ export const flexShrink = style({ }) export interface FlexBasisProps { - flexBasis?: SystemProp + flexBasis?: SystemProp } export const flexBasis = style({ prop: 'flexBasis', From 8b21457f6a56889e1238f629b9b5c67445303aeb Mon Sep 17 00:00:00 2001 From: Kamal Bennani Date: Tue, 15 Mar 2022 23:36:17 +0100 Subject: [PATCH 3/6] impr(layout): add typings for the layout namespace --- packages/system/src/styles/layout.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/system/src/styles/layout.ts b/packages/system/src/styles/layout.ts index 1302a2fb..ccca9e6b 100644 --- a/packages/system/src/styles/layout.ts +++ b/packages/system/src/styles/layout.ts @@ -112,7 +112,7 @@ export const getInset = themeGetter({ }) export interface TopProps { - top?: SystemProp | CSS.Property.Top, T> + top?: SystemProp | number | CSS.Property.Top, T> } export const top = style({ prop: 'top', @@ -120,7 +120,7 @@ export const top = style({ }) export interface RightProps { - right?: SystemProp | CSS.Property.Right, T> + right?: SystemProp | number | CSS.Property.Right, T> } export const right = style({ prop: 'right', @@ -128,7 +128,7 @@ export const right = style({ }) export interface BottomProps { - bottom?: SystemProp | CSS.Property.Bottom, T> + bottom?: SystemProp | number | CSS.Property.Bottom, T> } export const bottom = style({ prop: 'bottom', @@ -136,7 +136,7 @@ export const bottom = style({ }) export interface LeftProps { - left?: SystemProp | CSS.Property.Left, T> + left?: SystemProp | number | CSS.Property.Left, T> } export const left = style({ prop: 'left', From c654c7b9f8fa3714866183d0540cff2ba869d608 Mon Sep 17 00:00:00 2001 From: Kamal Bennani Date: Tue, 15 Mar 2022 23:36:31 +0100 Subject: [PATCH 4/6] impr(sizing): add typings for the sizing namespace --- packages/system/src/styles/sizing.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/system/src/styles/sizing.ts b/packages/system/src/styles/sizing.ts index 50059921..5e06bf1c 100644 --- a/packages/system/src/styles/sizing.ts +++ b/packages/system/src/styles/sizing.ts @@ -18,7 +18,7 @@ export const getSize = themeGetter({ // Styles export interface WidthProps { - w?: SystemProp | CSS.Property.Width, T> + w?: SystemProp | number | CSS.Property.Width, T> } export const width = style({ prop: 'w', @@ -27,7 +27,7 @@ export const width = style({ }) export interface HeightProps { - h?: SystemProp | CSS.Property.Height, T> + h?: SystemProp | number | CSS.Property.Height, T> } export const height = style({ prop: 'h', @@ -36,7 +36,7 @@ export const height = style({ }) type MaxWidthProp = SystemProp< - ThemeSize | CSS.Property.MaxWidth, + ThemeSize | number | CSS.Property.MaxWidth, T > export interface MaxWidthProps { @@ -50,7 +50,7 @@ export const maxWidth = style({ }) type MaxHeightProp = SystemProp< - ThemeSize | CSS.Property.MaxHeight, + ThemeSize | number | CSS.Property.MaxHeight, T > export interface MaxHeightProps { @@ -64,7 +64,7 @@ export const maxHeight = style({ }) export interface MinWidthProps { - minWidth?: SystemProp | CSS.Property.MinWidth, T> + minWidth?: SystemProp | number | CSS.Property.MinWidth, T> } export const minWidth = style({ prop: ['minWidth', 'minW'], @@ -73,7 +73,7 @@ export const minWidth = style({ }) type MinHeightProp = SystemProp< - ThemeSize | CSS.Property.MinHeight, + ThemeSize | number | CSS.Property.MinHeight, T > export interface MinHeightProps { @@ -87,7 +87,7 @@ export const minHeight = style({ }) export interface MaskSizeProps { - maskSize?: SystemProp | CSS.Property.MaskSize, T> + maskSize?: SystemProp | number | CSS.Property.MaskSize, T> } export const maskSize = style({ prop: 'maskSize', From d2d51f9138a786faf138e02d3c1df9642b3244ca Mon Sep 17 00:00:00 2001 From: Kamal Bennani Date: Tue, 15 Mar 2022 23:36:44 +0100 Subject: [PATCH 5/6] impr(space): add typings for the space namespace --- packages/system/src/styles/space.ts | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/packages/system/src/styles/space.ts b/packages/system/src/styles/space.ts index 31e8c677..0781fb9b 100644 --- a/packages/system/src/styles/space.ts +++ b/packages/system/src/styles/space.ts @@ -19,7 +19,7 @@ export const getSpace = themeGetter({ // Margin type MarginProp = SystemProp< - ThemeSpace | CSS.Property.Margin, + ThemeSpace | number | CSS.Property.Margin, T > export interface MarginProps { @@ -33,7 +33,7 @@ export const margin = style({ }) type MarginTopProp = SystemProp< - ThemeSpace | CSS.Property.MarginTop, + ThemeSpace | number | CSS.Property.MarginTop, T > export interface MarginTopProps { @@ -47,7 +47,7 @@ export const marginTop = style({ }) type MarginRightProp = SystemProp< - ThemeSpace | CSS.Property.MarginRight, + ThemeSpace | number | CSS.Property.MarginRight, T > export interface MarginRightProps { @@ -61,7 +61,7 @@ export const marginRight = style({ }) type MarginBottomProp = SystemProp< - ThemeSpace | CSS.Property.MarginBottom, + ThemeSpace | number | CSS.Property.MarginBottom, T > export interface MarginBottomProps { @@ -75,7 +75,7 @@ export const marginBottom = style({ }) type MarginLeftProp = SystemProp< - ThemeSpace | CSS.Property.MarginLeft, + ThemeSpace | number | CSS.Property.MarginLeft, T > export interface MarginLeftProps { @@ -90,7 +90,9 @@ export const marginLeft = style({ export interface MarginXProps { mx?: SystemProp< - ThemeSpace | (CSS.Property.MarginLeft & CSS.Property.MarginRight), + | ThemeSpace + | number + | (CSS.Property.MarginLeft & CSS.Property.MarginRight), T > } @@ -102,7 +104,9 @@ export const mx = style({ export interface MarginYProps { my?: SystemProp< - ThemeSpace | (CSS.Property.MarginTop & CSS.Property.MarginBottom), + | ThemeSpace + | number + | (CSS.Property.MarginTop & CSS.Property.MarginBottom), T > } @@ -115,7 +119,7 @@ export const my = style({ // Padding type PaddingProp = SystemProp< - ThemeSpace | CSS.Property.Padding, + ThemeSpace | number | CSS.Property.Padding, T > export interface PaddingProps { @@ -129,7 +133,7 @@ export const padding = style({ }) type PaddingTopProp = SystemProp< - ThemeSpace | CSS.Property.PaddingTop, + ThemeSpace | number | CSS.Property.PaddingTop, T > export interface PaddingTopProps { @@ -143,7 +147,7 @@ export const paddingTop = style({ }) type PaddingRightProp = SystemProp< - ThemeSpace | CSS.Property.PaddingRight, + ThemeSpace | number | CSS.Property.PaddingRight, T > export interface PaddingRightProps { @@ -157,7 +161,7 @@ export const paddingRight = style({ }) type PaddingBottomProp = SystemProp< - ThemeSpace | CSS.Property.PaddingBottom, + ThemeSpace | number | CSS.Property.PaddingBottom, T > export interface PaddingBottomProps { @@ -171,7 +175,7 @@ export const paddingBottom = style({ }) type PaddingLeftProp = SystemProp< - ThemeSpace | CSS.Property.PaddingLeft, + ThemeSpace | number | CSS.Property.PaddingLeft, T > export interface PaddingLeftProps { @@ -186,7 +190,9 @@ export const paddingLeft = style({ export interface PaddingXProps { px?: SystemProp< - ThemeSpace | (CSS.Property.PaddingLeft & CSS.Property.PaddingRight), + | ThemeSpace + | number + | (CSS.Property.PaddingLeft & CSS.Property.PaddingRight), T > } @@ -198,7 +204,9 @@ export const px = style({ export interface PaddingYProps { py?: SystemProp< - ThemeSpace | (CSS.Property.PaddingTop & CSS.Property.PaddingBottom), + | ThemeSpace + | number + | (CSS.Property.PaddingTop & CSS.Property.PaddingBottom), T > } From 8deae1b3b97c9c54daef787f3aabbfb086b08598 Mon Sep 17 00:00:00 2001 From: Kamal Bennani Date: Tue, 15 Mar 2022 23:37:05 +0100 Subject: [PATCH 6/6] impr(typography): add typings for the typography namespace --- packages/system/src/styles/typography.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/system/src/styles/typography.ts b/packages/system/src/styles/typography.ts index 93f0a907..03aabed9 100644 --- a/packages/system/src/styles/typography.ts +++ b/packages/system/src/styles/typography.ts @@ -66,7 +66,7 @@ export const fontFamily = style({ }) export interface FontSizeProps { - fontSize?: SystemProp | CSS.Property.FontSize, T> + fontSize?: SystemProp | number | CSS.Property.FontSize, T> } export const fontSize = style({ prop: 'fontSize', @@ -98,7 +98,7 @@ export const fontStyle = style({ export interface LetterSpacingProps { letterSpacing?: SystemProp< - ThemeLetterSpacing | CSS.Property.LetterSpacing, + ThemeLetterSpacing | number | CSS.Property.LetterSpacing, T > }