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

Cleanup argTypes.defaultValue Warning #63

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/components/Typography/Typography.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,33 @@ import { ComponentStory, ComponentMeta } from "@storybook/react";

import { Typography } from "./Typography";

// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: "USWDS/Base/Typography",
component: Typography,
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
args: {
as: "p",
family: "sans",
size: "md",
},
argTypes: {
as: {
description: "The type of component that will be rendered",
},
family: {
defaultValue: "sans",
description:
"This is the font-family for the text that will be rendered.",
},
size: {
defaultValue: "xs",
description: "This is the size of the text that will be rendered.",
},
as: {
defaultValue: "p",
description: "The type of component that will be rendered",
},
},
} as ComponentMeta<typeof Typography>;

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof Typography> = ({ children, ...rest }) => (
<Typography {...rest}>{children}</Typography>
);

export const Standard = Template.bind({});
// More on args: https://storybook.js.org/docs/react/writing-stories/args
Standard.args = {
children: "Testing",
size: "md",
family: "sans",
};