import { RefAttributes, default as React } from 'react'; import { SafeOmit } from '../../../.deps/utils/src'; import { ImageProps } from '../../Image/Image'; import { ModalProps } from '../../Modal/Modal'; import { RadioGroupProps, SelectKey } from '../RadioGroup/RadioGroup'; import { ImageSelectTranslations } from './dictionary'; export type { SelectKey }; export interface InheritedRadioGroupProps extends SafeOmit, 'id' | 'ref' | 'key' | 'name' | 'onChange' | 'layout' | 'orientation'> { } export interface ImageSelectOwnProps extends RefAttributes { /** * The id of the trigger button. */ id?: string; /** * Called when the user confirms a selection in the modal. */ onChange?: (value: V | null, event: React.MouseEvent) => void; /** * Shows a loading spinner on the modal Confirm button. Use while a consumer-driven onChange is pending. */ loading?: boolean; /** * Aspect ratio applied to both the trigger preview and the modal tiles. * @default '3 / 2' */ aspectRatio?: ImageProps['aspectRatio']; /** * Returns the image source URL for an option. */ getOptionImageSrc(option: T): string; /** * Returns the alt text for an option's image. Falls back to `getOptionLabel(option)` when not provided. */ getOptionImageAlt?(option: T): string | undefined; /** * Override the trigger preview rendering. Receives the currently selected option. */ renderValue?(option: T | null): React.ReactNode; /** * Optional override for the trigger preview aspect ratio. Falls back to `aspectRatio`. */ previewAspectRatio?: ImageProps['aspectRatio']; /** * Size of the radio tiles inside the modal. * @default 'md' */ optionSize?: ImageProps['size']; /** * Modal title. Defaults to the trigger CTA ('Choose image' / 'Change image'). */ modalTitle?: string; /** * Optional description shown below the modal title. */ modalDescription?: React.ReactNode; modalMaxWidth?: ModalProps['maxWidth']; /** * Per-instance translation overrides. */ translations?: Partial; /** * Width of the image preview. * Affects only the layout of the trigger, not the images inside the modal. * @default 'md' */ width?: ImageProps['size']; } export interface ImageSelectProps extends ImageSelectOwnProps, InheritedRadioGroupProps { } export declare function ImageSelect(props: ImageSelectProps): React.JSX.Element; export declare namespace ImageSelect { var displayName: string; }