From aca9c2385bfecab5db03e0128577bb320f35a7a7 Mon Sep 17 00:00:00 2001 From: SriHV Date: Thu, 28 Nov 2024 15:04:36 +0000 Subject: [PATCH 1/3] added a new example --- .../example-document-list-new-variant.njk | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/components/document-list/example-document-list-new-variant.njk diff --git a/src/components/document-list/example-document-list-new-variant.njk b/src/components/document-list/example-document-list-new-variant.njk new file mode 100644 index 0000000000..b58d0dcddb --- /dev/null +++ b/src/components/document-list/example-document-list-new-variant.njk @@ -0,0 +1,31 @@ +--- +'fullWidth': true +--- + +{% from "components/document-list/_macro.njk" import onsDocumentList %} + +{{ + onsDocumentList({ + "documents": [ + { + "featured": true, + "fullWidth": true, + "title": { + "text": 'Landmarks are lighting up purple to mark Census Day', + "url": '#0' + }, + "metadata": { + "object": { + "text": 'Press releases', + "url": '#0' + }, + "date": { + "iso": '2022-01-01', + "short": '1 January 2022' + } + }, + "description": 'Hundreds of buildings & landmarks across England and Wales are lighting up purple this weekend to celebrate the census and its importance to communities.' + } + ] + }) +}} From 8df78ab1ac48a1a2c62a22a8610b225e01fc04b1 Mon Sep 17 00:00:00 2001 From: SriHV Date: Fri, 29 Nov 2024 15:14:48 +0000 Subject: [PATCH 2/3] documented showMetadataFirst in document-list --- .../document-list/_macro-options.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/document-list/_macro-options.md b/src/components/document-list/_macro-options.md index e6a6857cc8..780525a727 100644 --- a/src/components/document-list/_macro-options.md +++ b/src/components/document-list/_macro-options.md @@ -8,17 +8,18 @@ ## 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 | `Object` | true | An object containing text and url of the [title](#title) | -| 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](#thumbnail). Renders a placeholder instead if set to `true` | -| metadata | `Object<Metadata>` | false | An object for a [list of information about document](#metadata), 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. Can only be set when featured is set to true. | -| wide | boolean | false | Set to `true` to increase the maximum width of the layout container to 1280px. | +| 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 | `Object<Title>` | true | An object containing text and url of the [title](#title) | +| 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](#thumbnail). Renders a placeholder instead if set to `true` | +| metadata | `Object<Metadata>` | false | An object for a [list of information about document](#metadata), 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. Can only be set when featured is set to true. | +| wide | boolean | false | Set to `true` to increase the maximum width of the layout container to 1280px. | +| showMetadataFirst | boolean | false | If set to `true`, metadata is displayed above the header. | ### Thumbnail From bb695199435c0028f47f3658ea5a919cb42580d4 Mon Sep 17 00:00:00 2001 From: SriHV <sri.harsha.v.parupudi@ons.gov.uk> Date: Fri, 29 Nov 2024 15:31:01 +0000 Subject: [PATCH 3/3] Deleted new variant --- .../example-document-list-new-variant.njk | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/components/document-list/example-document-list-new-variant.njk diff --git a/src/components/document-list/example-document-list-new-variant.njk b/src/components/document-list/example-document-list-new-variant.njk deleted file mode 100644 index b58d0dcddb..0000000000 --- a/src/components/document-list/example-document-list-new-variant.njk +++ /dev/null @@ -1,31 +0,0 @@ ---- -'fullWidth': true ---- - -{% from "components/document-list/_macro.njk" import onsDocumentList %} - -{{ - onsDocumentList({ - "documents": [ - { - "featured": true, - "fullWidth": true, - "title": { - "text": 'Landmarks are lighting up purple to mark Census Day', - "url": '#0' - }, - "metadata": { - "object": { - "text": 'Press releases', - "url": '#0' - }, - "date": { - "iso": '2022-01-01', - "short": '1 January 2022' - } - }, - "description": 'Hundreds of buildings & landmarks across England and Wales are lighting up purple this weekend to celebrate the census and its importance to communities.' - } - ] - }) -}}