import type { ReactNode } from 'react'; import { type ComboboxItems } from './comboboxItems.js'; import type { MenuEntry, MenuSearch } from './MenuEntries.js'; import { type ModalSize } from './Modal.js'; interface CreateModalProps { open: boolean; onClose: () => void; typeIcon?: ReactNode; typeLabel: string; /** Makes the type chip a dropdown to switch between sibling form types. */ typeMenu?: MenuEntry[] | undefined; /** A search atop the type chip's menu, for a long list such as many teams. */ typeMenuSearch?: MenuSearch | undefined; namePlaceholder: string; hideName?: boolean; initialName?: string | undefined; showDescription?: boolean; descriptionPlaceholder?: string; /** Takes the description's place, such as a rich text editor. Typing in it counts as * unsaved input, as the description's does. */ descriptionField?: ReactNode; submitLabel?: string; submittingLabel?: string; validateName?: ((name: string) => string | null) | undefined; /** Normalize the name as the user types (e.g. strip disallowed characters). */ sanitizeName?: (name: string) => string; nameHint?: ((name: string) => ReactNode) | undefined; /** The dialog's fields: an `Input`, or a `Field` around any other control. */ children?: ReactNode; /** Compact pills, such as `CreateModalSelect` and `CreateModalSwitch`, in a row under the name. */ properties?: ReactNode; advanced?: ReactNode; submitDisabled?: boolean; /** Hide the primary submit button and label the dismiss button "Close". */ hideSubmit?: boolean; nameOptional?: boolean; onNameChange?: (name: string) => void; /** Additional unsaved input in `children`/`properties` that should block an * accidental dismiss (name/description/favorite are already tracked). */ dirty?: boolean; /** Show a favorite toggle in the footer. */ showFavorite?: boolean; /** Muted text at the footer's start, such as which keys submit, written with `Kbd` so each * reader sees their own keyboard's modifier. Hidden on a touch screen, where keys mean * nothing. `error` takes its place. */ footerHint?: ReactNode; /** Why the last submit failed, at the footer's start, read out as it appears. */ error?: ReactNode; /** Its width, as `Modal`'s: `xl` for a long body such as a rich text editor. It narrows to * fit a small window. */ size?: ModalSize | undefined; align?: 'top' | 'center' | undefined; /** Resolves true to close the modal, false to keep it open (e.g. on error). `modifier` is * true when submitted with ⌘/Ctrl+Enter, so a host can create and then open what it made. */ onSubmit: (name: string, description: string, favorite: boolean, how: { modifier: boolean; }) => Promise; } /** Submits on Enter in the name field or ⌘/Ctrl+Enter from anywhere in the panel. */ export declare function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, typeMenuSearch, namePlaceholder, hideName, initialName, showDescription, descriptionPlaceholder, descriptionField, submitLabel, submittingLabel, validateName, sanitizeName, nameHint, children, properties, advanced, submitDisabled, hideSubmit, nameOptional, onNameChange, dirty, showFavorite, footerHint, error, size, align, onSubmit, }: CreateModalProps): import("react").JSX.Element; /** Compact property pill with an on/off switch. */ export declare function CreateModalSwitch({ label, checked, onCheckedChange, tooltip, }: { label: string; checked: boolean; onCheckedChange: (checked: boolean) => void; /** Help text surfaced on hover (explains what the toggle does). */ tooltip?: string; }): import("react").JSX.Element; /** Compact property pill that picks one value from a searchable list. Items may carry * icons, descriptions and group headings (e.g. Clusters vs Kubernetes). */ export declare function CreateModalSelect({ label, icon, value, items, onValueChange, disabled, disabledReason, tooltip, }: { label: string; icon?: ReactNode; value?: string | undefined; items: ComboboxItems; onValueChange: (value: string) => void; /** Gray the pill out (e.g. while a prerequisite pill is unset). */ disabled?: boolean; /** Why the pill is disabled, shown in place of the tooltip (e.g. the prerequisite). */ disabledReason?: string | undefined; /** Help text surfaced on hover (explains what the pill selects). */ tooltip?: string; }): import("react").JSX.Element; export {};