From d0ecd0c69a1e608e6ca9bdd7af91f3fee11cf02f Mon Sep 17 00:00:00 2001 From: Sergey Kozlov Date: Wed, 21 Feb 2024 19:18:01 +0400 Subject: [PATCH] use standard @storybook/icons instead of custom ucons --- package.json | 1 + src/Tool.tsx | 6 ++---- src/icons/Moon.tsx | 19 ------------------- src/icons/Sun.tsx | 28 ---------------------------- 4 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 src/icons/Moon.tsx delete mode 100644 src/icons/Sun.tsx diff --git a/package.json b/package.json index d6c97fba..1d9c3541 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@storybook/components": "^8.0.0-beta.4", "@storybook/core-events": "^8.0.0-beta.4", "@storybook/global": "^5.0.0", + "@storybook/icons": "^1.2.5", "@storybook/manager-api": "^8.0.0-beta.4", "@storybook/theming": "^8.0.0-beta.4", "fast-deep-equal": "^3.1.3", diff --git a/src/Tool.tsx b/src/Tool.tsx index c6b6943e..cdbd7344 100644 --- a/src/Tool.tsx +++ b/src/Tool.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { global } from '@storybook/global'; import { themes, ThemeVars } from '@storybook/theming'; import { IconButton } from '@storybook/components'; +import { MoonIcon, SunIcon } from '@storybook/icons'; import { STORY_CHANGED, SET_STORIES, @@ -11,9 +12,6 @@ import { API, useParameter } from '@storybook/manager-api'; import equal from 'fast-deep-equal'; import { DARK_MODE_EVENT_NAME, UPDATE_DARK_MODE_EVENT_NAME } from './constants'; -import { Sun } from './icons/Sun'; -import { Moon } from './icons/Moon'; - const { document, window } = global as { document: Document; window: Window }; const modes = ['light', 'dark'] as const; type Mode = typeof modes[number]; @@ -260,7 +258,7 @@ export function DarkMode({ api }: DarkModeProps) { } onClick={handleIconClick} > - {isDark ? : } + {isDark ?