-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: file download documentation (#539)
* add markdown * Add example + properties * add line breaks * temp fix id error * update download link to njk component, update params * update default download link text * update properties + example * add njk example props + markup * remove br Co-authored-by: Houston <[email protected]> Co-authored-by: Dayle Salmon <[email protected]>
- Loading branch information
1 parent
eae5a64
commit 0b449db
Showing
6 changed files
with
157 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% raw %} | ||
{% from "wmnds/components/file-download/_file-download.njk" import wmndsFileDownload %} | ||
{{ | ||
wmndsFileDownload({ | ||
fileName: "example file", | ||
fileType: "pdf", | ||
fileSize: "1MB", | ||
downloadLinkText: "Download file", | ||
accessible: true | ||
}) | ||
}} | ||
{% endraw %} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"wmndsFileDownloadProps": [ | ||
{ | ||
"name": "fileName", | ||
"type": "string", | ||
"description": "<strong>Required.</strong> The file name of the download." | ||
}, | ||
{ | ||
"name": "fileType", | ||
"type": "string", | ||
"description": "<strong>Required.</strong> The file type of the download e.g. doc, pdf." | ||
}, | ||
{ | ||
"name": "fileSize", | ||
"type": "string", | ||
"description": "The size of the file" | ||
}, | ||
{ | ||
"name": "downloadLinkText", | ||
"type": "string", | ||
"description": "Custom text to be displayed in the download link." | ||
}, | ||
{ | ||
"name": "accessible", | ||
"type": "boolean", | ||
"description": "Determines whether to display the file as an accessible or non-accessible file component. Defaults to <code class='wmnds-website-inline-code'>true</code>." | ||
} | ||
] | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{% extends "www/_layouts/layout-left-pane.njk" %} | ||
{% set pageTitle = "File download" %} | ||
{% from "www/_partials/component-example/component-example.njk" import compExample %} | ||
{# Macros #} | ||
{% from "wmnds/components/file-download/_file-download.njk" import wmndsFileDownload %} | ||
|
||
{% block content %} | ||
|
||
{% markdown %} | ||
{# About #} | ||
|
||
## About | ||
|
||
{# What #} | ||
|
||
### What does it do? | ||
|
||
- Allows users to download an offline version of the on-page content. | ||
- Allows users who rely on assistive technology to access an offline version of the on-page content. | ||
- Shows users how big the file is so they can decide if they want to download it. | ||
|
||
--- | ||
|
||
{# Accessible file #} | ||
|
||
## Accessible file | ||
|
||
{# When to #} | ||
|
||
### When to use it? | ||
|
||
- When you have an accessible, offline version of the on-page content. | ||
- When you have additional information within an accessible document. | ||
|
||
{# When not to #} | ||
|
||
### When not to use it? | ||
|
||
- If the download document is not accessible to users with assistive technology. In that instance, use the non-accessible file component. | ||
|
||
{% endmarkdown %} | ||
|
||
{{ | ||
compExample([ | ||
wmndsFileDownload({ | ||
fileName: "example file", | ||
fileType: "pdf", | ||
fileSize: "3MB" | ||
}) | ||
], { | ||
componentPath: "wmnds/components/file-download/", | ||
njk: true, | ||
njkProps: wmndsFileDownloadProps, | ||
js: false, | ||
iframe: false | ||
}) | ||
}} | ||
|
||
{% markdown %} | ||
{# Non-accessible file #} | ||
|
||
## Non-accessible file | ||
|
||
{# What #} | ||
|
||
### What does it do? <a name="non-accessible-what-does-it-do"></a> | ||
|
||
- Shows the user that the file is not accessible | ||
- Offers the user a way to get the file in a different format | ||
|
||
{# When to #} | ||
|
||
### When to use it? <a name="non-accessible-when-to-use-it"></a> | ||
|
||
- When you have an offline version of the on-page content which is not accessible | ||
- When the file cannot be made accessible. For example, complex maps. | ||
|
||
{# When not to #} | ||
|
||
### When not to use it? <a name="non-accessible-when-not-to-use-it"></a> | ||
|
||
- If the document is accessible to users with assistive technology. In that instance, use the accessible file component. | ||
- You still need to make the document accessible as soon as possible. Ideally before publishing it. | ||
|
||
{% endmarkdown %} | ||
|
||
{{ | ||
compExample([ | ||
wmndsFileDownload({ | ||
accessible: false | ||
}) | ||
], { | ||
componentPath: "wmnds/components/file-download/", | ||
njk: true, | ||
njkProps: wmndsFileDownloadProps, | ||
js: false, | ||
iframe: false | ||
}) | ||
}} | ||
|
||
{% endblock %} |