Skip to content

Commit

Permalink
(essentials): remove addon-themes from essentials #23652
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun Evening committed Jul 31, 2023
2 parents 3bf0237 + 9bf1a7c commit fb1895f
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 34 deletions.
15 changes: 1 addition & 14 deletions code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@
"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 @@ -136,7 +126,6 @@
"@storybook/addon-highlight": "workspace:*",
"@storybook/addon-measure": "workspace:*",
"@storybook/addon-outline": "workspace:*",
"@storybook/addon-themes": "workspace:*",
"@storybook/addon-toolbars": "workspace:*",
"@storybook/addon-viewport": "workspace:*",
"@storybook/core-common": "workspace:*",
Expand Down Expand Up @@ -173,9 +162,7 @@
"./src/outline/preview.ts",
"./src/outline/manager.ts",
"./src/toolbars/manager.ts",
"./src/viewport/manager.ts",
"./src/themes/manager.ts",
"./src/themes/preview.ts"
"./src/viewport/manager.ts"
],
"platform": "node"
},
Expand Down
1 change: 0 additions & 1 deletion code/addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function addons(options: PresetOptions) {
'measure',
'outline',
'highlight',
'themes',
]
.filter((key) => (options as any)[key] !== false)
.filter((addon) => !checkInstalled(addon, main))
Expand Down
1 change: 0 additions & 1 deletion code/addons/essentials/src/themes/manager.ts

This file was deleted.

2 changes: 0 additions & 2 deletions code/addons/essentials/src/themes/preview.ts

This file was deleted.

2 changes: 1 addition & 1 deletion code/addons/themes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Storybook Addon Themes can be used which between multiple themes for components

## Usage

Requires Storybook 7.0 or later. Themes is part of [essentials](https://storybook.js.org/docs/react/essentials/introduction) and so is installed in all new Storybooks by default. If you need to add it to your Storybook, you can run:
Requires Storybook 7.0 or later. If you need to add it to your Storybook, you can run:

```sh
npm i -D @storybook/addon-themes
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/docs/getting-started/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 📦 Install addon

**NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Import Bootstrap"](#🥾-import-bootstrap).
<!-- **NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Import Bootstrap"](#🥾-import-bootstrap). -->

To get started, **install the package** as a dev dependency

Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/docs/getting-started/emotion.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 📦 Install addon

**NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Provide your themes"](#🎨-provide-your-themes).
<!-- **NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Provide your themes"](#🎨-provide-your-themes). -->

To get started, **install the package** as a dev dependency

Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/docs/getting-started/material-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 📦 Install addon

**NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Import fonts"](#🔤-import-fonts).
<!-- **NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Import fonts"](#🔤-import-fonts). -->

To get started, **install the package** as a dev dependency

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 📦 Install addon

**NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Provide your themes"](#🎨-provide-your-themes).
<!-- **NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Provide your themes"](#🎨-provide-your-themes). -->

To get started, **install the package** as a dev dependency

Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/docs/getting-started/tailwind.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 📦 Install addon

**NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Import your css"](#🥾-import-your-css).
<!-- **NOTE:** As of Storybook 7.2, `@storybook/addon-themes` ships in `@storybook/addon-essentials`. If you're using Storybook >= 7.2, skip to ["Import your css"](#🥾-import-your-css). -->

To get started, **install the package** as a dev dependency

Expand Down
3 changes: 1 addition & 2 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5715,7 +5715,6 @@ __metadata:
"@storybook/addon-highlight": "workspace:*"
"@storybook/addon-measure": "workspace:*"
"@storybook/addon-outline": "workspace:*"
"@storybook/addon-themes": "workspace:*"
"@storybook/addon-toolbars": "workspace:*"
"@storybook/addon-viewport": "workspace:*"
"@storybook/core-common": "workspace:*"
Expand Down Expand Up @@ -6028,7 +6027,7 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/addon-themes@workspace:*, @storybook/addon-themes@workspace:addons/themes":
"@storybook/addon-themes@workspace:addons/themes":
version: 0.0.0-use.local
resolution: "@storybook/addon-themes@workspace:addons/themes"
dependencies:
Expand Down
4 changes: 1 addition & 3 deletions docs/essentials/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ A major strength of Storybook are [addons](https://storybook.js.org/addons) that
- [Docs](../writing-docs/introduction.md)
- [Highlight](./highlight.md)
- [Measure & outline](./measure-and-outline.md)
- [Themes](./themes.md)
- [Toolbars & globals](./toolbars-and-globals.md)
- [Viewport](./viewport.md)

Expand Down Expand Up @@ -98,7 +97,6 @@ Below is an abridged configuration and table with all the available options for
| `@storybook/addon-backgrounds` | N/A | N/A |
| `@storybook/addon-toolbars` | N/A | N/A |
| `@storybook/addon-measure` | N/A | N/A |
| `@storybook/addon-themes` | N/A | Provide and switch between multiple themes for components inside the preview in [Storybook](https://storybook.js.org). |

When you start Storybook, your custom configuration will override the default.

Expand All @@ -121,6 +119,6 @@ For example, if you wanted to disable the [backgrounds addon](./backgrounds.md),

<div class="aside">

💡 You can use the following keys for each individual addon: `actions`, `backgrounds`, `controls`, `docs`, `viewport`, `toolbars`, `measure`, `outline`, `highlight`, `themes`.
💡 You can use the following keys for each individual addon: `actions`, `backgrounds`, `controls`, `docs`, `viewport`, `toolbars`, `measure`, `outline`, and `highlight`.

</div>
10 changes: 5 additions & 5 deletions docs/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ module.exports = {
title: 'Measure & Outline',
type: 'link',
},
{
pathSegment: 'themes',
title: 'Themes',
type: 'link',
},
// {
// pathSegment: 'themes',
// title: 'Themes',
// type: 'link',
// },
{
pathSegment: 'toolbars-and-globals',
title: 'Toolbars & globals',
Expand Down

0 comments on commit fb1895f

Please sign in to comment.