@nationalarchives/frontend 0.1.16-prerelease → 0.1.18-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 (88) hide show
  1. package/nationalarchives/all.css +13 -1
  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.scss +2 -3
  6. package/nationalarchives/assets/fonts/fa-brands-400.ttf +0 -0
  7. package/nationalarchives/assets/fonts/fa-brands-400.woff2 +0 -0
  8. package/nationalarchives/assets/fonts/fa-regular-400.ttf +0 -0
  9. package/nationalarchives/assets/fonts/fa-regular-400.woff2 +0 -0
  10. package/nationalarchives/assets/fonts/fa-solid-900.ttf +0 -0
  11. package/nationalarchives/assets/fonts/fa-solid-900.woff2 +0 -0
  12. package/nationalarchives/components/breadcrumbs/_index.scss +2 -2
  13. package/nationalarchives/components/button/_button-group.scss +18 -0
  14. package/nationalarchives/components/button/_index.scss +24 -7
  15. package/nationalarchives/components/button/button.stories.js +63 -6
  16. package/nationalarchives/components/button/fixtures.json +3 -3
  17. package/nationalarchives/components/button/macro-options.json +13 -1
  18. package/nationalarchives/components/button/template.njk +7 -2
  19. package/nationalarchives/components/card/_index.scss +62 -47
  20. package/nationalarchives/components/card/card.stories.js +59 -8
  21. package/nationalarchives/components/card/fixtures.json +59 -20
  22. package/nationalarchives/components/card/macro-options.json +14 -2
  23. package/nationalarchives/components/card/template.njk +12 -8
  24. package/nationalarchives/components/filters/_index.scss +19 -14
  25. package/nationalarchives/components/footer/_index.scss +194 -60
  26. package/nationalarchives/components/footer/fixtures.json +1 -1
  27. package/nationalarchives/components/footer/footer.stories.js +80 -71
  28. package/nationalarchives/components/footer/macro-options.json +34 -8
  29. package/nationalarchives/components/footer/template.njk +110 -53
  30. package/nationalarchives/components/header/_index.scss +40 -4
  31. package/nationalarchives/components/hero/_index.scss +1 -1
  32. package/nationalarchives/components/index-grid/_index.scss +27 -5
  33. package/nationalarchives/components/index-grid/index-grid.stories.js +25 -1
  34. package/nationalarchives/components/index-grid/macro-options.json +12 -0
  35. package/nationalarchives/components/index-grid/template.njk +9 -11
  36. package/nationalarchives/components/message/_index.scss +8 -0
  37. package/nationalarchives/components/picture/_index.scss +2 -0
  38. package/nationalarchives/components/picture/picture.js +1 -1
  39. package/nationalarchives/components/picture/picture.js.map +1 -1
  40. package/nationalarchives/components/picture/picture.mjs +2 -0
  41. package/nationalarchives/components/skip-link/skip-link.stories.js +3 -2
  42. package/nationalarchives/components/tabs/_index.scss +6 -3
  43. package/nationalarchives/components/tabs/tabs.stories.js +6 -6
  44. package/nationalarchives/lib/font-awesome/_animated.scss +276 -0
  45. package/nationalarchives/lib/font-awesome/_bordered-pulled.scss +20 -0
  46. package/nationalarchives/lib/font-awesome/_core.scss +42 -0
  47. package/nationalarchives/lib/font-awesome/_fixed-width.scss +7 -0
  48. package/nationalarchives/lib/font-awesome/_functions.scss +57 -0
  49. package/nationalarchives/lib/font-awesome/_icons.scss +11 -0
  50. package/nationalarchives/lib/font-awesome/_list.scss +20 -0
  51. package/nationalarchives/lib/font-awesome/_mixins.scss +74 -0
  52. package/nationalarchives/lib/font-awesome/_rotated-flipped.scss +31 -0
  53. package/nationalarchives/lib/font-awesome/_screen-reader.scss +14 -0
  54. package/nationalarchives/lib/font-awesome/_shims.scss +2653 -0
  55. package/nationalarchives/lib/font-awesome/_sizing.scss +16 -0
  56. package/nationalarchives/lib/font-awesome/_stacked.scss +32 -0
  57. package/nationalarchives/lib/font-awesome/_variables.scss +4976 -0
  58. package/nationalarchives/lib/font-awesome/brands.scss +34 -0
  59. package/nationalarchives/lib/font-awesome/fontawesome.scss +21 -0
  60. package/nationalarchives/lib/font-awesome/regular.scss +28 -0
  61. package/nationalarchives/lib/font-awesome/solid.scss +28 -0
  62. package/nationalarchives/lib/font-awesome/v4-shims.scss +11 -0
  63. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +22 -0
  64. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +483 -97
  65. package/nationalarchives/stories/utilities/overrides/overrides.mdx +37 -57
  66. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +1 -1
  67. package/nationalarchives/stories/utilities/typography/typography.mdx +2 -0
  68. package/nationalarchives/stories/utilities/typography/typography.stories.js +20 -1
  69. package/nationalarchives/templates/layouts/_generic.njk +1 -1
  70. package/nationalarchives/tools/_colour.scss +86 -41
  71. package/nationalarchives/tools/_typography.scss +13 -0
  72. package/nationalarchives/utilities/_font-awesome.scss +5 -0
  73. package/nationalarchives/utilities/_global.scss +70 -26
  74. package/nationalarchives/utilities/_index.scss +1 -0
  75. package/nationalarchives/utilities/_overrides.scss +42 -10
  76. package/nationalarchives/utilities/_typography.scss +198 -59
  77. package/nationalarchives/variables/_assets.scss +1 -0
  78. package/nationalarchives/variables/_colour.scss +29 -23
  79. package/nationalarchives/variables/_index.scss +1 -0
  80. package/nationalarchives/variables/_spacing.scss +3 -1
  81. package/nationalarchives/variables/_typography.scss +4 -1
  82. package/package.json +13 -13
  83. package/nationalarchives/patterns/_index.scss +0 -1
  84. package/nationalarchives/patterns/featured-collection/_index.scss +0 -13
  85. package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +0 -34
  86. package/nationalarchives/patterns/featured-collection/macro-options.json +0 -20
  87. package/nationalarchives/patterns/featured-collection/macro.njk +0 -3
  88. package/nationalarchives/patterns/featured-collection/template.njk +0 -96
@@ -25,11 +25,14 @@
25
25
  &__title {
26
26
  order: 2;
27
27
 
28
- @include typography.main-font;
29
- @include typography.main-font-weight-bold;
28
+ // @include typography.main-font;
29
+ // @include typography.main-font-weight-bold;
30
30
  }
31
31
 
32
32
  &__title-link {
33
+ &::after {
34
+ display: none !important;
35
+ }
33
36
  }
34
37
 
35
38
  &__image-container {
@@ -53,26 +56,11 @@
53
56
  }
54
57
 
55
58
  &__image-label {
56
- max-width: calc(100% - 2rem);
57
- padding: 0.25rem 0.5rem;
59
+ max-width: calc(100% - 1rem);
58
60
 
59
61
  position: absolute;
60
- top: 1rem;
61
- left: 0;
62
-
63
- @include colour.fixed;
64
-
65
- @include colour.colour-font("font-dark");
66
- @include typography.relative-font-size(14);
67
- @include typography.main-font-weight-bold;
68
- text-transform: uppercase;
69
- line-height: #{math.div(16, 14)};
70
-
71
- @include colour.colour-background("accent");
72
- }
73
-
74
- &--green-label #{&}__image-label {
75
- background-color: colour.brand-colour("green");
62
+ top: 0.5rem;
63
+ left: 0.5rem;
76
64
  }
77
65
 
78
66
  &__body {
@@ -88,36 +76,34 @@
88
76
  &__action {
89
77
  }
90
78
 
91
- &--featured {
92
- @include colour.fixed;
93
-
94
- position: relative;
95
-
96
- @include colour.colour-font("font-base");
97
-
98
- @include colour.colour-background("accent");
99
-
100
- .tna-card__heading {
101
- padding-bottom: 2rem;
102
-
103
- @include colour.colour-border("keyline-dark", 2px, solid, bottom);
79
+ &--contrast,
80
+ &--accent {
81
+ .tna-card__inner {
82
+ padding-bottom: 1rem;
104
83
  }
105
84
 
106
- .tna-card__supertitle {
107
- color: inherit;
85
+ .tna-card__heading,
86
+ .tna-card__body,
87
+ .tna-card__actions {
88
+ margin-right: 1rem;
89
+ margin-left: 1rem;
108
90
  }
91
+ }
109
92
 
110
- .tna-card__title {
111
- @include typography.heading-font;
112
- }
93
+ &--contrast {
94
+ @include colour.invert;
95
+ }
113
96
 
114
- .tna-card__title-link {
115
- @include colour.colour-font("font-dark");
116
- }
97
+ &--accent {
98
+ @include colour.accent;
99
+ }
117
100
 
118
- .tna-card__image-container {
119
- margin-bottom: 2rem;
120
- }
101
+ &--accent &__supertitle {
102
+ @include colour.invert;
103
+ }
104
+
105
+ &--horizontal {
106
+ position: relative;
121
107
 
122
108
  @include media.on-larger-than-mobile {
123
109
  .tna-card__inner {
@@ -135,13 +121,27 @@
135
121
  position: absolute;
136
122
  inset: 0 50% 0 0;
137
123
  }
124
+
125
+ .tna-card__heading,
126
+ .tna-card__body,
127
+ .tna-card__actions {
128
+ margin-right: 0;
129
+ margin-left: 0;
130
+ }
138
131
  }
132
+ }
139
133
 
134
+ &--horizontal#{&}--contrast,
135
+ &--horizontal#{&}--accent {
140
136
  @include media.on-mobile {
141
137
  .tna-card__inner {
142
138
  padding: 0 0 2rem;
143
139
  }
144
140
 
141
+ .tna-card__image-container {
142
+ margin-bottom: 2rem;
143
+ }
144
+
145
145
  .tna-card__heading,
146
146
  .tna-card__body,
147
147
  .tna-card__actions {
@@ -151,18 +151,33 @@
151
151
  }
152
152
  }
153
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
+
154
169
  @include colour.on-high-contrast {
155
170
  @include colour.colour-border("keyline-dark", 1px);
156
171
 
157
172
  .tna-card__inner {
158
- padding-bottom: 1rem;
173
+ // padding-bottom: 1rem;
159
174
  }
160
175
 
161
176
  .tna-card__heading,
162
177
  .tna-card__body,
163
178
  .tna-card__actions {
164
- margin-right: 2rem;
165
- margin-left: 2rem;
179
+ // margin-right: 1rem;
180
+ // margin-left: 1rem;
166
181
  }
167
182
  }
168
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,7 +35,8 @@ 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,
@@ -48,7 +50,8 @@ 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,
@@ -61,6 +64,7 @@ Standard.args = {
61
64
  supertitle: "Card supertitle",
62
65
  title: "Card title",
63
66
  level: 3,
67
+ size: "l",
64
68
  singleSentence: false,
65
69
  },
66
70
  href: "#",
@@ -83,12 +87,59 @@ Standard.args = {
83
87
  classes: "tna-card--demo",
84
88
  };
85
89
 
86
- export const Featured = Template.bind({});
87
- Featured.args = {
90
+ export const Boxed = Template.bind({});
91
+ Boxed.args = {
88
92
  heading: {
89
93
  supertitle: "Card supertitle",
90
94
  title: "Card title",
91
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 = {
138
+ heading: {
139
+ supertitle: "Card supertitle",
140
+ title: "Card title",
141
+ level: 3,
142
+ size: "l",
92
143
  singleSentence: false,
93
144
  },
94
145
  href: "#",
@@ -107,7 +158,7 @@ Featured.args = {
107
158
  title: "Go and do the action",
108
159
  },
109
160
  ],
110
- featured: true,
161
+ horizontal: true,
111
162
  htmlElement: "article",
112
163
  classes: "tna-card--demo",
113
164
  };
@@ -120,7 +171,7 @@ const GridTemplate = ({
120
171
  body,
121
172
  text,
122
173
  actions,
123
- featured,
174
+ horizontal,
124
175
  htmlElement,
125
176
  classes,
126
177
  attributes,
@@ -138,7 +189,7 @@ const GridTemplate = ({
138
189
  body,
139
190
  text,
140
191
  actions,
141
- featured,
192
+ horizontal,
142
193
  htmlElement,
143
194
  classes,
144
195
  attributes,
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "body": "<p>Card body</p>"
12
12
  },
13
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
13
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
14
14
  "hidden": false
15
15
  },
16
16
  {
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "body": "<p>Card body</p>"
25
25
  },
26
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-card__heading tna-hgroup tna-hgroup--m\"><p class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</p><h3 class=\"tna-card__title tna-hgroup__title\">Card title</h3></hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
26
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-card__heading tna-hgroup tna-hgroup--l\"><p class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</p><h3 class=\"tna-card__title tna-hgroup__title\">Card title</h3></hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
27
27
  "hidden": false
28
28
  },
29
29
  {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "body": "<p>Card body</p>"
39
39
  },
40
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-card__heading tna-hgroup tna-hgroup--m\"><h3 class=\"tna-card__title tna-hgroup__title\"><span class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</span>Card title</h3></hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
40
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><hgroup class=\"tna-card__heading tna-hgroup tna-hgroup--l\"><h3 class=\"tna-card__title tna-hgroup__title\"><span class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</span>Card title</h3></hgroup><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
41
41
  "hidden": false
42
42
  },
43
43
  {
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "body": "<p>Card body</p>"
64
64
  },
65
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h1 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h1><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
65
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h1 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h1><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
66
66
  "hidden": false
67
67
  },
68
68
  {
@@ -75,7 +75,7 @@
75
75
  "href": "#",
76
76
  "body": "<p>Card body</p>"
77
77
  },
78
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\"><a href=\"#\" class=\"tna-card__title-link\">Card title</a></h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
78
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\"><a href=\"#\" class=\"tna-card__title-link\">Card title</a></h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
79
79
  "hidden": false
80
80
  },
81
81
  {
@@ -87,7 +87,7 @@
87
87
  },
88
88
  "text": "Card body"
89
89
  },
90
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
90
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
91
91
  "hidden": false
92
92
  },
93
93
  {
@@ -105,7 +105,7 @@
105
105
  },
106
106
  "body": "<p>Card body</p>"
107
107
  },
108
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><a href=\"\" class=\"tna-card__image-container\" tabindex=\"-1\"><img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" width=\"640\" height=\"360\" class=\"tna-card__image\" /></a><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
108
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><a href=\"\" class=\"tna-card__image-container\" tabindex=\"-1\"><img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" width=\"640\" height=\"360\" class=\"tna-card__image\" /></a><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
109
109
  "hidden": false
110
110
  },
111
111
  {
@@ -124,48 +124,87 @@
124
124
  }
125
125
  ]
126
126
  },
127
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div><div class=\"tna-card__actions\"><a href=\"#\" class=\"tna-card__action tna-button\" role=\"button\"title=\"Go and do the action\">Card action</a></div></div></div>",
127
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div><div class=\"tna-card__actions\"><a href=\"#\" class=\"tna-card__action\" role=\"button\"title=\"Go and do the action\">Card action</a></div></div></div>",
128
128
  "hidden": false
129
129
  },
130
130
  {
131
- "name": "with classes",
131
+ "name": "with a label",
132
+ "options": {
133
+ "heading": {
134
+ "title": "Card title",
135
+ "level": 3
136
+ },
137
+ "label": "New",
138
+ "body": "<p>Card body</p>"
139
+ },
140
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
141
+ "hidden": false
142
+ },
143
+ {
144
+ "name": "with a boxed style",
132
145
  "options": {
133
146
  "heading": {
134
147
  "title": "Card title",
135
148
  "level": 3
136
149
  },
137
150
  "body": "<p>Card body</p>",
138
- "classes": "card__test-class"
151
+ "style": "boxed"
139
152
  },
140
- "html": "<div class=\"tna-card card__test-class\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
153
+ "html": "<div class=\"tna-card tna-card--contrast\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
141
154
  "hidden": false
142
155
  },
143
156
  {
144
- "name": "with attributes",
157
+ "name": "with a accent style",
145
158
  "options": {
146
159
  "heading": {
147
160
  "title": "Card title",
148
161
  "level": 3
149
162
  },
150
163
  "body": "<p>Card body</p>",
151
- "attributes": {
152
- "data-testattribute": "foobar"
153
- }
164
+ "style": "accent"
154
165
  },
155
- "html": "<div class=\"tna-card \" data-module=\"tna-card\" data-testattribute=\"foobar\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
166
+ "html": "<div class=\"tna-card tna-card--accent\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
156
167
  "hidden": false
157
168
  },
158
169
  {
159
- "name": "with a label",
170
+ "name": "with an unknown style",
160
171
  "options": {
161
172
  "heading": {
162
173
  "title": "Card title",
163
174
  "level": 3
164
175
  },
165
- "label": "New",
166
- "body": "<p>Card body</p>"
176
+ "body": "<p>Card body</p>",
177
+ "style": "foobar"
167
178
  },
168
- "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--m\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
179
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
180
+ "hidden": false
181
+ },
182
+ {
183
+ "name": "with classes",
184
+ "options": {
185
+ "heading": {
186
+ "title": "Card title",
187
+ "level": 3
188
+ },
189
+ "body": "<p>Card body</p>",
190
+ "classes": "card__test-class"
191
+ },
192
+ "html": "<div class=\"tna-card card__test-class\" data-module=\"tna-card\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
193
+ "hidden": false
194
+ },
195
+ {
196
+ "name": "with attributes",
197
+ "options": {
198
+ "heading": {
199
+ "title": "Card title",
200
+ "level": 3
201
+ },
202
+ "body": "<p>Card body</p>",
203
+ "attributes": {
204
+ "data-testattribute": "foobar"
205
+ }
206
+ },
207
+ "html": "<div class=\"tna-card \" data-module=\"tna-card\" data-testattribute=\"foobar\"><div class=\"tna-card__inner\"><h3 class=\"tna-card__title tna-heading tna-heading--l\">Card title</h3><div class=\"tna-card__body\"><p>Card body</p></div></div></div>",
169
208
  "hidden": false
170
209
  }
171
210
  ]
@@ -23,6 +23,12 @@
23
23
  "required": true,
24
24
  "description": ""
25
25
  },
26
+ {
27
+ "name": "size",
28
+ "type": "string",
29
+ "required": false,
30
+ "description": ""
31
+ },
26
32
  {
27
33
  "name": "singleSentence",
28
34
  "type": "boolean",
@@ -78,7 +84,7 @@
78
84
  {
79
85
  "name": "body",
80
86
  "type": "string",
81
- "required": false,
87
+ "required": true,
82
88
  "description": ""
83
89
  },
84
90
  {
@@ -114,11 +120,17 @@
114
120
  ]
115
121
  },
116
122
  {
117
- "name": "featured",
123
+ "name": "horizontal",
118
124
  "type": "boolean",
119
125
  "required": false,
120
126
  "description": ""
121
127
  },
128
+ {
129
+ "name": "style",
130
+ "type": "text",
131
+ "required": false,
132
+ "description": ""
133
+ },
122
134
  {
123
135
  "name": "htmlElement",
124
136
  "type": "string",
@@ -1,14 +1,18 @@
1
1
  {%- set htmlElement = params.htmlElement if params.htmlElement else 'div' -%}
2
2
  {%- set containerClasses = [params.classes] if params.classes else [] -%}
3
- {%- set headingSize = "l" if params.featured else "m" -%}
4
- {%- if params.featured -%}
5
- {%- set containerClasses = containerClasses.concat('tna-card--featured') -%}
3
+ {%- if params.horizontal -%}
4
+ {%- set containerClasses = containerClasses.concat('tna-card--horizontal') -%}
5
+ {%- endif -%}
6
+ {%- if params.style == "boxed" -%}
7
+ {%- set containerClasses = containerClasses.concat('tna-card--contrast') -%}
8
+ {%- elseif params.style == "accent" -%}
9
+ {%- set containerClasses = containerClasses.concat('tna-card--accent') -%}
6
10
  {%- endif -%}
7
11
  <{{ htmlElement }} class="tna-card {{ containerClasses | join(' ') }}" data-module="tna-card" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
8
12
  <div class="tna-card__inner">
9
13
  {%- if params.heading.supertitle -%}
10
14
  {%- if params.heading.singleSentence -%}
11
- <hgroup class="tna-card__heading tna-hgroup tna-hgroup--{{ headingSize }}">
15
+ <hgroup class="tna-card__heading tna-hgroup tna-hgroup--{{ params.heading.size or 'l' }}">
12
16
  <h{{ params.heading.level }} class="tna-card__title tna-hgroup__title">
13
17
  <span class="tna-card__supertitle tna-hgroup__supertitle">{{ params.heading.supertitle }}</span>
14
18
  {%- if params.href -%}
@@ -19,7 +23,7 @@
19
23
  </h{{ params.heading.level }}>
20
24
  </hgroup>
21
25
  {%- else -%}
22
- <hgroup class="tna-card__heading tna-hgroup tna-hgroup--{{ headingSize }}">
26
+ <hgroup class="tna-card__heading tna-hgroup tna-hgroup--{{ params.heading.size or 'l' }}">
23
27
  <p class="tna-card__supertitle tna-hgroup__supertitle">{{ params.heading.supertitle }}</p>
24
28
  <h{{ params.heading.level }} class="tna-card__title tna-hgroup__title">
25
29
  {%- if params.href -%}
@@ -31,7 +35,7 @@
31
35
  </hgroup>
32
36
  {%- endif -%}
33
37
  {%- else -%}
34
- <h{{ params.heading.level }} class="tna-card__title tna-heading tna-heading--{{ headingSize }}">
38
+ <h{{ params.heading.level }} class="tna-card__title tna-heading tna-heading--{{ params.heading.size or 'l' }}">
35
39
  {%- if params.href -%}
36
40
  <a href="{{ params.href }}" class="tna-card__title-link">{{ params.heading.title }}</a>
37
41
  {%- else -%}
@@ -43,7 +47,7 @@
43
47
  <a href="{{ item.href }}" class="tna-card__image-container" tabindex="-1">
44
48
  <img src="{{ params.image.src }}" alt="{{ params.image.alt }}" width="{{ params.image.width }}" height="{{ params.image.height }}" class="tna-card__image" />
45
49
  {%- if params.label -%}
46
- <div class="tna-card__image-label">
50
+ <div class="tna-chip tna-card__image-label">
47
51
  {{ params.label }}
48
52
  </div>
49
53
  {%- endif -%}
@@ -59,7 +63,7 @@
59
63
  {%- if params.actions -%}
60
64
  <div class="tna-card__actions">
61
65
  {%- for item in params.actions -%}
62
- <a href="{{ item.href }}" class="tna-card__action tna-button" role="button" {%- if item.title %}title="{{ item.title }}"{% endif %}>{{ item.text }}</a>
66
+ <a href="{{ item.href }}" class="tna-card__action" role="button" {%- if item.title %}title="{{ item.title }}"{% endif %}>{{ item.text }}</a>
63
67
  {%- endfor -%}
64
68
  </div>
65
69
  {%- endif -%}
@@ -1,31 +1,30 @@
1
1
  .tna-filters {
2
- &__item {
3
- margin: 0 0.75rem 0.75rem 0;
2
+ margin-bottom: 2rem;
4
3
 
5
- display: inline-block;
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ gap: 1rem;
6
7
 
7
- &:last-child {
8
- margin-right: 0;
9
- margin-bottom: 0;
10
- }
8
+ &:last-child {
9
+ margin-bottom: 0;
11
10
  }
12
11
 
13
- &--stacked &__item {
14
- display: block;
12
+ &__item {
15
13
  }
16
14
 
17
15
  &__item--selected #{&}__link {
18
- color: #fff;
19
-
20
16
  background-color: #004c7e;
17
+
18
+ &,
19
+ &:link,
20
+ &:visited {
21
+ color: #fff;
22
+ }
21
23
  }
22
24
 
23
25
  &__link {
24
26
  padding: 0.125rem 0.75rem;
25
27
 
26
- display: inline-block;
27
-
28
- color: #000;
29
28
  text-decoration: none;
30
29
 
31
30
  background-color: #d4e5ef;
@@ -36,6 +35,12 @@
36
35
  color 200ms,
37
36
  background-color 200ms;
38
37
 
38
+ &,
39
+ &:link,
40
+ &:visited {
41
+ color: #000;
42
+ }
43
+
39
44
  &:hover {
40
45
  color: #fff;
41
46