fix(staples): apply design-system button spec to StapleChip (13px, tracking, font-sans)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
aria-pressed={selected}
|
aria-pressed={selected}
|
||||||
onclick={() => onToggle(!selected)}
|
onclick={() => onToggle(!selected)}
|
||||||
class="inline-flex text-[12px] font-medium px-[12px] py-[6px] rounded-full border cursor-pointer
|
class="inline-flex font-sans text-[13px] font-medium tracking-[0.04em] px-[12px] py-[6px] rounded-full border cursor-pointer
|
||||||
focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--green-light)]
|
focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--green-light)]
|
||||||
{selected
|
{selected
|
||||||
? 'bg-[var(--green-tint)] border-[var(--green-light)] text-[var(--green-dark)]'
|
? 'bg-[var(--green-tint)] border-[var(--green-light)] text-[var(--green-dark)]'
|
||||||
|
|||||||
@@ -42,4 +42,12 @@ describe('StapleChip', () => {
|
|||||||
const btn = screen.getByRole('button', { name: 'Olivenöl' });
|
const btn = screen.getByRole('button', { name: 'Olivenöl' });
|
||||||
expect(btn.className).toContain('focus-visible:outline');
|
expect(btn.className).toContain('focus-visible:outline');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('uses design-system button text spec: 13px, tracking, font-sans', () => {
|
||||||
|
render(StapleChip, { props: { name: 'Olivenöl', selected: false, onToggle: vi.fn() } });
|
||||||
|
const btn = screen.getByRole('button', { name: 'Olivenöl' });
|
||||||
|
expect(btn.className).toContain('text-[13px]');
|
||||||
|
expect(btn.className).toContain('tracking-[0.04em]');
|
||||||
|
expect(btn.className).toContain('font-sans');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user