@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.
Files changed (89) hide show
  1. package/LICENCE +21 -0
  2. package/nationalarchives/all.css +1 -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.mjs +7 -7
  7. package/nationalarchives/all.scss +2 -5
  8. package/nationalarchives/components/_index.scss +1 -0
  9. package/nationalarchives/components/breadcrumbs/_index.scss +54 -39
  10. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +2 -0
  11. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -0
  12. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +67 -0
  13. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +10 -3
  14. package/nationalarchives/components/breadcrumbs/fixtures.json +23 -1
  15. package/nationalarchives/components/breadcrumbs/macro-options.json +6 -0
  16. package/nationalarchives/components/breadcrumbs/template.njk +17 -12
  17. package/nationalarchives/components/button/_index.scss +1 -2
  18. package/nationalarchives/components/button/button.stories.js +2 -3
  19. package/nationalarchives/components/button/fixtures.json +5 -5
  20. package/nationalarchives/components/button/template.njk +1 -1
  21. package/nationalarchives/components/card/_index.scss +78 -34
  22. package/nationalarchives/components/card/card.stories.js +72 -5
  23. package/nationalarchives/components/card/fixtures.json +15 -2
  24. package/nationalarchives/components/card/macro-options.json +6 -12
  25. package/nationalarchives/components/card/template.njk +6 -6
  26. package/nationalarchives/components/filters/filters.stories.js +3 -4
  27. package/nationalarchives/components/footer/_index.scss +8 -14
  28. package/nationalarchives/components/footer/footer.stories.js +2 -3
  29. package/nationalarchives/components/footer/template.njk +1 -1
  30. package/nationalarchives/components/grid/_index.scss +2 -2
  31. package/nationalarchives/components/grid/grid.stories.js +2 -3
  32. package/nationalarchives/components/header/_index.scss +27 -26
  33. package/nationalarchives/components/header/header.stories.js +2 -3
  34. package/nationalarchives/components/header/template.njk +1 -1
  35. package/nationalarchives/components/hero/_index.scss +7 -20
  36. package/nationalarchives/components/hero/hero.stories.js +2 -3
  37. package/nationalarchives/components/index-grid/_index.scss +17 -1
  38. package/nationalarchives/components/index-grid/index-grid.stories.js +7 -5
  39. package/nationalarchives/components/index-grid/macro-options.json +22 -2
  40. package/nationalarchives/components/index-grid/template.njk +12 -6
  41. package/nationalarchives/components/message/_index.scss +4 -6
  42. package/nationalarchives/components/message/phase-banner.stories.js +2 -3
  43. package/nationalarchives/components/phase-banner/phase-banner.stories.js +2 -3
  44. package/nationalarchives/components/picture/_index.scss +12 -15
  45. package/nationalarchives/components/picture/picture.stories.js +2 -3
  46. package/nationalarchives/components/profile/profile.stories.js +2 -3
  47. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -4
  48. package/nationalarchives/components/skip-link/_index.scss +63 -0
  49. package/nationalarchives/components/skip-link/fixtures.json +11 -0
  50. package/nationalarchives/components/skip-link/macro-options.json +26 -0
  51. package/nationalarchives/components/skip-link/macro.njk +3 -0
  52. package/nationalarchives/components/skip-link/skip-link.stories.js +31 -0
  53. package/nationalarchives/components/skip-link/template.njk +4 -0
  54. package/nationalarchives/components/tabs/_index.scss +7 -14
  55. package/nationalarchives/components/tabs/tabs.stories.js +2 -3
  56. package/nationalarchives/patterns/featured-collection/_index.scss +2 -2
  57. package/nationalarchives/patterns/featured-collection/featured-collection.stories.js +3 -4
  58. package/nationalarchives/patterns/featured-collection/template.njk +2 -2
  59. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.mdx +85 -0
  60. package/nationalarchives/stories/utilities/{colour.stories.js → colour-schemes/colour-schemes.stories.js} +142 -52
  61. package/nationalarchives/stories/utilities/overrides/overrides.mdx +66 -0
  62. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +30 -0
  63. package/nationalarchives/stories/utilities/{headings.stories.js → typography/headings.stories.js} +2 -1
  64. package/nationalarchives/stories/utilities/typography/typography.stories.js +34 -0
  65. package/nationalarchives/templates/layouts/_generic.njk +10 -8
  66. package/nationalarchives/tools/_colour.scss +105 -16
  67. package/nationalarchives/tools/_index.scss +0 -1
  68. package/nationalarchives/tools/_typography.scss +13 -1
  69. package/nationalarchives/utilities/_debug.scss +41 -1
  70. package/nationalarchives/utilities/_global.scss +13 -4
  71. package/nationalarchives/utilities/_index.scss +1 -0
  72. package/nationalarchives/utilities/_overrides.scss +30 -0
  73. package/nationalarchives/utilities/_typography.scss +42 -34
  74. package/nationalarchives/variables/_colour.scss +103 -106
  75. package/nationalarchives/variables/_grid.scss +1 -1
  76. package/nationalarchives/variables/_index.scss +1 -1
  77. package/nationalarchives/variables/_media.scss +23 -23
  78. package/nationalarchives/variables/_spacing.scss +15 -0
  79. package/nationalarchives/variables/_typography.scss +2 -1
  80. package/package.json +2 -2
  81. package/nationalarchives/components/card/card.js +0 -2
  82. package/nationalarchives/components/card/card.js.map +0 -1
  83. package/nationalarchives/components/card/card.mjs +0 -45
  84. package/nationalarchives/stories/utilities/typography.stories.js +0 -29
  85. package/nationalarchives/tools/_assets.scss +0 -5
  86. package/nationalarchives/variables/_assets.scss +0 -1
  87. /package/nationalarchives/stories/utilities/{heading-groups.stories.js → typography/heading-groups.stories.js} +0 -0
  88. /package/nationalarchives/stories/utilities/{lists.stories.js → typography/lists.stories.js} +0 -0
  89. /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
- $-tna-black: #000;
5
- $-tna-grey: #8c9694;
6
- $-tna-light-grey: #d9d9d6;
7
- $-tna-white: #fff;
4
+ $colour-palette-brand: (
5
+ "black": #000,
6
+ "grey": #8c9694,
7
+ "light-grey": #d9d9d6,
8
+ "white": #fff,
8
9
 
9
- $-tna-yellow: #fc0;
10
- $-tna-pink: #fe1d57;
11
- $-tna-orange: #fd3f03;
12
- $-tna-green: #86bc25;
13
- $-tna-blue: #00b0ff;
10
+ "yellow": #fc0,
11
+ "pink": #fe1d57,
12
+ "orange": #fd3f03,
13
+ "green": #86bc25,
14
+ "blue": #00b0ff,
14
15
 
15
- $-tna-brown: #654e37;
16
- $-tna-maroon: #9c193a;
17
- $-tna-chestnut: #8f3415;
18
- $-tna-forest: #00623b;
19
- $-tna-navy: #004c7e;
16
+ "brown": #654e37,
17
+ "maroon": #9c193a,
18
+ "chestnut": #8f3415,
19
+ "forest": #00623b,
20
+ "navy": #004c7e,
20
21
 
21
- $-tna-cream: #f9f7e2;
22
- $-tna-pastel-pink: #fad3d4;
23
- $-tna-pastel-orange: #f9e1bc;
24
- $-tna-pastel-green: #dde5d5;
25
- $-tna-pastel-blue: #d4e5ef;
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
- @function accent-colour-dark() {
48
- // @return $-accent-colour-dark or -accent-colour();
49
- @return $-accent-colour-dark or accent-colour();
50
- }
29
+ $dark-grey: #26262a;
30
+ $base-font: #343338;
51
31
 
52
- // TODO: Scoped variables should not be used directly outside of this file
53
- $tna-black: $-tna-black;
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": $-tna-white,
64
- "font-base": $-base-font,
65
- "font-dark": $-tna-black,
66
- "font-light": rgba($-base-font, 0.7),
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": $-tna-blue,
47
+ // "focus-outline": #004c7e, // Old value
48
+ "focus-outline": map.get($colour-palette-brand, "blue"),
71
49
  "keyline": #ccc,
72
- "keyline-dark": $-dark-grey,
73
- "accent": accent-colour(),
74
- "button-primary-text": $-tna-white,
75
- "button-primary-background": $-tna-black,
76
- "button-primary-hover-text": $-tna-black,
77
- "button-primary-hover-background": $-tna-white,
78
- "button-secondary-text": $-tna-black,
79
- "button-secondary-background": $-tna-yellow,
80
- "button-secondary-hover-text": $-tna-black,
81
- "button-secondary-hover-background": $-tna-white,
82
- "contrast-background": $-dark-grey,
83
- "contrast-font-base": $-tna-white,
84
- "contrast-font-dark": $-tna-white,
85
- "contrast-font-light": rgba($-tna-white, 0.7),
86
- "contrast-link": $-tna-white,
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($-tna-white, 0.5),
89
- "contrast-keyline-dark": rgba($-tna-white, 0.8),
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": #111,
96
- "font-base": rgba($-tna-white, 0.95),
97
- "font-dark": $-tna-white,
98
- "font-light": rgba($-tna-white, 0.5),
99
- "link": $-tna-blue,
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($-tna-white, 0.5),
102
- "keyline-dark": $-tna-white,
103
- "accent": accent-colour-dark(),
104
- "contrast-background": #222,
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": $-tna-black,
114
- "font-light": $-tna-black,
115
- "link": $-tna-black,
116
- "link-visited": $-tna-black,
117
- "focus-outline": $-tna-orange,
118
- "keyline": $-tna-black,
119
- "keyline-dark": $-tna-black,
120
- "contrast-background": #f0f0f0,
121
- "contrast-font-base": $-tna-black,
122
- "contrast-font-dark": $-tna-black,
123
- "contrast-font-light": rgba($-tna-black, 0.7),
124
- "contrast-link": $-tna-black,
125
- "contrast-link-visited": $-tna-black,
126
- "contrast-keyline": rgba($-tna-black, 0.5),
127
- "contrast-keyline-dark": rgba($-tna-black, 0.8),
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": $tna-black,
135
- "font-base": $-tna-white,
136
- "font-light": $-tna-white,
137
- "link": $-tna-white,
138
- "link-visited": $-tna-white,
139
- "keyline": $-tna-white,
140
- "contrast-background": #111,
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,7 +1,7 @@
1
1
  $largest-container-width: 75.25rem !default;
2
2
 
3
3
  $gutter-width: 2rem !default;
4
- $gutter-width-mobile: 0.75rem !default;
4
+ $gutter-width-mobile: 1rem !default;
5
5
 
6
6
  $column-count: 12 !default;
7
7
  $column-count-medium: 6 !default;
@@ -1,5 +1,5 @@
1
- @use "assets";
2
1
  @use "colour";
3
2
  @use "grid";
4
3
  @use "media";
4
+ @use "spacing";
5
5
  @use "typography";
@@ -1,40 +1,40 @@
1
1
  @use "sass:math";
2
2
  @use "./typography";
3
3
 
4
- $largest-medium-device-px: 1024 !default;
5
- $largest-small-device-px: 768 !default;
6
- $largest-tiny-device-px: 480 !default;
4
+ $-largest-medium-device-px: 1024 !default;
5
+ $-largest-small-device-px: 768 !default;
6
+ $-largest-tiny-device-px: 480 !default;
7
7
 
8
- $smallest-large-device-em: #{math.div(
9
- $largest-medium-device-px + 1,
8
+ $-smallest-large-device-em: #{math.div(
9
+ $-largest-medium-device-px + 1,
10
10
  typography.$base-font-size-px
11
11
  )}em;
12
- $largest-medium-device-em: #{math.div(
13
- $largest-medium-device-px,
12
+ $-largest-medium-device-em: #{math.div(
13
+ $-largest-medium-device-px,
14
14
  typography.$base-font-size-px
15
15
  )}em;
16
- $smallest-medium-device-em: #{math.div(
17
- $largest-small-device-px + 1,
16
+ $-smallest-medium-device-em: #{math.div(
17
+ $-largest-small-device-px + 1,
18
18
  typography.$base-font-size-px
19
19
  )}em;
20
- $largest-small-device-em: #{math.div(
21
- $largest-small-device-px,
20
+ $-largest-small-device-em: #{math.div(
21
+ $-largest-small-device-px,
22
22
  typography.$base-font-size-px
23
23
  )}em;
24
- $smallest-small-device-em: #{math.div(
25
- $largest-tiny-device-px + 1,
24
+ $-smallest-small-device-em: #{math.div(
25
+ $-largest-tiny-device-px + 1,
26
26
  typography.$base-font-size-px
27
27
  )}em;
28
- $largest-tiny-device-em: #{math.div(
29
- $largest-tiny-device-px,
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: #{$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})";
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})";
@@ -0,0 +1,15 @@
1
+ $spacing: (
2
+ "xs": 0.5,
3
+ "s": 1,
4
+ "m": 2,
5
+ "l": 3,
6
+ "xl": 6,
7
+ );
8
+
9
+ $spacing-mobile: (
10
+ "xs": 0.5,
11
+ "s": 0.75,
12
+ "m": 1.5,
13
+ "l": 2,
14
+ "xl": 3,
15
+ );
@@ -1,7 +1,8 @@
1
1
  $base-font-size-px: 16;
2
2
 
3
3
  $font-family-main: "Open Sans", sans-serif;
4
- $font-weight-main: 400;
4
+ $font-weight-main: 500;
5
+ $font-weight-main-bold: 700;
5
6
 
6
7
  $font-family-heading: supria-sans-condensed, sans-serif;
7
8
  $font-weight-heading: 400;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nationalarchives/frontend",
3
- "version": "0.1.14-prerelease",
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 --quiet-deps src/nationalarchives/all.scss package/nationalarchives/all.css",
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,5 +0,0 @@
1
- @use "../variables/assets";
2
-
3
- @function tna-asset-url($asset) {
4
- @return #{assets.$tna-assets-path}/#{$asset};
5
- }
@@ -1 +0,0 @@
1
- $tna-assets-path: "/assets" !default;