@forsakringskassan/docs-generator 1.32.0 → 1.33.0

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.
@@ -1,10 +1,16 @@
1
1
  @charset "UTF-8";
2
- h1,
3
- h2,
4
- h3,
5
- h4,
6
- h5,
7
- h6 {
2
+ :root {
3
+ --docs-breakpoint-sm: 640px;
4
+ --docs-breakpoint-md: 1024px;
5
+ --docs-breakpoint-lg: 1280px;
6
+ }
7
+
8
+ h1:not(.code-preview h1),
9
+ h2:not(.code-preview h2),
10
+ h3:not(.code-preview h3),
11
+ h4:not(.code-preview h4),
12
+ h5:not(.code-preview h5),
13
+ h6:not(.code-preview h6) {
8
14
  font-family: var(--docs-heading-font-family);
9
15
  font-weight: var(--docs-heading-font-weight);
10
16
  line-height: var(--docs-heading-line-height);
@@ -53,7 +59,7 @@ h6 {
53
59
  margin-top: 2rem;
54
60
  }
55
61
 
56
- @media (width >= 640px) {
62
+ @media (width <= 640px) {
57
63
  h1 {
58
64
  font-size: var(--f-font-size-h2);
59
65
  }
@@ -152,7 +158,7 @@ main {
152
158
  padding-right: 2rem;
153
159
  grid-template: "sidenav title" auto "sidenav aside" auto "sidenav content" 1fr/min-content 1fr;
154
160
  }
155
- @media screen and (width >= 1024px) {
161
+ @media screen and (width >= 1280px) {
156
162
  .layout--content-with-menu #primary,
157
163
  .layout--pattern #primary,
158
164
  .layout--component #primary {
@@ -286,18 +292,43 @@ main {
286
292
 
287
293
  #outline {
288
294
  margin-bottom: 1rem;
289
- display: none;
290
- position: sticky;
291
- top: 1rem;
292
- padding-right: 1rem;
293
- max-height: calc(100vh - 2rem);
294
- overflow-y: auto;
295
- max-width: 15rem;
296
- scrollbar-width: thin;
295
+ }
296
+ #outline summary {
297
+ display: flex;
297
298
  }
298
299
  @media (width >= 1280px) {
299
300
  #outline {
300
- display: block;
301
+ position: sticky;
302
+ top: 1rem;
303
+ padding: 0.25rem 1rem 0.25rem 0.25rem;
304
+ overflow-y: auto;
305
+ max-height: calc(100vh - 2rem);
306
+ max-width: 15rem;
307
+ scrollbar-width: thin;
308
+ }
309
+ #outline summary {
310
+ pointer-events: none;
311
+ cursor: text;
312
+ }
313
+ }
314
+ @media (width < 1280px) {
315
+ #outline summary {
316
+ width: min-content;
317
+ cursor: pointer;
318
+ }
319
+ #outline summary::after {
320
+ content: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KPHBhdGggZD0iTTQ2Ny42NTggMTk2LjkxM0wyODMuNjU2IDM3Mi45MDdDMjc1LjkyMiAzODAuMzEzIDI2NS45NTMgMzg0IDI1NiAzODRDMjQ2LjA0NyAzODQgMjM2LjA3OCAzODAuMzEzIDIyOC4zNDQgMzcyLjkwN0w0NC4zNDIgMTk2LjkxM0MyOC4zODkgMTgxLjYzMyAyNy44MjYgMTU2LjMyMSA0My4wOTIgMTQwLjM1M0M1OC4zNzMgMTI0LjM1NCA4My42ODYgMTIzLjg1NCA5OS42NTUgMTM5LjEwM0wyNTYgMjg4LjY2TDQxMi4zNDUgMTM5LjEwM0M0MjguMzE0IDEyMy44MjIgNDUzLjYyNyAxMjQuMzg1IDQ2OC45MDggMTQwLjM1M0M0ODQuMTc0IDE1Ni4zMjEgNDgzLjYxMSAxODEuNjMzIDQ2Ny42NTggMTk2LjkxM1oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K");
321
+ transform: translateY(3px);
322
+ transition: all 200ms cubic-bezier(0.46, 0.03, 0.52, 0.96) 0s;
323
+ margin-left: 0.5rem;
324
+ width: 1rem;
325
+ height: 1rem;
326
+ display: inline;
327
+ }
328
+ #outline[open] > summary::after {
329
+ content: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KPHBhdGggZD0iTTQ2Ny42NTggMTk2LjkxM0wyODMuNjU2IDM3Mi45MDdDMjc1LjkyMiAzODAuMzEzIDI2NS45NTMgMzg0IDI1NiAzODRDMjQ2LjA0NyAzODQgMjM2LjA3OCAzODAuMzEzIDIyOC4zNDQgMzcyLjkwN0w0NC4zNDIgMTk2LjkxM0MyOC4zODkgMTgxLjYzMyAyNy44MjYgMTU2LjMyMSA0My4wOTIgMTQwLjM1M0M1OC4zNzMgMTI0LjM1NCA4My42ODYgMTIzLjg1NCA5OS42NTUgMTM5LjEwM0wyNTYgMjg4LjY2TDQxMi4zNDUgMTM5LjEwM0M0MjguMzE0IDEyMy44MjIgNDUzLjYyNyAxMjQuMzg1IDQ2OC45MDggMTQwLjM1M0M0ODQuMTc0IDE1Ni4zMjEgNDgzLjYxMSAxODEuNjMzIDQ2Ny42NTggMTk2LjkxM1oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K");
330
+ transform: rotate(180deg) translateY(-5px);
331
+ transition: all 200ms cubic-bezier(0.46, 0.03, 0.52, 0.96) 0s;
301
332
  }
302
333
  }
303
334
  #outline::-webkit-scrollbar {
@@ -1,10 +1,16 @@
1
1
  @charset "UTF-8";
2
- h1,
3
- h2,
4
- h3,
5
- h4,
6
- h5,
7
- h6 {
2
+ :root {
3
+ --docs-breakpoint-sm: 640px;
4
+ --docs-breakpoint-md: 1024px;
5
+ --docs-breakpoint-lg: 1280px;
6
+ }
7
+
8
+ h1:not(.code-preview h1),
9
+ h2:not(.code-preview h2),
10
+ h3:not(.code-preview h3),
11
+ h4:not(.code-preview h4),
12
+ h5:not(.code-preview h5),
13
+ h6:not(.code-preview h6) {
8
14
  font-family: var(--docs-heading-font-family);
9
15
  font-weight: var(--docs-heading-font-weight);
10
16
  line-height: var(--docs-heading-line-height);
@@ -53,7 +59,7 @@ h6 {
53
59
  margin-top: 2rem;
54
60
  }
55
61
 
56
- @media (width >= 640px) {
62
+ @media (width <= 640px) {
57
63
  h1 {
58
64
  font-size: var(--f-font-size-h2);
59
65
  }
@@ -152,7 +158,7 @@ main {
152
158
  padding-right: 2rem;
153
159
  grid-template: "sidenav title" auto "sidenav aside" auto "sidenav content" 1fr/min-content 1fr;
154
160
  }
155
- @media screen and (width >= 1024px) {
161
+ @media screen and (width >= 1280px) {
156
162
  .layout--content-with-menu #primary,
157
163
  .layout--pattern #primary,
158
164
  .layout--component #primary {
@@ -286,18 +292,43 @@ main {
286
292
 
287
293
  #outline {
288
294
  margin-bottom: 1rem;
289
- display: none;
290
- position: sticky;
291
- top: 1rem;
292
- padding-right: 1rem;
293
- max-height: calc(100vh - 2rem);
294
- overflow-y: auto;
295
- max-width: 15rem;
296
- scrollbar-width: thin;
295
+ }
296
+ #outline summary {
297
+ display: flex;
297
298
  }
298
299
  @media (width >= 1280px) {
299
300
  #outline {
300
- display: block;
301
+ position: sticky;
302
+ top: 1rem;
303
+ padding: 0.25rem 1rem 0.25rem 0.25rem;
304
+ overflow-y: auto;
305
+ max-height: calc(100vh - 2rem);
306
+ max-width: 15rem;
307
+ scrollbar-width: thin;
308
+ }
309
+ #outline summary {
310
+ pointer-events: none;
311
+ cursor: text;
312
+ }
313
+ }
314
+ @media (width < 1280px) {
315
+ #outline summary {
316
+ width: min-content;
317
+ cursor: pointer;
318
+ }
319
+ #outline summary::after {
320
+ content: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KPHBhdGggZD0iTTQ2Ny42NTggMTk2LjkxM0wyODMuNjU2IDM3Mi45MDdDMjc1LjkyMiAzODAuMzEzIDI2NS45NTMgMzg0IDI1NiAzODRDMjQ2LjA0NyAzODQgMjM2LjA3OCAzODAuMzEzIDIyOC4zNDQgMzcyLjkwN0w0NC4zNDIgMTk2LjkxM0MyOC4zODkgMTgxLjYzMyAyNy44MjYgMTU2LjMyMSA0My4wOTIgMTQwLjM1M0M1OC4zNzMgMTI0LjM1NCA4My42ODYgMTIzLjg1NCA5OS42NTUgMTM5LjEwM0wyNTYgMjg4LjY2TDQxMi4zNDUgMTM5LjEwM0M0MjguMzE0IDEyMy44MjIgNDUzLjYyNyAxMjQuMzg1IDQ2OC45MDggMTQwLjM1M0M0ODQuMTc0IDE1Ni4zMjEgNDgzLjYxMSAxODEuNjMzIDQ2Ny42NTggMTk2LjkxM1oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K");
321
+ transform: translateY(3px);
322
+ transition: all 200ms cubic-bezier(0.46, 0.03, 0.52, 0.96) 0s;
323
+ margin-left: 0.5rem;
324
+ width: 1rem;
325
+ height: 1rem;
326
+ display: inline;
327
+ }
328
+ #outline[open] > summary::after {
329
+ content: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KPHBhdGggZD0iTTQ2Ny42NTggMTk2LjkxM0wyODMuNjU2IDM3Mi45MDdDMjc1LjkyMiAzODAuMzEzIDI2NS45NTMgMzg0IDI1NiAzODRDMjQ2LjA0NyAzODQgMjM2LjA3OCAzODAuMzEzIDIyOC4zNDQgMzcyLjkwN0w0NC4zNDIgMTk2LjkxM0MyOC4zODkgMTgxLjYzMyAyNy44MjYgMTU2LjMyMSA0My4wOTIgMTQwLjM1M0M1OC4zNzMgMTI0LjM1NCA4My42ODYgMTIzLjg1NCA5OS42NTUgMTM5LjEwM0wyNTYgMjg4LjY2TDQxMi4zNDUgMTM5LjEwM0M0MjguMzE0IDEyMy44MjIgNDUzLjYyNyAxMjQuMzg1IDQ2OC45MDggMTQwLjM1M0M0ODQuMTc0IDE1Ni4zMjEgNDgzLjYxMSAxODEuNjMzIDQ2Ny42NTggMTk2LjkxM1oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPgo8L3N2Zz4K");
330
+ transform: rotate(180deg) translateY(-5px);
331
+ transition: all 200ms cubic-bezier(0.46, 0.03, 0.52, 0.96) 0s;
301
332
  }
302
333
  }
303
334
  #outline::-webkit-scrollbar {
@@ -853,6 +884,13 @@ kbd {
853
884
  background-color: #f4f4f4;
854
885
  }
855
886
 
887
+ .cookie-warning {
888
+ background: var(--docs-cookie-background-color);
889
+ border-bottom: 2px solid var(--docs-cookie-border-color);
890
+ display: none;
891
+ padding: 1rem 1.5rem 0;
892
+ }
893
+
856
894
  :root {
857
895
  --docs-font-family: arial, "Helvetica Neue", sans-serif;
858
896
  --docs-font-weight: normal;
@@ -869,6 +907,8 @@ kbd {
869
907
  --docs-version-text-color: var(--docs-text-color-discrete);
870
908
  --docs-version-link-color: var(--docs-text-color-discrete);
871
909
  --docs-version-hover-color: var(--docs-text-color-default);
910
+ --docs-cookie-background-color: #f5f6fa;
911
+ --docs-cookie-border-color: #4a52b6;
872
912
  }
873
913
 
874
914
  *,
@@ -1,3 +1,10 @@
1
+ .cookie-warning {
2
+ background: var(--docs-cookie-background-color);
3
+ border-bottom: 2px solid var(--docs-cookie-border-color);
4
+ display: none;
5
+ padding: 1rem 1.5rem 0;
6
+ }
7
+
1
8
  :root {
2
9
  --docs-font-family: arial, "Helvetica Neue", sans-serif;
3
10
  --docs-font-weight: normal;
@@ -14,6 +21,8 @@
14
21
  --docs-version-text-color: var(--docs-text-color-discrete);
15
22
  --docs-version-link-color: var(--docs-text-color-discrete);
16
23
  --docs-version-hover-color: var(--docs-text-color-default);
24
+ --docs-cookie-background-color: #f5f6fa;
25
+ --docs-cookie-border-color: #4a52b6;
17
26
  }
18
27
 
19
28
  *,
@@ -76,6 +85,12 @@ textarea {
76
85
  margin: 0;
77
86
  }
78
87
 
88
+ :root {
89
+ --docs-breakpoint-sm: 640px;
90
+ --docs-breakpoint-md: 1024px;
91
+ --docs-breakpoint-lg: 1280px;
92
+ }
93
+
79
94
  .version {
80
95
  color: var(--docs-text-color-discrete);
81
96
  text-wrap: nowrap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/docs-generator",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "Documentation generator",
5
5
  "keywords": [
6
6
  "documentation"
@@ -13,6 +13,7 @@
13
13
  "license": "MIT",
14
14
  "author": "Försäkringskassan",
15
15
  "sideEffects": [
16
+ "dist/runtime-bootstrap.js",
16
17
  "dist/runtime.js",
17
18
  "src/runtime/**/*"
18
19
  ],
@@ -81,6 +81,7 @@
81
81
  {%- endfor -%}
82
82
 
83
83
  <main>
84
+ <!-- [html-validate-disable-next heading-level, no-unused-disable -- allowed sectioning root] -->
84
85
  <h1 id="title">{{ doc.attributes.title }}</h1>
85
86
  {% set arr = ['component', 'pattern'] %} {% if doc.attributes.layout in arr %}
86
87
  <div id="aside">
@@ -88,14 +89,17 @@
88
89
  {%- block aside %}
89
90
  {%- endblock %}
90
91
 
91
- <div id="outline">
92
- <h2 class="outline__heading">Innehåll</h2>
92
+
93
+ {% if doc.outline | length %}
94
+ <details id="outline">
95
+ <summary class="outline__heading">Innehåll</summary>
93
96
  <ul>
94
97
  {% for heading in doc.outline %}
95
98
  <li><a href="#{{ heading.anchor }}">{{ heading.title | escape }}</a></li>
96
99
  {% endfor %}
97
100
  </ul>
98
- </div>
101
+ </details>
102
+ {% endif %}
99
103
  </div>
100
104
  {% endif %}
101
105
 
@@ -0,0 +1,19 @@
1
+ <div class="cookie-warning">
2
+ <!-- [html-validate-disable-next heading-level, no-unused-disable -- allowed sectioning root] -->
3
+ <h1>Kakor på webbplatsen</h1>
4
+ <p>
5
+ Vi använder kakor (cookies) för att webbplatsen ska fungera så bra som möjligt för dig.<br />
6
+ Vi använder också kakor för webbanalys för att göra webbplatsen bättre.
7
+ </p>
8
+ <p>Godkänner du att vi också använder kakor för webbanalys?</p>
9
+
10
+ <div class="button-group">
11
+ <button id="consent-all-button" class="button button-group__item button--primary" type="button">
12
+ Ja, jag godkänner alla kakor
13
+ </button>
14
+
15
+ <button id="consent-functional-button" class="button button-group__item button--secondary" type="button">
16
+ Nej, jag godkänner bara nödvändiga kakor
17
+ </button>
18
+ </div>
19
+ </div>
@@ -1,29 +1,33 @@
1
1
  <script>
2
2
  (() => {
3
- const allowedHostnames = {{ hostname | json }};
4
- if (allowedHostnames.length === 0 || allowedHostnames.includes(location.hostname)) {
5
- /* Matomo */
6
- var _paq = (window._paq = window._paq || []);
7
- _paq.push(["setAPIUrl", "{{ apiUrl }}"]);
8
- _paq.push(["trackPageView"]);
9
- _paq.push(["enableLinkTracking"]);
10
- (function () {
11
- var u = "{{ trackerUrl }}";
12
- _paq.push(["setTrackerUrl", u + "matomo.php"]);
13
- _paq.push(["setSiteId", "{{ siteId }}"]);
14
- var d = document,
15
- g = d.createElement("script"),
16
- s = d.getElementsByTagName("script")[0];
17
- g.async = true;
18
- g.src = u + "matomo.js";
19
- s.parentNode.insertBefore(g, s);
20
- })();
21
- /* End Matomo Code */
22
- } else {
23
- console.error(
24
- "Matomo analytics disabled as we are not running on one of the configured hostnames",
25
- allowedHostnames,
26
- );
27
- }
3
+ withCookieConsent(() => {
4
+ const allowedHostnames = {{ hostname | json }};
5
+ if (allowedHostnames.length === 0 || allowedHostnames.includes(location.hostname)) {
6
+ /* Matomo */
7
+ var _paq = (window._paq = window._paq || []);
8
+ {% if apiUrl %}
9
+ _paq.push(["setAPIUrl", "{{ apiUrl }}"]);
10
+ {% endif %}
11
+ _paq.push(["trackPageView"]);
12
+ _paq.push(["enableLinkTracking"]);
13
+ (function () {
14
+ var u = "{{ trackerUrl }}";
15
+ _paq.push(["setTrackerUrl", u + "matomo.php"]);
16
+ _paq.push(["setSiteId", "{{ siteId }}"]);
17
+ var d = document,
18
+ g = d.createElement("script"),
19
+ s = d.getElementsByTagName("script")[0];
20
+ g.async = true;
21
+ g.src = u + "matomo.js";
22
+ s.parentNode.insertBefore(g, s);
23
+ })();
24
+ /* End Matomo Code */
25
+ } else {
26
+ console.error(
27
+ "Matomo analytics disabled as we are not running on one of the configured hostnames",
28
+ allowedHostnames,
29
+ );
30
+ }
31
+ });
28
32
  })();
29
33
  </script>