Skip to content

Commit 0bd3d73

Browse files
authored
Merge pull request #574 from dxc-technology/draft-3.7.0-upload
Merge draft-3.7.0-upload in component-upload branch
2 parents 180f347 + 06a14dc commit 0bd3d73

File tree

13 files changed

+137
-19
lines changed

13 files changed

+137
-19
lines changed
-909 KB
Binary file not shown.

guidelines/components/upload/README.md

Lines changed: 137 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,162 @@ The upload component is used to choose files from any location in the local mach
44

55
## Usage
66

7-
- Use the specific mode based on the application requirements
8-
- Add some explanation text in the case that it is needed to clarify the information to the user
9-
- By default, the drag and drop appearance is handled by the browser, in case it wants to be customized is the responsibility of the developer
10-
- If the upload process fails, please show an error message avoiding technical or undetermined information (i.e '0x94 ERROR_PATH_BUSY') that won't be understood by the user of the application
7+
### Do's
118

9+
* Provide a meaninful label and helper text in order to help the user understand the files expected
10+
* When displaying errors, provide feedback about the type of error using the error message
11+
* When the upload process fails, provide useful information instead of showing an error message using technical or undetermined information (i.e '0x94 ERROR_PATH_BUSY')
1212

13+
### Don'ts
14+
15+
* Use the upload component to upload multiple files inside a modal dialog
16+
* Use a variant with drag and drop functionality when designing for mobile devices
17+
18+
19+
## Variants
20+
21+
![Upload component variants](images/upload_variants.png)
22+
23+
_Upload component variants_
24+
25+
| Name | Use case |
26+
| :----------- | :----------------------------------------------------------------------------------- |
27+
| **File** | Use the file variant when designing for multidevice |
28+
| **Filedrop** | Use in large or complex forms when designing only for desktop |
29+
| **Dropzone** | Choose the dropzone when the main purpose of the content is to upload files/images |
1330

1431
## States
1532

16-
### Default
33+
The component upload is made-up of an input (type: file) and a file-item(s).
34+
35+
### File
36+
37+
The element has the following states: **Enabled**, **hover**, **focus**, **active** and **disabled**.
38+
39+
![File variant upload states](images/upload_file_states.png)
40+
41+
_File variant upload states_
42+
43+
### Filedrop
44+
45+
The element has the following states: **Enabled**, **hover**, **focus**, **active**, **dragover** and **disabled**.
46+
47+
![Filedrop variant upload states](images/upload_filedrop_states.png)
48+
49+
_Filedrop variant upload states_
50+
51+
### Dropzone
52+
53+
The element has the following states: **Enabled**, **hover**, **focus**, **active**, **dragover** and **disabled**.
54+
55+
![Dropzone variant upload states](images/upload_dropzone_states.png)
56+
57+
_Dropzone variant upload states_
58+
### File items
59+
60+
The element has the following states: **Enabled**, **hover/focus**, **active**, **loading** and **error**.
61+
62+
![File item states](images/upload_states_fileitem.png)
63+
64+
_File item states_
65+
66+
## Anatomy
67+
68+
![Component upload anatomy](images/upload_anatomy.png)
69+
70+
1. Label
71+
2. Drag and drop area
72+
3. Error message
73+
4. Error indicator
74+
5. Action - Remove file
75+
6. Helper text
76+
7. Upload button
77+
8. File preview
78+
9. File name
79+
10. Loading indicator
80+
11. File item container
81+
82+
## File item with preview
83+
84+
When the files to upload are mainly images, the preview can provide more feedback to the user rather than the name of the file, preventing errors loading content.
85+
86+
![File item with preview example](images/upload_fileitem_preview.png)
87+
88+
_File item with preview example_
89+
90+
## Loading content
91+
92+
When handling with large file sizes the file item should provide feedback to the user about the loading state. While the file is being loaded, the action to remove the file can not be performed.
93+
94+
![Loading content example](images/upload_loading.png)
95+
96+
_Loading content state_
1797

18-
![Upload with the default preview of the component](images/upload_default.png)
98+
## Design Specifications
1999

20-
_Upload with the default preview of the component_
100+
![Upload design specifications](images/upload_specs.png)
21101

22-
### Drag and drop
102+
_Upload design specifications_
23103

24-
![Upload with drag and drop action of a file](images/upload_dragover.png)
104+
### Color
25105

26-
_Upload with drag and drop action of a file_
106+
#### Base
27107

28-
### Hover state
108+
| Component token | Element | Core token | Value |
109+
| :---------------------------- | :-------------------------- | :-------------------------- | :------------ |
110+
| `dropBorderColor` | Drag and drop area | `color-black` | #000000 |
111+
| `fileItemBorderColor` | File item | `color-grey-300` | #cccccc |
112+
| `fileItemIconColor` | File item | `color-black` | #000000 |
113+
| `labelFontColor` | Label | `color-black` | #000000 |
114+
| `helperTextFontColor` | Helper text | `color-black` | #000000 |
115+
| `dropLabelFontColor` | Drop label | `color-black` | #000000 |
29116

30-
![Example of an item hovered](images/upload_preview.png)
31117

32-
_Example of an item hovered_
118+
#### Interactive
33119

34-
### Success and error
120+
| Component token | Element | Core token | Value |
121+
| :-------------------------------------- | :-------------------------- | :-------------------------- | :------------ |
122+
| `disabledLabelFontColor` | Label:disabled | `color-grey-500` | #999999 |
123+
| `disabledHelperTextFontColor` | Helper text:disabled | `color-grey-500` | #999999 |
124+
| `disabledDropLabelFontColor` | Drop label:disabled | `color-grey-500` | #999999 |
125+
| `focusDropBorderColor` | Dnd border:focus | `color-blue-600` | #0095ff |
126+
| `disabledDropBorderColor` | Dnd border:disabled | `color-grey-500` | #999999 |
127+
| `focusDropBackgroundColor` | Dnd fill:focus | `color-blue-50` | #f5fbff |
128+
| `hoverFileItemIconBackgroundColor` | File item icon:hover | `color-grey-100` | #f2f2f2 |
129+
| `activeFileItemIconBackgroundColor` | File item icon:active | `color-grey-300` | #cccccc |
130+
| `errorFileItemBorderColor` | File item:error | `color-red-700` | #d0011b |
131+
| `errorFileItemBackgroundColor` | File item:error | `color-red-200` | #ffccd3 |
132+
| `errorMessageFontColor` | File item:error | `color-red-700` | #d0011b |
35133

36-
Provide feedback to the users regarding the issues their files may face, or indicate that the files upload was succesfull. An alert type `success` or `error` should be placed on the top right corner of the upload container.
37134

38-
![Component success feedback](images/upload_success.png)
135+
### Typography
39136

40-
_Component success feedback_
137+
| Property | Element | Token | Value |
138+
| :-------------- | :------------- | :---------------------- | :-------------- |
139+
| `font-family` | Label | `font-family-sans` | Open Sans |
140+
| `font-size` | Label | `font-scale-02` | 0.875rem / 14px |
141+
| `font-weight` | Label | `font-bold` | 600 |
142+
| `line-height` | Label | `font-leading-loose-01` | 1.75em |
143+
| `font-family` | Helper text | `font-family-sans` | Open Sans |
144+
| `font-size` | Helper text | `font-scale-01` | 12px |
145+
| `font-weight` | Helper text | `font-regular` | 400 |
146+
| `line-height` | Helper text | `font-leading-normal` | 1.5em |
147+
| `font-family` | Drop label | `font-family-sans` | Open Sans |
148+
| `font-size` | Drop label | `font-scale-03` | 1rem / 16px |
149+
| `font-weight` | Drop label | `font-regular` | 400 |
150+
| `font-family` | Error message | `font-family-sans` | Open Sans |
151+
| `font-size` | Error message | `font-scale-01` | 0.75rem / 12px |
152+
| `font-weight` | Error message | `font-regular` | 400 |
153+
| `line-height` | Error message | `font-leading-normal` | 1.5em |
41154

42-
![Component error feedback](images/upload_error.png)
155+
### Border
43156

44-
_Component error feedback_
157+
| Property | Element | Token | Value |
158+
| :-------------- | :-------------------- | :---------------- | :-------------- |
159+
| `border` | Drag and drop area | `-` | dashed 2px |
160+
| `border-radius` | Drag and drop area | `-` | 4px |
161+
| `border` | File item | `-` | solid 1px |
162+
| `border-radius` | File item | `-` | 4px |
45163

46164

47165
## Links and references
32.5 KB
Loading
67 KB
Loading
29.8 KB
Loading
51.7 KB
Loading
15.7 KB
Loading
20 KB
Loading
-40.8 KB
Binary file not shown.
43.7 KB
Loading

0 commit comments

Comments
 (0)