@nationalarchives/frontend 0.1.14-prerelease → 0.1.16-prerelease
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +21 -0
- package/nationalarchives/all.css +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/_index.scss +1 -0
- package/nationalarchives/components/breadcrumbs/_index.scss +54 -39
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js +2 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +67 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +10 -3
- package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
- package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
- package/nationalarchives/components/breadcrumbs/template.njk +17 -12
- package/nationalarchives/components/button/_index.scss +1 -2
- package/nationalarchives/components/button/button.stories.js +2 -3
- package/nationalarchives/components/button/fixtures.json +5 -5
- package/nationalarchives/components/button/template.njk +1 -1
- package/nationalarchives/components/card/_index.scss +78 -34
- package/nationalarchives/components/card/card.stories.js +72 -5
- package/nationalarchives/components/card/fixtures.json +15 -2
- package/nationalarchives/components/card/macro-options.json +6 -12
- package/nationalarchives/components/card/template.njk +6 -6
- package/nationalarchives/components/filters/filters.stories.js +3 -4
- package/nationalarchives/components/footer/_index.scss +8 -14
- package/nationalarchives/components/footer/footer.stories.js +2 -3
- package/nationalarchives/components/footer/template.njk +1 -1
- package/nationalarchives/components/grid/_index.scss +2 -2
- package/nationalarchives/components/grid/grid.stories.js +2 -3
- package/nationalarchives/components/header/_index.scss +27 -26
- package/nationalarchives/components/header/header.stories.js +2 -3
- package/nationalarchives/components/header/template.njk +1 -1
- package/nationalarchives/components/hero/_index.scss +7 -20
- package/nationalarchives/components/hero/hero.stories.js +2 -3
- package/nationalarchives/components/index-grid/_index.scss +17 -1
- package/nationalarchives/components/index-grid/index-grid.stories.js +7 -5
- 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 +4 -6
- package/nationalarchives/components/message/phase-banner.stories.js +2 -3
- package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
- package/nationalarchives/components/picture/_index.scss +12 -15
- package/nationalarchives/components/picture/picture.stories.js +2 -3
- package/nationalarchives/components/profile/profile.stories.js +2 -3
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
- package/nationalarchives/components/skip-link/_index.scss +63 -0
- package/nationalarchives/components/skip-link/fixtures.json +11 -0
- package/nationalarchives/components/skip-link/macro-options.json +26 -0
- package/nationalarchives/components/skip-link/macro.njk +3 -0
- package/nationalarchives/components/skip-link/skip-link.stories.js +31 -0
- package/nationalarchives/components/skip-link/template.njk +4 -0
- package/nationalarchives/components/tabs/_index.scss +7 -14
- package/nationalarchives/components/tabs/tabs.stories.js +2 -3
- package/nationalarchives/patterns/featured-collection/_index.scss +2 -2
- package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +3 -4
- 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} +142 -52
- package/nationalarchives/stories/utilities/overrides/overrides.mdx +66 -0
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +30 -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/templates/layouts/_generic.njk +10 -8
- package/nationalarchives/tools/_colour.scss +105 -16
- package/nationalarchives/tools/_index.scss +0 -1
- package/nationalarchives/tools/_typography.scss +13 -1
- package/nationalarchives/utilities/_debug.scss +41 -1
- package/nationalarchives/utilities/_global.scss +13 -4
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_overrides.scss +30 -0
- package/nationalarchives/utilities/_typography.scss +42 -34
- package/nationalarchives/variables/_colour.scss +103 -106
- package/nationalarchives/variables/_grid.scss +1 -1
- package/nationalarchives/variables/_index.scss +1 -1
- package/nationalarchives/variables/_media.scss +23 -23
- package/nationalarchives/variables/_spacing.scss +15 -0
- package/nationalarchives/variables/_typography.scss +2 -1
- package/package.json +2 -2
- 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/tools/_assets.scss +0 -5
- package/nationalarchives/variables/_assets.scss +0 -1
- /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
@@ -1,142 +1,139 @@
|
|
1
1
|
@use "sass:map";
|
2
2
|
@use "../features";
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
$colour-palette-brand: (
|
5
|
+
"black": #000,
|
6
|
+
"grey": #8c9694,
|
7
|
+
"light-grey": #d9d9d6,
|
8
|
+
"white": #fff,
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
"yellow": #fc0,
|
11
|
+
"pink": #fe1d57,
|
12
|
+
"orange": #fd3f03,
|
13
|
+
"green": #86bc25,
|
14
|
+
"blue": #00b0ff,
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
"brown": #654e37,
|
17
|
+
"maroon": #9c193a,
|
18
|
+
"chestnut": #8f3415,
|
19
|
+
"forest": #00623b,
|
20
|
+
"navy": #004c7e,
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
$-dark-grey: #26262a;
|
28
|
-
$-base-font: #343338;
|
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
|
-
}
|
22
|
+
"cream": #f9f7e2,
|
23
|
+
"pastel-pink": #fad3d4,
|
24
|
+
"pastel-orange": #f9e1bc,
|
25
|
+
"pastel-green": #dde5d5,
|
26
|
+
"pastel-blue": #d4e5ef,
|
27
|
+
);
|
46
28
|
|
47
|
-
|
48
|
-
|
49
|
-
@return $-accent-colour-dark or accent-colour();
|
50
|
-
}
|
29
|
+
$dark-grey: #26262a;
|
30
|
+
$base-font: #343338;
|
51
31
|
|
52
|
-
|
53
|
-
|
54
|
-
$dark-grey: $-dark-grey;
|
55
|
-
$tna-yellow: $-tna-yellow;
|
56
|
-
$tna-pink: $-tna-pink;
|
57
|
-
$tna-orange: $-tna-orange;
|
58
|
-
$tna-green: $-tna-green;
|
59
|
-
$tna-blue: $-tna-blue;
|
60
|
-
$tna-cream: $-tna-cream;
|
32
|
+
$-accent-colour-default: map.get($colour-palette-brand, "yellow");
|
33
|
+
$-accent-colour-default-dark: $-accent-colour-default;
|
61
34
|
|
35
|
+
/*
|
36
|
+
=========================================
|
37
|
+
LIGHT THEME (DEFAULT)
|
38
|
+
=========================================
|
39
|
+
*/
|
62
40
|
$colour-palette-default: (
|
63
|
-
"page-background":
|
64
|
-
"font-base":
|
65
|
-
"font-dark":
|
66
|
-
"font-light": rgba(
|
41
|
+
"page-background": map.get($colour-palette-brand, "white"),
|
42
|
+
"font-base": $base-font,
|
43
|
+
"font-dark": map.get($colour-palette-brand, "black"),
|
44
|
+
"font-light": rgba($base-font, 0.7),
|
67
45
|
"link": #1d70ab,
|
68
46
|
"link-visited": #4c2c92,
|
69
|
-
// "focus-outline": #004c7e,
|
70
|
-
"focus-outline":
|
47
|
+
// "focus-outline": #004c7e, // Old value
|
48
|
+
"focus-outline": map.get($colour-palette-brand, "blue"),
|
71
49
|
"keyline": #ccc,
|
72
|
-
"keyline-dark":
|
73
|
-
"accent": accent-colour
|
74
|
-
"button-primary-text":
|
75
|
-
"button-primary-background":
|
76
|
-
"button-primary-hover-text":
|
77
|
-
"button-primary-hover-background":
|
78
|
-
"button-secondary-text":
|
79
|
-
"button-secondary-background":
|
80
|
-
"button-secondary-hover-text":
|
81
|
-
"button-secondary-hover-background":
|
82
|
-
"contrast-background":
|
83
|
-
"contrast-font-base":
|
84
|
-
"contrast-font-dark":
|
85
|
-
"contrast-font-light": rgba(
|
86
|
-
"contrast-link":
|
50
|
+
"keyline-dark": $dark-grey,
|
51
|
+
"accent-default": $-accent-colour-default,
|
52
|
+
"button-primary-text": map.get($colour-palette-brand, "white"),
|
53
|
+
"button-primary-background": map.get($colour-palette-brand, "black"),
|
54
|
+
"button-primary-hover-text": map.get($colour-palette-brand, "black"),
|
55
|
+
"button-primary-hover-background": map.get($colour-palette-brand, "white"),
|
56
|
+
"button-secondary-text": map.get($colour-palette-brand, "black"),
|
57
|
+
"button-secondary-background": map.get($colour-palette-brand, "yellow"),
|
58
|
+
"button-secondary-hover-text": map.get($colour-palette-brand, "black"),
|
59
|
+
"button-secondary-hover-background": map.get($colour-palette-brand, "white"),
|
60
|
+
"contrast-background": $dark-grey,
|
61
|
+
"contrast-font-base": map.get($colour-palette-brand, "white"),
|
62
|
+
"contrast-font-dark": map.get($colour-palette-brand, "white"),
|
63
|
+
"contrast-font-light": rgba(map.get($colour-palette-brand, "white"), 0.7),
|
64
|
+
"contrast-link": map.get($colour-palette-brand, "blue"),
|
87
65
|
"contrast-link-visited": #b9f,
|
88
|
-
"contrast-keyline": rgba(
|
89
|
-
"contrast-keyline-dark": rgba(
|
66
|
+
"contrast-keyline": rgba(map.get($colour-palette-brand, "white"), 0.5),
|
67
|
+
"contrast-keyline-dark": rgba(map.get($colour-palette-brand, "white"), 0.8),
|
90
68
|
);
|
91
69
|
|
70
|
+
/*
|
71
|
+
=========================================
|
72
|
+
DARK THEME
|
73
|
+
=========================================
|
74
|
+
*/
|
92
75
|
$colour-palette-dark: map.merge(
|
93
76
|
$colour-palette-default,
|
94
77
|
(
|
95
|
-
"page-background": #
|
96
|
-
"font-base": rgba(
|
97
|
-
"font-dark":
|
98
|
-
"font-light": rgba(
|
99
|
-
"link":
|
78
|
+
"page-background": #222,
|
79
|
+
"font-base": rgba(map.get($colour-palette-brand, "white"), 0.95),
|
80
|
+
"font-dark": map.get($colour-palette-brand, "white"),
|
81
|
+
"font-light": rgba(map.get($colour-palette-brand, "white"), 0.5),
|
82
|
+
"link": map.get($colour-palette-brand, "blue"),
|
100
83
|
"link-visited": map.get($colour-palette-default, "contrast-link-visited"),
|
101
|
-
"keyline": rgba(
|
102
|
-
"keyline-dark":
|
103
|
-
"accent": accent-colour-dark
|
104
|
-
"contrast-background": #
|
84
|
+
"keyline": rgba(map.get($colour-palette-brand, "white"), 0.25),
|
85
|
+
"keyline-dark": map.get($colour-palette-brand, "white"),
|
86
|
+
"accent-default": $-accent-colour-default-dark,
|
87
|
+
"contrast-background": #111,
|
105
88
|
"contrast-link-visited":
|
106
89
|
map.get($colour-palette-default, "contrast-link-visited"),
|
107
90
|
)
|
108
91
|
);
|
109
92
|
|
93
|
+
/*
|
94
|
+
=========================================
|
95
|
+
LIGHT, HIGH_CONTRAST THEME
|
96
|
+
=========================================
|
97
|
+
*/
|
110
98
|
$colour-palette-high-contrast: map.merge(
|
111
99
|
$colour-palette-default,
|
112
100
|
(
|
113
|
-
"font-base":
|
114
|
-
"font-light":
|
115
|
-
"link":
|
116
|
-
"link-visited":
|
117
|
-
"focus-outline":
|
118
|
-
"keyline":
|
119
|
-
"keyline-dark":
|
120
|
-
"contrast-background":
|
121
|
-
"contrast-font-base":
|
122
|
-
"contrast-font-dark":
|
123
|
-
"contrast-font-light":
|
124
|
-
"contrast-link":
|
125
|
-
"contrast-link-visited":
|
126
|
-
"contrast-keyline":
|
127
|
-
"contrast-keyline-dark":
|
101
|
+
"font-base": map.get($colour-palette-brand, "black"),
|
102
|
+
"font-light": map.get($colour-palette-brand, "black"),
|
103
|
+
"link": map.get($colour-palette-brand, "navy"),
|
104
|
+
"link-visited": map.get($colour-palette-brand, "black"),
|
105
|
+
"focus-outline": map.get($colour-palette-brand, "orange"),
|
106
|
+
"keyline": map.get($colour-palette-brand, "black"),
|
107
|
+
"keyline-dark": map.get($colour-palette-brand, "black"),
|
108
|
+
"contrast-background": map.get($colour-palette-brand, "white"),
|
109
|
+
"contrast-font-base": map.get($colour-palette-brand, "black"),
|
110
|
+
"contrast-font-dark": map.get($colour-palette-brand, "black"),
|
111
|
+
"contrast-font-light": map.get($colour-palette-brand, "black"),
|
112
|
+
"contrast-link": map.get($colour-palette-brand, "navy"),
|
113
|
+
"contrast-link-visited": map.get($colour-palette-brand, "black"),
|
114
|
+
"contrast-keyline": map.get($colour-palette-brand, "black"),
|
115
|
+
"contrast-keyline-dark": map.get($colour-palette-brand, "black"),
|
128
116
|
)
|
129
117
|
);
|
130
118
|
|
119
|
+
/*
|
120
|
+
=========================================
|
121
|
+
DARK, HIGH_CONTRAST THEME
|
122
|
+
=========================================
|
123
|
+
*/
|
131
124
|
$colour-palette-high-contrast-dark: map.merge(
|
132
125
|
$colour-palette-dark,
|
133
126
|
(
|
134
|
-
"page-background": $
|
135
|
-
"font-base":
|
136
|
-
"font-light":
|
137
|
-
"link":
|
138
|
-
"link-visited":
|
139
|
-
"keyline":
|
140
|
-
"
|
127
|
+
"page-background": map.get($colour-palette-brand, "black"),
|
128
|
+
"font-base": map.get($colour-palette-brand, "white"),
|
129
|
+
"font-light": map.get($colour-palette-brand, "white"),
|
130
|
+
"link": map.get($colour-palette-brand, "white"),
|
131
|
+
"link-visited": map.get($colour-palette-brand, "white"),
|
132
|
+
"keyline": map.get($colour-palette-brand, "white"),
|
133
|
+
"button-primary-text": map.get($colour-palette-brand, "black"),
|
134
|
+
"button-primary-background": map.get($colour-palette-brand, "white"),
|
135
|
+
"button-primary-hover-text": map.get($colour-palette-brand, "white"),
|
136
|
+
"button-primary-hover-background": map.get($colour-palette-brand, "black"),
|
137
|
+
"contrast-background": map.get($colour-palette-brand, "black"),
|
141
138
|
)
|
142
139
|
);
|
@@ -1,40 +1,40 @@
|
|
1
1
|
@use "sass:math";
|
2
2
|
@use "./typography";
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
$-largest-medium-device-px: 1024 !default;
|
5
|
+
$-largest-small-device-px: 768 !default;
|
6
|
+
$-largest-tiny-device-px: 480 !default;
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
$-smallest-large-device-em: #{math.div(
|
9
|
+
$-largest-medium-device-px + 1,
|
10
10
|
typography.$base-font-size-px
|
11
11
|
)}em;
|
12
|
-
|
13
|
-
|
12
|
+
$-largest-medium-device-em: #{math.div(
|
13
|
+
$-largest-medium-device-px,
|
14
14
|
typography.$base-font-size-px
|
15
15
|
)}em;
|
16
|
-
|
17
|
-
|
16
|
+
$-smallest-medium-device-em: #{math.div(
|
17
|
+
$-largest-small-device-px + 1,
|
18
18
|
typography.$base-font-size-px
|
19
19
|
)}em;
|
20
|
-
|
21
|
-
|
20
|
+
$-largest-small-device-em: #{math.div(
|
21
|
+
$-largest-small-device-px,
|
22
22
|
typography.$base-font-size-px
|
23
23
|
)}em;
|
24
|
-
|
25
|
-
|
24
|
+
$-smallest-small-device-em: #{math.div(
|
25
|
+
$-largest-tiny-device-px + 1,
|
26
26
|
typography.$base-font-size-px
|
27
27
|
)}em;
|
28
|
-
|
29
|
-
|
28
|
+
$-largest-tiny-device-em: #{math.div(
|
29
|
+
$-largest-tiny-device-px,
|
30
30
|
typography.$base-font-size-px
|
31
31
|
)}em;
|
32
32
|
|
33
|
-
$media-large: "(min-width: #{
|
34
|
-
$media-lt-large: "(max-width: #{
|
35
|
-
$media-medium: "(min-width: #{
|
36
|
-
$media-gt-mobile: "(min-width: #{
|
37
|
-
$media-mobile: "(max-width: #{
|
38
|
-
$media-small: "(min-width: #{
|
39
|
-
$media-gt-tiny: "(min-width: #{
|
40
|
-
$media-tiny: "(max-width: #{
|
33
|
+
$media-large: "(min-width: #{$-smallest-large-device-em})";
|
34
|
+
$media-lt-large: "(max-width: #{$-largest-medium-device-em})";
|
35
|
+
$media-medium: "(min-width: #{$-smallest-medium-device-em}) and (max-width: #{$-largest-medium-device-em})";
|
36
|
+
$media-gt-mobile: "(min-width: #{$-smallest-medium-device-em})";
|
37
|
+
$media-mobile: "(max-width: #{$-largest-small-device-em})";
|
38
|
+
$media-small: "(min-width: #{$-smallest-small-device-em}) and (max-width: #{$-largest-small-device-em})";
|
39
|
+
$media-gt-tiny: "(min-width: #{$-smallest-small-device-em})";
|
40
|
+
$media-tiny: "(max-width: #{$-largest-tiny-device-em})";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nationalarchives/frontend",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.16-prerelease",
|
4
4
|
"description": "The National Archives frontend styles",
|
5
5
|
"scripts": {
|
6
6
|
"start": "storybook dev -p 6006",
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"test": "node tasks/test-fixtures.js && test-storybook --verbose --stories-json",
|
9
9
|
"lint": "prettier --check '{src,.storybook,tasks}/**/*.{js,mjs,scss,json,html}' && stylelint 'src/**/*.scss' && eslint 'src/**/*.mjs'",
|
10
10
|
"lint:fix": "prettier --write '{src,.storybook,tasks}/**/*.{js,mjs,scss,json,html}' && stylelint --fix 'src/**/*.scss' && eslint --fix 'src/**/*.mjs'",
|
11
|
-
"package:sass": "sass --style=compressed --
|
11
|
+
"package:sass": "sass --style=compressed --embed-sources src/nationalarchives/all.scss package/nationalarchives/all.css",
|
12
12
|
"package:scripts": "webpack"
|
13
13
|
},
|
14
14
|
"repository": {
|
@@ -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
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
$tna-assets-path: "/assets" !default;
|
File without changes
|
/package/nationalarchives/stories/utilities/{lists.stories.js → typography/lists.stories.js}
RENAMED
File without changes
|
File without changes
|