@momentum-design/components 0.133.7 → 0.133.9

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.
@@ -140,11 +140,11 @@ const styles = css `
140
140
  --mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
141
141
  --mdc-button-background: var(--mds-color-theme-button-accent-normal);
142
142
  }
143
- :host([color='accent'][variant='primary']:hover) {
143
+ :host([color='accent'][variant='primary']:hover:not([disabled]):not([soft-disabled])) {
144
144
  --mdc-button-background: var(--mds-color-theme-button-accent-hover);
145
145
  }
146
- :host([color='accent'][variant='primary']:active),
147
- :host([color='accent'][variant='primary'].pressed) {
146
+ :host([color='accent'][variant='primary']:active:not([disabled]):not([soft-disabled])),
147
+ :host([color='accent'][variant='primary'].pressed:not([disabled]):not([soft-disabled])) {
148
148
  --mdc-button-background: var(--mds-color-theme-button-accent-pressed);
149
149
  }
150
150
 
@@ -152,11 +152,11 @@ const styles = css `
152
152
  --mdc-button-text-color: var(--mds-color-theme-text-accent-normal);
153
153
  --mdc-button-border-color: var(--mds-color-theme-outline-theme-normal);
154
154
  }
155
- :host([color='accent'][variant='secondary']:hover) {
155
+ :host([color='accent'][variant='secondary']:hover:not([disabled]):not([soft-disabled])) {
156
156
  --mdc-button-background: var(--mds-color-theme-button-secondary-hover);
157
157
  }
158
- :host([color='accent'][variant='secondary']:active),
159
- :host([color='accent'][variant='secondary'].pressed) {
158
+ :host([color='accent'][variant='secondary']:active:not([disabled]):not([soft-disabled])),
159
+ :host([color='accent'][variant='secondary'].pressed:not([disabled]):not([soft-disabled])) {
160
160
  --mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
161
161
  }
162
162
 
@@ -164,11 +164,11 @@ const styles = css `
164
164
  --mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
165
165
  --mdc-button-background: var(--mds-color-theme-button-join-normal);
166
166
  }
167
- :host([color='positive'][variant='primary']:hover) {
167
+ :host([color='positive'][variant='primary']:hover:not([disabled]):not([soft-disabled])) {
168
168
  --mdc-button-background: var(--mds-color-theme-button-join-hover);
169
169
  }
170
- :host([color='positive'][variant='primary']:active),
171
- :host([color='positive'][variant='primary'].pressed) {
170
+ :host([color='positive'][variant='primary']:active:not([disabled]):not([soft-disabled])),
171
+ :host([color='positive'][variant='primary'].pressed:not([disabled]):not([soft-disabled])) {
172
172
  --mdc-button-background: var(--mds-color-theme-button-join-pressed);
173
173
  }
174
174
 
@@ -176,11 +176,11 @@ const styles = css `
176
176
  --mdc-button-text-color: var(--mds-color-theme-text-success-normal);
177
177
  --mdc-button-border-color: var(--mds-color-theme-outline-join-normal);
178
178
  }
179
- :host([color='positive'][variant='secondary']:hover) {
179
+ :host([color='positive'][variant='secondary']:hover:not([disabled]):not([soft-disabled])) {
180
180
  --mdc-button-background: var(--mds-color-theme-button-secondary-hover);
181
181
  }
182
- :host([color='positive'][variant='secondary']:active),
183
- :host([color='positive'][variant='secondary'].pressed) {
182
+ :host([color='positive'][variant='secondary']:active:not([disabled]):not([soft-disabled])),
183
+ :host([color='positive'][variant='secondary'].pressed:not([disabled]):not([soft-disabled])) {
184
184
  --mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
185
185
  }
186
186
 
@@ -188,11 +188,11 @@ const styles = css `
188
188
  --mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
189
189
  --mdc-button-background: var(--mds-color-theme-button-cancel-normal);
190
190
  }
191
- :host([color='negative'][variant='primary']:hover) {
191
+ :host([color='negative'][variant='primary']:hover:not([disabled]):not([soft-disabled])) {
192
192
  --mdc-button-background: var(--mds-color-theme-button-cancel-hover);
193
193
  }
194
- :host([color='negative'][variant='primary']:active),
195
- :host([color='negative'][variant='primary'].pressed) {
194
+ :host([color='negative'][variant='primary']:active:not([disabled]):not([soft-disabled])),
195
+ :host([color='negative'][variant='primary'].pressed:not([disabled]):not([soft-disabled])) {
196
196
  --mdc-button-background: var(--mds-color-theme-button-cancel-pressed);
197
197
  }
198
198
 
@@ -200,11 +200,11 @@ const styles = css `
200
200
  --mdc-button-text-color: var(--mds-color-theme-text-error-normal);
201
201
  --mdc-button-border-color: var(--mds-color-theme-outline-cancel-normal);
202
202
  }
203
- :host([color='negative'][variant='secondary']:hover) {
203
+ :host([color='negative'][variant='secondary']:hover:not([disabled]):not([soft-disabled])) {
204
204
  --mdc-button-background: var(--mds-color-theme-button-secondary-hover);
205
205
  }
206
- :host([color='negative'][variant='secondary']:active),
207
- :host([color='negative'][variant='secondary'].pressed) {
206
+ :host([color='negative'][variant='secondary']:active:not([disabled]):not([soft-disabled])),
207
+ :host([color='negative'][variant='secondary'].pressed:not([disabled]):not([soft-disabled])) {
208
208
  --mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
209
209
  }
210
210
 
@@ -212,11 +212,11 @@ const styles = css `
212
212
  --mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
213
213
  --mdc-button-background: var(--mds-color-theme-common-button-promotion-normal);
214
214
  }
215
- :host([color='promotional'][variant='primary']:hover) {
215
+ :host([color='promotional'][variant='primary']:hover:not([disabled]):not([soft-disabled])) {
216
216
  --mdc-button-background: var(--mds-color-theme-common-button-promotion-hover);
217
217
  }
218
- :host([color='promotional'][variant='primary']:active),
219
- :host([color='promotional'][variant='primary'].pressed) {
218
+ :host([color='promotional'][variant='primary']:active:not([disabled]):not([soft-disabled])),
219
+ :host([color='promotional'][variant='primary'].pressed:not([disabled]):not([soft-disabled])) {
220
220
  --mdc-button-background: var(--mds-color-theme-common-button-promotion-active);
221
221
  }
222
222
 
@@ -224,11 +224,11 @@ const styles = css `
224
224
  --mdc-button-text-color: var(--mds-color-theme-text-primary-normal);
225
225
  --mdc-button-border-color: var(--mds-color-theme-outline-promotion-normal);
226
226
  }
227
- :host([color='promotional'][variant='secondary']:hover) {
227
+ :host([color='promotional'][variant='secondary']:hover:not([disabled]):not([soft-disabled])) {
228
228
  --mdc-button-background: var(--mds-color-theme-button-secondary-hover);
229
229
  }
230
- :host([color='promotional'][variant='secondary']:active),
231
- :host([color='promotional'][variant='secondary'].pressed) {
230
+ :host([color='promotional'][variant='secondary']:active:not([disabled]):not([soft-disabled])),
231
+ :host([color='promotional'][variant='secondary'].pressed:not([disabled]):not([soft-disabled])) {
232
232
  --mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
233
233
  }
234
234
 
@@ -67,13 +67,20 @@ class FormfieldGroup extends FormfieldWrapper {
67
67
  this.disabled = undefined;
68
68
  this.role = this.isRadio ? ROLE.RADIOGROUP : ROLE.GROUP;
69
69
  this.ariaDescription = (_a = this.helpText) !== null && _a !== void 0 ? _a : '';
70
- this.ariaLabel = this.label || '';
70
+ // Add aria-label if not provided by the consumer, to make it accessible.
71
+ // It will use the label property for the aria-label if aria-label is not provided.
72
+ if (!this.hasAttribute('aria-label')) {
73
+ this.setAttribute('aria-label', this.label || '');
74
+ }
71
75
  }
72
76
  update(changedProperties) {
73
77
  super.update(changedProperties);
74
78
  if (changedProperties.has('label') && !this.ariaLabel) {
75
79
  this.ariaLabel = this.label || '';
76
80
  }
81
+ if (changedProperties.has('helpText') && !this.ariaDescription) {
82
+ this.ariaDescription = this.helpText || '';
83
+ }
77
84
  }
78
85
  render() {
79
86
  return html `
@@ -16,6 +16,7 @@ declare class RadioGroup extends FormfieldGroup {
16
16
  */
17
17
  name: string;
18
18
  constructor();
19
+ connectedCallback(): void;
19
20
  /**
20
21
  * Using name property to group the radio buttons together.
21
22
  * If the name is not set, it will be set to the name of the radio group.
@@ -32,6 +32,12 @@ class RadioGroup extends FormfieldGroup {
32
32
  // This is used to set the role of the component as `radiogroup`.
33
33
  this.isRadio = true;
34
34
  }
35
+ connectedCallback() {
36
+ super.connectedCallback();
37
+ // toggletipPlacement and toggletipStrategy are set to undefined as they are not used by radiogroup.
38
+ this.toggletipPlacement = undefined;
39
+ this.toggletipStrategy = undefined;
40
+ }
35
41
  /**
36
42
  * Using name property to group the radio buttons together.
37
43
  * If the name is not set, it will be set to the name of the radio group.
@@ -51,7 +57,7 @@ class RadioGroup extends FormfieldGroup {
51
57
  }
52
58
  RadioGroup.styles = [...FormfieldGroup.styles];
53
59
  __decorate([
54
- property({ type: String }),
60
+ property({ type: String, reflect: true }),
55
61
  __metadata("design:type", Object)
56
62
  ], RadioGroup.prototype, "name", void 0);
57
63
  export default RadioGroup;
@@ -37321,7 +37321,8 @@
37321
37321
  },
37322
37322
  "default": "''",
37323
37323
  "description": "Name of the radio group.\nThey are used to group elements in a form together.",
37324
- "attribute": "name"
37324
+ "attribute": "name",
37325
+ "reflects": true
37325
37326
  },
37326
37327
  {
37327
37328
  "kind": "field",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.133.7",
4
+ "version": "0.133.9",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"