File tree Expand file tree Collapse file tree 9 files changed +61
-18
lines changed
Expand file tree Collapse file tree 9 files changed +61
-18
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ $block: '.#{$ns}block-header';
1111
1212 margin-top : $indentXXS ;
1313
14- & _titleSize_s {
14+ & _titleSize_s ,
15+ & _titleSize_xs {
1516 margin-top : $indentXXXS ;
1617
1718 .yfm {
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ const SizesTemplate: Story<BlockHeaderProps & ClassNameProps> = (args) => (
2828 < div style = { { paddingBottom : '64px' } } >
2929 < BlockHeader { ...args } title = { data . sizes . s as TitleProps } />
3030 </ div >
31+ < div style = { { paddingBottom : '64px' } } >
32+ < BlockHeader { ...args } title = { data . sizes . xs as TitleProps } />
33+ </ div >
3134 </ div >
3235) ;
3336
Original file line number Diff line number Diff line change 2323 }
2424 },
2525 "sizes" : {
26+ "xs" : {
27+ "text" : " Size XS" ,
28+ "textSize" : " xs"
29+ },
2630 "s" : {
2731 "text" : " Size S" ,
2832 "textSize" : " s"
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ $block: '.#{$ns}title-block';
77 @include justify ();
88 $root : &;
99
10+ & _size_xs {
11+ @include heading5 ();
12+ }
13+
1014 & _size_s {
1115 @include heading4 ();
12-
1316 margin-top : $indentM ;
1417 }
1518
@@ -24,10 +27,14 @@ $block: '.#{$ns}title-block';
2427 }
2528
2629 & __arrow {
27- margin : 8px 0 0 4px ;
30+ margin-top : 10px ;
31+
32+ & _size_xs {
33+ margin-top : 7px ;
34+ }
2835
2936 & _size_s {
30- margin : 4 px 0 0 4 px ;
37+ margin-top : 5 px ;
3138 }
3239 }
3340
@@ -41,7 +48,11 @@ $block: '.#{$ns}title-block';
4148 cursor : pointer ;
4249
4350 #{$root } __arrow {
44- margin-left : 12px ;
51+ margin-left : 10px ;
52+
53+ & _size_xs {
54+ margin-left : 6px ;
55+ }
4556
4657 & _size_s {
4758 margin-left : 8px ;
@@ -66,8 +77,15 @@ $block: '.#{$ns}title-block';
6677 }
6778
6879 @media (max-width : map-get ($gridBreakpoints , ' sm' )) {
69- & _size_l {
80+ & _size_l :not (#{$root}_reset-margin) {
7081 margin-top : $indentL ;
7182 }
83+
84+ & __arrow {
85+ & _size_m ,
86+ & _size_l {
87+ margin-top : 9px ;
88+ }
89+ }
7290 }
7391}
Original file line number Diff line number Diff line change @@ -13,12 +13,14 @@ const b = block('title-block');
1313
1414export function getArrowSize ( size : TextSize , isMobile : boolean ) {
1515 switch ( size ) {
16+ case 'xs' :
17+ return 13 ;
1618 case 's' :
1719 return 16 ;
1820 case 'm' :
19- return isMobile ? 20 : 24 ;
21+ return isMobile ? 22 : 24 ;
2022 case 'l' :
21- return isMobile ? 20 : 24 ;
23+ return isMobile ? 26 : 38 ;
2224 default :
2325 return 20 ;
2426 }
Original file line number Diff line number Diff line change 11import { Meta , Story } from '@storybook/react/types-6-0' ;
2- import React from 'react' ;
2+ import React , { Fragment } from 'react' ;
33
44import Title , { TitleFullProps } from '../Title' ;
55import { COMPONENTS } from '../../../demo/constants' ;
@@ -14,10 +14,21 @@ export default {
1414
1515const DefaultTemplate : Story < TitleFullProps > = ( args ) => < Title { ...args } /> ;
1616
17+ const SizeTemplate : Story < TitleFullProps > = ( args ) => (
18+ < Fragment >
19+ < Title { ...args } textSize = "xs" />
20+ < Title { ...args } textSize = "s" />
21+ < Title { ...args } textSize = "m" />
22+ < Title { ...args } textSize = "l" resetMargin = { true } />
23+ </ Fragment >
24+ ) ;
25+
1726export const Default = DefaultTemplate . bind ( { } ) ;
18- export const WithLink = DefaultTemplate . bind ( { } ) ;
27+ export const WithLink = SizeTemplate . bind ( { } ) ;
1928export const ResetMargin = DefaultTemplate . bind ( { } ) ;
29+ export const Size = SizeTemplate . bind ( { } ) ;
2030
2131Default . args = data . default . content as TitleProps ;
2232WithLink . args = data . withLink . content as TitleProps ;
2333ResetMargin . args = data . resetMargin . content as TitleProps ;
34+ Size . args = data . default . content as TitleProps ;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export enum MediaVideoControlsType {
5050
5151// types
5252export type TextTheme = 'light' | 'dark' ;
53- export type TextSize = 's' | 'm' | 'l' ;
53+ export type TextSize = 'xs' | ' s' | 'm' | 'l' ;
5454export type DividerSize = '0' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' ;
5555export type HeaderWidth = 's' | 'm' | 'l' ;
5656export type HeaderImageSize = 's' | 'm' ;
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ export function getHeaderTag(size: TextSize) {
88 return 'h1' ;
99 case 's' :
1010 return 'h4' ;
11+ case 'xs' :
12+ return 'h5' ;
1113 case 'm' :
1214 default :
1315 return 'h2' ;
Original file line number Diff line number Diff line change 141141}
142142
143143@mixin label ($size : m) {
144- @include text-size (body- 1);
144+ @if $size == m {
145+ @include text-size (body- 1);
145146
146- $label-height : 20px ;
147+ $label-height : 20px ;
147148
148- display : inline-block ;
149- padding : 0 8px ;
150- border-radius : 2px ;
151- height : $label-height ;
152- line-height : $label-height ;
149+ display : inline-block ;
150+ padding : 0 8px ;
151+ border-radius : 2px ;
152+ height : $label-height ;
153+ line-height : $label-height ;
154+ }
153155
154156 @if $size == s {
155157 @include text-size (caption- 2);
You can’t perform that action at this time.
0 commit comments