diff --git a/apps/website/screens/components/file-input/code/FileInputCodePage.tsx b/apps/website/screens/components/file-input/code/FileInputCodePage.tsx
index 0be192ba0..28669e890 100644
--- a/apps/website/screens/components/file-input/code/FileInputCodePage.tsx
+++ b/apps/website/screens/components/file-input/code/FileInputCodePage.tsx
@@ -24,31 +24,54 @@ const sections = [
- mode |
+ accept |
- 'file' | 'filedrop' | 'dropzone'
+ string
|
- Available modes of the component. |
- 'file'
+ The file types that the component accepts. Its value must be one of all the possible values of the HTML
+ file input's accept attribute. Please check the documentation{" "}
+ here.
|
+ - |
- label |
+ buttonLabel |
string
|
- Text to be placed above the component. |
+ Text to be placed inside the button. |
- |
- buttonLabel |
- string
+
+
+ callbackFile
+
+ |
+
+
+ {"(val: {files: { file: File, error?: string, preview?: string }[], error?: string}) => void"}
+
+ |
+
+ This function will be called when the user adds or deletes a file. That is, when the file input's inner
+ value is modified. The list of files will be sent as a parameter. In this function, the files can be
+ updated or returned as they come. These files must be passed to the value in order to be shown.
|
- Text to be placed inside the button. |
- |
+
+ disabled |
+
+ boolean
+ |
+ If true, the component will be disabled. |
+
+ false
+ |
+
dropAreaLabel |
@@ -66,25 +89,21 @@ const sections = [
| - |
- accept |
+ label |
string
|
-
- The file types that the component accepts. Its value must be one of all the possible values of the HTML
- file input's accept attribute. Please check the documentation{" "}
- here.
- |
+ Text to be placed above the component. |
- |
- minSize |
+ margin |
- number
+ 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin
|
- The minimum file size (in bytes) allowed. If the size of the file does not comply this value, the file
- will have an error.
+ Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and
+ 'right' properties in order to specify different margin sizes.
|
- |
@@ -100,43 +119,24 @@ const sections = [
- |
+ minSize |
-
-
- value
-
- |
-
- {"{ file: File, error?: string, preview?: string }[]"}
+ number
|
- An array of files representing the selected files. Each file has the following properties:
-
- -
- file: Selected file.
-
- -
- error: Error of the file. If it is defined, it will be shown and the file item will be mark as
- invalid.
-
- -
- preview: Preview of the file.
-
-
+ The minimum file size (in bytes) allowed. If the size of the file does not comply this value, the file
+ will have an error.
|
- |
- showPreview |
-
- boolean
- |
+ mode |
- If true, if the file is an image, a preview of it will be shown. If not, an icon referring to the file
- type will be shown.
+ 'file' | 'filedrop' | 'dropzone'
|
+ Available modes of the component. |
- false
+ 'file'
|
@@ -154,42 +154,40 @@ const sections = [
- disabled |
+
+
+
+ optional
+
+ |
boolean
|
- If true, the component will be disabled. |
+ If true, the input will be optional, showing '(Optional)' next to the label. |
false
|
+ ref |
-
-
- callbackFile
-
- |
-
- {"(files: { file: File, error?: string, preview?: string }[]) => void"}
- |
-
- This function will be called when the user adds or deletes a file. That is, when the file input's inner
- value is modified. The list of files will be sent as a parameter. In this function, the files can be
- updated or returned as they come. These files must be passed to the value in order to be shown.
+ {"React.Ref"}
|
+ Reference to the component. |
- |
- margin |
+ showPreview |
- 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | Margin
+ boolean
|
- Size of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and
- 'right' properties in order to specify different margin sizes.
+ If true, if the file is an image, a preview of it will be shown. If not, an icon referring to the file
+ type will be shown.
+ |
+
+ false
|
- - |
tabIndex |
@@ -204,11 +202,30 @@ const sections = [
- ref |
- {"React.Ref"}
+
+
+ value
+
+ |
+
+ {"{ file: File, error?: string, preview?: string }[]"}
+ |
+
+ An array of files representing the selected files. Each file has the following properties:
+
+ -
+ file: Selected file.
+
+ -
+ error: Error of the file. If it is defined, it will be shown and the file item will be mark as
+ invalid.
+
+ -
+ preview: Preview of the file.
+
+
|
- Reference to the component. |
- |
diff --git a/packages/lib/src/file-input/FileInput.stories.tsx b/packages/lib/src/file-input/FileInput.stories.tsx
index 14b7c254a..05d1cd72d 100644
--- a/packages/lib/src/file-input/FileInput.stories.tsx
+++ b/packages/lib/src/file-input/FileInput.stories.tsx
@@ -2,7 +2,6 @@ import { Meta, StoryObj } from "@storybook/react";
import ExampleContainer from "../../.storybook/components/ExampleContainer";
import Title from "../../.storybook/components/Title";
import DxcFileInput from "./FileInput";
-import { userEvent, within } from "@storybook/test";
export default {
title: "File Input",
@@ -81,6 +80,10 @@ const FileInput = () => (