Skip to content

Commit

Permalink
fix(Button): address QA design feedback (#1940)
Browse files Browse the repository at this point in the history
- increase icon size in lg/md buttons with icon layouts
- increase spacing between buttons to match design
  • Loading branch information
booc0mtaco committed May 14, 2024
1 parent 3298c66 commit 1e431b4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/components/Button/Button-v2.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
.button--sm & {
/* Offset to better align text in small button */
transform: translateY(-1px);
gap: 0.25rem;
}

.button--md &,
.button--lg & {
gap: 0.5rem;
}
}

Expand Down
12 changes: 10 additions & 2 deletions src/components/Button/Button-v2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,19 @@ export const Button = forwardRef<HTMLButtonElement, ButtonV2Props>(
/>
)}
{iconLayout === 'left' && (
<Icon name={icon} purpose="decorative" size="1rem" />
<Icon
name={icon}
purpose="decorative"
size={size === 'lg' ? '1.5rem' : '1rem'}
/>
)}
{iconLayout !== 'icon-only' && children}
{iconLayout === 'right' && (
<Icon name={icon} purpose="decorative" size="1rem" />
<Icon
name={icon}
purpose="decorative"
size={size === 'lg' ? '1.5rem' : '1rem'}
/>
)}
</span>
{isLoading && (
Expand Down
12 changes: 6 additions & 6 deletions src/components/Button/__snapshots__/Button-v2.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ exports[`<Button /> (v2) IconLayouts story renders snapshot 1`] = `
aria-hidden="true"
class="icon"
fill="currentColor"
height="1rem"
style="--icon-size: 1rem;"
height="1.5rem"
style="--icon-size: 1.5rem;"
viewBox="0 0 24 24"
width="1rem"
width="1.5rem"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand All @@ -204,10 +204,10 @@ exports[`<Button /> (v2) IconLayouts story renders snapshot 1`] = `
aria-hidden="true"
class="icon"
fill="currentColor"
height="1rem"
style="--icon-size: 1rem;"
height="1.5rem"
style="--icon-size: 1.5rem;"
viewBox="0 0 24 24"
width="1rem"
width="1.5rem"
xmlns="http://www.w3.org/2000/svg"
>
<path
Expand Down

0 comments on commit 1e431b4

Please sign in to comment.