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

Docs: Restore stories #307

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .storybook/docs/args-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@
.docblock-argstable:not(.x) tbody td[colspan="3"] {
background-color: var(--border-weak) !important;
}

/* "controls" column inputs */
.docblock-argstable-body:not(.x) tr td label input:not([type="radio"]) {
width: 100%;
}
6 changes: 3 additions & 3 deletions .storybook/docs/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ html {
tab-size: 4;
}

.sbdocs p,
.sbdocs p:not(#gallery p),
.sbdocs ul {
max-width: 640px;
}
Expand Down Expand Up @@ -41,7 +41,7 @@ html {
}

/* Vertical rhythm */
.sbdocs p:not(#x),
.sbdocs p:not(#gallery p),
.sbdocs title:not(.x),
.sbdocs blockquote:not(.x),
.sbdocs h1:not(#x),
Expand All @@ -64,7 +64,7 @@ The actual top-level code block is "docblock-source".

/* Body text */
.sbdocs code:not(.x),
.sbdocs p:not(.x),
.sbdocs p:not(#gallery p),
.sbdocs li:not(.x),
.docblock-argstable:not(#x) {
font-size: 16px;
Expand Down
8 changes: 5 additions & 3 deletions .storybook/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import {
} from "@storybook/addon-docs";
import { ReactElement } from "react";
import { background } from "../../src/core";
import { DocsParameters } from "../../src/docs/utils/meta";
import { DocsMetaParameter } from "../../src/docs/utils/parameter";
import s from "./page.module.css";

export const StorybookPage = (): ReactElement => {
const meta = useOf("meta");

const parameters =
meta.type === "meta"
? (meta.csfFile.meta.parameters as DocsParameters)
? (meta.csfFile.meta.parameters as DocsMetaParameter)
: {};
const { gallery } = parameters;
const primary = parameters.primary ?? "sticky";
Expand All @@ -30,7 +30,9 @@ export const StorybookPage = (): ReactElement => {
{gallery !== undefined && (
<>
<h3 id="props">Gallery</h3>
<div className={s.gallery}>{gallery}</div>
<div id="gallery" className={s.gallery}>
{gallery}
</div>
</>
)}
<Stories includePrimary={false} />
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-storybook": "^0.8.0",
"formik": "^2.4.6",
"headless": "link:@tippyjs/react/headless",
"modern-normalize": "^2.0.0",
"react": "^18.3.1",
Expand Down
Loading