-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added storybook backgrounds, docs with MDX support, and demoed contexts
- Loading branch information
1 parent
011e7d7
commit de3e157
Showing
7 changed files
with
1,617 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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,7 @@ | ||
export const backgrounds = { | ||
default: "white", | ||
values: [ | ||
{ name: "light", value: "#fefefe" }, | ||
{ name: "dark", value: "#030303" }, | ||
], | ||
}; |
This file contains 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,28 @@ | ||
// Demo a context switch for Style Components theme | ||
// Using @storybook/addon-contexts | ||
// FIXME: not yet tested, as we wait for Storybook v6.0.0 official release | ||
import darkTheme from "~/lib/style/darkTheme"; | ||
import defaultTheme from "~/lib/style/defaultTheme"; | ||
import { SCThemeProvider } from "~/src/components/providers/SCThemeProvider"; | ||
export const contexts = [ | ||
{ | ||
title: "Theme", | ||
components: [SCThemeProvider], | ||
params: [ | ||
{ | ||
name: "Default theme", | ||
props: { theme: defaultTheme }, | ||
default: true, | ||
}, | ||
{ | ||
name: "Dark theme", | ||
props: { theme: darkTheme }, | ||
}, | ||
], | ||
options: { | ||
deep: true, | ||
disable: false, | ||
cancelable: false, | ||
}, | ||
}, | ||
]; |
This file contains 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 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 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 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,17 @@ | ||
import { Meta, Story, Preview } from "@storybook/addon-docs/blocks"; | ||
|
||
<Meta title="VNS/design-system/MDX" /> | ||
|
||
# MDX | ||
|
||
With `MDX` we can define a story for any custom component right in the middle of our | ||
markdown documentation. | ||
|
||
<Preview> | ||
<Story name="Some input"> | ||
<p>I am an MDX story, see me in the "Docs" tab!</p> | ||
<form> | ||
<input type="text" name="test" placeholder="I am some input" /> | ||
</form> | ||
</Story> | ||
</Preview> |
Oops, something went wrong.