@brightlocal/ui-components 2.22.0 → 2.24.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.
- package/AI_USAGE.md +1 -1
- package/README.md +4 -2
- package/component-meta.json +134 -25
- package/deprecations.json +22 -0
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +32 -35
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +151 -156
- package/dist/brand-illustration-motif.cjs +1 -0
- package/dist/brand-illustration-motif.d.ts +55 -0
- package/dist/brand-illustration-motif.d.ts.map +1 -0
- package/dist/brand-illustration-motif.js +67 -0
- package/dist/chart.cjs +7 -7
- package/dist/chart.d.ts +287 -2
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +408 -152
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +14 -1
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +387 -376
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +111 -109
- package/dist/data-table.cjs +1 -0
- package/dist/{blocks/data-table.d.ts → data-table.d.ts} +159 -4
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +721 -0
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +109 -121
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +16 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +23 -7
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +32 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +179 -109
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +526 -509
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +9 -0
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +26 -22
- package/dist/lib/spring-settle.cjs +1 -0
- package/dist/lib/spring-settle.d.ts +20 -0
- package/dist/lib/spring-settle.d.ts.map +1 -0
- package/dist/lib/spring-settle.js +4 -0
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +3 -2
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +22 -11
- package/dist/loading.cjs +1 -0
- package/dist/loading.d.ts +47 -0
- package/dist/loading.d.ts.map +1 -0
- package/dist/loading.js +163 -0
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +1 -1
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -99
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +27 -26
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +16 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +112 -85
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +29 -0
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +2 -2
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +236 -219
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +21 -2
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +35 -32
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +20 -4
- package/dist/typography.d.ts.map +1 -1
- package/dist/typography.js +263 -228
- package/package.json +7 -7
- package/src/blocks/sidebar.tsx +11 -23
- package/src/components/alert.tsx +10 -17
- package/src/components/brand-illustration-motif.tsx +143 -0
- package/src/components/chart.tsx +632 -1
- package/src/components/combobox.tsx +47 -0
- package/src/components/context-menu.tsx +8 -3
- package/src/{blocks → components}/data-table.tsx +272 -18
- package/src/components/dropdown-menu.tsx +6 -15
- package/src/components/field.tsx +31 -0
- package/src/components/global-layout.tsx +144 -5
- package/src/components/label.tsx +13 -1
- package/src/components/link.tsx +13 -1
- package/src/components/loading.tsx +355 -0
- package/src/components/map.tsx +3 -1
- package/src/components/menubar.tsx +6 -5
- package/src/components/popover.tsx +6 -2
- package/src/components/select.tsx +87 -10
- package/src/components/table.tsx +31 -2
- package/src/components/text-reveal-motion.tsx +90 -64
- package/src/components/tooltip.tsx +28 -3
- package/src/components/typography.tsx +74 -18
- package/src/index.ts +3 -1
- package/src/lib/spring-settle.ts +19 -0
- package/dist/blocks/data-table.cjs +0 -1
- package/dist/blocks/data-table.d.ts.map +0 -1
- package/dist/blocks/data-table.js +0 -654
|
@@ -1,315 +1,321 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { animate as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { usePrefersReducedMotion as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as C, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import * as wt from "react";
|
|
3
|
+
import { useId as Tt, useMemo as bt, useRef as M, useState as Xt, useCallback as Ft, useEffect as it } from "react";
|
|
4
|
+
import { animate as Z } from "framer-motion";
|
|
5
|
+
import { cn as Dt } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { usePrefersReducedMotion as qt } from "./hooks/use-prefers-reduced-motion.js";
|
|
7
|
+
import { SETTLE_REST_DELTA as Rt } from "./lib/spring-settle.js";
|
|
8
|
+
const xt = "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", At = "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", Lt = "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", N = (u) => u < 0 ? 0 : u > 1 ? 1 : u, zt = [
|
|
9
|
+
xt,
|
|
10
|
+
At,
|
|
11
|
+
Lt,
|
|
12
|
+
xt,
|
|
13
|
+
Lt,
|
|
14
|
+
At
|
|
15
|
+
];
|
|
16
|
+
function Nt(u, T, w, S) {
|
|
17
|
+
let b = !1, X = null;
|
|
18
|
+
const c = { ballX: 0, clipRight: 100, rotate: 0, pathD: "" };
|
|
19
|
+
function j() {
|
|
20
|
+
b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`), T.style.transform = `rotate(${c.rotate}deg)`, S?.setAttribute(
|
|
21
|
+
"gradientTransform",
|
|
22
|
+
`rotate(${-c.rotate} 0.5 0.5)`
|
|
23
|
+
), w.setAttribute("d", c.pathD);
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
25
|
+
function U(F, G, O, s) {
|
|
26
|
+
c.ballX = F, c.clipRight = G, c.rotate = O, c.pathD = s, b || (b = !0, requestAnimationFrame(j));
|
|
23
27
|
}
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
},
|
|
28
|
+
return U.setItem = (F) => {
|
|
29
|
+
X = F;
|
|
30
|
+
}, U;
|
|
27
31
|
}
|
|
28
|
-
function
|
|
29
|
-
return new Promise((
|
|
30
|
-
const
|
|
32
|
+
function Mt(u, T) {
|
|
33
|
+
return new Promise((w) => {
|
|
34
|
+
const S = performance.now();
|
|
31
35
|
function b() {
|
|
32
|
-
|
|
36
|
+
T.cancelled || performance.now() - S >= u ? w() : requestAnimationFrame(b);
|
|
33
37
|
}
|
|
34
38
|
requestAnimationFrame(b);
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
|
-
const
|
|
41
|
+
const Ut = wt.forwardRef(
|
|
38
42
|
({
|
|
39
|
-
className:
|
|
40
|
-
dataHook:
|
|
41
|
-
holdTime:
|
|
42
|
-
shimmer:
|
|
43
|
+
className: u,
|
|
44
|
+
dataHook: T,
|
|
45
|
+
holdTime: w = 1300,
|
|
46
|
+
shimmer: S = !0,
|
|
43
47
|
gradientFrom: b = "var(--loading-gradient-from)",
|
|
44
|
-
gradientTo:
|
|
45
|
-
loadingLabel:
|
|
46
|
-
trackingEl:
|
|
47
|
-
trackingLabel:
|
|
48
|
-
children:
|
|
49
|
-
...
|
|
50
|
-
},
|
|
51
|
-
const
|
|
52
|
-
() => `text-reveal-gradient-${
|
|
53
|
-
[
|
|
54
|
-
),
|
|
55
|
-
(n) => (
|
|
56
|
-
|
|
48
|
+
gradientTo: X = "var(--loading-gradient-to)",
|
|
49
|
+
loadingLabel: c,
|
|
50
|
+
trackingEl: j,
|
|
51
|
+
trackingLabel: U,
|
|
52
|
+
children: F,
|
|
53
|
+
...G
|
|
54
|
+
}, O) => {
|
|
55
|
+
const s = zt, J = 0.8, K = 180, Q = 24, V = 1, _ = qt(), ct = Tt(), ft = bt(
|
|
56
|
+
() => `text-reveal-gradient-${ct.replace(/:/g, "")}`,
|
|
57
|
+
[ct]
|
|
58
|
+
), Y = M(null), tt = M(null), et = M(null), nt = M(null), rt = M(null), at = M(null), ot = M(null), v = M([]), k = wt.Children.toArray(F), [vt, St] = Xt({ widths: [], ballSize: 0 }), { widths: p, ballSize: a } = vt, kt = Ft(
|
|
59
|
+
(n) => (e) => {
|
|
60
|
+
v.current[n] = e;
|
|
57
61
|
},
|
|
58
62
|
[]
|
|
59
63
|
);
|
|
60
|
-
|
|
61
|
-
if (
|
|
64
|
+
it(() => {
|
|
65
|
+
if (v.current.length === 0 || !v.current[0]) return;
|
|
62
66
|
let n = !1;
|
|
63
|
-
function
|
|
67
|
+
function e() {
|
|
64
68
|
if (n) return;
|
|
65
|
-
const
|
|
69
|
+
const m = [];
|
|
66
70
|
let R = 32;
|
|
67
|
-
for (let
|
|
68
|
-
const x =
|
|
69
|
-
if (x && (
|
|
70
|
-
const
|
|
71
|
-
R = Math.round(
|
|
71
|
+
for (let h = 0; h < k.length; h++) {
|
|
72
|
+
const x = v.current[h];
|
|
73
|
+
if (x && (m[h] = x.scrollWidth, h === 0)) {
|
|
74
|
+
const E = x.firstElementChild ?? x, t = parseFloat(getComputedStyle(E).fontSize) || 16;
|
|
75
|
+
R = Math.round(t * 1.5);
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
|
-
|
|
78
|
+
St({ widths: m, ballSize: R });
|
|
75
79
|
}
|
|
76
80
|
return document.fonts.ready.then(() => {
|
|
77
|
-
n || requestAnimationFrame(
|
|
81
|
+
n || requestAnimationFrame(e);
|
|
78
82
|
}), () => {
|
|
79
83
|
n = !0;
|
|
80
84
|
};
|
|
81
|
-
}, [
|
|
82
|
-
if (
|
|
83
|
-
const n =
|
|
85
|
+
}, [k.length]), it(() => {
|
|
86
|
+
if (_) return;
|
|
87
|
+
const n = rt.current;
|
|
84
88
|
if (!n) return;
|
|
85
|
-
const
|
|
86
|
-
let
|
|
87
|
-
const
|
|
88
|
-
let
|
|
89
|
-
function
|
|
90
|
-
R || (R =
|
|
91
|
-
const
|
|
92
|
-
if (Math.abs(
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
89
|
+
const e = n;
|
|
90
|
+
let m, R = null;
|
|
91
|
+
const h = 0.12 + Math.random() * 0.06, x = 0.08 + Math.random() * 0.04, E = Math.random() * Math.PI * 2, t = Math.random() * Math.PI * 2;
|
|
92
|
+
let D = -1 / 0;
|
|
93
|
+
function B(f) {
|
|
94
|
+
R || (R = f);
|
|
95
|
+
const l = (f - R) / 1e3, o = -Math.PI / 4 + Math.sin(l * h + E) * 0.5 + Math.sin(l * x + t) * 0.25;
|
|
96
|
+
if (Math.abs(o - D) > 0.01) {
|
|
97
|
+
D = o;
|
|
98
|
+
const q = Math.cos(o), i = Math.sin(o);
|
|
99
|
+
e.setAttribute("x1", `${50 + 45 * q}%`), e.setAttribute("y1", `${50 + 45 * i}%`), e.setAttribute("x2", `${50 - 45 * q}%`), e.setAttribute("y2", `${50 - 45 * i}%`);
|
|
96
100
|
}
|
|
97
|
-
|
|
101
|
+
m = requestAnimationFrame(B);
|
|
98
102
|
}
|
|
99
|
-
return
|
|
100
|
-
}, [
|
|
101
|
-
function
|
|
102
|
-
n.style.opacity = "1",
|
|
103
|
+
return m = requestAnimationFrame(B), () => cancelAnimationFrame(m);
|
|
104
|
+
}, [_]);
|
|
105
|
+
function Et(n) {
|
|
106
|
+
n.style.opacity = "1", Z(0, 1, {
|
|
103
107
|
duration: 1.2,
|
|
104
108
|
ease: [0.25, 1, 0.5, 1],
|
|
105
|
-
onUpdate: (
|
|
106
|
-
n.style.transform = `translateX(${-100 +
|
|
109
|
+
onUpdate: (e) => {
|
|
110
|
+
n.style.transform = `translateX(${-100 + e * 200}%)`;
|
|
107
111
|
},
|
|
108
112
|
onComplete: () => {
|
|
109
113
|
n.style.opacity = "0";
|
|
110
114
|
}
|
|
111
115
|
});
|
|
112
116
|
}
|
|
113
|
-
|
|
114
|
-
if (!
|
|
117
|
+
it(() => {
|
|
118
|
+
if (!et.current || !nt.current || !Y.current || !tt.current || !at.current || !ot.current || p.length === 0 || a === 0)
|
|
115
119
|
return;
|
|
116
|
-
const n =
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
+
const n = et.current, e = nt.current, m = Y.current, R = tt.current, h = at.current, x = ot.current;
|
|
121
|
+
function E(f) {
|
|
122
|
+
const l = `${f}px`;
|
|
123
|
+
h.style.width = l, x.style.width = l;
|
|
120
124
|
}
|
|
121
|
-
if (
|
|
122
|
-
n.setAttribute("d",
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
125
|
+
if (_) {
|
|
126
|
+
n.setAttribute("d", s[0]), e.style.opacity = "1";
|
|
127
|
+
const f = v.current[0];
|
|
128
|
+
f && (f.style.opacity = "1", f.style.clipPath = "none"), E(p[0] ?? 0);
|
|
129
|
+
const l = a * 0.25, o = (p[0] ?? 0) + l + a / 2;
|
|
130
|
+
m.style.transform = `translateX(${o}px)`;
|
|
127
131
|
return;
|
|
128
132
|
}
|
|
129
|
-
const
|
|
130
|
-
async function
|
|
131
|
-
const { interpolate:
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
for (let
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
let q = 0,
|
|
146
|
-
for (; !
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const
|
|
133
|
+
const t = { cancelled: !1 }, D = a * 0.25;
|
|
134
|
+
async function B() {
|
|
135
|
+
const { interpolate: f } = await import("flubber");
|
|
136
|
+
if (t.cancelled) return;
|
|
137
|
+
const l = [];
|
|
138
|
+
for (let A = 0; A < s.length; A++)
|
|
139
|
+
l.push(
|
|
140
|
+
f(s[A], s[(A + 1) % s.length])
|
|
141
|
+
);
|
|
142
|
+
const o = Nt(
|
|
143
|
+
m,
|
|
144
|
+
e,
|
|
145
|
+
n,
|
|
146
|
+
rt.current
|
|
147
|
+
);
|
|
148
|
+
e.style.opacity = "1";
|
|
149
|
+
let q = 0, i = 0, g = 0;
|
|
150
|
+
for (; !t.cancelled; ) {
|
|
151
|
+
const A = q % k.length, P = p[A] ?? 0;
|
|
152
|
+
E(P);
|
|
153
|
+
const I = -(D + a / 2), z = P + D + a / 2, ut = z - I, pt = v.current[A];
|
|
150
154
|
if (!pt) break;
|
|
151
|
-
|
|
152
|
-
for (let r = 0; r <
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
+
o.setItem(pt);
|
|
156
|
+
for (let r = 0; r < k.length; r++) {
|
|
157
|
+
const d = v.current[r];
|
|
158
|
+
d && (d.style.opacity = r === A ? "1" : "0", d.style.clipPath = "inset(0 100% 0 0)");
|
|
155
159
|
}
|
|
156
|
-
const
|
|
160
|
+
const mt = l[i], H = 360, ht = g;
|
|
157
161
|
if (await new Promise((r) => {
|
|
158
|
-
if (
|
|
162
|
+
if (t.cancelled) {
|
|
159
163
|
r();
|
|
160
164
|
return;
|
|
161
165
|
}
|
|
162
|
-
const
|
|
166
|
+
const d = Z(I, z, {
|
|
163
167
|
type: "spring",
|
|
164
|
-
stiffness:
|
|
165
|
-
damping:
|
|
166
|
-
mass:
|
|
167
|
-
onUpdate: (
|
|
168
|
-
if (
|
|
169
|
-
|
|
168
|
+
stiffness: K * J,
|
|
169
|
+
damping: Q,
|
|
170
|
+
mass: V,
|
|
171
|
+
onUpdate: (y) => {
|
|
172
|
+
if (t.cancelled) {
|
|
173
|
+
d.stop(), r();
|
|
170
174
|
return;
|
|
171
175
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
g,
|
|
175
|
-
$,
|
|
176
|
-
mt + E * B,
|
|
177
|
-
Pt[D]
|
|
178
|
-
);
|
|
176
|
+
const L = N((y - I) / ut), $ = P > 0 ? 100 - N(y / P) * 100 : 100;
|
|
177
|
+
o(y, $, ht + L * H, mt(L));
|
|
179
178
|
},
|
|
180
179
|
onComplete: () => {
|
|
181
|
-
|
|
180
|
+
g = ht + H, i = (i + 1) % s.length, t.cancelled || o(z, 0, g, mt(1)), r();
|
|
182
181
|
}
|
|
183
182
|
});
|
|
184
|
-
}),
|
|
185
|
-
if (
|
|
186
|
-
const r = performance.now(),
|
|
187
|
-
for (; !
|
|
188
|
-
const
|
|
189
|
-
await
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
mass: 0.5,
|
|
194
|
-
onUpdate: (gt) => {
|
|
195
|
-
const It = Math.round(z(gt) * s);
|
|
196
|
-
k(
|
|
197
|
-
h,
|
|
198
|
-
0,
|
|
199
|
-
$ + gt * (D - $),
|
|
200
|
-
E[It]
|
|
201
|
-
);
|
|
183
|
+
}), t.cancelled) break;
|
|
184
|
+
if (S && Et(R), w > 0) {
|
|
185
|
+
const r = performance.now(), d = z;
|
|
186
|
+
for (; !t.cancelled && performance.now() - r < w && (await Mt(300, t), !(t.cancelled || performance.now() - r >= w)); ) {
|
|
187
|
+
const y = (i + 1) % s.length, L = l[i], $ = g, st = g + 360;
|
|
188
|
+
await new Promise((lt) => {
|
|
189
|
+
if (t.cancelled) {
|
|
190
|
+
lt();
|
|
191
|
+
return;
|
|
202
192
|
}
|
|
203
|
-
|
|
193
|
+
const It = Z(0, 1 + Rt, {
|
|
194
|
+
type: "spring",
|
|
195
|
+
stiffness: 30,
|
|
196
|
+
damping: 9,
|
|
197
|
+
mass: 0.5,
|
|
198
|
+
restDelta: Rt,
|
|
199
|
+
onUpdate: ($t) => {
|
|
200
|
+
if (t.cancelled) {
|
|
201
|
+
It.stop(), lt();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const Ct = N($t);
|
|
205
|
+
o(
|
|
206
|
+
d,
|
|
207
|
+
0,
|
|
208
|
+
$ + Ct * (st - $),
|
|
209
|
+
L(Ct)
|
|
210
|
+
);
|
|
211
|
+
},
|
|
212
|
+
onComplete: lt
|
|
213
|
+
});
|
|
214
|
+
}), t.cancelled || o(d, 0, st, L(1)), g = st, i = y;
|
|
204
215
|
}
|
|
205
216
|
}
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
217
|
+
if (t.cancelled) break;
|
|
218
|
+
const gt = l[i], yt = g;
|
|
208
219
|
if (await new Promise((r) => {
|
|
209
|
-
if (
|
|
220
|
+
if (t.cancelled) {
|
|
210
221
|
r();
|
|
211
222
|
return;
|
|
212
223
|
}
|
|
213
|
-
const
|
|
224
|
+
const d = Z(z, I, {
|
|
214
225
|
type: "spring",
|
|
215
|
-
stiffness:
|
|
216
|
-
damping:
|
|
217
|
-
mass:
|
|
218
|
-
onUpdate: (
|
|
219
|
-
if (
|
|
220
|
-
|
|
226
|
+
stiffness: K * J,
|
|
227
|
+
damping: Q,
|
|
228
|
+
mass: V,
|
|
229
|
+
onUpdate: (y) => {
|
|
230
|
+
if (t.cancelled) {
|
|
231
|
+
d.stop(), r();
|
|
221
232
|
return;
|
|
222
233
|
}
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
g,
|
|
226
|
-
$,
|
|
227
|
-
ht - E * B,
|
|
228
|
-
kt[D]
|
|
229
|
-
);
|
|
234
|
+
const L = N(1 - (y - I) / ut), $ = P > 0 ? 100 - N(y / P) * 100 : 100;
|
|
235
|
+
o(y, $, yt - L * H, gt(L));
|
|
230
236
|
},
|
|
231
237
|
onComplete: () => {
|
|
232
|
-
|
|
238
|
+
g = yt - H, i = (i + 1) % s.length, t.cancelled || o(I, 100, g, gt(1)), r();
|
|
233
239
|
}
|
|
234
240
|
});
|
|
235
|
-
}),
|
|
236
|
-
await
|
|
241
|
+
}), t.cancelled) break;
|
|
242
|
+
await Mt(300, t), q++;
|
|
237
243
|
}
|
|
238
244
|
}
|
|
239
|
-
return
|
|
240
|
-
|
|
245
|
+
return B(), () => {
|
|
246
|
+
t.cancelled = !0;
|
|
241
247
|
};
|
|
242
248
|
}, [
|
|
243
|
-
|
|
249
|
+
p,
|
|
244
250
|
a,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
C,
|
|
251
|
+
k.length,
|
|
252
|
+
_,
|
|
253
|
+
J,
|
|
249
254
|
w,
|
|
255
|
+
S,
|
|
256
|
+
K,
|
|
257
|
+
Q,
|
|
250
258
|
V,
|
|
251
|
-
|
|
252
|
-
tt,
|
|
253
|
-
o
|
|
259
|
+
s
|
|
254
260
|
]);
|
|
255
|
-
const dt =
|
|
256
|
-
() =>
|
|
257
|
-
[
|
|
258
|
-
),
|
|
259
|
-
return /* @__PURE__ */
|
|
261
|
+
const dt = bt(
|
|
262
|
+
() => p.length > 0 ? Math.max(...p) : 0,
|
|
263
|
+
[p]
|
|
264
|
+
), Pt = p.length > 0 && a > 0;
|
|
265
|
+
return /* @__PURE__ */ C(
|
|
260
266
|
"div",
|
|
261
267
|
{
|
|
262
|
-
ref:
|
|
263
|
-
className:
|
|
264
|
-
"data-hook":
|
|
268
|
+
ref: O,
|
|
269
|
+
className: Dt("relative inline-flex items-center", u),
|
|
270
|
+
"data-hook": T,
|
|
265
271
|
"data-slot": "text-reveal",
|
|
266
|
-
"data-tracking-el":
|
|
267
|
-
"data-tracking-label":
|
|
272
|
+
"data-tracking-el": j,
|
|
273
|
+
"data-tracking-label": U,
|
|
268
274
|
style: {
|
|
269
|
-
opacity:
|
|
275
|
+
opacity: Pt ? 1 : 0,
|
|
270
276
|
transition: "opacity 0.4s ease-out"
|
|
271
277
|
},
|
|
272
|
-
...
|
|
273
|
-
children: /* @__PURE__ */
|
|
278
|
+
...G,
|
|
279
|
+
children: /* @__PURE__ */ W(
|
|
274
280
|
"div",
|
|
275
281
|
{
|
|
276
|
-
ref:
|
|
282
|
+
ref: at,
|
|
277
283
|
className: "relative flex items-center",
|
|
278
284
|
style: {
|
|
279
285
|
width: dt || void 0,
|
|
280
286
|
transition: "width 0.3s ease-out"
|
|
281
287
|
},
|
|
282
288
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ W(
|
|
284
290
|
"span",
|
|
285
291
|
{
|
|
286
|
-
ref:
|
|
292
|
+
ref: ot,
|
|
287
293
|
className: "relative inline-block overflow-hidden",
|
|
288
294
|
style: {
|
|
289
295
|
width: dt || void 0,
|
|
290
296
|
transition: "width 0.3s ease-out"
|
|
291
297
|
},
|
|
292
298
|
children: [
|
|
293
|
-
|
|
299
|
+
k.map((n, e) => /* @__PURE__ */ C(
|
|
294
300
|
"span",
|
|
295
301
|
{
|
|
296
|
-
ref:
|
|
302
|
+
ref: kt(e),
|
|
297
303
|
style: {
|
|
298
304
|
display: "block",
|
|
299
305
|
whiteSpace: "nowrap",
|
|
300
306
|
opacity: 0,
|
|
301
307
|
clipPath: "inset(0 100% 0 0)",
|
|
302
308
|
willChange: "clip-path",
|
|
303
|
-
...
|
|
309
|
+
...e > 0 ? { position: "absolute", top: 0, left: 0 } : {}
|
|
304
310
|
},
|
|
305
311
|
children: n
|
|
306
312
|
},
|
|
307
|
-
|
|
313
|
+
e
|
|
308
314
|
)),
|
|
309
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ C(
|
|
310
316
|
"div",
|
|
311
317
|
{
|
|
312
|
-
ref:
|
|
318
|
+
ref: tt,
|
|
313
319
|
className: "pointer-events-none absolute inset-0",
|
|
314
320
|
style: {
|
|
315
321
|
opacity: 0,
|
|
@@ -322,10 +328,10 @@ const Nt = yt.forwardRef(
|
|
|
322
328
|
]
|
|
323
329
|
}
|
|
324
330
|
),
|
|
325
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ C(
|
|
326
332
|
"div",
|
|
327
333
|
{
|
|
328
|
-
ref:
|
|
334
|
+
ref: Y,
|
|
329
335
|
className: "absolute",
|
|
330
336
|
style: {
|
|
331
337
|
left: -a / 2,
|
|
@@ -336,10 +342,10 @@ const Nt = yt.forwardRef(
|
|
|
336
342
|
transform: "translateX(0px)",
|
|
337
343
|
willChange: "transform"
|
|
338
344
|
},
|
|
339
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ W(
|
|
340
346
|
"svg",
|
|
341
347
|
{
|
|
342
|
-
"aria-label":
|
|
348
|
+
"aria-label": c ?? "Loading",
|
|
343
349
|
"data-slot": "text-reveal-ball",
|
|
344
350
|
fill: "none",
|
|
345
351
|
height: a,
|
|
@@ -349,25 +355,36 @@ const Nt = yt.forwardRef(
|
|
|
349
355
|
width: a,
|
|
350
356
|
xmlns: "http://www.w3.org/2000/svg",
|
|
351
357
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
358
|
+
/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ W(
|
|
359
|
+
"linearGradient",
|
|
360
|
+
{
|
|
361
|
+
ref: rt,
|
|
362
|
+
id: ft,
|
|
363
|
+
x1: "81.8%",
|
|
364
|
+
x2: "18.2%",
|
|
365
|
+
y1: "18.2%",
|
|
366
|
+
y2: "81.8%",
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ C("stop", { offset: "-60%", stopColor: b }),
|
|
369
|
+
/* @__PURE__ */ C("stop", { offset: "120%", stopColor: X })
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
) }),
|
|
373
|
+
/* @__PURE__ */ C(
|
|
357
374
|
"g",
|
|
358
375
|
{
|
|
359
|
-
ref:
|
|
376
|
+
ref: nt,
|
|
360
377
|
style: {
|
|
361
378
|
opacity: 0,
|
|
362
379
|
transformOrigin: "250px 250px",
|
|
363
380
|
willChange: "transform"
|
|
364
381
|
},
|
|
365
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ C(
|
|
366
383
|
"path",
|
|
367
384
|
{
|
|
368
|
-
ref:
|
|
369
|
-
d:
|
|
370
|
-
fill: `url(#${
|
|
385
|
+
ref: et,
|
|
386
|
+
d: s[0],
|
|
387
|
+
fill: `url(#${ft})`
|
|
371
388
|
}
|
|
372
389
|
)
|
|
373
390
|
}
|
|
@@ -384,7 +401,7 @@ const Nt = yt.forwardRef(
|
|
|
384
401
|
);
|
|
385
402
|
}
|
|
386
403
|
);
|
|
387
|
-
|
|
404
|
+
Ut.displayName = "TextRevealMotion";
|
|
388
405
|
export {
|
|
389
|
-
|
|
406
|
+
Ut as TextRevealMotion
|
|
390
407
|
};
|
package/dist/tooltip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),x=require("@radix-ui/react-tooltip"),l=require("@brightlocal/ui-components/lib/utils");function s(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const c=s(m),i=s(x);function j({delayDuration:t=0,skipDelayDuration:o=0,...e}){return a.jsx(i.Provider,{delayDuration:t,skipDelayDuration:o,...e})}function y({...t}){return a.jsx(i.Root,{...t})}const d=c.forwardRef(({dataHook:t,trackingEl:o,trackingLabel:e,...r},n)=>a.jsx(i.Trigger,{ref:n,"data-hook":t,"data-slot":"tooltip-trigger","data-tracking-el":o,"data-tracking-label":e,...r}));d.displayName="TooltipTrigger";const p=c.forwardRef(({className:t,sideOffset:o=0,dataHook:e,trackingEl:r,trackingLabel:n,hideArrow:u=!1,children:g,...T},f)=>a.jsx(i.Portal,{children:a.jsxs(i.Content,{ref:f,className:l.cn("bg-secondary text-secondary-foreground z-50 w-max max-w-sm rounded-md px-3 py-1.5 text-xs leading-4 font-normal",l.FLOATING_CONTENT_ANIMATION,"**:data-[slot=tooltip-arrow]:-translate-y-px",t),"data-hook":e,"data-slot":"tooltip-content","data-tracking-el":r,"data-tracking-label":n,sideOffset:o,...T,children:[g,!u&&a.jsx(i.Arrow,{className:"fill-secondary","data-slot":"tooltip-arrow",height:7,width:14})]})}));p.displayName="TooltipContent";exports.Tooltip=y;exports.TooltipContent=p;exports.TooltipProvider=j;exports.TooltipTrigger=d;
|