@momentum-design/components 0.102.0 → 0.102.1
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/dist/browser/index.js +25 -18
- package/dist/browser/index.js.map +2 -2
- package/dist/components/listitem/listitem.component.d.ts +7 -1
- package/dist/components/listitem/listitem.component.js +22 -14
- package/dist/components/listitem/listitem.styles.js +10 -5
- package/dist/custom-elements.json +830 -610
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +4 -4
- package/dist/react/listitem/index.d.ts +7 -1
- package/dist/react/listitem/index.js +7 -1
- package/package.json +1 -1
@@ -32,6 +32,8 @@ declare const ListItem_base: import("../../utils/mixins/index.types").Constructo
|
|
32
32
|
* @slot trailing-text-side-header - slot for list item side header text.
|
33
33
|
* @slot trailing-text-subline - slot for list item subline text.
|
34
34
|
* @slot trailing-controls - slot for list item controls to appear of trailing end.
|
35
|
+
* @slot content - content slot can be used to override the content completely. Be aware that
|
36
|
+
* this will override the default content of the list item.
|
35
37
|
*
|
36
38
|
* @cssproperty --mdc-listitem-default-background-color - Allows customization of the default background color.
|
37
39
|
* @cssproperty --mdc-listitem-background-color-hover - Allows customization of the background color on hover.
|
@@ -42,7 +44,11 @@ declare const ListItem_base: import("../../utils/mixins/index.types").Constructo
|
|
42
44
|
* - Allows customization of the secondary and tertiary label text slot color.
|
43
45
|
* @cssproperty --mdc-listitem-disabled-color - Allows customization of the disabled color.
|
44
46
|
* @cssproperty --mdc-listitem-column-gap - Allows customization of column gap.
|
45
|
-
* @cssproperty --mdc-listitem-padding-left-
|
47
|
+
* @cssproperty --mdc-listitem-padding-left-right - Allows customization of padding left and right.
|
48
|
+
* @cssproperty --mdc-listitem-padding-top-bottom - Allows customization of padding top and bottom.
|
49
|
+
* @cssproperty --mdc-listitem-cursor - Allows customization of the cursor.
|
50
|
+
* @cssproperty --mdc-listitem-width - Allows customization of the width of the list item.
|
51
|
+
* @cssproperty --mdc-listitem-height - Allows customization of the height of the list item.
|
46
52
|
*
|
47
53
|
* @event click - (React: onClick) This event is dispatched when the listitem is clicked.
|
48
54
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the listitem.
|
@@ -48,6 +48,8 @@ import { ListItemEventManager } from './listitem.events';
|
|
48
48
|
* @slot trailing-text-side-header - slot for list item side header text.
|
49
49
|
* @slot trailing-text-subline - slot for list item subline text.
|
50
50
|
* @slot trailing-controls - slot for list item controls to appear of trailing end.
|
51
|
+
* @slot content - content slot can be used to override the content completely. Be aware that
|
52
|
+
* this will override the default content of the list item.
|
51
53
|
*
|
52
54
|
* @cssproperty --mdc-listitem-default-background-color - Allows customization of the default background color.
|
53
55
|
* @cssproperty --mdc-listitem-background-color-hover - Allows customization of the background color on hover.
|
@@ -58,7 +60,11 @@ import { ListItemEventManager } from './listitem.events';
|
|
58
60
|
* - Allows customization of the secondary and tertiary label text slot color.
|
59
61
|
* @cssproperty --mdc-listitem-disabled-color - Allows customization of the disabled color.
|
60
62
|
* @cssproperty --mdc-listitem-column-gap - Allows customization of column gap.
|
61
|
-
* @cssproperty --mdc-listitem-padding-left-
|
63
|
+
* @cssproperty --mdc-listitem-padding-left-right - Allows customization of padding left and right.
|
64
|
+
* @cssproperty --mdc-listitem-padding-top-bottom - Allows customization of padding top and bottom.
|
65
|
+
* @cssproperty --mdc-listitem-cursor - Allows customization of the cursor.
|
66
|
+
* @cssproperty --mdc-listitem-width - Allows customization of the width of the list item.
|
67
|
+
* @cssproperty --mdc-listitem-height - Allows customization of the height of the list item.
|
62
68
|
*
|
63
69
|
* @event click - (React: onClick) This event is dispatched when the listitem is clicked.
|
64
70
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the listitem.
|
@@ -252,21 +258,23 @@ class ListItem extends DisabledMixin(TabIndexMixin(Component)) {
|
|
252
258
|
}
|
253
259
|
render() {
|
254
260
|
return html `
|
255
|
-
<
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
+
<slot name="content">
|
262
|
+
<div part="leading">
|
263
|
+
${this.renderLeadingControls()}
|
264
|
+
<div part="leading-text">
|
265
|
+
${this.getText('leading-text-primary-label', TYPE.BODY_MIDSIZE_REGULAR, this.label)}
|
266
|
+
${this.getText('leading-text-secondary-label', TYPE.BODY_SMALL_REGULAR, this.secondaryLabel)}
|
267
|
+
${this.getText('leading-text-tertiary-label', TYPE.BODY_SMALL_REGULAR, this.tertiaryLabel)}
|
268
|
+
</div>
|
261
269
|
</div>
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
270
|
+
<div part="trailing">
|
271
|
+
<div part="trailing-text">
|
272
|
+
${this.getText('trailing-text-side-header', TYPE.BODY_MIDSIZE_REGULAR, this.sideHeaderText)}
|
273
|
+
${this.getText('trailing-text-subline', TYPE.BODY_SMALL_REGULAR, this.sublineText)}
|
274
|
+
</div>
|
275
|
+
${this.renderTrailingControls()}
|
267
276
|
</div>
|
268
|
-
|
269
|
-
</div>
|
277
|
+
</slot>
|
270
278
|
`;
|
271
279
|
}
|
272
280
|
}
|
@@ -9,16 +9,21 @@ const styles = css `
|
|
9
9
|
--mdc-listitem-secondary-label-color: var(--mds-color-theme-text-secondary-normal);
|
10
10
|
--mdc-listitem-disabled-color: var(--mds-color-theme-text-primary-disabled);
|
11
11
|
--mdc-listitem-column-gap: 0.75rem;
|
12
|
-
--mdc-listitem-padding-left-
|
12
|
+
--mdc-listitem-padding-left-right: 0.75rem;
|
13
|
+
--mdc-listitem-padding-top-bottom: 0.5rem;
|
14
|
+
--mdc-listitem-cursor: pointer;
|
15
|
+
--mdc-listitem-width: 100%;
|
16
|
+
--mdc-listitem-height: auto;
|
13
17
|
}
|
14
18
|
:host {
|
15
19
|
background-color: var(--mdc-listitem-default-background-color);
|
16
20
|
column-gap: var(--mdc-listitem-column-gap);
|
17
|
-
cursor: pointer;
|
18
21
|
display: flex;
|
19
22
|
flex-direction: row;
|
20
|
-
|
21
|
-
|
23
|
+
cursor: var(--mdc-listitem-cursor);
|
24
|
+
padding: var(--mdc-listitem-padding-top-bottom) var(--mdc-listitem-padding-left-right);
|
25
|
+
width: var(--mdc-listitem-width);
|
26
|
+
height: var(--mdc-listitem-height);
|
22
27
|
}
|
23
28
|
:host([variant='inset-rectangle']) {
|
24
29
|
border-radius: 0.5rem;
|
@@ -29,7 +34,7 @@ const styles = css `
|
|
29
34
|
:host::part(leading-text) {
|
30
35
|
flex: 1;
|
31
36
|
/** 2x of column gap on both ends of the listitem - 100% width */
|
32
|
-
width: calc(100% - (2 * var(--mdc-listitem-padding-left-
|
37
|
+
width: calc(100% - (2 * var(--mdc-listitem-padding-left-right)));
|
33
38
|
}
|
34
39
|
:host::part(leading-text-primary-label),
|
35
40
|
:host::part(leading-text-secondary-label),
|