Unverified Commit be8d04d6 authored by Scarlett Perry's avatar Scarlett Perry Committed by GitHub
Browse files

storybook: add button story for default and destructive variant (#563)

parent bfd44e01
Showing with 33 additions and 2 deletions
+33 -2
......@@ -19,7 +19,11 @@ const StyledButton = styled(MuiButton)`
`}
`;
interface ButtonProps extends MuiButtonProps {
interface ButtonProps
extends Pick<
MuiButtonProps,
"disabled" | "endIcon" | "onClick" | "size" | "startIcon" | "type" | "variant"
> {
text: string;
destructive?: boolean;
}
......
import React from "react";
import type { Meta } from "@storybook/react";
import type { ButtonProps } from "../button";
import { Button } from "../button";
export default {
title: "Core/Button",
component: Button,
argTypes: {
onClick: { action: "onClick event" },
},
} as Meta;
const Template = (props: ButtonProps) => <Button {...props} />;
export const Default = Template.bind({});
Default.args = {
text: "continue",
};
export const Destructive = Template.bind({});
Destructive.args = {
text: "delete",
destructive: true,
};
......@@ -20,7 +20,8 @@
},
"exclude": [
"node_modules",
"**/stories/*",
"**/*.stories.ts*",
"**/*.stories.js*",
"**/*.test.js*",
"**/*.test.ts*"
],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment