UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

64 lines 2.81 kB
/** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import type { CommonProps, HtmlAttributes } from '../../_common/types'; type PromptProps = { /** The prompt text */ value?: React.ComponentPropsWithoutRef<'textarea'>['value']; /** Callback function called when the prompt text changes */ onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void; /** Whether the submit button is disabled */ isSubmitDisabled?: boolean; /** Maximum number of rows the textarea can expand to */ maxRows?: number; /** Whether the submit button is "running". Shows a stop icon when true. */ isRunningPrompt?: boolean; /** Callback function called when the submit button is clicked */ onSubmitPrompt?: (e: React.KeyboardEvent<HTMLTextAreaElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; /** Callback function called when the cancel button is clicked */ onCancelPrompt?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; /** Content to display above the textarea */ topContent?: React.ReactNode; /** Content to display below the textarea */ bottomContent?: React.ReactNode; /** Disclaimer to display below the component */ disclaimer?: React.ReactNode; /** Props for the textarea element */ textareaProps?: HtmlAttributes<'textarea'>; }; type AgentSelectProps = { value: { label: React.ReactNode; value: string; }; options: Array<{ label: React.ReactNode; value: string; }>; onChange: (option: { label: React.ReactNode; value: string; }) => void; }; declare const Prompt: (({ value, onChange, maxRows, isRunningPrompt, onSubmitPrompt, onCancelPrompt, isSubmitDisabled, topContent, bottomContent, disclaimer, className, style, htmlAttributes, ref, textareaProps, ...restProps }: CommonProps<"div", PromptProps>) => import("react/jsx-runtime").JSX.Element) & { Select: ({ value, options, onChange }: AgentSelectProps) => import("react/jsx-runtime").JSX.Element; }; export { Prompt }; //# sourceMappingURL=Prompt.d.ts.map