Skip to content

Commit

Permalink
Tabs: fix "With tab icons" Storybook example
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Jul 9, 2024
1 parent 4c93cf2 commit 7728044
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions packages/components/src/tabs/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import Tabs from '..';
import { Slot, Fill, Provider as SlotFillProvider } from '../../slot-fill';
import DropdownMenu from '../../dropdown-menu';
import Button from '../../button';
import Tooltip from '../../tooltip';
import Icon from '../../icon';

const meta: Meta< typeof Tabs > = {
title: 'Components (Experimental)/Tabs',
Expand Down Expand Up @@ -110,24 +112,29 @@ const WithTabIconsAndTooltipsTemplate: StoryFn< typeof Tabs > = ( props ) => {
return (
<Tabs { ...props }>
<Tabs.TabList>
<Tabs.Tab
tabId="tab1"
render={
<Button icon={ wordpress } label="Tab 1" showTooltip />
}
/>
<Tabs.Tab
tabId="tab2"
render={
<Button icon={ link } label="Tab 2" showTooltip />
}
/>
<Tabs.Tab
tabId="tab3"
render={
<Button icon={ more } label="Tab 3" showTooltip />
}
/>
{ [
{
id: 'tab1',
label: 'Tab one',
icon: wordpress,
},
{
id: 'tab2',
label: 'Tab two',
icon: link,
},
{
id: 'tab3',
label: 'Tab three',
icon: more,
},
].map( ( { id, label, icon } ) => (
<Tooltip text={ label } key={ id }>
<Tabs.Tab tabId={ id } aria-label={ label }>
<Icon icon={ icon } />
</Tabs.Tab>
</Tooltip>
) ) }
</Tabs.TabList>
<Tabs.TabPanel tabId="tab1">
<p>Selected tab: Tab 1</p>
Expand Down

0 comments on commit 7728044

Please sign in to comment.