/** * How a form arranges its fields. * * Contract v2 lets a form declare sections and column rows (`MdyDynamicLayoutNode` in * `@modyra/core`). What that turns into on screen is this vocabulary: one set of classes and one * custom property, so a two-column row is the same two-column row whichever adapter rendered it and * whichever theme is loaded. Without it each renderer invents its own grid and no theme can style * any of them. */ import type { MdyDynamicBreakpoint, MdyDynamicSlotPlacement } from "@modyra/core"; /** Canonical class vocabulary for declarative layout. */ export declare const MDY_LAYOUT_CLASSES: Readonly<{ /** A titled group of fields. */ section: "mdy-layout-section"; /** The section's title. */ sectionLabel: "mdy-layout-legend"; /** A row that divides its width into columns. */ columns: "mdy-layout-columns"; /** One column within that row. */ column: "mdy-layout-column"; }>; /** * Set by the renderer on a columns row. The foundation divides the row into this many tracks, so a * three-column row needs no extra class and no per-count CSS. */ export declare const MDY_LAYOUT_COLUMN_COUNT_PROPERTY: "--mdy-layout-column-count"; export type MdyLayoutPart = keyof typeof MDY_LAYOUT_CLASSES; /** * The sizes a layout can be authored against. * * Mobile-first and deliberately few: three names cover phone, tablet and desktop, and a form that * needs a fourth is a form arguing with its own content. The widths live here rather than in each * theme because a row that becomes two columns at `sm` has to do it at the same width everywhere — * a breakpoint that moved per theme would make a layout untestable, which is the point of naming it. */ export declare const MDY_LAYOUT_BREAKPOINTS: Readonly>; /** * The same sizes a document authors against, not a second list that happens to agree. * * A placement declared for a size nothing paints is a layout that silently does nothing, so the set * is derived rather than restated: `MDY_LAYOUT_BREAKPOINTS` is typed by it, and a size added on * either side fails to compile until both carry it. */ export type MdyLayoutBreakpoint = MdyDynamicBreakpoint; /** Where a child sits at one size. Aliased, because a document and a renderer describe one placement. */ export type MdyLayoutSlotPlacement = MdyDynamicSlotPlacement; /** How many tracks a row has, per breakpoint. Omitted sizes inherit the next smaller one. */ export type MdyLayoutColumnCounts = Partial>>; /** The custom property carrying the track count at each size. */ export declare const MDY_LAYOUT_COLUMN_COUNT_PROPERTIES: Readonly>; /** The custom property carrying a column's starting track at each size. */ export declare const MDY_LAYOUT_COLUMN_START_PROPERTIES: Readonly>; /** The custom property carrying whether a column shows at each size. */ export declare const MDY_LAYOUT_COLUMN_DISPLAY_PROPERTIES: Readonly>; /** * The inline style a column takes from the slot inside it. * * A slot's placement is the placement of the column it occupies. That is a deliberate reading rather * than a shortcut: `grid-column` and `display` are properties of a grid item, and the column *is* the * grid item — a wrapper inside the cell could not move itself into a different track however it was * styled. A column holding several slots takes the first placement it is given, so a row built one * slot per column — the ordinary case — behaves exactly as written. * * Sizes cascade the way the track count already does: what a size does not say, it inherits from the * next smaller one. Only the sizes actually authored are emitted, so a slot that says nothing adds * no properties and a column with no slot is untouched. */ export declare function layoutSlotStyle(at: Partial>> | undefined): Readonly>; /** The classes and inline style a layout node needs, ready to apply. */ export declare function layoutNodeAttributes(node: { readonly kind: "section" | "columns"; readonly id: string; readonly columns?: ReadonlyArray; /** * Tracks per breakpoint on a row. A section's `at` is a placement rather than a count — it says * where the section's own column sits — and is read by `layoutSlotStyle`, not here. */ readonly at?: MdyLayoutColumnCounts | Partial>>; }): { readonly className: string; readonly style: Readonly>; readonly dataset: Readonly>; };