@momentum-design/components 0.122.13 → 0.122.15
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 +68 -50
- package/dist/browser/index.js.map +4 -4
- package/dist/components/alertchip/alertchip.component.d.ts +2 -1
- package/dist/components/alertchip/alertchip.component.js +3 -2
- package/dist/components/alertchip/alertchip.styles.js +4 -0
- package/dist/components/chip/chip.component.js +1 -1
- package/dist/components/listitem/listitem.component.d.ts +9 -0
- package/dist/components/listitem/listitem.component.js +5 -1
- package/dist/components/listitem/listitem.styles.js +4 -0
- package/dist/components/staticchip/staticchip.component.js +1 -1
- package/dist/components/staticchip/staticchip.styles.js +10 -0
- package/dist/custom-elements.json +1436 -1265
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import Buttonsimple from '../buttonsimple/buttonsimple.component';
|
|
3
3
|
import type { VariantType } from './alertchip.types';
|
|
4
|
+
declare const AlertChip_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/IconNameMixin").IconNameMixinInterface> & typeof Buttonsimple;
|
|
4
5
|
/**
|
|
5
6
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
6
7
|
*
|
|
@@ -27,7 +28,7 @@ import type { VariantType } from './alertchip.types';
|
|
|
27
28
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the chip.
|
|
28
29
|
* @event focus - (React: onFocus) This event is dispatched when the chip receives focus.
|
|
29
30
|
*/
|
|
30
|
-
declare class AlertChip extends
|
|
31
|
+
declare class AlertChip extends AlertChip_base {
|
|
31
32
|
/**
|
|
32
33
|
* The variant of the alertchip. It supports 5 variants
|
|
33
34
|
* - neutral
|
|
@@ -11,6 +11,7 @@ import { html, nothing } from 'lit';
|
|
|
11
11
|
import { property } from 'lit/decorators.js';
|
|
12
12
|
import { Component } from '../../models';
|
|
13
13
|
import Buttonsimple from '../buttonsimple/buttonsimple.component';
|
|
14
|
+
import { IconNameMixin } from '../../utils/mixins/IconNameMixin';
|
|
14
15
|
import styles from './alertchip.styles';
|
|
15
16
|
import { DEFAULTS } from './alertchip.constants';
|
|
16
17
|
import { getAlertIcon } from './alertchip.utils';
|
|
@@ -40,7 +41,7 @@ import { getAlertIcon } from './alertchip.utils';
|
|
|
40
41
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the chip.
|
|
41
42
|
* @event focus - (React: onFocus) This event is dispatched when the chip receives focus.
|
|
42
43
|
*/
|
|
43
|
-
class AlertChip extends Buttonsimple {
|
|
44
|
+
class AlertChip extends IconNameMixin(Buttonsimple) {
|
|
44
45
|
constructor() {
|
|
45
46
|
super(...arguments);
|
|
46
47
|
/**
|
|
@@ -72,7 +73,7 @@ class AlertChip extends Buttonsimple {
|
|
|
72
73
|
}
|
|
73
74
|
render() {
|
|
74
75
|
return html `
|
|
75
|
-
<mdc-icon part="icon" name="${getAlertIcon(this.variant)}" length-unit="rem" size="1"></mdc-icon>
|
|
76
|
+
<mdc-icon part="icon" name="${this.iconName || getAlertIcon(this.variant)}" length-unit="rem" size="1"></mdc-icon>
|
|
76
77
|
${this.label
|
|
77
78
|
? html `<mdc-text part="label" type="${DEFAULTS.TEXT_TYPE}" tagname="${DEFAULTS.TAG_NAME}"
|
|
78
79
|
>${this.label}</mdc-text
|
|
@@ -21,10 +21,14 @@ const styles = css `
|
|
|
21
21
|
|
|
22
22
|
:host::part(label) {
|
|
23
23
|
color: var(--mdc-chip-color);
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
overflow: hidden;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
:host::part(icon) {
|
|
27
30
|
color: var(--mdc-chip-icon-color);
|
|
31
|
+
flex-shrink: 0;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
:host([variant='neutral']:hover) {
|
|
@@ -83,7 +83,7 @@ class Chip extends IconNameMixin(Buttonsimple) {
|
|
|
83
83
|
renderIcon() {
|
|
84
84
|
if (!this.iconName)
|
|
85
85
|
return nothing;
|
|
86
|
-
return html ` <mdc-icon name="${this.iconName}" length-unit="rem" size="1"></mdc-icon> `;
|
|
86
|
+
return html ` <mdc-icon part="icon" name="${this.iconName}" length-unit="rem" size="1"></mdc-icon> `;
|
|
87
87
|
}
|
|
88
88
|
render() {
|
|
89
89
|
return html `
|
|
@@ -116,6 +116,15 @@ declare class ListItem extends ListItem_base {
|
|
|
116
116
|
* @default undefined
|
|
117
117
|
*/
|
|
118
118
|
dataIndex?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Indicates whether the list item is active.
|
|
121
|
+
* When set to true, the list item appears in a active state.
|
|
122
|
+
*
|
|
123
|
+
* NOTE: this is a visual state only, it does not affect the behavior or a11y of the list item.
|
|
124
|
+
*
|
|
125
|
+
* @default undefined
|
|
126
|
+
*/
|
|
127
|
+
active?: boolean;
|
|
119
128
|
constructor();
|
|
120
129
|
connectedCallback(): void;
|
|
121
130
|
/**
|
|
@@ -230,7 +230,7 @@ class ListItem extends DisabledMixin(TabIndexMixin(LifeCycleMixin(Component))) {
|
|
|
230
230
|
<div part="leading">
|
|
231
231
|
${this.renderLeadingControls()}
|
|
232
232
|
<div part="leading-text">
|
|
233
|
-
${this.getText('leading-text-primary-label', TYPE.BODY_MIDSIZE_REGULAR, this.label)}
|
|
233
|
+
${this.getText('leading-text-primary-label', this.active ? TYPE.BODY_MIDSIZE_BOLD : TYPE.BODY_MIDSIZE_REGULAR, this.label)}
|
|
234
234
|
${this.getText('leading-text-secondary-label', TYPE.BODY_SMALL_REGULAR, this.secondaryLabel)}
|
|
235
235
|
${this.getText('leading-text-tertiary-label', TYPE.BODY_SMALL_REGULAR, this.tertiaryLabel)}
|
|
236
236
|
</div>
|
|
@@ -287,4 +287,8 @@ __decorate([
|
|
|
287
287
|
property({ type: Number, reflect: true, attribute: 'data-index' }),
|
|
288
288
|
__metadata("design:type", Number)
|
|
289
289
|
], ListItem.prototype, "dataIndex", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
property({ type: Boolean, reflect: true, attribute: 'active' }),
|
|
292
|
+
__metadata("design:type", Boolean)
|
|
293
|
+
], ListItem.prototype, "active", void 0);
|
|
290
294
|
export default ListItem;
|
|
@@ -3,6 +3,7 @@ import { hostFocusRingStyles } from '../../utils/styles';
|
|
|
3
3
|
const styles = css `
|
|
4
4
|
:host {
|
|
5
5
|
--mdc-listitem-default-background-color: var(--mds-color-theme-background-primary-ghost);
|
|
6
|
+
--mdc-listitem-default-active-background-color: var(--mds-color-theme-background-primary-active);
|
|
6
7
|
--mdc-listitem-background-color-hover: var(--mds-color-theme-background-primary-hover);
|
|
7
8
|
--mdc-listitem-background-color-active: var(--mds-color-theme-background-primary-active);
|
|
8
9
|
--mdc-listitem-primary-label-color: var(--mds-color-theme-text-primary-normal);
|
|
@@ -62,6 +63,9 @@ const styles = css `
|
|
|
62
63
|
color: var(--mdc-listitem-disabled-color);
|
|
63
64
|
cursor: default;
|
|
64
65
|
}
|
|
66
|
+
:host([active]) {
|
|
67
|
+
background-color: var(--mdc-listitem-default-active-background-color);
|
|
68
|
+
}
|
|
65
69
|
:host(:hover) {
|
|
66
70
|
background-color: var(--mdc-listitem-background-color-hover);
|
|
67
71
|
}
|
|
@@ -65,7 +65,7 @@ class StaticChip extends IconNameMixin(Component) {
|
|
|
65
65
|
renderIcon() {
|
|
66
66
|
if (!this.iconName)
|
|
67
67
|
return nothing;
|
|
68
|
-
return html ` <mdc-icon name="${this.iconName}" length-unit="rem" size="1"></mdc-icon> `;
|
|
68
|
+
return html ` <mdc-icon part="icon" name="${this.iconName}" length-unit="rem" size="1"></mdc-icon> `;
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
71
|
return html `
|
|
@@ -18,6 +18,16 @@ const styles = css `
|
|
|
18
18
|
background-color: var(--mdc-chip-background-color);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
:host::part(icon) {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host::part(label) {
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
:host([color='cobalt']) {
|
|
22
32
|
--mdc-chip-border-color: var(--mds-color-theme-outline-theme-normal);
|
|
23
33
|
--mdc-chip-background-color: var(--mds-color-theme-background-label-cobalt-normal);
|