@onsvisual/svelte-components 1.0.66 → 1.1.1

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.
@@ -34,7 +34,7 @@
34
34
  class:ons-svelte-mark={mode === "default"}
35
35
  class:ons-svelte-badge={mode === "badge"}
36
36
  class:ons-u-nowrap={nowrap}
37
- style:background-color={color}
37
+ style:background={color}
38
38
  style:color={text}
39
39
  style:font-size={fontSize}
40
40
  role="presentation"
@@ -28,13 +28,19 @@
28
28
  "Footer links": "",
29
29
  Help: "Cymorth",
30
30
  Accessibility: "Hygyrchedd",
31
+ "Accessibility statement": "Datganiad hygyrchedd",
32
+ Browsers: "Porwyr",
31
33
  Cookies: "Cwcis",
34
+ "Fair use policy": "Polisi defnydd teg",
32
35
  Privacy: "Preifatrwydd",
36
+ "Privacy notice": "Hysbysiad preifatrwydd",
33
37
  "Terms and conditions": "Telerau ac amodau",
34
38
  "About ONS": "Ynglŷn ag SYG",
39
+ "About us": "Amdanom ni",
35
40
  "What we do": "Beth rydym yn ei wneud",
36
41
  Careers: "Gyrfaoedd",
37
42
  "Contact us": "Cysylltu â ni",
43
+ Media: "Cyfryngau",
38
44
  News: "Newyddion",
39
45
  "Freedom of Information": "Rhyddid Gwybodaeth",
40
46
  "Connect with us": "Cysylltu â ni",
@@ -68,14 +74,23 @@
68
74
  <ul class="ons-list ons-u-mb-no ons-list--bare">
69
75
  <li class="ons-list__item">
70
76
  <a href="{baseurl}/help/accessibility" class="ons-list__link"
71
- >{i18n("Accessibility")}</a
77
+ >{i18n("Accessibility statement")}</a
72
78
  >
73
79
  </li>
80
+ <li class="ons-list__item">
81
+ <a href="{baseurl}/browsers" class="ons-list__link">{i18n("Browsers")}</a>
82
+ </li>
74
83
  <li class="ons-list__item">
75
84
  <a href="{baseurl}/cookies" class="ons-list__link">{i18n("Cookies")}</a>
76
85
  </li>
77
86
  <li class="ons-list__item">
78
- <a href="{baseurl}/help/privacynotice" class="ons-list__link">{i18n("Privacy")}</a
87
+ <a href="{baseurl}/help/fairusepolicy" class="ons-list__link"
88
+ >{i18n("Fair use policy")}</a
89
+ >
90
+ </li>
91
+ <li class="ons-list__item">
92
+ <a href="{baseurl}/help/privacynotice" class="ons-list__link"
93
+ >{i18n("Privacy notice")}</a
79
94
  >
80
95
  </li>
81
96
  <li class="ons-list__item">
@@ -87,12 +102,10 @@
87
102
  </div>
88
103
  <!-- Full footer columns -->
89
104
  <div class="ons-grid__col ons-col-4@m ons-u-mt-l@2xs@m">
90
- <h2 class="ons-footer__heading ons-u-fs-r--b">{i18n("About ONS")}</h2>
105
+ <h2 class="ons-footer__heading ons-u-fs-r--b">{i18n("About us")}</h2>
91
106
  <ul class="ons-list ons-u-mb-no ons-list--bare">
92
107
  <li class="ons-list__item">
93
- <a href="{baseurl}/aboutus/whatwedo" class="ons-list__link"
94
- >{i18n("What we do")}</a
95
- >
108
+ <a href="{baseurl}/aboutus" class="ons-list__link">{i18n("About us")}</a>
96
109
  </li>
97
110
  <li class="ons-list__item">
98
111
  <a href="https://careers.ons.gov.uk" class="ons-list__link">{i18n("Careers")}</a>
@@ -103,7 +116,10 @@
103
116
  >
104
117
  </li>
105
118
  <li class="ons-list__item">
106
- <a href="{baseurl}/news" class="ons-list__link">{i18n("News")}</a>
119
+ <a href="{baseurl}/news" class="ons-list__link">{i18n("Media")}</a>
120
+ </li>
121
+ <li class="ons-list__item">
122
+ <a href="https://blog.ons.gov.uk" class="ons-list__link">{i18n("Blog")}</a>
107
123
  </li>
108
124
  <li class="ons-list__item">
109
125
  <a
@@ -19,8 +19,12 @@
19
19
 
20
20
  <Story name="Default" args={{}} />
21
21
 
22
- <Story name="Compact" args={{ compact: true }} />
22
+ <Story name="Dark mode" args={{ theme: "dark" }} />
23
+
24
+ <Story name="Compact" args={{ compact: true, border: true }} />
23
25
 
24
26
  <Story name="Compact with page title" args={{ compact: true, title: "Page title" }} />
25
27
 
26
28
  <Story name="Compact dark theme" args={{ compact: true, title: "Page title", theme: "dark" }} />
29
+
30
+ <Story name="Legacy header" args={{ legacy: true }} />
@@ -3,6 +3,7 @@
3
3
  import Theme from "../Theme/Theme.svelte";
4
4
  import SkipLink from "../SkipLink/SkipLink.svelte";
5
5
  import HeaderNav from "./HeaderNav.svelte";
6
+ import HeaderNavCompact from "./HeaderNavCompact.svelte";
6
7
  import HeaderNavLegacy from "./HeaderNavLegacy.svelte";
7
8
 
8
9
  const page = getContext("page");
@@ -16,7 +17,12 @@
16
17
  * Use the legacy nav header
17
18
  * @type {boolean}
18
19
  */
19
- export let legacy = true;
20
+ export let legacy = false;
21
+ /**
22
+ * Include a border/line under the header
23
+ * @type {boolean}
24
+ */
25
+ export let border = false;
20
26
  /**
21
27
  * Optional product title
22
28
  * @type {string|null}
@@ -64,11 +70,15 @@
64
70
  const texts = {
65
71
  Home: "Hafan",
66
72
  Search: "Chwilio",
73
+ "Search the ONS": "Chwiliwch y SYG",
67
74
  Menu: "Dewislen",
68
75
  "Hide search": "Cuddio",
69
76
  "Office for National Statistics logo": "Logo Swyddfa Ystadegau Gwladol",
70
77
  Homepage: "Hafan",
71
- "Search for a keyword(s) or time series ID": "Chwilio am allweddair neu ID cyfres amser"
78
+ "Search for a keyword(s) or time series ID": "Chwilio am allweddair neu ID cyfres amser",
79
+ "Popular searches": "Chwiliadau poblogaidd",
80
+ Cymraeg: "English",
81
+ "Newid iaith i": "Change language to"
72
82
  };
73
83
 
74
84
  $: i18n = (text) => (lang === "cy" && texts[text] ? texts[text] : text);
@@ -83,12 +93,18 @@
83
93
  <SkipLink href={skipHref} />
84
94
  {/if}
85
95
  <slot name="before" />
86
- <Theme {theme} overrides={themeOverrides}>
96
+ <Theme
97
+ {theme}
98
+ overrides={themeOverrides}
99
+ cls={["dark", "blue", "navyblue"].includes(theme) ? "dark-mode" : null}
100
+ >
87
101
  <!-- <div id="pagePath" class="hide">{path}</div> -->
88
- {#if legacy && !compact}
89
- <HeaderNavLegacy {bilingual} {lang} {baseurl} {baseother} {path} {i18n} />
102
+ {#if compact}
103
+ <HeaderNavCompact {border} {baseurl} {i18n} />
104
+ {:else if !legacy}
105
+ <HeaderNav {border} {bilingual} {lang} {baseurl} {baseother} {path} {i18n} />
90
106
  {:else}
91
- <HeaderNav {compact} {title} {baseurl} {i18n} />
107
+ <HeaderNavLegacy {bilingual} {lang} {baseurl} {baseother} {path} {i18n} />
92
108
  {/if}
93
109
  {#if title}
94
110
  <div class="ons-header__main">
@@ -111,16 +127,3 @@
111
127
  {/if}
112
128
  </Theme>
113
129
  </header>
114
-
115
- <style>
116
- .ons-header__top {
117
- background: var(--ons-color-page-light);
118
- }
119
- .ons-icon--logo__group--primary,
120
- .ons-icon--logo__group--text {
121
- fill: var(--ons-color-text-link-hover);
122
- }
123
- .ons-header__top--compact {
124
- border-bottom: 1px solid var(--ons-color-borders);
125
- }
126
- </style>
@@ -7,6 +7,7 @@ export default class Header extends SvelteComponentTyped<{
7
7
  title?: string | null | undefined;
8
8
  skipHref?: string | null | undefined;
9
9
  compact?: boolean | undefined;
10
+ border?: boolean | undefined;
10
11
  bilingual?: boolean | undefined;
11
12
  legacy?: boolean | undefined;
12
13
  titleHref?: string | null | undefined;
@@ -27,6 +28,7 @@ declare const __propDef: {
27
28
  title?: string | null | undefined;
28
29
  skipHref?: string | null | undefined;
29
30
  compact?: boolean | undefined;
31
+ border?: boolean | undefined;
30
32
  bilingual?: boolean | undefined;
31
33
  legacy?: boolean | undefined;
32
34
  titleHref?: string | null | undefined;