Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Adding data-id to tab component #278

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/Tabs/Tabs.props.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ export function Format({ args }) {
<Tabs format={format} key={key} {...args}>
<Tabs.Panel
label="Tab 0"
dataId="tab-0"
onActivate={() => console.log('Clicked Tab 0')}
>
<Paragraph size="2">Lorem kittsum dolor sit ameow.</Paragraph>
<img src="http://placekitten.com/1000/400" width="100%" />
</Tabs.Panel>
<Tabs.Panel
label="Tab 1"
dataId="tab-1"
active
onActivate={() => console.log('Clicked Tab 1')}
>
Expand All @@ -35,6 +37,7 @@ export function Format({ args }) {
</Tabs.Panel>
<Tabs.Panel
label="Tab 2"
dataId="tab-2"
onActivate={() => console.log('Clicked Tab 2')}
>
<Paragraph size="2">Lorem kittsum dolor sit ameow.</Paragraph>
Expand Down
1 change: 1 addition & 0 deletions src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function TabsComponent({
<li
key={i}
onClick={() => activeTabSet(i)}
data-id={props.dataId}
style={{ flex: '1 0 0' }}
>
<NavItem
Expand Down
1 change: 1 addition & 0 deletions src/components/Tabs/Tabs.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface Minors {

export interface PanelProps {
label?: string;
dataId?: string;
active?: boolean;
/**
* @deprecated
Expand Down