UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

32 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileInput = void 0; const component_1 = require("../../component.cjs"); const TYPE = 'FileInput'; /** * A file input component, which is used to create a file input field. This * component can only be used as a child of the {@link Field} component. * * The total size of the files that can be uploaded may not exceed 64 MB. * * @param props - The props of the component. * @param props.name - The name of the file input field. This is used to * identify the file input field in the form data. * @param props.accept - The file types that the file input field accepts. If * not specified, the file input field accepts all file types. For examples of * valid values, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept). * @param props.compact - Whether the file input field is compact. Default is * `false`. * @param props.disabled - Whether the file input is disabled. * @returns A file input element. * @example * <FileInput name="file" accept={['image/*']} /> * @example * <FileInput name="file" compact /> * @example * <Field label="Upload file"> * <FileInput name="file" /> * </Field> */ exports.FileInput = (0, component_1.createSnapComponent)(TYPE); //# sourceMappingURL=FileInput.cjs.map