diff --git a/src/nationalarchives/stories/development/about.mdx b/src/nationalarchives/stories/development/about.mdx deleted file mode 100644 index 21f49ee3..00000000 --- a/src/nationalarchives/stories/development/about.mdx +++ /dev/null @@ -1,122 +0,0 @@ -import { Meta } from "@storybook/blocks"; - - - -# Project history - -## Needs - -TNA needed a frontend toolkit that was: - -- standardised - a single source of truth for all TNA that follows all our coding standards (currently non-existent) -- version controlled - as well as [semantically versioned](https://semver.org/) with a [changelog](https://keepachangelog.com/en/1.0.0/) -- open - all source code should be [open and available to anyone](https://www.gov.uk/service-manual/service-standard/point-12-make-new-source-code-open) -- accessible - all components meet WCAG 2.1 AA standards -- progressively enhanced - all components should still be operable without JavaScript, CSS or both -- importable into projects (via a service such as [NPM](https://www.npmjs.com/search?q=nationalarchives)) - to make dependency management as simple as possible -- agnostic - the implementation for the markup of the components can be replicated in any required technology (because we have Python, PHP and Java applications throughout the organisation) -- testable - both from an internal perspective as well as providing scenarios and expected results for language implementations to be able to validate against -- lean - minimal reliance on other languages and dependencies to ensure good extendability and speed of development and deployment -- automatically published - leveraging CI/CD, creating a new release version should be as simple as possible - -It would have also been nice to have a toolkit that was: - -- extendable - rather than providing a static snapshot of the toolkit, we should always be able to extend it for any given application -- documentable - not just from a technical perspective but also from a user-centred design perspective with best practices of when and how to use each component (this might be a separate project where we can [share information such as user research](https://www.gov.uk/service-manual/service-standard/point-13-use-common-standards-components-patterns)) -- prototype-able - by using Nunjucks, we could easily create a toolkit that integrated with the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk/docs/) which means we could very easily create high fidelity prototypes to test with, ultimately helping with user research - -## Current solutions - -There was already a solution in [nationalarchives/tdr-components](https://github.com/nationalarchives/tdr-components) which is specific to TDR and extends the GOV.UK components and styles. We needed to create a more generic set of components that were suitable for every TNA service, ~~while still extending the GOV.UK components and styles~~ *[Edit: this was not implemented]* but with a more TNA-branded look and feel. - -We also had [nationalarchives/tna-frontend-design-toolkit](https://github.com/nationalarchives/tna-frontend-design-toolkit) which aimed to provide similar functionality but wasn't as featureful as we needed and wasn't published to NPM which means it has to be [copied into the projects that require it](https://github.com/nationalarchives/ds-wagtail/tree/develop/sass/tna-toolkit). - -## Proposed solution - -This repository should hold all the JavaScript and SCSS source files required for all the frontend styles along with tests and expected markup. - -### Output - -The source files will be compiled down to a NodeJS package and deployed to [NPM](https://www.npmjs.com/). The package will contain: - -- All the JavaScript and SCSS source files which can be imported into a projects source code and compiled by the project (which will allow for tree shaking and application-specific modifications) -- An AMD/UMD/IIFE (TBD) ES5 JavaScript file which can be included with a normal ` - -``` - -...or use the module syntax: - -``` - -``` - -## Specific components - -```html - -``` - -### JavaScript - -```html - - -``` diff --git a/src/nationalarchives/stories/development/using/npm.mdx b/src/nationalarchives/stories/development/using/npm.mdx deleted file mode 100644 index c8cede5a..00000000 --- a/src/nationalarchives/stories/development/using/npm.mdx +++ /dev/null @@ -1,59 +0,0 @@ -import { Meta } from "@storybook/blocks"; - - - -# Using with npm - -Install the frontend package from NPM with: - -```sh -npm install @nationalarchives/frontend -``` - -## CSS - -From here, you have access to include the SCSS files from the package so you can compile the package yourself: - -```css -// OPTIONAL: Override any variables -@use "node_modules/@nationalarchives/frontend/nationalarchives/variables/assets" with ( - $tna-font-path: "/MY_CUSTOM_FONTS_PATH", - $fa-font-path: "/MY_CUSTOM_FONT_AWESOME_PATH" -); -@use "node_modules/@nationalarchives/frontend/nationalarchives/variables/grid" with ( - $largest-container-width: 1337px -); -@use "node_modules/@nationalarchives/frontend/nationalarchives/variables/typography" with ( - $body-font-size-px: 17 -); - -// Include all the styles -@use "node_modules/@nationalarchives/frontend/nationalarchives/all"; - -// ...or just include a single component -@use "node_modules/@nationalarchives/frontend/nationalarchives/components/tabs"; -``` - -...or you can copy any of the compiled CSS files into your distribution: - -- `node_modules/@nationalarchives/frontend/nationalarchives/all.css` -- `node_modules/@nationalarchives/frontend/nationalarchives/all.css.map` -- `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.css` -- `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.css.map` - -## JavaScript - -```JavaScript -// Import all the JavaScript -import "node_modules/@nationalarchives/frontend/nationalarchives/all.mjs"; - -// ...or import just the JavaScript for a single component -import "node_modules/@nationalarchives/frontend/nationalarchives/components/tabs/tabs.mjs"; -``` - -...or you can copy any of the compiled JavaScript files into your distribution: - -- `node_modules/@nationalarchives/frontend/nationalarchives/all.js` -- `node_modules/@nationalarchives/frontend/nationalarchives/all.js.map` -- `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.js` -- `node_modules/@nationalarchives/frontend/nationalarchives/components/tabs.js.map` diff --git a/src/nationalarchives/stories/utilities/lists/lists.mdx b/src/nationalarchives/stories/utilities/lists/lists.mdx new file mode 100644 index 00000000..bda680b3 --- /dev/null +++ b/src/nationalarchives/stories/utilities/lists/lists.mdx @@ -0,0 +1,18 @@ +import { Meta, Canvas } from "@storybook/blocks"; +import * as ListStories from './lists.stories'; + + + +# Lists + + + + + + +## Plain versions + + + + + diff --git a/src/nationalarchives/stories/utilities/typography/lists.stories.js b/src/nationalarchives/stories/utilities/lists/lists.stories.js similarity index 99% rename from src/nationalarchives/stories/utilities/typography/lists.stories.js rename to src/nationalarchives/stories/utilities/lists/lists.stories.js index 72b59ef2..3a90f424 100644 --- a/src/nationalarchives/stories/utilities/typography/lists.stories.js +++ b/src/nationalarchives/stories/utilities/lists/lists.stories.js @@ -4,7 +4,7 @@ const argTypes = { }; export default { - title: "Utilities/Typography", + title: "Utilities/Lists", argTypes, }; diff --git a/src/nationalarchives/stories/utilities/typography/typography.mdx b/src/nationalarchives/stories/utilities/typography/typography.mdx index 0db0a5f6..6408ffc8 100644 --- a/src/nationalarchives/stories/utilities/typography/typography.mdx +++ b/src/nationalarchives/stories/utilities/typography/typography.mdx @@ -2,14 +2,11 @@ import { Meta, Canvas } from "@storybook/blocks"; import * as HeadingStories from './headings.stories'; import * as HeadingGroupStories from './heading-groups.stories'; import * as TypographyStories from './typography.stories'; -import * as ListStories from './lists.stories'; # Typography -We use a set of typefaces... - ## Headings @@ -17,32 +14,13 @@ We use a set of typefaces... ## Heading groups -Although visually identical, there are two types of header groups based on whether the group should be read as a single sentence or not. - -In the first example, the heading will be read by screen readers as `The story of Alice Hawkins.` - - -In the second example, the heading will be read as two separate sentences; `Record revealed. The Monteagle Letter.` - ## General typography - + - -## Lists - - - - - - -### Plain versions - - - - - + + diff --git a/src/nationalarchives/stories/utilities/typography/typography.stories.js b/src/nationalarchives/stories/utilities/typography/typography.stories.js index e0b3247f..6843e69f 100644 --- a/src/nationalarchives/stories/utilities/typography/typography.stories.js +++ b/src/nationalarchives/stories/utilities/typography/typography.stories.js @@ -18,6 +18,17 @@ Paragraph.args = { ], }; +const LargeParagraphTemplate = ({ paragraphs }) => + paragraphs + .map((paragraph) => `

${paragraph}

`) + .join(""); +export const LargeParagraph = LargeParagraphTemplate.bind({}); +LargeParagraph.args = { + paragraphs: [ + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel tincidunt velit, a molestie turpis. Sed odio libero, sodales eleifend lorem sit amet, feugiat consequat nibh. Donec ac tellus in dui rutrum maximus. Aliquam vel euismod eros. Integer ut magna velit. Fusce sed dui sit amet metus eleifend dictum quis vitae mi. Aenean sagittis euismod purus, in accumsan metus venenatis nec. Nullam nec velit felis. Sed nec felis eu nisl varius dictum eu quis nisl. Donec dapibus est arcu, vel pellentesque risus pellentesque eget.", + ], +}; + const HeadingLinkTemplate = ({ text, href }) => `

${text} @@ -37,6 +48,15 @@ SceneSetter.args = { text: `We are the official archive of England and Wales. Discover 1,000 years of history through fascinating stories from the past or start your own research and search our catalogue of 32 million records. Plan a visit to access original historic documents from our collections then enjoy the grounds, café, and free exhibitions.`, }; +const SceneSetterSmallTemplate = ({ text }) => + `

+ ${text} +

`; +export const SceneSetterSmall = SceneSetterSmallTemplate.bind({}); +SceneSetterSmall.args = { + text: `We are the official archive of England and Wales. Discover 1,000 years of history through fascinating stories from the past or start your own research and search our catalogue of 32 million records. Plan a visit to access original historic documents from our collections then enjoy the grounds, café, and free exhibitions.`, +}; + const TextDetailsTemplate = () => `

Typed slip with photographs - 'The Italian Steamer Aida Lauro which ran on the rocks near Cape Cornwall a few days ago is now a total wreck. After a severe buffeting by heavy seas the ship has broken in two. The photograph shows the Aida Lauro broken in two by a severe buffeting from the seas near Cape Cornwall. diff --git a/src/nationalarchives/utilities/_typography.scss b/src/nationalarchives/utilities/_typography.scss index a597e7d1..7c118585 100644 --- a/src/nationalarchives/utilities/_typography.scss +++ b/src/nationalarchives/utilities/_typography.scss @@ -407,7 +407,7 @@ a.tna-chip { .tna-large-paragraph { @include spacing.space-above; - @include typography.relative-font-size(20); + @include typography.relative-font-size(22); } .tna-scene-setter { @@ -431,4 +431,8 @@ a.tna-chip { text-decoration-thickness: 4.5px; } } + + &--small { + @include typography.relative-font-size(24); + } }