Skip to content

Commit 65f366c

Browse files
Merge remote-tracking branch 'origin/next' into valentin/migrate-version-to-use-workspace-syntax
2 parents 7c3cde9 + 5bcced2 commit 65f366c

File tree

187 files changed

+2043
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+2043
-443
lines changed

CHANGELOG.prerelease.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 7.2.0-rc.0
2+
3+
- Addon: Create @storybook/addon-themes - [#23524](https://github.com/storybookjs/storybook/pull/23524), thanks [@Integrayshaun](https://github.com/Integrayshaun)!
4+
- Angular: Fix initialization of Storybook in Angular 16.1 - [#23598](https://github.com/storybookjs/storybook/pull/23598), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
5+
- CLI: Gracefully shutdown and cleanup execa child processes - [#23538](https://github.com/storybookjs/storybook/pull/23538), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
6+
- Dependencies: Downgrade `jest-mock` - [#23597](https://github.com/storybookjs/storybook/pull/23597), thanks [@ndelangen](https://github.com/ndelangen)!
7+
- Dependencies: Upgrade simple-update-notifier - [#23396](https://github.com/storybookjs/storybook/pull/23396), thanks [@dartess](https://github.com/dartess)!
8+
- Storyshots: fix broken storyshots with angular - [#23555](https://github.com/storybookjs/storybook/pull/23555), thanks [@mattlewis92](https://github.com/mattlewis92)!
9+
- TypeScript: Added `expanded` to `CoreCommon_StorybookRefs` to fix typescript errors - [#23488](https://github.com/storybookjs/storybook/pull/23488), thanks [@DotwoodMedia](https://github.com/DotwoodMedia)!
10+
- TypeScript: Downgrade to the last version of type-fest that doesn't need typescript 5.0 - [#23574](https://github.com/storybookjs/storybook/pull/23574), thanks [@ndelangen](https://github.com/ndelangen)!
11+
- Vue2: Source Decorator reactivity - [#23149](https://github.com/storybookjs/storybook/pull/23149), thanks [@chakAs3](https://github.com/chakAs3)!
12+
113
## 7.2.0-alpha.0
214

315
- Angular: Make enableProdMode optional - [#23489](https://github.com/storybookjs/storybook/pull/23489), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!

CODEOWNERS

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.yarnrc.yml @ndelangen @JReinhold
77

88
# Docs
9-
docs/ @kylegach @jonniebigodes
9+
/docs/ @kylegach @jonniebigodes
1010

1111
# Scripts
1212
/scripts/ @ndelangen @kasperpeulen
@@ -39,8 +39,8 @@ docs/ @kylegach @jonniebigodes
3939

4040
# Frameworks
4141
/code/frameworks/angular/ @valentinpalkovic @yannbf
42-
/code/frameworks/html-vite/ @kasperpeulen @JReinhold
43-
/code/frameworks/html-webpack5/ @kasperpeulen @JReinhold
42+
/code/frameworks/html-vite/ @kasperpeulen @JReinhold
43+
/code/frameworks/html-webpack5/ @kasperpeulen @JReinhold
4444
/code/frameworks/nextjs/ @valentinpalkovic @kasperpeulen @yannbf
4545
/code/frameworks/react-vite/ @valentinpalkovic @kasperpeulen
4646
/code/frameworks/react-webpack5/ @valentinpalkovic @kasperpeulen
@@ -61,7 +61,7 @@ docs/ @kylegach @jonniebigodes
6161
/code/lib/codemod/ @kasperpeulen @ndelangen
6262
/code/lib/core-common/ @ndelangen @yannbf
6363
/code/lib/core-events/ @ndelangen @kasperpeulen
64-
/code/lib/core-server/ @ndelangen @JReinhold @tmeasday @shilman
64+
/code/lib/core-server/ @ndelangen @JReinhold @tmeasday @shilman
6565
/code/lib/core-webpack/ @valentinpalkovic @ndelangen
6666
/code/lib/csf-plugin/ @ndelangen @valentinpalkovic
6767
/code/lib/csf-tools/ @kasperpeulen @shilman
@@ -71,7 +71,7 @@ docs/ @kylegach @jonniebigodes
7171
/code/lib/node-logger/ @yannbf @ndelangen
7272
/code/lib/preview/ @ndelangen @kasperpeulen
7373
/code/lib/preview-api/ @yannbf @ndelangen @tmeasday
74-
/code/lib/react-dom-shim/ @ndelangen @valentinpalkovic @tmeasday
74+
/code/lib/react-dom-shim/ @ndelangen @valentinpalkovic @tmeasday
7575
/code/lib/router/ @ndelangen @JReinhold
7676
/code/lib/telemetry/ @shilman @yannbf @ndelangen
7777
/code/lib/theming/ @cdedreuille @ndelangen @JReinhold

code/addons/a11y/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-a11y",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Test component compliance with web accessibility standards",
55
"keywords": [
66
"a11y",

code/addons/actions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-actions",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Get UI feedback when an action is performed on an interactive element",
55
"keywords": [
66
"storybook",

code/addons/backgrounds/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-backgrounds",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Switch backgrounds to view components in different settings",
55
"keywords": [
66
"addon",

code/addons/controls/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-controls",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Interact with component inputs dynamically in the Storybook UI",
55
"keywords": [
66
"addon",

code/addons/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-docs",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Document component usage and properties in Markdown",
55
"keywords": [
66
"addon",

code/addons/essentials/package.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-essentials",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Curated addons to bring out the best of Storybook",
55
"keywords": [
66
"addon",
@@ -93,6 +93,16 @@
9393
"require": "./dist/outline/manager.js",
9494
"import": "./dist/outline/manager.mjs"
9595
},
96+
"./themes/manager": {
97+
"types": "./dist/themes/manager.d.ts",
98+
"require": "./dist/themes/manager.js",
99+
"import": "./dist/themes/manager.mjs"
100+
},
101+
"./themes/preview": {
102+
"types": "./dist/themes/preview.d.ts",
103+
"require": "./dist/themes/preview.js",
104+
"import": "./dist/themes/preview.mjs"
105+
},
96106
"./toolbars/manager": {
97107
"types": "./dist/toolbars/manager.d.ts",
98108
"require": "./dist/toolbars/manager.js",
@@ -162,7 +172,9 @@
162172
"./src/outline/preview.ts",
163173
"./src/outline/manager.ts",
164174
"./src/toolbars/manager.ts",
165-
"./src/viewport/manager.ts"
175+
"./src/viewport/manager.ts",
176+
"./src/themes/manager.ts",
177+
"./src/themes/preview.ts"
166178
],
167179
"platform": "node"
168180
},

code/addons/essentials/src/index.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import { logger } from '@storybook/node-logger';
33
import { serverRequire } from '@storybook/core-common';
44

55
interface PresetOptions {
6-
configDir: string;
7-
docs?: boolean;
8-
controls?: boolean;
96
actions?: boolean;
107
backgrounds?: boolean;
11-
viewport?: boolean;
12-
toolbars?: boolean;
8+
configDir: string;
9+
controls?: boolean;
10+
docs?: boolean;
1311
measure?: boolean;
1412
outline?: boolean;
13+
themes?: boolean;
14+
toolbars?: boolean;
15+
viewport?: boolean;
1516
}
1617

1718
const requireMain = (configDir: string) => {
@@ -37,6 +38,8 @@ export function addons(options: PresetOptions) {
3738
};
3839

3940
const main = requireMain(options.configDir);
41+
42+
// NOTE: The order of these addons is important.
4043
return [
4144
'docs',
4245
'controls',
@@ -47,6 +50,7 @@ export function addons(options: PresetOptions) {
4750
'measure',
4851
'outline',
4952
'highlight',
53+
'themes',
5054
]
5155
.filter((key) => (options as any)[key] !== false)
5256
.filter((addon) => !checkInstalled(addon, main))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@storybook/addon-themes/manager';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line import/export
2+
export * from '@storybook/addon-themes/preview';

code/addons/gfm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-mdx-gfm",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "GitHub Flavored Markdown in Storybook",
55
"keywords": [
66
"addon",

code/addons/highlight/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-highlight",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Highlight DOM nodes within your stories",
55
"keywords": [
66
"storybook-addons",

code/addons/interactions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-interactions",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Automate, test and debug user interactions",
55
"keywords": [
66
"storybook-addons",

code/addons/jest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-jest",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "React storybook addon that show component jest report",
55
"keywords": [
66
"addon",

code/addons/links/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-links",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Link stories together to build demos and prototypes with your UI components",
55
"keywords": [
66
"addon",

code/addons/measure/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-measure",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Inspect layouts by visualizing the box model",
55
"keywords": [
66
"storybook-addons",

code/addons/outline/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-outline",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Outline all elements with CSS to help with layout placement and alignment",
55
"keywords": [
66
"storybook-addons",

code/addons/storyshots-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-storyshots",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Take a code snapshot of every story automatically with Jest",
55
"keywords": [
66
"addon",

code/addons/storyshots-puppeteer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-storyshots-puppeteer",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "Image snapshots addition to StoryShots based on puppeteer",
55
"keywords": [
66
"addon",

code/addons/storysource/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybook/addon-storysource",
3-
"version": "7.2.0-alpha.0",
3+
"version": "7.2.0-rc.0",
44
"description": "View a story’s source code to see how it works and paste into your app",
55
"keywords": [
66
"addon",

code/addons/themes/README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# `@storybook/addon-themes
2+
3+
Storybook Addon Themes can be used which between multiple themes for components inside the preview in [Storybook](https://storybook.js.org).
4+
5+
![React Storybook Screenshot](https://user-images.githubusercontent.com/42671/98158421-dada2300-1ea8-11eb-8619-af1e7018e1ec.png)
6+
7+
## Usage
8+
9+
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:
10+
11+
```sh
12+
npm i -D @storybook/addon-themes
13+
```
14+
15+
Then, add following content to [`.storybook/main.js`](https://storybook.js.org/docs/react/configure/overview#configure-your-storybook-project):
16+
17+
```js
18+
export default {
19+
addons: ['@storybook/addon-themes'],
20+
};
21+
```
22+
23+
### 👇 Tool specific configuration
24+
25+
For tool-specific setup, check out the recipes below
26+
27+
- [`@emotion/styled`](https://github.com/storybookjs/storybook/tree/next/code/addons/themes/docs/getting-started/emotion.md)
28+
- [`@mui/material`](https://github.com/storybookjs/storybook/tree/next/code/addons/themes/docs/getting-started/material-ui.md)
29+
- [`bootstrap`](https://github.com/storybookjs/storybook/tree/next/code/addons/themes/docs/getting-started/bootstrap.md)
30+
- [`styled-components`](https://github.com/storybookjs/storybook/tree/next/code/addons/themes/docs/getting-started/styled-components.md)
31+
- [`tailwind`](https://github.com/storybookjs/storybook/tree/next/code/addons/themes/docs/getting-started/tailwind.md)
32+
- [`[email protected]`](https://github.com/storybookjs/storybook/blob/next/code/addons/themes/docs/api.md#writing-a-custom-decorator)
33+
34+
Don't see your favorite tool listed? Don't worry! That doesn't mean this addon isn't for you. Check out the ["Writing a custom decorator"](https://github.com/storybookjs/storybook/blob/next/code/addons/themes/docs/api.md#writing-a-custom-decorator) section of the [api reference](https://github.com/storybookjs/storybook/blob/next/code/addons/themes/docs/api.md).
35+
36+
### ❗️ Overriding theme
37+
38+
If you want to override your theme for a particular component or story, you can use the `themes.themeOverride` parameter.
39+
40+
```js
41+
import React from 'react';
42+
import { Button } from './Button';
43+
44+
export default {
45+
title: 'Example/Button',
46+
component: Button,
47+
parameters: {
48+
themes: {
49+
themeOverride: 'light', // component level override
50+
},
51+
},
52+
};
53+
54+
export const Primary = {
55+
args: {
56+
primary: true,
57+
label: 'Button',
58+
},
59+
};
60+
61+
export const PrimaryDark = {
62+
args: {
63+
primary: true,
64+
label: 'Button',
65+
},
66+
parameters: {
67+
themes: {
68+
themeOverride: 'dark', // Story level override
69+
},
70+
},
71+
};
72+
```

0 commit comments

Comments
 (0)