feat(badge): add hue property for the ionic theme (#30307)

Issue number: internal

---------

## What is the current behavior?
The badge component does not support the `hue` property.

## What is the new behavior?
Adds support for the `subtle` hue for the badge. Defaults to `subtle`
when the badge contains icon or text. Defaults to `bold` when the badge
is empty or when it is inside of a button or tab button.

## Does this introduce a breaking change?
- [ ] Yes
- [x] No
This commit is contained in:
Brandy Smith
2025-04-11 13:07:01 -04:00
committed by GitHub
parent 207d4858a6
commit a9aa59bc36
116 changed files with 265 additions and 11 deletions

View File

@ -261,14 +261,14 @@ export declare interface IonBackdrop extends Components.IonBackdrop {
@ProxyCmp({
inputs: ['color', 'mode', 'shape', 'size', 'theme', 'vertical']
inputs: ['color', 'hue', 'mode', 'shape', 'size', 'theme', 'vertical']
})
@Component({
selector: 'ion-badge',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['color', 'mode', 'shape', 'size', 'theme', 'vertical'],
inputs: ['color', 'hue', 'mode', 'shape', 'size', 'theme', 'vertical'],
})
export class IonBadge {
protected el: HTMLIonBadgeElement;

View File

@ -350,14 +350,14 @@ export declare interface IonBackdrop extends Components.IonBackdrop {
@ProxyCmp({
defineCustomElementFn: defineIonBadge,
inputs: ['color', 'mode', 'shape', 'size', 'theme', 'vertical']
inputs: ['color', 'hue', 'mode', 'shape', 'size', 'theme', 'vertical']
})
@Component({
selector: 'ion-badge',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['color', 'mode', 'shape', 'size', 'theme', 'vertical'],
inputs: ['color', 'hue', 'mode', 'shape', 'size', 'theme', 'vertical'],
standalone: true
})
export class IonBadge {