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

Commit

Permalink
Adding data-id to tab component (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarzen-chugh authored Jun 15, 2023
1 parent 0fc808b commit abdc5d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
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

0 comments on commit abdc5d8

Please # to comment.