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