From ad9b36f61da2d9d1ac101ebe8b71660aebdd0293 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Mon, 27 Jan 2025 16:01:33 +0000 Subject: [PATCH] Update types.ts Signed-off-by: Charles de Dreuille --- packages/canon/src/types.ts | 76 ++++++++++++++----------------------- 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/packages/canon/src/types.ts b/packages/canon/src/types.ts index ee5d954576..3a6b55f13b 100644 --- a/packages/canon/src/types.ts +++ b/packages/canon/src/types.ts @@ -37,27 +37,7 @@ export type AsProps = export type Breakpoint = 'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** @public */ -export type Responsive = T | Partial>; - -/** @public */ -export type Space = - | '0.5' - | '1' - | '1.5' - | '2' - | '3' - | '4' - | '5' - | '6' - | '7' - | '8' - | '9' - | '10' - | '11' - | '12' - | '13' - | '14' - | string; +export type Space = 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; /** @public */ export type Display = 'none' | 'flex' | 'block' | 'inline'; @@ -99,35 +79,35 @@ export type Columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'auto'; /** @public */ export interface SpaceProps { - m?: Responsive; - mb?: Responsive; - ml?: Responsive; - mr?: Responsive; - mt?: Responsive; - mx?: Responsive; - my?: Responsive; - p?: Responsive; - pb?: Responsive; - pl?: Responsive; - pr?: Responsive; - pt?: Responsive; - px?: Responsive; - py?: Responsive; + margin?: Space | Partial>; + marginBottom?: Space | Partial>; + marginLeft?: Space | Partial>; + marginRight?: Space | Partial>; + marginTop?: Space | Partial>; + marginX?: Space | Partial>; + marginY?: Space | Partial>; + padding?: Space | Partial>; + paddingBottom?: Space | Partial>; + paddingLeft?: Space | Partial>; + paddingRight?: Space | Partial>; + paddingTop?: Space | Partial>; + paddingX?: Space | Partial>; + paddingY?: Space | Partial>; } /** @public */ export interface UtilityProps extends SpaceProps { - alignItems?: Responsive; - border?: Responsive; - borderRadius?: Responsive; - colEnd?: Responsive; - colSpan?: Responsive; - colStart?: Responsive; - columns?: Responsive; - display?: Responsive; - flexDirection?: Responsive; - flexWrap?: Responsive; - gap?: Responsive; - justifyContent?: Responsive; - rowSpan?: Responsive; + alignItems?: AlignItems | Partial>; + border?: Border | Partial>; + borderRadius?: BorderRadius | Partial>; + colEnd?: Columns | 'auto' | Partial>; + colSpan?: Columns | 'full' | Partial>; + colStart?: Columns | 'auto' | Partial>; + columns?: Columns | Partial>; + display?: Display | Partial>; + flexDirection?: FlexDirection | Partial>; + flexWrap?: FlexWrap | Partial>; + gap?: Space | Partial>; + justifyContent?: JustifyContent | Partial>; + rowSpan?: Columns | 'full' | Partial>; }