@surdeddd/bottom-sheet 0.7.0 → 0.8.1

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.
@@ -2359,6 +2359,7 @@ var BottomSheetEngine = class {
2359
2359
  __publicField(this, "progressWriteSentinel", new WriteSentinel());
2360
2360
  __publicField(this, "isTopSheet", true);
2361
2361
  __publicField(this, "opening", false);
2362
+ __publicField(this, "allowOvershoot", false);
2362
2363
  __publicField(this, "progressPayload", {
2363
2364
  value: 0,
2364
2365
  size: 0
@@ -2911,45 +2912,52 @@ var BottomSheetEngine = class {
2911
2912
  }
2912
2913
  return out;
2913
2914
  }
2914
- measureContentExtent(vertical) {
2915
+ measureSheetNatural(vertical) {
2916
+ const el = this.element;
2915
2917
  const content = this.scrollContainer;
2916
- if (!content) return 0;
2917
- const targets = this.contentTargets();
2918
- if (targets.length === 0) {
2919
- return vertical ? content.scrollHeight : content.scrollWidth;
2920
- }
2921
- let min = Infinity;
2922
- let max = -Infinity;
2923
- for (const el of targets) {
2924
- const r = el.getBoundingClientRect();
2925
- if (vertical) {
2926
- if (r.top < min) min = r.top;
2927
- if (r.bottom > max) max = r.bottom;
2928
- } else {
2929
- if (r.left < min) min = r.left;
2930
- if (r.right > max) max = r.right;
2931
- }
2932
- }
2933
- if (!isFinite(min) || !isFinite(max) || max <= min) {
2934
- return vertical ? content.scrollHeight : content.scrollWidth;
2935
- }
2936
- let pad = 0;
2937
- if (typeof getComputedStyle !== "undefined") {
2938
- const cs = getComputedStyle(content);
2939
- pad = vertical ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : (parseFloat(cs.paddingLeft) || 0) + (parseFloat(cs.paddingRight) || 0);
2940
- }
2941
- return max - min + pad;
2918
+ if (!content) {
2919
+ return vertical ? el.offsetHeight : el.offsetWidth;
2920
+ }
2921
+ const axis = vertical ? "height" : "width";
2922
+ const sheetStyle = el.style;
2923
+ const cs = content.style;
2924
+ const prevSheet = sheetStyle[axis];
2925
+ const prevFlex = cs.flex;
2926
+ const prevContent = vertical ? cs.height : cs.width;
2927
+ sheetStyle[axis] = "auto";
2928
+ cs.flex = "none";
2929
+ if (vertical) cs.height = "auto";
2930
+ else cs.width = "auto";
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);
2935
+ sheetStyle[axis] = prevSheet;
2936
+ cs.flex = prevFlex;
2937
+ if (vertical) cs.height = prevContent;
2938
+ else cs.width = prevContent;
2939
+ return natural;
2942
2940
  }
2943
2941
  measureFitSize() {
2944
2942
  const vertical = layoutAxis(this.mode) === "height";
2945
- const handleSize = vertical ? this.handle.offsetHeight : this.handle.offsetWidth;
2946
- const content = this.scrollContainer;
2947
- const natural = content ? handleSize + this.measureContentExtent(vertical) : handleSize;
2943
+ const natural = this.measureSheetNatural(vertical);
2948
2944
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2949
2945
  if (typeof window === "undefined") return capped;
2950
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2946
+ const viewport = this.containingExtent(vertical);
2951
2947
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2952
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
+ }
2953
2961
  installFitObserver() {
2954
2962
  if (typeof ResizeObserver === "undefined") return;
2955
2963
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -3030,6 +3038,10 @@ var BottomSheetEngine = class {
3030
3038
  this.backdrop.style.opacity = "";
3031
3039
  this.backdrop.style.pointerEvents = "";
3032
3040
  }
3041
+ if (this.anchorHost) {
3042
+ this.anchorHost.style.removeProperty("--bs-size");
3043
+ this.anchorHost.style.removeProperty("--bs-progress");
3044
+ }
3033
3045
  if (this.screenComponent) {
3034
3046
  this.screenComponent.style.opacity = "";
3035
3047
  this.screenComponent.style.display = "";
@@ -3041,6 +3053,7 @@ var BottomSheetEngine = class {
3041
3053
  this.bus.emit(event, payload);
3042
3054
  }
3043
3055
  newCycle() {
3056
+ this.allowOvershoot = false;
3044
3057
  this.currentAbort.abort();
3045
3058
  this.currentAbort = new AbortController();
3046
3059
  return this.currentAbort.signal;
@@ -3106,6 +3119,7 @@ var BottomSheetEngine = class {
3106
3119
  seen.add(p.id);
3107
3120
  }
3108
3121
  this.snaps.setRaw(this.snapPointsRaw);
3122
+ this.clampToMaxHeight();
3109
3123
  this.scrim.invalidateOpacityCache();
3110
3124
  }
3111
3125
  getAllowedRange() {
@@ -3312,9 +3326,13 @@ var BottomSheetEngine = class {
3312
3326
  this.opening = true;
3313
3327
  sheetStack.promote(this.id);
3314
3328
  }
3315
- void this.animation.animateTo(target.size, velocity).then(() => {
3316
- this.opening = false;
3329
+ const settleCap = this.snaps.getMaxAxisSize();
3330
+ const settleSize = settleCap > 0 ? Math.min(target.size, settleCap) : target.size;
3331
+ this.allowOvershoot = true;
3332
+ void this.animation.animateTo(settleSize, velocity).then(() => {
3317
3333
  if (signal.aborted) return;
3334
+ this.allowOvershoot = false;
3335
+ this.opening = false;
3318
3336
  this.scrollCache.restore(target.id, previousSize, target.size);
3319
3337
  this.updateAriaSlider();
3320
3338
  this.emit("snap", {
@@ -3346,7 +3364,7 @@ var BottomSheetEngine = class {
3346
3364
  }
3347
3365
  applySize(size) {
3348
3366
  const cap = this.snaps.getMaxAxisSize();
3349
- const clamped = cap > 0 && size > cap && !this.gesture?.isDragging ? cap : size;
3367
+ const clamped = cap > 0 && size > cap && !this.gesture?.isDragging && !this.allowOvershoot ? cap : size;
3350
3368
  this.size = clamped;
3351
3369
  const offset = cap - clamped;
3352
3370
  const style = this.element.style;
@@ -2357,6 +2357,7 @@ var BottomSheetEngine = class {
2357
2357
  __publicField(this, "progressWriteSentinel", new WriteSentinel());
2358
2358
  __publicField(this, "isTopSheet", true);
2359
2359
  __publicField(this, "opening", false);
2360
+ __publicField(this, "allowOvershoot", false);
2360
2361
  __publicField(this, "progressPayload", {
2361
2362
  value: 0,
2362
2363
  size: 0
@@ -2909,45 +2910,52 @@ var BottomSheetEngine = class {
2909
2910
  }
2910
2911
  return out;
2911
2912
  }
2912
- measureContentExtent(vertical) {
2913
+ measureSheetNatural(vertical) {
2914
+ const el = this.element;
2913
2915
  const content = this.scrollContainer;
2914
- if (!content) return 0;
2915
- const targets = this.contentTargets();
2916
- if (targets.length === 0) {
2917
- return vertical ? content.scrollHeight : content.scrollWidth;
2918
- }
2919
- let min = Infinity;
2920
- let max = -Infinity;
2921
- for (const el of targets) {
2922
- const r = el.getBoundingClientRect();
2923
- if (vertical) {
2924
- if (r.top < min) min = r.top;
2925
- if (r.bottom > max) max = r.bottom;
2926
- } else {
2927
- if (r.left < min) min = r.left;
2928
- if (r.right > max) max = r.right;
2929
- }
2930
- }
2931
- if (!isFinite(min) || !isFinite(max) || max <= min) {
2932
- return vertical ? content.scrollHeight : content.scrollWidth;
2933
- }
2934
- let pad = 0;
2935
- if (typeof getComputedStyle !== "undefined") {
2936
- const cs = getComputedStyle(content);
2937
- pad = vertical ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : (parseFloat(cs.paddingLeft) || 0) + (parseFloat(cs.paddingRight) || 0);
2938
- }
2939
- return max - min + pad;
2916
+ if (!content) {
2917
+ return vertical ? el.offsetHeight : el.offsetWidth;
2918
+ }
2919
+ const axis = vertical ? "height" : "width";
2920
+ const sheetStyle = el.style;
2921
+ const cs = content.style;
2922
+ const prevSheet = sheetStyle[axis];
2923
+ const prevFlex = cs.flex;
2924
+ const prevContent = vertical ? cs.height : cs.width;
2925
+ sheetStyle[axis] = "auto";
2926
+ cs.flex = "none";
2927
+ if (vertical) cs.height = "auto";
2928
+ else cs.width = "auto";
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);
2933
+ sheetStyle[axis] = prevSheet;
2934
+ cs.flex = prevFlex;
2935
+ if (vertical) cs.height = prevContent;
2936
+ else cs.width = prevContent;
2937
+ return natural;
2940
2938
  }
2941
2939
  measureFitSize() {
2942
2940
  const vertical = layoutAxis(this.mode) === "height";
2943
- const handleSize = vertical ? this.handle.offsetHeight : this.handle.offsetWidth;
2944
- const content = this.scrollContainer;
2945
- const natural = content ? handleSize + this.measureContentExtent(vertical) : handleSize;
2941
+ const natural = this.measureSheetNatural(vertical);
2946
2942
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2947
2943
  if (typeof window === "undefined") return capped;
2948
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2944
+ const viewport = this.containingExtent(vertical);
2949
2945
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2950
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
+ }
2951
2959
  installFitObserver() {
2952
2960
  if (typeof ResizeObserver === "undefined") return;
2953
2961
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -3028,6 +3036,10 @@ var BottomSheetEngine = class {
3028
3036
  this.backdrop.style.opacity = "";
3029
3037
  this.backdrop.style.pointerEvents = "";
3030
3038
  }
3039
+ if (this.anchorHost) {
3040
+ this.anchorHost.style.removeProperty("--bs-size");
3041
+ this.anchorHost.style.removeProperty("--bs-progress");
3042
+ }
3031
3043
  if (this.screenComponent) {
3032
3044
  this.screenComponent.style.opacity = "";
3033
3045
  this.screenComponent.style.display = "";
@@ -3039,6 +3051,7 @@ var BottomSheetEngine = class {
3039
3051
  this.bus.emit(event, payload);
3040
3052
  }
3041
3053
  newCycle() {
3054
+ this.allowOvershoot = false;
3042
3055
  this.currentAbort.abort();
3043
3056
  this.currentAbort = new AbortController();
3044
3057
  return this.currentAbort.signal;
@@ -3104,6 +3117,7 @@ var BottomSheetEngine = class {
3104
3117
  seen.add(p.id);
3105
3118
  }
3106
3119
  this.snaps.setRaw(this.snapPointsRaw);
3120
+ this.clampToMaxHeight();
3107
3121
  this.scrim.invalidateOpacityCache();
3108
3122
  }
3109
3123
  getAllowedRange() {
@@ -3310,9 +3324,13 @@ var BottomSheetEngine = class {
3310
3324
  this.opening = true;
3311
3325
  sheetStack.promote(this.id);
3312
3326
  }
3313
- void this.animation.animateTo(target.size, velocity).then(() => {
3314
- this.opening = false;
3327
+ const settleCap = this.snaps.getMaxAxisSize();
3328
+ const settleSize = settleCap > 0 ? Math.min(target.size, settleCap) : target.size;
3329
+ this.allowOvershoot = true;
3330
+ void this.animation.animateTo(settleSize, velocity).then(() => {
3315
3331
  if (signal.aborted) return;
3332
+ this.allowOvershoot = false;
3333
+ this.opening = false;
3316
3334
  this.scrollCache.restore(target.id, previousSize, target.size);
3317
3335
  this.updateAriaSlider();
3318
3336
  this.emit("snap", {
@@ -3344,7 +3362,7 @@ var BottomSheetEngine = class {
3344
3362
  }
3345
3363
  applySize(size) {
3346
3364
  const cap = this.snaps.getMaxAxisSize();
3347
- const clamped = cap > 0 && size > cap && !this.gesture?.isDragging ? cap : size;
3365
+ const clamped = cap > 0 && size > cap && !this.gesture?.isDragging && !this.allowOvershoot ? cap : size;
3348
3366
  this.size = clamped;
3349
3367
  const offset = cap - clamped;
3350
3368
  const style = this.element.style;
@@ -238,12 +238,6 @@
238
238
  else if (!next && isOpen) void engine.close();
239
239
  });
240
240
 
241
- let allowedIds = $derived(
242
- allowed && allowed.length > 0
243
- ? allowed
244
- : snapPoints.map(s => s.id),
245
- );
246
- let activeIdx = $derived(allowedIds.indexOf(viewState.activeId));
247
241
  let isVerticalAxis = $derived(mode === "bottom" || mode === "top");
248
242
  </script>
249
243
 
@@ -282,10 +276,9 @@
282
276
  tabindex="0"
283
277
  aria-label="Resize sheet"
284
278
  aria-orientation={isVerticalAxis ? "vertical" : "horizontal"}
285
- aria-valuemin={0}
286
- aria-valuemax={Math.max(0, allowedIds.length - 1)}
287
- aria-valuenow={Math.max(0, activeIdx)}
288
- aria-valuetext={viewState.activeId}
279
+ aria-valuemin="0"
280
+ aria-valuemax="0"
281
+ aria-valuenow="0"
289
282
  ></div>
290
283
  {#if header}<div class="bs-header">{@render header(viewState)}</div>{/if}
291
284
  <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
package/dist/svelte.cjs CHANGED
@@ -2381,6 +2381,7 @@ var BottomSheetEngine = class {
2381
2381
  __publicField(this, "progressWriteSentinel", new WriteSentinel());
2382
2382
  __publicField(this, "isTopSheet", true);
2383
2383
  __publicField(this, "opening", false);
2384
+ __publicField(this, "allowOvershoot", false);
2384
2385
  __publicField(this, "progressPayload", {
2385
2386
  value: 0,
2386
2387
  size: 0
@@ -2933,45 +2934,52 @@ var BottomSheetEngine = class {
2933
2934
  }
2934
2935
  return out;
2935
2936
  }
2936
- measureContentExtent(vertical) {
2937
+ measureSheetNatural(vertical) {
2938
+ const el = this.element;
2937
2939
  const content = this.scrollContainer;
2938
- if (!content) return 0;
2939
- const targets = this.contentTargets();
2940
- if (targets.length === 0) {
2941
- return vertical ? content.scrollHeight : content.scrollWidth;
2942
- }
2943
- let min = Infinity;
2944
- let max = -Infinity;
2945
- for (const el of targets) {
2946
- const r = el.getBoundingClientRect();
2947
- if (vertical) {
2948
- if (r.top < min) min = r.top;
2949
- if (r.bottom > max) max = r.bottom;
2950
- } else {
2951
- if (r.left < min) min = r.left;
2952
- if (r.right > max) max = r.right;
2953
- }
2954
- }
2955
- if (!isFinite(min) || !isFinite(max) || max <= min) {
2956
- return vertical ? content.scrollHeight : content.scrollWidth;
2957
- }
2958
- let pad = 0;
2959
- if (typeof getComputedStyle !== "undefined") {
2960
- const cs = getComputedStyle(content);
2961
- pad = vertical ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : (parseFloat(cs.paddingLeft) || 0) + (parseFloat(cs.paddingRight) || 0);
2962
- }
2963
- return max - min + pad;
2940
+ if (!content) {
2941
+ return vertical ? el.offsetHeight : el.offsetWidth;
2942
+ }
2943
+ const axis = vertical ? "height" : "width";
2944
+ const sheetStyle = el.style;
2945
+ const cs = content.style;
2946
+ const prevSheet = sheetStyle[axis];
2947
+ const prevFlex = cs.flex;
2948
+ const prevContent = vertical ? cs.height : cs.width;
2949
+ sheetStyle[axis] = "auto";
2950
+ cs.flex = "none";
2951
+ if (vertical) cs.height = "auto";
2952
+ else cs.width = "auto";
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);
2957
+ sheetStyle[axis] = prevSheet;
2958
+ cs.flex = prevFlex;
2959
+ if (vertical) cs.height = prevContent;
2960
+ else cs.width = prevContent;
2961
+ return natural;
2964
2962
  }
2965
2963
  measureFitSize() {
2966
2964
  const vertical = layoutAxis(this.mode) === "height";
2967
- const handleSize = vertical ? this.handle.offsetHeight : this.handle.offsetWidth;
2968
- const content = this.scrollContainer;
2969
- const natural = content ? handleSize + this.measureContentExtent(vertical) : handleSize;
2965
+ const natural = this.measureSheetNatural(vertical);
2970
2966
  const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
2971
2967
  if (typeof window === "undefined") return capped;
2972
- const viewport = vertical ? window.innerHeight : window.innerWidth;
2968
+ const viewport = this.containingExtent(vertical);
2973
2969
  return viewport > 0 ? Math.min(capped, viewport) : capped;
2974
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
+ }
2975
2983
  installFitObserver() {
2976
2984
  if (typeof ResizeObserver === "undefined") return;
2977
2985
  if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
@@ -3052,6 +3060,10 @@ var BottomSheetEngine = class {
3052
3060
  this.backdrop.style.opacity = "";
3053
3061
  this.backdrop.style.pointerEvents = "";
3054
3062
  }
3063
+ if (this.anchorHost) {
3064
+ this.anchorHost.style.removeProperty("--bs-size");
3065
+ this.anchorHost.style.removeProperty("--bs-progress");
3066
+ }
3055
3067
  if (this.screenComponent) {
3056
3068
  this.screenComponent.style.opacity = "";
3057
3069
  this.screenComponent.style.display = "";
@@ -3063,6 +3075,7 @@ var BottomSheetEngine = class {
3063
3075
  this.bus.emit(event, payload);
3064
3076
  }
3065
3077
  newCycle() {
3078
+ this.allowOvershoot = false;
3066
3079
  this.currentAbort.abort();
3067
3080
  this.currentAbort = new AbortController();
3068
3081
  return this.currentAbort.signal;
@@ -3128,6 +3141,7 @@ var BottomSheetEngine = class {
3128
3141
  seen.add(p.id);
3129
3142
  }
3130
3143
  this.snaps.setRaw(this.snapPointsRaw);
3144
+ this.clampToMaxHeight();
3131
3145
  this.scrim.invalidateOpacityCache();
3132
3146
  }
3133
3147
  getAllowedRange() {
@@ -3334,9 +3348,13 @@ var BottomSheetEngine = class {
3334
3348
  this.opening = true;
3335
3349
  sheetStack.promote(this.id);
3336
3350
  }
3337
- void this.animation.animateTo(target.size, velocity).then(() => {
3338
- this.opening = false;
3351
+ const settleCap = this.snaps.getMaxAxisSize();
3352
+ const settleSize = settleCap > 0 ? Math.min(target.size, settleCap) : target.size;
3353
+ this.allowOvershoot = true;
3354
+ void this.animation.animateTo(settleSize, velocity).then(() => {
3339
3355
  if (signal.aborted) return;
3356
+ this.allowOvershoot = false;
3357
+ this.opening = false;
3340
3358
  this.scrollCache.restore(target.id, previousSize, target.size);
3341
3359
  this.updateAriaSlider();
3342
3360
  this.emit("snap", {
@@ -3368,7 +3386,7 @@ var BottomSheetEngine = class {
3368
3386
  }
3369
3387
  applySize(size) {
3370
3388
  const cap = this.snaps.getMaxAxisSize();
3371
- const clamped = cap > 0 && size > cap && !this.gesture?.isDragging ? cap : size;
3389
+ const clamped = cap > 0 && size > cap && !this.gesture?.isDragging && !this.allowOvershoot ? cap : size;
3372
3390
  this.size = clamped;
3373
3391
  const offset = cap - clamped;
3374
3392
  const style = this.element.style;
@@ -3574,7 +3592,7 @@ var root_3 = $2__namespace.from_html(`<div class="bs-header"><!></div>`);
3574
3592
  var root_5 = $2__namespace.from_html(`<div class="bs-footer"><!></div>`);
3575
3593
  var root_6 = $2__namespace.from_html(`<div class="bs-button-slot" data-side="left"><!></div>`);
3576
3594
  var root_7 = $2__namespace.from_html(`<div class="bs-button-slot" data-side="right"><!></div>`);
3577
- 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>`);
3578
3596
  function BottomSheet($$anchor, $$props) {
3579
3597
  $2__namespace.push($$props, true);
3580
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");
@@ -3699,8 +3717,6 @@ function BottomSheet($$anchor, $$props) {
3699
3717
  if (next && !isOpen) void engine.open();
3700
3718
  else if (!next && isOpen) void engine.close();
3701
3719
  });
3702
- let allowedIds = $2__namespace.derived(() => $$props.allowed && $$props.allowed.length > 0 ? $$props.allowed : $$props.snapPoints.map((s) => s.id));
3703
- let activeIdx = $2__namespace.derived(() => $2__namespace.get(allowedIds).indexOf($2__namespace.get(viewState).activeId));
3704
3720
  let isVerticalAxis = $2__namespace.derived(() => mode() === "bottom" || mode() === "top");
3705
3721
  var $$exports = {
3706
3722
  snapTo,
@@ -3754,7 +3770,6 @@ function BottomSheet($$anchor, $$props) {
3754
3770
  $2__namespace.bind_this(div_2, ($$value) => $2__namespace.set(screenEl, $$value), () => $2__namespace.get(screenEl));
3755
3771
  var section = $2__namespace.sibling(div_2, 2);
3756
3772
  var div_3 = $2__namespace.child(section);
3757
- $2__namespace.set_attribute(div_3, "aria-valuemin", 0);
3758
3773
  $2__namespace.bind_this(div_3, ($$value) => $2__namespace.set(handleEl, $$value), () => $2__namespace.get(handleEl));
3759
3774
  var node_3 = $2__namespace.sibling(div_3, 2);
3760
3775
  {
@@ -3831,23 +3846,14 @@ function BottomSheet($$anchor, $$props) {
3831
3846
  });
3832
3847
  }
3833
3848
  $2__namespace.reset(div);
3834
- $2__namespace.template_effect(
3835
- ($0, $1) => {
3836
- $2__namespace.set_attribute(section, "data-mode", mode());
3837
- $2__namespace.set_attribute(section, "data-active", $2__namespace.get(viewState).activeId);
3838
- $2__namespace.set_attribute(section, "aria-modal", focusTrap() ? "true" : void 0);
3839
- $2__namespace.set_attribute(section, "aria-label", ariaLabel());
3840
- $2__namespace.set_attribute(div_3, "aria-orientation", $2__namespace.get(isVerticalAxis) ? "vertical" : "horizontal");
3841
- $2__namespace.set_attribute(div_3, "aria-valuemax", $0);
3842
- $2__namespace.set_attribute(div_3, "aria-valuenow", $1);
3843
- $2__namespace.set_attribute(div_3, "aria-valuetext", $2__namespace.get(viewState).activeId);
3844
- $2__namespace.set_text(text, $2__namespace.get(viewState).activeId);
3845
- },
3846
- [
3847
- () => Math.max(0, $2__namespace.get(allowedIds).length - 1),
3848
- () => Math.max(0, $2__namespace.get(activeIdx))
3849
- ]
3850
- );
3849
+ $2__namespace.template_effect(() => {
3850
+ $2__namespace.set_attribute(section, "data-mode", mode());
3851
+ $2__namespace.set_attribute(section, "data-active", $2__namespace.get(viewState).activeId);
3852
+ $2__namespace.set_attribute(section, "aria-modal", focusTrap() ? "true" : void 0);
3853
+ $2__namespace.set_attribute(section, "aria-label", ariaLabel());
3854
+ $2__namespace.set_attribute(div_3, "aria-orientation", $2__namespace.get(isVerticalAxis) ? "vertical" : "horizontal");
3855
+ $2__namespace.set_text(text, $2__namespace.get(viewState).activeId);
3856
+ });
3851
3857
  $2__namespace.append($$anchor, div);
3852
3858
  return $2__namespace.pop($$exports);
3853
3859
  }