@octopusdeploy/design-system-components
Version:
The design systems component library.
63 lines (62 loc) • 2.18 kB
TypeScript
import type React from "react";
import type { PopoverBasicHelpProps } from "../../Popover";
import type { DescriptionContent } from "../utils/descriptionWithLinks";
export interface FileUploadProps {
/**
* The label for the file upload.
*/
label: string;
/**
* Optional description paragraph to display under the label.
* Can be either:
* - A simple string (basic usage)
* - A DescriptionContent array created with descriptionText`...` for rich content with links and code
* @example
* // Simple string
* description="This is a basic description."
*
* // Rich content with links and code
* description={descriptionText`Set ${descriptionCode("isVisible")} prop or see ${descriptionLink("docs", "/docs")}.`}
*/
description?: string | DescriptionContent;
/**
* PopoverBasicHelp component to display additional help information
* displays the Information icon next to the label
*/
popover?: React.ReactElement<PopoverBasicHelpProps>;
/**
* If true displays the (optional) text next to the label
*/
hasOptionalMarker?: boolean;
/**
* If true displays the (required) text next to the label
*/
hasRequiredMarker?: boolean;
/**
* Whether this field has a default value marker
*/
hasDefaultMarker?: boolean;
/**
* Error message to display.
*/
error?: string;
/**
* The action to perform when the form control field is changed.
*/
onChange: (newValue: File[]) => void;
/**
* The max number of files that can be selected.
* @default 1
*/
filesLimit?: number;
/**
* The max file size in bytes.
*/
maxFileSizeBytes?: number;
/**
* The supported file types.
* These must be case insensitive filename extensions starting with a period e.g. ".txt", ".jpg"
*/
acceptedFileTypes?: string[];
}
export declare function FileUpload({ label, description, popover, hasOptionalMarker, hasRequiredMarker, hasDefaultMarker, error, onChange, filesLimit, maxFileSizeBytes, acceptedFileTypes }: FileUploadProps): import("react/jsx-runtime").JSX.Element;