38 lines
773 B
TypeScript
38 lines
773 B
TypeScript
import React, { ReactNode } from 'react';
|
|
import { Stack } from './primitives/Stack';
|
|
import { Text } from './Text';
|
|
|
|
interface FormSectionProps {
|
|
children: ReactNode;
|
|
title?: string;
|
|
}
|
|
|
|
/**
|
|
* FormSection
|
|
*
|
|
* Groups related form fields with an optional title.
|
|
*/
|
|
export function FormSection({ children, title }: FormSectionProps) {
|
|
return (
|
|
<Stack gap={4} fullWidth>
|
|
{title && (
|
|
<Text
|
|
size="xs"
|
|
weight="bold"
|
|
color="text-gray-500"
|
|
uppercase
|
|
letterSpacing="widest"
|
|
borderBottom
|
|
borderColor="border-border-gray"
|
|
pb={1}
|
|
>
|
|
{title}
|
|
</Text>
|
|
)}
|
|
<Stack gap={4} fullWidth>
|
|
{children}
|
|
</Stack>
|
|
</Stack>
|
|
);
|
|
}
|