From e583b01c31477c026b215c187eab44f271a2aa12 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Tue, 10 Dec 2024 18:40:29 +0000 Subject: [PATCH] Update TNA Frontend --- layouts/_design-system-base.njk | 3 +++ lib/index.js | 4 +-- package-lock.json | 8 +++--- package.json | 2 +- src/components/gallery/index.md | 2 +- src/components/records-list/default/index.njk | 27 ------------------- src/components/records-list/index.md | 13 --------- src/cookies/index.md | 26 ++++++++++++++++++ src/styles/typography/index.md | 4 +++ .../paragraphs-large-bold/index.njk | 7 +++++ 10 files changed, 47 insertions(+), 49 deletions(-) delete mode 100644 src/components/records-list/default/index.njk delete mode 100644 src/components/records-list/index.md create mode 100644 src/styles/typography/paragraphs-large-bold/index.njk diff --git a/layouts/_design-system-base.njk b/layouts/_design-system-base.njk index da18791..35be39c 100644 --- a/layouts/_design-system-base.njk +++ b/layouts/_design-system-base.njk @@ -21,6 +21,9 @@ {%- set siteTitle = "The National Archives Design System" -%} {%- set pageTitle = title -%} +{%- set htmlAttributes = { + "data-tnacookiespath": "/design-system/" +} -%} {% block head %} diff --git a/lib/index.js b/lib/index.js index 007665e..aa8c41d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,9 +2,7 @@ import Prism from "prismjs"; window.TNAFrontend.initAll(); -const cookies = new window.TNAFrontend.Cookies({ - path: "/design-system/", -}); +const cookies = new window.TNAFrontend.Cookies(); const setTheme = (theme) => { if (theme === "light") { diff --git a/package-lock.json b/package-lock.json index 93c0c9e..2643b68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "license": "MIT", "dependencies": { - "@nationalarchives/frontend": "^0.3.0", + "@nationalarchives/frontend": "^0.4.0", "prismjs": "^1.29.0" }, "devDependencies": { @@ -2413,9 +2413,9 @@ } }, "node_modules/@nationalarchives/frontend": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@nationalarchives/frontend/-/frontend-0.3.0.tgz", - "integrity": "sha512-9NcS/GccZD1AzjxzrRfWwkqgE29V8fh7FHaZOhol2OGUuus/bRjG0ExjfaEZoJjkiEdZiteGw6os0RtdpLJOag==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nationalarchives/frontend/-/frontend-0.4.0.tgz", + "integrity": "sha512-syh2liSHZyCbPHr7qntFvra/Otxjo4RNDXlVtdX/AYm4wmKYsSdXPjskWqG0Qk3JWcOOAxG2uM/P5FTAsJu8Nw==", "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { diff --git a/package.json b/package.json index 2f5672b..6d849bf 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "ext": "js css scss njk json html md" }, "dependencies": { - "@nationalarchives/frontend": "^0.3.0", + "@nationalarchives/frontend": "^0.4.0", "prismjs": "^1.29.0" }, "devDependencies": { diff --git a/src/components/gallery/index.md b/src/components/gallery/index.md index bec49ff..0fc88de 100644 --- a/src/components/gallery/index.md +++ b/src/components/gallery/index.md @@ -8,6 +8,6 @@ group: components {% from "partials/example.njk" import example %} {% from "partials/component-status.njk" import status %} -{{ example({ group: "components", item: "gallery", example: "default", html: true, nunjucks: true, size: "xxxl", noPadding: true }, 2) }} +{{ example({ group: "components", item: "gallery", example: "default", html: true, nunjucks: true, size: "xxxl" }, 2) }} {{ status(false, 1, 1, 2, 2, false) }} diff --git a/src/components/records-list/default/index.njk b/src/components/records-list/default/index.njk deleted file mode 100644 index 1f79126..0000000 --- a/src/components/records-list/default/index.njk +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Records list -layout: examples/plain.njk -private: true ---- - -{% from "nationalarchives/components/records-list/macro.njk" import tnaRecordsList %} - -{{ tnaRecordsList({ - items: [ - { - imageSrc: "https://picsum.photos/id/237/400/600", - imageWidth: 400, - imageHeight: 600, - collection: "TS 11/45/167", - title: "Court records relating to Robert Wedderburn’s trial", - href: "#", - date: "1819–1820" - }, - { - collection: "HO 42/191", - title: "Home office letters", - href: "#", - date: "1819" - } - ] -}) }} diff --git a/src/components/records-list/index.md b/src/components/records-list/index.md deleted file mode 100644 index 9f21adf..0000000 --- a/src/components/records-list/index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -layout: collection-page.njk -title: Records list -description: The records list component can be used to show a list of related or interesting records. -group: components ---- - -{% from "partials/example.njk" import example %} -{% from "partials/component-status.njk" import status %} - -{{ example({ group: "components", item: "records-list", example: "default", html: true, nunjucks: true, size: "l" }, 2) }} - -{{ status(false, 0, 1, 2, 2, false) }} diff --git a/src/cookies/index.md b/src/cookies/index.md index cce209c..0a9f474 100644 --- a/src/cookies/index.md +++ b/src/cookies/index.md @@ -85,3 +85,29 @@ This site currently collects no usage data. } }) }} + +## Cookies that are used for marketing purposes + +These cookies may be set by third party websites and track things that can be used for marketing and advertising purposes. + +This site currently collects no data for marketing purposes. + +

+ +
+ {{ tnaButton({ + text: "Allow marketing cookies", + buttonElement: true, + attributes: { + "data-setcookiepreference": "marketing", + "data-setcookiepreferencevalue": "true" + } + }) }} {{ tnaButton({ + text: "Decline marketing cookies", + buttonElement: true, + attributes: { + "data-setcookiepreference": "marketing", + "data-setcookiepreferencevalue": "false" + } + }) }} +
diff --git a/src/styles/typography/index.md b/src/styles/typography/index.md index 750a5a5..bc8c212 100644 --- a/src/styles/typography/index.md +++ b/src/styles/typography/index.md @@ -61,6 +61,10 @@ You can use a larger paragraph as an introduction to the page or section. {{ example({ group: "styles", item: "typography", example: "paragraphs-large", html: true, nunjucks: false, size: "xs", openHTML: true }) }} +There is also a slightly bolder version of the large paragraph. + +{{ example({ group: "styles", item: "typography", example: "paragraphs-large-bold", html: true, nunjucks: false, size: "xs", openHTML: true }) }} + ### Small You can use the `` element sparingly to make your paragraph font size smaller. diff --git a/src/styles/typography/paragraphs-large-bold/index.njk b/src/styles/typography/paragraphs-large-bold/index.njk new file mode 100644 index 0000000..1559099 --- /dev/null +++ b/src/styles/typography/paragraphs-large-bold/index.njk @@ -0,0 +1,7 @@ +--- +title: Paragraphs large bold +layout: examples/plain.njk +private: true +--- + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis.