@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.
Files changed (185) hide show
  1. package/README.md +8 -3
  2. package/dist/browser/index.js +2241 -2299
  3. package/dist/browser/index.js.map +4 -4
  4. package/dist/components/alertchip/alertchip.component.d.ts +1 -1
  5. package/dist/components/alertchip/alertchip.component.js +2 -2
  6. package/dist/components/alertchip/alertchip.styles.js +22 -23
  7. package/dist/components/alertchip/alertchip.types.d.ts +1 -1
  8. package/dist/components/animation/animation.component.js +1 -1
  9. package/dist/components/animation/animation.styles.js +8 -5
  10. package/dist/components/appheader/appheader.component.js +12 -13
  11. package/dist/components/appheader/appheader.styles.js +0 -1
  12. package/dist/components/avatar/avatar.component.js +3 -16
  13. package/dist/components/avatar/avatar.constants.d.ts +1 -1
  14. package/dist/components/avatar/avatar.constants.js +1 -1
  15. package/dist/components/avatar/avatar.styles.js +129 -122
  16. package/dist/components/avatar/avatar.types.d.ts +1 -1
  17. package/dist/components/avatar/avatar.utils.d.ts +1 -1
  18. package/dist/components/avatar/avatar.utils.js +1 -1
  19. package/dist/components/avatarbutton/avatarbutton.component.d.ts +2 -2
  20. package/dist/components/avatarbutton/avatarbutton.component.js +2 -2
  21. package/dist/components/avatarbutton/avatarbutton.styles.js +34 -30
  22. package/dist/components/badge/badge.styles.js +9 -7
  23. package/dist/components/brandvisual/brandvisual.component.js +4 -4
  24. package/dist/components/bullet/bullet.component.d.ts +1 -1
  25. package/dist/components/bullet/bullet.component.js +2 -2
  26. package/dist/components/bullet/bullet.styles.js +3 -3
  27. package/dist/components/button/button.component.js +10 -4
  28. package/dist/components/button/button.utils.js +1 -1
  29. package/dist/components/buttongroup/buttongroup.component.js +1 -1
  30. package/dist/components/buttongroup/buttongroup.styles.js +68 -68
  31. package/dist/components/buttonlink/buttonlink.component.d.ts +5 -5
  32. package/dist/components/buttonlink/buttonlink.component.js +9 -9
  33. package/dist/components/buttonsimple/buttonsimple.component.js +2 -2
  34. package/dist/components/buttonsimple/buttonsimple.constants.d.ts +1 -1
  35. package/dist/components/buttonsimple/buttonsimple.constants.js +1 -1
  36. package/dist/components/buttonsimple/buttonsimple.styles.js +62 -57
  37. package/dist/components/card/card.component.d.ts +6 -6
  38. package/dist/components/card/card.component.js +15 -16
  39. package/dist/components/card/card.styles.js +24 -22
  40. package/dist/components/cardbutton/cardbutton.component.js +9 -12
  41. package/dist/components/cardbutton/cardbutton.styles.js +1 -1
  42. package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +6 -6
  43. package/dist/components/cardcheckbox/cardcheckbox.component.js +30 -29
  44. package/dist/components/cardcheckbox/cardcheckbox.styles.js +10 -10
  45. package/dist/components/cardradio/cardradio.component.d.ts +12 -12
  46. package/dist/components/cardradio/cardradio.component.js +27 -30
  47. package/dist/components/cardradio/cardradio.styles.js +8 -8
  48. package/dist/components/checkbox/checkbox.component.js +7 -9
  49. package/dist/components/checkbox/checkbox.styles.js +62 -60
  50. package/dist/components/chip/chip.component.d.ts +1 -1
  51. package/dist/components/chip/chip.component.js +6 -11
  52. package/dist/components/chip/chip.styles.js +4 -2
  53. package/dist/components/dialog/dialog.component.d.ts +7 -2
  54. package/dist/components/dialog/dialog.component.js +43 -33
  55. package/dist/components/dialog/dialog.constants.d.ts +1 -0
  56. package/dist/components/dialog/dialog.constants.js +1 -0
  57. package/dist/components/dialog/dialog.styles.js +10 -12
  58. package/dist/components/divider/divider.component.js +6 -8
  59. package/dist/components/divider/divider.constants.d.ts +1 -1
  60. package/dist/components/divider/divider.constants.js +1 -1
  61. package/dist/components/divider/divider.styles.js +5 -20
  62. package/dist/components/filterchip/filterchip.styles.js +4 -2
  63. package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -4
  64. package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -2
  65. package/dist/components/formfieldwrapper/formfieldwrapper.component.js +19 -17
  66. package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +2 -1
  67. package/dist/components/formfieldwrapper/formfieldwrapper.subcomponent.js +4 -4
  68. package/dist/components/icon/icon.component.js +7 -7
  69. package/dist/components/icon/icon.utils.d.ts +1 -1
  70. package/dist/components/icon/icon.utils.js +7 -7
  71. package/dist/components/iconprovider/iconprovider.component.js +7 -7
  72. package/dist/components/input/input.component.d.ts +5 -5
  73. package/dist/components/input/input.component.js +64 -62
  74. package/dist/components/input/input.styles.js +128 -117
  75. package/dist/components/inputchip/inputchip.component.js +14 -19
  76. package/dist/components/inputchip/inputchip.styles.js +5 -3
  77. package/dist/components/link/link.component.d.ts +1 -1
  78. package/dist/components/link/link.component.js +4 -8
  79. package/dist/components/link/link.constants.d.ts +1 -1
  80. package/dist/components/link/link.constants.js +1 -1
  81. package/dist/components/link/link.styles.js +12 -12
  82. package/dist/components/linksimple/linksimple.component.js +2 -4
  83. package/dist/components/linksimple/linksimple.styles.js +59 -57
  84. package/dist/components/list/list.component.js +12 -9
  85. package/dist/components/listitem/listitem.component.js +15 -11
  86. package/dist/components/listitem/listitem.styles.js +11 -6
  87. package/dist/components/marker/marker.component.js +1 -1
  88. package/dist/components/marker/marker.styles.js +2 -2
  89. package/dist/components/menubar/menubar.component.d.ts +19 -19
  90. package/dist/components/menubar/menubar.component.js +19 -19
  91. package/dist/components/menuitem/menuitem.component.js +15 -15
  92. package/dist/components/menuitem/menuitem.styles.js +3 -2
  93. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
  94. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +4 -11
  95. package/dist/components/menuitemradio/menuitemradio.component.js +1 -1
  96. package/dist/components/menupopover/menupopover.component.js +11 -11
  97. package/dist/components/menupopover/menupopover.utils.d.ts +1 -1
  98. package/dist/components/menupopover/menupopover.utils.js +3 -8
  99. package/dist/components/navitem/navitem.component.js +11 -19
  100. package/dist/components/navitem/navitem.styles.js +147 -143
  101. package/dist/components/navitemlist/navitemlist.component.js +2 -2
  102. package/dist/components/optgroup/optgroup.component.js +12 -9
  103. package/dist/components/option/option.component.js +11 -11
  104. package/dist/components/option/option.styles.js +1 -1
  105. package/dist/components/popover/popover.component.js +4 -4
  106. package/dist/components/popover/popover.stack.js +1 -1
  107. package/dist/components/popover/popover.styles.js +0 -1
  108. package/dist/components/popover/popover.utils.js +3 -4
  109. package/dist/components/presence/presence.component.d.ts +4 -4
  110. package/dist/components/presence/presence.component.js +4 -4
  111. package/dist/components/progressbar/progressbar.component.js +3 -4
  112. package/dist/components/progressbar/progressbar.styles.js +77 -71
  113. package/dist/components/progressspinner/progressspiner.utils.js +4 -4
  114. package/dist/components/progressspinner/progressspinner.component.js +38 -37
  115. package/dist/components/progressspinner/progressspinner.styles.js +1 -1
  116. package/dist/components/radio/radio.component.d.ts +41 -41
  117. package/dist/components/radio/radio.component.js +84 -83
  118. package/dist/components/radio/radio.styles.js +77 -75
  119. package/dist/components/radiogroup/radiogroup.component.js +1 -1
  120. package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +2 -2
  121. package/dist/components/screenreaderannouncer/screenreaderannouncer.styles.js +8 -6
  122. package/dist/components/searchfield/searchfield.component.js +23 -17
  123. package/dist/components/searchfield/searchfield.styles.js +11 -13
  124. package/dist/components/select/select.component.js +20 -23
  125. package/dist/components/select/select.styles.js +9 -9
  126. package/dist/components/sidenavigation/sidenavigation.component.d.ts +6 -6
  127. package/dist/components/sidenavigation/sidenavigation.component.js +39 -29
  128. package/dist/components/sidenavigation/sidenavigation.context.js +5 -5
  129. package/dist/components/sidenavigation/sidenavigation.styles.js +53 -53
  130. package/dist/components/skeleton/skeleton.component.js +1 -4
  131. package/dist/components/skeleton/skeleton.constants.d.ts +1 -1
  132. package/dist/components/skeleton/skeleton.constants.js +1 -1
  133. package/dist/components/skeleton/skeleton.styles.js +4 -4
  134. package/dist/components/spinner/spinner.component.d.ts +7 -7
  135. package/dist/components/spinner/spinner.component.js +9 -9
  136. package/dist/components/spinner/spinner.styles.js +58 -53
  137. package/dist/components/staticcheckbox/staticcheckbox.component.js +10 -8
  138. package/dist/components/staticcheckbox/staticcheckbox.styles.js +52 -51
  139. package/dist/components/staticradio/staticradio.component.d.ts +8 -8
  140. package/dist/components/staticradio/staticradio.component.js +10 -11
  141. package/dist/components/staticradio/staticradio.styles.js +77 -75
  142. package/dist/components/statictoggle/statictoggle.component.d.ts +3 -3
  143. package/dist/components/statictoggle/statictoggle.component.js +3 -3
  144. package/dist/components/statictoggle/statictoggle.styles.js +71 -68
  145. package/dist/components/tab/tab.component.d.ts +1 -1
  146. package/dist/components/tab/tab.component.js +2 -2
  147. package/dist/components/tab/tab.styles.js +247 -245
  148. package/dist/components/tablist/tablist.component.js +11 -15
  149. package/dist/components/tablist/tablist.styles.js +27 -25
  150. package/dist/components/tablist/tablist.types.d.ts +1 -1
  151. package/dist/components/tablist/tablist.utils.js +4 -4
  152. package/dist/components/text/fonts.styles.js +49 -49
  153. package/dist/components/text/text.component.js +21 -11
  154. package/dist/components/text/text.types.d.ts +1 -1
  155. package/dist/components/textarea/textarea.component.d.ts +31 -31
  156. package/dist/components/textarea/textarea.component.js +54 -61
  157. package/dist/components/textarea/textarea.styles.js +123 -122
  158. package/dist/components/themeprovider/themeprovider.component.js +1 -1
  159. package/dist/components/themeprovider/themeprovider.styles.js +4 -4
  160. package/dist/components/toggle/toggle.component.d.ts +35 -35
  161. package/dist/components/toggle/toggle.component.js +62 -63
  162. package/dist/components/toggle/toggle.styles.js +77 -69
  163. package/dist/components/toggletip/toggletip.component.d.ts +7 -7
  164. package/dist/components/toggletip/toggletip.component.js +3 -2
  165. package/dist/components/tooltip/tooltip.component.js +1 -1
  166. package/dist/components/tooltip/tooltip.styles.js +0 -1
  167. package/dist/components/virtualizedlist/virtualizedlist.component.js +6 -14
  168. package/dist/components/virtualizedlist/virtualizedlist.helper.test.d.ts +1 -1
  169. package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +14 -11
  170. package/dist/components/virtualizedlist/virtualizedlist.styles.js +4 -4
  171. package/dist/custom-elements.json +239 -228
  172. package/dist/index.js +1 -0
  173. package/dist/models/component/index.d.ts +1 -1
  174. package/dist/models/index.d.ts +2 -2
  175. package/dist/models/index.js +1 -1
  176. package/dist/react/index.d.ts +3 -3
  177. package/dist/react/index.js +3 -3
  178. package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
  179. package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
  180. package/dist/utils/mixins/FocusTrapMixin.js +15 -12
  181. package/dist/utils/mixins/IconNameMixin.d.ts +1 -1
  182. package/dist/utils/mixins/MenuMixin.js +23 -23
  183. package/dist/utils/mixins/PreventScrollMixin.d.ts +1 -1
  184. package/dist/utils/styles/index.js +12 -12
  185. 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="neutral"]:hover){
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="neutral"]:active){
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="error"])::part(icon){
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="error"]){
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="error"]:hover){
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="error"]:active){
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="warning"])::part(icon){
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="warning"]){
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="warning"]:hover){
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="warning"]:active){
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="success"])::part(icon){
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="success"]){
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="success"]:hover){
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="success"]:active){
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="informational"])::part(icon){
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="informational"]){
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="informational"]:hover){
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="informational"]:active){
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 = [hostFitContentStyles, css `
4
- :host svg{
5
- display: block;
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
- <header part="container">
31
- <div part="leading-section">
32
- <slot name="leading"></slot>
33
- </div>
34
- <div part="center-section">
35
- <slot name="center"></slot>
36
- </div>
37
- <div part="trailing-section">
38
- <slot name="trailing"></slot>
39
- </div>
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];
@@ -22,7 +22,6 @@ const styles = css `
22
22
 
23
23
  :host::part(leading-section) {
24
24
  justify-content: flex-start;
25
-
26
25
  }
27
26
 
28
27
  :host::part(center-section) {
@@ -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
  `;
@@ -20,4 +20,4 @@ declare const DEFAULTS: {
20
20
  readonly SIZE: 32;
21
21
  readonly ICON_NAME: "user-regular";
22
22
  };
23
- export { TAG_NAME, DEFAULTS, AVATAR_TYPE, MAX_COUNTER, AVATAR_SIZE, };
23
+ export { TAG_NAME, DEFAULTS, AVATAR_TYPE, MAX_COUNTER, AVATAR_SIZE };
@@ -22,4 +22,4 @@ const DEFAULTS = {
22
22
  SIZE: AVATAR_SIZE[32],
23
23
  ICON_NAME,
24
24
  };
25
- export { TAG_NAME, DEFAULTS, AVATAR_TYPE, MAX_COUNTER, AVATAR_SIZE, };
25
+ export { TAG_NAME, DEFAULTS, AVATAR_TYPE, MAX_COUNTER, AVATAR_SIZE };
@@ -1,127 +1,134 @@
1
1
  import { css } from 'lit';
2
2
  import { hostFitContentStyles } from '../../utils/styles';
3
- const styles = [hostFitContentStyles, css `
4
- :host {
5
- --mdc-avatar-default-background-color: var(--mds-color-theme-avatar-default);
6
- --mdc-avatar-default-foreground-color: var(--mds-color-theme-common-text-primary-normal);
7
- --mdc-avatar-loading-indicator-background-color: var(--mds-color-theme-common-text-primary-disabled);
8
- --mdc-avatar-loading-indicator-foreground-color: var(--mdc-avatar-default-foreground-color);
9
- --mdc-avatar-loading-overlay-background-color: var(--mds-color-theme-common-overlays-secondary-normal);
10
- }
11
- :host([size="124"])::part(content) {
12
- width: 7.75rem;
13
- height: 7.75rem;
14
- }
15
- :host([size="88"])::part(content) {
16
- width: 5.5rem;
17
- height: 5.5rem;
18
- }
19
- :host([size="72"])::part(content) {
20
- width: 4.5rem;
21
- height: 4.5rem;
22
- }
23
- :host([size="64"])::part(content) {
24
- width: 4rem;
25
- height: 4rem;
26
- }
27
- :host([size="48"])::part(content) {
28
- width: 3rem;
29
- height: 3rem;
30
- }
31
- :host([size="32"])::part(content) {
32
- width: 2rem;
33
- height: 2rem;
34
- }
35
- :host([size="24"])::part(content) {
36
- width: 1.5rem;
37
- height: 1.5rem;
38
- }
39
- :host([size="124"])::part(loader) {
40
- transform: scale(1.5);
41
- }
42
- :host([size="88"])::part(loader) {
43
- transform: scale(1.2);
44
- }
45
- :host([size="72"])::part(loader),
46
- :host([size="64"])::part(loader) {
47
- transform: scale(0.8);
48
- }
49
- :host([size="48"])::part(loader) {
50
- transform: scale(0.6);
51
- }
52
- :host([size="32"])::part(loader) {
53
- transform: scale(0.4);
54
- }
55
- :host([size="24"])::part(loader) {
56
- transform: scale(0.3);
57
- }
58
- :host::part(content) {
59
- width: 2rem;
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
- outline: 0.125rem solid;
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
- * Aria-label attribute to be set for accessibility
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
- * Aria-label attribute to be set for accessibility
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 = [hostFitContentStyles, css `
4
- :host {
5
- --mdc-avatarbutton-overlay-background-color-rest: var(--mds-color-theme-avatar-ghost);
6
- --mdc-avatarbutton-overlay-background-color-hover: var(--mds-color-theme-avatar-hover);
7
- --mdc-avatarbutton-overlay-background-color-active: var(--mds-color-theme-avatar-pressed);
8
- padding: unset;
9
- margin: unset;
10
- outline: none;
11
- border-radius: 0.25rem;
12
- position: relative;
13
- cursor: pointer;
14
- }
15
- :host::part(overlay) {
16
- position: absolute;
17
- border-radius: 100vh;
18
- height: 100%;
19
- width: 100%;
20
- z-index: 1;
21
- background-color: var(--mdc-avatarbutton-overlay-background-color-rest);
22
- }
23
- :host(:not([is-typing]):hover)::part(overlay) {
24
- background-color: var(--mdc-avatarbutton-overlay-background-color-hover);
25
- }
26
- :host(:not([is-typing]):active)::part(overlay) {
27
- background-color: var(--mdc-avatarbutton-overlay-background-color-active);
28
- }
29
- :host::part(presence) {
30
- z-index: 2;
31
- }
32
- `, ...hostFocusRingStyles()];
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;