/** * Give warnings based on component composition (which slot/parent a child is rendered in). * * Used when child components need to know which slot/parent they are rendered in * (e.g. `FormSummary.Header` vs `FormSummary.Footer`) and should warn or error in development * if placed in a discouraged or forbidden slot. * * Usage: * - Wrap slot components with ... * - In child: `` to forbid slot. * * This is guidance only: warnings are logged to the console in development, never enforced at runtime. */ import React from "react"; type CompositionName = string; type CompositionWarningContextType = { /** * Name of the slot component we want to check. */ name: CompositionName; }; declare const CompositionWarning: React.FC; type CompositionWarningForbiddenProps = { children?: React.ReactElement; /** * Name of the parent slot component where the child is not allowed. */ name: CompositionName; /** * Warning message to display if the child is found. */ message: string; }; declare function CompositionWarningForbidden({ children, name, message, }: CompositionWarningForbiddenProps): React.JSX.Element; export { CompositionWarningForbidden as Forbidden, CompositionWarning as Root };