@bazza-ui/react 0.0.0 → 0.1.0-canary.2

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.
Files changed (81) hide show
  1. package/dist/ListboxStore-BtcTXpzi.d.cts +351 -0
  2. package/dist/ListboxStore-DPqpLlAL.d.ts +351 -0
  3. package/dist/adapters/index.cjs +2 -0
  4. package/dist/adapters/index.cjs.map +1 -0
  5. package/dist/adapters/index.d.cts +363 -0
  6. package/dist/adapters/index.d.ts +363 -0
  7. package/dist/adapters/index.js +2 -0
  8. package/dist/adapters/index.js.map +1 -0
  9. package/dist/chunk-4C666HHU.js +2 -0
  10. package/dist/chunk-4C666HHU.js.map +1 -0
  11. package/dist/chunk-AVZ64JQ3.js +2 -0
  12. package/dist/chunk-AVZ64JQ3.js.map +1 -0
  13. package/dist/chunk-BGJJC6GX.cjs +2 -0
  14. package/dist/chunk-BGJJC6GX.cjs.map +1 -0
  15. package/dist/chunk-FWWOE2SW.cjs +2 -0
  16. package/dist/chunk-FWWOE2SW.cjs.map +1 -0
  17. package/dist/chunk-JSPKF52O.cjs +2 -0
  18. package/dist/chunk-JSPKF52O.cjs.map +1 -0
  19. package/dist/chunk-KWGD24VS.js +2 -0
  20. package/dist/chunk-KWGD24VS.js.map +1 -0
  21. package/dist/chunk-M4G6J7DP.cjs +2 -0
  22. package/dist/chunk-M4G6J7DP.cjs.map +1 -0
  23. package/dist/chunk-WKAPAKUL.js +2 -0
  24. package/dist/chunk-WKAPAKUL.js.map +1 -0
  25. package/dist/combobox/index.cjs +2 -0
  26. package/dist/combobox/index.cjs.map +1 -0
  27. package/dist/combobox/index.d.cts +1039 -0
  28. package/dist/combobox/index.d.ts +1039 -0
  29. package/dist/combobox/index.js +2 -0
  30. package/dist/combobox/index.js.map +1 -0
  31. package/dist/command-score-Dgo3ZS3Z.d.ts +36 -0
  32. package/dist/command-score-YjNr3ZWi.d.cts +36 -0
  33. package/dist/context-menu/index.cjs +2 -0
  34. package/dist/context-menu/index.cjs.map +1 -0
  35. package/dist/context-menu/index.d.cts +658 -0
  36. package/dist/context-menu/index.d.ts +658 -0
  37. package/dist/context-menu/index.js +2 -0
  38. package/dist/context-menu/index.js.map +1 -0
  39. package/dist/data-surface-B-eIGTBi.d.cts +678 -0
  40. package/dist/data-surface-D1OilMDu.d.ts +678 -0
  41. package/dist/dropdown-menu/index.cjs +2 -0
  42. package/dist/dropdown-menu/index.cjs.map +1 -0
  43. package/dist/dropdown-menu/index.d.cts +700 -0
  44. package/dist/dropdown-menu/index.d.ts +700 -0
  45. package/dist/dropdown-menu/index.js +2 -0
  46. package/dist/dropdown-menu/index.js.map +1 -0
  47. package/dist/events-BPr8sRGH.d.cts +166 -0
  48. package/dist/events-BPr8sRGH.d.ts +166 -0
  49. package/dist/input-BoIK003I.d.cts +41 -0
  50. package/dist/input-DF7D8YzW.d.ts +41 -0
  51. package/dist/internal/listbox/index.cjs +2 -0
  52. package/dist/internal/listbox/index.cjs.map +1 -0
  53. package/dist/internal/listbox/index.d.cts +269 -0
  54. package/dist/internal/listbox/index.d.ts +269 -0
  55. package/dist/internal/listbox/index.js +2 -0
  56. package/dist/internal/listbox/index.js.map +1 -0
  57. package/dist/internal/popup-menu/index.cjs +2 -0
  58. package/dist/internal/popup-menu/index.cjs.map +1 -0
  59. package/dist/internal/popup-menu/index.d.cts +846 -0
  60. package/dist/internal/popup-menu/index.d.ts +846 -0
  61. package/dist/internal/popup-menu/index.js +2 -0
  62. package/dist/internal/popup-menu/index.js.map +1 -0
  63. package/dist/item-equality-B6TbXlBT.d.cts +7 -0
  64. package/dist/item-equality-B6TbXlBT.d.ts +7 -0
  65. package/dist/loading-DphSt8MY.d.cts +27 -0
  66. package/dist/loading-TsgH6v92.d.ts +27 -0
  67. package/dist/select/index.cjs +2 -0
  68. package/dist/select/index.cjs.map +1 -0
  69. package/dist/select/index.d.cts +927 -0
  70. package/dist/select/index.d.ts +927 -0
  71. package/dist/select/index.js +2 -0
  72. package/dist/select/index.js.map +1 -0
  73. package/dist/separator-B4Ot84B0.d.ts +748 -0
  74. package/dist/separator-BmbUeeaT.d.cts +748 -0
  75. package/dist/types-9vS1uLIK.d.cts +1557 -0
  76. package/dist/types-lQCIvWW8.d.ts +1557 -0
  77. package/dist/use-listbox-item-BIi4eRPI.d.cts +182 -0
  78. package/dist/use-listbox-item-BIi4eRPI.d.ts +182 -0
  79. package/package.json +50 -12
  80. package/dist/index.d.ts +0 -2
  81. package/dist/index.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{a as Qe,b as Ze,c as et,d as tt}from"../chunk-AVZ64JQ3.js";import{$ as je,L as De,N as ze,P as Oe,Qa as Je,Ra as $e,Sa as Ke,_ as Ne,aa as Ot,da as Fe,ea as qe,ha as W,ia as L,ja as Ge,l as te,oa as We,pa as Be,qa as Nt,sa as Ue,wa as _e,xa as Xe,ya as Ye}from"../chunk-WKAPAKUL.js";import{o as kt,p as At,v as Ht,w as Dt,x as zt}from"../chunk-KWGD24VS.js";import{a as wt}from"../chunk-4C666HHU.js";var st={};wt(st,{Arrow:()=>ze,Backdrop:()=>Oe,Empty:()=>We,Group:()=>Je,GroupLabel:()=>$e,Icon:()=>Ge,Input:()=>Be,Item:()=>fe,ItemIndicator:()=>Se,ItemLabel:()=>ge,List:()=>Ue,Popup:()=>Pe,Portal:()=>je,Positioner:()=>be,Root:()=>he,ScrollDownArrow:()=>Xe,ScrollUpArrow:()=>_e,Separator:()=>Ke,Surface:()=>Ve,Trigger:()=>Ce,Value:()=>Ie});import{useRender as qt}from"@base-ui/react/use-render";import*as I from"react";import*as $ from"react";var oe=$.createContext(null);function T(){let n=$.useContext(oe);if(!n)throw new Error("Select components must be used within a Select.Root");return n}function jt(){return $.useContext(oe)}var B={slot:"bazzaui-select-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected"};import*as K from"react";var ne=K.createContext(null);function Q(){let n=K.useContext(ne);if(!n)throw new Error("Select.Item child components must be used within a Select.Item");return n}function Ft(){return K.useContext(ne)}import{jsx as Ut}from"react/jsx-runtime";var Gt={highlighted:n=>n?{[B.highlighted]:""}:null,disabled:n=>n?{[B.disabled]:""}:null,selected:n=>n?{[B.selected]:""}:null};function Wt(n,u){if(n)return Array.isArray(n)?n.find(i=>i.value===u)?.label:n[u]}function Bt(n,u){let{value:s,textValue:i,keywords:m,disabled:o=!1,onSelect:l,forceMount:x=!1,render:e,className:r,style:v,onClick:c,onPointerDown:d,onPointerMove:S,children:p,...a}=n,t=T(),f=I.useMemo(()=>L(s,t.itemToStringValue),[s,t.itemToStringValue]),P=I.useMemo(()=>Wt(t.items,f),[t.items,f]),h=I.useMemo(()=>W(s,t.itemToStringLabel),[s,t.itemToStringLabel]),V=I.useMemo(()=>{if(i!==void 0)return i;if(typeof P=="string")return P;if(h&&h!==f)return h},[i,P,h,f]),y=I.useMemo(()=>{let R=typeof P=="string"?P:h&&h!==f?h:void 0;return R?m?m.includes(R)?m:[...m,R]:[R]:m},[m,P,h,f]),A=I.useRef(V),E=t.multiple?et(t.values,s,t.isItemEqualToValue):t.value!=null&&t.value!==""&&Ze(t.value,s,t.isItemEqualToValue),D=!t.multiple,b=qe({value:f,keywords:y,disabled:o,forceMount:x,closeOnClick:D,children:p});I.useEffect(()=>{let R=()=>{if(!o){if(t.multiple){let H=E?tt(t.values,s,t.isItemEqualToValue):[...t.values,s];t.onValuesChange(H)}else t.onValueChange(s);l?.()}};return b.registerSelect(R)},[o,t,s,E,l,b]),I.useEffect(()=>{let R=A.current;if(R)return t.registerItemText(f,R)},[f,t]),I.useEffect(()=>{!V&&typeof p=="string"&&(A.current=p,t.registerItemText(f,p))},[p,V,f,t]);let X=I.useMemo(()=>({highlighted:b.isHighlighted,disabled:o,selected:E}),[b.isHighlighted,o,E]),w=I.useMemo(()=>({id:b.id,value:s,textValue:V,highlighted:b.isHighlighted,disabled:o,selected:E}),[b.id,s,V,b.isHighlighted,o,E]),N=I.useCallback(R=>{c?.(R),R.defaultPrevented||b.handlers.onClick(R)},[c,b.handlers]),j=I.useCallback(R=>{b.handlers.onPointerDown(R),d?.(R)},[b.handlers,d]),F=I.useCallback(R=>{S?.(R),R.defaultPrevented||b.handlers.onPointerMove(R)},[S,b.handlers]),q=qt({render:e,ref:[b.ref,u],state:X,stateAttributesMapping:Gt,props:{...a,[B.slot]:"",id:b.id,role:"option",tabIndex:-1,"aria-selected":E,"aria-disabled":o||void 0,className:r,style:v,onClick:N,onPointerMove:F,onPointerDown:j,children:p},enabled:b.isVisible,defaultTagName:"div"});return b.isVisible?Ut(ne.Provider,{value:w,children:q}):null}var fe=I.forwardRef(Bt);import{useRender as _t}from"@base-ui/react/use-render";import*as re from"react";var le={slot:"bazzaui-select-item-indicator",selected:"data-selected"};var Xt={selected:n=>n?{[le.selected]:""}:null},Se=re.forwardRef(function(u,s){let{render:i,className:m,style:o,forceMount:l=!1,keepMounted:x=!1,children:e,...r}=u,c=Q().selected,d=re.useMemo(()=>({selected:c}),[c]),S=l||x||c,p=typeof e=="function"?e(d):x&&!c?null:e,a=_t({render:i,ref:s,state:d,stateAttributesMapping:Xt,props:{...r,[le.slot]:"","aria-hidden":!0,className:m,style:o,children:p},defaultTagName:"span"});return S?a:null});import{useRender as Yt}from"@base-ui/react/use-render";import*as k from"react";var ot={slot:"bazzaui-select-item-label"};function Jt(n,u){if(n)return Array.isArray(n)?n.find(i=>i.value===u)?.label:n[u]}var ge=k.forwardRef(function(u,s){let{render:i,className:m,style:o,children:l,...x}=u,e=T(),r=Q(),v=k.useRef(null),c=L(r.value,e.itemToStringValue),d=k.useMemo(()=>{if(l!==void 0)return l;let a=Jt(e.items,c);return a!==void 0?a:r.textValue!==void 0?r.textValue:c},[l,e.items,c,r.textValue]),S=k.useMemo(()=>({value:c,selected:r.selected,highlighted:r.highlighted,disabled:r.disabled}),[c,r.selected,r.highlighted,r.disabled]);k.useEffect(()=>{if(typeof d=="string")return e.registerItemText(c,d)},[d,e,c]);let p=k.useCallback(a=>{v.current=a,r.selected&&a&&(e.selectedItemTextRef.current=a),a&&!r.disabled&&(e.firstItemTextRef.current||(e.firstItemTextRef.current=a))},[r.selected,r.disabled,e]);return Yt({render:i,ref:s,state:S,props:{...x,[ot.slot]:"",ref:p,className:m,style:o,children:d},defaultTagName:"span"})});import"@base-ui/react/popover";import*as se from"react";import*as ae from"react";var xe=ae.createContext(null);function Z(){return ae.useContext(xe)}import{jsx as $t}from"react/jsx-runtime";var Pe=se.forwardRef(function(u,s){let{className:i,...m}=u,l=Z()?.alignItemWithTriggerActive??!1,x=se.useMemo(()=>typeof i=="function"?e=>{let r={...e,alignItemWithTriggerActive:l};return i(r)}:i,[i,l]);return $t(Ne,{ref:s,className:x,"data-align-item-with-trigger":l?"":void 0,...m})});import{Popover as Kt}from"@base-ui/react/popover";import*as M from"react";var Re={slot:"bazzaui-select-positioner"};import{jsx as lt}from"react/jsx-runtime";var U=10,Qt=100,nt=20;function Zt(n){let{triggerElement:u,positioner:s,valueElement:i,itemText:m}=n,o=u.getBoundingClientRect(),l=s.getBoundingClientRect(),x=document.documentElement.clientHeight,e=document.documentElement.clientWidth,r=o.top<nt,v=o.bottom>x-nt,c=l.height<Qt;if(r||v||c)return{shouldFallback:!0,left:0,top:0};if(!m)return{shouldFallback:!0,left:0,top:0};let d=0,S=0;if(m&&i){let h=i.getBoundingClientRect(),V=m.getBoundingClientRect(),y=h.left-o.left,A=V.left-l.left;d=y-A;let E=h.top+h.height/2,D=V.top-l.top+V.height/2;S=E-l.top-D}let p=o.left+d,a=l.top+S,t=e-l.width-U,f=x-l.height-U;p=Math.max(U,Math.min(p,t)),a=Math.max(U,Math.min(a,f));let P=x-2*U;return l.height>P?{shouldFallback:!1,left:p,top:U,maxHeight:P}:{shouldFallback:!1,left:p,top:a}}var be=M.forwardRef(function(u,s){let{alignItemWithTrigger:i=!0,side:m="bottom",align:o="start",sideOffset:l=0,className:x,style:e,children:r,...v}=u,c=te(),d=T(),S=c.store.useState("open"),[p,a]=M.useState(i),[t,f]=M.useState({positioned:!1}),P=M.useRef(null),h=M.useRef(null),V=M.useRef(null),y=M.useCallback(()=>{a(i),f({positioned:!1})},[i]);M.useEffect(()=>d.registerResetPositioningCallback(y),[d,y]),M.useLayoutEffect(()=>{if(!S||!p||t.positioned)return;let w=P.current,N=d.triggerRef.current,j=d.valueRef.current,F=d.selectedItemTextRef.current,q=d.firstItemTextRef.current;if(!w||!N)return;let H=Zt({triggerElement:N,positioner:w,valueElement:j,itemText:F??q});if(H.shouldFallback){a(!1),f({positioned:!0});return}f({positioned:!0,left:H.left,top:H.top,maxHeight:H.maxHeight})},[S,p,t.positioned,d]);let A=p?"none":m,E=M.useMemo(()=>({alignItemWithTriggerActive:p,side:A,align:o,scrollUpArrowRef:h,scrollDownArrowRef:V,setAlignItemWithTriggerActive:a,resetPositioningState:y}),[p,A,o,y]),D=M.useCallback(w=>{P.current=w,typeof s=="function"?s(w):s&&(s.current=w)},[s]),b=S&&p&&!t.positioned,X=p&&t.positioned?{position:"fixed",left:t.left,top:t.top,...t.maxHeight?{maxHeight:t.maxHeight}:{}}:{};return lt(xe.Provider,{value:E,children:lt(Kt.Positioner,{ref:D,side:p?void 0:m,align:p?void 0:o,sideOffset:p?0:l,className:x,style:{...e,...X,...b?{visibility:"hidden"}:{}},[Re.slot]:"",...v,children:r})})});import{Popover as eo}from"@base-ui/react/popover";import*as g from"react";import{jsx as ee,jsxs as to}from"react/jsx-runtime";function he(n){let{open:u,onOpenChange:s,onOpenChangeComplete:i,actionsRef:m,defaultOpen:o=!1,value:l,defaultValue:x,onValueChange:e,multiple:r=!1,values:v,defaultValues:c,onValuesChange:d,isItemEqualToValue:S=Qe,itemToStringLabel:p,itemToStringValue:a,name:t,form:f,required:P,disabled:h=!1,placeholder:V="Select...",items:y,modal:A=!0,virtualized:E=!1,virtualItems:D,onHighlightChange:b,debug:X,children:w,...N}=n,j=g.useId(),F=g.useRef(null),q=g.useRef(null),R=g.useRef(null),H=g.useRef(null),ve=g.useCallback(C=>{F.current=C},[]),Me=g.useCallback(C=>{q.current=C},[]),ce=g.useRef(null),Te=g.useCallback(C=>(ce.current=C,()=>{ce.current=null}),[]),{store:pe,focusOwnerStore:xt,openChainStore:Pt,registerSurface:Rt,closeAll:bt,virtualization:ht,handleOpenChange:ye,disabled:me,setDisabled:Ee}=De({onOpenChange:s,defaultOpen:o,virtualized:E,items:D,onHighlightChange:b,disabled:h}),de=g.useRef(null);g.useImperativeHandle(m,()=>({close:()=>{de.current?.close()},unmount:()=>{de.current?.unmount()},setDisabled:Ee}),[Ee]),pe.useControlledProp("open",u,o);let Vt=pe.useState("open"),[Ct,It]=g.useState(x!==void 0?x:null),Y=l!==void 0?l:Ct,Le=g.useCallback(C=>{l===void 0&&It(C),e?.(C)},[l,e]),[vt,Mt]=g.useState(c??[]),J=v!==void 0?v:vt,we=g.useCallback(C=>{v===void 0&&Mt(C),d?.(C)},[v,d]),ke=g.useRef(new Map),Ae=g.useCallback((C,G)=>(ke.current.set(C,G),()=>{}),[]),Tt=g.useMemo(()=>({multiple:r,value:Y,values:J,onValueChange:Le,onValuesChange:we,isItemEqualToValue:S,itemToStringLabel:p,itemToStringValue:a,name:t,form:f,required:P,disabled:me,placeholder:V,items:y,itemTextRegistry:ke.current,registerItemText:Ae,listId:j,triggerRef:F,valueRef:q,selectedItemTextRef:R,firstItemTextRef:H,setTriggerElement:ve,setValueElement:Me,registerResetPositioningCallback:Te}),[r,Y,J,Le,we,S,p,a,t,f,P,me,V,y,Ae,j,ve,Me,Te]),yt=g.useMemo(()=>t?r?J.length>0?J.map((C,G)=>{let He=L(C,a);return ee("input",{type:"hidden",name:t,value:He,form:f,required:P&&G===0},He)}):ee("input",{type:"hidden",name:t,value:"",form:f,required:P}):ee("input",{type:"hidden",name:t,value:Y!=null?L(Y,a):"",form:f,required:P}):null,[t,f,P,r,Y,J,a]),Et=g.useCallback((C,G)=>{ye(C,G.reason,G.event)},[ye]),Lt=g.useCallback(C=>{C||(ce.current?.(),H.current=null),i?.(C)},[i]);return ee(oe.Provider,{value:Tt,children:to(Fe,{store:pe,focusOwnerStore:xt,openChainStore:Pt,disabled:me,depth:0,closeAll:bt,registerSurface:Rt,virtualization:ht,menuType:"dropdown",componentName:"select",debug:X,children:[yt,ee(eo.Root,{...N,open:Vt,onOpenChange:Et,onOpenChangeComplete:Lt,modal:A,actionsRef:m?de:void 0,children:w})]})})}import*as ie from"react";var rt={slot:"bazzaui-select-surface"};import{jsx as oo}from"react/jsx-runtime";var Ve=ie.forwardRef(function(u,s){let{autoHighlightFirst:i,...m}=u,o=T(),l=Z(),x=ie.useMemo(()=>{let e=r=>r==null||r===""?!0:L(r,o.itemToStringValue);if(i==="selected"){let r=o.multiple?o.values[0]:o.value;return e(r)}if(i!==void 0)return i;if(l?.alignItemWithTriggerActive){let r=o.multiple?o.values[0]:o.value;return e(r)}return!0},[i,l?.alignItemWithTriggerActive,o.multiple,o.value,o.values,o.itemToStringValue]);return oo(Ye,{ref:s,autoHighlightFirst:x,[rt.slot]:"",...m})});import{Popover as no}from"@base-ui/react/popover";import{useRender as lo}from"@base-ui/react/use-render";import*as z from"react";var _={slot:"bazzaui-select-trigger",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};import{jsx as at}from"react/jsx-runtime";var ro={open:n=>n?{[_.open]:""}:null,disabled:n=>n?{[_.disabled]:""}:null,placeholder:n=>n?{[_.placeholder]:""}:null},ao=z.forwardRef(function(u,s){let{render:i,children:m,disabled:o,className:l,style:x,triggerProps:e,triggerState:r,...v}=u,c=T(),d=o??c.disabled,S=c.multiple?c.values.length>0:c.value!=null&&c.value!=="",p=z.useMemo(()=>({open:r.open,disabled:d,placeholder:!S}),[r.open,d,S]),a=z.useCallback(t=>{c.setTriggerElement(t)},[c]);return lo({render:i,ref:s,state:p,stateAttributesMapping:ro,props:{...e,...v,[_.slot]:"",ref:a,role:"combobox","aria-haspopup":"listbox","aria-controls":c.listId,className:l,style:x,children:m},defaultTagName:"button"})}),Ce=z.forwardRef(function(u,s){let{disabled:i,...m}=u,o=T(),l=te(),x=(i??o.disabled)||l.disabled;return at(no.Trigger,{ref:s,disabled:x,render:(e,r)=>at(ao,{...m,disabled:x,triggerProps:e,triggerState:r,ref:e.ref})})});import{useRender as so}from"@base-ui/react/use-render";import*as O from"react";var ue={slot:"bazzaui-select-value",placeholder:"data-placeholder",multiple:"data-multiple"};var io={hasValue:n=>n?null:{[ue.placeholder]:""},multiple:n=>n?{[ue.multiple]:""}:null,getValueText:()=>null};function uo(n,u){let{render:s,className:i,style:m,placeholder:o,children:l,...x}=n,e=T(),r=o??e.placeholder,v=e.multiple?e.values.length>0:!!e.value,c=O.useCallback(a=>{let t=L(a,e.itemToStringValue),f=e.itemTextRegistry.get(t);if(f!==void 0)return f;let P=e.items;if(P)if(Array.isArray(P)){let V=P.find(y=>y.value===t);if(V?.label!==void 0)return V.label}else{let V=P[t];if(V!==void 0)return V}let h=W(a,e.itemToStringLabel);if(h&&h!==t)return h},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),d=O.useMemo(()=>({value:e.value,values:e.values,multiple:e.multiple,hasValue:v,placeholder:r,getValueText:c}),[e.value,e.values,e.multiple,v,r,c]),S;if(typeof l=="function")S=l(d);else if(l!==void 0)S=l;else if(!v)S=r;else if(e.multiple){let a=e.values.map(t=>{let f=c(t);return f!==void 0?f:W(t,e.itemToStringLabel)||L(t,e.itemToStringValue)}).filter(Boolean);S=a.length>2?`${a.length} selected`:a.join(", ")}else{let a=e.value;if(a!=null){let t=c(a);t!==void 0?S=t:S=W(a,e.itemToStringLabel)||L(a,e.itemToStringValue)}}let p=O.useCallback(a=>{e.setValueElement(a)},[e]);return so({render:s,ref:u,state:d,stateAttributesMapping:io,props:{...x,[ue.slot]:"",ref:p,className:i,style:m,children:S},defaultTagName:"span"})}var Ie=O.forwardRef(uo);var it=(l=>(l.slot="bazzaui-select-arrow",l.open="data-open",l.closed="data-closed",l.side="data-side",l.align="data-align",l.uncentered="data-uncentered",l))(it||{});var ut=(o=>(o.slot="bazzaui-select-backdrop",o.open="data-open",o.closed="data-closed",o.startingStyle="data-starting-style",o.endingStyle="data-ending-style",o))(ut||{});var ct=(u=>(u.slot="bazzaui-select-empty",u))(ct||{});var pt=(u=>(u.slot="bazzaui-select-group",u))(pt||{});var mt=(u=>(u.slot="bazzaui-select-group-label",u))(mt||{});var co={slot:"bazzaui-select-icon",open:"data-popup-open"};var dt=(i=>(i.slot="bazzaui-select-input",i.open="data-open",i.closed="data-closed",i))(dt||{});var ft=(s=>(s.slot="bazzaui-select-list",s.list="data-popup-menu-list",s))(ft||{});var St=(u=>(u.alignItemWithTrigger="data-align-item-with-trigger",u))(St||{});var po={slotUp:"bazzaui-select-scroll-up-arrow",slotDown:"bazzaui-select-scroll-down-arrow",direction:"data-direction",side:"data-side"};var gt=(u=>(u.slot="bazzaui-select-separator",u))(gt||{});export{st as Select,it as SelectArrowDataAttributes,ut as SelectBackdropDataAttributes,ct as SelectEmptyDataAttributes,pt as SelectGroupDataAttributes,mt as SelectGroupLabelDataAttributes,co as SelectIconDataAttributes,dt as SelectInputDataAttributes,fe as SelectItem,B as SelectItemDataAttributes,Se as SelectItemIndicator,le as SelectItemIndicatorDataAttributes,ge as SelectItemLabel,Nt as SelectListCssVars,ft as SelectListDataAttributes,Pe as SelectPopup,St as SelectPopupDataAttributes,be as SelectPositioner,Ot as SelectPositionerCssVars,Re as SelectPositionerDataAttributes,he as SelectRoot,po as SelectScrollArrowDataAttributes,gt as SelectSeparatorDataAttributes,zt as SelectStore,Ve as SelectSurface,Ce as SelectTrigger,_ as SelectTriggerDataAttributes,Ie as SelectValue,Ht as commandScore,Dt as defaultFilter,jt as useMaybeSelectContext,Ft as useMaybeSelectItemContext,At as useMaybeSurfaceContext,T as useSelectContext,Q as useSelectItemContext,Z as useSelectPositionerContext,kt as useSurfaceContext};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/select/index.parts.ts","../../src/select/item/item.tsx","../../src/select/contexts/select-context.ts","../../src/select/item/item.data-attrs.ts","../../src/select/item/item-context.ts","../../src/select/item-indicator/item-indicator.tsx","../../src/select/item-indicator/item-indicator.data-attrs.ts","../../src/select/item-label/item-label.tsx","../../src/select/item-label/item-label.data-attrs.ts","../../src/select/popup/popup.tsx","../../src/select/contexts/select-positioner-context.ts","../../src/select/positioner/positioner.tsx","../../src/select/positioner/positioner.data-attrs.ts","../../src/select/root/root.tsx","../../src/select/surface/surface.tsx","../../src/select/surface/surface.data-attrs.ts","../../src/select/trigger/trigger.tsx","../../src/select/trigger/trigger.data-attrs.ts","../../src/select/value/value.tsx","../../src/select/value/value.data-attrs.ts","../../src/select/arrow/arrow.data-attrs.ts","../../src/select/backdrop/backdrop.data-attrs.ts","../../src/select/empty/empty.data-attrs.ts","../../src/select/group/group.data-attrs.ts","../../src/select/group-label/group-label.data-attrs.ts","../../src/select/icon/icon.data-attrs.ts","../../src/select/input/input.data-attrs.ts","../../src/select/list/list.data-attrs.ts","../../src/select/popup/popup.data-attrs.ts","../../src/select/scroll-arrow/scroll-arrow.data-attrs.ts","../../src/select/separator/separator.data-attrs.ts"],"sourcesContent":["// ============================================================================\n// Select Parts\n// ============================================================================\n// Re-exports shared components from internal/popup-menu with Select-specific\n// Root, Trigger, Value, Item, ItemLabel, and ItemIndicator components.\n\n// Re-export VirtualItem type from internal/listbox\nexport type { VirtualItem } from '../internal/listbox/index.js'\n\n// Re-export shared components from internal/popup-menu\nexport {\n PopupMenuArrow as Arrow,\n PopupMenuBackdrop as Backdrop,\n PopupMenuEmpty as Empty,\n // Structure\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n // Trigger components\n PopupMenuIcon as Icon,\n PopupMenuInput as Input,\n PopupMenuList as List,\n // Positioning & Container\n PopupMenuPortal as Portal,\n // Scroll indicators\n PopupMenuScrollDownArrow as ScrollDownArrow,\n PopupMenuScrollUpArrow as ScrollUpArrow,\n PopupMenuSeparator as Separator,\n} from '../internal/popup-menu/index.js'\nexport { SelectItem as Item } from './item/item.js'\nexport { SelectItemIndicator as ItemIndicator } from './item-indicator/item-indicator.js'\nexport { SelectItemLabel as ItemLabel } from './item-label/item-label.js'\n// Select-specific Popup with alignItemWithTriggerActive state\nexport type { SelectPopupProps, SelectPopupState } from './popup/popup.js'\nexport { SelectPopup as Popup } from './popup/popup.js'\n// Custom Select Positioner with alignItemWithTrigger support\nexport { SelectPositioner as Positioner } from './positioner/positioner.js'\n// Select-specific components\nexport { SelectRoot as Root } from './root/root.js'\n// Select-specific Surface with alignItemWithTrigger auto-highlight support\nexport { SelectSurface as Surface } from './surface/surface.js'\nexport { SelectTrigger as Trigger } from './trigger/trigger.js'\nexport { SelectValue as Value } from './value/value.js'\n","'use client'\n\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport { usePopupMenuItem } from '../../internal/popup-menu/index.js'\nimport {\n compareItemEquality,\n itemIncludes,\n removeItem,\n} from '../../utils/item-equality.js'\nimport {\n resolveLabel,\n stringifyAsValue,\n} from '../../utils/resolve-value-label.js'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { useSelectContext } from '../contexts/select-context.js'\nimport { SelectItemDataAttributes } from './item.data-attrs.js'\nimport {\n SelectItemContext,\n type SelectItemContextValue,\n} from './item-context.js'\n\nexport { SelectItemDataAttributes }\n\nexport interface SelectItemState extends Record<string, unknown> {\n /**\n * Whether the item is highlighted (via keyboard or pointer).\n */\n highlighted: boolean\n /**\n * Whether the item is disabled.\n */\n disabled: boolean\n /**\n * Whether the item is currently selected.\n */\n selected: boolean\n}\n\nexport interface SelectItemProps<Value = unknown>\n extends ComponentProps<'div', SelectItem.State> {\n /**\n * The value of this item. Required and must be unique within the Select.\n * Can be a primitive or an object.\n */\n value: Value\n\n /**\n * Text value to use for display in Select.Value when this item is selected.\n * If not provided, the text content of the item will be used.\n * For object values, this can be auto-detected from `{ label }` shape.\n */\n textValue?: string\n\n /**\n * Additional keywords to match against when filtering.\n * Useful for aliases or synonyms.\n */\n keywords?: string[]\n\n /**\n * Whether this item is disabled.\n * Disabled items are not selectable and are skipped during keyboard navigation.\n */\n disabled?: boolean\n\n /**\n * Callback when this item is selected.\n */\n onSelect?: () => void\n\n /**\n * Whether to force render this item regardless of filter results.\n * @default false\n */\n forceMount?: boolean\n}\n\nconst stateAttributesMapping = {\n highlighted: (value: unknown): Record<string, string> | null =>\n value ? { [SelectItemDataAttributes.highlighted]: '' } : null,\n disabled: (value: unknown): Record<string, string> | null =>\n value ? { [SelectItemDataAttributes.disabled]: '' } : null,\n selected: (value: unknown): Record<string, string> | null =>\n value ? { [SelectItemDataAttributes.selected]: '' } : null,\n}\n\n/**\n * Helper to resolve label from items prop (for legacy string-keyed items)\n */\nfunction resolveLabelFromItems(\n items:\n | Record<string, React.ReactNode>\n | Array<{ value: string; label: React.ReactNode }>\n | undefined,\n value: string,\n): React.ReactNode | undefined {\n if (!items) return undefined\n\n if (Array.isArray(items)) {\n const item = items.find((i) => i.value === value)\n return item?.label\n }\n\n return items[value]\n}\n\n/**\n * A selectable item in the select dropdown.\n * Renders a `<div>` element with role=\"option\".\n *\n * @template Value - The type of the item value (can be a primitive or object)\n */\nfunction SelectItemImpl<Value = unknown>(\n props: SelectItemProps<Value>,\n forwardedRef: React.ForwardedRef<HTMLDivElement>,\n) {\n const {\n value,\n textValue: textValueProp,\n keywords: keywordsProp,\n disabled = false,\n onSelect,\n forceMount = false,\n render,\n className,\n style,\n onClick,\n onPointerDown,\n onPointerMove,\n children,\n ...rest\n } = props\n\n const selectContext = useSelectContext<Value>()\n\n // Serialize value for registry key and internal lookups\n const serializedValue = React.useMemo(\n () => stringifyAsValue(value, selectContext.itemToStringValue),\n [value, selectContext.itemToStringValue],\n )\n\n // Resolve label from items prop (for auto-populating textValue and keywords)\n // This works for legacy string-keyed items\n const labelFromItems = React.useMemo(\n () => resolveLabelFromItems(selectContext.items, serializedValue),\n [selectContext.items, serializedValue],\n )\n\n // Auto-resolve label from object value shape { label }\n const labelFromObjectValue = React.useMemo(\n () => resolveLabel(value, selectContext.itemToStringLabel),\n [value, selectContext.itemToStringLabel],\n )\n\n // Auto-populate textValue: explicit prop > label from items (if string) > label from object > undefined\n const textValue = React.useMemo(() => {\n if (textValueProp !== undefined) return textValueProp\n if (typeof labelFromItems === 'string') return labelFromItems\n // For object values, use the resolved label\n if (labelFromObjectValue && labelFromObjectValue !== serializedValue) {\n return labelFromObjectValue\n }\n return undefined\n }, [textValueProp, labelFromItems, labelFromObjectValue, serializedValue])\n\n // Auto-add label to keywords for search/filter\n const keywords = React.useMemo(() => {\n const labelStr =\n typeof labelFromItems === 'string'\n ? labelFromItems\n : labelFromObjectValue && labelFromObjectValue !== serializedValue\n ? labelFromObjectValue\n : undefined\n if (!labelStr) return keywordsProp\n if (!keywordsProp) return [labelStr]\n // Only add if not already included\n if (keywordsProp.includes(labelStr)) return keywordsProp\n return [...keywordsProp, labelStr]\n }, [keywordsProp, labelFromItems, labelFromObjectValue, serializedValue])\n\n const textRef = React.useRef<string | undefined>(textValue)\n\n // Track if this item is selected using custom equality\n const selected = selectContext.multiple\n ? itemIncludes(\n selectContext.values,\n value,\n selectContext.isItemEqualToValue,\n )\n : selectContext.value != null &&\n selectContext.value !== '' &&\n compareItemEquality(\n selectContext.value,\n value,\n selectContext.isItemEqualToValue,\n )\n\n // Determine close behavior: single-select closes, multi-select stays open\n const closeOnClick = !selectContext.multiple\n\n const item = usePopupMenuItem({\n value: serializedValue,\n keywords,\n disabled,\n forceMount,\n closeOnClick,\n children,\n })\n\n // Register the select handler that updates the value\n React.useEffect(() => {\n const handleSelect = () => {\n if (disabled) return\n\n if (selectContext.multiple) {\n // Toggle value in array using custom equality\n const newValues = selected\n ? removeItem(\n selectContext.values,\n value,\n selectContext.isItemEqualToValue,\n )\n : [...selectContext.values, value]\n selectContext.onValuesChange(newValues)\n } else {\n // Set single value\n selectContext.onValueChange(value)\n }\n\n onSelect?.()\n }\n return item.registerSelect(handleSelect)\n }, [disabled, selectContext, value, selected, onSelect, item])\n\n // Register item text for Select.Value display\n React.useEffect(() => {\n // Use textValue if provided, otherwise extract from children\n const text = textRef.current\n if (text) {\n return selectContext.registerItemText(serializedValue, text)\n }\n }, [serializedValue, selectContext])\n\n // Update text ref when children might have changed (for extraction)\n React.useEffect(() => {\n if (!textValue && typeof children === 'string') {\n textRef.current = children\n selectContext.registerItemText(serializedValue, children)\n }\n }, [children, textValue, serializedValue, selectContext])\n\n const state: SelectItem.State = React.useMemo(\n () => ({\n highlighted: item.isHighlighted,\n disabled,\n selected,\n }),\n [item.isHighlighted, disabled, selected],\n )\n\n const itemContextValue: SelectItemContextValue<Value> = React.useMemo(\n () => ({\n id: item.id,\n value,\n textValue,\n highlighted: item.isHighlighted,\n disabled,\n selected,\n }),\n [item.id, value, textValue, item.isHighlighted, disabled, selected],\n )\n\n // Merge user-provided handlers with item handlers\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n onClick?.(event)\n if (!event.defaultPrevented) {\n item.handlers.onClick(event)\n }\n },\n [onClick, item.handlers],\n )\n\n const handlePointerDown = React.useCallback(\n (event: React.PointerEvent<HTMLDivElement>) => {\n item.handlers.onPointerDown(event)\n onPointerDown?.(event)\n },\n [item.handlers, onPointerDown],\n )\n\n const handlePointerMove = React.useCallback(\n (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerMove?.(event)\n if (!event.defaultPrevented) {\n item.handlers.onPointerMove(event)\n }\n },\n [onPointerMove, item.handlers],\n )\n\n const element = useRender({\n render,\n ref: [item.ref, forwardedRef],\n state,\n stateAttributesMapping,\n props: {\n ...rest,\n [SelectItemDataAttributes.slot]: '',\n id: item.id,\n role: 'option',\n tabIndex: -1,\n 'aria-selected': selected,\n 'aria-disabled': disabled || undefined,\n className,\n style,\n onClick: handleClick,\n onPointerMove: handlePointerMove,\n onPointerDown: handlePointerDown,\n children,\n },\n enabled: item.isVisible,\n defaultTagName: 'div',\n })\n\n if (!item.isVisible) {\n return null\n }\n\n return (\n <SelectItemContext.Provider\n value={itemContextValue as SelectItemContextValue}\n >\n {element}\n </SelectItemContext.Provider>\n )\n}\n\nexport const SelectItem = React.forwardRef(SelectItemImpl) as <Value = unknown>(\n props: SelectItemProps<Value> & React.RefAttributes<HTMLDivElement>,\n) => React.ReactElement | null\n\nexport namespace SelectItem {\n export type State = SelectItemState\n export interface Props<Value = unknown> extends SelectItemProps<Value> {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { ItemEqualityComparer } from '../../utils/item-equality.js'\n\n// ============================================================================\n// Select Context\n// ============================================================================\n// Provides value management and form integration for Select components.\n// Separate from PopupMenuContext to handle Select-specific concerns.\n\n/**\n * Item text registry for displaying selected values.\n * Maps serialized item value to its text content.\n */\nexport type ItemTextRegistry = Map<string, string>\n\n/**\n * Context value for Select components.\n * Provides value state, callbacks, and form integration.\n *\n * @template Value - The type of the select value (can be a primitive or object)\n */\nexport interface SelectContextValue<Value = unknown> {\n // ===== Selection State =====\n /** Whether multi-select mode is enabled */\n multiple: boolean\n /** Current selected value (single-select mode) */\n value: Value | null\n /** Current selected values (multi-select mode) */\n values: Value[]\n /** Callback when value changes (single-select mode) */\n onValueChange: (value: Value) => void\n /** Callback when values change (multi-select mode) */\n onValuesChange: (values: Value[]) => void\n\n // ===== Object Value Support =====\n /**\n * Custom comparison logic used to determine if a select item value\n * matches the current selected value.\n * Useful when item values are objects without matching referentially.\n * Defaults to Object.is comparison.\n */\n isItemEqualToValue: ItemEqualityComparer<Value>\n /**\n * When the item values are objects, this function converts the object\n * value to a string representation for display in the trigger.\n * If the shape of the object is { value, label }, the label will be\n * used automatically without needing to specify this prop.\n */\n itemToStringLabel?: (itemValue: Value) => string\n /**\n * When the item values are objects, this function converts the object\n * value to a string representation for form submission.\n * If the shape of the object is { value, label }, the value will be\n * used automatically without needing to specify this prop.\n */\n itemToStringValue?: (itemValue: Value) => string\n\n // ===== Form Integration =====\n /** Form field name for submission */\n name?: string\n /** Associate with a form by ID */\n form?: string\n /** Whether this field is required */\n required?: boolean\n /** Whether the select is disabled */\n disabled: boolean\n /** Placeholder text when no value selected */\n placeholder: string\n\n // ===== Item Text Registry =====\n /** Registry of item values to their text content */\n itemTextRegistry: ItemTextRegistry\n /** Register an item's text content */\n registerItemText: (value: string, text: string) => () => void\n /**\n * Data structure of the items for label resolution.\n * Used to display labels before items mount (e.g., on initial render with defaultValue).\n * Can be a record mapping values to labels, or an array of { value, label } objects.\n */\n items?:\n | Record<string, React.ReactNode>\n | Array<{ value: string; label: React.ReactNode }>\n\n // ===== List ID for ARIA =====\n /** ID for the listbox element */\n listId: string\n\n // ===== Element Refs for Positioning =====\n /** Ref to the trigger element */\n triggerRef: React.RefObject<HTMLElement | null>\n /** Ref to the value display element (text in trigger) */\n valueRef: React.RefObject<HTMLElement | null>\n /** Ref to the selected item's text element */\n selectedItemTextRef: React.MutableRefObject<HTMLElement | null>\n /** Ref to the first item's text element (used when no selection for alignItemWithTrigger) */\n firstItemTextRef: React.MutableRefObject<HTMLElement | null>\n /** Callback to set the trigger element */\n setTriggerElement: (element: HTMLElement | null) => void\n /** Callback to set the value element */\n setValueElement: (element: HTMLElement | null) => void\n\n // ===== Positioner Callback Registration =====\n /** Register a callback to reset positioning state after close animation */\n registerResetPositioningCallback: (\n callback: (() => void) | null,\n ) => () => void\n}\n\nconst SelectContext = React.createContext<SelectContextValue<unknown> | null>(\n null,\n)\n\n/**\n * Hook to access the Select context.\n * Throws if used outside a Select.Root.\n */\nexport function useSelectContext<Value = unknown>(): SelectContextValue<Value> {\n const context = React.useContext(SelectContext)\n if (!context) {\n throw new Error('Select components must be used within a Select.Root')\n }\n return context as SelectContextValue<Value>\n}\n\n/**\n * Hook to optionally access the Select context.\n * Returns null if used outside a Select.Root.\n */\nexport function useMaybeSelectContext<\n Value = unknown,\n>(): SelectContextValue<Value> | null {\n return React.useContext(SelectContext) as SelectContextValue<Value> | null\n}\n\nexport { SelectContext }\n","export const SelectItemDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-item'}\n */\n slot: 'bazzaui-select-item',\n /**\n * Present when the item is highlighted via keyboard or pointer.\n */\n highlighted: 'data-highlighted',\n /**\n * Present when the item is disabled.\n */\n disabled: 'data-disabled',\n /**\n * Present when the item is currently selected.\n */\n selected: 'data-selected',\n} as const\n","'use client'\n\nimport * as React from 'react'\n\n// ============================================================================\n// Select Item Context\n// ============================================================================\n// Provides select-specific item state to child components.\n\nexport interface SelectItemContextValue<Value = unknown> {\n /** Unique ID for this item (for DOM id attribute) */\n id: string\n /** The value of this item */\n value: Value\n /** The text value/label for this item */\n textValue: string | undefined\n /** Whether the item is highlighted */\n highlighted: boolean\n /** Whether the item is disabled */\n disabled: boolean\n /** Whether the item is selected */\n selected: boolean\n}\n\nconst SelectItemContext = React.createContext<SelectItemContextValue | null>(\n null,\n)\n\nexport function useSelectItemContext<\n Value = unknown,\n>(): SelectItemContextValue<Value> {\n const context = React.useContext(SelectItemContext)\n if (!context) {\n throw new Error(\n 'Select.Item child components must be used within a Select.Item',\n )\n }\n return context as SelectItemContextValue<Value>\n}\n\nexport function useMaybeSelectItemContext<\n Value = unknown,\n>(): SelectItemContextValue<Value> | null {\n return React.useContext(\n SelectItemContext,\n ) as SelectItemContextValue<Value> | null\n}\n\nexport { SelectItemContext }\n","'use client'\n\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { useSelectItemContext } from '../item/item-context.js'\nimport { SelectItemIndicatorDataAttributes } from './item-indicator.data-attrs.js'\n\nexport { SelectItemIndicatorDataAttributes }\n\nexport interface SelectItemIndicatorState extends Record<string, unknown> {\n /**\n * Whether the item is selected.\n */\n selected: boolean\n}\n\nexport interface SelectItemIndicatorProps\n extends Omit<ComponentProps<'span', SelectItemIndicator.State>, 'children'> {\n /**\n * Whether to force render even when the item is not selected.\n * @default false\n */\n forceMount?: boolean\n\n /**\n * Whether to keep the element mounted even when not selected.\n * Unlike forceMount, this still conditionally renders children.\n * Useful for checkbox-style indicators where the container is always visible.\n * @default false\n */\n keepMounted?: boolean\n\n /**\n * Content to render. Can be a ReactNode or a function that receives state.\n */\n children?:\n | React.ReactNode\n | ((state: SelectItemIndicator.State) => React.ReactNode)\n}\n\nconst stateAttributesMapping = {\n selected: (value: unknown): Record<string, string> | null =>\n value ? { [SelectItemIndicatorDataAttributes.selected]: '' } : null,\n}\n\n/**\n * Indicator that shows when the item is selected.\n * Typically renders a checkmark icon.\n * Only renders when the item is selected (unless forceMount or keepMounted is true).\n * Renders a `<span>` element.\n */\nexport const SelectItemIndicator = React.forwardRef<\n HTMLSpanElement,\n SelectItemIndicator.Props\n>(function SelectItemIndicator(props, forwardedRef) {\n const {\n render,\n className,\n style,\n forceMount = false,\n keepMounted = false,\n children,\n ...rest\n } = props\n\n const itemContext = useSelectItemContext()\n const selected = itemContext.selected\n\n const state: SelectItemIndicator.State = React.useMemo(\n () => ({ selected }),\n [selected],\n )\n\n // Determine if we should render\n const shouldRender = forceMount || keepMounted || selected\n\n // For keepMounted, only render children when selected\n const content =\n typeof children === 'function'\n ? children(state)\n : keepMounted && !selected\n ? null\n : children\n\n const element = useRender({\n render,\n ref: forwardedRef,\n state,\n stateAttributesMapping,\n props: {\n ...rest,\n [SelectItemIndicatorDataAttributes.slot]: '',\n 'aria-hidden': true,\n className,\n style,\n children: content,\n },\n defaultTagName: 'span',\n })\n\n if (!shouldRender) {\n return null\n }\n\n return element\n})\n\nexport namespace SelectItemIndicator {\n export interface Props extends SelectItemIndicatorProps {}\n export type State = SelectItemIndicatorState\n}\n","export const SelectItemIndicatorDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-item-indicator'}\n */\n slot: 'bazzaui-select-item-indicator',\n /**\n * Present when the parent item is selected.\n */\n selected: 'data-selected',\n} as const\n","'use client'\n\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport { stringifyAsValue } from '../../utils/resolve-value-label.js'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { useSelectContext } from '../contexts/select-context.js'\nimport { useSelectItemContext } from '../item/item-context.js'\nimport { SelectItemLabelDataAttributes } from './item-label.data-attrs.js'\n\nexport { SelectItemLabelDataAttributes }\n\nexport interface SelectItemLabelState extends Record<string, unknown> {\n /**\n * The serialized string key for the parent item's value.\n * For object values, this is the result of `itemToStringValue` or the auto-detected `.value` property.\n */\n value: string\n /**\n * Whether the parent item is selected.\n */\n selected: boolean\n /**\n * Whether the parent item is highlighted.\n */\n highlighted: boolean\n /**\n * Whether the parent item is disabled.\n */\n disabled: boolean\n}\n\nexport interface SelectItemLabelProps\n extends ComponentProps<'span', SelectItemLabel.State> {}\n\n/**\n * Helper to resolve label from items prop\n */\nfunction resolveLabelFromItems(\n items:\n | Record<string, React.ReactNode>\n | Array<{ value: string; label: React.ReactNode }>\n | undefined,\n valueKey: string,\n): React.ReactNode | undefined {\n if (!items) return undefined\n\n if (Array.isArray(items)) {\n const item = items.find((i) => i.value === valueKey)\n return item?.label\n }\n\n return items[valueKey]\n}\n\n/**\n * The label/text content of a Select.Item.\n *\n * When no children are provided, automatically renders the label from the\n * `items` prop passed to `Select.Root`. If children are provided, they\n * override the automatic label.\n *\n * Also captures the text for display in `Select.Value` when the item is selected,\n * and provides the text element reference for `alignItemWithTrigger` positioning.\n *\n * Renders a `<span>` element.\n */\nexport const SelectItemLabel = React.forwardRef<\n HTMLSpanElement,\n SelectItemLabel.Props\n>(function SelectItemLabel(props, forwardedRef) {\n const { render, className, style, children, ...rest } = props\n\n const selectContext = useSelectContext()\n const itemContext = useSelectItemContext()\n const textRef = React.useRef<HTMLSpanElement | null>(null)\n\n // Serialize the item value to a string key for registry lookups\n const valueKey = stringifyAsValue(\n itemContext.value,\n selectContext.itemToStringValue,\n )\n\n // Resolve label content:\n // 1. Explicit children (override)\n // 2. Label from items prop lookup\n // 3. textValue from item context\n // 4. Fall back to the serialized value key\n const resolvedLabel = React.useMemo(() => {\n if (children !== undefined) {\n return children\n }\n\n const labelFromItems = resolveLabelFromItems(selectContext.items, valueKey)\n if (labelFromItems !== undefined) {\n return labelFromItems\n }\n\n if (itemContext.textValue !== undefined) {\n return itemContext.textValue\n }\n\n return valueKey\n }, [children, selectContext.items, valueKey, itemContext.textValue])\n\n // Build state for render prop and className/style functions\n const state: SelectItemLabel.State = React.useMemo(\n () => ({\n value: valueKey,\n selected: itemContext.selected,\n highlighted: itemContext.highlighted,\n disabled: itemContext.disabled,\n }),\n [\n valueKey,\n itemContext.selected,\n itemContext.highlighted,\n itemContext.disabled,\n ],\n )\n\n // Register the text content when mounted (for Select.Value display)\n React.useEffect(() => {\n if (typeof resolvedLabel === 'string') {\n return selectContext.registerItemText(valueKey, resolvedLabel)\n }\n }, [resolvedLabel, selectContext, valueKey])\n\n // Merge refs - need to track for positioning AND pass to useRender\n const mergedRef = React.useCallback(\n (node: HTMLSpanElement | null) => {\n textRef.current = node\n\n // Register this element as the selected item text for alignItemWithTrigger positioning\n if (itemContext.selected && node) {\n selectContext.selectedItemTextRef.current = node\n }\n\n // Register as the first item text for alignment fallback\n // Only set if not already set - first non-disabled item to render wins\n // The positioner will prefer selectedItemTextRef over firstItemTextRef\n if (node && !itemContext.disabled) {\n if (!selectContext.firstItemTextRef.current) {\n selectContext.firstItemTextRef.current = node\n }\n }\n },\n [itemContext.selected, itemContext.disabled, selectContext],\n )\n\n return useRender({\n render,\n ref: forwardedRef,\n state,\n props: {\n ...rest,\n [SelectItemLabelDataAttributes.slot]: '',\n ref: mergedRef,\n className,\n style,\n children: resolvedLabel,\n },\n defaultTagName: 'span',\n })\n})\n\nexport namespace SelectItemLabel {\n export interface Props extends SelectItemLabelProps {}\n export type State = SelectItemLabelState\n}\n","export const SelectItemLabelDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-item-label'}\n */\n slot: 'bazzaui-select-item-label',\n} as const\n","'use client'\n\nimport { Popover } from '@base-ui/react/popover'\nimport * as React from 'react'\nimport {\n PopupMenuPopup,\n type PopupMenuPopupState,\n} from '../../internal/popup-menu/components/popup/popup.js'\nimport { useSelectPositionerContext } from '../contexts/select-positioner-context.js'\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface SelectPopupState extends PopupMenuPopupState {\n /**\n * Whether the popup is currently using align-item-with-trigger positioning.\n * This reflects the actual state, not just the prop value - it will be false\n * if alignment couldn't be applied (e.g., not enough space, no selected item).\n */\n alignItemWithTriggerActive: boolean\n}\n\nexport interface SelectPopupProps\n extends Omit<PopupMenuPopup.Props, 'className'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: SelectPopupState) => string)\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * A container for the select popup contents.\n * Extends PopupMenuPopup with Select-specific state including alignItemWithTriggerActive.\n *\n * Renders a `<div>` element.\n */\nexport const SelectPopup = React.forwardRef<HTMLDivElement, SelectPopup.Props>(\n function SelectPopup(props, forwardedRef) {\n const { className: classNameProp, ...rest } = props\n\n // Get positioner context for alignItemWithTriggerActive\n const positionerContext = useSelectPositionerContext()\n const alignItemWithTriggerActive =\n positionerContext?.alignItemWithTriggerActive ?? false\n\n // Wrap className to include alignItemWithTriggerActive in the state\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: PopupMenuPopupState) => {\n const extendedState: SelectPopupState = {\n ...baseState,\n alignItemWithTriggerActive,\n }\n return classNameProp(extendedState)\n }\n }\n return classNameProp\n }, [classNameProp, alignItemWithTriggerActive])\n\n return (\n <PopupMenuPopup\n ref={forwardedRef}\n className={className}\n data-align-item-with-trigger={\n alignItemWithTriggerActive ? '' : undefined\n }\n {...rest}\n />\n )\n },\n)\n\nexport namespace SelectPopup {\n export type Props = SelectPopupProps\n export type State = SelectPopupState\n}\n","'use client'\n\nimport * as React from 'react'\n\n// Types matching Base UI's positioning types\nexport type Side = 'top' | 'bottom' | 'left' | 'right'\nexport type Align = 'start' | 'center' | 'end'\n\n/**\n * Context value for Select Positioner.\n * Provides alignment state for coordinating positioning behavior.\n */\nexport interface SelectPositionerContextValue {\n /**\n * Whether alignItemWithTrigger is actively being used.\n * This may be false even if the prop is true (e.g., fallback scenarios).\n */\n alignItemWithTriggerActive: boolean\n\n /**\n * The rendered side of the popup (or 'none' when using align-item-with-trigger).\n */\n side: Side | 'none'\n\n /**\n * The rendered alignment of the popup.\n */\n align: Align\n\n /**\n * Ref for the scroll up arrow element.\n */\n scrollUpArrowRef: React.RefObject<HTMLDivElement | null>\n\n /**\n * Ref for the scroll down arrow element.\n */\n scrollDownArrowRef: React.RefObject<HTMLDivElement | null>\n\n /**\n * Callback to disable alignItemWithTrigger (fallback to normal positioning).\n */\n setAlignItemWithTriggerActive: (active: boolean) => void\n\n /**\n * Callback to reset positioning state after close animation completes.\n * This preserves positioning during exit animations.\n */\n resetPositioningState: () => void\n}\n\nconst SelectPositionerContext =\n React.createContext<SelectPositionerContextValue | null>(null)\n\n/**\n * Hook to access the Select Positioner context.\n * Returns null if used outside a SelectPositioner.\n */\nexport function useSelectPositionerContext(): SelectPositionerContextValue | null {\n return React.useContext(SelectPositionerContext)\n}\n\nexport { SelectPositionerContext }\n","'use client'\n\nimport { Popover, type PopoverPositionerProps } from '@base-ui/react/popover'\nimport * as React from 'react'\nimport { usePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { useSelectContext } from '../contexts/select-context.js'\nimport {\n type Align,\n SelectPositionerContext,\n type SelectPositionerContextValue,\n type Side,\n} from '../contexts/select-positioner-context.js'\nimport { SelectPositionerDataAttributes } from './positioner.data-attrs.js'\n\nexport { SelectPositionerDataAttributes }\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface SelectPositionerProps extends PopoverPositionerProps {\n /**\n * Whether the positioner overlaps the trigger so the selected item's text\n * is aligned with the trigger's value text.\n *\n * This is automatically disabled if:\n * - There is not enough space in the viewport\n * - The trigger is too close to the viewport edges\n * - Touch input is detected (better UX to show full list)\n *\n * @default true\n */\n alignItemWithTrigger?: boolean\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst MARGIN = 10 // Viewport margin\nconst MIN_HEIGHT = 100 // Minimum popup height before fallback\nconst TRIGGER_COLLISION_THRESHOLD = 20 // Distance from viewport edge\n\n// ============================================================================\n// Helper: Calculate alignment position\n// ============================================================================\n\ninterface CalculatePositionParams {\n triggerElement: HTMLElement\n positioner: HTMLDivElement\n valueElement: HTMLElement | null\n /** The text element to align with (selected item or first item) */\n itemText: HTMLElement | null\n}\n\ninterface CalculatePositionResult {\n shouldFallback: boolean\n left: number\n top: number\n maxHeight?: number\n}\n\nfunction calculateAlignmentPosition(\n params: CalculatePositionParams,\n): CalculatePositionResult {\n const { triggerElement, positioner, valueElement, itemText } = params\n\n const triggerRect = triggerElement.getBoundingClientRect()\n const positionerRect = positioner.getBoundingClientRect()\n const viewportHeight = document.documentElement.clientHeight\n const viewportWidth = document.documentElement.clientWidth\n\n // Check if trigger is too close to viewport edges\n const triggerTooCloseToTop = triggerRect.top < TRIGGER_COLLISION_THRESHOLD\n const triggerTooCloseToBottom =\n triggerRect.bottom > viewportHeight - TRIGGER_COLLISION_THRESHOLD\n\n // Check if popup is too small\n const popupTooSmall = positionerRect.height < MIN_HEIGHT\n\n if (triggerTooCloseToTop || triggerTooCloseToBottom || popupTooSmall) {\n return { shouldFallback: true, left: 0, top: 0 }\n }\n\n // Fallback if no item text element to align with\n if (!itemText) {\n return { shouldFallback: true, left: 0, top: 0 }\n }\n\n let offsetX = 0\n let offsetY = 0\n\n // Calculate offsets based on text elements if available\n if (itemText && valueElement) {\n const valueRect = valueElement.getBoundingClientRect()\n const textRect = itemText.getBoundingClientRect()\n\n // Align text baselines (horizontal)\n const valueLeftFromTrigger = valueRect.left - triggerRect.left\n const textLeftFromPositioner = textRect.left - positionerRect.left\n offsetX = valueLeftFromTrigger - textLeftFromPositioner\n\n // Align text centers (vertical)\n const valueCenterY = valueRect.top + valueRect.height / 2\n const textCenterFromPositioner =\n textRect.top - positionerRect.top + textRect.height / 2\n offsetY = valueCenterY - positionerRect.top - textCenterFromPositioner\n }\n\n // Calculate final position\n let left = triggerRect.left + offsetX\n let top = positionerRect.top + offsetY\n\n // Clamp to viewport with margins\n const maxLeft = viewportWidth - positionerRect.width - MARGIN\n const maxTop = viewportHeight - positionerRect.height - MARGIN\n\n left = Math.max(MARGIN, Math.min(left, maxLeft))\n top = Math.max(MARGIN, Math.min(top, maxTop))\n\n // Check if we have enough height\n const availableHeight = viewportHeight - 2 * MARGIN\n if (positionerRect.height > availableHeight) {\n return {\n shouldFallback: false,\n left,\n top: MARGIN,\n maxHeight: availableHeight,\n }\n }\n\n return { shouldFallback: false, left, top }\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Positions the select popup against its trigger.\n * Supports aligning the selected item with the trigger for a native select feel.\n *\n * Renders a `<div>` element.\n */\nexport const SelectPositioner = React.forwardRef<\n HTMLDivElement,\n SelectPositioner.Props\n>(function SelectPositioner(props, forwardedRef) {\n const {\n alignItemWithTrigger = true,\n side: sideProp = 'bottom',\n align: alignProp = 'start',\n sideOffset = 0,\n className,\n style,\n children,\n ...rest\n } = props\n\n const popupMenuContext = usePopupMenuContext()\n const selectContext = useSelectContext()\n\n // Get open state from the store\n const open = popupMenuContext.store.useState('open')\n\n // Local state - track if alignment is active and if initial positioning is done\n const [alignItemWithTriggerActive, setAlignItemWithTriggerActive] =\n React.useState(alignItemWithTrigger)\n const [positionState, setPositionState] = React.useState<{\n positioned: boolean\n left?: number\n top?: number\n maxHeight?: number\n }>({ positioned: false })\n\n const positionerRef = React.useRef<HTMLDivElement | null>(null)\n const scrollUpArrowRef = React.useRef<HTMLDivElement | null>(null)\n const scrollDownArrowRef = React.useRef<HTMLDivElement | null>(null)\n\n // Reset positioning state after close animation completes\n // This preserves positioning during exit animations via onOpenChangeComplete\n const resetPositioningState = React.useCallback(() => {\n setAlignItemWithTriggerActive(alignItemWithTrigger)\n setPositionState({ positioned: false })\n }, [alignItemWithTrigger])\n\n // Register reset callback with SelectContext so Root can call it after animation\n React.useEffect(() => {\n const cleanup = selectContext.registerResetPositioningCallback(\n resetPositioningState,\n )\n return cleanup\n }, [selectContext, resetPositioningState])\n\n // Calculate position when alignItemWithTrigger is active\n // We use useLayoutEffect to calculate before paint, preventing flash\n // The calculation is done synchronously to ensure it completes before browser paint\n React.useLayoutEffect(() => {\n if (!open || !alignItemWithTriggerActive || positionState.positioned) {\n return\n }\n\n const positioner = positionerRef.current\n const triggerElement = selectContext.triggerRef.current\n const valueElement = selectContext.valueRef.current\n const selectedItemText = selectContext.selectedItemTextRef.current\n const firstItemText = selectContext.firstItemTextRef.current\n\n if (!positioner || !triggerElement) {\n return\n }\n\n // Use selected item text if available, otherwise fall back to first item text\n // This enables alignment even when no item is selected (aligns to first item)\n const itemText = selectedItemText ?? firstItemText\n\n // Calculate position synchronously - useLayoutEffect runs after DOM mutations\n // but before paint, so getBoundingClientRect will return correct values\n const result = calculateAlignmentPosition({\n triggerElement,\n positioner,\n valueElement,\n itemText,\n })\n\n if (result.shouldFallback) {\n setAlignItemWithTriggerActive(false)\n setPositionState({ positioned: true })\n return\n }\n\n setPositionState({\n positioned: true,\n left: result.left,\n top: result.top,\n maxHeight: result.maxHeight,\n })\n }, [\n open,\n alignItemWithTriggerActive,\n positionState.positioned,\n selectContext,\n ])\n\n // Determine rendered side - 'none' when align-item-with-trigger is active\n const renderedSide = alignItemWithTriggerActive ? 'none' : sideProp\n\n // Context value\n const contextValue: SelectPositionerContextValue = React.useMemo(\n () => ({\n alignItemWithTriggerActive,\n side: renderedSide as Side | 'none',\n align: alignProp as Align,\n scrollUpArrowRef,\n scrollDownArrowRef,\n setAlignItemWithTriggerActive,\n resetPositioningState,\n }),\n [\n alignItemWithTriggerActive,\n renderedSide,\n alignProp,\n resetPositioningState,\n ],\n )\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n positionerRef.current = node\n if (typeof forwardedRef === 'function') {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n },\n [forwardedRef],\n )\n\n // When alignItemWithTrigger is active:\n // - Use visibility:hidden (NOT hidden attribute) to hide while measuring\n // The hidden attribute prevents the element from having dimensions!\n // - Apply fixed positioning with calculated coordinates after measurement\n // - Show element after positioning is done\n\n const shouldHide =\n open && alignItemWithTriggerActive && !positionState.positioned\n\n // Build position styles for alignment mode\n const alignmentStyles: React.CSSProperties =\n alignItemWithTriggerActive && positionState.positioned\n ? {\n position: 'fixed',\n left: positionState.left,\n top: positionState.top,\n ...(positionState.maxHeight\n ? { maxHeight: positionState.maxHeight }\n : {}),\n }\n : {}\n\n return (\n <SelectPositionerContext.Provider value={contextValue}>\n <Popover.Positioner\n ref={mergedRef}\n side={alignItemWithTriggerActive ? undefined : sideProp}\n align={alignItemWithTriggerActive ? undefined : alignProp}\n sideOffset={alignItemWithTriggerActive ? 0 : sideOffset}\n className={className}\n style={{\n ...style,\n ...alignmentStyles,\n // Use visibility:hidden instead of hidden attribute so element can be measured\n ...(shouldHide ? { visibility: 'hidden' } : {}),\n }}\n {...{ [SelectPositionerDataAttributes.slot]: '' }}\n {...rest}\n >\n {children}\n </Popover.Positioner>\n </SelectPositionerContext.Provider>\n )\n})\n\nexport namespace SelectPositioner {\n export type Props = SelectPositionerProps\n export type State = Popover.Positioner.State\n}\n","export const SelectPositionerDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-positioner'}\n */\n slot: 'bazzaui-select-positioner',\n} as const\n","'use client'\n\nimport { Popover, type PopoverRootProps } from '@base-ui/react/popover'\nimport * as React from 'react'\nimport type { VirtualItem } from '../../internal/listbox/index.js'\nimport {\n type PopupMenuDebugOptions,\n PopupMenuProviders,\n type PopupMenuRootActions,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport {\n defaultItemEquality,\n type ItemEqualityComparer,\n} from '../../utils/item-equality.js'\nimport { stringifyAsValue } from '../../utils/resolve-value-label.js'\nimport {\n type ItemTextRegistry,\n SelectContext,\n type SelectContextValue,\n} from '../contexts/select-context.js'\nimport type {\n SelectHighlightChangeEventDetails,\n SelectOpenChangeEventDetails,\n} from '../events.js'\n\n/**\n * Helper type to determine the value type based on the multiple flag.\n */\ntype SelectValue<\n Value,\n Multiple extends boolean | undefined,\n> = Multiple extends true ? Value[] : Value | null\n\nexport interface SelectRootProps<\n Value = unknown,\n Multiple extends boolean | undefined = false,\n> extends Omit<\n PopoverRootProps,\n 'open' | 'onOpenChange' | 'defaultOpen' | 'actionsRef'\n > {\n // ===== Open State =====\n /**\n * Whether the select is open.\n * Use for controlled mode.\n */\n open?: boolean\n\n /**\n * Callback when the open state changes.\n * The second parameter contains event details including the reason for the change.\n */\n onOpenChange?: (\n open: boolean,\n eventDetails: SelectOpenChangeEventDetails,\n ) => void\n\n /**\n * Callback called after any animations complete when the select opens or closes.\n * Useful for resetting state after exit animations finish.\n */\n onOpenChangeComplete?: (open: boolean) => void\n\n /**\n * A ref to imperative actions.\n * - `close`: closes the menu imperatively.\n * - `unmount`: unmounts the popup imperatively (when keep-mounted mode is enabled).\n * - `setDisabled`: enables/disables the menu imperatively.\n */\n actionsRef?: React.RefObject<SelectRoot.Actions | null>\n\n /**\n * Whether the select is initially open.\n * Use for uncontrolled mode.\n * @default false\n */\n defaultOpen?: boolean\n\n // ===== Single Selection =====\n /**\n * Current selected value (single-select mode).\n * Use for controlled mode.\n * Can be a primitive or an object.\n */\n value?: SelectValue<Value, Multiple>\n\n /**\n * Default selected value (single-select mode).\n * Use for uncontrolled mode.\n */\n defaultValue?: SelectValue<Value, Multiple>\n\n /**\n * Callback when the selected value changes (single-select mode).\n */\n onValueChange?: (value: Value) => void\n\n // ===== Multi Selection =====\n /**\n * Whether multi-select mode is enabled.\n * @default false\n */\n multiple?: Multiple\n\n /**\n * Current selected values (multi-select mode).\n * Use for controlled mode.\n */\n values?: Value[]\n\n /**\n * Default selected values (multi-select mode).\n * Use for uncontrolled mode.\n */\n defaultValues?: Value[]\n\n /**\n * Callback when the selected values change (multi-select mode).\n */\n onValuesChange?: (values: Value[]) => void\n\n // ===== Object Value Support =====\n /**\n * Custom comparison logic used to determine if a select item value\n * matches the current selected value.\n * Useful when item values are objects without matching referentially.\n * Defaults to Object.is comparison.\n */\n isItemEqualToValue?: ItemEqualityComparer<Value>\n\n /**\n * When the item values are objects (`<Select.Item value={object}>`),\n * this function converts the object value to a string representation\n * for display in the trigger.\n * If the shape of the object is `{ value, label }`, the label will be\n * used automatically without needing to specify this prop.\n */\n itemToStringLabel?: (itemValue: Value) => string\n\n /**\n * When the item values are objects (`<Select.Item value={object}>`),\n * this function converts the object value to a string representation\n * for form submission.\n * If the shape of the object is `{ value, label }`, the value will be\n * used automatically without needing to specify this prop.\n */\n itemToStringValue?: (itemValue: Value) => string\n\n // ===== Form Integration =====\n /**\n * Form field name for submission.\n * When set, hidden input(s) will be rendered for form submission.\n */\n name?: string\n\n /**\n * Associate with a form by ID.\n */\n form?: string\n\n /**\n * Whether this field is required.\n */\n required?: boolean\n\n /**\n * Whether the select is disabled.\n * @default false\n */\n disabled?: boolean\n\n /**\n * Placeholder text when no value is selected.\n * @default \"Select...\"\n */\n placeholder?: string\n\n /**\n * Data structure of the items rendered in the select popup.\n * When specified, `<Select.Value>` renders the label of the selected item\n * instead of the raw value.\n *\n * Can be a record mapping values to labels, or an array of { value, label } objects.\n * @example\n * ```tsx\n * // Record format\n * <Select.Root items={{ us: 'United States', uk: 'United Kingdom' }}>\n *\n * // Array format\n * <Select.Root items={[\n * { value: 'us', label: 'United States' },\n * { value: 'uk', label: 'United Kingdom' },\n * ]}>\n * ```\n */\n items?:\n | Record<string, React.ReactNode>\n | Array<{ value: string; label: React.ReactNode }>\n\n // ===== Behavior =====\n /**\n * Determines if the select enters a modal state when open.\n *\n * - `true`: user interaction is limited to the select: document page scroll\n * is locked, and pointer interactions on outside elements are disabled.\n * - `false`: user interaction with the rest of the document is allowed.\n * - `'trap-focus'`: focus is trapped inside the select, but document page\n * scroll is not locked and pointer interactions outside of it remain enabled.\n *\n * @default true\n */\n modal?: boolean | 'trap-focus'\n\n // ===== Virtualization =====\n /**\n * Whether virtualization mode is enabled.\n * When true, items should provide an explicit `index` prop and\n * the `virtualItems` prop should be provided for navigation to work correctly.\n * @default false\n */\n virtualized?: boolean\n\n /**\n * Pre-registered items for virtualization.\n * When provided with `virtualized={true}`, this allows navigation to work\n * for items that aren't currently mounted in the DOM.\n */\n virtualItems?: VirtualItem[]\n\n /**\n * Callback when the highlighted item changes.\n * Useful for synchronizing with a virtualizer (e.g., scrollToIndex) or other UI state.\n * The third parameter contains event details including the reason for the change.\n */\n onHighlightChange?: (\n id: string | null,\n index: number,\n eventDetails: SelectHighlightChangeEventDetails,\n ) => void\n\n /**\n * Debug visualization options for submenu interaction heuristics.\n */\n debug?: PopupMenuDebugOptions\n\n children: React.ReactNode\n}\n\n/**\n * Groups all parts of the select.\n * Manages open state, selection state, and provides context to children.\n * Doesn't render its own HTML element.\n *\n * @template Value - The type of the select value (can be a primitive or object)\n * @template Multiple - Whether multiple selection is enabled\n */\nexport function SelectRoot<\n Value = unknown,\n Multiple extends boolean | undefined = false,\n>(props: SelectRootProps<Value, Multiple>): React.JSX.Element {\n const {\n // Open state\n open: openProp,\n onOpenChange,\n onOpenChangeComplete,\n actionsRef,\n defaultOpen = false,\n // Single selection\n value: valueProp,\n defaultValue,\n onValueChange,\n // Multi selection\n multiple = false as Multiple,\n values: valuesProp,\n defaultValues,\n onValuesChange,\n // Object value support\n isItemEqualToValue = defaultItemEquality as ItemEqualityComparer<Value>,\n itemToStringLabel,\n itemToStringValue,\n // Form integration\n name,\n form,\n required,\n disabled: disabledProp = false,\n placeholder = 'Select...',\n items,\n // Behavior\n modal = true,\n // Virtualization\n virtualized = false,\n virtualItems,\n onHighlightChange,\n debug,\n children,\n ...rest\n } = props\n\n // Generate a unique ID for the listbox\n const listId = React.useId()\n\n // ===== Element Refs for Positioning =====\n const triggerRef = React.useRef<HTMLElement | null>(null)\n const valueRef = React.useRef<HTMLElement | null>(null)\n const selectedItemTextRef = React.useRef<HTMLElement | null>(null)\n const firstItemTextRef = React.useRef<HTMLElement | null>(null)\n\n const setTriggerElement = React.useCallback((element: HTMLElement | null) => {\n triggerRef.current = element\n }, [])\n\n const setValueElement = React.useCallback((element: HTMLElement | null) => {\n valueRef.current = element\n }, [])\n\n // ===== Positioner Reset Callback =====\n // Store callback to reset positioning state after close animation\n const resetPositioningCallbackRef = React.useRef<(() => void) | null>(null)\n\n const registerResetPositioningCallback = React.useCallback(\n (callback: (() => void) | null) => {\n resetPositioningCallbackRef.current = callback\n // Return cleanup function\n return () => {\n resetPositioningCallbackRef.current = null\n }\n },\n [],\n )\n\n // ===== Open State =====\n // Use shared hook to create stores and utilities\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n virtualization,\n handleOpenChange,\n disabled: menuDisabled,\n setDisabled,\n } = usePopupMenuRoot({\n // Cast to generic type - component handles type safety via narrowed types\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n virtualized,\n items: virtualItems,\n onHighlightChange:\n onHighlightChange as unknown as UsePopupMenuRootParams['onHighlightChange'],\n disabled: disabledProp,\n })\n\n const popoverActionsRef = React.useRef<Popover.Root.Actions | null>(null)\n\n React.useImperativeHandle(\n actionsRef,\n () => ({\n close: () => {\n popoverActionsRef.current?.close()\n },\n unmount: () => {\n popoverActionsRef.current?.unmount()\n },\n setDisabled,\n }),\n [setDisabled],\n )\n\n // Sync controlled open prop to store\n store.useControlledProp('open', openProp, defaultOpen)\n\n // Get open state from store for Popover\n const open = store.useState('open')\n\n // ===== Single Selection State =====\n const [internalValue, setInternalValue] = React.useState<Value | null>(\n defaultValue !== undefined ? (defaultValue as Value | null) : null,\n )\n const value: Value | null =\n valueProp !== undefined ? (valueProp as Value | null) : internalValue\n\n const handleValueChange = React.useCallback(\n (newValue: Value) => {\n if (valueProp === undefined) {\n setInternalValue(newValue)\n }\n onValueChange?.(newValue)\n },\n [valueProp, onValueChange],\n )\n\n // ===== Multi Selection State =====\n const [internalValues, setInternalValues] = React.useState<Value[]>(\n defaultValues ?? [],\n )\n const values: Value[] = valuesProp !== undefined ? valuesProp : internalValues\n\n const handleValuesChange = React.useCallback(\n (newValues: Value[]) => {\n if (valuesProp === undefined) {\n setInternalValues(newValues)\n }\n onValuesChange?.(newValues)\n },\n [valuesProp, onValuesChange],\n )\n\n // ===== Item Text Registry =====\n // The registry persists item text even after items unmount (popup closes).\n // This ensures SelectValue can display the correct label for selected values.\n // Text is only overwritten when items re-mount with new text, never deleted.\n const itemTextRegistryRef = React.useRef<ItemTextRegistry>(new Map())\n\n const registerItemText = React.useCallback(\n (itemValue: string, text: string) => {\n itemTextRegistryRef.current.set(itemValue, text)\n // No cleanup - text should persist even when items unmount\n return () => {}\n },\n [],\n )\n\n // ===== Select Context =====\n const selectContextValue: SelectContextValue<Value> = React.useMemo(\n () => ({\n multiple: multiple as boolean,\n value,\n values,\n onValueChange: handleValueChange,\n onValuesChange: handleValuesChange,\n isItemEqualToValue,\n itemToStringLabel,\n itemToStringValue,\n name,\n form,\n required,\n disabled: menuDisabled,\n placeholder,\n items,\n itemTextRegistry: itemTextRegistryRef.current,\n registerItemText,\n listId,\n triggerRef,\n valueRef,\n selectedItemTextRef,\n firstItemTextRef,\n setTriggerElement,\n setValueElement,\n registerResetPositioningCallback,\n }),\n [\n multiple,\n value,\n values,\n handleValueChange,\n handleValuesChange,\n isItemEqualToValue,\n itemToStringLabel,\n itemToStringValue,\n name,\n form,\n required,\n menuDisabled,\n placeholder,\n items,\n registerItemText,\n listId,\n setTriggerElement,\n setValueElement,\n registerResetPositioningCallback,\n ],\n )\n\n // ===== Hidden Inputs for Form Submission =====\n const hiddenInputs = React.useMemo(() => {\n if (!name) return null\n\n if (multiple) {\n // Multiple hidden inputs for array submission\n if (values.length > 0) {\n return values.map((v, index) => {\n const serializedValue = stringifyAsValue(v, itemToStringValue)\n return (\n <input\n key={serializedValue}\n type=\"hidden\"\n name={name}\n value={serializedValue}\n form={form}\n required={required && index === 0}\n />\n )\n })\n }\n // Empty hidden input to ensure field is submitted even when empty\n return (\n <input\n type=\"hidden\"\n name={name}\n value=\"\"\n form={form}\n required={required}\n />\n )\n }\n\n // Single hidden input\n return (\n <input\n type=\"hidden\"\n name={name}\n value={value != null ? stringifyAsValue(value, itemToStringValue) : ''}\n form={form}\n required={required}\n />\n )\n }, [name, form, required, multiple, value, values, itemToStringValue])\n\n // Wrapper to adapt Popover's event details to our handleOpenChange\n const handlePopoverOpenChange = React.useCallback(\n (nextOpen: boolean, popoverDetails: Popover.Root.ChangeEventDetails) => {\n // Forward to our internal handler with the reason and event\n handleOpenChange(\n nextOpen,\n popoverDetails.reason as SelectOpenChangeEventDetails['reason'],\n popoverDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n // Handle animation complete - reset positioning state after close animation\n const handleOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n // Reset positioning state after close animation completes\n // This preserves the aligned position during the exit animation\n if (!nextOpen) {\n resetPositioningCallbackRef.current?.()\n // Clear first item text ref so it can be set fresh on next open\n firstItemTextRef.current = null\n }\n // Call user's callback\n onOpenChangeComplete?.(nextOpen)\n },\n [onOpenChangeComplete],\n )\n\n return (\n <SelectContext.Provider\n value={selectContextValue as SelectContextValue<unknown>}\n >\n <PopupMenuProviders\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n registerSurface={registerSurface}\n virtualization={virtualization}\n menuType=\"dropdown\"\n componentName=\"select\"\n debug={debug}\n >\n {hiddenInputs}\n <Popover.Root\n {...rest}\n open={open}\n onOpenChange={handlePopoverOpenChange}\n onOpenChangeComplete={handleOpenChangeComplete}\n modal={modal}\n actionsRef={actionsRef ? popoverActionsRef : undefined}\n >\n {children}\n </Popover.Root>\n </PopupMenuProviders>\n </SelectContext.Provider>\n )\n}\n\nexport namespace SelectRoot {\n export interface Props<\n Value = unknown,\n Multiple extends boolean | undefined = false,\n > extends SelectRootProps<Value, Multiple> {}\n export type OpenChangeEventDetails = SelectOpenChangeEventDetails\n export type HighlightChangeEventDetails = SelectHighlightChangeEventDetails\n export type Actions = PopupMenuRootActions\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuSurface,\n type PopupMenuSurfaceProps,\n} from '../../internal/popup-menu/index.js'\nimport { stringifyAsValue } from '../../utils/resolve-value-label.js'\nimport { useSelectContext } from '../contexts/select-context.js'\nimport { useSelectPositionerContext } from '../contexts/select-positioner-context.js'\nimport { SelectSurfaceDataAttributes } from './surface.data-attrs.js'\n\nexport { SelectSurfaceDataAttributes }\n\nexport interface SelectSurfaceProps\n extends Omit<PopupMenuSurfaceProps, 'autoHighlightFirst'> {\n /**\n * Controls auto-highlighting behavior when the select opens.\n * - `true`: highlight the first item (default when alignItemWithTrigger is inactive)\n * - `false`: don't auto-highlight any item\n * - `'selected'`: highlight the currently selected item, or first item if none selected\n * - `string`: highlight the item with this specific value\n *\n * Note: When the Positioner's `alignItemWithTrigger` is active and this prop\n * is not explicitly set, the selected item is automatically highlighted.\n *\n * @default true (or selected value when alignItemWithTrigger is active)\n */\n autoHighlightFirst?: boolean | 'selected' | string\n}\n\n/**\n * Provides search context and manages item registration for Select.\n * Automatically configures `autoHighlightFirst` based on the Positioner's\n * `alignItemWithTrigger` prop - when active, highlights the selected item\n * instead of the first item.\n *\n * Place inside Select.Popup to enable search functionality.\n * Renders a `<div>` element.\n */\nexport const SelectSurface = React.forwardRef<\n HTMLDivElement,\n SelectSurface.Props\n>(function SelectSurface(props, forwardedRef) {\n const { autoHighlightFirst: autoHighlightFirstProp, ...rest } = props\n\n const selectContext = useSelectContext()\n const positionerContext = useSelectPositionerContext()\n\n // Determine autoHighlightFirst value:\n // - 'selected': use the current selected value (falls back to true if no selection)\n // - If alignItemWithTrigger is active and prop is not set, highlight the selected item\n // - Otherwise, use the prop value (defaulting to true)\n const autoHighlightFirst = React.useMemo(() => {\n // Helper to serialize a value to a string for highlighting\n // Returns true (highlight first) when there's no meaningful value\n const serializeValue = (value: unknown): string | true => {\n if (value == null || value === '') return true\n return stringifyAsValue(value, selectContext.itemToStringValue)\n }\n\n // Handle 'selected' shorthand - resolve to actual selected value\n if (autoHighlightFirstProp === 'selected') {\n // For single-select, use the selected value\n // For multi-select, use the first selected value\n const selectedValue = selectContext.multiple\n ? selectContext.values[0]\n : selectContext.value\n\n // If there's a selected value, serialize and use for highlighting\n return serializeValue(selectedValue)\n }\n\n // If user explicitly passed a value (other than 'selected'), respect it\n if (autoHighlightFirstProp !== undefined) {\n return autoHighlightFirstProp\n }\n\n // If alignItemWithTrigger is active and we have a selected value,\n // auto-highlight the selected item\n if (positionerContext?.alignItemWithTriggerActive) {\n // For single-select, use the value\n // For multi-select, use the first selected value (or fall back to true)\n const selectedValue = selectContext.multiple\n ? selectContext.values[0]\n : selectContext.value\n return serializeValue(selectedValue)\n }\n\n // Default behavior\n return true\n }, [\n autoHighlightFirstProp,\n positionerContext?.alignItemWithTriggerActive,\n selectContext.multiple,\n selectContext.value,\n selectContext.values,\n selectContext.itemToStringValue,\n ])\n\n return (\n <PopupMenuSurface\n ref={forwardedRef}\n autoHighlightFirst={autoHighlightFirst}\n {...{ [SelectSurfaceDataAttributes.slot]: '' }}\n {...rest}\n />\n )\n})\n\nexport namespace SelectSurface {\n export type State = PopupMenuSurface.State\n export interface Props extends SelectSurfaceProps {}\n}\n","export const SelectSurfaceDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-surface'}\n */\n slot: 'bazzaui-select-surface',\n} as const\n","'use client'\n\nimport { Popover, type PopoverTriggerProps } from '@base-ui/react/popover'\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport { usePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { useSelectContext } from '../contexts/select-context.js'\nimport { SelectTriggerDataAttributes } from './trigger.data-attrs.js'\n\nexport { SelectTriggerDataAttributes }\n\nexport interface SelectTriggerState extends Record<string, unknown> {\n /**\n * Whether the select is open.\n */\n open: boolean\n /**\n * Whether the select is disabled.\n */\n disabled: boolean\n /**\n * Whether the select currently shows placeholder (no value selected).\n */\n placeholder: boolean\n}\n\nexport interface SelectTriggerProps\n extends ComponentProps<'button', SelectTrigger.State> {\n /**\n * Whether the trigger is disabled.\n */\n disabled?: boolean\n}\n\nconst stateAttributesMapping = {\n open: (value: unknown): Record<string, string> | null =>\n value ? { [SelectTriggerDataAttributes.open]: '' } : null,\n disabled: (value: unknown): Record<string, string> | null =>\n value ? { [SelectTriggerDataAttributes.disabled]: '' } : null,\n placeholder: (value: unknown): Record<string, string> | null =>\n value ? { [SelectTriggerDataAttributes.placeholder]: '' } : null,\n}\n\n/**\n * Inner component that renders using useRender.\n * This allows us to use hooks while being called from Popover.Trigger's render prop.\n */\nconst SelectTriggerInner = React.forwardRef<\n HTMLButtonElement,\n SelectTriggerProps & {\n triggerProps: React.ComponentPropsWithRef<'button'>\n triggerState: { open: boolean }\n }\n>(function SelectTriggerInner(props, forwardedRef) {\n const {\n render,\n children,\n disabled: disabledProp,\n className,\n style,\n triggerProps,\n triggerState,\n ...rest\n } = props\n\n const selectContext = useSelectContext()\n const disabled = disabledProp ?? selectContext.disabled\n\n // Determine if showing placeholder\n // Match Base UI: null, undefined, or empty string = no selection\n const hasValue = selectContext.multiple\n ? selectContext.values.length > 0\n : selectContext.value != null && selectContext.value !== ''\n\n const state: SelectTrigger.State = React.useMemo(\n () => ({\n open: triggerState.open,\n disabled,\n placeholder: !hasValue,\n }),\n [triggerState.open, disabled, hasValue],\n )\n\n // Register trigger element for positioning\n const internalRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n selectContext.setTriggerElement(node)\n },\n [selectContext],\n )\n\n return useRender({\n render,\n ref: forwardedRef,\n state,\n stateAttributesMapping,\n props: {\n ...triggerProps,\n ...rest,\n [SelectTriggerDataAttributes.slot]: '',\n ref: internalRef,\n role: 'combobox' as const,\n 'aria-haspopup': 'listbox' as const,\n 'aria-controls': selectContext.listId,\n className,\n style,\n children,\n },\n defaultTagName: 'button',\n })\n})\n\n/**\n * A button that opens the select dropdown.\n * Renders a `<button>` element with combobox ARIA semantics.\n */\nexport const SelectTrigger = React.forwardRef<\n HTMLButtonElement,\n SelectTrigger.Props\n>(function SelectTrigger(props, forwardedRef) {\n const { disabled: disabledProp, ...rest } = props\n const selectContext = useSelectContext()\n const popupMenuContext = usePopupMenuContext()\n const disabled =\n (disabledProp ?? selectContext.disabled) || popupMenuContext.disabled\n\n return (\n <Popover.Trigger\n ref={forwardedRef}\n disabled={disabled}\n render={(triggerProps, triggerState) => (\n <SelectTriggerInner\n {...rest}\n disabled={disabled}\n triggerProps={triggerProps}\n triggerState={triggerState}\n ref={triggerProps.ref as React.Ref<HTMLButtonElement>}\n />\n )}\n />\n )\n})\n\nexport namespace SelectTrigger {\n export interface Props extends SelectTriggerProps {}\n export type State = SelectTriggerState\n}\n","export const SelectTriggerDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-trigger'}\n */\n slot: 'bazzaui-select-trigger',\n /**\n * Present when the select dropdown is open.\n */\n open: 'data-open',\n /**\n * Present when the select dropdown is closed.\n */\n closed: 'data-closed',\n /**\n * Present when the trigger is disabled.\n */\n disabled: 'data-disabled',\n /**\n * Present when no value is selected (showing placeholder).\n */\n placeholder: 'data-placeholder',\n} as const\n","'use client'\n\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport {\n resolveLabel,\n stringifyAsValue,\n} from '../../utils/resolve-value-label.js'\nimport type { ComponentProps } from '../../utils/types.js'\nimport { useSelectContext } from '../contexts/select-context.js'\nimport { SelectValueDataAttributes } from './value.data-attrs.js'\n\nexport { SelectValueDataAttributes }\n\nexport interface SelectValueState<Value = unknown>\n extends Record<string, unknown> {\n /**\n * The currently selected value (single-select mode).\n */\n value: Value | null\n /**\n * The currently selected values (multi-select mode).\n */\n values: Value[]\n /**\n * Whether the select is in multi-select mode.\n */\n multiple: boolean\n /**\n * Whether a value is currently selected.\n */\n hasValue: boolean\n /**\n * The placeholder text.\n */\n placeholder: string\n /**\n * Get the display content for a value.\n * First checks the item text registry (populated when items mount),\n * then falls back to the `items` prop passed to SelectRoot,\n * then falls back to `itemToStringLabel` for object values.\n */\n getValueText: (value: Value) => React.ReactNode | undefined\n}\n\nexport interface SelectValueProps<Value = unknown>\n extends Omit<ComponentProps<'span', SelectValueState<Value>>, 'children'> {\n /**\n * Placeholder text when no value is selected.\n * Overrides the placeholder set on Select.Root.\n */\n placeholder?: string\n\n /**\n * Custom render function for the selected value content.\n * Receives the current state and should return the content to render.\n * This is different from the `render` prop which replaces the element.\n */\n children?:\n | React.ReactNode\n | ((state: SelectValueState<Value>) => React.ReactNode)\n}\n\nconst stateAttributesMapping = {\n hasValue: (value: unknown): Record<string, string> | null =>\n !value ? { [SelectValueDataAttributes.placeholder]: '' } : null,\n multiple: (value: unknown): Record<string, string> | null =>\n value ? { [SelectValueDataAttributes.multiple]: '' } : null,\n // Exclude function from data attributes to avoid hydration mismatch\n getValueText: () => null,\n}\n\n/**\n * Displays the currently selected value(s) or placeholder.\n * Typically placed inside Select.Trigger.\n * Renders a `<span>` element.\n */\nfunction SelectValueImpl<Value = unknown>(\n props: SelectValueProps<Value>,\n forwardedRef: React.ForwardedRef<HTMLSpanElement>,\n) {\n const {\n render,\n className,\n style,\n placeholder: placeholderProp,\n children,\n ...rest\n } = props\n\n const selectContext = useSelectContext<Value>()\n\n const placeholder = placeholderProp ?? selectContext.placeholder\n\n const hasValue = selectContext.multiple\n ? selectContext.values.length > 0\n : Boolean(selectContext.value)\n\n // Helper to get text for a value\n // First check the item text registry (populated when items mount),\n // then fall back to the items prop (available immediately for initial render),\n // then fall back to itemToStringLabel for object values\n const getValueText = React.useCallback(\n (value: Value): React.ReactNode | undefined => {\n // Serialize for registry lookup\n const serializedValue = stringifyAsValue(\n value,\n selectContext.itemToStringValue,\n )\n\n // First try the registry (populated when items mount)\n const registryText = selectContext.itemTextRegistry.get(serializedValue)\n if (registryText !== undefined) {\n return registryText\n }\n\n // Fall back to the items prop (for initial render before popup opens)\n const items = selectContext.items\n if (items) {\n // Handle record format: { value: label }\n if (!Array.isArray(items)) {\n const label = items[serializedValue]\n if (label !== undefined) {\n return label\n }\n } else {\n // Handle array format: [{ value, label }]\n const item = items.find((item) => item.value === serializedValue)\n if (item?.label !== undefined) {\n return item.label\n }\n }\n }\n\n // Fall back to itemToStringLabel for object values\n const resolvedLabel = resolveLabel(value, selectContext.itemToStringLabel)\n // Only return if it's different from the serialized value (meaning we got a real label)\n if (resolvedLabel && resolvedLabel !== serializedValue) {\n return resolvedLabel\n }\n\n return undefined\n },\n [\n selectContext.itemTextRegistry,\n selectContext.items,\n selectContext.itemToStringLabel,\n selectContext.itemToStringValue,\n ],\n )\n\n const state: SelectValueState<Value> = React.useMemo(\n () => ({\n value: selectContext.value,\n values: selectContext.values,\n multiple: selectContext.multiple,\n hasValue,\n placeholder,\n getValueText,\n }),\n [\n selectContext.value,\n selectContext.values,\n selectContext.multiple,\n hasValue,\n placeholder,\n getValueText,\n ],\n )\n\n // Determine what to render as content\n let content: React.ReactNode\n\n if (typeof children === 'function') {\n // Custom render function\n content = children(state)\n } else if (children !== undefined) {\n // Static children\n content = children\n } else if (!hasValue) {\n // Show placeholder when no value\n content = placeholder\n } else if (selectContext.multiple) {\n // Multi-select: show count or comma-separated values\n const texts = selectContext.values\n .map((v) => {\n const text = getValueText(v)\n if (text !== undefined) return text\n // Fall back to resolved label or serialized value\n return (\n resolveLabel(v, selectContext.itemToStringLabel) ||\n stringifyAsValue(v, selectContext.itemToStringValue)\n )\n })\n .filter(Boolean)\n content = texts.length > 2 ? `${texts.length} selected` : texts.join(', ')\n } else {\n // Single-select: show value text\n const value = selectContext.value\n if (value != null) {\n const text = getValueText(value)\n if (text !== undefined) {\n content = text\n } else {\n // Fall back to resolved label or serialized value\n content =\n resolveLabel(value, selectContext.itemToStringLabel) ||\n stringifyAsValue(value, selectContext.itemToStringValue)\n }\n }\n }\n\n // Register value element for positioning\n const internalRef = React.useCallback(\n (node: HTMLSpanElement | null) => {\n selectContext.setValueElement(node)\n },\n [selectContext],\n )\n\n return useRender({\n render,\n ref: forwardedRef,\n state,\n stateAttributesMapping,\n props: {\n ...rest,\n [SelectValueDataAttributes.slot]: '',\n ref: internalRef,\n className,\n style,\n children: content,\n },\n defaultTagName: 'span',\n })\n}\n\nexport const SelectValue = React.forwardRef(SelectValueImpl) as <\n Value = unknown,\n>(\n props: SelectValueProps<Value> & React.RefAttributes<HTMLSpanElement>,\n) => React.ReactElement\n\nexport namespace SelectValue {\n // Props uses unknown default for simpler usage when type doesn't matter\n export interface Props extends SelectValueProps<unknown> {}\n export type State = SelectValueState<unknown>\n}\n","export const SelectValueDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-value'}\n */\n slot: 'bazzaui-select-value',\n /**\n * Present when showing placeholder (no value selected).\n */\n placeholder: 'data-placeholder',\n /**\n * Present when in multi-select mode.\n */\n multiple: 'data-multiple',\n} as const\n","export enum SelectArrowDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-arrow'}\n */\n slot = 'bazzaui-select-arrow',\n /**\n * Present when the popup menu is open.\n */\n open = 'data-open',\n /**\n * Present when the popup menu is closed.\n */\n closed = 'data-closed',\n /**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\n side = 'data-side',\n /**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\n align = 'data-align',\n /**\n * Present when the arrow is not centered due to collision avoidance.\n */\n uncentered = 'data-uncentered',\n}\n","export enum SelectBackdropDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-backdrop'}\n */\n slot = 'bazzaui-select-backdrop',\n /**\n * Present when the popup menu is open.\n */\n open = 'data-open',\n /**\n * Present when the popup menu is closed.\n */\n closed = 'data-closed',\n /**\n * Present when the popup menu is animating in.\n */\n startingStyle = 'data-starting-style',\n /**\n * Present when the popup menu is animating out.\n */\n endingStyle = 'data-ending-style',\n}\n","/**\n * Data attributes applied to Select.Empty for styling.\n * Displayed when no items match the current search filter.\n *\n * @example\n * ```css\n * [data-bazzaui-select-empty] {\n * padding: 8px 16px;\n * color: var(--muted);\n * text-align: center;\n * }\n * ```\n */\nexport enum SelectEmptyDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-empty'}\n */\n slot = 'bazzaui-select-empty',\n}\n","export enum SelectGroupDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-group'}\n */\n slot = 'bazzaui-select-group',\n}\n","export enum SelectGroupLabelDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-group-label'}\n */\n slot = 'bazzaui-select-group-label',\n}\n","export const SelectIconDataAttributes = {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-icon'}\n */\n slot: 'bazzaui-select-icon',\n /** Present when the popup is open. */\n open: 'data-popup-open',\n} as const\n","export enum SelectInputDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-input'}\n */\n slot = 'bazzaui-select-input',\n /**\n * Present when the popup menu is open.\n */\n open = 'data-open',\n /**\n * Present when the popup menu is closed.\n */\n closed = 'data-closed',\n}\n","/**\n * Data attributes applied to Select.List for styling.\n * Container for select items with role=\"listbox\".\n *\n * @example\n * ```css\n * [data-bazzaui-select-list] {\n * max-height: 300px;\n * overflow-y: auto;\n * }\n * ```\n */\nexport enum SelectListDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-list'}\n */\n slot = 'bazzaui-select-list',\n /**\n * Always present on the list element.\n * Used for styling and by useStickyRowWidth to find the list container.\n */\n list = 'data-popup-menu-list',\n}\n","// Re-export all base popup data attributes\nexport { PopupMenuPopupDataAttributes } from '../../internal/popup-menu/components/popup/popup.data-attrs.js'\n\n/**\n * Select-specific popup data attributes (in addition to PopupMenuPopupDataAttributes).\n */\nexport enum SelectPopupDataAttributes {\n /**\n * Present when the popup is using align-item-with-trigger positioning.\n * This reflects the actual state, not just the prop value.\n */\n alignItemWithTrigger = 'data-align-item-with-trigger',\n}\n","export const SelectScrollArrowDataAttributes = {\n /**\n * Identifies the component part for scroll up arrow.\n * @type {'bazzaui-select-scroll-up-arrow'}\n */\n slotUp: 'bazzaui-select-scroll-up-arrow',\n /**\n * Identifies the component part for scroll down arrow.\n * @type {'bazzaui-select-scroll-down-arrow'}\n */\n slotDown: 'bazzaui-select-scroll-down-arrow',\n /**\n * Direction of the scroll arrow.\n * @type {'up' | 'down'}\n */\n direction: 'data-direction',\n /**\n * Side of the popup.\n * @type {'top' | 'bottom' | 'left' | 'right'}\n */\n side: 'data-side',\n} as const\n","export enum SelectSeparatorDataAttributes {\n /**\n * Identifies the component part.\n * @type {'bazzaui-select-separator'}\n */\n slot = 'bazzaui-select-separator',\n}\n"],"mappings":"sZAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,WAAAE,GAAA,aAAAC,GAAA,UAAAC,GAAA,UAAAC,GAAA,eAAAC,GAAA,SAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,kBAAAC,GAAA,cAAAC,GAAA,SAAAC,GAAA,UAAAC,GAAA,WAAAC,GAAA,eAAAC,GAAA,SAAAC,GAAA,oBAAAC,GAAA,kBAAAC,GAAA,cAAAC,GAAA,YAAAC,GAAA,YAAAC,GAAA,UAAAC,KCEA,OAAS,aAAAC,OAAiB,4BAC1B,UAAYC,MAAW,QCDvB,UAAYC,MAAW,QA4GvB,IAAMC,GAAsB,gBAC1B,IACF,EAMO,SAASC,GAA+D,CAC7E,IAAMC,EAAgB,aAAWF,EAAa,EAC9C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,qDAAqD,EAEvE,OAAOA,CACT,CAMO,SAASC,IAEsB,CACpC,OAAa,aAAWH,EAAa,CACvC,CCtIO,IA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PA,EAAA,OAAS,cAbCA,QAAA,ICYL,IAAKC,QAKVA,EAAA,KAAO,sBAKPA,EAAA,KAAO,uBAVGA,QAAA,ICNL,IAAKC,QAKVA,EAAA,qBAAuB,+BALbA,QAAA,ICNL,IAAMC,GAAkC,CAK7C,OAAQ,iCAKR,SAAU,mCAKV,UAAW,iBAKX,KAAM,WACR,ECrBO,IAAKC,QAKVA,EAAA,KAAO,2BALGA,QAAA","names":["index_parts_exports","__export","PopupMenuArrow","PopupMenuBackdrop","PopupMenuEmpty","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuIcon","PopupMenuInput","SelectItem","SelectItemIndicator","SelectItemLabel","PopupMenuList","SelectPopup","PopupMenuPortal","SelectPositioner","SelectRoot","PopupMenuScrollDownArrow","PopupMenuScrollUpArrow","PopupMenuSeparator","SelectSurface","SelectTrigger","SelectValue","useRender","React","React","SelectContext","useSelectContext","context","useMaybeSelectContext","SelectItemDataAttributes","React","SelectItemContext","useSelectItemContext","context","useMaybeSelectItemContext","jsx","stateAttributesMapping","value","SelectItemDataAttributes","resolveLabelFromItems","items","SelectItemImpl","props","forwardedRef","textValueProp","keywordsProp","disabled","onSelect","forceMount","render","className","style","onClick","onPointerDown","onPointerMove","children","rest","selectContext","useSelectContext","serializedValue","stringifyAsValue","labelFromItems","labelFromObjectValue","resolveLabel","textValue","keywords","labelStr","textRef","selected","itemIncludes","compareItemEquality","closeOnClick","item","usePopupMenuItem","handleSelect","newValues","removeItem","text","state","itemContextValue","handleClick","event","handlePointerDown","handlePointerMove","element","useRender","jsx","SelectItemContext","SelectItem","useRender","React","SelectItemIndicatorDataAttributes","stateAttributesMapping","value","SelectItemIndicatorDataAttributes","SelectItemIndicator","props","forwardedRef","render","className","style","forceMount","keepMounted","children","rest","selected","useSelectItemContext","state","shouldRender","content","element","useRender","useRender","React","SelectItemLabelDataAttributes","resolveLabelFromItems","items","valueKey","SelectItemLabel","props","forwardedRef","render","className","style","children","rest","selectContext","useSelectContext","itemContext","useSelectItemContext","textRef","stringifyAsValue","resolvedLabel","labelFromItems","state","mergedRef","node","useRender","SelectItemLabelDataAttributes","React","React","SelectPositionerContext","useSelectPositionerContext","jsx","SelectPopup","props","forwardedRef","classNameProp","rest","alignItemWithTriggerActive","useSelectPositionerContext","className","baseState","extendedState","PopupMenuPopup","Popover","React","SelectPositionerDataAttributes","jsx","MARGIN","MIN_HEIGHT","TRIGGER_COLLISION_THRESHOLD","calculateAlignmentPosition","params","triggerElement","positioner","valueElement","itemText","triggerRect","positionerRect","viewportHeight","viewportWidth","triggerTooCloseToTop","triggerTooCloseToBottom","popupTooSmall","offsetX","offsetY","valueRect","textRect","valueLeftFromTrigger","textLeftFromPositioner","valueCenterY","textCenterFromPositioner","left","top","maxLeft","maxTop","availableHeight","SelectPositioner","props","forwardedRef","alignItemWithTrigger","sideProp","alignProp","sideOffset","className","style","children","rest","popupMenuContext","usePopupMenuContext","selectContext","useSelectContext","open","alignItemWithTriggerActive","setAlignItemWithTriggerActive","positionState","setPositionState","positionerRef","scrollUpArrowRef","scrollDownArrowRef","resetPositioningState","selectedItemText","firstItemText","result","renderedSide","contextValue","mergedRef","node","shouldHide","alignmentStyles","jsx","SelectPositionerContext","Popover","SelectPositionerDataAttributes","Popover","React","jsx","jsxs","SelectRoot","props","openProp","onOpenChange","onOpenChangeComplete","actionsRef","defaultOpen","valueProp","defaultValue","onValueChange","multiple","valuesProp","defaultValues","onValuesChange","isItemEqualToValue","defaultItemEquality","itemToStringLabel","itemToStringValue","name","form","required","disabledProp","placeholder","items","modal","virtualized","virtualItems","onHighlightChange","debug","children","rest","listId","triggerRef","valueRef","selectedItemTextRef","firstItemTextRef","setTriggerElement","element","setValueElement","resetPositioningCallbackRef","registerResetPositioningCallback","callback","store","focusOwnerStore","openChainStore","registerSurface","closeAll","virtualization","handleOpenChange","menuDisabled","setDisabled","usePopupMenuRoot","popoverActionsRef","open","internalValue","setInternalValue","value","handleValueChange","newValue","internalValues","setInternalValues","values","handleValuesChange","newValues","itemTextRegistryRef","registerItemText","itemValue","text","selectContextValue","hiddenInputs","v","index","serializedValue","stringifyAsValue","handlePopoverOpenChange","nextOpen","popoverDetails","handleOpenChangeComplete","SelectContext","PopupMenuProviders","Popover","React","SelectSurfaceDataAttributes","jsx","SelectSurface","props","forwardedRef","autoHighlightFirstProp","rest","selectContext","useSelectContext","positionerContext","useSelectPositionerContext","autoHighlightFirst","serializeValue","value","stringifyAsValue","selectedValue","jsx","PopupMenuSurface","SelectSurfaceDataAttributes","Popover","useRender","React","SelectTriggerDataAttributes","jsx","stateAttributesMapping","value","SelectTriggerDataAttributes","SelectTriggerInner","props","forwardedRef","render","children","disabledProp","className","style","triggerProps","triggerState","rest","selectContext","useSelectContext","disabled","hasValue","state","internalRef","node","useRender","SelectTrigger","popupMenuContext","usePopupMenuContext","jsx","Popover","useRender","React","SelectValueDataAttributes","stateAttributesMapping","value","SelectValueDataAttributes","SelectValueImpl","props","forwardedRef","render","className","style","placeholderProp","children","rest","selectContext","useSelectContext","placeholder","hasValue","getValueText","serializedValue","stringifyAsValue","registryText","items","item","label","resolvedLabel","resolveLabel","state","content","texts","v","text","internalRef","node","useRender","SelectValue","SelectArrowDataAttributes","SelectBackdropDataAttributes","SelectEmptyDataAttributes","SelectGroupDataAttributes","SelectGroupLabelDataAttributes","SelectIconDataAttributes","SelectInputDataAttributes","SelectListDataAttributes","SelectPopupDataAttributes","SelectScrollArrowDataAttributes","SelectSeparatorDataAttributes"]}