@momentum-design/components 0.84.3 → 0.84.4
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 +2233 -2291
- 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.js +28 -29
- 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 +514 -514
- 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 +4 -4
- package/dist/react/index.js +4 -4
- package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
- package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
- package/dist/utils/mixins/FocusTrapMixin.js +12 -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,6 +1,6 @@
|
|
1
1
|
import { CSSResult } from 'lit';
|
2
|
-
import type { VariantType } from './alertchip.types';
|
3
2
|
import Buttonsimple from '../buttonsimple/buttonsimple.component';
|
3
|
+
import type { VariantType } from './alertchip.types';
|
4
4
|
/**
|
5
5
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
6
6
|
*
|
@@ -9,11 +9,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { html } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
|
-
import styles from './alertchip.styles';
|
13
12
|
import { Component } from '../../models';
|
13
|
+
import Buttonsimple from '../buttonsimple/buttonsimple.component';
|
14
|
+
import styles from './alertchip.styles';
|
14
15
|
import { DEFAULTS } from './alertchip.constants';
|
15
16
|
import { getAlertIcon } from './alertchip.utils';
|
16
|
-
import Buttonsimple from '../buttonsimple/buttonsimple.component';
|
17
17
|
/**
|
18
18
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
19
19
|
*
|
@@ -9,7 +9,7 @@ const styles = css `
|
|
9
9
|
border: 1px solid;
|
10
10
|
cursor: pointer;
|
11
11
|
white-space: nowrap;
|
12
|
-
|
12
|
+
|
13
13
|
--mdc-chip-color: var(--mds-color-theme-text-primary-normal);
|
14
14
|
--mdc-chip-border-color: var(--mds-color-theme-outline-button-normal);
|
15
15
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-default-normal);
|
@@ -19,88 +19,87 @@ const styles = css `
|
|
19
19
|
background: var(--mdc-chip-background-color);
|
20
20
|
}
|
21
21
|
|
22
|
-
:host::part(label){
|
22
|
+
:host::part(label) {
|
23
23
|
color: var(--mdc-chip-color);
|
24
24
|
}
|
25
25
|
|
26
|
-
:host::part(icon){
|
26
|
+
:host::part(icon) {
|
27
27
|
color: var(--mdc-chip-icon-color);
|
28
28
|
}
|
29
|
-
|
30
29
|
|
31
|
-
:host([variant=
|
30
|
+
:host([variant='neutral']:hover) {
|
32
31
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-default-hover);
|
33
32
|
}
|
34
33
|
|
35
|
-
:host([variant=
|
34
|
+
:host([variant='neutral']:active) {
|
36
35
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-default-active);
|
37
36
|
}
|
38
37
|
|
39
|
-
:host([variant=
|
38
|
+
:host([variant='error'])::part(icon) {
|
40
39
|
--mdc-chip-icon-color: var(--mds-color-theme-text-error-normal);
|
41
40
|
}
|
42
|
-
|
43
|
-
:host([variant=
|
41
|
+
|
42
|
+
:host([variant='error']) {
|
44
43
|
--mdc-chip-border-color: var(--mds-color-theme-outline-cancel-normal);
|
45
44
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-error-normal);
|
46
45
|
}
|
47
46
|
|
48
|
-
:host([variant=
|
47
|
+
:host([variant='error']:hover) {
|
49
48
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-error-hover);
|
50
49
|
}
|
51
50
|
|
52
|
-
:host([variant=
|
51
|
+
:host([variant='error']:active) {
|
53
52
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-error-active);
|
54
53
|
}
|
55
54
|
|
56
|
-
:host([variant=
|
55
|
+
:host([variant='warning'])::part(icon) {
|
57
56
|
--mdc-chip-icon-color: var(--mds-color-theme-text-warning-normal);
|
58
57
|
}
|
59
58
|
|
60
|
-
:host([variant=
|
59
|
+
:host([variant='warning']) {
|
61
60
|
--mdc-chip-border-color: var(--mds-color-theme-outline-warning-normal);
|
62
61
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-warning-normal);
|
63
62
|
}
|
64
63
|
|
65
|
-
:host([variant=
|
64
|
+
:host([variant='warning']:hover) {
|
66
65
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-warning-hover);
|
67
66
|
}
|
68
67
|
|
69
|
-
:host([variant=
|
68
|
+
:host([variant='warning']:active) {
|
70
69
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-warning-active);
|
71
70
|
}
|
72
71
|
|
73
|
-
:host([variant=
|
72
|
+
:host([variant='success'])::part(icon) {
|
74
73
|
--mdc-chip-icon-color: var(--mds-color-theme-text-success-normal);
|
75
74
|
}
|
76
75
|
|
77
|
-
:host([variant=
|
76
|
+
:host([variant='success']) {
|
78
77
|
--mdc-chip-border-color: var(--mds-color-theme-outline-join-normal);
|
79
78
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-success-normal);
|
80
79
|
}
|
81
80
|
|
82
|
-
:host([variant=
|
81
|
+
:host([variant='success']:hover) {
|
83
82
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-success-hover);
|
84
83
|
}
|
85
84
|
|
86
|
-
:host([variant=
|
85
|
+
:host([variant='success']:active) {
|
87
86
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-success-active);
|
88
87
|
}
|
89
88
|
|
90
|
-
:host([variant=
|
89
|
+
:host([variant='informational'])::part(icon) {
|
91
90
|
--mdc-chip-icon-color: var(--mds-color-theme-text-accent-normal);
|
92
91
|
}
|
93
92
|
|
94
|
-
:host([variant=
|
93
|
+
:host([variant='informational']) {
|
95
94
|
--mdc-chip-border-color: var(--mds-color-theme-outline-theme-normal);
|
96
95
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-theme-normal);
|
97
96
|
}
|
98
97
|
|
99
|
-
:host([variant=
|
98
|
+
:host([variant='informational']:hover) {
|
100
99
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-theme-hover);
|
101
100
|
}
|
102
101
|
|
103
|
-
:host([variant=
|
102
|
+
:host([variant='informational']:active) {
|
104
103
|
--mdc-chip-background-color: var(--mds-color-theme-background-alert-theme-active);
|
105
104
|
}
|
106
105
|
`;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ValueOf } from '../../utils/types';
|
2
|
-
import { VARIANTS } from './alertchip.constants';
|
3
2
|
import type { IconNames } from '../icon/icon.types';
|
3
|
+
import { VARIANTS } from './alertchip.constants';
|
4
4
|
type VariantType = ValueOf<typeof VARIANTS>;
|
5
5
|
type IconListType = Extract<IconNames, 'error-legacy-badge-filled' | 'warning-badge-filled' | 'check-circle-badge-filled' | 'dnd-presence-badge-filled' | 'info-badge-filled'>;
|
6
6
|
export type { VariantType, IconListType };
|
@@ -12,8 +12,8 @@ import { property } from 'lit/decorators.js';
|
|
12
12
|
import { createRef, ref } from 'lit/directives/ref.js';
|
13
13
|
import lottie from 'lottie-web/build/player/lottie_light';
|
14
14
|
import animationManifest from '@momentum-design/animations/dist/manifest';
|
15
|
-
import styles from './animation.styles';
|
16
15
|
import { Component } from '../../models';
|
16
|
+
import styles from './animation.styles';
|
17
17
|
import { DEFAULTS } from './animation.constants';
|
18
18
|
/**
|
19
19
|
* The `mdc-animation` component is a wrapper around the Lottie animation library.
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { hostFitContentStyles } from '../../utils/styles';
|
3
|
-
const styles = [
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host svg {
|
7
|
+
display: block;
|
8
|
+
}
|
9
|
+
`,
|
10
|
+
];
|
8
11
|
export default styles;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { html } from 'lit';
|
2
|
-
import styles from './appheader.styles';
|
3
2
|
import { Component } from '../../models';
|
3
|
+
import styles from './appheader.styles';
|
4
4
|
/**
|
5
5
|
* The `mdc-appheader` component provides a structured and accessible app header layout.
|
6
6
|
* It consists of three primary sections: leading, center, and trailing.
|
@@ -26,18 +26,17 @@ class Appheader extends Component {
|
|
26
26
|
* Uses `slots` for flexibility, allowing consumers to insert custom content.
|
27
27
|
*/
|
28
28
|
render() {
|
29
|
-
return html `
|
30
|
-
<
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
<
|
35
|
-
|
36
|
-
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
</header>`;
|
29
|
+
return html ` <header part="container">
|
30
|
+
<div part="leading-section">
|
31
|
+
<slot name="leading"></slot>
|
32
|
+
</div>
|
33
|
+
<div part="center-section">
|
34
|
+
<slot name="center"></slot>
|
35
|
+
</div>
|
36
|
+
<div part="trailing-section">
|
37
|
+
<slot name="trailing"></slot>
|
38
|
+
</div>
|
39
|
+
</header>`;
|
41
40
|
}
|
42
41
|
}
|
43
42
|
Appheader.styles = [...Component.styles, ...styles];
|
@@ -132,11 +132,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
|
|
132
132
|
iconTemplate() {
|
133
133
|
const name = this.iconName || DEFAULTS.ICON_NAME;
|
134
134
|
return html `
|
135
|
-
<mdc-icon
|
136
|
-
name="${ifDefined(name)}"
|
137
|
-
length-unit="rem"
|
138
|
-
size="${getAvatarIconSize(this.size)}"
|
139
|
-
></mdc-icon>
|
135
|
+
<mdc-icon name="${ifDefined(name)}" length-unit="rem" size="${getAvatarIconSize(this.size)}"></mdc-icon>
|
140
136
|
`;
|
141
137
|
}
|
142
138
|
/**
|
@@ -148,14 +144,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
|
|
148
144
|
* @returns The template result containing the avatar text.
|
149
145
|
*/
|
150
146
|
textTemplate(content) {
|
151
|
-
return html `
|
152
|
-
<mdc-text
|
153
|
-
type="${getAvatarTextFontSize(this.size)}"
|
154
|
-
tagname="span"
|
155
|
-
>
|
156
|
-
${content}
|
157
|
-
</mdc-text>
|
158
|
-
`;
|
147
|
+
return html ` <mdc-text type="${getAvatarTextFontSize(this.size)}" tagname="span"> ${content} </mdc-text> `;
|
159
148
|
}
|
160
149
|
/**
|
161
150
|
* @internal
|
@@ -298,9 +287,7 @@ class Avatar extends AvatarComponentMixin(IconNameMixin(Component)) {
|
|
298
287
|
const type = this.getTypeBasedOnInputs();
|
299
288
|
return html `
|
300
289
|
<div part="content" aria-hidden="true">
|
301
|
-
${this.getPhotoPlaceHolderContent(type)}
|
302
|
-
${this.getTemplateBasedOnType(type)}
|
303
|
-
${this.getLoadingContent()}
|
290
|
+
${this.getPhotoPlaceHolderContent(type)} ${this.getTemplateBasedOnType(type)} ${this.getLoadingContent()}
|
304
291
|
${this.getPresenceTemplateBasedOnType(type)}
|
305
292
|
</div>
|
306
293
|
`;
|
@@ -1,127 +1,134 @@
|
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
height: 2rem;
|
61
|
-
background-color: var(--mdc-avatar-default-background-color);
|
62
|
-
color: var(--mdc-avatar-default-foreground-color);
|
63
|
-
border-radius: 100vh;
|
64
|
-
position: relative;
|
65
|
-
display: grid;
|
66
|
-
place-items: center;
|
67
|
-
}
|
68
|
-
:host::part(photo) {
|
69
|
-
border-radius: 100vh;
|
70
|
-
height: 100%;
|
71
|
-
width: 100%;
|
72
|
-
object-fit: cover;
|
73
|
-
overflow: hidden;
|
74
|
-
}
|
75
|
-
:host::part(presence) {
|
76
|
-
position: absolute;
|
77
|
-
bottom: 0;
|
78
|
-
right: 0;
|
79
|
-
}
|
80
|
-
:host::part(loading-wrapper) {
|
81
|
-
position: absolute;
|
82
|
-
border-radius: 100vh;
|
83
|
-
width: 100%;
|
84
|
-
height: 100%;
|
85
|
-
background-color: var(--mdc-avatar-loading-overlay-background-color);
|
86
|
-
display: grid;
|
87
|
-
place-items: center;
|
88
|
-
}
|
89
|
-
:host::part(loader) {
|
90
|
-
position: absolute;
|
91
|
-
width: 1rem;
|
92
|
-
transform: scale(0.4);
|
93
|
-
aspect-ratio: 1;
|
94
|
-
border-radius: 100vh;
|
95
|
-
animation: loading-key 1s infinite linear alternate;
|
96
|
-
}
|
97
|
-
@keyframes loading-key {
|
98
|
-
0% {
|
99
|
-
box-shadow: 1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color),
|
100
|
-
-1.25rem 0 var(--mdc-avatar-loading-indicator-background-color);
|
101
|
-
background: var(--mdc-avatar-loading-indicator-foreground-color);
|
102
|
-
}
|
103
|
-
33% {
|
104
|
-
box-shadow: 1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color),
|
105
|
-
-1.25rem 0 var(--mdc-avatar-loading-indicator-background-color);
|
106
|
-
background: var(--mdc-avatar-loading-indicator-background-color);
|
107
|
-
}
|
108
|
-
66% {
|
109
|
-
box-shadow: 1.25rem 0 var(--mdc-avatar-loading-indicator-background-color),
|
110
|
-
-1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color);
|
111
|
-
background: var(--mdc-avatar-loading-indicator-background-color);
|
112
|
-
}
|
113
|
-
100%{
|
114
|
-
box-shadow: 1.25rem 0 var(--mdc-avatar-loading-indicator-background-color),
|
115
|
-
-1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color);
|
116
|
-
background: var(--mdc-avatar-loading-indicator-foreground-color);
|
117
|
-
}
|
118
|
-
}
|
119
|
-
|
120
|
-
/* High Contrast Mode */
|
121
|
-
@media (forced-colors: active) {
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host {
|
7
|
+
--mdc-avatar-default-background-color: var(--mds-color-theme-avatar-default);
|
8
|
+
--mdc-avatar-default-foreground-color: var(--mds-color-theme-common-text-primary-normal);
|
9
|
+
--mdc-avatar-loading-indicator-background-color: var(--mds-color-theme-common-text-primary-disabled);
|
10
|
+
--mdc-avatar-loading-indicator-foreground-color: var(--mdc-avatar-default-foreground-color);
|
11
|
+
--mdc-avatar-loading-overlay-background-color: var(--mds-color-theme-common-overlays-secondary-normal);
|
12
|
+
}
|
13
|
+
:host([size='124'])::part(content) {
|
14
|
+
width: 7.75rem;
|
15
|
+
height: 7.75rem;
|
16
|
+
}
|
17
|
+
:host([size='88'])::part(content) {
|
18
|
+
width: 5.5rem;
|
19
|
+
height: 5.5rem;
|
20
|
+
}
|
21
|
+
:host([size='72'])::part(content) {
|
22
|
+
width: 4.5rem;
|
23
|
+
height: 4.5rem;
|
24
|
+
}
|
25
|
+
:host([size='64'])::part(content) {
|
26
|
+
width: 4rem;
|
27
|
+
height: 4rem;
|
28
|
+
}
|
29
|
+
:host([size='48'])::part(content) {
|
30
|
+
width: 3rem;
|
31
|
+
height: 3rem;
|
32
|
+
}
|
33
|
+
:host([size='32'])::part(content) {
|
34
|
+
width: 2rem;
|
35
|
+
height: 2rem;
|
36
|
+
}
|
37
|
+
:host([size='24'])::part(content) {
|
38
|
+
width: 1.5rem;
|
39
|
+
height: 1.5rem;
|
40
|
+
}
|
41
|
+
:host([size='124'])::part(loader) {
|
42
|
+
transform: scale(1.5);
|
43
|
+
}
|
44
|
+
:host([size='88'])::part(loader) {
|
45
|
+
transform: scale(1.2);
|
46
|
+
}
|
47
|
+
:host([size='72'])::part(loader),
|
48
|
+
:host([size='64'])::part(loader) {
|
49
|
+
transform: scale(0.8);
|
50
|
+
}
|
51
|
+
:host([size='48'])::part(loader) {
|
52
|
+
transform: scale(0.6);
|
53
|
+
}
|
54
|
+
:host([size='32'])::part(loader) {
|
55
|
+
transform: scale(0.4);
|
56
|
+
}
|
57
|
+
:host([size='24'])::part(loader) {
|
58
|
+
transform: scale(0.3);
|
59
|
+
}
|
122
60
|
:host::part(content) {
|
123
|
-
|
61
|
+
width: 2rem;
|
62
|
+
height: 2rem;
|
63
|
+
background-color: var(--mdc-avatar-default-background-color);
|
64
|
+
color: var(--mdc-avatar-default-foreground-color);
|
65
|
+
border-radius: 100vh;
|
66
|
+
position: relative;
|
67
|
+
display: grid;
|
68
|
+
place-items: center;
|
69
|
+
}
|
70
|
+
:host::part(photo) {
|
71
|
+
border-radius: 100vh;
|
72
|
+
height: 100%;
|
73
|
+
width: 100%;
|
74
|
+
object-fit: cover;
|
75
|
+
overflow: hidden;
|
76
|
+
}
|
77
|
+
:host::part(presence) {
|
78
|
+
position: absolute;
|
79
|
+
bottom: 0;
|
80
|
+
right: 0;
|
81
|
+
}
|
82
|
+
:host::part(loading-wrapper) {
|
83
|
+
position: absolute;
|
84
|
+
border-radius: 100vh;
|
85
|
+
width: 100%;
|
86
|
+
height: 100%;
|
87
|
+
background-color: var(--mdc-avatar-loading-overlay-background-color);
|
88
|
+
display: grid;
|
89
|
+
place-items: center;
|
90
|
+
}
|
91
|
+
:host::part(loader) {
|
92
|
+
position: absolute;
|
93
|
+
width: 1rem;
|
94
|
+
transform: scale(0.4);
|
95
|
+
aspect-ratio: 1;
|
96
|
+
border-radius: 100vh;
|
97
|
+
animation: loading-key 1s infinite linear alternate;
|
98
|
+
}
|
99
|
+
@keyframes loading-key {
|
100
|
+
0% {
|
101
|
+
box-shadow:
|
102
|
+
1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color),
|
103
|
+
-1.25rem 0 var(--mdc-avatar-loading-indicator-background-color);
|
104
|
+
background: var(--mdc-avatar-loading-indicator-foreground-color);
|
105
|
+
}
|
106
|
+
33% {
|
107
|
+
box-shadow:
|
108
|
+
1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color),
|
109
|
+
-1.25rem 0 var(--mdc-avatar-loading-indicator-background-color);
|
110
|
+
background: var(--mdc-avatar-loading-indicator-background-color);
|
111
|
+
}
|
112
|
+
66% {
|
113
|
+
box-shadow:
|
114
|
+
1.25rem 0 var(--mdc-avatar-loading-indicator-background-color),
|
115
|
+
-1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color);
|
116
|
+
background: var(--mdc-avatar-loading-indicator-background-color);
|
117
|
+
}
|
118
|
+
100% {
|
119
|
+
box-shadow:
|
120
|
+
1.25rem 0 var(--mdc-avatar-loading-indicator-background-color),
|
121
|
+
-1.25rem 0 var(--mdc-avatar-loading-indicator-foreground-color);
|
122
|
+
background: var(--mdc-avatar-loading-indicator-foreground-color);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
/* High Contrast Mode */
|
127
|
+
@media (forced-colors: active) {
|
128
|
+
:host::part(content) {
|
129
|
+
outline: 0.125rem solid;
|
130
|
+
}
|
124
131
|
}
|
125
|
-
|
126
|
-
|
132
|
+
`,
|
133
|
+
];
|
127
134
|
export default styles;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { AVATAR_TYPE, AVATAR_SIZE } from './avatar.constants';
|
2
1
|
import type { ValueOf } from '../../utils/types';
|
2
|
+
import { AVATAR_TYPE, AVATAR_SIZE } from './avatar.constants';
|
3
3
|
type AvatarType = ValueOf<typeof AVATAR_TYPE>;
|
4
4
|
type AvatarSize = ValueOf<typeof AVATAR_SIZE>;
|
5
5
|
export type { AvatarType, AvatarSize };
|
@@ -4,4 +4,4 @@ import type { AvatarSize } from './avatar.types';
|
|
4
4
|
declare const getPresenceSize: (size: AvatarSize) => PresenceSize;
|
5
5
|
declare const getAvatarIconSize: (size: AvatarSize) => number;
|
6
6
|
declare const getAvatarTextFontSize: (size: AvatarSize) => TextType;
|
7
|
-
export { getAvatarIconSize, getAvatarTextFontSize, getPresenceSize
|
7
|
+
export { getAvatarIconSize, getAvatarTextFontSize, getPresenceSize };
|
@@ -37,4 +37,4 @@ const getAvatarTextFontSize = (size) => {
|
|
37
37
|
};
|
38
38
|
return avatarTextFontSizeMap[size] || FONT_TYPE.BODY_MIDSIZE_MEDIUM; // default size of text font
|
39
39
|
};
|
40
|
-
export { getAvatarIconSize, getAvatarTextFontSize, getPresenceSize
|
40
|
+
export { getAvatarIconSize, getAvatarTextFontSize, getPresenceSize };
|
@@ -23,8 +23,8 @@ declare const AvatarButton_base: import("../../utils/mixins/index.types").Constr
|
|
23
23
|
*/
|
24
24
|
declare class AvatarButton extends AvatarButton_base {
|
25
25
|
/**
|
26
|
-
|
27
|
-
|
26
|
+
* Aria-label attribute to be set for accessibility
|
27
|
+
*/
|
28
28
|
ariaLabel: string | null;
|
29
29
|
connectedCallback(): void;
|
30
30
|
update(changedProperties: PropertyValues): void;
|
@@ -40,8 +40,8 @@ class AvatarButton extends AvatarComponentMixin(IconNameMixin(Buttonsimple)) {
|
|
40
40
|
constructor() {
|
41
41
|
super(...arguments);
|
42
42
|
/**
|
43
|
-
|
44
|
-
|
43
|
+
* Aria-label attribute to be set for accessibility
|
44
|
+
*/
|
45
45
|
this.ariaLabel = null;
|
46
46
|
}
|
47
47
|
connectedCallback() {
|
@@ -1,33 +1,37 @@
|
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host {
|
7
|
+
--mdc-avatarbutton-overlay-background-color-rest: var(--mds-color-theme-avatar-ghost);
|
8
|
+
--mdc-avatarbutton-overlay-background-color-hover: var(--mds-color-theme-avatar-hover);
|
9
|
+
--mdc-avatarbutton-overlay-background-color-active: var(--mds-color-theme-avatar-pressed);
|
10
|
+
padding: unset;
|
11
|
+
margin: unset;
|
12
|
+
outline: none;
|
13
|
+
border-radius: 0.25rem;
|
14
|
+
position: relative;
|
15
|
+
cursor: pointer;
|
16
|
+
}
|
17
|
+
:host::part(overlay) {
|
18
|
+
position: absolute;
|
19
|
+
border-radius: 100vh;
|
20
|
+
height: 100%;
|
21
|
+
width: 100%;
|
22
|
+
z-index: 1;
|
23
|
+
background-color: var(--mdc-avatarbutton-overlay-background-color-rest);
|
24
|
+
}
|
25
|
+
:host(:not([is-typing]):hover)::part(overlay) {
|
26
|
+
background-color: var(--mdc-avatarbutton-overlay-background-color-hover);
|
27
|
+
}
|
28
|
+
:host(:not([is-typing]):active)::part(overlay) {
|
29
|
+
background-color: var(--mdc-avatarbutton-overlay-background-color-active);
|
30
|
+
}
|
31
|
+
:host::part(presence) {
|
32
|
+
z-index: 2;
|
33
|
+
}
|
34
|
+
`,
|
35
|
+
...hostFocusRingStyles(),
|
36
|
+
];
|
33
37
|
export default styles;
|