diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 3317e750e0c5..a57524a04ebb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,4 +1,5 @@ 34e364a0ca1d93555d36a7367d78e8e229493de8 c0896915fb7fb9a8dd416b9aebca17abd909d1c1 a41c227037e7e7249b8b376f838f4f8bcc3e3e59 -13c46e6c0b7f3dd8cf4ba42d1cfd6714f4777d54 \ No newline at end of file +13c46e6c0b7f3dd8cf4ba42d1cfd6714f4777d54 +0a4522a3f84773f39daec4820c49b8a92e9f9d11 \ No newline at end of file diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index 1a1c6b59a4a2..000000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,72 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. They are provided -# by a third-party and are governed by separate terms of service, privacy -# policy, and support documentation. - -name: Scorecards supply-chain security -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '31 16 * * 5' - push: - branches: [ "next" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - # Uncomment the permissions below if installing in a private repository. - # contents: read - # actions: read - - steps: - - name: "Checkout code" - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6 - with: - results_file: results.sarif - results_format: sarif - # (Optional) Read-only PAT token. Uncomment the `repo_token` line below if: - # - you want to enable the Branch-Protection check on a *public* repository, or - # - you are installing Scorecards on a *private* repository - # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. - # repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} - - # Public repositories: - # - Publish results to OpenSSF REST API for easy access by consumers - # - Allows the repository to include the Scorecard badge. - # - See https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories: - # - `publish_results` will always be set to `false`, regardless - # of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100 # v2.1.27 - with: - sarif_file: results.sarif diff --git a/CHANGELOG.md b/CHANGELOG.md index 444fe7ae0bea..bdf5324fe23d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 8.2.7 + +- CPC: Fix type usage in renderers - [#28745](https://github.com/storybookjs/storybook/pull/28745), thanks @ndelangen! +- Core: Introduce run over play in portable stories, and revert back play changes of 8.2 - [#28764](https://github.com/storybookjs/storybook/pull/28764), thanks @kasperpeulen! + ## 8.2.6 - CPC: Fix missing exports for addon-kit - [#28691](https://github.com/storybookjs/storybook/pull/28691), thanks @ndelangen! diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index a5ab53b9e199..6180d4046fb2 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,12 @@ +## 8.3.0-alpha.4 + +- CSF: Allow overridding globals at the story level - [#26654](https://github.com/storybookjs/storybook/pull/26654), thanks @tmeasday! +- Core: Introduce run over play in portable stories, and revert back play changes of 8.2 - [#28764](https://github.com/storybookjs/storybook/pull/28764), thanks @kasperpeulen! +- Core: Split Storybook CLI - [#28519](https://github.com/storybookjs/storybook/pull/28519), thanks @kasperpeulen! +- Fix: Invariant failed: Expected package.json#version to be defined in the "undefined" package - [#28752](https://github.com/storybookjs/storybook/pull/28752), thanks @abcdmku! +- Next.js: Make RSC portable-stories compatible - [#28756](https://github.com/storybookjs/storybook/pull/28756), thanks @valentinpalkovic! +- UI: Fix collapse/expand all functionality - [#28582](https://github.com/storybookjs/storybook/pull/28582), thanks @filipemelo2002! + ## 8.3.0-alpha.3 - Angular: Fix Angular template error for props with a circular reference - [#28498](https://github.com/storybookjs/storybook/pull/28498), thanks @Marklb! diff --git a/MIGRATION.md b/MIGRATION.md index 3dd1311dd620..dcb75d359224 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1632,7 +1632,7 @@ export const Primary = { ## From version 6.5.x to 7.0.0 -A number of these changes can be made automatically by the Storybook CLI. To take advantage of these "automigrations", run `npx storybook@latest upgrade --prerelease` or `pnpx dlx storybook@latest upgrade --prerelease`. +A number of these changes can be made automatically by the Storybook CLI. To take advantage of these "automigrations", run `npx storybook@7 upgrade` or `pnpx dlx storybook@7 upgrade`. ### 7.0 breaking changes diff --git a/code/.storybook/main.ts b/code/.storybook/main.ts index 7c4f74c8c2ef..6a1f51f62f7c 100644 --- a/code/.storybook/main.ts +++ b/code/.storybook/main.ts @@ -68,6 +68,10 @@ const config: StorybookConfig = { directory: '../addons/toolbars/template/stories', titlePrefix: 'addons/toolbars', }, + { + directory: '../addons/themes/template/stories', + titlePrefix: 'addons/themes', + }, { directory: '../addons/onboarding/src', titlePrefix: 'addons/onboarding', @@ -83,6 +87,7 @@ const config: StorybookConfig = { ], addons: [ '@storybook/addon-links', + '@storybook/addon-themes', '@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-storysource', @@ -119,7 +124,6 @@ const config: StorybookConfig = { }, features: { viewportStoryGlobals: true, - themesStoryGlobals: true, backgroundsStoryGlobals: true, }, viteFinal: (viteConfig, { configType }) => diff --git a/code/.storybook/preview.tsx b/code/.storybook/preview.tsx index c80bdcea2937..548f29473efc 100644 --- a/code/.storybook/preview.tsx +++ b/code/.storybook/preview.tsx @@ -12,16 +12,17 @@ import { } from 'storybook/internal/theming'; import { useArgs, DocsContext as DocsContextProps } from 'storybook/internal/preview-api'; import type { PreviewWeb } from 'storybook/internal/preview-api'; -import type { ReactRenderer } from '@storybook/react'; +import type { ReactRenderer, Decorator } from '@storybook/react'; import type { Channel } from 'storybook/internal/channels'; import { DocsContext } from '@storybook/blocks'; +import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport'; import { DocsPageWrapper } from '../lib/blocks/src/components'; const { document } = global; -const ThemeBlock = styled.div<{ side: 'left' | 'right' }>( +const ThemeBlock = styled.div<{ side: 'left' | 'right'; layout: string }>( { position: 'absolute', top: 0, @@ -31,8 +32,10 @@ const ThemeBlock = styled.div<{ side: 'left' | 'right' }>( height: '100vh', bottom: 0, overflow: 'auto', - padding: 10, }, + ({ layout }) => ({ + padding: layout === 'fullscreen' ? 0 : '1rem', + }), ({ theme }) => ({ background: theme.background.content, color: theme.color.defaultText, @@ -49,14 +52,17 @@ const ThemeBlock = styled.div<{ side: 'left' | 'right' }>( } ); -const ThemeStack = styled.div( +const ThemeStack = styled.div<{ layout: string }>( { position: 'relative', - minHeight: 'calc(50vh - 15px)', + flex: 1, }, ({ theme }) => ({ background: theme.background.content, color: theme.color.defaultText, + }), + ({ layout }) => ({ + padding: layout === 'fullscreen' ? 0 : '1rem', }) ); @@ -80,6 +86,25 @@ const PlayFnNotice = styled.div( }) ); +const StackContainer = ({ children, layout }) => ( +
+