Skip to content

Commit

Permalink
feat(UiKit): Tab Navigation Block (#1095)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoevanp committed Jul 7, 2023
1 parent 4fa6667 commit 00d08d1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ui-kit/src/blocks/LayoutBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { ImageBlock } from './layout/ImageBlock';
import type { InputBlock } from './layout/InputBlock';
import type { PreviewBlock } from './layout/PreviewBlock';
import type { SectionBlock } from './layout/SectionBlock';
import type { TabNavigationBlock } from './layout/TabNavigationBlock';
import type { VideoConferenceBlock } from './layout/VideoConferenceBlock';

export type LayoutBlock =
Expand All @@ -18,4 +19,5 @@ export type LayoutBlock =
| InputBlock
| SectionBlock
| VideoConferenceBlock
| PreviewBlock;
| PreviewBlock
| TabNavigationBlock;
1 change: 1 addition & 0 deletions packages/ui-kit/src/blocks/LayoutBlockType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum LayoutBlockType {
INPUT = 'input',
CONDITIONAL = 'conditional',
PREVIEW = 'preview',
TAB_NAVIGATION = 'tab_navigation',
VIDEO_CONF = 'video_conf',
}

Expand Down
15 changes: 15 additions & 0 deletions packages/ui-kit/src/blocks/layout/TabNavigationBlock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Block } from '../Block';
import type { LayoutBlockish } from '../LayoutBlockish';
import type { TextObject } from '../TextObject';

export type TabItem = {
title: TextObject;
disabled?: boolean;
selected?: boolean;
elements: readonly Block[];
};

export type TabNavigationBlock = LayoutBlockish<{
type: 'tab_navigation';
tabs: readonly TabItem[];
}>;
1 change: 1 addition & 0 deletions packages/ui-kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export { InputBlock } from './blocks/layout/InputBlock';
export { SectionBlock } from './blocks/layout/SectionBlock';
export { VideoConferenceBlock } from './blocks/layout/VideoConferenceBlock';
export { LayoutBlock } from './blocks/LayoutBlock';
export { TabNavigationBlock } from './blocks/layout/TabNavigationBlock';

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

Expand Down

0 comments on commit 00d08d1

Please sign in to comment.