@brightlocal/ui-components 2.1.0 → 2.3.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/combobox.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),ee=require("react"),z=require("@brightlocal/icons"),te=require("@tanstack/react-virtual"),oe=require("class-variance-authority"),G=require("cmdk"),F=require("@brightlocal/ui-components/lib/utils"),U=require("@brightlocal/ui-components/lib/use-dev-warning"),W=require("@brightlocal/ui-components/popover"),T=require("@brightlocal/ui-components/command");function re(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const e=re(ee),V=e.createContext(null),H=e.createContext(null);function q(){const t=e.useContext(V);if(!t)throw new Error("Combobox components must be used within a <Combobox>");return t}function ne({value:t,onValueChange:o,open:r,onOpenChange:s,shouldFilter:l=!0,disabled:m=!1,itemToStringValue:d,children:C}){const[w,k]=e.useState(""),[j,I]=e.useState(!1),[S,R]=e.useState(()=>new Map),[y,x]=e.useState(""),[N,f]=e.useState(void 0),b=t!==void 0,p=r!==void 0,v=b?t:w,i=p?r:j,h=e.useCallback(n=>{n||x(""),p||I(n),s?.(n)},[p,s]),g=e.useCallback(n=>{b||k(n),o?.(n)},[b,o]),D=e.useRef(new Map),P=e.useRef(!1),L=e.useRef(!0);e.useEffect(()=>()=>{L.current=!1},[]);const M=e.useCallback(()=>{P.current||(P.current=!0,queueMicrotask(()=>{P.current=!1,L.current&&R(new Map(D.current))}))},[]),A=e.useCallback((n,u)=>{D.current.get(n)!==u&&(D.current.set(n,u),M())},[M]),O=e.useRef(v);e.useLayoutEffect(()=>{O.current=v},[v]);const $=e.useCallback(n=>{n!==O.current&&D.current.has(n)&&(D.current.delete(n),M())},[M]),_=e.useMemo(()=>d?(n,u,E)=>G.defaultFilter(d(n),u,E):G.defaultFilter,[d]),c=e.useMemo(()=>({open:i,setOpen:h,value:v,onValueChange:g,shouldFilter:l,disabled:m,itemLabels:S,registerItem:A,unregisterItem:$,itemToStringValue:d,filterFn:_,searchValue:y,setSearchValue:x,activeDescendantId:N,setActiveDescendantId:f}),[i,h,v,g,l,m,S,A,$,d,_,y,N,f]);return a.jsx(V.Provider,{value:c,children:a.jsx(W.Popover,{open:i,onOpenChange:h,children:C})})}const se=oe.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","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"]),K=e.forwardRef(({className:t,dataHook:o,error:r,trackingEl:s,trackingLabel:l,children:m,...d},C)=>{const{open:w,disabled:k,value:j}=q(),I=e.useId(),S=!j,R=r||d["aria-invalid"]===!0||d["aria-invalid"]==="true";return a.jsx(W.PopoverTrigger,{asChild:!0,children:a.jsxs("button",{ref:C,"aria-controls":w?I:void 0,"aria-expanded":w,"aria-haspopup":"listbox","aria-invalid":R?"true":void 0,className:F.cn(se(),R&&"border-destructive-40 dark: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",t),"data-hook":o,"data-placeholder":S,"data-slot":"combobox-trigger","data-state":w?"open":"closed","data-tracking-el":s||"combobox-trigger","data-tracking-label":l,disabled:k||d.disabled,role:"combobox",type:"button",...d,children:[m,a.jsx(z.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});K.displayName="ComboboxTrigger";function ae({placeholder:t,className:o}){const{value:r,itemLabels:s}=q(),l=r?s.get(r)||r:t;return a.jsx("span",{className:F.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",o),"data-slot":"combobox-value",children:l})}function ie({dataHook:t,className:o,children:r,align:s="start",side:l="bottom",sideOffset:m,avoidCollisions:d,hideList:C=!1}){const{open:w,shouldFilter:k,filterFn:j,itemToStringValue:I}=q(),[S,R]=e.useState(null),y=e.useRef(null),x=e.useCallback(f=>{if(y.current?.(),y.current=null,!f)return;let b=!1;const p=g=>{b||(g==="top"||g==="bottom")&&(b=!0,v.disconnect(),R(g))},v=new MutationObserver(()=>{p(f.getAttribute("data-side"))});v.observe(f,{attributes:!0,attributeFilter:["data-side"]});let i=0,h=0;i=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{p(f.getAttribute("data-side"))})}),y.current=()=>{b=!0,v.disconnect(),cancelAnimationFrame(i),cancelAnimationFrame(h)}},[]);e.useEffect(()=>{if(!w){y.current?.(),y.current=null;const f=setTimeout(()=>R(null),150);return()=>clearTimeout(f)}},[w]);const N=I?j:void 0;return a.jsx(W.PopoverContent,{ref:x,align:s,"aria-label":"Options",avoidCollisions:d,className:F.cn("flex max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)] flex-col overflow-hidden p-0",o),collisionPadding:4,"data-slot":"combobox-popover",side:S??l,sideOffset:m,children:a.jsx(T.Command,{className:F.cn("min-h-0 flex-1 border-0 shadow-none","[&_[data-slot='command-input-wrapper']]:shrink-0",C&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:t||"combobox-command",filter:N,shouldFilter:k,children:r})})}const Y=e.forwardRef(({debounceMs:t,onValueChange:o,...r},s)=>{const{setSearchValue:l,shouldFilter:m,activeDescendantId:d}=q(),C=e.useRef(void 0);U.useDevWarning(()=>!!(t&&t>0&&m),`debounceMs is set on <ComboboxInput> but shouldFilter is true (default).
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),re=require("react"),H=require("@brightlocal/icons"),ne=require("@tanstack/react-virtual"),se=require("class-variance-authority"),W=require("cmdk"),L=require("@brightlocal/ui-components/lib/utils"),Y=require("@brightlocal/ui-components/lib/use-dev-warning"),B=require("@brightlocal/ui-components/popover"),_=require("@brightlocal/ui-components/command");function ae(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const t=ae(re),J=t.createContext(null),K=t.createContext(null);function $(){const e=t.useContext(J);if(!e)throw new Error("Combobox components must be used within a <Combobox>");return e}function ie({value:e,onValueChange:o,open:r,onOpenChange:n,shouldFilter:u=!0,disabled:b=!1,itemToStringValue:l,children:g}){const[v,C]=t.useState(""),[F,I]=t.useState(!1),[j,R]=t.useState(()=>new Map),[w,y]=t.useState(""),[h,m]=t.useState(void 0),E=e!==void 0,D=r!==void 0,k=E?e:v,d=D?r:F,x=t.useCallback(p=>{p||y(""),D||I(p),n?.(p)},[D,n]),N=t.useCallback(p=>{E||C(p),o?.(p)},[E,o]),s=t.useRef(new Map),S=t.useRef(!1),T=t.useRef(!0);t.useEffect(()=>()=>{T.current=!1},[]);const q=t.useCallback(()=>{S.current||(S.current=!0,queueMicrotask(()=>{S.current=!1,T.current&&R(new Map(s.current))}))},[]),M=t.useCallback((p,O)=>{s.current.get(p)!==O&&(s.current.set(p,O),q())},[q]),A=t.useRef(k);t.useLayoutEffect(()=>{A.current=k},[k]);const z=t.useCallback(p=>{p!==A.current&&s.current.has(p)&&(s.current.delete(p),q())},[q]),G=t.useMemo(()=>l?(p,O,i)=>W.defaultFilter(l(p),O,i):W.defaultFilter,[l]),U=t.useMemo(()=>({open:d,setOpen:x,value:k,onValueChange:N,shouldFilter:u,disabled:b,itemLabels:j,registerItem:M,unregisterItem:z,itemToStringValue:l,filterFn:G,searchValue:w,setSearchValue:y,activeDescendantId:h,setActiveDescendantId:m}),[d,x,k,N,u,b,j,M,z,l,G,w,h,m]);return a.jsx(J.Provider,{value:U,children:a.jsx(B.Popover,{open:d,onOpenChange:x,children:g})})}const ce=se.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","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"]),Q=t.forwardRef(({className:e,dataHook:o,error:r,trackingEl:n,trackingLabel:u,children:b,...l},g)=>{const{open:v,disabled:C,value:F}=$(),I=t.useId(),j=!F,R=r||l["aria-invalid"]===!0||l["aria-invalid"]==="true";return a.jsx(B.PopoverTrigger,{asChild:!0,children:a.jsxs("button",{ref:g,"aria-controls":v?I:void 0,"aria-expanded":v,"aria-haspopup":"listbox","aria-invalid":R?"true":void 0,className:L.cn(ce(),R&&"border-destructive-40 dark: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":o,"data-placeholder":j,"data-slot":"combobox-trigger","data-state":v?"open":"closed","data-tracking-el":n||"combobox-trigger","data-tracking-label":u,disabled:C||l.disabled,role:"combobox",type:"button",...l,children:[b,a.jsx(H.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});Q.displayName="ComboboxTrigger";function ue({placeholder:e,className:o,displayValue:r}){const{value:n,itemLabels:u}=$(),b=n?u.get(n)||r?.(n)||n:e;return a.jsx("span",{className:L.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",o),"data-slot":"combobox-value",children:b})}function le({dataHook:e,className:o,children:r,align:n="start",side:u="bottom",sideOffset:b,avoidCollisions:l,hideList:g=!1}){const{open:v,shouldFilter:C,filterFn:F,itemToStringValue:I}=$(),[j,R]=t.useState(null),w=t.useRef(null),y=t.useCallback(m=>{if(w.current?.(),w.current=null,!m)return;let E=!1;const D=N=>{E||(N==="top"||N==="bottom")&&(E=!0,k.disconnect(),R(N))},k=new MutationObserver(()=>{D(m.getAttribute("data-side"))});k.observe(m,{attributes:!0,attributeFilter:["data-side"]});let d=0,x=0;d=requestAnimationFrame(()=>{x=requestAnimationFrame(()=>{D(m.getAttribute("data-side"))})}),w.current=()=>{E=!0,k.disconnect(),cancelAnimationFrame(d),cancelAnimationFrame(x)}},[]);t.useEffect(()=>{if(!v){w.current?.(),w.current=null;const m=setTimeout(()=>R(null),150);return()=>clearTimeout(m)}},[v]);const h=I?F:void 0;return a.jsx(B.PopoverContent,{ref:y,align:n,"aria-label":"Options",avoidCollisions:l,className:L.cn("flex max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)] flex-col overflow-hidden p-0",o),collisionPadding:4,"data-slot":"combobox-popover",side:j??u,sideOffset:b,children:a.jsx(_.Command,{className:L.cn("min-h-0 flex-1 border-0 shadow-none","[&_[data-slot='command-input-wrapper']]:shrink-0",g&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:e||"combobox-command",filter:h,shouldFilter:C,children:r})})}const V=t.forwardRef(({debounceMs:e,onValueChange:o,...r},n)=>{const{setSearchValue:u,shouldFilter:b,activeDescendantId:l}=$(),g=t.useRef(void 0);Y.useDevWarning(()=>!!(e&&e>0&&b),`debounceMs is set on <ComboboxInput> but shouldFilter is true (default).
2
2
  Debounce is designed for async/server-driven search where the consumer controls the items list.
3
- Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs for client-side filtering.`,[t,m]),U.useDevWarning(()=>!!(t&&t>0&&r.value!==void 0),"debounceMs is set on <ComboboxInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",[t,r.value]),e.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]);const w=e.useCallback(k=>{l(k),t&&t>0?(clearTimeout(C.current),C.current=setTimeout(()=>{o?.(k)},t)):o?.(k)},[t,o,l]);return a.jsx(T.CommandInput,{ref:s,"aria-activedescendant":d,"data-slot":"combobox-input",onValueChange:w,...r})});Y.displayName="ComboboxInput";const B=e.forwardRef(({className:t,...o},r)=>a.jsx(T.CommandList,{ref:r,className:F.cn("min-h-0 flex-1",t),"data-slot":"combobox-list",...o}));B.displayName="ComboboxList";function ce({items:t,getItemValue:o,getItemLabel:r,estimateSize:s=36,overscan:l=5,children:m,renderEmpty:d,className:C,dataHook:w},k){const j=e.useRef(null),{value:I,onValueChange:S,setOpen:R,shouldFilter:y,searchValue:x,filterFn:N,setActiveDescendantId:f}=q(),[b,p]=e.useState(0),v=e.useId();e.useImperativeHandle(k,()=>j.current,[]);const i=e.useMemo(()=>{if(!y||!x.trim())return t;const c=[];for(const n of t){const u=r?G.defaultFilter(r(n),x):N(o(n),x);u>0&&c.push({item:n,score:u})}return c.sort((n,u)=>u.score-n.score),c.map(n=>n.item)},[t,y,x,o,r,N]),h=te.useVirtualizer({count:i.length,getScrollElement:()=>j.current,estimateSize:()=>s,overscan:l}),g=b>=0&&b<i.length?o(i[b]):null;e.useEffect(()=>{p(0)},[x,i.length]);const D=e.useRef(!1);e.useEffect(()=>{if(D.current||!I)return;const c=i.findIndex(n=>o(n)===I);c>=0&&(p(c),h.scrollToIndex(c,{align:"center"}),D.current=!0)},[I,i,o,h]);const P=e.useRef(!1);e.useEffect(()=>{P.current&&b>=0&&b<i.length&&h.scrollToIndex(b,{align:"auto"}),P.current=!1},[b,i.length,h]),e.useEffect(()=>{const c=j.current?.closest('[data-slot="combobox-command"]');if(!c)return;const n=u=>{switch(u.key){case"ArrowDown":u.preventDefault(),u.stopPropagation(),P.current=!0,p(E=>E<i.length-1?E+1:E);break;case"ArrowUp":u.preventDefault(),u.stopPropagation(),P.current=!0,p(E=>E>0?E-1:E);break;case"Enter":if(u.preventDefault(),u.stopPropagation(),b>=0&&b<i.length){const E=o(i[b]);S(E===I?"":E),R(!1)}break;case"Home":u.preventDefault(),u.stopPropagation(),P.current=!0,p(0);break;case"End":u.preventDefault(),u.stopPropagation(),P.current=!0,p(i.length-1);break}};return c.addEventListener("keydown",n,{capture:!0}),()=>c.removeEventListener("keydown",n,{capture:!0})},[i,b,I,S,R,o]);const L=e.useMemo(()=>{const c=new Map;return i.forEach((n,u)=>{c.set(o(n),u)}),c},[i,o]),M=e.useCallback(c=>{const n=L.get(c);n!==void 0&&p(n)},[L]),A=e.useCallback(c=>(L.get(c)??0)+1,[L]),O=i.length,$=e.useMemo(()=>({activeValue:g,onItemPointerMove:M,idPrefix:v,filteredCount:O,getItemPosition:A}),[g,M,v,O,A]),_=g!=null?`${v}item-${g}`:void 0;return e.useEffect(()=>(f(_),()=>f(void 0)),[_,f]),i.length===0?a.jsx("div",{ref:j,className:F.cn("max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",C),"data-hook":w,"data-slot":"combobox-virtual-list",role:"listbox",children:d}):a.jsx(H.Provider,{value:$,children:a.jsx("div",{ref:j,className:F.cn("max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",C),"data-hook":w,"data-slot":"combobox-virtual-list",role:"listbox",children:a.jsx("div",{className:"relative w-full",style:{height:`${h.getTotalSize()}px`},children:h.getVirtualItems().map(c=>a.jsx("div",{ref:h.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":c.index,style:{transform:`translateY(${c.start}px)`},children:m(i[c.index],c.index)},c.key))})})})}const ue=e.forwardRef(ce),J=e.forwardRef((t,o)=>a.jsx(T.CommandEmpty,{ref:o,"data-slot":"combobox-empty",...t}));J.displayName="ComboboxEmpty";const Q=e.forwardRef(({children:t,...o},r)=>{const s=e.useRef(null);return U.useDevWarning(()=>s.current?s.current.querySelectorAll('[data-slot="combobox-item"]').length>=100:!1,`ComboboxGroup contains 100+ items. Use <ComboboxVirtualList> for large datasets to avoid DOM bloat and slow renders.
4
- Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox"`,[t]),a.jsx(T.CommandGroup,{ref:l=>{s.current=l,typeof r=="function"?r(l):r&&(r.current=l)},"data-slot":"combobox-group",...o,children:t})});Q.displayName="ComboboxGroup";function le(t,o,r){if(!o||!o.trim())return t;const s=new RegExp(`(${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),l=t.split(s);return a.jsx("span",{children:l.map((m,d)=>d%2===1?a.jsx("span",{className:r,children:m},d):a.jsx(e.Fragment,{children:m},d))})}const X=e.forwardRef(({value:t,label:o,dataHook:r,children:s,className:l,highlight:m,highlightClassName:d,keywords:C,...w},k)=>{const{value:j,onValueChange:I,setOpen:S,registerItem:R,unregisterItem:y}=q(),x=e.useContext(H),N=j===t,f=e.useMemo(()=>o||(typeof s=="string"?s:typeof s=="number"?String(s):t),[o,s,t]),b=e.useRef(R),p=e.useRef(y);e.useEffect(()=>{b.current=R,p.current=y},[R,y]),e.useEffect(()=>(b.current(t,f),()=>p.current(t)),[t,f]);const v=()=>{I(t===j?"":t),S(!1)},i=()=>m&&typeof s=="string"?le(s,m,d||"text-sm leading-normal font-semibold"):s;if(x){const h=x.activeValue===t,g=!!w.disabled;return a.jsxs("div",{ref:k,"aria-disabled":g||void 0,"aria-posinset":x.getItemPosition(t),"aria-selected":N,"aria-setsize":x.filteredCount,className:F.cn("data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none","[&_svg]:pointer-events-none [&_svg]:shrink-0",g&&"pointer-events-none opacity-50",l),"data-highlighted":h||void 0,"data-hook":r,"data-slot":"combobox-item",id:`${x.idPrefix}item-${t}`,role:"option",tabIndex:-1,onClick:g?void 0:v,onKeyDown:g?void 0:D=>{(D.key==="Enter"||D.key===" ")&&v()},onPointerMove:g?void 0:()=>x.onItemPointerMove(t),children:[i(),N&&a.jsx(z.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})}return a.jsxs(T.CommandItem,{ref:k,className:F.cn("justify-between",l),"data-slot":"combobox-item",dataHook:r,keywords:C?[f,...C]:[f],value:t,onSelect:v,...w,children:[i(),N&&a.jsx(z.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});X.displayName="ComboboxItem";const Z=e.forwardRef((t,o)=>a.jsx(T.CommandSeparator,{ref:o,"data-slot":"combobox-separator",...t}));Z.displayName="ComboboxSeparator";function de({className:t,children:o}){return a.jsx("div",{"aria-live":"polite",className:F.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",t),"data-slot":"combobox-loading",role:"status",children:o||a.jsxs(a.Fragment,{children:[a.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=ne;exports.ComboboxContent=ie;exports.ComboboxEmpty=J;exports.ComboboxGroup=Q;exports.ComboboxInput=Y;exports.ComboboxItem=X;exports.ComboboxList=B;exports.ComboboxLoading=de;exports.ComboboxSeparator=Z;exports.ComboboxTrigger=K;exports.ComboboxValue=ae;exports.ComboboxVirtualList=ue;
3
+ Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs for client-side filtering.`,[e,b]),Y.useDevWarning(()=>!!(e&&e>0&&r.value!==void 0),"debounceMs is set on <ComboboxInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",[e,r.value]),t.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const v=t.useCallback(C=>{u(C),e&&e>0?(clearTimeout(g.current),g.current=setTimeout(()=>{o?.(C)},e)):o?.(C)},[e,o,u]);return a.jsx(_.CommandInput,{ref:n,"aria-activedescendant":l,"data-slot":"combobox-input",onValueChange:v,...r})});V.displayName="ComboboxInput";const X=t.forwardRef(({className:e,...o},r)=>a.jsx(_.CommandList,{ref:r,className:L.cn("min-h-0 flex-1",e),"data-slot":"combobox-list",...o}));X.displayName="ComboboxList";function de({items:e,getItemValue:o,getItemLabel:r,getItemKeywords:n,estimateSize:u=36,overscan:b=5,children:l,renderEmpty:g,className:v,dataHook:C},F){const I=t.useRef(null),{value:j,onValueChange:R,setOpen:w,shouldFilter:y,searchValue:h,filterFn:m,setActiveDescendantId:E,registerItem:D,unregisterItem:k}=$(),[d,x]=t.useState(0),N=t.useId();t.useImperativeHandle(F,()=>I.current,[]),t.useEffect(()=>{const i=r??o;for(const c of e)D(o(c),i(c));return()=>{for(const c of e)k(o(c))}},[e,o,r,D,k]);const s=t.useMemo(()=>{if(!y||!h.trim())return e;const i=[];for(const c of e){let f=r?W.defaultFilter(r(c),h):m(o(c),h);if(n)for(const P of n(c))f=Math.max(f,W.defaultFilter(P,h));f>0&&i.push({item:c,score:f})}return i.sort((c,f)=>f.score-c.score),i.map(c=>c.item)},[e,y,h,o,r,n,m]),S=ne.useVirtualizer({count:s.length,getScrollElement:()=>I.current,estimateSize:()=>u,overscan:b}),T=d>=0&&d<s.length?o(s[d]):null;t.useEffect(()=>{x(0)},[h,s.length]);const q=t.useRef(!1);t.useEffect(()=>{if(q.current||!j)return;const i=s.findIndex(c=>o(c)===j);i>=0&&(x(i),S.scrollToIndex(i,{align:"center"}),q.current=!0)},[j,s,o,S]);const M=t.useRef(!1);t.useEffect(()=>{M.current&&d>=0&&d<s.length&&S.scrollToIndex(d,{align:"auto"}),M.current=!1},[d,s.length,S]),t.useEffect(()=>{const i=I.current?.closest('[data-slot="combobox-command"]');if(!i)return;const c=f=>{switch(f.key){case"ArrowDown":f.preventDefault(),f.stopPropagation(),M.current=!0,x(P=>P<s.length-1?P+1:P);break;case"ArrowUp":f.preventDefault(),f.stopPropagation(),M.current=!0,x(P=>P>0?P-1:P);break;case"Enter":if(f.preventDefault(),f.stopPropagation(),d>=0&&d<s.length){const P=o(s[d]);R(P===j?"":P),w(!1)}break;case"Home":f.preventDefault(),f.stopPropagation(),M.current=!0,x(0);break;case"End":f.preventDefault(),f.stopPropagation(),M.current=!0,x(s.length-1);break}};return i.addEventListener("keydown",c,{capture:!0}),()=>i.removeEventListener("keydown",c,{capture:!0})},[s,d,j,R,w,o]);const A=t.useMemo(()=>{const i=new Map;return s.forEach((c,f)=>{i.set(o(c),f)}),i},[s,o]),z=t.useCallback(i=>{const c=A.get(i);c!==void 0&&x(c)},[A]),G=t.useCallback(i=>(A.get(i)??0)+1,[A]),U=s.length,p=t.useMemo(()=>({activeValue:T,onItemPointerMove:z,idPrefix:N,filteredCount:U,getItemPosition:G}),[T,z,N,U,G]),O=T!=null?`${N}item-${T}`:void 0;return t.useEffect(()=>(E(O),()=>E(void 0)),[O,E]),s.length===0?a.jsx("div",{ref:I,className:L.cn("max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",v),"data-hook":C,"data-slot":"combobox-virtual-list",role:"listbox",children:g}):a.jsx(K.Provider,{value:p,children:a.jsx("div",{ref:I,className:L.cn("max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",v),"data-hook":C,"data-slot":"combobox-virtual-list",role:"listbox",children:a.jsx("div",{className:"relative w-full",style:{height:`${S.getTotalSize()}px`},children:S.getVirtualItems().map(i=>a.jsx("div",{ref:S.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":i.index,style:{transform:`translateY(${i.start}px)`},children:l(s[i.index],i.index,h)},i.key))})})})}const fe=t.forwardRef(de),Z=t.forwardRef((e,o)=>a.jsx(_.CommandEmpty,{ref:o,"data-slot":"combobox-empty",...e}));Z.displayName="ComboboxEmpty";const ee=t.forwardRef(({children:e,...o},r)=>{const n=t.useRef(null);return Y.useDevWarning(()=>n.current?n.current.querySelectorAll('[data-slot="combobox-item"]').length>=100:!1,`ComboboxGroup contains 100+ items. Use <ComboboxVirtualList> for large datasets to avoid DOM bloat and slow renders.
4
+ Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox"`,[e]),a.jsx(_.CommandGroup,{ref:u=>{n.current=u,typeof r=="function"?r(u):r&&(r.current=u)},"data-slot":"combobox-group",...o,children:e})});ee.displayName="ComboboxGroup";function be(e,o,r){if(!o||!o.trim())return e;const n=new RegExp(`(${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),u=e.split(n);return a.jsx("span",{children:u.map((b,l)=>l%2===1?a.jsx("span",{className:r,children:b},l):a.jsx(t.Fragment,{children:b},l))})}const te=t.forwardRef(({value:e,label:o,dataHook:r,children:n,className:u,highlight:b,highlightClassName:l,keywords:g,...v},C)=>{const{value:F,onValueChange:I,setOpen:j,registerItem:R,unregisterItem:w}=$(),y=t.useContext(K),h=F===e,m=t.useMemo(()=>o||(typeof n=="string"?n:typeof n=="number"?String(n):e),[o,n,e]),E=t.useRef(R),D=t.useRef(w);t.useEffect(()=>{E.current=R,D.current=w},[R,w]);const k=!!y;t.useEffect(()=>{if(!k)return E.current(e,m),()=>D.current(e)},[e,m,k]);const d=()=>{I(e===F?"":e),j(!1)},x=()=>b&&typeof n=="string"?be(n,b,l||"text-sm leading-normal font-semibold"):n;if(y){const N=y.activeValue===e,s=!!v.disabled;return a.jsxs("div",{ref:C,"aria-disabled":s||void 0,"aria-posinset":y.getItemPosition(e),"aria-selected":h,"aria-setsize":y.filteredCount,className:L.cn("data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none","[&_svg]:pointer-events-none [&_svg]:shrink-0",s&&"pointer-events-none opacity-50",u),"data-highlighted":N||void 0,"data-hook":r,"data-slot":"combobox-item",id:`${y.idPrefix}item-${e}`,role:"option",tabIndex:-1,onClick:s?void 0:d,onKeyDown:s?void 0:S=>{(S.key==="Enter"||S.key===" ")&&d()},onPointerMove:s?void 0:()=>y.onItemPointerMove(e),children:[x(),h&&a.jsx(H.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})}return a.jsxs(_.CommandItem,{ref:C,className:L.cn("justify-between",u),"data-slot":"combobox-item",dataHook:r,keywords:g?[m,...g]:[m],value:e,onSelect:d,...v,children:[x(),h&&a.jsx(H.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});te.displayName="ComboboxItem";const oe=t.forwardRef((e,o)=>a.jsx(_.CommandSeparator,{ref:o,"data-slot":"combobox-separator",...e}));oe.displayName="ComboboxSeparator";function me({className:e,children:o}){return a.jsx("div",{"aria-live":"polite",className:L.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",e),"data-slot":"combobox-loading",role:"status",children:o||a.jsxs(a.Fragment,{children:[a.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=ie;exports.ComboboxContent=le;exports.ComboboxEmpty=Z;exports.ComboboxGroup=ee;exports.ComboboxInput=V;exports.ComboboxItem=te;exports.ComboboxList=X;exports.ComboboxLoading=me;exports.ComboboxSeparator=oe;exports.ComboboxTrigger=Q;exports.ComboboxValue=ue;exports.ComboboxVirtualList=fe;
@@ -78,8 +78,22 @@ export interface ComboboxValueProps {
78
78
  placeholder?: string;
79
79
  /** Custom className */
80
80
  className?: string;
81
+ /**
82
+ * Resolve a display label for the selected value. Called when the internal
83
+ * label registry doesn't have a match (e.g. before the popover opens for
84
+ * the first time with a pre-selected value).
85
+ *
86
+ * @example
87
+ * ```tsx
88
+ * <ComboboxValue
89
+ * placeholder="Select country..."
90
+ * displayValue={(v) => countriesMap.get(v)?.name}
91
+ * />
92
+ * ```
93
+ */
94
+ displayValue?: (value: string) => string | undefined;
81
95
  }
82
- declare function ComboboxValue({ placeholder, className }: ComboboxValueProps): import("react/jsx-runtime").JSX.Element;
96
+ declare function ComboboxValue({ placeholder, className, displayValue, }: ComboboxValueProps): import("react/jsx-runtime").JSX.Element;
83
97
  export interface ComboboxContentProps {
84
98
  /** Data hook for automated testing */
85
99
  dataHook?: string;
@@ -124,21 +138,28 @@ declare const ComboboxInput: React.ForwardRefExoticComponent<Omit<ComboboxInputP
124
138
  export type ComboboxListProps = React.ComponentProps<typeof CommandList>;
125
139
  declare const ComboboxList: React.ForwardRefExoticComponent<Omit<Omit<import('@brightlocal/ui-components/command').CommandListProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
126
140
  export interface ComboboxVirtualListProps<T> {
127
- /** Array of items to virtualise */
141
+ /** Array of items to virtualise. Memoize with useMemo to avoid re-registering labels on every render. */
128
142
  items: T[];
129
143
  /** Extract the string value for each item (used for selection and keyboard navigation) */
130
144
  getItemValue: (item: T) => string;
131
145
  /**
132
- * Extract a display label for filtering. Defaults to `getItemValue`.
146
+ * Extract a display label for filtering and trigger display. Defaults to `getItemValue`.
133
147
  * Only used when `shouldFilter` is true on the parent Combobox.
134
148
  */
135
149
  getItemLabel?: (item: T) => string;
150
+ /**
151
+ * Extract additional keywords to match against when filtering.
152
+ * The item label is always included automatically — these are extras
153
+ * (e.g. ISO codes, abbreviations) that should be searchable without
154
+ * appearing in the trigger display.
155
+ */
156
+ getItemKeywords?: (item: T) => string[];
136
157
  /** Estimated item height in pixels. @default 36 */
137
158
  estimateSize?: number;
138
159
  /** Number of items to render above and below the visible area. @default 5 */
139
160
  overscan?: number;
140
- /** Render function for each item */
141
- children: (item: T, index: number) => React.ReactNode;
161
+ /** Render function for each item. The third argument is the current search query, useful for highlighting matching text. */
162
+ children: (item: T, index: number, searchValue: string) => React.ReactNode;
142
163
  /** Content to render when no items match the filter */
143
164
  renderEmpty?: React.ReactNode;
144
165
  /** Custom className for the scrollable container */
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAwE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,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;;;;;OAKG;IACH,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,iBAAS,QAAQ,CAAC,EAChB,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,uBAAuB,EACtC,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,sBAAsB,EACpC,YAAmB,EACnB,QAAgB,EAChB,iBAAiB,EACjB,QAAQ,GACT,EAAE,aAAa,2CAiJf;AAuCD,MAAM,WAAW,oBA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