Skip to content

Commit

Permalink
Cleanup argTypes.defaultValue Warning (#63)
Browse files Browse the repository at this point in the history
fix warning for argType.defaultValue
  • Loading branch information
jphechter committed Aug 10, 2022
1 parent c0a1c70 commit b804241
Showing 1 changed file with 8 additions and 12 deletions.
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",
};

0 comments on commit b804241

Please sign in to comment.