@momentum-design/components 0.84.3 → 0.84.5
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 +2241 -2299
- 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.d.ts +7 -2
- package/dist/components/dialog/dialog.component.js +43 -33
- package/dist/components/dialog/dialog.constants.d.ts +1 -0
- package/dist/components/dialog/dialog.constants.js +1 -0
- 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 +239 -228
- 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 +3 -3
- package/dist/react/index.js +3 -3
- package/dist/utils/mixins/ButtonComponentMixin.js +10 -10
- package/dist/utils/mixins/CardAndDialogFooterMixin.js +21 -22
- package/dist/utils/mixins/FocusTrapMixin.js +15 -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,248 +1,250 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
|
3
|
-
const styles = [
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
`,
|
3
|
+
const styles = [
|
4
|
+
hostFitContentStyles,
|
5
|
+
css `
|
6
|
+
:host {
|
7
|
+
--mdc-tab-content-gap: 0.5rem;
|
8
|
+
--mdc-tab-height: 2rem;
|
9
|
+
|
10
|
+
--mdc-tab-glass-active-background-color-disabled: var(--mds-color-theme-button-primary-disabled);
|
11
|
+
--mdc-tab-glass-active-background-color-hover: var(--mds-color-theme-button-primary-hover);
|
12
|
+
--mdc-tab-glass-active-background-color-normal: var(--mds-color-theme-button-primary-normal);
|
13
|
+
--mdc-tab-glass-active-background-color-pressed: var(--mds-color-theme-button-primary-pressed);
|
14
|
+
|
15
|
+
--mdc-tab-glass-active-color: var(--mds-color-theme-inverted-text-primary-normal);
|
16
|
+
--mdc-tab-glass-active-color-disabled: var(--mds-color-theme-inverted-text-primary-disabled);
|
17
|
+
|
18
|
+
--mdc-tab-glass-border-radius: 0.5rem;
|
19
|
+
|
20
|
+
--mdc-tab-glass-inactive-background-color-disabled: var(--mds-color-theme-button-secondary-disabled);
|
21
|
+
--mdc-tab-glass-inactive-background-color-hover: var(--mds-color-theme-button-secondary-hover);
|
22
|
+
--mdc-tab-glass-inactive-background-color-normal: var(--mds-color-theme-button-secondary-normal);
|
23
|
+
--mdc-tab-glass-inactive-background-color-pressed: var(--mds-color-theme-button-secondary-pressed);
|
24
|
+
|
25
|
+
--mdc-tab-glass-inactive-color: var(--mds-color-theme-text-secondary-normal);
|
26
|
+
--mdc-tab-glass-inactive-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
27
|
+
|
28
|
+
--mdc-tab-line-active-background-color-disabled: var(--mds-color-theme-button-secondary-disabled);
|
29
|
+
--mdc-tab-line-active-background-color-hover: var(--mds-color-theme-button-secondary-hover);
|
30
|
+
--mdc-tab-line-active-background-color-normal: var(--mds-color-theme-button-secondary-normal);
|
31
|
+
--mdc-tab-line-active-background-color-pressed: var(--mds-color-theme-button-secondary-pressed);
|
32
|
+
|
33
|
+
--mdc-tab-line-active-color: var(--mds-color-theme-text-primary-normal);
|
34
|
+
--mdc-tab-line-active-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
35
|
+
|
36
|
+
--mdc-tab-line-active-indicator-color: var(--mds-color-theme-outline-input-active);
|
37
|
+
--mdc-tab-line-active-indicator-color-disabled: var(--mds-color-theme-outline-primary-disabled);
|
38
|
+
--mdc-tab-line-active-indicator-height: 0.125rem;
|
39
|
+
--mdc-tab-line-active-indicator-width: 100%;
|
40
|
+
|
41
|
+
--mdc-tab-line-border-bottom-left-radius: 0;
|
42
|
+
--mdc-tab-line-border-bottom-right-radius: 0;
|
43
|
+
--mdc-tab-line-border-top-left-radius: 0.25rem;
|
44
|
+
--mdc-tab-line-border-top-right-radius: 0.25rem;
|
45
|
+
|
46
|
+
--mdc-tab-line-inactive-background-color-disabled: var(--mds-color-theme-button-secondary-disabled);
|
47
|
+
--mdc-tab-line-inactive-background-color-hover: var(--mds-color-theme-button-secondary-hover);
|
48
|
+
--mdc-tab-line-inactive-background-color-normal: var(--mds-color-theme-button-secondary-normal);
|
49
|
+
--mdc-tab-line-inactive-background-color-pressed: var(--mds-color-theme-button-secondary-pressed);
|
50
|
+
|
51
|
+
--mdc-tab-line-inactive-color: var(--mds-color-theme-text-secondary-normal);
|
52
|
+
--mdc-tab-line-inactive-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
53
|
+
|
54
|
+
--mdc-tab-padding-left: 0.75rem;
|
55
|
+
--mdc-tab-padding-right: 0.75rem;
|
56
|
+
|
57
|
+
--mdc-tab-pill-active-background-color-disabled: var(--mds-color-theme-button-secondary-active-normal);
|
58
|
+
--mdc-tab-pill-active-background-color-hover: var(--mds-color-theme-button-secondary-active-hover);
|
59
|
+
--mdc-tab-pill-active-background-color-normal: var(--mds-color-theme-button-secondary-active-normal);
|
60
|
+
--mdc-tab-pill-active-background-color-pressed: var(--mds-color-theme-button-secondary-active-pressed);
|
61
|
+
|
62
|
+
--mdc-tab-pill-active-color: var(--mds-color-theme-text-primary-normal);
|
63
|
+
--mdc-tab-pill-active-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
64
|
+
|
65
|
+
--mdc-tab-pill-border-radius: 0.5rem;
|
66
|
+
|
67
|
+
--mdc-tab-pill-inactive-background-color-disabled: var(--mds-color-theme-button-secondary-disabled);
|
68
|
+
--mdc-tab-pill-inactive-background-color-hover: var(--mds-color-theme-button-secondary-hover);
|
69
|
+
--mdc-tab-pill-inactive-background-color-normal: var(--mds-color-theme-button-secondary-normal);
|
70
|
+
--mdc-tab-pill-inactive-background-color-pressed: var(--mds-color-theme-button-secondary-pressed);
|
71
|
+
|
72
|
+
--mdc-tab-pill-inactive-color: var(--mds-color-theme-text-secondary-normal);
|
73
|
+
--mdc-tab-pill-inactive-color-disabled: var(--mds-color-theme-text-primary-disabled);
|
74
|
+
|
75
|
+
flex-direction: column;
|
76
|
+
flex-shrink: 0;
|
77
|
+
height: var(--mdc-tab-height);
|
78
|
+
padding-left: var(--mdc-tab-padding-left);
|
79
|
+
padding-right: var(--mdc-tab-padding-right);
|
80
|
+
position: relative;
|
81
|
+
border: none;
|
82
|
+
}
|
83
|
+
|
84
|
+
:host::part(container) {
|
85
|
+
align-items: center;
|
86
|
+
display: flex;
|
87
|
+
flex-direction: row;
|
88
|
+
gap: var(--mdc-tab-content-gap);
|
89
|
+
justify-content: center;
|
90
|
+
width: fit-content;
|
91
|
+
}
|
92
|
+
|
93
|
+
:host::part(text) {
|
94
|
+
display: flex;
|
95
|
+
flex-direction: column;
|
96
|
+
}
|
97
|
+
|
98
|
+
:host mdc-text::after {
|
99
|
+
content: attr(data-text);
|
100
|
+
height: 0;
|
101
|
+
visibility: hidden;
|
102
|
+
overflow: hidden;
|
103
|
+
user-select: none;
|
104
|
+
pointer-events: none;
|
105
|
+
/* body-midsize-bold font styling */
|
106
|
+
font-size: var(--mds-font-apps-body-midsize-bold-font-size);
|
107
|
+
font-weight: var(--mds-font-apps-body-midsize-bold-font-weight);
|
108
|
+
line-height: var(--mds-font-apps-body-midsize-bold-line-height);
|
109
|
+
text-decoration: var(--mds-font-apps-body-midsize-bold-text-decoration);
|
110
|
+
text-transform: var(--mds-font-apps-body-midsize-bold-text-case);
|
111
|
+
}
|
112
|
+
|
113
|
+
:host::part(indicator) {
|
114
|
+
width: var(--mdc-tab-line-active-indicator-width);
|
115
|
+
height: var(--mdc-tab-line-active-indicator-height);
|
116
|
+
bottom: 0;
|
117
|
+
position: absolute;
|
118
|
+
visibility: hidden;
|
119
|
+
}
|
120
|
+
|
121
|
+
:host([disabled]) {
|
122
|
+
cursor: default;
|
123
|
+
}
|
124
|
+
|
125
|
+
:host([variant='glass']) {
|
126
|
+
background-color: var(--mdc-tab-glass-inactive-background-color-normal);
|
127
|
+
border-radius: var(--mdc-tab-glass-border-radius);
|
128
|
+
color: var(--mdc-tab-glass-inactive-color);
|
129
|
+
}
|
130
|
+
|
131
|
+
:host([variant='glass']:hover) {
|
132
|
+
background-color: var(--mdc-tab-glass-inactive-background-color-hover);
|
133
|
+
}
|
134
|
+
|
135
|
+
:host([variant='glass']:active) {
|
136
|
+
background-color: var(--mdc-tab-glass-inactive-background-color-pressed);
|
137
|
+
}
|
138
|
+
|
139
|
+
:host([variant='glass'][disabled]) {
|
140
|
+
background-color: var(--mdc-tab-glass-inactive-background-color-disabled);
|
141
|
+
color: var(--mdc-tab-glass-inactive-color-disabled);
|
142
|
+
}
|
143
|
+
|
144
|
+
:host([variant='glass'][active]) {
|
145
|
+
background-color: var(--mdc-tab-glass-active-background-color-normal);
|
146
|
+
color: var(--mdc-tab-glass-active-color);
|
147
|
+
}
|
148
|
+
|
149
|
+
:host([variant='glass'][active]:hover) {
|
150
|
+
background-color: var(--mdc-tab-glass-active-background-color-hover);
|
151
|
+
}
|
152
|
+
|
153
|
+
:host([variant='glass'][active]:active) {
|
154
|
+
background-color: var(--mdc-tab-glass-active-background-color-pressed);
|
155
|
+
}
|
156
|
+
|
157
|
+
:host([variant='glass'][active][disabled]) {
|
158
|
+
background-color: var(--mdc-tab-glass-active-background-color-disabled);
|
159
|
+
color: var(--mdc-tab-glass-active-color-disabled);
|
160
|
+
}
|
161
|
+
|
162
|
+
:host([variant='line']) {
|
163
|
+
background-color: var(--mdc-tab-line-inactive-background-color-normal);
|
164
|
+
border-top-left-radius: var(--mdc-tab-line-border-top-left-radius);
|
165
|
+
border-top-right-radius: var(--mdc-tab-line-border-top-right-radius);
|
166
|
+
border-bottom-left-radius: var(--mdc-tab-line-border-bottom-left-radius);
|
167
|
+
border-bottom-right-radius: var(--mdc-tab-line-border-bottom-right-radius);
|
168
|
+
color: var(--mdc-tab-line-inactive-color);
|
169
|
+
}
|
170
|
+
|
171
|
+
:host([variant='line']:hover) {
|
172
|
+
background-color: var(--mdc-tab-line-inactive-background-color-hover);
|
173
|
+
}
|
174
|
+
|
175
|
+
:host([variant='line']:active) {
|
176
|
+
background-color: var(--mdc-tab-line-inactive-background-color-pressed);
|
177
|
+
}
|
178
|
+
|
179
|
+
:host([variant='line'][disabled]) {
|
180
|
+
background-color: var(--mdc-tab-line-inactive-background-color-disabled);
|
181
|
+
color: var(--mdc-tab-line-inactive-color-disabled);
|
182
|
+
}
|
183
|
+
|
184
|
+
:host([variant='line'][active]) {
|
185
|
+
background-color: var(--mdc-tab-line-active-background-color-normal);
|
186
|
+
color: var(--mdc-tab-line-active-color);
|
187
|
+
}
|
188
|
+
|
189
|
+
:host([variant='line'][active])::part(indicator) {
|
190
|
+
background-color: var(--mdc-tab-line-active-indicator-color);
|
191
|
+
visibility: visible;
|
192
|
+
}
|
193
|
+
|
194
|
+
:host([variant='line'][active]:hover) {
|
195
|
+
background-color: var(--mdc-tab-line-active-background-color-hover);
|
196
|
+
}
|
197
|
+
|
198
|
+
:host([variant='line'][active]:active) {
|
199
|
+
background-color: var(--mdc-tab-line-active-background-color-pressed);
|
200
|
+
}
|
201
|
+
|
202
|
+
:host([variant='line'][active][disabled]) {
|
203
|
+
background-color: var(--mdc-tab-line-active-background-color-disabled);
|
204
|
+
color: var(--mdc-tab-line-active-color-disabled);
|
205
|
+
}
|
206
|
+
|
207
|
+
:host([variant='line'][active][disabled])::part(indicator) {
|
208
|
+
background-color: var(--mdc-tab-line-active-indicator-color-disabled);
|
209
|
+
}
|
210
|
+
|
211
|
+
:host([variant='pill']) {
|
212
|
+
background-color: var(--mdc-tab-pill-inactive-background-color-normal);
|
213
|
+
border-radius: var(--mdc-tab-pill-border-radius);
|
214
|
+
color: var(--mdc-tab-pill-inactive-color);
|
215
|
+
}
|
216
|
+
|
217
|
+
:host([variant='pill']:hover) {
|
218
|
+
background-color: var(--mdc-tab-pill-inactive-background-color-hover);
|
219
|
+
}
|
220
|
+
|
221
|
+
:host([variant='pill']:active) {
|
222
|
+
background-color: var(--mdc-tab-pill-inactive-background-color-pressed);
|
223
|
+
}
|
224
|
+
|
225
|
+
:host([variant='pill'][disabled]) {
|
226
|
+
background-color: var(--mdc-tab-pill-inactive-background-color-disabled);
|
227
|
+
color: var(--mdc-tab-pill-inactive-color-disabled);
|
228
|
+
}
|
229
|
+
|
230
|
+
:host([variant='pill'][active]) {
|
231
|
+
background-color: var(--mdc-tab-pill-active-background-color-normal);
|
232
|
+
color: var(--mdc-tab-pill-active-color);
|
233
|
+
}
|
234
|
+
|
235
|
+
:host([variant='pill'][active]:hover) {
|
236
|
+
background-color: var(--mdc-tab-pill-active-background-color-hover);
|
237
|
+
}
|
238
|
+
|
239
|
+
:host([variant='pill'][active]:active) {
|
240
|
+
background-color: var(--mdc-tab-pill-active-background-color-pressed);
|
241
|
+
}
|
242
|
+
|
243
|
+
:host([variant='pill'][active][disabled]) {
|
244
|
+
background-color: var(--mdc-tab-pill-active-background-color-disabled);
|
245
|
+
color: var(--mdc-tab-pill-active-color-disabled);
|
246
|
+
}
|
247
|
+
`,
|
248
|
+
...hostFocusRingStyles(),
|
249
|
+
];
|
248
250
|
export default styles;
|
@@ -10,13 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
12
12
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
13
|
-
import styles from './tablist.styles';
|
14
13
|
import { Component } from '../../models';
|
15
|
-
import { ARROW_BUTTON_DIRECTION, KEYCODES } from './tablist.constants';
|
16
14
|
import Tab from '../tab/tab.component';
|
17
15
|
import Button from '../button/button.component';
|
18
|
-
import { getFirstTab, getLastTab, getNextTab, getPreviousTab, findTab, getActiveTab } from './tablist.utils';
|
19
16
|
import { ROLE } from '../../utils/roles';
|
17
|
+
import styles from './tablist.styles';
|
18
|
+
import { ARROW_BUTTON_DIRECTION, KEYCODES } from './tablist.constants';
|
19
|
+
import { getFirstTab, getLastTab, getNextTab, getPreviousTab, findTab, getActiveTab } from './tablist.utils';
|
20
20
|
/**
|
21
21
|
* Tab list organizes tabs into a container.
|
22
22
|
*
|
@@ -162,7 +162,7 @@ class TabList extends Component {
|
|
162
162
|
*/
|
163
163
|
this.resetTabIndexAndSetNewTabIndex = (newTab) => {
|
164
164
|
var _a;
|
165
|
-
(_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach(
|
165
|
+
(_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach(tab => {
|
166
166
|
tab.setAttribute('tabindex', tab === newTab ? '0' : '-1');
|
167
167
|
});
|
168
168
|
};
|
@@ -175,7 +175,7 @@ class TabList extends Component {
|
|
175
175
|
*/
|
176
176
|
this.setActiveTab = (newTab) => {
|
177
177
|
var _a;
|
178
|
-
(_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach(
|
178
|
+
(_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach(tab => {
|
179
179
|
if (tab === newTab) {
|
180
180
|
tab.setAttribute('active', '');
|
181
181
|
}
|
@@ -258,8 +258,8 @@ class TabList extends Component {
|
|
258
258
|
if (!this.showBackwardArrowButton && !this.showForwardArrowButton) {
|
259
259
|
(_a = getActiveTab(this.tabs || [])) === null || _a === void 0 ? void 0 : _a.focus();
|
260
260
|
}
|
261
|
-
else if ((this.showBackwardArrowButton && !this.showForwardArrowButton)
|
262
|
-
|
261
|
+
else if ((this.showBackwardArrowButton && !this.showForwardArrowButton) ||
|
262
|
+
(this.showForwardArrowButton && !this.showBackwardArrowButton)) {
|
263
263
|
(_b = this.notFocusedArrowButton) === null || _b === void 0 ? void 0 : _b.focus();
|
264
264
|
}
|
265
265
|
};
|
@@ -340,8 +340,8 @@ class TabList extends Component {
|
|
340
340
|
const forwardMultiplier = !this.isRtl() ? 1 : -1;
|
341
341
|
const backwardMultiplier = !this.isRtl() ? -1 : 1;
|
342
342
|
(_a = this.tabsContainer) === null || _a === void 0 ? void 0 : _a.scrollBy({
|
343
|
-
left: this.tabsContainer.clientWidth
|
344
|
-
|
343
|
+
left: this.tabsContainer.clientWidth *
|
344
|
+
(direction === ARROW_BUTTON_DIRECTION.FORWARD ? forwardMultiplier : backwardMultiplier),
|
345
345
|
// @ts-ignore : https://github.com/Microsoft/TypeScript/issues/28755
|
346
346
|
behavior: 'instant',
|
347
347
|
});
|
@@ -373,7 +373,7 @@ class TabList extends Component {
|
|
373
373
|
}
|
374
374
|
return;
|
375
375
|
}
|
376
|
-
const tabIds = this.tabs.map(
|
376
|
+
const tabIds = this.tabs.map(tab => tab.tabId);
|
377
377
|
if (new Set(tabIds).size !== this.tabs.length) {
|
378
378
|
if (this.onerror) {
|
379
379
|
this.onerror('The tabs inside the tab list must have unique tab ids');
|
@@ -442,11 +442,7 @@ class TabList extends Component {
|
|
442
442
|
></mdc-button>`
|
443
443
|
: nothing}`;
|
444
444
|
return html ` ${arrowButton('backward')}
|
445
|
-
<div
|
446
|
-
class="container"
|
447
|
-
role="${ROLE.TABLIST}"
|
448
|
-
tabindex="-1"
|
449
|
-
aria-label="${ifDefined(this.dataAriaLabel)}">
|
445
|
+
<div class="container" role="${ROLE.TABLIST}" tabindex="-1" aria-label="${ifDefined(this.dataAriaLabel)}">
|
450
446
|
<slot></slot>
|
451
447
|
</div>
|
452
448
|
${arrowButton(ARROW_BUTTON_DIRECTION.FORWARD)}`;
|
@@ -1,35 +1,37 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
import { baseHostStyleVariables } from '../../utils/styles';
|
3
|
-
const styles = [
|
3
|
+
const styles = [
|
4
|
+
baseHostStyleVariables,
|
4
5
|
css `
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
:host {
|
7
|
+
--mdc-tablist-focus-ring-outer-width: var(--mdc-focus-ring-outer-width);
|
8
|
+
--mdc-tablist-gap: 0.5rem;
|
9
|
+
--mdc-tablist-width: 100%;
|
10
|
+
--mdc-tablist-arrow-button-margin: 0.75rem;
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
width: var(--mdc-tablist-width);
|
13
|
+
display: flex;
|
14
|
+
align-items: center;
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
::slotted(mdc-tab) {
|
17
|
+
width: initial;
|
18
|
+
}
|
17
19
|
}
|
18
|
-
}
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
:host .container {
|
22
|
+
display: flex;
|
23
|
+
overflow-x: hidden;
|
24
|
+
gap: var(--mdc-tablist-gap);
|
25
|
+
padding: var(--mdc-tablist-focus-ring-outer-width);
|
26
|
+
}
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
:host mdc-button[prefix-icon='arrow-left-regular'] {
|
29
|
+
margin-right: var(--mdc-tablist-arrow-button-margin);
|
30
|
+
}
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
:host mdc-button[prefix-icon='arrow-right-regular'] {
|
33
|
+
margin-left: var(--mdc-tablist-arrow-button-margin);
|
34
|
+
}
|
35
|
+
`,
|
36
|
+
];
|
35
37
|
export default [...styles];
|