@momentum-design/components 0.33.1 → 0.33.2
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.
@@ -67,6 +67,10 @@ declare class Icon extends Component {
|
|
67
67
|
* Aria-label attribute to be set for accessibility
|
68
68
|
*/
|
69
69
|
ariaLabel: string | null;
|
70
|
+
/**
|
71
|
+
* Aria-labelledby attribute to be set for accessibility
|
72
|
+
*/
|
73
|
+
ariaLabelledBy: string | null;
|
70
74
|
private readonly iconProviderContext;
|
71
75
|
private abortController;
|
72
76
|
constructor();
|
@@ -72,6 +72,10 @@ class Icon extends Component {
|
|
72
72
|
* Aria-label attribute to be set for accessibility
|
73
73
|
*/
|
74
74
|
this.ariaLabel = null;
|
75
|
+
/**
|
76
|
+
* Aria-labelledby attribute to be set for accessibility
|
77
|
+
*/
|
78
|
+
this.ariaLabelledBy = null;
|
75
79
|
this.iconProviderContext = providerUtils.consume({ host: this, context: IconProvider.Context });
|
76
80
|
this.abortController = new AbortController(); // Initialize AbortController
|
77
81
|
}
|
@@ -198,8 +202,8 @@ class Icon extends Component {
|
|
198
202
|
}
|
199
203
|
});
|
200
204
|
}
|
201
|
-
if (changedProperties.has('ariaLabel')) {
|
202
|
-
this.role = this.ariaLabel ? 'img' : null;
|
205
|
+
if (changedProperties.has('ariaLabel') || changedProperties.has('ariaLabelledBy')) {
|
206
|
+
this.role = (this.ariaLabel || this.ariaLabelledBy) ? 'img' : null;
|
203
207
|
}
|
204
208
|
if (changedProperties.has('size') || changedProperties.has('lengthUnit')) {
|
205
209
|
this.updateSize();
|
@@ -246,6 +250,10 @@ __decorate([
|
|
246
250
|
property({ type: String, attribute: 'aria-label' }),
|
247
251
|
__metadata("design:type", Object)
|
248
252
|
], Icon.prototype, "ariaLabel", void 0);
|
253
|
+
__decorate([
|
254
|
+
property({ type: String, attribute: 'aria-labelledby' }),
|
255
|
+
__metadata("design:type", Object)
|
256
|
+
], Icon.prototype, "ariaLabelledBy", void 0);
|
249
257
|
__decorate([
|
250
258
|
state(),
|
251
259
|
__metadata("design:type", AbortController)
|
@@ -3676,6 +3676,16 @@
|
|
3676
3676
|
"description": "Aria-label attribute to be set for accessibility",
|
3677
3677
|
"attribute": "aria-label"
|
3678
3678
|
},
|
3679
|
+
{
|
3680
|
+
"kind": "field",
|
3681
|
+
"name": "ariaLabelledBy",
|
3682
|
+
"type": {
|
3683
|
+
"text": "string | null"
|
3684
|
+
},
|
3685
|
+
"default": "null",
|
3686
|
+
"description": "Aria-labelledby attribute to be set for accessibility",
|
3687
|
+
"attribute": "aria-labelledby"
|
3688
|
+
},
|
3679
3689
|
{
|
3680
3690
|
"kind": "field",
|
3681
3691
|
"name": "iconProviderContext",
|
@@ -3792,6 +3802,15 @@
|
|
3792
3802
|
"default": "null",
|
3793
3803
|
"description": "Aria-label attribute to be set for accessibility",
|
3794
3804
|
"fieldName": "ariaLabel"
|
3805
|
+
},
|
3806
|
+
{
|
3807
|
+
"name": "aria-labelledby",
|
3808
|
+
"type": {
|
3809
|
+
"text": "string | null"
|
3810
|
+
},
|
3811
|
+
"default": "null",
|
3812
|
+
"description": "Aria-labelledby attribute to be set for accessibility",
|
3813
|
+
"fieldName": "ariaLabelledBy"
|
3795
3814
|
}
|
3796
3815
|
],
|
3797
3816
|
"superclass": {
|
package/package.json
CHANGED