@gardenfi/garden-book 0.1.85 → 0.1.86

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/dist/ui.es.js CHANGED
@@ -14230,23 +14230,26 @@ const InfoBadge = ({ children: e, className: t, ...i }) => /* @__PURE__ */ jsx(
14230
14230
  className: t,
14231
14231
  height: i,
14232
14232
  gradientHeight: n = 24,
14233
- ...s
14233
+ onClose: s = !1,
14234
+ ...a
14234
14235
  }) => {
14235
- const [a, o] = useState(!0), [c, l] = useState(!0), f = useRef(null), u = useRef(null), m = () => {
14236
- if (f.current) {
14237
- const { scrollTop: p, scrollHeight: b, clientHeight: C } = f.current;
14238
- o(p + C < b), l(p > 0);
14236
+ const [o, c] = useState(!0), [l, f] = useState(!0), u = useRef(null), m = useRef(null), p = () => {
14237
+ if (u.current) {
14238
+ const { scrollTop: b, scrollHeight: C, clientHeight: y } = u.current;
14239
+ c(b + y < C), f(b > 0);
14239
14240
  }
14240
14241
  };
14241
14242
  return useEffect(() => {
14242
- const p = f.current, b = u.current;
14243
- if (!p || !b) return;
14244
- m();
14245
- const C = new ResizeObserver(() => {
14246
- m();
14243
+ s && u.current && (u.current.scrollTop = 0);
14244
+ }, [s]), useEffect(() => {
14245
+ const b = u.current, C = m.current;
14246
+ if (!b || !C) return;
14247
+ p();
14248
+ const y = new ResizeObserver(() => {
14249
+ p();
14247
14250
  });
14248
- return C.observe(p), C.observe(b), () => {
14249
- C.disconnect();
14251
+ return y.observe(b), y.observe(C), () => {
14252
+ y.disconnect();
14250
14253
  };
14251
14254
  }, []), /* @__PURE__ */ jsxs(
14252
14255
  "div",
@@ -14256,18 +14259,18 @@ const InfoBadge = ({ children: e, className: t, ...i }) => /* @__PURE__ */ jsx(
14256
14259
  t
14257
14260
  ),
14258
14261
  style: { height: typeof i == "number" ? `${i}px` : i },
14259
- ...s,
14262
+ ...a,
14260
14263
  children: [
14261
14264
  /* @__PURE__ */ jsx(
14262
14265
  "div",
14263
14266
  {
14264
14267
  className: "gf-h-full gf-w-full gf-overflow-auto gf-no-scrollbar",
14265
- onScroll: m,
14266
- ref: f,
14267
- children: /* @__PURE__ */ jsx("div", { ref: u, children: e })
14268
+ onScroll: p,
14269
+ ref: u,
14270
+ children: /* @__PURE__ */ jsx("div", { ref: m, children: e })
14268
14271
  }
14269
14272
  ),
14270
- c && /* @__PURE__ */ jsx(
14273
+ l && /* @__PURE__ */ jsx(
14271
14274
  "div",
14272
14275
  {
14273
14276
  className: " gf-w-full gf-absolute gf-top-0 gf-left-0 gf-z-40 gf-bg-gradient-to-b gf-from-white gf-via-white/80 gf-to-transparent gf-pointer-events-none",
@@ -14276,7 +14279,7 @@ const InfoBadge = ({ children: e, className: t, ...i }) => /* @__PURE__ */ jsx(
14276
14279
  }
14277
14280
  }
14278
14281
  ),
14279
- a && /* @__PURE__ */ jsx(
14282
+ o && /* @__PURE__ */ jsx(
14280
14283
  "div",
14281
14284
  {
14282
14285
  className: " gf-w-full gf-absolute gf-bottom-0 gf-left-0 gf-z-40 gf-bg-gradient-to-t gf-from-white gf-via-white/80 gf-to-transparent gf-pointer-events-none",