@communitiesuk/svelte-component-library 0.1.19-beta.7.0 → 0.1.19-beta.9
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/dist/assets/icons/MaterialIcon.svelte +1 -0
- package/dist/components/data-vis/line-chart/ValueLabel.svelte +4 -5
- package/dist/components/data-vis/position-chart/PositionChart.svelte +213 -185
- package/dist/components/data-vis/position-chart/PositionChart.svelte.d.ts +6 -2
- package/dist/components/data-vis/position-chart/PositionChartAxis.svelte +33 -25
- package/dist/components/data-vis/position-chart/PositionChartAxis.svelte.d.ts +2 -0
- package/dist/components/layout/Footer.svelte +1 -2
- package/dist/components/ui/Button.svelte +19 -2
- package/dist/components/ui/Button.svelte.d.ts +2 -0
- package/dist/components/ui/MultiSelectSearchAutocomplete.svelte +284 -192
- package/dist/components/ui/MultiSelectSearchAutocomplete.svelte.d.ts +1 -2
- package/dist/components/ui/Radios.svelte +23 -8
- package/dist/components/ui/Radios.svelte.d.ts +1 -0
- package/dist/components/ui/Tabs.svelte +190 -18
- package/dist/components/ui/Tabs.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -41,16 +41,15 @@ left: {markerRect?.x +
|
|
|
41
41
|
border-radius: 5px;"
|
|
42
42
|
>
|
|
43
43
|
{#if tooltipContent}
|
|
44
|
-
<div>
|
|
44
|
+
<div role="tooltip">
|
|
45
45
|
{activeMarkerId[tooltipContent]}
|
|
46
46
|
</div>
|
|
47
47
|
{:else}
|
|
48
|
-
<div>
|
|
49
|
-
|
|
50
|
-
</div>{/if}
|
|
48
|
+
<div role="tooltip">{activeMarkerId?.value ?? activeMarkerId}</div>
|
|
49
|
+
{/if}
|
|
51
50
|
</div>
|
|
52
51
|
{:else}
|
|
53
|
-
<div>
|
|
52
|
+
<div role="tooltip">
|
|
54
53
|
{@render tooltipSnippet(activeMarkerId)}
|
|
55
54
|
</div>
|
|
56
55
|
{/if}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
showAxis = true,
|
|
13
13
|
chartWidth = $bindable(500), // the 'chart' is the bar and the marker
|
|
14
14
|
chartHeight = 24,
|
|
15
|
-
|
|
15
|
+
color = "#CA357C",
|
|
16
16
|
nSegments = 10,
|
|
17
17
|
startColor = "#8EB8DC",
|
|
18
18
|
endColor = "#0F385C",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
rowData = [
|
|
28
28
|
{
|
|
29
29
|
value: value,
|
|
30
|
-
|
|
30
|
+
color: color,
|
|
31
31
|
opacity: opacity,
|
|
32
32
|
annotation: annotation,
|
|
33
33
|
},
|
|
@@ -79,10 +79,12 @@
|
|
|
79
79
|
activeMarkerId = null;
|
|
80
80
|
},
|
|
81
81
|
activeMarkerId = undefined,
|
|
82
|
+
ariaLabel,
|
|
83
|
+
axisTextSize,
|
|
82
84
|
} = $props();
|
|
83
85
|
|
|
84
86
|
// base defaults that apply to every row
|
|
85
|
-
const baseRow = { value,
|
|
87
|
+
const baseRow = { value, color, opacity, annotation };
|
|
86
88
|
|
|
87
89
|
// base defaults that apply to every chart
|
|
88
90
|
const baseChart = { label, chartHeight, min, max, showAxis };
|
|
@@ -234,218 +236,244 @@
|
|
|
234
236
|
),
|
|
235
237
|
);
|
|
236
238
|
|
|
239
|
+
$inspect(allDataNormalized, "allDataNormalized");
|
|
240
|
+
|
|
237
241
|
let gridTemplateRows = $derived(
|
|
238
242
|
allDataNormalized
|
|
239
243
|
.map((item, i) => {
|
|
240
|
-
const sizes = ["minmax(
|
|
241
|
-
if (moreInfoTogglesArray[i]) sizes.push("minmax(
|
|
242
|
-
if (item.divider
|
|
244
|
+
const sizes = ["minmax(28px,1fr)"];
|
|
245
|
+
if (moreInfoTogglesArray[i]) sizes.push("minmax(50px,auto)");
|
|
246
|
+
if (item.divider) sizes.push("0px");
|
|
243
247
|
return sizes.join(" "); // still fine because number of rows matches
|
|
244
248
|
})
|
|
245
|
-
.concat(showAxis ? ["minmax(
|
|
249
|
+
.concat(showAxis ? ["minmax(0px,auto)"] : [])
|
|
246
250
|
.join(" "),
|
|
247
251
|
);
|
|
248
252
|
</script>
|
|
249
253
|
|
|
250
|
-
{
|
|
251
|
-
{#
|
|
252
|
-
|
|
253
|
-
<
|
|
254
|
-
<
|
|
255
|
-
<
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
254
|
+
<div role="img" aria-label={ariaLabel}>
|
|
255
|
+
{#if annotations.length}
|
|
256
|
+
{#each annotations as d (d.value)}
|
|
257
|
+
<div bind:clientWidth={topWidth} aria-hidden={true}>
|
|
258
|
+
<svg width={topWidth} height="60">
|
|
259
|
+
<g>
|
|
260
|
+
<text
|
|
261
|
+
font-family="GDS Transport"
|
|
262
|
+
id="label"
|
|
263
|
+
x={d.value}
|
|
264
|
+
y="20"
|
|
265
|
+
fill={d.color}
|
|
266
|
+
font-size="18"
|
|
267
|
+
opacity={typeof activeMarkerId !== "undefined" && activeMarkerId
|
|
268
|
+
? 0.2
|
|
269
|
+
: 1}
|
|
270
|
+
>
|
|
271
|
+
{d.annotation}
|
|
272
|
+
</text>
|
|
273
|
+
</g>
|
|
274
|
+
<defs>
|
|
275
|
+
<marker
|
|
276
|
+
id="arrow-down"
|
|
277
|
+
markerWidth="10"
|
|
278
|
+
markerHeight="10"
|
|
279
|
+
refX="3"
|
|
280
|
+
refY="3"
|
|
281
|
+
orient="auto"
|
|
282
|
+
markerUnits="strokeWidth"
|
|
283
|
+
opacity={typeof activeMarkerId !== "undefined" && activeMarkerId
|
|
284
|
+
? 0.2
|
|
285
|
+
: 1}
|
|
286
|
+
>
|
|
287
|
+
<path d="M 0 0 L 6 3 L 0 6 z" fill={d.color}></path>
|
|
288
|
+
</marker>
|
|
289
|
+
</defs>
|
|
290
|
+
<path
|
|
291
|
+
d="M 4 25 v 10 h {xFunction(min, max)(d.value) +
|
|
292
|
+
markerRadius -
|
|
293
|
+
4 +
|
|
294
|
+
(topWidth - chartWidth)} v 15"
|
|
295
|
+
fill="none"
|
|
296
|
+
stroke={d.color}
|
|
297
|
+
stroke-width="1.5"
|
|
298
|
+
marker-end="url(#arrow-down)"
|
|
278
299
|
opacity={typeof activeMarkerId !== "undefined" && activeMarkerId
|
|
279
300
|
? 0.2
|
|
280
301
|
: 1}
|
|
281
|
-
>
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
d="M 4 25 v 10 h {xFunction(min, max)(d.value) +
|
|
287
|
-
markerRadius -
|
|
288
|
-
4 +
|
|
289
|
-
(topWidth - chartWidth)} v 15"
|
|
290
|
-
fill="none"
|
|
291
|
-
stroke={d.colour}
|
|
292
|
-
stroke-width="1.5"
|
|
293
|
-
marker-end="url(#arrow-down)"
|
|
294
|
-
opacity={typeof activeMarkerId !== "undefined" && activeMarkerId
|
|
295
|
-
? 0.2
|
|
296
|
-
: 1}
|
|
297
|
-
></path>
|
|
298
|
-
</svg>
|
|
299
|
-
</div>
|
|
300
|
-
{/each}
|
|
301
|
-
{/if}
|
|
302
|
+
></path>
|
|
303
|
+
</svg>
|
|
304
|
+
</div>
|
|
305
|
+
{/each}
|
|
306
|
+
{/if}
|
|
302
307
|
|
|
303
|
-
<div
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
<div
|
|
309
|
+
class="grid-container"
|
|
310
|
+
bind:this={container}
|
|
311
|
+
style="
|
|
307
312
|
position: relative;
|
|
308
313
|
grid-template-columns: {gridTemplateColumns};
|
|
309
314
|
grid-template-rows: {gridTemplateRows};
|
|
310
315
|
"
|
|
311
|
-
>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
>
|
|
317
|
+
{#each allDataNormalized as positionChart, i}
|
|
318
|
+
{#if showLabel}
|
|
319
|
+
<p
|
|
320
|
+
aria-hidden={true}
|
|
321
|
+
class="govuk-body-s"
|
|
322
|
+
style=" text-align: right;
|
|
317
323
|
margin: 0;
|
|
318
324
|
line-height: 1.05;"
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
<div class="button-container">
|
|
325
|
+
>
|
|
326
|
+
{positionChart.label}
|
|
327
|
+
</p>
|
|
328
|
+
{/if}
|
|
329
|
+
{#if showIcon}
|
|
325
330
|
<Button
|
|
326
331
|
textContent="i"
|
|
327
332
|
buttonType="moreInfo"
|
|
328
333
|
noPadding={true}
|
|
329
334
|
onClickFunction={() => updateMoreInfoTogglesArray(i)}
|
|
335
|
+
ariaExpanded={moreInfoTogglesArray[i]}
|
|
330
336
|
></Button>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
fill={colorScale && colorScale.length > 0
|
|
349
|
-
? colorScale[number]
|
|
350
|
-
: interpolateColors(startColor, endColor, nSegments, midColor)[
|
|
351
|
-
number
|
|
352
|
-
]}
|
|
353
|
-
></rect></g
|
|
354
|
-
>{/each}
|
|
355
|
-
{#each Object.entries(positionChart.rowData) as [tier, points]}
|
|
356
|
-
{#each points as rowValue, i}
|
|
357
|
-
{#if !isNaN(Number(rowValue.value))}
|
|
358
|
-
{@const markerId = "marker-" + rowValue.value}
|
|
359
|
-
<g
|
|
360
|
-
data-id={markerId}
|
|
361
|
-
onclick={interactiveMarkers
|
|
362
|
-
? (event) => onClickMarker(event, rowValue, markerId)
|
|
363
|
-
: null}
|
|
364
|
-
onmouseenter={interactiveMarkers
|
|
365
|
-
? (event) =>
|
|
366
|
-
onMouseEnterMarker(
|
|
367
|
-
event,
|
|
368
|
-
rowValue,
|
|
369
|
-
markerId,
|
|
370
|
-
event.currentTarget.getBoundingClientRect(),
|
|
371
|
-
)
|
|
372
|
-
: null}
|
|
373
|
-
onmouseleave={interactiveMarkers
|
|
374
|
-
? (event) => onMouseLeaveMarker(event, rowValue, markerId)
|
|
375
|
-
: null}
|
|
376
|
-
role="button"
|
|
377
|
-
tabindex="0"
|
|
378
|
-
onkeydown={interactiveMarkers
|
|
379
|
-
? (e) => e.key === "Enter" && onClickMarker(e, value)
|
|
380
|
-
: null}
|
|
381
|
-
pointer-events={interactiveMarkers ? null : "none"}
|
|
382
|
-
transform="translate({xFunction(
|
|
383
|
-
positionChart.min,
|
|
384
|
-
positionChart.max,
|
|
385
|
-
)(rowValue.value) + markerRadius},{positionChart.chartHeight /
|
|
386
|
-
2})"
|
|
387
|
-
>
|
|
388
|
-
<circle
|
|
389
|
-
r={markerRadius}
|
|
390
|
-
cx="0"
|
|
391
|
-
cy="0"
|
|
392
|
-
fill={rowValue.colour}
|
|
393
|
-
stroke="white"
|
|
394
|
-
opacity={rowValue.opacity}
|
|
395
|
-
></circle>
|
|
396
|
-
</g>
|
|
397
|
-
{/if}
|
|
398
|
-
{/each}
|
|
399
|
-
{/each}
|
|
400
|
-
</svg>
|
|
401
|
-
</div>
|
|
402
|
-
{#if moreInfoTogglesArray[i]}
|
|
403
|
-
<div class="accordion" style="grid-column:1 / -1">
|
|
404
|
-
<InsetText content={positionChart.moreInfo} renderStringAsHTML={true}
|
|
405
|
-
></InsetText>
|
|
406
|
-
</div>
|
|
407
|
-
{/if}
|
|
408
|
-
{#if positionChart.divider}
|
|
409
|
-
<div style="grid-column:1 / -1">
|
|
410
|
-
<svg width="100%" height="5">
|
|
411
|
-
<line
|
|
412
|
-
x1="0"
|
|
413
|
-
y1="2.5"
|
|
414
|
-
x2="100%"
|
|
415
|
-
y2="2.55"
|
|
337
|
+
{/if}
|
|
338
|
+
<div
|
|
339
|
+
class="chart"
|
|
340
|
+
style="height: {positionChart.chartHeight}px"
|
|
341
|
+
bind:clientWidth={chartWidth}
|
|
342
|
+
>
|
|
343
|
+
<svg
|
|
344
|
+
width={chartWidth}
|
|
345
|
+
height={positionChart.chartHeight}
|
|
346
|
+
aria-hidden={true}
|
|
347
|
+
>
|
|
348
|
+
<rect
|
|
349
|
+
x={markerRadius}
|
|
350
|
+
y={(positionChart.chartHeight - barHeight) / 2}
|
|
351
|
+
width={barWidth}
|
|
352
|
+
height={barHeight}
|
|
353
|
+
fill="none"
|
|
416
354
|
stroke="grey"
|
|
417
|
-
stroke-width="
|
|
418
|
-
></
|
|
355
|
+
stroke-width="1"
|
|
356
|
+
></rect>
|
|
357
|
+
{#each range as number}
|
|
358
|
+
<g
|
|
359
|
+
transform="translate({markerRadius +
|
|
360
|
+
(barWidth * number) / nSegments},{(positionChart.chartHeight -
|
|
361
|
+
barHeight) /
|
|
362
|
+
2})"
|
|
363
|
+
><rect
|
|
364
|
+
width={barWidth / nSegments}
|
|
365
|
+
height={barHeight}
|
|
366
|
+
fill={colorScale && colorScale.length > 0
|
|
367
|
+
? colorScale[number]
|
|
368
|
+
: interpolateColors(
|
|
369
|
+
startColor,
|
|
370
|
+
endColor,
|
|
371
|
+
nSegments,
|
|
372
|
+
midColor,
|
|
373
|
+
)[number]}
|
|
374
|
+
></rect></g
|
|
375
|
+
>{/each}
|
|
376
|
+
|
|
377
|
+
{#each Object.entries(positionChart.rowData) as [tier, points]}
|
|
378
|
+
{#each points as rowValue, i}
|
|
379
|
+
{#if !isNaN(Number(rowValue.value))}
|
|
380
|
+
{@const markerId = "marker-" + rowValue.value}
|
|
381
|
+
<g
|
|
382
|
+
data-id={markerId}
|
|
383
|
+
onclick={interactiveMarkers
|
|
384
|
+
? (event) => onClickMarker(event, rowValue, markerId)
|
|
385
|
+
: null}
|
|
386
|
+
onmouseenter={interactiveMarkers
|
|
387
|
+
? (event) =>
|
|
388
|
+
onMouseEnterMarker(
|
|
389
|
+
event,
|
|
390
|
+
rowValue,
|
|
391
|
+
markerId,
|
|
392
|
+
event.currentTarget.getBoundingClientRect(),
|
|
393
|
+
)
|
|
394
|
+
: null}
|
|
395
|
+
onmouseleave={interactiveMarkers
|
|
396
|
+
? (event) => onMouseLeaveMarker(event, rowValue, markerId)
|
|
397
|
+
: null}
|
|
398
|
+
onfocus={interactiveMarkers
|
|
399
|
+
? (event) =>
|
|
400
|
+
onMouseEnterMarker(
|
|
401
|
+
event,
|
|
402
|
+
rowValue,
|
|
403
|
+
markerId,
|
|
404
|
+
event.currentTarget.getBoundingClientRect(),
|
|
405
|
+
)
|
|
406
|
+
: null}
|
|
407
|
+
onblur={interactiveMarkers
|
|
408
|
+
? (event) => onMouseLeaveMarker(event, rowValue, markerId)
|
|
409
|
+
: null}
|
|
410
|
+
role="button"
|
|
411
|
+
aria-label={tooltipContent}
|
|
412
|
+
tabindex="0"
|
|
413
|
+
onkeydown={interactiveMarkers
|
|
414
|
+
? (event) => onClickMarker(event, rowValue, markerId)
|
|
415
|
+
: null}
|
|
416
|
+
pointer-events={interactiveMarkers ? null : "none"}
|
|
417
|
+
transform="translate({xFunction(
|
|
418
|
+
positionChart.min,
|
|
419
|
+
positionChart.max,
|
|
420
|
+
)(rowValue.value) + markerRadius},{positionChart.chartHeight /
|
|
421
|
+
2})"
|
|
422
|
+
>
|
|
423
|
+
<circle
|
|
424
|
+
r={markerRadius}
|
|
425
|
+
cx="0"
|
|
426
|
+
cy="0"
|
|
427
|
+
fill={rowValue.color}
|
|
428
|
+
stroke="white"
|
|
429
|
+
opacity={rowValue.opacity}
|
|
430
|
+
></circle>
|
|
431
|
+
</g>
|
|
432
|
+
{/if}
|
|
433
|
+
{/each}
|
|
434
|
+
{/each}
|
|
419
435
|
</svg>
|
|
420
|
-
</div>
|
|
421
|
-
|
|
436
|
+
</div>
|
|
437
|
+
{#if moreInfoTogglesArray[i]}
|
|
438
|
+
<div class="accordion" style="grid-column:1 / -1" aria-live="assertive">
|
|
439
|
+
<InsetText content={positionChart.moreInfo} renderStringAsHTML={true}
|
|
440
|
+
></InsetText>
|
|
441
|
+
</div>
|
|
442
|
+
{/if}
|
|
443
|
+
{#if positionChart.divider}
|
|
444
|
+
<div
|
|
445
|
+
style="grid-column:1 / -1; border-bottom: solid 1px #d5dade;"
|
|
446
|
+
></div>{/if}
|
|
447
|
+
{/each}
|
|
422
448
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
449
|
+
{#if showAxis}
|
|
450
|
+
{#if showIcon}
|
|
451
|
+
<div class="empty"></div>
|
|
452
|
+
{/if}
|
|
453
|
+
{#if showLabel}
|
|
454
|
+
<div class="empty"></div>
|
|
455
|
+
{/if}
|
|
456
|
+
<div class="axis" aria-hidden="true">
|
|
457
|
+
<PositionChartAxis {markerRadius} {barWidth} textSize={axisTextSize}
|
|
458
|
+
></PositionChartAxis>
|
|
459
|
+
</div>
|
|
426
460
|
{/if}
|
|
427
|
-
{#if
|
|
428
|
-
<
|
|
461
|
+
{#if activeMarkerId}
|
|
462
|
+
<ValueLabel
|
|
463
|
+
{activeMarkerId}
|
|
464
|
+
labelColor="lightgrey"
|
|
465
|
+
labelTextColor="black"
|
|
466
|
+
{labelText}
|
|
467
|
+
{tooltipContent}
|
|
468
|
+
{xFunction}
|
|
469
|
+
{yFunction}
|
|
470
|
+
{x}
|
|
471
|
+
{y}
|
|
472
|
+
{markerRect}
|
|
473
|
+
{tooltipSnippet}
|
|
474
|
+
></ValueLabel>
|
|
429
475
|
{/if}
|
|
430
|
-
|
|
431
|
-
<PositionChartAxis {markerRadius} {barWidth}></PositionChartAxis>
|
|
432
|
-
</div>
|
|
433
|
-
{/if}
|
|
434
|
-
{#if activeMarkerId}
|
|
435
|
-
<ValueLabel
|
|
436
|
-
{activeMarkerId}
|
|
437
|
-
labelColor="lightgrey"
|
|
438
|
-
labelTextColor="black"
|
|
439
|
-
{labelText}
|
|
440
|
-
{tooltipContent}
|
|
441
|
-
{xFunction}
|
|
442
|
-
{yFunction}
|
|
443
|
-
{x}
|
|
444
|
-
{y}
|
|
445
|
-
{markerRect}
|
|
446
|
-
{tooltipSnippet}
|
|
447
|
-
></ValueLabel>
|
|
448
|
-
{/if}
|
|
476
|
+
</div>
|
|
449
477
|
</div>
|
|
450
478
|
|
|
451
479
|
<style>
|
|
@@ -11,7 +11,7 @@ declare const PositionChart: import("svelte").Component<{
|
|
|
11
11
|
showAxis?: boolean;
|
|
12
12
|
chartWidth?: number;
|
|
13
13
|
chartHeight?: number;
|
|
14
|
-
|
|
14
|
+
color?: string;
|
|
15
15
|
nSegments?: number;
|
|
16
16
|
startColor?: string;
|
|
17
17
|
endColor?: string;
|
|
@@ -42,6 +42,8 @@ declare const PositionChart: import("svelte").Component<{
|
|
|
42
42
|
onMouseEnterMarker?: Function;
|
|
43
43
|
onMouseLeaveMarker?: Function;
|
|
44
44
|
activeMarkerId?: any;
|
|
45
|
+
ariaLabel: any;
|
|
46
|
+
axisTextSize: any;
|
|
45
47
|
}, {}, "chartWidth">;
|
|
46
48
|
type $$ComponentProps = {
|
|
47
49
|
value?: any;
|
|
@@ -51,7 +53,7 @@ type $$ComponentProps = {
|
|
|
51
53
|
showAxis?: boolean;
|
|
52
54
|
chartWidth?: number;
|
|
53
55
|
chartHeight?: number;
|
|
54
|
-
|
|
56
|
+
color?: string;
|
|
55
57
|
nSegments?: number;
|
|
56
58
|
startColor?: string;
|
|
57
59
|
endColor?: string;
|
|
@@ -82,4 +84,6 @@ type $$ComponentProps = {
|
|
|
82
84
|
onMouseEnterMarker?: Function;
|
|
83
85
|
onMouseLeaveMarker?: Function;
|
|
84
86
|
activeMarkerId?: any;
|
|
87
|
+
ariaLabel: any;
|
|
88
|
+
axisTextSize: any;
|
|
85
89
|
};
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
let {
|
|
2
|
+
let {
|
|
3
|
+
markerRadius = undefined,
|
|
4
|
+
barWidth = undefined,
|
|
5
|
+
textSize = "s",
|
|
6
|
+
} = $props();
|
|
3
7
|
</script>
|
|
4
8
|
|
|
5
|
-
<div
|
|
9
|
+
<div
|
|
10
|
+
class="axis govuk-body-{textSize}"
|
|
11
|
+
style="--axis-padding:{markerRadius}px; width: {barWidth}"
|
|
12
|
+
>
|
|
6
13
|
<div class="more-deprived">
|
|
7
14
|
<svg
|
|
8
15
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
width="
|
|
16
|
+
width="18"
|
|
10
17
|
height="16"
|
|
11
|
-
viewBox="0 0 11
|
|
18
|
+
viewBox="0 0 11 20"
|
|
12
19
|
fill="none"
|
|
13
20
|
>
|
|
14
21
|
<path
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
transform="translate(20,21)rotate(180)"
|
|
23
|
+
d="M 19.7071 12.7071 C 20.0976 12.3166 20.0976 11.6834 19.7071 11.2929 L 13.3431 4.9289 C 12.9526 4.5384 12.3195 4.5384 11.9289 4.9289 C 11.5384 5.3195 11.5384 5.9526 11.9289 6.3431 L 17.5858 12 L 11.9289 17.6568 C 11.5384 18.0474 11.5384 18.6805 11.9289 19.0711 C 12.3195 19.4616 12.9526 19.4616 13.3431 19.0711 L 19.7071 12.7071 Z M 4 12 L 4 13 L 19 13 L 19 12 L 19 11 L 9 11 L 4 11 Z"
|
|
24
|
+
fill="black"
|
|
17
25
|
></path>
|
|
18
26
|
</svg>
|
|
19
27
|
<span class="axis-text">More deprived</span>
|
|
@@ -22,14 +30,15 @@
|
|
|
22
30
|
<span class="axis-text">Less deprived</span>
|
|
23
31
|
<svg
|
|
24
32
|
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
-
width="
|
|
33
|
+
width="18"
|
|
26
34
|
height="16"
|
|
27
|
-
viewBox="0 0
|
|
35
|
+
viewBox="0 0 11 20"
|
|
28
36
|
fill="none"
|
|
29
37
|
>
|
|
30
38
|
<path
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
transform="translate(-5,-3)"
|
|
40
|
+
d="M 19.7071 12.7071 C 20.0976 12.3166 20.0976 11.6834 19.7071 11.2929 L 13.3431 4.9289 C 12.9526 4.5384 12.3195 4.5384 11.9289 4.9289 C 11.5384 5.3195 11.5384 5.9526 11.9289 6.3431 L 17.5858 12 L 11.9289 17.6568 C 11.5384 18.0474 11.5384 18.6805 11.9289 19.0711 C 12.3195 19.4616 12.9526 19.4616 13.3431 19.0711 L 19.7071 12.7071 Z M 4 12 L 4 13 L 19 13 L 19 12 L 19 11 L 9 11 L 4 11 Z"
|
|
41
|
+
fill="black"
|
|
33
42
|
></path>
|
|
34
43
|
</svg>
|
|
35
44
|
</div>
|
|
@@ -47,7 +56,18 @@
|
|
|
47
56
|
.more-deprived {
|
|
48
57
|
display: flex;
|
|
49
58
|
align-items: top;
|
|
50
|
-
|
|
59
|
+
|
|
60
|
+
gap: 2px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.more-deprived {
|
|
64
|
+
width: 45%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.less-deprived {
|
|
68
|
+
text-align: end;
|
|
69
|
+
justify-content: end;
|
|
70
|
+
width: 43%;
|
|
51
71
|
}
|
|
52
72
|
|
|
53
73
|
/* Tell the parent to act as a container */
|
|
@@ -58,19 +78,7 @@
|
|
|
58
78
|
.axis-text {
|
|
59
79
|
font-family: "GDS Transport";
|
|
60
80
|
line-height: 0.9;
|
|
61
|
-
color:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/* Container query: hide the child if parent's width is less than 400px */
|
|
65
|
-
@container (max-width: 18rem) {
|
|
66
|
-
.less-deprived {
|
|
67
|
-
display: none;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@container (max-width: 25rem) {
|
|
72
|
-
.average {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
81
|
+
color: black;
|
|
82
|
+
font-style: italic;
|
|
75
83
|
}
|
|
76
84
|
</style>
|
|
@@ -6,8 +6,10 @@ type PositionChartAxis = {
|
|
|
6
6
|
declare const PositionChartAxis: import("svelte").Component<{
|
|
7
7
|
markerRadius?: any;
|
|
8
8
|
barWidth?: any;
|
|
9
|
+
textSize?: string;
|
|
9
10
|
}, {}, "">;
|
|
10
11
|
type $$ComponentProps = {
|
|
11
12
|
markerRadius?: any;
|
|
12
13
|
barWidth?: any;
|
|
14
|
+
textSize?: string;
|
|
13
15
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import legacyDefaultCopyrightLogo from "./../../assets/images/govuk-crest.svg";
|
|
3
2
|
// Define component props with default values
|
|
4
3
|
// sections: array of footer navigation sections
|
|
5
4
|
// inlineLinks: array of inline footer links
|
|
@@ -227,7 +226,7 @@
|
|
|
227
226
|
]}
|
|
228
227
|
href={copyrightHref}
|
|
229
228
|
style={copyrightLogoUrl || !rebrand
|
|
230
|
-
? `background-image: url(${copyrightLogoUrl ??
|
|
229
|
+
? `background-image: url(${copyrightLogoUrl ?? "/images/govuk-crest.svg"}); display: block; width: 100%; padding-top: 112px; background-repeat: no-repeat; background-position: 50% 0; background-size: 125px 102px; text-align: center;`
|
|
231
230
|
: ""}
|
|
232
231
|
>
|
|
233
232
|
{copyrightText}
|