@surdeddd/bottom-sheet 0.6.1 → 0.8.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 CHANGED
@@ -3,7 +3,7 @@
3
3
  > Universal, headless bottom-sheet engine. **One core, eight adapters, GPU-accelerated, fully tested.**
4
4
 
5
5
  ![bundle](https://img.shields.io/badge/core-16.8%20KB%20gzip-1a1614?style=flat-square)
6
- ![tests](https://img.shields.io/badge/tests-392%20unit-2ea44f?style=flat-square)
6
+ ![tests](https://img.shields.io/badge/tests-452%20unit-2ea44f?style=flat-square)
7
7
  ![ts](https://img.shields.io/badge/TypeScript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white)
8
8
  ![license](https://img.shields.io/badge/license-MIT-dc3522?style=flat-square)
9
9
 
@@ -47,7 +47,7 @@ stacking — and the exact same engine behind every adapter.
47
47
  | WCAG 2.1 AA keyboard slider | partial | — | **✓** |
48
48
  | Multi-sheet stacking | — | — | **✓** |
49
49
  | Sheet-manager registry (typed) | — | — | **✓** |
50
- | Tests (unit + e2e) | partial | partial | **392 + 164** |
50
+ | Tests (unit + e2e) | partial | partial | **452 + 164** |
51
51
 
52
52
  ## Install
53
53
 
@@ -379,6 +379,34 @@ element — drive any CSS animation from drag without touching JS:
379
379
  }
380
380
  ```
381
381
 
382
+ ### Padding & layout
383
+
384
+ Every region's padding is a token — override or zero it to go edge-to-edge.
385
+ Defaults match the built-in look. Set the variable on the host / `.bs-root` /
386
+ `:root`; custom properties inherit through the Web Component's shadow boundary,
387
+ so the same override works for every adapter:
388
+
389
+ | Token | Default | Region |
390
+ | ---------------------- | ---------------------- | ------------------- |
391
+ | `--bs-content-padding` | `0 16px 16px` | scrollable body |
392
+ | `--bs-handle-padding` | `8px 16px 4px` | grabber strip (top) |
393
+ | `--bs-header-padding` | `0 16px 8px` | header slot |
394
+ | `--bs-footer-padding` | `12px 16px (+ inset)` | footer slot |
395
+
396
+ (The footer default is `12px 16px calc(12px + env(safe-area-inset-bottom))` — it
397
+ keeps action buttons clear of the home indicator.)
398
+
399
+ ```css
400
+ .bs-root { --bs-content-padding: 0; } /* full-bleed content */
401
+ .bs-root { --bs-content-padding: 0 24px 24px; } /* custom insets */
402
+ bottom-sheet { --bs-handle-padding: 0; } /* Web Component, from the host */
403
+ ```
404
+
405
+ A `maxHeight` (prop, or `max-height` attribute on the element) caps the sheet:
406
+ a `'content'` / `'fit'` snap taller than the cap settles flush against the edge
407
+ and the body scrolls internally — the sheet never lifts off its anchor and
408
+ `--bs-size` always equals the rendered height.
409
+
382
410
  ## Demo
383
411
 
384
412
  ```bash
@@ -393,7 +421,7 @@ snap, progress, velocity, FPS). EN/RU and light/dark toggles in the corner.
393
421
  ## Testing
394
422
 
395
423
  ```bash
396
- npm test # 253 unit tests via vitest + happy-dom (~6s)
424
+ npm test # 452 unit tests via vitest + happy-dom (~6s)
397
425
  npx playwright test # 32 e2e via Playwright on mobile-Chrome (~25s)
398
426
  npm run typecheck # TypeScript --noEmit
399
427
  ```
@@ -236,6 +236,7 @@ declare class BottomSheetEngine {
236
236
  private progressWriteSentinel;
237
237
  private isTopSheet;
238
238
  private opening;
239
+ private allowOvershoot;
239
240
  private progressPayload;
240
241
  private dragContextBuf;
241
242
  private bus;
@@ -294,7 +295,7 @@ declare class BottomSheetEngine {
294
295
  setSnapPoints(points: EngineOptions["snapPoints"], allowed?: string[]): void;
295
296
  recompute(): void;
296
297
  private contentTargets;
297
- private measureContentExtent;
298
+ private measureSheetNatural;
298
299
  private measureFitSize;
299
300
  private installFitObserver;
300
301
  destroy(): void;
@@ -236,6 +236,7 @@ declare class BottomSheetEngine {
236
236
  private progressWriteSentinel;
237
237
  private isTopSheet;
238
238
  private opening;
239
+ private allowOvershoot;
239
240
  private progressPayload;
240
241
  private dragContextBuf;
241
242
  private bus;
@@ -294,7 +295,7 @@ declare class BottomSheetEngine {
294
295
  setSnapPoints(points: EngineOptions["snapPoints"], allowed?: string[]): void;
295
296
  recompute(): void;
296
297
  private contentTargets;
297
- private measureContentExtent;
298
+ private measureSheetNatural;
298
299
  private measureFitSize;
299
300
  private installFitObserver;
300
301
  destroy(): void;
package/dist/element.cjs CHANGED
@@ -2599,6 +2599,7 @@ var init_BottomSheetEngine = __esm({
2599
2599
  __publicField(this, "progressWriteSentinel", new WriteSentinel());
2600
2600
  __publicField(this, "isTopSheet", true);
2601
2601
  __publicField(this, "opening", false);
2602
+ __publicField(this, "allowOvershoot", false);
2602
2603
  __publicField(this, "progressPayload", {
2603
2604
  value: 0,
2604
2605
  size: 0
@@ -2889,8 +2890,8 @@ var init_BottomSheetEngine = __esm({
2889
2890
  this.updateAriaSlider();
2890
2891
  this.emit("snap", {
2891
2892
  id,
2892
- size: target.size,
2893
- progress: this.computeProgress(target.size)
2893
+ size: this.size,
2894
+ progress: this.computeProgress(this.size)
2894
2895
  });
2895
2896
  if (wasClosed && target.size > 0) {
2896
2897
  this.emit("open", { id });
@@ -2969,12 +2970,12 @@ var init_BottomSheetEngine = __esm({
2969
2970
  const value = typeof h === "number" ? `${h}px` : h;
2970
2971
  const axis = layoutAxis(this.mode);
2971
2972
  this.element.style.setProperty(
2972
- axis === "height" ? "maxHeight" : "maxWidth",
2973
+ axis === "height" ? "max-height" : "max-width",
2973
2974
  value
2974
2975
  );
2975
2976
  if (typeof h === "number") {
2976
2977
  this.maxHeightCap = h;
2977
- this.clampToMaxHeight();
2978
+ this.recompute();
2978
2979
  } else if (typeof window !== "undefined") {
2979
2980
  const probe2 = document.createElement("div");
2980
2981
  probe2.style.cssText = `position:absolute;visibility:hidden;pointer-events:none;${axis === "height" ? "height" : "width"}:${value};`;
@@ -2982,7 +2983,7 @@ var init_BottomSheetEngine = __esm({
2982
2983
  const measured = axis === "height" ? probe2.offsetHeight : probe2.offsetWidth;
2983
2984
  probe2.remove();
2984
2985
  this.maxHeightCap = measured > 0 ? measured : void 0;
2985
- this.clampToMaxHeight();
2986
+ this.recompute();
2986
2987
  }
2987
2988
  }
2988
2989
  clampToMaxHeight() {
@@ -2990,9 +2991,6 @@ var init_BottomSheetEngine = __esm({
2990
2991
  if (this.snaps.getMaxAxisSize() > this.maxHeightCap) {
2991
2992
  this.snaps.setMaxAxisSize(this.maxHeightCap);
2992
2993
  }
2993
- if (this.size > this.maxHeightCap && !this.gesture?.isDragging) {
2994
- this.applySize(this.maxHeightCap);
2995
- }
2996
2994
  }
2997
2995
  setAllowed(ids, snap) {
2998
2996
  if (this.destroyed) return;
@@ -3130,6 +3128,7 @@ var init_BottomSheetEngine = __esm({
3130
3128
  recompute() {
3131
3129
  if (this.destroyed) return;
3132
3130
  this.snaps.recompute();
3131
+ this.clampToMaxHeight();
3133
3132
  this.scrim.invalidateOpacityCache();
3134
3133
  if (this.gesture?.isDragging) return;
3135
3134
  const current = this.snaps.findById(this.activeId);
@@ -3153,43 +3152,36 @@ var init_BottomSheetEngine = __esm({
3153
3152
  }
3154
3153
  return out;
3155
3154
  }
3156
- measureContentExtent(vertical) {
3155
+ measureSheetNatural(vertical) {
3156
+ const el = this.element;
3157
3157
  const content = this.scrollContainer;
3158
- if (!content) return 0;
3159
- const targets = this.contentTargets();
3160
- if (targets.length === 0) {
3161
- return vertical ? content.scrollHeight : content.scrollWidth;
3162
- }
3163
- let min = Infinity;
3164
- let max = -Infinity;
3165
- for (const el of targets) {
3166
- const r = el.getBoundingClientRect();
3167
- if (vertical) {
3168
- if (r.top < min) min = r.top;
3169
- if (r.bottom > max) max = r.bottom;
3170
- } else {
3171
- if (r.left < min) min = r.left;
3172
- if (r.right > max) max = r.right;
3173
- }
3174
- }
3175
- if (!isFinite(min) || !isFinite(max) || max <= min) {
3176
- return vertical ? content.scrollHeight : content.scrollWidth;
3158
+ if (!content) {
3159
+ return vertical ? el.offsetHeight : el.offsetWidth;
3177
3160
  }
3178
- let pad = 0;
3179
- if (typeof getComputedStyle !== "undefined") {
3180
- const cs = getComputedStyle(content);
3181
- pad = vertical ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : (parseFloat(cs.paddingLeft) || 0) + (parseFloat(cs.paddingRight) || 0);
3182
- }
3183
- return max - min + pad;
3161
+ const axis = vertical ? "height" : "width";
3162
+ const sheetStyle = el.style;
3163
+ const cs = content.style;
3164
+ const prevSheet = sheetStyle[axis];
3165
+ const prevFlex = cs.flex;
3166
+ const prevContent = vertical ? cs.height : cs.width;
3167
+ sheetStyle[axis] = "auto";
3168
+ cs.flex = "none";
3169
+ if (vertical) cs.height = "auto";
3170
+ else cs.width = "auto";
3171
+ const natural = vertical ? el.offsetHeight : el.offsetWidth;
3172
+ sheetStyle[axis] = prevSheet;
3173
+ cs.flex = prevFlex;
3174
+ if (vertical) cs.height = prevContent;
3175
+ else cs.width = prevContent;
3176
+ return natural;
3184
3177
  }
3185
3178
  measureFitSize() {
3186
3179
  const vertical = layoutAxis(this.mode) === "height";
3187
- const handleSize = vertical ? this.handle.offsetHeight : this.handle.offsetWidth;
3188
- const content = this.scrollContainer;
3189
- const natural = content ? handleSize + this.measureContentExtent(vertical) : handleSize;
3190
- if (typeof window === "undefined") return natural;
3180
+ const natural = this.measureSheetNatural(vertical);
3181
+ const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
3182
+ if (typeof window === "undefined") return capped;
3191
3183
  const viewport = vertical ? window.innerHeight : window.innerWidth;
3192
- return viewport > 0 ? Math.min(natural, viewport) : natural;
3184
+ return viewport > 0 ? Math.min(capped, viewport) : capped;
3193
3185
  }
3194
3186
  installFitObserver() {
3195
3187
  if (typeof ResizeObserver === "undefined") return;
@@ -3271,6 +3263,10 @@ var init_BottomSheetEngine = __esm({
3271
3263
  this.backdrop.style.opacity = "";
3272
3264
  this.backdrop.style.pointerEvents = "";
3273
3265
  }
3266
+ if (this.anchorHost) {
3267
+ this.anchorHost.style.removeProperty("--bs-size");
3268
+ this.anchorHost.style.removeProperty("--bs-progress");
3269
+ }
3274
3270
  if (this.screenComponent) {
3275
3271
  this.screenComponent.style.opacity = "";
3276
3272
  this.screenComponent.style.display = "";
@@ -3282,6 +3278,7 @@ var init_BottomSheetEngine = __esm({
3282
3278
  this.bus.emit(event, payload);
3283
3279
  }
3284
3280
  newCycle() {
3281
+ this.allowOvershoot = false;
3285
3282
  this.currentAbort.abort();
3286
3283
  this.currentAbort = new AbortController();
3287
3284
  return this.currentAbort.signal;
@@ -3347,6 +3344,7 @@ var init_BottomSheetEngine = __esm({
3347
3344
  seen.add(p.id);
3348
3345
  }
3349
3346
  this.snaps.setRaw(this.snapPointsRaw);
3347
+ this.clampToMaxHeight();
3350
3348
  this.scrim.invalidateOpacityCache();
3351
3349
  }
3352
3350
  getAllowedRange() {
@@ -3553,15 +3551,19 @@ var init_BottomSheetEngine = __esm({
3553
3551
  this.opening = true;
3554
3552
  sheetStack.promote(this.id);
3555
3553
  }
3556
- void this.animation.animateTo(target.size, velocity).then(() => {
3557
- this.opening = false;
3554
+ const settleCap = this.snaps.getMaxAxisSize();
3555
+ const settleSize = settleCap > 0 ? Math.min(target.size, settleCap) : target.size;
3556
+ this.allowOvershoot = true;
3557
+ void this.animation.animateTo(settleSize, velocity).then(() => {
3558
3558
  if (signal.aborted) return;
3559
+ this.allowOvershoot = false;
3560
+ this.opening = false;
3559
3561
  this.scrollCache.restore(target.id, previousSize, target.size);
3560
3562
  this.updateAriaSlider();
3561
3563
  this.emit("snap", {
3562
3564
  id: target.id,
3563
- size: target.size,
3564
- progress: this.computeProgress(target.size)
3565
+ size: this.size,
3566
+ progress: this.computeProgress(this.size)
3565
3567
  });
3566
3568
  this.haptic();
3567
3569
  if (previousSnapSize === 0 && target.size > 0) {
@@ -3586,23 +3588,25 @@ var init_BottomSheetEngine = __esm({
3586
3588
  }
3587
3589
  }
3588
3590
  applySize(size) {
3589
- this.size = size;
3590
- const offset = this.snaps.getMaxAxisSize() - size;
3591
+ const cap = this.snaps.getMaxAxisSize();
3592
+ const clamped = cap > 0 && size > cap && !this.gesture?.isDragging && !this.allowOvershoot ? cap : size;
3593
+ this.size = clamped;
3594
+ const offset = cap - clamped;
3591
3595
  const style = this.element.style;
3592
3596
  style.transform = this.transformTemplate(offset);
3593
- if (this.sizeWriteSentinel.shouldWrite(size, SIZE_WRITE_EPSILON)) {
3594
- style.setProperty("--bs-size", `${size}px`);
3597
+ if (this.sizeWriteSentinel.shouldWrite(clamped, SIZE_WRITE_EPSILON)) {
3598
+ style.setProperty("--bs-size", `${clamped}px`);
3595
3599
  if (this.scrimParent) {
3596
- this.scrimParent.style.setProperty("--bs-size", `${size}px`);
3600
+ this.scrimParent.style.setProperty("--bs-size", `${clamped}px`);
3597
3601
  }
3598
3602
  if (this.anchorHost && this.anchorHost !== this.scrimParent) {
3599
- this.anchorHost.style.setProperty("--bs-size", `${size}px`);
3603
+ this.anchorHost.style.setProperty("--bs-size", `${clamped}px`);
3600
3604
  }
3601
3605
  if (this.rootEl && this.rootEl !== this.scrimParent && this.rootEl !== this.anchorHost) {
3602
- this.rootEl.style.setProperty("--bs-size", `${size}px`);
3606
+ this.rootEl.style.setProperty("--bs-size", `${clamped}px`);
3603
3607
  }
3604
3608
  }
3605
- const progress = this.computeProgress(size);
3609
+ const progress = this.computeProgress(clamped);
3606
3610
  const progressChanged = this.progressWriteSentinel.shouldWrite(
3607
3611
  progress,
3608
3612
  OPACITY_WRITE_EPSILON
@@ -3619,14 +3623,15 @@ var init_BottomSheetEngine = __esm({
3619
3623
  this.scrim.applyOpacity(progress, progressChanged);
3620
3624
  if (progressChanged && this.bus.listenerCount("progress") > 0) {
3621
3625
  this.progressPayload.value = progress;
3622
- this.progressPayload.size = size;
3626
+ this.progressPayload.size = clamped;
3623
3627
  this.emit("progress", this.progressPayload);
3624
3628
  }
3625
3629
  }
3626
3630
  computeProgress(size) {
3627
3631
  const { min, max } = this.getAllowedRange();
3628
- if (max <= min) return 0;
3629
- return Math.min(Math.max((size - min) / (max - min), 0), 1);
3632
+ const reachableMax = Math.min(max, this.snaps.getMaxAxisSize());
3633
+ if (reachableMax <= min) return 0;
3634
+ return Math.min(Math.max((size - min) / (reachableMax - min), 0), 1);
3630
3635
  }
3631
3636
  handleOpen() {
3632
3637
  sheetStack.promote(this.id);
@@ -3650,8 +3655,8 @@ var init_BottomSheetEngine = __esm({
3650
3655
  this.updateAriaSlider();
3651
3656
  this.emit("snap", {
3652
3657
  id: target.id,
3653
- size: target.size,
3654
- progress: this.computeProgress(target.size)
3658
+ size: this.size,
3659
+ progress: this.computeProgress(this.size)
3655
3660
  });
3656
3661
  if (target.size > 0 && !this.lifecycle.isInstalled) {
3657
3662
  this.emit("open", { id: target.id });
@@ -3677,7 +3682,7 @@ var init_BottomSheetEngine = __esm({
3677
3682
  var baseStyles;
3678
3683
  var init_baseStyles = __esm({
3679
3684
  "src/web-component/baseStyles.ts"() {
3680
- baseStyles = `:where(.bs-root){--bs-surface-d:#ffffff;--bs-surface-border-d:rgba(225,227,237,1);--bs-radius-d:20px;--bs-handle-color-d:rgba(26,22,20,0.3);--bs-handle-width:40px;--bs-handle-height:5px;--bs-z-backdrop:90;--bs-z-sheet:100;--bs-header-min-height:80px;--bs-backdrop-color-d:rgba(0,0,0,0.5);--bs-scrim-color-d:transparent;--bs-scrim-blur:0px;--bs-z-scrim:calc(var(--bs-z-sheet) - 1);--bs-size:0px;--bs-progress:0}.bs-backdrop{position:fixed;inset:0;background:var(--bs-backdrop-color,var(--bs-backdrop-color-d));opacity:0;pointer-events:none;z-index:var(--bs-z-backdrop);transition:opacity 0.24s cubic-bezier(0.22,1,0.36,1);will-change:opacity}.bs-root[data-dragging="true"] .bs-backdrop,.bs-root[data-animating="true"] .bs-backdrop{transition:none}.bs-sheet{position:fixed;background:var(--bs-surface,var(--bs-surface-d));box-shadow:var(--bs-shadow,var(--bs-shadow-auto,none));z-index:var(--bs-z-sheet);pointer-events:auto;overflow:hidden;display:flex;flex-direction:column;-webkit-tap-highlight-color:transparent;user-select:none;overscroll-behavior:contain}.bs-sheet[data-mode="bottom"]{left:0;right:0;bottom:0;width:100%;border-top-left-radius:var(--bs-radius,var(--bs-radius-d));border-top-right-radius:var(--bs-radius,var(--bs-radius-d));border-top:1px solid var(--bs-surface-border,var(--bs-surface-border-d));padding-bottom:env(safe-area-inset-bottom);--bs-shadow-auto:0 calc(var(--bs-progress,0) * -2px - 3px) calc(var(--bs-progress,0) * 18px + 12px) rgba(0,0,0,calc(var(--bs-progress,0) * 0.15 + 0.12))}.bs-sheet[data-mode="top"]{left:0;right:0;top:0;width:100%;border-bottom-left-radius:var(--bs-radius,var(--bs-radius-d));border-bottom-right-radius:var(--bs-radius,var(--bs-radius-d));border-bottom:1px solid var(--bs-surface-border,var(--bs-surface-border-d));flex-direction:column-reverse;--bs-shadow-auto:0 3px 12px rgba(0,0,0,0.12);padding-top:env(safe-area-inset-top)}.bs-sheet[data-mode="left"]{top:0;bottom:0;left:0;height:100%;border-top-right-radius:var(--bs-radius,var(--bs-radius-d));border-bottom-right-radius:var(--bs-radius,var(--bs-radius-d));border-right:1px solid var(--bs-surface-border,var(--bs-surface-border-d));--bs-shadow-auto:3px 0 12px rgba(0,0,0,0.12)}.bs-sheet[data-mode="right"]{top:0;bottom:0;right:0;height:100%;border-top-left-radius:var(--bs-radius,var(--bs-radius-d));border-bottom-left-radius:var(--bs-radius,var(--bs-radius-d));border-left:1px solid var(--bs-surface-border,var(--bs-surface-border-d));--bs-shadow-auto:-3px 0 12px rgba(0,0,0,0.12)}.bs-sheet[data-mode="left"] .bs-content{padding-right:36px}.bs-sheet[data-mode="right"] .bs-content{padding-left:36px}.bs-handle{flex-shrink:0;min-height:44px;display:flex;flex-direction:column;justify-content:center;padding:8px 16px 4px;cursor:grab;touch-action:none;user-select:none;background:var(--bs-surface,var(--bs-surface-d));-webkit-tap-highlight-color:transparent;outline:none;position:relative}.bs-handle:active{cursor:grabbing}.bs-handle:focus-visible{outline:2px solid currentColor;outline-offset:-2px;border-radius:var(--bs-radius,var(--bs-radius-d))}.bs-handle::before{content:"";display:block;width:var(--bs-handle-width);height:var(--bs-handle-height);background:var(--bs-handle-color,var(--bs-handle-color-d));border-radius:calc(var(--bs-handle-height) / 2);margin:0 auto 8px;transition:width 0.15s ease,background 0.15s ease,transform 0.15s ease;pointer-events:none}.bs-sheet[data-mode="left"] .bs-handle,.bs-sheet[data-mode="right"] .bs-handle{position:absolute;top:0;bottom:0;width:28px;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;background:var(--bs-surface,var(--bs-surface-d));z-index:1;overflow:hidden}.bs-sheet[data-mode="left"] .bs-handle>*,.bs-sheet[data-mode="right"] .bs-handle>*{display:none}.bs-sheet[data-mode="left"] .bs-handle{right:0;border-left:1px solid var(--bs-surface-border,var(--bs-surface-border-d))}.bs-sheet[data-mode="right"] .bs-handle{left:0;border-right:1px solid var(--bs-surface-border,var(--bs-surface-border-d))}.bs-sheet[data-mode="left"] .bs-handle::before,.bs-sheet[data-mode="right"] .bs-handle::before{width:var(--bs-handle-height);height:var(--bs-handle-width);margin:0}.bs-sheet:hover .bs-handle::before{background:color-mix(in oklab,var(--bs-handle-color,var(--bs-handle-color-d)),#000 15%)}.bs-handle:active::before{background:color-mix(in oklab,var(--bs-handle-color,var(--bs-handle-color-d)),#000 35%);transform:scaleX(1.15)}.bs-handle.bs-handle--ticks::after{content:"";display:block;position:absolute;left:50%;bottom:6px;transform:translateX(-50%);width:calc(var(--bs-handle-width) * 2);height:3px;background-image:radial-gradient( circle,var(--bs-handle-color,var(--bs-handle-color-d)) 0 1.5px,transparent 1.6px );background-size:8px 3px;background-repeat:repeat-x;background-position:center;opacity:0;transition:opacity 0.18s ease-out;pointer-events:none}.bs-root[data-dragging="true"] .bs-handle.bs-handle--ticks::after{opacity:0.4}.bs-sheet[data-mode="top"] .bs-handle.bs-handle--ticks::after{bottom:auto;top:6px}.bs-sheet[data-mode="left"] .bs-handle.bs-handle--ticks::after,.bs-sheet[data-mode="right"] .bs-handle.bs-handle--ticks::after{left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);width:3px;height:calc(var(--bs-handle-width) * 2);background-size:3px 8px;background-repeat:repeat-y;margin-left:calc(var(--bs-handle-height) + 6px)}.bs-sheet[data-mode="right"] .bs-handle.bs-handle--ticks::after{margin-left:calc(-1 * (var(--bs-handle-height) + 6px))}.bs-header{flex:0 0 auto;padding:0 16px 8px;background:var(--bs-surface,var(--bs-surface-d))}.bs-content{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;user-select:text;padding:0 16px 16px}.bs-footer{flex:0 0 auto;padding:12px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--bs-surface-border,var(--bs-surface-border-d));background:var(--bs-surface,var(--bs-surface-d))}.bs-sheet[data-mode="bottom"]:has(.bs-footer:not([hidden]):has(*)){padding-bottom:0}.bs-header:not(:has(*)),.bs-footer:not(:has(*)),.bs-header[hidden],.bs-footer[hidden]{display:none}.bs-screen{position:absolute;inset:0;pointer-events:none;z-index:var(--bs-z-scrim);background:var(--bs-scrim-color,var(--bs-scrim-color-d));transition:opacity 0.24s cubic-bezier(0.22,1,0.36,1);will-change:opacity}.bs-root[data-dragging="true"] .bs-screen,.bs-root[data-animating="true"] .bs-screen{transition:none}.bs-scrim-overlay{z-index:calc(var(--bs-z-sheet) + 1);pointer-events:none}.bs-button-slot{position:fixed;z-index:calc(var(--bs-z-sheet) + 1);pointer-events:auto}.bs-button-slot[data-side="left"]{left:16px;bottom:calc(var(--bs-size,0px) + 12px)}.bs-button-slot[data-side="right"]{right:16px;bottom:calc(var(--bs-size,0px) + 12px)}.bs-button-slot[data-mode="top"]{bottom:auto;top:calc(var(--bs-size,0px) + 12px)}.bs-button-slot[data-mode="left"]{left:calc(var(--bs-size,0px) + 12px);right:auto;bottom:auto;top:16px}.bs-button-slot[data-mode="right"]{right:calc(var(--bs-size,0px) + 12px);left:auto;bottom:auto;top:16px}@media (prefers-reduced-motion:reduce){.bs-backdrop,.bs-handle::before,.bs-button-slot[data-side="left"],.bs-button-slot[data-side="right"]{transition:none !important}}@media (prefers-color-scheme:dark){:where(.bs-root){--bs-surface-d:#1a1a1d;--bs-surface-border-d:rgba(255,255,255,0.08);--bs-handle-color-d:rgba(255,255,255,0.45);--bs-shadow-auto:0 -3px 16px rgba(0,0,0,0.5)}}.bs-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:where(.ovl-root){--ovl-surface:var(--bs-surface,var(--bs-surface-d,#ffffff));--ovl-surface-border:var(--bs-surface-border,var(--bs-surface-border-d,rgba(0,0,0,0.08)));--ovl-shadow:0 -8px 40px rgba(0,0,0,0.35);--ovl-radius:var(--bs-radius,var(--bs-radius-d,20px));--ovl-backdrop-color:rgba(0,0,0,0.5);--ovl-z-backdrop:200;--ovl-z-panel:201}.ovl-backdrop{position:fixed;inset:0;background:var(--ovl-backdrop-color);opacity:0;pointer-events:none;z-index:var(--ovl-z-backdrop)}.ovl-panel{position:fixed;background:var(--ovl-surface);box-shadow:var(--ovl-shadow);z-index:var(--ovl-z-panel);-webkit-tap-highlight-color:transparent;outline:none;transition:transform 0.32s cubic-bezier(0.29,1.24,0.84,0.99),opacity 0.32s ease-out}.ovl-panel[data-state="open"]{transform:translate3d(0,0,0);opacity:1}@starting-style{.ovl-panel[data-edge="bottom"][data-state="open"]{transform:translate3d(0,100%,0);opacity:0}.ovl-panel[data-edge="top"][data-state="open"]{transform:translate3d(0,-100%,0);opacity:0}.ovl-panel[data-edge="left"][data-state="open"]{transform:translate3d(-100%,0,0);opacity:0}.ovl-panel[data-edge="right"][data-state="open"]{transform:translate3d(100%,0,0);opacity:0}}.ovl-panel[data-edge="bottom"]{left:0;right:0;bottom:0;width:100%;border-top-left-radius:var(--ovl-radius);border-top-right-radius:var(--ovl-radius);border-top:1px solid var(--ovl-surface-border);padding-bottom:env(safe-area-inset-bottom)}.ovl-panel[data-edge="top"]{left:0;right:0;top:0;width:100%;border-bottom-left-radius:var(--ovl-radius);border-bottom-right-radius:var(--ovl-radius);border-bottom:1px solid var(--ovl-surface-border);padding-top:env(safe-area-inset-top)}.ovl-panel[data-edge="left"]{top:0;bottom:0;left:0;height:100%;border-top-right-radius:var(--ovl-radius);border-bottom-right-radius:var(--ovl-radius);border-right:1px solid var(--ovl-surface-border)}.ovl-panel[data-edge="right"]{top:0;bottom:0;right:0;height:100%;border-top-left-radius:var(--ovl-radius);border-bottom-left-radius:var(--ovl-radius);border-left:1px solid var(--ovl-surface-border)}@media (prefers-reduced-motion:reduce){.ovl-panel,.ovl-backdrop{transition:none !important}}`;
3685
+ baseStyles = `:where(.bs-root){--bs-surface-d:#ffffff;--bs-surface-border-d:rgba(225,227,237,1);--bs-radius-d:20px;--bs-handle-color-d:rgba(26,22,20,0.3);--bs-handle-width:40px;--bs-handle-height:5px;--bs-z-backdrop:90;--bs-z-sheet:100;--bs-header-min-height:80px;--bs-backdrop-color-d:rgba(0,0,0,0.5);--bs-scrim-color-d:transparent;--bs-scrim-blur:0px;--bs-z-scrim:calc(var(--bs-z-sheet) - 1);--bs-size:0px;--bs-progress:0}.bs-backdrop{position:fixed;inset:0;background:var(--bs-backdrop-color,var(--bs-backdrop-color-d));opacity:0;pointer-events:none;z-index:var(--bs-z-backdrop);transition:opacity 0.24s cubic-bezier(0.22,1,0.36,1);will-change:opacity}.bs-root[data-dragging="true"] .bs-backdrop,.bs-root[data-animating="true"] .bs-backdrop{transition:none}.bs-sheet{position:fixed;background:var(--bs-surface,var(--bs-surface-d));box-shadow:var(--bs-shadow,var(--bs-shadow-auto,none));z-index:var(--bs-z-sheet);pointer-events:auto;overflow:hidden;display:flex;flex-direction:column;-webkit-tap-highlight-color:transparent;user-select:none;overscroll-behavior:contain}.bs-sheet[data-mode="bottom"]{left:0;right:0;bottom:0;width:100%;border-top-left-radius:var(--bs-radius,var(--bs-radius-d));border-top-right-radius:var(--bs-radius,var(--bs-radius-d));border-top:1px solid var(--bs-surface-border,var(--bs-surface-border-d));padding-bottom:env(safe-area-inset-bottom);--bs-shadow-auto:0 calc(var(--bs-progress,0) * -2px - 3px) calc(var(--bs-progress,0) * 18px + 12px) rgba(0,0,0,calc(var(--bs-progress,0) * 0.15 + 0.12))}.bs-sheet[data-mode="top"]{left:0;right:0;top:0;width:100%;border-bottom-left-radius:var(--bs-radius,var(--bs-radius-d));border-bottom-right-radius:var(--bs-radius,var(--bs-radius-d));border-bottom:1px solid var(--bs-surface-border,var(--bs-surface-border-d));flex-direction:column-reverse;--bs-shadow-auto:0 3px 12px rgba(0,0,0,0.12);padding-top:env(safe-area-inset-top)}.bs-sheet[data-mode="left"]{top:0;bottom:0;left:0;height:100%;border-top-right-radius:var(--bs-radius,var(--bs-radius-d));border-bottom-right-radius:var(--bs-radius,var(--bs-radius-d));border-right:1px solid var(--bs-surface-border,var(--bs-surface-border-d));--bs-shadow-auto:3px 0 12px rgba(0,0,0,0.12)}.bs-sheet[data-mode="right"]{top:0;bottom:0;right:0;height:100%;border-top-left-radius:var(--bs-radius,var(--bs-radius-d));border-bottom-left-radius:var(--bs-radius,var(--bs-radius-d));border-left:1px solid var(--bs-surface-border,var(--bs-surface-border-d));--bs-shadow-auto:-3px 0 12px rgba(0,0,0,0.12)}.bs-sheet[data-mode="left"] .bs-content{padding-right:36px}.bs-sheet[data-mode="right"] .bs-content{padding-left:36px}.bs-handle{flex-shrink:0;min-height:44px;display:flex;flex-direction:column;justify-content:center;padding:var(--bs-handle-padding,8px 16px 4px);cursor:grab;touch-action:none;user-select:none;background:var(--bs-surface,var(--bs-surface-d));-webkit-tap-highlight-color:transparent;outline:none;position:relative}.bs-handle:active{cursor:grabbing}.bs-handle:focus-visible{outline:2px solid currentColor;outline-offset:-2px;border-radius:var(--bs-radius,var(--bs-radius-d))}.bs-handle::before{content:"";display:block;width:var(--bs-handle-width);height:var(--bs-handle-height);background:var(--bs-handle-color,var(--bs-handle-color-d));border-radius:calc(var(--bs-handle-height) / 2);margin:0 auto 8px;transition:width 0.15s ease,background 0.15s ease,transform 0.15s ease;pointer-events:none}.bs-sheet[data-mode="left"] .bs-handle,.bs-sheet[data-mode="right"] .bs-handle{position:absolute;top:0;bottom:0;width:28px;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;background:var(--bs-surface,var(--bs-surface-d));z-index:1;overflow:hidden}.bs-sheet[data-mode="left"] .bs-handle>*,.bs-sheet[data-mode="right"] .bs-handle>*{display:none}.bs-sheet[data-mode="left"] .bs-handle{right:0;border-left:1px solid var(--bs-surface-border,var(--bs-surface-border-d))}.bs-sheet[data-mode="right"] .bs-handle{left:0;border-right:1px solid var(--bs-surface-border,var(--bs-surface-border-d))}.bs-sheet[data-mode="left"] .bs-handle::before,.bs-sheet[data-mode="right"] .bs-handle::before{width:var(--bs-handle-height);height:var(--bs-handle-width);margin:0}.bs-sheet:hover .bs-handle::before{background:color-mix(in oklab,var(--bs-handle-color,var(--bs-handle-color-d)),#000 15%)}.bs-handle:active::before{background:color-mix(in oklab,var(--bs-handle-color,var(--bs-handle-color-d)),#000 35%);transform:scaleX(1.15)}.bs-handle.bs-handle--ticks::after{content:"";display:block;position:absolute;left:50%;bottom:6px;transform:translateX(-50%);width:calc(var(--bs-handle-width) * 2);height:3px;background-image:radial-gradient( circle,var(--bs-handle-color,var(--bs-handle-color-d)) 0 1.5px,transparent 1.6px );background-size:8px 3px;background-repeat:repeat-x;background-position:center;opacity:0;transition:opacity 0.18s ease-out;pointer-events:none}.bs-root[data-dragging="true"] .bs-handle.bs-handle--ticks::after{opacity:0.4}.bs-sheet[data-mode="top"] .bs-handle.bs-handle--ticks::after{bottom:auto;top:6px}.bs-sheet[data-mode="left"] .bs-handle.bs-handle--ticks::after,.bs-sheet[data-mode="right"] .bs-handle.bs-handle--ticks::after{left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);width:3px;height:calc(var(--bs-handle-width) * 2);background-size:3px 8px;background-repeat:repeat-y;margin-left:calc(var(--bs-handle-height) + 6px)}.bs-sheet[data-mode="right"] .bs-handle.bs-handle--ticks::after{margin-left:calc(-1 * (var(--bs-handle-height) + 6px))}.bs-header{flex:0 0 auto;padding:var(--bs-header-padding,0 16px 8px);background:var(--bs-surface,var(--bs-surface-d))}.bs-content{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;user-select:text;padding:var(--bs-content-padding,0 16px 16px)}.bs-footer{flex:0 0 auto;padding:var(--bs-footer-padding,12px 16px calc(12px + env(safe-area-inset-bottom)));border-top:1px solid var(--bs-surface-border,var(--bs-surface-border-d));background:var(--bs-surface,var(--bs-surface-d))}.bs-sheet[data-mode="bottom"]:has(.bs-footer:not([hidden]):has(*)){padding-bottom:0}.bs-header:not(:has(*)),.bs-footer:not(:has(*)),.bs-header[hidden],.bs-footer[hidden]{display:none}.bs-screen{position:absolute;inset:0;pointer-events:none;z-index:var(--bs-z-scrim);background:var(--bs-scrim-color,var(--bs-scrim-color-d));transition:opacity 0.24s cubic-bezier(0.22,1,0.36,1);will-change:opacity}.bs-root[data-dragging="true"] .bs-screen,.bs-root[data-animating="true"] .bs-screen{transition:none}.bs-scrim-overlay{z-index:calc(var(--bs-z-sheet) + 1);pointer-events:none}.bs-button-slot{position:fixed;z-index:calc(var(--bs-z-sheet) + 1);pointer-events:auto}.bs-button-slot[data-side="left"]{left:16px;bottom:calc(var(--bs-size,0px) + 12px)}.bs-button-slot[data-side="right"]{right:16px;bottom:calc(var(--bs-size,0px) + 12px)}.bs-button-slot[data-mode="top"]{bottom:auto;top:calc(var(--bs-size,0px) + 12px)}.bs-button-slot[data-mode="left"]{left:calc(var(--bs-size,0px) + 12px);right:auto;bottom:auto;top:16px}.bs-button-slot[data-mode="right"]{right:calc(var(--bs-size,0px) + 12px);left:auto;bottom:auto;top:16px}@media (prefers-reduced-motion:reduce){.bs-backdrop,.bs-handle::before,.bs-button-slot[data-side="left"],.bs-button-slot[data-side="right"]{transition:none !important}}@media (prefers-color-scheme:dark){:where(.bs-root){--bs-surface-d:#1a1a1d;--bs-surface-border-d:rgba(255,255,255,0.08);--bs-handle-color-d:rgba(255,255,255,0.45);--bs-shadow-auto:0 -3px 16px rgba(0,0,0,0.5)}}.bs-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}:where(.ovl-root){--ovl-surface:var(--bs-surface,var(--bs-surface-d,#ffffff));--ovl-surface-border:var(--bs-surface-border,var(--bs-surface-border-d,rgba(0,0,0,0.08)));--ovl-shadow:0 -8px 40px rgba(0,0,0,0.35);--ovl-radius:var(--bs-radius,var(--bs-radius-d,20px));--ovl-backdrop-color:rgba(0,0,0,0.5);--ovl-z-backdrop:200;--ovl-z-panel:201}.ovl-backdrop{position:fixed;inset:0;background:var(--ovl-backdrop-color);opacity:0;pointer-events:none;z-index:var(--ovl-z-backdrop)}.ovl-panel{position:fixed;background:var(--ovl-surface);box-shadow:var(--ovl-shadow);z-index:var(--ovl-z-panel);-webkit-tap-highlight-color:transparent;outline:none;transition:transform 0.32s cubic-bezier(0.29,1.24,0.84,0.99),opacity 0.32s ease-out}.ovl-panel[data-state="open"]{transform:translate3d(0,0,0);opacity:1}@starting-style{.ovl-panel[data-edge="bottom"][data-state="open"]{transform:translate3d(0,100%,0);opacity:0}.ovl-panel[data-edge="top"][data-state="open"]{transform:translate3d(0,-100%,0);opacity:0}.ovl-panel[data-edge="left"][data-state="open"]{transform:translate3d(-100%,0,0);opacity:0}.ovl-panel[data-edge="right"][data-state="open"]{transform:translate3d(100%,0,0);opacity:0}}.ovl-panel[data-edge="bottom"]{left:0;right:0;bottom:0;width:100%;border-top-left-radius:var(--ovl-radius);border-top-right-radius:var(--ovl-radius);border-top:1px solid var(--ovl-surface-border);padding-bottom:env(safe-area-inset-bottom)}.ovl-panel[data-edge="top"]{left:0;right:0;top:0;width:100%;border-bottom-left-radius:var(--ovl-radius);border-bottom-right-radius:var(--ovl-radius);border-bottom:1px solid var(--ovl-surface-border);padding-top:env(safe-area-inset-top)}.ovl-panel[data-edge="left"]{top:0;bottom:0;left:0;height:100%;border-top-right-radius:var(--ovl-radius);border-bottom-right-radius:var(--ovl-radius);border-right:1px solid var(--ovl-surface-border)}.ovl-panel[data-edge="right"]{top:0;bottom:0;right:0;height:100%;border-top-left-radius:var(--ovl-radius);border-bottom-left-radius:var(--ovl-radius);border-left:1px solid var(--ovl-surface-border)}@media (prefers-reduced-motion:reduce){.ovl-panel,.ovl-backdrop{transition:none !important}}`;
3681
3686
  }
3682
3687
  });
3683
3688
 
@@ -1,4 +1,4 @@
1
- import { B as BottomSheetEngine, C as CloseReason, A as AnchorOptions, S as ScrimStagesOptions, E as EngineState } from './BottomSheetEngine-CqiCz64W.cjs';
1
+ import { B as BottomSheetEngine, C as CloseReason, A as AnchorOptions, S as ScrimStagesOptions, E as EngineState } from './BottomSheetEngine-BD1mSExI.cjs';
2
2
  import './transform-jVfAikE9.cjs';
3
3
 
4
4
  declare const BaseHTMLElement: typeof HTMLElement;
package/dist/element.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { B as BottomSheetEngine, C as CloseReason, A as AnchorOptions, S as ScrimStagesOptions, E as EngineState } from './BottomSheetEngine-BHjKFtnM.js';
1
+ import { B as BottomSheetEngine, C as CloseReason, A as AnchorOptions, S as ScrimStagesOptions, E as EngineState } from './BottomSheetEngine-BDGRWa2i.js';
2
2
  import './transform-jVfAikE9.js';
3
3
 
4
4
  declare const BaseHTMLElement: typeof HTMLElement;