diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.component.ts b/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.component.ts index e7caf1f43..6880925b6 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.component.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.component.ts @@ -9,27 +9,7 @@ import { BehaviorSubject } from "rxjs"; import { css } from "emotion"; import { CssUtils } from "../utils"; import { BackgroundProviderService } from "../background-provider/service/background-provider.service"; - -type Space = - | "xxsmall" - | "xsmall" - | "small" - | "medium" - | "large" - | "xlarge" - | "xxlarge"; -type Margin = { - top?: Space; - bottom?: Space; - left?: Space; - right?: Space; -}; -type Padding = { - top?: Space; - bottom?: Space; - left?: Space; - right?: Space; -}; +import { BoxProperties, Space, Spacing } from "./dxc-box.types"; @Component({ selector: "dxc-box", @@ -50,12 +30,12 @@ export class DxcBoxComponent implements OnInit { * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes. */ - @Input() margin: Space | Margin; + @Input() margin: Space | Spacing; /** * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes. */ - @Input() padding: Space | Padding; + @Input() padding: Space | Spacing; /** * Size of the component. */ @@ -71,9 +51,9 @@ export class DxcBoxComponent implements OnInit { fitContent: "fit-content", }; - defaultInputs = new BehaviorSubject({ + defaultInputs = new BehaviorSubject({ display: "inline-flex", - shadowDepth: "2", + shadowDepth: 2, margin: null, padding: null, size: null, diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.types.ts b/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.types.ts new file mode 100644 index 000000000..be75b161d --- /dev/null +++ b/projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.types.ts @@ -0,0 +1,31 @@ +export type Space = + | "xxsmall" + | "xsmall" + | "small" + | "medium" + | "large" + | "xlarge" + | "xxlarge"; + +export type Spacing = { + top?: Space; + bottom?: Space; + left?: Space; + right?: Space; +}; + +export type Sizes = { + small: "60px"; + medium: "240px"; + large: "480px"; + fillParent: "100%"; + fitContent: "fit-content"; +}; + +export interface BoxProperties { + shadowDepth: 0 | 1 | 2; + display: string; + margin: Space | Spacing; + padding: Space | Spacing; + size: "small" | "medium" | "large" | "fillParent" | "fitContent"; +}