mirror of
https://github.com/Steffo99/bluelib.git
synced 2024-12-23 03:54:21 +00:00
✨ Add panels
This commit is contained in:
parent
75cb46a207
commit
9c5dae403e
10 changed files with 175 additions and 3 deletions
|
@ -12,8 +12,8 @@ export default {
|
||||||
argTypes: {
|
argTypes: {
|
||||||
customColor: {
|
customColor: {
|
||||||
control: {type: "color"},
|
control: {type: "color"},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
24
src/components/panels/Box.stories.jsx
Normal file
24
src/components/panels/Box.stories.jsx
Normal 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 = {}
|
19
src/components/panels/Box.tsx
Normal file
19
src/components/panels/Box.tsx
Normal 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}/>
|
||||||
|
)
|
||||||
|
}
|
24
src/components/panels/Dialog.stories.jsx
Normal file
24
src/components/panels/Dialog.stories.jsx
Normal 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 = {}
|
19
src/components/panels/Dialog.tsx
Normal file
19
src/components/panels/Dialog.tsx
Normal 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}/>
|
||||||
|
)
|
||||||
|
}
|
24
src/components/panels/Panel.stories.jsx
Normal file
24
src/components/panels/Panel.stories.jsx
Normal 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 = {}
|
19
src/components/panels/Panel.tsx
Normal file
19
src/components/panels/Panel.tsx
Normal 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}/>
|
||||||
|
)
|
||||||
|
}
|
24
src/components/panels/Parenthesis.stories.jsx
Normal file
24
src/components/panels/Parenthesis.stories.jsx
Normal 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 = {}
|
19
src/components/panels/Parenthesis.tsx
Normal file
19
src/components/panels/Parenthesis.tsx
Normal 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}/>
|
||||||
|
)
|
||||||
|
}
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue