@brightlocal/ui-components 1.3.0 → 1.4.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.
@@ -1,245 +1,319 @@
1
- import { jsx as m, jsxs as I } from "react/jsx-runtime";
2
- import * as V from "react";
3
- import { useId as gt, useRef as R, useState as Ct, useCallback as yt, useEffect as Z } from "react";
4
- import { animate as X } from "framer-motion";
5
- import { interpolate as bt } from "flubber";
6
- import { cn as wt } from "@brightlocal/ui-components/lib/utils";
7
- import { usePrefersReducedMotion as vt } from "./hooks/use-prefers-reduced-motion.js";
8
- const Y = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", tt = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", et = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", L = (A) => A < 0 ? 0 : A > 1 ? 1 : A, xt = [
9
- Y,
10
- tt,
11
- et,
12
- Y,
13
- et,
14
- tt
15
- ], Mt = V.forwardRef(
1
+ import { jsx as y, jsxs as O } from "react/jsx-runtime";
2
+ import * as gt from "react";
3
+ import { useId as It, useMemo as yt, useRef as S, useState as Et, useCallback as Ft, useEffect as st } from "react";
4
+ import { animate as j } from "framer-motion";
5
+ import { cn as Xt } from "@brightlocal/ui-components/lib/utils";
6
+ import { usePrefersReducedMotion as $t } from "./hooks/use-prefers-reduced-motion.js";
7
+ const Ct = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", wt = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", bt = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", z = (f) => f < 0 ? 0 : f > 1 ? 1 : f, Dt = [
8
+ Ct,
9
+ wt,
10
+ bt,
11
+ Ct,
12
+ bt,
13
+ wt
14
+ ], Ht = 30, Tt = 15, _t = typeof navigator < "u" && typeof navigator.hardwareConcurrency == "number" && navigator.hardwareConcurrency <= 4;
15
+ function qt(f, H, C) {
16
+ let w = !1, b = null;
17
+ const i = { ballX: 0, clipRight: 100, rotate: 0, pathD: "" };
18
+ function Z() {
19
+ w = !1, f.style.transform = `translateX(${i.ballX}px)`, b && (b.style.clipPath = `inset(0 ${i.clipRight}% 0 0)`), H.style.transform = `rotate(${i.rotate}deg)`, C.setAttribute("d", i.pathD);
20
+ }
21
+ function N(T, G, J, r) {
22
+ i.ballX = T, i.clipRight = G, i.rotate = J, i.pathD = r, w || (w = !0, requestAnimationFrame(Z));
23
+ }
24
+ return N.setItem = (T) => {
25
+ b = T;
26
+ }, N;
27
+ }
28
+ function Rt(f, H) {
29
+ return new Promise((C) => {
30
+ const w = performance.now();
31
+ function b() {
32
+ H.cancelled || performance.now() - w >= f ? C() : requestAnimationFrame(b);
33
+ }
34
+ requestAnimationFrame(b);
35
+ });
36
+ }
37
+ const zt = gt.forwardRef(
16
38
  ({
17
- className: A,
18
- dataHook: nt,
19
- holdTime: S = 1300,
20
- shimmer: j = !0,
21
- gradientFrom: rt = "var(--loading-gradient-from)",
22
- gradientTo: st = "var(--loading-gradient-to)",
23
- trackingEl: at,
24
- trackingLabel: ot,
25
- children: it,
26
- ...lt
27
- }, ct) => {
28
- const o = xt, T = 0.8, F = 180, z = 24, H = 1, k = vt(), D = `text-reveal-gradient-${gt().replace(/:/g, "")}`, N = R(null), U = R(null), B = R(null), _ = R(null), G = R(null), C = R(/* @__PURE__ */ new Map()), P = V.Children.toArray(it), [ft, pt] = Ct({ widths: [], ballSize: 0 }), { widths: b, ballSize: i } = ft, dt = yt(
29
- (e) => (t) => {
30
- t ? C.current.set(e, t) : C.current.delete(e);
39
+ className: f,
40
+ dataHook: H,
41
+ holdTime: C = 1300,
42
+ shimmer: w = !0,
43
+ gradientFrom: b = "var(--loading-gradient-from)",
44
+ gradientTo: i = "var(--loading-gradient-to)",
45
+ trackingEl: Z,
46
+ trackingLabel: N,
47
+ children: T,
48
+ ...G
49
+ }, J) => {
50
+ const r = Dt, K = 0.8, Q = 180, V = 24, Y = 1, U = $t(), lt = It(), it = yt(
51
+ () => `text-reveal-gradient-${lt.replace(/:/g, "")}`,
52
+ [lt]
53
+ ), tt = S(null), et = S(null), nt = S(null), rt = S(null), ct = S(null), at = S(null), ot = S(null), P = S([]), F = gt.Children.toArray(T), [xt, Mt] = Et({ widths: [], ballSize: 0 }), { widths: d, ballSize: o } = xt, Lt = Ft(
54
+ (n) => (t) => {
55
+ P.current[n] = t;
31
56
  },
32
57
  []
33
58
  );
34
- Z(() => {
35
- if (C.current.size === 0) return;
36
- const e = requestAnimationFrame(() => {
37
- const t = [];
38
- let c = 32;
39
- C.current.forEach((p, n) => {
40
- if (t[n] = p.scrollWidth, n === 0) {
41
- const w = p.firstElementChild ?? p, h = parseFloat(getComputedStyle(w).fontSize) || 16;
42
- c = Math.round(h * 1.5);
59
+ st(() => {
60
+ if (P.current.length === 0 || !P.current[0]) return;
61
+ let n = !1;
62
+ function t() {
63
+ if (n) return;
64
+ const u = [];
65
+ let R = 32;
66
+ for (let p = 0; p < F.length; p++) {
67
+ const x = P.current[p];
68
+ if (x && (u[p] = x.scrollWidth, p === 0)) {
69
+ const X = x.firstElementChild ?? x, e = parseFloat(getComputedStyle(X).fontSize) || 16;
70
+ R = Math.round(e * 1.5);
43
71
  }
44
- }), pt({ widths: t, ballSize: c });
45
- });
46
- return () => cancelAnimationFrame(e);
47
- }, [P.length]), Z(() => {
48
- if (k) return;
49
- const e = G.current;
50
- if (!e) return;
51
- const t = e;
52
- let c, p = null;
53
- const n = 0.12 + Math.random() * 0.06, w = 0.08 + Math.random() * 0.04, h = Math.random() * Math.PI * 2, q = Math.random() * Math.PI * 2;
54
- let s = -1 / 0;
55
- function a(l) {
56
- p || (p = l);
57
- const v = (l - p) / 1e3, f = Math.sin(v * n + h) * Math.PI + Math.sin(v * w + q) * 0.5;
58
- if (Math.abs(f - s) > 0.01) {
59
- s = f;
60
- const u = Math.cos(f), x = Math.sin(f);
61
- t.setAttribute("x1", `${50 + 45 * u}%`), t.setAttribute("y1", `${50 + 45 * x}%`), t.setAttribute("x2", `${50 - 45 * u}%`), t.setAttribute("y2", `${50 - 45 * x}%`);
62
72
  }
63
- c = requestAnimationFrame(a);
73
+ Mt({ widths: u, ballSize: R });
74
+ }
75
+ return document.fonts.ready.then(() => {
76
+ n || requestAnimationFrame(t);
77
+ }), () => {
78
+ n = !0;
79
+ };
80
+ }, [F.length]), st(() => {
81
+ if (U) return;
82
+ const n = ct.current;
83
+ if (!n) return;
84
+ const t = n;
85
+ let u, R = null;
86
+ const p = 0.12 + Math.random() * 0.06, x = 0.08 + Math.random() * 0.04, X = Math.random() * Math.PI * 2, e = Math.random() * Math.PI * 2;
87
+ let _ = -1 / 0;
88
+ function W(c) {
89
+ R || (R = c);
90
+ const s = (c - R) / 1e3, l = Math.sin(s * p + X) * Math.PI + Math.sin(s * x + e) * 0.5;
91
+ if (Math.abs(l - _) > 0.01) {
92
+ _ = l;
93
+ const k = Math.cos(l), q = Math.sin(l);
94
+ t.setAttribute("x1", `${50 + 45 * k}%`), t.setAttribute("y1", `${50 + 45 * q}%`), t.setAttribute("x2", `${50 - 45 * k}%`), t.setAttribute("y2", `${50 - 45 * q}%`);
95
+ }
96
+ u = requestAnimationFrame(W);
64
97
  }
65
- return c = requestAnimationFrame(a), () => cancelAnimationFrame(c);
66
- }, [k]);
67
- function mt(e) {
68
- e.style.opacity = "1", X(0, 1, {
98
+ return u = requestAnimationFrame(W), () => cancelAnimationFrame(u);
99
+ }, [U]);
100
+ function vt(n) {
101
+ n.style.opacity = "1", j(0, 1, {
69
102
  duration: 1.2,
70
103
  ease: [0.25, 1, 0.5, 1],
71
104
  onUpdate: (t) => {
72
- e.style.transform = `translateX(${-100 + t * 200}%)`;
105
+ n.style.transform = `translateX(${-100 + t * 200}%)`;
73
106
  },
74
107
  onComplete: () => {
75
- e.style.opacity = "0";
108
+ n.style.opacity = "0";
76
109
  }
77
110
  });
78
111
  }
79
- Z(() => {
80
- if (!B.current || !_.current || !N.current || !U.current || b.length === 0 || i === 0)
112
+ st(() => {
113
+ if (!nt.current || !rt.current || !tt.current || !et.current || !at.current || !ot.current || d.length === 0 || o === 0)
81
114
  return;
82
- const e = B.current, t = _.current, c = N.current, p = U.current;
83
- if (k) {
84
- e.setAttribute("d", o[0]), t.style.opacity = "1";
85
- const s = C.current.get(0);
86
- s && (s.style.visibility = "visible", s.style.clipPath = "none");
87
- const a = i * 0.5, l = (b[0] ?? 0) + a + i / 2;
88
- c.style.transform = `translateX(${l}px)`;
115
+ const n = nt.current, t = rt.current, u = tt.current, R = et.current, p = at.current, x = ot.current;
116
+ function X(c) {
117
+ const s = `${c}px`;
118
+ p.style.width = s, x.style.width = s;
119
+ }
120
+ if (U) {
121
+ n.setAttribute("d", r[0]), t.style.opacity = "1";
122
+ const c = P.current[0];
123
+ c && (c.style.opacity = "1", c.style.clipPath = "none"), X(d[0] ?? 0);
124
+ const s = o * 0.25, l = (d[0] ?? 0) + s + o / 2;
125
+ u.style.transform = `translateX(${l}px)`;
89
126
  return;
90
127
  }
91
- let n = !1;
92
- const w = i * 0.5, h = [];
93
- for (let s = 0; s < o.length; s++)
94
- h.push(
95
- bt(o[s], o[(s + 1) % o.length])
96
- );
97
- async function q() {
128
+ const e = { cancelled: !1 }, _ = o * 0.25;
129
+ async function W() {
130
+ const { interpolate: c } = await import("flubber");
131
+ if (e.cancelled) return;
132
+ const s = _t ? Tt : Ht, l = [];
133
+ for (let M = 0; M < r.length; M++) {
134
+ const L = c(
135
+ r[M],
136
+ r[(M + 1) % r.length]
137
+ ), v = [];
138
+ for (let A = 0; A <= s; A++)
139
+ v.push(L(A / s));
140
+ l.push(v);
141
+ }
142
+ const k = qt(u, t, n);
98
143
  t.style.opacity = "1";
99
- let s = 0, a = 0, l = 0;
100
- for (; !n; ) {
101
- const v = s % P.length, f = b[v] ?? 0, u = -(w + i / 2), x = f + w + i / 2, J = x - u, W = C.current.get(v);
102
- if (!W) break;
103
- C.current.forEach((r, y) => {
104
- r.style.visibility = y === v ? "visible" : "hidden", r.style.clipPath = "inset(0 100% 0 0)";
105
- });
106
- const ht = h[a % o.length], $ = 360, K = l;
107
- if (await new Promise((r) => {
108
- if (n) {
109
- r();
144
+ let q = 0, m = 0, I = 0;
145
+ for (; !e.cancelled; ) {
146
+ const M = q % F.length, L = d[M] ?? 0;
147
+ X(L);
148
+ const v = -(_ + o / 2), A = L + _ + o / 2, dt = A - v, ut = P.current[M];
149
+ if (!ut) break;
150
+ k.setItem(ut);
151
+ for (let a = 0; a < F.length; a++) {
152
+ const h = P.current[a];
153
+ h && (h.style.opacity = a === M ? "1" : "0", h.style.clipPath = "inset(0 100% 0 0)");
154
+ }
155
+ const St = l[m % r.length], B = 360, pt = I;
156
+ if (await new Promise((a) => {
157
+ if (e.cancelled) {
158
+ a();
110
159
  return;
111
160
  }
112
- const y = X(u, x, {
161
+ const h = j(v, A, {
113
162
  type: "spring",
114
- stiffness: F * T,
115
- damping: z,
116
- mass: H,
117
- onUpdate: (d) => {
118
- if (n) {
119
- y.stop(), r();
163
+ stiffness: Q * K,
164
+ damping: V,
165
+ mass: Y,
166
+ onUpdate: (g) => {
167
+ if (e.cancelled) {
168
+ h.stop(), a();
120
169
  return;
121
170
  }
122
- c.style.transform = `translateX(${d}px)`;
123
- const M = f > 0 ? 100 - L(d / f) * 100 : 100;
124
- W.style.clipPath = `inset(0 ${M}% 0 0)`;
125
- const g = (d - u) / J;
126
- t.style.transform = `rotate(${K + g * $}deg)`, e.setAttribute("d", ht(L(g)));
171
+ const E = z((g - v) / dt), $ = L > 0 ? 100 - z(g / L) * 100 : 100, D = Math.round(E * s);
172
+ k(
173
+ g,
174
+ $,
175
+ pt + E * B,
176
+ St[D]
177
+ );
127
178
  },
128
179
  onComplete: () => {
129
- l = K + $, a = (a + 1) % o.length, r();
180
+ I = pt + B, m = (m + 1) % r.length, a();
130
181
  }
131
182
  });
132
- }), n) break;
133
- if (j && mt(p), S > 0) {
134
- const r = performance.now();
135
- for (; !n && performance.now() - r < S && (await new Promise((E) => setTimeout(E, 300)), !(n || performance.now() - r >= S)); ) {
136
- const y = (a + 1) % o.length, d = h[a % o.length], M = l, g = l + 360;
137
- await X(0, 1, {
183
+ }), e.cancelled) break;
184
+ if (w && vt(R), C > 0) {
185
+ const a = performance.now(), h = A;
186
+ for (; !e.cancelled && performance.now() - a < C && (await Rt(300, e), !(e.cancelled || performance.now() - a >= C)); ) {
187
+ const g = (m + 1) % r.length, E = l[m % r.length], $ = I, D = I + 360;
188
+ await j(0, 1, {
138
189
  type: "spring",
139
190
  stiffness: 30,
140
191
  damping: 9,
141
192
  mass: 0.5,
142
- onUpdate: (E) => {
143
- e.setAttribute("d", d(L(E))), t.style.transform = `rotate(${M + E * (g - M)}deg)`;
193
+ onUpdate: (ht) => {
194
+ const kt = Math.round(z(ht) * s);
195
+ k(
196
+ h,
197
+ 0,
198
+ $ + ht * (D - $),
199
+ E[kt]
200
+ );
144
201
  }
145
- }), l = g, a = y;
202
+ }), I = D, m = g;
146
203
  }
147
204
  }
148
- if (n) break;
149
- const ut = h[a % o.length], Q = l;
150
- if (await new Promise((r) => {
151
- if (n) {
152
- r();
205
+ if (e.cancelled) break;
206
+ const Pt = l[m % r.length], mt = I;
207
+ if (await new Promise((a) => {
208
+ if (e.cancelled) {
209
+ a();
153
210
  return;
154
211
  }
155
- const y = X(x, u, {
212
+ const h = j(A, v, {
156
213
  type: "spring",
157
- stiffness: F * T,
158
- damping: z,
159
- mass: H,
160
- onUpdate: (d) => {
161
- if (n) {
162
- y.stop(), r();
214
+ stiffness: Q * K,
215
+ damping: V,
216
+ mass: Y,
217
+ onUpdate: (g) => {
218
+ if (e.cancelled) {
219
+ h.stop(), a();
163
220
  return;
164
221
  }
165
- c.style.transform = `translateX(${d}px)`;
166
- const M = f > 0 ? 100 - L(d / f) * 100 : 100;
167
- W.style.clipPath = `inset(0 ${M}% 0 0)`;
168
- const g = 1 - (d - u) / J;
169
- t.style.transform = `rotate(${Q - g * $}deg)`, e.setAttribute("d", ut(L(g)));
222
+ const E = z(1 - (g - v) / dt), $ = L > 0 ? 100 - z(g / L) * 100 : 100, D = Math.round(E * s);
223
+ k(
224
+ g,
225
+ $,
226
+ mt - E * B,
227
+ Pt[D]
228
+ );
170
229
  },
171
230
  onComplete: () => {
172
- l = Q - $, a = (a + 1) % o.length, r();
231
+ I = mt - B, m = (m + 1) % r.length, a();
173
232
  }
174
233
  });
175
- }), n) break;
176
- await new Promise((r) => setTimeout(r, 300)), s++;
234
+ }), e.cancelled) break;
235
+ await Rt(300, e), q++;
177
236
  }
178
237
  }
179
- return q(), () => {
180
- n = !0;
238
+ return W(), () => {
239
+ e.cancelled = !0;
181
240
  };
182
241
  }, [
183
- b,
184
- i,
185
- P.length,
186
- k,
187
- T,
188
- S,
189
- j,
190
- F,
191
- z,
192
- H,
193
- o
242
+ d,
243
+ o,
244
+ F.length,
245
+ U,
246
+ K,
247
+ C,
248
+ w,
249
+ Q,
250
+ V,
251
+ Y,
252
+ r
194
253
  ]);
195
- const O = b.length > 0 ? Math.max(...b) : 0;
196
- return /* @__PURE__ */ m(
254
+ const ft = yt(
255
+ () => d.length > 0 ? Math.max(...d) : 0,
256
+ [d]
257
+ ), At = d.length > 0 && o > 0;
258
+ return /* @__PURE__ */ y(
197
259
  "div",
198
260
  {
199
- ref: ct,
200
- className: wt("relative inline-flex items-center", A),
201
- "data-hook": nt,
261
+ ref: J,
262
+ className: Xt("relative inline-flex items-center", f),
263
+ "data-hook": H,
202
264
  "data-slot": "text-reveal",
203
- "data-tracking-el": at,
204
- "data-tracking-label": ot,
205
- ...lt,
206
- children: /* @__PURE__ */ I(
265
+ "data-tracking-el": Z,
266
+ "data-tracking-label": N,
267
+ style: {
268
+ opacity: At ? 1 : 0,
269
+ transition: "opacity 0.4s ease-out"
270
+ },
271
+ ...G,
272
+ children: /* @__PURE__ */ O(
207
273
  "div",
208
274
  {
275
+ ref: at,
209
276
  className: "relative flex items-center",
210
- style: { width: O || void 0 },
277
+ style: {
278
+ width: ft || void 0,
279
+ transition: "width 0.3s ease-out"
280
+ },
211
281
  children: [
212
- /* @__PURE__ */ I(
282
+ /* @__PURE__ */ O(
213
283
  "span",
214
284
  {
285
+ ref: ot,
215
286
  className: "relative inline-block overflow-hidden",
216
- style: { width: O || void 0 },
287
+ style: {
288
+ width: ft || void 0,
289
+ transition: "width 0.3s ease-out"
290
+ },
217
291
  children: [
218
- P.map((e, t) => /* @__PURE__ */ m(
292
+ F.map((n, t) => /* @__PURE__ */ y(
219
293
  "span",
220
294
  {
221
- ref: dt(t),
295
+ ref: Lt(t),
222
296
  style: {
223
297
  display: "block",
224
298
  whiteSpace: "nowrap",
225
- visibility: "hidden",
299
+ opacity: 0,
226
300
  clipPath: "inset(0 100% 0 0)",
227
- willChange: "clip-path, visibility",
301
+ willChange: "clip-path",
228
302
  ...t > 0 ? { position: "absolute", top: 0, left: 0 } : {}
229
303
  },
230
- children: e
304
+ children: n
231
305
  },
232
306
  t
233
307
  )),
234
- /* @__PURE__ */ m(
308
+ /* @__PURE__ */ y(
235
309
  "div",
236
310
  {
237
- ref: U,
311
+ ref: et,
238
312
  className: "pointer-events-none absolute inset-0",
239
313
  style: {
240
314
  opacity: 0,
241
315
  transform: "translateX(-100%)",
242
- willChange: "transform, opacity",
316
+ willChange: "transform",
243
317
  background: "linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--background) 40%, transparent) 40%, color-mix(in srgb, var(--background) 70%, transparent) 50%, color-mix(in srgb, var(--background) 40%, transparent) 60%, transparent 100%)"
244
318
  }
245
319
  }
@@ -247,52 +321,52 @@ const Y = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C
247
321
  ]
248
322
  }
249
323
  ),
250
- /* @__PURE__ */ m(
324
+ /* @__PURE__ */ y(
251
325
  "div",
252
326
  {
253
- ref: N,
327
+ ref: tt,
254
328
  className: "absolute",
255
329
  style: {
256
- left: -i / 2,
330
+ left: -o / 2,
257
331
  top: "50%",
258
- marginTop: -i / 2,
259
- width: i,
260
- height: i,
332
+ marginTop: -o / 2,
333
+ width: o,
334
+ height: o,
261
335
  transform: "translateX(0px)",
262
336
  willChange: "transform"
263
337
  },
264
- children: /* @__PURE__ */ I(
338
+ children: /* @__PURE__ */ O(
265
339
  "svg",
266
340
  {
267
341
  "aria-label": "Loading",
268
342
  "data-slot": "text-reveal-ball",
269
343
  fill: "none",
270
- height: i,
344
+ height: o,
271
345
  role: "img",
272
346
  style: { overflow: "visible" },
273
347
  viewBox: "-30 -30 560 560",
274
- width: i,
348
+ width: o,
275
349
  xmlns: "http://www.w3.org/2000/svg",
276
350
  children: [
277
- /* @__PURE__ */ m("defs", { children: /* @__PURE__ */ I("linearGradient", { ref: G, id: D, children: [
278
- /* @__PURE__ */ m("stop", { offset: "-20%", stopColor: rt }),
279
- /* @__PURE__ */ m("stop", { offset: "120%", stopColor: st })
351
+ /* @__PURE__ */ y("defs", { children: /* @__PURE__ */ O("linearGradient", { ref: ct, id: it, children: [
352
+ /* @__PURE__ */ y("stop", { offset: "-20%", stopColor: b }),
353
+ /* @__PURE__ */ y("stop", { offset: "120%", stopColor: i })
280
354
  ] }) }),
281
- /* @__PURE__ */ m(
355
+ /* @__PURE__ */ y(
282
356
  "g",
283
357
  {
284
- ref: _,
358
+ ref: rt,
285
359
  style: {
286
360
  opacity: 0,
287
361
  transformOrigin: "250px 250px",
288
362
  willChange: "transform"
289
363
  },
290
- children: /* @__PURE__ */ m(
364
+ children: /* @__PURE__ */ y(
291
365
  "path",
292
366
  {
293
- ref: B,
294
- d: o[0],
295
- fill: `url(#${D})`
367
+ ref: nt,
368
+ d: r[0],
369
+ fill: `url(#${it})`
296
370
  }
297
371
  )
298
372
  }
@@ -309,7 +383,7 @@ const Y = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C
309
383
  );
310
384
  }
311
385
  );
312
- Mt.displayName = "TextRevealMotion";
386
+ zt.displayName = "TextRevealMotion";
313
387
  export {
314
- Mt as TextRevealMotion
388
+ zt as TextRevealMotion
315
389
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,