@momentum-design/components 0.120.22 → 0.120.24
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 +14 -16
- package/dist/browser/index.js.map +3 -3
- package/dist/components/option/option.component.d.ts +3 -2
- package/dist/components/option/option.component.js +12 -15
- package/dist/components/option/option.styles.js +0 -4
- package/dist/components/tab/tab.component.js +3 -1
- package/dist/custom-elements.json +627 -603
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { CSSResult, PropertyValues } from 'lit';
|
1
|
+
import type { CSSResult, PropertyValues, TemplateResult } from 'lit';
|
2
2
|
import type { IconNames } from '../icon/icon.types';
|
3
3
|
import ListItem from '../listitem/listitem.component';
|
4
4
|
declare const Option_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/FormInternalsMixin").FormInternalsMixinInterface> & typeof ListItem;
|
@@ -50,7 +50,8 @@ declare class Option extends Option_base {
|
|
50
50
|
ariaLabel: string | null;
|
51
51
|
connectedCallback(): void;
|
52
52
|
update(changedProperties: PropertyValues): void;
|
53
|
-
|
53
|
+
private renderIcon;
|
54
|
+
render(): TemplateResult<1>;
|
54
55
|
static styles: Array<CSSResult>;
|
55
56
|
}
|
56
57
|
export default Option;
|
@@ -9,7 +9,6 @@ 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 { ifDefined } from 'lit/directives/if-defined.js';
|
13
12
|
import { FormInternalsMixin } from '../../utils/mixins/FormInternalsMixin';
|
14
13
|
import { ROLE } from '../../utils/roles';
|
15
14
|
import ListItem from '../listitem/listitem.component';
|
@@ -80,22 +79,20 @@ class Option extends FormInternalsMixin(ListItem) {
|
|
80
79
|
this.dispatchModifiedEvent(this.selected ? 'selected' : 'unselected');
|
81
80
|
}
|
82
81
|
}
|
82
|
+
renderIcon(slotName, iconName) {
|
83
|
+
return html ` <mdc-icon length-unit="rem" slot="${slotName}" name="${iconName}"></mdc-icon> `;
|
84
|
+
}
|
83
85
|
render() {
|
84
|
-
const
|
85
|
-
? html `
|
86
|
-
<div part="leading-icon">
|
87
|
-
<mdc-icon length-unit="rem" slot="leading-controls" name="${ifDefined(this.prefixIcon)}"></mdc-icon>
|
88
|
-
</div>
|
89
|
-
`
|
90
|
-
: nothing;
|
91
|
-
const trailingContent = this.selected
|
92
|
-
? html ` <mdc-icon length-unit="rem" slot="trailing-controls" name="${SELECTED_ICON_NAME}"></mdc-icon> `
|
93
|
-
: nothing;
|
86
|
+
const trailingContent = this.selected ? this.renderIcon('trailing-controls', SELECTED_ICON_NAME) : nothing;
|
94
87
|
return html `
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
88
|
+
<div part="leading">
|
89
|
+
<slot name="leading-controls">
|
90
|
+
${this.prefixIcon ? this.renderIcon('leading-controls', this.prefixIcon) : nothing}
|
91
|
+
</slot>
|
92
|
+
<div part="leading-text">
|
93
|
+
${this.getText('leading-text-primary-label', TYPE.BODY_MIDSIZE_REGULAR, this.label)}
|
94
|
+
${this.getText('leading-text-secondary-label', TYPE.BODY_SMALL_REGULAR, this.secondaryLabel)}
|
95
|
+
</div>
|
99
96
|
</div>
|
100
97
|
<div part="trailing">${trailingContent}</div>
|
101
98
|
`;
|
@@ -9,7 +9,6 @@ const styles = [
|
|
9
9
|
flex-shrink: 0;
|
10
10
|
}
|
11
11
|
|
12
|
-
:host::part(leading-icon),
|
13
12
|
:host::part(trailing) {
|
14
13
|
display: flex;
|
15
14
|
align-items: center;
|
@@ -20,9 +19,6 @@ const styles = [
|
|
20
19
|
flex: 1;
|
21
20
|
}
|
22
21
|
|
23
|
-
:host::part(leading-icon) {
|
24
|
-
margin-inline-end: var(--mdc-listitem-column-gap);
|
25
|
-
}
|
26
22
|
:host::part(trailing) {
|
27
23
|
margin-inline-start: var(--mdc-listitem-column-gap);
|
28
24
|
}
|
@@ -221,9 +221,11 @@ class Tab extends IconNameMixin(Buttonsimple) {
|
|
221
221
|
render() {
|
222
222
|
return html `
|
223
223
|
<div part="container">
|
224
|
-
|
224
|
+
<slot name="prefix">
|
225
|
+
${this.iconName
|
225
226
|
? html ` <mdc-icon name="${this.iconName}" size="1" length-unit="rem" part="icon"></mdc-icon>`
|
226
227
|
: nothing}
|
228
|
+
</slot>
|
227
229
|
${this.text
|
228
230
|
? html ` <mdc-text
|
229
231
|
type=${this.active ? TYPE.BODY_MIDSIZE_BOLD : TYPE.BODY_MIDSIZE_MEDIUM}
|