Skip to content

Commit 00d08d1

Browse files
authored
feat(UiKit): Tab Navigation Block (#1095)
1 parent 4fa6667 commit 00d08d1

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

packages/ui-kit/src/blocks/LayoutBlock.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { ImageBlock } from './layout/ImageBlock';
66
import type { InputBlock } from './layout/InputBlock';
77
import type { PreviewBlock } from './layout/PreviewBlock';
88
import type { SectionBlock } from './layout/SectionBlock';
9+
import type { TabNavigationBlock } from './layout/TabNavigationBlock';
910
import type { VideoConferenceBlock } from './layout/VideoConferenceBlock';
1011

1112
export type LayoutBlock =
@@ -18,4 +19,5 @@ export type LayoutBlock =
1819
| InputBlock
1920
| SectionBlock
2021
| VideoConferenceBlock
21-
| PreviewBlock;
22+
| PreviewBlock
23+
| TabNavigationBlock;

packages/ui-kit/src/blocks/LayoutBlockType.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export enum LayoutBlockType {
99
INPUT = 'input',
1010
CONDITIONAL = 'conditional',
1111
PREVIEW = 'preview',
12+
TAB_NAVIGATION = 'tab_navigation',
1213
VIDEO_CONF = 'video_conf',
1314
}
1415

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Block } from '../Block';
2+
import type { LayoutBlockish } from '../LayoutBlockish';
3+
import type { TextObject } from '../TextObject';
4+
5+
export type TabItem = {
6+
title: TextObject;
7+
disabled?: boolean;
8+
selected?: boolean;
9+
elements: readonly Block[];
10+
};
11+
12+
export type TabNavigationBlock = LayoutBlockish<{
13+
type: 'tab_navigation';
14+
tabs: readonly TabItem[];
15+
}>;

packages/ui-kit/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export { InputBlock } from './blocks/layout/InputBlock';
3434
export { SectionBlock } from './blocks/layout/SectionBlock';
3535
export { VideoConferenceBlock } from './blocks/layout/VideoConferenceBlock';
3636
export { LayoutBlock } from './blocks/LayoutBlock';
37+
export { TabNavigationBlock } from './blocks/layout/TabNavigationBlock';
3738

3839
export { InputElementDispatchAction } from './blocks/InputElementDispatchAction';
3940

0 commit comments

Comments
 (0)