@momentum-design/components 0.122.1 → 0.122.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.
- package/dist/browser/index.js +136 -135
- package/dist/browser/index.js.map +2 -2
- package/dist/components/popover/popover.utils.js +2 -1
- package/dist/components/searchpopover/searchpopover.component.d.ts +7 -2
- package/dist/components/searchpopover/searchpopover.component.js +7 -2
- package/dist/custom-elements.json +6082 -6064
- package/dist/react/index.d.ts +8 -8
- package/dist/react/index.js +8 -8
- package/dist/react/searchpopover/index.d.ts +2 -2
- package/dist/react/searchpopover/index.js +2 -2
- package/package.json +1 -1
|
@@ -124,7 +124,8 @@ export class PopoverUtils {
|
|
|
124
124
|
this.popover.ariaLabel =
|
|
125
125
|
((_a = this.popover.triggerElement) === null || _a === void 0 ? void 0 : _a.ariaLabel) || ((_b = this.popover.triggerElement) === null || _b === void 0 ? void 0 : _b.textContent) || '';
|
|
126
126
|
}
|
|
127
|
-
if (!this.popover.ariaLabelledby) {
|
|
127
|
+
if (!this.popover.ariaLabelledby && !this.popover.ariaLabel) {
|
|
128
|
+
// If no aria-label is provided, link the popover to the trigger element via aria-labelledby
|
|
128
129
|
this.popover.ariaLabelledby = ((_c = this.popover.triggerElement) === null || _c === void 0 ? void 0 : _c.id) || '';
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -7,8 +7,8 @@ import type { Placement } from './searchpopover.types';
|
|
|
7
7
|
* in a popover below the search input field, where the search results hold individual actions like navigating to a
|
|
8
8
|
* a different url etc.
|
|
9
9
|
*
|
|
10
|
-
* - Don't use this when search results are displayed inline on the page
|
|
11
|
-
* - Don't use this when a list of options is filtered based on the search input
|
|
10
|
+
* - Don't use this when search results are displayed inline on the page -\> use Searchfield component instead.
|
|
11
|
+
* - Don't use this when a list of options is filtered based on the search input -\> use Combobox component instead.
|
|
12
12
|
*
|
|
13
13
|
* It supports `mdc-inputchip` as filters.
|
|
14
14
|
*
|
|
@@ -93,6 +93,11 @@ declare class Searchpopover extends Searchfield {
|
|
|
93
93
|
* @default 1000
|
|
94
94
|
*/
|
|
95
95
|
popoverZIndex: number;
|
|
96
|
+
/**
|
|
97
|
+
* The aria-label for the popover within Searchpopover.
|
|
98
|
+
* Use to provide an accessible name for the popover i.e. "Search results".
|
|
99
|
+
*/
|
|
100
|
+
popoverAriaLabel?: string;
|
|
96
101
|
protected renderInputElement(): import("lit-html").TemplateResult<1>;
|
|
97
102
|
render(): import("lit-html").TemplateResult<1>;
|
|
98
103
|
static styles: Array<CSSResult>;
|
|
@@ -25,8 +25,8 @@ import { DEFAULTS, TRIGGER_ID, POPOVER_ID } from './searchpopover.constants';
|
|
|
25
25
|
* in a popover below the search input field, where the search results hold individual actions like navigating to a
|
|
26
26
|
* a different url etc.
|
|
27
27
|
*
|
|
28
|
-
* - Don't use this when search results are displayed inline on the page
|
|
29
|
-
* - Don't use this when a list of options is filtered based on the search input
|
|
28
|
+
* - Don't use this when search results are displayed inline on the page -\> use Searchfield component instead.
|
|
29
|
+
* - Don't use this when a list of options is filtered based on the search input -\> use Combobox component instead.
|
|
30
30
|
*
|
|
31
31
|
* It supports `mdc-inputchip` as filters.
|
|
32
32
|
*
|
|
@@ -183,6 +183,7 @@ class Searchpopover extends Searchfield {
|
|
|
183
183
|
focus-back-to-trigger
|
|
184
184
|
size
|
|
185
185
|
placement="${this.placement}"
|
|
186
|
+
aria-label="${ifDefined(this.popoverAriaLabel)}"
|
|
186
187
|
disable-aria-expanded
|
|
187
188
|
z-index="${ifDefined(this.popoverZIndex)}"
|
|
188
189
|
exportparts="popover-content"
|
|
@@ -205,4 +206,8 @@ __decorate([
|
|
|
205
206
|
property({ type: Number, reflect: true, attribute: 'popover-z-index' }),
|
|
206
207
|
__metadata("design:type", Number)
|
|
207
208
|
], Searchpopover.prototype, "popoverZIndex", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property({ type: String, reflect: true, attribute: 'popover-aria-label' }),
|
|
211
|
+
__metadata("design:type", String)
|
|
212
|
+
], Searchpopover.prototype, "popoverAriaLabel", void 0);
|
|
208
213
|
export default Searchpopover;
|