From 9213b2191badb79c40a38c61c032af26f45bb73a Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 2 Feb 2023 08:04:33 +0800 Subject: [PATCH 1/5] Add dark mode migration --- MIGRATION.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index 483ed0b01fc5..0066b666a909 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -2,6 +2,7 @@ - [From version 6.5.x to 7.0.0](#from-version-65x-to-700) - [7.0 breaking changes](#70-breaking-changes) + - [Story context is prepared before for supporting fine grained updates](#story-context-is-prepared-before-for-supporting-fine-grained-updates) - [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below) - [ESM format in Main.js](#esm-format-in-mainjs) - [Modern browser support](#modern-browser-support) @@ -628,6 +629,14 @@ In 7.0 we've removed the following feature flags: | `breakingChangesV7` | This flag is no longer needed and should be deleted. | | `babelModeV7` | See [Babel mode v7 exclusively](#babel-mode-v7-exclusively) | +#### Dark mode detection + +Storybook 7 uses `prefers-color-scheme` to detects your system's dark mode preference if a theme is not set. + +Earlier versions used the light theme by default, so if you don't set a theme and your system's settings are in dark mode, this could surprise you. + +To manually set a theme, see [the theming docs](https://storybook.js.org/docs/react/configure/theming). + ### Core addons #### Removed auto injection of @storybook/addon-actions decorator From f7c1a9ffbf0141848daddb2fd4027bbd9799062d Mon Sep 17 00:00:00 2001 From: tyankatsu0105 Date: Wed, 22 Feb 2023 09:51:06 +0900 Subject: [PATCH 2/5] feat(addon): export interface PresetOptions --- code/addons/essentials/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/essentials/src/index.ts b/code/addons/essentials/src/index.ts index 96fd171146bb..f4f7ea1aa099 100644 --- a/code/addons/essentials/src/index.ts +++ b/code/addons/essentials/src/index.ts @@ -2,7 +2,7 @@ import path from 'path'; import { logger } from '@storybook/node-logger'; import { serverRequire } from '@storybook/core-common'; -interface PresetOptions { +export interface PresetOptions { configDir: string; docs?: boolean; controls?: boolean; From c3ae79711609b6da98592a3c828f5e77a1177dbc Mon Sep 17 00:00:00 2001 From: tyankatsu0105 Date: Wed, 22 Feb 2023 10:03:24 +0900 Subject: [PATCH 3/5] feat(addon): add description --- code/addons/essentials/src/index.ts | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/code/addons/essentials/src/index.ts b/code/addons/essentials/src/index.ts index f4f7ea1aa099..97a22c678359 100644 --- a/code/addons/essentials/src/index.ts +++ b/code/addons/essentials/src/index.ts @@ -4,13 +4,53 @@ import { serverRequire } from '@storybook/core-common'; export interface PresetOptions { configDir: string; + /** + * Allow to use @storybook/addon-docs + * @see https://storybook.js.org/addons/@storybook/addon-docs + * @default true + */ docs?: boolean; + /** + * Allow to use @storybook/addon-controls + * @see https://storybook.js.org/addons/@storybook/addon-controls + * @default true + */ controls?: boolean; + /** + * Allow to use @storybook/addon-actions + * @see https://storybook.js.org/addons/@storybook/addon-actions + * @default true + */ actions?: boolean; + /** + * Allow to use @storybook/addon-backgrounds + * @see https://storybook.js.org/addons/@storybook/addon-backgrounds + * @default true + */ backgrounds?: boolean; + /** + * Allow to use @storybook/addon-viewport + * @see https://storybook.js.org/addons/@storybook/addon-viewport + * @default true + */ viewport?: boolean; + /** + * Allow to use @storybook/addon-toolbars + * @see https://storybook.js.org/addons/@storybook/addon-toolbars + * @default true + */ toolbars?: boolean; + /** + * Allow to use @storybook/addon-measure + * @see https://storybook.js.org/addons/@storybook/addon-measure + * @default true + */ measure?: boolean; + /** + * Allow to use @storybook/addon-outline + * @see https://storybook.js.org/addons/@storybook/addon-outline + * @default true + */ outline?: boolean; } From c40614373196a60a5e57660ac5db12d9bbf53783 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 28 Nov 2023 12:40:05 +0100 Subject: [PATCH 4/5] fix --- MIGRATION.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 0066b666a909..47349ca7a747 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -19,13 +19,14 @@ - [Babel mode v7 exclusively](#babel-mode-v7-exclusively) - [Importing plain markdown files with `transcludeMarkdown` has changed](#importing-plain-markdown-files-with-transcludemarkdown-has-changed) - [7.0 feature flags removed](#70-feature-flags-removed) + - [Dark mode detection](#dark-mode-detection) - [Core addons](#core-addons) - [Removed auto injection of @storybook/addon-actions decorator](#removed-auto-injection-of-storybookaddon-actions-decorator) - [Addon-backgrounds: Removed deprecated grid parameter](#addon-backgrounds-removed-deprecated-grid-parameter) - [Addon-a11y: Removed deprecated withA11y decorator](#addon-a11y-removed-deprecated-witha11y-decorator) - [Vite](#vite) - [Vite builder uses Vite config automatically](#vite-builder-uses-vite-config-automatically) - - [Vite cache moved to node_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) + - [Vite cache moved to node\_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) - [Webpack](#webpack) - [Webpack4 support discontinued](#webpack4-support-discontinued) - [Postcss removed](#postcss-removed) @@ -64,7 +65,7 @@ - [Dropped addon-docs manual babel configuration](#dropped-addon-docs-manual-babel-configuration) - [Dropped addon-docs manual configuration](#dropped-addon-docs-manual-configuration) - [Autoplay in docs](#autoplay-in-docs) - - [Removed STORYBOOK_REACT_CLASSES global](#removed-storybook_react_classes-global) + - [Removed STORYBOOK\_REACT\_CLASSES global](#removed-storybook_react_classes-global) - [7.0 Deprecations and default changes](#70-deprecations-and-default-changes) - [storyStoreV7 enabled by default](#storystorev7-enabled-by-default) - [`Story` type deprecated](#story-type-deprecated) @@ -635,7 +636,7 @@ Storybook 7 uses `prefers-color-scheme` to detects your system's dark mode prefe Earlier versions used the light theme by default, so if you don't set a theme and your system's settings are in dark mode, this could surprise you. -To manually set a theme, see [the theming docs](https://storybook.js.org/docs/react/configure/theming). +To learn more about theming, read our [documentation](https://storybook.js.org/docs/react/configure/theming). ### Core addons From bd7fbbd8ab321b8f905c111bd6fe6381ac65447c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 28 Nov 2023 13:42:57 +0100 Subject: [PATCH 5/5] move --- MIGRATION.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 6862aa319739..d116de268ec3 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -49,6 +49,7 @@ - [7.0 feature flags removed](#70-feature-flags-removed) - [Story context is prepared before for supporting fine grained updates](#story-context-is-prepared-before-for-supporting-fine-grained-updates) - [Changed decorator order between preview.js and addons/frameworks](#changed-decorator-order-between-previewjs-and-addonsframeworks) + - [Dark mode detection](#dark-mode-detection) - [7.0 core addons changes](#70-core-addons-changes) - [Removed auto injection of @storybook/addon-actions decorator](#removed-auto-injection-of-storybookaddon-actions-decorator) - [Addon-backgrounds: Removed deprecated grid parameter](#addon-backgrounds-removed-deprecated-grid-parameter) @@ -59,7 +60,6 @@ - [Vite cache moved to node\_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) - [7.0 Webpack changes](#70-webpack-changes) - [Webpack4 support discontinued](#webpack4-support-discontinued) - - [Dark mode detection](#dark-mode-detection) - [Babel mode v7 exclusively](#babel-mode-v7-exclusively) - [Postcss removed](#postcss-removed) - [Removed DLL flags](#removed-dll-flags) @@ -1207,6 +1207,14 @@ export default { }; ``` +#### Dark mode detection + +Storybook 7 uses `prefers-color-scheme` to detects your system's dark mode preference if a theme is not set. + +Earlier versions used the light theme by default, so if you don't set a theme and your system's settings are in dark mode, this could surprise you. + +To learn more about theming, read our [documentation](https://storybook.js.org/docs/react/configure/theming). + ### 7.0 core addons changes #### Removed auto injection of @storybook/addon-actions decorator @@ -1289,14 +1297,6 @@ To upgrade: During the 7.0 dev cycle we will be updating this section with useful resources as we run across them. -#### Dark mode detection - -Storybook 7 uses `prefers-color-scheme` to detects your system's dark mode preference if a theme is not set. - -Earlier versions used the light theme by default, so if you don't set a theme and your system's settings are in dark mode, this could surprise you. - -To learn more about theming, read our [documentation](https://storybook.js.org/docs/react/configure/theming). - #### Babel mode v7 exclusively _Has automigration_