@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.
- package/README.md +8 -3
- package/dist/browser/index.js +2233 -2291
- package/dist/browser/index.js.map +4 -4
- package/dist/components/alertchip/alertchip.component.d.ts +1 -1
- package/dist/components/alertchip/alertchip.component.js +2 -2
- package/dist/components/alertchip/alertchip.styles.js +22 -23
- package/dist/components/alertchip/alertchip.types.d.ts +1 -1
- package/dist/components/animation/animation.component.js +1 -1
- package/dist/components/animation/animation.styles.js +8 -5
- package/dist/components/appheader/appheader.component.js +12 -13
- package/dist/components/appheader/appheader.styles.js +0 -1
- package/dist/components/avatar/avatar.component.js +3 -16
- package/dist/components/avatar/avatar.constants.d.ts +1 -1
- package/dist/components/avatar/avatar.constants.js +1 -1
- package/dist/components/avatar/avatar.styles.js +129 -122
- package/dist/components/avatar/avatar.types.d.ts +1 -1
- package/dist/components/avatar/avatar.utils.d.ts +1 -1
- package/dist/components/avatar/avatar.utils.js +1 -1
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +2 -2
- package/dist/components/avatarbutton/avatarbutton.component.js +2 -2
- package/dist/components/avatarbutton/avatarbutton.styles.js +34 -30
- package/dist/components/badge/badge.styles.js +9 -7
- package/dist/components/brandvisual/brandvisual.component.js +4 -4
- package/dist/components/bullet/bullet.component.d.ts +1 -1
- package/dist/components/bullet/bullet.component.js +2 -2
- package/dist/components/bullet/bullet.styles.js +3 -3
- package/dist/components/button/button.component.js +10 -4
- package/dist/components/button/button.utils.js +1 -1
- package/dist/components/buttongroup/buttongroup.component.js +1 -1
- package/dist/components/buttongroup/buttongroup.styles.js +68 -68
- package/dist/components/buttonlink/buttonlink.component.d.ts +5 -5
- package/dist/components/buttonlink/buttonlink.component.js +9 -9
- package/dist/components/buttonsimple/buttonsimple.component.js +2 -2
- package/dist/components/buttonsimple/buttonsimple.constants.d.ts +1 -1
- package/dist/components/buttonsimple/buttonsimple.constants.js +1 -1
- package/dist/components/buttonsimple/buttonsimple.styles.js +62 -57
- package/dist/components/card/card.component.d.ts +6 -6
- package/dist/components/card/card.component.js +15 -16
- package/dist/components/card/card.styles.js +24 -22
- package/dist/components/cardbutton/cardbutton.component.js +9 -12
- package/dist/components/cardbutton/cardbutton.styles.js +1 -1
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +6 -6
- package/dist/components/cardcheckbox/cardcheckbox.component.js +30 -29
- package/dist/components/cardcheckbox/cardcheckbox.styles.js +10 -10
- package/dist/components/cardradio/cardradio.component.d.ts +12 -12
- package/dist/components/cardradio/cardradio.component.js +27 -30
- package/dist/components/cardradio/cardradio.styles.js +8 -8
- package/dist/components/checkbox/checkbox.component.js +7 -9
- package/dist/components/checkbox/checkbox.styles.js +62 -60
- package/dist/components/chip/chip.component.d.ts +1 -1
- package/dist/components/chip/chip.component.js +6 -11
- package/dist/components/chip/chip.styles.js +4 -2
- package/dist/components/dialog/dialog.component.js +28 -29
- package/dist/components/dialog/dialog.styles.js +10 -12
- package/dist/components/divider/divider.component.js +6 -8
- package/dist/components/divider/divider.constants.d.ts +1 -1
- package/dist/components/divider/divider.constants.js +1 -1
- package/dist/components/divider/divider.styles.js +5 -20
- package/dist/components/filterchip/filterchip.styles.js +4 -2
- package/dist/components/formfieldgroup/formfieldgroup.component.js +1 -4
- package/dist/components/formfieldgroup/formfieldgroup.styles.js +1 -2
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +19 -17
- package/dist/components/formfieldwrapper/formfieldwrapper.styles.js +2 -1
- package/dist/components/formfieldwrapper/formfieldwrapper.subcomponent.js +4 -4
- package/dist/components/icon/icon.component.js +7 -7
- package/dist/components/icon/icon.utils.d.ts +1 -1
- package/dist/components/icon/icon.utils.js +7 -7
- package/dist/components/iconprovider/iconprovider.component.js +7 -7
- package/dist/components/input/input.component.d.ts +5 -5
- package/dist/components/input/input.component.js +64 -62
- package/dist/components/input/input.styles.js +128 -117
- package/dist/components/inputchip/inputchip.component.js +14 -19
- package/dist/components/inputchip/inputchip.styles.js +5 -3
- package/dist/components/link/link.component.d.ts +1 -1
- package/dist/components/link/link.component.js +4 -8
- package/dist/components/link/link.constants.d.ts +1 -1
- package/dist/components/link/link.constants.js +1 -1
- package/dist/components/link/link.styles.js +12 -12
- package/dist/components/linksimple/linksimple.component.js +2 -4
- package/dist/components/linksimple/linksimple.styles.js +59 -57
- package/dist/components/list/list.component.js +12 -9
- package/dist/components/listitem/listitem.component.js +15 -11
- package/dist/components/listitem/listitem.styles.js +11 -6
- package/dist/components/marker/marker.component.js +1 -1
- package/dist/components/marker/marker.styles.js +2 -2
- package/dist/components/menubar/menubar.component.d.ts +19 -19
- package/dist/components/menubar/menubar.component.js +19 -19
- package/dist/components/menuitem/menuitem.component.js +15 -15
- package/dist/components/menuitem/menuitem.styles.js +3 -2
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +1 -1
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +4 -11
- package/dist/components/menuitemradio/menuitemradio.component.js +1 -1
- package/dist/components/menupopover/menupopover.component.js +11 -11
- package/dist/components/menupopover/menupopover.utils.d.ts +1 -1
- package/dist/components/menupopover/menupopover.utils.js +3 -8
- package/dist/components/navitem/navitem.component.js +11 -19
- package/dist/components/navitem/navitem.styles.js +147 -143
- package/dist/components/navitemlist/navitemlist.component.js +2 -2
- package/dist/components/optgroup/optgroup.component.js +12 -9
- package/dist/components/option/option.component.js +11 -11
- package/dist/components/option/option.styles.js +1 -1
- package/dist/components/popover/popover.component.js +4 -4
- package/dist/components/popover/popover.stack.js +1 -1
- package/dist/components/popover/popover.styles.js +0 -1
- package/dist/components/popover/popover.utils.js +3 -4
- package/dist/components/presence/presence.component.d.ts +4 -4
- package/dist/components/presence/presence.component.js +4 -4
- package/dist/components/progressbar/progressbar.component.js +3 -4
- package/dist/components/progressbar/progressbar.styles.js +77 -71
- package/dist/components/progressspinner/progressspiner.utils.js +4 -4
- package/dist/components/progressspinner/progressspinner.component.js +38 -37
- package/dist/components/progressspinner/progressspinner.styles.js +1 -1
- package/dist/components/radio/radio.component.d.ts +41 -41
- package/dist/components/radio/radio.component.js +84 -83
- package/dist/components/radio/radio.styles.js +77 -75
- package/dist/components/radiogroup/radiogroup.component.js +1 -1
- package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +2 -2
- package/dist/components/screenreaderannouncer/screenreaderannouncer.styles.js +8 -6
- package/dist/components/searchfield/searchfield.component.js +23 -17
- package/dist/components/searchfield/searchfield.styles.js +11 -13
- package/dist/components/select/select.component.js +20 -23
- package/dist/components/select/select.styles.js +9 -9
- package/dist/components/sidenavigation/sidenavigation.component.d.ts +6 -6
- package/dist/components/sidenavigation/sidenavigation.component.js +39 -29
- package/dist/components/sidenavigation/sidenavigation.context.js +5 -5
- package/dist/components/sidenavigation/sidenavigation.styles.js +53 -53
- package/dist/components/skeleton/skeleton.component.js +1 -4
- package/dist/components/skeleton/skeleton.constants.d.ts +1 -1
- package/dist/components/skeleton/skeleton.constants.js +1 -1
- package/dist/components/skeleton/skeleton.styles.js +4 -4
- package/dist/components/spinner/spinner.component.d.ts +7 -7
- package/dist/components/spinner/spinner.component.js +9 -9
- package/dist/components/spinner/spinner.styles.js +58 -53
- package/dist/components/staticcheckbox/staticcheckbox.component.js +10 -8
- package/dist/components/staticcheckbox/staticcheckbox.styles.js +52 -51
- package/dist/components/staticradio/staticradio.component.d.ts +8 -8
- package/dist/components/staticradio/staticradio.component.js +10 -11
- package/dist/components/staticradio/staticradio.styles.js +77 -75
- package/dist/components/statictoggle/statictoggle.component.d.ts +3 -3
- package/dist/components/statictoggle/statictoggle.component.js +3 -3
- package/dist/components/statictoggle/statictoggle.styles.js +71 -68
- package/dist/components/tab/tab.component.d.ts +1 -1
- package/dist/components/tab/tab.component.js +2 -2
- package/dist/components/tab/tab.styles.js +247 -245
- package/dist/components/tablist/tablist.component.js +11 -15
- package/dist/components/tablist/tablist.styles.js +27 -25
- package/dist/components/tablist/tablist.types.d.ts +1 -1
- package/dist/components/tablist/tablist.utils.js +4 -4
- package/dist/components/text/fonts.styles.js +49 -49
- package/dist/components/text/text.component.js +21 -11
- package/dist/components/text/text.types.d.ts +1 -1
- package/dist/components/textarea/textarea.component.d.ts +31 -31
- package/dist/components/textarea/textarea.component.js +54 -61
- package/dist/components/textarea/textarea.styles.js +123 -122
- package/dist/components/themeprovider/themeprovider.component.js +1 -1
- package/dist/components/themeprovider/themeprovider.styles.js +4 -4
- package/dist/components/toggle/toggle.component.d.ts +35 -35
- package/dist/components/toggle/toggle.component.js +62 -63
- package/dist/components/toggle/toggle.styles.js +77 -69
- package/dist/components/toggletip/toggletip.component.d.ts +7 -7
- package/dist/components/toggletip/toggletip.component.js +3 -2
- package/dist/components/tooltip/tooltip.component.js +1 -1
- package/dist/components/tooltip/tooltip.styles.js +0 -1
- package/dist/components/virtualizedlist/virtualizedlist.component.js +6 -14
- package/dist/components/virtualizedlist/virtualizedlist.helper.test.d.ts +1 -1
- package/dist/components/virtualizedlist/virtualizedlist.helper.test.js +14 -11
- package/dist/components/virtualizedlist/virtualizedlist.styles.js +4 -4
- package/dist/custom-elements.json +514 -514
- package/dist/index.js +1 -0
- package/dist/models/component/index.d.ts +1 -1
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +1 -1
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +4 -4
- package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
- package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
- package/dist/utils/mixins/FocusTrapMixin.js +12 -12
- package/dist/utils/mixins/IconNameMixin.d.ts +1 -1
- package/dist/utils/mixins/MenuMixin.js +23 -23
- package/dist/utils/mixins/PreventScrollMixin.d.ts +1 -1
- package/dist/utils/styles/index.js +12 -12
- package/package.json +1 -1
@@ -12,15 +12,15 @@ const styles = [
|
|
12
12
|
|
13
13
|
--mdc-badge-success-foreground-color: var(--mds-color-theme-text-success-normal);
|
14
14
|
--mdc-badge-success-background-color: var(--mds-color-theme-background-alert-success-normal);
|
15
|
-
|
15
|
+
|
16
16
|
--mdc-badge-warning-foreground-color: var(--mds-color-theme-text-warning-normal);
|
17
17
|
--mdc-badge-warning-background-color: var(--mds-color-theme-background-alert-warning-normal);
|
18
|
-
|
18
|
+
|
19
19
|
--mdc-badge-error-foreground-color: var(--mds-color-theme-text-error-normal);
|
20
20
|
--mdc-badge-error-background-color: var(--mds-color-theme-background-alert-error-normal);
|
21
|
-
|
21
|
+
|
22
22
|
--mdc-badge-overlay-background-color: var(--mds-color-theme-background-solid-primary-normal);
|
23
|
-
|
23
|
+
|
24
24
|
color: var(--mdc-badge-primary-foreground-color);
|
25
25
|
}
|
26
26
|
.mdc-badge-overlay {
|
@@ -67,10 +67,12 @@ const styles = [
|
|
67
67
|
|
68
68
|
/* High Contrast Mode */
|
69
69
|
@media (forced-colors: active) {
|
70
|
-
|
71
|
-
|
70
|
+
.mdc-badge-dot,
|
71
|
+
.mdc-badge-icon,
|
72
|
+
.mdc-badge-text {
|
73
|
+
outline: 0.125rem solid;
|
74
|
+
}
|
72
75
|
}
|
73
|
-
}
|
74
76
|
`,
|
75
77
|
];
|
76
78
|
export default styles;
|
@@ -9,8 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { html } from 'lit';
|
11
11
|
import { property, state } from 'lit/decorators.js';
|
12
|
-
import styles from './brandvisual.styles';
|
13
12
|
import { Component } from '../../models';
|
13
|
+
import styles from './brandvisual.styles';
|
14
14
|
import { DEFAULTS } from './brandvisual.constants';
|
15
15
|
/**
|
16
16
|
* The `mdc-brandvisual` component is responsible for rendering logos dynamically & ensures they are
|
@@ -41,10 +41,10 @@ class Brandvisual extends Component {
|
|
41
41
|
if (this.name) {
|
42
42
|
// dynamic import of the lit template from the momentum brand-visuals package
|
43
43
|
return import(`@momentum-design/brand-visuals/dist/logos/ts/${this.name}.ts`)
|
44
|
-
.then(
|
44
|
+
.then(module => {
|
45
45
|
this.handleBrandVisualLoadedSuccess(module.default());
|
46
46
|
})
|
47
|
-
.catch(
|
47
|
+
.catch(error => {
|
48
48
|
this.handleBrandVisualLoadedFailure(error);
|
49
49
|
});
|
50
50
|
}
|
@@ -55,7 +55,7 @@ class Brandvisual extends Component {
|
|
55
55
|
super.updated(changedProperties);
|
56
56
|
if (changedProperties.has('name')) {
|
57
57
|
// import brandVisual data if name changes:
|
58
|
-
this.getBrandVisualData().catch(
|
58
|
+
this.getBrandVisualData().catch(err => {
|
59
59
|
if (this.onerror) {
|
60
60
|
this.onerror(err);
|
61
61
|
}
|
@@ -11,7 +11,7 @@ import type { Size } from './bullet.types';
|
|
11
11
|
* @cssproperty --mdc-bullet-size-small - small size value of the bullet
|
12
12
|
* @cssproperty --mdc-bullet-size-medium - medium size value of the bullet
|
13
13
|
* @cssproperty --mdc-bullet-size-large - large size value of the bullet
|
14
|
-
*/
|
14
|
+
*/
|
15
15
|
declare class Bullet extends Component {
|
16
16
|
/**
|
17
17
|
* Size of the bullet
|
@@ -8,8 +8,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
10
|
import { property } from 'lit/decorators.js';
|
11
|
-
import styles from './bullet.styles';
|
12
11
|
import { Component } from '../../models';
|
12
|
+
import styles from './bullet.styles';
|
13
13
|
import { SIZE } from './bullet.constants';
|
14
14
|
/**
|
15
15
|
* Bullet component, which is a visual marker
|
@@ -21,7 +21,7 @@ import { SIZE } from './bullet.constants';
|
|
21
21
|
* @cssproperty --mdc-bullet-size-small - small size value of the bullet
|
22
22
|
* @cssproperty --mdc-bullet-size-medium - medium size value of the bullet
|
23
23
|
* @cssproperty --mdc-bullet-size-large - large size value of the bullet
|
24
|
-
*/
|
24
|
+
*/
|
25
25
|
class Bullet extends Component {
|
26
26
|
constructor() {
|
27
27
|
super(...arguments);
|
@@ -11,13 +11,13 @@ const styles = css `
|
|
11
11
|
aspect-ratio: 1;
|
12
12
|
background-color: var(--mdc-bullet-background-color);
|
13
13
|
}
|
14
|
-
:host([size=
|
14
|
+
:host([size='small']) {
|
15
15
|
height: var(--mdc-bullet-size-small);
|
16
16
|
}
|
17
|
-
:host([size=
|
17
|
+
:host([size='medium']) {
|
18
18
|
height: var(--mdc-bullet-size-medium);
|
19
19
|
}
|
20
|
-
:host([size=
|
20
|
+
:host([size='large']) {
|
21
21
|
height: var(--mdc-bullet-size-large);
|
22
22
|
}
|
23
23
|
`;
|
@@ -122,13 +122,19 @@ class Button extends ButtonComponentMixin(Buttonsimple) {
|
|
122
122
|
render() {
|
123
123
|
return html `
|
124
124
|
${this.prefixFilledIconName
|
125
|
-
? html ` <mdc-icon
|
126
|
-
|
125
|
+
? html ` <mdc-icon
|
126
|
+
name="${this.prefixFilledIconName}"
|
127
|
+
part="prefix-icon"
|
128
|
+
length-unit="rem"
|
129
|
+
></mdc-icon>`
|
127
130
|
: ''}
|
128
131
|
<slot @slotchange=${this.inferButtonType}></slot>
|
129
132
|
${this.postfixFilledIconName
|
130
|
-
? html ` <mdc-icon
|
131
|
-
|
133
|
+
? html ` <mdc-icon
|
134
|
+
name="${this.postfixFilledIconName}"
|
135
|
+
part="postfix-icon"
|
136
|
+
length-unit="rem"
|
137
|
+
></mdc-icon>`
|
132
138
|
: ''}
|
133
139
|
`;
|
134
140
|
}
|
@@ -7,6 +7,6 @@
|
|
7
7
|
const getIconNameWithoutStyle = (iconName) => {
|
8
8
|
const iconParts = iconName.split('-');
|
9
9
|
const variants = ['bold', 'filled', 'regular', 'light'];
|
10
|
-
return iconParts.filter(
|
10
|
+
return iconParts.filter(part => !variants.includes(part)).join('-');
|
11
11
|
};
|
12
12
|
export { getIconNameWithoutStyle };
|
@@ -55,7 +55,7 @@ class ButtonGroup extends Component {
|
|
55
55
|
* @internal
|
56
56
|
*/
|
57
57
|
handleSlotChange() {
|
58
|
-
this.buttons.forEach(
|
58
|
+
this.buttons.forEach(button => {
|
59
59
|
button.setAttribute('size', this.size.toString());
|
60
60
|
button.setAttribute('variant', this.variant);
|
61
61
|
});
|
@@ -1,81 +1,81 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { hostFitContentStyles } from '../../utils/styles';
|
3
3
|
const styles = css `
|
4
|
-
:host{
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
:host {
|
5
|
+
--mdc-buttongroup-border-radius: 1.25rem;
|
6
|
+
--mdc-buttongroup-border-color: var(--mds-color-theme-outline-button-normal);
|
7
|
+
--mdc-buttongroup-divider-color: var(--mds-color-theme-outline-secondary-normal);
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
}
|
9
|
+
border-radius: var(--mdc-buttongroup-border-radius);
|
10
|
+
border: 1px solid var(--mdc-buttongroup-border-color);
|
11
|
+
}
|
12
12
|
|
13
|
-
:host([variant='primary']){
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
13
|
+
:host([variant='primary']) {
|
14
|
+
border: none;
|
15
|
+
background-color: var(--mds-color-theme-outline-primary-normal);
|
16
|
+
gap: 1px;
|
17
|
+
}
|
18
18
|
|
19
|
-
::slotted(mdc-button){
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
19
|
+
::slotted(mdc-button) {
|
20
|
+
border-radius: 0;
|
21
|
+
border: none;
|
22
|
+
box-sizing: content-box;
|
23
|
+
}
|
24
24
|
|
25
|
-
:host([orientation=
|
26
|
-
|
27
|
-
}
|
25
|
+
:host([orientation='vertical']) {
|
26
|
+
flex-direction: column;
|
27
|
+
}
|
28
28
|
|
29
|
-
:host([orientation=
|
30
|
-
|
31
|
-
}
|
32
|
-
:host([orientation=
|
33
|
-
|
34
|
-
}
|
35
|
-
:host([orientation=
|
36
|
-
|
37
|
-
}
|
29
|
+
:host([orientation='horizontal'][variant='secondary']:dir(ltr)) ::slotted(mdc-button:not(:last-child)) {
|
30
|
+
border-right: 1px solid var(--mdc-buttongroup-divider-color);
|
31
|
+
}
|
32
|
+
:host([orientation='horizontal'][variant='secondary']:dir(rtl)) ::slotted(mdc-button:not(:last-child)) {
|
33
|
+
border-left: 1px solid var(--mdc-buttongroup-divider-color);
|
34
|
+
}
|
35
|
+
:host([orientation='vertical'][variant='secondary']) ::slotted(mdc-button:not(:last-child)) {
|
36
|
+
border-bottom: 1px solid var(--mdc-buttongroup-divider-color);
|
37
|
+
}
|
38
38
|
|
39
|
-
:host([orientation=
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
:host([orientation=
|
44
|
-
|
45
|
-
|
46
|
-
}
|
39
|
+
:host([orientation='vertical']) ::slotted(mdc-button:first-child) {
|
40
|
+
border-top-left-radius: var(--mdc-buttongroup-border-radius);
|
41
|
+
border-top-right-radius: var(--mdc-buttongroup-border-radius);
|
42
|
+
}
|
43
|
+
:host([orientation='vertical']) ::slotted(mdc-button:last-child) {
|
44
|
+
border-bottom-left-radius: var(--mdc-buttongroup-border-radius);
|
45
|
+
border-bottom-right-radius: var(--mdc-buttongroup-border-radius);
|
46
|
+
}
|
47
47
|
|
48
|
-
:host([orientation=
|
49
|
-
|
50
|
-
|
51
|
-
}
|
52
|
-
:host([orientation=
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
:host([orientation=
|
57
|
-
|
58
|
-
|
59
|
-
}
|
60
|
-
:host([orientation=
|
61
|
-
|
62
|
-
|
63
|
-
}
|
48
|
+
:host([orientation='horizontal']:dir(ltr)) ::slotted(mdc-button:first-child) {
|
49
|
+
border-top-left-radius: var(--mdc-buttongroup-border-radius);
|
50
|
+
border-bottom-left-radius: var(--mdc-buttongroup-border-radius);
|
51
|
+
}
|
52
|
+
:host([orientation='horizontal']:dir(rtl)) ::slotted(mdc-button:first-child) {
|
53
|
+
border-top-right-radius: var(--mdc-buttongroup-border-radius);
|
54
|
+
border-bottom-right-radius: var(--mdc-buttongroup-border-radius);
|
55
|
+
}
|
56
|
+
:host([orientation='horizontal']:dir(ltr)) ::slotted(mdc-button:last-child) {
|
57
|
+
border-top-right-radius: var(--mdc-buttongroup-border-radius);
|
58
|
+
border-bottom-right-radius: var(--mdc-buttongroup-border-radius);
|
59
|
+
}
|
60
|
+
:host([orientation='horizontal']:dir(rtl)) ::slotted(mdc-button:last-child) {
|
61
|
+
border-top-left-radius: var(--mdc-buttongroup-border-radius);
|
62
|
+
border-bottom-left-radius: var(--mdc-buttongroup-border-radius);
|
63
|
+
}
|
64
64
|
|
65
|
-
:host([compact][orientation=
|
66
|
-
|
67
|
-
}
|
68
|
-
:host([compact][orientation=
|
69
|
-
|
70
|
-
}
|
71
|
-
:host([compact][orientation=
|
72
|
-
|
73
|
-
}
|
74
|
-
:host([compact][orientation=
|
75
|
-
|
76
|
-
}
|
77
|
-
:host([compact][orientation=
|
78
|
-
|
79
|
-
}
|
65
|
+
:host([compact][orientation='horizontal']) ::slotted(mdc-button) {
|
66
|
+
height: 1.5rem;
|
67
|
+
}
|
68
|
+
:host([compact][orientation='horizontal'][size='24']) ::slotted(mdc-button) {
|
69
|
+
width: 1.5rem;
|
70
|
+
}
|
71
|
+
:host([compact][orientation='horizontal'][size='28']) ::slotted(mdc-button) {
|
72
|
+
width: 1.75rem;
|
73
|
+
}
|
74
|
+
:host([compact][orientation='horizontal'][size='32']) ::slotted(mdc-button) {
|
75
|
+
width: 2rem;
|
76
|
+
}
|
77
|
+
:host([compact][orientation='horizontal'][size='40']) ::slotted(mdc-button) {
|
78
|
+
width: 2.5rem;
|
79
|
+
}
|
80
80
|
`;
|
81
81
|
export default [hostFitContentStyles, styles];
|
@@ -26,11 +26,11 @@ declare const ButtonLink_base: import("../../utils/mixins/index.types").Construc
|
|
26
26
|
declare class ButtonLink extends ButtonLink_base {
|
27
27
|
/**
|
28
28
|
* ButtonLink sizing is based on the buttonlink type.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
* - **Pill buttonlink**: 40, 32, 28, 24.
|
30
|
+
* - **Icon buttonlink**: 64, 52, 40, 32, 28, 24.
|
31
|
+
* - Tertiary icon buttonlink can also be 20.
|
32
|
+
* @default 32
|
33
|
+
*/
|
34
34
|
size: PillButtonSize | IconButtonSize;
|
35
35
|
/**
|
36
36
|
* Indicates whether the buttonlink is soft disabled.
|
@@ -39,11 +39,11 @@ class ButtonLink extends ButtonComponentMixin(Linksimple) {
|
|
39
39
|
super(...arguments);
|
40
40
|
/**
|
41
41
|
* ButtonLink sizing is based on the buttonlink type.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
* - **Pill buttonlink**: 40, 32, 28, 24.
|
43
|
+
* - **Icon buttonlink**: 64, 52, 40, 32, 28, 24.
|
44
|
+
* - Tertiary icon buttonlink can also be 20.
|
45
|
+
* @default 32
|
46
|
+
*/
|
47
47
|
this.size = DEFAULTS.SIZE;
|
48
48
|
}
|
49
49
|
/**
|
@@ -86,12 +86,12 @@ class ButtonLink extends ButtonComponentMixin(Linksimple) {
|
|
86
86
|
}
|
87
87
|
render() {
|
88
88
|
return html `
|
89
|
-
${this.prefixIcon
|
90
|
-
|
89
|
+
${this.prefixIcon
|
90
|
+
? html ` <mdc-icon name="${this.prefixIcon}" part="prefix-icon" length-unit="rem"></mdc-icon>`
|
91
|
+
: ''}
|
91
92
|
<slot @slotchange=${this.inferButtonType}></slot>
|
92
93
|
${this.postfixIcon
|
93
|
-
? html ` <mdc-icon name="${this.postfixIcon}"
|
94
|
-
part="postfix-icon" length-unit="rem"></mdc-icon>`
|
94
|
+
? html ` <mdc-icon name="${this.postfixIcon}" part="postfix-icon" length-unit="rem"></mdc-icon>`
|
95
95
|
: ''}
|
96
96
|
`;
|
97
97
|
}
|
@@ -102,8 +102,8 @@ class Buttonsimple extends AutoFocusMixin(TabIndexMixin(DisabledMixin(Component)
|
|
102
102
|
if (this.ariaStateKey) {
|
103
103
|
const ariaStateKeys = this.ariaStateKey.split(',');
|
104
104
|
ariaStateKeys
|
105
|
-
.filter(
|
106
|
-
.forEach(
|
105
|
+
.filter(key => key.trim().startsWith('aria-'))
|
106
|
+
.forEach(key => {
|
107
107
|
if (active === true) {
|
108
108
|
element.setAttribute(key.trim(), 'true');
|
109
109
|
}
|
@@ -1,61 +1,66 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
|
3
|
-
const styles = [
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
color: var(--mds-color-theme-inverted-text-secondary-normal);
|
11
|
-
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
12
|
-
outline: none;
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host {
|
7
|
+
border: 0.0625rem solid transparent;
|
8
|
+
cursor: pointer;
|
9
|
+
user-select: none;
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
11
|
+
background-color: var(--mds-color-theme-text-primary-normal);
|
12
|
+
color: var(--mds-color-theme-inverted-text-secondary-normal);
|
13
|
+
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
14
|
+
outline: none;
|
15
|
+
|
16
|
+
--mdc-button-height-size-124: 7.75rem;
|
17
|
+
--mdc-button-height-size-88: 5.5rem;
|
18
|
+
--mdc-button-height-size-72: 4.5rem;
|
19
|
+
--mdc-button-height-size-64: 4rem;
|
20
|
+
--mdc-button-height-size-52: 3.25rem;
|
21
|
+
--mdc-button-height-size-40: 2.5rem;
|
22
|
+
--mdc-button-height-size-32: 2rem;
|
23
|
+
--mdc-button-height-size-28: 1.75rem;
|
24
|
+
--mdc-button-height-size-24: 1.5rem;
|
25
|
+
--mdc-button-height-size-20: 1.25rem;
|
26
|
+
}
|
27
|
+
|
28
|
+
:host([disabled]),
|
29
|
+
:host([soft-disabled]) {
|
30
|
+
background-color: var(--mds-color-theme-text-primary-disabled);
|
31
|
+
}
|
32
|
+
:host([size='124']) {
|
33
|
+
height: var(--mdc-button-height-size-124);
|
34
|
+
}
|
35
|
+
:host([size='88']) {
|
36
|
+
height: var(--mdc-button-height-size-88);
|
37
|
+
}
|
38
|
+
:host([size='72']) {
|
39
|
+
height: var(--mdc-button-height-size-72);
|
40
|
+
}
|
41
|
+
:host([size='64']) {
|
42
|
+
height: var(--mdc-button-height-size-64);
|
43
|
+
}
|
44
|
+
:host([size='52']) {
|
45
|
+
height: var(--mdc-button-height-size-52);
|
46
|
+
}
|
47
|
+
:host([size='40']) {
|
48
|
+
height: var(--mdc-button-height-size-40);
|
49
|
+
}
|
50
|
+
:host([size='32']) {
|
51
|
+
height: var(--mdc-button-height-size-32);
|
52
|
+
}
|
53
|
+
:host([size='28']) {
|
54
|
+
height: var(--mdc-button-height-size-28);
|
55
|
+
font-size: var(--mds-font-size-body-midsize);
|
56
|
+
}
|
57
|
+
:host([size='24']) {
|
58
|
+
height: var(--mdc-button-height-size-24);
|
59
|
+
}
|
60
|
+
:host([size='20']) {
|
61
|
+
height: var(--mdc-button-height-size-20);
|
62
|
+
}
|
63
|
+
`,
|
64
|
+
...hostFocusRingStyles(),
|
65
|
+
];
|
61
66
|
export default styles;
|
@@ -49,9 +49,9 @@ declare const Card_base: import("../../utils/mixins/index.types").Constructor<im
|
|
49
49
|
*/
|
50
50
|
declare class Card extends Card_base {
|
51
51
|
/**
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
* The icon buttons in the header section
|
53
|
+
* @internal
|
54
|
+
*/
|
55
55
|
iconButtons?: Array<HTMLElement>;
|
56
56
|
update(changedProperties: PropertyValues<Card>): void;
|
57
57
|
/**
|
@@ -61,9 +61,9 @@ declare class Card extends Card_base {
|
|
61
61
|
*/
|
62
62
|
private handleIconButtons;
|
63
63
|
/**
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
* Renders the header of the card if title is provided
|
65
|
+
* @returns The header element
|
66
|
+
*/
|
67
67
|
protected renderHeader(): import("lit-html").TemplateResult<1> | typeof nothing;
|
68
68
|
render(): import("lit-html").TemplateResult<1>;
|
69
69
|
static styles: Array<CSSResult>;
|
@@ -9,12 +9,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { queryAssignedElements } from 'lit/decorators.js';
|
12
|
-
import styles from './card.styles';
|
13
12
|
import { Component } from '../../models';
|
14
|
-
import { DEFAULTS } from './card.constants';
|
15
13
|
import { BUTTON_VARIANTS } from '../button/button.constants';
|
16
14
|
import { CardComponentMixin } from '../../utils/mixins/CardComponentMixin';
|
17
15
|
import { CardAndDialogFooterMixin } from '../../utils/mixins/CardAndDialogFooterMixin';
|
16
|
+
import { DEFAULTS } from './card.constants';
|
17
|
+
import styles from './card.styles';
|
18
18
|
/**
|
19
19
|
* The card component allows users to organize information in a structured and tangible
|
20
20
|
* format that is visually appealing. `mdc-card` is a static component that supports
|
@@ -71,7 +71,7 @@ class Card extends CardComponentMixin(CardAndDialogFooterMixin(Component)) {
|
|
71
71
|
*/
|
72
72
|
this.handleIconButtons = () => {
|
73
73
|
var _a;
|
74
|
-
(_a = this.iconButtons) === null || _a === void 0 ? void 0 : _a.forEach(
|
74
|
+
(_a = this.iconButtons) === null || _a === void 0 ? void 0 : _a.forEach(element => {
|
75
75
|
if (!element.matches(DEFAULTS.BUTTON) && element.getAttribute('data-btn-type') !== 'icon') {
|
76
76
|
element.remove();
|
77
77
|
}
|
@@ -95,29 +95,28 @@ class Card extends CardComponentMixin(CardAndDialogFooterMixin(Component)) {
|
|
95
95
|
}
|
96
96
|
}
|
97
97
|
/**
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
* Renders the header of the card if title is provided
|
99
|
+
* @returns The header element
|
100
|
+
*/
|
101
101
|
renderHeader() {
|
102
102
|
if (!this.cardTitle) {
|
103
103
|
return nothing;
|
104
104
|
}
|
105
105
|
return html `<div part="header">
|
106
|
-
${this.renderIcon()}
|
107
|
-
${this.renderTitle()}
|
106
|
+
${this.renderIcon()} ${this.renderTitle()}
|
108
107
|
<div part="icon-button"><slot name="icon-button" @slotchange=${this.handleIconButtons}></slot></div>
|
109
108
|
</div>`;
|
110
109
|
}
|
111
110
|
render() {
|
112
111
|
return html `
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
112
|
+
${this.renderImage()}
|
113
|
+
<div part="body">
|
114
|
+
${this.renderHeader()}
|
115
|
+
<slot name="before-body"></slot>
|
116
|
+
<slot name="body"></slot>
|
117
|
+
<slot name="after-body"></slot>
|
118
|
+
${this.renderFooter()}
|
119
|
+
</div>
|
121
120
|
`;
|
122
121
|
}
|
123
122
|
}
|