@surdeddd/bottom-sheet 0.13.0 → 0.20.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 +46 -0
- package/dist/{BottomSheetCore-D16lsa6g.d.ts → BottomSheetCore-Cgn8b_6A.d.ts} +36 -2
- package/dist/{BottomSheetCore-CsIjyq7C.d.cts → BottomSheetCore-VPJZcKcg.d.cts} +36 -2
- package/dist/{BottomSheetEngine-BYjAVrmd.d.cts → BottomSheetEngine-B8C2CwF9.d.cts} +1 -1
- package/dist/{BottomSheetEngine-YuCNugZn.d.ts → BottomSheetEngine-DwYR_ygJ.d.ts} +1 -1
- package/dist/core.cjs +328 -33
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +328 -33
- package/dist/debug.d.cts +1 -1
- package/dist/debug.d.ts +1 -1
- package/dist/element.cjs +404 -108
- package/dist/element.d.cts +2 -2
- package/dist/element.d.ts +2 -2
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +404 -108
- package/dist/features.cjs +6 -50
- package/dist/features.d.cts +4 -4
- package/dist/features.d.ts +4 -4
- package/dist/features.js +6 -50
- package/dist/index-CnfbOKx0.d.cts +9 -0
- package/dist/index-DcMkhXAy.d.ts +9 -0
- package/dist/index.cjs +335 -829
- package/dist/index.d.cts +44 -47
- package/dist/index.d.ts +44 -47
- package/dist/index.js +336 -816
- 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 +5 -5
- package/dist/overlay.js +5 -5
- package/dist/preact.d.cts +2 -2
- package/dist/preact.d.ts +2 -2
- package/dist/qwik-lib/index.qwik.cjs +323 -83
- package/dist/qwik-lib/index.qwik.mjs +323 -83
- package/dist/qwik.cjs +342 -83
- package/dist/qwik.d.cts +4 -2
- package/dist/qwik.d.ts +4 -2
- package/dist/qwik.js +342 -83
- package/dist/react.cjs +347 -85
- package/dist/react.d.cts +3 -4
- package/dist/react.d.ts +3 -4
- package/dist/react.js +347 -85
- package/dist/solid.cjs +348 -83
- package/dist/solid.d.cts +37 -1
- package/dist/solid.d.ts +37 -1
- package/dist/solid.js +348 -83
- package/dist/solid.source.jsx +356 -83
- package/dist/styles.css +24 -4
- package/dist/svelte-core.cjs +334 -83
- package/dist/svelte-core.js +334 -83
- package/dist/svelte-src/BottomSheet.svelte +14 -0
- package/dist/svelte.cjs +344 -83
- package/dist/svelte.d.cts +2 -0
- package/dist/svelte.d.ts +2 -0
- package/dist/svelte.js +344 -83
- package/dist/vue.cjs +350 -83
- package/dist/vue.js +350 -83
- package/dist/webgl.cjs +673 -0
- package/dist/webgl.d.cts +17 -0
- package/dist/webgl.d.ts +17 -0
- package/dist/webgl.js +671 -0
- package/package.json +64 -40
- package/dist/index-DdYLOIIT.d.ts +0 -15
- package/dist/index-dfrzw-lI.d.cts +0 -15
package/dist/solid.d.cts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
|
|
3
|
+
type DragFrom$1 = "handle" | "sheet" | "zones";
|
|
4
|
+
|
|
3
5
|
type TransformAxis = "bottom" | "top" | "left" | "right";
|
|
4
6
|
|
|
7
|
+
type LogicalAxis = "start" | "end";
|
|
8
|
+
|
|
5
9
|
type SnapPoint = number | `${number}%` | "fit" | "content" | "full" | (string & {});
|
|
6
10
|
type SnapPointDef<Id extends string = string> = {
|
|
7
11
|
id: Id;
|
|
8
12
|
size: SnapPoint;
|
|
13
|
+
dragFromContent?: boolean;
|
|
9
14
|
};
|
|
10
|
-
type
|
|
15
|
+
type PhysicalSheetMode = TransformAxis;
|
|
16
|
+
type LogicalSheetMode = LogicalAxis;
|
|
17
|
+
type SheetMode = PhysicalSheetMode | LogicalSheetMode;
|
|
18
|
+
type DragFrom = DragFrom$1;
|
|
19
|
+
type DragSurfaceKind = "content";
|
|
11
20
|
type ScrimPreset = "subtle" | "standard" | "monitoring" | "cinematic";
|
|
12
21
|
type ScrimUpdate = {
|
|
13
22
|
color?: string | null;
|
|
@@ -83,6 +92,8 @@ type EngineOptions = {
|
|
|
83
92
|
respectReducedMotion?: boolean;
|
|
84
93
|
flickVelocity?: number;
|
|
85
94
|
dragThreshold?: number;
|
|
95
|
+
dragFrom?: DragFrom;
|
|
96
|
+
dragFromContent?: boolean;
|
|
86
97
|
rubberBand?: boolean;
|
|
87
98
|
backdropRange?: [number, number];
|
|
88
99
|
screenRange?: [number, number];
|
|
@@ -162,6 +173,7 @@ type EngineFeatureContext = {
|
|
|
162
173
|
resyncAfterResize: () => void;
|
|
163
174
|
snapTo: (id: string) => void;
|
|
164
175
|
close: (reason?: CloseReason) => Promise<void>;
|
|
176
|
+
attachDragSurface: (surface: HTMLElement, kind: DragSurfaceKind) => (() => void) | void;
|
|
165
177
|
on: <K extends keyof SheetEventMap>(event: K, fn: (payload: SheetEventMap[K]) => void) => () => void;
|
|
166
178
|
addTeardown: (fn: (() => void) | null | undefined) => void;
|
|
167
179
|
};
|
|
@@ -241,6 +253,8 @@ declare class BottomSheetCore {
|
|
|
241
253
|
private mode;
|
|
242
254
|
private flickVelocity;
|
|
243
255
|
private dragThreshold;
|
|
256
|
+
private dragFromMode;
|
|
257
|
+
private dragFromContentDefault;
|
|
244
258
|
private rubberBandEnabled;
|
|
245
259
|
private scrim;
|
|
246
260
|
private aria;
|
|
@@ -253,13 +267,18 @@ declare class BottomSheetCore {
|
|
|
253
267
|
private disableDragFlag;
|
|
254
268
|
private closeOnRouteChange;
|
|
255
269
|
private maxHeight;
|
|
270
|
+
private maxHeightDeps;
|
|
256
271
|
private snapPointsRaw;
|
|
257
272
|
private snaps;
|
|
258
273
|
private activeId;
|
|
259
274
|
private size;
|
|
260
275
|
private gesture;
|
|
276
|
+
private contentGesture;
|
|
277
|
+
private detachSheetGesture;
|
|
278
|
+
private detachSliderKeyboard;
|
|
261
279
|
private rootEl;
|
|
262
280
|
private destroyed;
|
|
281
|
+
private restClosed;
|
|
263
282
|
private currentViewTransition;
|
|
264
283
|
private currentAbort;
|
|
265
284
|
private sizeWriteSentinel;
|
|
@@ -302,6 +321,7 @@ declare class BottomSheetCore {
|
|
|
302
321
|
signal?: AbortSignal;
|
|
303
322
|
}, _skipBeforeSnap?: boolean): Promise<void>;
|
|
304
323
|
private completeSnap;
|
|
324
|
+
private setRestClosed;
|
|
305
325
|
private emitOpenSequence;
|
|
306
326
|
private emitCloseSequence;
|
|
307
327
|
dragTo(targetSize: number, velocityOrOpts?: number | {
|
|
@@ -314,6 +334,11 @@ declare class BottomSheetCore {
|
|
|
314
334
|
setPersistent(value: boolean): void;
|
|
315
335
|
setDisableClose(value: boolean): void;
|
|
316
336
|
setDisableDrag(value: boolean): void;
|
|
337
|
+
setDragFromContent(value: boolean): void;
|
|
338
|
+
setDragFrom(mode: DragFrom$1): void;
|
|
339
|
+
getDragFrom(): DragFrom$1;
|
|
340
|
+
setMode(mode: SheetMode): void;
|
|
341
|
+
getMode(): PhysicalSheetMode;
|
|
317
342
|
isTop(): boolean;
|
|
318
343
|
depth(): number;
|
|
319
344
|
expand(): Promise<void>;
|
|
@@ -353,9 +378,18 @@ declare class BottomSheetCore {
|
|
|
353
378
|
private updateAriaSlider;
|
|
354
379
|
private registerInStack;
|
|
355
380
|
private applyStackDepth;
|
|
381
|
+
private buildGestureDeps;
|
|
382
|
+
private isContentDragAllowed;
|
|
383
|
+
private decideContentDrag;
|
|
384
|
+
private attachDragSurface;
|
|
385
|
+
private sheetDragSurface;
|
|
386
|
+
private canStartSheetDrag;
|
|
387
|
+
private mountSheetGesture;
|
|
356
388
|
private attach;
|
|
357
389
|
private attachFeatures;
|
|
390
|
+
private mountSliderKeyboard;
|
|
358
391
|
private settleAfterDrag;
|
|
392
|
+
private isDraggingAny;
|
|
359
393
|
private clearWillChangeIfIdle;
|
|
360
394
|
private haptic;
|
|
361
395
|
private applySize;
|
|
@@ -395,6 +429,8 @@ type BottomSheetProps<TId extends string = string> = {
|
|
|
395
429
|
persistent?: boolean;
|
|
396
430
|
disableClose?: boolean;
|
|
397
431
|
disableDrag?: boolean;
|
|
432
|
+
dragFrom?: EngineOptions["dragFrom"];
|
|
433
|
+
dragFromContent?: boolean;
|
|
398
434
|
closeOnRouteChange?: boolean;
|
|
399
435
|
stackEffect?: boolean;
|
|
400
436
|
teleport?: boolean;
|
package/dist/solid.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
2
|
|
|
3
|
+
type DragFrom$1 = "handle" | "sheet" | "zones";
|
|
4
|
+
|
|
3
5
|
type TransformAxis = "bottom" | "top" | "left" | "right";
|
|
4
6
|
|
|
7
|
+
type LogicalAxis = "start" | "end";
|
|
8
|
+
|
|
5
9
|
type SnapPoint = number | `${number}%` | "fit" | "content" | "full" | (string & {});
|
|
6
10
|
type SnapPointDef<Id extends string = string> = {
|
|
7
11
|
id: Id;
|
|
8
12
|
size: SnapPoint;
|
|
13
|
+
dragFromContent?: boolean;
|
|
9
14
|
};
|
|
10
|
-
type
|
|
15
|
+
type PhysicalSheetMode = TransformAxis;
|
|
16
|
+
type LogicalSheetMode = LogicalAxis;
|
|
17
|
+
type SheetMode = PhysicalSheetMode | LogicalSheetMode;
|
|
18
|
+
type DragFrom = DragFrom$1;
|
|
19
|
+
type DragSurfaceKind = "content";
|
|
11
20
|
type ScrimPreset = "subtle" | "standard" | "monitoring" | "cinematic";
|
|
12
21
|
type ScrimUpdate = {
|
|
13
22
|
color?: string | null;
|
|
@@ -83,6 +92,8 @@ type EngineOptions = {
|
|
|
83
92
|
respectReducedMotion?: boolean;
|
|
84
93
|
flickVelocity?: number;
|
|
85
94
|
dragThreshold?: number;
|
|
95
|
+
dragFrom?: DragFrom;
|
|
96
|
+
dragFromContent?: boolean;
|
|
86
97
|
rubberBand?: boolean;
|
|
87
98
|
backdropRange?: [number, number];
|
|
88
99
|
screenRange?: [number, number];
|
|
@@ -162,6 +173,7 @@ type EngineFeatureContext = {
|
|
|
162
173
|
resyncAfterResize: () => void;
|
|
163
174
|
snapTo: (id: string) => void;
|
|
164
175
|
close: (reason?: CloseReason) => Promise<void>;
|
|
176
|
+
attachDragSurface: (surface: HTMLElement, kind: DragSurfaceKind) => (() => void) | void;
|
|
165
177
|
on: <K extends keyof SheetEventMap>(event: K, fn: (payload: SheetEventMap[K]) => void) => () => void;
|
|
166
178
|
addTeardown: (fn: (() => void) | null | undefined) => void;
|
|
167
179
|
};
|
|
@@ -241,6 +253,8 @@ declare class BottomSheetCore {
|
|
|
241
253
|
private mode;
|
|
242
254
|
private flickVelocity;
|
|
243
255
|
private dragThreshold;
|
|
256
|
+
private dragFromMode;
|
|
257
|
+
private dragFromContentDefault;
|
|
244
258
|
private rubberBandEnabled;
|
|
245
259
|
private scrim;
|
|
246
260
|
private aria;
|
|
@@ -253,13 +267,18 @@ declare class BottomSheetCore {
|
|
|
253
267
|
private disableDragFlag;
|
|
254
268
|
private closeOnRouteChange;
|
|
255
269
|
private maxHeight;
|
|
270
|
+
private maxHeightDeps;
|
|
256
271
|
private snapPointsRaw;
|
|
257
272
|
private snaps;
|
|
258
273
|
private activeId;
|
|
259
274
|
private size;
|
|
260
275
|
private gesture;
|
|
276
|
+
private contentGesture;
|
|
277
|
+
private detachSheetGesture;
|
|
278
|
+
private detachSliderKeyboard;
|
|
261
279
|
private rootEl;
|
|
262
280
|
private destroyed;
|
|
281
|
+
private restClosed;
|
|
263
282
|
private currentViewTransition;
|
|
264
283
|
private currentAbort;
|
|
265
284
|
private sizeWriteSentinel;
|
|
@@ -302,6 +321,7 @@ declare class BottomSheetCore {
|
|
|
302
321
|
signal?: AbortSignal;
|
|
303
322
|
}, _skipBeforeSnap?: boolean): Promise<void>;
|
|
304
323
|
private completeSnap;
|
|
324
|
+
private setRestClosed;
|
|
305
325
|
private emitOpenSequence;
|
|
306
326
|
private emitCloseSequence;
|
|
307
327
|
dragTo(targetSize: number, velocityOrOpts?: number | {
|
|
@@ -314,6 +334,11 @@ declare class BottomSheetCore {
|
|
|
314
334
|
setPersistent(value: boolean): void;
|
|
315
335
|
setDisableClose(value: boolean): void;
|
|
316
336
|
setDisableDrag(value: boolean): void;
|
|
337
|
+
setDragFromContent(value: boolean): void;
|
|
338
|
+
setDragFrom(mode: DragFrom$1): void;
|
|
339
|
+
getDragFrom(): DragFrom$1;
|
|
340
|
+
setMode(mode: SheetMode): void;
|
|
341
|
+
getMode(): PhysicalSheetMode;
|
|
317
342
|
isTop(): boolean;
|
|
318
343
|
depth(): number;
|
|
319
344
|
expand(): Promise<void>;
|
|
@@ -353,9 +378,18 @@ declare class BottomSheetCore {
|
|
|
353
378
|
private updateAriaSlider;
|
|
354
379
|
private registerInStack;
|
|
355
380
|
private applyStackDepth;
|
|
381
|
+
private buildGestureDeps;
|
|
382
|
+
private isContentDragAllowed;
|
|
383
|
+
private decideContentDrag;
|
|
384
|
+
private attachDragSurface;
|
|
385
|
+
private sheetDragSurface;
|
|
386
|
+
private canStartSheetDrag;
|
|
387
|
+
private mountSheetGesture;
|
|
356
388
|
private attach;
|
|
357
389
|
private attachFeatures;
|
|
390
|
+
private mountSliderKeyboard;
|
|
358
391
|
private settleAfterDrag;
|
|
392
|
+
private isDraggingAny;
|
|
359
393
|
private clearWillChangeIfIdle;
|
|
360
394
|
private haptic;
|
|
361
395
|
private applySize;
|
|
@@ -395,6 +429,8 @@ type BottomSheetProps<TId extends string = string> = {
|
|
|
395
429
|
persistent?: boolean;
|
|
396
430
|
disableClose?: boolean;
|
|
397
431
|
disableDrag?: boolean;
|
|
432
|
+
dragFrom?: EngineOptions["dragFrom"];
|
|
433
|
+
dragFromContent?: boolean;
|
|
398
434
|
closeOnRouteChange?: boolean;
|
|
399
435
|
stackEffect?: boolean;
|
|
400
436
|
teleport?: boolean;
|