@surdeddd/bottom-sheet 0.23.3 → 0.24.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 +513 -525
- package/README.ru.md +685 -0
- package/dist/{BottomSheetCore-COvILxmR.d.ts → BottomSheetCore-B_r4KCQL.d.cts} +48 -12
- package/dist/{BottomSheetCore-CaJwHnxY.d.cts → BottomSheetCore-B_r4KCQL.d.ts} +48 -12
- package/dist/{BottomSheetEngine-C_1aPJsU.d.cts → BottomSheetEngine-0F7mjyvF.d.cts} +1 -1
- package/dist/{BottomSheetEngine-CsgCcCSO.d.ts → BottomSheetEngine-CJV_DDrM.d.ts} +1 -1
- package/dist/core.cjs +810 -436
- package/dist/core.d.cts +2 -3
- package/dist/core.d.ts +2 -3
- package/dist/core.js +810 -436
- package/dist/debug.d.cts +3 -3
- package/dist/debug.d.ts +3 -3
- package/dist/{default-features-BJx7J0NH.d.ts → default-features-4Xwv6aVt.d.ts} +4 -2
- package/dist/{default-features-CTJb8Wdk.d.cts → default-features-DX2NOxP6.d.cts} +4 -2
- package/dist/element.cjs +1428 -699
- package/dist/element.d.cts +15 -5
- package/dist/element.d.ts +15 -5
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +1428 -699
- package/dist/features.cjs +334 -190
- package/dist/features.d.cts +3 -4
- package/dist/features.d.ts +3 -4
- package/dist/features.js +334 -191
- package/dist/{index-CXN7t3rr.d.ts → index-2shlxhcG.d.cts} +3 -2
- package/dist/{index-BBrJJjy5.d.cts → index-CNCRQnpc.d.ts} +3 -2
- package/dist/index.cjs +1129 -631
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +1129 -632
- package/dist/integrations/formik.cjs +21 -10
- package/dist/integrations/formik.d.cts +3 -3
- package/dist/integrations/formik.d.ts +3 -3
- package/dist/integrations/formik.js +22 -11
- package/dist/integrations/react-hook-form.cjs +21 -12
- package/dist/integrations/react-hook-form.d.cts +3 -3
- package/dist/integrations/react-hook-form.d.ts +3 -3
- package/dist/integrations/react-hook-form.js +21 -12
- package/dist/option-keys-DItuAjUw.d.cts +6 -0
- package/dist/option-keys-a5DYNwwO.d.ts +6 -0
- package/dist/overlay.cjs +386 -189
- package/dist/overlay.d.cts +3 -4
- package/dist/overlay.d.ts +3 -4
- package/dist/overlay.js +386 -189
- package/dist/preact.d.cts +3 -4
- package/dist/preact.d.ts +3 -4
- package/dist/qwik-lib/index.qwik.cjs +1306 -671
- package/dist/qwik-lib/index.qwik.mjs +1306 -671
- package/dist/qwik.cjs +1326 -701
- package/dist/qwik.d.cts +14 -30
- package/dist/qwik.d.ts +14 -30
- package/dist/qwik.js +1326 -701
- package/dist/react.cjs +1373 -750
- package/dist/react.d.cts +31 -14
- package/dist/react.d.ts +31 -14
- package/dist/react.js +1375 -752
- package/dist/solid.cjs +1332 -727
- package/dist/solid.d.cts +13 -437
- package/dist/solid.d.ts +13 -437
- package/dist/solid.js +1334 -729
- package/dist/solid.source.jsx +1374 -751
- package/dist/styles.css +20 -6
- package/dist/svelte-core.cjs +1211 -676
- package/dist/svelte-core.js +1207 -677
- package/dist/svelte-src/BottomSheet.svelte +102 -59
- package/dist/svelte.cjs +1324 -707
- package/dist/svelte.d.cts +45 -25
- package/dist/svelte.d.ts +45 -25
- package/dist/svelte.js +1324 -707
- package/dist/vue.cjs +1354 -773
- package/dist/vue.d.cts +20 -3
- package/dist/vue.d.ts +20 -3
- package/dist/vue.js +1354 -773
- package/dist/webgl.cjs +38 -7
- package/dist/webgl.d.cts +3 -3
- package/dist/webgl.d.ts +3 -3
- package/dist/webgl.js +38 -7
- package/llms.txt +330 -0
- package/package.json +62 -42
- package/dist/transform-jVfAikE9.d.cts +0 -3
- package/dist/transform-jVfAikE9.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TransformAxis } from './transform-jVfAikE9.js';
|
|
2
|
-
|
|
3
1
|
type DragFrom$1 = "handle" | "sheet" | "zones";
|
|
4
2
|
|
|
3
|
+
type TransformAxis = "bottom" | "top" | "left" | "right";
|
|
4
|
+
|
|
5
5
|
type LogicalAxis = "start" | "end";
|
|
6
6
|
|
|
7
7
|
type SnapPoint = number | `${number}%` | "fit" | "content" | "full" | (string & {});
|
|
@@ -107,6 +107,8 @@ type EngineOptions = {
|
|
|
107
107
|
fitContentToSnap?: boolean;
|
|
108
108
|
rubberBand?: boolean;
|
|
109
109
|
backdropRange?: [number, number];
|
|
110
|
+
backdropOpacity?: number;
|
|
111
|
+
backdropColor?: string;
|
|
110
112
|
screenRange?: [number, number];
|
|
111
113
|
scrimMode?: "full" | "above-sheet" | "off";
|
|
112
114
|
scrimColor?: string;
|
|
@@ -177,10 +179,14 @@ type EngineFeatureContext = {
|
|
|
177
179
|
id: string;
|
|
178
180
|
size: number;
|
|
179
181
|
} | null;
|
|
182
|
+
getPhase: () => SheetPhase;
|
|
180
183
|
setSize: (size: number) => void;
|
|
181
184
|
setMaxAxisSize: (size: number) => void;
|
|
185
|
+
setKeyboardInset: (px: number) => void;
|
|
182
186
|
applySize: (size: number) => void;
|
|
183
187
|
recomputeSnaps: () => void;
|
|
188
|
+
reseat: () => void;
|
|
189
|
+
holdSettle: (settled: Promise<unknown>) => void;
|
|
184
190
|
newCycle: () => void;
|
|
185
191
|
cancelInFlight: () => void;
|
|
186
192
|
resyncAfterResize: () => void;
|
|
@@ -202,9 +208,11 @@ type Plugin = {
|
|
|
202
208
|
name: string;
|
|
203
209
|
install: (engine: BottomSheetCore, scope: TeardownScope) => void | (() => void);
|
|
204
210
|
};
|
|
211
|
+
type SheetPhase = "closed" | "opening" | "open" | "closing";
|
|
205
212
|
type EngineState = {
|
|
206
213
|
size: number;
|
|
207
214
|
activeId: string;
|
|
215
|
+
phase: SheetPhase;
|
|
208
216
|
isDragging: boolean;
|
|
209
217
|
isAnimating: boolean;
|
|
210
218
|
progress: number;
|
|
@@ -244,6 +252,7 @@ type AnchorHandle = {
|
|
|
244
252
|
wrapper: HTMLElement;
|
|
245
253
|
detach: () => void;
|
|
246
254
|
syncZ: (z: number) => void;
|
|
255
|
+
reposition: () => void;
|
|
247
256
|
};
|
|
248
257
|
|
|
249
258
|
type ScrimStageDef = {
|
|
@@ -288,6 +297,7 @@ declare class BottomSheetCore {
|
|
|
288
297
|
private fitContentToSnap;
|
|
289
298
|
private settleAnimation;
|
|
290
299
|
private persistent;
|
|
300
|
+
private keyboardInset;
|
|
291
301
|
private disableCloseFlag;
|
|
292
302
|
private disableDragFlag;
|
|
293
303
|
private closeOnRouteChange;
|
|
@@ -302,6 +312,7 @@ declare class BottomSheetCore {
|
|
|
302
312
|
private detachSheetGesture;
|
|
303
313
|
private detachSliderKeyboard;
|
|
304
314
|
private rootEl;
|
|
315
|
+
private homeRoot;
|
|
305
316
|
private destroyed;
|
|
306
317
|
private restClosed;
|
|
307
318
|
private currentViewTransition;
|
|
@@ -309,8 +320,13 @@ declare class BottomSheetCore {
|
|
|
309
320
|
private sizeWriteSentinel;
|
|
310
321
|
private progressWriteSentinel;
|
|
311
322
|
private isTopSheet;
|
|
312
|
-
private
|
|
313
|
-
private
|
|
323
|
+
private phase;
|
|
324
|
+
private transition;
|
|
325
|
+
private inFlight;
|
|
326
|
+
private outbox;
|
|
327
|
+
private flushing;
|
|
328
|
+
private openPending;
|
|
329
|
+
private settleHolds;
|
|
314
330
|
private allowOvershoot;
|
|
315
331
|
private progressPayload;
|
|
316
332
|
private dragContextBuf;
|
|
@@ -323,6 +339,7 @@ declare class BottomSheetCore {
|
|
|
323
339
|
private anchorHost;
|
|
324
340
|
private stackZ;
|
|
325
341
|
private detachScrimStages;
|
|
342
|
+
private placeScrimStages;
|
|
326
343
|
private stackEffectEnabled;
|
|
327
344
|
private stackEffectPrimed;
|
|
328
345
|
private fitDeps;
|
|
@@ -346,10 +363,27 @@ declare class BottomSheetCore {
|
|
|
346
363
|
velocity?: number;
|
|
347
364
|
signal?: AbortSignal;
|
|
348
365
|
}, _skipBeforeSnap?: boolean): Promise<void>;
|
|
349
|
-
private
|
|
366
|
+
private transitionTo;
|
|
367
|
+
private runTransition;
|
|
368
|
+
private beginTransition;
|
|
369
|
+
private enterOpening;
|
|
370
|
+
private enterClosing;
|
|
371
|
+
private settlePhase;
|
|
372
|
+
private land;
|
|
373
|
+
private suspend;
|
|
374
|
+
private landNow;
|
|
375
|
+
private reseat;
|
|
376
|
+
private installLifecycle;
|
|
377
|
+
private abortOpen;
|
|
378
|
+
private zeroSnapId;
|
|
379
|
+
private isClosedSnap;
|
|
380
|
+
private closingBlocked;
|
|
381
|
+
private setKeyboardInset;
|
|
382
|
+
private varHosts;
|
|
383
|
+
private dismissBlocked;
|
|
384
|
+
private post;
|
|
385
|
+
private flush;
|
|
350
386
|
private setRestClosed;
|
|
351
|
-
private emitOpenSequence;
|
|
352
|
-
private emitCloseSequence;
|
|
353
387
|
dragTo(targetSize: number, velocityOrOpts?: number | {
|
|
354
388
|
velocity?: number;
|
|
355
389
|
signal?: AbortSignal;
|
|
@@ -372,7 +406,10 @@ declare class BottomSheetCore {
|
|
|
372
406
|
setRadius(r: string | number): void;
|
|
373
407
|
setMaxHeight(h: string | number): void;
|
|
374
408
|
setAllowed(ids: string[], snap?: string): void;
|
|
409
|
+
private fallbackSnap;
|
|
375
410
|
setBackdropRange(range: [number, number]): void;
|
|
411
|
+
setBackdropOpacity(value: number): void;
|
|
412
|
+
setBackdropColor(color: string | undefined | null): void;
|
|
376
413
|
setScreenRange(range: [number, number]): void;
|
|
377
414
|
setScrimColor(color: string | undefined | null): void;
|
|
378
415
|
setScrimBlur(blur: string | undefined | null): void;
|
|
@@ -390,7 +427,6 @@ declare class BottomSheetCore {
|
|
|
390
427
|
};
|
|
391
428
|
setSnapPoints(points: EngineOptions["snapPoints"], allowed?: string[]): void;
|
|
392
429
|
recompute(): void;
|
|
393
|
-
private healActiveSnap;
|
|
394
430
|
destroy(): void;
|
|
395
431
|
private emit;
|
|
396
432
|
private newCycle;
|
|
@@ -415,14 +451,14 @@ declare class BottomSheetCore {
|
|
|
415
451
|
private attachFeatures;
|
|
416
452
|
private mountSliderKeyboard;
|
|
417
453
|
private settleAfterDrag;
|
|
454
|
+
private restoreAfterDrag;
|
|
455
|
+
private smallestOpenSize;
|
|
418
456
|
private isDraggingAny;
|
|
419
457
|
private clearWillChangeIfIdle;
|
|
420
458
|
private haptic;
|
|
421
459
|
private applySize;
|
|
422
460
|
private computeProgress;
|
|
423
|
-
private handleOpen;
|
|
424
|
-
private resyncAfterResize;
|
|
425
|
-
private handleClose;
|
|
426
461
|
}
|
|
427
462
|
|
|
428
|
-
export {
|
|
463
|
+
export { BottomSheetCore as B, SCRIM_PRESETS as q, runAnchorTransition as y };
|
|
464
|
+
export type { AnchorOptions as A, CloseReason as C, EngineFeature as E, LogicalSheetMode as L, PhysicalSheetMode as P, SheetEventMap as S, TeardownScope as T, EngineFeatureContext as a, EngineFeatureOptions as b, EngineFeatureStage as c, EngineState as d, SnapPointDef as e, EngineOptions as f, SheetMode as g, SnapPoint as h, ScrimStagesOptions as i, ScrimOverlayPosition as j, AnchorAnimationPreset as k, AnchorAnimationSpec as l, AnchorHandle as m, AnchorPosition as n, AnchorState as o, Plugin as p, ScrimOverlayOptions as r, ScrimPreset as s, ScrimPresetConfig as t, ScrimStageDef as u, ScrimUpdate as v, SheetPhase as w, SnapId as x };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TransformAxis } from './transform-jVfAikE9.cjs';
|
|
2
|
-
|
|
3
1
|
type DragFrom$1 = "handle" | "sheet" | "zones";
|
|
4
2
|
|
|
3
|
+
type TransformAxis = "bottom" | "top" | "left" | "right";
|
|
4
|
+
|
|
5
5
|
type LogicalAxis = "start" | "end";
|
|
6
6
|
|
|
7
7
|
type SnapPoint = number | `${number}%` | "fit" | "content" | "full" | (string & {});
|
|
@@ -107,6 +107,8 @@ type EngineOptions = {
|
|
|
107
107
|
fitContentToSnap?: boolean;
|
|
108
108
|
rubberBand?: boolean;
|
|
109
109
|
backdropRange?: [number, number];
|
|
110
|
+
backdropOpacity?: number;
|
|
111
|
+
backdropColor?: string;
|
|
110
112
|
screenRange?: [number, number];
|
|
111
113
|
scrimMode?: "full" | "above-sheet" | "off";
|
|
112
114
|
scrimColor?: string;
|
|
@@ -177,10 +179,14 @@ type EngineFeatureContext = {
|
|
|
177
179
|
id: string;
|
|
178
180
|
size: number;
|
|
179
181
|
} | null;
|
|
182
|
+
getPhase: () => SheetPhase;
|
|
180
183
|
setSize: (size: number) => void;
|
|
181
184
|
setMaxAxisSize: (size: number) => void;
|
|
185
|
+
setKeyboardInset: (px: number) => void;
|
|
182
186
|
applySize: (size: number) => void;
|
|
183
187
|
recomputeSnaps: () => void;
|
|
188
|
+
reseat: () => void;
|
|
189
|
+
holdSettle: (settled: Promise<unknown>) => void;
|
|
184
190
|
newCycle: () => void;
|
|
185
191
|
cancelInFlight: () => void;
|
|
186
192
|
resyncAfterResize: () => void;
|
|
@@ -202,9 +208,11 @@ type Plugin = {
|
|
|
202
208
|
name: string;
|
|
203
209
|
install: (engine: BottomSheetCore, scope: TeardownScope) => void | (() => void);
|
|
204
210
|
};
|
|
211
|
+
type SheetPhase = "closed" | "opening" | "open" | "closing";
|
|
205
212
|
type EngineState = {
|
|
206
213
|
size: number;
|
|
207
214
|
activeId: string;
|
|
215
|
+
phase: SheetPhase;
|
|
208
216
|
isDragging: boolean;
|
|
209
217
|
isAnimating: boolean;
|
|
210
218
|
progress: number;
|
|
@@ -244,6 +252,7 @@ type AnchorHandle = {
|
|
|
244
252
|
wrapper: HTMLElement;
|
|
245
253
|
detach: () => void;
|
|
246
254
|
syncZ: (z: number) => void;
|
|
255
|
+
reposition: () => void;
|
|
247
256
|
};
|
|
248
257
|
|
|
249
258
|
type ScrimStageDef = {
|
|
@@ -288,6 +297,7 @@ declare class BottomSheetCore {
|
|
|
288
297
|
private fitContentToSnap;
|
|
289
298
|
private settleAnimation;
|
|
290
299
|
private persistent;
|
|
300
|
+
private keyboardInset;
|
|
291
301
|
private disableCloseFlag;
|
|
292
302
|
private disableDragFlag;
|
|
293
303
|
private closeOnRouteChange;
|
|
@@ -302,6 +312,7 @@ declare class BottomSheetCore {
|
|
|
302
312
|
private detachSheetGesture;
|
|
303
313
|
private detachSliderKeyboard;
|
|
304
314
|
private rootEl;
|
|
315
|
+
private homeRoot;
|
|
305
316
|
private destroyed;
|
|
306
317
|
private restClosed;
|
|
307
318
|
private currentViewTransition;
|
|
@@ -309,8 +320,13 @@ declare class BottomSheetCore {
|
|
|
309
320
|
private sizeWriteSentinel;
|
|
310
321
|
private progressWriteSentinel;
|
|
311
322
|
private isTopSheet;
|
|
312
|
-
private
|
|
313
|
-
private
|
|
323
|
+
private phase;
|
|
324
|
+
private transition;
|
|
325
|
+
private inFlight;
|
|
326
|
+
private outbox;
|
|
327
|
+
private flushing;
|
|
328
|
+
private openPending;
|
|
329
|
+
private settleHolds;
|
|
314
330
|
private allowOvershoot;
|
|
315
331
|
private progressPayload;
|
|
316
332
|
private dragContextBuf;
|
|
@@ -323,6 +339,7 @@ declare class BottomSheetCore {
|
|
|
323
339
|
private anchorHost;
|
|
324
340
|
private stackZ;
|
|
325
341
|
private detachScrimStages;
|
|
342
|
+
private placeScrimStages;
|
|
326
343
|
private stackEffectEnabled;
|
|
327
344
|
private stackEffectPrimed;
|
|
328
345
|
private fitDeps;
|
|
@@ -346,10 +363,27 @@ declare class BottomSheetCore {
|
|
|
346
363
|
velocity?: number;
|
|
347
364
|
signal?: AbortSignal;
|
|
348
365
|
}, _skipBeforeSnap?: boolean): Promise<void>;
|
|
349
|
-
private
|
|
366
|
+
private transitionTo;
|
|
367
|
+
private runTransition;
|
|
368
|
+
private beginTransition;
|
|
369
|
+
private enterOpening;
|
|
370
|
+
private enterClosing;
|
|
371
|
+
private settlePhase;
|
|
372
|
+
private land;
|
|
373
|
+
private suspend;
|
|
374
|
+
private landNow;
|
|
375
|
+
private reseat;
|
|
376
|
+
private installLifecycle;
|
|
377
|
+
private abortOpen;
|
|
378
|
+
private zeroSnapId;
|
|
379
|
+
private isClosedSnap;
|
|
380
|
+
private closingBlocked;
|
|
381
|
+
private setKeyboardInset;
|
|
382
|
+
private varHosts;
|
|
383
|
+
private dismissBlocked;
|
|
384
|
+
private post;
|
|
385
|
+
private flush;
|
|
350
386
|
private setRestClosed;
|
|
351
|
-
private emitOpenSequence;
|
|
352
|
-
private emitCloseSequence;
|
|
353
387
|
dragTo(targetSize: number, velocityOrOpts?: number | {
|
|
354
388
|
velocity?: number;
|
|
355
389
|
signal?: AbortSignal;
|
|
@@ -372,7 +406,10 @@ declare class BottomSheetCore {
|
|
|
372
406
|
setRadius(r: string | number): void;
|
|
373
407
|
setMaxHeight(h: string | number): void;
|
|
374
408
|
setAllowed(ids: string[], snap?: string): void;
|
|
409
|
+
private fallbackSnap;
|
|
375
410
|
setBackdropRange(range: [number, number]): void;
|
|
411
|
+
setBackdropOpacity(value: number): void;
|
|
412
|
+
setBackdropColor(color: string | undefined | null): void;
|
|
376
413
|
setScreenRange(range: [number, number]): void;
|
|
377
414
|
setScrimColor(color: string | undefined | null): void;
|
|
378
415
|
setScrimBlur(blur: string | undefined | null): void;
|
|
@@ -390,7 +427,6 @@ declare class BottomSheetCore {
|
|
|
390
427
|
};
|
|
391
428
|
setSnapPoints(points: EngineOptions["snapPoints"], allowed?: string[]): void;
|
|
392
429
|
recompute(): void;
|
|
393
|
-
private healActiveSnap;
|
|
394
430
|
destroy(): void;
|
|
395
431
|
private emit;
|
|
396
432
|
private newCycle;
|
|
@@ -415,14 +451,14 @@ declare class BottomSheetCore {
|
|
|
415
451
|
private attachFeatures;
|
|
416
452
|
private mountSliderKeyboard;
|
|
417
453
|
private settleAfterDrag;
|
|
454
|
+
private restoreAfterDrag;
|
|
455
|
+
private smallestOpenSize;
|
|
418
456
|
private isDraggingAny;
|
|
419
457
|
private clearWillChangeIfIdle;
|
|
420
458
|
private haptic;
|
|
421
459
|
private applySize;
|
|
422
460
|
private computeProgress;
|
|
423
|
-
private handleOpen;
|
|
424
|
-
private resyncAfterResize;
|
|
425
|
-
private handleClose;
|
|
426
461
|
}
|
|
427
462
|
|
|
428
|
-
export {
|
|
463
|
+
export { BottomSheetCore as B, SCRIM_PRESETS as q, runAnchorTransition as y };
|
|
464
|
+
export type { AnchorOptions as A, CloseReason as C, EngineFeature as E, LogicalSheetMode as L, PhysicalSheetMode as P, SheetEventMap as S, TeardownScope as T, EngineFeatureContext as a, EngineFeatureOptions as b, EngineFeatureStage as c, EngineState as d, SnapPointDef as e, EngineOptions as f, SheetMode as g, SnapPoint as h, ScrimStagesOptions as i, ScrimOverlayPosition as j, AnchorAnimationPreset as k, AnchorAnimationSpec as l, AnchorHandle as m, AnchorPosition as n, AnchorState as o, Plugin as p, ScrimOverlayOptions as r, ScrimPreset as s, ScrimPresetConfig as t, ScrimStageDef as u, ScrimUpdate as v, SheetPhase as w, SnapId as x };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BottomSheetCore,
|
|
1
|
+
import { B as BottomSheetCore, f as EngineOptions } from './BottomSheetCore-B_r4KCQL.cjs';
|
|
2
2
|
|
|
3
3
|
declare class BottomSheetEngine extends BottomSheetCore {
|
|
4
4
|
constructor(opts: EngineOptions);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BottomSheetCore,
|
|
1
|
+
import { B as BottomSheetCore, f as EngineOptions } from './BottomSheetCore-B_r4KCQL.js';
|
|
2
2
|
|
|
3
3
|
declare class BottomSheetEngine extends BottomSheetCore {
|
|
4
4
|
constructor(opts: EngineOptions);
|