Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file input component #722

Open
connor-baer opened this issue Nov 25, 2020 · 3 comments
Open

Add file input component #722

connor-baer opened this issue Nov 25, 2020 · 3 comments
Labels
⚛️ component Changes to a React component 🎨 design Requires input from designers feature A new feature or enhancement
Milestone

Comments

@connor-baer
Copy link
Member

connor-baer commented Nov 25, 2020

Visual

These are mockups and should not be used as the final design.

FileInput

Context

This component can be used when a user is asked to upload any type of file. Examples include a profile photo, documents for verification, or paper receipts.

State

The component has multiple states which are not mutually exclusive:

  1. Hovered
  2. Focused
  3. Active (when a user is dragging files over the dropzone)
  4. Uploading
  5. Single file vs multiple files: when multiple files can be uploaded, the component displays the selected files in a list.

Progressive enhancement

The component should be built on top of the native file input element (<input type="file" />). This ensures the greatest compatibility and best user experience on all devices.

Further reading: Using files from web applications (MDN)

@connor-baer connor-baer added the feature A new feature or enhancement label Nov 25, 2020
@connor-baer connor-baer changed the title Add FileInput component Add file input component Nov 25, 2020
@connor-baer connor-baer added the help wanted Looking for contributions label Dec 9, 2020
@connor-baer connor-baer added ⚛️ component Changes to a React component 🎨 design Requires input from designers and removed help wanted Looking for contributions labels Jan 29, 2021
@connor-baer connor-baer added this to the v3.0 milestone Jan 29, 2021
@connor-baer connor-baer modified the milestones: v3.0, v2.x Mar 7, 2021
@connor-baer connor-baer modified the milestones: v2.x, v3.x Jun 29, 2021
@connor-baer connor-baer removed this from the v3.x milestone Jan 7, 2022
@long-lazuli
Copy link
Contributor

long-lazuli commented Sep 26, 2022

Hi folks,
In POS Pro, we did exactly a component like this,
I'd like to check with you if it can be integrated into Circuit.

As this checklist seem to be fulfilled...

The component has multiple states which are not mutually exclusive:
1. Hovered
2. Focused
3. Active (when a user is dragging files over the dropzone)
4. Uploading
5. Single file vs multiple files: when multiple files can be uploaded, the component displays the selected files in a list.

What would be the pattern you want to use in this Component ?
I can see mostly two cases:

  1. the value sent by the form is the content of the file, as a classic Input[type=file];
  2. when a file is selected, an asynchronous transformation is done to obtain the values.

We do the number Two: onFileSelection / FileChange, we upload the file content to a server, and retrieve an Id (it could be an url, with S3); we use the response of this request as values for the component.

It should be usable as a controlled & uncontrolled input, I imagine.

Here are some screenshots. We will have to work on it soon, I'd rather do it in the right direction if you think it can be valuable for Circuit.

image

image

image

image

image

image

@github-actions github-actions bot added the stale label May 22, 2023
@connor-baer connor-baer added this to the v7.x milestone May 22, 2023
@connor-baer connor-baer removed the stale label May 22, 2023
@sumup-oss sumup-oss deleted a comment from github-actions bot May 22, 2023
@harshilparmar
Copy link

Hey @connor-baer Can I contribute to this. Or anything that can get me going for this repo. I really wants to contribute to design system.

@connor-baer
Copy link
Member Author

Thanks for the offer, @harshilparmar, I appreciate your enthusiasm! Unfortunately, we currently don't accept outside contributions:

Don't work at SumUp?

In an effort to give back to the community from which we learn so much, our documentation and code are public. However, the intended use case for Circuit UI is purely internal for our product, so please treat this as a read-only project and inspiration only.

@connor-baer connor-baer modified the milestones: v7.x, v8.x Feb 9, 2024
@connor-baer connor-baer modified the milestones: v8.x, v9.x Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚛️ component Changes to a React component 🎨 design Requires input from designers feature A new feature or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants