@momentum-design/components 0.53.6 → 0.53.8
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 +7 -7
- package/dist/browser/index.js.map +2 -2
- package/dist/components/button/button.styles.js +6 -6
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +2 -2
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -14
- package/dist/custom-elements.json +911 -869
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +3 -3
- package/package.json +1 -1
@@ -69,21 +69,21 @@ const styles = css `
|
|
69
69
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
70
70
|
}
|
71
71
|
|
72
|
-
:host([active]:not([variant='primary'])) {
|
72
|
+
:host([active][color='default']:not([variant='primary'])) {
|
73
73
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
74
74
|
background: var(--mdc-button-active-background-color);
|
75
75
|
}
|
76
|
-
:host([active]:not([variant='primary']):hover) {
|
76
|
+
:host([active][color='default']:not([variant='primary']):hover) {
|
77
77
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
78
78
|
background: var(--mdc-button-active-hover-background-color);
|
79
79
|
}
|
80
|
-
:host([active]:not([variant='primary']):active),
|
81
|
-
:host([active]:not([variant='primary']).pressed) {
|
80
|
+
:host([active][color='default']:not([variant='primary']):active),
|
81
|
+
:host([active][color='default']:not([variant='primary']).pressed) {
|
82
82
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
83
83
|
background: var(--mdc-button-active-pressed-background-color);
|
84
84
|
}
|
85
|
-
:host([active]:not([variant='primary'])[disabled]),
|
86
|
-
:host([active]:not([variant='primary'])[soft-disabled]) {
|
85
|
+
:host([active][color='default']:not([variant='primary'])[disabled]),
|
86
|
+
:host([active][color='default']:not([variant='primary'])[soft-disabled]) {
|
87
87
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
88
88
|
background: var(--mdc-button-active-disabled-background-color);
|
89
89
|
}
|
@@ -59,9 +59,9 @@ declare class Buttonsimple extends Buttonsimple_base {
|
|
59
59
|
* a comma separated string.
|
60
60
|
* For example: `aria-pressed,aria-expanded`
|
61
61
|
*
|
62
|
-
* @default 'aria-pressed'
|
62
|
+
* @default 'aria-pressed' (when)
|
63
63
|
*/
|
64
|
-
ariaStateKey
|
64
|
+
ariaStateKey?: string;
|
65
65
|
/**
|
66
66
|
* This property defines the type attribute for the button element.
|
67
67
|
* The type attribute specifies the behavior of the button when it is clicked.
|
@@ -46,19 +46,6 @@ class Buttonsimple extends TabIndexMixin(DisabledMixin(Component)) {
|
|
46
46
|
* @default button
|
47
47
|
*/
|
48
48
|
this.role = DEFAULTS.ROLE;
|
49
|
-
/**
|
50
|
-
* This property defines the ARIA state key, which will be toggled when the
|
51
|
-
* Button is set to `active`.
|
52
|
-
* The default value is 'aria-pressed', which is commonly used for toggle buttons.
|
53
|
-
*
|
54
|
-
* Consumers can override this property to use a different ARIA state key if needed.
|
55
|
-
* In case multiple aria attributes should be toggled, they can be passed in as
|
56
|
-
* a comma separated string.
|
57
|
-
* For example: `aria-pressed,aria-expanded`
|
58
|
-
*
|
59
|
-
* @default 'aria-pressed'
|
60
|
-
*/
|
61
|
-
this.ariaStateKey = DEFAULTS.ARIA_STATE_KEY;
|
62
49
|
/**
|
63
50
|
* This property defines the type attribute for the button element.
|
64
51
|
* The type attribute specifies the behavior of the button when it is clicked.
|
@@ -88,6 +75,10 @@ class Buttonsimple extends TabIndexMixin(DisabledMixin(Component)) {
|
|
88
75
|
this.setSoftDisabled(this, this.softDisabled);
|
89
76
|
}
|
90
77
|
if (changedProperties.has('active')) {
|
78
|
+
if (this.active) {
|
79
|
+
// if active is true and no ariaStateKey is provided, set it to the default (= aria-pressed)
|
80
|
+
this.ariaStateKey = this.ariaStateKey || DEFAULTS.ARIA_STATE_KEY;
|
81
|
+
}
|
91
82
|
this.setActive(this, this.active);
|
92
83
|
}
|
93
84
|
}
|
@@ -237,7 +228,7 @@ __decorate([
|
|
237
228
|
], Buttonsimple.prototype, "role", void 0);
|
238
229
|
__decorate([
|
239
230
|
property({ type: String, reflect: true }),
|
240
|
-
__metadata("design:type",
|
231
|
+
__metadata("design:type", String)
|
241
232
|
], Buttonsimple.prototype, "ariaStateKey", void 0);
|
242
233
|
__decorate([
|
243
234
|
property({ reflect: true }),
|