Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.
*/
Expand All @@ -71,9 +51,9 @@ export class DxcBoxComponent implements OnInit {
fitContent: "fit-content",
};

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<BoxProperties>({
display: "inline-flex",
shadowDepth: "2",
shadowDepth: 2,
margin: null,
padding: null,
size: null,
Expand Down
31 changes: 31 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-box/dxc-box.types.ts
Original file line number Diff line number Diff line change
@@ -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";
}