@grasp-labs/ds-react-components 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/fileInput/FileInput.d.ts +28 -0
- package/dist/components/fileInput/index.d.ts +1 -0
- package/dist/{index-DnAYLZ11.js → index-CwNLBbHw.js} +2099 -2012
- package/dist/index.d.ts +1 -0
- package/dist/{index.esm-CxO4uPdH.js → index.esm-DjUGbkSD.js} +1 -1
- package/dist/index.js +73 -72
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type FileInputProps = Omit<ComponentPropsWithRef<"input">, "type" | "value"> & {
|
|
3
|
+
/** Label for the button */
|
|
4
|
+
buttonLabel?: string;
|
|
5
|
+
/** Custom class for the container */
|
|
6
|
+
containerClassName?: string;
|
|
7
|
+
/** Callback fired when files are selected */
|
|
8
|
+
onFileSelect?: (files: FileList | null) => void;
|
|
9
|
+
/** Variant for the button */
|
|
10
|
+
variant?: "primary" | "secondary" | "danger";
|
|
11
|
+
/** Text shown when no file is selected */
|
|
12
|
+
noFileText?: string;
|
|
13
|
+
/** Function used to render the multiple-files selected text */
|
|
14
|
+
filesSelectedText?: (count: number) => string;
|
|
15
|
+
/** Whether to show a clear button when files are selected */
|
|
16
|
+
clearable?: boolean;
|
|
17
|
+
/** Label for the clear button */
|
|
18
|
+
clearButtonLabel?: string;
|
|
19
|
+
/** Callback fired when selection is cleared */
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A styled file input field wrapped in a label, showing the selected file name(s) or a default button label.
|
|
24
|
+
*/
|
|
25
|
+
export declare const FileInput: {
|
|
26
|
+
({ className, containerClassName, buttonLabel, variant, noFileText, filesSelectedText, clearable, clearButtonLabel, disabled, multiple, id, onChange, onFileSelect, onClear, ref, ...props }: FileInputProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FileInput';
|