From a5d61c8f5295a669e480a5baadced66cfe80b711 Mon Sep 17 00:00:00 2001 From: Aleksandr Shumilov Date: Tue, 20 Aug 2024 15:36:54 +0200 Subject: [PATCH] [FX-5808] Fix badge placement in tabs and checkbox spacing (#4489) --- .changeset/twelve-steaks-melt.md | 9 +++++++++ packages/base/Badge/src/Badge/Badge.tsx | 3 +-- .../Badge/src/Badge/__snapshots__/test.tsx.snap | 4 ++-- packages/base/Checkbox/src/Checkbox/Checkbox.tsx | 1 + .../src/Checkbox/__snapshots__/test.tsx.snap | 16 ++++++++-------- ...{Icon.example.tsx => IconOrBadge.example.tsx} | 13 ++----------- packages/base/Tabs/src/Tab/story/index.jsx | 6 +++++- .../src/Checkbox/__snapshots__/test.tsx.snap | 8 ++++---- 8 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 .changeset/twelve-steaks-melt.md rename packages/base/Tabs/src/Tab/story/{Icon.example.tsx => IconOrBadge.example.tsx} (76%) diff --git a/.changeset/twelve-steaks-melt.md b/.changeset/twelve-steaks-melt.md new file mode 100644 index 0000000000..709a8aae93 --- /dev/null +++ b/.changeset/twelve-steaks-melt.md @@ -0,0 +1,9 @@ +--- +'@toptal/picasso-badge': patch +'@toptal/picasso-tabs': patch +'@toptal/picasso-checkbox': patch +--- + +- fix styles in Badge component +- add "badge in tab" case to Tabs storybook stories +- fix font size for Checkbox root diff --git a/packages/base/Badge/src/Badge/Badge.tsx b/packages/base/Badge/src/Badge/Badge.tsx index 9710227743..4d6ab1745b 100644 --- a/packages/base/Badge/src/Badge/Badge.tsx +++ b/packages/base/Badge/src/Badge/Badge.tsx @@ -58,8 +58,7 @@ export const Badge = forwardRef(function Badge( root: { className: twMerge( `inline-flex flex-shrink-0 content-middle flex-nowrap justify-normal - text-[10px] font-semibold leading-3 align-middle text-graphite-700 - top-0 right-0`, + text-[10px] font-semibold leading-3 align-middle text-graphite-700`, hasChildren ? 'relative' : 'static', className ), diff --git a/packages/base/Badge/src/Badge/__snapshots__/test.tsx.snap b/packages/base/Badge/src/Badge/__snapshots__/test.tsx.snap index 892b51c2ae..c7a4434872 100644 --- a/packages/base/Badge/src/Badge/__snapshots__/test.tsx.snap +++ b/packages/base/Badge/src/Badge/__snapshots__/test.tsx.snap @@ -6,7 +6,7 @@ exports[`Badge renders 1`] = ` class="Picasso-root" > ( style={labelStyle} ref={ref as React.ForwardedRef} classes={{ + root: 'text-[1rem]', label: twJoin( 'max-w-[calc(100%_-_1.5em_+_1px)]', 'ml-[0.5em]', diff --git a/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap b/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap index e86cffcd8c..56e72d09d5 100644 --- a/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap +++ b/packages/base/Checkbox/src/Checkbox/__snapshots__/test.tsx.snap @@ -15,7 +15,7 @@ exports[`Checkbox Checkbox.Group renders checkbox in a grid group 1`] = ` class="box-border m-0 p-[8px] sm:basis-4/12 sm:max-w leading-none pt-0 pb-0 [&_.picasso-checkbox]:mb-[0.5em]" >