Skip to content

Commit

Permalink
update icon button size and styles in the design system
Browse files Browse the repository at this point in the history
  • Loading branch information
bhushankhope committed Oct 22, 2024
1 parent 0d57bac commit 74e8a30
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mat-icon-button
[matMenuTriggerFor]="menu"
hraMicroTooltip="More"
hraIconButtonSize="medium"
hraIconButtonSize="large"
data-testid="trigger"
>
<mat-icon>more_vert</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="title">
{{ data.title }}
</div>
<button mat-icon-button mat-dialog-close disableRipple hraIconButtonSize="medium" data-testid="close-icon">
<button mat-icon-button mat-dialog-close disableRipple hraIconButtonSize="large" data-testid="close-icon">
<mat-icon class="material-symbols-rounded">close</mat-icon>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { computed, Directive, input } from '@angular/core';

/** Input options for icon button size */
export type IconButtonSize = 'small' | 'medium' | 'large';
export type IconButtonSize = 'small' | 'large';

/** Record of button sizes (number in rem) */
const BUTTON_SIZES: Record<IconButtonSize, number> = {
small: 1.5,
medium: 2.25,
large: 2.5,
};

/** Record of icon sizes (number in rem) */
const ICON_SIZES: Record<IconButtonSize, number> = {
small: 1.25,
medium: 1.5,
large: 1.5,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
button[mat-icon-button] {
--mat-icon-button-hover-state-layer-opacity: 0.04;
--mat-icon-button-pressed-state-layer-opacity: 0.08;
--mat-icon-button-hover-state-layer-opacity: 0.08;
--mat-icon-button-pressed-state-layer-opacity: 0.16;
--mat-icon-color: var(--sys-secondary);
--mat-icon-button-state-layer-color: var(--sys-secondary);
--mat-icon-button-focus-state-layer-opacity: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const meta: Meta = {
},
size: {
control: 'select',
options: ['small', 'medium', 'large'],
options: ['small', 'large'],
},
},
decorators: [
Expand Down Expand Up @@ -59,12 +59,6 @@ export const Small: Story = {
},
};

export const Medium: Story = {
args: {
size: 'medium',
},
};

export const Large: Story = {
args: {
size: 'large',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const meta: Meta<MenuDemoComponent> = {
argTypes: {
size: {
control: 'select',
options: ['small', 'medium', 'large'],
options: ['small', 'large'],
},
},
args: {
size: 'medium',
size: 'small',
menuOptions: exampleOptions,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface MenuDemoOption {
})
export class MenuDemoComponent {
/** Menu size */
readonly size = input<IconButtonSize>('medium');
readonly size = input<IconButtonSize>('small');

/** List of menu options */
readonly menuOptions = input<MenuDemoOption[]>([]);
Expand Down

0 comments on commit 74e8a30

Please sign in to comment.