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

USWDS - Web components: Improve component docs with custom elements manifest #67

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config = {
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-docs",
"@chromatic-com/storybook",
"@storybook/addon-a11y",
],
Expand Down
19 changes: 17 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
/**
* Custom elements for component docs generation.
*/
import { setCustomElementsManifest } from "@storybook/web-components";
import customElements from "../custom-elements.json";

setCustomElementsManifest(customElements);
Comment on lines +1 to +7
Copy link
Collaborator Author

@mejiaj mejiaj Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

This is how StorybookJS uses the manifest to generate docs.


/**
*
* StorybookJS theme
*
*/

// Custom theme.
import UswdsTheme from "./UswdsTheme";

// Global component styles.
// Global styles.
import "../storybook/index.css";
// Theme overrides.
// Documentation overrides.
import "./index.css";

/** @type { import('@storybook/web-components').Preview } */
Expand Down
Loading