Skip to content

Commit 005a686

Browse files
feat(Tabs): provide an to change tab text size (#417)
1 parent 4a08348 commit 005a686

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/blocks/Tabs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Tabs block
1818
- `lg: number` — On a screen wider than 1081px.
1919
- `xl: number` — On a screen wider than 1185px.
2020

21+
`tabsColSizes?: 's' | 'l'` — Component's size that defines font sizes (`'s'` by default)
22+
2123
`items: TabsBlockItem[]` — Tab description
2224

2325
- `tabName: string` — Tab title.

src/blocks/Tabs/Tabs.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const TabsBlock = ({
2525
tabsColSizes,
2626
centered,
2727
direction = 'media-content',
28+
contentSize = 's',
2829
}: TabsBlockProps) => {
2930
const [activeTab, setActiveTab] = useState<string | null>(items[0].tabName);
3031
const [play, setPlay] = useState<boolean>(false);
@@ -61,7 +62,7 @@ export const TabsBlock = ({
6162
title={activeTabData.title}
6263
text={activeTabData.text}
6364
additionalInfo={activeTabData.additionalInfo}
64-
size="s"
65+
size={contentSize}
6566
links={[
6667
...(activeTabData.link ? [activeTabData.link] : []),
6768
...(activeTabData.links || []),

src/blocks/Tabs/schema.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
LinkProps,
88
MediaProps,
99
containerSizesArray,
10+
contentSizes,
1011
mediaDirection,
1112
sizeNumber,
1213
withTheme,
@@ -56,6 +57,10 @@ export const TabsBlock = {
5657
},
5758
centered: {type: 'boolean'},
5859
items: filteredArray(tabsItem),
60+
contentSize: {
61+
type: 'string',
62+
enum: contentSizes,
63+
},
5964
},
6065
},
6166
};

src/models/constructor-items/blocks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ export interface TabsBlockProps extends Animatable {
274274
centered?: boolean;
275275
direction?: MediaDirection;
276276
items: TabsBlockItem[];
277+
contentSize?: ContentSize;
277278
}
278279

279280
export interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {

0 commit comments

Comments
 (0)