@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
@@ -1,12 +1,12 @@
|
|
1
1
|
export const getFirstTab = (tabs) => tabs[0];
|
2
2
|
export const getLastTab = (tabs) => tabs[tabs.length - 1];
|
3
3
|
export const getPreviousTab = (tabs, focusedTabElement) => {
|
4
|
-
const newIndex = tabs.findIndex(
|
4
|
+
const newIndex = tabs.findIndex(tab => focusedTabElement === tab) - 1;
|
5
5
|
return tabs[(newIndex + tabs.length) % tabs.length];
|
6
6
|
};
|
7
7
|
export const getNextTab = (tabs, focusedTabElement) => {
|
8
|
-
const newIndex = tabs.findIndex(
|
8
|
+
const newIndex = tabs.findIndex(tab => focusedTabElement === tab) + 1;
|
9
9
|
return tabs[newIndex % tabs.length];
|
10
10
|
};
|
11
|
-
export const findTab = (tabs, tabId) => tabs.find(
|
12
|
-
export const getActiveTab = (tabs) => tabs.find(
|
11
|
+
export const findTab = (tabs, tabId) => tabs.find(tab => tab.tabId === tabId);
|
12
|
+
export const getActiveTab = (tabs) => tabs.find(tab => tab.active);
|
@@ -11,7 +11,7 @@ export const fontsStyles = css `
|
|
11
11
|
text-overflow: inherit;
|
12
12
|
}
|
13
13
|
|
14
|
-
:host([type=
|
14
|
+
:host([type='headline-small-regular']) {
|
15
15
|
font-size: var(--mds-font-apps-headline-small-regular-font-size);
|
16
16
|
font-weight: var(--mds-font-apps-headline-small-regular-font-weight);
|
17
17
|
line-height: var(--mds-font-apps-headline-small-regular-line-height);
|
@@ -19,7 +19,7 @@ export const fontsStyles = css `
|
|
19
19
|
text-transform: var(--mds-font-apps-headline-small-regular-text-case);
|
20
20
|
}
|
21
21
|
|
22
|
-
:host([type=
|
22
|
+
:host([type='headline-small-light']) {
|
23
23
|
font-size: var(--mds-font-apps-headline-small-light-font-size);
|
24
24
|
font-weight: var(--mds-font-apps-headline-small-light-font-weight);
|
25
25
|
line-height: var(--mds-font-apps-headline-small-light-line-height);
|
@@ -27,23 +27,23 @@ export const fontsStyles = css `
|
|
27
27
|
text-transform: var(--mds-font-apps-headline-small-light-text-case);
|
28
28
|
}
|
29
29
|
|
30
|
-
:host([type=
|
30
|
+
:host([type='heading-xlarge-bold']) {
|
31
31
|
font-size: var(--mds-font-apps-heading-xlarge-bold-font-size);
|
32
32
|
font-weight: var(--mds-font-apps-heading-xlarge-bold-font-weight);
|
33
33
|
line-height: var(--mds-font-apps-heading-xlarge-bold-line-height);
|
34
34
|
text-decoration: var(--mds-font-apps-heading-xlarge-bold-text-decoration);
|
35
35
|
text-transform: var(--mds-font-apps-heading-xlarge-bold-text-case);
|
36
36
|
}
|
37
|
-
|
38
|
-
:host([type=
|
37
|
+
|
38
|
+
:host([type='heading-xlarge-medium']) {
|
39
39
|
font-size: var(--mds-font-apps-heading-xlarge-medium-font-size);
|
40
40
|
font-weight: var(--mds-font-apps-heading-xlarge-medium-font-weight);
|
41
41
|
line-height: var(--mds-font-apps-heading-xlarge-medium-line-height);
|
42
42
|
text-decoration: var(--mds-font-apps-heading-xlarge-medium-text-decoration);
|
43
43
|
text-transform: var(--mds-font-apps-heading-xlarge-medium-text-case);
|
44
44
|
}
|
45
|
-
|
46
|
-
:host([type=
|
45
|
+
|
46
|
+
:host([type='heading-xlarge-regular']) {
|
47
47
|
font-size: var(--mds-font-apps-heading-xlarge-regular-font-size);
|
48
48
|
font-weight: var(--mds-font-apps-heading-xlarge-regular-font-weight);
|
49
49
|
line-height: var(--mds-font-apps-heading-xlarge-regular-line-height);
|
@@ -51,23 +51,23 @@ export const fontsStyles = css `
|
|
51
51
|
text-transform: var(--mds-font-apps-heading-xlarge-regular-text-case);
|
52
52
|
}
|
53
53
|
|
54
|
-
:host([type=
|
54
|
+
:host([type='heading-large-bold']) {
|
55
55
|
font-size: var(--mds-font-apps-heading-large-bold-font-size);
|
56
56
|
font-weight: var(--mds-font-apps-heading-large-bold-font-weight);
|
57
57
|
line-height: var(--mds-font-apps-heading-large-bold-line-height);
|
58
58
|
text-decoration: var(--mds-font-apps-heading-large-bold-text-decoration);
|
59
59
|
text-transform: var(--mds-font-apps-heading-large-bold-text-case);
|
60
60
|
}
|
61
|
-
|
62
|
-
:host([type=
|
61
|
+
|
62
|
+
:host([type='heading-large-medium']) {
|
63
63
|
font-size: var(--mds-font-apps-heading-large-medium-font-size);
|
64
64
|
font-weight: var(--mds-font-apps-heading-large-medium-font-weight);
|
65
65
|
line-height: var(--mds-font-apps-heading-large-medium-line-height);
|
66
66
|
text-decoration: var(--mds-font-apps-heading-large-medium-text-decoration);
|
67
67
|
text-transform: var(--mds-font-apps-heading-large-medium-text-case);
|
68
68
|
}
|
69
|
-
|
70
|
-
:host([type=
|
69
|
+
|
70
|
+
:host([type='heading-large-regular']) {
|
71
71
|
font-size: var(--mds-font-apps-heading-large-regular-font-size);
|
72
72
|
font-weight: var(--mds-font-apps-heading-large-regular-font-weight);
|
73
73
|
line-height: var(--mds-font-apps-heading-large-regular-line-height);
|
@@ -75,23 +75,23 @@ export const fontsStyles = css `
|
|
75
75
|
text-transform: var(--mds-font-apps-heading-large-regular-text-case);
|
76
76
|
}
|
77
77
|
|
78
|
-
:host([type=
|
78
|
+
:host([type='heading-midsize-bold']) {
|
79
79
|
font-size: var(--mds-font-apps-heading-midsize-bold-font-size);
|
80
80
|
font-weight: var(--mds-font-apps-heading-midsize-bold-font-weight);
|
81
81
|
line-height: var(--mds-font-apps-heading-midsize-bold-line-height);
|
82
82
|
text-decoration: var(--mds-font-apps-heading-midsize-bold-text-decoration);
|
83
83
|
text-transform: var(--mds-font-apps-heading-midsize-bold-text-case);
|
84
84
|
}
|
85
|
-
|
86
|
-
:host([type=
|
85
|
+
|
86
|
+
:host([type='heading-midsize-medium']) {
|
87
87
|
font-size: var(--mds-font-apps-heading-midsize-medium-font-size);
|
88
88
|
font-weight: var(--mds-font-apps-heading-midsize-medium-font-weight);
|
89
89
|
line-height: var(--mds-font-apps-heading-midsize-medium-line-height);
|
90
90
|
text-decoration: var(--mds-font-apps-heading-midsize-medium-text-decoration);
|
91
91
|
text-transform: var(--mds-font-apps-heading-midsize-medium-text-case);
|
92
92
|
}
|
93
|
-
|
94
|
-
:host([type=
|
93
|
+
|
94
|
+
:host([type='heading-midsize-regular']) {
|
95
95
|
font-size: var(--mds-font-apps-heading-midsize-regular-font-size);
|
96
96
|
font-weight: var(--mds-font-apps-heading-midsize-regular-font-weight);
|
97
97
|
line-height: var(--mds-font-apps-heading-midsize-regular-line-height);
|
@@ -99,23 +99,23 @@ export const fontsStyles = css `
|
|
99
99
|
text-transform: var(--mds-font-apps-heading-midsize-regular-text-case);
|
100
100
|
}
|
101
101
|
|
102
|
-
:host([type=
|
102
|
+
:host([type='heading-small-bold']) {
|
103
103
|
font-size: var(--mds-font-apps-heading-small-bold-font-size);
|
104
104
|
font-weight: var(--mds-font-apps-heading-small-bold-font-weight);
|
105
105
|
line-height: var(--mds-font-apps-heading-small-bold-line-height);
|
106
106
|
text-decoration: var(--mds-font-apps-heading-small-bold-text-decoration);
|
107
107
|
text-transform: var(--mds-font-apps-heading-small-bold-text-case);
|
108
108
|
}
|
109
|
-
|
110
|
-
:host([type=
|
109
|
+
|
110
|
+
:host([type='heading-small-medium']) {
|
111
111
|
font-size: var(--mds-font-apps-heading-small-medium-font-size);
|
112
112
|
font-weight: var(--mds-font-apps-heading-small-medium-font-weight);
|
113
113
|
line-height: var(--mds-font-apps-heading-small-medium-line-height);
|
114
114
|
text-decoration: var(--mds-font-apps-heading-small-medium-text-decoration);
|
115
115
|
text-transform: var(--mds-font-apps-heading-small-medium-text-case);
|
116
116
|
}
|
117
|
-
|
118
|
-
:host([type=
|
117
|
+
|
118
|
+
:host([type='heading-small-regular']) {
|
119
119
|
font-size: var(--mds-font-apps-heading-small-regular-font-size);
|
120
120
|
font-weight: var(--mds-font-apps-heading-small-regular-font-weight);
|
121
121
|
line-height: var(--mds-font-apps-heading-small-regular-line-height);
|
@@ -123,39 +123,39 @@ export const fontsStyles = css `
|
|
123
123
|
text-transform: var(--mds-font-apps-heading-small-regular-text-case);
|
124
124
|
}
|
125
125
|
|
126
|
-
:host([type=
|
126
|
+
:host([type='body-large-bold']) {
|
127
127
|
font-size: var(--mds-font-apps-body-large-bold-font-size);
|
128
128
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
129
129
|
line-height: var(--mds-font-apps-body-large-bold-line-height);
|
130
130
|
text-decoration: var(--mds-font-apps-body-large-bold-text-decoration);
|
131
131
|
text-transform: var(--mds-font-apps-body-large-bold-text-case);
|
132
132
|
}
|
133
|
-
|
134
|
-
:host([type=
|
133
|
+
|
134
|
+
:host([type='body-large-medium-underline']) {
|
135
135
|
font-size: var(--mds-font-apps-body-large-medium-underline-font-size);
|
136
136
|
font-weight: var(--mds-font-apps-body-large-medium-underline-font-weight);
|
137
137
|
line-height: var(--mds-font-apps-body-large-medium-underline-line-height);
|
138
138
|
text-decoration: var(--mds-font-apps-body-large-medium-underline-text-decoration);
|
139
139
|
text-transform: var(--mds-font-apps-body-large-medium-underline-text-case);
|
140
140
|
}
|
141
|
-
|
142
|
-
:host([type=
|
141
|
+
|
142
|
+
:host([type='body-large-medium']) {
|
143
143
|
font-size: var(--mds-font-apps-body-large-medium-font-size);
|
144
144
|
font-weight: var(--mds-font-apps-body-large-medium-font-weight);
|
145
145
|
line-height: var(--mds-font-apps-body-large-medium-line-height);
|
146
146
|
text-decoration: var(--mds-font-apps-body-large-medium-text-decoration);
|
147
147
|
text-transform: var(--mds-font-apps-body-large-medium-text-case);
|
148
148
|
}
|
149
|
-
|
150
|
-
:host([type=
|
149
|
+
|
150
|
+
:host([type='body-large-regular-underline']) {
|
151
151
|
font-size: var(--mds-font-apps-body-large-regular-underline-font-size);
|
152
152
|
font-weight: var(--mds-font-apps-body-large-regular-underline-font-weight);
|
153
153
|
line-height: var(--mds-font-apps-body-large-regular-underline-line-height);
|
154
154
|
text-decoration: var(--mds-font-apps-body-large-regular-underline-text-decoration);
|
155
155
|
text-transform: var(--mds-font-apps-body-large-regular-underline-text-case);
|
156
156
|
}
|
157
|
-
|
158
|
-
:host([type=
|
157
|
+
|
158
|
+
:host([type='body-large-regular']) {
|
159
159
|
font-size: var(--mds-font-apps-body-large-regular-font-size);
|
160
160
|
font-weight: var(--mds-font-apps-body-large-regular-font-weight);
|
161
161
|
line-height: var(--mds-font-apps-body-large-regular-line-height);
|
@@ -163,39 +163,39 @@ export const fontsStyles = css `
|
|
163
163
|
text-transform: var(--mds-font-apps-body-large-regular-text-case);
|
164
164
|
}
|
165
165
|
|
166
|
-
:host([type=
|
166
|
+
:host([type='body-midsize-bold']) {
|
167
167
|
font-size: var(--mds-font-apps-body-midsize-bold-font-size);
|
168
168
|
font-weight: var(--mds-font-apps-body-midsize-bold-font-weight);
|
169
169
|
line-height: var(--mds-font-apps-body-midsize-bold-line-height);
|
170
170
|
text-decoration: var(--mds-font-apps-body-midsize-bold-text-decoration);
|
171
171
|
text-transform: var(--mds-font-apps-body-midsize-bold-text-case);
|
172
172
|
}
|
173
|
-
|
174
|
-
:host([type=
|
173
|
+
|
174
|
+
:host([type='body-midsize-medium-underline']) {
|
175
175
|
font-size: var(--mds-font-apps-body-midsize-medium-underline-font-size);
|
176
176
|
font-weight: var(--mds-font-apps-body-midsize-medium-underline-font-weight);
|
177
177
|
line-height: var(--mds-font-apps-body-midsize-medium-underline-line-height);
|
178
178
|
text-decoration: var(--mds-font-apps-body-midsize-medium-underline-text-decoration);
|
179
179
|
text-transform: var(--mds-font-apps-body-midsize-medium-underline-text-case);
|
180
180
|
}
|
181
|
-
|
182
|
-
:host([type=
|
181
|
+
|
182
|
+
:host([type='body-midsize-medium']) {
|
183
183
|
font-size: var(--mds-font-apps-body-midsize-medium-font-size);
|
184
184
|
font-weight: var(--mds-font-apps-body-midsize-medium-font-weight);
|
185
185
|
line-height: var(--mds-font-apps-body-midsize-medium-line-height);
|
186
186
|
text-decoration: var(--mds-font-apps-body-midsize-medium-text-decoration);
|
187
187
|
text-transform: var(--mds-font-apps-body-midsize-medium-text-case);
|
188
188
|
}
|
189
|
-
|
190
|
-
:host([type=
|
189
|
+
|
190
|
+
:host([type='body-midsize-regular-underline']) {
|
191
191
|
font-size: var(--mds-font-apps-body-midsize-regular-underline-font-size);
|
192
192
|
font-weight: var(--mds-font-apps-body-midsize-regular-underline-font-weight);
|
193
193
|
line-height: var(--mds-font-apps-body-midsize-regular-underline-line-height);
|
194
194
|
text-decoration: var(--mds-font-apps-body-midsize-regular-underline-text-decoration);
|
195
195
|
text-transform: var(--mds-font-apps-body-midsize-regular-underline-text-case);
|
196
196
|
}
|
197
|
-
|
198
|
-
:host([type=
|
197
|
+
|
198
|
+
:host([type='body-midsize-regular']) {
|
199
199
|
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
200
200
|
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
201
201
|
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
@@ -203,39 +203,39 @@ export const fontsStyles = css `
|
|
203
203
|
text-transform: var(--mds-font-apps-body-midsize-regular-text-case);
|
204
204
|
}
|
205
205
|
|
206
|
-
:host([type=
|
206
|
+
:host([type='body-small-bold']) {
|
207
207
|
font-size: var(--mds-font-apps-body-small-bold-font-size);
|
208
208
|
font-weight: var(--mds-font-apps-body-small-bold-font-weight);
|
209
209
|
line-height: var(--mds-font-apps-body-small-bold-line-height);
|
210
210
|
text-decoration: var(--mds-font-apps-body-small-bold-text-decoration);
|
211
211
|
text-transform: var(--mds-font-apps-body-small-bold-text-case);
|
212
212
|
}
|
213
|
-
|
214
|
-
:host([type=
|
213
|
+
|
214
|
+
:host([type='body-small-medium-underline']) {
|
215
215
|
font-size: var(--mds-font-apps-body-small-medium-underline-font-size);
|
216
216
|
font-weight: var(--mds-font-apps-body-small-medium-underline-font-weight);
|
217
217
|
line-height: var(--mds-font-apps-body-small-medium-underline-line-height);
|
218
218
|
text-decoration: var(--mds-font-apps-body-small-medium-underline-text-decoration);
|
219
219
|
text-transform: var(--mds-font-apps-body-small-medium-underline-text-case);
|
220
220
|
}
|
221
|
-
|
222
|
-
:host([type=
|
221
|
+
|
222
|
+
:host([type='body-small-medium']) {
|
223
223
|
font-size: var(--mds-font-apps-body-small-medium-font-size);
|
224
224
|
font-weight: var(--mds-font-apps-body-small-medium-font-weight);
|
225
225
|
line-height: var(--mds-font-apps-body-small-medium-line-height);
|
226
226
|
text-decoration: var(--mds-font-apps-body-small-medium-text-decoration);
|
227
227
|
text-transform: var(--mds-font-apps-body-small-medium-text-case);
|
228
228
|
}
|
229
|
-
|
230
|
-
:host([type=
|
229
|
+
|
230
|
+
:host([type='body-small-regular-underline']) {
|
231
231
|
font-size: var(--mds-font-apps-body-small-regular-underline-font-size);
|
232
232
|
font-weight: var(--mds-font-apps-body-small-regular-underline-font-weight);
|
233
233
|
line-height: var(--mds-font-apps-body-small-regular-underline-line-height);
|
234
234
|
text-decoration: var(--mds-font-apps-body-small-regular-underline-text-decoration);
|
235
235
|
text-transform: var(--mds-font-apps-body-small-regular-underline-text-case);
|
236
236
|
}
|
237
|
-
|
238
|
-
:host([type=
|
237
|
+
|
238
|
+
:host([type='body-small-regular']) {
|
239
239
|
font-size: var(--mds-font-apps-body-small-regular-font-size);
|
240
240
|
font-weight: var(--mds-font-apps-body-small-regular-font-weight);
|
241
241
|
line-height: var(--mds-font-apps-body-small-regular-line-height);
|
@@ -9,8 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { html } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
|
-
import styles from './text.styles';
|
13
12
|
import { Component } from '../../models';
|
13
|
+
import styles from './text.styles';
|
14
14
|
import { DEFAULTS, VALID_TEXT_TAGS } from './text.constants';
|
15
15
|
/**
|
16
16
|
* Text component for creating styled text elements.
|
@@ -96,17 +96,27 @@ class Text extends Component {
|
|
96
96
|
// Lit does not support dynamically changing values for the tag name of a custom element.
|
97
97
|
// Read more: https://lit.dev/docs/templates/expressions/#invalid-locations
|
98
98
|
switch (this.tagname) {
|
99
|
-
case VALID_TEXT_TAGS.H1:
|
100
|
-
|
101
|
-
case VALID_TEXT_TAGS.
|
102
|
-
|
103
|
-
case VALID_TEXT_TAGS.
|
104
|
-
|
105
|
-
case VALID_TEXT_TAGS.
|
106
|
-
|
107
|
-
case VALID_TEXT_TAGS.
|
99
|
+
case VALID_TEXT_TAGS.H1:
|
100
|
+
return html `<h1 part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></h1>`;
|
101
|
+
case VALID_TEXT_TAGS.H2:
|
102
|
+
return html `<h2 part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></h2>`;
|
103
|
+
case VALID_TEXT_TAGS.H3:
|
104
|
+
return html `<h3 part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></h3>`;
|
105
|
+
case VALID_TEXT_TAGS.H4:
|
106
|
+
return html `<h4 part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></h4>`;
|
107
|
+
case VALID_TEXT_TAGS.H5:
|
108
|
+
return html `<h5 part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></h5>`;
|
109
|
+
case VALID_TEXT_TAGS.H6:
|
110
|
+
return html `<h6 part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></h6>`;
|
111
|
+
case VALID_TEXT_TAGS.DIV:
|
112
|
+
return html `<div part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></div>`;
|
113
|
+
case VALID_TEXT_TAGS.SPAN:
|
114
|
+
return html `<span part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></span>`;
|
115
|
+
case VALID_TEXT_TAGS.SMALL:
|
116
|
+
return html `<small part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></small>`;
|
108
117
|
case VALID_TEXT_TAGS.P:
|
109
|
-
default:
|
118
|
+
default:
|
119
|
+
return html `<p part=${DEFAULTS.CSS_PART_TEXT}><slot></slot></p>`;
|
110
120
|
}
|
111
121
|
}
|
112
122
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { TYPE, VALID_TEXT_TAGS } from './text.constants';
|
2
1
|
import type { ValueOf } from '../../utils/types';
|
2
|
+
import { TYPE, VALID_TEXT_TAGS } from './text.constants';
|
3
3
|
type TextType = ValueOf<typeof TYPE>;
|
4
4
|
type TagName = ValueOf<typeof VALID_TEXT_TAGS>;
|
5
5
|
export type { TextType, TagName };
|
@@ -109,9 +109,9 @@ declare class Textarea extends Textarea_base {
|
|
109
109
|
*/
|
110
110
|
maxCharacterLimit?: number;
|
111
111
|
/**
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
* @internal
|
113
|
+
* The textarea element
|
114
|
+
*/
|
115
115
|
inputElement: HTMLTextAreaElement;
|
116
116
|
private characterLimitExceedingFired;
|
117
117
|
protected get textarea(): HTMLTextAreaElement;
|
@@ -122,48 +122,48 @@ declare class Textarea extends Textarea_base {
|
|
122
122
|
/** @internal */
|
123
123
|
formStateRestoreCallback(state: string): void;
|
124
124
|
/**
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
125
|
+
* Handles the value change of the textarea field.
|
126
|
+
* Sets the form value and updates the validity of the textarea field.
|
127
|
+
* @returns void
|
128
|
+
*/
|
129
129
|
handleValueChange(): void;
|
130
130
|
protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
131
131
|
/**
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
132
|
+
* This function is called when the attribute changes.
|
133
|
+
* It updates the validity of the textarea field based on the textarea field's validity.
|
134
|
+
*
|
135
|
+
* @param name - attribute name
|
136
|
+
* @param old - old value
|
137
|
+
* @param value - new value
|
138
|
+
*/
|
139
139
|
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
140
140
|
/**
|
141
|
-
|
142
|
-
|
143
|
-
|
141
|
+
* Dispatches the character overflow state change event.
|
142
|
+
* @returns void
|
143
|
+
*/
|
144
144
|
private dispatchCharacterOverflowStateChangeEvent;
|
145
145
|
/**
|
146
146
|
* Handles the character overflow state change.
|
147
147
|
* Dispatches the character overflow state change event if the character limit is exceeded or restored.
|
148
148
|
* @returns void
|
149
|
-
|
149
|
+
*/
|
150
150
|
private handleCharacterOverflowStateChange;
|
151
151
|
/**
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
152
|
+
* Updates the value of the textarea field.
|
153
|
+
* Sets the form value.
|
154
|
+
* @returns void
|
155
|
+
*/
|
156
156
|
private updateValue;
|
157
157
|
/**
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
158
|
+
* Handles the change event of the textarea field.
|
159
|
+
* Updates the value and sets the validity of the textarea field.
|
160
|
+
*
|
161
|
+
* The 'change' event does not bubble up through the shadow DOM as it was not composed.
|
162
|
+
* Therefore, we need to re-dispatch the same event to ensure it is propagated correctly.
|
163
|
+
* Read more: https://developer.mozilla.org/en-US/docs/Web/API/Event/composed
|
164
|
+
*
|
165
|
+
* @param event - Event which contains information about the value change.
|
166
|
+
*/
|
167
167
|
private onChange;
|
168
168
|
protected renderCharacterCounter(): import("lit-html").TemplateResult<1> | typeof nothing;
|
169
169
|
protected renderTextareaFooter(): import("lit-html").TemplateResult<1> | typeof nothing;
|