@onsvisual/svelte-components 1.0.17 → 1.0.19
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/css/main.css
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
@import url("https://cdn.ons.gov.uk/vendor/accessible-autocomplete/3.0.1/accessible-autocomplete.min.css");
|
|
3
3
|
|
|
4
4
|
/* CSS rules missing from design system */
|
|
5
|
+
.ons-grid--spaced {
|
|
6
|
+
margin-bottom: -1rem;
|
|
7
|
+
}
|
|
8
|
+
.ons-grid--gutterless {
|
|
9
|
+
margin-bottom: 0;
|
|
10
|
+
}
|
|
11
|
+
.ons-grid--tight {
|
|
12
|
+
margin-bottom: -0.5rem;
|
|
13
|
+
}
|
|
14
|
+
.ons-grid--loose {
|
|
15
|
+
margin-bottom: -2rem;
|
|
16
|
+
}
|
|
5
17
|
.ons-grid--loose .ons-grid__col {
|
|
6
18
|
padding-left: 2rem;
|
|
7
19
|
}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* @type {boolean}
|
|
22
22
|
*/
|
|
23
23
|
export let nowrap = true;
|
|
24
|
+
/**
|
|
25
|
+
* Descriptive text for screen readers if not self-explanatory
|
|
26
|
+
* @type {string|null}
|
|
27
|
+
*/
|
|
28
|
+
export let ariaLabel = null;
|
|
24
29
|
|
|
25
30
|
$: text = contrastColor(color);
|
|
26
31
|
</script>
|
|
@@ -33,6 +38,7 @@
|
|
|
33
38
|
style:color={text}
|
|
34
39
|
style:font-size={fontSize}
|
|
35
40
|
role="presentation"
|
|
41
|
+
aria-label={ariaLabel}
|
|
36
42
|
>
|
|
37
43
|
<slot />
|
|
38
44
|
</mark>
|
|
@@ -6,6 +6,7 @@ export default class Em extends SvelteComponentTyped<{
|
|
|
6
6
|
color?: string | undefined;
|
|
7
7
|
fontSize?: string | undefined;
|
|
8
8
|
nowrap?: boolean | undefined;
|
|
9
|
+
ariaLabel?: string | null | undefined;
|
|
9
10
|
}, {
|
|
10
11
|
[evt: string]: CustomEvent<any>;
|
|
11
12
|
}, {
|
|
@@ -22,6 +23,7 @@ declare const __propDef: {
|
|
|
22
23
|
color?: string | undefined;
|
|
23
24
|
fontSize?: string | undefined;
|
|
24
25
|
nowrap?: boolean | undefined;
|
|
26
|
+
ariaLabel?: string | null | undefined;
|
|
25
27
|
};
|
|
26
28
|
events: {
|
|
27
29
|
[evt: string]: CustomEvent<any>;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export let titleBadge = null;
|
|
28
28
|
/**
|
|
29
|
-
* Optional: Label and href for an action button in format {label, href}
|
|
29
|
+
* Optional: Label and href for an action button in format {label, ariaLabel, href}
|
|
30
30
|
* @type {object|null}
|
|
31
31
|
*/
|
|
32
32
|
export let actionButton = null;
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<h1 class="ons-hero__title ons-u-fs-3xl">
|
|
104
104
|
{title}
|
|
105
105
|
{#if titleBadge}
|
|
106
|
-
<Em mode="badge" color={titleBadge.color} fontSize="1.125rem"
|
|
106
|
+
<Em mode="badge" color={titleBadge.color} ariaLabel={titleBadge.ariaLabel} fontSize="1.125rem"
|
|
107
107
|
>{titleBadge.label}</Em
|
|
108
108
|
>
|
|
109
109
|
{/if}
|