@brightlocal/ui-components 2.24.1 → 2.25.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/README.md +2 -1
- package/component-meta.json +93 -79
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +17 -17
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +9 -9
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +43 -46
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.js +14 -14
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.js +11 -11
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +10 -10
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +12 -12
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +7 -7
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +7 -7
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/data-table.d.ts +29 -0
- package/dist/data-table.d.ts.map +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +61 -61
- package/dist/field.cjs +1 -1
- package/dist/field.js +1 -1
- package/dist/height-transition.cjs +1 -0
- package/dist/height-transition.d.ts +44 -0
- package/dist/height-transition.d.ts.map +1 -0
- package/dist/height-transition.js +63 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +326 -324
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +2 -2
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +15 -15
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/lib/motion.cjs +1 -0
- package/dist/lib/motion.d.ts +70 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/motion.js +25 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +12 -4
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +17 -16
- package/dist/list.cjs +1 -1
- package/dist/list.js +10 -10
- package/dist/loading.cjs +1 -1
- package/dist/loading.d.ts.map +1 -1
- package/dist/loading.js +45 -47
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +2 -2
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +5 -5
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +13 -13
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +21 -25
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +12 -12
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.js +11 -11
- package/dist/select.cjs +1 -1
- package/dist/select.js +12 -12
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +54 -50
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +13 -13
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +4 -4
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +5 -5
- package/dist/table.cjs +1 -1
- package/dist/table.js +2 -2
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +77 -79
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +5 -5
- package/package.json +13 -4
- package/src/blocks/input-list.tsx +3 -6
- package/src/blocks/sidebar.tsx +14 -14
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/badge.tsx +1 -1
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +2 -2
- package/src/components/card.tsx +1 -1
- package/src/components/carousel.tsx +1 -1
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +2 -2
- package/src/components/combobox.tsx +1 -1
- package/src/components/data-table.tsx +29 -0
- package/src/components/dialog.tsx +3 -3
- package/src/components/field.tsx +1 -1
- package/src/components/height-transition.tsx +164 -0
- package/src/components/input-chip.tsx +2 -2
- package/src/components/input-group.tsx +2 -2
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/link.tsx +4 -3
- package/src/components/list.tsx +1 -1
- package/src/components/loading.tsx +2 -15
- package/src/components/map.tsx +3 -2
- package/src/components/menubar.tsx +5 -5
- package/src/components/navigation-menu.tsx +6 -6
- package/src/components/pagination.tsx +1 -1
- package/src/components/progress.tsx +2 -10
- package/src/components/radio-group.tsx +1 -1
- package/src/components/scroll-area.tsx +2 -2
- package/src/components/select.tsx +1 -1
- package/src/components/sheet.tsx +9 -5
- package/src/components/slider.tsx +1 -1
- package/src/components/stepper.tsx +4 -4
- package/src/components/switch.tsx +2 -2
- package/src/components/table.tsx +2 -2
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +3 -8
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/lib/motion.ts +75 -0
- package/src/lib/utils.ts +14 -2
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import { jsx as C, jsxs as W } from "react/jsx-runtime";
|
|
2
2
|
import * as wt from "react";
|
|
3
|
-
import { useId as
|
|
4
|
-
import { animate as
|
|
3
|
+
import { useId as $t, useMemo as bt, useRef as M, useState as Xt, useCallback as Ft, useEffect as it } from "react";
|
|
4
|
+
import { animate as G } from "framer-motion";
|
|
5
5
|
import { cn as Dt } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
import { usePrefersReducedMotion as
|
|
6
|
+
import { usePrefersReducedMotion as Nt } from "./hooks/use-prefers-reduced-motion.js";
|
|
7
|
+
import { SPRING_SMOOTH as _t, SPRING_SETTLE as qt } from "./lib/motion.js";
|
|
7
8
|
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",
|
|
9
|
+
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", Lt = "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", At = "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", q = (u) => u < 0 ? 0 : u > 1 ? 1 : u, zt = [
|
|
9
10
|
xt,
|
|
10
|
-
At,
|
|
11
11
|
Lt,
|
|
12
|
+
At,
|
|
12
13
|
xt,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
At,
|
|
15
|
+
Lt
|
|
15
16
|
];
|
|
16
|
-
function
|
|
17
|
+
function Ht(u, $, w, v) {
|
|
17
18
|
let b = !1, X = null;
|
|
18
19
|
const c = { ballX: 0, clipRight: 100, rotate: 0, pathD: "" };
|
|
19
|
-
function
|
|
20
|
-
b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`),
|
|
20
|
+
function O() {
|
|
21
|
+
b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`), $.style.transform = `rotate(${c.rotate}deg)`, v?.setAttribute(
|
|
21
22
|
"gradientTransform",
|
|
22
23
|
`rotate(${-c.rotate} 0.5 0.5)`
|
|
23
24
|
), w.setAttribute("d", c.pathD);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
c.ballX = F, c.clipRight =
|
|
26
|
+
function z(F, Z, j, s) {
|
|
27
|
+
c.ballX = F, c.clipRight = Z, c.rotate = j, c.pathD = s, b || (b = !0, requestAnimationFrame(O));
|
|
27
28
|
}
|
|
28
|
-
return
|
|
29
|
+
return z.setItem = (F) => {
|
|
29
30
|
X = F;
|
|
30
|
-
},
|
|
31
|
+
}, z;
|
|
31
32
|
}
|
|
32
|
-
function Mt(u,
|
|
33
|
+
function Mt(u, $) {
|
|
33
34
|
return new Promise((w) => {
|
|
34
|
-
const
|
|
35
|
+
const v = performance.now();
|
|
35
36
|
function b() {
|
|
36
|
-
|
|
37
|
+
$.cancelled || performance.now() - v >= u ? w() : requestAnimationFrame(b);
|
|
37
38
|
}
|
|
38
39
|
requestAnimationFrame(b);
|
|
39
40
|
});
|
|
@@ -41,41 +42,41 @@ function Mt(u, T) {
|
|
|
41
42
|
const Ut = wt.forwardRef(
|
|
42
43
|
({
|
|
43
44
|
className: u,
|
|
44
|
-
dataHook:
|
|
45
|
+
dataHook: $,
|
|
45
46
|
holdTime: w = 1300,
|
|
46
|
-
shimmer:
|
|
47
|
+
shimmer: v = !0,
|
|
47
48
|
gradientFrom: b = "var(--loading-gradient-from)",
|
|
48
49
|
gradientTo: X = "var(--loading-gradient-to)",
|
|
49
50
|
loadingLabel: c,
|
|
50
|
-
trackingEl:
|
|
51
|
-
trackingLabel:
|
|
51
|
+
trackingEl: O,
|
|
52
|
+
trackingLabel: z,
|
|
52
53
|
children: F,
|
|
53
|
-
...
|
|
54
|
-
},
|
|
55
|
-
const s = zt, J = 0.8,
|
|
54
|
+
...Z
|
|
55
|
+
}, j) => {
|
|
56
|
+
const s = zt, J = 0.8, { stiffness: K, damping: Q, mass: V } = _t, H = Nt(), ct = $t(), ft = bt(
|
|
56
57
|
() => `text-reveal-gradient-${ct.replace(/:/g, "")}`,
|
|
57
58
|
[ct]
|
|
58
|
-
), Y = M(null), tt = M(null), et = M(null), nt = M(null), rt = M(null), at = M(null), ot = M(null),
|
|
59
|
+
), Y = M(null), tt = M(null), et = M(null), nt = M(null), rt = M(null), at = M(null), ot = M(null), S = M([]), k = wt.Children.toArray(F), [St, vt] = Xt({ widths: [], ballSize: 0 }), { widths: p, ballSize: a } = St, kt = Ft(
|
|
59
60
|
(n) => (e) => {
|
|
60
|
-
|
|
61
|
+
S.current[n] = e;
|
|
61
62
|
},
|
|
62
63
|
[]
|
|
63
64
|
);
|
|
64
65
|
it(() => {
|
|
65
|
-
if (
|
|
66
|
+
if (S.current.length === 0 || !S.current[0]) return;
|
|
66
67
|
let n = !1;
|
|
67
68
|
function e() {
|
|
68
69
|
if (n) return;
|
|
69
70
|
const m = [];
|
|
70
71
|
let R = 32;
|
|
71
72
|
for (let h = 0; h < k.length; h++) {
|
|
72
|
-
const x =
|
|
73
|
+
const x = S.current[h];
|
|
73
74
|
if (x && (m[h] = x.scrollWidth, h === 0)) {
|
|
74
75
|
const E = x.firstElementChild ?? x, t = parseFloat(getComputedStyle(E).fontSize) || 16;
|
|
75
76
|
R = Math.round(t * 1.5);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
+
vt({ widths: m, ballSize: R });
|
|
79
80
|
}
|
|
80
81
|
return document.fonts.ready.then(() => {
|
|
81
82
|
n || requestAnimationFrame(e);
|
|
@@ -83,27 +84,27 @@ const Ut = wt.forwardRef(
|
|
|
83
84
|
n = !0;
|
|
84
85
|
};
|
|
85
86
|
}, [k.length]), it(() => {
|
|
86
|
-
if (
|
|
87
|
+
if (H) return;
|
|
87
88
|
const n = rt.current;
|
|
88
89
|
if (!n) return;
|
|
89
90
|
const e = n;
|
|
90
91
|
let m, R = null;
|
|
91
92
|
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
93
|
let D = -1 / 0;
|
|
93
|
-
function
|
|
94
|
+
function U(f) {
|
|
94
95
|
R || (R = f);
|
|
95
96
|
const l = (f - R) / 1e3, o = -Math.PI / 4 + Math.sin(l * h + E) * 0.5 + Math.sin(l * x + t) * 0.25;
|
|
96
97
|
if (Math.abs(o - D) > 0.01) {
|
|
97
98
|
D = o;
|
|
98
|
-
const
|
|
99
|
-
e.setAttribute("x1", `${50 + 45 *
|
|
99
|
+
const N = Math.cos(o), i = Math.sin(o);
|
|
100
|
+
e.setAttribute("x1", `${50 + 45 * N}%`), e.setAttribute("y1", `${50 + 45 * i}%`), e.setAttribute("x2", `${50 - 45 * N}%`), e.setAttribute("y2", `${50 - 45 * i}%`);
|
|
100
101
|
}
|
|
101
|
-
m = requestAnimationFrame(
|
|
102
|
+
m = requestAnimationFrame(U);
|
|
102
103
|
}
|
|
103
|
-
return m = requestAnimationFrame(
|
|
104
|
-
}, [
|
|
104
|
+
return m = requestAnimationFrame(U), () => cancelAnimationFrame(m);
|
|
105
|
+
}, [H]);
|
|
105
106
|
function Et(n) {
|
|
106
|
-
n.style.opacity = "1",
|
|
107
|
+
n.style.opacity = "1", G(0, 1, {
|
|
107
108
|
duration: 1.2,
|
|
108
109
|
ease: [0.25, 1, 0.5, 1],
|
|
109
110
|
onUpdate: (e) => {
|
|
@@ -122,48 +123,48 @@ const Ut = wt.forwardRef(
|
|
|
122
123
|
const l = `${f}px`;
|
|
123
124
|
h.style.width = l, x.style.width = l;
|
|
124
125
|
}
|
|
125
|
-
if (
|
|
126
|
+
if (H) {
|
|
126
127
|
n.setAttribute("d", s[0]), e.style.opacity = "1";
|
|
127
|
-
const f =
|
|
128
|
+
const f = S.current[0];
|
|
128
129
|
f && (f.style.opacity = "1", f.style.clipPath = "none"), E(p[0] ?? 0);
|
|
129
130
|
const l = a * 0.25, o = (p[0] ?? 0) + l + a / 2;
|
|
130
131
|
m.style.transform = `translateX(${o}px)`;
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
134
|
const t = { cancelled: !1 }, D = a * 0.25;
|
|
134
|
-
async function
|
|
135
|
+
async function U() {
|
|
135
136
|
const { interpolate: f } = await import("flubber");
|
|
136
137
|
if (t.cancelled) return;
|
|
137
138
|
const l = [];
|
|
138
|
-
for (let
|
|
139
|
+
for (let L = 0; L < s.length; L++)
|
|
139
140
|
l.push(
|
|
140
|
-
f(s[
|
|
141
|
+
f(s[L], s[(L + 1) % s.length])
|
|
141
142
|
);
|
|
142
|
-
const o =
|
|
143
|
+
const o = Ht(
|
|
143
144
|
m,
|
|
144
145
|
e,
|
|
145
146
|
n,
|
|
146
147
|
rt.current
|
|
147
148
|
);
|
|
148
149
|
e.style.opacity = "1";
|
|
149
|
-
let
|
|
150
|
+
let N = 0, i = 0, g = 0;
|
|
150
151
|
for (; !t.cancelled; ) {
|
|
151
|
-
const
|
|
152
|
+
const L = N % k.length, P = p[L] ?? 0;
|
|
152
153
|
E(P);
|
|
153
|
-
const I = -(D + a / 2),
|
|
154
|
+
const I = -(D + a / 2), _ = P + D + a / 2, ut = _ - I, pt = S.current[L];
|
|
154
155
|
if (!pt) break;
|
|
155
156
|
o.setItem(pt);
|
|
156
157
|
for (let r = 0; r < k.length; r++) {
|
|
157
|
-
const d =
|
|
158
|
-
d && (d.style.opacity = r ===
|
|
158
|
+
const d = S.current[r];
|
|
159
|
+
d && (d.style.opacity = r === L ? "1" : "0", d.style.clipPath = "inset(0 100% 0 0)");
|
|
159
160
|
}
|
|
160
|
-
const mt = l[i],
|
|
161
|
+
const mt = l[i], B = 360, ht = g;
|
|
161
162
|
if (await new Promise((r) => {
|
|
162
163
|
if (t.cancelled) {
|
|
163
164
|
r();
|
|
164
165
|
return;
|
|
165
166
|
}
|
|
166
|
-
const d =
|
|
167
|
+
const d = G(I, _, {
|
|
167
168
|
type: "spring",
|
|
168
169
|
stiffness: K * J,
|
|
169
170
|
damping: Q,
|
|
@@ -173,45 +174,42 @@ const Ut = wt.forwardRef(
|
|
|
173
174
|
d.stop(), r();
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
176
|
-
const
|
|
177
|
-
o(y,
|
|
177
|
+
const A = q((y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
|
|
178
|
+
o(y, T, ht + A * B, mt(A));
|
|
178
179
|
},
|
|
179
180
|
onComplete: () => {
|
|
180
|
-
g = ht +
|
|
181
|
+
g = ht + B, i = (i + 1) % s.length, t.cancelled || o(_, 0, g, mt(1)), r();
|
|
181
182
|
}
|
|
182
183
|
});
|
|
183
184
|
}), t.cancelled) break;
|
|
184
|
-
if (
|
|
185
|
-
const r = performance.now(), d =
|
|
185
|
+
if (v && Et(R), w > 0) {
|
|
186
|
+
const r = performance.now(), d = _;
|
|
186
187
|
for (; !t.cancelled && performance.now() - r < w && (await Mt(300, t), !(t.cancelled || performance.now() - r >= w)); ) {
|
|
187
|
-
const y = (i + 1) % s.length,
|
|
188
|
+
const y = (i + 1) % s.length, A = l[i], T = g, st = g + 360;
|
|
188
189
|
await new Promise((lt) => {
|
|
189
190
|
if (t.cancelled) {
|
|
190
191
|
lt();
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
|
-
const It =
|
|
194
|
-
|
|
195
|
-
stiffness: 30,
|
|
196
|
-
damping: 9,
|
|
197
|
-
mass: 0.5,
|
|
194
|
+
const It = G(0, 1 + Rt, {
|
|
195
|
+
...qt,
|
|
198
196
|
restDelta: Rt,
|
|
199
|
-
onUpdate: (
|
|
197
|
+
onUpdate: (Tt) => {
|
|
200
198
|
if (t.cancelled) {
|
|
201
199
|
It.stop(), lt();
|
|
202
200
|
return;
|
|
203
201
|
}
|
|
204
|
-
const Ct =
|
|
202
|
+
const Ct = q(Tt);
|
|
205
203
|
o(
|
|
206
204
|
d,
|
|
207
205
|
0,
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
T + Ct * (st - T),
|
|
207
|
+
A(Ct)
|
|
210
208
|
);
|
|
211
209
|
},
|
|
212
210
|
onComplete: lt
|
|
213
211
|
});
|
|
214
|
-
}), t.cancelled || o(d, 0, st,
|
|
212
|
+
}), t.cancelled || o(d, 0, st, A(1)), g = st, i = y;
|
|
215
213
|
}
|
|
216
214
|
}
|
|
217
215
|
if (t.cancelled) break;
|
|
@@ -221,7 +219,7 @@ const Ut = wt.forwardRef(
|
|
|
221
219
|
r();
|
|
222
220
|
return;
|
|
223
221
|
}
|
|
224
|
-
const d =
|
|
222
|
+
const d = G(_, I, {
|
|
225
223
|
type: "spring",
|
|
226
224
|
stiffness: K * J,
|
|
227
225
|
damping: Q,
|
|
@@ -231,28 +229,28 @@ const Ut = wt.forwardRef(
|
|
|
231
229
|
d.stop(), r();
|
|
232
230
|
return;
|
|
233
231
|
}
|
|
234
|
-
const
|
|
235
|
-
o(y,
|
|
232
|
+
const A = q(1 - (y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
|
|
233
|
+
o(y, T, yt - A * B, gt(A));
|
|
236
234
|
},
|
|
237
235
|
onComplete: () => {
|
|
238
|
-
g = yt -
|
|
236
|
+
g = yt - B, i = (i + 1) % s.length, t.cancelled || o(I, 100, g, gt(1)), r();
|
|
239
237
|
}
|
|
240
238
|
});
|
|
241
239
|
}), t.cancelled) break;
|
|
242
|
-
await Mt(300, t),
|
|
240
|
+
await Mt(300, t), N++;
|
|
243
241
|
}
|
|
244
242
|
}
|
|
245
|
-
return
|
|
243
|
+
return U(), () => {
|
|
246
244
|
t.cancelled = !0;
|
|
247
245
|
};
|
|
248
246
|
}, [
|
|
249
247
|
p,
|
|
250
248
|
a,
|
|
251
249
|
k.length,
|
|
252
|
-
|
|
250
|
+
H,
|
|
253
251
|
J,
|
|
254
252
|
w,
|
|
255
|
-
|
|
253
|
+
v,
|
|
256
254
|
K,
|
|
257
255
|
Q,
|
|
258
256
|
V,
|
|
@@ -265,17 +263,17 @@ const Ut = wt.forwardRef(
|
|
|
265
263
|
return /* @__PURE__ */ C(
|
|
266
264
|
"div",
|
|
267
265
|
{
|
|
268
|
-
ref:
|
|
266
|
+
ref: j,
|
|
269
267
|
className: Dt("relative inline-flex items-center", u),
|
|
270
|
-
"data-hook":
|
|
268
|
+
"data-hook": $,
|
|
271
269
|
"data-slot": "text-reveal",
|
|
272
|
-
"data-tracking-el":
|
|
273
|
-
"data-tracking-label":
|
|
270
|
+
"data-tracking-el": O,
|
|
271
|
+
"data-tracking-label": z,
|
|
274
272
|
style: {
|
|
275
273
|
opacity: Pt ? 1 : 0,
|
|
276
274
|
transition: "opacity 0.4s ease-out"
|
|
277
275
|
},
|
|
278
|
-
...
|
|
276
|
+
...Z,
|
|
279
277
|
children: /* @__PURE__ */ W(
|
|
280
278
|
"div",
|
|
281
279
|
{
|
package/dist/textarea.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 u=require("react/jsx-runtime"),d=require("react"),l=require("class-variance-authority"),b=require("@brightlocal/ui-components/lib/utils");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const g=f(d),v=l.cva(["flex w-full","border border-input bg-background rounded-md","outline-none transition-[border-color,background-color,box-shadow] duration-fast ease-out","text-base leading-normal font-sans","text-foreground","px-3 py-2","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground"]),n=g.forwardRef(({className:e,dataHook:r,error:t,trackingEl:a,trackingLabel:s,...o},c)=>{const i=t||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return u.jsx("textarea",{ref:c,"aria-invalid":i?"true":void 0,className:b.cn(v(),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":r,"data-slot":"textarea","data-tracking-el":a,"data-tracking-label":s,...o})});n.displayName="Textarea";exports.Textarea=n;
|
package/dist/textarea.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
const b =
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { cn as c } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
const b = u([
|
|
6
6
|
// Layout & Size
|
|
7
7
|
"flex w-full",
|
|
8
8
|
// Appearance - Explicit background with isolation for contrast calculation
|
|
9
9
|
"border border-input bg-background rounded-md",
|
|
10
|
-
"outline-none transition-[border-color,background-color,box-shadow]",
|
|
10
|
+
"outline-none transition-[border-color,background-color,box-shadow] duration-fast ease-out",
|
|
11
11
|
// Typography
|
|
12
12
|
"text-base leading-normal font-sans",
|
|
13
13
|
"text-foreground",
|
|
@@ -21,23 +21,23 @@ const b = c([
|
|
|
21
21
|
// Pseudo-elements
|
|
22
22
|
"placeholder:text-muted-foreground"
|
|
23
23
|
]), f = l.forwardRef(
|
|
24
|
-
({ className:
|
|
25
|
-
const
|
|
24
|
+
({ className: r, dataHook: o, error: t, trackingEl: i, trackingLabel: d, ...a }, s) => {
|
|
25
|
+
const e = t || a["aria-invalid"] === !0 || a["aria-invalid"] === "true";
|
|
26
26
|
return /* @__PURE__ */ n(
|
|
27
27
|
"textarea",
|
|
28
28
|
{
|
|
29
29
|
ref: s,
|
|
30
|
-
"aria-invalid":
|
|
31
|
-
className:
|
|
30
|
+
"aria-invalid": e ? "true" : void 0,
|
|
31
|
+
className: c(
|
|
32
32
|
b(),
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
e && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
|
|
34
|
+
r
|
|
35
35
|
),
|
|
36
36
|
"data-hook": o,
|
|
37
37
|
"data-slot": "textarea",
|
|
38
38
|
"data-tracking-el": i,
|
|
39
39
|
"data-tracking-label": d,
|
|
40
|
-
...
|
|
40
|
+
...a
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
package/dist/toggle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),f=require("react"),m=require("@radix-ui/react-toggle"),b=require("class-variance-authority"),p=require("@brightlocal/ui-components/lib/utils");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const v=o(f),h=o(m),r=b.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),f=require("react"),m=require("@radix-ui/react-toggle"),b=require("class-variance-authority"),p=require("@brightlocal/ui-components/lib/utils");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const v=o(f),h=o(m),r=b.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-fast ease-out whitespace-nowrap",{variants:{variant:{simple:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"simple",size:"default"}}),i=v.forwardRef(({className:e,variant:t,size:a,dataHook:n,trackingEl:s,trackingLabel:c,ariaLabel:l,...g},u)=>d.jsx(h.Root,{ref:u,"aria-label":l,className:p.cn(r({variant:t,size:a,className:e})),"data-hook":n,"data-slot":"toggle","data-tracking-el":s||`toggle-${t}`,"data-tracking-label":c,...g}));i.displayName="Toggle";exports.Toggle=i;exports.toggleVariants=r;
|
package/dist/toggle.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as m from "@radix-ui/react-toggle";
|
|
|
4
4
|
import { cva as c } from "class-variance-authority";
|
|
5
5
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
const f = c(
|
|
7
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-
|
|
7
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 focus-visible:border-ring focus-visible:shadow-default outline-none transition-[color,box-shadow] duration-fast ease-out whitespace-nowrap",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -26,8 +26,8 @@ const f = c(
|
|
|
26
26
|
({
|
|
27
27
|
className: t,
|
|
28
28
|
variant: e,
|
|
29
|
-
size:
|
|
30
|
-
dataHook:
|
|
29
|
+
size: a,
|
|
30
|
+
dataHook: o,
|
|
31
31
|
trackingEl: r,
|
|
32
32
|
trackingLabel: n,
|
|
33
33
|
ariaLabel: i,
|
|
@@ -37,8 +37,8 @@ const f = c(
|
|
|
37
37
|
{
|
|
38
38
|
ref: d,
|
|
39
39
|
"aria-label": i,
|
|
40
|
-
className: p(f({ variant: e, size:
|
|
41
|
-
"data-hook":
|
|
40
|
+
className: p(f({ variant: e, size: a, className: t })),
|
|
41
|
+
"data-hook": o,
|
|
42
42
|
"data-slot": "toggle",
|
|
43
43
|
"data-tracking-el": r || `toggle-${e}`,
|
|
44
44
|
"data-tracking-label": n,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightlocal/ui-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "BrightLocal Design System UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -52,6 +52,15 @@
|
|
|
52
52
|
"import": "./dist/lib/use-dev-warning.js",
|
|
53
53
|
"require": "./dist/lib/use-dev-warning.cjs"
|
|
54
54
|
},
|
|
55
|
+
"./lib/motion": {
|
|
56
|
+
"source": {
|
|
57
|
+
"types": "./src/lib/motion.ts",
|
|
58
|
+
"import": "./src/lib/motion.ts"
|
|
59
|
+
},
|
|
60
|
+
"types": "./dist/lib/motion.d.ts",
|
|
61
|
+
"import": "./dist/lib/motion.js",
|
|
62
|
+
"require": "./dist/lib/motion.cjs"
|
|
63
|
+
},
|
|
55
64
|
"./input-list": {
|
|
56
65
|
"source": {
|
|
57
66
|
"types": "./src/blocks/input-list.tsx",
|
|
@@ -183,8 +192,8 @@
|
|
|
183
192
|
"sonner": "^2.0.7",
|
|
184
193
|
"tailwind-merge": "^3.4.0",
|
|
185
194
|
"vaul": "^1.1.2",
|
|
186
|
-
"@brightlocal/
|
|
187
|
-
"@brightlocal/
|
|
195
|
+
"@brightlocal/illustrations": "0.6.0",
|
|
196
|
+
"@brightlocal/icons": "2.3.1"
|
|
188
197
|
},
|
|
189
198
|
"size-limit": [
|
|
190
199
|
{
|
|
@@ -209,7 +218,7 @@
|
|
|
209
218
|
"typecheck": "tsc --noEmit",
|
|
210
219
|
"clean": "rm -rf dist",
|
|
211
220
|
"build": "pnpm run clean && vite build",
|
|
212
|
-
"build:browser": "vite build --config vite.config.browser.ts && node scripts/audit-browser-demos.mjs",
|
|
221
|
+
"build:browser": "vite build --config vite.config.browser.ts && cp -R ../tokens/src/fonts dist-browser/fonts && node scripts/audit-browser-demos.mjs",
|
|
213
222
|
"size": "size-limit",
|
|
214
223
|
"analyze": "vite-bundle-visualizer",
|
|
215
224
|
"deprecations:list": "node scripts/deprecations-list.mjs",
|
|
@@ -6,6 +6,7 @@ import { X } from "@brightlocal/icons";
|
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
import { usePrefersReducedMotion } from "@brightlocal/ui-components/hooks/use-prefers-reduced-motion";
|
|
9
|
+
import { SPRING_SNAPPY } from "../lib/motion";
|
|
9
10
|
import { Button, type ButtonProps } from "../components/button";
|
|
10
11
|
import { Input } from "../components/input";
|
|
11
12
|
import { Item, ItemContent, ItemTitle, ItemActions } from "../components/list";
|
|
@@ -295,11 +296,7 @@ function InputListItems({
|
|
|
295
296
|
transition={{
|
|
296
297
|
opacity: { duration: 0.15 },
|
|
297
298
|
scale: { duration: 0.15 },
|
|
298
|
-
layout:
|
|
299
|
-
type: "spring",
|
|
300
|
-
stiffness: 500,
|
|
301
|
-
damping: 35,
|
|
302
|
-
},
|
|
299
|
+
layout: SPRING_SNAPPY,
|
|
303
300
|
}}
|
|
304
301
|
>
|
|
305
302
|
<Item asChild variant="filled">
|
|
@@ -318,7 +315,7 @@ function InputListItems({
|
|
|
318
315
|
"inline-flex size-9 cursor-pointer items-center justify-center rounded-full",
|
|
319
316
|
"text-muted-foreground",
|
|
320
317
|
"focus-visible:shadow-default outline-none",
|
|
321
|
-
"transition-colors
|
|
318
|
+
"duration-fast transition-colors ease-out",
|
|
322
319
|
"disabled:pointer-events-none disabled:opacity-50"
|
|
323
320
|
)}
|
|
324
321
|
data-hook={`${dataHook}-remove-${index}`}
|
package/src/blocks/sidebar.tsx
CHANGED
|
@@ -482,7 +482,7 @@ const Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(
|
|
|
482
482
|
<div
|
|
483
483
|
ref={ref}
|
|
484
484
|
className={cn(
|
|
485
|
-
"group text-sidebar-foreground flex h-full shrink-0 flex-col overflow-hidden transition-[width]
|
|
485
|
+
"group text-sidebar-foreground duration-base flex h-full shrink-0 flex-col overflow-hidden transition-[width] ease-linear",
|
|
486
486
|
state === "expanded" && "w-(--sidebar-width)",
|
|
487
487
|
collapsible === SidebarCollapsible.ICON &&
|
|
488
488
|
state === "collapsed" &&
|
|
@@ -591,7 +591,7 @@ const SidebarRail = React.forwardRef<HTMLButtonElement, SidebarRailProps>(
|
|
|
591
591
|
ref={ref}
|
|
592
592
|
aria-label={resolvedLabel}
|
|
593
593
|
className={cn(
|
|
594
|
-
"hover:after:bg-sidebar-border absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex",
|
|
594
|
+
"hover:after:bg-sidebar-border duration-base absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex",
|
|
595
595
|
"cursor-w-resize",
|
|
596
596
|
"in-data-[state=collapsed]:cursor-e-resize",
|
|
597
597
|
"group-data-[collapsible=offcanvas]:hover:bg-sidebar-background group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
@@ -859,7 +859,7 @@ SidebarGroup.displayName = "SidebarGroup";
|
|
|
859
859
|
|
|
860
860
|
const sidebarGroupLabelVariants = cva(
|
|
861
861
|
[
|
|
862
|
-
"flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-
|
|
862
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-base ease-linear [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
863
863
|
SIDEBAR_FOCUS_RING,
|
|
864
864
|
],
|
|
865
865
|
{
|
|
@@ -982,7 +982,7 @@ const SidebarGroupLabel = React.forwardRef<
|
|
|
982
982
|
{variant === SidebarGroupLabelVariant.COLLAPSIBLE && (
|
|
983
983
|
<ChevronDown
|
|
984
984
|
className={cn(
|
|
985
|
-
"shrink-0 transition-transform
|
|
985
|
+
"duration-base shrink-0 transition-transform ease-in-out",
|
|
986
986
|
isOpen && "rotate-180"
|
|
987
987
|
)}
|
|
988
988
|
size={16}
|
|
@@ -1017,7 +1017,7 @@ const SidebarGroupAction = React.forwardRef<
|
|
|
1017
1017
|
<Comp
|
|
1018
1018
|
ref={ref}
|
|
1019
1019
|
className={cn(
|
|
1020
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none [&>svg]:shrink-0",
|
|
1020
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-base absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0",
|
|
1021
1021
|
SIDEBAR_FOCUS_RING,
|
|
1022
1022
|
// Increases the hit area of the button on mobile.
|
|
1023
1023
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
@@ -1126,7 +1126,7 @@ const SidebarCollapseIcon = React.forwardRef<
|
|
|
1126
1126
|
const iconProps = {
|
|
1127
1127
|
ref,
|
|
1128
1128
|
className: cn(
|
|
1129
|
-
"shrink-0 transition-transform",
|
|
1129
|
+
"shrink-0 transition-transform duration-base ease-in-out",
|
|
1130
1130
|
isActive && type === SidebarCollapseIconType.CARET && "rotate-90",
|
|
1131
1131
|
className
|
|
1132
1132
|
),
|
|
@@ -1155,7 +1155,7 @@ SidebarCollapseIcon.displayName = "SidebarCollapseIcon";
|
|
|
1155
1155
|
|
|
1156
1156
|
const sidebarMenuButtonVariants = cva(
|
|
1157
1157
|
[
|
|
1158
|
-
"peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-
|
|
1158
|
+
"peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-base ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",
|
|
1159
1159
|
SIDEBAR_FOCUS_RING,
|
|
1160
1160
|
],
|
|
1161
1161
|
{
|
|
@@ -1165,7 +1165,7 @@ const sidebarMenuButtonVariants = cva(
|
|
|
1165
1165
|
simple: "",
|
|
1166
1166
|
// Collapsible - has a chevron indicator that rotates when open
|
|
1167
1167
|
collapsible:
|
|
1168
|
-
"[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform data-[state=open]:[&>[data-collapse-icon]]:rotate-90",
|
|
1168
|
+
"[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform [&>[data-collapse-icon]]:duration-base [&>[data-collapse-icon]]:ease-in-out data-[state=open]:[&>[data-collapse-icon]]:rotate-90",
|
|
1169
1169
|
// Dropdown - has action menu (dots) on hover
|
|
1170
1170
|
dropdown: "group-has-[[data-slot=sidebar-menu-action]]/menu-item:pr-8",
|
|
1171
1171
|
// Badge - has a number badge on the right (handled via SidebarMenuBadge)
|
|
@@ -1312,7 +1312,7 @@ const SidebarMenuAction = React.forwardRef<
|
|
|
1312
1312
|
<Comp
|
|
1313
1313
|
ref={ref}
|
|
1314
1314
|
className={cn(
|
|
1315
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none [&>svg]:shrink-0",
|
|
1315
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground duration-base absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0",
|
|
1316
1316
|
SIDEBAR_FOCUS_RING,
|
|
1317
1317
|
// Increases the hit area of the button on mobile.
|
|
1318
1318
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
@@ -1519,7 +1519,7 @@ const SidebarMenuSubButton = React.forwardRef<
|
|
|
1519
1519
|
<Comp
|
|
1520
1520
|
ref={ref}
|
|
1521
1521
|
className={cn(
|
|
1522
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity]
|
|
1522
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground duration-fast flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity] ease-out outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:not([data-slot])]:truncate [&>svg]:shrink-0",
|
|
1523
1523
|
SIDEBAR_FOCUS_RING,
|
|
1524
1524
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
1525
1525
|
size === SidebarMenuSubButtonSize.SM && "text-xs",
|
|
@@ -1621,7 +1621,7 @@ const SidebarMenuCollapsibleTrigger = React.forwardRef<
|
|
|
1621
1621
|
{children}
|
|
1622
1622
|
<ChevronRight
|
|
1623
1623
|
data-collapse-icon
|
|
1624
|
-
className="opacity-100! transition-transform
|
|
1624
|
+
className="duration-base opacity-100! transition-transform ease-in-out group-data-[collapsible=icon]:hidden"
|
|
1625
1625
|
size={12}
|
|
1626
1626
|
/>
|
|
1627
1627
|
</SidebarMenuButton>
|
|
@@ -1811,7 +1811,7 @@ const SidebarPopoverTrigger = React.forwardRef<
|
|
|
1811
1811
|
ref={ref}
|
|
1812
1812
|
aria-label={triggerAriaLabel ?? "Switch workspace"}
|
|
1813
1813
|
className={cn(
|
|
1814
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors
|
|
1814
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-fast flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors ease-out outline-none",
|
|
1815
1815
|
SIDEBAR_FOCUS_RING,
|
|
1816
1816
|
className
|
|
1817
1817
|
)}
|
|
@@ -1863,7 +1863,7 @@ const SidebarPopoverMenuItem = React.forwardRef<
|
|
|
1863
1863
|
<button
|
|
1864
1864
|
ref={ref}
|
|
1865
1865
|
className={cn(
|
|
1866
|
-
"text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors
|
|
1866
|
+
"text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors ease-out outline-none",
|
|
1867
1867
|
SIDEBAR_FOCUS_RING,
|
|
1868
1868
|
className
|
|
1869
1869
|
)}
|
|
@@ -2230,7 +2230,7 @@ const SidebarInboxItem = React.forwardRef<
|
|
|
2230
2230
|
<button
|
|
2231
2231
|
ref={ref}
|
|
2232
2232
|
className={cn(
|
|
2233
|
-
"border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent flex w-full flex-col gap-2 border-b p-4 text-left transition-colors
|
|
2233
|
+
"border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent duration-fast flex w-full flex-col gap-2 border-b p-4 text-left transition-colors ease-out outline-none",
|
|
2234
2234
|
SIDEBAR_FOCUS_RING,
|
|
2235
2235
|
className
|
|
2236
2236
|
)}
|