@onsvisual/svelte-components 0.0.6 → 0.0.8
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/dist/@types/datavis/Table/Table.svelte.d.ts +4 -4
- package/dist/@types/datavis/shared/data.d.ts +6 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/inputs/Button/Button.svelte.d.ts +2 -2
- package/dist/@types/inputs/Dropdown/Dropdown.svelte.d.ts +2 -2
- package/dist/@types/inputs/ErrorSummary/ErrorSummary.svelte.d.ts +27 -0
- package/dist/@types/inputs/Input/Input.svelte.d.ts +2 -2
- package/dist/@types/inputs/Select/Select.svelte.d.ts +2 -2
- package/dist/@types/inputs/Textarea/Textarea.svelte.d.ts +2 -2
- package/dist/@types/layout/Accordion/AccordionItem.svelte.d.ts +2 -2
- package/dist/@types/layout/AnalyticsBanner/AnalyticsBanner.svelte.d.ts +30 -0
- package/dist/@types/layout/BackLink/Backlink.svelte.d.ts +23 -0
- package/dist/@types/layout/Breadcrumb/Breadcrumb.svelte.d.ts +23 -0
- package/dist/@types/layout/Contents/Contents.svelte.d.ts +29 -0
- package/dist/@types/layout/ErrorPage/ErrorPage.svelte.d.ts +25 -0
- package/dist/@types/layout/Grid/Grid.svelte.d.ts +2 -2
- package/dist/@types/layout/Header/Header.svelte.d.ts +2 -2
- package/dist/@types/layout/Hero/Hero.svelte.d.ts +2 -2
- package/dist/@types/layout/NavSections/NavSection.svelte.d.ts +2 -2
- package/dist/@types/layout/Notice/Notice.svelte.d.ts +31 -0
- package/dist/@types/layout/PhaseBanner/PhaseBanner.svelte.d.ts +25 -0
- package/dist/@types/layout/Scroller/Scroller.svelte.d.ts +2 -2
- package/dist/@types/layout/Scroller/ScrollerSection.svelte.d.ts +2 -2
- package/dist/@types/layout/Section/Section.svelte.d.ts +2 -2
- package/dist/@types/layout/ShareButtons/ShareButtons.svelte.d.ts +33 -0
- package/dist/@types/layout/Summary/Summary.svelte.d.ts +25 -0
- package/dist/@types/layout/Survey/Survey.svelte.d.ts +23 -0
- package/dist/@types/layout/Survey/init-survey.d.ts +1 -0
- package/dist/@types/layout/Tabs/Tab.svelte.d.ts +31 -0
- package/dist/@types/layout/Tabs/Tabs.svelte.d.ts +27 -0
- package/dist/@types/layout/TitleBlock/TitleBlock.svelte.d.ts +2 -2
- package/dist/datavis/Table/Table.svelte +1 -1
- package/dist/datavis/shared/data.js +18 -0
- package/dist/decorators/Divider/Divider.svelte +1 -1
- package/dist/index.js +2 -0
- package/dist/inputs/ErrorSummary/ErrorSummary.svelte +21 -0
- package/dist/layout/Accordion/AccordionItem.svelte +1 -1
- package/dist/layout/AnalyticsBanner/AnalyticsBanner.svelte +256 -0
- package/dist/layout/BackLink/Backlink.svelte +32 -0
- package/dist/layout/Breadcrumb/Breadcrumb.svelte +39 -0
- package/dist/layout/Contents/Contents.svelte +44 -0
- package/dist/layout/ErrorPage/ErrorPage.svelte +39 -0
- package/dist/layout/Filler/Filler.svelte +1 -1
- package/dist/layout/Footer/Footer.svelte +1 -1
- package/dist/layout/Grid/Grid.svelte +1 -1
- package/dist/layout/Header/Header.svelte +2 -2
- package/dist/layout/Hero/Hero.svelte +2 -2
- package/dist/layout/NavSections/NavSection.svelte +3 -3
- package/dist/layout/Notice/Notice.svelte +54 -0
- package/dist/layout/PhaseBanner/PhaseBanner.svelte +40 -0
- package/dist/layout/Scroller/ScrollerSection.svelte +3 -3
- package/dist/layout/Section/Section.svelte +4 -4
- package/dist/layout/ShareButtons/ShareButtons.svelte +177 -0
- package/dist/layout/Summary/Summary.svelte +51 -0
- package/dist/layout/Survey/Survey.svelte +96 -0
- package/dist/layout/Survey/init-survey.js +230 -0
- package/dist/layout/Tabs/Tab.svelte +48 -0
- package/dist/layout/Tabs/Tabs.svelte +85 -0
- package/dist/layout/TitleBlock/Meta.svelte +1 -1
- package/dist/layout/TitleBlock/TitleBlock.svelte +1 -1
- package/package.json +17 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TabsProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TabsEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TabsSlots */
|
|
4
|
+
export default class Tabs extends SvelteComponentTyped<{
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type TabsProps = typeof __propDef.props;
|
|
13
|
+
export type TabsEvents = typeof __propDef.events;
|
|
14
|
+
export type TabsSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
compact?: boolean;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -5,8 +5,8 @@ export default class TitleBlock extends SvelteComponentTyped<{
|
|
|
5
5
|
theme?: "light" | "dark" | "lightblue";
|
|
6
6
|
background?: string;
|
|
7
7
|
themeOverrides?: any;
|
|
8
|
-
title?: string;
|
|
9
8
|
meta?: any[];
|
|
9
|
+
title?: string;
|
|
10
10
|
natStatBadge?: boolean;
|
|
11
11
|
censusLogo?: boolean;
|
|
12
12
|
}, {
|
|
@@ -26,8 +26,8 @@ declare const __propDef: {
|
|
|
26
26
|
theme?: "light" | "dark" | "lightblue";
|
|
27
27
|
background?: string;
|
|
28
28
|
themeOverrides?: object;
|
|
29
|
-
title?: string;
|
|
30
29
|
meta?: any[];
|
|
30
|
+
title?: string;
|
|
31
31
|
natStatBadge?: boolean;
|
|
32
32
|
censusLogo?: boolean;
|
|
33
33
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{ year: 2017, value: 320, group: "apples" },
|
|
3
|
+
{ year: 2017, value: 480, group: "bananas" },
|
|
4
|
+
{ year: 2017, value: 640, group: "cherries" },
|
|
5
|
+
{ year: 2017, value: 400, group: "dates" },
|
|
6
|
+
{ year: 2018, value: 640, group: "apples" },
|
|
7
|
+
{ year: 2018, value: 960, group: "bananas" },
|
|
8
|
+
{ year: 2018, value: 640, group: "cherries" },
|
|
9
|
+
{ year: 2018, value: 400, group: "dates" },
|
|
10
|
+
{ year: 2019, value: 1600, group: "apples" },
|
|
11
|
+
{ year: 2019, value: 1440, group: "bananas" },
|
|
12
|
+
{ year: 2019, value: 960, group: "cherries" },
|
|
13
|
+
{ year: 2019, value: 400, group: "dates" },
|
|
14
|
+
{ year: 2020, value: 3840, group: "apples" },
|
|
15
|
+
{ year: 2020, value: 1920, group: "bananas" },
|
|
16
|
+
{ year: 2020, value: 960, group: "cherries" },
|
|
17
|
+
{ year: 2020, value: 400, group: "dates" },
|
|
18
|
+
];
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ export { default as Theme } from "./wrappers/Theme/Theme.svelte";
|
|
|
6
6
|
|
|
7
7
|
// Layout
|
|
8
8
|
export { default as Accordion } from "./layout/Accordion/Accordion.svelte";
|
|
9
|
+
export { default as AnalyticsBanner } from "./layout/AnalyticsBanner/AnalyticsBanner.svelte";
|
|
10
|
+
export { AnalyticsEvent } from "./layout/AnalyticsBanner/AnalyticsBanner.svelte";
|
|
9
11
|
export { default as Filler } from "./layout/Filler/Filler.svelte";
|
|
10
12
|
export { default as Footer } from "./layout/Footer/Footer.svelte";
|
|
11
13
|
export { default as Grid } from "./layout/Grid/Grid.svelte";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Defines the title of the error
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
export let title = "";
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div aria-labelledby="alert" role="alert" tabindex="-1" class="ons-panel ons-panel--error">
|
|
10
|
+
<div class="ons-panel__header">
|
|
11
|
+
<h2 id="alert" data-qa="error-header" class="ons-panel__title ons-u-fs-r--b">{title}</h2>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="ons-panel__body">
|
|
14
|
+
<slot />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.ons-panel {
|
|
20
|
+
color: rgb(34, 34, 34);
|
|
21
|
+
}</style>
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
<script context="module">
|
|
2
|
+
export function analyticsEvent(props) {
|
|
3
|
+
if (window?.dataLayer) window.dataLayer.push(props);
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { onMount, getContext } from "svelte";
|
|
9
|
+
|
|
10
|
+
const page = getContext("page"); // Optional: Set Svelte Kit's page store to the context to track navigation in multi-page apps
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Google analytics/tags manager ID
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
export let analyticsId = "GTM-MBCBVQS";
|
|
17
|
+
/**
|
|
18
|
+
* Optional props to describe the content
|
|
19
|
+
* @type {object}
|
|
20
|
+
*/
|
|
21
|
+
export let analyticsProps = {};
|
|
22
|
+
/**
|
|
23
|
+
* Bind to this value if you need to know if cookies have been accepted
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
*/
|
|
26
|
+
export let usageCookies = false;
|
|
27
|
+
/**
|
|
28
|
+
* Set the width of the banner
|
|
29
|
+
* @type {"medium"|"wide"}
|
|
30
|
+
*/
|
|
31
|
+
export let width = "medium";
|
|
32
|
+
|
|
33
|
+
let live; // Don't run analytics unless page is live on ONS site (re-set in the onMount function)
|
|
34
|
+
let showBanner = false;
|
|
35
|
+
let showConfirm = false;
|
|
36
|
+
let message = "";
|
|
37
|
+
let lang = $page && $page.url.host.startsWith("cy") ? "cy" : "en";
|
|
38
|
+
let location = null; // For keeping track of navigation multi-page apps
|
|
39
|
+
|
|
40
|
+
function hasCookiesPreferencesSet() {
|
|
41
|
+
return -1 < document.cookie.indexOf("cookies_preferences_set=true");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Check if usage cookies are allowed (for Google Analytics + Hotjar)
|
|
45
|
+
function getUsageCookieValue() {
|
|
46
|
+
var cookiesPolicyCookie = document.cookie.match(
|
|
47
|
+
new RegExp("(^|;) ?cookies_policy=([^;]*)(;|$)")
|
|
48
|
+
);
|
|
49
|
+
if (cookiesPolicyCookie) {
|
|
50
|
+
var decodedCookie = decodeURIComponent(cookiesPolicyCookie[2]);
|
|
51
|
+
var cookieValue = JSON.parse(decodedCookie);
|
|
52
|
+
return cookieValue.usage;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Set site cookie with 'all' or 'essential' cookies
|
|
58
|
+
function setCookie(option) {
|
|
59
|
+
let oneYearInSeconds = 60 * 60 * 24 * 365;
|
|
60
|
+
let cookiesDomain = window.location.hostname;
|
|
61
|
+
let cookiesPreference = !0;
|
|
62
|
+
let encodedCookiesPolicy = `%7B%22essential%22%3Atrue%2C%22usage%22%3A${
|
|
63
|
+
option == "all" ? "true" : "false"
|
|
64
|
+
}%7D`;
|
|
65
|
+
let cookiesPath = "/";
|
|
66
|
+
|
|
67
|
+
document.cookie = `cookies_preferences_set=${cookiesPreference};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
|
|
68
|
+
document.cookie = `cookies_policy=${encodedCookiesPolicy};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
|
|
69
|
+
|
|
70
|
+
message = `You have ${option == "all" ? "accepted" : "rejected"} all additional cookies.`;
|
|
71
|
+
if (option == "all") usageCookies = true;
|
|
72
|
+
showConfirm = true;
|
|
73
|
+
|
|
74
|
+
if (option == "all") initAnalytics();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Initialise analytics and 'window.dataLayer' (which can be used throughout the app)
|
|
78
|
+
function initAnalytics() {
|
|
79
|
+
console.log("initialising analytics");
|
|
80
|
+
window.dataLayer = [
|
|
81
|
+
{
|
|
82
|
+
analyticsOptOut: false,
|
|
83
|
+
"gtm.whitelist": ["google", "hjtc", "lcl"],
|
|
84
|
+
"gtm.blacklist": ["customScripts", "sp", "adm", "awct", "k", "d", "j"],
|
|
85
|
+
...analyticsProps,
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
(function (w, d, s, l, i) {
|
|
90
|
+
w[l] = w[l] || [];
|
|
91
|
+
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
|
|
92
|
+
var f = d.head,
|
|
93
|
+
j = d.createElement(s),
|
|
94
|
+
dl = l != "dataLayer" ? "&l=" + l : "";
|
|
95
|
+
j.async = true;
|
|
96
|
+
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
|
|
97
|
+
f.appendChild(j);
|
|
98
|
+
})(window, document, "script", "dataLayer", analyticsId);
|
|
99
|
+
|
|
100
|
+
if ($page) location = `${$page.url.href}`.replace($page.url.hash, "");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// This code is only relevant for multi-page Svelte Kit apps. It sends an analytics event when the URL changes
|
|
104
|
+
function onPageChange(page) {
|
|
105
|
+
if (page && location) {
|
|
106
|
+
const newlocation = `${page.url.href}`.replace(page.url.hash, "");
|
|
107
|
+
if (newlocation !== location) {
|
|
108
|
+
location = newlocation;
|
|
109
|
+
analyticsEvent({
|
|
110
|
+
event: "pageView",
|
|
111
|
+
pageURL: location,
|
|
112
|
+
...analyticsProps,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
$: onPageChange($page);
|
|
118
|
+
|
|
119
|
+
onMount(() => {
|
|
120
|
+
live = true;
|
|
121
|
+
//live = document.location.hostname == "www.ons.gov.uk" || document.location.hostname == "cy.ons.gov.uk";
|
|
122
|
+
if (!page) lang = document.location.host.startsWith("cy") ? "cy" : "en";
|
|
123
|
+
showBanner = !hasCookiesPreferencesSet();
|
|
124
|
+
usageCookies = getUsageCookieValue();
|
|
125
|
+
if (usageCookies && live) initAnalytics();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const texts = {
|
|
129
|
+
"Cookies on ons.gov.uk": "Cwcis ar ons.gov.uk",
|
|
130
|
+
"Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.":
|
|
131
|
+
"Ffeiliau bach a gaiff eu storio ar eich dyfais pan fyddwch yn mynd ar wefan yw cwcis. Rydym ni’n defnyddio rhai cwcis hanfodol i wneud i’r wefan hon weithio.",
|
|
132
|
+
"We would like to set": "Hoffem osod",
|
|
133
|
+
"additional cookies": "cwcis ychwanegol",
|
|
134
|
+
"to remember your settings and understand how you use the site. This helps us to improve our services.":
|
|
135
|
+
"er mwyn cofio eich gosodiadau a deall sut rydych chi’n defnyddio’r wefan. Mae hyn yn ein helpu ni i wella ein gwasanaethau.",
|
|
136
|
+
"Accept additional cookies": "Derbyn cwcis ychwanegol",
|
|
137
|
+
"Reject additional cookies": "Gwrthod cwcis ychwanegol",
|
|
138
|
+
"View cookies": "Gweld cwcis",
|
|
139
|
+
"You have accepted all additional cookies.": "Rydych chi wedi derbyn yr holl gwcis ychwanegol.",
|
|
140
|
+
"You have rejected all additional cookies.":
|
|
141
|
+
"Rydych chi wedi gwrthod yr holl gwcis ychwanegol.",
|
|
142
|
+
"You can": "Gallwch chi",
|
|
143
|
+
"change your cookie preferences": "newid eich dewisiadau o ran cwcis",
|
|
144
|
+
"at any time.": "ar unrhyw adeg.",
|
|
145
|
+
Hide: "Cuddio",
|
|
146
|
+
};
|
|
147
|
+
const i18n = (text) => (lang == "cy" && texts[text] ? texts[text] : text);
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
{#if showBanner}
|
|
151
|
+
<div
|
|
152
|
+
class="ons-cookies-banner"
|
|
153
|
+
role="region"
|
|
154
|
+
aria-label="Cookies banner"
|
|
155
|
+
style:display="{showBanner ? "block" : null}"
|
|
156
|
+
>
|
|
157
|
+
{#if !showConfirm}
|
|
158
|
+
<form
|
|
159
|
+
action="/cookies/accept-all"
|
|
160
|
+
method="GET"
|
|
161
|
+
id="global-cookie-message"
|
|
162
|
+
aria-label="cookie banner"
|
|
163
|
+
>
|
|
164
|
+
<div
|
|
165
|
+
class="ons-container ons-cookies-banner__primary"
|
|
166
|
+
class:ons-page__container--wide="{width === 'wide'}"
|
|
167
|
+
>
|
|
168
|
+
<div class="ons-grid">
|
|
169
|
+
<div class="ons-grid__col ons-col-8@m">
|
|
170
|
+
<h2 class="ons-cookies-banner__title ons-u-mb-xs">{i18n("Cookies on ons.gov.uk")}</h2>
|
|
171
|
+
<div class="ons-cookies-banner__statement">
|
|
172
|
+
<p>
|
|
173
|
+
{i18n(
|
|
174
|
+
"Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work."
|
|
175
|
+
)}
|
|
176
|
+
</p>
|
|
177
|
+
<p>
|
|
178
|
+
{i18n("We would like to set")} <a href="/cookies">{i18n("additional cookies")}</a>
|
|
179
|
+
{i18n(
|
|
180
|
+
"to remember your settings and understand how you use the site. This helps us to improve our services."
|
|
181
|
+
)}
|
|
182
|
+
</p>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="ons-grid ons-grid--flex ons-u-mt-s">
|
|
187
|
+
<div class="ons-grid__col">
|
|
188
|
+
<button
|
|
189
|
+
type="submit"
|
|
190
|
+
class="ons-btn ons-btn--small ons-js-accept-cookies ons-cookies-banner__btn"
|
|
191
|
+
data-button="accept"
|
|
192
|
+
on:click|preventDefault="{() => setCookie('all')}"
|
|
193
|
+
>
|
|
194
|
+
<span class="ons-btn__inner"
|
|
195
|
+
><span class="ons-btn__text">{i18n("Accept additional cookies")}</span>
|
|
196
|
+
</span>
|
|
197
|
+
</button>
|
|
198
|
+
</div>
|
|
199
|
+
<div class="ons-grid__col">
|
|
200
|
+
<button
|
|
201
|
+
type="button"
|
|
202
|
+
class="ons-btn ons-btn--small ons-js-reject-cookies ons-cookies-banner__btn"
|
|
203
|
+
data-button="reject"
|
|
204
|
+
on:click|preventDefault="{() => setCookie('reject')}"
|
|
205
|
+
>
|
|
206
|
+
<span class="ons-btn__inner"
|
|
207
|
+
><span class="ons-btn__text">{i18n("Reject additional cookies")}</span>
|
|
208
|
+
</span>
|
|
209
|
+
</button>
|
|
210
|
+
</div>
|
|
211
|
+
<div class="ons-grid__col">
|
|
212
|
+
<a class="ons-cookies-banner__link" href="/cookies">{i18n("View cookies")}</a>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</form>
|
|
217
|
+
{:else}
|
|
218
|
+
<div
|
|
219
|
+
class="ons-container ons-cookies-banner__confirmation"
|
|
220
|
+
class:ons-page__container--wide="{width === 'wide'}"
|
|
221
|
+
>
|
|
222
|
+
<div
|
|
223
|
+
class="ons-grid ons-grid--flex ons-grid--between ons-grid--gutterless ons-grid--no-wrap@s ons-grid--vertical-center"
|
|
224
|
+
>
|
|
225
|
+
<div class="ons-grid__col ons-grid__col--flex ons-col-auto ons-u-flex-shrink@s">
|
|
226
|
+
<p class="ons-cookies-banner__desc ons-u-mb-no@s ons-u-mr-s@s">
|
|
227
|
+
<span>{i18n(message)}</span>
|
|
228
|
+
<span class="ons-cookies-banner__preferences-text"
|
|
229
|
+
>{i18n("You can")} <a href="/cookies">{i18n("change your cookie preferences")}</a>
|
|
230
|
+
{i18n("at any time")}.</span
|
|
231
|
+
>
|
|
232
|
+
</p>
|
|
233
|
+
</div>
|
|
234
|
+
<div class="ons-grid__col">
|
|
235
|
+
<button
|
|
236
|
+
type="button"
|
|
237
|
+
class="ons-btn ons-btn--secondary ons-btn--small ons-js-hide-button"
|
|
238
|
+
on:click="{() => (showBanner = false)}"
|
|
239
|
+
>
|
|
240
|
+
<span class="ons-btn__inner"><span class="ons-btn__text">{i18n("Hide")}</span> </span>
|
|
241
|
+
</button>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
{/if}
|
|
246
|
+
</div>
|
|
247
|
+
{/if}
|
|
248
|
+
|
|
249
|
+
<style>
|
|
250
|
+
.ons-cookies-banner {
|
|
251
|
+
/* padding: 0; */
|
|
252
|
+
background: none !important;
|
|
253
|
+
}
|
|
254
|
+
.ons-page__container--wide {
|
|
255
|
+
max-width: 1240px;
|
|
256
|
+
}</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* URL for previous page
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
export let href = "#0";
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<nav class="ons-breadcrumb" aria-label="Back">
|
|
10
|
+
<ol class="ons-breadcrumb__items ons-u-fs-s">
|
|
11
|
+
<li class="ons-breadcrumb__item" id="breadcrumb-1">
|
|
12
|
+
<a class="ons-breadcrumb__link" href="{href}" id="back">Back</a>
|
|
13
|
+
<svg
|
|
14
|
+
class="ons-svg-icon"
|
|
15
|
+
viewBox="0 0 8 13"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
focusable="false"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
>
|
|
20
|
+
<path
|
|
21
|
+
d="M5.74,14.28l-.57-.56a.5.5,0,0,1,0-.71h0l5-5-5-5a.5.5,0,0,1,0-.71h0l.57-.56a.5.5,0,0,1,.71,0h0l5.93,5.93a.5.5,0,0,1,0,.7L6.45,14.28a.5.5,0,0,1-.71,0Z"
|
|
22
|
+
transform="translate(-5.02 -1.59)"></path>
|
|
23
|
+
</svg>
|
|
24
|
+
</li>
|
|
25
|
+
</ol>
|
|
26
|
+
</nav>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.ons-svg-icon {
|
|
30
|
+
color: currentColor;
|
|
31
|
+
fill: currentColor;
|
|
32
|
+
}</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* An array of links in the format {label, href}
|
|
4
|
+
* @type {array}
|
|
5
|
+
*/
|
|
6
|
+
export let links = [];
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="ons-page__container ons-container">
|
|
10
|
+
<nav class="ons-breadcrumb print--hide" aria-label="Breadcrumbs">
|
|
11
|
+
<ol class="ons-breadcrumb__items ons-u-fs-s">
|
|
12
|
+
{#each links as link}
|
|
13
|
+
<li class="ons-breadcrumb__item ons-u-p-no">
|
|
14
|
+
{#if link.href}
|
|
15
|
+
<a class="ons-breadcrumb__link" href="{link.href}">{link.label}</a>
|
|
16
|
+
{:else}
|
|
17
|
+
{link.label}
|
|
18
|
+
{/if}
|
|
19
|
+
<svg
|
|
20
|
+
class="ons-svg-icon"
|
|
21
|
+
viewBox="0 0 8 13"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
focusable="false"
|
|
24
|
+
>
|
|
25
|
+
<path
|
|
26
|
+
d="M5.74,14.28l-.57-.56a.5.5,0,0,1,0-.71h0l5-5-5-5a.5.5,0,0,1,0-.71h0l.57-.56a.5.5,0,0,1,.71,0h0l5.93,5.93a.5.5,0,0,1,0,.7L6.45,14.28a.5.5,0,0,1-.71,0Z"
|
|
27
|
+
transform="translate(-5.02 -1.59)"></path>
|
|
28
|
+
</svg>
|
|
29
|
+
</li>
|
|
30
|
+
{/each}
|
|
31
|
+
</ol>
|
|
32
|
+
</nav>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<style>
|
|
36
|
+
.ons-svg-icon {
|
|
37
|
+
color: currentColor;
|
|
38
|
+
fill: currentColor;
|
|
39
|
+
}</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Sets the title of the contents block
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
export let title = "Contents";
|
|
7
|
+
/**
|
|
8
|
+
* Visually hides the title of the block
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export let hideTitle = false;
|
|
12
|
+
/**
|
|
13
|
+
* An array of links for the contentents block in the form {label, href?}. Excluding href renders an item as plain text.
|
|
14
|
+
* @type {array}
|
|
15
|
+
*/
|
|
16
|
+
export let links = [];
|
|
17
|
+
/**
|
|
18
|
+
* An anchor link URL to the main content of the page (to skip contents)
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
export let skipHref = "";
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<aside class="ons-toc-container" role="complementary">
|
|
25
|
+
{#if skipHref}
|
|
26
|
+
<a class="ons-skip-link" href="{skipHref}">Skip to content</a>
|
|
27
|
+
{/if}
|
|
28
|
+
<nav class="ons-toc" aria-label="{title}">
|
|
29
|
+
{#if title}
|
|
30
|
+
<h2 class="ons-toc__title ons-u-fs-r--b ons-u-mb-s" class:ons-u-vh="{hideTitle}">{title}</h2>
|
|
31
|
+
{/if}
|
|
32
|
+
<ol class="ons-list ons-u-mb-m ons-list--dashed">
|
|
33
|
+
{#each links as link}
|
|
34
|
+
{#if link.href}
|
|
35
|
+
<li class="ons-list__item">
|
|
36
|
+
<a href="{link.href}" class="ons-list__link">{link.label}</a>
|
|
37
|
+
</li>
|
|
38
|
+
{:else}
|
|
39
|
+
<li class="ons-list__item" aria-current="true">{link.label}</li>
|
|
40
|
+
{/if}
|
|
41
|
+
{/each}
|
|
42
|
+
</ol>
|
|
43
|
+
</nav>
|
|
44
|
+
</aside>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Pass the "page" store from "$app/stores" in any Svelte Kit project
|
|
4
|
+
* @type {any}
|
|
5
|
+
*/
|
|
6
|
+
export let page = null;
|
|
7
|
+
/**
|
|
8
|
+
* (Optional) Explicitly pass a page status number, eg. 404 or 500.
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
export let status = $page ? $page.status : null;
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="ons-page__container ons-container">
|
|
15
|
+
<div class="ons-grid">
|
|
16
|
+
<div class="ons-grid__col ons-col-12@m">
|
|
17
|
+
<main id="main-content" class="ons-page__main">
|
|
18
|
+
{#if status === 404}
|
|
19
|
+
<h1>Page not found</h1>
|
|
20
|
+
<p>If you entered a web address, check it is correct.</p>
|
|
21
|
+
<p>If you pasted the web address, check you copied the whole address.</p>
|
|
22
|
+
<p>
|
|
23
|
+
If the web address is correct or you selected a link or button, <a href="/feedback"
|
|
24
|
+
>contact us</a
|
|
25
|
+
> for more help.
|
|
26
|
+
</p>
|
|
27
|
+
{:else}
|
|
28
|
+
<h1>Sorry, there is a problem with the service</h1>
|
|
29
|
+
<p>Try again later.</p>
|
|
30
|
+
<p>
|
|
31
|
+
If you continue to experience problems with this service, please <a href="/feedback"
|
|
32
|
+
>contact us</a
|
|
33
|
+
>.
|
|
34
|
+
</p>
|
|
35
|
+
{/if}
|
|
36
|
+
</main>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { onMount, getContext } from "svelte";
|
|
3
|
-
import Theme from "
|
|
3
|
+
import Theme from "../../wrappers/Theme/Theme.svelte";
|
|
4
4
|
import ONSLogo from "./ONSLogo.svelte";
|
|
5
5
|
|
|
6
6
|
const page = getContext("page");
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
class="search__button col--md-3 col--lg-3"
|
|
470
470
|
id="nav-search-submit"
|
|
471
471
|
>
|
|
472
|
-
<span class="
|
|
472
|
+
<span class="hidden">{i18n("Search")}</span>
|
|
473
473
|
<span class="icon-search--light">
|
|
474
474
|
<svg
|
|
475
475
|
class="ons-svg-icon ons-svg-icon--m"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { validDate, formatDate } from "
|
|
3
|
-
import Container from "
|
|
2
|
+
import { validDate, formatDate } from "../../js/utils.js";
|
|
3
|
+
import Container from "../../wrappers/Container/Container.svelte";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* (Optional) Sets the unique ID of the section
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { onMount, onDestroy, getContext } from "svelte";
|
|
3
|
-
import { slugify } from "
|
|
3
|
+
import { slugify } from "../../js/utils.js";
|
|
4
4
|
import SectionBacklink from "./SectionBacklink.svelte";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<section id="{id}" aria-label="{title}" bind:this="{section}">
|
|
44
|
-
{#if title
|
|
45
|
-
<h2 class="ons-u-mt-xl ons-u-pb-no ons-u-pt-no">{title}</h2>
|
|
44
|
+
{#if title}
|
|
45
|
+
<h2 class="ons-u-mt-xl ons-u-pb-no ons-u-pt-no" class:ons-u-vh="{hideTitle}">{title}</h2>
|
|
46
46
|
{/if}
|
|
47
47
|
<slot />
|
|
48
48
|
{#if tocId}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* (Optional) Notice title
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
export let title = null;
|
|
7
|
+
/**
|
|
8
|
+
* Adds an exclamation mark icon
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export let important = false;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the mode/colour of the notice
|
|
14
|
+
* @type {"info"|"success"|"pending"|"error"}
|
|
15
|
+
*/
|
|
16
|
+
export let mode = "info";
|
|
17
|
+
|
|
18
|
+
$: style =
|
|
19
|
+
mode === "success"
|
|
20
|
+
? "background: var(--ons-color-success-tint); border-color: var(--ons-color-success);"
|
|
21
|
+
: mode === "pending"
|
|
22
|
+
? "background: var(--ons-color-pending-tint); border-color: var(--ons-color-pending);"
|
|
23
|
+
: mode === "error"
|
|
24
|
+
? "background: var(--ons-color-errors-tint); border-color: var(--ons-color-errors);"
|
|
25
|
+
: null;
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class="ons-panel ons-panel--info ons-panel--no-title ons-u-mt-m ons-u-mb-l" style="{style}">
|
|
29
|
+
<div class="ons-u-bg--tr" class:ons-panel--warn="{important}">
|
|
30
|
+
{#if important}<div class="ons-panel__icon" aria-hidden="true">!</div>{/if}
|
|
31
|
+
<span class="ons-panel__assistive-text ons-u-vh">Important information:</span>
|
|
32
|
+
<div class="ons-panel__body">
|
|
33
|
+
<div class="ons-u-fs-r default-line-height">
|
|
34
|
+
{#if title}<p><strong>{title}</strong></p>{/if}
|
|
35
|
+
<p class="ons-u-mb-no">
|
|
36
|
+
<slot />
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<style>
|
|
44
|
+
.ons-panel {
|
|
45
|
+
color: rgb(34, 34, 34);
|
|
46
|
+
}
|
|
47
|
+
:global(.ons-panel__body a) {
|
|
48
|
+
color: #206095 !important;
|
|
49
|
+
}
|
|
50
|
+
:global(.ons-panel__body a:hover) {
|
|
51
|
+
color: rgb(0, 60, 87) !important;
|
|
52
|
+
-webkit-text-decoration: underline solid rgb(0, 60, 87) 2px !important;
|
|
53
|
+
text-decoration: underline solid rgb(0, 60, 87) 2px !important;
|
|
54
|
+
}</style>
|