@carbon/ibm-products
Version:
Carbon for IBM Products
117 lines (116 loc) • 2.94 kB
TypeScript
import { ComposedModal } from '@carbon/react';
import React, { ReactNode, RefObject } from 'react';
type InputType = 'text' | 'password';
type PreformattedExtensions = {
extension?: string;
description?: string;
};
export interface ExportModalProps extends React.ComponentProps<typeof ComposedModal> {
/**
* Body content for the modal
*/
body?: string;
/**
* Optional class name
*/
className?: string;
/**
* specify if an error occurred
*/
error?: boolean;
/**
* messaging to display in the event of an error
*/
errorMessage?: string;
/**
* name of the file being exported
*/
filename: string;
/**
* label text that's displayed when hovering over visibility toggler to hide key
*/
hidePasswordLabel?: string;
/**
* label for the text input
*/
inputLabel?: string;
/**
* specify the type of text input
*/
inputType: InputType;
/**
* text for an invalid input
*/
invalidInputText?: string;
/**
* specify if the modal is in a loading state
*/
loading?: boolean;
/**
* message to display during the loading state
*/
loadingMessage?: string;
/**
* Specify a handler for closing modal
*/
onClose?: () => void;
/**
* Specify a handler for "submitting" modal. Returns the file name
*/
onRequestSubmit?: (value?: string) => void;
/**
* Specify whether the Modal is currently open
*/
open?: boolean;
/**
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
*/
portalTarget?: ReactNode;
/**
* Array of extensions to display as radio buttons
*/
preformattedExtensions: readonly PreformattedExtensions[];
/**
* Label for the preformatted label form group
*/
preformattedExtensionsLabel?: string;
/**
* Specify the text for the primary button
*/
primaryButtonText: string;
/**
* Specify the text for the secondary button
*/
secondaryButtonText: string;
/**
* label text that's displayed when hovering over visibility toggler to show key
*/
showPasswordLabel?: string;
/**
* messaging to display if the export was successful
*/
successMessage?: string;
/**
* specify if the export was successful
*/
successful?: boolean;
/**
* The text displayed at the top of the modal
*/
title: string;
/**
* Reference to trigger button
*/
triggerButtonRef?: RefObject<any>;
/**
* array of valid extensions the file can have
*/
validExtensions: readonly any[];
}
/**
* Modal dialog version of the export pattern
*/
export declare let ExportModal: React.ForwardRefExoticComponent<ExportModalProps & {
children?: ReactNode | undefined;
} & React.RefAttributes<unknown>>;
export {};