@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.
Files changed (182) hide show
  1. package/README.md +8 -3
  2. package/dist/browser/index.js +2233 -2291
  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.js +28 -29
  54. package/dist/components/dialog/dialog.styles.js +10 -12
  55. package/dist/components/divider/divider.component.js +6 -8
  56. package/dist/components/divider/divider.constants.d.ts +1 -1
  57. package/dist/components/divider/divider.constants.js +1 -1
  58. package/dist/components/divider/divider.styles.js +5 -20
  59. package/dist/components/filterchip/filterchip.styles.js +4 -2
  60. package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -4
  61. package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -2
  62. package/dist/components/formfieldwrapper/formfieldwrapper.component.js +19 -17
  63. package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +2 -1
  64. package/dist/components/formfieldwrapper/formfieldwrapper.subcomponent.js +4 -4
  65. package/dist/components/icon/icon.component.js +7 -7
  66. package/dist/components/icon/icon.utils.d.ts +1 -1
  67. package/dist/components/icon/icon.utils.js +7 -7
  68. package/dist/components/iconprovider/iconprovider.component.js +7 -7
  69. package/dist/components/input/input.component.d.ts +5 -5
  70. package/dist/components/input/input.component.js +64 -62
  71. package/dist/components/input/input.styles.js +128 -117
  72. package/dist/components/inputchip/inputchip.component.js +14 -19
  73. package/dist/components/inputchip/inputchip.styles.js +5 -3
  74. package/dist/components/link/link.component.d.ts +1 -1
  75. package/dist/components/link/link.component.js +4 -8
  76. package/dist/components/link/link.constants.d.ts +1 -1
  77. package/dist/components/link/link.constants.js +1 -1
  78. package/dist/components/link/link.styles.js +12 -12
  79. package/dist/components/linksimple/linksimple.component.js +2 -4
  80. package/dist/components/linksimple/linksimple.styles.js +59 -57
  81. package/dist/components/list/list.component.js +12 -9
  82. package/dist/components/listitem/listitem.component.js +15 -11
  83. package/dist/components/listitem/listitem.styles.js +11 -6
  84. package/dist/components/marker/marker.component.js +1 -1
  85. package/dist/components/marker/marker.styles.js +2 -2
  86. package/dist/components/menubar/menubar.component.d.ts +19 -19
  87. package/dist/components/menubar/menubar.component.js +19 -19
  88. package/dist/components/menuitem/menuitem.component.js +15 -15
  89. package/dist/components/menuitem/menuitem.styles.js +3 -2
  90. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
  91. package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +4 -11
  92. package/dist/components/menuitemradio/menuitemradio.component.js +1 -1
  93. package/dist/components/menupopover/menupopover.component.js +11 -11
  94. package/dist/components/menupopover/menupopover.utils.d.ts +1 -1
  95. package/dist/components/menupopover/menupopover.utils.js +3 -8
  96. package/dist/components/navitem/navitem.component.js +11 -19
  97. package/dist/components/navitem/navitem.styles.js +147 -143
  98. package/dist/components/navitemlist/navitemlist.component.js +2 -2
  99. package/dist/components/optgroup/optgroup.component.js +12 -9
  100. package/dist/components/option/option.component.js +11 -11
  101. package/dist/components/option/option.styles.js +1 -1
  102. package/dist/components/popover/popover.component.js +4 -4
  103. package/dist/components/popover/popover.stack.js +1 -1
  104. package/dist/components/popover/popover.styles.js +0 -1
  105. package/dist/components/popover/popover.utils.js +3 -4
  106. package/dist/components/presence/presence.component.d.ts +4 -4
  107. package/dist/components/presence/presence.component.js +4 -4
  108. package/dist/components/progressbar/progressbar.component.js +3 -4
  109. package/dist/components/progressbar/progressbar.styles.js +77 -71
  110. package/dist/components/progressspinner/progressspiner.utils.js +4 -4
  111. package/dist/components/progressspinner/progressspinner.component.js +38 -37
  112. package/dist/components/progressspinner/progressspinner.styles.js +1 -1
  113. package/dist/components/radio/radio.component.d.ts +41 -41
  114. package/dist/components/radio/radio.component.js +84 -83
  115. package/dist/components/radio/radio.styles.js +77 -75
  116. package/dist/components/radiogroup/radiogroup.component.js +1 -1
  117. package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +2 -2
  118. package/dist/components/screenreaderannouncer/screenreaderannouncer.styles.js +8 -6
  119. package/dist/components/searchfield/searchfield.component.js +23 -17
  120. package/dist/components/searchfield/searchfield.styles.js +11 -13
  121. package/dist/components/select/select.component.js +20 -23
  122. package/dist/components/select/select.styles.js +9 -9
  123. package/dist/components/sidenavigation/sidenavigation.component.d.ts +6 -6
  124. package/dist/components/sidenavigation/sidenavigation.component.js +39 -29
  125. package/dist/components/sidenavigation/sidenavigation.context.js +5 -5
  126. package/dist/components/sidenavigation/sidenavigation.styles.js +53 -53
  127. package/dist/components/skeleton/skeleton.component.js +1 -4
  128. package/dist/components/skeleton/skeleton.constants.d.ts +1 -1
  129. package/dist/components/skeleton/skeleton.constants.js +1 -1
  130. package/dist/components/skeleton/skeleton.styles.js +4 -4
  131. package/dist/components/spinner/spinner.component.d.ts +7 -7
  132. package/dist/components/spinner/spinner.component.js +9 -9
  133. package/dist/components/spinner/spinner.styles.js +58 -53
  134. package/dist/components/staticcheckbox/staticcheckbox.component.js +10 -8
  135. package/dist/components/staticcheckbox/staticcheckbox.styles.js +52 -51
  136. package/dist/components/staticradio/staticradio.component.d.ts +8 -8
  137. package/dist/components/staticradio/staticradio.component.js +10 -11
  138. package/dist/components/staticradio/staticradio.styles.js +77 -75
  139. package/dist/components/statictoggle/statictoggle.component.d.ts +3 -3
  140. package/dist/components/statictoggle/statictoggle.component.js +3 -3
  141. package/dist/components/statictoggle/statictoggle.styles.js +71 -68
  142. package/dist/components/tab/tab.component.d.ts +1 -1
  143. package/dist/components/tab/tab.component.js +2 -2
  144. package/dist/components/tab/tab.styles.js +247 -245
  145. package/dist/components/tablist/tablist.component.js +11 -15
  146. package/dist/components/tablist/tablist.styles.js +27 -25
  147. package/dist/components/tablist/tablist.types.d.ts +1 -1
  148. package/dist/components/tablist/tablist.utils.js +4 -4
  149. package/dist/components/text/fonts.styles.js +49 -49
  150. package/dist/components/text/text.component.js +21 -11
  151. package/dist/components/text/text.types.d.ts +1 -1
  152. package/dist/components/textarea/textarea.component.d.ts +31 -31
  153. package/dist/components/textarea/textarea.component.js +54 -61
  154. package/dist/components/textarea/textarea.styles.js +123 -122
  155. package/dist/components/themeprovider/themeprovider.component.js +1 -1
  156. package/dist/components/themeprovider/themeprovider.styles.js +4 -4
  157. package/dist/components/toggle/toggle.component.d.ts +35 -35
  158. package/dist/components/toggle/toggle.component.js +62 -63
  159. package/dist/components/toggle/toggle.styles.js +77 -69
  160. package/dist/components/toggletip/toggletip.component.d.ts +7 -7
  161. package/dist/components/toggletip/toggletip.component.js +3 -2
  162. package/dist/components/tooltip/tooltip.component.js +1 -1
  163. package/dist/components/tooltip/tooltip.styles.js +0 -1
  164. package/dist/components/virtualizedlist/virtualizedlist.component.js +6 -14
  165. package/dist/components/virtualizedlist/virtualizedlist.helper.test.d.ts +1 -1
  166. package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +14 -11
  167. package/dist/components/virtualizedlist/virtualizedlist.styles.js +4 -4
  168. package/dist/custom-elements.json +514 -514
  169. package/dist/index.js +1 -0
  170. package/dist/models/component/index.d.ts +1 -1
  171. package/dist/models/index.d.ts +2 -2
  172. package/dist/models/index.js +1 -1
  173. package/dist/react/index.d.ts +4 -4
  174. package/dist/react/index.js +4 -4
  175. package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
  176. package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
  177. package/dist/utils/mixins/FocusTrapMixin.js +12 -12
  178. package/dist/utils/mixins/IconNameMixin.d.ts +1 -1
  179. package/dist/utils/mixins/MenuMixin.js +23 -23
  180. package/dist/utils/mixins/PreventScrollMixin.d.ts +1 -1
  181. package/dist/utils/styles/index.js +12 -12
  182. package/package.json +1 -1
@@ -6,83 +6,85 @@ const styles = css `
6
6
  border-radius: 0.5rem;
7
7
  border: 1px solid var(--mds-color-theme-outline-primary-normal);
8
8
  box-shadow: none;
9
- transition: box-shadow 0.2s;
9
+ transition: box-shadow 0.2s;
10
10
  }
11
- :host([variant='ghost']){
11
+ :host([variant='ghost']) {
12
12
  border-color: transparent;
13
13
  }
14
- :host([orientation="horizontal"]){
14
+ :host([orientation='horizontal']) {
15
15
  max-width: 40rem;
16
16
  }
17
17
 
18
- :host([orientation="vertical"]){
18
+ :host([orientation='vertical']) {
19
19
  max-width: 20rem;
20
20
  flex-direction: column;
21
21
  }
22
-
23
- :host([orientation="vertical"])::part(image){
22
+
23
+ :host([orientation='vertical'])::part(image) {
24
24
  height: 12.5rem;
25
25
  width: 100%;
26
26
  border-top-left-radius: 0.5rem;
27
27
  border-top-right-radius: 0.5rem;
28
28
  }
29
-
30
- :host([orientation="horizontal"])::part(image){
29
+
30
+ :host([orientation='horizontal'])::part(image) {
31
31
  width: 10rem;
32
32
  height: 100%;
33
33
  border-top-left-radius: 0.5rem;
34
34
  border-bottom-left-radius: 0.5rem;
35
35
  }
36
36
 
37
- :host::part(header){
37
+ :host::part(header) {
38
38
  display: flex;
39
39
  gap: 0.5rem;
40
40
  }
41
41
 
42
- :host::part(icon){
42
+ :host::part(icon) {
43
43
  margin-top: 0.25rem;
44
44
  }
45
45
 
46
- :host::part(body){
46
+ :host::part(body) {
47
47
  width: 100%;
48
48
  padding: 1.5rem;
49
49
  display: flex;
50
50
  flex-direction: column;
51
51
  }
52
52
 
53
- ::slotted([slot='body']){
53
+ ::slotted([slot='body']) {
54
54
  padding-bottom: 0.5rem;
55
55
  margin-top: 0.75rem;
56
56
  }
57
57
 
58
- :host([variant='promotional']){
58
+ :host([variant='promotional']) {
59
59
  border-color: var(--mds-color-theme-outline-promotion-normal);
60
60
  }
61
61
 
62
- :host(:dir(ltr))::part(icon-button), :host(:dir(ltr))::part(footer) {
62
+ :host(:dir(ltr))::part(icon-button),
63
+ :host(:dir(ltr))::part(footer) {
63
64
  margin-left: auto;
64
65
  }
65
66
 
66
- :host(:dir(rtl))::part(icon-button), :host(:dir(rtl))::part(footer) {
67
+ :host(:dir(rtl))::part(icon-button),
68
+ :host(:dir(rtl))::part(footer) {
67
69
  margin-right: auto;
68
70
  }
69
71
 
70
- :host::part(icon-button), :host::part(footer) {
72
+ :host::part(icon-button),
73
+ :host::part(footer) {
71
74
  display: flex;
72
75
  gap: 0.5rem;
73
76
  align-items: center;
74
77
  justify-content: center;
75
78
  }
76
79
 
77
- :host::part(footer){
80
+ :host::part(footer) {
78
81
  gap: 1rem;
79
82
  }
80
-
81
- ::slotted([slot='footer-link']),
82
- ::slotted([slot='footer-button-primary']),
83
- ::slotted([slot='footer-button-secondary']){
83
+
84
+ ::slotted([slot='footer-link']),
85
+ ::slotted([slot='footer-button-primary']),
86
+ ::slotted([slot='footer-button-secondary']) {
84
87
  margin-bottom: 0.5rem;
85
88
  }
86
-
87
89
  `;
88
90
  export default [hostFitContentStyles, styles];
@@ -1,8 +1,8 @@
1
1
  import { html, nothing } from 'lit';
2
- import styles from './cardbutton.styles';
3
2
  import Buttonsimple from '../buttonsimple/buttonsimple.component';
4
3
  import Card from '../card/card.component';
5
4
  import { CardComponentMixin } from '../../utils/mixins/CardComponentMixin';
5
+ import styles from './cardbutton.styles';
6
6
  /**
7
7
  * cardbutton component looks like a card and behaves as a button component.
8
8
  *
@@ -40,21 +40,18 @@ class CardButton extends CardComponentMixin(Buttonsimple) {
40
40
  if (!this.cardTitle) {
41
41
  return nothing;
42
42
  }
43
- return html `<div part="header">
44
- ${this.renderIcon()}
45
- ${this.renderTitle()}
46
- </div>`;
43
+ return html `<div part="header">${this.renderIcon()} ${this.renderTitle()}</div>`;
47
44
  }
48
45
  render() {
49
46
  return html `
50
47
  ${this.renderImage()}
51
- <div part="body">
52
- ${this.renderHeader()}
53
- <slot name="before-body"></slot>
54
- <slot name="body"></slot>
55
- <slot name="after-body"></slot>
56
- </div>
57
- `;
48
+ <div part="body">
49
+ ${this.renderHeader()}
50
+ <slot name="before-body"></slot>
51
+ <slot name="body"></slot>
52
+ <slot name="after-body"></slot>
53
+ </div>
54
+ `;
58
55
  }
59
56
  }
60
57
  CardButton.styles = [...Card.styles, ...styles];
@@ -19,7 +19,7 @@ const styles = css `
19
19
  color: var(--mds-color-theme-text-primary-disabled);
20
20
  }
21
21
 
22
- :host([disabled])::part(image){
22
+ :host([disabled])::part(image) {
23
23
  opacity: 0.5;
24
24
  }
25
25
  `;
@@ -34,14 +34,14 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
34
34
  */
35
35
  declare class CardCheckbox extends CardCheckbox_base {
36
36
  /**
37
- * The checked state of the card
38
- * @default false
39
- */
37
+ * The checked state of the card
38
+ * @default false
39
+ */
40
40
  checked: boolean;
41
41
  /**
42
- * The selection type of the card. It can either be set to 'check' or 'checkbox'
43
- * @default 'check'
44
- */
42
+ * The selection type of the card. It can either be set to 'check' or 'checkbox'
43
+ * @default 'check'
44
+ */
45
45
  selectionType: SelectionType;
46
46
  constructor();
47
47
  connectedCallback(): void;
@@ -9,12 +9,12 @@ 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 './cardcheckbox.styles';
13
12
  import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
14
13
  import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
15
14
  import Card from '../card/card.component';
16
- import { CHECK_MARK, DEFAULTS, SELECTION_TYPE } from './cardcheckbox.constants';
17
15
  import { ROLE } from '../../utils/roles';
16
+ import { CHECK_MARK, DEFAULTS, SELECTION_TYPE } from './cardcheckbox.constants';
17
+ import styles from './cardcheckbox.styles';
18
18
  /**
19
19
  * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.
20
20
  *
@@ -49,14 +49,14 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
49
49
  constructor() {
50
50
  super();
51
51
  /**
52
- * The checked state of the card
53
- * @default false
54
- */
52
+ * The checked state of the card
53
+ * @default false
54
+ */
55
55
  this.checked = false;
56
56
  /**
57
- * The selection type of the card. It can either be set to 'check' or 'checkbox'
58
- * @default 'check'
59
- */
57
+ * The selection type of the card. It can either be set to 'check' or 'checkbox'
58
+ * @default 'check'
59
+ */
60
60
  this.selectionType = DEFAULTS.SELECTION_TYPE;
61
61
  this.addEventListener('click', this.toggleChecked);
62
62
  this.addEventListener('keydown', this.toggleOnEnter);
@@ -110,17 +110,22 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
110
110
  const ICON_NAME = this.checked ? CHECK_MARK.CHECKED : CHECK_MARK.DEFAULT;
111
111
  switch (this.selectionType) {
112
112
  case SELECTION_TYPE.CHECK: {
113
- return html `<mdc-icon part="check check-icon"
114
- size="${DEFAULTS.ICON_SIZE}"
115
- length-unit="${DEFAULTS.ICON_LENGTH_UNIT}"
116
- name="${ICON_NAME}"></mdc-icon>`;
113
+ return html `<mdc-icon
114
+ part="check check-icon"
115
+ size="${DEFAULTS.ICON_SIZE}"
116
+ length-unit="${DEFAULTS.ICON_LENGTH_UNIT}"
117
+ name="${ICON_NAME}"
118
+ ></mdc-icon>`;
117
119
  }
118
120
  case SELECTION_TYPE.CHECKBOX: {
119
- return html `<mdc-staticcheckbox part="check"
120
- ?checked="${this.checked}"
121
- ?disabled="${this.disabled}"></mdc-staticcheckbox>`;
121
+ return html `<mdc-staticcheckbox
122
+ part="check"
123
+ ?checked="${this.checked}"
124
+ ?disabled="${this.disabled}"
125
+ ></mdc-staticcheckbox>`;
122
126
  }
123
- default: return nothing;
127
+ default:
128
+ return nothing;
124
129
  }
125
130
  }
126
131
  /**
@@ -131,22 +136,18 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
131
136
  if (!this.cardTitle) {
132
137
  return nothing;
133
138
  }
134
- return html `<div part="header">
135
- ${this.renderIcon()}
136
- ${this.renderTitle()}
137
- ${this.renderSelection()}
138
- </div>`;
139
+ return html `<div part="header">${this.renderIcon()} ${this.renderTitle()} ${this.renderSelection()}</div>`;
139
140
  }
140
141
  render() {
141
142
  return html `
142
- ${this.renderImage()}
143
- <div part="body">
144
- ${this.renderHeader()}
145
- <slot name="before-body"></slot>
146
- <slot name="body"></slot>
147
- <slot name="after-body"></slot>
148
- </div>
149
- `;
143
+ ${this.renderImage()}
144
+ <div part="body">
145
+ ${this.renderHeader()}
146
+ <slot name="before-body"></slot>
147
+ <slot name="body"></slot>
148
+ <slot name="after-body"></slot>
149
+ </div>
150
+ `;
150
151
  }
151
152
  }
152
153
  CardCheckbox.styles = [...Card.styles, ...styles];
@@ -6,11 +6,11 @@ const styles = css `
6
6
  user-select: none;
7
7
  }
8
8
 
9
- :host(:dir(ltr))::part(check){
9
+ :host(:dir(ltr))::part(check) {
10
10
  margin-left: auto;
11
11
  }
12
12
 
13
- :host(:dir(rtl))::part(check){
13
+ :host(:dir(rtl))::part(check) {
14
14
  margin-right: auto;
15
15
  }
16
16
 
@@ -22,25 +22,25 @@ const styles = css `
22
22
  background-color: var(--mds-color-theme-background-primary-active);
23
23
  }
24
24
 
25
- :host([checked]){
25
+ :host([checked]) {
26
26
  border: 1px solid var(--mds-color-theme-outline-input-active);
27
27
  box-shadow: 0 0 0 1px var(--mds-color-theme-outline-input-active);
28
28
  background-color: var(--mds-color-theme-background-primary-active);
29
29
  }
30
30
 
31
- :host([checked]:hover){
31
+ :host([checked]:hover) {
32
32
  background-color: var(--mds-color-theme-background-primary-hover);
33
33
  }
34
34
 
35
- :host([checked]:active){
35
+ :host([checked]:active) {
36
36
  background-color: var(--mds-color-theme-background-primary-ghost);
37
37
  }
38
38
 
39
- :host::part(check-icon){
39
+ :host::part(check-icon) {
40
40
  color: var(--mds-color-theme-text-secondary-normal);
41
41
  }
42
42
 
43
- :host([checked])::part(check-icon){
43
+ :host([checked])::part(check-icon) {
44
44
  color: var(--mds-color-theme-text-accent-normal);
45
45
  }
46
46
 
@@ -50,11 +50,11 @@ const styles = css `
50
50
  border-color: var(--mds-color-theme-outline-primary-disabled);
51
51
  }
52
52
 
53
- :host([disabled])::part(image){
53
+ :host([disabled])::part(image) {
54
54
  opacity: 0.5;
55
55
  }
56
-
57
- :host([disabled])::part(check-icon){
56
+
57
+ :host([disabled])::part(check-icon) {
58
58
  color: var(--mds-color-theme-text-primary-disabled);
59
59
  }
60
60
  `;
@@ -33,26 +33,26 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
33
33
  */
34
34
  declare class CardRadio extends CardRadio_base {
35
35
  /**
36
- * The checked state of the card
37
- * @default false
38
- */
36
+ * The checked state of the card
37
+ * @default false
38
+ */
39
39
  checked: boolean;
40
40
  /**
41
- * The name of the radio.
42
- * @default ''
43
- */
41
+ * The name of the radio.
42
+ * @default ''
43
+ */
44
44
  name: string;
45
45
  constructor();
46
46
  connectedCallback(): void;
47
47
  /**
48
- * Returns all cards within the same group (name).
49
- */
48
+ * Returns all cards within the same group (name).
49
+ */
50
50
  private getAllCardsWithinSameGroup;
51
51
  /**
52
- * Handles the change event on the radio element.
53
- * This will toggle the state of the radio element.
54
- * Dispatches the change event.
55
- */
52
+ * Handles the change event on the radio element.
53
+ * This will toggle the state of the radio element.
54
+ * Dispatches the change event.
55
+ */
56
56
  private toggleChecked;
57
57
  setDisabled(disabled: boolean): void;
58
58
  update(changedProperties: PropertyValues<CardRadio>): void;
@@ -10,11 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  /* eslint-disable no-param-reassign */
11
11
  import { html, nothing } from 'lit';
12
12
  import { property } from 'lit/decorators.js';
13
- import styles from './cardradio.styles';
14
13
  import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
15
14
  import { TabIndexMixin } from '../../utils/mixins/TabIndexMixin';
16
15
  import Card from '../card/card.component';
17
16
  import { ROLE } from '../../utils/roles';
17
+ import styles from './cardradio.styles';
18
18
  /**
19
19
  * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.
20
20
  *
@@ -49,14 +49,14 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
49
49
  constructor() {
50
50
  super();
51
51
  /**
52
- * The checked state of the card
53
- * @default false
54
- */
52
+ * The checked state of the card
53
+ * @default false
54
+ */
55
55
  this.checked = false;
56
56
  /**
57
- * The name of the radio.
58
- * @default ''
59
- */
57
+ * The name of the radio.
58
+ * @default ''
59
+ */
60
60
  this.name = '';
61
61
  this.addEventListener('click', this.toggleChecked);
62
62
  this.addEventListener('keydown', this.toggleOnEnter);
@@ -67,24 +67,24 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
67
67
  this.role = ROLE.RADIO;
68
68
  }
69
69
  /**
70
- * Returns all cards within the same group (name).
71
- */
70
+ * Returns all cards within the same group (name).
71
+ */
72
72
  getAllCardsWithinSameGroup() {
73
73
  return Array.from(document.querySelectorAll(`mdc-cardradio[name="${this.name}"]`));
74
74
  }
75
75
  /**
76
- * Handles the change event on the radio element.
77
- * This will toggle the state of the radio element.
78
- * Dispatches the change event.
79
- */
76
+ * Handles the change event on the radio element.
77
+ * This will toggle the state of the radio element.
78
+ * Dispatches the change event.
79
+ */
80
80
  toggleChecked() {
81
81
  if (this.disabled)
82
82
  return;
83
83
  const cards = this.getAllCardsWithinSameGroup();
84
- cards.forEach((card) => {
84
+ cards.forEach(card => {
85
85
  /**
86
86
  * Uncheck all cards in the same group (name)
87
- */
87
+ */
88
88
  card.checked = false;
89
89
  });
90
90
  this.checked = true;
@@ -114,7 +114,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
114
114
  if (this.disabled)
115
115
  return;
116
116
  const cards = this.getAllCardsWithinSameGroup();
117
- const enabledCards = cards.filter((card) => !card.disabled);
117
+ const enabledCards = cards.filter(card => !card.disabled);
118
118
  const currentIndex = enabledCards.indexOf(this);
119
119
  if (['ArrowDown', 'ArrowRight'].includes(event.key)) {
120
120
  // Move focus to the next radio
@@ -148,23 +148,20 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
148
148
  return nothing;
149
149
  }
150
150
  return html `<div part="header">
151
- ${this.renderIcon()}
152
- ${this.renderTitle()}
153
- <mdc-staticradio part="check"
154
- ?checked="${this.checked}"
155
- ?disabled="${this.disabled}"></mdc-staticradio>
156
- </div>`;
151
+ ${this.renderIcon()} ${this.renderTitle()}
152
+ <mdc-staticradio part="check" ?checked="${this.checked}" ?disabled="${this.disabled}"></mdc-staticradio>
153
+ </div>`;
157
154
  }
158
155
  render() {
159
156
  return html `
160
- ${this.renderImage()}
161
- <div part="body">
162
- ${this.renderHeader()}
163
- <slot name="before-body"></slot>
164
- <slot name="body"></slot>
165
- <slot name="after-body"></slot>
166
- </div>
167
- `;
157
+ ${this.renderImage()}
158
+ <div part="body">
159
+ ${this.renderHeader()}
160
+ <slot name="before-body"></slot>
161
+ <slot name="body"></slot>
162
+ <slot name="after-body"></slot>
163
+ </div>
164
+ `;
168
165
  }
169
166
  }
170
167
  CardRadio.styles = [...Card.styles, ...styles];
@@ -6,11 +6,11 @@ const styles = css `
6
6
  user-select: none;
7
7
  }
8
8
 
9
- :host(:dir(ltr))::part(check){
9
+ :host(:dir(ltr))::part(check) {
10
10
  margin-left: auto;
11
11
  }
12
12
 
13
- :host(:dir(rtl))::part(check){
13
+ :host(:dir(rtl))::part(check) {
14
14
  margin-right: auto;
15
15
  }
16
16
 
@@ -22,25 +22,25 @@ const styles = css `
22
22
  background-color: var(--mds-color-theme-background-primary-active);
23
23
  }
24
24
 
25
- :host([checked]){
25
+ :host([checked]) {
26
26
  border: 1px solid var(--mds-color-theme-outline-input-active);
27
27
  box-shadow: 0 0 0 1px var(--mds-color-theme-outline-input-active);
28
28
  background-color: var(--mds-color-theme-background-primary-active);
29
29
  }
30
30
 
31
- :host([checked]:hover){
31
+ :host([checked]:hover) {
32
32
  background-color: var(--mds-color-theme-background-primary-hover);
33
33
  }
34
34
 
35
- :host([checked]:active){
35
+ :host([checked]:active) {
36
36
  background-color: var(--mds-color-theme-background-primary-ghost);
37
37
  }
38
38
 
39
- :host::part(check-icon){
39
+ :host::part(check-icon) {
40
40
  color: var(--mds-color-theme-text-secondary-normal);
41
41
  }
42
42
 
43
- :host([checked])::part(check-icon){
43
+ :host([checked])::part(check-icon) {
44
44
  color: var(--mds-color-theme-text-accent-normal);
45
45
  }
46
46
 
@@ -50,7 +50,7 @@ const styles = css `
50
50
  border-color: var(--mds-color-theme-outline-primary-disabled);
51
51
  }
52
52
 
53
- :host([disabled])::part(image){
53
+ :host([disabled])::part(image) {
54
54
  opacity: 0.5;
55
55
  }
56
56
  `;
@@ -66,10 +66,7 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
66
66
  this.renderLabelAndHelperText = () => {
67
67
  if (!this.label)
68
68
  return nothing;
69
- return html `<div class="text-container">
70
- ${this.renderLabel()}
71
- ${this.renderHelperText()}
72
- </div>`;
69
+ return html `<div class="text-container">${this.renderLabel()} ${this.renderHelperText()}</div>`;
73
70
  };
74
71
  }
75
72
  connectedCallback() {
@@ -165,11 +162,12 @@ class Checkbox extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
165
162
  render() {
166
163
  var _a;
167
164
  return html `
168
- <mdc-staticcheckbox
169
- class="mdc-focus-ring"
170
- ?checked="${this.checked}"
171
- ?indeterminate="${this.indeterminate}"
172
- ?disabled="${this.disabled}">
165
+ <mdc-staticcheckbox
166
+ class="mdc-focus-ring"
167
+ ?checked="${this.checked}"
168
+ ?indeterminate="${this.indeterminate}"
169
+ ?disabled="${this.disabled}"
170
+ >
173
171
  <input
174
172
  id="${this.id}"
175
173
  type="checkbox"