@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.
Files changed (115) hide show
  1. package/LICENCE +21 -0
  2. package/nationalarchives/all.css +13 -1
  3. package/nationalarchives/all.css.map +1 -1
  4. package/nationalarchives/all.js +1 -1
  5. package/nationalarchives/all.js.map +1 -1
  6. package/nationalarchives/all.scss +2 -3
  7. package/nationalarchives/assets/fonts/fa-brands-400.ttf +0 -0
  8. package/nationalarchives/assets/fonts/fa-brands-400.woff2 +0 -0
  9. package/nationalarchives/assets/fonts/fa-regular-400.ttf +0 -0
  10. package/nationalarchives/assets/fonts/fa-regular-400.woff2 +0 -0
  11. package/nationalarchives/assets/fonts/fa-solid-900.ttf +0 -0
  12. package/nationalarchives/assets/fonts/fa-solid-900.woff2 +0 -0
  13. package/nationalarchives/components/_index.scss +1 -0
  14. package/nationalarchives/components/breadcrumbs/_index.scss +13 -41
  15. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  17. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +8 -4
  18. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +9 -30
  19. package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
  20. package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
  21. package/nationalarchives/components/breadcrumbs/template.njk +17 -12
  22. package/nationalarchives/components/button/_button-group.scss +18 -0
  23. package/nationalarchives/components/button/_index.scss +25 -9
  24. package/nationalarchives/components/button/button.stories.js +64 -8
  25. package/nationalarchives/components/button/fixtures.json +3 -3
  26. package/nationalarchives/components/button/macro-options.json +13 -1
  27. package/nationalarchives/components/button/template.njk +7 -2
  28. package/nationalarchives/components/card/_index.scss +67 -51
  29. package/nationalarchives/components/card/card.stories.js +123 -10
  30. package/nationalarchives/components/card/fixtures.json +62 -10
  31. package/nationalarchives/components/card/macro-options.json +9 -3
  32. package/nationalarchives/components/card/template.njk +12 -8
  33. package/nationalarchives/components/filters/_index.scss +19 -14
  34. package/nationalarchives/components/filters/filters.stories.js +3 -4
  35. package/nationalarchives/components/footer/_index.scss +195 -72
  36. package/nationalarchives/components/footer/fixtures.json +1 -1
  37. package/nationalarchives/components/footer/footer.stories.js +82 -74
  38. package/nationalarchives/components/footer/macro-options.json +34 -8
  39. package/nationalarchives/components/footer/template.njk +110 -53
  40. package/nationalarchives/components/grid/_index.scss +2 -2
  41. package/nationalarchives/components/grid/grid.stories.js +2 -3
  42. package/nationalarchives/components/header/_index.scss +57 -23
  43. package/nationalarchives/components/header/header.stories.js +2 -3
  44. package/nationalarchives/components/hero/_index.scss +4 -8
  45. package/nationalarchives/components/hero/hero.stories.js +2 -3
  46. package/nationalarchives/components/index-grid/_index.scss +28 -7
  47. package/nationalarchives/components/index-grid/index-grid.stories.js +27 -4
  48. package/nationalarchives/components/index-grid/macro-options.json +12 -0
  49. package/nationalarchives/components/index-grid/template.njk +9 -11
  50. package/nationalarchives/components/message/_index.scss +12 -6
  51. package/nationalarchives/components/message/phase-banner.stories.js +2 -3
  52. package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
  53. package/nationalarchives/components/picture/_index.scss +5 -5
  54. package/nationalarchives/components/picture/picture.js +1 -1
  55. package/nationalarchives/components/picture/picture.js.map +1 -1
  56. package/nationalarchives/components/picture/picture.mjs +2 -0
  57. package/nationalarchives/components/picture/picture.stories.js +2 -3
  58. package/nationalarchives/components/profile/profile.stories.js +2 -3
  59. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
  60. package/nationalarchives/components/skip-link/_index.scss +63 -0
  61. package/nationalarchives/components/skip-link/fixtures.json +11 -0
  62. package/nationalarchives/{patterns/featured-collection → components/skip-link}/macro-options.json +10 -4
  63. package/nationalarchives/components/skip-link/macro.njk +3 -0
  64. package/nationalarchives/{patterns/featured-collection/featured-collection.stories.js → components/skip-link/skip-link.stories.js} +7 -10
  65. package/nationalarchives/components/skip-link/template.njk +4 -0
  66. package/nationalarchives/components/tabs/_index.scss +7 -5
  67. package/nationalarchives/components/tabs/tabs.stories.js +8 -9
  68. package/nationalarchives/lib/font-awesome/_animated.scss +276 -0
  69. package/nationalarchives/lib/font-awesome/_bordered-pulled.scss +20 -0
  70. package/nationalarchives/lib/font-awesome/_core.scss +42 -0
  71. package/nationalarchives/lib/font-awesome/_fixed-width.scss +7 -0
  72. package/nationalarchives/lib/font-awesome/_functions.scss +57 -0
  73. package/nationalarchives/lib/font-awesome/_icons.scss +11 -0
  74. package/nationalarchives/lib/font-awesome/_list.scss +20 -0
  75. package/nationalarchives/lib/font-awesome/_mixins.scss +74 -0
  76. package/nationalarchives/lib/font-awesome/_rotated-flipped.scss +31 -0
  77. package/nationalarchives/lib/font-awesome/_screen-reader.scss +14 -0
  78. package/nationalarchives/lib/font-awesome/_shims.scss +2653 -0
  79. package/nationalarchives/lib/font-awesome/_sizing.scss +16 -0
  80. package/nationalarchives/lib/font-awesome/_stacked.scss +32 -0
  81. package/nationalarchives/lib/font-awesome/_variables.scss +4976 -0
  82. package/nationalarchives/lib/font-awesome/brands.scss +34 -0
  83. package/nationalarchives/lib/font-awesome/fontawesome.scss +21 -0
  84. package/nationalarchives/lib/font-awesome/regular.scss +28 -0
  85. package/nationalarchives/lib/font-awesome/solid.scss +28 -0
  86. package/nationalarchives/lib/font-awesome/v4-shims.scss +11 -0
  87. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +22 -0
  88. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +494 -91
  89. package/nationalarchives/stories/utilities/overrides/overrides.mdx +37 -57
  90. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +8 -14
  91. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +1 -1
  92. package/nationalarchives/stories/utilities/typography/typography.mdx +2 -0
  93. package/nationalarchives/stories/utilities/typography/typography.stories.js +20 -1
  94. package/nationalarchives/templates/layouts/_generic.njk +10 -8
  95. package/nationalarchives/tools/_colour.scss +163 -49
  96. package/nationalarchives/tools/_index.scss +0 -1
  97. package/nationalarchives/tools/_typography.scss +13 -0
  98. package/nationalarchives/utilities/_debug.scss +41 -1
  99. package/nationalarchives/utilities/_font-awesome.scss +5 -0
  100. package/nationalarchives/utilities/_global.scss +75 -26
  101. package/nationalarchives/utilities/_index.scss +1 -0
  102. package/nationalarchives/utilities/_overrides.scss +54 -9
  103. package/nationalarchives/utilities/_typography.scss +203 -65
  104. package/nationalarchives/variables/_assets.scss +1 -1
  105. package/nationalarchives/variables/_colour.scss +93 -93
  106. package/nationalarchives/variables/_grid.scss +1 -1
  107. package/nationalarchives/variables/_media.scss +23 -23
  108. package/nationalarchives/variables/_spacing.scss +12 -2
  109. package/nationalarchives/variables/_typography.scss +4 -1
  110. package/package.json +14 -14
  111. package/nationalarchives/patterns/_index.scss +0 -1
  112. package/nationalarchives/patterns/featured-collection/_index.scss +0 -13
  113. package/nationalarchives/patterns/featured-collection/macro.njk +0 -3
  114. package/nationalarchives/patterns/featured-collection/template.njk +0 -96
  115. package/nationalarchives/tools/_assets.scss +0 -5
@@ -25,6 +25,12 @@
25
25
  }
26
26
  ]
27
27
  },
28
+ {
29
+ "name": "noCollapse",
30
+ "type": "string",
31
+ "required": false,
32
+ "description": ""
33
+ },
28
34
  {
29
35
  "name": "classes",
30
36
  "type": "string",
@@ -1,14 +1,19 @@
1
1
  {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
- <div class="tna-breadcrumbs tna-container {{ containerClasses | join(' ') }}" data-module="tna-breadcrumbs" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
3
- <nav class="tna-breadcrumbs__wrapper tna-column tna-column--full" aria-label="Breadcrumb">
4
- <ol class="tna-breadcrumbs__list tna-breadcrumbs__list--collapse-on-mobile">
5
- {%- for item in params.items -%}
6
- <li class="tna-breadcrumbs__item">
7
- <a href="{{ item.href }}" class="tna-breadcrumbs__link" data-prefix="{{ params.prefix if params.prefix else 'Back to' }}" {%- if item.title %} title="{{ item.title }}"{% endif %}>
8
- {{ item.text }}
9
- </a>
10
- </li>
11
- {%- endfor -%}
12
- </ol>
13
- </nav>
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: 0.25rem transparent solid;
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
- @include colour.colour-background("button-primary-hover-background");
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
- &--secondary {
41
- @include colour.colour-background("button-secondary-background");
43
+ &--accent {
44
+ @include colour.colour-background("button-accent-background");
42
45
 
43
- @include colour.colour-border("button-secondary-background");
46
+ @include colour.colour-border("button-accent-background");
44
47
 
45
48
  &,
46
49
  &:link,
47
50
  &:visited {
48
- @include colour.colour-font("button-secondary-text");
51
+ @include colour.colour-font("button-accent-text");
49
52
  }
50
53
 
51
54
  &:hover {
52
- @include colour.colour-font("button-secondary-hover-text");
55
+ @include colour.colour-font("font-dark");
56
+ }
57
+ }
53
58
 
54
- @include colour.colour-background("button-secondary-hover-background");
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
- secondary: { control: "boolean" },
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 = ({ text, href, title, secondary, classes, attributes }) => {
25
- return Button({
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
- secondary,
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 Secondary = Template.bind({});
45
- Secondary.args = {
56
+ export const Accent = Template.bind({});
57
+ Accent.args = {
46
58
  text: "Button",
47
59
  href: "#",
48
- secondary: true,
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": "secondary",
24
+ "name": "accent",
25
25
  "options": {
26
26
  "text": "Log in",
27
27
  "href": "#",
28
- "secondary": true
28
+ "accent": true
29
29
  },
30
- "html": "<a href=\"#\" class=\"tna-button tna-button--secondary\" role=\"button\">Log in</a>",
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": "secondary",
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.secondary -%}
3
- {%- set buttonClasses = buttonClasses.concat('tna-button--secondary') -%}
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% - 2rem);
55
- padding: 0.25rem 0.5rem;
59
+ max-width: calc(100% - 1rem);
56
60
 
57
61
  position: absolute;
58
- top: 1rem;
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
- &--featured {
93
- @include colour.fixed;
94
-
95
- position: relative;
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-card__supertitle {
109
- color: inherit;
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
- .tna-card__title {
113
- @include typography.heading-font;
114
- }
93
+ &--contrast {
94
+ @include colour.invert;
95
+ }
115
96
 
116
- .tna-card__title-link {
117
- @include colour.colour-font("font-dark");
118
- }
97
+ &--accent {
98
+ @include colour.accent;
99
+ }
119
100
 
120
- .tna-card__image-container {
121
- margin-bottom: 2rem;
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: 1px transparent solid;
158
- @include colour.colour-border("keyline-dark");
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: 2rem;
164
- margin-left: 2rem;
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
- featured: { control: "boolean" },
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
- featured,
38
+ horizontal,
39
+ style,
38
40
  htmlElement,
39
41
  classes,
40
42
  attributes,
41
- }) => {
42
- return Card({
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
- featured,
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: "m",
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 Featured = Template.bind({});
89
- Featured.args = {
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
- featured: true,
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
  };