From 8763d162f892d5ccbe289de3ecc410c8af497df0 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Tue, 9 Jul 2024 16:32:37 +0200 Subject: [PATCH] Tabs: fix "With tab icons" Storybook example (#63297) * Tabs: fix "With tab icons" Storybook example * CHANGELOG --- Co-authored-by: ciampo Co-authored-by: mirka <0mirka00@git.wordpress.org> --- packages/components/CHANGELOG.md | 1 + .../src/tabs/stories/index.story.tsx | 43 +++++++++++-------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 211a4f66f48035..604a709d290f9e 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -24,6 +24,7 @@ - `TimePicker`: Fix time zone overflow ([#63209](https://github.com/WordPress/gutenberg/pull/63209)). - `SelectControl`: Fix disabled styles ([#63266](https://github.com/WordPress/gutenberg/pull/63266)). - `Tabs`: Fix text-align when text wraps in vertical mode ([#63272](https://github.com/WordPress/gutenberg/pull/63272)). +- `Tabs`: Fix "With tab icons" Storybook example ([#63297](https://github.com/WordPress/gutenberg/pull/63297)). ### Internal diff --git a/packages/components/src/tabs/stories/index.story.tsx b/packages/components/src/tabs/stories/index.story.tsx index 164b2cbb5ea9ba..e5f113d93b7d0e 100644 --- a/packages/components/src/tabs/stories/index.story.tsx +++ b/packages/components/src/tabs/stories/index.story.tsx @@ -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', @@ -110,24 +112,29 @@ const WithTabIconsAndTooltipsTemplate: StoryFn< typeof Tabs > = ( props ) => { return ( - - } - /> - - } - /> - - } - /> + { [ + { + 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 } ) => ( + + + + + + ) ) }

Selected tab: Tab 1