material 3.16.1 → 3.16.3
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 +2 -2
- package/dist/components/bottom-sheet/features/drag.js +186 -71
- package/dist/components/carousel/features/scroll.js +77 -5
- package/dist/components/carousel/features/slides.js +8 -4
- package/dist/components/list/index.d.ts +1 -1
- package/dist/components/slider/features/controller.js +21 -12
- package/dist/components/split-button/constants.js +1 -1
- package/dist/elements/css/bottom-sheet.css +1 -1
- package/dist/elements/css/carousel.css +1 -1
- package/dist/elements/css/drawer.css +1 -1
- package/dist/elements/css/list.css +1 -1
- package/dist/elements/css/slider.css +1 -1
- package/dist/elements/css/split-button.css +1 -1
- package/dist/elements/preupgrade/app-bar.css +1 -1
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-drawer.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +1 -1
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +1 -1
- package/dist/elements/styles.js +6 -6
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-elements.css +1 -1
- package/dist/styles/base-lite.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/bottom-app-bar-toolbar.css +1 -1
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +2 -2
- package/dist/styles/button-filled-small-round.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +2 -2
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +2 -2
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +2 -2
- package/dist/styles/listbox.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +1 -1
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +2 -2
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +2 -2
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/timepicker.css +1 -1
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +2 -2
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +2 -2
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +2 -2
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +2 -2
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +2 -2
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/dist/tokens/catalogue.json +3 -3
- package/package.json +1 -1
- package/src/styles/components/_bottom-sheet.scss +3 -3
- package/src/styles/components/_carousel.scss +8 -2
- package/src/styles/components/_drawer.scss +11 -11
- package/src/styles/components/_list.scss +6 -1
- package/src/styles/components/_slider.scss +3 -1
- package/src/styles/components/_split-button.scss +6 -16
- package/src/styles/themes/_autumn.scss +4 -0
- package/src/styles/themes/_forest.scss +4 -0
- package/src/styles/themes/_ocean.scss +4 -0
- package/src/styles/themes/_spring.scss +4 -0
- package/src/styles/themes/_sunset.scss +4 -0
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Import `material/styles/button` for any other variant, size or shape. This inclu
|
|
|
60
60
|
|-------|------------|
|
|
61
61
|
| Actions | Button, Icon button, Button group, Split button, FAB, Extended FAB, FAB menu, Toolbar |
|
|
62
62
|
| Selection and input | Checkbox, Switch, Radio buttons, Chips, Slider, Text field, Select, Search, Date picker, Time picker |
|
|
63
|
-
| Navigation | Navigation bar, Navigation rail, Drawer, Tabs, Menu, Top app bar
|
|
63
|
+
| Navigation | Navigation bar, Navigation rail, Drawer, Tabs, Menu, Top app bar |
|
|
64
64
|
| Containment | Card, Carousel, List, Divider, Dialog, Bottom sheet, Side sheet |
|
|
65
65
|
| Communication | Badge, Progress, Loading indicator, Snackbar, Tooltip |
|
|
66
66
|
|
|
@@ -138,7 +138,7 @@ What a bundler keeps, minified and gzipped (kB is 1,000 bytes), measured from th
|
|
|
138
138
|
| `createButton` from `material`, with code splitting: the initial chunks (the progress indicator loads on demand) | 7.6 kB |
|
|
139
139
|
| `createButton`, without code splitting (the progress indicator included) | 14.0 kB |
|
|
140
140
|
| `createButton`, `createTextField` and `createCheckbox`, without code splitting | 20.5 kB |
|
|
141
|
-
| Everything the root exports (`export * from 'material'`), without code splitting |
|
|
141
|
+
| Everything the root exports (`export * from 'material'`), without code splitting | 135.2 kB |
|
|
142
142
|
| `material/styles/base` | 3.1 kB |
|
|
143
143
|
| `material/styles/base-lite` | 1.7 kB |
|
|
144
144
|
| `material/styles/base` and `material/styles/button` | 5.4 kB |
|
|
@@ -1,94 +1,209 @@
|
|
|
1
|
-
import { BOTTOM_SHEET_DEFAULTS, BOTTOM_SHEET_EVENTS, BOTTOM_SHEET_STATES
|
|
1
|
+
import { BOTTOM_SHEET_DEFAULTS, BOTTOM_SHEET_EVENTS, BOTTOM_SHEET_STATES } from "../constants.js";
|
|
2
|
+
import { PREFIX } from "../../../core/config.js";
|
|
3
|
+
const { EXPANDED, PARTIAL, HIDDEN } = BOTTOM_SHEET_STATES;
|
|
4
|
+
const { POSITIONAL_THRESHOLD: POS, VELOCITY_THRESHOLD: FAST } = BOTTOM_SHEET_DEFAULTS;
|
|
5
|
+
const speedOf = (samples, now) => {
|
|
6
|
+
let i = samples.length - 1;
|
|
7
|
+
const last = samples[i];
|
|
8
|
+
if (!last || i < 1)
|
|
9
|
+
return 0;
|
|
10
|
+
while (i > 0 && samples[i - 1].y === last.y)
|
|
11
|
+
i -= 1;
|
|
12
|
+
const end = samples[i];
|
|
13
|
+
if (i === 0 || now - end.t >= 100)
|
|
14
|
+
return 0;
|
|
15
|
+
let j = i - 1;
|
|
16
|
+
while (j > 0 && end.t - samples[j - 1].t <= 100)
|
|
17
|
+
j -= 1;
|
|
18
|
+
return (end.y - samples[j].y) / Math.max(end.t - samples[j].t, 1) * 1000;
|
|
19
|
+
};
|
|
20
|
+
const aim = (at, offset, velocity) => {
|
|
21
|
+
let nearest = 0;
|
|
22
|
+
for (const point of at)
|
|
23
|
+
if (Math.abs(point - offset) < Math.abs(nearest - offset))
|
|
24
|
+
nearest = point;
|
|
25
|
+
const step = (up) => {
|
|
26
|
+
if (up)
|
|
27
|
+
return at.find((point) => point >= offset - 0.5) ?? at[at.length - 1];
|
|
28
|
+
for (let index = at.length - 1; index >= 0; index -= 1)
|
|
29
|
+
if (at[index] <= offset + 0.5)
|
|
30
|
+
return at[index];
|
|
31
|
+
return at[0];
|
|
32
|
+
};
|
|
33
|
+
if (velocity === 0)
|
|
34
|
+
return nearest;
|
|
35
|
+
const forward = velocity > 0;
|
|
36
|
+
if (Math.abs(velocity) >= FAST)
|
|
37
|
+
return step(forward);
|
|
38
|
+
const behind = step(!forward);
|
|
39
|
+
return Math.abs(behind - offset) >= POS ? step(forward) : behind;
|
|
40
|
+
};
|
|
2
41
|
export const withDrag = () => (component) => {
|
|
3
42
|
const { structure, state } = component;
|
|
4
43
|
const handle = structure.handle;
|
|
44
|
+
const node = structure.container;
|
|
5
45
|
if (!handle)
|
|
6
46
|
return { ...component, drag: { release: () => { } } };
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let offset = 0;
|
|
10
|
-
let dragging = false;
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
|
|
47
|
+
const style = node.style;
|
|
48
|
+
const view = handle.ownerDocument.defaultView;
|
|
49
|
+
let id = -1, y0 = 0, from = 0, offset = 0, full = 0, peek = 0;
|
|
50
|
+
let dragging = false, travel = 0, dragged = false, gesture = 0;
|
|
51
|
+
let samples = [];
|
|
52
|
+
const states = () => {
|
|
53
|
+
const span = Math.max(full - peek, 0);
|
|
54
|
+
const at = [0];
|
|
55
|
+
const name = [EXPANDED];
|
|
56
|
+
if (span > 1) {
|
|
57
|
+
at.push(span);
|
|
58
|
+
name.push(PARTIAL);
|
|
59
|
+
}
|
|
60
|
+
if (full > span + 1) {
|
|
61
|
+
at.push(full);
|
|
62
|
+
name.push(HIDDEN);
|
|
63
|
+
}
|
|
64
|
+
return { at, name };
|
|
14
65
|
};
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
dragged = false;
|
|
66
|
+
const place = (next) => {
|
|
67
|
+
if (full <= 0)
|
|
18
68
|
return;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
state.close();
|
|
23
|
-
else if (current === BOTTOM_SHEET_STATES.PARTIAL)
|
|
24
|
-
state.setState(BOTTOM_SHEET_STATES.EXPANDED);
|
|
25
|
-
else
|
|
26
|
-
state.open();
|
|
69
|
+
const span = Math.max(full - peek, 0);
|
|
70
|
+
style.maxHeight = `${next <= span ? full - next : peek}px`;
|
|
71
|
+
style.transform = `translateY(${next <= span ? 0 : next - span}px)`;
|
|
27
72
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return
|
|
73
|
+
const clear = () => { style.transition = style.maxHeight = style.transform = ""; };
|
|
74
|
+
const settle = (next, token) => {
|
|
75
|
+
void node.offsetHeight;
|
|
76
|
+
requestAnimationFrame(() => {
|
|
77
|
+
if (token !== gesture)
|
|
78
|
+
return;
|
|
79
|
+
const reduced = view?.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches ?? false;
|
|
80
|
+
style.transition = style.transform = "";
|
|
81
|
+
if (reduced || next !== HIDDEN) {
|
|
82
|
+
style.maxHeight = "";
|
|
83
|
+
return;
|
|
39
84
|
}
|
|
40
|
-
|
|
85
|
+
requestAnimationFrame(() => {
|
|
86
|
+
if (token !== gesture)
|
|
87
|
+
return;
|
|
88
|
+
const pending = (node.getAnimations?.() ?? []).filter((animation) => animation.playState === "running");
|
|
89
|
+
const drop = () => {
|
|
90
|
+
if (token === gesture)
|
|
91
|
+
style.maxHeight = "";
|
|
41
92
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
structure.container.style.transition = "none";
|
|
49
|
-
component.emit(BOTTOM_SHEET_EVENTS.DRAG_START);
|
|
93
|
+
if (!pending.length)
|
|
94
|
+
drop();
|
|
95
|
+
else
|
|
96
|
+
void Promise.all(pending.map((animation) => animation.finished.then(drop, drop)));
|
|
97
|
+
});
|
|
98
|
+
});
|
|
50
99
|
};
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
100
|
+
const note = (clientY) => {
|
|
101
|
+
const now = performance.now();
|
|
102
|
+
samples.push({ t: now, y: clientY });
|
|
103
|
+
if (samples.length > 12)
|
|
104
|
+
samples.shift();
|
|
105
|
+
travel = Math.max(travel, Math.abs(clientY - y0));
|
|
106
|
+
offset = Math.min(Math.max(from + clientY - y0, 0), Math.max(full, 0));
|
|
107
|
+
place(offset);
|
|
57
108
|
};
|
|
58
|
-
const
|
|
109
|
+
const finish = (clientY, flick = true) => {
|
|
59
110
|
if (!dragging)
|
|
60
111
|
return;
|
|
61
112
|
dragging = false;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
113
|
+
try {
|
|
114
|
+
handle.releasePointerCapture(id);
|
|
115
|
+
}
|
|
116
|
+
catch { }
|
|
117
|
+
if (clientY != null)
|
|
118
|
+
note(clientY);
|
|
119
|
+
const { at, name } = states();
|
|
120
|
+
const next = name[at.indexOf(aim(at, offset, flick ? speedOf(samples, performance.now()) : 0))] ?? EXPANDED;
|
|
121
|
+
samples = [];
|
|
122
|
+
if (travel > 4) {
|
|
123
|
+
dragged = true;
|
|
124
|
+
setTimeout(() => { dragged = false; }, 0);
|
|
125
|
+
}
|
|
68
126
|
const previous = state.getState();
|
|
69
|
-
|
|
70
|
-
if (next === BOTTOM_SHEET_STATES.HIDDEN)
|
|
127
|
+
if (next === HIDDEN)
|
|
71
128
|
state.close();
|
|
72
129
|
else
|
|
73
130
|
state.setState(next);
|
|
74
131
|
component.emit(BOTTOM_SHEET_EVENTS.DRAG_END, { state: next, previous });
|
|
132
|
+
settle(next, gesture);
|
|
75
133
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
134
|
+
const down = (event) => {
|
|
135
|
+
const root = node.parentElement;
|
|
136
|
+
if (dragging || event.button !== 0 || !root)
|
|
137
|
+
return;
|
|
138
|
+
gesture += 1;
|
|
139
|
+
dragging = true;
|
|
140
|
+
id = event.pointerId;
|
|
141
|
+
y0 = event.clientY;
|
|
142
|
+
travel = 0;
|
|
143
|
+
samples = [];
|
|
144
|
+
const seen = node.getBoundingClientRect();
|
|
145
|
+
const rootBox = root.getBoundingClientRect();
|
|
146
|
+
for (const animation of node.getAnimations?.() ?? [])
|
|
147
|
+
animation.cancel();
|
|
148
|
+
style.transition = "none";
|
|
149
|
+
const heightOf = (value) => { style.maxHeight = value; return node.getBoundingClientRect().height; };
|
|
150
|
+
full = heightOf("100%");
|
|
151
|
+
peek = heightOf(`var(--${PREFIX}-bottom-sheet-peek-height, 50%)`);
|
|
152
|
+
from = Math.min(Math.max(seen.top - (rootBox.bottom - full), 0), Math.max(full, 0));
|
|
153
|
+
offset = from;
|
|
154
|
+
place(offset);
|
|
155
|
+
note(event.clientY);
|
|
156
|
+
try {
|
|
157
|
+
handle.setPointerCapture(event.pointerId);
|
|
158
|
+
}
|
|
159
|
+
catch { }
|
|
160
|
+
component.emit(BOTTOM_SHEET_EVENTS.DRAG_START);
|
|
161
|
+
};
|
|
162
|
+
const move = (event) => {
|
|
163
|
+
if (!dragging || event.pointerId !== id)
|
|
164
|
+
return;
|
|
165
|
+
if (event.pointerType === "mouse" && event.buttons === 0)
|
|
166
|
+
finish(event.clientY, false);
|
|
167
|
+
else
|
|
168
|
+
note(event.clientY);
|
|
169
|
+
};
|
|
170
|
+
const up = (event) => {
|
|
171
|
+
if (event.pointerId === id)
|
|
172
|
+
finish(event.clientY);
|
|
173
|
+
};
|
|
174
|
+
const end = () => finish(undefined, false);
|
|
175
|
+
const label = () => handle.setAttribute("aria-label", state.getState() === EXPANDED ? "Close sheet" : "Expand sheet");
|
|
176
|
+
const onClick = () => {
|
|
177
|
+
if (dragged) {
|
|
178
|
+
dragged = false;
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const current = state.getState();
|
|
182
|
+
if (current === EXPANDED)
|
|
183
|
+
state.close();
|
|
184
|
+
else if (current === PARTIAL)
|
|
185
|
+
state.setState(EXPANDED);
|
|
186
|
+
else
|
|
187
|
+
state.open();
|
|
93
188
|
};
|
|
189
|
+
label();
|
|
190
|
+
component.on?.(BOTTOM_SHEET_EVENTS.STATE_CHANGE, label);
|
|
191
|
+
const pairs = [
|
|
192
|
+
["pointerdown", down], ["pointermove", move],
|
|
193
|
+
["pointerup", up], ["pointercancel", end],
|
|
194
|
+
["lostpointercapture", end], ["contextmenu", end], ["click", onClick],
|
|
195
|
+
];
|
|
196
|
+
for (const [type, fn] of pairs)
|
|
197
|
+
handle.addEventListener(type, fn);
|
|
198
|
+
view?.addEventListener("blur", end);
|
|
199
|
+
return { ...component, drag: { release: () => {
|
|
200
|
+
const pending = dragging;
|
|
201
|
+
finish(undefined, false);
|
|
202
|
+
if (!pending)
|
|
203
|
+
clear();
|
|
204
|
+
for (const [type, fn] of pairs)
|
|
205
|
+
handle.removeEventListener(type, fn);
|
|
206
|
+
view?.removeEventListener("blur", end);
|
|
207
|
+
component.off?.(BOTTOM_SHEET_EVENTS.STATE_CHANGE, label);
|
|
208
|
+
} } };
|
|
94
209
|
};
|
|
@@ -23,7 +23,7 @@ const corner = cornerRadius === CAROUSEL_DEFAULTS.CORNER_RADIUS
|
|
|
23
23
|
const reduceMotion = typeof window !== "undefined" && typeof window.matchMedia === "function"
|
|
24
24
|
? window.matchMedia("(prefers-reduced-motion: reduce)")
|
|
25
25
|
: null;
|
|
26
|
-
const { element, scroller, track, slideElements } = component;
|
|
26
|
+
const { element, scroller, track, layer, slideElements } = component;
|
|
27
27
|
const prefix = component.getClass("carousel");
|
|
28
28
|
const snapClass = `${prefix}__snap`;
|
|
29
29
|
element.classList.toggle(`${prefix}--snap`, snap);
|
|
@@ -97,6 +97,30 @@ sign = rtl ? -1 : 1;
|
|
|
97
97
|
lastStyles = new WeakMap();
|
|
98
98
|
count = slideElements.length;
|
|
99
99
|
containerSize = vertical ? scroller.clientHeight : scroller.clientWidth;
|
|
100
|
+
if (variant === CAROUSEL_VARIANTS.UNCONTAINED) {
|
|
101
|
+
layer.style.position = "static";
|
|
102
|
+
layer.style.width = "";
|
|
103
|
+
layer.style.height = "";
|
|
104
|
+
layer.style.top = "";
|
|
105
|
+
layer.style.left = "";
|
|
106
|
+
layer.style.right = "";
|
|
107
|
+
}
|
|
108
|
+
else if (vertical) {
|
|
109
|
+
layer.style.position = "";
|
|
110
|
+
layer.style.width = "100%";
|
|
111
|
+
layer.style.height = `${containerSize}px`;
|
|
112
|
+
layer.style.top = "0";
|
|
113
|
+
layer.style.left = "0";
|
|
114
|
+
layer.style.right = "";
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
layer.style.position = "";
|
|
118
|
+
layer.style.width = `${containerSize}px`;
|
|
119
|
+
layer.style.height = "100%";
|
|
120
|
+
layer.style.top = "0";
|
|
121
|
+
layer.style.left = rtl ? "auto" : "0";
|
|
122
|
+
layer.style.right = rtl ? "0" : "auto";
|
|
123
|
+
}
|
|
100
124
|
currentIndex = count ? Math.min(currentIndex, count - 1) : 0;
|
|
101
125
|
if (containerSize <= 0 || count === 0) {
|
|
102
126
|
strategy = null;
|
|
@@ -154,7 +178,7 @@ let offscreen = false;
|
|
|
154
178
|
if (!isUncontained) {
|
|
155
179
|
const placement = placeItem(strategy, keylines, i, scrollOffset);
|
|
156
180
|
const visible = Math.max(0, Math.min(itemSize, placement.size));
|
|
157
|
-
start = placement.center - itemSize / 2
|
|
181
|
+
start = placement.center - itemSize / 2;
|
|
158
182
|
offscreen = placement.center + visible / 2 < -itemSize || placement.center - visible / 2 > containerSize + itemSize;
|
|
159
183
|
inset = Math.max(0, (itemSize - visible) / 2);
|
|
160
184
|
if (fadeRange > 0)
|
|
@@ -240,11 +264,14 @@ slideElements[target].focus({ preventScroll: true });
|
|
|
240
264
|
goTo(target);
|
|
241
265
|
};
|
|
242
266
|
const handleFocusIn = (e) => {
|
|
267
|
+
if (dragging)
|
|
268
|
+
return;
|
|
243
269
|
const index = indexOf(e.target);
|
|
244
270
|
if (index >= 0 && index !== currentIndex)
|
|
245
271
|
goTo(index);
|
|
246
272
|
};
|
|
247
273
|
let dragging = false;
|
|
274
|
+
let dragPointer = null;
|
|
248
275
|
let dragged = false;
|
|
249
276
|
let dragStart = 0;
|
|
250
277
|
let dragScrollStart = 0;
|
|
@@ -263,6 +290,7 @@ clearPending();
|
|
|
263
290
|
if (e.pointerType !== "mouse" || e.button !== 0 || !strategy)
|
|
264
291
|
return;
|
|
265
292
|
dragging = true;
|
|
293
|
+
dragPointer = e.pointerId;
|
|
266
294
|
lastWheel = -Infinity;
|
|
267
295
|
dragged = false;
|
|
268
296
|
dragStart = vertical ? e.clientY : e.clientX;
|
|
@@ -272,16 +300,37 @@ dragVelocity = 0;
|
|
|
272
300
|
dragScrollStart = scroller[vertical ? "scrollTop" : "scrollLeft"];
|
|
273
301
|
restoreSnap();
|
|
274
302
|
element.dataset.settling = "true";
|
|
275
|
-
|
|
303
|
+
};
|
|
304
|
+
const endDrag = (e) => {
|
|
305
|
+
if (!dragging)
|
|
306
|
+
return;
|
|
307
|
+
if (e && dragPointer !== null && "pointerId" in e && e.pointerId !== dragPointer)
|
|
308
|
+
return;
|
|
309
|
+
dragging = false;
|
|
310
|
+
dragPointer = null;
|
|
311
|
+
dragged = false;
|
|
312
|
+
delete element.dataset.dragging;
|
|
313
|
+
restoreSnap();
|
|
276
314
|
};
|
|
277
315
|
const handlePointerMove = (e) => {
|
|
278
316
|
if (!dragging)
|
|
279
317
|
return;
|
|
318
|
+
if (dragPointer !== null && e.pointerId !== dragPointer)
|
|
319
|
+
return;
|
|
320
|
+
if (e.buttons === 0) {
|
|
321
|
+
if (scroller.hasPointerCapture(e.pointerId))
|
|
322
|
+
scroller.releasePointerCapture(e.pointerId);
|
|
323
|
+
endDrag(e);
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
280
326
|
const position = vertical ? e.clientY : e.clientX;
|
|
281
327
|
const delta = position - dragStart;
|
|
282
328
|
if (!dragged && Math.abs(delta) < DRAG_THRESHOLD)
|
|
283
329
|
return;
|
|
330
|
+
if (!dragged) {
|
|
284
331
|
dragged = true;
|
|
332
|
+
scroller.setPointerCapture(e.pointerId);
|
|
333
|
+
}
|
|
285
334
|
element.dataset.dragging = "true";
|
|
286
335
|
const dt = e.timeStamp - dragLastTime;
|
|
287
336
|
if (dt > 0)
|
|
@@ -294,7 +343,10 @@ e.preventDefault();
|
|
|
294
343
|
const handlePointerUp = (e) => {
|
|
295
344
|
if (!dragging)
|
|
296
345
|
return;
|
|
346
|
+
if (dragPointer !== null && e.pointerId !== dragPointer)
|
|
347
|
+
return;
|
|
297
348
|
dragging = false;
|
|
349
|
+
dragPointer = null;
|
|
298
350
|
if (scroller.hasPointerCapture(e.pointerId))
|
|
299
351
|
scroller.releasePointerCapture(e.pointerId);
|
|
300
352
|
delete element.dataset.dragging;
|
|
@@ -321,7 +373,17 @@ if (dragged) {
|
|
|
321
373
|
dragged = false;
|
|
322
374
|
e.preventDefault();
|
|
323
375
|
e.stopPropagation();
|
|
376
|
+
return;
|
|
324
377
|
}
|
|
378
|
+
const slide = e.composedPath().find((node) => slideElements.includes(node));
|
|
379
|
+
if (slide) {
|
|
380
|
+
const index = slideElements.indexOf(slide);
|
|
381
|
+
if (index !== currentIndex)
|
|
382
|
+
goTo(index);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const handleDragStart = (e) => {
|
|
386
|
+
e.preventDefault();
|
|
325
387
|
};
|
|
326
388
|
let wheelDirection = 0;
|
|
327
389
|
let wheelStart = 0;
|
|
@@ -439,8 +501,13 @@ scroller.addEventListener("focusin", handleFocusIn);
|
|
|
439
501
|
scroller.addEventListener("pointerdown", handlePointerDown);
|
|
440
502
|
scroller.addEventListener("pointermove", handlePointerMove);
|
|
441
503
|
scroller.addEventListener("pointerup", handlePointerUp);
|
|
442
|
-
|
|
504
|
+
window.addEventListener("pointerup", handlePointerUp, { capture: true });
|
|
505
|
+
window.addEventListener("pointercancel", endDrag, { capture: true });
|
|
506
|
+
scroller.addEventListener("pointercancel", endDrag);
|
|
507
|
+
scroller.addEventListener("lostpointercapture", endDrag);
|
|
508
|
+
scroller.addEventListener("dragstart", handleDragStart);
|
|
443
509
|
scroller.addEventListener("click", handleClick, true);
|
|
510
|
+
window.addEventListener("blur", endDrag);
|
|
444
511
|
reduceMotion?.addEventListener?.("change", rebuild);
|
|
445
512
|
const resizeObserver = typeof ResizeObserver === "function" ? new ResizeObserver(rebuild) : null;
|
|
446
513
|
resizeObserver?.observe(scroller);
|
|
@@ -472,8 +539,13 @@ scroller.removeEventListener("focusin", handleFocusIn);
|
|
|
472
539
|
scroller.removeEventListener("pointerdown", handlePointerDown);
|
|
473
540
|
scroller.removeEventListener("pointermove", handlePointerMove);
|
|
474
541
|
scroller.removeEventListener("pointerup", handlePointerUp);
|
|
475
|
-
|
|
542
|
+
window.removeEventListener("pointerup", handlePointerUp, { capture: true });
|
|
543
|
+
window.removeEventListener("pointercancel", endDrag, { capture: true });
|
|
544
|
+
scroller.removeEventListener("pointercancel", endDrag);
|
|
545
|
+
scroller.removeEventListener("lostpointercapture", endDrag);
|
|
546
|
+
scroller.removeEventListener("dragstart", handleDragStart);
|
|
476
547
|
scroller.removeEventListener("click", handleClick, true);
|
|
548
|
+
window.removeEventListener("blur", endDrag);
|
|
477
549
|
destroy?.();
|
|
478
550
|
},
|
|
479
551
|
};
|
|
@@ -6,6 +6,9 @@ const scroller = document.createElement("div");
|
|
|
6
6
|
scroller.className = `${prefix}__scroller`;
|
|
7
7
|
const track = document.createElement("div");
|
|
8
8
|
track.className = `${prefix}__track`;
|
|
9
|
+
const layer = document.createElement("div");
|
|
10
|
+
layer.className = `${prefix}__layer`;
|
|
11
|
+
track.appendChild(layer);
|
|
9
12
|
scroller.appendChild(track);
|
|
10
13
|
component.element.appendChild(scroller);
|
|
11
14
|
const slideData = [];
|
|
@@ -92,11 +95,11 @@ const at = index !== undefined && index >= 0 && index <= slideData.length ? inde
|
|
|
92
95
|
const el = createSlideElement(slide, at);
|
|
93
96
|
slideData.splice(at, 0, slide);
|
|
94
97
|
if (at < slideElements.length) {
|
|
95
|
-
|
|
98
|
+
layer.insertBefore(el, slideElements[at]);
|
|
96
99
|
slideElements.splice(at, 0, el);
|
|
97
100
|
}
|
|
98
101
|
else {
|
|
99
|
-
|
|
102
|
+
layer.appendChild(el);
|
|
100
103
|
slideElements.push(el);
|
|
101
104
|
}
|
|
102
105
|
changed();
|
|
@@ -105,7 +108,7 @@ return slides;
|
|
|
105
108
|
removeSlide(index) {
|
|
106
109
|
if (index < 0 || index >= slideElements.length)
|
|
107
110
|
return slides;
|
|
108
|
-
|
|
111
|
+
layer.removeChild(slideElements[index]);
|
|
109
112
|
slideElements.splice(index, 1);
|
|
110
113
|
slideData.splice(index, 1);
|
|
111
114
|
changed();
|
|
@@ -125,6 +128,7 @@ getElements: () => slideElements.slice(),
|
|
|
125
128
|
};
|
|
126
129
|
enhanced.scroller = scroller;
|
|
127
130
|
enhanced.track = track;
|
|
131
|
+
enhanced.layer = layer;
|
|
128
132
|
enhanced.slides = slides;
|
|
129
133
|
enhanced.slideElements = slideElements;
|
|
130
134
|
enhanced.onSlidesChanged = (handler) => {
|
|
@@ -134,7 +138,7 @@ slidesChanged = handler;
|
|
|
134
138
|
const el = createSlideElement(slide, i);
|
|
135
139
|
slideData.push(slide);
|
|
136
140
|
slideElements.push(el);
|
|
137
|
-
|
|
141
|
+
layer.appendChild(el);
|
|
138
142
|
});
|
|
139
143
|
relabel();
|
|
140
144
|
return enhanced;
|
|
@@ -81,7 +81,7 @@ interface ListSlot {
|
|
|
81
81
|
interface ListItem {
|
|
82
82
|
/** Structural entries are rendered but never selectable. */
|
|
83
83
|
kind?: "item" | "divider" | "subheader";
|
|
84
|
-
/** Insets a divider
|
|
84
|
+
/** Insets a divider: 16px from the start, 24px from the end. */
|
|
85
85
|
inset?: boolean;
|
|
86
86
|
/** One headline line plus optional overline/supporting lines. */
|
|
87
87
|
lines?: 1 | 2 | 3;
|
|
@@ -33,10 +33,14 @@ if (trackHeight <= SLIDER_SIZES.L)
|
|
|
33
33
|
return 16;
|
|
34
34
|
return 28;
|
|
35
35
|
};
|
|
36
|
+
const HANDLE_END_INSET = 6;
|
|
36
37
|
const TRACK_STEPS = { 8: "small", 12: "medium", 16: "large", 28: "extra-large" };
|
|
37
|
-
const trackPositionCss = (fraction, inset) =>
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const trackPositionCss = (fraction, inset) => {
|
|
39
|
+
if (!inset)
|
|
40
|
+
return `${fraction * 100}%`;
|
|
41
|
+
const offset = Math.round(inset * (1 - 2 * fraction) * 1e6) / 1e6;
|
|
42
|
+
return `calc(${fraction * 100}% ${offset < 0 ? "-" : "+"} ${Math.abs(offset)}px)`;
|
|
43
|
+
};
|
|
40
44
|
const A0 = { f: 0, p: 0 };
|
|
41
45
|
const A1 = { f: 1, p: 0 };
|
|
42
46
|
const ap = (f, p) => ({ f, p });
|
|
@@ -93,8 +97,7 @@ min: config.min ?? 0, max: config.max ?? 100, step: config.step ?? 1,
|
|
|
93
97
|
};
|
|
94
98
|
const narrowed = (which) => {
|
|
95
99
|
const handle = which === "first" ? component.handle : component.secondHandle;
|
|
96
|
-
|
|
97
|
-
return pressed || !!handle?.classList.contains(component.getClass("slider__handle--focused"));
|
|
100
|
+
return !!handle?.classList.contains(component.getClass("slider__handle--focused"));
|
|
98
101
|
};
|
|
99
102
|
const render = (next) => {
|
|
100
103
|
if (destroyed)
|
|
@@ -104,7 +107,7 @@ state = { ...next };
|
|
|
104
107
|
axis = getAxis(config, isRtl(component.element));
|
|
105
108
|
const width = lengthOf(container.getBoundingClientRect(), axis) || 0;
|
|
106
109
|
const corner = getExternalTrackRadius(size);
|
|
107
|
-
const inset =
|
|
110
|
+
const inset = HANDLE_END_INSET;
|
|
108
111
|
const fraction = (value) => fractionOf(value, state.min, state.max);
|
|
109
112
|
const atValue = (value) => {
|
|
110
113
|
const f = fraction(value);
|
|
@@ -158,14 +161,12 @@ activeEnd = first;
|
|
|
158
161
|
parts = [[A0, A0, false], [A0, sub(first, firstGap), true], [add(first, firstGap), A1, false]];
|
|
159
162
|
}
|
|
160
163
|
const standard = !config.centered && !(config.range && state.secondValue !== null);
|
|
161
|
-
if (config.ticks) {
|
|
162
164
|
parts.forEach((part) => {
|
|
163
165
|
if (cmp(part[0], A0) === 0 && cmp(part[1], px(inset)) <= 0)
|
|
164
166
|
part[1] = part[0];
|
|
165
167
|
else if (cmp(part[1], A1) === 0 && cmp(part[0], ap(1, -inset)) >= 0)
|
|
166
168
|
part[1] = part[0];
|
|
167
169
|
});
|
|
168
|
-
}
|
|
169
170
|
segments.forEach((segment, index) => {
|
|
170
171
|
const [start, end, active] = parts[index] ?? [A0, A0, false];
|
|
171
172
|
const len = sub(end, start);
|
|
@@ -335,8 +336,8 @@ component.emit(eventName, eventData);
|
|
|
335
336
|
return eventData;
|
|
336
337
|
};
|
|
337
338
|
const axisNow = () => getAxis(config, isRtl(component.element));
|
|
338
|
-
const inset = () =>
|
|
339
|
-
const visualPosition = (value) => trackPositionCss(fractionOf(value, state.min, state.max),
|
|
339
|
+
const inset = () => HANDLE_END_INSET;
|
|
340
|
+
const visualPosition = (value) => trackPositionCss(fractionOf(value, state.min, state.max), HANDLE_END_INSET);
|
|
340
341
|
const getValueFromPosition = (position) => {
|
|
341
342
|
const { handle, container } = component;
|
|
342
343
|
if (!handle || !container)
|
|
@@ -387,6 +388,11 @@ place(secondHandle, state.secondValue, handleTransform(axis));
|
|
|
387
388
|
if (secondValueBubble)
|
|
388
389
|
place(secondValueBubble, state.secondValue, bubbleTransform(axis));
|
|
389
390
|
}
|
|
391
|
+
const pressedClass = component.getClass("slider__handle--pressed");
|
|
392
|
+
handle.classList.toggle(pressedClass, !!state.pressed && state.activeHandle === "first");
|
|
393
|
+
if (secondHandle) {
|
|
394
|
+
secondHandle.classList.toggle(pressedClass, !!state.pressed && state.activeHandle === "second");
|
|
395
|
+
}
|
|
390
396
|
updateHandleAria(handle, state.value);
|
|
391
397
|
if (config.range && secondHandle && state.secondValue !== null) {
|
|
392
398
|
updateHandleAria(secondHandle, state.secondValue);
|
|
@@ -534,12 +540,14 @@ document.addEventListener("mousemove", handleMouseMove);
|
|
|
534
540
|
document.addEventListener("mouseup", handleMouseUp);
|
|
535
541
|
document.addEventListener("touchmove", handleMouseMove, { passive: false });
|
|
536
542
|
document.addEventListener("touchend", handleMouseUp);
|
|
543
|
+
document.addEventListener("touchcancel", handleMouseUp);
|
|
537
544
|
};
|
|
538
545
|
const stopFollowing = () => {
|
|
539
546
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
540
547
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
541
548
|
document.removeEventListener("touchmove", handleMouseMove);
|
|
542
549
|
document.removeEventListener("touchend", handleMouseUp);
|
|
550
|
+
document.removeEventListener("touchcancel", handleMouseUp);
|
|
543
551
|
};
|
|
544
552
|
const handleHandleMouseDown = (e, isSecondHandle = false) => {
|
|
545
553
|
if (disabled()) {
|
|
@@ -601,12 +609,13 @@ initialX = pointerOf(e);
|
|
|
601
609
|
if (config.centered && !config.range) {
|
|
602
610
|
showActiveBubble(state.activeBubble);
|
|
603
611
|
followPointer();
|
|
604
|
-
state.pressed =
|
|
612
|
+
state.pressed = true;
|
|
613
|
+
render();
|
|
605
614
|
emitEvent(SLIDER_EVENTS.START, e);
|
|
606
615
|
}
|
|
607
616
|
else {
|
|
608
617
|
state.dragging = false;
|
|
609
|
-
state.pressed =
|
|
618
|
+
state.pressed = true;
|
|
610
619
|
hasActualDragStarted = false;
|
|
611
620
|
showActiveBubble(state.activeBubble);
|
|
612
621
|
followPointer();
|
|
@@ -32,4 +32,4 @@ CHEVRON: "split-button__chevron",
|
|
|
32
32
|
EXPANDED: "split-button--expanded",
|
|
33
33
|
};
|
|
34
34
|
export const SPLIT_BUTTON_CHEVRON = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor" aria-hidden="true">' +
|
|
35
|
-
'<path d="M480-
|
|
35
|
+
'<path d="M480-320 240-560l56-56 184 184 184-184 56 56-240 240Z"/></svg>';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mtrl-bottom-sheet{--mtrl-density: 0;position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-end;justify-content:center;pointer-events:none}.mtrl-bottom-sheet--scrim-visible,.mtrl-bottom-sheet--partial,.mtrl-bottom-sheet--expanded{pointer-events:auto}.mtrl-bottom-sheet__scrim{position:absolute;inset:0;background-color:color-mix(in srgb, var(--mtrl-sys-color-scrim) 32%, transparent);opacity:0;visibility:hidden;transition:opacity 250ms linear(0, 0.066, 0.203, 0.355, 0.496, 0.616, 0.713, 0.788, 0.845, 0.888, 0.92, 0.943, 0.96, 0.971, 0.98, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1),visibility 0s linear 250ms}.mtrl-bottom-sheet__container{position:relative;width:100%;max-width:640px;max-height:100%;display:flex;flex-direction:column;box-sizing:border-box;pointer-events:auto;background-color:var(--mtrl-sys-color-surface-container-low);color:var(--mtrl-sys-color-on-surface);border-start-start-radius:var(--mtrl-sys-shape-corner-extra-large, 28px);border-start-end-radius:var(--mtrl-sys-shape-corner-extra-large, 28px);box-shadow:0px 1px 2px rgba(0,0,0,.3),0px 1px 3px 1px rgba(0,0,0,.15)
|
|
1
|
+
.mtrl-bottom-sheet{--mtrl-density: 0;position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-end;justify-content:center;pointer-events:none}.mtrl-bottom-sheet--scrim-visible,.mtrl-bottom-sheet--partial,.mtrl-bottom-sheet--expanded{pointer-events:auto}.mtrl-bottom-sheet__scrim{position:absolute;inset:0;background-color:color-mix(in srgb, var(--mtrl-sys-color-scrim) 32%, transparent);opacity:0;visibility:hidden;transition:opacity 250ms linear(0, 0.066, 0.203, 0.355, 0.496, 0.616, 0.713, 0.788, 0.845, 0.888, 0.92, 0.943, 0.96, 0.971, 0.98, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1),visibility 0s linear 250ms}.mtrl-bottom-sheet__container{position:relative;width:100%;max-width:640px;max-height:100%;display:flex;flex-direction:column;box-sizing:border-box;pointer-events:auto;background-color:var(--mtrl-sys-color-surface-container-low);color:var(--mtrl-sys-color-on-surface);border-start-start-radius:var(--mtrl-sys-shape-corner-extra-large, 28px);border-start-end-radius:var(--mtrl-sys-shape-corner-extra-large, 28px);box-shadow:0 32px 0 0 var(--mtrl-sys-color-surface-container-low),0px 1px 2px rgba(0,0,0,.3),0px 1px 3px 1px rgba(0,0,0,.15);transform:translateY(100%);transition:transform 175ms linear(0, 0.075, 0.227, 0.39, 0.537, 0.657, 0.751, 0.822, 0.874, 0.912, 0.939, 0.958, 0.971, 0.98, 0.987, 0.991, 0.994, 0.996, 0.997, 0.998, 0.999, 0.999, 0.999, 1, 1)}.mtrl-bottom-sheet__container:focus{outline:none}.mtrl-bottom-sheet__container:focus-visible{outline:3px solid var(--mtrl-sys-color-secondary);outline-offset:-3px}.mtrl-bottom-sheet__handle{font:inherit;flex:0 0 auto;position:relative;align-self:center;width:48px;height:48px;margin:0 auto;padding:0;border:0;border-radius:50%;background:none;cursor:grab;touch-action:none}.mtrl-bottom-sheet__handle::before{content:"";position:absolute;inset:22px 8px;border-radius:var(--mtrl-sys-shape-corner-extra-large, 28px);background-color:var(--mtrl-sys-color-on-surface-variant)}.mtrl-bottom-sheet__handle:active{cursor:grabbing}.mtrl-bottom-sheet__handle:focus-visible{outline:3px solid var(--mtrl-sys-color-secondary);outline-offset:-3px}.mtrl-bottom-sheet__header{flex:0 0 auto;padding:0 24px 16px}.mtrl-bottom-sheet__title{margin:0;color:var(--mtrl-sys-color-on-surface);font-family:var(--mtrl-ref-typeface-brand, Roboto, sans-serif);font-size:24px;line-height:32px;letter-spacing:0;font-weight:400}.mtrl-bottom-sheet__content{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 24px 24px;font-family:var(--mtrl-ref-typeface-plain, Roboto, sans-serif);font-size:14px;line-height:20px;letter-spacing:.25px;font-weight:400;color:var(--mtrl-sys-color-on-surface-variant)}.mtrl-bottom-sheet--partial .mtrl-bottom-sheet__container{transform:translateY(0);max-height:var(--mtrl-bottom-sheet-peek-height, 50%);transition:transform 450ms linear(0, 0.055, 0.18, 0.332, 0.483, 0.619, 0.733, 0.823, 0.891, 0.94, 0.973, 0.994, 1.007, 1.013, 1.015, 1.015, 1.013, 1.011, 1.009, 1.006, 1.005, 1.003, 1.002, 1.001, 1),max-height 450ms linear(0, 0.055, 0.18, 0.332, 0.483, 0.619, 0.733, 0.823, 0.891, 0.94, 0.973, 0.994, 1.007, 1.013, 1.015, 1.015, 1.013, 1.011, 1.009, 1.006, 1.005, 1.003, 1.002, 1.001, 1)}.mtrl-bottom-sheet--partial .mtrl-bottom-sheet__scrim{opacity:1;visibility:visible;transition:opacity 250ms linear(0, 0.066, 0.203, 0.355, 0.496, 0.616, 0.713, 0.788, 0.845, 0.888, 0.92, 0.943, 0.96, 0.971, 0.98, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1),visibility 0s}.mtrl-bottom-sheet--expanded .mtrl-bottom-sheet__container{transform:translateY(0);max-height:100%;transition:transform 450ms linear(0, 0.055, 0.18, 0.332, 0.483, 0.619, 0.733, 0.823, 0.891, 0.94, 0.973, 0.994, 1.007, 1.013, 1.015, 1.015, 1.013, 1.011, 1.009, 1.006, 1.005, 1.003, 1.002, 1.001, 1),max-height 450ms linear(0, 0.055, 0.18, 0.332, 0.483, 0.619, 0.733, 0.823, 0.891, 0.94, 0.973, 0.994, 1.007, 1.013, 1.015, 1.015, 1.013, 1.011, 1.009, 1.006, 1.005, 1.003, 1.002, 1.001, 1)}.mtrl-bottom-sheet--expanded .mtrl-bottom-sheet__container:where(.mtrl-bottom-sheet--full-height *){border-start-start-radius:0;border-start-end-radius:0}.mtrl-bottom-sheet--expanded .mtrl-bottom-sheet__scrim{opacity:1;visibility:visible;transition:opacity 250ms linear(0, 0.066, 0.203, 0.355, 0.496, 0.616, 0.713, 0.788, 0.845, 0.888, 0.92, 0.943, 0.96, 0.971, 0.98, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1),visibility 0s}.mtrl-bottom-sheet--standard{pointer-events:none}.mtrl-bottom-sheet--standard .mtrl-bottom-sheet__container{pointer-events:auto}@media(prefers-reduced-motion: reduce){.mtrl-bottom-sheet .mtrl-bottom-sheet__container,.mtrl-bottom-sheet .mtrl-bottom-sheet__scrim,.mtrl-bottom-sheet--partial .mtrl-bottom-sheet__container,.mtrl-bottom-sheet--partial .mtrl-bottom-sheet__scrim,.mtrl-bottom-sheet--expanded .mtrl-bottom-sheet__container,.mtrl-bottom-sheet--expanded .mtrl-bottom-sheet__scrim{transition:none}}dialog.mtrl-bottom-sheet{width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:visible;background:rgba(0,0,0,0);color:inherit;transition:overlay 250ms allow-discrete}dialog.mtrl-bottom-sheet::backdrop{background-color:color-mix(in srgb, var(--mtrl-sys-color-scrim) 32%, transparent);opacity:0;transition:opacity 250ms linear(0, 0.066, 0.203, 0.355, 0.496, 0.616, 0.713, 0.788, 0.845, 0.888, 0.92, 0.943, 0.96, 0.971, 0.98, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1)}dialog.mtrl-bottom-sheet.mtrl-bottom-sheet--partial::backdrop,dialog.mtrl-bottom-sheet.mtrl-bottom-sheet--expanded::backdrop{opacity:1}@media(prefers-reduced-motion: reduce){dialog.mtrl-bottom-sheet,dialog.mtrl-bottom-sheet::backdrop{transition:none}}
|