@momentum-design/components 0.120.37 → 0.121.0
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/browser/index.js +56 -56
- package/dist/browser/index.js.map +3 -3
- package/dist/components/animation/animation.component.d.ts +1 -1
- package/dist/components/animation/animation.component.js +5 -4
- package/dist/components/dialog/dialog.component.d.ts +1 -1
- package/dist/components/dialog/dialog.component.js +5 -5
- package/dist/components/icon/icon.component.d.ts +1 -1
- package/dist/components/icon/icon.component.js +4 -4
- package/dist/components/illustration/illustration.component.js +3 -2
- package/dist/custom-elements.json +8 -8
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ import { createRef, ref } from 'lit/directives/ref.js';
|
|
|
13
13
|
import lottie from 'lottie-web/build/player/lottie_light';
|
|
14
14
|
import animationManifest from '@momentum-design/animations/dist/manifest';
|
|
15
15
|
import { Component } from '../../models';
|
|
16
|
+
import { ROLE } from '../../utils/roles';
|
|
16
17
|
import styles from './animation.styles';
|
|
17
18
|
import { DEFAULTS } from './animation.constants';
|
|
18
19
|
/**
|
|
@@ -52,7 +53,7 @@ class Animation extends Component {
|
|
|
52
53
|
/**
|
|
53
54
|
* Aria-labelledby attribute to be set for accessibility
|
|
54
55
|
*/
|
|
55
|
-
this.
|
|
56
|
+
this.ariaLabelledby = null;
|
|
56
57
|
/**
|
|
57
58
|
* Container for the animation
|
|
58
59
|
*/
|
|
@@ -143,8 +144,8 @@ class Animation extends Component {
|
|
|
143
144
|
if (changedProperties.has('name') || changedProperties.has('loop') || changedProperties.has('autoplay')) {
|
|
144
145
|
this.getAnimationData();
|
|
145
146
|
}
|
|
146
|
-
if (changedProperties.has('ariaLabel') || changedProperties.has('
|
|
147
|
-
this.role = this.ariaLabel || this.
|
|
147
|
+
if (changedProperties.has('ariaLabel') || changedProperties.has('ariaLabelledby')) {
|
|
148
|
+
this.role = this.ariaLabel || this.ariaLabelledby ? ROLE.IMG : null;
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
disconnectedCallback() {
|
|
@@ -180,5 +181,5 @@ __decorate([
|
|
|
180
181
|
__decorate([
|
|
181
182
|
property({ type: String, attribute: 'aria-labelledby' }),
|
|
182
183
|
__metadata("design:type", Object)
|
|
183
|
-
], Animation.prototype, "
|
|
184
|
+
], Animation.prototype, "ariaLabelledby", void 0);
|
|
184
185
|
export default Animation;
|
|
@@ -117,7 +117,7 @@ declare class Dialog extends Dialog_base {
|
|
|
117
117
|
* Defines a string value for the aria-describedby attribute that refers to the element
|
|
118
118
|
* describing the dialog for accessibility
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
ariaDescribedby: string | null;
|
|
121
121
|
/**
|
|
122
122
|
* Defines a string value for the aria-description attribute that refers to the element
|
|
123
123
|
* describing the dialog for accessibility
|
|
@@ -131,7 +131,7 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
131
131
|
* Defines a string value for the aria-describedby attribute that refers to the element
|
|
132
132
|
* describing the dialog for accessibility
|
|
133
133
|
*/
|
|
134
|
-
this.
|
|
134
|
+
this.ariaDescribedby = null;
|
|
135
135
|
/**
|
|
136
136
|
* Defines a string value for the aria-description attribute that refers to the element
|
|
137
137
|
* describing the dialog for accessibility
|
|
@@ -251,8 +251,8 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
251
251
|
this.updateFooterButtonColors(this.variant);
|
|
252
252
|
}
|
|
253
253
|
if (changedProperties.has('ariaLabel') ||
|
|
254
|
-
changedProperties.has('
|
|
255
|
-
changedProperties.has('
|
|
254
|
+
changedProperties.has('ariaLabelledby') ||
|
|
255
|
+
changedProperties.has('ariaDescribedby') ||
|
|
256
256
|
changedProperties.has('ariaDescription') ||
|
|
257
257
|
changedProperties.has('headerText') ||
|
|
258
258
|
changedProperties.has('descriptionText')) {
|
|
@@ -296,7 +296,7 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
// If aria-describedby or aria-description is already set, do not override it
|
|
299
|
-
if (!this.
|
|
299
|
+
if (!this.ariaDescribedby && !this.ariaDescription) {
|
|
300
300
|
if (this.descriptionText) {
|
|
301
301
|
this.setAttribute('aria-description', this.descriptionText);
|
|
302
302
|
}
|
|
@@ -462,7 +462,7 @@ __decorate([
|
|
|
462
462
|
__decorate([
|
|
463
463
|
property({ type: String, reflect: true, attribute: 'aria-describedby' }),
|
|
464
464
|
__metadata("design:type", Object)
|
|
465
|
-
], Dialog.prototype, "
|
|
465
|
+
], Dialog.prototype, "ariaDescribedby", void 0);
|
|
466
466
|
__decorate([
|
|
467
467
|
property({ type: String, reflect: true, attribute: 'aria-description' }),
|
|
468
468
|
__metadata("design:type", Object)
|
|
@@ -72,7 +72,7 @@ declare class Icon extends Component {
|
|
|
72
72
|
/**
|
|
73
73
|
* Aria-labelledby attribute to be set for accessibility
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
ariaLabelledby: string | null;
|
|
76
76
|
private readonly iconProviderContext;
|
|
77
77
|
private abortController?;
|
|
78
78
|
constructor();
|
|
@@ -77,7 +77,7 @@ class Icon extends Component {
|
|
|
77
77
|
/**
|
|
78
78
|
* Aria-labelledby attribute to be set for accessibility
|
|
79
79
|
*/
|
|
80
|
-
this.
|
|
80
|
+
this.ariaLabelledby = null;
|
|
81
81
|
this.iconProviderContext = providerUtils.consume({ host: this, context: IconProvider.Context });
|
|
82
82
|
this.abortController = new AbortController(); // Initialize AbortController
|
|
83
83
|
}
|
|
@@ -205,8 +205,8 @@ class Icon extends Component {
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
if (changedProperties.has('ariaLabel') || changedProperties.has('
|
|
209
|
-
this.role = this.ariaLabel || this.
|
|
208
|
+
if (changedProperties.has('ariaLabel') || changedProperties.has('ariaLabelledby')) {
|
|
209
|
+
this.role = this.ariaLabel || this.ariaLabelledby ? 'img' : null;
|
|
210
210
|
}
|
|
211
211
|
if (changedProperties.has('size') || changedProperties.has('lengthUnit')) {
|
|
212
212
|
this.updateSize();
|
|
@@ -263,7 +263,7 @@ __decorate([
|
|
|
263
263
|
__decorate([
|
|
264
264
|
property({ type: String, attribute: 'aria-labelledby' }),
|
|
265
265
|
__metadata("design:type", Object)
|
|
266
|
-
], Icon.prototype, "
|
|
266
|
+
], Icon.prototype, "ariaLabelledby", void 0);
|
|
267
267
|
__decorate([
|
|
268
268
|
state(),
|
|
269
269
|
__metadata("design:type", AbortController)
|
|
@@ -12,6 +12,7 @@ import { property, state } from 'lit/decorators.js';
|
|
|
12
12
|
import { Component } from '../../models';
|
|
13
13
|
import providerUtils from '../../utils/provider';
|
|
14
14
|
import IllustrationProvider from '../illustrationprovider/illustrationprovider.component';
|
|
15
|
+
import { ROLE } from '../../utils/roles';
|
|
15
16
|
import styles from './illustration.styles';
|
|
16
17
|
import { svgFetch } from './illustration.utils';
|
|
17
18
|
import { DEFAULTS } from './illustration.constants';
|
|
@@ -181,8 +182,8 @@ class Illustration extends Component {
|
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
|
-
if (changedProperties.has('ariaLabel') || changedProperties.has('
|
|
185
|
-
this.role = this.ariaLabel || this.ariaLabelledby ?
|
|
185
|
+
if (changedProperties.has('ariaLabel') || changedProperties.has('ariaLabelledby')) {
|
|
186
|
+
this.role = this.ariaLabel || this.ariaLabelledby ? ROLE.IMG : null;
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
disconnectedCallback() {
|
|
@@ -1637,7 +1637,7 @@
|
|
|
1637
1637
|
},
|
|
1638
1638
|
{
|
|
1639
1639
|
"kind": "field",
|
|
1640
|
-
"name": "
|
|
1640
|
+
"name": "ariaLabelledby",
|
|
1641
1641
|
"type": {
|
|
1642
1642
|
"text": "string | null"
|
|
1643
1643
|
},
|
|
@@ -1775,7 +1775,7 @@
|
|
|
1775
1775
|
},
|
|
1776
1776
|
"default": "null",
|
|
1777
1777
|
"description": "Aria-labelledby attribute to be set for accessibility",
|
|
1778
|
-
"fieldName": "
|
|
1778
|
+
"fieldName": "ariaLabelledby"
|
|
1779
1779
|
}
|
|
1780
1780
|
],
|
|
1781
1781
|
"superclass": {
|
|
@@ -2690,7 +2690,7 @@
|
|
|
2690
2690
|
},
|
|
2691
2691
|
{
|
|
2692
2692
|
"kind": "field",
|
|
2693
|
-
"name": "
|
|
2693
|
+
"name": "ariaDescribedby",
|
|
2694
2694
|
"type": {
|
|
2695
2695
|
"text": "string | null"
|
|
2696
2696
|
},
|
|
@@ -3034,7 +3034,7 @@
|
|
|
3034
3034
|
},
|
|
3035
3035
|
"default": "null",
|
|
3036
3036
|
"description": "Defines a string value for the aria-describedby attribute that refers to the element\ndescribing the dialog for accessibility",
|
|
3037
|
-
"fieldName": "
|
|
3037
|
+
"fieldName": "ariaDescribedby",
|
|
3038
3038
|
"inheritedFrom": {
|
|
3039
3039
|
"name": "Dialog",
|
|
3040
3040
|
"module": "src/components/dialog/dialog.component.ts"
|
|
@@ -15280,7 +15280,7 @@
|
|
|
15280
15280
|
},
|
|
15281
15281
|
{
|
|
15282
15282
|
"kind": "field",
|
|
15283
|
-
"name": "
|
|
15283
|
+
"name": "ariaDescribedby",
|
|
15284
15284
|
"type": {
|
|
15285
15285
|
"text": "string | null"
|
|
15286
15286
|
},
|
|
@@ -16052,7 +16052,7 @@
|
|
|
16052
16052
|
},
|
|
16053
16053
|
"default": "null",
|
|
16054
16054
|
"description": "Defines a string value for the aria-describedby attribute that refers to the element\ndescribing the dialog for accessibility",
|
|
16055
|
-
"fieldName": "
|
|
16055
|
+
"fieldName": "ariaDescribedby"
|
|
16056
16056
|
},
|
|
16057
16057
|
{
|
|
16058
16058
|
"name": "aria-description",
|
|
@@ -18254,7 +18254,7 @@
|
|
|
18254
18254
|
},
|
|
18255
18255
|
{
|
|
18256
18256
|
"kind": "field",
|
|
18257
|
-
"name": "
|
|
18257
|
+
"name": "ariaLabelledby",
|
|
18258
18258
|
"type": {
|
|
18259
18259
|
"text": "string | null"
|
|
18260
18260
|
},
|
|
@@ -18386,7 +18386,7 @@
|
|
|
18386
18386
|
},
|
|
18387
18387
|
"default": "null",
|
|
18388
18388
|
"description": "Aria-labelledby attribute to be set for accessibility",
|
|
18389
|
-
"fieldName": "
|
|
18389
|
+
"fieldName": "ariaLabelledby"
|
|
18390
18390
|
}
|
|
18391
18391
|
],
|
|
18392
18392
|
"superclass": {
|