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 1 commit
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
1 change: 1 addition & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function ButtonComponent({
theme={theme}
type={type}
variant={variant}
data-id={props.dataId}
juliewongbandue marked this conversation as resolved.
Show resolved Hide resolved
onClick={(event: React.MouseEvent<HTMLButtonElement>) => {
//Safari Button Focus Fix
buttonRef?.current?.focus();
Expand Down
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 @@ -61,6 +61,7 @@ function TabsComponent({
format={format}
index={i}
label={props.label}
dataId={props.dataId}
juliewongbandue marked this conversation as resolved.
Show resolved Hide resolved
selected={activeTab === i}
variant={variant}
pill={pill}
Expand Down
1 change: 1 addition & 0 deletions src/utils/HOCs/IrisProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type IrisElementProps<DOMElement = HTMLDivElement> = {
children?: ReactNode;
className?: string;
data?: string;
dataId?: string;
debug?: boolean;
disabled?: boolean;
forwardRef?: Ref<DOMElement>;
Expand Down