Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Prerelease beta 8.1.0-beta.0 #27036

Merged
merged 159 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
c9dc4e0
Fix #25759: Panel resizing is not applied when done too fast
jorge-ji Mar 12, 2024
32e854a
Add metaTags, tag removal
shilman Mar 24, 2024
ab64211
Switch tag removal prefix from `-` to `!`
shilman Mar 26, 2024
445e0cd
Merge branch 'next' into my-first-storybook-contribution
ndelangen Mar 26, 2024
b5b17f5
Add project-level tags
shilman Mar 29, 2024
c52d943
Deprecate main.js docs.autodocs in favor of tags
shilman Mar 29, 2024
ebce080
Add autodocs tag in preview if docs.autodics is true
shilman Mar 29, 2024
3317619
Add docs for story tags
kylegach Apr 2, 2024
f54b030
Always apply dev/docs/test tags
shilman Apr 4, 2024
fea9c2e
Fix tag precedence in CSF combineTags util
shilman Apr 5, 2024
bcd3da8
Remove metaTags concept
shilman Apr 5, 2024
1efccbe
WIP
kylegach Apr 15, 2024
0242371
Split into 3 pages
kylegach Apr 16, 2024
ff3f2e9
Add Modules section to Next.js docs
JReinhold Apr 16, 2024
92e1382
More mocking content
kylegach Apr 16, 2024
75b0820
Updates for Next.js
kylegach Apr 16, 2024
299a2c2
Simplify Building pages with Storybook guide
kylegach Apr 16, 2024
ec6742b
Update Decorators and Interaction tests pages
kylegach Apr 17, 2024
abc9b7c
Add missing TODOs
kylegach Apr 17, 2024
194a9bc
Add vite example
kylegach Apr 17, 2024
f2f4d13
clarify mock->original import limitations.
JReinhold Apr 17, 2024
e7c0676
add paragraph on mocking external modules.
JReinhold Apr 17, 2024
5d8ee28
add docs on `beforeEach`, `cleanup`, `parameters.test`
JReinhold Apr 17, 2024
4faf1ae
simplify subpath example in nextjs
JReinhold Apr 17, 2024
2ac03c4
Address feedback
kylegach Apr 18, 2024
b1da9c9
add getPackageAliases example
JReinhold Apr 18, 2024
71a4cea
add examples to next mock docs
JReinhold Apr 18, 2024
5bab73a
improve documentation for parameters.test.dangerouslyIgnoreUnhandledE…
JReinhold Apr 18, 2024
46c31eb
remove docs on default router and navigation contexts
JReinhold Apr 18, 2024
eef3290
add reasons for aliases in nextjs+jest
JReinhold Apr 18, 2024
f88bea5
Add back nextjs router/navigation override instructions
kylegach Apr 19, 2024
3f7e44c
Improve MSW snippets
kylegach Apr 19, 2024
8eaeb94
Address MSW snippets feedback
kylegach Apr 19, 2024
f4914e3
Prettify snippets
kylegach Apr 19, 2024
eae5d3a
Merge branch 'next' into my-first-storybook-contribution
JReinhold Apr 22, 2024
875af9d
Merge branch 'next' into my-first-storybook-contribution
JReinhold Apr 24, 2024
9f7ca74
add react prerelease sandbox templates
JReinhold Apr 26, 2024
5731002
Merge branch 'next' of github.com:storybookjs/storybook into jeppe/re…
JReinhold Apr 26, 2024
bc44d82
disable snapshots for ResolvedReact stories
JReinhold Apr 26, 2024
5d8fd43
adjust ci parallelism
JReinhold Apr 26, 2024
d6f8032
allow react 19 betas in packages' peer dependencies
JReinhold Apr 26, 2024
e244830
use beta instead of next react version
JReinhold Apr 26, 2024
18df4de
fix: remove state from dependency array
jorge-ji Apr 27, 2024
3ed89f3
Merge branch 'next' into my-first-storybook-contribution
ndelangen Apr 29, 2024
cf2be73
Add new actions to the bottom of the panel and auto scroll
kasperpeulen Apr 17, 2024
42773e3
Address review
kasperpeulen Apr 17, 2024
e850d36
add cache.mock entrypoint to nextjs
JReinhold Apr 17, 2024
401fd26
Try another mock naming convention
kasperpeulen Apr 16, 2024
9920353
Bind this
kasperpeulen Apr 16, 2024
b55673f
Update snapshot
kasperpeulen Apr 16, 2024
a033167
Fix name
kasperpeulen Apr 16, 2024
537fbb2
Hide some junk of next for nwo
kasperpeulen Apr 16, 2024
7cacdfa
Update code/frameworks/nextjs/src/export-mocks/navigation/index.ts
kasperpeulen Apr 16, 2024
af31a1f
Update code/frameworks/nextjs/src/export-mocks/navigation/index.ts
kasperpeulen Apr 16, 2024
789991f
Update code/frameworks/nextjs/src/export-mocks/navigation/index.ts
kasperpeulen Apr 16, 2024
17c5152
Update code/frameworks/nextjs/src/export-mocks/navigation/index.ts
kasperpeulen Apr 16, 2024
fc7e664
Hide some junk of next for now
kasperpeulen Apr 16, 2024
5fafb46
Show redirect and next/cache spies
kasperpeulen Apr 16, 2024
a9ce1d4
Apply suggestions from code review
kylegach Apr 30, 2024
01c6509
Address feedback
kylegach Apr 30, 2024
39689ac
Merge branch 'kasper/module-mocking' into module-mocking-docs
kylegach Apr 30, 2024
1dca308
Snippetize examples
kylegach May 1, 2024
6bf05a1
Remove unnecessary snippets
kylegach May 1, 2024
c715248
Prettify snippets
kylegach May 1, 2024
27d7ed9
Upgrade @joshwooding/vite-plugin-react-docgen-typescript to 0.3.1
joshwooding Mar 28, 2024
f4b07b5
Merge branch 'next' into my-first-storybook-contribution
ndelangen May 1, 2024
7be08e3
Address feedback
kylegach May 1, 2024
ef6710f
Fix broken migration notes for @storybook/addon-knobs
SpanishPear May 2, 2024
a9d9bfa
Update decorator snippets
kylegach May 3, 2024
370cff6
Update index.md
laurens94 May 3, 2024
d2f7fe8
Address feedback
kylegach May 3, 2024
88253e4
add react 19 types resolutions, allow peer dep problems in prereleases.
JReinhold May 3, 2024
ea2f38c
Merge branch 'next' into jeppe/react-prerelease-sandboxes
JReinhold May 3, 2024
da74a1f
Merge branch 'next' of github.com:storybookjs/storybook into jeppe/re…
JReinhold May 4, 2024
e55bee6
Merge branch 'next' into shilman/add-tag-exclusion
shilman May 4, 2024
f677115
Add preview.js watcher for project tags
shilman May 4, 2024
5dfa56b
Restore dev/docs/test default tags
shilman May 4, 2024
3160354
Preserver negated tags for index
shilman May 5, 2024
a9c0730
Remove auto-generated story tag, update tests
shilman May 5, 2024
ca88bca
Add dev/docs tag behaviors
shilman May 5, 2024
d89ff2e
Deprecate main.js `docs.autodocs` and remove from CLI template
shilman May 5, 2024
1e0e822
Update CHANGELOG.md for v8.0.10 [skip ci]
storybook-bot May 5, 2024
bd1f0cb
expect React 19 in react prerelease sandboxes
JReinhold May 5, 2024
206e6ec
dont be stupid now
JReinhold May 5, 2024
6b20236
convert defaultProps to default assignments in functional components.
JReinhold May 5, 2024
4f2bec7
Fix incorrect TypeScript syntax
r4ai May 6, 2024
2f7978c
Unpublish portable stories jest/vitest for now
kylegach May 6, 2024
149dd06
Replace `docs` tag by `autodocs`
shilman May 6, 2024
5fc32ee
Fix MDX detection now that MDX can inherit autodocs tags
shilman May 6, 2024
8f7d569
Update snapshots
shilman May 6, 2024
d4ac168
Merge branch 'next' into shilman/add-tag-exclusion
shilman May 6, 2024
5b46717
Fix portable stories tests
shilman May 6, 2024
f5447a3
Fix tags inheritance story
shilman May 6, 2024
74afbb1
add react types resolutions to react-webpack/prerelease template.
JReinhold May 6, 2024
493679c
Merge pull request #27029 from r4ai/fix-coverage-config-snippets
yannbf May 6, 2024
254e03e
Merge pull request #27006 from SpanishPear/patch-1
yannbf May 6, 2024
638b96a
only allow peer dependency errors in react prereleases
JReinhold May 6, 2024
01923cd
Remove bogus console.log
shilman May 6, 2024
dc28521
Try clearing the webpack mock
shilman May 6, 2024
6a6da24
Merge pull request #26960 from storybookjs/jeppe/react-prerelease-san…
JReinhold May 6, 2024
d810f8e
Try to fix CI
shilman May 6, 2024
dfa82ab
Address feedback
kylegach May 6, 2024
2a0d245
Merge branch 'next' into module-mocking-docs
kylegach May 6, 2024
bdbd332
Fix bad merge
shilman May 6, 2024
8648002
Merge pull request #26858 from storybookjs/module-mocking-docs
kylegach May 6, 2024
b751b83
Merge branch 'next' into shilman/add-tag-exclusion
shilman May 6, 2024
2c0005b
Merge branch 'next' into patch-1
laurens94 May 6, 2024
64c67b4
Revise tags docs
kylegach May 6, 2024
b44b838
Merge branch 'next' into tags-docs
kylegach May 6, 2024
c992970
Fix bad link
kylegach May 6, 2024
cbadd74
Merge pull request #27042 from storybookjs/docs-mdx-gfm-link
kylegach May 6, 2024
348d23b
Mention badges addon
kylegach May 7, 2024
af3906d
Revert "Revert "Nextjs: Implement next redirect and the RedirectBound…
yannbf May 7, 2024
31ae4d6
Fix yarn.lock
shilman May 7, 2024
1a4bd14
Update csf-tools babel deps
shilman May 7, 2024
8b35e06
Another attempt to fix yarn.lock
shilman May 7, 2024
15d7ef9
Continue to show autodocs even when primary story is !dev
shilman May 7, 2024
83639e0
Add e2e tests for new tags behavior
shilman May 7, 2024
a1ca72d
Next.js: Implement next redirect and the RedirectBoundary
yannbf May 7, 2024
aad8a11
Fix CI?
shilman May 7, 2024
607c790
max of 5 concurrent tasks on CI
ndelangen May 7, 2024
b218ba4
fix: bump ejs to 3.1.10
rui-silva-beqom May 7, 2024
9c4a5e5
update comment
ndelangen May 7, 2024
872630f
Merge pull request #27052 from storybookjs/norbert/lower-cpu-usage-ci
ndelangen May 7, 2024
2707c15
Build: Add E2E tests for the module mocking stories
yannbf May 7, 2024
561ad98
fix mock name
yannbf May 7, 2024
0ac197d
Fix CRA not respecting storybook import condition names.
JReinhold May 7, 2024
2793bcc
Merge branch 'next' into upgrade-vite-plugin-react-docgen-typescript
ndelangen May 7, 2024
27dc023
Merge pull request #27050 from storybookjs/yann/nextjs-redirect-boundary
yannbf May 7, 2024
56debf0
Merge pull request #27046 from storybookjs/yann/add-module-mocking-e2…
JReinhold May 7, 2024
14f86ec
Fix tags stories
shilman May 7, 2024
cb49021
Merge branch 'next' into patch-1
jonniebigodes May 7, 2024
2dee030
Merge branch 'next' into shilman/add-tag-exclusion
shilman May 7, 2024
ad98449
Merge pull request #27019 from laurens94/patch-1
jonniebigodes May 7, 2024
a17fe0b
Merge pull request #26673 from storybookjs/upgrade-vite-plugin-react-…
ndelangen May 7, 2024
25ed3c2
Snippetize examples
kylegach May 7, 2024
a379e68
Merge branch 'next' into unpublish-portable-stories-jest-vitest
kylegach May 7, 2024
c6348d2
Merge pull request #27056 from storybookjs/unpublish-portable-stories…
kylegach May 7, 2024
e62d7f3
Merge pull request #26634 from storybookjs/shilman/add-tag-exclusion
shilman May 7, 2024
50dd267
Update module mocking docs
kylegach May 7, 2024
34c0e17
Address feedback
kylegach May 7, 2024
ca13021
Docs: Minor fixes to the testing snippets
jonniebigodes May 7, 2024
7c9db11
Merge pull request #27058 from storybookjs/docs_fix_storyshots_migrat…
jonniebigodes May 7, 2024
92a2180
Merge branch 'next' into module-mocking-docs-2
kylegach May 7, 2024
37f944a
Merge pull request #27057 from storybookjs/module-mocking-docs-2
kylegach May 7, 2024
d06d40d
Merge pull request #27054 from RiuSalvi/next
JReinhold May 7, 2024
974ad92
Merge branch 'next' into tags-docs
kylegach May 7, 2024
4ea3fcf
Merge pull request #26715 from storybookjs/tags-docs
kylegach May 7, 2024
abff28c
Merge pull request #26460 from jorge-ji/my-first-storybook-contribution
JReinhold May 7, 2024
6012858
do not warn on nextjs prerelease as @JReinholdsuggested
ndelangen May 8, 2024
f6b4fbd
fix e2e test for nextjs/prerelease
ndelangen May 8, 2024
8787873
Merge pull request #27065 from storybookjs/norbert/add-nextjs-peerwar…
ndelangen May 8, 2024
85690eb
add extention to prevent failure to load .ts files in CRA
ndelangen May 9, 2024
d9e824e
improve UI of onboarding
ndelangen May 9, 2024
15a49b4
remove link to missing portable stories docs
JReinhold May 9, 2024
f9ca4d0
Merge pull request #27072 from storybookjs/norbert/fix-mock-test-cra
ndelangen May 9, 2024
25de7f6
Merge pull request #27075 from storybookjs/jeppe/remove-portable-stor…
ndelangen May 9, 2024
4d8b2c9
Merge pull request #27074 from storybookjs/norbert/improve-ui-onboarding
ndelangen May 9, 2024
e19d316
Write changelog for 8.1.0-beta.0 [skip ci]
storybook-bot May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -768,30 +768,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 35
parallelism: 37
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 35
parallelism: 37
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 32
parallelism: 34
requires:
- build-sandboxes
- e2e-production:
parallelism: 30
parallelism: 32
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 30
parallelism: 32
requires:
- build-sandboxes
- test-portable-stories:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 8.0.10

- MDX: Don't transform `http://` links - [#26488](https://github.com/storybookjs/storybook/pull/26488), thanks @JReinhold!
- React: Support v19 in `react-dom-shim` - [#26898](https://github.com/storybookjs/storybook/pull/26898), thanks @Tobbe!
- Vite: Merge assetsInclude property with Storybook default values - [#26860](https://github.com/storybookjs/storybook/pull/26860), thanks @yuemori!

## 8.0.9

- Addon-docs: Fix MDX compilation when using `@vitejs/plugin-react-swc` with plugins - [#26837](https://github.com/storybookjs/storybook/pull/26837), thanks @JReinhold!
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 8.1.0-beta.0

- Dependencies: Upgrade `@joshwooding/vite-plugin-react-docgen-typescript` to `0.3.1` - [#26673](https://github.com/storybookjs/storybook/pull/26673), thanks @joshwooding!
- Dependencies: Upgrade `ejs` to `3.1.10` - [#27054](https://github.com/storybookjs/storybook/pull/27054), thanks @RiuSalvi!
- Nextjs: Implement next redirect and the RedirectBoundary - [#27050](https://github.com/storybookjs/storybook/pull/27050), thanks @yannbf!
- Onboarding: Improve UI - [#27074](https://github.com/storybookjs/storybook/pull/27074), thanks @ndelangen!
- Portable Stories: Remove link to missing docs - [#27075](https://github.com/storybookjs/storybook/pull/27075), thanks @JReinhold!
- React: Support v19 betas in peer dependencies - [#26960](https://github.com/storybookjs/storybook/pull/26960), thanks @JReinhold!
- Tags: Add project tags, negation, `dev`/`autodocs`/`test` system tags - [#26634](https://github.com/storybookjs/storybook/pull/26634), thanks @shilman!
- UI: Fix panel layout resizing do not apply when done too fast - [#26460](https://github.com/storybookjs/storybook/pull/26460), thanks @jorge-ji!

## 8.1.0-alpha.8

- Addon-actions: Fix falsy args printing as object - 22163 - [#26917](https://github.com/storybookjs/storybook/pull/26917), thanks @Fatcat560!
Expand Down
48 changes: 44 additions & 4 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<h1>Migration</h1>

- [From version 8.0.x to 8.1.x](#from-version-80x-to-81x)
- [Subtitle block and `parameters.componentSubtitle`](#subtitle-block-and-parameterscomponentsubtitle)
- [Title block](#title-block)
- [Portable stories](#portable-stories)
- [@storybook/nextjs requires specific path aliases to be setup](#storybooknextjs-requires-specific-path-aliases-to-be-setup)
- [main.js `docs.autodocs` is deprecated](#mainjs-docsautodocs-is-deprecated)
- [`docs` and `story` system tags removed](#docs-and-story-system-tags-removed)
- [Subtitle block and `parameters.componentSubtitle`](#subtitle-block-and-parameterscomponentsubtitle)
- [Title block `of` prop](#title-block-of-prop)
- [From version 7.x to 8.0.0](#from-version-7x-to-800)
- [Portable stories](#portable-stories-1)
- [Project annotations are now merged instead of overwritten in composeStory](#project-annotations-are-now-merged-instead-of-overwritten-in-composestory)
Expand Down Expand Up @@ -430,13 +432,51 @@ module.exports = createJestConfig(customJestConfig);

This will make sure you end using the correct implementation of the packages and avoid having issues in your tests.

### main.js `docs.autodocs` is deprecated

The `docs.autodocs` setting in `main.js` is deprecated in 8.1 and will be removed in 9.0.

It has been replaced with a tags-based system which is more flexible than before.

`docs.autodocs` takes three values:
- `true`: generate autodocs for every component
- `false`: don't generate autodocs at all
- `tag`: generate autodocs for components that have been tagged `'autodocs'`.

Starting in 8.1, to generate autodocs for every component (`docs.autodocs = true`), add the following code to `.storybook/preview.js`:

```js
// .storybook/preview.js
export default {
tags: ['autodocs'],
}
```

Tags cascade, so setting `'autodocs'` at the project level automatically propagates to every component and story. If you set autodocs globally and want to opt-out for a particular component, you can remove the `'autodocs'` tag for a component like this:

```js
// Button.stories.ts
export default {
component: Button,
tags: ['!autodocs'],
}
```

If you had set `docs.autodocs = 'tag'`, the default setting, you can remove the setting from `.storybook/main.js`. That is now the default behavior.

If you had set `docs.autodocs = false`, this still works in 8.x, but will go away in 9.0 as a breaking change. If you don't want autodocs at all, simply remove the `'autodocs'` tag throughout your Storybook and autodocs will not be created.

### `docs` and `story` system tags removed

Storybook automatically added the tag `'docs'` to any docs entry in the index and `'story'` to any story entry in the index. This behavior was undocumented, and in an effort to reduce the number of tags we've removed them in 8.1. If you depended on these tags, please file an issue on the [Storybook monorepo](https://github.com/storybookjs/storybook) and let us know!

### Subtitle block and `parameters.componentSubtitle`

The `Subtitle` block now accepts an `of` prop, which can be a reference to a CSF file or a default export (meta).

`parameters.componentSubtitle` has been deprecated to be consistent with other parameters related to autodocs, instead use `parameters.docs.subtitle`.

##### Title block
### Title block `of` prop

The `Title` block now accepts an `of` prop, which can be a reference to a CSF file or a default export (meta).

Expand Down Expand Up @@ -3859,7 +3899,7 @@ export default {
We are replacing `@storybook/addon-knobs` with `@storybook/addon-controls`.

- [Rationale & discussion](https://github.com/storybookjs/storybook/discussions/15060)
- [Migration notes](https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#how-do-i-migrate-from-addon-knobs)
- [Migration notes](https://github.com/storybookjs/storybook/blob/next/code/addons/controls/README.md#how-do-i-migrate-from-addon-knobs)

#### Deprecated scoped blocks imports

Expand Down
4 changes: 3 additions & 1 deletion code/addons/docs/src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export const parameters: any = {
filter: (story: PreparedStory) => {
const tags = story.tags || [];
return (
tags.filter((tag) => excludeTags[tag]).length === 0 && !story.parameters.docs?.disable
tags.includes('autodocs') &&
tags.filter((tag) => excludeTags[tag]).length === 0 &&
!story.parameters.docs?.disable
);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export default {
docs: {
name: 'ResolvedReact',
},
// the version string changes with every release of React/Next.js/Preact, not worth snapshotting
chromatic: { disable: true },
},
};

Expand Down
2 changes: 1 addition & 1 deletion code/addons/gfm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const mdxLoaderOptions = async (config: any) => {
deprecate(dedent`
The "@storybook/addon-mdx-gfm" addon is meant as a migration assistant for Storybook 8.0; and will likely be removed in a future version.
It's recommended you read this document:
https://storybook.js.org/docs/react/writing-docs/mdx#lack-of-github-flavored-markdown-gfm
https://storybook.js.org/docs/writing-docs/mdx#markdown-tables-arent-rendering-correctly

Once you've made the necessary changes, you can remove the addon from your package.json and storybook config.
`);
4 changes: 2 additions & 2 deletions code/addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/csf": "^0.1.6",
"@storybook/csf": "^0.1.7",
"@storybook/global": "^5.0.0",
"ts-dedent": "^2.0.0"
},
Expand All @@ -82,7 +82,7 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta"
},
"peerDependenciesMeta": {
"react": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { keyframes, styled } from '@storybook/theming';
import { Modal } from '@storybook/components';

export const ModalWrapper = styled(Modal)`
background: white;
`;
export const ModalWrapper = styled(Modal)``;

export const ModalContent = styled.div`
display: flex;
Expand All @@ -21,10 +19,13 @@ export const Main = styled.div`
flex: 1;
display: flex;
flex-direction: column;
background: white;
font-family: ${({ theme }) => theme.typography.fonts.base};
`;

export const Header = styled.div`
position: relative;
z-index: 1;
box-sizing: border-box;
display: flex;
justify-content: space-between;
Expand Down Expand Up @@ -64,20 +65,20 @@ export const Content = styled.div`
}
`;

export const SpanHighlight = styled.span`
display: inline-flex;
border-radius: 3px;
padding: 0 5px;
margin-bottom: -2px;
opacity: 0.8;
font-family: ${({ theme }) => theme.typography.fonts.mono};
font-size: 11px;
border: 1px solid #ecf4f9;
color: ${({ theme }) => theme.color.darkest};
background-color: #f7fafc;
box-sizing: border-box;
line-height: 17px;
`;
export const SpanHighlight = styled.span(({ theme }) => ({
display: 'inline-flex',
borderRadius: 3,
padding: '0 5px',
marginBottom: -2,
opacity: 0.8,
fontFamily: theme.typography.fonts.mono,
fontSize: 11,
border: theme.base === 'dark' ? theme.color.darkest : theme.color.lightest,
color: theme.base === 'dark' ? theme.color.lightest : theme.color.darkest,
backgroundColor: theme.base === 'dark' ? 'black' : theme.color.light,
boxSizing: 'border-box',
lineHeight: '17px',
}));

export const Image = styled.img`
max-width: 100%;
Expand All @@ -90,8 +91,10 @@ export const Background = styled.div`
left: 0;
width: 100%;
height: 100%;
z-index: -1;
z-index: 0;
overflow: hidden;
z-index: 0;
pointer-events: none;
`;

export const circle1Anim = keyframes`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export const WriteStoriesModal: FC<WriteStoriesModalProps> = ({
</Button>
)}
<Main>
<Background>
<Circle1 />
<Circle2 />
<Circle3 />
</Background>

<Header>
<Modal.Title asChild>
<ModalTitle>
Expand Down Expand Up @@ -280,11 +286,6 @@ export const WriteStoriesModal: FC<WriteStoriesModalProps> = ({
) : null)}
</Content>
</Modal.Description>
<Background>
<Circle1 />
<Circle2 />
<Circle3 />
</Background>
</Main>
</ModalContent>
</ModalWrapper>
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/ejs": "^3.1.1",
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
"browser-assert": "^1.2.1",
"ejs": "^3.1.8",
"ejs": "^3.1.10",
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0",
"esbuild-plugin-alias": "^0.2.1",
"express": "^4.17.3",
Expand Down
6 changes: 6 additions & 0 deletions code/e2e-tests/addon-docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ test.describe('addon-docs', () => {
expectedReactVersionRange = /^17/;
} else if (templateName.includes('react16')) {
expectedReactVersionRange = /^16/;
} else if (
templateName.includes('nextjs/prerelease') ||
templateName.includes('react-vite/prerelease') ||
templateName.includes('react-webpack/prerelease')
) {
expectedReactVersionRange = /^19/;
}

// Arrange - Get the actual versions
Expand Down
49 changes: 49 additions & 0 deletions code/e2e-tests/module-mocking.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { test, expect } from '@playwright/test';
import process from 'process';
import { SbPage } from './util';

const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001';

test.describe('module-mocking', () => {
test.beforeEach(async ({ page }) => {
await page.goto(storybookUrl);

await new SbPage(page).waitUntilLoaded();
});

test('should assert story lifecycle order', async ({ page }) => {
const sbPage = new SbPage(page);

await sbPage.navigateToStory('lib/test/before-each', 'before-each-order');

await sbPage.viewAddonPanel('Actions');
const logItem = await page.locator('#storybook-panel-root #panel-tab-content');
await expect(logItem).toBeVisible();

const expectedTexts = [
'1 - [from loaders]',
'2 - [from meta beforeEach]',
'3 - [from story beforeEach]',
'4 - [from decorator]',
'5 - [from onClick]',
];

// Assert that each LI text content contains the expected text in order
for (let i = 0; i < expectedTexts.length; i++) {
const nthText = await logItem.locator(`li >> nth=${i}`).innerText();
expect(nthText).toMatch(expectedTexts[i]);
}
});

test('should assert that utils import is mocked', async ({ page }) => {
const sbPage = new SbPage(page);

await sbPage.navigateToStory('lib/test/module-mocking', 'basic');

await sbPage.viewAddonPanel('Actions');
const logItem = await page.locator('#storybook-panel-root #panel-tab-content', {
hasText: 'foo: []',
});
await expect(logItem).toBeVisible();
});
});
Loading