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

Add todo panels

This commit is contained in:
Steffo 2021-08-24 04:58:22 +02:00
parent a6709dd335
commit d72dc52fda
Signed by: steffo
GPG key ID: 6965406171929D01
8 changed files with 63 additions and 9 deletions

View file

@ -15,6 +15,9 @@ export default {
disabled: {
control: {type: "boolean"},
},
todo: {
defaultValue: false,
},
},
}
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = {
disabled: false,
}
export const Todo = Default.bind({})
Todo.args = {
todo: true,
}

View file

@ -8,8 +8,12 @@ import mergeClassNames from "classnames"
export interface BoxProps extends PanelProps {}
export function Box({...props}: BoxProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-box")
export function Box({todo, ...props}: BoxProps): JSX.Element {
if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-box", todo ? "todo" : "")
return (
<Panel {...props}/>

View file

@ -15,6 +15,9 @@ export default {
disabled: {
control: {type: "boolean"},
},
todo: {
defaultValue: false,
},
},
}
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = {
disabled: false,
}
export const Todo = Default.bind({})
Todo.args = {
todo: true,
}

View file

@ -8,8 +8,12 @@ import mergeClassNames from "classnames"
export interface DialogProps extends PanelProps {}
export function Dialog({...props}: DialogProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-dialog")
export function Dialog({todo, ...props}: DialogProps): JSX.Element {
if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-dialog", todo ? "todo" : "")
return (
<Panel {...props}/>

View file

@ -15,6 +15,9 @@ export default {
disabled: {
control: {type: "boolean"},
},
todo: {
defaultValue: false,
},
},
}
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = {
disabled: false,
}
export const Todo = Default.bind({})
Todo.args = {
todo: true,
}

View file

@ -5,11 +5,17 @@ import {BaseElement} from "../BaseElement"
import mergeClassNames from "classnames"
export interface PanelProps extends Types.BluelibHTMLProps<HTMLElement> {}
export interface PanelProps extends Types.BluelibHTMLProps<HTMLElement> {
todo?: boolean,
}
export function Panel({...props}: PanelProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel")
export function Panel({todo, ...props}: PanelProps): JSX.Element {
if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel", todo ? "todo" : "")
return (
<BaseElement kind={"section"} {...props}/>

View file

@ -15,6 +15,9 @@ export default {
disabled: {
control: {type: "boolean"},
},
todo: {
defaultValue: false,
},
},
}
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = {
disabled: false,
}
export const Todo = Default.bind({})
Todo.args = {
todo: true,
}

View file

@ -8,8 +8,12 @@ import mergeClassNames from "classnames"
export interface ParenthesisProps extends PanelProps {}
export function Parenthesis({...props}: ParenthesisProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-parenthesis")
export function Parenthesis({todo, ...props}: ParenthesisProps): JSX.Element {
if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-parenthesis", todo ? "todo" : "")
return (
<Panel {...props}/>