@momentum-design/components 0.120.37 → 0.120.38
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 +822 -822
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +3 -3
- 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() {
|