UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

44 lines (43 loc) • 1.55 kB
import { type ReactNode } from 'react'; import { type Responsive, type Space } from '@mitcsutt/kiln-ui'; import type { HeadingLevel } from '../internal/types.js'; export interface FormPanelsProps { /** Default `1`. */ columns?: Responsive<1 | 2 | 3>; /** Default `5`. */ gap?: Responsive<Space>; children: ReactNode; } export interface FormPanelProps { title: ReactNode; description?: ReactNode; /** Default 3. */ headingLevel?: HeadingLevel; /** Buttons beside the title ("Remove card"). */ actions?: ReactNode; children: ReactNode; } /** One panel: `section aria-labelledby` inside an outline `Card`. */ export declare function FormPanel({ title, description, headingLevel, actions, children, }: FormPanelProps): import("react").JSX.Element; /** * Self-contained groups of fields in outlined cards, like a saved place or a payment method. * * @remarks * `FormPanels` lays out `FormPanel`s, each a `<section>` labelled by its title inside an outlined * card. Use panels for groups that are objects in their own right: an address, a card, a saved * place. A card needs a reason; most sections don't have one. * * @example In a schema * ```json * { * "layout": "panels", * "columns": { "base": 1, "md": 2 }, * "children": [{ "layout": "panel", "title": "Home", "children": [] }] * } * ``` */ declare function FormPanelsRoot(props: FormPanelsProps): import("react").JSX.Element; export declare const FormPanels: typeof FormPanelsRoot & { Panel: typeof FormPanel; }; export {};