-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee40293
commit 44f38cb
Showing
4 changed files
with
51 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) => ( | ||
<div | ||
className={`deriv-divider deriv-divider--${variant}`} | ||
style={{ borderColor: color, margin }} | ||
style={{ margin, backgroundColor: color, height }} | ||
className={className} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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( | ||
<React.StrictMode> | ||
<> | ||
<Dropdown label='test' variant='comboBox' list={[ | ||
{ | ||
text: 'Option 1', | ||
value: 'option1' | ||
}, | ||
{ | ||
text: 'Option 2', | ||
value: 'option2' | ||
}, | ||
]} | ||
dropdownIcon="down" | ||
onSelect={(value) => console.log(value)} | ||
name='test name' | ||
/> | ||
</> | ||
|
||
|
||
</React.StrictMode>, | ||
) | ||
<div /> | ||
</React.StrictMode> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { Divider } from "../../lib/components/Divider"; | ||
|
||
const meta: Meta<typeof Divider> = { | ||
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<typeof meta>; | ||
|
||
export const Default: Story = { | ||
name: "Divider", | ||
render: () => ( | ||
<div> | ||
<span>This is a test text</span> | ||
<Divider /> | ||
<span>This is another test text</span> | ||
</div> | ||
), | ||
}; |