@nationalarchives/frontend 0.1.15-prerelease → 0.1.17-prerelease
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +21 -0
- package/nationalarchives/all.css +13 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.scss +2 -3
- package/nationalarchives/assets/fonts/fa-brands-400.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-brands-400.woff2 +0 -0
- package/nationalarchives/assets/fonts/fa-regular-400.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-regular-400.woff2 +0 -0
- package/nationalarchives/assets/fonts/fa-solid-900.ttf +0 -0
- package/nationalarchives/assets/fonts/fa-solid-900.woff2 +0 -0
- package/nationalarchives/components/_index.scss +1 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +13 -41
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +8 -4
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +9 -30
- package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
- package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
- package/nationalarchives/components/breadcrumbs/template.njk +17 -12
- package/nationalarchives/components/button/_button-group.scss +18 -0
- package/nationalarchives/components/button/_index.scss +25 -9
- package/nationalarchives/components/button/button.stories.js +64 -8
- package/nationalarchives/components/button/fixtures.json +3 -3
- package/nationalarchives/components/button/macro-options.json +13 -1
- package/nationalarchives/components/button/template.njk +7 -2
- package/nationalarchives/components/card/_index.scss +67 -51
- package/nationalarchives/components/card/card.stories.js +123 -10
- package/nationalarchives/components/card/fixtures.json +62 -10
- package/nationalarchives/components/card/macro-options.json +9 -3
- package/nationalarchives/components/card/template.njk +12 -8
- package/nationalarchives/components/filters/_index.scss +19 -14
- package/nationalarchives/components/filters/filters.stories.js +3 -4
- package/nationalarchives/components/footer/_index.scss +195 -72
- package/nationalarchives/components/footer/fixtures.json +1 -1
- package/nationalarchives/components/footer/footer.stories.js +82 -74
- package/nationalarchives/components/footer/macro-options.json +34 -8
- package/nationalarchives/components/footer/template.njk +110 -53
- package/nationalarchives/components/grid/_index.scss +2 -2
- package/nationalarchives/components/grid/grid.stories.js +2 -3
- package/nationalarchives/components/header/_index.scss +57 -23
- package/nationalarchives/components/header/header.stories.js +2 -3
- package/nationalarchives/components/hero/_index.scss +4 -8
- package/nationalarchives/components/hero/hero.stories.js +2 -3
- package/nationalarchives/components/index-grid/_index.scss +28 -7
- package/nationalarchives/components/index-grid/index-grid.stories.js +27 -4
- package/nationalarchives/components/index-grid/macro-options.json +12 -0
- package/nationalarchives/components/index-grid/template.njk +9 -11
- package/nationalarchives/components/message/_index.scss +12 -6
- package/nationalarchives/components/message/phase-banner.stories.js +2 -3
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
- package/nationalarchives/components/picture/_index.scss +5 -5
- package/nationalarchives/components/picture/picture.js +1 -1
- package/nationalarchives/components/picture/picture.js.map +1 -1
- package/nationalarchives/components/picture/picture.mjs +2 -0
- package/nationalarchives/components/picture/picture.stories.js +2 -3
- package/nationalarchives/components/profile/profile.stories.js +2 -3
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
- package/nationalarchives/components/skip-link/_index.scss +63 -0
- package/nationalarchives/components/skip-link/fixtures.json +11 -0
- package/nationalarchives/{patterns/featured-collection → components/skip-link}/macro-options.json +10 -4
- package/nationalarchives/components/skip-link/macro.njk +3 -0
- package/nationalarchives/{patterns/featured-collection/featured-collection.stories.js → components/skip-link/skip-link.stories.js} +7 -10
- package/nationalarchives/components/skip-link/template.njk +4 -0
- package/nationalarchives/components/tabs/_index.scss +7 -5
- package/nationalarchives/components/tabs/tabs.stories.js +8 -9
- package/nationalarchives/lib/font-awesome/_animated.scss +276 -0
- package/nationalarchives/lib/font-awesome/_bordered-pulled.scss +20 -0
- package/nationalarchives/lib/font-awesome/_core.scss +42 -0
- package/nationalarchives/lib/font-awesome/_fixed-width.scss +7 -0
- package/nationalarchives/lib/font-awesome/_functions.scss +57 -0
- package/nationalarchives/lib/font-awesome/_icons.scss +11 -0
- package/nationalarchives/lib/font-awesome/_list.scss +20 -0
- package/nationalarchives/lib/font-awesome/_mixins.scss +74 -0
- package/nationalarchives/lib/font-awesome/_rotated-flipped.scss +31 -0
- package/nationalarchives/lib/font-awesome/_screen-reader.scss +14 -0
- package/nationalarchives/lib/font-awesome/_shims.scss +2653 -0
- package/nationalarchives/lib/font-awesome/_sizing.scss +16 -0
- package/nationalarchives/lib/font-awesome/_stacked.scss +32 -0
- package/nationalarchives/lib/font-awesome/_variables.scss +4976 -0
- package/nationalarchives/lib/font-awesome/brands.scss +34 -0
- package/nationalarchives/lib/font-awesome/fontawesome.scss +21 -0
- package/nationalarchives/lib/font-awesome/regular.scss +28 -0
- package/nationalarchives/lib/font-awesome/solid.scss +28 -0
- package/nationalarchives/lib/font-awesome/v4-shims.scss +11 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +22 -0
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +494 -91
- package/nationalarchives/stories/utilities/overrides/overrides.mdx +37 -57
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +8 -14
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +1 -1
- package/nationalarchives/stories/utilities/typography/typography.mdx +2 -0
- package/nationalarchives/stories/utilities/typography/typography.stories.js +20 -1
- package/nationalarchives/templates/layouts/_generic.njk +10 -8
- package/nationalarchives/tools/_colour.scss +163 -49
- package/nationalarchives/tools/_index.scss +0 -1
- package/nationalarchives/tools/_typography.scss +13 -0
- package/nationalarchives/utilities/_debug.scss +41 -1
- package/nationalarchives/utilities/_font-awesome.scss +5 -0
- package/nationalarchives/utilities/_global.scss +75 -26
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_overrides.scss +54 -9
- package/nationalarchives/utilities/_typography.scss +203 -65
- package/nationalarchives/variables/_assets.scss +1 -1
- package/nationalarchives/variables/_colour.scss +93 -93
- package/nationalarchives/variables/_grid.scss +1 -1
- package/nationalarchives/variables/_media.scss +23 -23
- package/nationalarchives/variables/_spacing.scss +12 -2
- package/nationalarchives/variables/_typography.scss +4 -1
- package/package.json +14 -14
- package/nationalarchives/patterns/_index.scss +0 -1
- package/nationalarchives/patterns/featured-collection/_index.scss +0 -13
- package/nationalarchives/patterns/featured-collection/macro.njk +0 -3
- package/nationalarchives/patterns/featured-collection/template.njk +0 -96
- package/nationalarchives/tools/_assets.scss +0 -5
@@ -1,14 +1,19 @@
|
|
1
1
|
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
{%- if params.noCollapse -%}
|
3
|
+
{%- set containerClasses = containerClasses.concat('tna-breadcrumbs--no-collapse') -%}
|
4
|
+
{%- endif -%}
|
5
|
+
<div class="tna-breadcrumbs {{ containerClasses | join(' ') }}" data-module="tna-breadcrumbs" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
6
|
+
<div class="tna-container">
|
7
|
+
<nav class="tna-breadcrumbs__wrapper tna-column tna-column--full" aria-label="Breadcrumb">
|
8
|
+
<ol class="tna-breadcrumbs__list">
|
9
|
+
{%- for item in params.items -%}
|
10
|
+
<li class="tna-breadcrumbs__item">
|
11
|
+
<a href="{{ item.href }}" class="tna-breadcrumbs__link" {%- if item.title %} title="{{ item.title }}"{% endif %}>
|
12
|
+
{{ item.text }}
|
13
|
+
</a>
|
14
|
+
</li>
|
15
|
+
{%- endfor -%}
|
16
|
+
</ol>
|
17
|
+
</nav>
|
18
|
+
</div>
|
14
19
|
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
@use "../../tools/media";
|
2
|
+
|
3
|
+
.tna-button-group {
|
4
|
+
margin-bottom: 2rem;
|
5
|
+
|
6
|
+
display: flex;
|
7
|
+
flex-wrap: wrap;
|
8
|
+
gap: 1rem;
|
9
|
+
|
10
|
+
&:last-child {
|
11
|
+
margin-bottom: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
@include media.on-tiny {
|
15
|
+
flex-direction: column;
|
16
|
+
align-items: stretch;
|
17
|
+
}
|
18
|
+
}
|
@@ -1,4 +1,6 @@
|
|
1
1
|
@use "../../tools/colour";
|
2
|
+
@use "../../tools/media";
|
3
|
+
@import "button-group";
|
2
4
|
|
3
5
|
.tna-button {
|
4
6
|
padding: 0.25rem 1rem;
|
@@ -7,11 +9,11 @@
|
|
7
9
|
|
8
10
|
font-weight: 700;
|
9
11
|
text-decoration: none;
|
12
|
+
text-align: center;
|
10
13
|
|
11
14
|
@include colour.colour-background("button-primary-background");
|
12
15
|
|
13
|
-
border
|
14
|
-
@include colour.colour-border("button-primary-background");
|
16
|
+
@include colour.colour-border("button-primary-background", 0.25rem);
|
15
17
|
|
16
18
|
transition:
|
17
19
|
color 200ms,
|
@@ -28,8 +30,9 @@
|
|
28
30
|
|
29
31
|
&:hover {
|
30
32
|
@include colour.colour-font("button-primary-hover-text");
|
33
|
+
text-decoration: none;
|
31
34
|
|
32
|
-
|
35
|
+
background: transparent;
|
33
36
|
|
34
37
|
transition:
|
35
38
|
color 50ms,
|
@@ -37,21 +40,34 @@
|
|
37
40
|
border-color 50ms;
|
38
41
|
}
|
39
42
|
|
40
|
-
&--
|
41
|
-
@include colour.colour-background("button-
|
43
|
+
&--accent {
|
44
|
+
@include colour.colour-background("button-accent-background");
|
42
45
|
|
43
|
-
@include colour.colour-border("button-
|
46
|
+
@include colour.colour-border("button-accent-background");
|
44
47
|
|
45
48
|
&,
|
46
49
|
&:link,
|
47
50
|
&:visited {
|
48
|
-
@include colour.colour-font("button-
|
51
|
+
@include colour.colour-font("button-accent-text");
|
49
52
|
}
|
50
53
|
|
51
54
|
&:hover {
|
52
|
-
@include colour.colour-font("
|
55
|
+
@include colour.colour-font("font-dark");
|
56
|
+
}
|
57
|
+
}
|
53
58
|
|
54
|
-
|
59
|
+
&--solid-hover,
|
60
|
+
.tna-background--accent &,
|
61
|
+
.tna-background--accent-light & {
|
62
|
+
&:hover {
|
63
|
+
@include colour.colour-background("page-background");
|
55
64
|
}
|
56
65
|
}
|
66
|
+
|
67
|
+
.fa,
|
68
|
+
.fa-regular,
|
69
|
+
.fa-solid,
|
70
|
+
.fa-brands {
|
71
|
+
margin-right: 0.5rem;
|
72
|
+
}
|
57
73
|
}
|
@@ -5,7 +5,9 @@ const argTypes = {
|
|
5
5
|
text: { control: "text" },
|
6
6
|
href: { control: "text" },
|
7
7
|
title: { control: "text" },
|
8
|
-
|
8
|
+
icon: { control: "text" },
|
9
|
+
brandIcon: { control: "text" },
|
10
|
+
accent: { control: "boolean" },
|
9
11
|
classes: { control: "text" },
|
10
12
|
attributes: { control: "object" },
|
11
13
|
};
|
@@ -21,18 +23,28 @@ export default {
|
|
21
23
|
argTypes,
|
22
24
|
};
|
23
25
|
|
24
|
-
const Template = ({
|
25
|
-
|
26
|
+
const Template = ({
|
27
|
+
text,
|
28
|
+
href,
|
29
|
+
title,
|
30
|
+
icon,
|
31
|
+
brandIcon,
|
32
|
+
accent,
|
33
|
+
classes,
|
34
|
+
attributes,
|
35
|
+
}) =>
|
36
|
+
Button({
|
26
37
|
params: {
|
27
38
|
text,
|
28
39
|
href,
|
29
40
|
title,
|
30
|
-
|
41
|
+
icon,
|
42
|
+
brandIcon,
|
43
|
+
accent,
|
31
44
|
classes,
|
32
45
|
attributes,
|
33
46
|
},
|
34
47
|
});
|
35
|
-
};
|
36
48
|
|
37
49
|
export const Standard = Template.bind({});
|
38
50
|
Standard.args = {
|
@@ -41,10 +53,54 @@ Standard.args = {
|
|
41
53
|
classes: "tna-button--demo",
|
42
54
|
};
|
43
55
|
|
44
|
-
export const
|
45
|
-
|
56
|
+
export const Accent = Template.bind({});
|
57
|
+
Accent.args = {
|
46
58
|
text: "Button",
|
47
59
|
href: "#",
|
48
|
-
|
60
|
+
accent: true,
|
61
|
+
classes: "tna-button--demo",
|
62
|
+
};
|
63
|
+
|
64
|
+
export const Icon = Template.bind({});
|
65
|
+
Icon.args = {
|
66
|
+
text: "Explore the collection",
|
67
|
+
href: "#",
|
68
|
+
icon: "map-location-dot",
|
49
69
|
classes: "tna-button--demo",
|
50
70
|
};
|
71
|
+
|
72
|
+
export const BrandIcon = Template.bind({});
|
73
|
+
BrandIcon.args = {
|
74
|
+
text: "Twitter",
|
75
|
+
href: "#",
|
76
|
+
brandIcon: "twitter",
|
77
|
+
classes: "tna-button--demo",
|
78
|
+
};
|
79
|
+
|
80
|
+
const GroupTemplate = ({ buttons }) =>
|
81
|
+
`<div class="tna-button-group">
|
82
|
+
${buttons.map((button) => Template(button)).join("")}
|
83
|
+
</div>`;
|
84
|
+
|
85
|
+
export const Group = GroupTemplate.bind({});
|
86
|
+
Group.args = {
|
87
|
+
buttons: [
|
88
|
+
{
|
89
|
+
text: "Button 1",
|
90
|
+
href: "#",
|
91
|
+
classes: "tna-button--demo",
|
92
|
+
},
|
93
|
+
{
|
94
|
+
text: "Button 2",
|
95
|
+
href: "#",
|
96
|
+
accent: true,
|
97
|
+
classes: "tna-button--demo",
|
98
|
+
},
|
99
|
+
{
|
100
|
+
text: "Call us",
|
101
|
+
href: "#",
|
102
|
+
icon: "phone",
|
103
|
+
classes: "tna-button--demo",
|
104
|
+
},
|
105
|
+
],
|
106
|
+
};
|
@@ -21,13 +21,13 @@
|
|
21
21
|
"hidden": false
|
22
22
|
},
|
23
23
|
{
|
24
|
-
"name": "
|
24
|
+
"name": "accent",
|
25
25
|
"options": {
|
26
26
|
"text": "Log in",
|
27
27
|
"href": "#",
|
28
|
-
"
|
28
|
+
"accent": true
|
29
29
|
},
|
30
|
-
"html": "<a href=\"#\" class=\"tna-button tna-button--
|
30
|
+
"html": "<a href=\"#\" class=\"tna-button tna-button--accent\" role=\"button\">Log in</a>",
|
31
31
|
"hidden": false
|
32
32
|
},
|
33
33
|
{
|
@@ -18,7 +18,19 @@
|
|
18
18
|
"description": ""
|
19
19
|
},
|
20
20
|
{
|
21
|
-
"name": "
|
21
|
+
"name": "icon",
|
22
|
+
"type": "string",
|
23
|
+
"required": false,
|
24
|
+
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "brandIcon",
|
28
|
+
"type": "string",
|
29
|
+
"required": false,
|
30
|
+
"description": ""
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "accent",
|
22
34
|
"type": "boolean",
|
23
35
|
"required": false,
|
24
36
|
"description": ""
|
@@ -1,7 +1,12 @@
|
|
1
1
|
{%- set buttonClasses = [params.classes] if params.classes else [] -%}
|
2
|
-
{%- if params.
|
3
|
-
{%- set buttonClasses = buttonClasses.concat('tna-button--
|
2
|
+
{%- if params.accent -%}
|
3
|
+
{%- set buttonClasses = buttonClasses.concat('tna-button--accent') -%}
|
4
4
|
{%- endif -%}
|
5
5
|
<a href="{{ params.href }}" class="tna-button {{ buttonClasses | join(' ') }}" role="button"{%- if params.title %} title="{{ params.title }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
6
|
+
{%- if params.brandIcon -%}
|
7
|
+
<i class="fa-brands fa-{{ params.brandIcon }}"></i>
|
8
|
+
{%- elseif params.icon -%}
|
9
|
+
<i class="fa-solid fa-{{ params.icon }}"></i>
|
10
|
+
{%- endif -%}
|
6
11
|
{{ params.text }}
|
7
12
|
</a>
|
@@ -1,5 +1,4 @@
|
|
1
1
|
@use "sass:math";
|
2
|
-
@use "../../variables/colour" as colourVars; // TODO
|
3
2
|
@use "../../tools/colour";
|
4
3
|
@use "../../tools/typography";
|
5
4
|
@use "../../tools/media";
|
@@ -25,9 +24,15 @@
|
|
25
24
|
|
26
25
|
&__title {
|
27
26
|
order: 2;
|
27
|
+
|
28
|
+
// @include typography.main-font;
|
29
|
+
// @include typography.main-font-weight-bold;
|
28
30
|
}
|
29
31
|
|
30
32
|
&__title-link {
|
33
|
+
&::after {
|
34
|
+
display: none !important;
|
35
|
+
}
|
31
36
|
}
|
32
37
|
|
33
38
|
&__image-container {
|
@@ -51,32 +56,14 @@
|
|
51
56
|
}
|
52
57
|
|
53
58
|
&__image-label {
|
54
|
-
max-width: calc(100% -
|
55
|
-
padding: 0.25rem 0.5rem;
|
59
|
+
max-width: calc(100% - 1rem);
|
56
60
|
|
57
61
|
position: absolute;
|
58
|
-
top:
|
59
|
-
left: 0;
|
60
|
-
|
61
|
-
@include colour.fixed;
|
62
|
-
|
63
|
-
@include colour.colour-font("font-dark");
|
64
|
-
@include typography.relative-font-size(14);
|
65
|
-
@include typography.main-font-weight-bold;
|
66
|
-
text-transform: uppercase;
|
67
|
-
line-height: #{math.div(16, 14)};
|
68
|
-
|
69
|
-
@include colour.colour-background("accent");
|
70
|
-
}
|
71
|
-
|
72
|
-
&--green-label #{&}__image-label {
|
73
|
-
// color: colourVars.$tna-white;
|
74
|
-
background-color: colourVars.$tna-green;
|
62
|
+
top: 0.5rem;
|
63
|
+
left: 0.5rem;
|
75
64
|
}
|
76
65
|
|
77
66
|
&__body {
|
78
|
-
// margin-top: 2rem;
|
79
|
-
|
80
67
|
order: 3;
|
81
68
|
}
|
82
69
|
|
@@ -89,37 +76,34 @@
|
|
89
76
|
&__action {
|
90
77
|
}
|
91
78
|
|
92
|
-
&--
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
@include colour.colour-font("font-base");
|
98
|
-
|
99
|
-
@include colour.colour-background("accent");
|
100
|
-
|
101
|
-
.tna-card__heading {
|
102
|
-
padding-bottom: 2rem;
|
103
|
-
|
104
|
-
border-bottom: 2px transparent solid;
|
105
|
-
@include colour.colour-border("keyline-dark");
|
79
|
+
&--contrast,
|
80
|
+
&--accent {
|
81
|
+
.tna-card__inner {
|
82
|
+
padding-bottom: 1rem;
|
106
83
|
}
|
107
84
|
|
108
|
-
.tna-
|
109
|
-
|
85
|
+
.tna-card__heading,
|
86
|
+
.tna-card__body,
|
87
|
+
.tna-card__actions {
|
88
|
+
margin-right: 1rem;
|
89
|
+
margin-left: 1rem;
|
110
90
|
}
|
91
|
+
}
|
111
92
|
|
112
|
-
|
113
|
-
|
114
|
-
|
93
|
+
&--contrast {
|
94
|
+
@include colour.invert;
|
95
|
+
}
|
115
96
|
|
116
|
-
|
117
|
-
|
118
|
-
|
97
|
+
&--accent {
|
98
|
+
@include colour.accent;
|
99
|
+
}
|
119
100
|
|
120
|
-
|
121
|
-
|
122
|
-
|
101
|
+
&--accent &__supertitle {
|
102
|
+
@include colour.invert;
|
103
|
+
}
|
104
|
+
|
105
|
+
&--horizontal {
|
106
|
+
position: relative;
|
123
107
|
|
124
108
|
@include media.on-larger-than-mobile {
|
125
109
|
.tna-card__inner {
|
@@ -137,13 +121,27 @@
|
|
137
121
|
position: absolute;
|
138
122
|
inset: 0 50% 0 0;
|
139
123
|
}
|
124
|
+
|
125
|
+
.tna-card__heading,
|
126
|
+
.tna-card__body,
|
127
|
+
.tna-card__actions {
|
128
|
+
margin-right: 0;
|
129
|
+
margin-left: 0;
|
130
|
+
}
|
140
131
|
}
|
132
|
+
}
|
141
133
|
|
134
|
+
&--horizontal#{&}--contrast,
|
135
|
+
&--horizontal#{&}--accent {
|
142
136
|
@include media.on-mobile {
|
143
137
|
.tna-card__inner {
|
144
138
|
padding: 0 0 2rem;
|
145
139
|
}
|
146
140
|
|
141
|
+
.tna-card__image-container {
|
142
|
+
margin-bottom: 2rem;
|
143
|
+
}
|
144
|
+
|
147
145
|
.tna-card__heading,
|
148
146
|
.tna-card__body,
|
149
147
|
.tna-card__actions {
|
@@ -153,15 +151,33 @@
|
|
153
151
|
}
|
154
152
|
}
|
155
153
|
|
154
|
+
&:not(#{&}--horizontal) {
|
155
|
+
@include colour.on-high-contrast {
|
156
|
+
.tna-card__inner {
|
157
|
+
padding-bottom: 1rem;
|
158
|
+
}
|
159
|
+
|
160
|
+
.tna-card__heading,
|
161
|
+
.tna-card__body,
|
162
|
+
.tna-card__actions {
|
163
|
+
margin-right: 1rem;
|
164
|
+
margin-left: 1rem;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
156
169
|
@include colour.on-high-contrast {
|
157
|
-
border
|
158
|
-
|
170
|
+
@include colour.colour-border("keyline-dark", 1px);
|
171
|
+
|
172
|
+
.tna-card__inner {
|
173
|
+
// padding-bottom: 1rem;
|
174
|
+
}
|
159
175
|
|
160
176
|
.tna-card__heading,
|
161
177
|
.tna-card__body,
|
162
178
|
.tna-card__actions {
|
163
|
-
margin-right:
|
164
|
-
margin-left:
|
179
|
+
// margin-right: 1rem;
|
180
|
+
// margin-left: 1rem;
|
165
181
|
}
|
166
182
|
}
|
167
183
|
}
|
@@ -9,7 +9,8 @@ const argTypes = {
|
|
9
9
|
body: { control: "text" },
|
10
10
|
text: { control: "text" },
|
11
11
|
actions: { control: "object" },
|
12
|
-
|
12
|
+
horizontal: { control: "boolean" },
|
13
|
+
style: { control: "text" },
|
13
14
|
htmlElement: { control: "text" },
|
14
15
|
classes: { control: "text" },
|
15
16
|
attributes: { control: "object" },
|
@@ -34,12 +35,13 @@ const Template = ({
|
|
34
35
|
body,
|
35
36
|
text,
|
36
37
|
actions,
|
37
|
-
|
38
|
+
horizontal,
|
39
|
+
style,
|
38
40
|
htmlElement,
|
39
41
|
classes,
|
40
42
|
attributes,
|
41
|
-
}) =>
|
42
|
-
|
43
|
+
}) =>
|
44
|
+
Card({
|
43
45
|
params: {
|
44
46
|
heading,
|
45
47
|
href,
|
@@ -48,13 +50,13 @@ const Template = ({
|
|
48
50
|
body,
|
49
51
|
text,
|
50
52
|
actions,
|
51
|
-
|
53
|
+
horizontal,
|
54
|
+
style,
|
52
55
|
htmlElement,
|
53
56
|
classes,
|
54
57
|
attributes,
|
55
58
|
},
|
56
59
|
});
|
57
|
-
};
|
58
60
|
|
59
61
|
export const Standard = Template.bind({});
|
60
62
|
Standard.args = {
|
@@ -62,7 +64,7 @@ Standard.args = {
|
|
62
64
|
supertitle: "Card supertitle",
|
63
65
|
title: "Card title",
|
64
66
|
level: 3,
|
65
|
-
size: "
|
67
|
+
size: "l",
|
66
68
|
singleSentence: false,
|
67
69
|
},
|
68
70
|
href: "#",
|
@@ -85,8 +87,54 @@ Standard.args = {
|
|
85
87
|
classes: "tna-card--demo",
|
86
88
|
};
|
87
89
|
|
88
|
-
export const
|
89
|
-
|
90
|
+
export const Boxed = Template.bind({});
|
91
|
+
Boxed.args = {
|
92
|
+
heading: {
|
93
|
+
supertitle: "Card supertitle",
|
94
|
+
title: "Card title",
|
95
|
+
level: 3,
|
96
|
+
size: "l",
|
97
|
+
singleSentence: false,
|
98
|
+
},
|
99
|
+
href: "#",
|
100
|
+
image: {
|
101
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
102
|
+
alt: "The National Archives office",
|
103
|
+
width: 1996,
|
104
|
+
height: 1331,
|
105
|
+
},
|
106
|
+
label: "New",
|
107
|
+
body: "<p>Card body</p>",
|
108
|
+
style: "contrast",
|
109
|
+
htmlElement: "article",
|
110
|
+
classes: "tna-card--demo",
|
111
|
+
};
|
112
|
+
|
113
|
+
export const Accent = Template.bind({});
|
114
|
+
Accent.args = {
|
115
|
+
heading: {
|
116
|
+
supertitle: "Card supertitle",
|
117
|
+
title: "Card title",
|
118
|
+
level: 3,
|
119
|
+
size: "l",
|
120
|
+
singleSentence: false,
|
121
|
+
},
|
122
|
+
href: "#",
|
123
|
+
image: {
|
124
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
125
|
+
alt: "The National Archives office",
|
126
|
+
width: 1996,
|
127
|
+
height: 1331,
|
128
|
+
},
|
129
|
+
label: "New",
|
130
|
+
body: "<p>Card body</p>",
|
131
|
+
style: "accent",
|
132
|
+
htmlElement: "article",
|
133
|
+
classes: "tna-card--demo",
|
134
|
+
};
|
135
|
+
|
136
|
+
export const Horizontal = Template.bind({});
|
137
|
+
Horizontal.args = {
|
90
138
|
heading: {
|
91
139
|
supertitle: "Card supertitle",
|
92
140
|
title: "Card title",
|
@@ -110,7 +158,72 @@ Featured.args = {
|
|
110
158
|
title: "Go and do the action",
|
111
159
|
},
|
112
160
|
],
|
113
|
-
|
161
|
+
horizontal: true,
|
162
|
+
htmlElement: "article",
|
163
|
+
classes: "tna-card--demo",
|
164
|
+
};
|
165
|
+
|
166
|
+
const GridTemplate = ({
|
167
|
+
heading,
|
168
|
+
href,
|
169
|
+
image,
|
170
|
+
label,
|
171
|
+
body,
|
172
|
+
text,
|
173
|
+
actions,
|
174
|
+
horizontal,
|
175
|
+
htmlElement,
|
176
|
+
classes,
|
177
|
+
attributes,
|
178
|
+
}) =>
|
179
|
+
`<div class="tna-container">
|
180
|
+
${Array(12)
|
181
|
+
.fill(
|
182
|
+
`<div class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny tna-!--margin-bottom-l">
|
183
|
+
${Card({
|
184
|
+
params: {
|
185
|
+
heading,
|
186
|
+
href,
|
187
|
+
image,
|
188
|
+
label,
|
189
|
+
body,
|
190
|
+
text,
|
191
|
+
actions,
|
192
|
+
horizontal,
|
193
|
+
htmlElement,
|
194
|
+
classes,
|
195
|
+
attributes,
|
196
|
+
},
|
197
|
+
})}
|
198
|
+
</div>`,
|
199
|
+
)
|
200
|
+
.join("")}
|
201
|
+
</div>`;
|
202
|
+
|
203
|
+
export const Grid = GridTemplate.bind({});
|
204
|
+
Grid.args = {
|
205
|
+
heading: {
|
206
|
+
supertitle: "Card supertitle",
|
207
|
+
title: "Card title",
|
208
|
+
level: 3,
|
209
|
+
singleSentence: false,
|
210
|
+
},
|
211
|
+
href: "#",
|
212
|
+
image: {
|
213
|
+
src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
|
214
|
+
alt: "The National Archives office",
|
215
|
+
width: 1996,
|
216
|
+
height: 1331,
|
217
|
+
},
|
218
|
+
label: "New",
|
219
|
+
body: "<p>Card body</p>",
|
220
|
+
// actions: [
|
221
|
+
// {
|
222
|
+
// text: "Card action",
|
223
|
+
// href: "#",
|
224
|
+
// title: "Go and do the action",
|
225
|
+
// },
|
226
|
+
// ],
|
114
227
|
htmlElement: "article",
|
115
228
|
classes: "tna-card--demo",
|
116
229
|
};
|