@douxcode/vue-spring-bottom-sheet 2.4.3 → 2.6.0-next.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.
package/README.md CHANGED
@@ -132,20 +132,21 @@ For Nuxt 3, just wrap component in `<ClientOnly>`
132
132
 
133
133
  ### Prop Definitions
134
134
 
135
- | Prop | Type | Default | Description |
136
- | ------------------- | ------------------------- | ---------------- | ---------------------------------------------- |
137
- | duration | Number | 250 | Animation duration in milliseconds |
138
- | snapPoints | Array<number\|string> | [instinctHeight] | Custom snapping positions |
139
- | initialSnapPoint | Number | minHeight | Initial snap point index |
140
- | blocking | Boolean | true | Block interactions with underlying content |
141
- | canSwipeClose | Boolean | true | Enable swipe-to-close gesture |
142
- | canBackdropClose | Boolean | true | Allow closing by tapping backdrop |
143
- | expandOnContentDrag | Boolean | true | Enable expanding by dragging content |
144
- | teleprtTo | String \| RendererElement | body | Teleport to a specific element |
145
- | teleportDefer | Boolean | false | Defer teleporting until opened (Vue 3.5+ only) |
146
- | headerClass | String | '' | Set header element class |
147
- | contentClass | String | '' | Set content element class |
148
- | footerClass | String | '' | Set footer element class |
135
+ | Prop | Type | Default | Description |
136
+ | ------------------- | ------------------------- | ---------------- | ------------------------------------------------------------------------- |
137
+ | duration | Number | 250 | Animation duration in milliseconds |
138
+ | snapPoints | Array<number\|string> | [instinctHeight] | Custom snapping positions |
139
+ | initialSnapPoint | Number | minHeight | Initial snap point index |
140
+ | blocking | Boolean | true | Block interactions with underlying content |
141
+ | canSwipeClose | Boolean | true | Enable swipe-to-close gesture |
142
+ | swipeCloseThreshold | Number\|String | "50%" | The amount of translation (in px or %) after which the element will close |
143
+ | canBackdropClose | Boolean | true | Allow closing by tapping backdrop |
144
+ | expandOnContentDrag | Boolean | true | Enable expanding by dragging content |
145
+ | teleportTo | String \| RendererElement | body | Teleport to a specific element |
146
+ | teleportDefer | Boolean | false | Defer teleporting until opened (Vue 3.5+ only) |
147
+ | headerClass | String | '' | Set header element class |
148
+ | contentClass | String | '' | Set content element class |
149
+ | footerClass | String | '' | Set footer element class |
149
150
 
150
151
  ## Exposed methods
151
152
 
@@ -160,7 +161,7 @@ Assuming there is `const bottomSheet = ref()`
160
161
  ## Events
161
162
 
162
163
  | Event | Description | Payload |
163
- | -------------- | -------------------------------------- | ----------------------- |
164
+ | --------------- | -------------------------------------- | ----------------------- |
164
165
  | opened | Emitted when sheet finishes opening | - |
165
166
  | opening-started | Emitted when sheet starts opening | - |
166
167
  | closed | Emitted when sheet finishes closing | - |
@@ -7,13 +7,13 @@ declare function __VLS_template(): {
7
7
  footer?(_: {}): any;
8
8
  };
9
9
  refs: {
10
- backdrop: import('vue').ShallowUnwrapRef<{}> | null;
11
- sheet: import('vue').ShallowUnwrapRef<{}> | null;
12
- sheetHeader: import('vue').ShallowUnwrapRef<{}> | null;
10
+ backdrop: HTMLDivElement;
11
+ sheet: HTMLDivElement;
12
+ sheetHeader: HTMLDivElement;
13
13
  sheetScroll: HTMLDivElement;
14
- sheetContentWrapper: import('vue').ShallowUnwrapRef<{}> | null;
14
+ sheetContentWrapper: HTMLDivElement;
15
15
  sheetContent: HTMLDivElement;
16
- sheetFooter: import('vue').ShallowUnwrapRef<{}> | null;
16
+ sheetFooter: HTMLDivElement;
17
17
  };
18
18
  rootEl: any;
19
19
  };
@@ -37,13 +37,13 @@ declare const __VLS_component: import('vue').DefineComponent<BottomSheetProps, {
37
37
  teleportTo: string | import('vue').RendererElement;
38
38
  teleportDefer: boolean;
39
39
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
40
- backdrop: import('vue').ShallowUnwrapRef<{}> | null;
41
- sheet: import('vue').ShallowUnwrapRef<{}> | null;
42
- sheetHeader: import('vue').ShallowUnwrapRef<{}> | null;
40
+ backdrop: HTMLDivElement;
41
+ sheet: HTMLDivElement;
42
+ sheetHeader: HTMLDivElement;
43
43
  sheetScroll: HTMLDivElement;
44
- sheetContentWrapper: import('vue').ShallowUnwrapRef<{}> | null;
44
+ sheetContentWrapper: HTMLDivElement;
45
45
  sheetContent: HTMLDivElement;
46
- sheetFooter: import('vue').ShallowUnwrapRef<{}> | null;
46
+ sheetFooter: HTMLDivElement;
47
47
  }, any>;
48
48
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
49
49
  export default _default;
@@ -0,0 +1,13 @@
1
+ export interface SwipeResult {
2
+ direction: 'up' | 'down' | 'none';
3
+ velocity: number;
4
+ isSwipe: boolean;
5
+ }
6
+ export interface UseSwipeDetectionOptions {
7
+ velocityThreshold?: number;
8
+ }
9
+ export declare function useSwipeDetection(options?: UseSwipeDetectionOptions): {
10
+ start: (y: number) => void;
11
+ update: (y: number) => void;
12
+ end: () => SwipeResult;
13
+ };
package/dist/index.mjs CHANGED
@@ -1,83 +1,112 @@
1
- import { ref as P, computed as _, defineComponent as Be, watch as q, onMounted as Ie, toRefs as Ee, nextTick as N, onUnmounted as _e, createBlock as te, openBlock as ae, Teleport as De, createElementVNode as ne, createVNode as $, unref as m, withCtx as E, createCommentVNode as ge, normalizeStyle as He, normalizeClass as oe, renderSlot as le } from "vue";
2
- import { useMotionValue as me, animate as B, AnimatePresence as be, Motion as A } from "motion-v";
3
- import { useVModel as Ve, useWindowSize as Fe, useElementBounding as Q, useScrollLock as ye } from "@vueuse/core";
4
- import { useFocusTrap as Re } from "@vueuse/integrations/useFocusTrap";
5
- function G(n, a) {
6
- const o = parseFloat(n);
7
- return a * o / 100;
1
+ import { ref as g, computed as I, defineComponent as Re, useCssVars as Le, watch as U, onMounted as _e, toRefs as Ae, nextTick as ge, onUnmounted as Ve, createElementBlock as ae, openBlock as V, Fragment as We, createBlock as we, Teleport as Se, createVNode as Ce, Transition as be, withCtx as ye, createCommentVNode as Pe, unref as le, normalizeStyle as ze, createElementVNode as W, normalizeClass as oe, renderSlot as ue } from "vue";
2
+ import { useVModel as Ne, useWindowSize as qe, useElementBounding as J, useScrollLock as Te } from "@vueuse/core";
3
+ import { useFocusTrap as Qe } from "@vueuse/integrations/useFocusTrap";
4
+ function z(o, l) {
5
+ const r = parseFloat(o);
6
+ return l * r / 100;
8
7
  }
9
- function $e(n, a, o) {
10
- const t = P(0), s = _(() => n.value.map((p) => typeof p == "string" ? G(p, o.value) : p)), y = _(() => Math.min(...s.value)), r = _(() => Math.max(...s.value)), h = _(() => {
11
- const p = s.value.reduce(
12
- (g, M) => Math.abs(M - a.value) < Math.abs(g - a.value) ? M : g
8
+ function je(o, l, r) {
9
+ const t = g(0), v = I(() => o.value.map((b) => typeof b == "string" ? z(b, r.value) : b)), C = I(() => Math.min(...v.value)), i = I(() => Math.max(...v.value)), y = I(() => {
10
+ const b = v.value.reduce(
11
+ (P, w) => Math.abs(w - l.value) < Math.abs(P - l.value) ? w : P
13
12
  );
14
- return s.value.indexOf(p);
13
+ return v.value.indexOf(b);
15
14
  });
16
15
  return {
17
16
  currentSnapPointIndex: t,
18
- flattenedSnapPoints: s,
19
- minSnapPoint: y,
20
- maxSnapPoint: r,
21
- closestSnapPointIndex: h
17
+ flattenedSnapPoints: v,
18
+ minSnapPoint: C,
19
+ maxSnapPoint: i,
20
+ closestSnapPointIndex: y
22
21
  };
23
22
  }
24
- function Ae(n, a, o) {
25
- let t = (s) => n(s, ...a);
26
- return o === void 0 ? t : Object.assign(t, { lazy: o, lazyArgs: a });
23
+ function Ge(o = {}) {
24
+ const { velocityThreshold: l = 0.5 } = o, r = g(0), t = g(0), v = g(0), C = g(0), i = g([]);
25
+ return {
26
+ start: (w) => {
27
+ const S = performance.now();
28
+ r.value = w, t.value = S, v.value = w, C.value = S, i.value = [{ y: w, time: S }];
29
+ },
30
+ update: (w) => {
31
+ const S = performance.now();
32
+ v.value = w, C.value = S, i.value.push({ y: w, time: S });
33
+ const M = S - 100;
34
+ i.value = i.value.filter((d) => d.time > M).slice(-5);
35
+ },
36
+ end: () => {
37
+ const w = i.value;
38
+ let S = 0;
39
+ if (w.length >= 2) {
40
+ const h = w[0], D = w[w.length - 1], $ = D.y - h.y, L = D.time - h.time;
41
+ L > 0 && (S = $ / L);
42
+ }
43
+ const M = Math.abs(S) >= l;
44
+ let d = "none";
45
+ return M && (d = S < 0 ? "up" : "down"), i.value = [], {
46
+ direction: d,
47
+ velocity: Math.abs(S),
48
+ isSwipe: M
49
+ };
50
+ }
51
+ };
52
+ }
53
+ function Ke(o, l, r) {
54
+ let t = (v) => o(v, ...l);
55
+ return r === void 0 ? t : Object.assign(t, { lazy: r, lazyArgs: l });
27
56
  }
28
- function We(n, a, o) {
29
- let t = n.length - a.length;
30
- if (t === 0) return n(...a);
31
- if (t === 1) return Ae(n, a, o);
57
+ function Ue(o, l, r) {
58
+ let t = o.length - l.length;
59
+ if (t === 0) return o(...l);
60
+ if (t === 1) return Ke(o, l, r);
32
61
  throw new Error("Wrong number of arguments");
33
62
  }
34
- function je(n, { triggerAt: a = "end", minQuietPeriodMs: o, maxBurstDurationMs: t, minGapMs: s, reducer: y = ze }) {
35
- let r, h, p, g, M = () => {
36
- let i = p;
37
- i !== void 0 && (p = void 0, n(i), s !== void 0 && (h = setTimeout(D, s)));
38
- }, D = () => {
39
- clearTimeout(h), h = void 0, r === void 0 && M();
40
- }, H = () => {
41
- clearTimeout(r), r = void 0, g = void 0, h === void 0 && M();
63
+ function Je(o, { triggerAt: l = "end", minQuietPeriodMs: r, maxBurstDurationMs: t, minGapMs: v, reducer: C = Xe }) {
64
+ let i, y, b, P, w = () => {
65
+ let d = b;
66
+ d !== void 0 && (b = void 0, o(d), v !== void 0 && (y = setTimeout(S, v)));
67
+ }, S = () => {
68
+ clearTimeout(y), y = void 0, i === void 0 && w();
69
+ }, M = () => {
70
+ clearTimeout(i), i = void 0, P = void 0, y === void 0 && w();
42
71
  };
43
- return { call: (...i) => {
44
- let c = r === void 0 && h === void 0;
45
- if ((a !== "start" || c) && (p = y(p, ...i)), !(r === void 0 && !c)) {
46
- if (o !== void 0 || t !== void 0 || s === void 0) {
47
- clearTimeout(r);
48
- let C = Date.now();
49
- g ?? (g = C);
50
- let W = t === void 0 ? o ?? 0 : Math.min(o ?? t, t - (C - g));
51
- r = setTimeout(H, W);
72
+ return { call: (...d) => {
73
+ let h = i === void 0 && y === void 0;
74
+ if ((l !== "start" || h) && (b = C(b, ...d)), !(i === void 0 && !h)) {
75
+ if (r !== void 0 || t !== void 0 || v === void 0) {
76
+ clearTimeout(i);
77
+ let D = Date.now();
78
+ P ?? (P = D);
79
+ let $ = t === void 0 ? r ?? 0 : Math.min(r ?? t, t - (D - P));
80
+ i = setTimeout(M, $);
52
81
  }
53
- a !== "end" && c && M();
82
+ l !== "end" && h && w();
54
83
  }
55
84
  }, cancel: () => {
56
- clearTimeout(r), r = void 0, g = void 0, clearTimeout(h), h = void 0, p = void 0;
85
+ clearTimeout(i), i = void 0, P = void 0, clearTimeout(y), y = void 0, b = void 0;
57
86
  }, flush: () => {
58
- H(), D();
87
+ M(), S();
59
88
  }, get isIdle() {
60
- return r === void 0 && h === void 0;
89
+ return i === void 0 && y === void 0;
61
90
  } };
62
91
  }
63
- var ze = () => "";
64
- function b(...n) {
65
- return We(Le, n);
92
+ var Xe = () => "";
93
+ function T(...o) {
94
+ return Ue(Ze, o);
66
95
  }
67
- var Le = (n, { min: a, max: o }) => a !== void 0 && n < a ? a : o !== void 0 && n > o ? o : n;
68
- function qe(n, a, o) {
69
- return Math.max(a, Math.min(n, o));
96
+ var Ze = (o, { min: l, max: r }) => l !== void 0 && o < l ? l : r !== void 0 && o > r ? r : o;
97
+ function et(o, l, r) {
98
+ return Math.max(l, Math.min(o, r));
70
99
  }
71
- function Ne(n, a) {
72
- return Math.pow(n, a * 5);
100
+ function tt(o, l) {
101
+ return Math.pow(o, l * 5);
73
102
  }
74
- function Se(n, a, o) {
75
- return a === 0 || Math.abs(a) === 1 / 0 ? Ne(n, o) : n * a * o / (a + o * n);
103
+ function ke(o, l, r) {
104
+ return l === 0 || Math.abs(l) === 1 / 0 ? tt(o, r) : o * l * r / (l + r * o);
76
105
  }
77
- function ue(n, a, o, t = 0.15) {
78
- return t === 0 ? qe(n, a, o) : n < a ? -Se(a - n, o - a, t) + a : n > o ? +Se(n - o, o - a, t) + o : n;
106
+ function se(o, l, r, t = 0.15) {
107
+ return t === 0 ? et(o, l, r) : o < l ? -ke(l - o, r - l, t) + l : o > r ? +ke(o - r, r - l, t) + r : o;
79
108
  }
80
- const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
109
+ const nt = ["data-vsbs-shadow", "data-vsbs-sheet-show"], at = /* @__PURE__ */ Re({
81
110
  __name: "BottomSheet",
82
111
  props: {
83
112
  duration: { default: 250 },
@@ -85,6 +114,7 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
85
114
  initialSnapPoint: {},
86
115
  blocking: { type: Boolean, default: !0 },
87
116
  canSwipeClose: { type: Boolean, default: !0 },
117
+ swipeCloseThreshold: {},
88
118
  canBackdropClose: { type: Boolean, default: !0 },
89
119
  expandOnContentDrag: { type: Boolean, default: !0 },
90
120
  modelValue: { type: Boolean },
@@ -95,323 +125,385 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
95
125
  footerClass: {}
96
126
  },
97
127
  emits: ["opened", "opening-started", "closed", "closing-started", "ready", "dragging-up", "dragging-down", "snapped", "instinctHeight", "update:modelValue"],
98
- setup(n, { expose: a, emit: o }) {
99
- const t = n, s = o, y = Ve(t, "modelValue", s, {
128
+ setup(o, { expose: l, emit: r }) {
129
+ Le((e) => ({
130
+ "55bcd70e": xe.value
131
+ }));
132
+ const t = o, v = r, C = Ne(t, "modelValue", v, {
100
133
  passive: !0
101
134
  });
102
- q(y, (e) => {
103
- e && X();
104
- }), Ie(() => {
105
- y.value && X();
135
+ U(C, (e) => {
136
+ e && te();
137
+ }), _e(() => {
138
+ C.value && te();
106
139
  });
107
- const r = P(), h = P(null), p = P(null), g = P(null), M = P(null), D = P(null), H = P(null), i = P(t.expandOnContentDrag), { height: c } = Fe(), { height: C } = Q(r), { height: W } = Q(h), { height: se } = Q(D), { height: re } = Q(p), K = _({
140
+ const i = g(null), y = g(null), b = g(null), P = g(null), w = g(null), S = g(null), M = g(null), d = g(t.expandOnContentDrag), { height: h } = qe(), { height: D } = J(i), { height: $ } = J(y), { height: L } = J(S), { height: re } = J(b), X = I({
108
141
  get() {
109
- return b(
110
- Math.ceil(se.value + W.value + re.value),
142
+ return T(
143
+ Math.ceil(L.value + $.value + re.value),
111
144
  {
112
- max: c.value
145
+ max: h.value
113
146
  }
114
147
  );
115
148
  },
116
149
  set(e) {
117
- [W.value, se.value, re.value] = e;
150
+ [$.value, L.value, re.value] = e;
118
151
  }
119
- }), l = P(0), v = P(0), k = me(0), S = me(0), { snapPoints: Pe } = Ee(t), d = _(() => Pe.value ?? [K.value]), {
120
- flattenedSnapPoints: U,
121
- currentSnapPointIndex: I,
122
- closestSnapPointIndex: V,
152
+ }), a = g(0), u = g(0), xe = I(() => t.duration + "ms"), { snapPoints: Ye } = Ae(t), f = I(() => Ye.value ?? [X.value]), {
153
+ flattenedSnapPoints: k,
154
+ currentSnapPointIndex: B,
155
+ closestSnapPointIndex: F,
123
156
  minSnapPoint: O,
124
- maxSnapPoint: F
125
- } = $e(d, l, c);
126
- let w;
127
- const j = ye(document.body), z = ye(document.documentElement), Y = Re([r, H], {
157
+ maxSnapPoint: _
158
+ } = je(f, a, h), N = Te(document.body), q = Te(document.documentElement), E = g(!1), A = g(0), Q = g(0), j = g(0), H = g(0), G = g(!0), R = Ge({ velocityThreshold: 0.5 }), Z = Qe([i, M], {
128
159
  immediate: !1,
129
- fallbackFocus: () => {
130
- var e;
131
- return ((e = r.value) == null ? void 0 : e.$el) || document.body;
132
- }
160
+ fallbackFocus: () => i.value || document.body
133
161
  });
134
162
  function ie(e) {
135
- i.value = !0, ve(e);
163
+ d.value = !0, ve(e);
136
164
  }
137
165
  function ve(e) {
138
- i.value && e.preventDefault();
166
+ d.value && e.preventDefault();
139
167
  }
140
- const de = (e) => {
141
- e.key === "Escape" && L();
142
- }, Ce = () => {
143
- t.canBackdropClose && L();
168
+ const ce = (e) => {
169
+ e.key === "Escape" && x();
170
+ }, Me = () => {
171
+ t.canBackdropClose && x();
144
172
  };
145
- let J = !1;
146
- const X = async () => {
147
- if (J) return;
148
- y.value = !0, J = !0, s("opening-started"), t.blocking && (j.value = !0, z.value = !0), await N();
149
- const e = r.value.$el;
150
- C.value = e.getBoundingClientRect().height;
151
- const u = e.querySelector("[data-vsbs-content]"), f = e.querySelector("[data-vsbs-header]"), T = e.querySelector("[data-vsbs-footer]");
152
- if (K.value = [
153
- f.getBoundingClientRect().height,
154
- u.getBoundingClientRect().height,
155
- T.getBoundingClientRect().height
156
- ], await N(), I.value = U.value.findIndex(
157
- (x) => x === O.value
173
+ let ee = !1;
174
+ const te = async () => {
175
+ if (ee) return;
176
+ C.value = !0, ee = !0, v("opening-started"), t.blocking && (N.value = !0, q.value = !0), await ge();
177
+ const e = i.value;
178
+ D.value = e.getBoundingClientRect().height;
179
+ const n = e.querySelector("[data-vsbs-content]"), s = e.querySelector("[data-vsbs-header]"), p = e.querySelector("[data-vsbs-footer]");
180
+ if (X.value = [
181
+ s.getBoundingClientRect().height,
182
+ n.getBoundingClientRect().height,
183
+ p.getBoundingClientRect().height
184
+ ], await ge(), B.value = k.value.findIndex(
185
+ (c) => c === O.value
158
186
  ), t.initialSnapPoint) {
159
- const x = t.initialSnapPoint;
160
- if (x < 0 || x >= d.value.length) {
187
+ const c = t.initialSnapPoint;
188
+ if (c < 0 || c >= f.value.length) {
161
189
  console.warn("Index out of bounds");
162
190
  return;
163
191
  }
164
- let R;
165
- typeof d.value[x] == "number" ? R = b(d.value[x], {
166
- max: c.value
167
- }) : R = G(d.value[x], c.value), l.value = R;
192
+ let m;
193
+ typeof f.value[c] == "number" ? m = T(f.value[c], {
194
+ max: h.value
195
+ }) : m = z(f.value[c], h.value), a.value = m;
168
196
  } else
169
- l.value = b(O.value, {
170
- max: c.value
197
+ a.value = T(O.value, {
198
+ max: h.value
171
199
  });
172
- v.value = l.value, k.jump(l.value), S.jump(l.value), requestAnimationFrame(() => {
173
- w = B(k, l.value, {
174
- duration: t.duration / 1e3,
175
- ease: "easeInOut"
176
- }), w = B(S, 0, {
177
- duration: t.duration / 1e3,
178
- ease: "easeInOut",
179
- onComplete: () => {
180
- t.blocking && (s("opened"), Y.activate());
181
- }
182
- });
183
- }), window.addEventListener("keydown", de), J = !1;
200
+ u.value = a.value, requestAnimationFrame(() => {
201
+ u.value = 0, t.blocking && setTimeout(() => {
202
+ C.value && (v("opened"), Z.activate());
203
+ }, t.duration);
204
+ }), window.addEventListener("keydown", ce), ee = !1;
184
205
  };
185
- let Z = !1;
186
- const L = () => {
187
- Z || (y.value = !1, Z = !0, s("closing-started"), t.blocking && (j.value = !1, z.value = !1), window.removeEventListener("keydown", de), t.blocking && Y.deactivate(), setTimeout(() => {
188
- s("closed"), Z = !1;
206
+ let ne = !1;
207
+ const x = () => {
208
+ ne || (C.value = !1, ne = !0, v("closing-started"), t.blocking && (N.value = !1, q.value = !1), window.removeEventListener("keydown", ce), t.blocking && Z.deactivate(), u.value = a.value, setTimeout(() => {
209
+ v("closed"), ne = !1;
189
210
  }, t.duration));
190
- }, ce = (e) => {
191
- if (!d.value) return;
192
- if (e < 0 || e >= d.value.length) {
211
+ }, de = (e) => {
212
+ if (!f.value) return;
213
+ if (e < 0 || e >= f.value.length) {
193
214
  console.warn("Index out of bounds");
194
215
  return;
195
216
  }
196
- I.value = e;
197
- let u;
198
- typeof d.value[e] == "number" ? u = b(d.value[e], {
199
- max: c.value
200
- }) : u = G(d.value[e], c.value), l.value = u, w = B(k, l.value, {
201
- duration: t.duration / 1e3,
202
- ease: "easeInOut",
203
- onComplete: () => s("snapped", d.value.indexOf(d.value[e]))
204
- });
217
+ B.value = e;
218
+ let n;
219
+ typeof f.value[e] == "number" ? n = T(f.value[e], {
220
+ max: h.value
221
+ }) : n = z(f.value[e], h.value), a.value = n, v("snapped", f.value.indexOf(f.value[e]));
205
222
  };
206
223
  function fe(e) {
207
- e > 0 ? s("dragging-down") : e < 0 && s("dragging-up");
224
+ e > 0 ? v("dragging-down") : e < 0 && v("dragging-up");
208
225
  }
209
- const pe = () => {
210
- l.value = C.value, v.value = S.get(), k.jump(l.value), S.jump(v.value);
211
- }, he = async (e, u) => {
212
- await N(), r.value && (v.value <= 0 && (l.value -= u.delta.y), l.value <= O.value && (l.value = O.value, v.value += u.delta.y, S.set(
213
- t.canSwipeClose ? b(v.value, { min: 0 }) : b(ue(v.value, -C.value, 0, 0.5), {
214
- min: 0
215
- })
216
- )), k.set(
217
- b(ue(l.value, 0, F.value, 0.25), {
218
- min: 0,
219
- max: c.value
220
- })
221
- ), fe(u.delta.y));
222
- }, ee = () => {
223
- v.value = t.canSwipeClose ? [0, l.value].reduce(
224
- (u, f) => Math.abs(f - v.value) < Math.abs(u - v.value) ? f : u
225
- ) : 0, w = B(S, v.value, {
226
- duration: t.duration / 1e3,
227
- ease: "easeInOut"
228
- }), v.value === l.value && (v.value = 0, L()), I.value = V.value;
229
- let e;
230
- typeof d.value[V.value] == "number" ? e = b(d.value[V.value], {
231
- max: c.value
232
- }) : e = G(
233
- d.value[V.value],
234
- c.value
235
- ), l.value = e, w = B(k, l.value, {
236
- duration: t.duration / 1e3,
237
- ease: "easeInOut",
238
- onComplete: () => s(
239
- "snapped",
240
- d.value.indexOf(d.value[V.value])
241
- )
242
- }), w = B(S, 0, {
243
- duration: t.duration / 1e3,
244
- ease: "easeInOut"
245
- });
246
- }, ke = (e, u) => {
247
- if (l.value = C.value, v.value = S.get(), w && w.stop(), !g.value) return;
248
- const f = g.value.scrollTop === 0, T = u.delta.y > 0, x = U.value.length === 1, R = 0.5 > Math.abs(l.value - F.value);
249
- if (x) {
226
+ const pe = (e) => {
227
+ if (!i.value) return;
228
+ const n = window.getComputedStyle(i.value), s = parseFloat(n.height);
229
+ let p = 0;
230
+ n.transform && n.transform !== "none" && (p = new DOMMatrix(n.transform).m42), a.value = s, u.value = p, E.value = !0, A.value = e.clientY, Q.value = a.value, j.value = u.value, H.value = e.clientY, R.start(e.clientY), e.target.setPointerCapture(e.pointerId);
231
+ }, he = (e) => {
232
+ if (!E.value) return;
233
+ const n = e.clientY - A.value, s = e.clientY;
234
+ u.value <= 0 && (a.value = Q.value - n), a.value <= O.value && (a.value = O.value, u.value = j.value + n, t.canSwipeClose ? u.value = T(u.value, { min: 0 }) : u.value = T(
235
+ se(u.value, -D.value, 0, 0.5),
236
+ { min: 0 }
237
+ )), a.value = T(se(a.value, 0, _.value, 0.25), {
238
+ min: 0,
239
+ max: h.value
240
+ }), fe(e.clientY - H.value), R.update(e.clientY), H.value = s;
241
+ }, K = (e) => {
242
+ if (E.value = !1, e.target.releasePointerCapture(e.pointerId), t.canSwipeClose) {
243
+ let c = a.value / 2;
244
+ if (t.swipeCloseThreshold && typeof t.swipeCloseThreshold == "number" && (c = t.swipeCloseThreshold), t.swipeCloseThreshold && typeof t.swipeCloseThreshold == "string" && t.swipeCloseThreshold.includes("%") && (c = a.value * (Number(t.swipeCloseThreshold.replace("%", "")) / 100)), u.value > c) {
245
+ u.value = a.value, x();
246
+ return;
247
+ }
248
+ } else
249
+ u.value = 0;
250
+ if (u.value === a.value) {
251
+ u.value = 0, x();
252
+ return;
253
+ }
254
+ const n = R.end();
255
+ if (n.isSwipe && n.direction === "down" && t.canSwipeClose && a.value <= O.value + 10) {
256
+ u.value = a.value, x();
257
+ return;
258
+ }
259
+ let s;
260
+ if (n.isSwipe && k.value.length > 1) {
261
+ const c = [...k.value].sort((m, Y) => m - Y);
262
+ if (n.direction === "up") {
263
+ const m = c.find((Y) => Y > a.value + 1);
264
+ s = m !== void 0 ? k.value.indexOf(m) : F.value;
265
+ } else {
266
+ const m = [...c].reverse().find((Y) => Y < a.value - 1);
267
+ s = m !== void 0 ? k.value.indexOf(m) : F.value;
268
+ }
269
+ } else
270
+ s = F.value;
271
+ B.value = s;
272
+ let p;
273
+ if (typeof f.value[s] == "number" ? p = T(f.value[s], {
274
+ max: h.value
275
+ }) : p = z(
276
+ f.value[s],
277
+ h.value
278
+ ), p === 0) {
279
+ x();
280
+ return;
281
+ }
282
+ a.value = p, u.value = 0, v("snapped", f.value.indexOf(f.value[s]));
283
+ }, De = (e) => {
284
+ if (!P.value) return;
285
+ const n = P.value.scrollTop === 0, s = e > 0, p = k.value.length === 1, c = 0.5 > Math.abs(a.value - _.value);
286
+ if (console.log(e), p) {
250
287
  if (!t.expandOnContentDrag) {
251
- i.value = !1;
288
+ d.value = !1;
252
289
  return;
253
290
  }
254
- S.get() === 0 && f && T && (i.value = !0), S.get() === 0 && f && !T && (i.value = !1);
291
+ u.value === 0 && n && s && (d.value = !0), u.value === 0 && n && !s && (d.value = !1);
255
292
  } else {
256
293
  if (!t.expandOnContentDrag) {
257
- i.value = !1;
294
+ d.value = !1;
258
295
  return;
259
296
  }
260
- i.value = !0, R && (T && f && (i.value = !0), !T && f && (i.value = !1), f || (i.value = !1));
297
+ d.value = !0, c && (s && n && (d.value = !0), !s && n && (d.value = !1), n || (d.value = !1));
261
298
  }
262
- }, we = async (e, u) => {
263
- if (await N(), !t.expandOnContentDrag) {
264
- i.value = !1;
299
+ }, Oe = (e) => {
300
+ if (!i.value) return;
301
+ const n = window.getComputedStyle(i.value), s = parseFloat(n.height);
302
+ let p = 0;
303
+ n.transform && n.transform !== "none" && (p = new DOMMatrix(n.transform).m42), a.value = s, u.value = p, E.value = !0, A.value = e.clientY, Q.value = a.value, j.value = u.value, H.value = e.clientY, G.value = !0, R.start(e.clientY), e.target.setPointerCapture(e.pointerId);
304
+ }, Be = (e) => {
305
+ if (!E.value) return;
306
+ if (!t.expandOnContentDrag) {
307
+ d.value = !1;
265
308
  return;
266
309
  }
267
- if (!r.value) return;
268
- v.value === 0 && i.value && t.expandOnContentDrag && (l.value -= u.delta.y), l.value <= O.value && (l.value = O.value, i.value && t.expandOnContentDrag && (v.value += u.delta.y), v.value = b(v.value, { min: 0, max: O.value }), S.set(
269
- t.canSwipeClose ? b(v.value, { min: 0 }) : b(ue(v.value, -C.value, 0, 0.5), {
270
- min: 0
271
- })
272
- )), l.value > F.value && (l.value = F.value), l.value = b(l.value, { max: c.value }), U.value.length === 1 || l.value === F.value && (i.value = !1), k.set(l.value), fe(u.delta.y);
273
- }, Te = () => {
274
- t.blocking || (j.value = !0, z.value = !0);
275
- }, xe = () => {
276
- t.blocking || (j.value = !1, z.value = !1);
277
- }, Me = () => {
278
- if (!g.value) return;
279
- const e = g.value.scrollTop === 0;
280
- i.value = e;
281
- }, Oe = je((e) => ce(e), {
310
+ const n = e.clientY - A.value, s = e.clientY, p = e.clientY - H.value;
311
+ if (G.value) {
312
+ const m = e.clientY - A.value;
313
+ if (Math.abs(m) > 3)
314
+ G.value = !1, De(m);
315
+ else {
316
+ H.value = s;
317
+ return;
318
+ }
319
+ }
320
+ u.value === 0 && d.value && t.expandOnContentDrag && (a.value = Q.value - n), a.value <= O.value && (a.value = O.value, d.value && t.expandOnContentDrag && (u.value = j.value + n), u.value = T(u.value, { min: 0, max: O.value }), t.canSwipeClose ? u.value = T(u.value, { min: 0 }) : u.value = T(
321
+ se(u.value, -D.value, 0, 0.5),
322
+ { min: 0 }
323
+ )), a.value > _.value && (a.value = _.value), a.value = T(a.value, { max: h.value }), k.value.length === 1 || a.value === _.value && (d.value = !1), fe(p), R.update(e.clientY), H.value = s;
324
+ }, me = (e) => {
325
+ if (E.value = !1, G.value = !0, e.target.releasePointerCapture(e.pointerId), t.canSwipeClose) {
326
+ let c = a.value / 2;
327
+ if (t.swipeCloseThreshold && typeof t.swipeCloseThreshold == "number" && (c = t.swipeCloseThreshold), t.swipeCloseThreshold && typeof t.swipeCloseThreshold == "string" && t.swipeCloseThreshold.includes("%") && (c = a.value * (Number(t.swipeCloseThreshold.replace("%", "")) / 100)), u.value > c) {
328
+ u.value = a.value, x();
329
+ return;
330
+ }
331
+ } else
332
+ u.value = 0;
333
+ if (u.value === a.value) {
334
+ u.value = 0, x();
335
+ return;
336
+ }
337
+ const n = R.end();
338
+ if (n.isSwipe && n.direction === "down" && t.canSwipeClose && a.value <= O.value + 10) {
339
+ u.value = a.value, x();
340
+ return;
341
+ }
342
+ let s;
343
+ if (n.isSwipe && k.value.length > 1) {
344
+ const c = [...k.value].sort((m, Y) => m - Y);
345
+ if (n.direction === "up") {
346
+ const m = c.find((Y) => Y > a.value + 1);
347
+ s = m !== void 0 ? k.value.indexOf(m) : F.value;
348
+ } else {
349
+ const m = [...c].reverse().find((Y) => Y < a.value - 1);
350
+ s = m !== void 0 ? k.value.indexOf(m) : F.value;
351
+ }
352
+ } else
353
+ s = F.value;
354
+ B.value = s;
355
+ let p;
356
+ if (typeof f.value[s] == "number" ? p = T(f.value[s], {
357
+ max: h.value
358
+ }) : p = z(
359
+ f.value[s],
360
+ h.value
361
+ ), p === 0) {
362
+ x();
363
+ return;
364
+ }
365
+ a.value = p, u.value = 0, v("snapped", f.value.indexOf(f.value[s]));
366
+ }, Ee = () => {
367
+ t.blocking || (N.value = !0, q.value = !0);
368
+ }, He = () => {
369
+ t.blocking || (N.value = !1, q.value = !1);
370
+ }, Ie = () => {
371
+ if (!P.value) return;
372
+ const e = P.value.scrollTop === 0;
373
+ d.value = e;
374
+ }, $e = Je((e) => de(e), {
282
375
  minQuietPeriodMs: t.duration,
283
- reducer: (e, u) => u
376
+ reducer: (e, n) => n
284
377
  });
285
- return q(d, (e, u) => {
286
- if (y.value === !1 || !e || !u) return;
287
- const f = e[I.value], T = u[I.value];
288
- typeof f != "string" && typeof T != "string" && (l.value = b(f, {
289
- max: c.value
290
- }), f !== T && (w = B(k, l.value, {
291
- duration: t.duration / 1e3,
292
- ease: "easeInOut"
293
- })));
294
- }), q(c, () => {
295
- Oe.call(I.value);
296
- }), q(K, (e) => {
297
- s("instinctHeight", e);
298
- }), _e(() => {
299
- Y.deactivate();
300
- }), a({ open: X, close: L, snapToPoint: ce }), (e, u) => (ae(), te(De, {
301
- to: e.teleportTo,
302
- defer: e.teleportDefer
303
- }, [
304
- ne("div", Qe, [
305
- $(m(be), null, {
306
- default: E(() => [
307
- m(y) && e.blocking ? (ae(), te(m(A), {
378
+ U(f, (e, n) => {
379
+ if (C.value === !1 || !e || !n) return;
380
+ const s = e[B.value], p = n[B.value];
381
+ typeof s != "string" && typeof p != "string" && (a.value = T(s, {
382
+ max: h.value
383
+ }));
384
+ }), U(h, () => {
385
+ $e.call(B.value);
386
+ }), U(X, (e) => {
387
+ v("instinctHeight", e);
388
+ }), Ve(() => {
389
+ Z.deactivate();
390
+ });
391
+ const Fe = (e) => {
392
+ const n = e;
393
+ n.style.transition = `transform ${t.duration}ms ease, height ${t.duration}ms ease`, n.style.transform = `translateY(${a.value}px)`;
394
+ };
395
+ return l({ open: te, close: x, snapToPoint: de }), (e, n) => (V(), ae(We, null, [
396
+ (V(), we(Se, {
397
+ to: e.teleportTo,
398
+ defer: e.teleportDefer
399
+ }, [
400
+ Ce(be, { name: "vsbs-backdrop" }, {
401
+ default: ye(() => [
402
+ le(C) && e.blocking ? (V(), ae("div", {
308
403
  key: 0,
309
404
  ref_key: "backdrop",
310
- ref: H,
405
+ ref: M,
311
406
  "data-vsbs-backdrop": "",
312
- onClick: u[0] || (u[0] = (f) => Ce()),
313
- transition: {
314
- ease: "easeInOut",
315
- duration: e.duration / 1e3
316
- },
317
- initial: { opacity: 0 },
318
- animate: { opacity: 1 },
319
- exit: { opacity: 0 }
320
- }, null, 8, ["transition"])) : ge("", !0)
407
+ onClick: n[0] || (n[0] = (s) => Me())
408
+ }, null, 512)) : Pe("", !0)
321
409
  ]),
322
410
  _: 1
323
- }),
324
- $(m(be), null, {
325
- default: E(() => [
326
- m(y) ? (ae(), te(m(A), {
411
+ })
412
+ ], 8, ["to", "defer"])),
413
+ (V(), we(Se, {
414
+ to: e.teleportTo,
415
+ defer: e.teleportDefer
416
+ }, [
417
+ Ce(be, {
418
+ name: "vsbs-sheet",
419
+ onLeave: Fe
420
+ }, {
421
+ default: ye(() => [
422
+ le(C) ? (V(), ae("div", {
327
423
  key: 0,
328
424
  ref_key: "sheet",
329
- ref: r,
330
- exit: { y: "100%", height: m(C) },
331
- initial: !1,
332
- style: He({ y: m(S), height: m(k) }),
425
+ ref: i,
426
+ style: ze({
427
+ transform: `translateY(${u.value}px)`,
428
+ height: `${a.value}px`,
429
+ transition: E.value ? "none" : `transform ${e.duration}ms ease, height ${e.duration}ms ease`
430
+ }),
333
431
  "data-vsbs-shadow": !e.blocking,
334
- "data-vsbs-sheet-show": m(y),
432
+ "data-vsbs-sheet-show": le(C),
335
433
  "aria-modal": "true",
336
434
  "data-vsbs-sheet": "",
337
435
  tabindex: "-1",
338
- onTouchstart: Te,
339
- onTouchend: xe
340
- }, {
341
- default: E(() => [
342
- $(m(A), {
343
- ref_key: "sheetHeader",
344
- ref: h,
345
- "data-vsbs-header": "",
346
- onPanStart: pe,
347
- onPan: he,
348
- onPanEnd: ee,
349
- onTouchmove: ie,
350
- class: oe(e.headerClass)
351
- }, {
352
- default: E(() => [
353
- le(e.$slots, "header", {}, void 0, !0)
354
- ]),
355
- _: 3
356
- }, 8, ["class"]),
357
- ne("div", {
358
- ref_key: "sheetScroll",
359
- ref: g,
360
- "data-vsbs-scroll": "",
361
- onScrollend: Me
436
+ onTouchstart: Ee,
437
+ onTouchend: He
438
+ }, [
439
+ W("div", {
440
+ ref_key: "sheetHeader",
441
+ ref: y,
442
+ "data-vsbs-header": "",
443
+ onPointerdown: pe,
444
+ onPointermove: he,
445
+ onPointerup: K,
446
+ onPointercancel: K,
447
+ onTouchmove: ie,
448
+ class: oe(e.headerClass),
449
+ style: { "touch-action": "none" }
450
+ }, [
451
+ ue(e.$slots, "header", {}, void 0, !0)
452
+ ], 34),
453
+ W("div", {
454
+ ref_key: "sheetScroll",
455
+ ref: P,
456
+ "data-vsbs-scroll": "",
457
+ onScrollend: Ie
458
+ }, [
459
+ W("div", {
460
+ ref_key: "sheetContentWrapper",
461
+ ref: w,
462
+ "data-vsbs-content-wrapper": "",
463
+ onPointerdown: Oe,
464
+ onPointermove: Be,
465
+ onPointerup: me,
466
+ onPointercancel: me,
467
+ onTouchmove: ve,
468
+ style: { touchAction: "pan-y" }
362
469
  }, [
363
- $(m(A), {
364
- ref_key: "sheetContentWrapper",
365
- ref: M,
366
- "data-vsbs-content-wrapper": "",
367
- onPanStart: ke,
368
- onPan: we,
369
- onPanEnd: ee,
370
- onTouchmove: ve
371
- }, {
372
- default: E(() => [
373
- ne("div", {
374
- ref_key: "sheetContent",
375
- ref: D,
376
- "data-vsbs-content": "",
377
- class: oe(e.contentClass)
378
- }, [
379
- le(e.$slots, "default", {}, void 0, !0)
380
- ], 2)
381
- ]),
382
- _: 3
383
- }, 512)
384
- ], 544),
385
- $(m(A), {
386
- ref_key: "sheetFooter",
387
- ref: p,
388
- "data-vsbs-footer": "",
389
- onPanStart: pe,
390
- onPan: he,
391
- onPanEnd: ee,
392
- onTouchmove: ie,
393
- class: oe(e.footerClass)
394
- }, {
395
- default: E(() => [
396
- le(e.$slots, "footer", {}, void 0, !0)
397
- ]),
398
- _: 3
399
- }, 8, ["class"])
400
- ]),
401
- _: 3
402
- }, 8, ["exit", "style", "data-vsbs-shadow", "data-vsbs-sheet-show"])) : ge("", !0)
470
+ W("div", {
471
+ ref_key: "sheetContent",
472
+ ref: S,
473
+ "data-vsbs-content": "",
474
+ class: oe(e.contentClass)
475
+ }, [
476
+ ue(e.$slots, "default", {}, void 0, !0)
477
+ ], 2)
478
+ ], 544)
479
+ ], 544),
480
+ W("div", {
481
+ ref_key: "sheetFooter",
482
+ ref: b,
483
+ "data-vsbs-footer": "",
484
+ onPointerdown: pe,
485
+ onPointermove: he,
486
+ onPointerup: K,
487
+ onPointercancel: K,
488
+ onTouchmove: ie,
489
+ class: oe(e.footerClass),
490
+ style: { "touch-action": "none" }
491
+ }, [
492
+ ue(e.$slots, "footer", {}, void 0, !0)
493
+ ], 34)
494
+ ], 44, nt)) : Pe("", !0)
403
495
  ]),
404
496
  _: 3
405
497
  })
406
- ])
407
- ], 8, ["to", "defer"]));
498
+ ], 8, ["to", "defer"]))
499
+ ], 64));
408
500
  }
409
- }), Ke = (n, a) => {
410
- const o = n.__vccOpts || n;
411
- for (const [t, s] of a)
412
- o[t] = s;
413
- return o;
414
- }, Ze = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-3c41a73f"]]);
501
+ }), lt = (o, l) => {
502
+ const r = o.__vccOpts || o;
503
+ for (const [t, v] of l)
504
+ r[t] = v;
505
+ return r;
506
+ }, rt = /* @__PURE__ */ lt(at, [["__scopeId", "data-v-ac41efee"]]);
415
507
  export {
416
- Ze as default
508
+ rt as default
417
509
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- [data-vsbs-container][data-v-3c41a73f]{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;pointer-events:none;z-index:9999;visibility:visible}[data-vsbs-backdrop][data-v-3c41a73f]{background-color:var(--vsbs-backdrop-bg, rgba(0, 0, 0, .5));top:0;right:0;bottom:0;left:0;pointer-events:auto;position:fixed;-webkit-user-select:none;user-select:none;will-change:opacity;z-index:1}[data-vsbs-shadow=true][data-v-3c41a73f]:before{content:"";z-index:-1;position:absolute;top:0;height:100lvh;width:100%;border-radius:var(--vsbs-border-radius, 16px);box-shadow:0 -5px 60px 0 var(--vsbs-shadow-color, rgba(89, 89, 89, .2))}[data-vsbs-sheet][data-v-3c41a73f]{background-color:var(--vsbs-background, #fff);border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);border-right:1px solid var(--vsbs-outer-border-color, transparent);border-left:1px solid var(--vsbs-outer-border-color, transparent);bottom:0;display:flex;flex-direction:column;left:0;margin-left:auto;margin-right:auto;max-height:inherit;max-width:var(--vsbs-max-width, 640px);pointer-events:all;position:fixed;right:0;width:100%;will-change:height;z-index:2}[data-vsbs-sheet-show=true][data-v-3c41a73f]{visibility:visible}[data-vsbs-header][data-v-3c41a73f]{box-shadow:0 1px 0 var(--vsbs-border-color, rgba(46, 59, 66, .125));flex-shrink:0;padding:20px var(--vsbs-padding-x, 16px) 8px;-webkit-user-select:none;user-select:none;z-index:3;border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);border-top:1px solid var(--vsbs-outer-border-color, transparent)}[data-vsbs-header][data-v-3c41a73f]:before{background-color:var(--vsbs-handle-background, rgba(0, 0, 0, .28));border-radius:2px;content:"";display:block;height:4px;left:50%;position:absolute;top:8px;transform:translate(-50%);width:36px}[data-vsbs-header][data-v-3c41a73f]:empty{box-shadow:none;padding:14px var(--vsbs-padding-x, 16px) 10px}[data-vsbs-footer][data-v-3c41a73f]{box-shadow:0 -1px 0 var(--vsbs-border-color, rgba(46, 59, 66, .125));flex-grow:0;flex-shrink:0;padding:16px var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}[data-vsbs-footer][data-v-3c41a73f]:empty{display:none}[data-vsbs-scroll][data-v-3c41a73f]{flex-grow:1;overflow-y:auto;overscroll-behavior:none}[data-vsbs-content-wrapper][data-v-3c41a73f]{height:100%}[data-vsbs-content][data-v-3c41a73f]{display:grid;padding:8px var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}
1
+ [data-vsbs-backdrop][data-v-ac41efee]{background-color:var(--vsbs-backdrop-bg, rgba(0, 0, 0, .5));top:0;right:0;bottom:0;left:0;pointer-events:auto;position:fixed;-webkit-user-select:none;user-select:none;will-change:opacity;--vsbs-duration: var(--55bcd70e)}[data-vsbs-shadow=true][data-v-ac41efee]:before{content:"";z-index:-1;position:absolute;top:0;height:100lvh;width:100%;border-radius:var(--vsbs-border-radius, 16px);box-shadow:0 -5px 60px 0 var(--vsbs-shadow-color, rgba(89, 89, 89, .2))}[data-vsbs-sheet][data-v-ac41efee]{background-color:var(--vsbs-background, #fff);border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);border-right:1px solid var(--vsbs-outer-border-color, transparent);border-left:1px solid var(--vsbs-outer-border-color, transparent);bottom:0;display:flex;flex-direction:column;left:0;margin-left:auto;margin-right:auto;max-width:var(--vsbs-max-width, 640px);pointer-events:all;position:fixed;right:0;width:100%;will-change:height,transform}[data-vsbs-sheet-show=true][data-v-ac41efee]{visibility:visible}[data-vsbs-header][data-v-ac41efee]{box-shadow:0 1px 0 var(--vsbs-border-color, rgba(46, 59, 66, .125));flex-shrink:0;padding:20px var(--vsbs-padding-x, 16px) 8px;-webkit-user-select:none;user-select:none;z-index:3;border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);border-top:1px solid var(--vsbs-outer-border-color, transparent)}[data-vsbs-header][data-v-ac41efee]:before{background-color:var(--vsbs-handle-background, rgba(0, 0, 0, .28));border-radius:2px;content:"";display:block;height:4px;left:50%;position:absolute;top:8px;transform:translate(-50%);width:36px}[data-vsbs-header][data-v-ac41efee]:empty{box-shadow:none;padding:14px var(--vsbs-padding-x, 16px) 10px}[data-vsbs-footer][data-v-ac41efee]{box-shadow:0 -1px 0 var(--vsbs-border-color, rgba(46, 59, 66, .125));flex-grow:0;flex-shrink:0;padding:16px var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}[data-vsbs-footer][data-v-ac41efee]:empty{display:none}[data-vsbs-scroll][data-v-ac41efee]{flex-grow:1;overflow-y:auto;overscroll-behavior:none}[data-vsbs-content-wrapper][data-v-ac41efee]{height:100%}[data-vsbs-content][data-v-ac41efee]{display:grid;padding:8px var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}.vsbs-backdrop-enter-active[data-v-ac41efee],.vsbs-backdrop-leave-active[data-v-ac41efee]{transition:opacity var(--vsbs-duration) ease}.vsbs-backdrop-enter-from[data-v-ac41efee],.vsbs-backdrop-leave-to[data-v-ac41efee]{opacity:0}
package/dist/types.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface BottomSheetProps {
5
5
  initialSnapPoint?: number;
6
6
  blocking?: boolean;
7
7
  canSwipeClose?: boolean;
8
+ swipeCloseThreshold?: string | number;
8
9
  canBackdropClose?: boolean;
9
10
  expandOnContentDrag?: boolean;
10
11
  modelValue?: boolean;
package/package.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "url": "https://github.com/megaarmos/vue-spring-bottom-sheet/issues"
33
33
  },
34
34
  "private": false,
35
- "version": "2.4.3",
35
+ "version": "2.6.0-next.1",
36
36
  "type": "module",
37
37
  "exports": {
38
38
  ".": {
@@ -64,7 +64,6 @@
64
64
  "@vueuse/core": "^13.2.0",
65
65
  "@vueuse/integrations": "^13.2.0",
66
66
  "focus-trap": "^7.6.4",
67
- "motion-v": "^1.5.0",
68
67
  "remeda": "^2.21.6",
69
68
  "vue": "^3.5.14"
70
69
  },
@@ -89,6 +88,7 @@
89
88
  "LICENSE"
90
89
  ],
91
90
  "publishConfig": {
92
- "access": "public"
91
+ "access": "public",
92
+ "provenance": true
93
93
  }
94
94
  }