@shortfuse/materialdesignweb 0.7.1-0 → 0.7.1-2
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/bin/generate-css.js +1 -2
- package/components/Badge.js +40 -3
- package/components/Body.js +16 -2
- package/components/BottomAppBar.js +25 -2
- package/components/Box.js +33 -3
- package/components/Button.js +146 -9
- package/components/Card.js +111 -3
- package/components/Checkbox.js +91 -3
- package/components/CheckboxIcon.js +92 -4
- package/components/Chip.js +38 -2
- package/components/Dialog.js +237 -3
- package/components/DialogActions.js +3 -2
- package/components/Divider.js +44 -3
- package/components/ExtendedFab.js +27 -2
- package/components/Fab.js +26 -2
- package/components/FilterChip.js +83 -2
- package/components/Headline.js +16 -2
- package/components/Icon.js +80 -4
- package/components/IconButton.js +153 -2
- package/components/Label.js +16 -2
- package/components/Layout.js +21 -3
- package/components/List.js +15 -2
- package/components/ListItem.js +229 -3
- package/components/ListOption.js +37 -3
- package/components/ListSelect.js +12 -2
- package/components/Menu.js +173 -3
- package/components/MenuItem.js +55 -2
- package/components/Nav.js +19 -2
- package/components/NavBar.js +37 -2
- package/components/NavBarItem.js +44 -2
- package/components/NavDrawer.js +34 -2
- package/components/NavDrawerItem.js +44 -2
- package/components/NavItem.js +183 -3
- package/components/NavRail.js +50 -2
- package/components/NavRailItem.js +25 -2
- package/components/Pane.js +263 -3
- package/components/Progress.js +469 -10
- package/components/Radio.js +97 -3
- package/components/RadioIcon.js +77 -5
- package/components/Ripple.js +76 -3
- package/components/SegmentedButton.js +97 -2
- package/components/SegmentedButtonGroup.js +15 -2
- package/components/Select.js +54 -2
- package/components/Shape.js +55 -18
- package/components/Slider.js +309 -3
- package/components/Snackbar.js +82 -2
- package/components/Surface.js +13 -4
- package/components/Switch.js +67 -4
- package/components/SwitchIcon.js +272 -5
- package/components/Tab.js +87 -3
- package/components/TabContent.js +21 -21
- package/components/TabList.js +131 -2
- package/components/TextArea.js +97 -3
- package/components/Title.js +16 -2
- package/components/Tooltip.js +42 -2
- package/components/TopAppBar.js +212 -3
- package/core/template.js +36 -9
- package/mixins/ControlMixin.js +65 -2
- package/mixins/DensityMixin.js +17 -3
- package/mixins/FlexableMixin.js +81 -3
- package/mixins/RippleMixin.js +15 -4
- package/mixins/ShapeMixin.js +279 -8
- package/mixins/StateMixin.js +87 -5
- package/mixins/SurfaceMixin.js +152 -3
- package/mixins/TextFieldMixin.js +661 -3
- package/mixins/ThemableMixin.js +206 -3
- package/mixins/TooltipTriggerMixin.js +30 -4
- package/mixins/TouchTargetMixin.js +29 -4
- package/package.json +2 -1
- package/theming/loader.js +0 -2
- package/components/Badge.css +0 -38
- package/components/Body.css +0 -14
- package/components/BottomAppBar.css +0 -23
- package/components/Box.css +0 -31
- package/components/Button.css +0 -147
- package/components/Card.css +0 -109
- package/components/Checkbox.css +0 -89
- package/components/CheckboxIcon.css +0 -90
- package/components/Chip.css +0 -35
- package/components/Dialog.css +0 -235
- package/components/Divider.css +0 -41
- package/components/ExtendedFab.css +0 -24
- package/components/Fab.css +0 -23
- package/components/FilterChip.css +0 -80
- package/components/Headline.css +0 -14
- package/components/Icon.css +0 -76
- package/components/IconButton.css +0 -150
- package/components/Label.css +0 -14
- package/components/Layout.css +0 -19
- package/components/List.css +0 -12
- package/components/ListItem.css +0 -224
- package/components/ListOption.css +0 -34
- package/components/ListSelect.css +0 -9
- package/components/Menu.css +0 -171
- package/components/MenuItem.css +0 -53
- package/components/Nav.css +0 -17
- package/components/NavBar.css +0 -34
- package/components/NavBarItem.css +0 -41
- package/components/NavDrawer.css +0 -31
- package/components/NavDrawerItem.css +0 -42
- package/components/NavItem.css +0 -181
- package/components/NavRail.css +0 -47
- package/components/NavRailItem.css +0 -25
- package/components/Outline.css +0 -138
- package/components/Pane.css +0 -261
- package/components/Progress.css +0 -75
- package/components/ProgressCircle.css +0 -226
- package/components/ProgressLine.css +0 -155
- package/components/Radio.css +0 -95
- package/components/RadioIcon.css +0 -73
- package/components/Ripple.css +0 -74
- package/components/SegmentedButton.css +0 -94
- package/components/SegmentedButtonGroup.css +0 -12
- package/components/Select.css +0 -52
- package/components/Shape.css +0 -132
- package/components/Slider.css +0 -307
- package/components/Snackbar.css +0 -80
- package/components/Surface.css +0 -10
- package/components/Switch.css +0 -64
- package/components/SwitchIcon.css +0 -178
- package/components/SwitchIconAnimations.css +0 -89
- package/components/Tab.css +0 -85
- package/components/TabList.css +0 -129
- package/components/TextArea.css +0 -93
- package/components/Title.css +0 -14
- package/components/Tooltip.css +0 -40
- package/components/TopAppBar.css +0 -209
- package/mixins/ControlMixin.css +0 -57
- package/mixins/DensityMixin.css +0 -40
- package/mixins/FlexableMixin.css +0 -79
- package/mixins/RippleMixin.css +0 -12
- package/mixins/ShapeMixin.css +0 -135
- package/mixins/StateMixin.css +0 -82
- package/mixins/SurfaceMixin.css +0 -150
- package/mixins/TextFieldMixin.css +0 -657
- package/mixins/ThemableMixin.css +0 -204
- package/mixins/TooltipTriggerMixin.css +0 -27
- package/mixins/TouchTargetMixin.css +0 -26
package/components/IconButton.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import TooltipTriggerMixin from '../mixins/TooltipTriggerMixin.js';
|
|
2
2
|
|
|
3
3
|
import Button from './Button.js';
|
|
4
|
-
import styles from './IconButton.css' assert { type: 'css' };
|
|
5
4
|
|
|
6
5
|
export default Button
|
|
7
6
|
.mixin(TooltipTriggerMixin)
|
|
8
7
|
.extend()
|
|
9
|
-
.css(styles)
|
|
10
8
|
.observe({
|
|
11
9
|
_ariaPressed: {
|
|
12
10
|
get({ type, checked }) {
|
|
@@ -62,4 +60,157 @@ export default Button
|
|
|
62
60
|
outline.setAttribute('selected', '{checked}');
|
|
63
61
|
},
|
|
64
62
|
})
|
|
63
|
+
.css`
|
|
64
|
+
/* https://m3.material.io/components/icon-buttons/specs */
|
|
65
|
+
|
|
66
|
+
:host {
|
|
67
|
+
--mdw-shape__size: var(--mdw-shape__full);
|
|
68
|
+
--mdw-ink: rgb(var(--mdw-color__on-surface-variant));
|
|
69
|
+
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
|
|
73
|
+
padding: max(8px, calc(8px + (var(--mdw-density) * 2px)));
|
|
74
|
+
|
|
75
|
+
background-color: transparent;
|
|
76
|
+
|
|
77
|
+
font-size: 24px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host(:where([type="checkbox"])) {
|
|
81
|
+
--mdw-ink: var(--mdw-color__primary);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Filled | Filled Checked */
|
|
85
|
+
:host(:where([filled])) {
|
|
86
|
+
--mdw-ink: var(--mdw-color__on-primary);
|
|
87
|
+
--mdw-bg: var(--mdw-color__primary);
|
|
88
|
+
--mdw-surface__shadow__resting: none;
|
|
89
|
+
--mdw-surface__shadow__raised: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Tonal | Tonal Checked */
|
|
93
|
+
:host(:where([filled="tonal"])) {
|
|
94
|
+
--mdw-ink: var(--mdw-color__on-secondary-container);
|
|
95
|
+
--mdw-bg: var(--mdw-color__secondary-container);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Outlined | Outlined Unchecked */
|
|
99
|
+
:host(:where([outlined])) {
|
|
100
|
+
--mdw-ink: var(--mdw-color__on-surface-variant);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Outlined | Outlined Unchecked */
|
|
104
|
+
:host(:where([outlined][type="checkbox"])) {
|
|
105
|
+
--mdw-bg: var(--mdw-color__inverse-surface);
|
|
106
|
+
--mdw-ink: var(--mdw-color__inverse-on-surface);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#label {
|
|
110
|
+
font-size: inherit;
|
|
111
|
+
letter-spacing: inherit;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
#shape[toggle] {
|
|
115
|
+
background-color: transparent;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.colored[toggle] {
|
|
119
|
+
color: rgb(var(--mdw-color__on-surface-variant));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.colored[selected] {
|
|
123
|
+
/* background-color: rgb(var(--mdw-bg)); */
|
|
124
|
+
color: rgb(var(--mdw-ink));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#shape[filled][toggle] {
|
|
128
|
+
background-color: rgb(var(--mdw-color__surface-variant));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.colored[filled][toggle] {
|
|
132
|
+
color: rgb(var(--mdw-bg));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#shape[filled="tonal"][toggle] {
|
|
136
|
+
background-color: rgb(var(--mdw-color__surface-variant));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.colored[filled="tonal"][toggle] {
|
|
140
|
+
color: rgb(var(--mdw-color__on-surface-variant));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
#shape[filled][selected] {
|
|
144
|
+
background-color: rgb(var(--mdw-bg));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.colored[filled][selected] {
|
|
148
|
+
color: rgb(var(--mdw-ink));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
#shape[outlined] {
|
|
152
|
+
background-color: transparent;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.colored[outlined] {
|
|
156
|
+
color: inherit;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
#shape[outlined][toggle] {
|
|
160
|
+
background-color: transparent;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.colored[outlined][toggle] {
|
|
164
|
+
color: rgb(var(--mdw-color__on-surface-variant));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
#shape[outlined][selected] {
|
|
168
|
+
background-color: rgb(var(--mdw-bg));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.colored[outlined][selected] {
|
|
172
|
+
color: rgb(var(--mdw-ink));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#icon {
|
|
176
|
+
font-size: inherit;
|
|
177
|
+
font-variation-settings: 'FILL' 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
#icon[toggle] {
|
|
181
|
+
font-variation-settings: 'FILL' 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
#icon[selected] {
|
|
185
|
+
font-variation-settings: 'FILL' 1;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
#outline[focused] {
|
|
189
|
+
opacity: 1;
|
|
190
|
+
|
|
191
|
+
color: inherit;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
#outline[selected] {
|
|
195
|
+
opacity: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Disabled */
|
|
199
|
+
.colored[disabled] {
|
|
200
|
+
cursor: not-allowed;
|
|
201
|
+
|
|
202
|
+
color: rgba(var(--mdw-color__on-surface), 0.38);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
#shape[disabled][filled],
|
|
206
|
+
#shape[disabled][outlined][selected] {
|
|
207
|
+
background-color: rgba(var(--mdw-color__on-surface), 0.12);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.colored[disabled][filled],
|
|
211
|
+
.colored[disabled][outlined][selected] {
|
|
212
|
+
color: rgba(var(--mdw-color__on-surface), 0.38);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
`
|
|
65
216
|
.autoRegister('mdw-icon-button');
|
package/components/Label.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import Box from './Box.js';
|
|
2
|
-
import styles from './Label.css' assert { type: 'css' };
|
|
3
2
|
|
|
4
3
|
export default Box
|
|
5
4
|
.extend()
|
|
6
|
-
.css
|
|
5
|
+
.css`
|
|
6
|
+
:host {
|
|
7
|
+
font: var(--mdw-typescale__label-large__font);
|
|
8
|
+
letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([size="medium"]) {
|
|
12
|
+
font: var(--mdw-typescale__label-medium__font);
|
|
13
|
+
letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([size="small"]) {
|
|
17
|
+
font: var(--mdw-typescale__label-small__font);
|
|
18
|
+
letter-spacing: var(--mdw-typescale__body-small__letter-spacing);
|
|
19
|
+
}
|
|
20
|
+
`
|
|
7
21
|
.autoRegister('mdw-label');
|
package/components/Layout.js
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import CustomElement from '../core/CustomElement.js';
|
|
2
2
|
|
|
3
|
-
import styles from './Layout.css' assert {type:'css'};
|
|
4
|
-
|
|
5
3
|
export default CustomElement
|
|
6
4
|
.extend()
|
|
7
|
-
.css(styles)
|
|
8
5
|
.html/* html */`
|
|
9
6
|
<slot id=slot-top name=top></slot>
|
|
10
7
|
<slot id=slot></slot>
|
|
11
8
|
`
|
|
9
|
+
.css`
|
|
10
|
+
/* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
|
|
11
|
+
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Pane Slot */
|
|
17
|
+
#slot {
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: 24px;
|
|
20
|
+
|
|
21
|
+
justify-content: center;
|
|
22
|
+
|
|
23
|
+
padding-inline: 16px;
|
|
24
|
+
|
|
25
|
+
transition: padding-inline 100ms;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media screen and (min-width: 648px) { #slot { padding-inline: 24px; } }
|
|
29
|
+
`
|
|
12
30
|
.autoRegister('mdw-layout');
|
package/components/List.js
CHANGED
|
@@ -2,7 +2,6 @@ import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';
|
|
|
2
2
|
import DensityMixin from '../mixins/DensityMixin.js';
|
|
3
3
|
|
|
4
4
|
import Box from './Box.js';
|
|
5
|
-
import styles from './List.css' assert { type: 'css' };
|
|
6
5
|
|
|
7
6
|
/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */
|
|
8
7
|
|
|
@@ -10,8 +9,22 @@ export default Box
|
|
|
10
9
|
.mixin(DensityMixin)
|
|
11
10
|
.mixin(AriaReflectorMixin)
|
|
12
11
|
.extend()
|
|
13
|
-
.css(styles)
|
|
14
12
|
.set({
|
|
15
13
|
_ariaRole: 'list',
|
|
16
14
|
})
|
|
15
|
+
.css`
|
|
16
|
+
/* https://m3.material.io/components/lists/specs */
|
|
17
|
+
|
|
18
|
+
:host {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
|
|
22
|
+
padding-block: 8px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(:focus) {
|
|
26
|
+
outline: 1px solid red;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`
|
|
17
30
|
.autoRegister('mdw-list');
|
package/components/ListItem.js
CHANGED
|
@@ -11,8 +11,6 @@ import RippleMixin from '../mixins/RippleMixin.js';
|
|
|
11
11
|
import StateMixin from '../mixins/StateMixin.js';
|
|
12
12
|
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
13
13
|
|
|
14
|
-
import styles from './ListItem.css' assert { type: 'css' };
|
|
15
|
-
|
|
16
14
|
export default CustomElement
|
|
17
15
|
.mixin(ThemableMixin)
|
|
18
16
|
.mixin(StateMixin)
|
|
@@ -70,7 +68,6 @@ export default CustomElement
|
|
|
70
68
|
return this.radio || 'leading';
|
|
71
69
|
},
|
|
72
70
|
})
|
|
73
|
-
.css(styles)
|
|
74
71
|
.html/* html */`
|
|
75
72
|
<a id=anchor _if={href} href={href} disabled={disabledState} aria-labelledby=content></a>
|
|
76
73
|
<mdw-checkbox-icon id=checkbox _if={checkbox} aria-hidden=true class={checkboxClass} color={selectionColor} disabled={disabledState} icon=check selected={selected}></mdw-checkbox-icon>
|
|
@@ -101,6 +98,235 @@ export default CustomElement
|
|
|
101
98
|
this.updateAriaProperty('ariaDisabled', newValue ? 'true' : 'false');
|
|
102
99
|
},
|
|
103
100
|
})
|
|
101
|
+
.css`
|
|
102
|
+
/* https://m3.material.io/components/lists/specs */
|
|
103
|
+
|
|
104
|
+
:host {
|
|
105
|
+
--mdw-shape__size: 0px;
|
|
106
|
+
/* Grid does not auto collapse columns, leaving gaps */
|
|
107
|
+
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: 16px;
|
|
111
|
+
|
|
112
|
+
border: none;
|
|
113
|
+
padding-block: 8px;
|
|
114
|
+
padding-inline: 16px 24px;
|
|
115
|
+
|
|
116
|
+
cursor: auto;
|
|
117
|
+
|
|
118
|
+
outline: none;
|
|
119
|
+
|
|
120
|
+
color: inherit;
|
|
121
|
+
|
|
122
|
+
text-decoration: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([href]) {
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#anchor {
|
|
130
|
+
position: absolute;
|
|
131
|
+
inset: 0;
|
|
132
|
+
|
|
133
|
+
outline: none;
|
|
134
|
+
|
|
135
|
+
color: inherit;
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host([video]) {
|
|
140
|
+
padding-inline-start: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([lines="3"]) {
|
|
144
|
+
align-items: flex-start;
|
|
145
|
+
|
|
146
|
+
padding-block: 12px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
#content {
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: flex-start;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
justify-content: center;
|
|
154
|
+
|
|
155
|
+
flex: 1;
|
|
156
|
+
|
|
157
|
+
padding-block: calc(8px + (var(--mdw-density) * 2px));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#content:is([has-supporting], [lines="2"]) {
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
min-block-size: calc(8px + calc(48px + var(--mdw-density) * 2px));
|
|
163
|
+
padding-block: calc(4px + var(--mdw-density) * 2px);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
#content:is([lines="3"]) {
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
min-block-size: calc(8px + calc(48px + var(--mdw-density) * 2px));
|
|
169
|
+
padding-block: calc(0 + var(--mdw-density) * 2px);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
#icon {
|
|
173
|
+
font-size: 24px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#trailing-icon {
|
|
177
|
+
font-size: 24px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
#divider {
|
|
181
|
+
position: absolute;
|
|
182
|
+
inset-block-end: 0;
|
|
183
|
+
|
|
184
|
+
display: block;
|
|
185
|
+
|
|
186
|
+
color: rgb(var(--mdw-color__surface-variant));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
#divider[divider="inset"] {
|
|
190
|
+
padding-inline: 16px 24px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
#slot {
|
|
194
|
+
max-block-size: var(--mdw-typescale__body-large__line-height) * 2;
|
|
195
|
+
|
|
196
|
+
/* background-color: rgba(255,0,0,0.10); */
|
|
197
|
+
|
|
198
|
+
color: var(--mdw-color__on-surface);
|
|
199
|
+
|
|
200
|
+
font: var(--mdw-typescale__body-large__font);
|
|
201
|
+
letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
#supporting {
|
|
205
|
+
max-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);
|
|
206
|
+
|
|
207
|
+
/* background-color: rgba(0,255,0,0.10); */
|
|
208
|
+
|
|
209
|
+
color: var(--mdw-color__on-surface-variant);
|
|
210
|
+
|
|
211
|
+
font: var(--mdw-typescale__body-medium__font);
|
|
212
|
+
letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
#trailing {
|
|
216
|
+
color: var(--mdw-color__on-surface-variant);
|
|
217
|
+
|
|
218
|
+
font: var(--mdw-typescale__body-medium__font);
|
|
219
|
+
letter-spacing: var(--mdw-typescale__body-medium__letter-spacing);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
#slot, #supporting {
|
|
223
|
+
display: block;
|
|
224
|
+
overflow-x: hidden;
|
|
225
|
+
overflow-y: hidden;
|
|
226
|
+
|
|
227
|
+
text-align: start;
|
|
228
|
+
text-overflow: ellipsis;
|
|
229
|
+
text-transform: none;
|
|
230
|
+
white-space: normal;
|
|
231
|
+
word-break: break-word;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
#supporting[lines="2"] {
|
|
235
|
+
min-block-size: var(--mdw-typescale__body-medium__line-height);
|
|
236
|
+
max-block-size: var(--mdw-typescale__body-medium__line-height);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
#supporting[lines="3"] {
|
|
240
|
+
min-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);
|
|
241
|
+
max-block-size: calc(var(--mdw-typescale__body-medium__line-height) * 2);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@supports(width: 1lh) {
|
|
245
|
+
#slot {
|
|
246
|
+
max-block-size: 1lh;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
#supporting {
|
|
250
|
+
max-block-size: 2lh;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
#supporting[lines="2"] {
|
|
254
|
+
min-block-size: 1lh;
|
|
255
|
+
max-block-size: 1lh;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
#supporting[lines="3"] {
|
|
259
|
+
min-block-size: 2lh;
|
|
260
|
+
max-block-size: 2lh;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
@supports(-webkit-line-clamp:1) {
|
|
265
|
+
#slot {
|
|
266
|
+
display: -webkit-box;
|
|
267
|
+
-webkit-box-orient: vertical;
|
|
268
|
+
-webkit-line-clamp: 1;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
#supporting {
|
|
272
|
+
display: -webkit-box;
|
|
273
|
+
-webkit-line-clamp: 2;
|
|
274
|
+
-webkit-box-orient: vertical;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
#supporting[lines="2"] {
|
|
278
|
+
-webkit-line-clamp: 1;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
#avatar {
|
|
283
|
+
display: flex;
|
|
284
|
+
align-items: center;
|
|
285
|
+
justify-content: center;
|
|
286
|
+
|
|
287
|
+
block-size: 40px;
|
|
288
|
+
inline-size: 40px;
|
|
289
|
+
|
|
290
|
+
border-radius: 50%;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
#img {
|
|
294
|
+
block-size: 56px;
|
|
295
|
+
max-block-size: 56px;
|
|
296
|
+
inline-size: 56px;
|
|
297
|
+
max-inline-size: 56px;
|
|
298
|
+
|
|
299
|
+
object-fit: cover;
|
|
300
|
+
object-position: center center;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
#img[video] {
|
|
304
|
+
block-size: 64px;
|
|
305
|
+
max-block-size: 64px;
|
|
306
|
+
inline-size: 114px;
|
|
307
|
+
max-inline-size: 114px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
#checkbox {
|
|
311
|
+
/* stylelint-disable-next-line declaration-property-value-disallowed-list */
|
|
312
|
+
margin: 3px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
#radio {
|
|
316
|
+
/* stylelint-disable-next-line declaration-property-value-disallowed-list */
|
|
317
|
+
margin: 2px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.trailing {
|
|
321
|
+
order: 1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:host([disabled]) {
|
|
325
|
+
opacity: 0.38;
|
|
326
|
+
|
|
327
|
+
color: rgb(var(--mdw-color__on-surface));
|
|
328
|
+
}
|
|
329
|
+
`
|
|
104
330
|
.childEvents({
|
|
105
331
|
supporting: {
|
|
106
332
|
/** @param {Event & {currentTarget: HTMLSlotElement}} event */
|
package/components/ListOption.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
2
2
|
|
|
3
3
|
import ListItem from './ListItem.js';
|
|
4
|
-
import styles from './ListOption.css' assert {type: 'css'};
|
|
5
4
|
|
|
6
5
|
// https://html.spec.whatwg.org/multipage/form-elements.html#htmloptionelement
|
|
7
6
|
|
|
@@ -70,7 +69,6 @@ export default class ListOption extends ListItem
|
|
|
70
69
|
this.refs.anchor.focus(...options);
|
|
71
70
|
},
|
|
72
71
|
})
|
|
73
|
-
.css(styles)
|
|
74
72
|
.on({
|
|
75
73
|
composed({ inline }) {
|
|
76
74
|
const { anchor, state, content } = this.refs;
|
|
@@ -92,7 +90,43 @@ export default class ListOption extends ListItem
|
|
|
92
90
|
|
|
93
91
|
state.setAttribute('state-disabled', 'focus');
|
|
94
92
|
},
|
|
95
|
-
})
|
|
93
|
+
})
|
|
94
|
+
.css`
|
|
95
|
+
:host {
|
|
96
|
+
--mdw-bg: var(--mdw-color__secondary-container);
|
|
97
|
+
--mdw-ink: var(--mdw-color__on-secondary-container);
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
|
|
100
|
+
z-index: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([href]) {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host([disabled]) {
|
|
108
|
+
cursor: not-allowed;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#content {
|
|
113
|
+
-webkit-user-select: none;
|
|
114
|
+
user-select: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#content[selected] {
|
|
118
|
+
color: rgb(var(--mdw-ink));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
#anchor {
|
|
122
|
+
z-index: -1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
#anchor[selected] {
|
|
126
|
+
background-color: rgb(var(--mdw-bg));
|
|
127
|
+
color: rgb(var(--mdw-ink));
|
|
128
|
+
}
|
|
129
|
+
` {
|
|
96
130
|
static { this.autoRegister('mdw-list-option'); }
|
|
97
131
|
|
|
98
132
|
/**
|
package/components/ListSelect.js
CHANGED
|
@@ -5,7 +5,6 @@ import StateMixin from '../mixins/StateMixin.js';
|
|
|
5
5
|
|
|
6
6
|
import List from './List.js';
|
|
7
7
|
import ListOption from './ListOption.js';
|
|
8
|
-
import styles from './ListSelect.css' assert { type: 'css' };
|
|
9
8
|
|
|
10
9
|
/** @implements {HTMLSelectElement} */
|
|
11
10
|
export default class ListSelect extends List
|
|
@@ -14,7 +13,18 @@ export default class ListSelect extends List
|
|
|
14
13
|
.mixin(KeyboardNavMixin) {
|
|
15
14
|
static {
|
|
16
15
|
this.autoRegister('mdw-list-select');
|
|
17
|
-
|
|
16
|
+
// eslint-disable-next-line no-unused-expressions
|
|
17
|
+
this.css`
|
|
18
|
+
:host(:disabled) {
|
|
19
|
+
cursor: not-allowed;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([internals-disabled]) {
|
|
24
|
+
cursor: not-allowed;
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
18
28
|
this.on({
|
|
19
29
|
disabledStateChanged(oldValue, newValue) {
|
|
20
30
|
this._kbdFocusable = !newValue;
|