import React, { ElementType } from "react"; import VibeComponentProps from "../../types/VibeComponentProps"; import VibeComponent from "../../types/VibeComponent"; import { TooltipProps } from "../Tooltip/Tooltip"; import { TextType, TextWeight } from "../Text/TextConstants"; import { HeadingType, HeadingWeight } from "../Heading/HeadingConstants"; export interface EditableTypographyImplementationProps { /** Value of the text */ value: string; /** Will be called whenever the current value changes to a non-empty value */ onChange?: (value: string) => void; /** Will be called whenever the component gets clicked */ onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void; /** Disables editing mode - component will be just a typography element */ readOnly?: boolean; /** Shown in edit mode when the text value is empty */ placeholder?: string; /** ARIA Label */ ariaLabel?: string; /** Controls the mode of the component (i.e. view/edit mode) */ isEditMode?: boolean; /** Will be called when the mode of the component changes */ onEditModeChange?: (isEditMode: boolean) => void; /** Override Tooltip props when needed */ tooltipProps?: Partial; } export interface EditableTypographyProps extends VibeComponentProps, EditableTypographyImplementationProps { /** A typography component that is being rendered in view mode */ component: ElementType; /** Controls the style of the typography component in view mode */ typographyClassName: string; /** Shows placeholder when empty, if provided */ clearable?: boolean; /** Sets the Text/Heading type */ type?: TextType | HeadingType; /** Sets the Text/Heading weight */ weight?: TextWeight | HeadingWeight; } declare const EditableTypography: VibeComponent; export default EditableTypography;