@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
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
|
-
import styles from './inputchip.styles';
|
13
12
|
import { Component } from '../../models';
|
14
13
|
import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
15
14
|
import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
|
15
|
+
import styles from './inputchip.styles';
|
16
16
|
import { DEFAULTS } from './inputchip.constants';
|
17
17
|
/**
|
18
18
|
* mdc-inputchip component is an interactive chip that consumers can use to represent an input.
|
@@ -62,12 +62,7 @@ class InputChip extends IconNameMixin(DisabledMixin(Component)) {
|
|
62
62
|
renderIcon() {
|
63
63
|
if (!this.iconName)
|
64
64
|
return nothing;
|
65
|
-
return html `
|
66
|
-
<mdc-icon
|
67
|
-
name="${this.iconName}"
|
68
|
-
length-unit="rem"
|
69
|
-
size="1"></mdc-icon>
|
70
|
-
`;
|
65
|
+
return html ` <mdc-icon name="${this.iconName}" length-unit="rem" size="1"></mdc-icon> `;
|
71
66
|
}
|
72
67
|
/**
|
73
68
|
* Handles the behavior of the close button on click event.
|
@@ -78,18 +73,18 @@ class InputChip extends IconNameMixin(DisabledMixin(Component)) {
|
|
78
73
|
}
|
79
74
|
render() {
|
80
75
|
return html `
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
76
|
+
${this.renderIcon()}
|
77
|
+
<mdc-text part="label" type="${DEFAULTS.TEXT_TYPE}" tagname="${DEFAULTS.TAG_NAME}">${this.label}</mdc-text>
|
78
|
+
<mdc-button
|
79
|
+
?disabled="${this.disabled}"
|
80
|
+
variant="tertiary"
|
81
|
+
part="close-icon"
|
82
|
+
aria-label="${this.clearAriaLabel}"
|
83
|
+
prefix-icon="${DEFAULTS.CLOSE_ICON}"
|
84
|
+
size="20"
|
85
|
+
@click="${this.handleClose}"
|
86
|
+
></mdc-button>
|
87
|
+
`;
|
93
88
|
}
|
94
89
|
}
|
95
90
|
InputChip.styles = [...Component.styles, ...styles];
|
@@ -17,13 +17,15 @@ const styles = css `
|
|
17
17
|
border-color: var(--mdc-chip-border-color);
|
18
18
|
background-color: var(--mdc-chip-background-color);
|
19
19
|
}
|
20
|
-
|
21
|
-
:host([error]){
|
20
|
+
|
21
|
+
:host([error]) {
|
22
22
|
--mdc-chip-border-color: var(--mds-color-theme-outline-cancel-normal);
|
23
23
|
--mdc-chip-background-color: var(--mds-color-theme-background-label-error-normal);
|
24
24
|
}
|
25
25
|
|
26
|
-
:host([disabled]),
|
26
|
+
:host([disabled]),
|
27
|
+
:host([disabled]:hover),
|
28
|
+
:host([disabled]:active) {
|
27
29
|
--mdc-chip-border-color: var(--mds-color-theme-common-outline-primary-disabled);
|
28
30
|
--mdc-chip-background-color: var(--mds-color-theme-background-primary-disabled);
|
29
31
|
--mdc-chip-color: var(--mds-color-theme-text-primary-disabled);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CSSResult } from 'lit';
|
2
|
-
import type { LinkSize } from './link.types';
|
3
2
|
import Linksimple from '../linksimple/linksimple.component';
|
3
|
+
import type { LinkSize } from './link.types';
|
4
4
|
declare const Link_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/IconNameMixin").IconNameMixinInterface> & typeof Linksimple;
|
5
5
|
/**
|
6
6
|
* `mdc-link` component can be used to navigate to a different page
|
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
12
|
import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
|
13
|
+
import Linksimple from '../linksimple/linksimple.component';
|
13
14
|
import { DEFAULTS, LINK_ICON_SIZES, LINK_SIZES } from './link.constants';
|
14
15
|
import styles from './link.styles';
|
15
|
-
import Linksimple from '../linksimple/linksimple.component';
|
16
16
|
/**
|
17
17
|
* `mdc-link` component can be used to navigate to a different page
|
18
18
|
* within the application or to an external site. It can be used to link to
|
@@ -63,13 +63,9 @@ class Link extends IconNameMixin(Linksimple) {
|
|
63
63
|
render() {
|
64
64
|
return html `
|
65
65
|
<slot></slot>
|
66
|
-
${this.iconName
|
67
|
-
|
68
|
-
|
69
|
-
size=${this.getIconSize()}
|
70
|
-
length-unit="rem"
|
71
|
-
></mdc-icon>
|
72
|
-
` : nothing}
|
66
|
+
${this.iconName
|
67
|
+
? html ` <mdc-icon name=${this.iconName} size=${this.getIconSize()} length-unit="rem"></mdc-icon> `
|
68
|
+
: nothing}
|
73
69
|
`;
|
74
70
|
}
|
75
71
|
}
|
@@ -4,7 +4,7 @@ const styles = css `
|
|
4
4
|
gap: 0.25rem;
|
5
5
|
}
|
6
6
|
|
7
|
-
:host([size=
|
7
|
+
:host([size='large']) {
|
8
8
|
font-size: var(--mds-font-apps-body-large-regular-font-size);
|
9
9
|
font-weight: var(--mds-font-apps-body-large-regular-font-weight);
|
10
10
|
line-height: var(--mds-font-apps-body-large-regular-line-height);
|
@@ -12,7 +12,7 @@ const styles = css `
|
|
12
12
|
text-transform: var(--mds-font-apps-body-large-regular-text-case);
|
13
13
|
}
|
14
14
|
|
15
|
-
:host([size=
|
15
|
+
:host([size='midsize']) {
|
16
16
|
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
17
17
|
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
18
18
|
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
@@ -20,7 +20,7 @@ const styles = css `
|
|
20
20
|
text-transform: var(--mds-font-apps-body-midsize-regular-text-case);
|
21
21
|
}
|
22
22
|
|
23
|
-
:host([size=
|
23
|
+
:host([size='small']) {
|
24
24
|
font-size: var(--mds-font-apps-body-small-regular-font-size);
|
25
25
|
font-weight: var(--mds-font-apps-body-small-regular-font-weight);
|
26
26
|
line-height: var(--mds-font-apps-body-small-regular-line-height);
|
@@ -28,9 +28,9 @@ const styles = css `
|
|
28
28
|
text-transform: var(--mds-font-apps-body-small-regular-text-case);
|
29
29
|
}
|
30
30
|
|
31
|
-
:host([size=
|
32
|
-
:host([size=
|
33
|
-
:host([size=
|
31
|
+
:host([size='large']:hover),
|
32
|
+
:host([size='large']:active),
|
33
|
+
:host([size='large'][inline]) {
|
34
34
|
font-size: var(--mds-font-apps-body-large-regular-underline-font-size);
|
35
35
|
font-weight: var(--mds-font-apps-body-large-regular-underline-font-weight);
|
36
36
|
line-height: var(--mds-font-apps-body-large-regular-underline-line-height);
|
@@ -38,9 +38,9 @@ const styles = css `
|
|
38
38
|
text-transform: var(--mds-font-apps-body-large-regular-underline-text-case);
|
39
39
|
}
|
40
40
|
|
41
|
-
:host([size=
|
42
|
-
:host([size=
|
43
|
-
:host([size=
|
41
|
+
:host([size='midsize']:hover),
|
42
|
+
:host([size='midsize']:active),
|
43
|
+
:host([size='midsize'][inline]) {
|
44
44
|
font-size: var(--mds-font-apps-body-midsize-regular-underline-font-size);
|
45
45
|
font-weight: var(--mds-font-apps-body-midsize-regular-underline-font-weight);
|
46
46
|
line-height: var(--mds-font-apps-body-midsize-regular-underline-line-height);
|
@@ -48,9 +48,9 @@ const styles = css `
|
|
48
48
|
text-transform: var(--mds-font-apps-body-midsize-regular-underline-text-case);
|
49
49
|
}
|
50
50
|
|
51
|
-
:host([size=
|
52
|
-
:host([size=
|
53
|
-
:host([size=
|
51
|
+
:host([size='small']:hover),
|
52
|
+
:host([size='small']:active),
|
53
|
+
:host([size='small'][inline]) {
|
54
54
|
font-size: var(--mds-font-apps-body-small-regular-underline-font-size);
|
55
55
|
font-weight: var(--mds-font-apps-body-small-regular-underline-font-weight);
|
56
56
|
line-height: var(--mds-font-apps-body-small-regular-underline-line-height);
|
@@ -11,9 +11,9 @@ import { html } from 'lit';
|
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
12
|
import { Component } from '../../models';
|
13
13
|
import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
14
|
+
import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
|
14
15
|
import { DEFAULTS } from './linksimple.constants';
|
15
16
|
import styles from './linksimple.styles';
|
16
|
-
import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
|
17
17
|
/**
|
18
18
|
* `mdc-linksimple` is a lightweight link component that can be used to navigate
|
19
19
|
* within the application or to an external URL. It does not have any predefined default size.
|
@@ -112,9 +112,7 @@ class Linksimple extends DisabledMixin(TabIndexMixin(Component)) {
|
|
112
112
|
}
|
113
113
|
}
|
114
114
|
render() {
|
115
|
-
return html `
|
116
|
-
<slot></slot>
|
117
|
-
`;
|
115
|
+
return html ` <slot></slot> `;
|
118
116
|
}
|
119
117
|
}
|
120
118
|
Linksimple.styles = [...Component.styles, ...styles];
|
@@ -1,72 +1,74 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
|
3
|
-
const styles = [
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host {
|
7
|
+
--mdc-link-border-radius: 0.25rem;
|
8
|
+
--mdc-link-color-active: var(--mds-color-theme-text-accent-active);
|
9
|
+
--mdc-link-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
10
|
+
--mdc-link-color-hover: var(--mds-color-theme-text-accent-hover);
|
11
|
+
--mdc-link-color-normal: var(--mds-color-theme-text-accent-normal);
|
12
|
+
--mdc-link-inverted-color-active: var(--mds-color-theme-inverted-text-accent-active);
|
13
|
+
--mdc-link-inverted-color-disabled: var(--mds-color-theme-inverted-text-primary-disabled);
|
14
|
+
--mdc-link-inverted-color-hover: var(--mds-color-theme-inverted-text-accent-hover);
|
15
|
+
--mdc-link-inverted-color-normal: var(--mds-color-theme-inverted-text-accent-normal);
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
/* based on default linksimple size (large) */
|
22
|
-
line-height: var(--mds-font-apps-body-large-regular-line-height);
|
23
|
-
}
|
17
|
+
border-radius: var(--mdc-link-border-radius);
|
18
|
+
color: var(--mdc-link-color-normal);
|
19
|
+
text-underline-offset: auto;
|
20
|
+
text-underline-position: from-font;
|
21
|
+
cursor: pointer;
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
/* based on default linksimple size (large) */
|
24
|
+
line-height: var(--mds-font-apps-body-large-regular-line-height);
|
25
|
+
}
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
:host([inline]) {
|
28
|
+
display: inline-flex;
|
29
|
+
}
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
:host([inverted]) {
|
32
|
+
color: var(--mdc-link-inverted-color-normal);
|
33
|
+
}
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
35
|
+
:host(:hover) {
|
36
|
+
color: var(--mdc-link-color-hover);
|
37
|
+
}
|
41
38
|
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
:host(:active) {
|
40
|
+
color: var(--mdc-link-color-active);
|
41
|
+
box-shadow: none;
|
42
|
+
}
|
45
43
|
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
:host([inverted]:hover) {
|
45
|
+
color: var(--mdc-link-inverted-color-hover);
|
46
|
+
}
|
49
47
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}
|
48
|
+
:host([inverted]:active) {
|
49
|
+
color: var(--mdc-link-inverted-color-active);
|
50
|
+
}
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
:host([disabled]) {
|
53
|
+
color: var(--mdc-link-color-disabled);
|
54
|
+
pointer-events: none;
|
55
|
+
}
|
58
56
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
:host([inline]) {
|
63
|
-
font-size: var(--mds-font-apps-body-large-regular-underline-font-size);
|
64
|
-
font-weight: var(--mds-font-apps-body-large-regular-underline-font-weight);
|
65
|
-
line-height: var(--mds-font-apps-body-large-regular-underline-line-height);
|
66
|
-
text-decoration: var(--mds-font-apps-body-large-regular-underline-text-decoration);
|
67
|
-
text-transform: var(--mds-font-apps-body-large-regular-underline-text-case);
|
68
|
-
}
|
57
|
+
:host([inverted][disabled]) {
|
58
|
+
color: var(--mdc-link-inverted-color-disabled);
|
59
|
+
}
|
69
60
|
|
70
|
-
|
61
|
+
/* based on default linksimple size (large) */
|
62
|
+
:host(:hover),
|
63
|
+
:host(:active),
|
64
|
+
:host([inline]) {
|
65
|
+
font-size: var(--mds-font-apps-body-large-regular-underline-font-size);
|
66
|
+
font-weight: var(--mds-font-apps-body-large-regular-underline-font-weight);
|
67
|
+
line-height: var(--mds-font-apps-body-large-regular-underline-line-height);
|
68
|
+
text-decoration: var(--mds-font-apps-body-large-regular-underline-text-decoration);
|
69
|
+
text-transform: var(--mds-font-apps-body-large-regular-underline-text-case);
|
70
|
+
}
|
71
|
+
`,
|
72
|
+
...hostFocusRingStyles(),
|
71
73
|
];
|
72
74
|
export default styles;
|
@@ -57,7 +57,7 @@ class List extends DataAriaLabelMixin(Component) {
|
|
57
57
|
* @returns The index of the target element in the listItems array.
|
58
58
|
*/
|
59
59
|
getCurrentIndex(target) {
|
60
|
-
return this.listItems.findIndex(
|
60
|
+
return this.listItems.findIndex(node => node === target || node === target.parentElement);
|
61
61
|
}
|
62
62
|
/**
|
63
63
|
* Calculates a new index based on the pressed keyboard key.
|
@@ -110,14 +110,17 @@ class List extends DataAriaLabelMixin(Component) {
|
|
110
110
|
}
|
111
111
|
render() {
|
112
112
|
var _a;
|
113
|
-
const headerText = this.headerText
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
113
|
+
const headerText = this.headerText
|
114
|
+
? html `
|
115
|
+
<mdc-text
|
116
|
+
id="${HEADER_ID}"
|
117
|
+
part="header-text"
|
118
|
+
type="${TYPE.BODY_MIDSIZE_BOLD}"
|
119
|
+
tagname="${VALID_TEXT_TAGS.SPAN}"
|
120
|
+
>${this.headerText}</mdc-text
|
121
|
+
>
|
122
|
+
`
|
123
|
+
: nothing;
|
121
124
|
return html `
|
122
125
|
<div
|
123
126
|
role="${this.dataRole}"
|
@@ -184,7 +184,7 @@ class ListItem extends DisabledMixin(TabIndexMixin(Component)) {
|
|
184
184
|
* @param disabled - Whether to disable or enable the controls.
|
185
185
|
*/
|
186
186
|
disableSlottedChildren(disabled) {
|
187
|
-
[...this.leadingControlsSlot, ...this.trailingControlsSlot].forEach(
|
187
|
+
[...this.leadingControlsSlot, ...this.trailingControlsSlot].forEach(element => {
|
188
188
|
if (disabled) {
|
189
189
|
element.setAttribute('disabled', '');
|
190
190
|
}
|
@@ -206,20 +206,24 @@ class ListItem extends DisabledMixin(TabIndexMixin(Component)) {
|
|
206
206
|
* @returns A template for the trailing controls slot.
|
207
207
|
*/
|
208
208
|
renderTrailingControls() {
|
209
|
-
return html `<slot
|
210
|
-
|
211
|
-
|
212
|
-
|
209
|
+
return html `<slot
|
210
|
+
name="trailing-controls"
|
211
|
+
@click=${this.stopEventPropagation}
|
212
|
+
@keyup=${this.stopEventPropagation}
|
213
|
+
@keydown=${this.stopEventPropagation}
|
214
|
+
></slot>`;
|
213
215
|
}
|
214
216
|
/**
|
215
217
|
* Renders the leading controls slot.
|
216
218
|
* @returns A template for the leading controls slot.
|
217
219
|
*/
|
218
220
|
renderLeadingControls() {
|
219
|
-
return html `<slot
|
220
|
-
|
221
|
-
|
222
|
-
|
221
|
+
return html `<slot
|
222
|
+
name="leading-controls"
|
223
|
+
@click=${this.stopEventPropagation}
|
224
|
+
@keyup=${this.stopEventPropagation}
|
225
|
+
@keydown=${this.stopEventPropagation}
|
226
|
+
></slot>`;
|
223
227
|
}
|
224
228
|
/**
|
225
229
|
* Stops the click event from propagating to parent elements. In case of keyboard events,
|
@@ -229,8 +233,8 @@ class ListItem extends DisabledMixin(TabIndexMixin(Component)) {
|
|
229
233
|
* @param event - The mouse event triggered when a click occurs.
|
230
234
|
*/
|
231
235
|
stopEventPropagation(event) {
|
232
|
-
if ((event instanceof KeyboardEvent && (event.key === KEYS.ENTER || event.key === KEYS.SPACE))
|
233
|
-
|
236
|
+
if ((event instanceof KeyboardEvent && (event.key === KEYS.ENTER || event.key === KEYS.SPACE)) ||
|
237
|
+
event instanceof MouseEvent) {
|
234
238
|
event.stopPropagation();
|
235
239
|
}
|
236
240
|
}
|
@@ -20,10 +20,10 @@ const styles = css `
|
|
20
20
|
padding: 0.5rem var(--mdc-listitem-padding-left-and-right);
|
21
21
|
width: 100%;
|
22
22
|
}
|
23
|
-
:host([variant=
|
23
|
+
:host([variant='inset-rectangle']) {
|
24
24
|
border-radius: 0.5rem;
|
25
25
|
}
|
26
|
-
:host([variant=
|
26
|
+
:host([variant='inset-pill']) {
|
27
27
|
border-radius: 3.125rem;
|
28
28
|
}
|
29
29
|
:host::part(leading-text) {
|
@@ -58,7 +58,8 @@ const styles = css `
|
|
58
58
|
:host(:active) {
|
59
59
|
background-color: var(--mdc-listitem-background-color-active);
|
60
60
|
}
|
61
|
-
:host::part(leading),
|
61
|
+
:host::part(leading),
|
62
|
+
:host::part(trailing) {
|
62
63
|
align-items: center;
|
63
64
|
column-gap: var(--mdc-listitem-column-gap);
|
64
65
|
display: flex;
|
@@ -67,16 +68,20 @@ const styles = css `
|
|
67
68
|
:host::part(trailing) {
|
68
69
|
justify-content: flex-end;
|
69
70
|
}
|
70
|
-
:host::part(leading-text-secondary-label),
|
71
|
+
:host::part(leading-text-secondary-label),
|
72
|
+
:host::part(leading-text-tertiary-label) {
|
71
73
|
color: var(--mdc-listitem-secondary-label-color);
|
72
74
|
}
|
73
|
-
:host::part(leading-text-primary-label),
|
75
|
+
:host::part(leading-text-primary-label),
|
76
|
+
:host::part(trailing-text-side-header),
|
77
|
+
:host::part(trailing-text-subline) {
|
74
78
|
color: var(--mdc-listitem-primary-label-color);
|
75
79
|
}
|
76
80
|
:host::part(trailing-text) {
|
77
81
|
text-align: right;
|
78
82
|
}
|
79
|
-
::slotted([slot=
|
83
|
+
::slotted([slot='leading-controls']),
|
84
|
+
::slotted([slot='trailing-controls']) {
|
80
85
|
align-items: center;
|
81
86
|
column-gap: var(--mdc-listitem-column-gap);
|
82
87
|
display: flex;
|
@@ -8,8 +8,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
10
|
import { property } from 'lit/decorators.js';
|
11
|
-
import styles from './marker.styles';
|
12
11
|
import { Component } from '../../models';
|
12
|
+
import styles from './marker.styles';
|
13
13
|
import { MARKER_VARIANTS } from './marker.constants';
|
14
14
|
/**
|
15
15
|
* `mdc-marker`, which is a vertical line and
|
@@ -4,7 +4,7 @@ const styles = css `
|
|
4
4
|
--mdc-marker-width: 0.25rem;
|
5
5
|
--mdc-marker-solid-background-color: var(--mds-color-theme-outline-secondary-normal);
|
6
6
|
--mdc-marker-striped-color: var(--mds-color-theme-outline-secondary-normal);
|
7
|
-
--mdc-marker-striped-background-color: transparent;
|
7
|
+
--mdc-marker-striped-background-color: transparent;
|
8
8
|
|
9
9
|
width: var(--mdc-marker-width);
|
10
10
|
height: 100%;
|
@@ -20,7 +20,7 @@ const styles = css `
|
|
20
20
|
135deg,
|
21
21
|
var(--mdc-marker-striped-color),
|
22
22
|
var(--mdc-marker-striped-color) 0.1875rem,
|
23
|
-
var(--mdc-marker-striped-background-color) 0.1875rem,
|
23
|
+
var(--mdc-marker-striped-background-color) 0.1875rem,
|
24
24
|
var(--mdc-marker-striped-background-color) 0.375rem
|
25
25
|
);
|
26
26
|
}
|
@@ -2,25 +2,25 @@ import type { CSSResult, PropertyValues } from 'lit';
|
|
2
2
|
import { Component } from '../../models';
|
3
3
|
declare const MenuBar_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/MenuMixin").MenuMixinInterface> & typeof Component;
|
4
4
|
/**
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
5
|
+
* Menubar is a navigational menu component that provides a horizontal (default) or vertical fixed list of menu items,
|
6
|
+
* with support for nested submenus and keyboard navigation. It serves as a container
|
7
|
+
* for menu items and manages their interaction patterns, including:
|
8
|
+
* - Keyboard navigation (arrow keys, Home, End)
|
9
|
+
* - Menu item activation (Enter/Space)
|
10
|
+
* - Submenu toggling (Right/Left arrow keys)
|
11
|
+
* - Focus management
|
12
|
+
* - Support for both horizontal and vertical orientations
|
13
|
+
* - Integration with MenuPopover for nested menus
|
14
|
+
*
|
15
|
+
* A menubar will contain a set of menu items and their associated popovers.
|
16
|
+
* Each menu item can have a popover for nested menus.
|
17
|
+
*
|
18
|
+
* The component automatically handles ARIA attributes and follows WAI-ARIA menu design patterns.
|
19
|
+
* It works in conjunction with `mdc-menuitem` and `mdc-menupopover` to create accessible menu structures.
|
20
|
+
*
|
21
|
+
* @tagname mdc-menubar
|
22
|
+
* @slot default - Contains the menu items and their associated popovers
|
23
|
+
*/
|
24
24
|
declare class MenuBar extends MenuBar_base {
|
25
25
|
constructor();
|
26
26
|
connectedCallback(): void;
|
@@ -4,25 +4,25 @@ import { MenuMixin } from '../../utils/mixins/MenuMixin';
|
|
4
4
|
import { ROLE } from '../../utils/roles';
|
5
5
|
import styles from './menubar.styles';
|
6
6
|
/**
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
7
|
+
* Menubar is a navigational menu component that provides a horizontal (default) or vertical fixed list of menu items,
|
8
|
+
* with support for nested submenus and keyboard navigation. It serves as a container
|
9
|
+
* for menu items and manages their interaction patterns, including:
|
10
|
+
* - Keyboard navigation (arrow keys, Home, End)
|
11
|
+
* - Menu item activation (Enter/Space)
|
12
|
+
* - Submenu toggling (Right/Left arrow keys)
|
13
|
+
* - Focus management
|
14
|
+
* - Support for both horizontal and vertical orientations
|
15
|
+
* - Integration with MenuPopover for nested menus
|
16
|
+
*
|
17
|
+
* A menubar will contain a set of menu items and their associated popovers.
|
18
|
+
* Each menu item can have a popover for nested menus.
|
19
|
+
*
|
20
|
+
* The component automatically handles ARIA attributes and follows WAI-ARIA menu design patterns.
|
21
|
+
* It works in conjunction with `mdc-menuitem` and `mdc-menupopover` to create accessible menu structures.
|
22
|
+
*
|
23
|
+
* @tagname mdc-menubar
|
24
|
+
* @slot default - Contains the menu items and their associated popovers
|
25
|
+
*/
|
26
26
|
class MenuBar extends MenuMixin(Component) {
|
27
27
|
constructor() {
|
28
28
|
super();
|