Skip to content

Commit

Permalink
Add themes to Essentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun Lloyd committed Jul 20, 2023
1 parent a50b2ef commit 3f01f1d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
11 changes: 11 additions & 0 deletions code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
22 changes: 12 additions & 10 deletions code/addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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))
Expand Down
1 change: 1 addition & 0 deletions code/addons/essentials/src/themes/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@storybook/addon-themes/manager';
1 change: 1 addition & 0 deletions code/addons/essentials/src/themes/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@storybook/addon-themes/preview';

0 comments on commit 3f01f1d

Please sign in to comment.