reset backup
This commit is contained in:
parent
6677695b78
commit
c5c65d84dc
58
src/stories/Checkbox.stories.tsx
Normal file
58
src/stories/Checkbox.stories.tsx
Normal file
@ -0,0 +1,58 @@
|
||||
import Checkbox from "../components/Checkbox";
|
||||
import { Meta, Story, ComponentStory, ComponentMeta } from "@storybook/react";
|
||||
import React, { useState } from "react";
|
||||
import { ReactComponent as Checkmark } from "assets/svg/check.svg";
|
||||
import { boolean } from "yup/lib/locale";
|
||||
|
||||
export default {
|
||||
title: "Checkbox",
|
||||
component: Checkbox,
|
||||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||
argTypes: {
|
||||
isChecked: {
|
||||
type: "boolean",
|
||||
},
|
||||
children: {
|
||||
type: "string",
|
||||
defaultValue: "Use light theme",
|
||||
},
|
||||
disabled: {
|
||||
type: "boolean",
|
||||
defaultValue: "false",
|
||||
},
|
||||
id: {
|
||||
type: "string",
|
||||
defaultValue: "uniqueID",
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
defaultValue: "checkbox name",
|
||||
},
|
||||
},
|
||||
} as ComponentMeta<typeof Checkbox>;
|
||||
|
||||
const Template: ComponentStory<typeof Checkbox> = (args) => (
|
||||
<Checkbox {...args} />
|
||||
);
|
||||
|
||||
export const Checked = Template.bind({});
|
||||
Checked.args = {
|
||||
isChecked: true,
|
||||
children: "This is custom checkbox",
|
||||
};
|
||||
|
||||
export const Unchecked = Template.bind({});
|
||||
Unchecked.args = {
|
||||
isChecked: false,
|
||||
};
|
||||
|
||||
export const Disabled = Template.bind({});
|
||||
Disabled.args = {
|
||||
disabled: true,
|
||||
};
|
||||
|
||||
export const Hovered = bindTemplate({});
|
||||
Hovered.args = {
|
||||
className: "hover:true",
|
||||
isChecked: false,
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user