@douxcode/vue-spring-bottom-sheet 1.1.3 → 1.2.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
@@ -9,7 +9,11 @@
9
9
  # Installation
10
10
 
11
11
  ```
12
- npm install @douxcode/vue-bottom-sheet
12
+ npm install @douxcode/vue-spring-bottom-sheet
13
+ ```
14
+
15
+ ```
16
+ bun install @douxcode/vue-spring-bottom-sheet
13
17
  ```
14
18
 
15
19
  # Getting started
@@ -18,8 +22,8 @@ npm install @douxcode/vue-bottom-sheet
18
22
 
19
23
  ```vue
20
24
  <script setup>
21
- import BottomSheet from '@douxcode/vue-bottom-sheet'
22
- import '@douxcode/vue-bottom-sheet/dist/style.css'
25
+ import BottomSheet from '@douxcode/vue-spring-bottom-sheet'
26
+ import '@douxcode/vue-spring-bottom-sheet/dist/style.css'
23
27
  import { ref } from 'vue'
24
28
 
25
29
  const bottomSheet = ref(null)
@@ -42,8 +46,8 @@ const close = () => {
42
46
 
43
47
  ```vue
44
48
  <script setup lang="ts">
45
- import BottomSheet from '@douxcode/vue-bottom-sheet'
46
- import '@douxcode/vue-bottom-sheet/dist/style.css'
49
+ import BottomSheet from '@douxcode/vue-spring-bottom-sheet'
50
+ import '@douxcode/vue-spring-bottom-sheet/dist/style.css'
47
51
  import { ref } from 'vue'
48
52
 
49
53
  const bottomSheet = ref<InstanceType<typeof BottomSheet>>()
@@ -1,4 +1,5 @@
1
1
  interface IProps {
2
+ duration?: number;
2
3
  snapPoints?: number[];
3
4
  defaultBreakpoint?: number;
4
5
  blocking?: boolean;
@@ -45,6 +46,7 @@ declare const __VLS_component: import('vue').DefineComponent<IProps, {
45
46
  onMinHeight?: ((minSheetHeight: number) => any) | undefined;
46
47
  onMaxHeight?: ((maxSheetHeight: number) => any) | undefined;
47
48
  }>, {
49
+ duration: number;
48
50
  blocking: boolean;
49
51
  canSwipeClose: boolean;
50
52
  canBackdropClose: boolean;
package/dist/index.mjs CHANGED
@@ -1,69 +1,70 @@
1
- import { computed as H, defineComponent as ie, ref as h, toRefs as se, watch as U, nextTick as z, onMounted as re, openBlock as ve, createBlock as de, Teleport as ce, createElementVNode as b, createVNode as fe, Transition as ge, withCtx as he, withDirectives as pe, vShow as me, renderSlot as N } from "vue";
2
- import { useWindowSize as be, useElementBounding as I, useScrollLock as ye } from "@vueuse/core";
3
- import { useGesture as R, rubberbandIfOutOfBounds as V } from "@vueuse/gesture";
4
- import { useMotionProperties as we, useMotionTransitions as Se, useMotionControls as ke } from "@vueuse/motion";
5
- import { useFocusTrap as Te } from "@vueuse/integrations/useFocusTrap";
6
- function Ce(n, u, a) {
7
- let t = (o) => n(o, ...u);
8
- return a === void 0 ? t : Object.assign(t, { lazy: a, lazyArgs: u });
1
+ import { computed as y, defineComponent as de, useCssVars as ce, ref as p, toRefs as fe, watch as q, nextTick as F, onMounted as ge, openBlock as pe, createBlock as he, Teleport as me, createElementVNode as b, createVNode as be, Transition as ye, withCtx as we, withDirectives as Se, vShow as ke, renderSlot as R } from "vue";
2
+ import { useWindowSize as Te, useElementBounding as I, useScrollLock as J } from "@vueuse/core";
3
+ import { useGesture as z, rubberbandIfOutOfBounds as N } from "@vueuse/gesture";
4
+ import { useMotionProperties as Ce, useMotionTransitions as De, useMotionControls as xe } from "@vueuse/motion";
5
+ import { useFocusTrap as Me } from "@vueuse/integrations/useFocusTrap";
6
+ function _e(n, u, a) {
7
+ let e = (o) => n(o, ...u);
8
+ return a === void 0 ? e : Object.assign(e, { lazy: a, lazyArgs: u });
9
9
  }
10
- function De(n, u, a) {
11
- let t = n.length - u.length;
12
- if (t === 0) return n(...u);
13
- if (t === 1) return Ce(n, u, a);
10
+ function Be(n, u, a) {
11
+ let e = n.length - u.length;
12
+ if (e === 0) return n(...u);
13
+ if (e === 1) return _e(n, u, a);
14
14
  throw new Error("Wrong number of arguments");
15
15
  }
16
- function xe(n, { triggerAt: u = "end", minQuietPeriodMs: a, maxBurstDurationMs: t, minGapMs: o, reducer: c = Me }) {
17
- let s, r, f, y, T = () => {
16
+ function He(n, { triggerAt: u = "end", minQuietPeriodMs: a, maxBurstDurationMs: e, minGapMs: o, reducer: c = Oe }) {
17
+ let s, r, f, w, C = () => {
18
18
  let v = f;
19
- v !== void 0 && (f = void 0, n(v), o !== void 0 && (r = setTimeout(P, o)));
20
- }, P = () => {
21
- clearTimeout(r), r = void 0, s === void 0 && T();
22
- }, w = () => {
23
- clearTimeout(s), s = void 0, y = void 0, r === void 0 && T();
19
+ v !== void 0 && (f = void 0, n(v), o !== void 0 && (r = setTimeout(O, o)));
20
+ }, O = () => {
21
+ clearTimeout(r), r = void 0, s === void 0 && C();
22
+ }, S = () => {
23
+ clearTimeout(s), s = void 0, w = void 0, r === void 0 && C();
24
24
  };
25
25
  return { call: (...v) => {
26
26
  let g = s === void 0 && r === void 0;
27
27
  if ((u !== "start" || g) && (f = c(f, ...v)), !(s === void 0 && !g)) {
28
- if (a !== void 0 || t !== void 0 || o === void 0) {
28
+ if (a !== void 0 || e !== void 0 || o === void 0) {
29
29
  clearTimeout(s);
30
- let p = Date.now();
31
- y ?? (y = p);
32
- let W = t === void 0 ? a ?? 0 : Math.min(a ?? t, t - (p - y));
33
- s = setTimeout(w, W);
30
+ let h = Date.now();
31
+ w ?? (w = h);
32
+ let W = e === void 0 ? a ?? 0 : Math.min(a ?? e, e - (h - w));
33
+ s = setTimeout(S, W);
34
34
  }
35
- u !== "end" && g && T();
35
+ u !== "end" && g && C();
36
36
  }
37
37
  }, cancel: () => {
38
- clearTimeout(s), s = void 0, y = void 0, clearTimeout(r), r = void 0, f = void 0;
38
+ clearTimeout(s), s = void 0, w = void 0, clearTimeout(r), r = void 0, f = void 0;
39
39
  }, flush: () => {
40
- w(), P();
40
+ S(), O();
41
41
  }, get isIdle() {
42
42
  return s === void 0 && r === void 0;
43
43
  } };
44
44
  }
45
- var Me = () => "";
45
+ var Oe = () => "";
46
46
  function $(...n) {
47
- return De(_e, n);
47
+ return Be(Pe, n);
48
48
  }
49
- var _e = (n, { min: u, max: a }) => u !== void 0 && n < u ? u : a !== void 0 && n > a ? a : n;
50
- function Be(n, u) {
51
- const a = H(() => n.value.sort()), t = H(() => a.value[0]), o = H(() => a.value[a.value.length - 1]), c = H(() => {
49
+ var Pe = (n, { min: u, max: a }) => u !== void 0 && n < u ? u : a !== void 0 && n > a ? a : n;
50
+ function Ee(n, u) {
51
+ const a = y(() => n.value.sort()), e = y(() => a.value[0]), o = y(() => a.value[a.value.length - 1]), c = y(() => {
52
52
  const s = a.value.reduce(
53
53
  (r, f) => Math.abs(f - u.value) < Math.abs(r - u.value) ? f : r
54
54
  );
55
55
  return a.value.indexOf(s);
56
56
  });
57
57
  return {
58
- minSnap: t,
58
+ minSnap: e,
59
59
  maxSnap: o,
60
60
  snapPoints: n,
61
61
  closestSnapPointIndex: c
62
62
  };
63
63
  }
64
- const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-sheet-show"], Oe = /* @__PURE__ */ ie({
64
+ const Ie = { "data-vsbs-container": "" }, $e = ["data-vsbs-shadow", "data-vsbs-sheet-show"], We = /* @__PURE__ */ de({
65
65
  __name: "BottomSheet",
66
66
  props: {
67
+ duration: { default: 250 },
67
68
  snapPoints: {},
68
69
  defaultBreakpoint: {},
69
70
  blocking: { type: Boolean, default: !0 },
@@ -73,154 +74,167 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
73
74
  },
74
75
  emits: ["opened", "closed", "ready", "dragging-up", "dragging-down", "minHeight", "maxHeight"],
75
76
  setup(n, { expose: u, emit: a }) {
76
- const t = n, o = a, c = h(null), s = h(null), r = h(null), f = h(null), y = h(null), T = h(null), P = h(null), w = h(!1), v = h(t.expandOnContentDrag), { height: g } = be(), { height: p } = I(c), { height: W } = I(s), { height: q } = I(r), { height: J } = I(T), { activate: Z, deactivate: Y } = Te([c, P], { immediate: !1 }), S = H(
77
- () => Math.ceil(J.value + W.value + q.value)
78
- ), { motionProperties: C } = we(c), { push: D, stop: ee, motionValues: x } = Se(), { set: M, stop: X } = ke(
79
- C,
77
+ ce((i) => ({
78
+ "702e831e": ae.value,
79
+ "2476b37f": ne.value
80
+ }));
81
+ const e = n, o = a, c = p(null), s = p(null), r = p(null), f = p(null), w = p(null), C = p(null), O = p(null), S = p(!1), v = p(e.expandOnContentDrag), { height: g } = Te(), { height: h } = I(c), { height: W } = I(s), { height: Z } = I(r), { height: Y } = I(C), { activate: ee, deactivate: te } = Me([c, O], { immediate: !1 }), k = y(
82
+ () => Math.ceil(Y.value + W.value + Z.value)
83
+ ), ae = y(() => `visibility ${e.duration}ms ease-in-out`), ne = y(() => `opacity ${e.duration}ms ease-in-out`), { motionProperties: D } = Ce(c), { push: x, stop: oe, motionValues: M } = De(), { set: _, stop: L } = xe(
84
+ D,
80
85
  {},
81
- { push: D, motionValues: x, stop: ee }
82
- ), e = h(0), l = h(0), { snapPoints: te } = se(t), ae = H(() => te.value ?? [S.value]), {
83
- minSnap: _,
84
- maxSnap: B,
85
- snapPoints: k,
86
- closestSnapPointIndex: A
87
- } = Be(ae, e), G = ye(document.body), Q = (i) => {
86
+ { push: x, motionValues: M, stop: oe }
87
+ ), t = p(0), l = p(0), { snapPoints: le } = fe(e), ue = y(() => le.value ?? [k.value]), {
88
+ minSnap: B,
89
+ maxSnap: H,
90
+ snapPoints: T,
91
+ closestSnapPointIndex: V
92
+ } = Ee(ue, t), G = J(document.body), Q = J(document.documentElement), j = (i) => {
88
93
  i.key === "Escape" && E();
89
- }, ne = () => {
90
- c.value && (e.value = Math.min(t.defaultBreakpoint ?? _.value, g.value), M({
91
- height: e.value,
92
- y: e.value
93
- }), D("y", 0, C, { type: "tween", easings: "easeInOut", bounce: 0, duration: 300 }), w.value = !0, G.value = !0, window.addEventListener("keydown", Q), t.blocking && setTimeout(() => {
94
- x.value.y.get() - 0 < 0.1 && (o("opened"), Z());
95
- }, 300));
94
+ }, ie = () => {
95
+ c.value && (t.value = Math.min(e.defaultBreakpoint ?? B.value, g.value), _({
96
+ height: t.value,
97
+ y: t.value
98
+ }), x("y", 0, D, {
99
+ type: "tween",
100
+ easings: "easeInOut",
101
+ bounce: 0,
102
+ duration: e.duration
103
+ }), S.value = !0, G.value = !0, Q.value = !0, window.addEventListener("keydown", j), e.blocking && setTimeout(() => {
104
+ M.value.y.get() - 0 < 0.1 && (o("opened"), ee());
105
+ }, e.duration));
96
106
  }, E = () => {
97
- c.value && (D("y", p.value, C, { type: "tween", bounce: 0, duration: 300 }), w.value = !1, G.value = !1, t.blocking && Y(), window.removeEventListener("keydown", Q), setTimeout(() => {
98
- x.value.y.get() - p.value < 0.1 && o("closed");
99
- }, 300));
100
- }, oe = () => {
101
- t.canBackdropClose && E();
107
+ c.value && (x("y", h.value, D, {
108
+ type: "tween",
109
+ bounce: 0,
110
+ duration: e.duration
111
+ }), S.value = !1, G.value = !1, Q.value = !1, e.blocking && te(), window.removeEventListener("keydown", j), setTimeout(() => {
112
+ M.value.y.get() - h.value < 0.1 && o("closed");
113
+ }, e.duration));
114
+ }, se = () => {
115
+ e.canBackdropClose && E();
102
116
  };
103
- function le(i) {
117
+ function re(i) {
104
118
  v.value && i.preventDefault();
105
119
  }
106
- const F = (i) => {
107
- e.value = i, D("height", e.value, C, {
120
+ const X = (i) => {
121
+ t.value = i, x("height", t.value, D, {
108
122
  type: "tween",
109
123
  easings: "easeInOut",
110
124
  bounce: 0,
111
- duration: 300
125
+ duration: e.duration
112
126
  });
113
- }, j = ({
127
+ }, K = ({
114
128
  delta: [i, d],
115
- direction: [O, m]
129
+ direction: [P, m]
116
130
  }) => {
117
- c.value && (l.value <= 0 && (e.value -= d), e.value <= _.value && (e.value = _.value, l.value += d, M({
118
- y: t.canSwipeClose ? $(l.value, { min: 0 }) : $(V(l.value, -p.value, 0, 0.5), { min: 0 })
119
- })), M({
120
- height: $(V(e.value, 0, B.value, 0.25), {
131
+ c.value && (l.value <= 0 && (t.value -= d), t.value <= B.value && (t.value = B.value, l.value += d, _({
132
+ y: e.canSwipeClose ? $(l.value, { min: 0 }) : $(N(l.value, -h.value, 0, 0.5), { min: 0 })
133
+ })), _({
134
+ height: $(N(t.value, 0, H.value, 0.25), {
121
135
  min: 0,
122
136
  max: g.value
123
137
  })
124
138
  }), m > 0 ? o("dragging-down") : m < 0 && o("dragging-up"));
125
- }, L = () => {
126
- c.value && (l.value = t.canSwipeClose ? [0, e.value].reduce(
139
+ }, A = () => {
140
+ c.value && (l.value = e.canSwipeClose ? [0, t.value].reduce(
127
141
  (i, d) => Math.abs(d - l.value) < Math.abs(i - l.value) ? d : i
128
- ) : 0, D("y", l.value, C, {
142
+ ) : 0, x("y", l.value, D, {
129
143
  type: "tween",
130
144
  easings: "easeInOut",
131
145
  bounce: 0,
132
- duration: 300
133
- }), l.value === e.value && (l.value = 0, E()), e.value = Math.min(k.value[A.value], g.value), D("height", e.value, C, {
146
+ duration: e.duration
147
+ }), l.value === t.value && (l.value = 0, E()), t.value = Math.min(T.value[V.value], g.value), x("height", t.value, D, {
134
148
  type: "tween",
135
149
  easings: "easeInOut",
136
150
  bounce: 0,
137
- duration: 300
151
+ duration: e.duration
138
152
  }));
139
153
  };
140
- R(
154
+ z(
141
155
  {
142
156
  onDragStart: () => {
143
- e.value = p.value, l.value = x.value.y.get(), X();
157
+ t.value = h.value, l.value = M.value.y.get(), L();
144
158
  },
145
- onDrag: j,
146
- onDragEnd: L
159
+ onDrag: K,
160
+ onDragEnd: A
147
161
  },
148
162
  {
149
163
  domTarget: s,
150
164
  drag: { filterTaps: !0 }
151
165
  }
152
- ), R(
166
+ ), z(
153
167
  {
154
168
  onDragStart: () => {
155
- e.value = p.value, l.value = x.value.y.get(), X();
169
+ t.value = h.value, l.value = M.value.y.get(), L();
156
170
  },
157
- onDrag: j,
158
- onDragEnd: L
171
+ onDrag: K,
172
+ onDragEnd: A
159
173
  },
160
174
  {
161
175
  domTarget: r,
162
176
  drag: { filterTaps: !0 }
163
177
  }
164
- ), R(
178
+ ), z(
165
179
  {
166
180
  onDragStart: ({ direction: [i, d] }) => {
167
- e.value = p.value, l.value = x.value.y.get(), X();
168
- const O = f.value.scrollTop === 0, m = d > 0;
169
- k.value.length === 1 ? l.value === 0 && O && (v.value = m) : (t.expandOnContentDrag && e.value !== B.value && (v.value = !0), e.value === B.value && O && (v.value = m));
181
+ t.value = h.value, l.value = M.value.y.get(), L();
182
+ const P = f.value.scrollTop === 0, m = d > 0;
183
+ T.value.length === 1 ? l.value === 0 && P && (v.value = m) : (e.expandOnContentDrag && t.value !== H.value && (v.value = !0), t.value === H.value && P && (v.value = m));
170
184
  },
171
- onDrag: ({ delta: [i, d], direction: [O, m] }) => {
172
- if (!t.expandOnContentDrag) {
185
+ onDrag: ({ delta: [i, d], direction: [P, m] }) => {
186
+ if (!e.expandOnContentDrag) {
173
187
  v.value = !1;
174
188
  return;
175
189
  }
176
190
  if (!c.value) return;
177
- l.value === 0 && v.value && t.expandOnContentDrag && (e.value -= d), e.value <= _.value && (e.value = _.value, v.value && t.expandOnContentDrag && (l.value += d), l.value = $(l.value, { min: 0, max: _.value }), M({
178
- y: t.canSwipeClose ? l.value : V(l.value, -p.value, 0, 0.5)
179
- })), e.value > B.value && (e.value = B.value), e.value = Math.min(e.value, g.value);
180
- const K = f.value.scrollTop === 0;
181
- k.value.length === 1 ? d < 0 && l.value === 0 && K && (v.value = !1) : e.value === B.value && (v.value = !1), M({
182
- height: e.value
191
+ l.value === 0 && v.value && e.expandOnContentDrag && (t.value -= d), t.value <= B.value && (t.value = B.value, v.value && e.expandOnContentDrag && (l.value += d), l.value = $(l.value, { min: 0, max: B.value }), _({
192
+ y: e.canSwipeClose ? l.value : N(l.value, -h.value, 0, 0.5)
193
+ })), t.value > H.value && (t.value = H.value), t.value = Math.min(t.value, g.value);
194
+ const U = f.value.scrollTop === 0;
195
+ T.value.length === 1 ? d < 0 && l.value === 0 && U && (v.value = !1) : t.value === H.value && (v.value = !1), _({
196
+ height: t.value
183
197
  }), m > 0 ? o("dragging-down") : m < 0 && o("dragging-up");
184
198
  },
185
- onDragEnd: L
199
+ onDragEnd: A
186
200
  },
187
201
  {
188
- domTarget: y,
202
+ domTarget: w,
189
203
  drag: { filterTaps: !0 }
190
204
  }
191
205
  );
192
- const ue = xe(
206
+ const ve = He(
193
207
  () => {
194
- o("maxHeight", g.value), z(() => {
195
- e.value = k.value[A.value], F(k.value[A.value]);
208
+ o("maxHeight", g.value), F(() => {
209
+ t.value = T.value[V.value], X(T.value[V.value]);
196
210
  });
197
211
  },
198
212
  { minQuietPeriodMs: 50 }
199
213
  );
200
- return U(g, () => {
201
- ue.call();
202
- }), U(S, () => {
203
- o("minHeight", S.value), k.value.length === 1 && z(() => {
204
- k.value[0] === S.value && F(Math.min(S.value, g.value));
214
+ return q(g, () => {
215
+ ve.call();
216
+ }), q(k, () => {
217
+ o("minHeight", k.value), T.value.length === 1 && F(() => {
218
+ T.value[0] === k.value && X(Math.min(k.value, g.value));
205
219
  });
206
- }), re(() => {
207
- o("minHeight", S.value), o("maxHeight", g.value), e.value = t.defaultBreakpoint ?? Number(S.value), M({
208
- height: e.value,
209
- y: e.value
210
- }), z(() => {
220
+ }), ge(() => {
221
+ o("minHeight", k.value), o("maxHeight", g.value), t.value = e.defaultBreakpoint ?? Number(k.value), _({
222
+ height: t.value,
223
+ y: t.value
224
+ }), F(() => {
211
225
  o("ready");
212
226
  });
213
- }), u({ open: ne, close: E, snapToPoint: F }), (i, d) => (ve(), de(ce, { to: "body" }, [
214
- b("div", He, [
215
- fe(ge, { name: "fade" }, {
216
- default: he(() => [
217
- pe(b("div", {
227
+ }), u({ open: ie, close: E, snapToPoint: X }), (i, d) => (pe(), he(me, { to: "body" }, [
228
+ b("div", Ie, [
229
+ be(ye, { name: "fade" }, {
230
+ default: we(() => [
231
+ Se(b("div", {
218
232
  ref_key: "backdrop",
219
- ref: P,
233
+ ref: O,
220
234
  "data-vsbs-backdrop": "",
221
- onClick: d[0] || (d[0] = (O) => oe())
235
+ onClick: d[0] || (d[0] = (P) => se())
222
236
  }, null, 512), [
223
- [me, w.value && i.blocking]
237
+ [ke, S.value && i.blocking]
224
238
  ])
225
239
  ]),
226
240
  _: 1
@@ -229,7 +243,7 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
229
243
  ref_key: "sheet",
230
244
  ref: c,
231
245
  "data-vsbs-shadow": !i.blocking,
232
- "data-vsbs-sheet-show": w.value,
246
+ "data-vsbs-sheet-show": S.value,
233
247
  "aria-modal": "true",
234
248
  "data-vsbs-sheet": "",
235
249
  tabindex: "-1"
@@ -239,25 +253,25 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
239
253
  ref: s,
240
254
  "data-vsbs-header": ""
241
255
  }, [
242
- N(i.$slots, "header", {}, void 0, !0)
256
+ R(i.$slots, "header", {}, void 0, !0)
243
257
  ], 512),
244
258
  b("div", {
245
259
  ref_key: "sheetScroll",
246
260
  ref: f,
247
261
  "data-vsbs-scroll": "",
248
- onTouchmove: le
262
+ onTouchmove: re
249
263
  }, [
250
264
  b("div", {
251
265
  ref_key: "sheetContentWrapper",
252
- ref: y,
266
+ ref: w,
253
267
  "data-vsbs-content-wrapper": ""
254
268
  }, [
255
269
  b("div", {
256
270
  ref_key: "sheetContent",
257
- ref: T,
271
+ ref: C,
258
272
  "data-vsbs-content": ""
259
273
  }, [
260
- N(i.$slots, "default", {}, void 0, !0)
274
+ R(i.$slots, "default", {}, void 0, !0)
261
275
  ], 512)
262
276
  ], 512)
263
277
  ], 544),
@@ -266,18 +280,18 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
266
280
  ref: r,
267
281
  "data-vsbs-footer": ""
268
282
  }, [
269
- N(i.$slots, "footer", {}, void 0, !0)
283
+ R(i.$slots, "footer", {}, void 0, !0)
270
284
  ], 512)
271
- ], 8, Pe)
285
+ ], 8, $e)
272
286
  ])
273
287
  ]));
274
288
  }
275
- }), Ee = (n, u) => {
289
+ }), Le = (n, u) => {
276
290
  const a = n.__vccOpts || n;
277
- for (const [t, o] of u)
278
- a[t] = o;
291
+ for (const [e, o] of u)
292
+ a[e] = o;
279
293
  return a;
280
- }, Fe = /* @__PURE__ */ Ee(Oe, [["__scopeId", "data-v-84fc7f9f"]]);
294
+ }, ze = /* @__PURE__ */ Le(We, [["__scopeId", "data-v-37eb32bc"]]);
281
295
  export {
282
- Fe as default
296
+ ze as default
283
297
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- [data-vsbs-backdrop][data-v-84fc7f9f]{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:100}[data-vsbs-shadow=true][data-v-84fc7f9f]{box-shadow:0 -5px 60px 0 var(--vsbs-shadow-color, rgba(89, 89, 89, .2))}[data-vsbs-sheet][data-v-84fc7f9f]{background-color:var(--vsbs-background, #fff);border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);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;transition:visibility .3s ease-in-out;visibility:hidden;width:100%;will-change:height;z-index:100}[data-vsbs-sheet-show=true][data-v-84fc7f9f]{visibility:visible}[data-vsbs-header][data-v-84fc7f9f]{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:1}[data-vsbs-header][data-v-84fc7f9f]: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-84fc7f9f]:empty{box-shadow:none;padding:12px var(--vsbs-padding-x, 16px) 8px}[data-vsbs-footer][data-v-84fc7f9f]{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-84fc7f9f]:empty{display:none}[data-vsbs-scroll][data-v-84fc7f9f]{flex-grow:1;overflow-y:auto;overscroll-behavior:contain}[data-vsbs-content-wrapper][data-v-84fc7f9f]{height:100%}[data-vsbs-content][data-v-84fc7f9f]{display:grid;padding:1vh var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}.fade-enter-active[data-v-84fc7f9f],.fade-leave-active[data-v-84fc7f9f]{transition:opacity .3s ease}.fade-enter-from[data-v-84fc7f9f],.fade-leave-to[data-v-84fc7f9f]{opacity:0}
1
+ [data-vsbs-backdrop][data-v-37eb32bc]{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:100}[data-vsbs-shadow=true][data-v-37eb32bc]{box-shadow:0 -5px 60px 0 var(--vsbs-shadow-color, rgba(89, 89, 89, .2))}[data-vsbs-sheet][data-v-37eb32bc]{background-color:var(--vsbs-background, #fff);border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);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;transition:var(--702e831e);visibility:hidden;width:100%;will-change:height;z-index:100}[data-vsbs-sheet-show=true][data-v-37eb32bc]{visibility:visible}[data-vsbs-header][data-v-37eb32bc]{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:1}[data-vsbs-header][data-v-37eb32bc]: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-37eb32bc]:empty{box-shadow:none;padding:12px var(--vsbs-padding-x, 16px) 8px}[data-vsbs-footer][data-v-37eb32bc]{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-37eb32bc]:empty{display:none}[data-vsbs-scroll][data-v-37eb32bc]{flex-grow:1;overflow-y:auto;overscroll-behavior:contain}[data-vsbs-content-wrapper][data-v-37eb32bc]{height:100%}[data-vsbs-content][data-v-37eb32bc]{display:grid;padding:1vh var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}.fade-enter-active[data-v-37eb32bc],.fade-leave-active[data-v-37eb32bc]{transition:var(--2476b37f)}.fade-enter-from[data-v-37eb32bc],.fade-leave-to[data-v-37eb32bc]{opacity:0}
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": "1.1.3",
35
+ "version": "1.2.0",
36
36
  "type": "module",
37
37
  "exports": {
38
38
  ".": {
@@ -55,9 +55,9 @@
55
55
  "release": "npm run build && npm publish --access public"
56
56
  },
57
57
  "peerDependencies": {
58
- "vue": ">=3.3",
59
58
  "@vueuse/gesture": "^2.0.0",
60
- "@vueuse/motion": "^2.2.6"
59
+ "@vueuse/motion": "^2.2.6",
60
+ "vue": ">=3.3"
61
61
  },
62
62
  "dependencies": {
63
63
  "@vueuse/core": "^12.0.0",
@@ -66,17 +66,17 @@
66
66
  "@vueuse/motion": "^2.2.6",
67
67
  "focus-trap": "^7",
68
68
  "remeda": "^2.19.0",
69
- "vue": "^3.5.13"
69
+ "vue": ">=3.3"
70
70
  },
71
71
  "devDependencies": {
72
- "ajv": "^8.17.1",
72
+ "@types/node": "^22.10.2",
73
+ "@vitejs/plugin-vue": "^5.2.1",
73
74
  "@vue/eslint-config-prettier": "^10.1.0",
74
75
  "@vue/eslint-config-typescript": "^14.2.0",
76
+ "@vue/tsconfig": "^0.7.0",
77
+ "ajv": "^8.17.1",
75
78
  "eslint": "^9.17.0",
76
79
  "eslint-plugin-vue": "^9.32.0",
77
- "@types/node": "^22.10.2",
78
- "@vitejs/plugin-vue": "^5.2.1",
79
- "@vue/tsconfig": "^0.7.0",
80
80
  "prettier": "^3.4.2",
81
81
  "typescript": "~5.6.2",
82
82
  "vite": "^6.0.1",