@surdeddd/bottom-sheet 0.9.1 → 0.11.0
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 +126 -83
- package/dist/{BottomSheetEngine-CBRcBwV-.d.ts → BottomSheetEngine-DRjCU73e.d.ts} +6 -5
- package/dist/{BottomSheetEngine-BcyruNP1.d.cts → BottomSheetEngine-DzsIwD28.d.cts} +6 -5
- package/dist/element.cjs +388 -222
- package/dist/element.d.cts +1 -1
- package/dist/element.d.ts +1 -1
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +388 -222
- package/dist/index.cjs +389 -266
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +389 -266
- package/dist/integrations/formik.d.cts +1 -1
- package/dist/integrations/formik.d.ts +1 -1
- package/dist/integrations/react-hook-form.d.cts +1 -1
- package/dist/integrations/react-hook-form.d.ts +1 -1
- package/dist/overlay.cjs +191 -58
- package/dist/overlay.d.cts +4 -3
- package/dist/overlay.d.ts +4 -3
- package/dist/overlay.js +191 -58
- package/dist/preact.d.cts +2 -1
- package/dist/preact.d.ts +2 -1
- package/dist/qwik.cjs +396 -211
- package/dist/qwik.d.cts +11 -2
- package/dist/qwik.d.ts +11 -2
- package/dist/qwik.js +396 -211
- package/dist/react.cjs +500 -332
- package/dist/react.d.cts +26 -4
- package/dist/react.d.ts +26 -4
- package/dist/react.js +500 -332
- package/dist/solid.cjs +362 -210
- package/dist/solid.d.cts +14 -4
- package/dist/solid.d.ts +14 -4
- package/dist/solid.js +362 -210
- package/dist/solid.source.jsx +362 -210
- package/dist/styles.css +17 -1
- package/dist/svelte-core.cjs +345 -208
- package/dist/svelte-core.js +345 -208
- package/dist/svelte-src/BottomSheet.svelte +6 -0
- package/dist/svelte.cjs +359 -220
- package/dist/svelte.d.cts +2 -0
- package/dist/svelte.d.ts +2 -0
- package/dist/svelte.js +359 -220
- package/dist/teleport-7uYNiEAT.d.cts +3 -0
- package/dist/teleport-7uYNiEAT.d.ts +3 -0
- package/dist/vue.cjs +353 -209
- package/dist/vue.d.cts +3 -1
- package/dist/vue.d.ts +3 -1
- package/dist/vue.js +353 -209
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> Universal, headless bottom-sheet engine. **One core, eight adapters, GPU-accelerated, fully tested.**
|
|
4
4
|
|
|
5
|
-

|
|
6
|
+

|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
@@ -14,40 +14,41 @@ stacking — and the exact same engine behind every adapter.
|
|
|
14
14
|
## 🚀 [Live demo → bottom-sheet-demo.vercel.app](https://bottom-sheet-demo.vercel.app)
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/screenshots/sheet-dark.png" />
|
|
19
|
+
<img src="docs/screenshots/sheet-light.png" alt="bottom sheet at a mid snap point over a dimmed page" width="420" />
|
|
20
|
+
</picture>
|
|
18
21
|
</p>
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src="https://raw.githubusercontent.com/Surdeddd/BottomSheet/main/docs/gifs/01-drag-to-close.gif" alt="drag to close — spring physics" width="380" />
|
|
25
|
+
</p>
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
│ focus trap · scroll lock · stack │
|
|
26
|
-
└────────────┬──────────────────────────┘
|
|
27
|
-
│
|
|
28
|
-
┌──────┬──────┬──────┬──────┬──────┬─────────────┬─────────┐
|
|
29
|
-
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
30
|
-
React Vue 3 Svelte Solid Lit Web Comp. Vanilla Angular
|
|
31
|
-
(recipe)
|
|
32
|
-
```
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="docs/assets/architecture.svg" alt="One engine core feeding eight adapters — React, Preact, Vue 3, Svelte, Solid, Qwik, Web Component and Vanilla — plus a standalone /overlay subpath" width="720" />
|
|
29
|
+
</p>
|
|
33
30
|
|
|
34
|
-
##
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
## What it does
|
|
32
|
+
|
|
33
|
+
Every item below is verifiable in this repo's `src/`:
|
|
34
|
+
|
|
35
|
+
- **8 build targets** — React, Preact, Vue 3, Svelte 5, Solid, Qwik, Web
|
|
36
|
+
Component (Lit-compatible `<bottom-sheet>`) and the vanilla core, plus an
|
|
37
|
+
`/overlay` subpath (standalone slide-up panel).
|
|
38
|
+
- **4 axes** — `bottom`, `top`, `left`, `right` (via `mode`).
|
|
39
|
+
- **Spring physics with velocity carry**, plus pointer-type-aware tuning
|
|
40
|
+
(separate touch / mouse / pen drag thresholds).
|
|
41
|
+
- **Hardware-back interception** on Android — opt-in via `closeOnBack`.
|
|
42
|
+
- **`env(safe-area-inset-*)`-aware padding** so action rows clear the home
|
|
43
|
+
indicator.
|
|
44
|
+
- **WCAG 2.1 AA keyboard slider** — Arrow/Home/End/Esc stepping, focus trap
|
|
45
|
+
with restore.
|
|
46
|
+
- **Multi-sheet stacking** plus a typed sheet-manager registry.
|
|
47
|
+
- **Cancelable `before-snap` / `before-close`** — veto a transition
|
|
48
|
+
synchronously.
|
|
49
|
+
- Backed by 500+ unit tests across the suite and ~200 Playwright e2e runs
|
|
50
|
+
across three browser engines (`mobile-chrome` / `mobile-safari` /
|
|
51
|
+
`firefox`).
|
|
51
52
|
|
|
52
53
|
## Install
|
|
53
54
|
|
|
@@ -210,31 +211,41 @@ engine.snapTo('full');
|
|
|
210
211
|
type SnapPoint =
|
|
211
212
|
| number // pixels
|
|
212
213
|
| `${number}%` // percent of viewport along the axis
|
|
213
|
-
| 'fit' // natural height of header
|
|
214
|
+
| 'fit' // natural height of the whole sheet (handle + header + content + footer)
|
|
215
|
+
| 'content' // alias of 'fit'
|
|
214
216
|
| 'full' // 100 % of axis
|
|
215
217
|
| string; // any CSS length — "50dvh", "clamp(200px, 60%, 800px)"
|
|
216
218
|
```
|
|
217
219
|
|
|
218
220
|
### Engine options
|
|
219
221
|
|
|
220
|
-
| Option
|
|
221
|
-
|
|
|
222
|
-
| `snapPoints`
|
|
223
|
-
| `allowed`
|
|
224
|
-
| `initial`
|
|
225
|
-
| `mode`
|
|
226
|
-
| `animation`
|
|
227
|
-
| `spring`
|
|
228
|
-
| `flickVelocity`
|
|
229
|
-
| `dragThreshold`
|
|
230
|
-
| `rubberBand`
|
|
231
|
-
| `backdropRange`
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
222
|
+
| Option | Default | What it does |
|
|
223
|
+
| -------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
224
|
+
| `snapPoints` | required | Ordered list of `{ id, size }` |
|
|
225
|
+
| `allowed` | all ids | Subset the sheet may settle on right now |
|
|
226
|
+
| `initial` | first allowed | Snap id to start at |
|
|
227
|
+
| `mode` | `"bottom"` | `bottom`, `top`, `left`, `right` |
|
|
228
|
+
| `animation` | `"spring"` | `spring`, `tween`, `ios-spring`, `material-bounce`, `linear`, `snappy` |
|
|
229
|
+
| `spring` | snappy | `{ stiffness, damping, mass }` |
|
|
230
|
+
| `flickVelocity` | `0.65 px/ms` | Mobile flick threshold |
|
|
231
|
+
| `dragThreshold` | `18 px` | Below this, drag snaps back |
|
|
232
|
+
| `rubberBand` | `true` | iOS-style soft over-drag |
|
|
233
|
+
| `backdropRange` | `[0, 1]` | Progress range over which backdrop fades |
|
|
234
|
+
| `screenRange` | `[0, 1]` | Progress range over which the `screen`/scrim content fades |
|
|
235
|
+
| `focusTrap` | `false` | Trap Tab focus inside the sheet when open |
|
|
236
|
+
| `initialFocus` | first field | Element / selector to focus on open; `false` focuses the sheet container (`tabindex=-1`) instead — avoids the iOS keyboard |
|
|
237
|
+
| `closeOnEscape` | `true` | Listen for Escape and close |
|
|
238
|
+
| `closeOnBack` | `false` | Intercept Android back button (history.popstate) |
|
|
239
|
+
| `closeOnRouteChange` | `false` | Close when the URL changes (patches `pushState`/`replaceState` + popstate) |
|
|
240
|
+
| `lockBodyScroll` | `true` | iOS-safe body lock (`position: fixed`) |
|
|
241
|
+
| `stackEffect` | `false` | iOS card-stack: back sheets scale down per depth |
|
|
242
|
+
| `inertSiblings` | `false` | Mark page siblings `inert` while open (full modal) |
|
|
243
|
+
| `persistent` | `false` | Block dismissal (backdrop / Escape / back); programmatic `close()` still works |
|
|
244
|
+
| `disableClose` | `false` | Block all closing, including programmatic |
|
|
245
|
+
| `disableDrag` | `false` | Suppress the drag gesture (imperative snaps still work) |
|
|
246
|
+
| `radius` | token default | Corner radius (`string` CSS length or `number` px); also `setRadius()` |
|
|
247
|
+
| `maxHeight` | none | Cap the sheet height. `number` (px) or a string (`"92dvh"`, `"50%"`) re-resolved on viewport / orientation changes |
|
|
248
|
+
| `returnFocusTo` | opener | Focus target on dismiss — an `HTMLElement`, a selector `string`, or a `() => HTMLElement` factory |
|
|
238
249
|
|
|
239
250
|
### Anchored elements, docked bars & scrim stages
|
|
240
251
|
|
|
@@ -268,23 +279,41 @@ engine.setScrimStages({
|
|
|
268
279
|
### Events
|
|
269
280
|
|
|
270
281
|
```ts
|
|
271
|
-
engine.on('snap', ({ id, size }) => {}); // settled state change
|
|
272
|
-
engine.on('open', ({ id }) => {}); // 0 → >0
|
|
273
|
-
engine.on('
|
|
282
|
+
engine.on('snap', ({ id, size, progress }) => {}); // settled state change
|
|
283
|
+
engine.on('open', ({ id }) => {}); // 0 → >0 (enter starts)
|
|
284
|
+
engine.on('opened', ({ id }) => {}); // enter settled
|
|
285
|
+
engine.on('close', () => {}); // → 0 (exit starts)
|
|
286
|
+
engine.on('closed', () => {}); // exit settled
|
|
274
287
|
engine.on('dragstart', ({ size }) => {});
|
|
275
|
-
engine.on('drag', ({ size, delta }) => {}); // ~60 fps
|
|
288
|
+
engine.on('drag', ({ size, delta }) => {}); // ~60 fps — payload is pooled, don't retain
|
|
276
289
|
engine.on('dragend', ({ size, velocity }) => {});
|
|
277
290
|
engine.on('progress', ({ value, size }) => {}); // ~60 fps
|
|
291
|
+
|
|
292
|
+
// Cancelable — call cancel() synchronously to veto the transition:
|
|
293
|
+
engine.on('before-snap', ({ id, size, previousId, cancel }) => {});
|
|
294
|
+
engine.on('before-close', ({ reason, cancel }) => {}); // reason: programmatic | backdrop | escape | back
|
|
278
295
|
```
|
|
279
296
|
|
|
280
297
|
### Imperative
|
|
281
298
|
|
|
282
299
|
```ts
|
|
283
300
|
engine.snapTo('half');
|
|
284
|
-
engine.open(); // → first
|
|
285
|
-
engine.close(); // →
|
|
301
|
+
engine.open(); // → first allowed snap with resolved size > 0
|
|
302
|
+
engine.close(reason?); // → first snap that resolves to size 0, else first allowed
|
|
303
|
+
engine.expand(); // → largest allowed snap
|
|
304
|
+
engine.collapse(); // → smallest allowed snap with size > 0
|
|
286
305
|
engine.setAllowed(ids, snapId); // dynamic allowlist
|
|
287
306
|
engine.setSnapPoints(points); // re-measure
|
|
307
|
+
engine.recompute(); // re-measure a 'fit' / 'content' snap on demand
|
|
308
|
+
engine.getResolvedSnaps(); // → [{ id, size }] resolved to pixels right now
|
|
309
|
+
engine.setPersistent(bool); // toggle persistence (block dismissal) at runtime
|
|
310
|
+
engine.setDisableClose(bool); // toggle close-blocking at runtime
|
|
311
|
+
engine.setDisableDrag(bool); // toggle the drag gesture at runtime
|
|
312
|
+
engine.setRadius('28px'); // corner radius
|
|
313
|
+
engine.setMaxHeight('92dvh'); // height cap (re-resolved on viewport change)
|
|
314
|
+
engine.canDismiss(); // false when persistent / disableClose
|
|
315
|
+
engine.isTop(); // top of the multi-sheet stack?
|
|
316
|
+
engine.depth(); // open sheets above this one
|
|
288
317
|
engine.destroy(); // remove listeners + cancel animation
|
|
289
318
|
```
|
|
290
319
|
|
|
@@ -293,17 +322,17 @@ engine.destroy(); // remove listeners + cancel animation
|
|
|
293
322
|
The scrim is the dim layer behind/around the sheet (`screenComponent`). All
|
|
294
323
|
scrim properties can be mutated at runtime — no remount needed.
|
|
295
324
|
|
|
296
|
-
| Method
|
|
297
|
-
|
|
|
298
|
-
| `setScrimMode('full'
|
|
299
|
-
| `setScrimEnabled(boolean)`
|
|
300
|
-
| `setScrimTapToClose(boolean)`
|
|
301
|
-
| `setScrimColor(color
|
|
302
|
-
| `setScrimInteractive(boolean)`
|
|
303
|
-
| `setBackdropRange([s, e])` / `setScreenRange([s, e])`
|
|
304
|
-
| `setScrim({ ... })`
|
|
305
|
-
| `setScrimOverlay({ children, position, interactive })`
|
|
306
|
-
| `getScrimState()`
|
|
325
|
+
| Method | Purpose | | |
|
|
326
|
+
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | ---------------------------------------------------------------------- |
|
|
327
|
+
| `setScrimMode('full' \ | 'above-sheet' \ | 'off')` | Switch positioning at runtime. `'off'` fully disables the scrim layer. |
|
|
328
|
+
| `setScrimEnabled(boolean)` | Convenience switch — stashes/restores opacity ranges. | | |
|
|
329
|
+
| `setScrimTapToClose(boolean)` | Install/teardown click-to-close on the scrim. | | |
|
|
330
|
+
| `setScrimColor(color \ | null)` / `setScrimBlur(blur \ | null)` | Live color & backdrop-filter blur. `null` clears. |
|
|
331
|
+
| `setScrimInteractive(boolean)` | Toggle `pointer-events` on the scrim layer. | | |
|
|
332
|
+
| `setBackdropRange([s, e])` / `setScreenRange([s, e])` | Opacity-range mapping (progress 0..1 → opacity 0..1). | | |
|
|
333
|
+
| `setScrim({ ... })` | Batch — applies preset + individual fields in one pass with a single `applySize`. | | |
|
|
334
|
+
| `setScrimOverlay({ children, position, interactive })` | Inject a positioned floating element into the scrim area. Returns a teardown. Useful for monitoring-style "dim everything except this badge" UX. | | |
|
|
335
|
+
| `getScrimState()` | Read-only `{ mode, enabled }` snapshot. Stable public API for introspection without coupling to internals. | | |
|
|
307
336
|
|
|
308
337
|
**Presets**: `'subtle' | 'standard' | 'monitoring' | 'cinematic'` — use via `scrimPreset` constructor option or `setScrim({ preset })`.
|
|
309
338
|
|
|
@@ -312,11 +341,11 @@ scrim properties can be mutated at runtime — no remount needed.
|
|
|
312
341
|
The overlay engine (`@surdeddd/bottom-sheet/overlay`) is a standalone slide-up
|
|
313
342
|
panel that mirrors the scrim's runtime-mutability story for content.
|
|
314
343
|
|
|
315
|
-
| Method
|
|
316
|
-
|
|
|
317
|
-
| `setOverlayChildren(node
|
|
318
|
-
| `clearOverlayChildren()`
|
|
319
|
-
| `setOverlay({ children, ... })`
|
|
344
|
+
| Method | Purpose | | |
|
|
345
|
+
| ------------------------------- | ----------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------- |
|
|
346
|
+
| `setOverlayChildren(node \ | fragment \ | factory)` | Replace overlay contents at runtime. Pass a `Node`, a `DocumentFragment`, or a `() => Node` factory. |
|
|
347
|
+
| `clearOverlayChildren()` | Remove any injected content. | | |
|
|
348
|
+
| `setOverlay({ children, ... })` | Batch update — `children` is one of the accepted fields alongside positioning/preset overrides. | | |
|
|
320
349
|
|
|
321
350
|
**Presets**: `OverlayPreset` is `'sheet' | 'dialog' | 'sidebar' | 'toast'` —
|
|
322
351
|
exposed as the `OVERLAY_PRESETS` const map and accepted by `setOverlay({ preset })`.
|
|
@@ -379,6 +408,20 @@ element — drive any CSS animation from drag without touching JS:
|
|
|
379
408
|
}
|
|
380
409
|
```
|
|
381
410
|
|
|
411
|
+
### Scrim, blur & high contrast
|
|
412
|
+
|
|
413
|
+
| Token | Default | Region |
|
|
414
|
+
| ------------------------ | ----------- | ---------------------------------------------------- |
|
|
415
|
+
| `--bs-scrim-color` | transparent | Fill of the scrim layer (`.bs-screen`) |
|
|
416
|
+
| `--bs-scrim-blur` | `0px` | `backdrop-filter: blur()` applied to the scrim layer |
|
|
417
|
+
| `--bs-header-min-height` | `0px` | Minimum height of the `.bs-header` region |
|
|
418
|
+
|
|
419
|
+
`--bs-scrim-blur` drives a real `backdrop-filter` blur on the scrim — set it
|
|
420
|
+
for a frosted backdrop (or use the `monitoring` / `cinematic` scrim presets,
|
|
421
|
+
which set both color and blur). Under Windows High Contrast / `forced-colors`
|
|
422
|
+
the stylesheet ships a `@media (forced-colors: active)` block so the sheet
|
|
423
|
+
surface, handle and focus ring stay visible.
|
|
424
|
+
|
|
382
425
|
### Padding & layout
|
|
383
426
|
|
|
384
427
|
Every region's padding is a token — override or zero it to go edge-to-edge.
|
|
@@ -386,12 +429,12 @@ Defaults match the built-in look. Set the variable on the host / `.bs-root` /
|
|
|
386
429
|
`:root`; custom properties inherit through the Web Component's shadow boundary,
|
|
387
430
|
so the same override works for every adapter:
|
|
388
431
|
|
|
389
|
-
| Token | Default
|
|
390
|
-
| ---------------------- |
|
|
391
|
-
| `--bs-content-padding` | `0 16px 16px`
|
|
392
|
-
| `--bs-handle-padding` | `8px 16px 4px`
|
|
393
|
-
| `--bs-header-padding` | `0 16px 8px`
|
|
394
|
-
| `--bs-footer-padding` | `12px 16px (+ inset)`
|
|
432
|
+
| Token | Default | Region |
|
|
433
|
+
| ---------------------- | --------------------- | ------------------- |
|
|
434
|
+
| `--bs-content-padding` | `0 16px 16px` | scrollable body |
|
|
435
|
+
| `--bs-handle-padding` | `8px 16px 4px` | grabber strip (top) |
|
|
436
|
+
| `--bs-header-padding` | `0 16px 8px` | header slot |
|
|
437
|
+
| `--bs-footer-padding` | `12px 16px (+ inset)` | footer slot |
|
|
395
438
|
|
|
396
439
|
(The footer default is `12px 16px calc(12px + env(safe-area-inset-bottom))` — it
|
|
397
440
|
keeps action buttons clear of the home indicator.)
|
|
@@ -414,19 +457,19 @@ npm run demo
|
|
|
414
457
|
# http://localhost:5173
|
|
415
458
|
```
|
|
416
459
|
|
|
417
|
-
The editorial demo showcases
|
|
460
|
+
The editorial demo showcases the adapters, every gesture, every mode
|
|
418
461
|
(`bottom · top · left · right · overlay`), and live engine readouts (active
|
|
419
462
|
snap, progress, velocity, FPS). EN/RU and light/dark toggles in the corner.
|
|
420
463
|
|
|
421
464
|
## Testing
|
|
422
465
|
|
|
423
466
|
```bash
|
|
424
|
-
npm test #
|
|
425
|
-
npx playwright test #
|
|
467
|
+
npm test # 500+ unit tests via vitest + happy-dom
|
|
468
|
+
npx playwright test # e2e via Playwright on mobile-Chrome / mobile-Safari / Firefox
|
|
426
469
|
npm run typecheck # TypeScript --noEmit
|
|
427
470
|
```
|
|
428
471
|
|
|
429
|
-
CI runs all three across Node
|
|
472
|
+
CI runs all three across Node 20.19 / 22 on every PR and tag.
|
|
430
473
|
|
|
431
474
|
## Contributing
|
|
432
475
|
|
|
@@ -222,8 +222,7 @@ declare class BottomSheetEngine {
|
|
|
222
222
|
private disableCloseFlag;
|
|
223
223
|
private disableDragFlag;
|
|
224
224
|
private closeOnRouteChange;
|
|
225
|
-
private
|
|
226
|
-
private maxHeightRaw;
|
|
225
|
+
private maxHeight;
|
|
227
226
|
private snapPointsRaw;
|
|
228
227
|
private snaps;
|
|
229
228
|
private activeId;
|
|
@@ -259,6 +258,10 @@ declare class BottomSheetEngine {
|
|
|
259
258
|
use(plugin: Plugin): this;
|
|
260
259
|
setLinkedSheets(sheets: BottomSheetEngine[]): void;
|
|
261
260
|
getAllowedIds(): string[];
|
|
261
|
+
getResolvedSnaps(): readonly {
|
|
262
|
+
id: string;
|
|
263
|
+
size: number;
|
|
264
|
+
}[];
|
|
262
265
|
snapTo(id: string, velocityOrOpts?: number | {
|
|
263
266
|
velocity?: number;
|
|
264
267
|
signal?: AbortSignal;
|
|
@@ -282,8 +285,6 @@ declare class BottomSheetEngine {
|
|
|
282
285
|
collapse(): Promise<void>;
|
|
283
286
|
setRadius(r: string | number): void;
|
|
284
287
|
setMaxHeight(h: string | number): void;
|
|
285
|
-
private resolveMaxHeightCap;
|
|
286
|
-
private clampToMaxHeight;
|
|
287
288
|
setAllowed(ids: string[], snap?: string): void;
|
|
288
289
|
setBackdropRange(range: [number, number]): void;
|
|
289
290
|
setScreenRange(range: [number, number]): void;
|
|
@@ -328,4 +329,4 @@ declare class BottomSheetEngine {
|
|
|
328
329
|
private handleClose;
|
|
329
330
|
}
|
|
330
331
|
|
|
331
|
-
export { type AnchorOptions as A, BottomSheetEngine as B, type CloseReason as C, type EngineState as E, type Plugin as P, type ScrimStagesOptions as S, type TeardownScope as T, type SnapPointDef as a, type SheetMode as b, type EngineOptions as c, type
|
|
332
|
+
export { type AnchorOptions as A, BottomSheetEngine as B, type CloseReason as C, type EngineState as E, type Plugin as P, type ScrimStagesOptions as S, type TeardownScope as T, type SnapPointDef as a, type SheetMode as b, type EngineOptions as c, type SheetEventMap as d, type SnapPoint as e, type ScrimOverlayPosition as f, type AnchorAnimationPreset as g, type AnchorAnimationSpec as h, type AnchorHandle as i, type AnchorPosition as j, type AnchorState as k, SCRIM_PRESETS as l, type ScrimOverlayOptions as m, type ScrimPreset as n, type ScrimPresetConfig as o, type ScrimStageDef as p, type ScrimUpdate as q, type SnapId as r, runAnchorTransition as s };
|
|
@@ -222,8 +222,7 @@ declare class BottomSheetEngine {
|
|
|
222
222
|
private disableCloseFlag;
|
|
223
223
|
private disableDragFlag;
|
|
224
224
|
private closeOnRouteChange;
|
|
225
|
-
private
|
|
226
|
-
private maxHeightRaw;
|
|
225
|
+
private maxHeight;
|
|
227
226
|
private snapPointsRaw;
|
|
228
227
|
private snaps;
|
|
229
228
|
private activeId;
|
|
@@ -259,6 +258,10 @@ declare class BottomSheetEngine {
|
|
|
259
258
|
use(plugin: Plugin): this;
|
|
260
259
|
setLinkedSheets(sheets: BottomSheetEngine[]): void;
|
|
261
260
|
getAllowedIds(): string[];
|
|
261
|
+
getResolvedSnaps(): readonly {
|
|
262
|
+
id: string;
|
|
263
|
+
size: number;
|
|
264
|
+
}[];
|
|
262
265
|
snapTo(id: string, velocityOrOpts?: number | {
|
|
263
266
|
velocity?: number;
|
|
264
267
|
signal?: AbortSignal;
|
|
@@ -282,8 +285,6 @@ declare class BottomSheetEngine {
|
|
|
282
285
|
collapse(): Promise<void>;
|
|
283
286
|
setRadius(r: string | number): void;
|
|
284
287
|
setMaxHeight(h: string | number): void;
|
|
285
|
-
private resolveMaxHeightCap;
|
|
286
|
-
private clampToMaxHeight;
|
|
287
288
|
setAllowed(ids: string[], snap?: string): void;
|
|
288
289
|
setBackdropRange(range: [number, number]): void;
|
|
289
290
|
setScreenRange(range: [number, number]): void;
|
|
@@ -328,4 +329,4 @@ declare class BottomSheetEngine {
|
|
|
328
329
|
private handleClose;
|
|
329
330
|
}
|
|
330
331
|
|
|
331
|
-
export { type AnchorOptions as A, BottomSheetEngine as B, type CloseReason as C, type EngineState as E, type Plugin as P, type ScrimStagesOptions as S, type TeardownScope as T, type SnapPointDef as a, type SheetMode as b, type EngineOptions as c, type
|
|
332
|
+
export { type AnchorOptions as A, BottomSheetEngine as B, type CloseReason as C, type EngineState as E, type Plugin as P, type ScrimStagesOptions as S, type TeardownScope as T, type SnapPointDef as a, type SheetMode as b, type EngineOptions as c, type SheetEventMap as d, type SnapPoint as e, type ScrimOverlayPosition as f, type AnchorAnimationPreset as g, type AnchorAnimationSpec as h, type AnchorHandle as i, type AnchorPosition as j, type AnchorState as k, SCRIM_PRESETS as l, type ScrimOverlayOptions as m, type ScrimPreset as n, type ScrimPresetConfig as o, type ScrimStageDef as p, type ScrimUpdate as q, type SnapId as r, runAnchorTransition as s };
|