import React from 'react'; import { RuleInput } from './rules.js'; export type FormWhenProps = { rule: RuleInput; children?: React.ReactNode; }; /** * Conditionally renders a group of fields by a single rule, computed against * the form's current `values`. * * Visible → a Fragment (NOT a wrapper element: fields live in the `Form.Fields` * CSS grid and any wrapper DOM node would break the column layout). Hidden → * `null`, a full unmount — children's internal state resets, but their values * persist in the form context (the U1/U4 contract; nothing for When to do). * * Nested `