Skip to content

Commit a5974c9

Browse files
committed
fix: Add empty string option for props that match directive name
Signed-off-by: Akshat Patel <[email protected]>
1 parent 42c9b6d commit a5974c9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/button/button.directive.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ export class Button implements OnInit {
3131
this.cdsButton = type;
3232
}
3333
/**
34-
* sets the button type
34+
* Sets the button type
35+
* Accepts `ButtonType` or nothing (defaults to empty string in angular 16+)
3536
*/
36-
@Input() cdsButton: ButtonType = "primary";
37+
@Input() cdsButton: ButtonType | "" = "primary";
3738
/**
3839
* Specify the size of the button
3940
*/

src/theme/theme.directive.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
} from "@angular/core";
1010
import { LayerDirective } from "carbon-components-angular/layer";
1111

12+
export type ThemeType = "white" | "g10" | "g90" | "g100";
13+
1214
/**
1315
* Applies theme styles to the div container it is applied to.
1416
*
@@ -22,14 +24,15 @@ export class ThemeDirective implements OnInit, AfterContentChecked {
2224
/**
2325
* @deprecated as of v5 - Use `cdsTheme` input property instead
2426
*/
25-
@Input() set ibmTheme(type: "white" | "g10" | "g90" | "g100") {
27+
@Input() set ibmTheme(type: ThemeType | "") {
2628
this.cdsTheme = type;
2729
}
2830

2931
/**
3032
* Sets the theme for the content
33+
* Accepts `ThemeType` or nothing (defaults to empty string in angular 16+)
3134
*/
32-
@Input() cdsTheme: "white" | "g10" | "g90" | "g100" = "white";
35+
@Input() cdsTheme: ThemeType | "" = "white";
3336

3437
@ContentChildren(LayerDirective, { descendants: false }) layerChildren: QueryList<LayerDirective>;
3538

0 commit comments

Comments
 (0)