1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 19:44:21 +00:00

Add panels

This commit is contained in:
Steffo 2021-08-17 17:55:14 +02:00
parent 75cb46a207
commit 9c5dae403e
Signed by: steffo
GPG key ID: 6965406171929D01
10 changed files with 175 additions and 3 deletions

View file

@ -12,8 +12,8 @@ export default {
argTypes: { argTypes: {
customColor: { customColor: {
control: {type: "color"}, control: {type: "color"},
} },
} },
} }

View file

@ -0,0 +1,24 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Decorators from "../../utils/Decorators"
import { Box } from "./Box"
export default {
component: Box,
title: "Panels/Box",
decorators: [Decorators.Bluelib],
argTypes: {
customColor: {
control: {type: "color"},
},
},
}
export const Default = props => (
<Box {...props}>
This is a Box.
</Box>
)
Default.args = {}

View file

@ -0,0 +1,19 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Types from "../../types"
import {Panel} from "./Panel";
import mergeClassNames from "classnames"
interface BoxProps {
[props: string]: any,
}
export function Box({...props}: BoxProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-box")
return (
<Panel {...props}/>
)
}

View file

@ -0,0 +1,24 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Decorators from "../../utils/Decorators"
import { Dialog } from "./Dialog"
export default {
component: Dialog,
title: "Panels/Dialog",
decorators: [Decorators.Bluelib],
argTypes: {
customColor: {
control: {type: "color"},
},
},
}
export const Default = props => (
<Dialog {...props}>
This is a Dialog.
</Dialog>
)
Default.args = {}

View file

@ -0,0 +1,19 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Types from "../../types"
import {Panel} from "./Panel";
import mergeClassNames from "classnames"
interface DialogProps {
[props: string]: any,
}
export function Dialog({...props}: DialogProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-dialog")
return (
<Panel {...props}/>
)
}

View file

@ -0,0 +1,24 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Decorators from "../../utils/Decorators"
import { Panel } from "./Panel"
export default {
component: Panel,
title: "Panels/Panel",
decorators: [Decorators.Bluelib],
argTypes: {
customColor: {
control: {type: "color"},
},
},
}
export const Default = props => (
<Panel {...props}>
This is a Panel.
</Panel>
)
Default.args = {}

View file

@ -0,0 +1,19 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Types from "../../types"
import {BaseElement} from "../BaseElement"
import mergeClassNames from "classnames"
interface PanelProps {
[props: string]: any,
}
export function Panel({...props}: PanelProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel")
return (
<BaseElement kind={"section"} {...props}/>
)
}

View file

@ -0,0 +1,24 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Decorators from "../../utils/Decorators"
import { Parenthesis } from "./Parenthesis"
export default {
component: Parenthesis,
title: "Panels/Parenthesis",
decorators: [Decorators.Bluelib],
argTypes: {
customColor: {
control: {type: "color"},
},
},
}
export const Default = props => (
<Parenthesis {...props}>
This is a Parenthesis.
</Parenthesis>
)
Default.args = {}

View file

@ -0,0 +1,19 @@
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Types from "../../types"
import {Panel} from "./Panel";
import mergeClassNames from "classnames"
interface ParenthesisProps {
[props: string]: any,
}
export function Parenthesis({...props}: ParenthesisProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-parenthesis")
return (
<Panel {...props}/>
)
}

View file

@ -1,6 +1,6 @@
import { Bluelib as BluelibComponent } from "../components/Bluelib" import { Bluelib as BluelibComponent } from "../components/Bluelib"
export const Bluelib = Story => <BluelibComponent theme={"paper"}><Story/></BluelibComponent> export const Bluelib = Story => <BluelibComponent theme={"paper"} style={{backgroundColor: "transparent"}}><Story/></BluelibComponent>
export const Fill = Story => <div style={{height: "100vh"}}><Story/></div> export const Fill = Story => <div style={{height: "100vh"}}><Story/></div>