@momentum-design/components 0.53.9 → 0.54.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.
- package/dist/browser/index.js +350 -314
- package/dist/browser/index.js.map +4 -4
- package/dist/components/buttonsimple/buttonsimple.component.js +4 -2
- package/dist/components/checkbox/checkbox.component.d.ts +1 -9
- package/dist/components/checkbox/checkbox.component.js +7 -21
- package/dist/components/checkbox/checkbox.styles.js +30 -67
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/radio/radio.component.d.ts +3 -11
- package/dist/components/radio/radio.component.js +10 -16
- package/dist/components/radio/radio.styles.js +36 -111
- package/dist/components/staticcheckbox/index.d.ts +8 -0
- package/dist/components/staticcheckbox/index.js +5 -0
- package/dist/components/staticcheckbox/staticcheckbox.component.d.ts +42 -0
- package/dist/components/staticcheckbox/staticcheckbox.component.js +76 -0
- package/dist/components/staticcheckbox/staticcheckbox.constants.d.ts +3 -0
- package/dist/components/staticcheckbox/staticcheckbox.constants.js +4 -0
- package/dist/components/staticcheckbox/staticcheckbox.styles.d.ts +2 -0
- package/dist/components/staticcheckbox/staticcheckbox.styles.js +60 -0
- package/dist/components/staticradio/index.d.ts +7 -0
- package/dist/components/staticradio/index.js +4 -0
- package/dist/components/staticradio/staticradio.component.d.ts +41 -0
- package/dist/components/staticradio/staticradio.component.js +67 -0
- package/dist/components/staticradio/staticradio.constants.d.ts +2 -0
- package/dist/components/staticradio/staticradio.constants.js +3 -0
- package/dist/components/staticradio/staticradio.styles.d.ts +2 -0
- package/dist/components/staticradio/staticradio.styles.js +86 -0
- package/dist/custom-elements.json +306 -70
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/react/checkbox/index.d.ts +1 -9
- package/dist/react/checkbox/index.js +1 -9
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/react/radio/index.d.ts +3 -11
- package/dist/react/radio/index.js +3 -11
- package/dist/react/staticcheckbox/index.d.ts +25 -0
- package/dist/react/staticcheckbox/index.js +34 -0
- package/dist/react/staticradio/index.d.ts +24 -0
- package/dist/react/staticradio/index.js +33 -0
- package/package.json +1 -1
@@ -75,8 +75,10 @@ class Buttonsimple extends TabIndexMixin(DisabledMixin(Component)) {
|
|
75
75
|
this.setSoftDisabled(this, this.softDisabled);
|
76
76
|
}
|
77
77
|
if (changedProperties.has('active')) {
|
78
|
-
if (this.active) {
|
79
|
-
// if active is
|
78
|
+
if (this.active !== undefined) {
|
79
|
+
// if active is not undefined and no ariaStateKey is provided, set it to the default (= aria-pressed)
|
80
|
+
// this will make sure that if active is set to true or false regardless
|
81
|
+
// the ariaStateKey fallback will still work
|
80
82
|
this.ariaStateKey = this.ariaStateKey || DEFAULTS.ARIA_STATE_KEY;
|
81
83
|
}
|
82
84
|
this.setActive(this, this.active);
|
@@ -18,18 +18,10 @@ declare const Checkbox_base: import("../../utils/mixins/index.types").Constructo
|
|
18
18
|
* @event focus - (React: onFocus) Event that gets dispatched when the checkbox receives focus.
|
19
19
|
*
|
20
20
|
* @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
|
21
|
-
* @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
|
22
|
-
* @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
|
23
21
|
* @cssproperty --mdc-checkbox-checked-background-color-hover - Background color for a selected checkbox when hovered.
|
24
22
|
* @cssproperty --mdc-checkbox-checked-pressed-icon-color - Background color for a selected checkbox when pressed.
|
25
|
-
* @cssproperty --mdc-checkbox-disabled-background-color - Background color for a disabled checkbox.
|
26
|
-
* @cssproperty --mdc-checkbox-disabled-border-color - Border color for a disabled checkbox.
|
27
|
-
* @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a disabled, selected checkbox.
|
28
|
-
* @cssproperty --mdc-checkbox-disabled-icon-color - Icon color for a disabled checkbox.
|
29
|
-
* @cssproperty --mdc-checkbox-icon-background-color - Background color for an unselected checkbox.
|
30
|
-
* @cssproperty --mdc-checkbox-icon-border-color - Default background color for an unselected checkbox.
|
31
|
-
* @cssproperty --mdc-checkbox-icon-color - Icon color for an unselected checkbox.
|
32
23
|
* @cssproperty --mdc-checkbox-pressed-icon-color - Background color for a selected checkbox when pressed.
|
24
|
+
* @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a selected checkbox when disabled.
|
33
25
|
*/
|
34
26
|
declare class Checkbox extends Checkbox_base implements AssociatedFormControl {
|
35
27
|
/**
|
@@ -14,7 +14,6 @@ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
|
|
14
14
|
import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
15
15
|
import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
|
16
16
|
import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwrapper.constants';
|
17
|
-
import { ICON_NAME } from './checkbox.constants';
|
18
17
|
import styles from './checkbox.styles';
|
19
18
|
/**
|
20
19
|
* Checkboxes allow users to select multiple options from a list or turn an item/feature on or off.
|
@@ -32,18 +31,10 @@ import styles from './checkbox.styles';
|
|
32
31
|
* @event focus - (React: onFocus) Event that gets dispatched when the checkbox receives focus.
|
33
32
|
*
|
34
33
|
* @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
|
35
|
-
* @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
|
36
|
-
* @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
|
37
34
|
* @cssproperty --mdc-checkbox-checked-background-color-hover - Background color for a selected checkbox when hovered.
|
38
35
|
* @cssproperty --mdc-checkbox-checked-pressed-icon-color - Background color for a selected checkbox when pressed.
|
39
|
-
* @cssproperty --mdc-checkbox-disabled-background-color - Background color for a disabled checkbox.
|
40
|
-
* @cssproperty --mdc-checkbox-disabled-border-color - Border color for a disabled checkbox.
|
41
|
-
* @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a disabled, selected checkbox.
|
42
|
-
* @cssproperty --mdc-checkbox-disabled-icon-color - Icon color for a disabled checkbox.
|
43
|
-
* @cssproperty --mdc-checkbox-icon-background-color - Background color for an unselected checkbox.
|
44
|
-
* @cssproperty --mdc-checkbox-icon-border-color - Default background color for an unselected checkbox.
|
45
|
-
* @cssproperty --mdc-checkbox-icon-color - Icon color for an unselected checkbox.
|
46
36
|
* @cssproperty --mdc-checkbox-pressed-icon-color - Background color for a selected checkbox when pressed.
|
37
|
+
* @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a selected checkbox when disabled.
|
47
38
|
*/
|
48
39
|
class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
49
40
|
constructor() {
|
@@ -169,16 +160,12 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
|
|
169
160
|
}
|
170
161
|
render() {
|
171
162
|
var _a;
|
172
|
-
const checkboxIconContent = (this.checked || this.indeterminate) ? html `
|
173
|
-
<mdc-icon
|
174
|
-
class="icon"
|
175
|
-
name="${this.indeterminate ? ICON_NAME.INDETERMINATE : ICON_NAME.CHECKED}"
|
176
|
-
size="1"
|
177
|
-
length-unit="rem"
|
178
|
-
></mdc-icon>
|
179
|
-
` : nothing;
|
180
163
|
return html `
|
181
|
-
<
|
164
|
+
<mdc-staticcheckbox
|
165
|
+
class="mdc-focus-ring"
|
166
|
+
?checked="${this.checked}"
|
167
|
+
?indeterminate="${this.indeterminate}"
|
168
|
+
?disabled="${this.disabled}">
|
182
169
|
<input
|
183
170
|
id="${this.id}"
|
184
171
|
type="checkbox"
|
@@ -197,8 +184,7 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
|
|
197
184
|
@change=${this.handleChange}
|
198
185
|
@keydown=${this.handleKeyDown}
|
199
186
|
/>
|
200
|
-
|
201
|
-
</div>
|
187
|
+
</mdc-staticcheckbox>
|
202
188
|
${this.renderLabelAndHelperText()}
|
203
189
|
`;
|
204
190
|
}
|
@@ -3,59 +3,48 @@ import { hostFocusRingStyles } from '../../utils/styles';
|
|
3
3
|
const styles = [css `
|
4
4
|
:host {
|
5
5
|
--mdc-checkbox-background-color-hover: var(--mds-color-theme-control-inactive-hover);
|
6
|
-
--mdc-checkbox-
|
7
|
-
--mdc-checkbox-checked-background-color-hover: var(--mds-color-theme-control-active-hover);
|
8
|
-
--mdc-checkbox-checked-background-color: var(--mds-color-theme-control-active-normal);
|
6
|
+
--mdc-checkbox-pressed-icon-color: var(--mds-color-theme-control-inactive-pressed);
|
9
7
|
--mdc-checkbox-checked-pressed-icon-color: var(--mds-color-theme-control-active-pressed);
|
10
|
-
--mdc-checkbox-
|
11
|
-
--mdc-checkbox-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
|
8
|
+
--mdc-checkbox-checked-background-color-hover: var(--mds-color-theme-control-active-hover);
|
12
9
|
--mdc-checkbox-disabled-checked-icon-color: var(--mds-color-theme-control-active-disabled);
|
13
|
-
|
14
|
-
--mdc-checkbox-icon-background-color: var(--mds-color-theme-control-inactive-normal);
|
15
|
-
--mdc-checkbox-icon-border-color: var(--mds-color-theme-outline-input-normal);
|
16
|
-
--mdc-checkbox-icon-color: var(--mds-color-theme-inverted-text-primary-normal);
|
17
|
-
--mdc-checkbox-pressed-icon-color: var(--mds-color-theme-control-inactive-pressed);
|
18
|
-
|
10
|
+
|
19
11
|
flex-direction: row;
|
20
12
|
align-items: flex-start;
|
21
13
|
}
|
22
14
|
.mdc-label, .input {
|
23
15
|
cursor: pointer;
|
24
16
|
}
|
25
|
-
|
26
|
-
:host([indeterminate]) .icon-container {
|
27
|
-
background: var(--mdc-checkbox-checked-background-color);
|
28
|
-
border: unset;
|
29
|
-
}
|
30
|
-
:host([checked]) .container:hover .icon-container,
|
31
|
-
:host([indeterminate]) .container:hover .icon-container {
|
32
|
-
background: var(--mdc-checkbox-checked-background-color-hover);
|
33
|
-
}
|
34
|
-
:host([checked]) .container:active .icon-container,
|
35
|
-
:host([indeterminate]) .container:active .icon-container {
|
36
|
-
background: var(--mdc-checkbox-checked-pressed-icon-color);
|
37
|
-
}
|
17
|
+
|
38
18
|
:host([disabled]) .mdc-label,
|
39
19
|
:host([disabled]) .input {
|
40
20
|
cursor: default;
|
41
21
|
}
|
42
|
-
|
43
|
-
|
22
|
+
|
23
|
+
:host(:hover) mdc-staticcheckbox{
|
24
|
+
background: var(--mdc-checkbox-background-color-hover);
|
44
25
|
}
|
45
|
-
:host(
|
46
|
-
|
47
|
-
background: var(--mdc-checkbox-disabled-background-color);
|
26
|
+
:host(:active) mdc-staticcheckbox{
|
27
|
+
background: var(--mdc-checkbox-pressed-icon-color);
|
48
28
|
}
|
49
|
-
|
50
|
-
|
29
|
+
|
30
|
+
:host([checked]:hover)::part(icon-container),
|
31
|
+
:host([indeterminate]:hover)::part(icon-container) {
|
32
|
+
background: var(--mdc-checkbox-checked-background-color-hover);
|
51
33
|
}
|
52
|
-
:host([
|
53
|
-
:host([
|
54
|
-
|
55
|
-
:host([disabled][indeterminate]) .container:hover .icon-container {
|
56
|
-
background: var(--mdc-checkbox-disabled-checked-icon-color);
|
57
|
-
border: 0.0625rem solid var(--mdc-checkbox-disabled-border-color);
|
34
|
+
:host([checked]:active)::part(icon-container),
|
35
|
+
:host([indeterminate]:active)::part(icon-container) {
|
36
|
+
background: var(--mdc-checkbox-checked-pressed-icon-color);
|
58
37
|
}
|
38
|
+
|
39
|
+
:host([disabled]) mdc-staticcheckbox {
|
40
|
+
background: unset;
|
41
|
+
}
|
42
|
+
|
43
|
+
:host([disabled][checked])::part(icon-container),
|
44
|
+
:host([disabled][indeterminate])::part(icon-container) {
|
45
|
+
background-color: var(--mdc-checkbox-disabled-checked-icon-color);
|
46
|
+
}
|
47
|
+
|
59
48
|
.input {
|
60
49
|
margin: 0;
|
61
50
|
padding: 0;
|
@@ -64,45 +53,19 @@ const styles = [css `
|
|
64
53
|
overflow: visible;
|
65
54
|
z-index: 1;
|
66
55
|
}
|
67
|
-
|
68
|
-
|
69
|
-
align-items: center;
|
70
|
-
border: 0.0625rem solid var(--mdc-checkbox-icon-border-color);
|
71
|
-
background: var(--mdc-checkbox-icon-background-color);
|
72
|
-
}
|
73
|
-
.container:hover {
|
74
|
-
background: var(--mdc-checkbox-background-color-hover);
|
75
|
-
}
|
76
|
-
.container:active {
|
77
|
-
background: var(--mdc-checkbox-pressed-icon-color);
|
78
|
-
}
|
79
|
-
.input, .icon-container {
|
56
|
+
|
57
|
+
.input {
|
80
58
|
width: 1rem;
|
81
59
|
height: 1rem;
|
82
|
-
}
|
83
|
-
.input,
|
84
|
-
.icon-container,
|
85
|
-
.container {
|
86
60
|
border-radius: 0.125rem;
|
87
61
|
}
|
88
|
-
|
89
|
-
--mdc-icon-fill-color: var(--mdc-checkbox-icon-color);
|
90
|
-
}
|
91
|
-
.container {
|
92
|
-
margin: 0.125rem 0;
|
93
|
-
}
|
62
|
+
|
94
63
|
.text-container {
|
95
64
|
display: flex;
|
96
65
|
flex-direction: column;
|
97
66
|
gap: 0.25rem;
|
98
67
|
}
|
99
68
|
|
100
|
-
|
101
|
-
@media (forced-colors: active) {
|
102
|
-
:host([checked]) .icon-container,
|
103
|
-
:host([indeterminate]) .icon-container {
|
104
|
-
border: 0.0625rem solid var(--mdc-checkbox-border-color);
|
105
|
-
}
|
106
|
-
}
|
69
|
+
|
107
70
|
`, ...hostFocusRingStyles(true)];
|
108
71
|
export default styles;
|
@@ -14,22 +14,14 @@ declare const Radio_base: import("../../utils/mixins/index.types").Constructor<i
|
|
14
14
|
* @event change - (React: onChange) Event that gets dispatched when the radio state changes.
|
15
15
|
* @event focus - (React: onFocus) Event that gets dispatched when the radio receives focus.
|
16
16
|
*
|
17
|
-
* @cssproperty --mdc-radio-inner-circle-size - size of the inner circle
|
18
17
|
* @cssproperty --mdc-radio-text-disabled-color - color of the label when disabled
|
19
|
-
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button border when disabled
|
20
|
-
* @cssproperty --mdc-radio-normal-border-color - color of the radio button border when normal
|
21
|
-
* @cssproperty --mdc-radio-inner-circle-normal-background - background color of the inner circle when normal
|
22
|
-
* @cssproperty --mdc-radio-inner-circle-disabled-background - background color of the inner circle when disabled
|
23
|
-
* @cssproperty --mdc-radio-control-inactive-color - color of the radio button when inactive
|
24
18
|
* @cssproperty --mdc-radio-control-inactive-hover - color of the radio button when inactive and hovered
|
25
19
|
* @cssproperty --mdc-radio-control-inactive-pressed-color - color of the radio button when inactive and pressed
|
26
|
-
* @cssproperty --mdc-radio-control-inactive-disabled-background - background color of the radio button when
|
27
|
-
* inactive and disabled
|
28
|
-
* @cssproperty --mdc-radio-control-active-color - color of the radio button when active
|
29
20
|
* @cssproperty --mdc-radio-control-active-hover-color - color of the radio button when active and hovered
|
30
21
|
* @cssproperty --mdc-radio-control-active-pressed-color - color of the radio button when active and pressed
|
31
|
-
* @cssproperty --mdc-radio-
|
32
|
-
*
|
22
|
+
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button when disabled
|
23
|
+
* @cssproperty --mdc-radio-control-active-disabled-background - color of the radio button when active and disabled
|
24
|
+
* @cssproperty --mdc-radio-control-inactive-disabled-background - color of the radio button when inactive and disabled
|
33
25
|
*
|
34
26
|
*/
|
35
27
|
declare class Radio extends Radio_base implements AssociatedFormControl {
|
@@ -28,22 +28,14 @@ import { DEFAULTS as FORMFIELD_DEFAULTS } from '../formfieldwrapper/formfieldwra
|
|
28
28
|
* @event change - (React: onChange) Event that gets dispatched when the radio state changes.
|
29
29
|
* @event focus - (React: onFocus) Event that gets dispatched when the radio receives focus.
|
30
30
|
*
|
31
|
-
* @cssproperty --mdc-radio-inner-circle-size - size of the inner circle
|
32
31
|
* @cssproperty --mdc-radio-text-disabled-color - color of the label when disabled
|
33
|
-
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button border when disabled
|
34
|
-
* @cssproperty --mdc-radio-normal-border-color - color of the radio button border when normal
|
35
|
-
* @cssproperty --mdc-radio-inner-circle-normal-background - background color of the inner circle when normal
|
36
|
-
* @cssproperty --mdc-radio-inner-circle-disabled-background - background color of the inner circle when disabled
|
37
|
-
* @cssproperty --mdc-radio-control-inactive-color - color of the radio button when inactive
|
38
32
|
* @cssproperty --mdc-radio-control-inactive-hover - color of the radio button when inactive and hovered
|
39
33
|
* @cssproperty --mdc-radio-control-inactive-pressed-color - color of the radio button when inactive and pressed
|
40
|
-
* @cssproperty --mdc-radio-control-inactive-disabled-background - background color of the radio button when
|
41
|
-
* inactive and disabled
|
42
|
-
* @cssproperty --mdc-radio-control-active-color - color of the radio button when active
|
43
34
|
* @cssproperty --mdc-radio-control-active-hover-color - color of the radio button when active and hovered
|
44
35
|
* @cssproperty --mdc-radio-control-active-pressed-color - color of the radio button when active and pressed
|
45
|
-
* @cssproperty --mdc-radio-
|
46
|
-
*
|
36
|
+
* @cssproperty --mdc-radio-disabled-border-color - color of the radio button when disabled
|
37
|
+
* @cssproperty --mdc-radio-control-active-disabled-background - color of the radio button when active and disabled
|
38
|
+
* @cssproperty --mdc-radio-control-inactive-disabled-background - color of the radio button when inactive and disabled
|
47
39
|
*
|
48
40
|
*/
|
49
41
|
class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
@@ -279,8 +271,12 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
279
271
|
render() {
|
280
272
|
var _a;
|
281
273
|
return html `
|
282
|
-
|
283
|
-
|
274
|
+
<mdc-staticradio
|
275
|
+
class="mdc-focus-ring"
|
276
|
+
?checked="${this.checked}"
|
277
|
+
?disabled="${this.disabled}"
|
278
|
+
?readonly="${this.readonly}"
|
279
|
+
>
|
284
280
|
<input
|
285
281
|
id="${this.id}"
|
286
282
|
type="radio"
|
@@ -299,10 +295,8 @@ class Radio extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
299
295
|
aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
|
300
296
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
301
297
|
/>
|
302
|
-
|
303
|
-
</div>
|
298
|
+
</mdc-staticradio>
|
304
299
|
${this.renderLabelAndHelperText()}
|
305
|
-
</div>
|
306
300
|
`;
|
307
301
|
}
|
308
302
|
}
|
@@ -2,141 +2,72 @@ import { css } from 'lit';
|
|
2
2
|
import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
|
3
3
|
const styles = [hostFitContentStyles, css `
|
4
4
|
:host{
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
--mdc-radio-inner-circle-normal-background: var(--mds-color-theme-inverted-text-primary-normal);
|
10
|
-
--mdc-radio-inner-circle-disabled-background: var(--mds-color-theme-inverted-text-primary-disabled);
|
5
|
+
display: flex;
|
6
|
+
flex-direction: row;
|
7
|
+
align-items: start;
|
8
|
+
gap: 0.5rem;
|
11
9
|
|
12
|
-
--mdc-radio-
|
10
|
+
--mdc-radio-text-disabled-color: var(--mds-color-theme-text-primary-disabled);
|
13
11
|
--mdc-radio-control-inactive-hover: var(--mds-color-theme-control-inactive-hover);
|
14
12
|
--mdc-radio-control-inactive-pressed-color: var(--mds-color-theme-control-inactive-pressed);
|
15
|
-
--mdc-radio-control-inactive-disabled-background: var(--mds-color-theme-control-inactive-disabled);
|
16
|
-
|
17
|
-
--mdc-radio-control-active-color: var(--mds-color-theme-control-active-normal);
|
18
13
|
--mdc-radio-control-active-hover-color: var(--mds-color-theme-control-active-hover);
|
19
14
|
--mdc-radio-control-active-pressed-color: var(--mds-color-theme-control-active-pressed);
|
20
15
|
--mdc-radio-control-active-disabled-background: var(--mds-color-theme-control-active-disabled);
|
21
|
-
|
22
|
-
|
23
|
-
:host([readonly]) .mdc-radio__input,
|
24
|
-
:host([disabled]) .mdc-radio__input,
|
25
|
-
:host([disabled]) .mdc-label,
|
26
|
-
:host([readonly]) .mdc-label{
|
27
|
-
cursor: default;
|
28
|
-
}
|
29
|
-
|
30
|
-
.mdc-label {
|
31
|
-
cursor: pointer;
|
32
|
-
}
|
33
|
-
|
34
|
-
:host([disabled]) .mdc-radio__label-text,
|
35
|
-
:host([disabled]) .mdc-radio__help-text {
|
36
|
-
color: var(--mdc-radio-text-disabled-color);
|
37
|
-
}
|
38
|
-
|
39
|
-
:host([disabled]) .mdc-radio__icon,
|
40
|
-
:host([disabled]) .mdc-radio__container:hover .mdc-radio__icon,
|
41
|
-
:host([disabled][readonly]) .mdc-radio__icon,
|
42
|
-
:host([disabled][readonly]) .mdc-radio__container:hover .mdc-radio__icon {
|
43
|
-
border-color: var(--mdc-radio-disabled-border-color);
|
44
|
-
background: var(--mdc-radio-control-inactive-disabled-background);
|
45
|
-
}
|
46
|
-
|
47
|
-
:host([disabled][checked]) .mdc-radio__icon,
|
48
|
-
:host([disabled][checked]) .mdc-radio__container:hover .mdc-radio__icon,
|
49
|
-
:host([disabled][readonly][checked]) .mdc-radio__icon,
|
50
|
-
:host([disabled][readonly][checked]) .mdc-radio__container:hover .mdc-radio__icon {
|
51
|
-
border: var(--mdc-radio-control-active-disabled-background);
|
52
|
-
background: var(--mdc-radio-control-active-disabled-background);
|
53
|
-
}
|
54
|
-
|
55
|
-
:host([disabled][checked]) .mdc-radio__icon:after,
|
56
|
-
:host([disabled][checked]) .mdc-radio__container:hover .mdc-radio__icon:after,
|
57
|
-
:host([disabled][readonly][checked]) .mdc-radio__icon:after,
|
58
|
-
:host([disabled][readonly][checked]) .mdc-radio__container:hover .mdc-radio__icon:after {
|
59
|
-
background: var(--mdc-radio-inner-circle-disabled-background);
|
60
|
-
}
|
61
|
-
|
62
|
-
:host .mdc-radio__icon {
|
63
|
-
position: absolute;
|
64
|
-
top: 0;
|
65
|
-
left: 0;
|
66
|
-
width: 1rem;
|
67
|
-
height: 1rem;
|
68
|
-
border: 0.0625rem solid var(--mdc-radio-normal-border-color);
|
69
|
-
background-color: var(--mdc-radio-control-inactive-color);
|
70
|
-
border-radius: 50%;
|
16
|
+
--mdc-radio-control-inactive-disabled-background: var(--mds-color-theme-control-inactive-disabled);
|
17
|
+
--mdc-radio-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
|
71
18
|
}
|
72
19
|
|
73
|
-
:host([checked]) .mdc-radio__icon {
|
74
|
-
border-color: var(--mdc-radio-control-active-color);
|
75
|
-
background-color: var(--mdc-radio-control-active-color);
|
76
|
-
}
|
77
20
|
|
78
|
-
:host(
|
79
|
-
|
80
|
-
top: 50%;
|
81
|
-
left: 50%;
|
82
|
-
transform: translate(-50%, -50%);
|
83
|
-
width: var(--mdc-radio-inner-circle-size);
|
84
|
-
height: var(--mdc-radio-inner-circle-size);
|
85
|
-
border-radius: 50%;
|
86
|
-
background: var(--mdc-radio-inner-circle-normal-background);
|
21
|
+
:host(:hover)::part(radio-icon) {
|
22
|
+
background-color: var(--mdc-radio-control-inactive-hover);
|
87
23
|
}
|
88
24
|
|
89
|
-
:host
|
90
|
-
|
91
|
-
background-color: var(--mdc-radio-control-inactive-hover);
|
25
|
+
:host(:active)::part(radio-icon) {
|
26
|
+
background-color: var(--mdc-radio-control-inactive-pressed-color);
|
92
27
|
}
|
93
28
|
|
94
|
-
:host([checked]
|
29
|
+
:host([checked]:hover)::part(radio-icon) {
|
95
30
|
border-color: var(--mdc-radio-control-active-hover-color);
|
96
31
|
background-color: var(--mdc-radio-control-active-hover-color);
|
97
32
|
}
|
98
33
|
|
99
|
-
:host
|
100
|
-
border-color: var(--mdc-radio-normal-border-color);
|
101
|
-
background-color: var(--mdc-radio-control-inactive-pressed-color);
|
102
|
-
}
|
103
|
-
|
104
|
-
:host([checked]) .mdc-radio__input:active ~ .mdc-radio__icon {
|
34
|
+
:host([checked]:active)::part(radio-icon) {
|
105
35
|
border-color: var(--mdc-radio-control-active-pressed-color);
|
106
36
|
background-color: var(--mdc-radio-control-active-pressed-color);
|
107
37
|
}
|
108
38
|
|
109
|
-
:host([readonly])
|
110
|
-
|
111
|
-
|
112
|
-
background-color: var(--mdc-radio-control-inactive-color);
|
39
|
+
:host([readonly]:hover)::part(radio-icon) {
|
40
|
+
border-color: var(--mdc-staticradio-normal-border-color);
|
41
|
+
background-color: var(--mdc-staticradio-control-inactive-color);
|
113
42
|
}
|
114
43
|
|
115
|
-
:host([
|
116
|
-
|
44
|
+
:host([disabled]:hover)::part(radio-icon),
|
45
|
+
:host([disabled][readonly]:hover)::part(radio-icon) {
|
46
|
+
border-color: var(--mdc-radio-disabled-border-color);
|
47
|
+
background-color: var(--mdc-radio-control-inactive-disabled-background);
|
117
48
|
}
|
118
49
|
|
119
|
-
:host([
|
120
|
-
|
121
|
-
:host([readonly][checked]) .mdc-radio__container:active .mdc-radio__icon:after {
|
122
|
-
background-color: var(--mdc-radio-text-disabled-color);
|
50
|
+
:host([disabled][checked]:hover)::part(radio-icon){
|
51
|
+
background-color: var(--mdc-radio-control-active-disabled-background);
|
123
52
|
}
|
124
53
|
|
125
|
-
.mdc-
|
126
|
-
|
127
|
-
|
128
|
-
|
54
|
+
:host([readonly]) .mdc-radio__input,
|
55
|
+
:host([disabled]) .mdc-radio__input,
|
56
|
+
:host([disabled]) .mdc-label,
|
57
|
+
:host([readonly]) .mdc-label{
|
58
|
+
cursor: default;
|
129
59
|
}
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
width: 1rem;
|
134
|
-
height: 1rem;
|
135
|
-
margin: 0.125rem 0;
|
136
|
-
border-radius: 50%;
|
60
|
+
|
61
|
+
.mdc-label {
|
62
|
+
cursor: pointer;
|
137
63
|
}
|
138
64
|
|
139
|
-
.mdc-
|
65
|
+
:host([disabled]) .mdc-radio__label-text,
|
66
|
+
:host([disabled]) .mdc-radio__help-text {
|
67
|
+
color: var(--mdc-radio-text-disabled-color);
|
68
|
+
}
|
69
|
+
|
70
|
+
.mdc-radio__input{
|
140
71
|
position: absolute;
|
141
72
|
opacity: 0;
|
142
73
|
margin: 0;
|
@@ -145,12 +76,6 @@ const styles = [hostFitContentStyles, css `
|
|
145
76
|
cursor: pointer;
|
146
77
|
z-index: 2;
|
147
78
|
}
|
148
|
-
|
149
|
-
.mdc-radio__icon-container .mdc-radio__icon:after {
|
150
|
-
content: "";
|
151
|
-
position: absolute;
|
152
|
-
display: none;
|
153
|
-
}
|
154
79
|
|
155
80
|
.mdc-radio__label-container{
|
156
81
|
display: flex;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { CSSResult } from 'lit';
|
2
|
+
import { Component } from '../../models';
|
3
|
+
declare const StaticCheckbox_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DisabledMixin").DisabledMixinInterface> & typeof Component;
|
4
|
+
/**
|
5
|
+
* This is a decorative component that is styled to look as a checkbox.
|
6
|
+
*
|
7
|
+
* It has 3 properties - checked, indeterminate and disabled.
|
8
|
+
*
|
9
|
+
* We are using the same styling that has been created for the `mdc-checkbox` component.
|
10
|
+
*
|
11
|
+
* @tagname mdc-staticcheckbox
|
12
|
+
*
|
13
|
+
* @dependency mdc-icon
|
14
|
+
*
|
15
|
+
* @cssproperty --mdc-staticcheckbox-border-color - Border color in high contrast.
|
16
|
+
* @cssproperty --mdc-staticcheckbox-checked-background-color - Background color for a selected checkbox.
|
17
|
+
* @cssproperty --mdc-staticcheckbox-disabled-background-color - Background color for a disabled checkbox.
|
18
|
+
* @cssproperty --mdc-checkbox-disabled-border-color - Border color for a disabled checkbox.
|
19
|
+
* @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a disabled, selected checkbox.
|
20
|
+
* @cssproperty --mdc-staticcheckbox-disabled-icon-color - Icon color for a disabled checkbox.
|
21
|
+
* @cssproperty --mdc-staticcheckbox-icon-background-color - Background color for an unselected checkbox.
|
22
|
+
* @cssproperty --mdc-staticcheckbox-icon-border-color - Default background color for an unselected checkbox.
|
23
|
+
* @cssproperty --mdc-staticcheckbox-icon-color - Icon color for an unselected checkbox.
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
declare class StaticCheckbox extends StaticCheckbox_base {
|
27
|
+
/**
|
28
|
+
* Determines whether the checkbox is selected or unselected.
|
29
|
+
*
|
30
|
+
* @default false
|
31
|
+
*/
|
32
|
+
checked: boolean;
|
33
|
+
/**
|
34
|
+
* Determines whether the checkbox is in an indeterminate state.
|
35
|
+
*
|
36
|
+
* @default false
|
37
|
+
*/
|
38
|
+
indeterminate: boolean;
|
39
|
+
render(): import("lit-html").TemplateResult<1>;
|
40
|
+
static styles: Array<CSSResult>;
|
41
|
+
}
|
42
|
+
export default StaticCheckbox;
|