@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
35 lines (34 loc) • 1.34 kB
TypeScript
import type { PropsFor } from "../../types.js";
export type FileInputAreaProps = PropsFor<"input", {
/** Available states: `default`, and `alert` (red border) */
state?: "default" | "alert";
}>;
/**
* File upload form field, wraps a native `<input type="file">`, and supports
* the same props/event listeners like `onInput` and `multiple`.
*
* Browsers will let users drag-and-drop files to it, or click/tap to open a
* file selector.
*
* **Note:** The native `<input type="file">` will be visually hidden so you are
* required to provide content and feedback based on input events and state.
* @example
* <FileInputArea aria-label="Upload file">
* <Icon
* icon={faArrowUpFromBracket}
* className="bfc-base-2"
* style={{ marginBottom: 8 }}
* />
* <div>
* Drag & drop file or{" "}
* <span className="bf-neutral-link-text">click to upload</span>
* </div>
* <div className="bfc-base-2">.csv file, less than 10 MB</div>
* </FileInputArea>
* @example
* // connected to a visible label
* <Label htmlFor="my-file-input-area">Upload file</Label>
* <FileInputArea id="my-file-input-area">...</FileInputArea>
*/
declare const FileInputArea: import("react").ForwardRefExoticComponent<FileInputAreaProps & import("react").RefAttributes<HTMLInputElement>>;
export default FileInputArea;