@communitiesuk/svelte-component-library 0.1.19-beta.6 → 0.1.19-beta.7.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.
@@ -51,6 +51,7 @@
51
51
  copyrightHref = "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/",
52
52
  rebrand = true,
53
53
  borderTopColor = "#00625E",
54
+ removeCopyrightPadding = false,
54
55
  } = $props<{
55
56
  sections?: FooterSection[];
56
57
  inlineLinks?: FooterItem[];
@@ -68,6 +69,7 @@
68
69
  copyrightHref?: string;
69
70
  rebrand?: boolean;
70
71
  borderTopColor?: string;
72
+ removeCopyrightPadding?: boolean;
71
73
  }>();
72
74
  </script>
73
75
 
@@ -218,6 +220,7 @@
218
220
  <a
219
221
  class={[
220
222
  "govuk-footer__link",
223
+ { "no-copyright-padding": removeCopyrightPadding },
221
224
  {
222
225
  "govuk-footer__copyright-logo": !copyrightLogoUrl && rebrand,
223
226
  },
@@ -234,3 +237,9 @@
234
237
  </div>
235
238
  </div>
236
239
  </footer>
240
+
241
+ <style>
242
+ .no-copyright-padding {
243
+ padding: 0;
244
+ }
245
+ </style>
@@ -27,6 +27,7 @@ type $$ComponentProps = {
27
27
  copyrightHref?: string;
28
28
  rebrand?: boolean;
29
29
  borderTopColor?: string;
30
+ removeCopyrightPadding?: boolean;
30
31
  };
31
32
  declare const Footer: import("svelte").Component<$$ComponentProps, {}, "">;
32
33
  type Footer = ReturnType<typeof Footer>;
@@ -5,15 +5,21 @@
5
5
  bannerText = "This is a new service. Help us improve it and ",
6
6
  linkText = "give your feedback by email",
7
7
  linkHref = "#",
8
+ bottomBorder = true,
8
9
  } = $props<{
9
10
  tagText?: string;
10
11
  bannerText?: string;
11
12
  linkText?: string;
12
13
  linkHref?: string;
14
+ bottomBorder?: boolean;
13
15
  }>();
14
16
  </script>
15
17
 
16
- <div class="govuk-phase-banner govuk-width-container">
18
+ <div
19
+ class="govuk-phase-banner govuk-width-container {bottomBorder
20
+ ? ''
21
+ : 'no-bottom-border'}"
22
+ >
17
23
  <p class="govuk-phase-banner__content">
18
24
  <strong class="govuk-tag govuk-phase-banner__content__tag">
19
25
  {tagText}
@@ -25,4 +31,7 @@
25
31
  </div>
26
32
 
27
33
  <style>
34
+ .no-bottom-border {
35
+ border-bottom: none;
36
+ }
28
37
  </style>
@@ -3,6 +3,7 @@ type $$ComponentProps = {
3
3
  bannerText?: string;
4
4
  linkText?: string;
5
5
  linkHref?: string;
6
+ bottomBorder?: boolean;
6
7
  };
7
8
  declare const PhaseBanner: import("svelte").Component<$$ComponentProps, {}, "">;
8
9
  type PhaseBanner = ReturnType<typeof PhaseBanner>;
@@ -17,11 +17,15 @@ Use the component with or without navigation items based on your needs. -->
17
17
  serviceUrl = "#",
18
18
  navigationItems = undefined,
19
19
  collapseOnDesktop = false,
20
+ customiseServiceNameLink = false,
21
+ serviceNameLinkStyle = "govuk-link no-underline",
20
22
  } = $props<{
21
23
  serviceName?: string;
22
24
  serviceUrl?: string;
23
25
  navigationItems?: NavigationItem[];
24
26
  collapseOnDesktop?: boolean;
27
+ customiseServiceNameLink?: boolean;
28
+ serviceNameLinkStyle?: string;
25
29
  }>();
26
30
 
27
31
  // Reactive state declarations
@@ -94,7 +98,12 @@ Use the component with or without navigation items based on your needs. -->
94
98
  <div class="govuk-width-container">
95
99
  <div class="govuk-service-navigation__container">
96
100
  <span class="govuk-service-navigation__service-name">
97
- <a href={serviceUrl} class="govuk-service-navigation__link">
101
+ <a
102
+ href={serviceUrl}
103
+ class={customiseServiceNameLink
104
+ ? serviceNameLinkStyle
105
+ : "govuk-service-navigation__link"}
106
+ >
98
107
  {serviceName}
99
108
  </a>
100
109
  </span>
@@ -145,3 +154,12 @@ Use the component with or without navigation items based on your needs. -->
145
154
  </div>
146
155
  </div>
147
156
  </section>
157
+
158
+ <style>
159
+ .no-underline {
160
+ text-decoration: none;
161
+ }
162
+ .no-underline:hover {
163
+ text-decoration: underline;
164
+ }
165
+ </style>
@@ -8,6 +8,8 @@ type $$ComponentProps = {
8
8
  serviceUrl?: string;
9
9
  navigationItems?: NavigationItem[];
10
10
  collapseOnDesktop?: boolean;
11
+ customiseServiceNameLink?: boolean;
12
+ serviceNameLinkStyle?: string;
11
13
  };
12
14
  declare const ServiceNavigation: import("svelte").Component<$$ComponentProps, {}, "">;
13
15
  type ServiceNavigation = ReturnType<typeof ServiceNavigation>;
@@ -21,26 +21,28 @@
21
21
  style="background-color: {callToActionBackgroundColor};"
22
22
  >
23
23
  {#if linkCard}
24
- <a class="link" {href}>
25
- <h3
26
- class="govuk-link link-heading govuk-heading-m"
24
+ <h2 class="link-heading govuk-heading-m">
25
+ <a
26
+ class="govuk-link link"
27
+ {href}
27
28
  style="--link-text-color: {linkTextColor}"
28
29
  >
29
30
  {linkText}
30
- </h3>
31
- <svg
32
- xmlns="http://www.w3.org/2000/svg"
33
- width="10"
34
- height="17"
35
- viewBox="0 0 10 17"
36
- fill="none"
37
- >
38
- <path
39
- d="M6.21622 8.5L0 2.36667L1.89189 0.5L10 8.5L1.89189 16.5L0 14.6333L6.21622 8.5Z"
40
- fill={linkTextColor}
41
- ></path>
42
- </svg>
43
- </a>
31
+ <svg
32
+ xmlns="http://www.w3.org/2000/svg"
33
+ width="10"
34
+ height="17"
35
+ viewBox="0 0 10 17"
36
+ fill="none"
37
+ aria-hidden="true"
38
+ >
39
+ <path
40
+ d="M6.21622 8.5L0 2.36667L1.89189 0.5L10 8.5L1.89189 16.5L0 14.6333L6.21622 8.5Z"
41
+ fill={linkTextColor}
42
+ ></path>
43
+ </svg>
44
+ </a>
45
+ </h2>
44
46
  {:else}
45
47
  {@render cardSnippet()}
46
48
  {/if}
@@ -12,6 +12,10 @@
12
12
  imageAlt = "",
13
13
  backgroundColor = "#1d70b8", // GOV.UK blue by default
14
14
  textColor = "#FFFFFF",
15
+ imgMarginTop = "15px",
16
+ paddingTop = "30px",
17
+ titlePaddingTop = false,
18
+ paddingBottom = "30px",
15
19
  } = $props<{
16
20
  title?: string;
17
21
  description?: string;
@@ -22,16 +26,24 @@
22
26
  imageAlt?: string;
23
27
  backgroundColor?: string;
24
28
  textColor?: string;
29
+ imgMarginTop?: string;
30
+ paddingTop?: string;
31
+ titlePaddingTop?: boolean;
32
+ paddingBottom?: string;
25
33
  }>();
26
34
  </script>
27
35
 
28
36
  <div
29
37
  class="app-masthead"
30
- style="background-color: {backgroundColor}; border-bottom-color: {backgroundColor}; --masthead-text-color: {textColor};"
38
+ style="background-color: {backgroundColor}; border-bottom-color: {backgroundColor}; --masthead-text-color: {textColor}; --padding-top: {paddingTop}; --padding-bottom: {paddingBottom};"
31
39
  >
32
40
  <div class="govuk-width-container">
33
41
  <div class="govuk-grid-row">
34
- <div class="govuk-grid-column-two-thirds-from-desktop">
42
+ <div
43
+ class="govuk-grid-column-two-thirds-from-desktop {titlePaddingTop
44
+ ? 'custom-padding'
45
+ : ''}"
46
+ >
35
47
  <h1 class="govuk-heading-xl app-masthead__title">{@html title}</h1>
36
48
  <p class="app-masthead__description">{description}</p>
37
49
  {#if includeButton === true}
@@ -61,6 +73,7 @@
61
73
  <div class="govuk-grid-column-one-third-from-desktop">
62
74
  <img
63
75
  class="app-masthead__image"
76
+ style="--img-margin-top: {imgMarginTop}"
64
77
  src={imageSrc}
65
78
  alt={imageAlt}
66
79
  role="presentation"
@@ -88,8 +101,8 @@
88
101
  @media (min-width: 40.0625em) {
89
102
  .app-masthead.app-masthead {
90
103
  /* Responsive spacing unit 6: 30px on large screens */
91
- padding-top: 30px;
92
- padding-bottom: 30px;
104
+ padding-top: var(--padding-top);
105
+ padding-bottom: var(--padding-bottom);
93
106
  }
94
107
  }
95
108
 
@@ -128,12 +141,19 @@
128
141
  }
129
142
 
130
143
  /* @include govuk-media-query($from: desktop) - Desktop breakpoint is 769px */
131
- @media (min-width: 48.0625em) {
144
+ @media (min-width: 53em) {
132
145
  .app-masthead .app-masthead__image.app-masthead__image {
133
146
  display: block;
134
147
  width: 100%;
135
148
  /* margin-top: govuk-spacing(3); - Static spacing unit 3 is 15px */
136
- margin-top: 15px;
149
+ margin-top: var(--img-margin-top);
150
+ }
151
+ }
152
+
153
+ @media (max-width: 52.9375em) {
154
+ .govuk-grid-column-two-thirds-from-desktop {
155
+ width: 100%;
156
+ float: none;
137
157
  }
138
158
  }
139
159
 
@@ -276,4 +296,14 @@
276
296
  .app-masthead__description {
277
297
  color: var(--masthead-text-color);
278
298
  }
299
+
300
+ .custom-padding {
301
+ padding-top: 32px;
302
+ }
303
+
304
+ @media (max-width: 820px) {
305
+ .custom-padding {
306
+ padding-top: 16px;
307
+ }
308
+ }
279
309
  </style>
@@ -8,6 +8,10 @@ type $$ComponentProps = {
8
8
  imageAlt?: string;
9
9
  backgroundColor?: string;
10
10
  textColor?: string;
11
+ imgMarginTop?: string;
12
+ paddingTop?: string;
13
+ titlePaddingTop?: boolean;
14
+ paddingBottom?: string;
11
15
  };
12
16
  declare const Masthead: import("svelte").Component<$$ComponentProps, {}, "">;
13
17
  type Masthead = ReturnType<typeof Masthead>;
@@ -30,11 +30,13 @@
30
30
  headingLevel = 2 as 1 | 2 | 3 | 4 | 5 | 6, // Main heading level (used by first 'main' section)
31
31
  listTruncateThreshold = 5, // Default threshold, can be overridden per section
32
32
  disableGa4 = false,
33
+ marginBottom = "60px",
33
34
  } = $props<{
34
35
  sections?: RelatedContentSection[];
35
36
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
36
37
  listTruncateThreshold?: number; // Default threshold
37
38
  disableGa4?: boolean;
39
+ marginBottom?: string;
38
40
  }>();
39
41
 
40
42
  // Helper to check if a link is external
@@ -229,6 +231,7 @@
229
231
  class="gem-c-related-navigation govuk-!-display-none-print {hasJavaScript
230
232
  ? 'govuk-frontend-supported'
231
233
  : ''}"
234
+ style="margin-bottom: {marginBottom};"
232
235
  role="complementary"
233
236
  >
234
237
  {#if mainSection && mainSection.title}
@@ -304,7 +307,7 @@
304
307
  <style>
305
308
  .gem-c-related-navigation {
306
309
  border-top: 2px solid #1d70b8;
307
- margin-bottom: 60px;
310
+ /* margin-bottom: 60px; */
308
311
  color: #0b0c0c;
309
312
  }
310
313
 
@@ -24,6 +24,7 @@ type $$ComponentProps = {
24
24
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
25
25
  listTruncateThreshold?: number;
26
26
  disableGa4?: boolean;
27
+ marginBottom?: string;
27
28
  };
28
29
  declare const RelatedContent: import("svelte").Component<$$ComponentProps, {}, "">;
29
30
  type RelatedContent = ReturnType<typeof RelatedContent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@communitiesuk/svelte-component-library",
3
- "version": "v0.1.19-beta.6",
3
+ "version": "0.1.19-beta.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/communitiesuk/mhclg_svelte_component_library.git"