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 Files Component #1879

Closed
aswinshenoy opened this issue Apr 1, 2019 · 3 comments · Fixed by #1929
Closed

Add Files Component #1879

aswinshenoy opened this issue Apr 1, 2019 · 3 comments · Fixed by #1929
Labels

Comments

@aswinshenoy
Copy link
Contributor

Implement the Files component according to spec: https://www.lightningdesignsystem.com/components/files/

I am currently working on the same and will post an initial prop proposal soon.

@aswinshenoy
Copy link
Contributor Author

aswinshenoy commented Apr 1, 2019

Here is my initial prop proposal for the component, what do you think?

File

Name Type Description
ClassName array/object/string Additional Class Names
placeholder string URL to placeholder image.
title string Title for the file
description string Description for the link attachment
externalIcon string URL to external icon
type string File format, as in SLDS Doctype Icons, to be shown
onClick string/node Action/URL to be opened on click
downloadURL string URL to download file.
isLoading boolean Whether the file is loading. Defaults false.

Here are some basic examples using these specs -

<div>
<File
    title="Image Title"
    type="image"
    onClick="{...}"
>
<File
    placeholder="..."
    onClick="{...}"
>
<File
    title="Proposal.pdf"
    type="pdf"
    placeholder="..."
    onClick="{...}"
    downloadURL="..."
>
<File
    placeholder="..."
    onClick="{...}"
    downloadURL="..."
>
<File
    title="Proposal.pdf"
    type="pdf"
    onClick="{...}"
   externalIcon="..."
>
<File
    placeholder="..."
    title="Image Title"
    type="image"
    onClick="{...}"
    isLoading
>
<File
    title="Maui By Air The Best Way Around The Island"
    description="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt"
    onClick="{...}"
>
</div>

Currently doesn't have support for handling multiple files in groups.

@interactivellama
Copy link
Contributor

I still need to look at this closer, but my initial thoughts are:

  • externalIcon and type should probably take an Icon component. Path should be dealt with there. icon={<Icon name="audio" />} should work I think.
  • Looking at the spec. it looks like you need a Dropdown menu passed in. Maybe actionsDropdown?
  • onClick should be a function callback

@interactivellama
Copy link
Contributor

I will try to get also you additional feedback on Files tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants