1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-23 03:54: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: { disabled: {
control: {type: "boolean"}, control: {type: "boolean"},
}, },
todo: {
defaultValue: false,
},
}, },
} }
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = { NestedMultiple.args = {
disabled: false, 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 interface BoxProps extends PanelProps {}
export function Box({...props}: BoxProps): JSX.Element { export function Box({todo, ...props}: BoxProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-box") if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-box", todo ? "todo" : "")
return ( return (
<Panel {...props}/> <Panel {...props}/>

View file

@ -15,6 +15,9 @@ export default {
disabled: { disabled: {
control: {type: "boolean"}, control: {type: "boolean"},
}, },
todo: {
defaultValue: false,
},
}, },
} }
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = { NestedMultiple.args = {
disabled: false, 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 interface DialogProps extends PanelProps {}
export function Dialog({...props}: DialogProps): JSX.Element { export function Dialog({todo, ...props}: DialogProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-dialog") if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-dialog", todo ? "todo" : "")
return ( return (
<Panel {...props}/> <Panel {...props}/>

View file

@ -15,6 +15,9 @@ export default {
disabled: { disabled: {
control: {type: "boolean"}, control: {type: "boolean"},
}, },
todo: {
defaultValue: false,
},
}, },
} }
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = { NestedMultiple.args = {
disabled: false, 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" 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 { export function Panel({todo, ...props}: PanelProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel") if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel", todo ? "todo" : "")
return ( return (
<BaseElement kind={"section"} {...props}/> <BaseElement kind={"section"} {...props}/>

View file

@ -15,6 +15,9 @@ export default {
disabled: { disabled: {
control: {type: "boolean"}, control: {type: "boolean"},
}, },
todo: {
defaultValue: false,
},
}, },
} }
@ -59,3 +62,9 @@ export const NestedMultiple = props => (
NestedMultiple.args = { NestedMultiple.args = {
disabled: false, 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 interface ParenthesisProps extends PanelProps {}
export function Parenthesis({...props}: ParenthesisProps): JSX.Element { export function Parenthesis({todo, ...props}: ParenthesisProps): JSX.Element {
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-parenthesis") if(todo) {
console.warn(`TODO: ${props.children}`)
}
props.bluelibClassNames = mergeClassNames(props.bluelibClassNames, "panel-parenthesis", todo ? "todo" : "")
return ( return (
<Panel {...props}/> <Panel {...props}/>