diff --git a/lib/components/Divider/Divider.scss b/lib/components/Divider/Divider.scss deleted file mode 100644 index b286ed39..00000000 --- a/lib/components/Divider/Divider.scss +++ /dev/null @@ -1,11 +0,0 @@ -.deriv-divider { - &--horizontal { - border-top: 1px solid; - width: 100%; - } - - &--vertical { - border-right: 1px solid; - height: 100%; - } -} diff --git a/lib/components/Divider/index.tsx b/lib/components/Divider/index.tsx index 7b9c899a..ef930668 100644 --- a/lib/components/Divider/index.tsx +++ b/lib/components/Divider/index.tsx @@ -1,19 +1,20 @@ import { CSSProperties } from "react"; -import "./Divider.scss"; type DividerProps = { - variant?: "horizontal" | "vertical"; - color?: CSSProperties["borderColor"]; + color?: string; margin?: CSSProperties["margin"]; + height?: CSSProperties["height"]; + className?: HTMLDivElement["className"]; }; export const Divider = ({ - variant = "horizontal", - color, + color = "#d6dadb", + height = "1px", margin, + className, }: DividerProps) => (
); diff --git a/src/main.tsx b/src/main.tsx index 6661c4e6..9d64206b 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,31 +1,9 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import { Loader } from '../dist/components/Loader'; -import { Button } from '../dist/components/Button'; -import { Text } from '../dist/components/Text'; -import { Tab, Tabs } from '../dist/components/Tabs'; -import {Dropdown} from '../dist/components/Dropdown'; -import './style.scss' +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./style.scss"; -ReactDOM.createRoot(document.getElementById('root')!).render( +ReactDOM.createRoot(document.getElementById("root")!).render( - <> - console.log(value)} - name='test name' - /> - - - - , -) +
+ +); diff --git a/src/stories/Divider.stories.tsx b/src/stories/Divider.stories.tsx new file mode 100644 index 00000000..d5c5feb6 --- /dev/null +++ b/src/stories/Divider.stories.tsx @@ -0,0 +1,36 @@ +import type { Meta, StoryObj } from "@storybook/react"; + +import { Divider } from "../../lib/components/Divider"; + +const meta: Meta = { + title: "Components/Divider", + component: Divider, + parameters: { layout: "centered" }, + tags: ["autodocs"], + args: { + color: "", + height: "", + margin: "", + className: "", + }, + argTypes: { + color: { control: { type: "color" } }, + height: { control: { type: "text" } }, + margin: { control: { type: "text" } }, + className: { control: { type: "text" } }, + }, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + name: "Divider", + render: () => ( +
+ This is a test text + + This is another test text +
+ ), +};