Skip to content

Commit

Permalink
'Document list' component to replace downloads and articles, and use …
Browse files Browse the repository at this point in the history
…for search results (#2011)

* added document component first draft

* refector

* added date

* added more metadata options

* corrected page template heading levels

* added examples of differenet document types

* added featured docs

* fixed issues with examples

* used new document component in news pattern

* documentation

* more documentation

* fixed bug #1664

* replaced download resources with new document component

* removed old components replaced by document

* removed unnecessary change

* removed unused document examples

* revert unrelated changes

* removed scss imports for removed components

* removed old placeholder thumbnail pngs

* removed unused imports from guide example

* revert removed onsList from guide rtl example

* macro options docs

* refactored download resources pattern to use document list

* fix for border and margin showing when preceded by hidden item

* revert test

* updated downloadable resources examples [test-visual]

* remove bottom border from inline featured doc

* changed name of component and fixed featured image size

* updated example folder names

* adjusted metadata line height

* pr suggestion

* Update src/components/document-list/_macro.njk

Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com>

* Update src/components/document-list/_macro.njk

Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com>

Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com>
  • Loading branch information
jrbarnes9 and rmccar authored Mar 21, 2022
1 parent 62263a6 commit dcd0d92
Show file tree
Hide file tree
Showing 47 changed files with 1,704 additions and 1,372 deletions.
86 changes: 0 additions & 86 deletions src/components/articles/_articles.scss

This file was deleted.

32 changes: 0 additions & 32 deletions src/components/articles/_macro-options.md

This file was deleted.

81 changes: 0 additions & 81 deletions src/components/articles/_macro.njk

This file was deleted.

22 changes: 0 additions & 22 deletions src/components/articles/examples/articles-featured/index.njk

This file was deleted.

31 changes: 0 additions & 31 deletions src/components/articles/examples/articles-multiple/index.njk

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/articles/examples/articles-single/index.njk

This file was deleted.

51 changes: 0 additions & 51 deletions src/components/articles/index.njk

This file was deleted.

61 changes: 61 additions & 0 deletions src/components/document-list/_macro-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
| Name | Type | Required | Description |
| ---------- | ----------------- | -------- | ---------------------------------------------------------------------------------- |
| id | string | false | ID for the document list element |
| classes | string | false | Classes for the document list element |
| attributes | object | false | HTML attributes (for example, data attributes) to add to the document list element |
| documents | `Array<Document>` | true | An array of document list items to render in the documents list |

## Document

| Name | Type | Required | Description |
| ----------- | ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| classes | string | false | Custom classes to add to each document list item |
| attributes | object | false | HTML attributes (for example, data attributes) to add to each document list item |
| title | string | true | The title for the document |
| url | string | true | The URL for the document link (either a file or web page) |
| description | string | false | A short HTML extract of text (for example, a short sentence to give some context of the document) |
| thumbnail | `Object<Thumbnail>` | false | An object containing path and filename attributes for the thumbnail image. Renders a placeholder instead if set to `true` |
| metadata | `<Object>Metadata` | false | An object for a list of information about document, for example, date, type and size |
| featured | boolean | false | Will render a featured variant of the document if set to `true` |
| fullWidth | boolean | false | If set to `true`, wraps the `featured` document in a `div` with class `ons-container` for a “full-bleed” layout |
| wide | boolean | false | If set to `true`, adds class `ons-container--wide` to the `div` set with `fullWidth` |

### Thumbnail

| Name | Type | Required | Description |
| -------- | ------ | -------- | ------------------------------------------- |
| smallSrc | string | true | Path to the non-retina version of the image |
| largeSrc | string | true | Path to the retina version of the image |

### Metadata

| Name | Type | Required | Description |
| ---- | -------------- | -------- | ----------------------------------------------------------------------------------------------------- |
| type | `<Object>Type` | false | An object for a list item describing the type of document, for example, “Dataset” or “Press release” |
| date | `<Object>Date` | false | An object for the date the document was published or updated |
| file | `<Object>File` | false | An object to describe the details of the downloadable document file: format, size and number of pages |

#### Type

| Name | Type | Required | Description |
| ---- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| text | string | true | Label for the type of document, for example “User requested data”. |
| url | string | false | URL `href` for the type. Can be used to filter a list of documents by category. |
| ref | string | false | Text for a sub-type or reference. Can be used to give extra detail about the type, for example, “User requested data: Ref 008052”. |

#### Date

| Name | Type | Required | Description |
| ---------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| iso | string | true | ISO format meachine-readable date, for example, `2020-05-20` |
| short | string | true | Displayed short format of the date, for example, “20 May 2020” |
| prefix | string | false | Label to prefix the date for context, for example, “Last updated” (Defaults to “Published”). Is automatically suffixed with a colon. |
| showPrefix | boolean | false | Displays the `prefix` when set to `true`. Otherwise it will be hidden. Use when context is required. |

#### File

| Name | Type | Required | Description |
| --------- | ------ | -------- | ---------------------------------------------------------------- |
| fileType | string | true | Format of the file, for example, PDF, DOC, XLS |
| fileSize | string | true | Size of the file in megabytes or kilobytes, for example, “850KB” |
| filePages | string | false | Number of pages in the file, for example, “16 pages” |
Loading

0 comments on commit dcd0d92

Please sign in to comment.