From 3f01f1df81c2d24b0a254e8522b333ea993e4a59 Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Thu, 20 Jul 2023 15:50:18 -0400 Subject: [PATCH] Add themes to Essentials --- code/addons/essentials/package.json | 11 ++++++++++ code/addons/essentials/src/index.ts | 22 +++++++++++--------- code/addons/essentials/src/themes/manager.ts | 1 + code/addons/essentials/src/themes/preview.ts | 1 + 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 code/addons/essentials/src/themes/manager.ts create mode 100644 code/addons/essentials/src/themes/preview.ts diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index bfdc135d190b..066f4f0721be 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -93,6 +93,16 @@ "require": "./dist/outline/manager.js", "import": "./dist/outline/manager.mjs" }, + "./themes/manager": { + "types": "./dist/themes/manager.d.ts", + "require": "./dist/themes/manager.js", + "import": "./dist/themes/manager.mjs" + }, + "./themes/preview": { + "types": "./dist/themes/preview.d.ts", + "require": "./dist/themes/preview.js", + "import": "./dist/themes/preview.mjs" + }, "./toolbars/manager": { "types": "./dist/toolbars/manager.d.ts", "require": "./dist/toolbars/manager.js", @@ -126,6 +136,7 @@ "@storybook/addon-highlight": "7.1.0", "@storybook/addon-measure": "7.1.0", "@storybook/addon-outline": "7.1.0", + "@storybook/addon-themes": "7.1.0", "@storybook/addon-toolbars": "7.1.0", "@storybook/addon-viewport": "7.1.0", "@storybook/core-common": "7.1.0", diff --git a/code/addons/essentials/src/index.ts b/code/addons/essentials/src/index.ts index 96fd171146bb..f7fe3e599856 100644 --- a/code/addons/essentials/src/index.ts +++ b/code/addons/essentials/src/index.ts @@ -3,15 +3,16 @@ import { logger } from '@storybook/node-logger'; import { serverRequire } from '@storybook/core-common'; interface PresetOptions { - configDir: string; - docs?: boolean; - controls?: boolean; actions?: boolean; backgrounds?: boolean; - viewport?: boolean; - toolbars?: boolean; + configDir: string; + controls?: boolean; + docs?: boolean; measure?: boolean; outline?: boolean; + themes?: boolean; + toolbars?: boolean; + viewport?: boolean; } const requireMain = (configDir: string) => { @@ -38,15 +39,16 @@ export function addons(options: PresetOptions) { const main = requireMain(options.configDir); return [ - 'docs', - 'controls', 'actions', 'backgrounds', - 'viewport', - 'toolbars', + 'controls', + 'docs', + 'highlight', 'measure', 'outline', - 'highlight', + 'themes', + 'toolbars', + 'viewport', ] .filter((key) => (options as any)[key] !== false) .filter((addon) => !checkInstalled(addon, main)) diff --git a/code/addons/essentials/src/themes/manager.ts b/code/addons/essentials/src/themes/manager.ts new file mode 100644 index 000000000000..84a500ab3a74 --- /dev/null +++ b/code/addons/essentials/src/themes/manager.ts @@ -0,0 +1 @@ +export * from '@storybook/addon-themes/manager'; diff --git a/code/addons/essentials/src/themes/preview.ts b/code/addons/essentials/src/themes/preview.ts new file mode 100644 index 000000000000..4abc0dfe9b00 --- /dev/null +++ b/code/addons/essentials/src/themes/preview.ts @@ -0,0 +1 @@ +export * from '@storybook/addon-themes/preview';