@groupeactual/ui-kit 1.7.0-beta.3 → 1.7.0-beta.4

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.
@@ -261,7 +261,7 @@ interface Props$a {
261
261
  children?: JSX.Element | null;
262
262
  titleAddButton?: string;
263
263
  _isDroppingFile?: boolean;
264
- validateFile?: (_size: number, _type: string) => boolean;
264
+ validateFile?: (_size: number, _type: string, _accept: string[], _setUploadFileError: React.Dispatch<React.SetStateAction<boolean | string>>) => boolean;
265
265
  removeExistingFile?: () => void;
266
266
  onTouched?: () => void;
267
267
  onFileDataChange?: (_fileData: {
@@ -301,13 +301,13 @@ interface Props$a {
301
301
  *
302
302
  * Example:
303
303
  * ```js
304
- * validateFile={(size, type) => {
304
+ * validateFile={(size, type, accept, setUploadFileError) => {
305
305
  * if (size > 10 * 1024 * 1024) {
306
- * setCustomFileError('Le fichier doit être inférieur à 10 Mo');
306
+ * setUploadFileError('Le fichier doit être inférieur à 10 Mo');
307
307
  * return true;
308
308
  * }
309
- * if (!['application/pdf', 'image/png', 'image/jpeg', 'image/jpg'].includes(type)) {
310
- * setCustomFileError('Le fichier doit être au format PDF, PNG, JPEG ou JPG');
309
+ * if (!accept.includes(type)) {
310
+ * setUploadFileError('Le fichier doit être au format PDF, PNG, JPEG ou JPG');
311
311
  * return true;
312
312
  * }
313
313
  * return false;