Skip to content

Commit

Permalink
Merge pull request #785 from hubmapconsortium/update-icon-button-story
Browse files Browse the repository at this point in the history
update icon button size and styles in the design system
  • Loading branch information
axdanbol authored Oct 22, 2024
2 parents 0d57bac + 4f311b6 commit ff67556
Show file tree
Hide file tree
Showing 7 changed files with 15 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
14 changes: 7 additions & 7 deletions libs/design-system/icon-button/src/lib/icon-button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import { provideIconButtons } from './providers';

const meta: Meta = {
title: 'IconButton',
parameters: {
design: {
type: 'figma',
url: 'https://www.figma.com/design/BCEJn9KCIbBJ5MzqnojKQp/HRA-Components?node-id=24-876',
},
},
args: {
icon: 'search',
size: 'large',
Expand All @@ -18,7 +24,7 @@ const meta: Meta = {
},
size: {
control: 'select',
options: ['small', 'medium', 'large'],
options: ['small', 'large'],
},
},
decorators: [
Expand Down Expand Up @@ -59,12 +65,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 ff67556

Please sign in to comment.