@surdeddd/bottom-sheet 0.23.4 → 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.
Files changed (80) hide show
  1. package/README.md +513 -527
  2. package/README.ru.md +533 -545
  3. package/dist/{BottomSheetCore-C5tJYVMY.d.cts → BottomSheetCore-B_r4KCQL.d.cts} +48 -13
  4. package/dist/{BottomSheetCore-DxSrC4QC.d.ts → BottomSheetCore-B_r4KCQL.d.ts} +48 -13
  5. package/dist/{BottomSheetEngine-B3F9qukX.d.cts → BottomSheetEngine-0F7mjyvF.d.cts} +1 -1
  6. package/dist/{BottomSheetEngine-BchzgqGG.d.ts → BottomSheetEngine-CJV_DDrM.d.ts} +1 -1
  7. package/dist/core.cjs +810 -436
  8. package/dist/core.d.cts +2 -3
  9. package/dist/core.d.ts +2 -3
  10. package/dist/core.js +810 -436
  11. package/dist/debug.d.cts +0 -1
  12. package/dist/debug.d.ts +0 -1
  13. package/dist/{default-features-DwVTzDwP.d.ts → default-features-4Xwv6aVt.d.ts} +4 -2
  14. package/dist/{default-features-BGiCSmV1.d.cts → default-features-DX2NOxP6.d.cts} +4 -2
  15. package/dist/element.cjs +1421 -697
  16. package/dist/element.d.cts +11 -3
  17. package/dist/element.d.ts +11 -3
  18. package/dist/element.iife.global.js +2 -2
  19. package/dist/element.js +1421 -697
  20. package/dist/features.cjs +334 -190
  21. package/dist/features.d.cts +3 -4
  22. package/dist/features.d.ts +3 -4
  23. package/dist/features.js +334 -191
  24. package/dist/{index-C7TSQkVK.d.cts → index-2shlxhcG.d.cts} +1 -1
  25. package/dist/{index-CdM1tke5.d.ts → index-CNCRQnpc.d.ts} +1 -1
  26. package/dist/index.cjs +1129 -631
  27. package/dist/index.d.cts +11 -6
  28. package/dist/index.d.ts +11 -6
  29. package/dist/index.js +1129 -632
  30. package/dist/integrations/formik.cjs +21 -10
  31. package/dist/integrations/formik.d.cts +0 -1
  32. package/dist/integrations/formik.d.ts +0 -1
  33. package/dist/integrations/formik.js +22 -11
  34. package/dist/integrations/react-hook-form.cjs +21 -12
  35. package/dist/integrations/react-hook-form.d.cts +0 -1
  36. package/dist/integrations/react-hook-form.d.ts +0 -1
  37. package/dist/integrations/react-hook-form.js +21 -12
  38. package/dist/option-keys-DItuAjUw.d.cts +6 -0
  39. package/dist/option-keys-a5DYNwwO.d.ts +6 -0
  40. package/dist/overlay.cjs +386 -189
  41. package/dist/overlay.d.cts +1 -3
  42. package/dist/overlay.d.ts +1 -3
  43. package/dist/overlay.js +386 -189
  44. package/dist/preact.d.cts +3 -4
  45. package/dist/preact.d.ts +3 -4
  46. package/dist/qwik-lib/index.qwik.cjs +1306 -671
  47. package/dist/qwik-lib/index.qwik.mjs +1306 -671
  48. package/dist/qwik.cjs +1326 -701
  49. package/dist/qwik.d.cts +12 -30
  50. package/dist/qwik.d.ts +12 -30
  51. package/dist/qwik.js +1326 -701
  52. package/dist/react.cjs +1373 -750
  53. package/dist/react.d.cts +26 -12
  54. package/dist/react.d.ts +26 -12
  55. package/dist/react.js +1375 -752
  56. package/dist/solid.cjs +1332 -727
  57. package/dist/solid.d.cts +13 -438
  58. package/dist/solid.d.ts +13 -438
  59. package/dist/solid.js +1334 -729
  60. package/dist/solid.source.jsx +1374 -751
  61. package/dist/styles.css +20 -6
  62. package/dist/svelte-core.cjs +1209 -676
  63. package/dist/svelte-core.js +1207 -677
  64. package/dist/svelte-src/BottomSheet.svelte +101 -58
  65. package/dist/svelte.cjs +1323 -705
  66. package/dist/svelte.d.cts +45 -25
  67. package/dist/svelte.d.ts +45 -25
  68. package/dist/svelte.js +1323 -705
  69. package/dist/vue.cjs +1354 -773
  70. package/dist/vue.d.cts +20 -3
  71. package/dist/vue.d.ts +20 -3
  72. package/dist/vue.js +1354 -773
  73. package/dist/webgl.cjs +38 -7
  74. package/dist/webgl.d.cts +0 -1
  75. package/dist/webgl.d.ts +0 -1
  76. package/dist/webgl.js +38 -7
  77. package/llms.txt +330 -0
  78. package/package.json +41 -19
  79. package/dist/transform-jVfAikE9.d.cts +0 -3
  80. package/dist/transform-jVfAikE9.d.ts +0 -3
@@ -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 opening;
313
- private promotedForOpen;
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 completeSnap;
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,15 +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 { BottomSheetCore as B, SCRIM_PRESETS as q, runAnchorTransition as x };
429
- 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, SheetMode as f, EngineOptions 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, SnapId as w };
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.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 opening;
313
- private promotedForOpen;
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 completeSnap;
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,15 +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 { BottomSheetCore as B, SCRIM_PRESETS as q, runAnchorTransition as x };
429
- 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, SheetMode as f, EngineOptions 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, SnapId as w };
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, g as EngineOptions } from './BottomSheetCore-C5tJYVMY.cjs';
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, g as EngineOptions } from './BottomSheetCore-DxSrC4QC.js';
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);