/*! * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved. * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") * * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and limitations under the License. */ import { FieldComponentProps } from "../FieldComponentProps.js"; export declare const fileUploadTypes: readonly ["single", "multiple"]; export declare const fileUploadVariants: readonly ["button", "dragAndDrop", "dragAndDropWithIcon"]; export type FileUploaderProps = { /** * an array of file types the user is able to upload. * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers for examples */ acceptedFileTypes?: string[]; /** * The initial file list for uncontrolled usage. Applied only on mount. */ defaultValue?: File[]; /** * If `true`, the file uploader is disabled and cannot accept new files. * @default false */ isDisabled?: boolean; /** * The label for the `input` element. */ label: string; /** * Called when the list of files to upload changes. Receives the updated file array. */ onChange: (files: File[]) => void; /** * Controls how many files the uploader accepts. * - If `'single'`, only one file can be selected at a time. * - If `'multiple'`, the user can select more than one file at once. */ type?: (typeof fileUploadTypes)[number]; /** * The file list for controlled usage. When provided, the consumer is responsible for updating it via `onChange`. */ value?: File[]; /** * The visual interaction style. `"button"` renders a compact upload button; * `"dragAndDrop"` renders a drop zone; `"dragAndDropWithIcon"` adds an illustration to the drop zone. */ variant: (typeof fileUploadVariants)[number]; } & Pick; declare const MemoizedFileUploader: import("react").MemoExoticComponent<({ acceptedFileTypes, defaultValue, errorMessage, id, isDisabled, isFullWidth, isOptional, hint, HintLinkComponent, label, onChange, type, value, variant, }: FileUploaderProps) => import("@emotion/react/jsx-runtime").JSX.Element>; export { MemoizedFileUploader as FileUpload, MemoizedFileUploader as FileUploader, }; //# sourceMappingURL=FileUploader.d.ts.map