-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from uswds/jm/add-storybook
USWDS-Next - Storybook: Add initial implementation
- Loading branch information
Showing
12 changed files
with
11,904 additions
and
1,597 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 |
---|---|---|
|
@@ -22,3 +22,5 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
*storybook.log |
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,10 @@ | ||
import { create } from '@storybook/theming/create'; | ||
|
||
export default create({ | ||
base: 'light', | ||
brandTitle: "USWDS Next", | ||
fontBase: '"Public Sans Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', | ||
colorPrimary: '#4a77b4', | ||
colorSecondary: '#2672de', | ||
textColor: '#1b1b1b', | ||
}); |
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,5 @@ | ||
:where(p:not(.sb-anchor, .sb-unstyled, .sb-unstyled p)), | ||
:where(li:not(.sb-anchor, .sb-unstyled, .sb-unstyled li)) { | ||
font-size: 22px !important; | ||
line-height: 1.4 !important; | ||
} |
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 @@ | ||
/** @type { import('@storybook/web-components-vite').StorybookConfig } */ | ||
const config = { | ||
stories: [ | ||
"../src/**/*.mdx", | ||
"../src/components/**/*.stories.@(js|jsx|mjs|ts|tsx)", | ||
], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@chromatic-com/storybook", | ||
], | ||
framework: { | ||
name: "@storybook/web-components-vite", | ||
options: {}, | ||
}, | ||
}; | ||
export default config; |
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,6 @@ | ||
import { addons } from "@storybook/manager-api"; | ||
import UswdsTheme from "./UswdsTheme"; | ||
|
||
addons.setConfig({ | ||
theme: UswdsTheme, | ||
}); |
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 @@ | ||
import UswdsTheme from "./UswdsTheme"; | ||
|
||
// Global component styles. | ||
import "../src/index.css"; | ||
// Theme overrides. | ||
import "./index.css"; | ||
|
||
/** @type { import('@storybook/web-components').Preview } */ | ||
const preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
docs: { | ||
toc: true, // Autogenerate table of contents. | ||
theme: UswdsTheme, | ||
canvas: { | ||
sourceState: "shown", | ||
}, | ||
}, | ||
}, | ||
tags: ["autodocs"], | ||
}; | ||
|
||
export default preview; |
Oops, something went wrong.