@@ -19,22 +19,7 @@ import {
1919} from "@angular/cdk/coercion" ;
2020import { DxcButtonIconComponent } from "./dxc-button-icon/dxc-button-icon.component" ;
2121import { BackgroundProviderService } from "../background-provider/service/background-provider.service" ;
22-
23- type Size = "small" | "medium" | "large" | "fillParent" | "fitContent" ;
24- type Space =
25- | "xxsmall"
26- | "xsmall"
27- | "small"
28- | "medium"
29- | "large"
30- | "xlarge"
31- | "xxlarge" ;
32- type Margin = {
33- top ?: Space ;
34- bottom ?: Space ;
35- left ?: Space ;
36- right ?: Space ;
37- } ;
22+ import { Space , Spacing , ButtonProperties } from "./dxc-button.types" ;
3823
3924@Component ( {
4025 selector : "dxc-button" ,
@@ -73,11 +58,11 @@ export class DxcButtonComponent {
7358 * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
7459 * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
7560 */
76- @Input ( ) margin : Space | Margin ;
61+ @Input ( ) margin : Space | Spacing ;
7762 /**
7863 * Size of the component.
7964 */
80- @Input ( ) size : Size = "fitContent" ;
65+ @Input ( ) size : "small" | "medium" | "large" | "fillParent" | "fitContent" = "fitContent" ;
8166 /**
8267 * This prop corresponds to the 'type' prop of the button in html.
8368 */
@@ -107,7 +92,7 @@ export class DxcButtonComponent {
10792 lightBackground : boolean = true ;
10893 darkBackground : boolean = false ;
10994
110- defaultInputs = new BehaviorSubject < any > ( {
95+ defaultInputs = new BehaviorSubject < ButtonProperties > ( {
11196 mode : "primary" ,
11297 disabled : false ,
11398 label : null ,
@@ -116,6 +101,7 @@ export class DxcButtonComponent {
116101 margin : null ,
117102 size : "fitContent" ,
118103 tabIndexValue : 0 ,
104+ type : "button"
119105 } ) ;
120106
121107 constructor (
0 commit comments