import type { PropsWithChildren, ReactNode } from 'react'
import clsx from 'clsx'
type ConsumerFormSectionProps = PropsWithChildren<{
className?: string
description?: ReactNode
title: ReactNode
variant?: 'surface' | 'embedded'
}>
export const ConsumerFormSection = ({ children, className, description, title, variant = 'surface' }: ConsumerFormSectionProps) => (
{title}
{description ?
{description}
: null}
{children}
)
type ConsumerFormShellProps = PropsWithChildren<{
className?: string
description?: ReactNode
progress?: ReactNode
/** Keeps chrome static while the form body owns the vertical scrollport. */
scrollable?: boolean
status?: ReactNode
title?: ReactNode
utilityAction?: ReactNode
}>
/**
* Shared visual shell for long, task-oriented consumer forms.
* Domain forms keep ownership of their fields and validation; the shell only
* standardises hierarchy, canvas/surface contrast, status and progress.
*/
export const ConsumerFormShell = ({
children,
className,
description,
progress,
scrollable = false,
status,
title,
utilityAction,
}: ConsumerFormShellProps) => (
{title || status || description || utilityAction ? (
{title ?
{title}
: null}
{status ? (
{status}
) : null}
{description ?
{description}
: null}
{utilityAction ?
{utilityAction}
: null}
) : null}
{progress ? (
{progress}
) : null}
{scrollable ?
{children}
: children}
)
type ConsumerFormActionsProps = PropsWithChildren<{
className?: string
helper?: ReactNode
}>
export const ConsumerFormActions = ({ children, className, helper }: ConsumerFormActionsProps) => (
{helper ?
{helper}
:
}
{children}
)