Skip to content

Commit b88485a

Browse files
committed
Core: Convert template globalTypes to @storybook/icons components
The core sandbox template still passed legacy string icon names in its toolbar configs, which no longer typecheck under ToolbarIconType. Switch to individually imported icon components.
1 parent 52fa1e5 commit b88485a

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

‎code/core/template/stories/preview.ts‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
import {
2+
CircleHollowIcon,
3+
GlobeIcon,
4+
MoonIcon,
5+
SideBySideIcon,
6+
StackedIcon,
7+
SunIcon,
8+
} from '@storybook/icons';
19
import type { GlobalTypes, PartialStoryFn, StoryContext } from 'storybook/internal/types';
210

311
declare global {
@@ -67,21 +75,21 @@ export const globalTypes = {
6775
name: 'Theme',
6876
description: 'Global theme for components',
6977
toolbar: {
70-
icon: 'circlehollow',
78+
icon: CircleHollowIcon,
7179
title: 'Theme',
7280
items: [
73-
{ value: 'light', icon: 'sun', title: 'light' },
74-
{ value: 'dark', icon: 'moon', title: 'dark' },
75-
{ value: 'side-by-side', icon: 'sidebyside', title: 'side by side' },
76-
{ value: 'stacked', icon: 'stacked', title: 'stacked' },
81+
{ value: 'light', icon: SunIcon, title: 'light' },
82+
{ value: 'dark', icon: MoonIcon, title: 'dark' },
83+
{ value: 'side-by-side', icon: SideBySideIcon, title: 'side by side' },
84+
{ value: 'stacked', icon: StackedIcon, title: 'stacked' },
7785
],
7886
},
7987
},
8088
locale: {
8189
name: 'Locale',
8290
description: 'Internationalization locale',
8391
toolbar: {
84-
icon: 'globe',
92+
icon: GlobeIcon,
8593
shortcuts: {
8694
next: {
8795
label: 'Go to next language',

0 commit comments

Comments
 (0)