feat(avatar): add disabled property (#30284)

Issue number: internal

---------

## What is the current behavior?
Avatar does not have a disabled state for the ionic theme.

## What is the new behavior?
- Added styles for ionic theme disabled state
- Added states e2e test & snapshots

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

[Preview](https://ionic-framework-git-rou-11728-ionic1.vercel.app/src/components/avatar/test/states?ionic:theme=ionic)

---------

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: ionitron <hi@ionicframework.com>
This commit is contained in:
João Ferreira
2025-03-24 09:57:54 +00:00
committed by GitHub
parent c5fb051be3
commit 02c9d64ca5
12 changed files with 91 additions and 7 deletions

View File

@ -211,14 +211,14 @@ export declare interface IonApp extends Components.IonApp {}
@ProxyCmp({
inputs: ['mode', 'shape', 'size', 'theme']
inputs: ['disabled', 'mode', 'shape', 'size', 'theme']
})
@Component({
selector: 'ion-avatar',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['mode', 'shape', 'size', 'theme'],
inputs: ['disabled', 'mode', 'shape', 'size', 'theme'],
})
export class IonAvatar {
protected el: HTMLIonAvatarElement;

View File

@ -295,14 +295,14 @@ export declare interface IonApp extends Components.IonApp {}
@ProxyCmp({
defineCustomElementFn: defineIonAvatar,
inputs: ['mode', 'shape', 'size', 'theme']
inputs: ['disabled', 'mode', 'shape', 'size', 'theme']
})
@Component({
selector: 'ion-avatar',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['mode', 'shape', 'size', 'theme'],
inputs: ['disabled', 'mode', 'shape', 'size', 'theme'],
standalone: true
})
export class IonAvatar {