Skip to content

Commit af515b7

Browse files
[DSR] Updated AvatarIcon's severity Default to Neutral (#604)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR updated AvatarIcon's severity Default to Neutral in the `@metamask/design-system-react` package <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Related issues** Fixes: #601 ## **Manual testing steps** 1. Run `yarn storybook` 2. Make sure the `AvatarIcon` component is functioning as expected 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/4d21407c-79ce-4fb7-a9a8-1964df2b53c1 <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: George Marshall <[email protected]>
1 parent ecb6b4b commit af515b7

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

packages/design-system-react/src/components/AvatarIcon/AvatarIcon.constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR: Record<
1313
AvatarIconSeverity,
1414
string
1515
> = {
16-
[AvatarIconSeverity.Default]: 'bg-background-muted',
16+
[AvatarIconSeverity.Neutral]: 'bg-background-muted',
1717
[AvatarIconSeverity.Info]: 'bg-info-muted',
1818
[AvatarIconSeverity.Success]: 'bg-success-muted',
1919
[AvatarIconSeverity.Error]: 'bg-error-muted',
@@ -24,7 +24,7 @@ export const MAP_AVATARICON_SEVERITY_ICONCOLOR: Record<
2424
AvatarIconSeverity,
2525
IconColor
2626
> = {
27-
[AvatarIconSeverity.Default]: IconColor.IconAlternative,
27+
[AvatarIconSeverity.Neutral]: IconColor.IconAlternative,
2828
[AvatarIconSeverity.Info]: IconColor.InfoDefault,
2929
[AvatarIconSeverity.Success]: IconColor.SuccessDefault,
3030
[AvatarIconSeverity.Error]: IconColor.ErrorDefault,

packages/design-system-react/src/components/AvatarIcon/AvatarIcon.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const Severity: Story = {
8989
<div className="flex gap-2">
9090
<AvatarIcon
9191
iconName={IconName.User}
92-
severity={AvatarIconSeverity.Default}
92+
severity={AvatarIconSeverity.Neutral}
9393
/>
9494
<AvatarIcon iconName={IconName.Info} severity={AvatarIconSeverity.Info} />
9595
<AvatarIcon
@@ -113,11 +113,11 @@ export const HasBorder: Story = {
113113
<div className="flex gap-2 bg-primary-muted p-2">
114114
<AvatarIcon
115115
iconName={IconName.User}
116-
severity={AvatarIconSeverity.Default}
116+
severity={AvatarIconSeverity.Neutral}
117117
/>
118118
<AvatarIcon
119119
iconName={IconName.User}
120-
severity={AvatarIconSeverity.Default}
120+
severity={AvatarIconSeverity.Neutral}
121121
hasBorder
122122
/>
123123
</div>

packages/design-system-react/src/components/AvatarIcon/AvatarIcon.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('AvatarIcon', () => {
1919
expect(avatarIcon).toBeInTheDocument();
2020
expect(avatarIcon).toHaveClass(
2121
TWCLASSMAP_AVATARICON_SEVERITY_BACKGROUNDCOLOR[
22-
AvatarIconSeverity.Default
22+
AvatarIconSeverity.Neutral
2323
],
2424
);
2525
});

packages/design-system-react/src/components/AvatarIcon/AvatarIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const AvatarIcon = React.forwardRef<HTMLDivElement, AvatarIconProps>(
1717
iconName,
1818
iconProps,
1919
size = AvatarIconSize.Md,
20-
severity = AvatarIconSeverity.Default,
20+
severity = AvatarIconSeverity.Neutral,
2121
className,
2222
...props
2323
},

packages/design-system-react/src/components/AvatarIcon/AvatarIcon.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type AvatarIconProps = Omit<AvatarBaseProps, 'children' | 'size'> & {
1919
size?: AvatarIconSize;
2020
/**
2121
* Optional prop to control the severity of the avatar
22-
* @default AvatarIconSeverity.Default
22+
* @default AvatarIconSeverity.Neutral
2323
*/
2424
severity?: AvatarIconSeverity;
2525
};

packages/design-system-react/src/components/AvatarIcon/README.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ AvatarIcon supports five sizes, each with a corresponding icon size:
5959

6060
The `severity` prop allows you to apply predefined color combinations to the avatar and icon. Each severity level uses appropriate background and icon colors:
6161

62-
- `AvatarIconSeverity.Default` - neutral styling for general use
62+
- `AvatarIconSeverity.Neutral` - neutral styling for general use - default
6363
- `AvatarIconSeverity.Info` - info styling for informational content
6464
- `AvatarIconSeverity.Success` - success styling for positive actions/states
6565
- `AvatarIconSeverity.Warning` - warning styling for cautionary content
@@ -86,7 +86,7 @@ Example:
8686
```tsx
8787
<AvatarIcon
8888
iconName={IconName.User}
89-
severity={AvatarIconSeverity.Default}
89+
severity={AvatarIconSeverity.Neutral}
9090
className="mx-2 my-4"
9191
/>
9292
```

packages/design-system-react/src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export enum AvatarAccountVariant {
5959
* AvatarIcon - severity
6060
*/
6161
export enum AvatarIconSeverity {
62-
Default = 'default',
62+
Neutral = 'neutral',
6363
Info = 'info',
6464
Success = 'success',
6565
Error = 'error',

0 commit comments

Comments
 (0)