diff --git a/src/components/Radio.tsx b/src/components/Radio.tsx new file mode 100644 index 0000000..3c2e198 --- /dev/null +++ b/src/components/Radio.tsx @@ -0,0 +1,41 @@ +import classNames from "classnames"; +import React from "react"; +import { ReactComponent as Checkmark } from "assets/svg/check.svg"; + +export type Props = { + /** + * An Element next to the Radio + */ + children?: React.ReactNode; +} & Omit, "type">; + +const Radio = ({ children, className, ...props }: Props) => { + return ( + + ); +}; +export default Radio; diff --git a/src/stories/Radio.stories.tsx b/src/stories/Radio.stories.tsx new file mode 100644 index 0000000..bc1dc72 --- /dev/null +++ b/src/stories/Radio.stories.tsx @@ -0,0 +1,46 @@ +import Radio from "../components/Radio"; +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: "Radio", + component: Radio, + // More on argTypes: https://storybook.js.org/docs/react/api/argtypes + argTypes: { + checked: { + type: "boolean", + }, + children: { + type: "string", + defaultValue: "Use light theme", + }, + className: { + type: "string", + defaultValue: "mt-4 ml-4", + }, + disabled: { + type: "boolean", + defaultValue: "false", + }, + }, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ; + +export const Checked = Template.bind({}); +Checked.args = { + checked: true, + children: "This is a custom Radio", +}; + +export const Unchecked = Template.bind({}); +Unchecked.args = { + checked: false, +}; + +export const Disabled = Template.bind({}); +Disabled.args = { + disabled: true, +};