@momentum-design/components 0.84.3 → 0.84.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.
- package/README.md +8 -3
- package/dist/browser/index.js +2241 -2299
- package/dist/browser/index.js.map +4 -4
- package/dist/components/alertchip/alertchip.component.d.ts +1 -1
- package/dist/components/alertchip/alertchip.component.js +2 -2
- package/dist/components/alertchip/alertchip.styles.js +22 -23
- package/dist/components/alertchip/alertchip.types.d.ts +1 -1
- package/dist/components/animation/animation.component.js +1 -1
- package/dist/components/animation/animation.styles.js +8 -5
- package/dist/components/appheader/appheader.component.js +12 -13
- package/dist/components/appheader/appheader.styles.js +0 -1
- package/dist/components/avatar/avatar.component.js +3 -16
- package/dist/components/avatar/avatar.constants.d.ts +1 -1
- package/dist/components/avatar/avatar.constants.js +1 -1
- package/dist/components/avatar/avatar.styles.js +129 -122
- package/dist/components/avatar/avatar.types.d.ts +1 -1
- package/dist/components/avatar/avatar.utils.d.ts +1 -1
- package/dist/components/avatar/avatar.utils.js +1 -1
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +2 -2
- package/dist/components/avatarbutton/avatarbutton.component.js +2 -2
- package/dist/components/avatarbutton/avatarbutton.styles.js +34 -30
- package/dist/components/badge/badge.styles.js +9 -7
- package/dist/components/brandvisual/brandvisual.component.js +4 -4
- package/dist/components/bullet/bullet.component.d.ts +1 -1
- package/dist/components/bullet/bullet.component.js +2 -2
- package/dist/components/bullet/bullet.styles.js +3 -3
- package/dist/components/button/button.component.js +10 -4
- package/dist/components/button/button.utils.js +1 -1
- package/dist/components/buttongroup/buttongroup.component.js +1 -1
- package/dist/components/buttongroup/buttongroup.styles.js +68 -68
- package/dist/components/buttonlink/buttonlink.component.d.ts +5 -5
- package/dist/components/buttonlink/buttonlink.component.js +9 -9
- package/dist/components/buttonsimple/buttonsimple.component.js +2 -2
- package/dist/components/buttonsimple/buttonsimple.constants.d.ts +1 -1
- package/dist/components/buttonsimple/buttonsimple.constants.js +1 -1
- package/dist/components/buttonsimple/buttonsimple.styles.js +62 -57
- package/dist/components/card/card.component.d.ts +6 -6
- package/dist/components/card/card.component.js +15 -16
- package/dist/components/card/card.styles.js +24 -22
- package/dist/components/cardbutton/cardbutton.component.js +9 -12
- package/dist/components/cardbutton/cardbutton.styles.js +1 -1
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +6 -6
- package/dist/components/cardcheckbox/cardcheckbox.component.js +30 -29
- package/dist/components/cardcheckbox/cardcheckbox.styles.js +10 -10
- package/dist/components/cardradio/cardradio.component.d.ts +12 -12
- package/dist/components/cardradio/cardradio.component.js +27 -30
- package/dist/components/cardradio/cardradio.styles.js +8 -8
- package/dist/components/checkbox/checkbox.component.js +7 -9
- package/dist/components/checkbox/checkbox.styles.js +62 -60
- package/dist/components/chip/chip.component.d.ts +1 -1
- package/dist/components/chip/chip.component.js +6 -11
- package/dist/components/chip/chip.styles.js +4 -2
- package/dist/components/dialog/dialog.component.d.ts +7 -2
- package/dist/components/dialog/dialog.component.js +43 -33
- package/dist/components/dialog/dialog.constants.d.ts +1 -0
- package/dist/components/dialog/dialog.constants.js +1 -0
- package/dist/components/dialog/dialog.styles.js +10 -12
- package/dist/components/divider/divider.component.js +6 -8
- package/dist/components/divider/divider.constants.d.ts +1 -1
- package/dist/components/divider/divider.constants.js +1 -1
- package/dist/components/divider/divider.styles.js +5 -20
- package/dist/components/filterchip/filterchip.styles.js +4 -2
- package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -4
- package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -2
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +19 -17
- package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +2 -1
- package/dist/components/formfieldwrapper/formfieldwrapper.subcomponent.js +4 -4
- package/dist/components/icon/icon.component.js +7 -7
- package/dist/components/icon/icon.utils.d.ts +1 -1
- package/dist/components/icon/icon.utils.js +7 -7
- package/dist/components/iconprovider/iconprovider.component.js +7 -7
- package/dist/components/input/input.component.d.ts +5 -5
- package/dist/components/input/input.component.js +64 -62
- package/dist/components/input/input.styles.js +128 -117
- package/dist/components/inputchip/inputchip.component.js +14 -19
- package/dist/components/inputchip/inputchip.styles.js +5 -3
- package/dist/components/link/link.component.d.ts +1 -1
- package/dist/components/link/link.component.js +4 -8
- package/dist/components/link/link.constants.d.ts +1 -1
- package/dist/components/link/link.constants.js +1 -1
- package/dist/components/link/link.styles.js +12 -12
- package/dist/components/linksimple/linksimple.component.js +2 -4
- package/dist/components/linksimple/linksimple.styles.js +59 -57
- package/dist/components/list/list.component.js +12 -9
- package/dist/components/listitem/listitem.component.js +15 -11
- package/dist/components/listitem/listitem.styles.js +11 -6
- package/dist/components/marker/marker.component.js +1 -1
- package/dist/components/marker/marker.styles.js +2 -2
- package/dist/components/menubar/menubar.component.d.ts +19 -19
- package/dist/components/menubar/menubar.component.js +19 -19
- package/dist/components/menuitem/menuitem.component.js +15 -15
- package/dist/components/menuitem/menuitem.styles.js +3 -2
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +4 -11
- package/dist/components/menuitemradio/menuitemradio.component.js +1 -1
- package/dist/components/menupopover/menupopover.component.js +11 -11
- package/dist/components/menupopover/menupopover.utils.d.ts +1 -1
- package/dist/components/menupopover/menupopover.utils.js +3 -8
- package/dist/components/navitem/navitem.component.js +11 -19
- package/dist/components/navitem/navitem.styles.js +147 -143
- package/dist/components/navitemlist/navitemlist.component.js +2 -2
- package/dist/components/optgroup/optgroup.component.js +12 -9
- package/dist/components/option/option.component.js +11 -11
- package/dist/components/option/option.styles.js +1 -1
- package/dist/components/popover/popover.component.js +4 -4
- package/dist/components/popover/popover.stack.js +1 -1
- package/dist/components/popover/popover.styles.js +0 -1
- package/dist/components/popover/popover.utils.js +3 -4
- package/dist/components/presence/presence.component.d.ts +4 -4
- package/dist/components/presence/presence.component.js +4 -4
- package/dist/components/progressbar/progressbar.component.js +3 -4
- package/dist/components/progressbar/progressbar.styles.js +77 -71
- package/dist/components/progressspinner/progressspiner.utils.js +4 -4
- package/dist/components/progressspinner/progressspinner.component.js +38 -37
- package/dist/components/progressspinner/progressspinner.styles.js +1 -1
- package/dist/components/radio/radio.component.d.ts +41 -41
- package/dist/components/radio/radio.component.js +84 -83
- package/dist/components/radio/radio.styles.js +77 -75
- package/dist/components/radiogroup/radiogroup.component.js +1 -1
- package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +2 -2
- package/dist/components/screenreaderannouncer/screenreaderannouncer.styles.js +8 -6
- package/dist/components/searchfield/searchfield.component.js +23 -17
- package/dist/components/searchfield/searchfield.styles.js +11 -13
- package/dist/components/select/select.component.js +20 -23
- package/dist/components/select/select.styles.js +9 -9
- package/dist/components/sidenavigation/sidenavigation.component.d.ts +6 -6
- package/dist/components/sidenavigation/sidenavigation.component.js +39 -29
- package/dist/components/sidenavigation/sidenavigation.context.js +5 -5
- package/dist/components/sidenavigation/sidenavigation.styles.js +53 -53
- package/dist/components/skeleton/skeleton.component.js +1 -4
- package/dist/components/skeleton/skeleton.constants.d.ts +1 -1
- package/dist/components/skeleton/skeleton.constants.js +1 -1
- package/dist/components/skeleton/skeleton.styles.js +4 -4
- package/dist/components/spinner/spinner.component.d.ts +7 -7
- package/dist/components/spinner/spinner.component.js +9 -9
- package/dist/components/spinner/spinner.styles.js +58 -53
- package/dist/components/staticcheckbox/staticcheckbox.component.js +10 -8
- package/dist/components/staticcheckbox/staticcheckbox.styles.js +52 -51
- package/dist/components/staticradio/staticradio.component.d.ts +8 -8
- package/dist/components/staticradio/staticradio.component.js +10 -11
- package/dist/components/staticradio/staticradio.styles.js +77 -75
- package/dist/components/statictoggle/statictoggle.component.d.ts +3 -3
- package/dist/components/statictoggle/statictoggle.component.js +3 -3
- package/dist/components/statictoggle/statictoggle.styles.js +71 -68
- package/dist/components/tab/tab.component.d.ts +1 -1
- package/dist/components/tab/tab.component.js +2 -2
- package/dist/components/tab/tab.styles.js +247 -245
- package/dist/components/tablist/tablist.component.js +11 -15
- package/dist/components/tablist/tablist.styles.js +27 -25
- package/dist/components/tablist/tablist.types.d.ts +1 -1
- package/dist/components/tablist/tablist.utils.js +4 -4
- package/dist/components/text/fonts.styles.js +49 -49
- package/dist/components/text/text.component.js +21 -11
- package/dist/components/text/text.types.d.ts +1 -1
- package/dist/components/textarea/textarea.component.d.ts +31 -31
- package/dist/components/textarea/textarea.component.js +54 -61
- package/dist/components/textarea/textarea.styles.js +123 -122
- package/dist/components/themeprovider/themeprovider.component.js +1 -1
- package/dist/components/themeprovider/themeprovider.styles.js +4 -4
- package/dist/components/toggle/toggle.component.d.ts +35 -35
- package/dist/components/toggle/toggle.component.js +62 -63
- package/dist/components/toggle/toggle.styles.js +77 -69
- package/dist/components/toggletip/toggletip.component.d.ts +7 -7
- package/dist/components/toggletip/toggletip.component.js +3 -2
- package/dist/components/tooltip/tooltip.component.js +1 -1
- package/dist/components/tooltip/tooltip.styles.js +0 -1
- package/dist/components/virtualizedlist/virtualizedlist.component.js +6 -14
- package/dist/components/virtualizedlist/virtualizedlist.helper.test.d.ts +1 -1
- package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +14 -11
- package/dist/components/virtualizedlist/virtualizedlist.styles.js +4 -4
- package/dist/custom-elements.json +239 -228
- package/dist/index.js +1 -0
- package/dist/models/component/index.d.ts +1 -1
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +3 -3
- package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
- package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
- package/dist/utils/mixins/FocusTrapMixin.js +15 -12
- package/dist/utils/mixins/IconNameMixin.d.ts +1 -1
- package/dist/utils/mixins/MenuMixin.js +23 -23
- package/dist/utils/mixins/PreventScrollMixin.d.ts +1 -1
- package/dist/utils/styles/index.js +12 -12
- package/package.json +1 -1
@@ -1,66 +1,71 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { hostFitContentStyles } from '../../utils/styles';
|
3
|
-
const styles = [
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
--mdc-spinner-color: var(--mdc-spinner-inverted-color);
|
14
|
-
}
|
15
|
-
|
16
|
-
:host([size="large"]) {
|
17
|
-
--mdc-spinner-size: 6rem;
|
18
|
-
}
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host {
|
7
|
+
--mdc-spinner-default-color: var(--mds-color-theme-control-active-normal);
|
8
|
+
--mdc-spinner-inverted-color: var(--mds-color-theme-inverted-control-active-normal);
|
9
|
+
--mdc-spinner-button-variant-color: currentColor;
|
10
|
+
--mdc-spinner-color: var(--mdc-spinner-default-color);
|
11
|
+
--mdc-spinner-size: 100%;
|
12
|
+
}
|
19
13
|
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
:host([inverted]) {
|
15
|
+
--mdc-spinner-color: var(--mdc-spinner-inverted-color);
|
16
|
+
}
|
23
17
|
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
:host([size='large']) {
|
19
|
+
--mdc-spinner-size: 6rem;
|
20
|
+
}
|
27
21
|
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
:host([size='midsize']) {
|
23
|
+
--mdc-spinner-size: 3rem;
|
24
|
+
}
|
31
25
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
animation: rotate 1.5s linear infinite;
|
36
|
-
}
|
26
|
+
:host([size='small']) {
|
27
|
+
--mdc-spinner-size: 1.5rem;
|
28
|
+
}
|
37
29
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
stroke-width: 8%;
|
42
|
-
stroke-linecap: round;
|
43
|
-
animation: dash 1.5s ease-in-out infinite;
|
44
|
-
transform: rotate(-90deg);
|
45
|
-
transform-origin: center;
|
46
|
-
}
|
30
|
+
:host([variant='button']) {
|
31
|
+
--mdc-spinner-color: var(--mdc-spinner-button-variant-color);
|
32
|
+
}
|
47
33
|
|
48
|
-
|
49
|
-
|
50
|
-
|
34
|
+
:host::part(container) {
|
35
|
+
width: var(--mdc-spinner-size);
|
36
|
+
height: var(--mdc-spinner-size);
|
37
|
+
animation: rotate 1.5s linear infinite;
|
38
|
+
}
|
51
39
|
|
52
|
-
|
53
|
-
|
54
|
-
stroke
|
40
|
+
:host::part(circle) {
|
41
|
+
fill: none;
|
42
|
+
stroke: var(--mdc-spinner-color);
|
43
|
+
stroke-width: 8%;
|
44
|
+
stroke-linecap: round;
|
45
|
+
animation: dash 1.5s ease-in-out infinite;
|
46
|
+
transform: rotate(-90deg);
|
47
|
+
transform-origin: center;
|
55
48
|
}
|
56
|
-
|
57
|
-
|
58
|
-
|
49
|
+
|
50
|
+
@keyframes rotate {
|
51
|
+
100% {
|
52
|
+
transform: rotate(360deg);
|
53
|
+
}
|
59
54
|
}
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
|
56
|
+
@keyframes dash {
|
57
|
+
0% {
|
58
|
+
stroke-dasharray: 1, 470;
|
59
|
+
}
|
60
|
+
50% {
|
61
|
+
stroke-dasharray: 209, 470;
|
62
|
+
stroke-dashoffset: -83;
|
63
|
+
}
|
64
|
+
100% {
|
65
|
+
stroke-dasharray: 209, 470;
|
66
|
+
stroke-dashoffset: -292;
|
67
|
+
}
|
63
68
|
}
|
64
|
-
|
65
|
-
|
69
|
+
`,
|
70
|
+
];
|
66
71
|
export default styles;
|
@@ -52,14 +52,16 @@ class StaticCheckbox extends DisabledMixin(Component) {
|
|
52
52
|
this.indeterminate = false;
|
53
53
|
}
|
54
54
|
render() {
|
55
|
-
const checkboxIconContent =
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
const checkboxIconContent = this.checked || this.indeterminate
|
56
|
+
? html `
|
57
|
+
<mdc-icon
|
58
|
+
class="icon"
|
59
|
+
name="${this.indeterminate ? ICON_NAME.INDETERMINATE : ICON_NAME.CHECKED}"
|
60
|
+
size="1"
|
61
|
+
length-unit="rem"
|
62
|
+
></mdc-icon>
|
63
|
+
`
|
64
|
+
: nothing;
|
63
65
|
return html `<slot></slot>
|
64
66
|
<div part="icon-container">${checkboxIconContent}</div>`;
|
65
67
|
}
|
@@ -1,60 +1,61 @@
|
|
1
1
|
import { css } from 'lit';
|
2
|
-
const styles = [
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
2
|
+
const styles = [
|
3
|
+
css `
|
4
|
+
:host {
|
5
|
+
margin: 0.125rem 0;
|
6
|
+
border-radius: 0.125rem;
|
7
|
+
--mdc-staticcheckbox-border-color: var(--mds-color-theme-outline-button-normal);
|
8
|
+
--mdc-staticcheckbox-checked-background-color: var(--mds-color-theme-control-active-normal);
|
9
|
+
--mdc-staticcheckbox-disabled-background-color: var(--mds-color-theme-control-inactive-disabled);
|
10
|
+
--mdc-staticcheckbox-disabled-icon-color: var(--mds-color-theme-text-primary-disabled);
|
11
|
+
--mdc-staticcheckbox-icon-background-color: var(--mds-color-theme-control-inactive-normal);
|
12
|
+
--mdc-staticcheckbox-icon-border-color: var(--mds-color-theme-outline-input-normal);
|
13
|
+
--mdc-staticcheckbox-icon-color: var(--mds-color-theme-inverted-text-primary-normal);
|
14
|
+
--mdc-staticcheckbox-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
|
15
|
+
--mdc-staticcheckbox-disabled-checked-icon-color: var(--mds-color-theme-control-active-disabled);
|
16
|
+
}
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
:host([checked])::part(icon-container),
|
19
|
+
:host([indeterminate])::part(icon-container) {
|
20
|
+
background: var(--mdc-staticcheckbox-checked-background-color);
|
21
|
+
border-color: transparent;
|
22
|
+
}
|
23
|
+
|
24
|
+
:host([disabled])::part(icon-container) {
|
25
|
+
border-color: var(--mdc-staticcheckbox-disabled-border-color);
|
26
|
+
background: var(--mdc-staticcheckbox-disabled-background-color);
|
27
|
+
}
|
22
28
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
29
|
+
:host([disabled][checked])::part(icon-container),
|
30
|
+
:host([disabled][indeterminate])::part(icon-container) {
|
31
|
+
background: var(--mdc-staticcheckbox-disabled-checked-icon-color);
|
32
|
+
border: 0.0625rem solid var(--mdc-staticcheckbox-disabled-border-color);
|
33
|
+
}
|
27
34
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
border: 0.0625rem solid var(--mdc-staticcheckbox-icon-border-color);
|
38
|
-
background: var(--mdc-staticcheckbox-icon-background-color);
|
39
|
-
width: 1rem;
|
40
|
-
height: 1rem;
|
41
|
-
border-radius: 0.125rem;
|
42
|
-
}
|
35
|
+
:host::part(icon-container) {
|
36
|
+
display: flex;
|
37
|
+
align-items: center;
|
38
|
+
border: 0.0625rem solid var(--mdc-staticcheckbox-icon-border-color);
|
39
|
+
background: var(--mdc-staticcheckbox-icon-background-color);
|
40
|
+
width: 1rem;
|
41
|
+
height: 1rem;
|
42
|
+
border-radius: 0.125rem;
|
43
|
+
}
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
.icon {
|
46
|
+
--mdc-icon-fill-color: var(--mdc-staticcheckbox-icon-color);
|
47
|
+
}
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
:host([disabled]) .icon {
|
50
|
+
--mdc-icon-fill-color: var(--mdc-staticcheckbox-disabled-icon-color);
|
51
|
+
}
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
/* High Contrast Mode */
|
54
|
+
@media (forced-colors: active) {
|
55
|
+
:host([checked])::part(icon-container) :host([indeterminate])::part(icon-container) {
|
56
|
+
border: 0.0625rem solid var(--mdc-staticcheckbox-border-color);
|
57
|
+
}
|
57
58
|
}
|
58
|
-
|
59
|
-
|
59
|
+
`,
|
60
|
+
];
|
60
61
|
export default styles;
|
@@ -24,16 +24,16 @@ declare const StaticRadio_base: import("../../utils/mixins/index.types").Constru
|
|
24
24
|
*/
|
25
25
|
declare class StaticRadio extends StaticRadio_base {
|
26
26
|
/**
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
* Determines whether the radio is selected or unselected.
|
28
|
+
*
|
29
|
+
* @default false
|
30
|
+
*/
|
31
31
|
checked: boolean;
|
32
32
|
/**
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
* Determines whether the radio is read-only.
|
34
|
+
*
|
35
|
+
* @default false
|
36
|
+
*/
|
37
37
|
readonly: boolean;
|
38
38
|
render(): import("lit-html").TemplateResult<1>;
|
39
39
|
static styles: Array<CSSResult>;
|
@@ -10,8 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
import { html } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
12
|
import { Component } from '../../models';
|
13
|
-
import styles from './staticradio.styles';
|
14
13
|
import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
14
|
+
import styles from './staticradio.styles';
|
15
15
|
/**
|
16
16
|
* This is a decorative component that is styled to look as a radio.
|
17
17
|
* It has 2 properties - checked and disabled.
|
@@ -37,21 +37,20 @@ class StaticRadio extends DisabledMixin(Component) {
|
|
37
37
|
constructor() {
|
38
38
|
super(...arguments);
|
39
39
|
/**
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
* Determines whether the radio is selected or unselected.
|
41
|
+
*
|
42
|
+
* @default false
|
43
|
+
*/
|
44
44
|
this.checked = false;
|
45
45
|
/**
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
* Determines whether the radio is read-only.
|
47
|
+
*
|
48
|
+
* @default false
|
49
|
+
*/
|
50
50
|
this.readonly = false;
|
51
51
|
}
|
52
52
|
render() {
|
53
|
-
return html `
|
54
|
-
<slot></slot>
|
53
|
+
return html ` <slot></slot>
|
55
54
|
<span part="radio-icon" class="icon"></span>`;
|
56
55
|
}
|
57
56
|
}
|
@@ -1,86 +1,88 @@
|
|
1
1
|
import { css } from 'lit';
|
2
|
-
const styles = [
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
const styles = [
|
3
|
+
css `
|
4
|
+
:host {
|
5
|
+
display: block;
|
6
|
+
position: relative;
|
7
|
+
width: 1rem;
|
8
|
+
height: 1rem;
|
9
|
+
margin: 0.125rem 0;
|
10
|
+
border-radius: 50%;
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
.icon:after {
|
24
|
-
content: "";
|
25
|
-
position: absolute;
|
26
|
-
display: none;
|
27
|
-
}
|
12
|
+
--mdc-staticradio-inner-circle-size: 0.375rem;
|
13
|
+
--mdc-staticradio-text-disabled-color: var(--mds-color-theme-text-primary-disabled);
|
14
|
+
--mdc-staticradio-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
|
15
|
+
--mdc-staticradio-normal-border-color: var(--mds-color-theme-outline-input-normal);
|
16
|
+
--mdc-staticradio-inner-circle-normal-background: var(--mds-color-theme-inverted-text-primary-normal);
|
17
|
+
--mdc-staticradio-inner-circle-disabled-background: var(--mds-color-theme-inverted-text-primary-disabled);
|
18
|
+
--mdc-staticradio-control-inactive-color: var(--mds-color-theme-control-inactive-normal);
|
19
|
+
--mdc-staticradio-control-inactive-disabled-background: var(--mds-color-theme-control-inactive-disabled);
|
20
|
+
--mdc-staticradio-control-active-color: var(--mds-color-theme-control-active-normal);
|
21
|
+
--mdc-staticradio-control-active-disabled-background: var(--mds-color-theme-control-active-disabled);
|
22
|
+
}
|
28
23
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
.icon:after {
|
25
|
+
content: '';
|
26
|
+
position: absolute;
|
27
|
+
display: none;
|
28
|
+
}
|
34
29
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
30
|
+
:host([disabled]) .icon,
|
31
|
+
:host([disabled][readonly]) .icon {
|
32
|
+
border-color: var(--mdc-staticradio-disabled-border-color);
|
33
|
+
background: var(--mdc-staticradio-control-inactive-disabled-background);
|
34
|
+
}
|
40
35
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
:host([disabled][checked]) .icon,
|
37
|
+
:host([disabled][readonly][checked]) .icon {
|
38
|
+
border: var(--mdc-staticradio-control-active-disabled-background);
|
39
|
+
background: var(--mdc-staticradio-control-active-disabled-background);
|
40
|
+
}
|
45
41
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
width: 1rem;
|
51
|
-
height: 1rem;
|
52
|
-
border: 0.0625rem solid var(--mdc-staticradio-normal-border-color);
|
53
|
-
background-color: var(--mdc-staticradio-control-inactive-color);
|
54
|
-
border-radius: 50%;
|
55
|
-
}
|
42
|
+
:host([disabled][checked]) .icon:after,
|
43
|
+
:host([disabled][readonly][checked]) .icon:after {
|
44
|
+
background: var(--mdc-staticradio-inner-circle-disabled-background);
|
45
|
+
}
|
56
46
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
47
|
+
.icon {
|
48
|
+
position: absolute;
|
49
|
+
top: 0;
|
50
|
+
left: 0;
|
51
|
+
width: 1rem;
|
52
|
+
height: 1rem;
|
53
|
+
border: 0.0625rem solid var(--mdc-staticradio-normal-border-color);
|
54
|
+
background-color: var(--mdc-staticradio-control-inactive-color);
|
55
|
+
border-radius: 50%;
|
56
|
+
}
|
61
57
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
transform: translate(-50%, -50%);
|
67
|
-
width: var(--mdc-staticradio-inner-circle-size);
|
68
|
-
height: var(--mdc-staticradio-inner-circle-size);
|
69
|
-
border-radius: 50%;
|
70
|
-
background: var(--mdc-staticradio-inner-circle-normal-background);
|
71
|
-
}
|
58
|
+
:host([checked]) .icon {
|
59
|
+
border-color: var(--mdc-staticradio-control-active-color);
|
60
|
+
background-color: var(--mdc-staticradio-control-active-color);
|
61
|
+
}
|
72
62
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
63
|
+
:host([checked]) .icon:after {
|
64
|
+
display: block;
|
65
|
+
top: 50%;
|
66
|
+
left: 50%;
|
67
|
+
transform: translate(-50%, -50%);
|
68
|
+
width: var(--mdc-staticradio-inner-circle-size);
|
69
|
+
height: var(--mdc-staticradio-inner-circle-size);
|
70
|
+
border-radius: 50%;
|
71
|
+
background: var(--mdc-staticradio-inner-circle-normal-background);
|
72
|
+
}
|
77
73
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
74
|
+
:host([readonly]) .icon {
|
75
|
+
border-color: var(--mdc-staticradio-normal-border-color);
|
76
|
+
background-color: var(--mdc-staticradio-control-inactive-color);
|
77
|
+
}
|
78
|
+
|
79
|
+
:host([readonly][checked]) .icon {
|
80
|
+
border-color: var(--mdc-staticradio-normal-border-color);
|
81
|
+
}
|
82
|
+
|
83
|
+
:host([readonly][checked]) .icon:after {
|
84
|
+
background-color: var(--mdc-staticradio-text-disabled-color);
|
85
|
+
}
|
86
|
+
`,
|
87
|
+
];
|
86
88
|
export default styles;
|
@@ -31,9 +31,9 @@ declare const StaticToggle_base: import("../../utils/mixins/index.types").Constr
|
|
31
31
|
*/
|
32
32
|
declare class StaticToggle extends StaticToggle_base {
|
33
33
|
/**
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
* Determines whether the toggle is active or inactive.
|
35
|
+
* @default false
|
36
|
+
*/
|
37
37
|
checked: boolean;
|
38
38
|
/**
|
39
39
|
* Determines toggle size in rem (height is specified here).
|
@@ -44,9 +44,9 @@ class StaticToggle extends DisabledMixin(Component) {
|
|
44
44
|
constructor() {
|
45
45
|
super(...arguments);
|
46
46
|
/**
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
* Determines whether the toggle is active or inactive.
|
48
|
+
* @default false
|
49
|
+
*/
|
50
50
|
this.checked = false;
|
51
51
|
/**
|
52
52
|
* Determines toggle size in rem (height is specified here).
|