This commit is contained in:
Patrick Alvin Alcala 2026-02-20 19:04:03 +08:00
parent eb8731d039
commit 0b4c7b2d93
6 changed files with 98 additions and 47 deletions

View file

@ -5,19 +5,20 @@ interface Props {
children: JSXElement
content?: 'left' | 'center' | 'right' | 'split' | 'spaced' | 'even'
gap?: number
wrap?: boolean
}
export default (props: Props) => {
return (
<>
<Show when={props.gap}>
<section class={`dasig-row-${props.content || 'center'}`} style={`gap: ${props.gap}rem`}>
<section class={`dasig-row-${props.content || 'center'}`} style={`gap: ${props.gap}rem; flex-wrap: ${props.wrap ? 'wrap' : 'nowrap'}`}>
{props.children}
</section>
</Show>
<Show when={!props.gap}>
<section class={`dasig-row-${props.content || 'center'}`}>{props.children}</section>
<section class={`dasig-row-${props.content || 'center'}`} style={`flex-wrap: ${props.wrap ? 'wrap' : 'nowrap'}`}>{props.children}</section>
</Show>
</>
)