From f008d80b60f1f73b67480e65d2b9bfb50d23be6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CSalar?= <“salar.sali97@gmail.com”>
Date: Fri, 5 Aug 2022 14:06:21 +0300
Subject: [PATCH] Radio component with its stories
---
src/components/Radio.tsx | 69 ++++++++++++++++-------------------
src/stories/Radio.stories.tsx | 46 +++++++++++++++++++++++
2 files changed, 78 insertions(+), 37 deletions(-)
create mode 100644 src/stories/Radio.stories.tsx
diff --git a/src/components/Radio.tsx b/src/components/Radio.tsx
index 0157cd3..3c2e198 100644
--- a/src/components/Radio.tsx
+++ b/src/components/Radio.tsx
@@ -1,46 +1,41 @@
+import classNames from "classnames";
import React from "react";
-/**
- * [*]This is a Radio component.
- *
- * [*]when you click on the label the radio will be selected
- *
- * [*] when you call this component pass the following:
- * [1]. label
- * [2]. id
- * [3]. name
- *
- * [*] A good example will be:
- *
- */
-type RadioProps = {
+import { ReactComponent as Checkmark } from "assets/svg/check.svg";
+
+export type Props = {
/**
- * the text that will be shown besie the radio
+ * An Element next to the Radio
*/
- label: string;
- /**
- * please provide a unique id
- */
- id: string;
- /**
- * The name of radio element
- */
- name: string;
+ children?: React.ReactNode;
} & Omit, "type">;
-const Radio = ({ label, id, name, ...props }: RadioProps) => {
+const Radio = ({ children, className, ...props }: Props) => {
return (
-