From 2be0f8c5b4649587fc1d6e2d4054d471447b8b7f Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Tue, 10 Dec 2024 18:04:15 +0000 Subject: [PATCH] Remove the records list component --- .github/actions/prototype-kit-test/action.yml | 2 - CHANGELOG.md | 3 + .../components/_presentation.scss | 1 - .../components/records-list/_index.scss | 1 - .../components/records-list/fixtures.json | 42 --------- .../records-list/macro-options.json | 70 -------------- .../components/records-list/macro.njk | 3 - .../components/records-list/records-list.scss | 92 ------------------- .../records-list/records-list.stories.js | 50 ---------- .../components/records-list/template.njk | 21 ----- .../utilities/colour/colour-themes.stories.js | 26 ------ tasks/test-package.js | 1 - 12 files changed, 3 insertions(+), 309 deletions(-) delete mode 100644 src/nationalarchives/components/records-list/_index.scss delete mode 100644 src/nationalarchives/components/records-list/fixtures.json delete mode 100644 src/nationalarchives/components/records-list/macro-options.json delete mode 100644 src/nationalarchives/components/records-list/macro.njk delete mode 100644 src/nationalarchives/components/records-list/records-list.scss delete mode 100644 src/nationalarchives/components/records-list/records-list.stories.js delete mode 100644 src/nationalarchives/components/records-list/template.njk diff --git a/.github/actions/prototype-kit-test/action.yml b/.github/actions/prototype-kit-test/action.yml index 634c1812..dc35d5f8 100644 --- a/.github/actions/prototype-kit-test/action.yml +++ b/.github/actions/prototype-kit-test/action.yml @@ -58,7 +58,6 @@ runs: echo -e "{% from \"nationalarchives/components/picture/macro.njk\" import tnaPicture %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/quick-filters/macro.njk\" import tnaQuickFilters %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/radios/macro.njk\" import tnaRadios %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && - echo -e "{% from \"nationalarchives/components/records-list/macro.njk\" import tnaRecordsList %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/search-field/macro.njk\" import tnaSearchField %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/select/macro.njk\" import tnaSelect %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/sidebar/macro.njk\" import tnaSidebar %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && @@ -96,7 +95,6 @@ runs: echo "{{ tnaPicture({}) }}" >> prototype/app/views/index.html && echo "{{ tnaQuickFilters({}) }}" >> prototype/app/views/index.html && echo "{{ tnaRadios({}) }}" >> prototype/app/views/index.html && - echo "{{ tnaRecordsList({}) }}" >> prototype/app/views/index.html && echo "{{ tnaSearchField({}) }}" >> prototype/app/views/index.html && echo "{{ tnaSelect({}) }}" >> prototype/app/views/index.html && echo "{{ tnaSidebar({}) }}" >> prototype/app/views/index.html && diff --git a/CHANGELOG.md b/CHANGELOG.md index f5876150..5b84fe82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a `tna-large-paragraph--bold` to change the weight and colour `tna-large-paragraph` ### Deprecated + +- Removed the records list component + ### Removed ### Fixed diff --git a/src/nationalarchives/components/_presentation.scss b/src/nationalarchives/components/_presentation.scss index 886ed1a2..b75ffbdd 100644 --- a/src/nationalarchives/components/_presentation.scss +++ b/src/nationalarchives/components/_presentation.scss @@ -16,7 +16,6 @@ @use "phase-banner"; @use "picture"; @use "quick-filters"; -@use "records-list"; @use "sidebar"; @use "skip-link"; @use "tabs"; diff --git a/src/nationalarchives/components/records-list/_index.scss b/src/nationalarchives/components/records-list/_index.scss deleted file mode 100644 index 698588aa..00000000 --- a/src/nationalarchives/components/records-list/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@use "records-list"; diff --git a/src/nationalarchives/components/records-list/fixtures.json b/src/nationalarchives/components/records-list/fixtures.json deleted file mode 100644 index 54171d39..00000000 --- a/src/nationalarchives/components/records-list/fixtures.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "component": "records list", - "fixtures": [ - { - "name": "basic records list", - "options": { - "items": [ - { - "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" - } - ] - }, - "html": "" - }, - { - "name": "records list with images", - "options": { - "items": [ - { - "imageSrc": "https://beta.nationalarchives.gov.uk/media/images/wedderburn-trial.max-832x591.format-webp_i3c9pUH.webp", - "imageWidth": 576, - "imageHeight": 591, - "collection": "TS 11/45/167", - "title": "Court records relating to Robert Wedderburn's trial", - "href": "#", - "date": "1819–1820" - } - ] - }, - "html": "" - } - ] -} diff --git a/src/nationalarchives/components/records-list/macro-options.json b/src/nationalarchives/components/records-list/macro-options.json deleted file mode 100644 index 2f14f1d1..00000000 --- a/src/nationalarchives/components/records-list/macro-options.json +++ /dev/null @@ -1,70 +0,0 @@ -[ - { - "name": "items", - "type": "array", - "required": true, - "description": "", - "params": [ - { - "name": "imageSrc", - "type": "string", - "required": false, - "description": "" - }, - { - "name": "imageAlt", - "type": "string", - "required": false, - "description": "" - }, - { - "name": "imageWidth", - "type": "number", - "required": false, - "description": "" - }, - { - "name": "imageHeight", - "type": "number", - "required": false, - "description": "" - }, - { - "name": "collection", - "type": "string", - "required": true, - "description": "" - }, - { - "name": "title", - "type": "string", - "required": true, - "description": "" - }, - { - "name": "href", - "type": "string", - "required": true, - "description": "" - }, - { - "name": "date", - "type": "string", - "required": false, - "description": "" - } - ] - }, - { - "name": "classes", - "type": "string", - "required": false, - "description": "Classes to add to the filters." - }, - { - "name": "attributes", - "type": "object", - "required": false, - "description": "HTML attributes (for example data attributes) to add to the filters." - } -] diff --git a/src/nationalarchives/components/records-list/macro.njk b/src/nationalarchives/components/records-list/macro.njk deleted file mode 100644 index 1b5349b4..00000000 --- a/src/nationalarchives/components/records-list/macro.njk +++ /dev/null @@ -1,3 +0,0 @@ -{% macro tnaRecordsList(params) %} - {%- include "nationalarchives/components/records-list/template.njk" -%} -{% endmacro %} \ No newline at end of file diff --git a/src/nationalarchives/components/records-list/records-list.scss b/src/nationalarchives/components/records-list/records-list.scss deleted file mode 100644 index 9e047bb3..00000000 --- a/src/nationalarchives/components/records-list/records-list.scss +++ /dev/null @@ -1,92 +0,0 @@ -@use "../../tools/colour"; -@use "../../tools/media"; -@use "../../tools/spacing"; -@use "../../tools/typography"; - -.tna-records-list { - @include spacing.space-above; - margin-bottom: 0; - padding: 0; - - list-style: none; - - @include colour.thick-keyline-accent(top); - - &__item { - padding: spacing.space(1) spacing.space(1.5); - - display: flex; - align-items: center; - justify-content: flex-start; - gap: spacing.space(2); - - @include colour.colour-border("keyline", 1px); - border-top-width: 0; - } - - &__image { - width: 6rem; - height: auto; - } - - &__details { - margin: 0; - - flex: 1; - } - - &__title-label, - &__date-label { - display: none; - } - - &__collection-description, - &__title-description, - &__date-description { - width: 100%; - margin: 0; - } - - &__collection-label, - &__collection-description { - display: inline-block; - } - - &__collection-label { - &::after { - content: ":"; - content: ":" / ""; - } - } - - &__collection-description { - } - - &__title-label { - } - - &__title-description { - padding-bottom: spacing.space(0.25); - - @include typography.detail-font(true); - } - - &__date-label { - } - - &__date-description { - @include colour.colour-font("font-light"); - @include typography.font-size(16); - } - - @include media.on-tiny { - &__item { - padding: spacing.space(1); - - flex-direction: column; - align-items: flex-start; - - gap: spacing.space(1); - } - } -} diff --git a/src/nationalarchives/components/records-list/records-list.stories.js b/src/nationalarchives/components/records-list/records-list.stories.js deleted file mode 100644 index 93c5f470..00000000 --- a/src/nationalarchives/components/records-list/records-list.stories.js +++ /dev/null @@ -1,50 +0,0 @@ -import RecordsList from "./template.njk"; -import macroOptions from "./macro-options.json"; - -const argTypes = { - items: { control: "object" }, - classes: { control: "text" }, - attributes: { control: "object" }, -}; - -Object.keys(argTypes).forEach((argType) => { - argTypes[argType].description = macroOptions.find( - (option) => option.name === argType, - )?.description; -}); - -export default { - title: "Components/Records list", - argTypes, -}; - -const Template = ({ items, classes, attributes }) => - RecordsList({ - params: { - items, - classes, - attributes, - }, - }); - -export const Standard = Template.bind({}); -Standard.args = { - 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", - }, - ], - classes: "tna-records-list--demo", -}; diff --git a/src/nationalarchives/components/records-list/template.njk b/src/nationalarchives/components/records-list/template.njk deleted file mode 100644 index 3fb99bfc..00000000 --- a/src/nationalarchives/components/records-list/template.njk +++ /dev/null @@ -1,21 +0,0 @@ -{%- set containerClasses = [params.classes] if params.classes else [] -%} -{%- set classes = containerClasses | join(' ') -%} - diff --git a/src/nationalarchives/utilities/colour/colour-themes.stories.js b/src/nationalarchives/utilities/colour/colour-themes.stories.js index ca7ab153..21d8b057 100644 --- a/src/nationalarchives/utilities/colour/colour-themes.stories.js +++ b/src/nationalarchives/utilities/colour/colour-themes.stories.js @@ -13,7 +13,6 @@ import Pagination from "../../components/pagination/template.njk"; import PhaseBanner from "../../components/phase-banner/template.njk"; import Picture from "../../components/picture/template.njk"; import Radios from "../../components/radios/template.njk"; -import RecordsList from "../../components/records-list/template.njk"; import SearchField from "../../components/search-field/template.njk"; import Select from "../../components/select/template.njk"; import SkipLink from "../../components/skip-link/template.njk"; @@ -443,31 +442,6 @@ const Template = ({ theme, accent }) => { body: "Please note this page references hunger strikes and force feeding, which some people may find upsetting.", }, })} -

- Featured records -

- ${RecordsList({ - params: { - 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", - }, - ], - classes: "tna-records-list--demo", - }, - })}

Accordion

diff --git a/tasks/test-package.js b/tasks/test-package.js index e5e0f0a7..d4fc5762 100644 --- a/tasks/test-package.js +++ b/tasks/test-package.js @@ -108,7 +108,6 @@ const checkExists = [ ...componentFiles("picture", "Picture"), ...componentFiles("quick-filters"), ...componentFiles("radios"), - ...componentFiles("records-list"), ...componentFiles("search-field"), ...componentFiles("select"), ...componentFiles("sidebar"),