@momentum-design/components 0.121.4 → 0.121.5

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.
@@ -54,6 +54,14 @@ declare class Accordion extends AccordionButton {
54
54
  leadingControlsSlot: Array<HTMLElement>;
55
55
  /** @internal */
56
56
  trailingControlsSlot: Array<HTMLElement>;
57
+ /**
58
+ * Aria-label attribute for the trigger button when accordion is collapsed.
59
+ */
60
+ openButtonAriaLabel?: string;
61
+ /**
62
+ * Aria-label attribute for the trigger button when accordion is expanded.
63
+ */
64
+ closeButtonAriaLabel?: string;
57
65
  /**
58
66
  * Handles property changes for the accordion.
59
67
  * If the disabled property is updated, applies the same disabled state to all elements in the leading and trailing controls slots.
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { html } from 'lit';
11
- import { queryAssignedElements } from 'lit/decorators.js';
11
+ import { queryAssignedElements, property } from 'lit/decorators.js';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
13
  import { ROLE } from '../../utils/roles';
14
14
  import AccordionButton from '../accordionbutton/accordionbutton.component';
@@ -108,7 +108,7 @@ class Accordion extends AccordionButton {
108
108
  @click="${this.handleHeaderClick}"
109
109
  aria-controls="${this.bodySectionId}"
110
110
  aria-expanded="${this.expanded}"
111
- title="${ifDefined(this.headerText)}"
111
+ aria-label="${ifDefined(this.expanded ? this.closeButtonAriaLabel : this.openButtonAriaLabel)}"
112
112
  prefix-icon="${this.getArrowIconName()}"
113
113
  variant="${BUTTON_VARIANTS.TERTIARY}"
114
114
  size="${ICON_BUTTON_SIZES[20]}"
@@ -127,4 +127,12 @@ __decorate([
127
127
  queryAssignedElements({ slot: 'trailing-controls' }),
128
128
  __metadata("design:type", Array)
129
129
  ], Accordion.prototype, "trailingControlsSlot", void 0);
130
+ __decorate([
131
+ property({ type: String, attribute: 'open-button-aria-label', reflect: true }),
132
+ __metadata("design:type", String)
133
+ ], Accordion.prototype, "openButtonAriaLabel", void 0);
134
+ __decorate([
135
+ property({ type: String, attribute: 'close-button-aria-label', reflect: true }),
136
+ __metadata("design:type", String)
137
+ ], Accordion.prototype, "closeButtonAriaLabel", void 0);
130
138
  export default Accordion;