@xiping/react-components 1.0.40 → 1.0.43

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,69 +1,71 @@
1
1
  "use client";
2
- import { jsx as u } from "react/jsx-runtime";
3
- import { cn as g } from "../../utils/utils.js";
2
+ import { jsx as p } from "react/jsx-runtime";
3
+ import { cn as h } from "../../utils/utils.js";
4
4
  import { motion as x, AnimatePresence as U } from "motion/react";
5
- import { useState as M, useRef as h, useEffect as I } from "react";
5
+ import { useState as M, useRef as d, useEffect as I } from "react";
6
+ /* empty css */
6
7
  const j = Object.freeze(
7
8
  "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")
8
9
  ), q = (n) => Math.floor(Math.random() * n);
9
- function z({
10
+ function B({
10
11
  children: n,
11
12
  className: C,
12
- duration: f = 800,
13
- delay: r = 0,
13
+ duration: u = 800,
14
+ delay: o = 0,
14
15
  as: E = "div",
15
- startOnView: p = !1,
16
+ startOnView: f = !1,
16
17
  animateOnHover: F = !0,
17
18
  characterSet: s = j,
18
19
  ...R
19
20
  }) {
20
21
  const b = x.create(E, {
21
22
  forwardMotionProps: !0
22
- }), [v, w] = M(
23
+ }), [v, y] = M(
23
24
  () => n.split("")
24
- ), [i, o] = M(!1), a = h(0), m = h(null), D = () => {
25
- F && !i && (a.current = 0, o(!0));
25
+ ), [i, r] = M(!1), a = d(0), m = d(null), D = () => {
26
+ F && !i && (a.current = 0, r(!0));
26
27
  };
27
28
  return I(() => {
28
- if (!p) {
29
+ if (!f) {
29
30
  const t = setTimeout(() => {
30
- o(!0);
31
- }, r);
31
+ r(!0);
32
+ }, o);
32
33
  return () => clearTimeout(t);
33
34
  }
34
35
  const e = new IntersectionObserver(
35
36
  ([t]) => {
36
37
  t.isIntersecting && (setTimeout(() => {
37
- o(!0);
38
- }, r), e.disconnect());
38
+ r(!0);
39
+ }, o), e.disconnect());
39
40
  },
40
41
  { threshold: 0.1, rootMargin: "-30% 0px -30% 0px" }
41
42
  );
42
43
  return m.current && e.observe(m.current), () => e.disconnect();
43
- }, [r, p]), I(() => {
44
+ }, [o, f]), I(() => {
44
45
  if (!i) return;
45
46
  const e = n.length, t = performance.now();
46
47
  let c;
47
48
  const l = (H) => {
48
- const N = H - t, T = Math.min(N / f, 1);
49
- a.current = T * e, w(
49
+ const N = H - t, g = Math.min(N / u, 1);
50
+ a.current = g * e, y(
50
51
  (P) => P.map(
51
- (A, d) => A === " " ? A : d <= a.current ? n[d] : s[q(s.length)]
52
+ (T, A) => T === " " ? T : A <= a.current ? n[A] : s[q(s.length)]
52
53
  )
53
- ), T < 1 ? c = requestAnimationFrame(l) : o(!1);
54
+ ), g < 1 ? c = requestAnimationFrame(l) : r(!1);
54
55
  };
55
56
  return c = requestAnimationFrame(l), () => cancelAnimationFrame(c);
56
- }, [n, f, i, s]), /* @__PURE__ */ u(
57
+ }, [n, u, i, s]), // eslint-disable-next-line react-hooks/static-components
58
+ /* @__PURE__ */ p(
57
59
  b,
58
60
  {
59
61
  ref: m,
60
- className: g("overflow-hidden py-2 text-4xl font-bold", C),
62
+ className: h("xiping-hyper-container", C),
61
63
  onMouseEnter: D,
62
64
  ...R,
63
- children: /* @__PURE__ */ u(U, { children: v.map((e, t) => /* @__PURE__ */ u(
65
+ children: /* @__PURE__ */ p(U, { children: v.map((e, t) => /* @__PURE__ */ p(
64
66
  x.span,
65
67
  {
66
- className: g("font-mono", e === " " ? "w-3" : ""),
68
+ className: h("xiping-hyper-char", e === " " ? "xiping-hyper-space" : ""),
67
69
  children: e.toUpperCase()
68
70
  },
69
71
  t
@@ -72,5 +74,5 @@ function z({
72
74
  );
73
75
  }
74
76
  export {
75
- z as HyperText
77
+ B as HyperText
76
78
  };
@@ -1,94 +1,118 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
- import { Modal as D, ModalContent as O, Spinner as S } from "@heroui/react";
4
- import U from "../pinch-content/PinchContent.js";
5
- import A from "./ImageThumbnails.js";
6
- import { useState as h, useEffect as P } from "react";
7
- import T from "clsx";
8
- import { Download as B, X as V } from "lucide-react";
9
- import { AnimatePresence as W, motion as X } from "motion/react";
10
- import { cn as l } from "../../utils/utils.js";
2
+ import { jsx as n, jsxs as h } from "react/jsx-runtime";
3
+ import { Modal as z, ModalContent as O, Spinner as S } from "@heroui/react";
4
+ import P from "../pinch-content/PinchContent.js";
5
+ import V from "./ImageThumbnails.js";
6
+ import { useState as v, useCallback as b, useEffect as x } from "react";
7
+ import X from "clsx";
8
+ import { Download as B, X as K } from "lucide-react";
9
+ import { AnimatePresence as W, motion as _ } from "motion/react";
10
+ import { cn as f } from "../../utils/utils.js";
11
11
  /* empty css */
12
- const u = (a) => {
13
- a.target.closest(".xiping-main-content") && a.preventDefault();
14
- }, $ = (a) => {
12
+ const C = (c) => {
13
+ c.target.closest(".xiping-main-content") && c.preventDefault();
14
+ }, ne = (c) => {
15
15
  const {
16
- isOpen: n,
17
- onClose: f,
18
- imgSrc: s,
19
- thumbnailImages: x,
20
- canDownload: w = !1,
21
- wrapperClassName: v,
22
- closeClassName: C,
23
- downloadClassName: N,
24
- toolWrapperClassName: I,
25
- initialIndex: b = 0
26
- } = a, t = Array.isArray(s) ? s : [s], y = x || t, L = Math.max(
16
+ isOpen: a,
17
+ onClose: w,
18
+ imgSrc: d,
19
+ thumbnailImages: N,
20
+ canDownload: y = !1,
21
+ wrapperClassName: I,
22
+ closeClassName: E,
23
+ downloadClassName: L,
24
+ toolWrapperClassName: k,
25
+ initialIndex: D = 0
26
+ } = c, o = Array.isArray(d) ? d : [d], A = N || o, R = Math.max(
27
27
  0,
28
- Math.min(b, t.length - 1)
29
- ), [i, E] = h(L), [M, r] = h(!0), m = () => {
30
- r(!0), f();
31
- }, R = async () => {
32
- const d = t[i];
28
+ Math.min(D, o.length - 1)
29
+ ), [l, g] = v(R), [M, p] = v(!0), m = b(() => {
30
+ p(!0), w();
31
+ }, [w]), T = async () => {
32
+ const i = o[l];
33
33
  try {
34
- const z = await (await fetch(d)).blob(), g = window.URL.createObjectURL(z), o = document.createElement("a");
35
- o.href = g, o.download = d.split("/").pop() || "image", document.body.appendChild(o), o.click(), window.URL.revokeObjectURL(g), document.body.removeChild(o);
36
- } catch (p) {
37
- console.error("Error downloading image:", p);
34
+ const r = await (await fetch(i)).blob(), e = window.URL.createObjectURL(r), s = document.createElement("a");
35
+ s.href = e, s.download = i.split("/").pop() || "image", document.body.appendChild(s), s.click(), window.URL.revokeObjectURL(e), document.body.removeChild(s);
36
+ } catch (t) {
37
+ console.error("Error downloading image:", t);
38
38
  }
39
+ }, U = () => {
40
+ p(!1);
39
41
  }, j = () => {
40
- r(!1);
41
- }, k = () => {
42
- r(!1);
42
+ p(!1);
43
43
  };
44
- return P(() => {
45
- if (n)
46
- return document.addEventListener("touchmove", u, {
44
+ x(() => {
45
+ if (a)
46
+ return document.addEventListener("touchmove", C, {
47
47
  passive: !1
48
48
  }), () => {
49
- document.removeEventListener("touchmove", u);
49
+ document.removeEventListener("touchmove", C);
50
50
  };
51
- }, [n]), /* @__PURE__ */ e(
52
- D,
51
+ }, [a]);
52
+ const u = b(() => {
53
+ "vibrate" in navigator && navigator.vibrate([50, 50, 50]);
54
+ }, []);
55
+ return x(() => {
56
+ if (!a) return;
57
+ const i = (t) => {
58
+ const r = t.target;
59
+ if (!(r.tagName === "INPUT" || r.tagName === "TEXTAREA" || r.isContentEditable))
60
+ switch (t.key) {
61
+ case "ArrowLeft":
62
+ t.preventDefault(), g((e) => e > 0 ? e - 1 : (u(), e));
63
+ break;
64
+ case "ArrowRight":
65
+ t.preventDefault(), g((e) => e < o.length - 1 ? e + 1 : (u(), e));
66
+ break;
67
+ case "Escape":
68
+ t.preventDefault(), m();
69
+ break;
70
+ }
71
+ };
72
+ return document.addEventListener("keydown", i), () => {
73
+ document.removeEventListener("keydown", i);
74
+ };
75
+ }, [a, o.length, m, u]), /* @__PURE__ */ n(
76
+ z,
53
77
  {
54
- isOpen: n,
78
+ isOpen: a,
55
79
  size: "full",
56
80
  onClose: m,
57
81
  classNames: {
58
- wrapper: T(v)
82
+ wrapper: X(I)
59
83
  },
60
84
  className: "xiping-modal-overlay",
61
85
  hideCloseButton: !0,
62
86
  portalContainer: document.body,
63
- children: /* @__PURE__ */ e(O, { className: "xiping-modal-content", children: /* @__PURE__ */ c("div", { className: "xiping-wrapper", children: [
64
- /* @__PURE__ */ c("div", { className: l("xiping-tool-wrapper", I), children: [
65
- w && /* @__PURE__ */ e(
87
+ children: /* @__PURE__ */ n(O, { className: "xiping-modal-content", children: /* @__PURE__ */ h("div", { className: "xiping-wrapper", children: [
88
+ /* @__PURE__ */ h("div", { className: f("xiping-tool-wrapper", k), children: [
89
+ y && /* @__PURE__ */ n(
66
90
  B,
67
91
  {
68
92
  size: 24,
69
- className: l("xiping-download-icon", N),
70
- onClick: R
93
+ className: f("xiping-download-icon", L),
94
+ onClick: T
71
95
  }
72
96
  ),
73
- /* @__PURE__ */ e(
74
- V,
97
+ /* @__PURE__ */ n(
98
+ K,
75
99
  {
76
100
  size: 24,
77
- className: l("xiping-close-icon", C),
101
+ className: f("xiping-close-icon", E),
78
102
  onClick: m
79
103
  }
80
104
  )
81
105
  ] }),
82
- /* @__PURE__ */ c("div", { className: "xiping-main-content", children: [
83
- /* @__PURE__ */ e(U, { canRotate: !1, className: "xiping-pinch-content", children: /* @__PURE__ */ e(W, { mode: "wait", children: /* @__PURE__ */ e(
84
- X.img,
106
+ /* @__PURE__ */ h("div", { className: "xiping-main-content", children: [
107
+ /* @__PURE__ */ n(P, { canRotate: !1, className: "xiping-pinch-content", children: /* @__PURE__ */ n(W, { mode: "wait", children: /* @__PURE__ */ n(
108
+ _.img,
85
109
  {
86
110
  draggable: "false",
87
- src: t[i],
111
+ src: o[l],
88
112
  alt: "",
89
113
  className: "xiping-image",
90
- onLoad: j,
91
- onError: k,
114
+ onLoad: U,
115
+ onError: j,
92
116
  initial: { opacity: 0, scale: 0.95 },
93
117
  animate: { opacity: 1, scale: 1 },
94
118
  exit: { opacity: 0, scale: 1.05 },
@@ -97,16 +121,16 @@ const u = (a) => {
97
121
  ease: "easeInOut"
98
122
  }
99
123
  },
100
- i
124
+ l
101
125
  ) }) }),
102
- M && /* @__PURE__ */ e("div", { className: "xiping-loading", children: /* @__PURE__ */ e(S, { color: "white", size: "lg" }) })
126
+ M && /* @__PURE__ */ n("div", { className: "xiping-loading", children: /* @__PURE__ */ n(S, { color: "white", size: "lg" }) })
103
127
  ] }),
104
- /* @__PURE__ */ e(
105
- A,
128
+ /* @__PURE__ */ n(
129
+ V,
106
130
  {
107
- images: y,
108
- currentIndex: i,
109
- onImageSelect: E
131
+ images: A,
132
+ currentIndex: l,
133
+ onImageSelect: g
110
134
  }
111
135
  )
112
136
  ] }) })
@@ -114,5 +138,5 @@ const u = (a) => {
114
138
  );
115
139
  };
116
140
  export {
117
- $ as default
141
+ ne as default
118
142
  };
@@ -1,35 +1,37 @@
1
1
  import { jsx as E } from "react/jsx-runtime";
2
- import { useRef as g, useEffect as F } from "react";
3
- import { gsap as s } from "gsap";
2
+ import { useRef as m, useEffect as F } from "react";
3
+ import { gsap as i } from "gsap";
4
4
  import { ScrollTrigger as N } from "gsap/ScrollTrigger";
5
5
  import { SplitText as S } from "gsap/SplitText";
6
- s.registerPlugin(N, S);
7
- const W = ({
8
- text: i,
6
+ import j from "clsx";
7
+ /* empty css */
8
+ i.registerPlugin(N, S);
9
+ const A = ({
10
+ text: l,
9
11
  className: C = "",
10
- delay: m = 100,
12
+ delay: g = 100,
11
13
  duration: d = 0.6,
12
14
  ease: h = "power3.out",
13
15
  splitType: n = "chars",
14
16
  from: w = { opacity: 0, y: 40 },
15
- to: a = { opacity: 1, y: 0 },
17
+ to: c = { opacity: 1, y: 0 },
16
18
  threshold: x = 0.1,
17
- rootMargin: $ = "-100px",
19
+ rootMargin: y = "-100px",
18
20
  textAlign: R = "center",
19
- onLetterAnimationComplete: b
21
+ onLetterAnimationComplete: T
20
22
  }) => {
21
- const c = g(null), k = g(!1), o = g(null);
23
+ const a = m(null), $ = m(!1), o = m(null);
22
24
  return F(() => {
23
- if (typeof window > "u" || !c.current || !i) return;
24
- const u = c.current;
25
- k.current = !1;
26
- const y = n === "lines";
27
- y && (u.style.position = "relative");
25
+ if (typeof window > "u" || !a.current || !l) return;
26
+ const p = a.current;
27
+ $.current = !1;
28
+ const b = n === "lines";
29
+ b && (p.style.position = "relative");
28
30
  let r;
29
31
  try {
30
- r = new S(u, {
32
+ r = new S(p, {
31
33
  type: n,
32
- absolute: y,
34
+ absolute: b,
33
35
  linesClass: "split-line"
34
36
  });
35
37
  } catch (t) {
@@ -57,9 +59,9 @@ const W = ({
57
59
  e.forEach((t) => {
58
60
  t.style.willChange = "transform, opacity";
59
61
  });
60
- const v = (1 - x) * 100, l = /^(-?\d+(?:\.\d+)?)(px|em|rem|%)?$/.exec($), f = l ? parseFloat(l[1]) : 0, T = l && l[2] || "px", P = f < 0 ? `-=${Math.abs(f)}${T}` : `+=${f}${T}`, D = `top ${v}%${P}`, p = s.timeline({
62
+ const v = (1 - x) * 100, s = /^(-?\d+(?:\.\d+)?)(px|em|rem|%)?$/.exec(y), u = s ? parseFloat(s[1]) : 0, k = s && s[2] || "px", P = u < 0 ? `-=${Math.abs(u)}${k}` : `+=${u}${k}`, D = `top ${v}%${P}`, f = i.timeline({
61
63
  scrollTrigger: {
62
- trigger: u,
64
+ trigger: p,
63
65
  start: D,
64
66
  toggleActions: "play none none none",
65
67
  once: !0,
@@ -69,46 +71,46 @@ const W = ({
69
71
  },
70
72
  smoothChildTiming: !0,
71
73
  onComplete: () => {
72
- k.current = !0, s.set(e, {
73
- ...a,
74
+ $.current = !0, i.set(e, {
75
+ ...c,
74
76
  clearProps: "willChange",
75
77
  immediateRender: !0
76
- }), b?.();
78
+ }), T?.();
77
79
  }
78
80
  });
79
- return p.set(e, { ...w, immediateRender: !1, force3D: !0 }), p.to(e, {
80
- ...a,
81
+ return f.set(e, { ...w, immediateRender: !1, force3D: !0 }), f.to(e, {
82
+ ...c,
81
83
  duration: d,
82
84
  ease: h,
83
- stagger: m / 1e3,
85
+ stagger: g / 1e3,
84
86
  force3D: !0
85
87
  }), () => {
86
- p.kill(), o.current && (o.current.kill(), o.current = null), s.killTweensOf(e), r && r.revert();
88
+ f.kill(), o.current && (o.current.kill(), o.current = null), i.killTweensOf(e), r && r.revert();
87
89
  };
88
90
  }, [
89
- i,
90
- m,
91
+ l,
92
+ g,
91
93
  d,
92
94
  h,
93
95
  n,
94
96
  w,
95
- a,
97
+ c,
96
98
  x,
97
- $,
98
- b
99
+ y,
100
+ T
99
101
  ]), /* @__PURE__ */ E(
100
102
  "p",
101
103
  {
102
- ref: c,
103
- className: `split-parent overflow-hidden inline-block whitespace-normal ${C}`,
104
+ ref: a,
105
+ className: j("xiping-split-parent", C),
104
106
  style: {
105
107
  textAlign: R,
106
108
  wordWrap: "break-word"
107
109
  },
108
- children: i
110
+ children: l
109
111
  }
110
112
  );
111
113
  };
112
114
  export {
113
- W as SplitText
115
+ A as SplitText
114
116
  };
@@ -1,20 +1,21 @@
1
1
  "use client";
2
2
  import { jsx as T } from "react/jsx-runtime";
3
3
  import { cn as x } from "../../utils/utils.js";
4
- import { motion as b } from "motion/react";
5
- import { useState as u, useRef as I, useEffect as a } from "react";
6
- function R({
4
+ import { motion as I } from "motion/react";
5
+ import { useState as u, useRef as b, useEffect as a } from "react";
6
+ /* empty css */
7
+ function S({
7
8
  children: r,
8
- className: l,
9
+ className: m,
9
10
  duration: s = 100,
10
11
  delay: n = 0,
11
- as: m = "div",
12
+ as: l = "div",
12
13
  startOnView: i = !1,
13
14
  ...p
14
15
  }) {
15
- const d = b.create(m, {
16
+ const d = I.create(l, {
16
17
  forwardMotionProps: !0
17
- }), [g, v] = u(""), [c, f] = u(!1), o = I(null);
18
+ }), [g, v] = u(""), [c, f] = u(!1), o = b(null);
18
19
  return a(() => {
19
20
  if (!i) {
20
21
  const t = setTimeout(() => {
@@ -44,16 +45,13 @@ function R({
44
45
  d,
45
46
  {
46
47
  ref: o,
47
- className: x(
48
- "text-4xl font-bold leading-[5rem] tracking-[-0.02em]",
49
- l
50
- ),
48
+ className: x("xiping-typing-animation", m),
51
49
  ...p,
52
50
  children: g
53
51
  }
54
52
  );
55
53
  }
56
54
  export {
57
- R as TypingAnimation,
58
- R as default
55
+ S as TypingAnimation,
56
+ S as default
59
57
  };
@@ -0,0 +1,15 @@
1
+ import { RefObject, HTMLAttributes } from 'react';
2
+ interface VariableProximityProps extends HTMLAttributes<HTMLSpanElement> {
3
+ label: string;
4
+ fromFontVariationSettings: string;
5
+ toFontVariationSettings: string;
6
+ containerRef: RefObject<HTMLElement>;
7
+ radius?: number;
8
+ falloff?: "linear" | "exponential" | "gaussian";
9
+ className?: string;
10
+ onClick?: () => void;
11
+ style?: React.CSSProperties;
12
+ }
13
+ declare const VariableProximity: import('react').ForwardRefExoticComponent<VariableProximityProps & import('react').RefAttributes<HTMLSpanElement>>;
14
+ export { VariableProximity };
15
+ export default VariableProximity;
@@ -0,0 +1,140 @@
1
+ import { jsxs as $, jsx as C } from "react/jsx-runtime";
2
+ import { forwardRef as k, useRef as d, useMemo as D, useEffect as F } from "react";
3
+ import { motion as T } from "motion/react";
4
+ /* empty css */
5
+ function z(c) {
6
+ F(() => {
7
+ let i;
8
+ const s = () => {
9
+ c(), i = requestAnimationFrame(s);
10
+ };
11
+ return i = requestAnimationFrame(s), () => cancelAnimationFrame(i);
12
+ }, [c]);
13
+ }
14
+ function G(c) {
15
+ const i = d({ x: 0, y: 0 });
16
+ return F(() => {
17
+ const s = (r, a) => {
18
+ if (c?.current) {
19
+ const p = c.current.getBoundingClientRect();
20
+ i.current = { x: r - p.left, y: a - p.top };
21
+ } else
22
+ i.current = { x: r, y: a };
23
+ }, u = (r) => s(r.clientX, r.clientY), f = (r) => {
24
+ const a = r.touches[0];
25
+ s(a.clientX, a.clientY);
26
+ };
27
+ return window.addEventListener("mousemove", u), window.addEventListener("touchmove", f), () => {
28
+ window.removeEventListener("mousemove", u), window.removeEventListener("touchmove", f);
29
+ };
30
+ }, [c]), i;
31
+ }
32
+ const H = k(
33
+ (c, i) => {
34
+ const {
35
+ label: s,
36
+ fromFontVariationSettings: u,
37
+ toFontVariationSettings: f,
38
+ containerRef: r,
39
+ radius: a = 50,
40
+ falloff: p = "linear",
41
+ className: R = "",
42
+ onClick: V,
43
+ style: P,
44
+ ...E
45
+ } = c, x = d([]), v = d([]), h = G(r), g = d({
46
+ x: null,
47
+ y: null
48
+ }), A = D(() => {
49
+ const e = (t) => new Map(
50
+ t.split(",").map((l) => l.trim()).map((l) => {
51
+ const [m, y] = l.split(" ");
52
+ return [m.replace(/['"]/g, ""), parseFloat(y)];
53
+ })
54
+ ), n = e(u), o = e(f);
55
+ return Array.from(n.entries()).map(([t, l]) => ({
56
+ axis: t,
57
+ fromValue: l,
58
+ toValue: o.get(t) ?? l
59
+ }));
60
+ }, [u, f]), L = (e, n, o, t) => Math.sqrt((o - e) ** 2 + (t - n) ** 2), b = (e) => {
61
+ const n = Math.min(Math.max(1 - e / a, 0), 1);
62
+ switch (p) {
63
+ case "exponential":
64
+ return n ** 2;
65
+ case "gaussian":
66
+ return Math.exp(-((e / (a / 2)) ** 2) / 2);
67
+ case "linear":
68
+ default:
69
+ return n;
70
+ }
71
+ };
72
+ z(() => {
73
+ if (!r?.current) return;
74
+ const { x: e, y: n } = h.current;
75
+ if (g.current.x === e && g.current.y === n)
76
+ return;
77
+ g.current = { x: e, y: n };
78
+ const o = r.current.getBoundingClientRect();
79
+ x.current.forEach((t, l) => {
80
+ if (!t) return;
81
+ const m = t.getBoundingClientRect(), y = m.left + m.width / 2 - o.left, q = m.top + m.height / 2 - o.top, w = L(
82
+ h.current.x,
83
+ h.current.y,
84
+ y,
85
+ q
86
+ );
87
+ if (w >= a) {
88
+ t.style.fontVariationSettings = u;
89
+ return;
90
+ }
91
+ const B = b(w), M = A.map(({ axis: I, fromValue: S, toValue: X }) => {
92
+ const Y = S + (X - S) * B;
93
+ return `'${I}' ${Y}`;
94
+ }).join(", ");
95
+ v.current[l] = M, t.style.fontVariationSettings = M;
96
+ });
97
+ });
98
+ const N = /[\u4e00-\u9fa5]/.test(s) ? s.split("") : s.split(" ").flatMap((e, n, o) => {
99
+ const t = e.split("");
100
+ return n < o.length - 1 ? [...t, " "] : t;
101
+ });
102
+ let j = 0;
103
+ return /* @__PURE__ */ $(
104
+ "span",
105
+ {
106
+ ref: i,
107
+ className: `${R} variable-proximity`,
108
+ onClick: V,
109
+ style: { display: "inline", ...P },
110
+ ...E,
111
+ children: [
112
+ N.map((e, n) => {
113
+ const o = j++;
114
+ return /* @__PURE__ */ C(
115
+ T.span,
116
+ {
117
+ ref: (t) => {
118
+ x.current[o] = t;
119
+ },
120
+ style: {
121
+ display: e === " " ? "inline" : "inline-block",
122
+ fontVariationSettings: v.current[o]
123
+ },
124
+ "aria-hidden": "true",
125
+ children: e
126
+ },
127
+ n
128
+ );
129
+ }),
130
+ /* @__PURE__ */ C("span", { className: "sr-only", children: s })
131
+ ]
132
+ }
133
+ );
134
+ }
135
+ );
136
+ H.displayName = "VariableProximity";
137
+ export {
138
+ H as VariableProximity,
139
+ H as default
140
+ };