@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.
- package/README.md +7 -0
- package/dist/components/content/Tag.svelte +32 -0
- package/dist/components/content/Tag.svelte.d.ts +13 -0
- package/dist/components/data-vis/Histogram.svelte +287 -0
- package/dist/components/data-vis/Histogram.svelte.d.ts +75 -0
- package/dist/components/data-vis/axis/Axis.svelte +217 -34
- package/dist/components/data-vis/axis/Axis.svelte.d.ts +38 -30
- package/dist/components/data-vis/axis/Ticks.svelte +142 -78
- package/dist/components/data-vis/axis/Ticks.svelte.d.ts +28 -31
- package/dist/components/data-vis/line-chart/LineChart.svelte +51 -21
- package/dist/components/data-vis/line-chart/LineChart.svelte.d.ts +14 -6
- package/dist/components/data-vis/line-chart/ValueLabel.svelte +2 -1
- package/dist/components/data-vis/line-chart/ValueLabel.svelte.d.ts +2 -0
- package/dist/components/data-vis/position-chart/PositionChart.svelte +279 -122
- package/dist/components/data-vis/position-chart/PositionChart.svelte.d.ts +37 -5
- package/dist/components/data-vis/position-chart/PositionChartAxis.svelte +59 -48
- package/dist/components/data-vis/position-chart/PositionChartAxis.svelte.d.ts +4 -4
- package/dist/components/data-vis/table/Table.svelte +145 -95
- package/dist/components/data-vis/table/Table.svelte.d.ts +4 -4
- package/dist/components/layout/Footer.svelte +9 -0
- package/dist/components/layout/Footer.svelte.d.ts +1 -0
- package/dist/components/layout/PhaseBanner.svelte +10 -1
- package/dist/components/layout/PhaseBanner.svelte.d.ts +1 -0
- package/dist/components/layout/ServiceNavigation.svelte +19 -1
- package/dist/components/layout/ServiceNavigation.svelte.d.ts +2 -0
- package/dist/components/ui/Accordion.svelte +212 -66
- package/dist/components/ui/Accordion.svelte.d.ts +2 -0
- package/dist/components/ui/BasicMultiSelect.svelte +716 -0
- package/dist/components/ui/BasicMultiSelect.svelte.d.ts +18 -0
- package/dist/components/ui/Button.svelte +220 -104
- package/dist/components/ui/Button.svelte.d.ts +4 -0
- package/dist/components/ui/Card.svelte +48 -60
- package/dist/components/ui/Card.svelte.d.ts +26 -12
- package/dist/components/ui/CardHeader.svelte +46 -0
- package/dist/components/ui/CardHeader.svelte.d.ts +21 -0
- package/dist/components/ui/ChartExporter.svelte +142 -0
- package/dist/components/ui/ChartExporter.svelte.d.ts +16 -0
- package/dist/components/ui/CheckBox.svelte +1 -0
- package/dist/components/ui/Details.svelte +47 -8
- package/dist/components/ui/Details.svelte.d.ts +8 -10
- package/dist/components/ui/Masthead.svelte +44 -6
- package/dist/components/ui/Masthead.svelte.d.ts +6 -0
- package/dist/components/ui/RelatedContent.svelte +4 -1
- package/dist/components/ui/RelatedContent.svelte.d.ts +1 -0
- package/dist/components/ui/SearchAutocomplete.svelte +69 -44
- package/dist/components/ui/SearchAutocomplete.svelte.d.ts +1 -0
- package/dist/components/ui/Select.svelte +18 -7
- package/dist/components/ui/Tabs.svelte +192 -18
- package/dist/components/ui/Tabs.svelte.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +4 -1
|
@@ -1,70 +1,81 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
let {
|
|
2
|
+
let { textSize = "s", axisLabels = ["Left", "Right"] } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<div class="axis
|
|
6
|
-
<div class="
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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="
|
|
22
|
-
<span
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
43
|
-
padding: 0 var(--axis-padding);
|
|
56
|
+
margin-bottom: 0;
|
|
44
57
|
}
|
|
45
58
|
|
|
46
|
-
.
|
|
47
|
-
.
|
|
59
|
+
.left-label,
|
|
60
|
+
.right-label {
|
|
48
61
|
display: flex;
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
gap: 4px;
|
|
63
|
+
max-width: 120px;
|
|
51
64
|
}
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
container-type: inline-size;
|
|
66
|
+
.right-label {
|
|
67
|
+
text-align: end;
|
|
56
68
|
}
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
8
|
-
|
|
7
|
+
textSize?: string;
|
|
8
|
+
axisLabels?: any[];
|
|
9
9
|
}, {}, "">;
|
|
10
10
|
type $$ComponentProps = {
|
|
11
|
-
|
|
12
|
-
|
|
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 =
|
|
6
|
-
|
|
5
|
+
data = [],
|
|
6
|
+
metadata = {},
|
|
7
7
|
caption = undefined,
|
|
8
8
|
colourScale = undefined,
|
|
9
9
|
} = $props();
|
|
10
10
|
|
|
11
|
-
let localCopyOfData = $
|
|
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;
|
|
26
|
+
return false;
|
|
18
27
|
}
|
|
19
28
|
seen.add(obj[key]);
|
|
20
29
|
}
|
|
21
|
-
return true;
|
|
30
|
+
return true;
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
let columns =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
-
.filter((column) => column.dataType === "number")
|
|
44
|
-
.map((column) => column.key);
|
|
55
|
+
$inspect(columns);
|
|
45
56
|
|
|
46
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
81
|
+
|
|
82
|
+
if (typeof sorted[0][sortState.column] === "string") {
|
|
66
83
|
if (sortState.order === "ascending") {
|
|
67
|
-
|
|
68
|
-
a[sortState
|
|
84
|
+
sorted.sort((a, b) =>
|
|
85
|
+
a[sortState.column].localeCompare(b[sortState.column]),
|
|
69
86
|
);
|
|
70
87
|
} else {
|
|
71
|
-
|
|
72
|
-
b[sortState
|
|
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
|
-
|
|
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
|
-
|
|
98
|
-
const
|
|
97
|
+
const minAndMaxValues = $derived.by(() => {
|
|
98
|
+
const result = {};
|
|
99
99
|
|
|
100
100
|
for (const metric of metrics) {
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const
|
|
101
|
+
const metricValues = localCopyOfData.map((item) => item[metric]);
|
|
102
|
+
const min = Math.min(...metricValues);
|
|
103
|
+
const max = Math.max(...metricValues);
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
result[metric] = { min, max };
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
return
|
|
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
|
|
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
|
-
|
|
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={
|
|
146
|
-
|
|
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.
|
|
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={
|
|
200
|
+
textContent={metadata[column.key]?.shortLabel ?? column.key}
|
|
156
201
|
buttonType={"table header"}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
|
169
|
-
>
|
|
207
|
+
</div>
|
|
208
|
+
</th>
|
|
170
209
|
{/each}
|
|
171
|
-
</tr
|
|
172
|
-
>
|
|
210
|
+
</tr>
|
|
211
|
+
</thead>
|
|
212
|
+
|
|
173
213
|
<tbody class="govuk-table__body">
|
|
174
|
-
{#each
|
|
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=
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
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">
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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>
|
|
@@ -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
|
|
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>;
|