@brightlocal/ui-components 1.2.2 → 1.2.4

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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),J=require("react"),Q=require("@brightlocal/icons"),R=require("@brightlocal/ui-components/lib/utils"),U=require("../button.cjs"),S=require("../field.cjs"),W=require("../input.cjs"),m=require("../list.cjs");function Y(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const c in t)if(c!=="default"){const f=Object.getOwnPropertyDescriptor(t,c);Object.defineProperty(a,c,f.get?f:{enumerable:!0,get:()=>t[c]})}}return a.default=t,Object.freeze(a)}const o=Y(J);function q({value:t,onValueChange:a,maxItems:c,placeholder:f="Add item",addButtonLabel:E="Add",skeletonCount:M=3,disabled:h=!1,loading:g=!1,error:D=!1,errorMessage:I,description:N,dataHook:d,trackingEl:O,trackingLabel:F,className:P}){const[b,$]=o.useState(""),[T,k]=o.useState(()=>new Set),[j,v]=o.useState(()=>new Set);o.useEffect(()=>{if(j.size===0)return;const e=requestAnimationFrame(()=>{v(new Set)});return()=>cancelAnimationFrame(e)},[j]);const x=o.useRef(t);o.useEffect(()=>{x.current=t},[t]);const y=o.useRef(new Set);o.useEffect(()=>{const e=y.current;return()=>{e.forEach(clearTimeout),e.clear()}},[]);const A=o.useRef(t.length),[K,p]=o.useState(()=>t.map((e,s)=>s));o.useEffect(()=>{p(e=>e.length!==t.length?t.map(()=>A.current++):e)},[t]);const _=c!==void 0&&t.length>=c,L=h||_||g,z=h||_||g,w=o.useCallback(e=>{const s=e.map(r=>r.trim()).filter(Boolean);if(!s.length)return;const l=c!==void 0?c-t.length:1/0,i=s.slice(0,l);if(i.length){if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){const u=t.length;v(new Set(i.map((Z,G)=>u+G)))}p(u=>[...u,...i.map(()=>A.current++)]),a([...t,...i]),$("")}},[t,c,a]),C=o.useCallback(e=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){p(i=>i.filter((r,u)=>u!==e)),a(x.current.filter((i,r)=>r!==e));return}k(i=>new Set(i).add(e));const l=setTimeout(()=>{y.current.delete(l),k(i=>{const r=new Set(i);return r.delete(e),r}),p(i=>i.filter((r,u)=>u!==e)),a(x.current.filter((i,r)=>r!==e))},200);y.current.add(l)},[a]),B=e=>{e.key==="Enter"&&(e.preventDefault(),w([b]))},X=e=>{const l=e.clipboardData.getData("text").split(`
2
- `);l.length>1&&(e.preventDefault(),w(l))};return n.jsxs("div",{className:R.cn("flex flex-col gap-4",P),"data-hook":d,"data-slot":"input-list","data-tracking-el":O,"data-tracking-label":F,children:[g?n.jsx("ul",{className:"flex flex-col gap-2","data-slot":"input-list-skeleton",children:Array.from({length:M}).map((e,s)=>n.jsx(m.Item,{variant:"loading"},s))}):t.length>0?n.jsx("ul",{className:"flex flex-col","data-hook":`${d}-list`,"data-slot":"list",children:t.map((e,s)=>{const l=T.has(s),r=j.has(s)||l;return n.jsx("li",{className:R.cn("grid transition-[grid-template-rows,opacity,margin-bottom] ease-out",r?"mb-0 grid-rows-[0fr] opacity-0":"mb-2 grid-rows-[1fr] opacity-100 last:mb-0",l?"duration-200":"duration-300"),"data-hook":`${d}-item-${s}`,"data-slot":"item",children:n.jsx("div",{className:"overflow-hidden",children:n.jsxs("div",{className:"bg-card flex items-center gap-4 rounded-lg py-2 pr-2 pl-4",children:[n.jsx(m.ItemContent,{children:n.jsx(m.ItemTitle,{children:e})}),n.jsx(m.ItemActions,{children:n.jsx("button",{"aria-label":`Remove ${e}`,className:R.cn("inline-flex size-9 cursor-pointer items-center justify-center rounded-full","text-muted-foreground","focus-visible:shadow-default outline-none","transition-colors duration-150 ease-in-out","disabled:pointer-events-none disabled:opacity-50"),"data-hook":`${d}-remove-${s}`,disabled:h||l,type:"button",onClick:()=>C(s),children:n.jsx(Q.X,{})})})]})})},K[s])})}):null,n.jsxs("div",{className:"flex flex-col gap-2","data-slot":"input-list-input-area",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(W.Input,{className:"flex-1",dataHook:`${d}-input`,disabled:L,error:D,placeholder:f,value:b,onChange:e=>$(e.target.value),onKeyDown:B,onPaste:X}),n.jsx(U.Button,{dataHook:`${d}-add`,disabled:z,onClick:()=>w([b]),children:E})]}),N&&n.jsx(S.FieldDescription,{"data-slot":"input-list-description",dataHook:`${d}-description`,children:N}),c!==void 0&&n.jsxs(S.FieldDescription,{"data-slot":"input-list-count",dataHook:`${d}-count`,children:[t.length,"/",c]}),D&&I&&n.jsx(S.FieldError,{"data-slot":"input-list-error",dataHook:`${d}-error`,children:I})]})]})}q.displayName="InputList";exports.InputList=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),T=require("react"),q=require("framer-motion"),z=require("@brightlocal/icons"),A=require("@brightlocal/ui-components/lib/utils"),B=require("../button.cjs"),b=require("../field.cjs"),M=require("../input.cjs"),u=require("../list.cjs");function v(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const d=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(a,s,d.get?d:{enumerable:!0,get:()=>e[s]})}}return a.default=e,Object.freeze(a)}const o=v(T);function I({value:e,onValueChange:a,maxItems:s,placeholder:d="Add item",addButtonLabel:S="Add",skeletonCount:_=3,disabled:p=!1,loading:f=!1,error:y=!1,errorMessage:D,description:$,dataHook:l,trackingEl:O,trackingLabel:P,className:R}){const[h,k]=o.useState(""),g=o.useRef(e.length),[w,m]=o.useState(()=>e.map((t,i)=>i));o.useEffect(()=>{m(t=>t.length===e.length?t:e.length>t.length?[...t,...Array.from({length:e.length-t.length},()=>g.current++)]:e.map(()=>g.current++))},[e]);const N=s!==void 0&&e.length>=s,F=p||N||f,K=p||N||f,j=o.useCallback(t=>{const i=t.map(x=>x.trim()).filter(Boolean);if(!i.length)return;const r=s!==void 0?s-e.length:1/0,c=i.slice(0,r);c.length&&(m(x=>[...x,...c.map(()=>g.current++)]),a([...e,...c]),k(""))},[e,s,a]),L=o.useCallback(t=>{m(i=>i.filter((r,c)=>c!==t)),a(e.filter((i,r)=>r!==t))},[e,a]),C=t=>{t.key==="Enter"&&(t.preventDefault(),j([h]))},E=t=>{const r=t.clipboardData.getData("text").split(`
2
+ `);r.length>1&&(t.preventDefault(),j(r))};return n.jsxs("div",{className:A.cn("flex flex-col gap-4",R),"data-hook":l,"data-slot":"input-list","data-tracking-el":O,"data-tracking-label":P,children:[f?n.jsx("ul",{className:"flex flex-col gap-2","data-slot":"input-list-skeleton",children:Array.from({length:_}).map((t,i)=>n.jsx(u.Item,{variant:"loading"},i))}):e.length>0?n.jsx("ul",{className:"flex flex-col gap-2","data-hook":`${l}-list`,"data-slot":"list",children:n.jsx(q.AnimatePresence,{initial:!1,children:e.map((t,i)=>n.jsx(q.motion.li,{layout:!0,animate:{opacity:1,scale:1},"data-hook":`${l}-item-${i}`,"data-slot":"item",exit:{opacity:0,scale:.8,transition:{opacity:{duration:.15},scale:{duration:.12}}},initial:{opacity:0,scale:.8},transition:{opacity:{duration:.15},scale:{duration:.15},layout:{type:"spring",stiffness:500,damping:35}},children:n.jsxs("div",{className:"bg-card flex items-center gap-4 rounded-lg py-2 pr-2 pl-4",children:[n.jsx(u.ItemContent,{children:n.jsx(u.ItemTitle,{children:t})}),n.jsx(u.ItemActions,{children:n.jsx("button",{"aria-label":`Remove ${t}`,className:A.cn("inline-flex size-9 cursor-pointer items-center justify-center rounded-full","text-muted-foreground","focus-visible:shadow-default outline-none","transition-colors duration-150 ease-in-out","disabled:pointer-events-none disabled:opacity-50"),"data-hook":`${l}-remove-${i}`,disabled:p,type:"button",onClick:()=>L(i),children:n.jsx(z.X,{})})})]})},w[i]))})}):null,n.jsxs("div",{className:"flex flex-col gap-2","data-slot":"input-list-input-area",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(M.Input,{className:"flex-1",dataHook:`${l}-input`,disabled:F,error:y,placeholder:d,value:h,onChange:t=>k(t.target.value),onKeyDown:C,onPaste:E}),n.jsx(B.Button,{dataHook:`${l}-add`,disabled:K,onClick:()=>j([h]),children:S})]}),y&&D?n.jsx(b.FieldError,{"data-slot":"input-list-error",dataHook:`${l}-error`,children:D}):n.jsxs(n.Fragment,{children:[$&&n.jsx(b.FieldDescription,{"data-slot":"input-list-description",dataHook:`${l}-description`,children:$}),s!==void 0&&n.jsxs(b.FieldDescription,{"data-slot":"input-list-count",dataHook:`${l}-count`,children:[e.length,"/",s]})]})]})]})}I.displayName="InputList";exports.InputList=I;
@@ -1 +1 @@
1
- {"version":3,"file":"input-list.d.ts","sourceRoot":"","sources":["../../src/blocks/input-list.tsx"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,WAAwB,EACxB,cAAsB,EACtB,aAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,KAAa,EACb,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,SAAS,GACV,EAAE,cAAc,2CAkPhB;kBAlQQ,SAAS;;;AAsQlB,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"input-list.d.ts","sourceRoot":"","sources":["../../src/blocks/input-list.tsx"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,WAAwB,EACxB,cAAsB,EACtB,aAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,KAAa,EACb,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,SAAS,GACV,EAAE,cAAc,2CAmNhB;kBAnOQ,SAAS;;;AAuOlB,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,215 +1,191 @@
1
- import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { X as J } from "@brightlocal/icons";
4
- import { cn as S } from "@brightlocal/ui-components/lib/utils";
5
- import { Button as O } from "../button.js";
6
- import { FieldDescription as _, FieldError as Q } from "../field.js";
7
- import { Input as U } from "../input.js";
8
- import { Item as W, ItemContent as Y, ItemTitle as Z, ItemActions as V } from "../list.js";
9
- function H({
1
+ import { jsxs as r, jsx as i, Fragment as B } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { AnimatePresence as z, motion as T } from "framer-motion";
4
+ import { X } from "@brightlocal/icons";
5
+ import { cn as N } from "@brightlocal/ui-components/lib/utils";
6
+ import { Button as q } from "../button.js";
7
+ import { FieldError as G, FieldDescription as A } from "../field.js";
8
+ import { Input as J } from "../input.js";
9
+ import { Item as O, ItemContent as Q, ItemTitle as U, ItemActions as W } from "../list.js";
10
+ function Y({
10
11
  value: e,
11
- onValueChange: f,
12
- maxItems: c,
13
- placeholder: M = "Add item",
14
- addButtonLabel: x = "Add",
15
- skeletonCount: F = 3,
12
+ onValueChange: d,
13
+ maxItems: a,
14
+ placeholder: I = "Add item",
15
+ addButtonLabel: K = "Add",
16
+ skeletonCount: R = 3,
16
17
  disabled: p = !1,
17
- loading: h = !1,
18
- error: I = !1,
19
- errorMessage: N,
20
- description: $,
18
+ loading: f = !1,
19
+ error: b = !1,
20
+ errorMessage: $,
21
+ description: k,
21
22
  dataHook: l,
22
- trackingEl: K,
23
+ trackingEl: _,
23
24
  trackingLabel: j,
24
- className: C
25
+ className: w
25
26
  }) {
26
- const [g, A] = o.useState(""), [L, k] = o.useState(
27
- () => /* @__PURE__ */ new Set()
28
- ), [b, D] = o.useState(
29
- () => /* @__PURE__ */ new Set()
30
- );
31
- o.useEffect(() => {
32
- if (b.size === 0) return;
33
- const t = requestAnimationFrame(() => {
34
- D(/* @__PURE__ */ new Set());
35
- });
36
- return () => cancelAnimationFrame(t);
37
- }, [b]);
38
- const w = o.useRef(e);
39
- o.useEffect(() => {
40
- w.current = e;
41
- }, [e]);
42
- const y = o.useRef(/* @__PURE__ */ new Set());
43
- o.useEffect(() => {
44
- const t = y.current;
45
- return () => {
46
- t.forEach(clearTimeout), t.clear();
47
- };
48
- }, []);
49
- const v = o.useRef(e.length), [T, m] = o.useState(
27
+ const [m, x] = s.useState(""), u = s.useRef(e.length), [C, h] = s.useState(
50
28
  () => e.map((t, n) => n)
51
29
  );
52
- o.useEffect(() => {
53
- m((t) => t.length !== e.length ? e.map(() => v.current++) : t);
30
+ s.useEffect(() => {
31
+ h((t) => t.length === e.length ? t : e.length > t.length ? [
32
+ ...t,
33
+ ...Array.from(
34
+ { length: e.length - t.length },
35
+ () => u.current++
36
+ )
37
+ ] : e.map(() => u.current++));
54
38
  }, [e]);
55
- const E = c !== void 0 && e.length >= c, z = p || E || h, B = p || E || h, R = o.useCallback(
39
+ const D = a !== void 0 && e.length >= a, E = p || D || f, F = p || D || f, g = s.useCallback(
56
40
  (t) => {
57
- const n = t.map((s) => s.trim()).filter(Boolean);
41
+ const n = t.map((y) => y.trim()).filter(Boolean);
58
42
  if (!n.length) return;
59
- const a = c !== void 0 ? c - e.length : 1 / 0, i = n.slice(0, a);
60
- if (i.length) {
61
- if (!window.matchMedia(
62
- "(prefers-reduced-motion: reduce)"
63
- ).matches) {
64
- const d = e.length;
65
- D(new Set(i.map((tt, G) => d + G)));
66
- }
67
- m((d) => [
68
- ...d,
69
- ...i.map(() => v.current++)
70
- ]), f([...e, ...i]), A("");
71
- }
43
+ const o = a !== void 0 ? a - e.length : 1 / 0, c = n.slice(0, o);
44
+ c.length && (h((y) => [
45
+ ...y,
46
+ ...c.map(() => u.current++)
47
+ ]), d([...e, ...c]), x(""));
72
48
  },
73
- [e, c, f]
74
- ), P = o.useCallback(
49
+ [e, a, d]
50
+ ), L = s.useCallback(
75
51
  (t) => {
76
- if (window.matchMedia(
77
- "(prefers-reduced-motion: reduce)"
78
- ).matches) {
79
- m((i) => i.filter((s, d) => d !== t)), f(w.current.filter((i, s) => s !== t));
80
- return;
81
- }
82
- k((i) => new Set(i).add(t));
83
- const a = setTimeout(() => {
84
- y.current.delete(a), k((i) => {
85
- const s = new Set(i);
86
- return s.delete(t), s;
87
- }), m((i) => i.filter((s, d) => d !== t)), f(w.current.filter((i, s) => s !== t));
88
- }, 200);
89
- y.current.add(a);
52
+ h((n) => n.filter((o, c) => c !== t)), d(e.filter((n, o) => o !== t));
90
53
  },
91
- [f]
92
- ), q = (t) => {
93
- t.key === "Enter" && (t.preventDefault(), R([g]));
94
- }, X = (t) => {
95
- const a = t.clipboardData.getData("text").split(`
54
+ [e, d]
55
+ ), P = (t) => {
56
+ t.key === "Enter" && (t.preventDefault(), g([m]));
57
+ }, S = (t) => {
58
+ const o = t.clipboardData.getData("text").split(`
96
59
  `);
97
- a.length > 1 && (t.preventDefault(), R(a));
60
+ o.length > 1 && (t.preventDefault(), g(o));
98
61
  };
99
- return /* @__PURE__ */ u(
62
+ return /* @__PURE__ */ r(
100
63
  "div",
101
64
  {
102
- className: S("flex flex-col gap-4", C),
65
+ className: N("flex flex-col gap-4", w),
103
66
  "data-hook": l,
104
67
  "data-slot": "input-list",
105
- "data-tracking-el": K,
68
+ "data-tracking-el": _,
106
69
  "data-tracking-label": j,
107
70
  children: [
108
- h ? /* @__PURE__ */ r("ul", { className: "flex flex-col gap-2", "data-slot": "input-list-skeleton", children: Array.from({ length: F }).map((t, n) => /* @__PURE__ */ r(W, { variant: "loading" }, n)) }) : e.length > 0 ? /* @__PURE__ */ r(
71
+ f ? /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2", "data-slot": "input-list-skeleton", children: Array.from({ length: R }).map((t, n) => /* @__PURE__ */ i(O, { variant: "loading" }, n)) }) : e.length > 0 ? /* @__PURE__ */ i(
109
72
  "ul",
110
73
  {
111
- className: "flex flex-col",
74
+ className: "flex flex-col gap-2",
112
75
  "data-hook": `${l}-list`,
113
76
  "data-slot": "list",
114
- children: e.map((t, n) => {
115
- const a = L.has(n), s = b.has(n) || a;
116
- return /* @__PURE__ */ r(
117
- "li",
118
- {
119
- className: S(
120
- "grid transition-[grid-template-rows,opacity,margin-bottom] ease-out",
121
- s ? "mb-0 grid-rows-[0fr] opacity-0" : "mb-2 grid-rows-[1fr] opacity-100 last:mb-0",
122
- a ? "duration-200" : "duration-300"
123
- ),
124
- "data-hook": `${l}-item-${n}`,
125
- "data-slot": "item",
126
- children: /* @__PURE__ */ r("div", { className: "overflow-hidden", children: /* @__PURE__ */ u("div", { className: "bg-card flex items-center gap-4 rounded-lg py-2 pr-2 pl-4", children: [
127
- /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Z, { children: t }) }),
128
- /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(
129
- "button",
130
- {
131
- "aria-label": `Remove ${t}`,
132
- className: S(
133
- "inline-flex size-9 cursor-pointer items-center justify-center rounded-full",
134
- "text-muted-foreground",
135
- "focus-visible:shadow-default outline-none",
136
- "transition-colors duration-150 ease-in-out",
137
- "disabled:pointer-events-none disabled:opacity-50"
138
- ),
139
- "data-hook": `${l}-remove-${n}`,
140
- disabled: p || a,
141
- type: "button",
142
- onClick: () => P(n),
143
- children: /* @__PURE__ */ r(J, {})
144
- }
145
- ) })
146
- ] }) })
77
+ children: /* @__PURE__ */ i(z, { initial: !1, children: e.map((t, n) => /* @__PURE__ */ i(
78
+ T.li,
79
+ {
80
+ layout: !0,
81
+ animate: { opacity: 1, scale: 1 },
82
+ "data-hook": `${l}-item-${n}`,
83
+ "data-slot": "item",
84
+ exit: {
85
+ opacity: 0,
86
+ scale: 0.8,
87
+ transition: {
88
+ opacity: { duration: 0.15 },
89
+ scale: { duration: 0.12 }
90
+ }
91
+ },
92
+ initial: { opacity: 0, scale: 0.8 },
93
+ transition: {
94
+ opacity: { duration: 0.15 },
95
+ scale: { duration: 0.15 },
96
+ layout: {
97
+ type: "spring",
98
+ stiffness: 500,
99
+ damping: 35
100
+ }
147
101
  },
148
- T[n]
149
- );
150
- })
102
+ children: /* @__PURE__ */ r("div", { className: "bg-card flex items-center gap-4 rounded-lg py-2 pr-2 pl-4", children: [
103
+ /* @__PURE__ */ i(Q, { children: /* @__PURE__ */ i(U, { children: t }) }),
104
+ /* @__PURE__ */ i(W, { children: /* @__PURE__ */ i(
105
+ "button",
106
+ {
107
+ "aria-label": `Remove ${t}`,
108
+ className: N(
109
+ "inline-flex size-9 cursor-pointer items-center justify-center rounded-full",
110
+ "text-muted-foreground",
111
+ "focus-visible:shadow-default outline-none",
112
+ "transition-colors duration-150 ease-in-out",
113
+ "disabled:pointer-events-none disabled:opacity-50"
114
+ ),
115
+ "data-hook": `${l}-remove-${n}`,
116
+ disabled: p,
117
+ type: "button",
118
+ onClick: () => L(n),
119
+ children: /* @__PURE__ */ i(X, {})
120
+ }
121
+ ) })
122
+ ] })
123
+ },
124
+ C[n]
125
+ )) })
151
126
  }
152
127
  ) : null,
153
- /* @__PURE__ */ u("div", { className: "flex flex-col gap-2", "data-slot": "input-list-input-area", children: [
154
- /* @__PURE__ */ u("div", { className: "flex gap-2", children: [
155
- /* @__PURE__ */ r(
156
- U,
128
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-2", "data-slot": "input-list-input-area", children: [
129
+ /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
130
+ /* @__PURE__ */ i(
131
+ J,
157
132
  {
158
133
  className: "flex-1",
159
134
  dataHook: `${l}-input`,
160
- disabled: z,
161
- error: I,
162
- placeholder: M,
163
- value: g,
164
- onChange: (t) => A(t.target.value),
165
- onKeyDown: q,
166
- onPaste: X
135
+ disabled: E,
136
+ error: b,
137
+ placeholder: I,
138
+ value: m,
139
+ onChange: (t) => x(t.target.value),
140
+ onKeyDown: P,
141
+ onPaste: S
167
142
  }
168
143
  ),
169
- /* @__PURE__ */ r(
170
- O,
144
+ /* @__PURE__ */ i(
145
+ q,
171
146
  {
172
147
  dataHook: `${l}-add`,
173
- disabled: B,
174
- onClick: () => R([g]),
175
- children: x
148
+ disabled: F,
149
+ onClick: () => g([m]),
150
+ children: K
176
151
  }
177
152
  )
178
153
  ] }),
179
- $ && /* @__PURE__ */ r(
180
- _,
181
- {
182
- "data-slot": "input-list-description",
183
- dataHook: `${l}-description`,
184
- children: $
185
- }
186
- ),
187
- c !== void 0 && /* @__PURE__ */ u(
188
- _,
189
- {
190
- "data-slot": "input-list-count",
191
- dataHook: `${l}-count`,
192
- children: [
193
- e.length,
194
- "/",
195
- c
196
- ]
197
- }
198
- ),
199
- I && N && /* @__PURE__ */ r(
200
- Q,
154
+ b && $ ? /* @__PURE__ */ i(
155
+ G,
201
156
  {
202
157
  "data-slot": "input-list-error",
203
158
  dataHook: `${l}-error`,
204
- children: N
159
+ children: $
205
160
  }
206
- )
161
+ ) : /* @__PURE__ */ r(B, { children: [
162
+ k && /* @__PURE__ */ i(
163
+ A,
164
+ {
165
+ "data-slot": "input-list-description",
166
+ dataHook: `${l}-description`,
167
+ children: k
168
+ }
169
+ ),
170
+ a !== void 0 && /* @__PURE__ */ r(
171
+ A,
172
+ {
173
+ "data-slot": "input-list-count",
174
+ dataHook: `${l}-count`,
175
+ children: [
176
+ e.length,
177
+ "/",
178
+ a
179
+ ]
180
+ }
181
+ )
182
+ ] })
207
183
  ] })
208
184
  ]
209
185
  }
210
186
  );
211
187
  }
212
- H.displayName = "InputList";
188
+ Y.displayName = "InputList";
213
189
  export {
214
- H as InputList
190
+ Y as InputList
215
191
  };
package/dist/combobox.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),E=require("@brightlocal/icons"),V=require("class-variance-authority"),$=require("cmdk"),k=require("@brightlocal/ui-components/lib/utils"),L=require("@brightlocal/ui-components/popover"),y=require("@brightlocal/ui-components/command");function z(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(o,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return o.default=e,Object.freeze(o)}const t=z(U),T=t.createContext(null);function R(){const e=t.useContext(T);if(!e)throw new Error("Combobox components must be used within a <Combobox>");return e}function H({value:e,onValueChange:o,open:a,onOpenChange:r,shouldFilter:i=!0,disabled:u=!1,itemToStringValue:c,children:b}){const[h,C]=t.useState(""),[f,w]=t.useState(!1),[v,s]=t.useState(()=>new Map),x=e!==void 0,p=a!==void 0,d=x?e:h,m=p?a:f,g=t.useCallback(l=>{p||w(l),r?.(l)},[p,r]),j=t.useCallback(l=>{x||C(l),o?.(l)},[x,o]),N=t.useCallback((l,O)=>{s(I=>{if(I.get(l)===O)return I;const q=new Map(I);return q.set(l,O),q})},[]),S=t.useMemo(()=>({open:m,setOpen:g,value:d,onValueChange:j,shouldFilter:i,disabled:u,itemLabels:v,registerItem:N,itemToStringValue:c}),[m,g,d,j,i,u,v,N,c]);return n.jsx(T.Provider,{value:S,children:n.jsx(L.Popover,{open:m,onOpenChange:g,children:b})})}const B=V.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:bg-neutral-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{variant:{default:[]}},defaultVariants:{variant:"default"}}),F=t.forwardRef(({className:e,variant:o,dataHook:a,error:r,trackingEl:i,trackingLabel:u,children:c,...b},h)=>{const{open:C,disabled:f,value:w}=R(),v=t.useId(),s=!w,x=r||b["aria-invalid"]===!0||b["aria-invalid"]==="true";return n.jsx(L.PopoverTrigger,{asChild:!0,children:n.jsxs("button",{ref:h,"aria-controls":C?v:void 0,"aria-expanded":C,"aria-haspopup":"listbox","aria-invalid":x?"true":void 0,className:k.cn(B({variant:o}),x&&"border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive",e),"data-hook":a,"data-placeholder":s,"data-slot":"combobox-trigger","data-state":C?"open":"closed","data-tracking-el":i||"combobox-trigger","data-tracking-label":u,disabled:f||b.disabled,role:"combobox",type:"button",...b,children:[c,n.jsx(E.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});F.displayName="ComboboxTrigger";function J({placeholder:e,className:o}){const{value:a,itemLabels:r}=R(),i=a?r.get(a)||a:e;return n.jsx("span",{className:k.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",o),"data-slot":"combobox-value",children:i})}function K({dataHook:e,className:o,children:a,align:r="start",side:i="bottom",sideOffset:u,avoidCollisions:c,hideList:b=!1}){const{open:h,shouldFilter:C,itemToStringValue:f}=R(),[w,v]=t.useState(null),s=t.useRef(null),x=t.useCallback(d=>{if(s.current?.(),s.current=null,!d)return;let m=!1;const g=l=>{m||(l==="top"||l==="bottom")&&(m=!0,j.disconnect(),v(l))},j=new MutationObserver(()=>{g(d.getAttribute("data-side"))});j.observe(d,{attributes:!0,attributeFilter:["data-side"]});let N=0,S=0;N=requestAnimationFrame(()=>{S=requestAnimationFrame(()=>{g(d.getAttribute("data-side"))})}),s.current=()=>{m=!0,j.disconnect(),cancelAnimationFrame(N),cancelAnimationFrame(S)}},[]);t.useEffect(()=>{h||(s.current?.(),s.current=null,v(null))},[h]);const p=t.useMemo(()=>{if(f)return(d,m,g)=>$.defaultFilter(f(d),m,g)},[f]);return n.jsx(L.PopoverContent,{ref:x,align:r,"aria-label":"Options",avoidCollisions:c,className:k.cn("w-[var(--radix-popover-trigger-width)] p-0",o),"data-slot":"combobox-popover",side:w??i,sideOffset:u,children:n.jsx(y.Command,{className:k.cn("border-0 shadow-none",b&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:e||"combobox-command",filter:p,shouldFilter:C,children:a})})}const M=t.forwardRef((e,o)=>n.jsx(y.CommandInput,{ref:o,"data-slot":"combobox-input",...e}));M.displayName="ComboboxInput";const P=t.forwardRef((e,o)=>n.jsx(y.CommandList,{ref:o,"data-slot":"combobox-list",...e}));P.displayName="ComboboxList";const A=t.forwardRef((e,o)=>n.jsx(y.CommandEmpty,{ref:o,"data-slot":"combobox-empty",...e}));A.displayName="ComboboxEmpty";const _=t.forwardRef((e,o)=>n.jsx(y.CommandGroup,{ref:o,"data-slot":"combobox-group",...e}));_.displayName="ComboboxGroup";function Q(e,o,a){if(!o||!o.trim())return e;const r=new RegExp(`(${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),i=e.split(r);return n.jsx("span",{children:i.map((u,c)=>c%2===1?n.jsx("span",{className:a,children:u},c):n.jsx(t.Fragment,{children:u},c))})}const G=t.forwardRef(({value:e,label:o,dataHook:a,children:r,className:i,highlight:u,highlightClassName:c,keywords:b,...h},C)=>{const{value:f,onValueChange:w,setOpen:v,registerItem:s}=R(),x=f===e,p=t.useMemo(()=>o||(typeof r=="string"?r:typeof r=="number"?String(r):e),[o,r,e]),d=t.useRef(s);t.useEffect(()=>{d.current=s},[s]),t.useEffect(()=>{d.current(e,p)},[e,p]);const m=()=>{w(e===f?"":e),v(!1)},g=()=>u&&typeof r=="string"?Q(r,u,c||"text-sm leading-normal font-semibold"):r;return n.jsxs(y.CommandItem,{ref:C,className:k.cn("justify-between",i),"data-slot":"combobox-item",dataHook:a,keywords:b?[p,...b]:[p],value:e,onSelect:m,...h,children:[g(),x&&n.jsx(E.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});G.displayName="ComboboxItem";const D=t.forwardRef((e,o)=>n.jsx(y.CommandSeparator,{ref:o,"data-slot":"combobox-separator",...e}));D.displayName="ComboboxSeparator";function W({className:e,children:o}){return n.jsx("div",{"aria-disabled":"true","aria-selected":"false",className:k.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",e),"data-slot":"combobox-loading",role:"option",children:o||n.jsxs(n.Fragment,{children:[n.jsx("div",{"aria-hidden":"true",className:"size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"}),"Loading..."]})})}exports.Combobox=H;exports.ComboboxContent=K;exports.ComboboxEmpty=A;exports.ComboboxGroup=_;exports.ComboboxInput=M;exports.ComboboxItem=G;exports.ComboboxList=P;exports.ComboboxLoading=W;exports.ComboboxSeparator=D;exports.ComboboxTrigger=F;exports.ComboboxValue=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),q=require("@brightlocal/icons"),V=require("class-variance-authority"),$=require("cmdk"),k=require("@brightlocal/ui-components/lib/utils"),T=require("@brightlocal/ui-components/popover"),y=require("@brightlocal/ui-components/command");function z(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(o,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return o.default=e,Object.freeze(o)}const t=z(U),E=t.createContext(null);function R(){const e=t.useContext(E);if(!e)throw new Error("Combobox components must be used within a <Combobox>");return e}function H({value:e,onValueChange:o,open:a,onOpenChange:r,shouldFilter:u=!0,disabled:c=!1,itemToStringValue:d,children:b}){const[h,C]=t.useState(""),[f,w]=t.useState(!1),[v,i]=t.useState(()=>new Map),x=e!==void 0,p=a!==void 0,s=x?e:h,m=p?a:f,g=t.useCallback(l=>{p||w(l),r?.(l)},[p,r]),j=t.useCallback(l=>{x||C(l),o?.(l)},[x,o]),N=t.useCallback((l,L)=>{i(I=>{if(I.get(l)===L)return I;const O=new Map(I);return O.set(l,L),O})},[]),S=t.useMemo(()=>({open:m,setOpen:g,value:s,onValueChange:j,shouldFilter:u,disabled:c,itemLabels:v,registerItem:N,itemToStringValue:d}),[m,g,s,j,u,c,v,N,d]);return n.jsx(E.Provider,{value:S,children:n.jsx(T.Popover,{open:m,onOpenChange:g,children:b})})}const B=V.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:bg-neutral-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{variant:{default:[]}},defaultVariants:{variant:"default"}}),F=t.forwardRef(({className:e,variant:o,dataHook:a,error:r,trackingEl:u,trackingLabel:c,children:d,...b},h)=>{const{open:C,disabled:f,value:w}=R(),v=t.useId(),i=!w,x=r||b["aria-invalid"]===!0||b["aria-invalid"]==="true";return n.jsx(T.PopoverTrigger,{asChild:!0,children:n.jsxs("button",{ref:h,"aria-controls":C?v:void 0,"aria-expanded":C,"aria-haspopup":"listbox","aria-invalid":x?"true":void 0,className:k.cn(B({variant:o}),x&&"border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive",e),"data-hook":a,"data-placeholder":i,"data-slot":"combobox-trigger","data-state":C?"open":"closed","data-tracking-el":u||"combobox-trigger","data-tracking-label":c,disabled:f||b.disabled,role:"combobox",type:"button",...b,children:[d,n.jsx(q.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});F.displayName="ComboboxTrigger";function J({placeholder:e,className:o}){const{value:a,itemLabels:r}=R(),u=a?r.get(a)||a:e;return n.jsx("span",{className:k.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",o),"data-slot":"combobox-value",children:u})}function K({dataHook:e,className:o,children:a,align:r="start",side:u="bottom",sideOffset:c,avoidCollisions:d,hideList:b=!1}){const{open:h,shouldFilter:C,itemToStringValue:f}=R(),[w,v]=t.useState(null),i=t.useRef(null),x=t.useCallback(s=>{if(i.current?.(),i.current=null,!s)return;let m=!1;const g=l=>{m||(l==="top"||l==="bottom")&&(m=!0,j.disconnect(),v(l))},j=new MutationObserver(()=>{g(s.getAttribute("data-side"))});j.observe(s,{attributes:!0,attributeFilter:["data-side"]});let N=0,S=0;N=requestAnimationFrame(()=>{S=requestAnimationFrame(()=>{g(s.getAttribute("data-side"))})}),i.current=()=>{m=!0,j.disconnect(),cancelAnimationFrame(N),cancelAnimationFrame(S)}},[]);t.useEffect(()=>{if(!h){i.current?.(),i.current=null;const s=setTimeout(()=>v(null),150);return()=>clearTimeout(s)}},[h]);const p=t.useMemo(()=>{if(f)return(s,m,g)=>$.defaultFilter(f(s),m,g)},[f]);return n.jsx(T.PopoverContent,{ref:x,align:r,"aria-label":"Options",avoidCollisions:d,className:k.cn("w-[var(--radix-popover-trigger-width)] p-0",o),"data-slot":"combobox-popover",side:w??u,sideOffset:c,children:n.jsx(y.Command,{className:k.cn("border-0 shadow-none",b&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:e||"combobox-command",filter:p,shouldFilter:C,children:a})})}const M=t.forwardRef((e,o)=>n.jsx(y.CommandInput,{ref:o,"data-slot":"combobox-input",...e}));M.displayName="ComboboxInput";const P=t.forwardRef((e,o)=>n.jsx(y.CommandList,{ref:o,"data-slot":"combobox-list",...e}));P.displayName="ComboboxList";const A=t.forwardRef((e,o)=>n.jsx(y.CommandEmpty,{ref:o,"data-slot":"combobox-empty",...e}));A.displayName="ComboboxEmpty";const _=t.forwardRef((e,o)=>n.jsx(y.CommandGroup,{ref:o,"data-slot":"combobox-group",...e}));_.displayName="ComboboxGroup";function Q(e,o,a){if(!o||!o.trim())return e;const r=new RegExp(`(${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),u=e.split(r);return n.jsx("span",{children:u.map((c,d)=>d%2===1?n.jsx("span",{className:a,children:c},d):n.jsx(t.Fragment,{children:c},d))})}const G=t.forwardRef(({value:e,label:o,dataHook:a,children:r,className:u,highlight:c,highlightClassName:d,keywords:b,...h},C)=>{const{value:f,onValueChange:w,setOpen:v,registerItem:i}=R(),x=f===e,p=t.useMemo(()=>o||(typeof r=="string"?r:typeof r=="number"?String(r):e),[o,r,e]),s=t.useRef(i);t.useEffect(()=>{s.current=i},[i]),t.useEffect(()=>{s.current(e,p)},[e,p]);const m=()=>{w(e===f?"":e),v(!1)},g=()=>c&&typeof r=="string"?Q(r,c,d||"text-sm leading-normal font-semibold"):r;return n.jsxs(y.CommandItem,{ref:C,className:k.cn("justify-between",u),"data-slot":"combobox-item",dataHook:a,keywords:b?[p,...b]:[p],value:e,onSelect:m,...h,children:[g(),x&&n.jsx(q.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});G.displayName="ComboboxItem";const D=t.forwardRef((e,o)=>n.jsx(y.CommandSeparator,{ref:o,"data-slot":"combobox-separator",...e}));D.displayName="ComboboxSeparator";function W({className:e,children:o}){return n.jsx("div",{"aria-disabled":"true","aria-selected":"false",className:k.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",e),"data-slot":"combobox-loading",role:"option",children:o||n.jsxs(n.Fragment,{children:[n.jsx("div",{"aria-hidden":"true",className:"size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"}),"Loading..."]})})}exports.Combobox=H;exports.ComboboxContent=K;exports.ComboboxEmpty=A;exports.ComboboxGroup=_;exports.ComboboxInput=M;exports.ComboboxItem=G;exports.ComboboxList=P;exports.ComboboxLoading=W;exports.ComboboxSeparator=D;exports.ComboboxTrigger=F;exports.ComboboxValue=J;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AASlE,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAkC5C,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kHAAkH;IAClH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,eAAe;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iB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