/** * Copyright IBM Corp. 2022, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { PropsWithChildren } from 'react'; import PropTypes from 'prop-types'; type Size = 'sm' | 'md' | 'lg'; type AlignPropType = 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right'; type Shape = { cancel: AlignPropType; edit: AlignPropType; save: AlignPropType; }; export interface EditInplaceProps extends PropsWithChildren { /** * label for cancel button */ cancelLabel: string; /** * By default the edit icon is shown on hover only. */ editAlwaysVisible?: boolean; /** * label for edit button */ editLabel: string; /** * Specify a custom id for the input */ id: string; /** * inheritTypography - causes the text entry field to inherit typography settings * assigned to the container. This is useful when editing titles for instance. * * NOTE: The size property limits the vertical size of the input element. * Inherited font's should be selected to fit within the size selected. */ inheritTypography?: boolean; /** * determines if the input is invalid */ invalid?: boolean; /** * text that is displayed if the input is invalid */ invalidText?: string; /** * Provide the text that will be read by a screen reader when visiting this control */ labelText: string; /** * handler to add custom onBlur event */ onBlur?: (value: string) => void; /** * handler that is called when the cancel button is pressed or when the user removes focus from the input and there is no new value */ onCancel: (value: string) => void; /** * handler that is called when the input is updated */ onChange: (value: string) => void; /** * handler that is called when the save button is pressed or when the user removes focus from the input if it has a new value */ onSave: () => void; /** * determines if the input is in readOnly mode */ readOnly?: boolean; /** * label for the edit off button that displays when in read only mode */ readOnlyLabel?: string; /** * text for the toggletip that displays when in read only mode */ readOnlyToggleTipText?: string; /** * label for save button */ saveLabel: string; /** * alignment for the toggletip that displays when in read only mode */ toggleTipAlignment?: AlignPropType; /** * vertical size of control */ size?: Size; /** * tooltipAlignment from the standard tooltip. Default center. * * Can be passed either as one of tooltip options or as an object specifying cancel, edit and save separately */ tooltipAlignment?: AlignPropType | Shape; /** * current value of the input */ value: string; /** * placeholder for the input */ placeholder?: string; } export declare const EditInPlace: React.ForwardRefExoticComponent>; export declare const deprecatedProps: { /** * **Deprecated** * invalidLabel was misnamed, using invalidText to match Carbon */ invalidText: PropTypes.Requireable; }; export {}; //# sourceMappingURL=EditInPlace.d.ts.map