@surdeddd/bottom-sheet 0.1.0 → 0.2.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 +6 -0
- package/dist/BottomSheetEngine-CIT9Htti.d.cts +219 -0
- package/dist/BottomSheetEngine-Df9MwBbm.d.ts +219 -0
- package/dist/element.cjs +95 -440
- package/dist/element.d.cts +3 -56
- package/dist/element.d.ts +3 -56
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +95 -440
- package/dist/index.cjs +84 -494
- package/dist/index.d.cts +3 -84
- package/dist/index.d.ts +3 -84
- package/dist/index.js +84 -494
- package/dist/integrations/formik.d.cts +2 -8
- package/dist/integrations/formik.d.ts +2 -8
- package/dist/integrations/react-hook-form.d.cts +2 -11
- package/dist/integrations/react-hook-form.d.ts +2 -11
- package/dist/overlay.cjs +0 -87
- package/dist/overlay.d.cts +1 -137
- package/dist/overlay.d.ts +1 -137
- package/dist/overlay.js +0 -87
- package/dist/preact.d.cts +2 -2
- package/dist/preact.d.ts +2 -2
- package/dist/preact.js +0 -1
- package/dist/qwik.cjs +87 -439
- package/dist/qwik.d.cts +3 -24
- package/dist/qwik.d.ts +3 -24
- package/dist/qwik.js +87 -439
- package/dist/react.cjs +91 -496
- package/dist/react.d.cts +16 -158
- package/dist/react.d.ts +16 -158
- package/dist/react.js +91 -496
- package/dist/solid.cjs +87 -439
- package/dist/solid.d.cts +4 -31
- package/dist/solid.d.ts +4 -31
- package/dist/solid.js +87 -439
- package/dist/styles.css +27 -102
- package/dist/svelte.cjs +139 -462
- package/dist/svelte.d.ts +9 -2
- package/dist/svelte.js +139 -462
- package/dist/themes/ios.css +0 -3
- package/dist/themes/material.css +0 -3
- package/dist/themes/vercel.css +0 -3
- package/dist/{transform-Brkf-wzo.d.cts → transform-jVfAikE9.d.cts} +0 -1
- package/dist/{transform-Brkf-wzo.d.ts → transform-jVfAikE9.d.ts} +0 -1
- package/dist/vue.cjs +104 -446
- package/dist/vue.d.ts +7 -1
- package/dist/vue.js +105 -447
- package/package.json +3 -3
- package/dist/BottomSheetEngine-CvSVbo6c.d.cts +0 -704
- package/dist/BottomSheetEngine-DbO8rW_3.d.ts +0 -704
package/README.md
CHANGED
|
@@ -11,6 +11,12 @@ A framework-agnostic bottom-sheet primitive. Spring physics, Pointer Events,
|
|
|
11
11
|
GPU-only motion, full keyboard a11y, hardware-back interception, multi-sheet
|
|
12
12
|
stacking — and the exact same engine behind every adapter.
|
|
13
13
|
|
|
14
|
+
## 🚀 [Live demo → bottom-sheet-demo.vercel.app](https://bottom-sheet-demo.vercel.app)
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/Surdeddd/BottomSheet/main/docs/gifs/01-drag-to-close.gif" alt="drag to close — spring physics" width="380" />
|
|
18
|
+
</p>
|
|
19
|
+
|
|
14
20
|
```
|
|
15
21
|
|
|
16
22
|
┌───────────────────────────────────────┐
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { T as TransformAxis } from './transform-jVfAikE9.cjs';
|
|
2
|
+
|
|
3
|
+
type SnapPoint = number | `${number}%` | "fit" | "full" | (string & {});
|
|
4
|
+
type SnapPointDef<Id extends string = string> = {
|
|
5
|
+
id: Id;
|
|
6
|
+
size: SnapPoint;
|
|
7
|
+
};
|
|
8
|
+
type SnapId<T extends readonly SnapPointDef<string>[] | {
|
|
9
|
+
snapPoints: readonly SnapPointDef<string>[];
|
|
10
|
+
}> = T extends {
|
|
11
|
+
snapPoints: readonly SnapPointDef<infer U>[];
|
|
12
|
+
} ? U : T extends readonly SnapPointDef<infer U>[] ? U : never;
|
|
13
|
+
type SheetMode = TransformAxis;
|
|
14
|
+
type ScrimPreset = "subtle" | "standard" | "monitoring" | "cinematic";
|
|
15
|
+
type ScrimPresetConfig = {
|
|
16
|
+
color: string;
|
|
17
|
+
blur: string | undefined;
|
|
18
|
+
range: [number, number];
|
|
19
|
+
interactive: boolean;
|
|
20
|
+
};
|
|
21
|
+
declare const SCRIM_PRESETS: Readonly<Record<ScrimPreset, ScrimPresetConfig>>;
|
|
22
|
+
type ScrimUpdate = {
|
|
23
|
+
color?: string | null;
|
|
24
|
+
blur?: string | null;
|
|
25
|
+
interactive?: boolean;
|
|
26
|
+
range?: [number, number];
|
|
27
|
+
preset?: ScrimPreset;
|
|
28
|
+
mode?: "full" | "above-sheet" | "off";
|
|
29
|
+
tapToClose?: boolean;
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type ScrimOverlayPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | "sheet-top-left" | "sheet-top-center" | "sheet-top-right";
|
|
33
|
+
type ScrimOverlayOptions = {
|
|
34
|
+
children: HTMLElement | DocumentFragment;
|
|
35
|
+
position?: ScrimOverlayPosition;
|
|
36
|
+
interactive?: boolean;
|
|
37
|
+
inset?: string;
|
|
38
|
+
};
|
|
39
|
+
type SheetEventMap = {
|
|
40
|
+
"before-snap": {
|
|
41
|
+
id: string;
|
|
42
|
+
size: number;
|
|
43
|
+
cancel: () => void;
|
|
44
|
+
previousId: string;
|
|
45
|
+
};
|
|
46
|
+
snap: {
|
|
47
|
+
id: string;
|
|
48
|
+
size: number;
|
|
49
|
+
};
|
|
50
|
+
progress: {
|
|
51
|
+
value: number;
|
|
52
|
+
size: number;
|
|
53
|
+
};
|
|
54
|
+
dragstart: {
|
|
55
|
+
size: number;
|
|
56
|
+
};
|
|
57
|
+
drag: {
|
|
58
|
+
size: number;
|
|
59
|
+
delta: number;
|
|
60
|
+
};
|
|
61
|
+
dragend: {
|
|
62
|
+
size: number;
|
|
63
|
+
velocity: number;
|
|
64
|
+
};
|
|
65
|
+
close: void;
|
|
66
|
+
open: {
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type EngineOptions = {
|
|
71
|
+
element: HTMLElement;
|
|
72
|
+
handle?: HTMLElement;
|
|
73
|
+
scrollContainer?: HTMLElement;
|
|
74
|
+
backdrop?: HTMLElement;
|
|
75
|
+
scrim?: HTMLElement;
|
|
76
|
+
screenComponent?: HTMLElement;
|
|
77
|
+
mode?: SheetMode;
|
|
78
|
+
snapPoints: SnapPointDef[];
|
|
79
|
+
allowed?: string[];
|
|
80
|
+
initial?: string;
|
|
81
|
+
duration?: number;
|
|
82
|
+
easing?: (t: number) => number;
|
|
83
|
+
respectReducedMotion?: boolean;
|
|
84
|
+
flickVelocity?: number;
|
|
85
|
+
dragThreshold?: number;
|
|
86
|
+
rubberBand?: boolean;
|
|
87
|
+
backdropRange?: [number, number];
|
|
88
|
+
screenRange?: [number, number];
|
|
89
|
+
scrimMode?: "full" | "above-sheet" | "off";
|
|
90
|
+
scrimColor?: string;
|
|
91
|
+
scrimBlur?: string;
|
|
92
|
+
scrimInteractive?: boolean;
|
|
93
|
+
scrimTapToClose?: boolean;
|
|
94
|
+
scrimPreset?: ScrimPreset;
|
|
95
|
+
animation?: "spring" | "tween" | "ios-spring" | "material-bounce" | "linear" | "snappy";
|
|
96
|
+
spring?: {
|
|
97
|
+
stiffness?: number;
|
|
98
|
+
damping?: number;
|
|
99
|
+
mass?: number;
|
|
100
|
+
};
|
|
101
|
+
focusTrap?: boolean;
|
|
102
|
+
initialFocus?: string | HTMLElement;
|
|
103
|
+
closeOnEscape?: boolean;
|
|
104
|
+
lockBodyScroll?: boolean;
|
|
105
|
+
closeOnBack?: boolean;
|
|
106
|
+
routedTo?: string;
|
|
107
|
+
inertSiblings?: boolean;
|
|
108
|
+
persistKey?: string;
|
|
109
|
+
autoCollapseAfter?: number;
|
|
110
|
+
linkedSheets?: BottomSheetEngineLike[];
|
|
111
|
+
viewTransitions?: boolean;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
type BottomSheetEngineLike = BottomSheetEngine;
|
|
115
|
+
type TeardownScope = {
|
|
116
|
+
add: (fn: (() => void) | null | undefined) => void;
|
|
117
|
+
};
|
|
118
|
+
type Plugin = {
|
|
119
|
+
name: string;
|
|
120
|
+
install: (engine: BottomSheetEngine, scope: TeardownScope) => void | (() => void);
|
|
121
|
+
};
|
|
122
|
+
type EngineState = {
|
|
123
|
+
size: number;
|
|
124
|
+
activeId: string;
|
|
125
|
+
isDragging: boolean;
|
|
126
|
+
isAnimating: boolean;
|
|
127
|
+
progress: number;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type Listener<K extends keyof SheetEventMap> = (payload: SheetEventMap[K]) => void;
|
|
131
|
+
declare class BottomSheetEngine {
|
|
132
|
+
private id;
|
|
133
|
+
private element;
|
|
134
|
+
private handle;
|
|
135
|
+
private scrollContainer?;
|
|
136
|
+
private backdrop?;
|
|
137
|
+
private screenComponent?;
|
|
138
|
+
private scrimParent;
|
|
139
|
+
private mode;
|
|
140
|
+
private flickVelocity;
|
|
141
|
+
private dragThreshold;
|
|
142
|
+
private rubberBandEnabled;
|
|
143
|
+
private scrim;
|
|
144
|
+
private aria;
|
|
145
|
+
private animation;
|
|
146
|
+
private lifecycle;
|
|
147
|
+
private closeOnBack;
|
|
148
|
+
private routedTo;
|
|
149
|
+
private snapPointsRaw;
|
|
150
|
+
private snaps;
|
|
151
|
+
private activeId;
|
|
152
|
+
private size;
|
|
153
|
+
private gesture;
|
|
154
|
+
private rootEl;
|
|
155
|
+
private destroyed;
|
|
156
|
+
private currentViewTransition;
|
|
157
|
+
private currentAbort;
|
|
158
|
+
private sizeWriteSentinel;
|
|
159
|
+
private progressWriteSentinel;
|
|
160
|
+
private isTopSheet;
|
|
161
|
+
private progressPayload;
|
|
162
|
+
private dragContextBuf;
|
|
163
|
+
private bus;
|
|
164
|
+
private persistKey;
|
|
165
|
+
private linkedSheets;
|
|
166
|
+
private scrollCache;
|
|
167
|
+
private teardowns;
|
|
168
|
+
private transformTemplate;
|
|
169
|
+
constructor(opts: EngineOptions);
|
|
170
|
+
get state(): EngineState;
|
|
171
|
+
on<K extends keyof SheetEventMap>(event: K, fn: Listener<K>): () => void;
|
|
172
|
+
use(plugin: Plugin): this;
|
|
173
|
+
setLinkedSheets(sheets: BottomSheetEngine[]): void;
|
|
174
|
+
getAllowedIds(): string[];
|
|
175
|
+
snapTo(id: string, velocityOrOpts?: number | {
|
|
176
|
+
velocity?: number;
|
|
177
|
+
signal?: AbortSignal;
|
|
178
|
+
}, _skipBeforeSnap?: boolean): Promise<void>;
|
|
179
|
+
dragTo(targetSize: number, velocityOrOpts?: number | {
|
|
180
|
+
velocity?: number;
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
}): Promise<void>;
|
|
183
|
+
open(id?: string): Promise<void>;
|
|
184
|
+
close(): Promise<void>;
|
|
185
|
+
setAllowed(ids: string[], snap?: string): void;
|
|
186
|
+
setBackdropRange(range: [number, number]): void;
|
|
187
|
+
setScreenRange(range: [number, number]): void;
|
|
188
|
+
setScrimColor(color: string | undefined | null): void;
|
|
189
|
+
setScrimBlur(blur: string | undefined | null): void;
|
|
190
|
+
setScrimInteractive(interactive: boolean): void;
|
|
191
|
+
setScrim(opts: ScrimUpdate): void;
|
|
192
|
+
setScrimMode(mode: "full" | "above-sheet" | "off"): void;
|
|
193
|
+
setScrimTapToClose(enabled: boolean): void;
|
|
194
|
+
setScrimEnabled(enabled: boolean): void;
|
|
195
|
+
setScrimOverlay(opts: ScrimOverlayOptions): () => void;
|
|
196
|
+
getScrimState(): {
|
|
197
|
+
mode: "full" | "above-sheet" | "off";
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
};
|
|
200
|
+
setSnapPoints(points: EngineOptions["snapPoints"], allowed?: string[]): void;
|
|
201
|
+
destroy(): void;
|
|
202
|
+
private emit;
|
|
203
|
+
private newCycle;
|
|
204
|
+
private emitBeforeSnap;
|
|
205
|
+
private recomputeSnaps;
|
|
206
|
+
private getAllowedRange;
|
|
207
|
+
private updateAriaSlider;
|
|
208
|
+
private registerInStack;
|
|
209
|
+
private attach;
|
|
210
|
+
private attachFeatures;
|
|
211
|
+
private settleAfterDrag;
|
|
212
|
+
private haptic;
|
|
213
|
+
private applySize;
|
|
214
|
+
private computeProgress;
|
|
215
|
+
private handleOpen;
|
|
216
|
+
private handleClose;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export { BottomSheetEngine as B, type EngineState as E, type Plugin as P, type SnapPointDef as S, type TeardownScope as T, type SheetMode as a, type EngineOptions as b, type SnapPoint as c, type SheetEventMap as d, SCRIM_PRESETS as e, type ScrimOverlayOptions as f, type ScrimOverlayPosition as g, type ScrimPreset as h, type ScrimPresetConfig as i, type ScrimUpdate as j, type SnapId as k };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { T as TransformAxis } from './transform-jVfAikE9.js';
|
|
2
|
+
|
|
3
|
+
type SnapPoint = number | `${number}%` | "fit" | "full" | (string & {});
|
|
4
|
+
type SnapPointDef<Id extends string = string> = {
|
|
5
|
+
id: Id;
|
|
6
|
+
size: SnapPoint;
|
|
7
|
+
};
|
|
8
|
+
type SnapId<T extends readonly SnapPointDef<string>[] | {
|
|
9
|
+
snapPoints: readonly SnapPointDef<string>[];
|
|
10
|
+
}> = T extends {
|
|
11
|
+
snapPoints: readonly SnapPointDef<infer U>[];
|
|
12
|
+
} ? U : T extends readonly SnapPointDef<infer U>[] ? U : never;
|
|
13
|
+
type SheetMode = TransformAxis;
|
|
14
|
+
type ScrimPreset = "subtle" | "standard" | "monitoring" | "cinematic";
|
|
15
|
+
type ScrimPresetConfig = {
|
|
16
|
+
color: string;
|
|
17
|
+
blur: string | undefined;
|
|
18
|
+
range: [number, number];
|
|
19
|
+
interactive: boolean;
|
|
20
|
+
};
|
|
21
|
+
declare const SCRIM_PRESETS: Readonly<Record<ScrimPreset, ScrimPresetConfig>>;
|
|
22
|
+
type ScrimUpdate = {
|
|
23
|
+
color?: string | null;
|
|
24
|
+
blur?: string | null;
|
|
25
|
+
interactive?: boolean;
|
|
26
|
+
range?: [number, number];
|
|
27
|
+
preset?: ScrimPreset;
|
|
28
|
+
mode?: "full" | "above-sheet" | "off";
|
|
29
|
+
tapToClose?: boolean;
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type ScrimOverlayPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | "sheet-top-left" | "sheet-top-center" | "sheet-top-right";
|
|
33
|
+
type ScrimOverlayOptions = {
|
|
34
|
+
children: HTMLElement | DocumentFragment;
|
|
35
|
+
position?: ScrimOverlayPosition;
|
|
36
|
+
interactive?: boolean;
|
|
37
|
+
inset?: string;
|
|
38
|
+
};
|
|
39
|
+
type SheetEventMap = {
|
|
40
|
+
"before-snap": {
|
|
41
|
+
id: string;
|
|
42
|
+
size: number;
|
|
43
|
+
cancel: () => void;
|
|
44
|
+
previousId: string;
|
|
45
|
+
};
|
|
46
|
+
snap: {
|
|
47
|
+
id: string;
|
|
48
|
+
size: number;
|
|
49
|
+
};
|
|
50
|
+
progress: {
|
|
51
|
+
value: number;
|
|
52
|
+
size: number;
|
|
53
|
+
};
|
|
54
|
+
dragstart: {
|
|
55
|
+
size: number;
|
|
56
|
+
};
|
|
57
|
+
drag: {
|
|
58
|
+
size: number;
|
|
59
|
+
delta: number;
|
|
60
|
+
};
|
|
61
|
+
dragend: {
|
|
62
|
+
size: number;
|
|
63
|
+
velocity: number;
|
|
64
|
+
};
|
|
65
|
+
close: void;
|
|
66
|
+
open: {
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type EngineOptions = {
|
|
71
|
+
element: HTMLElement;
|
|
72
|
+
handle?: HTMLElement;
|
|
73
|
+
scrollContainer?: HTMLElement;
|
|
74
|
+
backdrop?: HTMLElement;
|
|
75
|
+
scrim?: HTMLElement;
|
|
76
|
+
screenComponent?: HTMLElement;
|
|
77
|
+
mode?: SheetMode;
|
|
78
|
+
snapPoints: SnapPointDef[];
|
|
79
|
+
allowed?: string[];
|
|
80
|
+
initial?: string;
|
|
81
|
+
duration?: number;
|
|
82
|
+
easing?: (t: number) => number;
|
|
83
|
+
respectReducedMotion?: boolean;
|
|
84
|
+
flickVelocity?: number;
|
|
85
|
+
dragThreshold?: number;
|
|
86
|
+
rubberBand?: boolean;
|
|
87
|
+
backdropRange?: [number, number];
|
|
88
|
+
screenRange?: [number, number];
|
|
89
|
+
scrimMode?: "full" | "above-sheet" | "off";
|
|
90
|
+
scrimColor?: string;
|
|
91
|
+
scrimBlur?: string;
|
|
92
|
+
scrimInteractive?: boolean;
|
|
93
|
+
scrimTapToClose?: boolean;
|
|
94
|
+
scrimPreset?: ScrimPreset;
|
|
95
|
+
animation?: "spring" | "tween" | "ios-spring" | "material-bounce" | "linear" | "snappy";
|
|
96
|
+
spring?: {
|
|
97
|
+
stiffness?: number;
|
|
98
|
+
damping?: number;
|
|
99
|
+
mass?: number;
|
|
100
|
+
};
|
|
101
|
+
focusTrap?: boolean;
|
|
102
|
+
initialFocus?: string | HTMLElement;
|
|
103
|
+
closeOnEscape?: boolean;
|
|
104
|
+
lockBodyScroll?: boolean;
|
|
105
|
+
closeOnBack?: boolean;
|
|
106
|
+
routedTo?: string;
|
|
107
|
+
inertSiblings?: boolean;
|
|
108
|
+
persistKey?: string;
|
|
109
|
+
autoCollapseAfter?: number;
|
|
110
|
+
linkedSheets?: BottomSheetEngineLike[];
|
|
111
|
+
viewTransitions?: boolean;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
type BottomSheetEngineLike = BottomSheetEngine;
|
|
115
|
+
type TeardownScope = {
|
|
116
|
+
add: (fn: (() => void) | null | undefined) => void;
|
|
117
|
+
};
|
|
118
|
+
type Plugin = {
|
|
119
|
+
name: string;
|
|
120
|
+
install: (engine: BottomSheetEngine, scope: TeardownScope) => void | (() => void);
|
|
121
|
+
};
|
|
122
|
+
type EngineState = {
|
|
123
|
+
size: number;
|
|
124
|
+
activeId: string;
|
|
125
|
+
isDragging: boolean;
|
|
126
|
+
isAnimating: boolean;
|
|
127
|
+
progress: number;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type Listener<K extends keyof SheetEventMap> = (payload: SheetEventMap[K]) => void;
|
|
131
|
+
declare class BottomSheetEngine {
|
|
132
|
+
private id;
|
|
133
|
+
private element;
|
|
134
|
+
private handle;
|
|
135
|
+
private scrollContainer?;
|
|
136
|
+
private backdrop?;
|
|
137
|
+
private screenComponent?;
|
|
138
|
+
private scrimParent;
|
|
139
|
+
private mode;
|
|
140
|
+
private flickVelocity;
|
|
141
|
+
private dragThreshold;
|
|
142
|
+
private rubberBandEnabled;
|
|
143
|
+
private scrim;
|
|
144
|
+
private aria;
|
|
145
|
+
private animation;
|
|
146
|
+
private lifecycle;
|
|
147
|
+
private closeOnBack;
|
|
148
|
+
private routedTo;
|
|
149
|
+
private snapPointsRaw;
|
|
150
|
+
private snaps;
|
|
151
|
+
private activeId;
|
|
152
|
+
private size;
|
|
153
|
+
private gesture;
|
|
154
|
+
private rootEl;
|
|
155
|
+
private destroyed;
|
|
156
|
+
private currentViewTransition;
|
|
157
|
+
private currentAbort;
|
|
158
|
+
private sizeWriteSentinel;
|
|
159
|
+
private progressWriteSentinel;
|
|
160
|
+
private isTopSheet;
|
|
161
|
+
private progressPayload;
|
|
162
|
+
private dragContextBuf;
|
|
163
|
+
private bus;
|
|
164
|
+
private persistKey;
|
|
165
|
+
private linkedSheets;
|
|
166
|
+
private scrollCache;
|
|
167
|
+
private teardowns;
|
|
168
|
+
private transformTemplate;
|
|
169
|
+
constructor(opts: EngineOptions);
|
|
170
|
+
get state(): EngineState;
|
|
171
|
+
on<K extends keyof SheetEventMap>(event: K, fn: Listener<K>): () => void;
|
|
172
|
+
use(plugin: Plugin): this;
|
|
173
|
+
setLinkedSheets(sheets: BottomSheetEngine[]): void;
|
|
174
|
+
getAllowedIds(): string[];
|
|
175
|
+
snapTo(id: string, velocityOrOpts?: number | {
|
|
176
|
+
velocity?: number;
|
|
177
|
+
signal?: AbortSignal;
|
|
178
|
+
}, _skipBeforeSnap?: boolean): Promise<void>;
|
|
179
|
+
dragTo(targetSize: number, velocityOrOpts?: number | {
|
|
180
|
+
velocity?: number;
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
}): Promise<void>;
|
|
183
|
+
open(id?: string): Promise<void>;
|
|
184
|
+
close(): Promise<void>;
|
|
185
|
+
setAllowed(ids: string[], snap?: string): void;
|
|
186
|
+
setBackdropRange(range: [number, number]): void;
|
|
187
|
+
setScreenRange(range: [number, number]): void;
|
|
188
|
+
setScrimColor(color: string | undefined | null): void;
|
|
189
|
+
setScrimBlur(blur: string | undefined | null): void;
|
|
190
|
+
setScrimInteractive(interactive: boolean): void;
|
|
191
|
+
setScrim(opts: ScrimUpdate): void;
|
|
192
|
+
setScrimMode(mode: "full" | "above-sheet" | "off"): void;
|
|
193
|
+
setScrimTapToClose(enabled: boolean): void;
|
|
194
|
+
setScrimEnabled(enabled: boolean): void;
|
|
195
|
+
setScrimOverlay(opts: ScrimOverlayOptions): () => void;
|
|
196
|
+
getScrimState(): {
|
|
197
|
+
mode: "full" | "above-sheet" | "off";
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
};
|
|
200
|
+
setSnapPoints(points: EngineOptions["snapPoints"], allowed?: string[]): void;
|
|
201
|
+
destroy(): void;
|
|
202
|
+
private emit;
|
|
203
|
+
private newCycle;
|
|
204
|
+
private emitBeforeSnap;
|
|
205
|
+
private recomputeSnaps;
|
|
206
|
+
private getAllowedRange;
|
|
207
|
+
private updateAriaSlider;
|
|
208
|
+
private registerInStack;
|
|
209
|
+
private attach;
|
|
210
|
+
private attachFeatures;
|
|
211
|
+
private settleAfterDrag;
|
|
212
|
+
private haptic;
|
|
213
|
+
private applySize;
|
|
214
|
+
private computeProgress;
|
|
215
|
+
private handleOpen;
|
|
216
|
+
private handleClose;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export { BottomSheetEngine as B, type EngineState as E, type Plugin as P, type SnapPointDef as S, type TeardownScope as T, type SheetMode as a, type EngineOptions as b, type SnapPoint as c, type SheetEventMap as d, SCRIM_PRESETS as e, type ScrimOverlayOptions as f, type ScrimOverlayPosition as g, type ScrimPreset as h, type ScrimPresetConfig as i, type ScrimUpdate as j, type SnapId as k };
|