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

infrastructure/update-storybook-config #20

Merged
merged 22 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9f17d56
Install Mozilla Protocol npm package
hawkticehurst Nov 26, 2020
15e3eb6
Initial creation of MozillaCard component
hawkticehurst Nov 26, 2020
5842d52
Add MozillaCard component to storybook
hawkticehurst Nov 26, 2020
7bc158b
Create custom storybook theme
hawkticehurst Dec 11, 2020
af89e7c
Create storybook manager config
hawkticehurst Dec 11, 2020
3e656d9
Add .DS_Store to gitignore file
hawkticehurst Dec 11, 2020
66d5845
Include addons-essentials to storybook config
hawkticehurst Dec 11, 2020
61e52e4
Add config for story sorting, doc theme, and canvas background colors…
hawkticehurst Dec 11, 2020
22e41b9
Install @storybook/theming and @storybook/addon-essentials packages
hawkticehurst Dec 11, 2020
e38b84f
Update Card story meta title
hawkticehurst Dec 11, 2020
5b8f778
Create stories directory and Introduction doc page
hawkticehurst Dec 11, 2020
0be85d4
Move the Filters directory inside of the components directory
hawkticehurst Dec 11, 2020
dbb4f1f
Upgrade storybook packages to latest versions
hawkticehurst Dec 11, 2020
ccae759
Delete Mozilla styled components and references to those components
hawkticehurst Dec 11, 2020
f0696d2
Fix incorrect export paths
hawkticehurst Dec 11, 2020
f935e73
Merge branch 'main' into update-storybook-config
hawkticehurst Dec 11, 2020
d11c165
Add a prettier ignore file to ignore all SVG files
hawkticehurst Dec 11, 2020
e747a51
Remove /register from a11y, actions, knobs, and links storybook addons
hawkticehurst Dec 11, 2020
d3dd7c9
Fix invalid storybook glob pattern
hawkticehurst Dec 11, 2020
08be51a
Add Semantic UI CSS import back to preview.js
hawkticehurst Dec 11, 2020
a3941b4
Remove a11y and knobs decorators and associated imports from preview.js
hawkticehurst Dec 11, 2020
6761daf
Fix margin decorator that wraps all stories
hawkticehurst Dec 11, 2020
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dist
type-declarations
dist-docs
coverage
storybook-static
storybook-static
.DS_Store
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore all SVG files
*.svg
8 changes: 8 additions & 0 deletions .storybook/customTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { create } from "@storybook/theming/create";

export default create({
base: "dark",
brandTitle: "Council Data Project",
brandUrl: "https://councildataproject.github.io/",
// brandImage: "https://placehold.it/350x150",
});
11 changes: 6 additions & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const path = require("path");

module.exports = {
stories: ["../src/**/*.stories.(tsx|mdx)"],
stories: ["../src/**/*.stories.@(tsx|mdx)"],
addons: [
"@storybook/addon-a11y/register",
"@storybook/addon-actions/register",
"@storybook/addon-knobs/register",
"@storybook/addon-links/register",
"@storybook/addon-a11y",
"@storybook/addon-actions",
"@storybook/addon-knobs",
"@storybook/addon-links",
"@storybook/addon-essentials",
{
name: "@storybook/addon-docs",
options: {
Expand Down
16 changes: 16 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { addons } from "@storybook/addons";
import customTheme from "./customTheme";

addons.setConfig({
isFullscreen: false,
showNav: true,
showPanel: true,
panelPosition: "bottom",
sidebarAnimations: true,
enableShortcuts: true,
isToolshown: true,
theme: customTheme,
selectedPanel: undefined,
initialActive: "sidebar",
showRoots: true,
});
40 changes: 30 additions & 10 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
import React from "react";

import { addDecorator } from "@storybook/react";
import { withA11y } from "@storybook/addon-a11y";
import { withInfo } from "@storybook/addon-info";
import { withKnobs } from "@storybook/addon-knobs";
import { themes } from "@storybook/theming";
import "semantic-ui-css/semantic.min.css";
import { Segment } from "semantic-ui-react";

addDecorator(withInfo);
addDecorator(withA11y);
addDecorator(withKnobs);

// Wrap a simple container around all stories.
addDecorator((storyFn) => (
<Segment>{storyFn()}</Segment>
));
export const decorators = [(story) => <div style={{ margin: "1rem" }}>{story()}</div>];

export const parameters = {
options: {
storySort: {
order: ["Getting Started", "Library"],
},
},
docs: {
theme: themes.dark,
},
backgrounds: {
default: "light",
values: [
{
name: "light",
value: "#f9f9f9",
},
{
name: "grey",
value: "#929396",
},
{
name: "dark",
value: "#333",
},
],
},
};
Loading