update
This commit is contained in:
1 parent
f899f75780
commit
73566d3aca
10 files changed
+92
-51
No files matched your search
@@ -14,6 +14,7 @@ export type BoxProps = {
|
||||
align?: boolean
|
||||
vertical?: boolean
|
||||
center?: boolean
|
||||
gap?: number
|
||||
}
|
||||
|
||||
export const Box: React.FC<BoxProps> = ({
|
||||
@@ -23,12 +24,16 @@ export const Box: React.FC<BoxProps> = ({
|
||||
center = false,
|
||||
align = true,
|
||||
style,
|
||||
gap,
|
||||
className,
|
||||
...props
|
||||
}) => {
|
||||
const newProps = {
|
||||
className: cx(s.box, className, { vertical, align, center, wrap }),
|
||||
style,
|
||||
style: {
|
||||
...style,
|
||||
gap,
|
||||
},
|
||||
}
|
||||
|
||||
return createElement(as, newProps, props.children)
|
||||
|
||||
@@ -5,14 +5,18 @@ import { Box } from "../Box"
|
||||
export type PanelProps = {
|
||||
children?: React.ReactNode
|
||||
style?: React.CSSProperties
|
||||
ghost?: boolean
|
||||
}
|
||||
|
||||
export const Panel: React.FC<PanelProps> = ({
|
||||
style,
|
||||
children,
|
||||
ghost = false,
|
||||
}) => {
|
||||
const variant = ghost ? s.ghost : s.default
|
||||
|
||||
return (
|
||||
<Box vertical align={false} className={`${s.panel} ${s.default}`} style={style}>
|
||||
<Box vertical align={false} className={`${s.panel} ${variant}`} style={style}>
|
||||
{children}
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
.panel {
|
||||
padding: var(--size-m);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
.default {
|
||||
padding: var(--size-m);
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
background-color: none;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { createElement } from "react"
|
||||
|
||||
export type TitleProps = {
|
||||
level?: 1 | 2 | 3 | 4 | 5 | 6
|
||||
children?: React.ReactNode
|
||||
className?: string
|
||||
style?: React.CSSProperties
|
||||
}
|
||||
|
||||
export const Title: React.FC<TitleProps> = ({ level = 1, children, ...props }) => {
|
||||
return createElement(`h${level}`, props, children)
|
||||
}
|
||||
Reference in new issue
Block a user