import React from 'react'; import { InputProps, ButtonProps } from '@bigbinary/neetoui'; interface InlineInputProps extends InputProps { className?: string; value?: string; nullable?: boolean; isSaving?: boolean; saveOnBlur?: boolean; clearOnSave?: boolean; submitButtonProps?: ButtonProps; cancelButtonProps?: ButtonProps; handleSubmit: (value: string) => void; handleCancel: (value: string) => void; size?: "small" | "medium" | "large"; } interface FormikInlineInputProps extends InlineInputProps { name: string; handleSubmit?: (value: string) => void; handleCancel?: (value: string) => void; } /** * * An input field with built-in functionality for handling saving and cancelling * * actions via buttons, keypress and blur handlers. * * @example * * import InlineInput from "@bigbinary/neeto-molecules/InlineInput"; * * const TaskInput = () => { * const [taskName, setTaskName] = useState("Sample task"); * const [isEditorOpen, setIsEditorOpen] = useState(false); * * return ( *
* {isEditorOpen ? ( * setIsEditorOpen(false)} * value={taskName} * handleSubmit={value => { * setTaskName(value); * setIsEditorOpen(false); * }} * /> * ) : ( * setIsEditorOpen(true)} * > * {taskName} * * )} *
* ); * }; * @endexample * The InlineInput component wrapped in Formik. * * @example * * import { FormikInlineInput } from "@bigbinary/neeto-molecules/InlineInput"; * import { Form } from "@bigbinary/neetoui/formik"; * * const App = () => ( * return ( *
* * * ); * ); * @endexample */ declare const InlineInput: React.ForwardRefExoticComponent; declare const FormikInlineInput: React.ForwardRefExoticComponent; export { FormikInlineInput, InlineInput }; export type { FormikInlineInputProps, InlineInputProps };