@communitiesuk/svelte-component-library 0.1.19-beta.3 → 0.1.19-beta.34

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 (52) hide show
  1. package/README.md +7 -0
  2. package/dist/components/content/Tag.svelte +32 -0
  3. package/dist/components/content/Tag.svelte.d.ts +13 -0
  4. package/dist/components/data-vis/Histogram.svelte +287 -0
  5. package/dist/components/data-vis/Histogram.svelte.d.ts +75 -0
  6. package/dist/components/data-vis/axis/Axis.svelte +217 -34
  7. package/dist/components/data-vis/axis/Axis.svelte.d.ts +38 -30
  8. package/dist/components/data-vis/axis/Ticks.svelte +142 -78
  9. package/dist/components/data-vis/axis/Ticks.svelte.d.ts +28 -31
  10. package/dist/components/data-vis/line-chart/LineChart.svelte +51 -21
  11. package/dist/components/data-vis/line-chart/LineChart.svelte.d.ts +14 -6
  12. package/dist/components/data-vis/line-chart/ValueLabel.svelte +2 -1
  13. package/dist/components/data-vis/line-chart/ValueLabel.svelte.d.ts +2 -0
  14. package/dist/components/data-vis/position-chart/PositionChart.svelte +279 -122
  15. package/dist/components/data-vis/position-chart/PositionChart.svelte.d.ts +37 -5
  16. package/dist/components/data-vis/position-chart/PositionChartAxis.svelte +59 -48
  17. package/dist/components/data-vis/position-chart/PositionChartAxis.svelte.d.ts +4 -4
  18. package/dist/components/data-vis/table/Table.svelte +145 -95
  19. package/dist/components/data-vis/table/Table.svelte.d.ts +4 -4
  20. package/dist/components/layout/Footer.svelte +9 -0
  21. package/dist/components/layout/Footer.svelte.d.ts +1 -0
  22. package/dist/components/layout/PhaseBanner.svelte +10 -1
  23. package/dist/components/layout/PhaseBanner.svelte.d.ts +1 -0
  24. package/dist/components/layout/ServiceNavigation.svelte +19 -1
  25. package/dist/components/layout/ServiceNavigation.svelte.d.ts +2 -0
  26. package/dist/components/ui/Accordion.svelte +212 -66
  27. package/dist/components/ui/Accordion.svelte.d.ts +2 -0
  28. package/dist/components/ui/BasicMultiSelect.svelte +716 -0
  29. package/dist/components/ui/BasicMultiSelect.svelte.d.ts +18 -0
  30. package/dist/components/ui/Button.svelte +220 -104
  31. package/dist/components/ui/Button.svelte.d.ts +4 -0
  32. package/dist/components/ui/Card.svelte +48 -60
  33. package/dist/components/ui/Card.svelte.d.ts +26 -12
  34. package/dist/components/ui/CardHeader.svelte +46 -0
  35. package/dist/components/ui/CardHeader.svelte.d.ts +21 -0
  36. package/dist/components/ui/ChartExporter.svelte +142 -0
  37. package/dist/components/ui/ChartExporter.svelte.d.ts +16 -0
  38. package/dist/components/ui/CheckBox.svelte +1 -0
  39. package/dist/components/ui/Details.svelte +47 -8
  40. package/dist/components/ui/Details.svelte.d.ts +8 -10
  41. package/dist/components/ui/Masthead.svelte +44 -6
  42. package/dist/components/ui/Masthead.svelte.d.ts +6 -0
  43. package/dist/components/ui/RelatedContent.svelte +4 -1
  44. package/dist/components/ui/RelatedContent.svelte.d.ts +1 -0
  45. package/dist/components/ui/SearchAutocomplete.svelte +69 -44
  46. package/dist/components/ui/SearchAutocomplete.svelte.d.ts +1 -0
  47. package/dist/components/ui/Select.svelte +18 -7
  48. package/dist/components/ui/Tabs.svelte +192 -18
  49. package/dist/components/ui/Tabs.svelte.d.ts +1 -0
  50. package/dist/index.d.ts +5 -0
  51. package/dist/index.js +5 -0
  52. package/package.json +4 -1
@@ -1,70 +1,81 @@
1
1
  <script>
2
- let { markerRadius = undefined, barWidth = undefined } = $props();
2
+ let { textSize = "s", axisLabels = ["Left", "Right"] } = $props();
3
3
  </script>
4
4
 
5
- <div class="axis" style="--axis-padding:{markerRadius}px; width: {barWidth}">
6
- <div class="more-deprived">
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- width="11"
10
- height="16"
11
- viewBox="0 0 11 16"
12
- fill="none"
13
- >
14
- <path
15
- d="M0.292893 7.29289C-0.0976315 7.68342 -0.0976314 8.31658 0.292893 8.70711L6.65685 15.0711C7.04738 15.4616 7.68054 15.4616 8.07107 15.0711C8.46159 14.6805 8.46159 14.0474 8.07107 13.6569L2.41421 8L8.07107 2.34315C8.46159 1.95262 8.46159 1.31946 8.07107 0.928932C7.68054 0.538408 7.04738 0.538408 6.65685 0.928933L0.292893 7.29289ZM11 8L11 7L1 7L1 8L1 9L11 9L11 8Z"
16
- fill="#B1B4B6"
17
- ></path>
18
- </svg>
19
- <span style="font-family:GDS Transport">More deprived</span>
5
+ <div class="axis govuk-body-{textSize}">
6
+ <div class="left-label">
7
+ <div class="arrow-container">
8
+ <svg
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ width="18"
11
+ height="16"
12
+ viewBox="0 0 18 16"
13
+ >
14
+ <path
15
+ d="M8 1L1 8L8 15M1 8H17"
16
+ stroke="darkgrey"
17
+ stroke-width="2"
18
+ fill="none"
19
+ stroke-linecap="round"
20
+ stroke-linejoin="round"
21
+ ></path>
22
+ </svg>
23
+ </div>
24
+ <span class="axis-text">{axisLabels[0]}</span>
20
25
  </div>
21
- <div class="less-deprived">
22
- <span style="font-family:GDS Transport">Less deprived</span>
23
- <svg
24
- xmlns="http://www.w3.org/2000/svg"
25
- width="12"
26
- height="16"
27
- viewBox="0 0 12 16"
28
- fill="none"
29
- >
30
- <path
31
- d="M11.2071 8.70711C11.5976 8.31658 11.5976 7.68342 11.2071 7.2929L4.84315 0.928933C4.45262 0.538409 3.81946 0.538408 3.42893 0.928933C3.03841 1.31946 3.03841 1.95262 3.42893 2.34315L9.08579 8L3.42893 13.6569C3.03841 14.0474 3.03841 14.6805 3.42893 15.0711C3.81946 15.4616 4.45262 15.4616 4.84314 15.0711L11.2071 8.70711ZM0.5 8L0.5 9L10.5 9L10.5 8L10.5 7L0.5 7L0.5 8Z"
32
- fill="#B1B4B6"
33
- ></path>
34
- </svg>
26
+ <div class="right-label">
27
+ <span class="axis-text">{axisLabels[1]}</span>
28
+ <div class="arrow-container">
29
+ <svg
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ width="18"
32
+ height="16"
33
+ viewBox="0 0 18 16"
34
+ >
35
+ <path
36
+ d="M10 1L17 8L10 15M17 8H1"
37
+ stroke="darkgrey"
38
+ stroke-width="2"
39
+ fill="none"
40
+ stroke-linecap="round"
41
+ stroke-linejoin="round"
42
+ ></path>
43
+ </svg>
44
+ </div>
35
45
  </div>
36
46
  </div>
37
47
 
38
48
  <style>
49
+ svg {
50
+ overflow: visible;
51
+ }
52
+
39
53
  .axis {
40
54
  display: flex;
41
55
  justify-content: space-between;
42
- align-items: center;
43
- padding: 0 var(--axis-padding);
56
+ margin-bottom: 0;
44
57
  }
45
58
 
46
- .less-deprived,
47
- .more-deprived {
59
+ .left-label,
60
+ .right-label {
48
61
  display: flex;
49
- align-items: center;
50
- gap: 5px;
62
+ gap: 4px;
63
+ max-width: 120px;
51
64
  }
52
65
 
53
- /* Tell the parent to act as a container */
54
- .axis {
55
- container-type: inline-size;
66
+ .right-label {
67
+ text-align: end;
56
68
  }
57
69
 
58
- /* Container query: hide the child if parent's width is less than 400px */
59
- @container (max-width: 18rem) {
60
- .less-deprived {
61
- display: none;
62
- }
70
+ .axis-text {
71
+ font-family: "GDS Transport";
72
+ line-height: 0.9;
73
+ color: #666666;
74
+ font-style: italic;
63
75
  }
64
76
 
65
- @container (max-width: 25rem) {
66
- .average {
67
- display: none;
68
- }
77
+ .arrow-container {
78
+ display: flex;
79
+ align-items: center;
69
80
  }
70
81
  </style>
@@ -4,10 +4,10 @@ type PositionChartAxis = {
4
4
  $set?(props: Partial<$$ComponentProps>): void;
5
5
  };
6
6
  declare const PositionChartAxis: import("svelte").Component<{
7
- markerRadius?: any;
8
- barWidth?: any;
7
+ textSize?: string;
8
+ axisLabels?: any[];
9
9
  }, {}, "">;
10
10
  type $$ComponentProps = {
11
- markerRadius?: any;
12
- barWidth?: any;
11
+ textSize?: string;
12
+ axisLabels?: any[];
13
13
  };
@@ -2,48 +2,63 @@
2
2
  import Button from "./../../ui/Button.svelte";
3
3
 
4
4
  let {
5
- data = undefined,
6
- metaData = undefined,
5
+ data = [],
6
+ metadata = {},
7
7
  caption = undefined,
8
8
  colourScale = undefined,
9
9
  } = $props();
10
10
 
11
- let localCopyOfData = $derived([...data]);
11
+ let localCopyOfData = $state([...(data ?? [])]);
12
+
13
+ let sortState = $state({
14
+ column: null,
15
+ order: null, // "ascending" | "descending" | null
16
+ });
17
+
18
+ $effect(() => {
19
+ localCopyOfData = [...(data ?? [])];
20
+ });
12
21
 
13
22
  function hasUniqueValues(array, key) {
14
23
  const seen = new Set();
15
24
  for (const obj of array) {
16
25
  if (seen.has(obj[key])) {
17
- return false; // Duplicate found
26
+ return false;
18
27
  }
19
28
  seen.add(obj[key]);
20
29
  }
21
- return true; // All values are unique
30
+ return true;
22
31
  }
23
32
 
24
- let columns = [];
25
-
26
- for (const column in localCopyOfData[0]) {
27
- // create a variable to store whether the key is unique or not
28
- const keyIsUnique = hasUniqueValues(localCopyOfData, column);
29
- // get data type of each column
30
- const columnDataType = typeof localCopyOfData[0][column];
31
- // for each one create an object and push it into the array
32
- const columnObject = {
33
- key: column,
34
- isUnique: keyIsUnique,
35
- dataType: columnDataType,
36
- };
37
- columns.push(columnObject);
38
- }
33
+ let columns = $derived.by(() => {
34
+ if (!data || data.length === 0) return [];
35
+
36
+ const derivedColumns = [];
39
37
 
40
- $inspect("columns array is ", columns);
38
+ for (const column in data[0]) {
39
+ const keyIsUnique = hasUniqueValues(data, column);
40
+ const columnDataType = typeof data[0][column];
41
+
42
+ derivedColumns.push({
43
+ key: column,
44
+ isUnique: keyIsUnique,
45
+ dataType: columnDataType,
46
+ id: metadata[column].order,
47
+ });
48
+ }
49
+
50
+ const orderedColumns = derivedColumns.sort((a, b) => a.id - b.id);
51
+
52
+ return orderedColumns;
53
+ });
41
54
 
42
- const metrics = columns
43
- .filter((column) => column.dataType === "number")
44
- .map((column) => column.key);
55
+ $inspect(columns);
45
56
 
46
- let sortState = $state({ column: "sortedColumn", order: "ascending" });
57
+ const metrics = $derived(
58
+ columns
59
+ .filter((column) => column.dataType === "number")
60
+ .map((column) => column.key),
61
+ );
47
62
 
48
63
  function updateSortState(columnToSort, sortOrder) {
49
64
  sortState.column = columnToSort;
@@ -51,61 +66,63 @@
51
66
  }
52
67
 
53
68
  function sortFunction() {
54
- if (typeof localCopyOfData[0][sortState["column"]] === "number") {
69
+ if (!localCopyOfData.length || !sortState.column || !sortState.order)
70
+ return;
71
+
72
+ const sorted = [...localCopyOfData];
73
+
74
+ if (typeof sorted[0][sortState.column] === "number") {
55
75
  if (sortState.order === "ascending") {
56
- localCopyOfData.sort(
57
- (a, b) => a[sortState.column] - b[sortState.column],
58
- );
76
+ sorted.sort((a, b) => a[sortState.column] - b[sortState.column]);
59
77
  } else {
60
- localCopyOfData.sort(
61
- (a, b) => b[sortState.column] - a[sortState.column],
62
- );
78
+ sorted.sort((a, b) => b[sortState.column] - a[sortState.column]);
63
79
  }
64
80
  }
65
- if (typeof localCopyOfData[0][sortState["column"]] === "string") {
81
+
82
+ if (typeof sorted[0][sortState.column] === "string") {
66
83
  if (sortState.order === "ascending") {
67
- localCopyOfData.sort((a, b) =>
68
- a[sortState["column"]].localeCompare(b[sortState["column"]]),
84
+ sorted.sort((a, b) =>
85
+ a[sortState.column].localeCompare(b[sortState.column]),
69
86
  );
70
87
  } else {
71
- localCopyOfData.sort((a, b) =>
72
- b[sortState["column"]].localeCompare(a[sortState["column"]]),
88
+ sorted.sort((a, b) =>
89
+ b[sortState.column].localeCompare(a[sortState.column]),
73
90
  );
74
91
  }
75
92
  }
76
- }
77
-
78
- $inspect(
79
- sortState,
80
- localCopyOfData[0],
81
- typeof localCopyOfData[0][sortState["column"]],
82
- );
83
93
 
84
- // heat map
85
-
86
- // calculate the min and max of each metric
87
- const minAndMaxValues = {}; // create an empty object to store them in
88
- for (const metric of metrics) {
89
- // get the values
90
- const metricValues = localCopyOfData.map((item) => item[metric]);
91
- const min = Math.min(...metricValues);
92
- const max = Math.max(...metricValues);
93
- // store them
94
- minAndMaxValues[metric] = { min, max };
94
+ localCopyOfData = sorted;
95
95
  }
96
96
 
97
- localCopyOfData = localCopyOfData.map((row) => {
98
- const rowWithNorms = { ...row };
97
+ const minAndMaxValues = $derived.by(() => {
98
+ const result = {};
99
99
 
100
100
  for (const metric of metrics) {
101
- const { min, max } = minAndMaxValues[metric];
102
- const value = row[metric];
103
- const normalisedValue = (value - min) / (max - min);
101
+ const metricValues = localCopyOfData.map((item) => item[metric]);
102
+ const min = Math.min(...metricValues);
103
+ const max = Math.max(...metricValues);
104
104
 
105
- rowWithNorms[`${metric}__normalised`] = normalisedValue;
105
+ result[metric] = { min, max };
106
106
  }
107
107
 
108
- return rowWithNorms;
108
+ return result;
109
+ });
110
+
111
+ const displayRows = $derived.by(() => {
112
+ return localCopyOfData.map((row) => {
113
+ const rowWithNorms = { ...row };
114
+
115
+ for (const metric of metrics) {
116
+ const { min, max } = minAndMaxValues[metric];
117
+ const value = row[metric];
118
+
119
+ const normalisedValue = max === min ? 0.5 : (value - min) / (max - min);
120
+
121
+ rowWithNorms[`${metric}__normalised`] = normalisedValue;
122
+ }
123
+
124
+ return rowWithNorms;
125
+ });
109
126
  });
110
127
 
111
128
  function normToColor(norm) {
@@ -119,6 +136,27 @@
119
136
  }
120
137
 
121
138
  const colorKey = Object.entries({ Good: 1, Ok: 0.5, Bad: 0 });
139
+
140
+ function handleSort(columnKey) {
141
+ let newDirection = "ascending";
142
+
143
+ if (sortState.column === columnKey) {
144
+ if (sortState.order === "ascending") {
145
+ newDirection = "descending";
146
+ } else if (sortState.order === "descending") {
147
+ newDirection = null;
148
+ }
149
+ }
150
+
151
+ if (newDirection === null) {
152
+ updateSortState(null, null);
153
+ localCopyOfData = [...(data ?? [])];
154
+ return;
155
+ }
156
+
157
+ updateSortState(columnKey, newDirection);
158
+ sortFunction();
159
+ }
122
160
  </script>
123
161
 
124
162
  <div class="p-4">
@@ -126,7 +164,10 @@
126
164
  <div class="legend">
127
165
  <div>Colour key:</div>
128
166
  {#each colorKey as key}
129
- <div class="color-keys" style="background-color: {normToColor(key[1])}">
167
+ <div
168
+ class="color-keys"
169
+ style={`background-color: ${normToColor(key[1])}`}
170
+ >
130
171
  {key[0]}
131
172
  </div>
132
173
  {/each}
@@ -135,62 +176,65 @@
135
176
 
136
177
  <div class="table-container">
137
178
  <div id="table-caption" class="sticky-caption">{caption}</div>
179
+
138
180
  <table class="govuk-table" data-module="moj-sortable-table">
139
- <thead class="govuk-table__head"
140
- ><tr class="govuk-table__row">
181
+ <thead class="govuk-table__head">
182
+ <tr class="govuk-table__row">
141
183
  {#each columns as column}
142
184
  <th
143
185
  scope="col"
144
186
  class={`govuk-table__header ${column.dataType === "number" ? "govuk-table__header--numeric" : ""}`}
145
- title={metaData[column.key].explainer}
146
- aria-sort={sortState.column !== column.key
187
+ title={metadata[column.key]?.explainer}
188
+ style={metadata[column.key]?.width
189
+ ? `min-width: ${metadata[column.key].width}`
190
+ : undefined}
191
+ aria-sort={sortState.column !== column.key ||
192
+ sortState.order === null
147
193
  ? "none"
148
- : sortState.column === column.key &&
149
- sortState.order === "descending"
194
+ : sortState.order === "descending"
150
195
  ? "descending"
151
196
  : "ascending"}
152
197
  >
153
198
  <div class="header">
154
199
  <Button
155
- textContent={metaData[column.key].shortLabel}
200
+ textContent={metadata[column.key]?.shortLabel ?? column.key}
156
201
  buttonType={"table header"}
157
- onClickFunction={() => {
158
- const newDirection =
159
- sortState.column === column.key &&
160
- sortState.order === "ascending"
161
- ? "descending"
162
- : "ascending";
163
-
164
- updateSortState(column.key, newDirection);
165
- sortFunction();
166
- }}
202
+ direction={sortState.column === column.key
203
+ ? sortState.order
204
+ : null}
205
+ onClickFunction={() => handleSort(column.key)}
167
206
  ></Button>
168
- </div></th
169
- >
207
+ </div>
208
+ </th>
170
209
  {/each}
171
- </tr></thead
172
- >
210
+ </tr>
211
+ </thead>
212
+
173
213
  <tbody class="govuk-table__body">
174
- {#each localCopyOfData as row}
214
+ {#each displayRows as row}
175
215
  <tr class="govuk-table__row">
176
216
  {#each columns as column}
177
217
  {#if column.dataType === "number"}
178
218
  {#if colourScale === "On"}
179
219
  <td
180
220
  class="govuk-table__cell govuk-table__cell--numeric"
181
- style="background-color: {metaData[column.key].direction ===
182
- 'Higher is better'
183
- ? normToColor(row[column.key + '__normalised'])
184
- : normToColorReverse(row[column.key + '__normalised'])}"
185
- >{row[column.key]}</td
221
+ style={`background-color: ${
222
+ metadata[column.key]?.direction === "Higher is better"
223
+ ? normToColor(row[column.key + "__normalised"])
224
+ : normToColorReverse(row[column.key + "__normalised"])
225
+ }`}
186
226
  >
227
+ {@html row[column.key]}
228
+ </td>
187
229
  {:else}
188
- <td class="govuk-table__cell govuk-table__cell--numeric"
189
- >{row[column.key]}</td
190
- >
230
+ <td class="govuk-table__cell govuk-table__cell--numeric">
231
+ {@html row[column.key]}
232
+ </td>
191
233
  {/if}
192
234
  {:else}
193
- <td class="govuk-table__cell">{row[column.key]}</td>
235
+ <td class="govuk-table__cell">
236
+ {@html row[column.key]}
237
+ </td>
194
238
  {/if}
195
239
  {/each}
196
240
  </tr>
@@ -202,7 +246,7 @@
202
246
 
203
247
  <style>
204
248
  .table-container {
205
- max-height: 85vh;
249
+ max-height: 60vh;
206
250
  overflow-y: auto;
207
251
  overflow-x: scroll;
208
252
  width: 100%;
@@ -228,8 +272,14 @@
228
272
  gap: 20px;
229
273
  margin: 10px;
230
274
  }
275
+
231
276
  .color-keys {
232
277
  border-radius: 10%;
233
278
  padding: 6px;
234
279
  }
280
+
281
+ .header {
282
+ display: flex;
283
+ align-items: center;
284
+ }
235
285
  </style>
@@ -4,14 +4,14 @@ type Table = {
4
4
  $set?(props: Partial<$$ComponentProps>): void;
5
5
  };
6
6
  declare const Table: import("svelte").Component<{
7
- data?: any;
8
- metaData?: any;
7
+ data?: any[];
8
+ metadata?: Record<string, any>;
9
9
  caption?: any;
10
10
  colourScale?: any;
11
11
  }, {}, "">;
12
12
  type $$ComponentProps = {
13
- data?: any;
14
- metaData?: any;
13
+ data?: any[];
14
+ metadata?: Record<string, any>;
15
15
  caption?: any;
16
16
  colourScale?: any;
17
17
  };
@@ -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>;