-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(file-uploader): match experimental spec (#1772)
* fix(file-uploader): match experimental spec * docs(file-uploader): add example upload states * refactor(file-uploader): use caption style token * refactor(file-uploader): update filename background color token * fix(file-uploader): replace improper reference with mixin properties * fix(file-uploader): increase right padding of file upload button * fix(file-uploader): increase min-height of file labels * style(file-uploader): increase svg icon size * fix(file-uploader): use new type token for filenames * fix(file-uploader): increase file container top margin * fix(file-uploader): use state containers and fix icon sizes
- Loading branch information
Showing
3 changed files
with
108 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,69 @@ | ||
<!-- | ||
<!-- | ||
Copyright IBM Corp. 2016, 2018 | ||
This source code is licensed under the Apache-2.0 license found in the | ||
LICENSE file in the root directory of this source tree. | ||
--> | ||
|
||
<div class="{{@root.prefix}}--form-item"> | ||
<strong class="{{#if componentsX}}{{@root.prefix}}--file--label{{else}}{{@root.prefix}}--label{{/if}}">Account photo</strong> | ||
<strong class="{{#if componentsX}}{{@root.prefix}}--file--label{{else}}{{@root.prefix}}--label{{/if}}">Account | ||
photo</strong> | ||
<p class="{{@root.prefix}}--label-description">only .jpg and .png files. 500kb max file size.</p> | ||
<div class="{{@root.prefix}}--file" data-file> | ||
<label | ||
for="your-file-importer-id-here" | ||
<label for="your-file-importer-id-here" | ||
class="{{@root.prefix}}--file-btn {{@root.prefix}}--btn {{@root.prefix}}--btn--primary {{@root.prefix}}--btn--sm" | ||
role="button" | ||
tabindex="0">Add file</label> | ||
<input | ||
type="file" | ||
class="{{@root.prefix}}--file-input" | ||
id="your-file-importer-id-here" | ||
data-file-uploader | ||
data-target="[data-file-container]" | ||
multiple | ||
/> | ||
<div data-file-container class="{{@root.prefix}}--file-container"></div> | ||
role="button" tabindex="0">Add file</label> | ||
<input type="file" class="{{@root.prefix}}--file-input" id="your-file-importer-id-here" data-file-uploader | ||
data-target="[data-file-container]" multiple /> | ||
<di data-file-container class="{{@root.prefix}}--file-container"> | ||
{{#if exampleUploadStates}} | ||
<div class="{{@root.prefix}}--file__selected-file"> | ||
<p class="{{@root.prefix}}--file-filename">Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero vero | ||
sapiente illum reprehenderit molestiae perferendis voluptatem temporibus laudantium ducimus magni voluptatum | ||
veniam, odit nesciunt corporis numquam maxime sunt excepturi sint!</p> | ||
<span data-for="your-file-importer-id-here" class="{{@root.prefix}}--file__state-container"> | ||
{{#if componentsX}} | ||
{{ carbon-icon 'CheckmarkFilled16' class=(add @root.prefix '--file-complete') }} | ||
{{/if}} | ||
</span> | ||
</div> | ||
<div class="{{@root.prefix}}--file__selected-file--invalid__wrapper"> | ||
<div class="{{@root.prefix}}--file__selected-file {{@root.prefix}}--file__selected-file--invalid" data-invalid> | ||
<p class="{{@root.prefix}}--file-filename">color.jpeg</p> | ||
<span data-for="your-file-importer-id-here" class="{{@root.prefix}}--file__state-container"> | ||
{{#if componentsX}} | ||
{{ carbon-icon 'WarningFilled16' class=(add @root.prefix '--file--invalid')}} | ||
{{ carbon-icon 'Close16' class=(add @root.prefix '--file--close') }} | ||
{{/if}} | ||
</span> | ||
</div> | ||
{{#if componentsX}} | ||
<div class="{{@root.prefix}}--form-requirement"> | ||
File size exceeds limit | ||
</div> | ||
{{/if}} | ||
</div> | ||
<div class="{{@root.prefix}}--file__selected-file"> | ||
<p class="{{@root.prefix}}--file-filename">color.jpeg</p> | ||
<span data-for="your-file-importer-id-here" class="{{@root.prefix}}--file__state-container"> | ||
{{#if componentsX}} | ||
<div class="{{@root.prefix}}--inline-loading__animation"> | ||
<div data-inline-loading-spinner="" class="{{@root.prefix}}--loading {{@root.prefix}}--loading--small"> | ||
<svg class="{{@root.prefix}}--loading__svg" viewBox="-75 -75 150 150"> | ||
<circle class="{{@root.prefix}}--loading__background" cx="0" cy="0" r="37.5"></circle> | ||
<circle class="{{@root.prefix}}--loading__stroke" cx="0" cy="0" r="37.5"></circle> | ||
</svg> | ||
</div> | ||
<svg data-inline-loading-finished="" hidden="" | ||
class="{{@root.prefix}}--inline-loading__checkmark-container {{@root.prefix}}--inline-loading__svg" | ||
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"> | ||
<polyline class="{{@root.prefix}}--inline-loading__checkmark" points="0.74 3.4 3.67 6.34 9.24 0.74"> | ||
</polyline> | ||
</svg> | ||
</div> | ||
{{/if}} | ||
</span> | ||
</div> | ||
{{/if}} | ||
</div> | ||
</div> |