@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type Option = {
|
|
2
|
+
id: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
type $$ComponentProps = {
|
|
6
|
+
options?: Option[];
|
|
7
|
+
selected?: (string | number)[];
|
|
8
|
+
colorArray?: string[];
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
enableColors?: boolean;
|
|
13
|
+
startsWithSearch?: boolean;
|
|
14
|
+
resetButton?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const BasicMultiSelect: import("svelte").Component<$$ComponentProps, {}, "selected">;
|
|
17
|
+
type BasicMultiSelect = ReturnType<typeof BasicMultiSelect>;
|
|
18
|
+
export default BasicMultiSelect;
|
|
@@ -7,162 +7,257 @@
|
|
|
7
7
|
componentNameProp = undefined,
|
|
8
8
|
onClickFunction = undefined,
|
|
9
9
|
noPadding = false,
|
|
10
|
+
direction = null, // "ascending" | "descending" | null
|
|
11
|
+
disabled = false,
|
|
10
12
|
} = $props();
|
|
11
13
|
|
|
12
14
|
let buttonClass = $derived(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
buttonType === "default"
|
|
16
|
+
? "govuk-button"
|
|
17
|
+
: buttonType === "secondary"
|
|
18
|
+
? "govuk-button govuk-button--secondary"
|
|
19
|
+
: buttonType === "warning"
|
|
20
|
+
? "govuk-button govuk-button--warning"
|
|
21
|
+
: buttonType === "dark background"
|
|
22
|
+
? "govuk-button govuk-button--inverse"
|
|
23
|
+
: undefined,
|
|
22
24
|
);
|
|
23
25
|
</script>
|
|
24
26
|
|
|
25
27
|
{#if noPadding}
|
|
26
28
|
{#if buttonType === "moreInfo"}
|
|
27
29
|
<div>
|
|
28
|
-
<button class="more-info-button" onclick={onClickFunction}>
|
|
30
|
+
<button class="more-info-button" type="button" onclick={onClickFunction}>
|
|
29
31
|
<Icon kind="info" />
|
|
30
32
|
</button>
|
|
31
33
|
</div>
|
|
34
|
+
|
|
32
35
|
{:else if buttonType === "start"}
|
|
33
36
|
<a
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
href="#"
|
|
38
|
+
role="button"
|
|
39
|
+
draggable="false"
|
|
40
|
+
class="govuk-button govuk-button--start"
|
|
41
|
+
data-module="govuk-button"
|
|
42
|
+
onclick={onClickFunction}
|
|
40
43
|
>
|
|
41
44
|
{textContent}
|
|
42
45
|
<svg
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
class="govuk-button__start-icon"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
width="17.5"
|
|
49
|
+
height="19"
|
|
50
|
+
viewBox="0 0 33 40"
|
|
51
|
+
aria-hidden="true"
|
|
52
|
+
focusable="false"
|
|
50
53
|
>
|
|
51
54
|
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"></path>
|
|
52
55
|
</svg>
|
|
53
56
|
</a>
|
|
57
|
+
|
|
54
58
|
{:else if buttonType === "disabled"}
|
|
55
59
|
<button
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
type="submit"
|
|
61
|
+
disabled
|
|
62
|
+
aria-disabled="true"
|
|
63
|
+
class="govuk-button"
|
|
64
|
+
data-module="govuk-button"
|
|
65
|
+
onclick={onClickFunction}
|
|
62
66
|
>
|
|
63
67
|
{textContent}
|
|
64
68
|
</button>
|
|
69
|
+
|
|
65
70
|
{:else if buttonType === "table header"}
|
|
66
|
-
<button
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
<button
|
|
72
|
+
type="button"
|
|
73
|
+
class="text-header"
|
|
74
|
+
onclick={onClickFunction}
|
|
75
|
+
disabled={disabled}
|
|
76
|
+
>
|
|
77
|
+
<span>{textContent}</span>
|
|
78
|
+
|
|
79
|
+
<span class="sort-icon" aria-hidden="true">
|
|
80
|
+
{#if direction === "ascending"}
|
|
81
|
+
<svg
|
|
82
|
+
class="sort-arrow-single"
|
|
83
|
+
width="1em"
|
|
84
|
+
height="1em"
|
|
85
|
+
focusable="false"
|
|
86
|
+
role="img"
|
|
87
|
+
viewBox="0 0 22 22"
|
|
88
|
+
fill="currentColor"
|
|
89
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
90
|
+
>
|
|
91
|
+
<path
|
|
92
|
+
d="M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z"
|
|
93
|
+
fill="currentColor"
|
|
94
|
+
></path>
|
|
95
|
+
</svg>
|
|
96
|
+
{:else if direction === "descending"}
|
|
97
|
+
<svg
|
|
98
|
+
class="sort-arrow-single"
|
|
99
|
+
width="1em"
|
|
100
|
+
height="1em"
|
|
101
|
+
focusable="false"
|
|
102
|
+
role="img"
|
|
103
|
+
viewBox="0 0 22 22"
|
|
104
|
+
fill="currentColor"
|
|
105
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
106
|
+
>
|
|
107
|
+
<path
|
|
108
|
+
d="M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z"
|
|
109
|
+
fill="currentColor"
|
|
110
|
+
></path>
|
|
111
|
+
</svg>
|
|
112
|
+
{:else}
|
|
113
|
+
<svg
|
|
114
|
+
class="sort-arrow-both"
|
|
115
|
+
width="1em"
|
|
116
|
+
height="1em"
|
|
117
|
+
focusable="false"
|
|
118
|
+
role="img"
|
|
119
|
+
viewBox="0 0 22 22"
|
|
120
|
+
fill="currentColor"
|
|
121
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
122
|
+
>
|
|
123
|
+
<path
|
|
124
|
+
d="M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z"
|
|
125
|
+
fill="currentColor"
|
|
126
|
+
></path>
|
|
127
|
+
<path
|
|
128
|
+
d="M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z"
|
|
129
|
+
fill="currentColor"
|
|
130
|
+
></path>
|
|
131
|
+
</svg>
|
|
132
|
+
{/if}
|
|
133
|
+
</span>
|
|
89
134
|
</button>
|
|
135
|
+
|
|
90
136
|
{:else}
|
|
91
137
|
<button
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
138
|
+
type="submit"
|
|
139
|
+
class={buttonClass}
|
|
140
|
+
data-module="govuk-button"
|
|
141
|
+
onclick={onClickFunction}
|
|
96
142
|
>
|
|
97
143
|
{textContent}
|
|
98
144
|
</button>
|
|
99
145
|
{/if}
|
|
146
|
+
|
|
100
147
|
{:else}
|
|
101
148
|
<div class="p-4">
|
|
102
149
|
{#if buttonType === "start"}
|
|
103
150
|
<a
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
151
|
+
href="#"
|
|
152
|
+
role="button"
|
|
153
|
+
draggable="false"
|
|
154
|
+
class="govuk-button govuk-button--start"
|
|
155
|
+
data-module="govuk-button"
|
|
156
|
+
onclick={onClickFunction}
|
|
110
157
|
>
|
|
111
158
|
{textContent}
|
|
112
159
|
<svg
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
160
|
+
class="govuk-button__start-icon"
|
|
161
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
162
|
+
width="17.5"
|
|
163
|
+
height="19"
|
|
164
|
+
viewBox="0 0 33 40"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
focusable="false"
|
|
120
167
|
>
|
|
121
168
|
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"></path>
|
|
122
169
|
</svg>
|
|
123
170
|
</a>
|
|
171
|
+
|
|
124
172
|
{:else if buttonType === "disabled"}
|
|
125
173
|
<button
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
174
|
+
type="submit"
|
|
175
|
+
disabled
|
|
176
|
+
aria-disabled="true"
|
|
177
|
+
class="govuk-button"
|
|
178
|
+
data-module="govuk-button"
|
|
179
|
+
onclick={onClickFunction}
|
|
132
180
|
>
|
|
133
181
|
{textContent}
|
|
134
182
|
</button>
|
|
183
|
+
|
|
135
184
|
{:else if buttonType === "table header"}
|
|
136
|
-
<button
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
185
|
+
<button
|
|
186
|
+
type="button"
|
|
187
|
+
class="text-header"
|
|
188
|
+
onclick={onClickFunction}
|
|
189
|
+
disabled={disabled}
|
|
190
|
+
>
|
|
191
|
+
<span>{textContent}</span>
|
|
192
|
+
|
|
193
|
+
<span class="sort-icon" aria-hidden="true">
|
|
194
|
+
{#if direction === "ascending"}
|
|
195
|
+
<svg
|
|
196
|
+
class="sort-arrow-single"
|
|
197
|
+
width="1em"
|
|
198
|
+
height="1em"
|
|
199
|
+
focusable="false"
|
|
200
|
+
role="img"
|
|
201
|
+
viewBox="0 0 22 22"
|
|
202
|
+
fill="currentColor"
|
|
203
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
204
|
+
>
|
|
205
|
+
<path
|
|
206
|
+
d="M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z"
|
|
207
|
+
fill="currentColor"
|
|
208
|
+
></path>
|
|
209
|
+
</svg>
|
|
210
|
+
{:else if direction === "descending"}
|
|
211
|
+
<svg
|
|
212
|
+
class="sort-arrow-single"
|
|
213
|
+
width="1em"
|
|
214
|
+
height="1em"
|
|
215
|
+
focusable="false"
|
|
216
|
+
role="img"
|
|
217
|
+
viewBox="0 0 22 22"
|
|
218
|
+
fill="currentColor"
|
|
219
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
220
|
+
>
|
|
221
|
+
<path
|
|
222
|
+
d="M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z"
|
|
223
|
+
fill="currentColor"
|
|
224
|
+
></path>
|
|
225
|
+
</svg>
|
|
226
|
+
{:else}
|
|
227
|
+
<svg
|
|
228
|
+
class="sort-arrow-both"
|
|
229
|
+
width="1em"
|
|
230
|
+
height="1em"
|
|
231
|
+
focusable="false"
|
|
232
|
+
role="img"
|
|
233
|
+
viewBox="0 0 22 22"
|
|
234
|
+
fill="currentColor"
|
|
235
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
236
|
+
>
|
|
237
|
+
<path
|
|
238
|
+
d="M8.1875 9.5L10.9609 3.95703L13.7344 9.5H8.1875Z"
|
|
239
|
+
fill="currentColor"
|
|
240
|
+
></path>
|
|
241
|
+
<path
|
|
242
|
+
d="M13.7344 12.0781L10.9609 17.6211L8.1875 12.0781H13.7344Z"
|
|
243
|
+
fill="currentColor"
|
|
244
|
+
></path>
|
|
245
|
+
</svg>
|
|
246
|
+
{/if}
|
|
247
|
+
</span>
|
|
159
248
|
</button>
|
|
249
|
+
|
|
250
|
+
{:else if buttonType === "moreInfo"}
|
|
251
|
+
<button class="more-info-button" type="button" onclick={onClickFunction}>
|
|
252
|
+
<Icon kind="info" />
|
|
253
|
+
</button>
|
|
254
|
+
|
|
160
255
|
{:else}
|
|
161
256
|
<button
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
257
|
+
type="button"
|
|
258
|
+
class={buttonClass}
|
|
259
|
+
data-module="govuk-button"
|
|
260
|
+
onclick={onClickFunction}
|
|
166
261
|
>
|
|
167
262
|
{textContent}
|
|
168
263
|
</button>
|
|
@@ -176,7 +271,28 @@
|
|
|
176
271
|
color: #005ea5;
|
|
177
272
|
}
|
|
178
273
|
|
|
274
|
+
.sort-icon {
|
|
275
|
+
display: inline-flex;
|
|
276
|
+
align-items: center;
|
|
277
|
+
justify-content: center;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.sort-icon svg {
|
|
281
|
+
display: block;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.sort-arrow-single {
|
|
285
|
+
width: 1em;
|
|
286
|
+
height: 1em;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.sort-arrow-both {
|
|
290
|
+
width: 1em;
|
|
291
|
+
height: 1em;
|
|
292
|
+
}
|
|
293
|
+
|
|
179
294
|
.more-info-button {
|
|
295
|
+
display: flex;
|
|
180
296
|
flex: none;
|
|
181
297
|
font-size: 1.25rem;
|
|
182
298
|
padding-top: 2px;
|
|
@@ -184,11 +300,11 @@
|
|
|
184
300
|
cursor: pointer;
|
|
185
301
|
}
|
|
186
302
|
|
|
187
|
-
/* For the scale on hover of group parent */
|
|
188
303
|
:hover .more-info-button {
|
|
189
304
|
transform: scale(1.25);
|
|
190
305
|
}
|
|
306
|
+
|
|
191
307
|
.more-info-button.custom-ring {
|
|
192
308
|
box-shadow: 0 0 0 2px rgba(59, 130, 246, 1);
|
|
193
309
|
}
|
|
194
|
-
</style>
|
|
310
|
+
</style>
|
|
@@ -9,6 +9,8 @@ declare const Button: import("svelte").Component<{
|
|
|
9
9
|
componentNameProp?: any;
|
|
10
10
|
onClickFunction?: any;
|
|
11
11
|
noPadding?: boolean;
|
|
12
|
+
direction?: any;
|
|
13
|
+
disabled?: boolean;
|
|
12
14
|
}, {}, "">;
|
|
13
15
|
type $$ComponentProps = {
|
|
14
16
|
textContent?: any;
|
|
@@ -16,4 +18,6 @@ type $$ComponentProps = {
|
|
|
16
18
|
componentNameProp?: any;
|
|
17
19
|
onClickFunction?: any;
|
|
18
20
|
noPadding?: boolean;
|
|
21
|
+
direction?: any;
|
|
22
|
+
disabled?: boolean;
|
|
19
23
|
};
|
|
@@ -1,101 +1,89 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import CardHeader from "./CardHeader.svelte";
|
|
3
|
+
|
|
2
4
|
let {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
headerIsLink = true,
|
|
6
|
+
headerText = "Card header",
|
|
7
|
+
headerTextSize = "1.5rem",
|
|
8
|
+
headerTextColor = "#1D70B8",
|
|
9
|
+
headerBackgroundColor = "white",
|
|
6
10
|
href = undefined,
|
|
7
|
-
|
|
8
|
-
bodyText =
|
|
11
|
+
onlyTextInBody = true,
|
|
12
|
+
bodyText = "Text in the body of the card",
|
|
13
|
+
headerSnippet = undefined,
|
|
14
|
+
bodySnippet = undefined,
|
|
15
|
+
children = undefined,
|
|
9
16
|
bodyTextColor = "#0B0C0C",
|
|
10
17
|
bodyBackgroundColor = "#FBFCFD",
|
|
11
18
|
bodyTopBorderColor = "#F4F8FB",
|
|
12
19
|
bodyBottomBorderColor = "#c3d9e9",
|
|
13
20
|
selectedValue = $bindable(),
|
|
14
|
-
|
|
21
|
+
display = "flex",
|
|
22
|
+
gridPosition = undefined,
|
|
23
|
+
subtitle = undefined,
|
|
15
24
|
} = $props();
|
|
16
25
|
</script>
|
|
17
26
|
|
|
18
|
-
<div class="card">
|
|
27
|
+
<div class="card" style="display: {display}">
|
|
19
28
|
<div
|
|
20
|
-
class="
|
|
21
|
-
style="background-color: {
|
|
29
|
+
class="header-div"
|
|
30
|
+
style="background-color: {headerBackgroundColor}; grid-row: {gridPosition?.[0]
|
|
31
|
+
?.row ?? null}; grid-column: {gridPosition?.[0]?.col ?? null};"
|
|
22
32
|
>
|
|
23
|
-
{#if
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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>
|
|
33
|
+
{#if headerIsLink}
|
|
34
|
+
<CardHeader
|
|
35
|
+
text={headerText}
|
|
36
|
+
textSize={headerTextSize}
|
|
37
|
+
textColor={headerTextColor}
|
|
38
|
+
backgroundColor={headerBackgroundColor}
|
|
39
|
+
{href}
|
|
40
|
+
{subtitle}
|
|
41
|
+
></CardHeader>
|
|
44
42
|
{:else}
|
|
45
|
-
{@render
|
|
43
|
+
{@render headerSnippet?.()}
|
|
46
44
|
{/if}
|
|
47
45
|
</div>
|
|
48
46
|
|
|
49
47
|
<div
|
|
50
48
|
class="body-div"
|
|
51
|
-
style="--body-bg-color: {bodyBackgroundColor}; --body-bottom-border-color: {bodyBottomBorderColor}; --body-top-border-color: {bodyTopBorderColor};
|
|
49
|
+
style="--body-bg-color: {bodyBackgroundColor}; --body-bottom-border-color: {bodyBottomBorderColor}; --body-top-border-color: {bodyTopBorderColor}; grid-row: {gridPosition?.[1]
|
|
50
|
+
?.row ?? null}; grid-column: {gridPosition?.[1]?.col ?? null};"
|
|
52
51
|
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
{#if onlyTextInBody}
|
|
53
|
+
<p
|
|
54
|
+
class="govuk-body body-text"
|
|
55
|
+
style="--body-text-color: {bodyTextColor};"
|
|
56
|
+
>
|
|
57
|
+
{bodyText}
|
|
58
|
+
</p>
|
|
59
|
+
{:else if children}
|
|
60
|
+
{@render children?.()}
|
|
61
|
+
{:else}
|
|
62
|
+
{@render bodySnippet?.()}
|
|
63
|
+
{/if}
|
|
56
64
|
</div>
|
|
57
65
|
</div>
|
|
58
66
|
|
|
59
67
|
<style>
|
|
60
68
|
.card {
|
|
61
|
-
display: flex;
|
|
62
69
|
flex-direction: column;
|
|
70
|
+
min-width: 0;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
|
-
.
|
|
66
|
-
padding:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.link {
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
justify-content: space-between;
|
|
73
|
-
width: 100%;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.link-heading {
|
|
77
|
-
color: var(--link-text-color);
|
|
73
|
+
.header-div {
|
|
74
|
+
padding: 20px;
|
|
75
|
+
flex: 1;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
.body-div {
|
|
81
79
|
background-color: var(--body-bg-color);
|
|
82
80
|
border-bottom: 1px solid var(--body-bottom-border-color);
|
|
83
81
|
border-top: 1px solid var(--body-top-border-color);
|
|
84
|
-
padding:
|
|
82
|
+
padding: 15px 1%;
|
|
85
83
|
flex: 1;
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
.body-text {
|
|
89
87
|
color: var(--body-text-color);
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
.govuk-heading-m {
|
|
93
|
-
/* overwriting margin and line-height to make link centered vertically */
|
|
94
|
-
margin: 0;
|
|
95
|
-
line-height: 1;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
a {
|
|
99
|
-
color: #1d70b8;
|
|
100
|
-
}
|
|
101
89
|
</style>
|
|
@@ -4,30 +4,44 @@ type Card = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const Card: import("svelte").Component<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
headerIsLink?: boolean;
|
|
8
|
+
headerText?: string;
|
|
9
|
+
headerTextSize?: string;
|
|
10
|
+
headerTextColor?: string;
|
|
11
|
+
headerBackgroundColor?: string;
|
|
10
12
|
href?: any;
|
|
11
|
-
|
|
12
|
-
bodyText?:
|
|
13
|
+
onlyTextInBody?: boolean;
|
|
14
|
+
bodyText?: string;
|
|
15
|
+
headerSnippet?: any;
|
|
16
|
+
bodySnippet?: any;
|
|
17
|
+
children?: any;
|
|
13
18
|
bodyTextColor?: string;
|
|
14
19
|
bodyBackgroundColor?: string;
|
|
15
20
|
bodyTopBorderColor?: string;
|
|
16
21
|
bodyBottomBorderColor?: string;
|
|
17
22
|
selectedValue?: any;
|
|
18
|
-
|
|
23
|
+
display?: string;
|
|
24
|
+
gridPosition?: any;
|
|
25
|
+
subtitle?: any;
|
|
19
26
|
}, {}, "selectedValue">;
|
|
20
27
|
type $$ComponentProps = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
headerIsLink?: boolean;
|
|
29
|
+
headerText?: string;
|
|
30
|
+
headerTextSize?: string;
|
|
31
|
+
headerTextColor?: string;
|
|
32
|
+
headerBackgroundColor?: string;
|
|
24
33
|
href?: any;
|
|
25
|
-
|
|
26
|
-
bodyText?:
|
|
34
|
+
onlyTextInBody?: boolean;
|
|
35
|
+
bodyText?: string;
|
|
36
|
+
headerSnippet?: any;
|
|
37
|
+
bodySnippet?: any;
|
|
38
|
+
children?: any;
|
|
27
39
|
bodyTextColor?: string;
|
|
28
40
|
bodyBackgroundColor?: string;
|
|
29
41
|
bodyTopBorderColor?: string;
|
|
30
42
|
bodyBottomBorderColor?: string;
|
|
31
43
|
selectedValue?: any;
|
|
32
|
-
|
|
44
|
+
display?: string;
|
|
45
|
+
gridPosition?: any;
|
|
46
|
+
subtitle?: any;
|
|
33
47
|
};
|