@nationalarchives/frontend 0.1.13-prerelease → 0.1.15-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/nationalarchives/_features.scss +0 -3
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +7 -7
- package/nationalarchives/all.scss +2 -5
- package/nationalarchives/components/breadcrumbs/_index.scss +62 -19
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +2 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +63 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +28 -0
- package/nationalarchives/components/breadcrumbs/fixtures.json +1 -1
- package/nationalarchives/components/breadcrumbs/template.njk +3 -3
- package/nationalarchives/components/button/fixtures.json +5 -5
- package/nationalarchives/components/button/template.njk +1 -1
- package/nationalarchives/components/card/_index.scss +72 -29
- package/nationalarchives/components/card/card.stories.js +6 -1
- package/nationalarchives/components/card/fixtures.json +2 -2
- package/nationalarchives/components/card/macro-options.json +6 -6
- package/nationalarchives/components/card/template.njk +5 -5
- package/nationalarchives/components/filters/filters.stories.js +1 -1
- package/nationalarchives/components/footer/_index.scss +7 -4
- package/nationalarchives/components/footer/template.njk +1 -1
- package/nationalarchives/components/header/_index.scss +17 -11
- package/nationalarchives/components/header/header.stories.js +73 -28
- package/nationalarchives/components/header/template.njk +1 -1
- package/nationalarchives/components/hero/_index.scss +4 -15
- package/nationalarchives/components/hero/hero.stories.js +2 -0
- package/nationalarchives/components/index-grid/_index.scss +20 -5
- package/nationalarchives/components/index-grid/index-grid.stories.js +6 -2
- package/nationalarchives/components/index-grid/macro-options.json +22 -2
- package/nationalarchives/components/index-grid/template.njk +12 -6
- package/nationalarchives/components/message/_index.scss +3 -1
- package/nationalarchives/components/picture/_index.scss +13 -32
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -1
- package/nationalarchives/components/tabs/_index.scss +6 -12
- package/nationalarchives/components/tabs/tabs.stories.js +3 -1
- package/nationalarchives/patterns/featured-collection/_index.scss +1 -1
- package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +1 -1
- package/nationalarchives/patterns/featured-collection/template.njk +2 -2
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +85 -0
- package/nationalarchives/stories/utilities/{colour.stories.js → colour-schemes/colour-schemes.stories.js} +129 -18
- package/nationalarchives/stories/utilities/overrides/overrides.mdx +66 -0
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +36 -0
- package/nationalarchives/stories/utilities/{headings.stories.js → typography/headings.stories.js} +2 -1
- package/nationalarchives/stories/utilities/typography/typography.stories.js +34 -0
- package/nationalarchives/tools/_colour.scss +51 -53
- package/nationalarchives/tools/_typography.scss +13 -1
- package/nationalarchives/utilities/_global.scss +10 -22
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_overrides.scss +17 -0
- package/nationalarchives/utilities/_typography.scss +36 -27
- package/nationalarchives/variables/_colour.scss +50 -27
- package/nationalarchives/variables/_index.scss +1 -0
- package/nationalarchives/variables/_spacing.scss +7 -0
- package/nationalarchives/variables/_typography.scss +2 -1
- package/package.json +1 -1
- package/nationalarchives/components/card/card.js +0 -2
- package/nationalarchives/components/card/card.js.map +0 -1
- package/nationalarchives/components/card/card.mjs +0 -45
- package/nationalarchives/stories/utilities/typography.stories.js +0 -29
- /package/nationalarchives/stories/utilities/{heading-groups.stories.js → typography/heading-groups.stories.js} +0 -0
- /package/nationalarchives/stories/utilities/{lists.stories.js → typography/lists.stories.js} +0 -0
- /package/nationalarchives/stories/utilities/{typography.mdx → typography/typography.mdx} +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
@use "../variables/spacing";
|
2
|
+
|
3
|
+
@each $property in margin, padding {
|
4
|
+
@each $direction in top, bottom {
|
5
|
+
.tna-\!--no-#{$property}-#{$direction},
|
6
|
+
.tna-\!--no-#{$property}-vertical {
|
7
|
+
#{$property}-#{$direction}: 0 !important;
|
8
|
+
}
|
9
|
+
|
10
|
+
@each $size, $amount in spacing.$spacing {
|
11
|
+
.tna-\!--#{$property}-#{$direction}-#{$size},
|
12
|
+
.tna-\!--#{$property}-vertical-#{$size} {
|
13
|
+
#{$property}-#{$direction}: #{$amount}rem !important;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
@@ -1,9 +1,10 @@
|
|
1
|
+
@use "sass:math";
|
1
2
|
@use "../tools/colour";
|
2
3
|
@use "../tools/media";
|
3
4
|
@use "../tools/typography";
|
4
5
|
|
5
|
-
// Temporary - will eventually bundle font files into package
|
6
|
-
@import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@
|
6
|
+
// TODO: Temporary - will eventually bundle font files into package
|
7
|
+
@import "https://fonts.googleapis.com/css2?family=Open+Sans:wght@500;700&family=Roboto+Mono:wght@400&display=swap";
|
7
8
|
@import "https://use.typekit.net/hkj3kuz.css";
|
8
9
|
|
9
10
|
.tna-template {
|
@@ -19,7 +20,8 @@
|
|
19
20
|
.tna-template__body {
|
20
21
|
color: inherit;
|
21
22
|
@include typography.relative-font-size(18);
|
22
|
-
line-height: 1.6;
|
23
|
+
// line-height: 1.6;
|
24
|
+
line-height: #{math.div(16, 18) * 2};
|
23
25
|
}
|
24
26
|
|
25
27
|
h1,
|
@@ -33,6 +35,16 @@ ol {
|
|
33
35
|
margin-top: 0;
|
34
36
|
}
|
35
37
|
|
38
|
+
h1,
|
39
|
+
h2,
|
40
|
+
h3,
|
41
|
+
h4,
|
42
|
+
h5,
|
43
|
+
h6,
|
44
|
+
strong {
|
45
|
+
@include typography.main-font-weight-bold;
|
46
|
+
}
|
47
|
+
|
36
48
|
p {
|
37
49
|
margin: 0 0 1.5rem;
|
38
50
|
|
@@ -43,23 +55,26 @@ p {
|
|
43
55
|
|
44
56
|
a {
|
45
57
|
@include colour.colour-font("link");
|
58
|
+
text-decoration-thickness: 1.5px;
|
46
59
|
|
47
60
|
&:visited {
|
48
61
|
@include colour.colour-font("link-visited");
|
49
62
|
}
|
50
63
|
|
64
|
+
&:hover,
|
51
65
|
&:active {
|
52
|
-
text-decoration-thickness:
|
53
|
-
}
|
54
|
-
|
55
|
-
&:hover {
|
56
|
-
text-decoration-thickness: 3px;
|
66
|
+
text-decoration-thickness: 3.5px;
|
57
67
|
}
|
58
68
|
}
|
59
69
|
|
60
70
|
.tna-ul,
|
61
71
|
.tna-ol {
|
62
|
-
|
72
|
+
margin: 0 0 2rem;
|
73
|
+
padding: 0 0 0 2rem;
|
74
|
+
|
75
|
+
&:last-child {
|
76
|
+
margin-bottom: 0;
|
77
|
+
}
|
63
78
|
|
64
79
|
li::marker {
|
65
80
|
@include colour.colour-font("accent");
|
@@ -121,22 +136,20 @@ a {
|
|
121
136
|
}
|
122
137
|
|
123
138
|
.tna-hgroup {
|
124
|
-
margin-bottom:
|
139
|
+
margin-bottom: 1rem;
|
125
140
|
|
126
141
|
&:last-child {
|
127
142
|
margin-bottom: 0;
|
128
143
|
}
|
129
144
|
|
130
145
|
&__supertitle {
|
131
|
-
margin: 0;
|
146
|
+
margin: 0 0 0.5rem;
|
132
147
|
|
133
148
|
@include colour.colour-font("font-base");
|
134
|
-
@include typography.relative-font-size(14);
|
135
149
|
@include typography.detail-font;
|
136
|
-
text-transform: uppercase;
|
137
150
|
|
138
151
|
.tna-hgroup & {
|
139
|
-
margin: 0;
|
152
|
+
// margin: 0;
|
140
153
|
}
|
141
154
|
}
|
142
155
|
|
@@ -153,44 +166,36 @@ a {
|
|
153
166
|
}
|
154
167
|
|
155
168
|
&--xl {
|
156
|
-
.tna-hgroup__supertitle {
|
157
|
-
}
|
158
|
-
|
159
169
|
.tna-hgroup__title {
|
160
170
|
@include typography.relative-font-size(64);
|
171
|
+
line-height: 1;
|
161
172
|
}
|
162
173
|
}
|
163
174
|
|
164
175
|
&--l {
|
165
|
-
.tna-hgroup__supertitle {
|
166
|
-
}
|
167
|
-
|
168
176
|
.tna-hgroup__title {
|
169
177
|
@include typography.relative-font-size(32);
|
178
|
+
line-height: 1.2;
|
170
179
|
}
|
171
180
|
}
|
172
181
|
|
173
182
|
&--m {
|
174
|
-
.tna-hgroup__supertitle {
|
175
|
-
}
|
176
|
-
|
177
183
|
.tna-hgroup__title {
|
178
184
|
@include typography.relative-font-size(20);
|
185
|
+
line-height: 1.4;
|
179
186
|
}
|
180
187
|
}
|
181
188
|
|
182
189
|
&--s {
|
183
|
-
.tna-hgroup__supertitle {
|
184
|
-
}
|
185
|
-
|
186
190
|
.tna-hgroup__title {
|
187
191
|
@include typography.relative-font-size(18);
|
192
|
+
line-height: 1.6;
|
188
193
|
}
|
189
194
|
}
|
190
195
|
}
|
191
196
|
|
192
197
|
.tna-blockquote {
|
193
|
-
margin: 0;
|
198
|
+
margin: 0 0 2rem;
|
194
199
|
padding: 1rem 1rem 1rem 2rem;
|
195
200
|
|
196
201
|
border-left: 0.35rem solid;
|
@@ -198,6 +203,10 @@ a {
|
|
198
203
|
|
199
204
|
quotes: "“" "”" "‘" "’";
|
200
205
|
|
206
|
+
&:last-child {
|
207
|
+
margin-bottom: 0;
|
208
|
+
}
|
209
|
+
|
201
210
|
&::before {
|
202
211
|
float: left;
|
203
212
|
|
@@ -27,27 +27,8 @@ $-tna-pastel-blue: #d4e5ef;
|
|
27
27
|
$-dark-grey: #26262a;
|
28
28
|
$-base-font: #343338;
|
29
29
|
|
30
|
-
$-accent-colour: $-tna-yellow;
|
31
|
-
$-accent-colour-dark: $-accent-colour;
|
32
|
-
|
33
|
-
// @debug $-accent-colour;
|
34
|
-
// @mixin configure($accent-colour: null) {
|
35
|
-
// @debug $accent-colour;
|
36
|
-
// @if $accent-colour {
|
37
|
-
// $-accent-colour: $accent-colour !global;
|
38
|
-
// }
|
39
|
-
// }
|
40
|
-
// @debug $-accent-colour;
|
41
|
-
|
42
|
-
@function accent-colour() {
|
43
|
-
// @return $-accent-colour or $-tna-yellow;
|
44
|
-
@return $-accent-colour;
|
45
|
-
}
|
46
|
-
|
47
|
-
@function accent-colour-dark() {
|
48
|
-
// @return $-accent-colour-dark or -accent-colour();
|
49
|
-
@return $-accent-colour-dark or accent-colour();
|
50
|
-
}
|
30
|
+
$-accent-colour-default: $-tna-yellow;
|
31
|
+
$-accent-colour-default-dark: $-accent-colour-default;
|
51
32
|
|
52
33
|
// TODO: Scoped variables should not be used directly outside of this file
|
53
34
|
$tna-black: $-tna-black;
|
@@ -56,9 +37,16 @@ $tna-yellow: $-tna-yellow;
|
|
56
37
|
$tna-pink: $-tna-pink;
|
57
38
|
$tna-orange: $-tna-orange;
|
58
39
|
$tna-green: $-tna-green;
|
40
|
+
$tna-forest: $-tna-forest;
|
59
41
|
$tna-blue: $-tna-blue;
|
60
42
|
$tna-cream: $-tna-cream;
|
43
|
+
$tna-white: $-tna-white;
|
61
44
|
|
45
|
+
/*
|
46
|
+
=========================================
|
47
|
+
LIGHT/DEFAULT THEME
|
48
|
+
=========================================
|
49
|
+
*/
|
62
50
|
$colour-palette-default: (
|
63
51
|
"page-background": $-tna-white,
|
64
52
|
"font-base": $-base-font,
|
@@ -66,11 +54,11 @@ $colour-palette-default: (
|
|
66
54
|
"font-light": rgba($-base-font, 0.7),
|
67
55
|
"link": #1d70ab,
|
68
56
|
"link-visited": #4c2c92,
|
69
|
-
// "focus-outline": #004c7e,
|
57
|
+
// "focus-outline": #004c7e, // Old value
|
70
58
|
"focus-outline": $-tna-blue,
|
71
59
|
"keyline": #ccc,
|
72
60
|
"keyline-dark": $-dark-grey,
|
73
|
-
"accent": accent-colour
|
61
|
+
"accent-default": $-accent-colour-default,
|
74
62
|
"button-primary-text": $-tna-white,
|
75
63
|
"button-primary-background": $-tna-black,
|
76
64
|
"button-primary-hover-text": $-tna-black,
|
@@ -79,8 +67,21 @@ $colour-palette-default: (
|
|
79
67
|
"button-secondary-background": $-tna-yellow,
|
80
68
|
"button-secondary-hover-text": $-tna-black,
|
81
69
|
"button-secondary-hover-background": $-tna-white,
|
70
|
+
"contrast-background": $-dark-grey,
|
71
|
+
"contrast-font-base": $-tna-white,
|
72
|
+
"contrast-font-dark": $-tna-white,
|
73
|
+
"contrast-font-light": rgba($-tna-white, 0.7),
|
74
|
+
"contrast-link": $-tna-white,
|
75
|
+
"contrast-link-visited": #b9f,
|
76
|
+
"contrast-keyline": rgba($-tna-white, 0.5),
|
77
|
+
"contrast-keyline-dark": rgba($-tna-white, 0.8),
|
82
78
|
);
|
83
79
|
|
80
|
+
/*
|
81
|
+
=========================================
|
82
|
+
DARK THEME
|
83
|
+
=========================================
|
84
|
+
*/
|
84
85
|
$colour-palette-dark: map.merge(
|
85
86
|
$colour-palette-default,
|
86
87
|
(
|
@@ -89,13 +90,21 @@ $colour-palette-dark: map.merge(
|
|
89
90
|
"font-dark": $-tna-white,
|
90
91
|
"font-light": rgba($-tna-white, 0.5),
|
91
92
|
"link": $-tna-blue,
|
92
|
-
"link-visited":
|
93
|
-
"keyline": rgba($-tna-white, 0.
|
93
|
+
"link-visited": map.get($colour-palette-default, "contrast-link-visited"),
|
94
|
+
"keyline": rgba($-tna-white, 0.25),
|
94
95
|
"keyline-dark": $-tna-white,
|
95
|
-
"accent": accent-colour-dark
|
96
|
+
"accent-default": $-accent-colour-default-dark,
|
97
|
+
"contrast-background": #111,
|
98
|
+
"contrast-link-visited":
|
99
|
+
map.get($colour-palette-default, "contrast-link-visited"),
|
96
100
|
)
|
97
101
|
);
|
98
102
|
|
103
|
+
/*
|
104
|
+
=========================================
|
105
|
+
LIGHT, HIGH_CONTRAST THEME
|
106
|
+
=========================================
|
107
|
+
*/
|
99
108
|
$colour-palette-high-contrast: map.merge(
|
100
109
|
$colour-palette-default,
|
101
110
|
(
|
@@ -106,17 +115,31 @@ $colour-palette-high-contrast: map.merge(
|
|
106
115
|
"focus-outline": $-tna-orange,
|
107
116
|
"keyline": $-tna-black,
|
108
117
|
"keyline-dark": $-tna-black,
|
118
|
+
"contrast-background": $-tna-white,
|
119
|
+
"contrast-font-base": $-tna-black,
|
120
|
+
"contrast-font-dark": $-tna-black,
|
121
|
+
"contrast-font-light": $-tna-black,
|
122
|
+
"contrast-link": $-tna-black,
|
123
|
+
"contrast-link-visited": $-tna-black,
|
124
|
+
"contrast-keyline": $-tna-black,
|
125
|
+
"contrast-keyline-dark": $-tna-black,
|
109
126
|
)
|
110
127
|
);
|
111
128
|
|
129
|
+
/*
|
130
|
+
=========================================
|
131
|
+
DARK, HIGH_CONTRAST THEME
|
132
|
+
=========================================
|
133
|
+
*/
|
112
134
|
$colour-palette-high-contrast-dark: map.merge(
|
113
135
|
$colour-palette-dark,
|
114
136
|
(
|
115
|
-
"page-background":
|
137
|
+
"page-background": $tna-black,
|
116
138
|
"font-base": $-tna-white,
|
117
139
|
"font-light": $-tna-white,
|
118
140
|
"link": $-tna-white,
|
119
141
|
"link-visited": $-tna-white,
|
120
142
|
"keyline": $-tna-white,
|
143
|
+
"contrast-background": $tna-black,
|
121
144
|
)
|
122
145
|
);
|
package/package.json
CHANGED
@@ -1,2 +0,0 @@
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():(t.TNAFrontend=t.TNAFrontend||{},t.TNAFrontend["components/card/card"]=e())}(self,(()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===o(i)?i:String(i)),r)}var i}t.r(e),t.d(e,{Card:()=>r});var r=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$cardTitleLink=e&&e.querySelector(".tna-card__title-link"),this.$cardAction=e&&e.querySelector(".tna-card__action"),this.tapTimeMax=o}var e,o;return e=t,(o=[{key:"init",value:function(){this.$module&&(this.$cardTitleLink||this.$cardAction)&&!this.$module.classList.contains("tna-card--no-global-click")&&(this.touchStartTime=null)}},{key:"handleCardClick",value:function(){this.$cardTitleLink?this.$cardTitleLink.click():this.$cardAction&&this.$cardAction.click()}},{key:"handleCardTouchStart",value:function(){this.touchStartTime=new Date}},{key:"handleCardTouchEnd",value:function(){(new Date).getTime()-this.touchStartTime.getTime()<this.tapTimeMax&&this.handleCardClick()}}])&&n(e.prototype,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();return e})()));
|
2
|
-
//# sourceMappingURL=card.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"components/card/card.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,KAEzBD,EAAkB,YAAIA,EAAkB,aAAK,CAAC,EAAGA,EAAkB,YAAE,wBAA0BC,IAChG,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,msBCLvD,IAAMC,EAAI,WACf,SAAAA,EAAYC,GAA2B,IAAlBC,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,K,4FAAGG,CAAA,KAAAN,GACnCO,KAAKN,QAAUA,EACfM,KAAKC,eACHP,GAAWA,EAAQQ,cAAc,yBACnCF,KAAKG,YAAcT,GAAWA,EAAQQ,cAAc,qBACpDF,KAAKL,WAAaA,CACpB,C,QAoCC,O,EApCAF,G,EAAA,EAAAd,IAAA,OAAAa,MAED,WAEKQ,KAAKN,UACJM,KAAKC,gBAAmBD,KAAKG,eAC/BH,KAAKN,QAAQU,UAAUC,SAAS,+BAKlCL,KAAKM,eAAiB,KAMxB,GAAC,CAAA3B,IAAA,kBAAAa,MAED,WACMQ,KAAKC,eACPD,KAAKC,eAAeM,QACXP,KAAKG,aACdH,KAAKG,YAAYI,OAErB,GAAC,CAAA5B,IAAA,uBAAAa,MAED,WACEQ,KAAKM,eAAiB,IAAIE,IAC5B,GAAC,CAAA7B,IAAA,qBAAAa,MAED,YACmB,IAAIgB,MAAOC,UAAYT,KAAKM,eAAeG,UAC7CT,KAAKL,YAClBK,KAAKU,iBAET,M,oEAACjB,CAAA,CA3Cc,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/card/card.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = root[\"TNAFrontend\"] || {}, root[\"TNAFrontend\"][\"components/card/card\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class Card {\n constructor($module, tapTimeMax = 300) {\n this.$module = $module;\n this.$cardTitleLink =\n $module && $module.querySelector(\".tna-card__title-link\");\n this.$cardAction = $module && $module.querySelector(\".tna-card__action\");\n this.tapTimeMax = tapTimeMax;\n }\n\n init() {\n if (\n !this.$module ||\n (!this.$cardTitleLink && !this.$cardAction) ||\n this.$module.classList.contains(\"tna-card--no-global-click\")\n ) {\n return;\n }\n\n this.touchStartTime = null;\n\n // this.$module.addEventListener(\"touchstart\", () =>\n // this.handleCardTouchStart(),\n // );\n // this.$module.addEventListener(\"touchend\", () => this.handleCardTouchEnd());\n }\n\n handleCardClick() {\n if (this.$cardTitleLink) {\n this.$cardTitleLink.click();\n } else if (this.$cardAction) {\n this.$cardAction.click();\n }\n }\n\n handleCardTouchStart() {\n this.touchStartTime = new Date();\n }\n\n handleCardTouchEnd() {\n const duration = new Date().getTime() - this.touchStartTime.getTime();\n if (duration < this.tapTimeMax) {\n this.handleCardClick();\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Card","$module","tapTimeMax","arguments","length","undefined","_classCallCheck","this","$cardTitleLink","querySelector","$cardAction","classList","contains","touchStartTime","click","Date","getTime","handleCardClick"],"sourceRoot":""}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
export class Card {
|
2
|
-
constructor($module, tapTimeMax = 300) {
|
3
|
-
this.$module = $module;
|
4
|
-
this.$cardTitleLink =
|
5
|
-
$module && $module.querySelector(".tna-card__title-link");
|
6
|
-
this.$cardAction = $module && $module.querySelector(".tna-card__action");
|
7
|
-
this.tapTimeMax = tapTimeMax;
|
8
|
-
}
|
9
|
-
|
10
|
-
init() {
|
11
|
-
if (
|
12
|
-
!this.$module ||
|
13
|
-
(!this.$cardTitleLink && !this.$cardAction) ||
|
14
|
-
this.$module.classList.contains("tna-card--no-global-click")
|
15
|
-
) {
|
16
|
-
return;
|
17
|
-
}
|
18
|
-
|
19
|
-
this.touchStartTime = null;
|
20
|
-
|
21
|
-
// this.$module.addEventListener("touchstart", () =>
|
22
|
-
// this.handleCardTouchStart(),
|
23
|
-
// );
|
24
|
-
// this.$module.addEventListener("touchend", () => this.handleCardTouchEnd());
|
25
|
-
}
|
26
|
-
|
27
|
-
handleCardClick() {
|
28
|
-
if (this.$cardTitleLink) {
|
29
|
-
this.$cardTitleLink.click();
|
30
|
-
} else if (this.$cardAction) {
|
31
|
-
this.$cardAction.click();
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
handleCardTouchStart() {
|
36
|
-
this.touchStartTime = new Date();
|
37
|
-
}
|
38
|
-
|
39
|
-
handleCardTouchEnd() {
|
40
|
-
const duration = new Date().getTime() - this.touchStartTime.getTime();
|
41
|
-
if (duration < this.tapTimeMax) {
|
42
|
-
this.handleCardClick();
|
43
|
-
}
|
44
|
-
}
|
45
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
const argTypes = {
|
2
|
-
text: { control: "text" },
|
3
|
-
};
|
4
|
-
|
5
|
-
export default {
|
6
|
-
title: "Utilities/Typography",
|
7
|
-
argTypes,
|
8
|
-
};
|
9
|
-
|
10
|
-
const ParagraphTemplate = ({ text }) => `<p class="tna-p">${text}</p>`;
|
11
|
-
export const Paragraph = ParagraphTemplate.bind({});
|
12
|
-
Paragraph.args = {
|
13
|
-
text: "This is some body text",
|
14
|
-
};
|
15
|
-
|
16
|
-
const BlockquoteTemplate = ({
|
17
|
-
html,
|
18
|
-
author,
|
19
|
-
}) => `<blockquote class="tna-blockquote">
|
20
|
-
<div class="tna-blockquote__quote">
|
21
|
-
${html}
|
22
|
-
</div>
|
23
|
-
<p class="tna-blockquote__author">${author}</p>
|
24
|
-
</p>`;
|
25
|
-
export const Blockquote = BlockquoteTemplate.bind({});
|
26
|
-
Blockquote.args = {
|
27
|
-
html: "<p>A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.</p>",
|
28
|
-
author: "Douglas Adams, Mostly Harmless",
|
29
|
-
};
|
File without changes
|
/package/nationalarchives/stories/utilities/{lists.stories.js → typography/lists.stories.js}
RENAMED
File without changes
|
File without changes
|