@nationalarchives/frontend 0.1.17-prerelease → 0.1.19-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.
Files changed (170) hide show
  1. package/nationalarchives/all.css +12 -2
  2. package/nationalarchives/all.css.map +1 -1
  3. package/nationalarchives/all.js +1 -1
  4. package/nationalarchives/all.js.map +1 -1
  5. package/nationalarchives/all.mjs +26 -2
  6. package/nationalarchives/all.scss +20 -4
  7. package/nationalarchives/assets/fonts/OpenSans-Bold.ttf +0 -0
  8. package/nationalarchives/assets/fonts/OpenSans-Medium.ttf +0 -0
  9. package/nationalarchives/assets/fonts/RobotoMono-Regular.ttf +0 -0
  10. package/nationalarchives/components/_index.scss +18 -16
  11. package/nationalarchives/components/breadcrumbs/_index.scss +1 -109
  12. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -0
  13. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -0
  14. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  15. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +111 -0
  17. package/nationalarchives/components/button/_button-group.scss +3 -5
  18. package/nationalarchives/components/button/_index.scss +1 -73
  19. package/nationalarchives/components/button/button.css +13 -0
  20. package/nationalarchives/components/button/button.css.map +1 -0
  21. package/nationalarchives/components/button/button.scss +103 -0
  22. package/nationalarchives/components/button/button.stories.js +61 -0
  23. package/nationalarchives/components/button/macro-options.json +19 -1
  24. package/nationalarchives/components/button/template.njk +8 -2
  25. package/nationalarchives/components/card/_index.scss +1 -183
  26. package/nationalarchives/components/card/card.css +13 -0
  27. package/nationalarchives/components/card/card.css.map +1 -0
  28. package/nationalarchives/components/card/card.scss +171 -0
  29. package/nationalarchives/components/card/card.stories.js +185 -95
  30. package/nationalarchives/components/card/fixtures.json +57 -28
  31. package/nationalarchives/components/card/macro-options.json +77 -48
  32. package/nationalarchives/components/card/template.njk +47 -37
  33. package/nationalarchives/components/cookie-banner/_index.scss +1 -0
  34. package/nationalarchives/components/cookie-banner/cookie-banner.css +13 -0
  35. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -0
  36. package/nationalarchives/components/cookie-banner/cookie-banner.js +2 -0
  37. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -0
  38. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +83 -0
  39. package/nationalarchives/components/cookie-banner/cookie-banner.scss +32 -0
  40. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +164 -0
  41. package/nationalarchives/components/cookie-banner/fixtures.json +4 -0
  42. package/nationalarchives/components/cookie-banner/macro-options.json +38 -0
  43. package/nationalarchives/components/cookie-banner/macro.njk +3 -0
  44. package/nationalarchives/components/cookie-banner/template.njk +61 -0
  45. package/nationalarchives/components/filters/_index.scss +1 -54
  46. package/nationalarchives/components/filters/filters.css +1 -0
  47. package/nationalarchives/components/filters/filters.css.map +1 -0
  48. package/nationalarchives/components/filters/filters.scss +53 -0
  49. package/nationalarchives/components/footer/_index.scss +1 -270
  50. package/nationalarchives/components/footer/footer.css +13 -0
  51. package/nationalarchives/components/footer/footer.css.map +1 -0
  52. package/nationalarchives/components/footer/footer.scss +265 -0
  53. package/nationalarchives/components/footer/footer.stories.js +6 -6
  54. package/nationalarchives/components/footer/macro-options.json +7 -1
  55. package/nationalarchives/components/footer/template.njk +10 -6
  56. package/nationalarchives/components/gallery/_index.scss +1 -0
  57. package/nationalarchives/components/gallery/fixtures.json +4 -0
  58. package/nationalarchives/components/gallery/gallery.css +13 -0
  59. package/nationalarchives/components/gallery/gallery.css.map +1 -0
  60. package/nationalarchives/components/gallery/gallery.js +2 -0
  61. package/nationalarchives/components/gallery/gallery.js.map +1 -0
  62. package/nationalarchives/components/gallery/gallery.mjs +80 -0
  63. package/nationalarchives/components/gallery/gallery.scss +129 -0
  64. package/nationalarchives/components/gallery/gallery.stories.js +76 -0
  65. package/nationalarchives/components/gallery/macro-options.json +104 -0
  66. package/nationalarchives/components/gallery/macro.njk +3 -0
  67. package/nationalarchives/components/gallery/template.njk +45 -0
  68. package/nationalarchives/components/grid/_index.scss +1 -79
  69. package/nationalarchives/components/grid/grid.css +1 -0
  70. package/nationalarchives/components/grid/grid.css.map +1 -0
  71. package/nationalarchives/components/grid/grid.scss +81 -0
  72. package/nationalarchives/components/header/_index.scss +1 -586
  73. package/nationalarchives/components/header/header.css +1 -0
  74. package/nationalarchives/components/header/header.css.map +1 -0
  75. package/nationalarchives/components/header/header.js +1 -1
  76. package/nationalarchives/components/header/header.js.map +1 -1
  77. package/nationalarchives/components/header/header.scss +594 -0
  78. package/nationalarchives/components/header/header.stories.js +5 -5
  79. package/nationalarchives/components/hero/_index.scss +1 -167
  80. package/nationalarchives/components/hero/hero.css +1 -0
  81. package/nationalarchives/components/hero/hero.css.map +1 -0
  82. package/nationalarchives/components/hero/hero.scss +169 -0
  83. package/nationalarchives/components/index-grid/_index.scss +1 -82
  84. package/nationalarchives/components/index-grid/index-grid.css +1 -0
  85. package/nationalarchives/components/index-grid/index-grid.css.map +1 -0
  86. package/nationalarchives/components/index-grid/index-grid.scss +84 -0
  87. package/nationalarchives/components/message/_index.scss +1 -35
  88. package/nationalarchives/components/message/message.css +1 -0
  89. package/nationalarchives/components/message/message.css.map +1 -0
  90. package/nationalarchives/components/message/message.scss +36 -0
  91. package/nationalarchives/components/phase-banner/_index.scss +1 -60
  92. package/nationalarchives/components/phase-banner/fixtures.json +8 -8
  93. package/nationalarchives/components/phase-banner/phase-banner.css +1 -0
  94. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -0
  95. package/nationalarchives/components/phase-banner/phase-banner.scss +31 -0
  96. package/nationalarchives/components/phase-banner/template.njk +2 -2
  97. package/nationalarchives/components/picture/_index.scss +1 -62
  98. package/nationalarchives/components/picture/picture.css +13 -0
  99. package/nationalarchives/components/picture/picture.css.map +1 -0
  100. package/nationalarchives/components/picture/picture.js +1 -1
  101. package/nationalarchives/components/picture/picture.js.map +1 -1
  102. package/nationalarchives/components/picture/picture.mjs +2 -1
  103. package/nationalarchives/components/picture/picture.scss +65 -0
  104. package/nationalarchives/components/profile/_index.scss +1 -2
  105. package/nationalarchives/components/profile/profile.css +1 -0
  106. package/nationalarchives/components/profile/profile.css.map +1 -0
  107. package/nationalarchives/components/profile/profile.scss +5 -0
  108. package/nationalarchives/components/sensitive-image/_index.scss +1 -77
  109. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -0
  110. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -0
  111. package/nationalarchives/components/sensitive-image/sensitive-image.js +1 -1
  112. package/nationalarchives/components/sensitive-image/sensitive-image.js.map +1 -1
  113. package/nationalarchives/components/sensitive-image/sensitive-image.scss +78 -0
  114. package/nationalarchives/components/skip-link/_index.scss +1 -63
  115. package/nationalarchives/components/skip-link/skip-link.css +1 -0
  116. package/nationalarchives/components/skip-link/skip-link.css.map +1 -0
  117. package/nationalarchives/components/skip-link/skip-link.scss +61 -0
  118. package/nationalarchives/components/tabs/_index.scss +1 -144
  119. package/nationalarchives/components/tabs/tabs.css +1 -0
  120. package/nationalarchives/components/tabs/tabs.css.map +1 -0
  121. package/nationalarchives/components/tabs/tabs.js +1 -1
  122. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  123. package/nationalarchives/components/tabs/tabs.mjs +2 -0
  124. package/nationalarchives/components/tabs/tabs.scss +143 -0
  125. package/nationalarchives/components/tabs/tabs.stories.js +0 -1
  126. package/nationalarchives/lib/_font-awesome.scss +5 -0
  127. package/nationalarchives/lib/_index.scss +1 -0
  128. package/nationalarchives/lib/cookies.mjs +110 -0
  129. package/nationalarchives/lib/font-awesome/brands.css +5 -0
  130. package/nationalarchives/lib/font-awesome/brands.css.map +1 -0
  131. package/nationalarchives/lib/font-awesome/fontawesome.css +5 -0
  132. package/nationalarchives/lib/font-awesome/fontawesome.css.map +1 -0
  133. package/nationalarchives/lib/font-awesome/regular.css +5 -0
  134. package/nationalarchives/lib/font-awesome/regular.css.map +1 -0
  135. package/nationalarchives/lib/font-awesome/solid.css +5 -0
  136. package/nationalarchives/lib/font-awesome/solid.css.map +1 -0
  137. package/nationalarchives/lib/font-awesome/v4-shims.css +5 -0
  138. package/nationalarchives/lib/font-awesome/v4-shims.css.map +1 -0
  139. package/nationalarchives/stories/development/about.mdx +60 -0
  140. package/nationalarchives/stories/development/contributing.mdx +8 -5
  141. package/nationalarchives/stories/development/relationships.mdx +57 -0
  142. package/nationalarchives/stories/development/using.mdx +75 -0
  143. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +176 -50
  144. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +3 -3
  145. package/nationalarchives/stories/utilities/typography/typography.stories.js +1 -1
  146. package/nationalarchives/templates/layouts/_generic.njk +7 -2
  147. package/nationalarchives/tools/_colour.scss +55 -17
  148. package/nationalarchives/tools/_index.scss +5 -4
  149. package/nationalarchives/tools/_spacing.scss +22 -0
  150. package/nationalarchives/tools/_typography.scss +0 -4
  151. package/nationalarchives/utilities/_a11y.scss +24 -0
  152. package/nationalarchives/utilities/_global.scss +3 -29
  153. package/nationalarchives/utilities/_index.scss +5 -5
  154. package/nationalarchives/utilities/_overrides.scss +5 -15
  155. package/nationalarchives/utilities/_typography.scss +68 -57
  156. package/nationalarchives/variables/_colour.scss +17 -9
  157. package/nationalarchives/variables/_grid.scss +1 -1
  158. package/nationalarchives/variables/_spacing.scss +12 -12
  159. package/nationalarchives/variables/_typography.scss +7 -7
  160. package/package.json +5 -2
  161. package/nationalarchives/assets/images/footer/facebook.svg +0 -11
  162. package/nationalarchives/assets/images/footer/flickr.svg +0 -11
  163. package/nationalarchives/assets/images/footer/instagram.svg +0 -17
  164. package/nationalarchives/assets/images/footer/rss.svg +0 -13
  165. package/nationalarchives/assets/images/footer/twitter.svg +0 -14
  166. package/nationalarchives/assets/images/footer/youtube.svg +0 -12
  167. package/nationalarchives/stories/development/dependencies.mdx +0 -11
  168. package/nationalarchives/stories/development/relationships.md +0 -91
  169. package/nationalarchives/stories/development/technologies.mdx +0 -65
  170. package/nationalarchives/utilities/_font-awesome.scss +0 -5
@@ -0,0 +1,171 @@
1
+ @use "sass:math";
2
+ @use "../../tools/colour";
3
+ @use "../../tools/typography";
4
+ @use "../../tools/media";
5
+ @use "../../tools/spacing";
6
+ @use "../../utilities";
7
+ @use "../button";
8
+
9
+ .tna-card {
10
+ @include spacing.space-below;
11
+
12
+ &__inner {
13
+ display: flex;
14
+ flex-direction: column;
15
+ }
16
+
17
+ &__heading {
18
+ order: 2;
19
+ }
20
+
21
+ &__heading-link {
22
+ &::after {
23
+ display: none !important;
24
+ }
25
+ }
26
+
27
+ &__image-container {
28
+ height: 0;
29
+ margin-bottom: 1rem;
30
+ // padding-bottom: #{math.div(9, 16) * 100%};
31
+ padding-bottom: #{math.div(2, 3) * 100%};
32
+
33
+ position: relative;
34
+ order: 1;
35
+ }
36
+
37
+ &__image {
38
+ position: absolute;
39
+ inset: 0;
40
+
41
+ img {
42
+ width: 100%;
43
+ height: 100%;
44
+
45
+ object-fit: cover;
46
+ }
47
+ }
48
+
49
+ &__image-label {
50
+ max-width: calc(100% - 1rem);
51
+
52
+ position: absolute;
53
+ top: 0.5rem;
54
+ left: 0.5rem;
55
+ }
56
+
57
+ &__body {
58
+ order: 3;
59
+ }
60
+
61
+ &__actions {
62
+ margin-top: 2rem;
63
+
64
+ order: 4;
65
+ }
66
+
67
+ &__action {
68
+ @include typography.main-font-weight-bold;
69
+
70
+ .fa,
71
+ .fa-regular,
72
+ .fa-solid,
73
+ .fa-brands {
74
+ margin-right: 0.5rem;
75
+ }
76
+ }
77
+
78
+ &--contrast,
79
+ &--accent {
80
+ .tna-card__inner {
81
+ padding-bottom: 1rem;
82
+ }
83
+
84
+ .tna-card__heading,
85
+ .tna-card__body,
86
+ .tna-card__actions {
87
+ margin-right: 1rem;
88
+ margin-left: 1rem;
89
+ }
90
+ }
91
+
92
+ &--contrast {
93
+ @include colour.invert;
94
+ }
95
+
96
+ &--accent {
97
+ @include colour.accent;
98
+
99
+ .tna-hgroup__supertitle {
100
+ @include colour.invert;
101
+ }
102
+ }
103
+
104
+ &--horizontal {
105
+ position: relative;
106
+
107
+ @include media.on-larger-than-mobile {
108
+ .tna-card__inner {
109
+ margin-left: 50%;
110
+ padding: 2rem;
111
+ }
112
+
113
+ .tna-card__image-container {
114
+ height: auto;
115
+ margin-bottom: 0;
116
+ padding-bottom: 0;
117
+
118
+ display: block;
119
+
120
+ position: absolute;
121
+ inset: 0 50% 0 0;
122
+ }
123
+
124
+ .tna-card__heading,
125
+ .tna-card__body,
126
+ .tna-card__actions {
127
+ margin-right: 0;
128
+ margin-left: 0;
129
+ }
130
+ }
131
+ }
132
+
133
+ &--horizontal#{&}--contrast,
134
+ &--horizontal#{&}--accent {
135
+ @include media.on-mobile {
136
+ .tna-card__inner {
137
+ padding: 0 0 2rem;
138
+ }
139
+
140
+ .tna-card__image-container {
141
+ margin-bottom: 2rem;
142
+ }
143
+
144
+ .tna-card__heading,
145
+ .tna-card__body,
146
+ .tna-card__actions {
147
+ margin-right: 2rem;
148
+ margin-left: 2rem;
149
+ }
150
+ }
151
+ }
152
+
153
+ &:not(#{&}--horizontal) {
154
+ @include colour.on-high-contrast {
155
+ .tna-card__inner {
156
+ padding-bottom: 1rem;
157
+ }
158
+
159
+ .tna-card__heading,
160
+ .tna-card__body,
161
+ .tna-card__actions {
162
+ margin-right: 1rem;
163
+ margin-left: 1rem;
164
+ }
165
+ }
166
+ }
167
+
168
+ @include colour.on-high-contrast {
169
+ @include colour.colour-border("keyline-dark", 1px);
170
+ }
171
+ }
@@ -2,24 +2,33 @@ import Card from "./template.njk";
2
2
  import macroOptions from "./macro-options.json";
3
3
 
4
4
  const argTypes = {
5
- heading: { control: "object" },
5
+ title: { control: "text" },
6
+ supertitle: { control: "text" },
7
+ headingLevel: { control: { type: "number", min: 1, max: 6 } },
8
+ headingSize: { control: "inline-radio", options: ["m", "l"] },
6
9
  href: { control: "text" },
7
- image: { control: "object" },
10
+ imageSrc: { control: { type: "file", accept: ".jpg" } },
11
+ imageAlt: { control: "text" },
12
+ imageWidth: { control: { type: "number", min: 1 } },
13
+ imageHeight: { control: { type: "number", min: 1 } },
14
+ imageSources: { control: "object" },
8
15
  label: { control: "text" },
9
16
  body: { control: "text" },
10
17
  text: { control: "text" },
11
18
  actions: { control: "object" },
12
19
  horizontal: { control: "boolean" },
13
- style: { control: "text" },
20
+ style: { control: "inline-radio", options: ["none", "boxed", "accent"] },
14
21
  htmlElement: { control: "text" },
15
22
  classes: { control: "text" },
16
23
  attributes: { control: "object" },
17
24
  };
18
25
 
19
26
  Object.keys(argTypes).forEach((argType) => {
20
- argTypes[argType].description = macroOptions.find(
21
- (option) => option.name === argType,
22
- )?.description;
27
+ const macroOption = macroOptions.find((option) => option.name === argType);
28
+ argTypes[argType] = {
29
+ ...argTypes[argType],
30
+ description: macroOption?.description,
31
+ };
23
32
  });
24
33
 
25
34
  export default {
@@ -28,9 +37,16 @@ export default {
28
37
  };
29
38
 
30
39
  const Template = ({
31
- heading,
40
+ title,
41
+ supertitle,
42
+ headingLevel,
43
+ headingSize,
32
44
  href,
33
- image,
45
+ imageSrc,
46
+ imageAlt,
47
+ imageWidth,
48
+ imageHeight,
49
+ imageSources,
34
50
  label,
35
51
  body,
36
52
  text,
@@ -43,9 +59,16 @@ const Template = ({
43
59
  }) =>
44
60
  Card({
45
61
  params: {
46
- heading,
62
+ title,
63
+ supertitle,
64
+ headingLevel,
65
+ headingSize,
47
66
  href,
48
- image,
67
+ imageSrc,
68
+ imageAlt,
69
+ imageWidth,
70
+ imageHeight,
71
+ imageSources,
49
72
  label,
50
73
  body,
51
74
  text,
@@ -60,72 +83,53 @@ const Template = ({
60
83
 
61
84
  export const Standard = Template.bind({});
62
85
  Standard.args = {
63
- heading: {
64
- supertitle: "Card supertitle",
65
- title: "Card title",
66
- level: 3,
67
- size: "l",
68
- singleSentence: false,
69
- },
86
+ supertitle: "Card supertitle",
87
+ title: "Card title",
88
+ headingLevel: 3,
89
+ headingSize: "m",
70
90
  href: "#",
71
- image: {
72
- src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
73
- alt: "The National Archives office",
74
- width: 1996,
75
- height: 1331,
76
- },
91
+ imageSrc:
92
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
93
+ imageAlt: "The National Archives office",
94
+ imageWidth: 1996,
95
+ imageHeight: 1331,
77
96
  label: "New",
78
97
  body: "<p>Card body</p>",
79
- // actions: [
80
- // {
81
- // text: "Card action",
82
- // href: "#",
83
- // title: "Go and do the action",
84
- // },
85
- // ],
86
98
  htmlElement: "article",
87
99
  classes: "tna-card--demo",
88
100
  };
89
101
 
90
102
  export const Boxed = Template.bind({});
91
103
  Boxed.args = {
92
- heading: {
93
- supertitle: "Card supertitle",
94
- title: "Card title",
95
- level: 3,
96
- size: "l",
97
- singleSentence: false,
98
- },
104
+ supertitle: "Card supertitle",
105
+ title: "Card title",
106
+ headingLevel: 3,
107
+ headingSize: "m",
99
108
  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
- },
109
+ imageSrc:
110
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
111
+ imageAlt: "The National Archives office",
112
+ imageWidth: 1996,
113
+ imageHeight: 1331,
106
114
  label: "New",
107
115
  body: "<p>Card body</p>",
108
- style: "contrast",
116
+ style: "boxed",
109
117
  htmlElement: "article",
110
118
  classes: "tna-card--demo",
111
119
  };
112
120
 
113
121
  export const Accent = Template.bind({});
114
122
  Accent.args = {
115
- heading: {
116
- supertitle: "Card supertitle",
117
- title: "Card title",
118
- level: 3,
119
- size: "l",
120
- singleSentence: false,
121
- },
123
+ supertitle: "Card supertitle",
124
+ title: "Card title",
125
+ headingLevel: 3,
126
+ headingSize: "m",
122
127
  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
- },
128
+ imageSrc:
129
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
130
+ imageAlt: "The National Archives office",
131
+ imageWidth: 1996,
132
+ imageHeight: 1331,
129
133
  label: "New",
130
134
  body: "<p>Card body</p>",
131
135
  style: "accent",
@@ -135,20 +139,41 @@ Accent.args = {
135
139
 
136
140
  export const Horizontal = Template.bind({});
137
141
  Horizontal.args = {
138
- heading: {
139
- supertitle: "Card supertitle",
140
- title: "Card title",
141
- level: 3,
142
- size: "l",
143
- singleSentence: false,
144
- },
145
- href: "#",
146
- image: {
147
- src: "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
148
- alt: "The National Archives office",
149
- width: 1996,
150
- height: 1331,
151
- },
142
+ supertitle: "Card supertitle",
143
+ title: "Card title",
144
+ headingLevel: 3,
145
+ headingSize: "l",
146
+ imageSrc:
147
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
148
+ imageAlt: "The National Archives office",
149
+ imageWidth: 1996,
150
+ imageHeight: 1331,
151
+ label: "New",
152
+ body: "<p>Card body</p>",
153
+ actions: [
154
+ {
155
+ text: "Card action",
156
+ href: "#",
157
+ title: "Go and do the action",
158
+ icon: "calendar",
159
+ },
160
+ ],
161
+ horizontal: true,
162
+ htmlElement: "article",
163
+ classes: "tna-card--demo",
164
+ };
165
+
166
+ export const HorizontalBoxed = Template.bind({});
167
+ HorizontalBoxed.args = {
168
+ supertitle: "Card supertitle",
169
+ title: "Card title",
170
+ headingLevel: 3,
171
+ headingSize: "l",
172
+ imageSrc:
173
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
174
+ imageAlt: "The National Archives office",
175
+ imageWidth: 1996,
176
+ imageHeight: 1331,
152
177
  label: "New",
153
178
  body: "<p>Card body</p>",
154
179
  actions: [
@@ -156,17 +181,85 @@ Horizontal.args = {
156
181
  text: "Card action",
157
182
  href: "#",
158
183
  title: "Go and do the action",
184
+ icon: "calendar",
159
185
  },
160
186
  ],
161
187
  horizontal: true,
188
+ style: "boxed",
189
+ htmlElement: "article",
190
+ classes: "tna-card--demo",
191
+ };
192
+
193
+ export const HorizontalAccent = Template.bind({});
194
+ HorizontalAccent.args = {
195
+ supertitle: "Card supertitle",
196
+ title: "Card title",
197
+ headingLevel: 3,
198
+ headingSize: "l",
199
+ imageSrc:
200
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
201
+ imageAlt: "The National Archives office",
202
+ imageWidth: 1996,
203
+ imageHeight: 1331,
204
+ label: "New",
205
+ body: "<p>Card body</p>",
206
+ actions: [
207
+ {
208
+ text: "Card action",
209
+ href: "#",
210
+ title: "Go and do the action",
211
+ icon: "calendar",
212
+ },
213
+ ],
214
+ horizontal: true,
215
+ style: "accent",
216
+ htmlElement: "article",
217
+ classes: "tna-card--demo",
218
+ };
219
+
220
+ export const Sources = Template.bind({});
221
+ Sources.args = {
222
+ supertitle: "Card supertitle",
223
+ title: "Card title",
224
+ headingLevel: 3,
225
+ headingSize: "m",
226
+ imageSrc: "https://www.gstatic.com/webp/gallery/2.jpg",
227
+ imageAlt: "A man in a canoe paddling through white water",
228
+ imageWidth: 550,
229
+ imageHeight: 404,
230
+ imageSources: [
231
+ {
232
+ imageSrc: "https://www.gstatic.com/webp/gallery/2.webp",
233
+ type: "image/webp",
234
+ },
235
+ ],
236
+ body: "<p>Card body</p>",
237
+ htmlElement: "article",
238
+ classes: "tna-card--demo",
239
+ };
240
+
241
+ export const WithoutImage = Template.bind({});
242
+ WithoutImage.args = {
243
+ supertitle: "Card supertitle",
244
+ title: "Card title",
245
+ headingLevel: 3,
246
+ headingSize: "m",
247
+ body: "<p>Card body</p>",
162
248
  htmlElement: "article",
163
249
  classes: "tna-card--demo",
164
250
  };
165
251
 
166
252
  const GridTemplate = ({
167
- heading,
253
+ title,
254
+ supertitle,
255
+ headingLevel,
256
+ headingSize,
168
257
  href,
169
- image,
258
+ imageSrc,
259
+ imageAlt,
260
+ imageWidth,
261
+ imageHeight,
262
+ imageSources,
170
263
  label,
171
264
  body,
172
265
  text,
@@ -179,12 +272,19 @@ const GridTemplate = ({
179
272
  `<div class="tna-container">
180
273
  ${Array(12)
181
274
  .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">
275
+ `<div class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny tna-!--margin-bottom-m">
183
276
  ${Card({
184
277
  params: {
185
- heading,
278
+ title,
279
+ supertitle,
280
+ headingLevel,
281
+ headingSize,
186
282
  href,
187
- image,
283
+ imageSrc,
284
+ imageAlt,
285
+ imageWidth,
286
+ imageHeight,
287
+ imageSources,
188
288
  label,
189
289
  body,
190
290
  text,
@@ -202,28 +302,18 @@ const GridTemplate = ({
202
302
 
203
303
  export const Grid = GridTemplate.bind({});
204
304
  Grid.args = {
205
- heading: {
206
- supertitle: "Card supertitle",
207
- title: "Card title",
208
- level: 3,
209
- singleSentence: false,
210
- },
305
+ supertitle: "Card supertitle",
306
+ title: "Card title",
307
+ headingLevel: 3,
308
+ headingSize: "m",
211
309
  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
- },
310
+ imageSrc:
311
+ "https://www.nationalarchives.gov.uk/wp-content/uploads/sites/24/2023/07/tna-building-compress.jpg",
312
+ imageAlt: "The National Archives office",
313
+ imageWidth: 1996,
314
+ imageHeight: 1331,
218
315
  label: "New",
219
316
  body: "<p>Card body</p>",
220
- // actions: [
221
- // {
222
- // text: "Card action",
223
- // href: "#",
224
- // title: "Go and do the action",
225
- // },
226
- // ],
227
317
  htmlElement: "article",
228
318
  classes: "tna-card--demo",
229
319
  };