import { ReactNode, ElementType, CSSProperties, ComponentPropsWithoutRef, HTMLAttributes, } from 'react'; /** * Sentiment types for the SentimentSurface component */ export type Sentiment = 'negative' | 'warning' | 'neutral' | 'success' | 'proposition'; /** * Emphasis levels for the SentimentSurface component */ export type Emphasis = 'base' | 'elevated'; /** * Common properties for the SentimentSurface component */ export interface CommonProps { /** * The sentiment type that determines the colour scheme */ sentiment: Sentiment; /** * The emphasis level affecting background and text contrast * @default 'base' */ emphasis?: Emphasis; /** * If true, sets the `background-color` and `color` on the container. Otherwise, only exposes the tokens as CSS custom properties without rendering. * @default true */ hasBaseStyles?: boolean; children?: ReactNode; className?: string; style?: CSSProperties; id?: string; /** * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests */ 'data-testid'?: string; } /** * Props when rendering as a div or custom element */ export type SentimentSurfaceDivProps = Omit< HTMLAttributes, keyof CommonProps > & CommonProps & { /** * The underlying HTML element to render * @default 'div' */ as?: T; }; /** * All possible props for the SentimentSurface component */ export type SentimentSurfaceProps = SentimentSurfaceDivProps; /** * Combines SentimentSurface props with all valid HTML attributes for the specified element type. * Supports polymorphic rendering via the `as` prop while maintaining full type safety. * * @example * * Error message * */ export type SentimentSurfaceComponentProps = SentimentSurfaceProps & Omit, keyof SentimentSurfaceProps>; /** * The SentimentSurface component type signature */ export interface SentimentSurfaceComponent { (props: SentimentSurfaceComponentProps): ReactNode; displayName?: string; }