Skip to content

Commit

Permalink
Stamp spacings for the label and icon (#2717)
Browse files Browse the repository at this point in the history
* chore: adjust the spacings of the stamp's icon and label

* chore: changeset

* chore: updating the tests

* chore: updating the tests
  • Loading branch information
chloe0592 authored Feb 9, 2024
1 parent c029c7c commit 52db947
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/odd-students-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-uikit/stamp': patch
---

Adjust the spacing for the stamp's icon and label.
5 changes: 4 additions & 1 deletion packages/components/stamp/src/stamp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ const Stamp = (props: TStampProps) => {
getPaddingStyle(props),
]}
>
<SpacingsInline alignItems="center">
<SpacingsInline
alignItems="center"
scale={props.isCondensed ? 'xs' : 's'}
>
{Icon}
{props.label ? <StampLabel>{props.label}</StampLabel> : props.children}
</SpacingsInline>
Expand Down
7 changes: 7 additions & 0 deletions packages/components/stamp/src/stamp.visualroute.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Stamp } from '@commercetools-frontend/ui-kit';
import { ClockIcon } from '@commercetools-uikit/icons';
import { Suite, Spec } from '../../../../test/percy';

export const routePath = '/stamp';
Expand Down Expand Up @@ -28,5 +29,11 @@ export const component = () => (
Secondary
</Stamp>
</Spec>
<Spec label="when condensed with icon and label">
<Stamp tone="information" isCondensed={true} label="Hello" icon={<ClockIcon />} />
</Spec>
<Spec label="when not condensed with icon and label">
<Stamp tone="information" isCondensed={false} label="Hello" icon={<ClockIcon />} />
</Spec>
</Suite>
);

0 comments on commit 52db947

Please sign in to comment.