Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

HBox.tsx

41 lines769 Bytes

1import type { HBoxProps } from '@/lib/reports/types'
2​
3const gapClasses = {
4 none: 'gap-0',
5 xs: 'gap-1',
6 sm: 'gap-2',
7 md: 'gap-4',
8 lg: 'gap-6',
9 xl: 'gap-8',
11​
12const alignClasses = {
13 start: 'items-start',
14 center: 'items-center',
15 end: 'items-end',
16 stretch: 'items-stretch',
18​
19const justifyClasses = {
20 start: 'justify-start',
21 center: 'justify-center',
22 end: 'justify-end',
23 between: 'justify-between',
24 around: 'justify-around',
26​
27export function HBox({
28 gap = 'md',
29 align = 'stretch',
30 justify = 'start',
31 wrap = false,
32 children,
33}: HBoxProps) {
34 return (
35 <div
36 className={`flex flex-row ${gapClasses[gap]} ${alignClasses[align]} ${justifyClasses[justify]} ${wrap ? 'flex-wrap' : ''}`}
37 >
38 {children}
39 </div>
40 )