import { type FC, type ReactNode } from 'react'; /** * Mirrors the shape of GSK's `Button` icon props, where a prop is a union of a * component type and `ReactNode` (`FC<…> | ReactNode`). Because `FC` is not * assignable to `ReactNode`, TypeScript keeps this a real union and expands the * `ReactNode` alias into its constituents — which previously caused the prop to * infer as a plain string field instead of a ReactNode slot. */ interface UnionReactNodeProps { /** Component-or-node union, like an icon slot. Should be a slot. */ iconLeading?: FC<{ className?: string; }> | ReactNode; /** Plain string-or-node union. Should be a slot. */ label?: string | ReactNode; /** Bare ReactNode. Should be a slot (regression guard for the existing path). */ iconTrailing?: ReactNode; /** Enum union — must stay a prop, NOT be treated as a slot. */ size?: 'sm' | 'md' | 'lg'; /** Enum whose value happens to be the literal "ReactNode" — must stay a prop. */ display?: 'ReactNode' | 'text'; } export declare const UnionReactNode: ({ iconLeading, label, iconTrailing, size, display, }: UnionReactNodeProps) => import("react/jsx-runtime").JSX.Element; /** * Faithfully mirrors GSK's `Button`: the props type is itself a UNION of two * interfaces (button vs. link) that share `iconLeading: FC<…> | ReactNode`. * That extra union-of-interfaces level is what nests the icon prop one deeper * than a plain object props type — the exact shape that must still route the * icon prop to a ReactNode slot. */ interface IconButtonCommonProps { /** Component-or-node union, like an icon slot. Should be a slot. */ iconLeading?: FC<{ className?: string; }> | ReactNode; /** Enum union — must stay a prop. */ size?: 'sm' | 'md' | 'lg'; } interface IconButtonAsButtonProps extends IconButtonCommonProps { type?: 'button' | 'submit' | 'reset'; } interface IconButtonAsLinkProps extends IconButtonCommonProps { href?: string; } export type UnionPropsIconButtonProps = IconButtonAsButtonProps | IconButtonAsLinkProps; export declare const UnionPropsIconButton: (props: UnionPropsIconButtonProps) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=union-react-node.d.ts.map