From 51f6215379d34814d656201f4687c9e6b3243dc4 Mon Sep 17 00:00:00 2001 From: Kyzyl-ool Kezhik Date: Tue, 7 Nov 2023 16:01:19 +0100 Subject: [PATCH] fix: raise up title item arrow to 1 px (#668) raise up title item arrow to 1 px --- src/components/Title/TitleItem.scss | 6 +- .../Title/__stories__/Title.stories.tsx | 71 +++++++++++++++---- 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/src/components/Title/TitleItem.scss b/src/components/Title/TitleItem.scss index caf91779f..9d74bb353 100644 --- a/src/components/Title/TitleItem.scss +++ b/src/components/Title/TitleItem.scss @@ -27,14 +27,14 @@ $block: '.#{$ns}title-item'; } &__arrow { - margin-top: 10px; + margin-top: 9px; &_size_xs { - margin-top: 7px; + margin-top: 6px; } &_size_s { - margin-top: 5px; + margin-top: 4px; } } diff --git a/src/components/Title/__stories__/Title.stories.tsx b/src/components/Title/__stories__/Title.stories.tsx index 86213a652..a8ace791e 100644 --- a/src/components/Title/__stories__/Title.stories.tsx +++ b/src/components/Title/__stories__/Title.stories.tsx @@ -15,22 +15,58 @@ export default { const DefaultTemplate: StoryFn = (args) => ; -const SizesTemplate: StoryFn<TitleProps & ClassNameProps> = (args) => ( - <div> - <div style={{paddingBottom: '64px'}}> - <Title {...args} title={data.sizes.l as TitleItemProps} /> - </div> - <div style={{paddingBottom: '64px'}}> - <Title {...args} title={data.sizes.m as TitleItemProps} /> - </div> - <div style={{paddingBottom: '64px'}}> - <Title {...args} title={data.sizes.s as TitleItemProps} /> - </div> - <div style={{paddingBottom: '64px'}}> - <Title {...args} title={data.sizes.xs as TitleItemProps} /> +const SizesTemplate: StoryFn<TitleProps & ClassNameProps> = (args) => { + const titleItemObjectProps = typeof args.title === 'object' ? args.title : {}; + + return ( + <div> + <div style={{paddingBottom: '64px'}}> + <Title + {...args} + title={ + { + ...data.sizes.l, + ...titleItemObjectProps, + } as TitleItemProps + } + /> + </div> + <div style={{paddingBottom: '64px'}}> + <Title + {...args} + title={ + { + ...data.sizes.m, + ...titleItemObjectProps, + } as TitleItemProps + } + /> + </div> + <div style={{paddingBottom: '64px'}}> + <Title + {...args} + title={ + { + ...data.sizes.s, + ...titleItemObjectProps, + } as TitleItemProps + } + /> + </div> + <div style={{paddingBottom: '64px'}}> + <Title + {...args} + title={ + { + ...data.sizes.xs, + ...titleItemObjectProps, + } as TitleItemProps + } + /> + </div> </div> - </div> -); + ); +}; const DefaultArgs = { ...data.default.content, @@ -41,6 +77,7 @@ export const Default = DefaultTemplate.bind({}); export const TitleLink = DefaultTemplate.bind({}); export const CustomTitle = DefaultTemplate.bind({}); export const Sizes = SizesTemplate.bind({}); +export const SizesWithLinks = SizesTemplate.bind({}); export const TitleWithoutDescription = SizesTemplate.bind({}); Default.args = { @@ -57,6 +94,10 @@ CustomTitle.args = { Sizes.args = { ...DefaultArgs, } as TitleProps; +SizesWithLinks.args = { + ...DefaultArgs, + title: data.titleLink.content.title, +} as TitleProps; TitleWithoutDescription.args = { title: data.default.content.title, } as TitleProps;