import React, { type ElementType } from "react"; import { type VibeComponentProps } from "../../types"; import { type TooltipProps } from "@vibe/tooltip"; import { type TextType, type TextWeight } from "@vibe/typography"; import { type HeadingType, type HeadingWeight } from "@vibe/typography"; export interface EditableTypographyImplementationProps { /** * The current value of the text. */ value: string; /** * Callback fired when the value changes. */ onChange?: (value: string) => void; /** * Callback fired when the component is clicked. */ onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void; /** * Callback fired when a key is pressed inside the input/textarea element. */ onKeyDown?: (event: React.KeyboardEvent) => void; /** * If true, the text is read-only and cannot be edited. */ readOnly?: boolean; /** * Placeholder text displayed when the value is empty. */ placeholder?: string; /** * The label of the component for accessibility. */ "aria-label"?: string; /** * Controls whether the component is in edit mode. */ isEditMode?: boolean; /** * If true, automatically selects all text when entering edit mode. */ autoSelectTextOnEditMode?: boolean; /** * Callback fired when the edit mode changes. */ onEditModeChange?: (isEditMode: boolean) => void; /** * Props to customize the tooltip. */ tooltipProps?: Partial; } export interface EditableTypographyProps extends VibeComponentProps, EditableTypographyImplementationProps { /** * The typography component used in view mode. */ component: ElementType; /** * Class name applied to the typography component. */ typographyClassName: string; /** * If true, shows the placeholder when empty. */ clearable?: boolean; /** * The text or heading type. */ type?: TextType | HeadingType; /** * The text or heading weight. */ weight?: TextWeight | HeadingWeight; /** * If true, enables multi-line editing. */ multiline?: boolean; } declare const EditableTypography: React.ForwardRefExoticComponent>; export default EditableTypography;