@momentum-design/components 0.120.38 → 0.121.1

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.
@@ -10,7 +10,8 @@ import type { ValidationType } from '../formfieldwrapper/formfieldwrapper.types'
10
10
  * - `password` field - contains the value
11
11
  * - `help-text` or `validation-message` - displayed below the password field.
12
12
  * - `help-text-type` - type of the help text, can be 'default', 'error', 'warning', 'success', 'priority'.
13
- * - `show-hide-button-aria-label` - aria label for the trailing show/hide button.
13
+ * - `show-button-aria-label` - aria label for the trailing show button.
14
+ * - `hide-button-aria-label` - aria label for the trailing hide button.
14
15
  * - all the attributes of the native password field.
15
16
  *
16
17
  * @tagname mdc-password
@@ -62,9 +63,13 @@ import type { ValidationType } from '../formfieldwrapper/formfieldwrapper.types'
62
63
  */
63
64
  declare class Password extends Input {
64
65
  /**
65
- * Aria label for the show or hide password icon button.
66
+ * Aria label for the show password icon button.
66
67
  */
67
- showHideButtonAriaLabel: string;
68
+ showButtonAriaLabel: string;
69
+ /**
70
+ * Aria label for the hide password icon button.
71
+ */
72
+ hideButtonAriaLabel: string;
68
73
  /**
69
74
  * The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
70
75
  * @override
@@ -22,7 +22,8 @@ import { PASSWORD_VISIBILITY_ICONS } from './password.constants';
22
22
  * - `password` field - contains the value
23
23
  * - `help-text` or `validation-message` - displayed below the password field.
24
24
  * - `help-text-type` - type of the help text, can be 'default', 'error', 'warning', 'success', 'priority'.
25
- * - `show-hide-button-aria-label` - aria label for the trailing show/hide button.
25
+ * - `show-button-aria-label` - aria label for the trailing show button.
26
+ * - `hide-button-aria-label` - aria label for the trailing hide button.
26
27
  * - all the attributes of the native password field.
27
28
  *
28
29
  * @tagname mdc-password
@@ -76,9 +77,13 @@ class Password extends Input {
76
77
  constructor() {
77
78
  super(...arguments);
78
79
  /**
79
- * Aria label for the show or hide password icon button.
80
+ * Aria label for the show password icon button.
80
81
  */
81
- this.showHideButtonAriaLabel = '';
82
+ this.showButtonAriaLabel = '';
83
+ /**
84
+ * Aria label for the hide password icon button.
85
+ */
86
+ this.hideButtonAriaLabel = '';
82
87
  /**
83
88
  * The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
84
89
  * @override
@@ -116,7 +121,7 @@ class Password extends Input {
116
121
  ?disabled=${this.disabled || this.readonly || !showBtn}
117
122
  size="${DEFAULTS.ICON_SIZE}"
118
123
  @click=${this.toggleShowPassword}
119
- aria-label=${this.showHideButtonAriaLabel}
124
+ aria-label=${this.showPassword ? this.hideButtonAriaLabel : this.showButtonAriaLabel}
120
125
  prefix-icon=${this.showPassword ? PASSWORD_VISIBILITY_ICONS.HIDE_BOLD : PASSWORD_VISIBILITY_ICONS.SHOW_BOLD}
121
126
  ></mdc-button>
122
127
  `;
@@ -131,9 +136,13 @@ class Password extends Input {
131
136
  }
132
137
  Password.styles = [...Input.styles];
133
138
  __decorate([
134
- property({ type: String, attribute: 'show-hide-button-aria-label' }),
139
+ property({ type: String, attribute: 'show-button-aria-label' }),
140
+ __metadata("design:type", Object)
141
+ ], Password.prototype, "showButtonAriaLabel", void 0);
142
+ __decorate([
143
+ property({ type: String, attribute: 'hide-button-aria-label' }),
135
144
  __metadata("design:type", Object)
136
- ], Password.prototype, "showHideButtonAriaLabel", void 0);
145
+ ], Password.prototype, "hideButtonAriaLabel", void 0);
137
146
  __decorate([
138
147
  property({ type: String, attribute: 'help-text-type' }),
139
148
  __metadata("design:type", String)