-
Notifications
You must be signed in to change notification settings - Fork 88
feat(storybook): upgrade from v6 to v10 #470
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b9159e7
upgrade from 6 to 8
lsagetlethias 4eddd8a
upgrade from 8 to 9
lsagetlethias 0a430b0
upgrade from 9 to 10
lsagetlethias f2be923
unstyled tweak and fix picto
lsagetlethias 851e9e4
fix story order
lsagetlethias 4c162f3
remove unused import
lsagetlethias 808e784
handle dsfr dark theme during sb loading
lsagetlethias 994e57d
feat: upgrade storybook and add ToC
lsagetlethias 2284f31
feat: toc as dsfr side menu
lsagetlethias 8ef98a5
Merge branch 'main' of github.com:codegouvfr/react-dsfr into feat/upg…
lsagetlethias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,4 @@ CHANGELOG.md | |
| .yarn_home/ | ||
| /test/integration/ | ||
| /storybook-static/ | ||
|
|
||
| !.storybook | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { create } from "storybook/theming"; | ||
|
|
||
| const brandImage = "logo.png"; | ||
| const brandTitle = "@codegouvfr/react-dsfr"; | ||
| const brandUrl = "https://github.com/codegouvfr/react-dsfr"; | ||
| const fontBase = '"Marianne", arial, sans-serif'; | ||
| const fontCode = "monospace"; | ||
|
|
||
| export const darkTheme = create({ | ||
| base: "dark", | ||
| appBg: "#1E1E1E", | ||
| appContentBg: "#161616", | ||
| barBg: "#161616", | ||
| colorSecondary: "#8585F6", | ||
| textColor: "#FFFFFF", | ||
| brandImage, | ||
| brandTitle, | ||
| brandUrl, | ||
| fontBase, | ||
| fontCode | ||
| }); | ||
|
|
||
| export const lightTheme = create({ | ||
| base: "light", | ||
| appBg: "#F6F6F6", | ||
| appContentBg: "#FFFFFF", | ||
| barBg: "#FFFFFF", | ||
| colorSecondary: "#000091", | ||
| textColor: "#212121", | ||
| brandImage, | ||
| brandTitle, | ||
| brandUrl, | ||
| fontBase, | ||
| fontCode | ||
| }); | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { StorybookConfig } from "@storybook/react-vite"; | ||
|
|
||
| export default { | ||
| framework: { | ||
| name: "@storybook/react-vite", | ||
| options: {} | ||
| }, | ||
| features: { | ||
| controls: true, | ||
| viewport: true, | ||
| backgrounds: false | ||
| }, | ||
|
lsagetlethias marked this conversation as resolved.
|
||
| stories: [ | ||
| "../stories/*.mdx", | ||
| "../stories/*.stories.@(ts|tsx)", | ||
| "../stories/blocks/*.stories.@(ts|tsx)", | ||
| "../stories/charts/*.stories.@(ts|tsx)" | ||
| ], | ||
| addons: [ | ||
| "@vueless/storybook-dark-mode", | ||
| "@storybook/addon-links", | ||
|
lsagetlethias marked this conversation as resolved.
|
||
| "@storybook/addon-a11y", | ||
| "@storybook/addon-docs" | ||
| ], | ||
| staticDirs: ["../dist", "./static"] | ||
| } satisfies StorybookConfig; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <style> | ||
| /* Override Storybook default grey colors with DSFR grey colors */ | ||
| .sb-preparing-story, | ||
| .sb-preparing-docs { | ||
| background-color: var(--background-default-grey) !important; | ||
| } | ||
|
|
||
| .sb-loader { | ||
| border-color: var(--border-default-grey); | ||
| border-top-color: var(--border-default-grey); | ||
| } | ||
|
|
||
| .sb-previewBlock { | ||
| background: var(--background-default-grey); | ||
| border: 1px solid var(--border-default-grey); | ||
| box-shadow: var(--border-default-grey) 0 1px 3px 0; | ||
| } | ||
|
|
||
| .sb-previewBlock_header { | ||
| box-shadow: var(--border-default-grey) 0 -1px 0 0 inset; | ||
| } | ||
|
|
||
| .sb-previewBlock_icon { | ||
| background: var(--background-alt-grey); | ||
| } | ||
|
|
||
| .sb-argstableBlock th span, | ||
| .sb-argstableBlock td span { | ||
| background-color: var(--background-default-grey); | ||
| } | ||
|
|
||
| .sb-argstableBlock-body td { | ||
| box-shadow: | ||
| var(--border-contrast-grey) 0 1px 3px 1px, | ||
| var(--border-default-grey) 0 0 0 1px; | ||
| } | ||
|
|
||
| .sb-argstableBlock-body tr:not(:first-child) { | ||
| border-top: 1px solid var(--border-default-grey); | ||
| } | ||
|
|
||
| .sb-argstableBlock-body td { | ||
| background: var(--background-default-grey); | ||
| } | ||
|
|
||
| .sb-argstableBlock-body button { | ||
| background-color: var(--background-alt-grey); | ||
| } | ||
| </style> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.