@payfit/unity-components
Version:
44 lines (43 loc) • 1.8 kB
TypeScript
import { ComponentPropsWithoutRef, ReactNode } from 'react';
/** Props for the banner above an `AIStructuredInput` question sequence. */
export type AIStructuredInputHeaderProps = Omit<ComponentPropsWithoutRef<'header'>, 'children' | 'className' | 'title'> & {
/** Required header label. */
title: ReactNode;
/** Closes the structured-input surface. */
onClose: () => void;
/** Adds styling to the banner. */
className?: string;
};
/**
* Renders the AI label and a close action above an `AIStructuredInput` question card.
* Pass it through the root's `header` prop so the root can manage the complete
* surface layout.
* @param props - Header label, close action, and standard header attributes.
* @example
* ```tsx
* import { AIStructuredInputHeader } from '@payfit/unity-components/ai-kit'
*
* <AIStructuredInput
* aria-label="Bonus questions"
* header={
* <AIStructuredInputHeader
* title="Bonus questions"
* onClose={closeQuestions}
* />
* }
* >
* ...
* </AIStructuredInput>
* ```
* @see {@link AIStructuredInputHeaderProps} for all available props.
* @param props.title - Required configurable label.
* @see {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=25390-31142 Figma design}
*/
export declare const AIStructuredInputHeader: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children" | "className" | "title"> & {
/** Required header label. */
title: ReactNode;
/** Closes the structured-input surface. */
onClose: () => void;
/** Adds styling to the banner. */
className?: string;
} & import('react').RefAttributes<HTMLElement>>;