@xiping/react-components 0.0.67 → 0.0.68

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.
@@ -1,36 +1,37 @@
1
- import { jsxs as s, Fragment as F, jsx as e } from "react/jsx-runtime";
2
- import { useRef as a } from "react";
3
- import r from "clsx";
1
+ import { jsxs as E, Fragment as F, jsx as t } from "react/jsx-runtime";
2
+ import { useRef as c } from "react";
3
+ import e from "clsx";
4
4
  import { useScroll as _, useTransform as v, useMotionTemplate as y, motion as n } from "motion/react";
5
- const g = 16, I = 1.5, L = "normal", j = ({
6
- content: f,
7
- lineHeight: m = I,
8
- fontSize: d = g,
9
- fontWeight: p = L,
10
- className: u = "",
11
- style: x = {},
12
- onProgressChange: t,
13
- initialScrollPosition: R,
14
- cacheKey: S,
15
- showTopProgress: T = !0,
16
- topProgressClassName: b,
17
- showBottomProgress: h = !0,
18
- bottomProgressClassName: N
5
+ import g from "./index.module.css.js";
6
+ const I = 16, L = 1.5, R = "normal", k = ({
7
+ content: a,
8
+ lineHeight: f = L,
9
+ fontSize: m = I,
10
+ fontWeight: p = R,
11
+ className: d = "",
12
+ style: u = {},
13
+ onProgressChange: r,
14
+ initialScrollPosition: S,
15
+ cacheKey: A,
16
+ showTopProgress: x = !0,
17
+ topProgressClassName: T,
18
+ showBottomProgress: b = !0,
19
+ bottomProgressClassName: h
19
20
  }) => {
20
- const l = a(null), o = a(null), { scrollYProgress: i } = _({
21
+ const l = c(null), o = c(null), { scrollYProgress: i } = _({
21
22
  container: l,
22
23
  target: o
23
- }), c = v(() => (i.get() * 100).toFixed(2)), w = y`${c}%`;
24
- return c.on("change", (E) => {
25
- t == null || t(Number(E));
26
- }), /* @__PURE__ */ s(F, { children: [
27
- T && /* @__PURE__ */ e(
24
+ }), s = v(() => (i.get() * 100).toFixed(2).replace(/\.0*$/, "")), N = y`${s}%`;
25
+ return s.on("change", (w) => {
26
+ r == null || r(Number(w));
27
+ }), /* @__PURE__ */ E(F, { children: [
28
+ x && /* @__PURE__ */ t(
28
29
  n.div,
29
30
  {
30
31
  id: "scroll-indicator",
31
- className: r(
32
+ className: e(
32
33
  "fixed left-0 top-0 right-0 bg-[#ff0088] h-2.5",
33
- b
34
+ T
34
35
  ),
35
36
  style: {
36
37
  scaleX: i,
@@ -38,43 +39,45 @@ const g = 16, I = 1.5, L = "normal", j = ({
38
39
  }
39
40
  }
40
41
  ),
41
- /* @__PURE__ */ s(
42
+ /* @__PURE__ */ t(
42
43
  "div",
43
44
  {
44
- className: "relative w-full h-full overflow-y-auto",
45
+ className: e(
46
+ "relative w-full h-full overflow-y-auto",
47
+ g.textContent
48
+ // "scrollbar-thumb-rounded-full scrollbar-track-rounded-full scrollbar scrollbar-thumb-slate-700 scrollbar-track-slate-300",
49
+ ),
45
50
  ref: l,
46
- children: [
47
- /* @__PURE__ */ e(
48
- "div",
49
- {
50
- ref: o,
51
- className: r("w-full whitespace-pre-wrap break-words", u),
52
- style: {
53
- fontSize: `${d}px`,
54
- lineHeight: m,
55
- fontWeight: p,
56
- ...x
57
- },
58
- children: f
59
- }
60
- ),
61
- h && /* @__PURE__ */ e(
62
- n.div,
63
- {
64
- id: "scroll-present",
65
- className: r(
66
- "fixed text-white rounded text-sm bg-black bg-opacity-70 pl-2 pr-2 pb-1 pt-1 right-5 bottom-5",
67
- N
68
- ),
69
- children: w
70
- }
71
- )
72
- ]
51
+ children: /* @__PURE__ */ t(
52
+ "div",
53
+ {
54
+ ref: o,
55
+ className: e("w-full whitespace-pre-wrap break-words", d),
56
+ style: {
57
+ fontSize: `${m}px`,
58
+ lineHeight: f,
59
+ fontWeight: p,
60
+ ...u
61
+ },
62
+ children: a
63
+ }
64
+ )
65
+ }
66
+ ),
67
+ b && /* @__PURE__ */ t(
68
+ n.div,
69
+ {
70
+ id: "scroll-present",
71
+ className: e(
72
+ "fixed text-white rounded text-sm bg-black bg-opacity-70 pl-2 pr-2 pb-1 pt-1 right-5 bottom-5",
73
+ h
74
+ ),
75
+ children: N
73
76
  }
74
77
  )
75
78
  ] });
76
79
  };
77
80
  export {
78
- j as TxtReader,
79
- j as default
81
+ k as TxtReader,
82
+ k as default
80
83
  };
@@ -0,0 +1,7 @@
1
+ const t = "_textContent_8n59h_23", e = {
2
+ textContent: t
3
+ };
4
+ export {
5
+ e as default,
6
+ t as textContent
7
+ };