@spark-ui/components 11.5.1 → 11.6.1
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/alert-dialog/index.mjs +1 -1
- package/dist/avatar/index.mjs +2 -2
- package/dist/carousel/index.mjs +2 -2
- package/dist/{chunk-TKAU6SMC.mjs → chunk-7EWSMIZU.mjs} +21 -4
- package/dist/chunk-7EWSMIZU.mjs.map +1 -0
- package/dist/combobox/index.mjs +3 -3
- package/dist/dialog/index.mjs +1 -1
- package/dist/docgen.json +341 -63
- package/dist/drawer/index.mjs +2 -2
- package/dist/dropdown/index.mjs +2 -2
- package/dist/file-upload/index.d.mts +50 -31
- package/dist/file-upload/index.d.ts +50 -31
- package/dist/file-upload/index.js +294 -120
- package/dist/file-upload/index.js.map +1 -1
- package/dist/file-upload/index.mjs +253 -97
- package/dist/file-upload/index.mjs.map +1 -1
- package/dist/pagination/index.mjs +3 -3
- package/dist/popover/index.mjs +1 -1
- package/dist/progress/index.d.mts +6 -2
- package/dist/progress/index.d.ts +6 -2
- package/dist/progress/index.js +20 -3
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/scrolling-list/index.mjs +3 -3
- package/dist/snackbar/index.mjs +3 -3
- package/dist/stepper/index.mjs +2 -2
- package/dist/tabs/index.mjs +3 -3
- package/dist/toast/index.mjs +3 -3
- package/package.json +5 -5
- package/dist/chunk-TKAU6SMC.mjs.map +0 -1
|
@@ -5,6 +5,52 @@ import { ButtonProps } from '../button/index.mjs';
|
|
|
5
5
|
import 'class-variance-authority/types';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* File upload error codes
|
|
10
|
+
*/
|
|
11
|
+
declare const FILE_UPLOAD_ERRORS: {
|
|
12
|
+
/**
|
|
13
|
+
* Exceeds the maxFiles limit
|
|
14
|
+
*/
|
|
15
|
+
readonly TOO_MANY_FILES: "TOO_MANY_FILES";
|
|
16
|
+
/**
|
|
17
|
+
* File type not in the accept list
|
|
18
|
+
*/
|
|
19
|
+
readonly FILE_INVALID_TYPE: "FILE_INVALID_TYPE";
|
|
20
|
+
/**
|
|
21
|
+
* File size exceeds maxFileSize
|
|
22
|
+
*/
|
|
23
|
+
readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
|
|
24
|
+
/**
|
|
25
|
+
* File size below minFileSize
|
|
26
|
+
*/
|
|
27
|
+
readonly FILE_TOO_SMALL: "FILE_TOO_SMALL";
|
|
28
|
+
/**
|
|
29
|
+
* Generic validation failure
|
|
30
|
+
*/
|
|
31
|
+
readonly FILE_INVALID: "FILE_INVALID";
|
|
32
|
+
/**
|
|
33
|
+
* Duplicate file detected
|
|
34
|
+
*/
|
|
35
|
+
readonly FILE_EXISTS: "FILE_EXISTS";
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type FileUploadFileError = typeof FILE_UPLOAD_ERRORS.TOO_MANY_FILES | typeof FILE_UPLOAD_ERRORS.FILE_INVALID_TYPE | typeof FILE_UPLOAD_ERRORS.FILE_TOO_LARGE | typeof FILE_UPLOAD_ERRORS.FILE_TOO_SMALL | typeof FILE_UPLOAD_ERRORS.FILE_INVALID | typeof FILE_UPLOAD_ERRORS.FILE_EXISTS;
|
|
39
|
+
interface RejectedFile$1 {
|
|
40
|
+
file: File;
|
|
41
|
+
errors: FileUploadFileError[];
|
|
42
|
+
}
|
|
43
|
+
interface FileAcceptDetails {
|
|
44
|
+
files: File[];
|
|
45
|
+
}
|
|
46
|
+
interface FileRejectDetails {
|
|
47
|
+
files: RejectedFile$1[];
|
|
48
|
+
}
|
|
49
|
+
interface FileChangeDetails {
|
|
50
|
+
acceptedFiles: File[];
|
|
51
|
+
rejectedFiles: RejectedFile$1[];
|
|
52
|
+
}
|
|
53
|
+
|
|
8
54
|
interface FileUploadProps {
|
|
9
55
|
/**
|
|
10
56
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
@@ -82,31 +128,12 @@ interface FileUploadProps {
|
|
|
82
128
|
*/
|
|
83
129
|
locale?: string;
|
|
84
130
|
}
|
|
85
|
-
type FileUploadFileError = 'TOO_MANY_FILES' | 'FILE_INVALID_TYPE' | 'FILE_TOO_LARGE' | 'FILE_TOO_SMALL' | 'FILE_INVALID' | 'FILE_EXISTS';
|
|
86
|
-
interface RejectedFile$1 {
|
|
87
|
-
file: File;
|
|
88
|
-
errors: FileUploadFileError[];
|
|
89
|
-
}
|
|
90
|
-
interface FileAcceptDetails {
|
|
91
|
-
files: File[];
|
|
92
|
-
}
|
|
93
|
-
interface FileRejectDetails {
|
|
94
|
-
files: RejectedFile$1[];
|
|
95
|
-
}
|
|
96
|
-
interface FileChangeDetails {
|
|
97
|
-
acceptedFiles: File[];
|
|
98
|
-
rejectedFiles: RejectedFile$1[];
|
|
99
|
-
}
|
|
100
131
|
declare const FileUpload$1: {
|
|
101
132
|
({ asChild: _asChild, children, defaultValue, value: controlledValue, onFileAccept, onFileReject, onFileChange, multiple, accept, maxFiles, maxFileSize, minFileSize, disabled: disabledProp, readOnly: readOnlyProp, locale, }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
102
133
|
displayName: string;
|
|
103
134
|
};
|
|
104
135
|
|
|
105
136
|
interface FileUploadAcceptedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
106
|
-
/**
|
|
107
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
108
|
-
*/
|
|
109
|
-
asChild?: boolean;
|
|
110
137
|
ref?: Ref<HTMLLIElement>;
|
|
111
138
|
/**
|
|
112
139
|
* The file to display
|
|
@@ -127,7 +154,7 @@ interface FileUploadAcceptedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
|
127
154
|
className?: string;
|
|
128
155
|
}
|
|
129
156
|
declare const AcceptedFile: {
|
|
130
|
-
({
|
|
157
|
+
({ className, file, uploadProgress, deleteButtonAriaLabel, progressAriaLabel, ...props }: FileUploadAcceptedFileProps): react_jsx_runtime.JSX.Element;
|
|
131
158
|
displayName: string;
|
|
132
159
|
};
|
|
133
160
|
|
|
@@ -168,10 +195,6 @@ declare const ItemDeleteTrigger: {
|
|
|
168
195
|
};
|
|
169
196
|
|
|
170
197
|
interface FileUploadPreviewImageProps extends ComponentPropsWithoutRef<'div'> {
|
|
171
|
-
/**
|
|
172
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
173
|
-
*/
|
|
174
|
-
asChild?: boolean;
|
|
175
198
|
ref?: Ref<HTMLDivElement>;
|
|
176
199
|
className?: string;
|
|
177
200
|
/**
|
|
@@ -184,15 +207,11 @@ interface FileUploadPreviewImageProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
184
207
|
fallback?: React.ReactNode;
|
|
185
208
|
}
|
|
186
209
|
declare const PreviewImage: {
|
|
187
|
-
({
|
|
210
|
+
({ className, file, fallback, ...props }: FileUploadPreviewImageProps): react_jsx_runtime.JSX.Element;
|
|
188
211
|
displayName: string;
|
|
189
212
|
};
|
|
190
213
|
|
|
191
214
|
interface FileUploadRejectedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
192
|
-
/**
|
|
193
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
194
|
-
*/
|
|
195
|
-
asChild?: boolean;
|
|
196
215
|
ref?: Ref<HTMLLIElement>;
|
|
197
216
|
/**
|
|
198
217
|
* The rejected file to display
|
|
@@ -211,7 +230,7 @@ interface FileUploadRejectedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
|
211
230
|
className?: string;
|
|
212
231
|
}
|
|
213
232
|
declare const RejectedFile: {
|
|
214
|
-
({
|
|
233
|
+
({ className, rejectedFile, renderError, deleteButtonAriaLabel, ...props }: FileUploadRejectedFileProps): react_jsx_runtime.JSX.Element;
|
|
215
234
|
displayName: string;
|
|
216
235
|
};
|
|
217
236
|
|
|
@@ -248,4 +267,4 @@ declare const FileUpload: typeof FileUpload$1 & {
|
|
|
248
267
|
RejectedFileDeleteTrigger: typeof RejectedFileDeleteTrigger;
|
|
249
268
|
};
|
|
250
269
|
|
|
251
|
-
export { type FileAcceptDetails, type FileChangeDetails, type FileRejectDetails, FileUpload, type FileUploadFileError, type RejectedFile$1 as RejectedFile };
|
|
270
|
+
export { FILE_UPLOAD_ERRORS, type FileAcceptDetails, type FileChangeDetails, type FileRejectDetails, FileUpload, type FileUploadFileError, type RejectedFile$1 as RejectedFile };
|
|
@@ -5,6 +5,52 @@ import { ButtonProps } from '../button/index.js';
|
|
|
5
5
|
import 'class-variance-authority/types';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* File upload error codes
|
|
10
|
+
*/
|
|
11
|
+
declare const FILE_UPLOAD_ERRORS: {
|
|
12
|
+
/**
|
|
13
|
+
* Exceeds the maxFiles limit
|
|
14
|
+
*/
|
|
15
|
+
readonly TOO_MANY_FILES: "TOO_MANY_FILES";
|
|
16
|
+
/**
|
|
17
|
+
* File type not in the accept list
|
|
18
|
+
*/
|
|
19
|
+
readonly FILE_INVALID_TYPE: "FILE_INVALID_TYPE";
|
|
20
|
+
/**
|
|
21
|
+
* File size exceeds maxFileSize
|
|
22
|
+
*/
|
|
23
|
+
readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
|
|
24
|
+
/**
|
|
25
|
+
* File size below minFileSize
|
|
26
|
+
*/
|
|
27
|
+
readonly FILE_TOO_SMALL: "FILE_TOO_SMALL";
|
|
28
|
+
/**
|
|
29
|
+
* Generic validation failure
|
|
30
|
+
*/
|
|
31
|
+
readonly FILE_INVALID: "FILE_INVALID";
|
|
32
|
+
/**
|
|
33
|
+
* Duplicate file detected
|
|
34
|
+
*/
|
|
35
|
+
readonly FILE_EXISTS: "FILE_EXISTS";
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type FileUploadFileError = typeof FILE_UPLOAD_ERRORS.TOO_MANY_FILES | typeof FILE_UPLOAD_ERRORS.FILE_INVALID_TYPE | typeof FILE_UPLOAD_ERRORS.FILE_TOO_LARGE | typeof FILE_UPLOAD_ERRORS.FILE_TOO_SMALL | typeof FILE_UPLOAD_ERRORS.FILE_INVALID | typeof FILE_UPLOAD_ERRORS.FILE_EXISTS;
|
|
39
|
+
interface RejectedFile$1 {
|
|
40
|
+
file: File;
|
|
41
|
+
errors: FileUploadFileError[];
|
|
42
|
+
}
|
|
43
|
+
interface FileAcceptDetails {
|
|
44
|
+
files: File[];
|
|
45
|
+
}
|
|
46
|
+
interface FileRejectDetails {
|
|
47
|
+
files: RejectedFile$1[];
|
|
48
|
+
}
|
|
49
|
+
interface FileChangeDetails {
|
|
50
|
+
acceptedFiles: File[];
|
|
51
|
+
rejectedFiles: RejectedFile$1[];
|
|
52
|
+
}
|
|
53
|
+
|
|
8
54
|
interface FileUploadProps {
|
|
9
55
|
/**
|
|
10
56
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
@@ -82,31 +128,12 @@ interface FileUploadProps {
|
|
|
82
128
|
*/
|
|
83
129
|
locale?: string;
|
|
84
130
|
}
|
|
85
|
-
type FileUploadFileError = 'TOO_MANY_FILES' | 'FILE_INVALID_TYPE' | 'FILE_TOO_LARGE' | 'FILE_TOO_SMALL' | 'FILE_INVALID' | 'FILE_EXISTS';
|
|
86
|
-
interface RejectedFile$1 {
|
|
87
|
-
file: File;
|
|
88
|
-
errors: FileUploadFileError[];
|
|
89
|
-
}
|
|
90
|
-
interface FileAcceptDetails {
|
|
91
|
-
files: File[];
|
|
92
|
-
}
|
|
93
|
-
interface FileRejectDetails {
|
|
94
|
-
files: RejectedFile$1[];
|
|
95
|
-
}
|
|
96
|
-
interface FileChangeDetails {
|
|
97
|
-
acceptedFiles: File[];
|
|
98
|
-
rejectedFiles: RejectedFile$1[];
|
|
99
|
-
}
|
|
100
131
|
declare const FileUpload$1: {
|
|
101
132
|
({ asChild: _asChild, children, defaultValue, value: controlledValue, onFileAccept, onFileReject, onFileChange, multiple, accept, maxFiles, maxFileSize, minFileSize, disabled: disabledProp, readOnly: readOnlyProp, locale, }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
102
133
|
displayName: string;
|
|
103
134
|
};
|
|
104
135
|
|
|
105
136
|
interface FileUploadAcceptedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
106
|
-
/**
|
|
107
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
108
|
-
*/
|
|
109
|
-
asChild?: boolean;
|
|
110
137
|
ref?: Ref<HTMLLIElement>;
|
|
111
138
|
/**
|
|
112
139
|
* The file to display
|
|
@@ -127,7 +154,7 @@ interface FileUploadAcceptedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
|
127
154
|
className?: string;
|
|
128
155
|
}
|
|
129
156
|
declare const AcceptedFile: {
|
|
130
|
-
({
|
|
157
|
+
({ className, file, uploadProgress, deleteButtonAriaLabel, progressAriaLabel, ...props }: FileUploadAcceptedFileProps): react_jsx_runtime.JSX.Element;
|
|
131
158
|
displayName: string;
|
|
132
159
|
};
|
|
133
160
|
|
|
@@ -168,10 +195,6 @@ declare const ItemDeleteTrigger: {
|
|
|
168
195
|
};
|
|
169
196
|
|
|
170
197
|
interface FileUploadPreviewImageProps extends ComponentPropsWithoutRef<'div'> {
|
|
171
|
-
/**
|
|
172
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
173
|
-
*/
|
|
174
|
-
asChild?: boolean;
|
|
175
198
|
ref?: Ref<HTMLDivElement>;
|
|
176
199
|
className?: string;
|
|
177
200
|
/**
|
|
@@ -184,15 +207,11 @@ interface FileUploadPreviewImageProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
184
207
|
fallback?: React.ReactNode;
|
|
185
208
|
}
|
|
186
209
|
declare const PreviewImage: {
|
|
187
|
-
({
|
|
210
|
+
({ className, file, fallback, ...props }: FileUploadPreviewImageProps): react_jsx_runtime.JSX.Element;
|
|
188
211
|
displayName: string;
|
|
189
212
|
};
|
|
190
213
|
|
|
191
214
|
interface FileUploadRejectedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
192
|
-
/**
|
|
193
|
-
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
194
|
-
*/
|
|
195
|
-
asChild?: boolean;
|
|
196
215
|
ref?: Ref<HTMLLIElement>;
|
|
197
216
|
/**
|
|
198
217
|
* The rejected file to display
|
|
@@ -211,7 +230,7 @@ interface FileUploadRejectedFileProps extends ComponentPropsWithoutRef<'li'> {
|
|
|
211
230
|
className?: string;
|
|
212
231
|
}
|
|
213
232
|
declare const RejectedFile: {
|
|
214
|
-
({
|
|
233
|
+
({ className, rejectedFile, renderError, deleteButtonAriaLabel, ...props }: FileUploadRejectedFileProps): react_jsx_runtime.JSX.Element;
|
|
215
234
|
displayName: string;
|
|
216
235
|
};
|
|
217
236
|
|
|
@@ -248,4 +267,4 @@ declare const FileUpload: typeof FileUpload$1 & {
|
|
|
248
267
|
RejectedFileDeleteTrigger: typeof RejectedFileDeleteTrigger;
|
|
249
268
|
};
|
|
250
269
|
|
|
251
|
-
export { type FileAcceptDetails, type FileChangeDetails, type FileRejectDetails, FileUpload, type FileUploadFileError, type RejectedFile$1 as RejectedFile };
|
|
270
|
+
export { FILE_UPLOAD_ERRORS, type FileAcceptDetails, type FileChangeDetails, type FileRejectDetails, FileUpload, type FileUploadFileError, type RejectedFile$1 as RejectedFile };
|