@brightlocal/ui-components 3.3.0 → 3.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.
package/dist/list.js CHANGED
@@ -1,10 +1,14 @@
1
- import * as i from "react";
2
- import { cn as l } from "@brightlocal/ui-components/lib/utils";
3
- import { jsx as r } from "react/jsx-runtime";
4
- import { Slot as p } from "@radix-ui/react-slot";
5
- import { cva as u } from "class-variance-authority";
6
- import { Skeleton as g } from "@brightlocal/ui-components/skeleton";
7
- var v = u([
1
+ "use client";
2
+ import * as s from "react";
3
+ import { ChevronRight as B } from "@brightlocal/icons";
4
+ import { cn as d } from "@brightlocal/ui-components/lib/utils";
5
+ import { jsx as n, jsxs as M } from "react/jsx-runtime";
6
+ import { Slot as g } from "@radix-ui/react-slot";
7
+ import { cva as h } from "class-variance-authority";
8
+ import { Tooltip as P, TooltipContent as H, TooltipTrigger as _ } from "@brightlocal/ui-components/tooltip";
9
+ import { Skeleton as W } from "@brightlocal/ui-components/skeleton";
10
+ var I = h([
11
+ "group/item",
8
12
  "flex",
9
13
  "gap-4",
10
14
  "rounded-lg",
@@ -13,7 +17,9 @@ var v = u([
13
17
  "pl-4",
14
18
  "transition-colors",
15
19
  "duration-fast",
16
- "ease-out"
20
+ "ease-out",
21
+ "has-[>[data-slot=item-button]]:p-0",
22
+ "has-[>[data-slot=item-link]]:p-0"
17
23
  ], {
18
24
  variants: {
19
25
  variant: {
@@ -35,81 +41,289 @@ var v = u([
35
41
  variant: "filled",
36
42
  align: "center"
37
43
  }
38
- }), x = i.forwardRef(({ className: t, dataHook: a, trackingEl: e, trackingLabel: o, ...d }, s) => /* @__PURE__ */ r("ul", {
39
- ref: s,
40
- className: l("flex flex-col gap-2", t),
41
- "data-hook": a,
44
+ }), K = h(["flex", "flex-col"], {
45
+ variants: {
46
+ inset: {
47
+ true: ["-mr-2", "-ml-4"],
48
+ false: []
49
+ },
50
+ divided: {
51
+ true: [
52
+ "gap-0",
53
+ "[&>[data-slot=item]]:rounded-none",
54
+ "[&>[data-slot=item]+[data-slot=item]]:border-t",
55
+ "[&>[data-slot=item]+[data-slot=item]]:border-border"
56
+ ],
57
+ false: ["gap-2"]
58
+ }
59
+ },
60
+ defaultVariants: {
61
+ inset: !1,
62
+ divided: !1
63
+ }
64
+ }), $ = s.forwardRef(({ className: t, dataHook: e, trackingEl: a, trackingLabel: i, inset: r, divided: o, ...l }, m) => /* @__PURE__ */ n("ul", {
65
+ ref: m,
66
+ className: d(K({
67
+ inset: r,
68
+ divided: o
69
+ }), t),
70
+ "data-divided": o ? "" : void 0,
71
+ "data-hook": e,
42
72
  "data-slot": "list",
43
- "data-tracking-el": e,
44
- "data-tracking-label": o,
45
- ...d
73
+ "data-tracking-el": a,
74
+ "data-tracking-label": i,
75
+ ...l
46
76
  }));
47
- x.displayName = "List";
48
- var N = i.forwardRef(({ asChild: t = !1, className: a, variant: e, align: o, dataHook: d, trackingEl: s, trackingLabel: m, children: n, ...f }, c) => /* @__PURE__ */ r(t ? p : "li", {
49
- ref: c,
50
- className: l(v({
51
- variant: e,
52
- align: o
53
- }), a),
54
- "data-hook": d,
77
+ $.displayName = "List";
78
+ var N = s.forwardRef(({ asChild: t = !1, className: e, variant: a, align: i, dataHook: r, trackingEl: o, trackingLabel: l, children: m, ...c }, p) => /* @__PURE__ */ n(t ? g : "li", {
79
+ ref: p,
80
+ className: d(I({
81
+ variant: a,
82
+ align: i
83
+ }), e),
84
+ "data-align": i ?? "center",
85
+ "data-hook": r,
55
86
  "data-slot": "item",
56
- "data-tracking-el": s,
57
- "data-tracking-label": m,
58
- ...f,
59
- children: e === "loading" ? /* @__PURE__ */ r(g, { className: "h-13 w-full rounded-lg" }) : n
87
+ "data-tracking-el": o,
88
+ "data-tracking-label": l,
89
+ ...c,
90
+ children: a === "loading" ? /* @__PURE__ */ n(W, { className: "h-13 w-full rounded-lg" }) : m
60
91
  }));
61
- N.displayName = "Item";
62
- var b = i.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r("div", {
63
- ref: e,
64
- className: l("shrink-0", t),
92
+ N.displayName = "ListItem";
93
+ var q = h(["shrink-0"], {
94
+ variants: { variant: {
95
+ default: [],
96
+ icon: [
97
+ "inline-flex",
98
+ "size-10",
99
+ "items-center",
100
+ "justify-center",
101
+ "rounded-lg",
102
+ "border",
103
+ "border-border",
104
+ "bg-background"
105
+ ],
106
+ image: [
107
+ "size-10",
108
+ "overflow-hidden",
109
+ "rounded-lg",
110
+ "[&_img]:size-full",
111
+ "[&_img]:object-cover"
112
+ ]
113
+ } },
114
+ defaultVariants: { variant: "default" }
115
+ }), x = s.forwardRef(({ className: t, variant: e, ...a }, i) => /* @__PURE__ */ n("div", {
116
+ ref: i,
117
+ className: d(q({ variant: e }), t),
65
118
  "data-slot": "item-media",
119
+ "data-variant": e ?? "default",
66
120
  ...a
67
121
  }));
68
- b.displayName = "ItemMedia";
69
- var I = i.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r("div", {
70
- ref: e,
71
- className: l("flex flex-1 flex-col gap-1", t),
122
+ x.displayName = "ListItemMedia";
123
+ var y = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n("div", {
124
+ ref: a,
125
+ className: d("flex min-w-0 flex-1 flex-col gap-1", t),
72
126
  "data-slot": "item-content",
73
- ...a
127
+ ...e
74
128
  }));
75
- I.displayName = "ItemContent";
76
- var y = i.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r("div", {
77
- ref: e,
78
- className: l("text-foreground text-body", t),
79
- "data-slot": "item-title",
80
- ...a
129
+ y.displayName = "ListItemContent";
130
+ var G = '[data-slot="item-button"], [data-slot="item-link"]';
131
+ function J(t, e) {
132
+ const [a, i] = s.useState(!1);
133
+ return s.useEffect(() => {
134
+ if (!e || !t) return;
135
+ const r = () => i(t.scrollHeight > t.clientHeight + 1 || t.scrollWidth > t.clientWidth + 1), o = new ResizeObserver(r);
136
+ o.observe(t);
137
+ const l = new MutationObserver(r);
138
+ return l.observe(t, {
139
+ characterData: !0,
140
+ childList: !0,
141
+ subtree: !0
142
+ }), () => {
143
+ o.disconnect(), l.disconnect();
144
+ };
145
+ }, [e, t]), e && t !== null && a;
146
+ }
147
+ function Q(t, e) {
148
+ const [a, i] = s.useState(null), r = e ? t?.closest(G) ?? null : null;
149
+ return s.useEffect(() => {
150
+ if (!r) return;
151
+ const o = () => i(r === document.activeElement && r.matches(":focus-visible") ? r : null), l = () => i(null);
152
+ return o(), r.addEventListener("focus", o), r.addEventListener("blur", l), () => {
153
+ r.removeEventListener("focus", o), r.removeEventListener("blur", l);
154
+ };
155
+ }, [r]), r !== null && a === r;
156
+ }
157
+ var L = s.forwardRef(({ asChild: t = !1, truncate: e = !1, partSlot: a, tooltipSide: i, className: r, children: o, ...l }, m) => {
158
+ const [c, p] = s.useState(null), V = s.useCallback((u) => {
159
+ p(u), typeof m == "function" ? m(u) : m && (m.current = u);
160
+ }, [m]), v = J(c, e), f = Q(c, v), [O, A] = s.useState(!1), [F, b] = s.useState(!1), [j, z] = s.useState(f);
161
+ f !== j && (z(f), f && b(!1));
162
+ const w = /* @__PURE__ */ n(t ? g : "div", {
163
+ ref: V,
164
+ className: d(e && "line-clamp-2", r),
165
+ "data-slot": a,
166
+ "data-truncated": v ? "" : void 0,
167
+ ...l,
168
+ children: o
169
+ });
170
+ return v ? /* @__PURE__ */ M(P, {
171
+ open: !F && (O || f),
172
+ onOpenChange: (u) => {
173
+ u && b(!1), A(u);
174
+ },
175
+ children: [/* @__PURE__ */ n(_, {
176
+ asChild: !0,
177
+ onPointerDown: (u) => {
178
+ const k = u.currentTarget;
179
+ u.pointerType === "touch" && (k.closest("button, a, label") || k.tagName === "LABEL") && u.preventDefault();
180
+ },
181
+ children: w
182
+ }), /* @__PURE__ */ n(H, {
183
+ dataHook: `list-${a}-tooltip`,
184
+ side: i,
185
+ sideOffset: 4,
186
+ onEscapeKeyDown: () => b(!0),
187
+ children: o
188
+ })]
189
+ }) : w;
190
+ });
191
+ L.displayName = "TruncatableText";
192
+ var R = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n(L, {
193
+ ref: a,
194
+ className: d("text-foreground text-body", t),
195
+ partSlot: "item-title",
196
+ tooltipSide: "top",
197
+ ...e
81
198
  }));
82
- y.displayName = "ItemTitle";
83
- var k = i.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r("div", {
84
- ref: e,
85
- className: l("text-body-sm text-muted-foreground", t),
86
- "data-slot": "item-description",
87
- ...a
199
+ R.displayName = "ListItemTitle";
200
+ var C = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n(L, {
201
+ ref: a,
202
+ className: d("text-body-sm text-muted-foreground", t),
203
+ partSlot: "item-description",
204
+ tooltipSide: "bottom",
205
+ ...e
88
206
  }));
89
- k.displayName = "ItemDescription";
90
- var h = i.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ r("div", {
91
- ref: e,
92
- className: l("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full", t),
207
+ C.displayName = "ListItemDescription";
208
+ var S = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n("div", {
209
+ ref: a,
210
+ className: d("text-muted-foreground flex min-h-9 min-w-9 shrink-0 items-center justify-center gap-2", t),
93
211
  "data-slot": "item-actions",
212
+ ...e
213
+ }));
214
+ S.displayName = "ListItemActions";
215
+ var T = s.forwardRef(({ className: t, dataHook: e, ...a }, i) => /* @__PURE__ */ n("li", {
216
+ ref: i,
217
+ className: d("text-muted-foreground text-label-sm flex items-center pt-4 pr-2 pb-1 pl-4 first:pt-2", t),
218
+ "data-hook": e,
219
+ "data-slot": "item-subheader",
94
220
  ...a
95
221
  }));
96
- h.displayName = "ItemActions";
97
- var w = i.forwardRef(({ className: t, dataHook: a, ...e }, o) => /* @__PURE__ */ r("li", {
98
- ref: o,
99
- className: l("text-muted-foreground text-label-sm flex items-center pt-4 pr-2 pb-1 pl-4 first:pt-2", t),
222
+ T.displayName = "ListSubheader";
223
+ var E = [
224
+ "flex",
225
+ "w-full",
226
+ "min-w-0",
227
+ "items-center",
228
+ "group-data-[align=start]/item:items-start",
229
+ "gap-4",
230
+ "rounded-[inherit]",
231
+ "py-2",
232
+ "pr-2",
233
+ "pl-4",
234
+ "text-left",
235
+ "cursor-pointer",
236
+ "outline-none",
237
+ "hover:bg-accent",
238
+ "focus-visible:shadow-default",
239
+ "transition-colors",
240
+ "duration-fast",
241
+ "ease-out",
242
+ "disabled:pointer-events-none",
243
+ "disabled:cursor-not-allowed",
244
+ "disabled:opacity-50",
245
+ "aria-disabled:pointer-events-none",
246
+ "aria-disabled:cursor-not-allowed",
247
+ "aria-disabled:opacity-50"
248
+ ];
249
+ function D(t, e) {
250
+ const a = t.currentTarget.getAttribute("aria-disabled");
251
+ if (a === "true" || a === "") {
252
+ t.preventDefault(), t.stopPropagation();
253
+ return;
254
+ }
255
+ e?.(t);
256
+ }
257
+ var U = s.forwardRef(({ className: t, type: e = "button", dataHook: a, trackingEl: i, trackingLabel: r, onClickCapture: o, ...l }, m) => /* @__PURE__ */ n("button", {
258
+ ref: m,
259
+ className: d(E, t),
100
260
  "data-hook": a,
101
- "data-slot": "item-subheader",
261
+ "data-slot": "item-button",
262
+ "data-tracking-el": i,
263
+ "data-tracking-label": r,
264
+ type: e,
265
+ onClickCapture: (c) => D(c, o),
266
+ ...l
267
+ }));
268
+ U.displayName = "ListItemButton";
269
+ var X = s.forwardRef(({ className: t, asChild: e = !1, dataHook: a, trackingEl: i, trackingLabel: r, onClickCapture: o, ...l }, m) => /* @__PURE__ */ n(e ? g : "a", {
270
+ ref: m,
271
+ className: d(E, t),
272
+ "data-hook": a,
273
+ "data-slot": "item-link",
274
+ "data-tracking-el": i,
275
+ "data-tracking-label": r,
276
+ onClickCapture: (c) => D(c, o),
277
+ ...l
278
+ }));
279
+ X.displayName = "ListItemLink";
280
+ var Y = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n("span", {
281
+ ref: a,
282
+ className: d("text-muted-foreground text-body-sm max-w-1/2 min-w-0 shrink truncate text-right", t),
283
+ "data-slot": "item-value",
284
+ ...e
285
+ }));
286
+ Y.displayName = "ListItemValue";
287
+ var Z = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n(B, {
288
+ ref: a,
289
+ "aria-hidden": !0,
290
+ className: d("text-muted-foreground shrink-0", t),
291
+ "data-slot": "item-chevron",
292
+ ...e
293
+ }));
294
+ Z.displayName = "ListItemChevron";
295
+ var tt = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ n("li", {
296
+ ref: a,
297
+ "aria-hidden": !0,
298
+ className: d("bg-border h-px w-full shrink-0", t),
299
+ "data-slot": "item-separator",
102
300
  ...e
103
301
  }));
104
- w.displayName = "ItemSubheader";
302
+ tt.displayName = "ListSeparator";
303
+ var lt = N, dt = x, mt = y, ut = R, ct = C, ft = S, pt = T, vt = I;
105
304
  export {
106
- N as Item,
107
- h as ItemActions,
108
- I as ItemContent,
109
- k as ItemDescription,
110
- b as ItemMedia,
111
- w as ItemSubheader,
112
- y as ItemTitle,
113
- x as List,
114
- v as itemVariants
305
+ lt as Item,
306
+ ft as ItemActions,
307
+ mt as ItemContent,
308
+ ct as ItemDescription,
309
+ dt as ItemMedia,
310
+ pt as ItemSubheader,
311
+ ut as ItemTitle,
312
+ $ as List,
313
+ N as ListItem,
314
+ S as ListItemActions,
315
+ U as ListItemButton,
316
+ Z as ListItemChevron,
317
+ y as ListItemContent,
318
+ C as ListItemDescription,
319
+ X as ListItemLink,
320
+ x as ListItemMedia,
321
+ R as ListItemTitle,
322
+ Y as ListItemValue,
323
+ tt as ListSeparator,
324
+ T as ListSubheader,
325
+ vt as itemVariants,
326
+ q as listItemMediaVariants,
327
+ I as listItemVariants,
328
+ K as listVariants
115
329
  };
@@ -1 +1 @@
1
- "use client";const T=require("./_virtual/_rolldown/runtime.cjs");let r=require("react");r=T.__toESM(r,1);let b=require("@brightlocal/ui-components/lib/utils"),i=require("react/jsx-runtime"),A=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion");var P=12,q=90,x=12e3,S="var(--ds-motion-ease-emphasized)",y=150,F=50,d=r.forwardRef(({className:m,active:l,dataHook:p,trackingEl:_,trackingLabel:f,navigatingLabel:g="Loading page",style:h,...v},E)=>{const a=(0,A.usePrefersReducedMotion)(),[e,o]=r.useState("idle");r.useEffect(()=>{if(l){o(t=>t==="start"||t==="creep"?t:"start");return}const s=setTimeout(()=>o(t=>t==="idle"?"idle":"complete"),y);return()=>clearTimeout(s)},[l]),r.useEffect(()=>{if(e!=="start"||a)return;let s=0;const t=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>o(u=>u==="start"?"creep":u))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(s)}},[e,a]),r.useEffect(()=>{if(e!=="complete")return;const s=setTimeout(()=>o(t=>t==="complete"?"idle":t),a?0:350);return()=>clearTimeout(s)},[e,a]);const c=e==="start"||e==="creep",R=e==="complete"?100:e==="creep"?q:e==="start"&&a?F:P;let n="none";return a||(e==="creep"?n=`clip-path ${x}ms ${S}`:e==="complete"&&(n="clip-path var(--ds-motion-duration-base) ease-out, opacity var(--ds-motion-duration-fast) ease-out var(--ds-motion-duration-base)")),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:E,"aria-hidden":"true",className:(0,b.cn)("pointer-events-none fixed inset-x-0 top-0 z-60 h-0.5 overflow-hidden",m),"data-hook":p,"data-slot":"route-progress","data-state":e,"data-tracking-el":_,"data-tracking-label":f,style:h,...v,children:(0,i.jsx)("span",{className:"bg-primary absolute inset-0 dark:bg-[var(--ds-colors-primary-light)]","data-slot":"route-progress-bar",style:{clipPath:`inset(0 ${100-R}% 0 0)`,opacity:c?1:0,transition:n}})}),(0,i.jsx)("span",{"aria-atomic":"true","aria-live":"polite",className:"sr-only fixed","data-slot":"route-progress-status",children:c?g:""})]})});d.displayName="RouteProgress";exports.RouteProgress=d;
1
+ "use client";const T=require("./_virtual/_rolldown/runtime.cjs"),L=require("./lib/motion.cjs");let r=require("react");r=T.__toESM(r,1);let b=require("@brightlocal/ui-components/lib/utils"),i=require("react/jsx-runtime"),q=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion");var A=12,P=90,x=12e3,S="var(--ds-motion-ease-emphasized)",y=150,F=50,d=r.forwardRef(({className:m,active:l,dataHook:p,trackingEl:_,trackingLabel:f,navigatingLabel:g="Loading page",style:h,...v},E)=>{const a=(0,q.usePrefersReducedMotion)(),[e,o]=r.useState("idle");r.useEffect(()=>{if(l){o(t=>t==="start"||t==="creep"?t:"start");return}const s=setTimeout(()=>o(t=>t==="idle"?"idle":"complete"),y);return()=>clearTimeout(s)},[l]),r.useEffect(()=>{if(e!=="start"||a)return;let s=0;const t=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>o(u=>u==="start"?"creep":u))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(s)}},[e,a]),r.useEffect(()=>{if(e!=="complete")return;const s=setTimeout(()=>o(t=>t==="complete"?"idle":t),a?0:350);return()=>clearTimeout(s)},[e,a]);const c=e==="start"||e==="creep",R=e==="complete"?100:e==="creep"?P:e==="start"&&a?F:A;let n="none";return a||(e==="creep"?n=`clip-path ${x}ms ${S}`:e==="complete"&&(n="clip-path var(--ds-motion-duration-base) ease-out, opacity var(--ds-motion-duration-fast) ease-out var(--ds-motion-duration-base)")),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:E,"aria-hidden":"true",className:(0,b.cn)("pointer-events-none fixed inset-x-0 top-0 z-60 h-0.5 overflow-hidden",m),"data-hook":p,"data-slot":"route-progress","data-state":e,"data-tracking-el":_,"data-tracking-label":f,style:h,...v,children:(0,i.jsx)("span",{className:"bg-primary absolute inset-0 dark:bg-[var(--ds-colors-primary-light)]","data-slot":"route-progress-bar",style:{clipPath:`inset(0 ${100-R}% 0 0)`,opacity:c?1:0,transition:n}})}),(0,i.jsx)("span",{"aria-atomic":"true","aria-live":"polite",className:"sr-only fixed","data-slot":"route-progress-status",children:c?g:""})]})});d.displayName="RouteProgress";exports.RouteProgress=d;
@@ -1,50 +1,51 @@
1
1
  "use client";
2
- import * as s from "react";
3
- import { cn as T } from "@brightlocal/ui-components/lib/utils";
4
- import { Fragment as A, jsx as n, jsxs as P } from "react/jsx-runtime";
5
- import { usePrefersReducedMotion as b } from "@brightlocal/ui-components/hooks/use-prefers-reduced-motion";
6
- var y = 12, F = 90, S = 12e3, _ = "var(--ds-motion-ease-emphasized)", x = 150, L = 50, C = s.forwardRef(({ className: d, active: l, dataHook: p, trackingEl: u, trackingLabel: f, navigatingLabel: v = "Loading page", style: g, ...E }, h) => {
7
- const a = b(), [e, o] = s.useState("idle");
8
- s.useEffect(() => {
2
+ import "./lib/motion.js";
3
+ import * as o from "react";
4
+ import { cn as R } from "@brightlocal/ui-components/lib/utils";
5
+ import { Fragment as A, jsx as n, jsxs as _ } from "react/jsx-runtime";
6
+ import { usePrefersReducedMotion as S } from "@brightlocal/ui-components/hooks/use-prefers-reduced-motion";
7
+ var F = 12, M = 90, N = 12e3, P = "var(--ds-motion-ease-emphasized)", b = 150, y = 50, I = o.forwardRef(({ className: d, active: l, dataHook: p, trackingEl: u, trackingLabel: f, navigatingLabel: T = "Loading page", style: v, ...E }, g) => {
8
+ const a = S(), [e, s] = o.useState("idle");
9
+ o.useEffect(() => {
9
10
  if (l) {
10
- o((t) => t === "start" || t === "creep" ? t : "start");
11
+ s((t) => t === "start" || t === "creep" ? t : "start");
11
12
  return;
12
13
  }
13
- const r = setTimeout(() => o((t) => t === "idle" ? "idle" : "complete"), x);
14
+ const r = setTimeout(() => s((t) => t === "idle" ? "idle" : "complete"), b);
14
15
  return () => clearTimeout(r);
15
- }, [l]), s.useEffect(() => {
16
+ }, [l]), o.useEffect(() => {
16
17
  if (e !== "start" || a) return;
17
18
  let r = 0;
18
19
  const t = requestAnimationFrame(() => {
19
- r = requestAnimationFrame(() => o((m) => m === "start" ? "creep" : m));
20
+ r = requestAnimationFrame(() => s((c) => c === "start" ? "creep" : c));
20
21
  });
21
22
  return () => {
22
23
  cancelAnimationFrame(t), cancelAnimationFrame(r);
23
24
  };
24
- }, [e, a]), s.useEffect(() => {
25
+ }, [e, a]), o.useEffect(() => {
25
26
  if (e !== "complete") return;
26
- const r = setTimeout(() => o((t) => t === "complete" ? "idle" : t), a ? 0 : 350);
27
+ const r = setTimeout(() => s((t) => t === "complete" ? "idle" : t), a ? 0 : 350);
27
28
  return () => clearTimeout(r);
28
29
  }, [e, a]);
29
- const c = e === "start" || e === "creep", R = e === "complete" ? 100 : e === "creep" ? F : e === "start" && a ? L : y;
30
+ const m = e === "start" || e === "creep", h = e === "complete" ? 100 : e === "creep" ? M : e === "start" && a ? y : F;
30
31
  let i = "none";
31
- return a || (e === "creep" ? i = `clip-path ${S}ms ${_}` : e === "complete" && (i = "clip-path var(--ds-motion-duration-base) ease-out, opacity var(--ds-motion-duration-fast) ease-out var(--ds-motion-duration-base)")), /* @__PURE__ */ P(A, { children: [/* @__PURE__ */ n("div", {
32
- ref: h,
32
+ return a || (e === "creep" ? i = `clip-path ${N}ms ${P}` : e === "complete" && (i = "clip-path var(--ds-motion-duration-base) ease-out, opacity var(--ds-motion-duration-fast) ease-out var(--ds-motion-duration-base)")), /* @__PURE__ */ _(A, { children: [/* @__PURE__ */ n("div", {
33
+ ref: g,
33
34
  "aria-hidden": "true",
34
- className: T("pointer-events-none fixed inset-x-0 top-0 z-60 h-0.5 overflow-hidden", d),
35
+ className: R("pointer-events-none fixed inset-x-0 top-0 z-60 h-0.5 overflow-hidden", d),
35
36
  "data-hook": p,
36
37
  "data-slot": "route-progress",
37
38
  "data-state": e,
38
39
  "data-tracking-el": u,
39
40
  "data-tracking-label": f,
40
- style: g,
41
+ style: v,
41
42
  ...E,
42
43
  children: /* @__PURE__ */ n("span", {
43
44
  className: "bg-primary absolute inset-0 dark:bg-[var(--ds-colors-primary-light)]",
44
45
  "data-slot": "route-progress-bar",
45
46
  style: {
46
- clipPath: `inset(0 ${100 - R}% 0 0)`,
47
- opacity: c ? 1 : 0,
47
+ clipPath: `inset(0 ${100 - h}% 0 0)`,
48
+ opacity: m ? 1 : 0,
48
49
  transition: i
49
50
  }
50
51
  })
@@ -53,10 +54,10 @@ var y = 12, F = 90, S = 12e3, _ = "var(--ds-motion-ease-emphasized)", x = 150, L
53
54
  "aria-live": "polite",
54
55
  className: "sr-only fixed",
55
56
  "data-slot": "route-progress-status",
56
- children: c ? v : ""
57
+ children: m ? T : ""
57
58
  })] });
58
59
  });
59
- C.displayName = "RouteProgress";
60
+ I.displayName = "RouteProgress";
60
61
  export {
61
- C as RouteProgress
62
+ I as RouteProgress
62
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -227,8 +227,8 @@
227
227
  "sonner": "^2.0.8",
228
228
  "tailwind-merge": "^3.7.0",
229
229
  "vaul": "^1.1.2",
230
- "@brightlocal/icons": "2.5.0",
231
- "@brightlocal/illustrations": "0.7.0"
230
+ "@brightlocal/illustrations": "0.7.0",
231
+ "@brightlocal/icons": "2.5.0"
232
232
  },
233
233
  "size-limit": [
234
234
  {
@@ -9,7 +9,12 @@ import { usePrefersReducedMotion } from "@brightlocal/ui-components/hooks/use-pr
9
9
  import { SPRING_SNAPPY } from "../lib/motion";
10
10
  import { Button, type ButtonProps } from "../components/button";
11
11
  import { Input } from "../components/input";
12
- import { Item, ItemContent, ItemTitle, ItemActions } from "../components/list";
12
+ import {
13
+ ListItem,
14
+ ListItemContent,
15
+ ListItemTitle,
16
+ ListItemActions,
17
+ } from "../components/list";
13
18
 
14
19
  /* -------------------------------------------------------------------------------------------------
15
20
  * InputList Context
@@ -295,7 +300,7 @@ function InputListItems({
295
300
  data-slot="input-list-skeleton"
296
301
  >
297
302
  {Array.from({ length: skeletonCount }).map((_, i) => (
298
- <Item key={i} variant="loading" />
303
+ <ListItem key={i} variant="loading" />
299
304
  ))}
300
305
  </ul>
301
306
  );
@@ -329,12 +334,12 @@ function InputListItems({
329
334
  layout: SPRING_SNAPPY,
330
335
  }}
331
336
  >
332
- <Item asChild variant="filled">
337
+ <ListItem asChild variant="filled">
333
338
  <div>
334
- <ItemContent>
335
- <ItemTitle>{item}</ItemTitle>
336
- </ItemContent>
337
- <ItemActions>
339
+ <ListItemContent>
340
+ <ListItemTitle>{item}</ListItemTitle>
341
+ </ListItemContent>
342
+ <ListItemActions>
338
343
  <button
339
344
  aria-label={
340
345
  removeAriaLabel
@@ -355,9 +360,9 @@ function InputListItems({
355
360
  >
356
361
  <X />
357
362
  </button>
358
- </ItemActions>
363
+ </ListItemActions>
359
364
  </div>
360
- </Item>
365
+ </ListItem>
361
366
  </motion.li>
362
367
  ))}
363
368
  </AnimatePresence>