@surdeddd/bottom-sheet 0.8.0 → 0.8.2

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { d as SnapPoint, b as SheetMode, a as SnapPointDef, c as EngineOptions, f as ScrimOverlayPosition } from './BottomSheetEngine-BDGRWa2i.js';
2
- export { g as AnchorAnimationPreset, h as AnchorAnimationSpec, i as AnchorHandle, A as AnchorOptions, j as AnchorPosition, k as AnchorState, B as BottomSheetEngine, C as CloseReason, E as EngineState, P as Plugin, l as SCRIM_PRESETS, m as ScrimOverlayOptions, n as ScrimPreset, o as ScrimPresetConfig, p as ScrimStageDef, S as ScrimStagesOptions, q as ScrimUpdate, e as SheetEventMap, r as SnapId, T as TeardownScope, s as runAnchorTransition } from './BottomSheetEngine-BDGRWa2i.js';
1
+ import { d as SnapPoint, b as SheetMode, a as SnapPointDef, c as EngineOptions, f as ScrimOverlayPosition } from './BottomSheetEngine-BFTb0-4Z.js';
2
+ export { g as AnchorAnimationPreset, h as AnchorAnimationSpec, i as AnchorHandle, A as AnchorOptions, j as AnchorPosition, k as AnchorState, B as BottomSheetEngine, C as CloseReason, E as EngineState, P as Plugin, l as SCRIM_PRESETS, m as ScrimOverlayOptions, n as ScrimPreset, o as ScrimPresetConfig, p as ScrimStageDef, S as ScrimStagesOptions, q as ScrimUpdate, e as SheetEventMap, r as SnapId, T as TeardownScope, s as runAnchorTransition } from './BottomSheetEngine-BFTb0-4Z.js';
3
3
  export { OVERLAY_PRESETS, Overlay, OverlayAnimation, OverlayCloseReason, OverlayEdge, Overlay as OverlayEngine, OverlayEventMap, OverlayMountTarget, OverlayOptions, OverlayPreset, OverlayState, OverlayUpdate, SwipeToCloseConfig, createOverlay } from './overlay.js';
4
4
  import './transform-jVfAikE9.js';
5
5
 
package/dist/index.js CHANGED
@@ -2931,7 +2931,10 @@ var BottomSheetEngine = class {
2931
2931
  cs.flex = "none";
2932
2932
  if (vertical) cs.height = "auto";
2933
2933
  else cs.width = "auto";
2934
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2934
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2935
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2936
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2937
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2935
2938
  sheetStyle[axis] = prevSheet;
2936
2939
  cs.flex = prevFlex;
2937
2940
  if (vertical) cs.height = prevContent;
@@ -2943,9 +2946,21 @@ var BottomSheetEngine = class {
2943
2946
  const natural = this.measureSheetNatural(vertical);
2944
2947
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2945
2948
  if (typeof window === "undefined") return capped;
2946
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2949
+ const viewport = this.containingExtent(vertical);
2947
2950
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2948
2951
  }
2952
+ // The fit cap is the sheet's containing block, not always the window: a
2953
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2954
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2955
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2956
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2957
+ containingExtent(vertical) {
2958
+ const op = this.element.offsetParent;
2959
+ if (op && op !== document.body && op !== document.documentElement) {
2960
+ return vertical ? op.clientHeight : op.clientWidth;
2961
+ }
2962
+ return vertical ? window.innerHeight : window.innerWidth;
2963
+ }
2949
2964
  installFitObserver() {
2950
2965
  if (typeof ResizeObserver === "undefined") return;
2951
2966
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -1,4 +1,4 @@
1
- import { e as SheetEventMap } from '../BottomSheetEngine-BD1mSExI.cjs';
1
+ import { e as SheetEventMap } from '../BottomSheetEngine-7BDK2OWX.cjs';
2
2
  import '../transform-jVfAikE9.cjs';
3
3
 
4
4
  type FormikStateLike = {
@@ -1,4 +1,4 @@
1
- import { e as SheetEventMap } from '../BottomSheetEngine-BDGRWa2i.js';
1
+ import { e as SheetEventMap } from '../BottomSheetEngine-BFTb0-4Z.js';
2
2
  import '../transform-jVfAikE9.js';
3
3
 
4
4
  type FormikStateLike = {
@@ -1,4 +1,4 @@
1
- import { e as SheetEventMap } from '../BottomSheetEngine-BD1mSExI.cjs';
1
+ import { e as SheetEventMap } from '../BottomSheetEngine-7BDK2OWX.cjs';
2
2
  import '../transform-jVfAikE9.cjs';
3
3
 
4
4
  type RhfFormStateLike = {
@@ -1,4 +1,4 @@
1
- import { e as SheetEventMap } from '../BottomSheetEngine-BDGRWa2i.js';
1
+ import { e as SheetEventMap } from '../BottomSheetEngine-BFTb0-4Z.js';
2
2
  import '../transform-jVfAikE9.js';
3
3
 
4
4
  type RhfFormStateLike = {
package/dist/preact.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { BottomSheet, BottomSheetFromConfig, BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, HeaderProp, Overlay, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn, useBottomSheet, useOverlay } from './react.cjs';
2
- export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetEngine-BD1mSExI.cjs';
2
+ export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetEngine-7BDK2OWX.cjs';
3
3
  export { OverlayEdge, OverlayOptions, OverlayState } from './overlay.cjs';
4
4
  import 'react';
5
5
  import './transform-jVfAikE9.cjs';
package/dist/preact.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { BottomSheet, BottomSheetFromConfig, BottomSheetFromConfigProps, BottomSheetHandle, BottomSheetProps, HeaderProp, Overlay, OverlayHandle, OverlayProps, SheetConfig, UseBottomSheetRefs, UseBottomSheetReturn, UseOverlayReturn, useBottomSheet, useOverlay } from './react.js';
2
- export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetEngine-BDGRWa2i.js';
2
+ export { E as EngineState, b as SheetMode, d as SnapPoint, a as SnapPointDef } from './BottomSheetEngine-BFTb0-4Z.js';
3
3
  export { OverlayEdge, OverlayOptions, OverlayState } from './overlay.js';
4
4
  import 'react';
5
5
  import './transform-jVfAikE9.js';
package/dist/qwik.cjs CHANGED
@@ -2929,7 +2929,10 @@ var BottomSheetEngine = class {
2929
2929
  cs.flex = "none";
2930
2930
  if (vertical) cs.height = "auto";
2931
2931
  else cs.width = "auto";
2932
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2932
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2933
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2934
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2935
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2933
2936
  sheetStyle[axis] = prevSheet;
2934
2937
  cs.flex = prevFlex;
2935
2938
  if (vertical) cs.height = prevContent;
@@ -2941,9 +2944,21 @@ var BottomSheetEngine = class {
2941
2944
  const natural = this.measureSheetNatural(vertical);
2942
2945
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2943
2946
  if (typeof window === "undefined") return capped;
2944
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2947
+ const viewport = this.containingExtent(vertical);
2945
2948
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2946
2949
  }
2950
+ // The fit cap is the sheet's containing block, not always the window: a
2951
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2952
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2953
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2954
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2955
+ containingExtent(vertical) {
2956
+ const op = this.element.offsetParent;
2957
+ if (op && op !== document.body && op !== document.documentElement) {
2958
+ return vertical ? op.clientHeight : op.clientWidth;
2959
+ }
2960
+ return vertical ? window.innerHeight : window.innerWidth;
2961
+ }
2947
2962
  installFitObserver() {
2948
2963
  if (typeof ResizeObserver === "undefined") return;
2949
2964
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
package/dist/qwik.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _builder_io_qwik from '@builder.io/qwik';
2
2
  import { QRL } from '@builder.io/qwik';
3
- import { a as SnapPointDef, b as SheetMode, c as EngineOptions, E as EngineState } from './BottomSheetEngine-BD1mSExI.cjs';
4
- export { d as SnapPoint } from './BottomSheetEngine-BD1mSExI.cjs';
3
+ import { a as SnapPointDef, b as SheetMode, c as EngineOptions, E as EngineState } from './BottomSheetEngine-7BDK2OWX.cjs';
4
+ export { d as SnapPoint } from './BottomSheetEngine-7BDK2OWX.cjs';
5
5
  import './transform-jVfAikE9.cjs';
6
6
 
7
7
  type BottomSheetProps<TId extends string = string> = {
package/dist/qwik.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _builder_io_qwik from '@builder.io/qwik';
2
2
  import { QRL } from '@builder.io/qwik';
3
- import { a as SnapPointDef, b as SheetMode, c as EngineOptions, E as EngineState } from './BottomSheetEngine-BDGRWa2i.js';
4
- export { d as SnapPoint } from './BottomSheetEngine-BDGRWa2i.js';
3
+ import { a as SnapPointDef, b as SheetMode, c as EngineOptions, E as EngineState } from './BottomSheetEngine-BFTb0-4Z.js';
4
+ export { d as SnapPoint } from './BottomSheetEngine-BFTb0-4Z.js';
5
5
  import './transform-jVfAikE9.js';
6
6
 
7
7
  type BottomSheetProps<TId extends string = string> = {
package/dist/qwik.js CHANGED
@@ -2927,7 +2927,10 @@ var BottomSheetEngine = class {
2927
2927
  cs.flex = "none";
2928
2928
  if (vertical) cs.height = "auto";
2929
2929
  else cs.width = "auto";
2930
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2930
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2931
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2932
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2933
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2931
2934
  sheetStyle[axis] = prevSheet;
2932
2935
  cs.flex = prevFlex;
2933
2936
  if (vertical) cs.height = prevContent;
@@ -2939,9 +2942,21 @@ var BottomSheetEngine = class {
2939
2942
  const natural = this.measureSheetNatural(vertical);
2940
2943
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2941
2944
  if (typeof window === "undefined") return capped;
2942
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2945
+ const viewport = this.containingExtent(vertical);
2943
2946
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2944
2947
  }
2948
+ // The fit cap is the sheet's containing block, not always the window: a
2949
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2950
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2951
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2952
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2953
+ containingExtent(vertical) {
2954
+ const op = this.element.offsetParent;
2955
+ if (op && op !== document.body && op !== document.documentElement) {
2956
+ return vertical ? op.clientHeight : op.clientWidth;
2957
+ }
2958
+ return vertical ? window.innerHeight : window.innerWidth;
2959
+ }
2945
2960
  installFitObserver() {
2946
2961
  if (typeof ResizeObserver === "undefined") return;
2947
2962
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
package/dist/react.cjs CHANGED
@@ -2936,7 +2936,10 @@ var BottomSheetEngine = class {
2936
2936
  cs.flex = "none";
2937
2937
  if (vertical) cs.height = "auto";
2938
2938
  else cs.width = "auto";
2939
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2939
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2940
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2941
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2942
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2940
2943
  sheetStyle[axis] = prevSheet;
2941
2944
  cs.flex = prevFlex;
2942
2945
  if (vertical) cs.height = prevContent;
@@ -2948,9 +2951,21 @@ var BottomSheetEngine = class {
2948
2951
  const natural = this.measureSheetNatural(vertical);
2949
2952
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2950
2953
  if (typeof window === "undefined") return capped;
2951
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2954
+ const viewport = this.containingExtent(vertical);
2952
2955
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2953
2956
  }
2957
+ // The fit cap is the sheet's containing block, not always the window: a
2958
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2959
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2960
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2961
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2962
+ containingExtent(vertical) {
2963
+ const op = this.element.offsetParent;
2964
+ if (op && op !== document.body && op !== document.documentElement) {
2965
+ return vertical ? op.clientHeight : op.clientWidth;
2966
+ }
2967
+ return vertical ? window.innerHeight : window.innerWidth;
2968
+ }
2954
2969
  installFitObserver() {
2955
2970
  if (typeof ResizeObserver === "undefined") return;
2956
2971
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
package/dist/react.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, e as SheetEventMap, C as CloseReason, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-BD1mSExI.cjs';
2
- export { d as SnapPoint } from './BottomSheetEngine-BD1mSExI.cjs';
1
+ import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, e as SheetEventMap, C as CloseReason, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-7BDK2OWX.cjs';
2
+ export { d as SnapPoint } from './BottomSheetEngine-7BDK2OWX.cjs';
3
3
  import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.cjs';
4
4
  export { OverlayEdge } from './overlay.cjs';
5
5
  import * as react from 'react';
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, e as SheetEventMap, C as CloseReason, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-BDGRWa2i.js';
2
- export { d as SnapPoint } from './BottomSheetEngine-BDGRWa2i.js';
1
+ import { c as EngineOptions, E as EngineState, A as AnchorOptions, S as ScrimStagesOptions, p as ScrimStageDef, e as SheetEventMap, C as CloseReason, q as ScrimUpdate, m as ScrimOverlayOptions, B as BottomSheetEngine, a as SnapPointDef, b as SheetMode } from './BottomSheetEngine-BFTb0-4Z.js';
2
+ export { d as SnapPoint } from './BottomSheetEngine-BFTb0-4Z.js';
3
3
  import { OverlayOptions, OverlayState, Overlay as OverlayEngine } from './overlay.js';
4
4
  export { OverlayEdge } from './overlay.js';
5
5
  import * as react from 'react';
package/dist/react.js CHANGED
@@ -2934,7 +2934,10 @@ var BottomSheetEngine = class {
2934
2934
  cs.flex = "none";
2935
2935
  if (vertical) cs.height = "auto";
2936
2936
  else cs.width = "auto";
2937
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2937
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2938
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2939
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2940
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2938
2941
  sheetStyle[axis] = prevSheet;
2939
2942
  cs.flex = prevFlex;
2940
2943
  if (vertical) cs.height = prevContent;
@@ -2946,9 +2949,21 @@ var BottomSheetEngine = class {
2946
2949
  const natural = this.measureSheetNatural(vertical);
2947
2950
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2948
2951
  if (typeof window === "undefined") return capped;
2949
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2952
+ const viewport = this.containingExtent(vertical);
2950
2953
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2951
2954
  }
2955
+ // The fit cap is the sheet's containing block, not always the window: a
2956
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2957
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2958
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2959
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2960
+ containingExtent(vertical) {
2961
+ const op = this.element.offsetParent;
2962
+ if (op && op !== document.body && op !== document.documentElement) {
2963
+ return vertical ? op.clientHeight : op.clientWidth;
2964
+ }
2965
+ return vertical ? window.innerHeight : window.innerWidth;
2966
+ }
2952
2967
  installFitObserver() {
2953
2968
  if (typeof ResizeObserver === "undefined") return;
2954
2969
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
package/dist/solid.cjs CHANGED
@@ -2929,7 +2929,10 @@ var BottomSheetEngine = class {
2929
2929
  cs.flex = "none";
2930
2930
  if (vertical) cs.height = "auto";
2931
2931
  else cs.width = "auto";
2932
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2932
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2933
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2934
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2935
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2933
2936
  sheetStyle[axis] = prevSheet;
2934
2937
  cs.flex = prevFlex;
2935
2938
  if (vertical) cs.height = prevContent;
@@ -2941,9 +2944,21 @@ var BottomSheetEngine = class {
2941
2944
  const natural = this.measureSheetNatural(vertical);
2942
2945
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2943
2946
  if (typeof window === "undefined") return capped;
2944
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2947
+ const viewport = this.containingExtent(vertical);
2945
2948
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2946
2949
  }
2950
+ // The fit cap is the sheet's containing block, not always the window: a
2951
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2952
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2953
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2954
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2955
+ containingExtent(vertical) {
2956
+ const op = this.element.offsetParent;
2957
+ if (op && op !== document.body && op !== document.documentElement) {
2958
+ return vertical ? op.clientHeight : op.clientWidth;
2959
+ }
2960
+ return vertical ? window.innerHeight : window.innerWidth;
2961
+ }
2947
2962
  installFitObserver() {
2948
2963
  if (typeof ResizeObserver === "undefined") return;
2949
2964
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
package/dist/solid.d.cts CHANGED
@@ -277,6 +277,7 @@ declare class BottomSheetEngine {
277
277
  private contentTargets;
278
278
  private measureSheetNatural;
279
279
  private measureFitSize;
280
+ private containingExtent;
280
281
  private installFitObserver;
281
282
  destroy(): void;
282
283
  private emit;
package/dist/solid.d.ts CHANGED
@@ -277,6 +277,7 @@ declare class BottomSheetEngine {
277
277
  private contentTargets;
278
278
  private measureSheetNatural;
279
279
  private measureFitSize;
280
+ private containingExtent;
280
281
  private installFitObserver;
281
282
  destroy(): void;
282
283
  private emit;
package/dist/solid.js CHANGED
@@ -2927,7 +2927,10 @@ var BottomSheetEngine = class {
2927
2927
  cs.flex = "none";
2928
2928
  if (vertical) cs.height = "auto";
2929
2929
  else cs.width = "auto";
2930
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2930
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2931
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2932
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2933
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2931
2934
  sheetStyle[axis] = prevSheet;
2932
2935
  cs.flex = prevFlex;
2933
2936
  if (vertical) cs.height = prevContent;
@@ -2939,9 +2942,21 @@ var BottomSheetEngine = class {
2939
2942
  const natural = this.measureSheetNatural(vertical);
2940
2943
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2941
2944
  if (typeof window === "undefined") return capped;
2942
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2945
+ const viewport = this.containingExtent(vertical);
2943
2946
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2944
2947
  }
2948
+ // The fit cap is the sheet's containing block, not always the window: a
2949
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2950
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2951
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2952
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2953
+ containingExtent(vertical) {
2954
+ const op = this.element.offsetParent;
2955
+ if (op && op !== document.body && op !== document.documentElement) {
2956
+ return vertical ? op.clientHeight : op.clientWidth;
2957
+ }
2958
+ return vertical ? window.innerHeight : window.innerWidth;
2959
+ }
2945
2960
  installFitObserver() {
2946
2961
  if (typeof ResizeObserver === "undefined") return;
2947
2962
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -2929,7 +2929,10 @@ var BottomSheetEngine = class {
2929
2929
  cs.flex = "none";
2930
2930
  if (vertical) cs.height = "auto";
2931
2931
  else cs.width = "auto";
2932
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2932
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2933
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2934
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2935
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2933
2936
  sheetStyle[axis] = prevSheet;
2934
2937
  cs.flex = prevFlex;
2935
2938
  if (vertical) cs.height = prevContent;
@@ -2941,9 +2944,21 @@ var BottomSheetEngine = class {
2941
2944
  const natural = this.measureSheetNatural(vertical);
2942
2945
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2943
2946
  if (typeof window === "undefined") return capped;
2944
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2947
+ const viewport = this.containingExtent(vertical);
2945
2948
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2946
2949
  }
2950
+ // The fit cap is the sheet's containing block, not always the window: a
2951
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2952
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2953
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2954
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2955
+ containingExtent(vertical) {
2956
+ const op = this.element.offsetParent;
2957
+ if (op && op !== document.body && op !== document.documentElement) {
2958
+ return vertical ? op.clientHeight : op.clientWidth;
2959
+ }
2960
+ return vertical ? window.innerHeight : window.innerWidth;
2961
+ }
2947
2962
  installFitObserver() {
2948
2963
  if (typeof ResizeObserver === "undefined") return;
2949
2964
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -2928,7 +2928,10 @@ var BottomSheetEngine = class {
2928
2928
  cs.flex = "none";
2929
2929
  if (vertical) cs.height = "auto";
2930
2930
  else cs.width = "auto";
2931
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2931
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2932
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2933
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2934
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2932
2935
  sheetStyle[axis] = prevSheet;
2933
2936
  cs.flex = prevFlex;
2934
2937
  if (vertical) cs.height = prevContent;
@@ -2940,9 +2943,21 @@ var BottomSheetEngine = class {
2940
2943
  const natural = this.measureSheetNatural(vertical);
2941
2944
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2942
2945
  if (typeof window === "undefined") return capped;
2943
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2946
+ const viewport = this.containingExtent(vertical);
2944
2947
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2945
2948
  }
2949
+ // The fit cap is the sheet's containing block, not always the window: a
2950
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2951
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2952
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2953
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2954
+ containingExtent(vertical) {
2955
+ const op = this.element.offsetParent;
2956
+ if (op && op !== document.body && op !== document.documentElement) {
2957
+ return vertical ? op.clientHeight : op.clientWidth;
2958
+ }
2959
+ return vertical ? window.innerHeight : window.innerWidth;
2960
+ }
2946
2961
  installFitObserver() {
2947
2962
  if (typeof ResizeObserver === "undefined") return;
2948
2963
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -2926,7 +2926,10 @@ var BottomSheetEngine = class {
2926
2926
  cs.flex = "none";
2927
2927
  if (vertical) cs.height = "auto";
2928
2928
  else cs.width = "auto";
2929
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2929
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2930
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2931
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2932
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2930
2933
  sheetStyle[axis] = prevSheet;
2931
2934
  cs.flex = prevFlex;
2932
2935
  if (vertical) cs.height = prevContent;
@@ -2938,9 +2941,21 @@ var BottomSheetEngine = class {
2938
2941
  const natural = this.measureSheetNatural(vertical);
2939
2942
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2940
2943
  if (typeof window === "undefined") return capped;
2941
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2944
+ const viewport = this.containingExtent(vertical);
2942
2945
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2943
2946
  }
2947
+ // The fit cap is the sheet's containing block, not always the window: a
2948
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2949
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2950
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2951
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2952
+ containingExtent(vertical) {
2953
+ const op = this.element.offsetParent;
2954
+ if (op && op !== document.body && op !== document.documentElement) {
2955
+ return vertical ? op.clientHeight : op.clientWidth;
2956
+ }
2957
+ return vertical ? window.innerHeight : window.innerWidth;
2958
+ }
2944
2959
  installFitObserver() {
2945
2960
  if (typeof ResizeObserver === "undefined") return;
2946
2961
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -276,6 +276,9 @@
276
276
  tabindex="0"
277
277
  aria-label="Resize sheet"
278
278
  aria-orientation={isVerticalAxis ? "vertical" : "horizontal"}
279
+ aria-valuemin="0"
280
+ aria-valuemax="0"
281
+ aria-valuenow="0"
279
282
  ></div>
280
283
  {#if header}<div class="bs-header">{@render header(viewState)}</div>{/if}
281
284
  <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
package/dist/svelte.cjs CHANGED
@@ -2950,7 +2950,10 @@ var BottomSheetEngine = class {
2950
2950
  cs.flex = "none";
2951
2951
  if (vertical) cs.height = "auto";
2952
2952
  else cs.width = "auto";
2953
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2953
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2954
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2955
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2956
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2954
2957
  sheetStyle[axis] = prevSheet;
2955
2958
  cs.flex = prevFlex;
2956
2959
  if (vertical) cs.height = prevContent;
@@ -2962,9 +2965,21 @@ var BottomSheetEngine = class {
2962
2965
  const natural = this.measureSheetNatural(vertical);
2963
2966
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2964
2967
  if (typeof window === "undefined") return capped;
2965
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2968
+ const viewport = this.containingExtent(vertical);
2966
2969
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2967
2970
  }
2971
+ // The fit cap is the sheet's containing block, not always the window: a
2972
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2973
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2974
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2975
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2976
+ containingExtent(vertical) {
2977
+ const op = this.element.offsetParent;
2978
+ if (op && op !== document.body && op !== document.documentElement) {
2979
+ return vertical ? op.clientHeight : op.clientWidth;
2980
+ }
2981
+ return vertical ? window.innerHeight : window.innerWidth;
2982
+ }
2968
2983
  installFitObserver() {
2969
2984
  if (typeof ResizeObserver === "undefined") return;
2970
2985
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -3577,7 +3592,7 @@ var root_3 = $2__namespace.from_html(`<div class="bs-header"><!></div>`);
3577
3592
  var root_5 = $2__namespace.from_html(`<div class="bs-footer"><!></div>`);
3578
3593
  var root_6 = $2__namespace.from_html(`<div class="bs-button-slot" data-side="left"><!></div>`);
3579
3594
  var root_7 = $2__namespace.from_html(`<div class="bs-button-slot" data-side="right"><!></div>`);
3580
- var root = $2__namespace.from_html(`<div class="bs-root"><!> <div class="bs-screen"><!></div> <section class="bs-sheet" role="dialog"><div class="bs-handle" role="slider" tabindex="0" aria-label="Resize sheet"></div> <!> <div class="bs-content" tabindex="0" role="region" aria-label="Sheet content"><!></div> <!> <span class="bs-sr-only" role="status" aria-live="polite"> </span></section> <!> <!></div>`);
3595
+ var root = $2__namespace.from_html(`<div class="bs-root"><!> <div class="bs-screen"><!></div> <section class="bs-sheet" role="dialog"><div class="bs-handle" role="slider" tabindex="0" aria-label="Resize sheet" aria-valuemin="0" aria-valuemax="0" aria-valuenow="0"></div> <!> <div class="bs-content" tabindex="0" role="region" aria-label="Sheet content"><!></div> <!> <span class="bs-sr-only" role="status" aria-live="polite"> </span></section> <!> <!></div>`);
3581
3596
  function BottomSheet($$anchor, $$props) {
3582
3597
  $2__namespace.push($$props, true);
3583
3598
  let mode = $2__namespace.prop($$props, "mode", 3, "bottom"), animation = $2__namespace.prop($$props, "animation", 3, "spring"), focusTrap = $2__namespace.prop($$props, "focusTrap", 3, false), closeOnEscape = $2__namespace.prop($$props, "closeOnEscape", 3, true), closeOnBack = $2__namespace.prop($$props, "closeOnBack", 3, false), lockBodyScroll2 = $2__namespace.prop($$props, "lockBodyScroll", 3, true), rubberBand2 = $2__namespace.prop($$props, "rubberBand", 3, true), backdrop = $2__namespace.prop($$props, "backdrop", 3, true), closeOnBackdrop = $2__namespace.prop($$props, "closeOnBackdrop", 3, true), persistent = $2__namespace.prop($$props, "persistent", 3, false), disableClose = $2__namespace.prop($$props, "disableClose", 3, false), disableDrag = $2__namespace.prop($$props, "disableDrag", 3, false), closeOnRouteChange = $2__namespace.prop($$props, "closeOnRouteChange", 3, false), openProp = $2__namespace.prop($$props, "open", 15), snap = $2__namespace.prop($$props, "snap", 15), ariaLabel = $2__namespace.prop($$props, "ariaLabel", 3, "Bottom sheet");
package/dist/svelte.js CHANGED
@@ -2928,7 +2928,10 @@ var BottomSheetEngine = class {
2928
2928
  cs.flex = "none";
2929
2929
  if (vertical) cs.height = "auto";
2930
2930
  else cs.width = "auto";
2931
- const natural = vertical ? el.offsetHeight : el.offsetWidth;
2931
+ const poked = vertical ? el.offsetHeight : el.offsetWidth;
2932
+ const contentBox = vertical ? content.clientHeight : content.clientWidth;
2933
+ const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
2934
+ const natural = Math.max(poked, poked - contentBox + contentScroll);
2932
2935
  sheetStyle[axis] = prevSheet;
2933
2936
  cs.flex = prevFlex;
2934
2937
  if (vertical) cs.height = prevContent;
@@ -2940,9 +2943,21 @@ var BottomSheetEngine = class {
2940
2943
  const natural = this.measureSheetNatural(vertical);
2941
2944
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2942
2945
  if (typeof window === "undefined") return capped;
2943
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2946
+ const viewport = this.containingExtent(vertical);
2944
2947
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2945
2948
  }
2949
+ // The fit cap is the sheet's containing block, not always the window: a
2950
+ // position:fixed sheet nested under a transform/filter/will-change ancestor
2951
+ // is clipped to that ancestor, so capping by window.innerHeight oversizes the
2952
+ // sheet and the content/footer get clipped. offsetParent resolves to that
2953
+ // ancestor when present, and is null (→ viewport) for a plain fixed sheet.
2954
+ containingExtent(vertical) {
2955
+ const op = this.element.offsetParent;
2956
+ if (op && op !== document.body && op !== document.documentElement) {
2957
+ return vertical ? op.clientHeight : op.clientWidth;
2958
+ }
2959
+ return vertical ? window.innerHeight : window.innerWidth;
2960
+ }
2946
2961
  installFitObserver() {
2947
2962
  if (typeof ResizeObserver === "undefined") return;
2948
2963
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -3555,7 +3570,7 @@ var root_3 = $2.from_html(`<div class="bs-header"><!></div>`);
3555
3570
  var root_5 = $2.from_html(`<div class="bs-footer"><!></div>`);
3556
3571
  var root_6 = $2.from_html(`<div class="bs-button-slot" data-side="left"><!></div>`);
3557
3572
  var root_7 = $2.from_html(`<div class="bs-button-slot" data-side="right"><!></div>`);
3558
- var root = $2.from_html(`<div class="bs-root"><!> <div class="bs-screen"><!></div> <section class="bs-sheet" role="dialog"><div class="bs-handle" role="slider" tabindex="0" aria-label="Resize sheet"></div> <!> <div class="bs-content" tabindex="0" role="region" aria-label="Sheet content"><!></div> <!> <span class="bs-sr-only" role="status" aria-live="polite"> </span></section> <!> <!></div>`);
3573
+ var root = $2.from_html(`<div class="bs-root"><!> <div class="bs-screen"><!></div> <section class="bs-sheet" role="dialog"><div class="bs-handle" role="slider" tabindex="0" aria-label="Resize sheet" aria-valuemin="0" aria-valuemax="0" aria-valuenow="0"></div> <!> <div class="bs-content" tabindex="0" role="region" aria-label="Sheet content"><!></div> <!> <span class="bs-sr-only" role="status" aria-live="polite"> </span></section> <!> <!></div>`);
3559
3574
  function BottomSheet($$anchor, $$props) {
3560
3575
  $2.push($$props, true);
3561
3576
  let mode = $2.prop($$props, "mode", 3, "bottom"), animation = $2.prop($$props, "animation", 3, "spring"), focusTrap = $2.prop($$props, "focusTrap", 3, false), closeOnEscape = $2.prop($$props, "closeOnEscape", 3, true), closeOnBack = $2.prop($$props, "closeOnBack", 3, false), lockBodyScroll2 = $2.prop($$props, "lockBodyScroll", 3, true), rubberBand2 = $2.prop($$props, "rubberBand", 3, true), backdrop = $2.prop($$props, "backdrop", 3, true), closeOnBackdrop = $2.prop($$props, "closeOnBackdrop", 3, true), persistent = $2.prop($$props, "persistent", 3, false), disableClose = $2.prop($$props, "disableClose", 3, false), disableDrag = $2.prop($$props, "disableDrag", 3, false), closeOnRouteChange = $2.prop($$props, "closeOnRouteChange", 3, false), openProp = $2.prop($$props, "open", 15), snap = $2.prop($$props, "snap", 15), ariaLabel = $2.prop($$props, "ariaLabel", 3, "Bottom sheet");