@cloudflare/kumo 2.13.2 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +2 -2
  3. package/ai/component-registry.json +792 -64
  4. package/ai/component-registry.md +1666 -224
  5. package/ai/schemas.ts +110 -3
  6. package/dist/.build-complete +1 -1
  7. package/dist/ai/schemas.d.ts +360 -69
  8. package/dist/ai/schemas.js +216 -23
  9. package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
  10. package/dist/blocks-source/delete-resource/delete-resource.tsx +14 -8
  11. package/dist/catalog.d.ts +11 -11
  12. package/dist/chunks/{index.parts-ef9111sjk9e3al87.js → AccordionPanelDataAttributes-mmrmkky28u1010l5.js} +189 -120
  13. package/dist/chunks/{AlertDialogTrigger-k3f8nevrda6awa4s.js → AlertDialogTrigger-l1r1gbxcky1xq889.js} +5 -5
  14. package/dist/chunks/AlertDialogTriggerDataAttributes-go49qon601catpgn.js +56 -0
  15. package/dist/chunks/{AutocompleteItem-ksckpihly1c23f3j.js → AutocompleteItem-36ysm5nwbsd0snr6.js} +17 -29
  16. package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
  17. package/dist/chunks/AutocompleteSeparator-bnqeqh7i983d92gx.js +12 -0
  18. package/dist/chunks/{index.parts-i4iu310eo65d7lfc.js → AvatarImageDataAttributes-jw70u384c83lhqfp.js} +111 -35
  19. package/dist/chunks/{Button-oczevl8g75m85ew9.js → ButtonDataAttributes-nceand1fi7lvnmkb.js} +12 -4
  20. package/dist/chunks/{CSPContext-guqghj8kxoukvlky.js → CSPContext-iv67i0qqhihg8mur.js} +1 -7
  21. package/dist/chunks/{CSPProvider-f3it239kgztzgryk.js → CSPProvider-finau3a8hnc9o2td.js} +2 -2
  22. package/dist/chunks/{CheckboxGroup-g5xn5gnq8ocqyoum.js → CheckboxGroup-581mfftu99wvjb3a.js} +58 -45
  23. package/dist/chunks/{CheckboxGroupContext-f9wox07n2u5moq4h.js → CheckboxGroupContext-jf1bt3znvqlhrql6.js} +3 -5
  24. package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
  25. package/dist/chunks/{CheckboxRoot-o5bfpje6e4p6pdgm.js → CheckboxIndicator-i13dmhacfgqo328c.js} +187 -134
  26. package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
  27. package/dist/chunks/{CollapsiblePanel-e80n35tnsb2cskt9.js → CollapsiblePanel-md5suzmtnsyz1kab.js} +39 -38
  28. package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
  29. package/dist/chunks/{ComboboxClear-glm805v81uaaf3su.js → ComboboxClear-ioejwvtnmqanph88.js} +91 -99
  30. package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
  31. package/dist/chunks/{ComboboxEmpty-hwv2kjxnf9un635e.js → ComboboxEmpty-gkt1y5b81a4983v7.js} +770 -702
  32. package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
  33. package/dist/chunks/{ComboboxPopup-fx7xex6g75t9u0gm.js → ComboboxPopup-n8cbgys9st446j1i.js} +57 -57
  34. package/dist/chunks/{CompositeItem-l7zee38lq5m224d5.js → CompositeItem-kepwg8jtvgap06o6.js} +4 -7
  35. package/dist/chunks/CompositeList-gwuaf6d14s4da0j0.js +182 -0
  36. package/dist/chunks/{CompositeListContext-oetjj2x8li8678as.js → CompositeListContext-bejvmlu39hsfjzgu.js} +2 -5
  37. package/dist/chunks/{CompositeRoot-l6ot8jo0umdics5m.js → CompositeRoot-dnlkb27uw4g5aocf.js} +61 -63
  38. package/dist/chunks/{CompositeRootContext-ofhzmevv7hadjhyy.js → CompositeRootContext-obm54j7y6s86qwhq.js} +1 -1
  39. package/dist/chunks/{index.parts-bv57na43ve93uz3x.js → ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js} +82 -37
  40. package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
  41. package/dist/chunks/DialogCloseDataAttributes-12m7gwh3i6fd7d05.js +76 -0
  42. package/dist/chunks/{DialogPopup-mp89aob2nown2akq.js → DialogPopup-n6w7b389e7bs0472.js} +31 -72
  43. package/dist/chunks/DialogRoot-hkkqj7vcjpkx8qk8.js +16 -0
  44. package/dist/chunks/{DialogTrigger-cmok07cf3ks0kzug.js → DialogTrigger-kpugfkbfswqrus4u.js} +23 -20
  45. package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
  46. package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
  47. package/dist/chunks/{DirectionContext-jc1g0w645603sd6p.js → DirectionContext-kpby968j030psajn.js} +1 -4
  48. package/dist/chunks/{DirectionProvider-ihtfgxd5qpm6oth1.js → DirectionProvider-cg0pwzgdyg6r73r6.js} +2 -2
  49. package/dist/chunks/DrawerViewport-mzqpwvqtylnad8ib.js +1532 -0
  50. package/dist/chunks/DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js +1072 -0
  51. package/dist/chunks/FieldControl-hjj2tcqruozadgdi.js +122 -0
  52. package/dist/chunks/{FieldDescription-ju607ea6gwgzga8p.js → FieldDescription-orix2gepowrp5ni4.js} +13 -12
  53. package/dist/chunks/{FieldItemContext-j85dc0ihramj5ezs.js → FieldItemContext-ohsf45im6xhpay40.js} +1 -1
  54. package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
  55. package/dist/chunks/FieldLabel-fjc7tdis7rcbq8o4.js +353 -0
  56. package/dist/chunks/{FieldsetLegend-j5piwq1giyhrr8s4.js → FieldsetLegend-gl9z9eezr0xg9zr7.js} +7 -14
  57. package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
  58. package/dist/chunks/{FieldsetRootContext-b633e9uzilttuyfi.js → FieldsetRootContext-fphwizvcm55ydg94.js} +1 -1
  59. package/dist/chunks/{FloatingPortalLite-mlt7ztrvhzepwi5y.js → FloatingPortalLite-j7dsy7gokbxdoe1i.js} +3 -3
  60. package/dist/chunks/{popupStateMapping-hdv48wmkzb2mqful.js → FloatingRootStore-men6ufp3a2b296fh.js} +215 -243
  61. package/dist/chunks/{FloatingTree-oosjswl1s9q4obvg.js → FloatingTree-kiyzavvaum442o1s.js} +6 -6
  62. package/dist/chunks/Form-oz425k7r4abea8o4.js +113 -0
  63. package/dist/chunks/{FormContext-xz0b4h7ue30fkkn1.js → FormContext-jv19engyccpf6xcl.js} +4 -3
  64. package/dist/chunks/{Input-ovqfhsmpfcrg5czm.js → Input-ozudotydd679ly63.js} +2 -2
  65. package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
  66. package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
  67. package/dist/chunks/{LabelableContext-hetas2e4y0kywfas.js → LabelableContext-dz4wz3lu3lgqusu7.js} +50 -46
  68. package/dist/chunks/ListboxSeparator-skazx18vzzj7i9zp.js +21 -0
  69. package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
  70. package/dist/chunks/{MenuSubmenuTrigger-fzubf5xr7ohsgsi7.js → MenuSubmenuTrigger-hm5xbgik6aq95x35.js} +917 -473
  71. package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
  72. package/dist/chunks/{MenuTrigger-ntugq34yppc8ouwe.js → MenuTrigger-dlfvicsaggss0o9m.js} +45 -46
  73. package/dist/chunks/{Menubar-d57cyjuztbge4dvv.js → Menubar-ja5int05ihjj0ra4.js} +29 -30
  74. package/dist/chunks/{MenubarContext-ei2r6vu6lmsspozo.js → MenubarContext-ooz0h08i55c8oip5.js} +1 -1
  75. package/dist/chunks/{MeterLabel-c40b0q8r81cftkjj.js → MeterLabel-cykbkvqys5263z05.js} +15 -18
  76. package/dist/chunks/{index.parts-fl4zaorc97ed3keb.js → NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js} +470 -278
  77. package/dist/chunks/NullStore-my62xo2vfcfkerri.js +110 -0
  78. package/dist/chunks/{index.parts-7z8hqx6zl9yajzvs.js → NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js} +592 -528
  79. package/dist/chunks/{index.parts-bmzuqorz0tmneh7t.js → OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js} +189 -70
  80. package/dist/chunks/{PopoverClose-e91n3nkw16qnyese.js → PopoverViewport-peh28i8q4hqfjy97.js} +271 -224
  81. package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
  82. package/dist/chunks/PrehydrationScript-hs2je3mndbxuts7w.js +78 -0
  83. package/dist/chunks/{index.parts-nd3mitrhxf806lsa.js → PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js} +369 -147
  84. package/dist/chunks/ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js +287 -0
  85. package/dist/chunks/{RadioGroup-lsix4haqxfigpuv8.js → RadioGroup-kioqngmmuo7a1lfa.js} +49 -51
  86. package/dist/chunks/{RadioGroupContext-ft0nndmzqynjz8a2.js → RadioGroupContext-dr6uihsj7oky0eol.js} +1 -1
  87. package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
  88. package/dist/chunks/{RadioIndicator-mwkahpwyqfc6yk1i.js → RadioIndicator-bhxqih8wzv7hyrec.js} +108 -105
  89. package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
  90. package/dist/chunks/{ScrollAreaThumb-kmhan411yxfo0362.js → ScrollAreaThumb-hxig41yn4lrurd3o.js} +373 -389
  91. package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
  92. package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
  93. package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-nnak70azojox8b2b.js} +593 -561
  94. package/dist/chunks/{Separator-b8wf5rea6m1cei8k.js → Separator-fhwve0tfny3tht3a.js} +2 -2
  95. package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
  96. package/dist/chunks/{index.parts-hxjt52jbictdzgad.js → SliderIndicator-h1o3qbrvr8x0t4t2.js} +341 -399
  97. package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
  98. package/dist/chunks/{SwitchRoot-e3hnyh3mf8qd30hj.js → SwitchRoot-m4t2tq5zn5wibyxk.js} +96 -89
  99. package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
  100. package/dist/chunks/{TabsList-c0inft3sf8gi2o4v.js → TabsList-n5n93rxr4sy704u8.js} +225 -178
  101. package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
  102. package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
  103. package/dist/chunks/{Toggle-c8p9m3puz8l4mav7.js → ToggleDataAttributes-jl9ojyvwgrvefke6.js} +28 -14
  104. package/dist/chunks/{ToggleGroupContext-cdk2zo6ciddpockn.js → ToggleGroupContext-hg8zbkgqpscqhz83.js} +3 -5
  105. package/dist/chunks/{ToggleGroup-xz9zrh7t1htn6ht4.js → ToggleGroupDataAttributes-n1dwona1alvabstl.js} +35 -39
  106. package/dist/chunks/{ToolbarGroupContext-nriz3632ymugfj6h.js → ToolbarGroupContext-eawva8xkxb4osbxb.js} +3 -5
  107. package/dist/chunks/{ToolbarInput-er5t9irqvuwcjrir.js → ToolbarInput-kyxl1be0p3cyuayp.js} +28 -33
  108. package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
  109. package/dist/chunks/{ToolbarRootContext-lvi96r1vvs93rhde.js → ToolbarRootContext-difqbj720teyt8lu.js} +1 -1
  110. package/dist/chunks/{TooltipPopup-l2zrbjavf1cqclfx.js → TooltipPopup-furysmeyb68uycbz.js} +132 -161
  111. package/dist/chunks/{TooltipProvider-eyhgia63aq2x4frl.js → TooltipProvider-hyans0ens4axh1y8.js} +14 -17
  112. package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
  113. package/dist/chunks/adaptiveOriginMiddleware-m9tqzw58wya9sdds.js +51 -0
  114. package/dist/chunks/{addEventListener-lhqvk2ahlzjsanyg.js → addEventListener-ku3x23446prmd1kz.js} +1 -1
  115. package/dist/chunks/areArraysEqual-nnpg93s9g7aqcaoh.js +15 -0
  116. package/dist/chunks/{autocomplete-dn6g4rc8bktdl4an.js → autocomplete-kgp17p6oz4pczxt9.js} +10 -10
  117. package/dist/chunks/{badge-xw5ydgdjx2o5qxbl.js → badge-kyz53p7p0ng393bs.js} +4 -2
  118. package/dist/chunks/{banner-n1ekcvrwashsgv93.js → banner-cpla8vqjxaulggyd.js} +3 -3
  119. package/dist/chunks/{breadcrumbs-ffwe8tzqzmpyikq5.js → breadcrumbs-oyuqwb09l08uhok2.js} +9 -17
  120. package/dist/chunks/button-group-biv43ksvaipc3p5n.js +59 -0
  121. package/dist/chunks/{button-h36q7tklakhd38nx.js → button-oxy32x5w9x9az80g.js} +25 -6
  122. package/dist/chunks/{chart-qmls2klknm1pd6hs.js → chart-foxl6xbubuoshfcs.js} +945 -54
  123. package/dist/chunks/{checkbox-jachq6akfh72x12r.js → checkbox-o9627970y7c9ciqy.js} +90 -37
  124. package/dist/chunks/clamp-rcpupxvhqrn8uuyf.js +7 -0
  125. package/dist/chunks/{clipboard-text-ms46uaujvkjmjnng.js → clipboard-text-bhy88tgvk1o6wmyl.js} +6 -6
  126. package/dist/chunks/{cloudflare-logo-boafurcbm5ttoo4o.js → cloudflare-logo-d8mid9xr190h78cu.js} +3 -3
  127. package/dist/chunks/{code-eu8kzwqnlhoyin24.js → code-nj2nu6qzxhz6qnkk.js} +1 -1
  128. package/dist/chunks/{collapsible-jyajpe40jcca357s.js → collapsible-ic6813hc4yv5s5hv.js} +2 -2
  129. package/dist/chunks/{combobox-hxarufzb1z61xnbv.js → combobox-hwrq8etkr7p2id0x.js} +13 -12
  130. package/dist/chunks/{command-palette-iomiziccabzh4ogg.js → command-palette-el4x943vpmid0po0.js} +9 -9
  131. package/dist/chunks/{composite-o65hjzwwzb4kvl4w.js → composite-c11t1ok72s3cggjc.js} +9 -21
  132. package/dist/chunks/{constants-j09lrtg73n4vlx5x.js → constants-l10cgj6pyqg27jod.js} +1 -1
  133. package/dist/chunks/{core-kjfqbvgicl9i3abf.js → core-n0de50o00ej2ecfe.js} +69 -55
  134. package/dist/chunks/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
  135. package/dist/chunks/{ComboboxChipRemove-ksyozjezihhstmbu.js → createItems-n07tfwx89cdoar18.js} +125 -104
  136. package/dist/chunks/{createToastManager-kv89sv0xhhsvmq54.js → createToastManager-cxjmn4jx3ejh85fs.js} +353 -361
  137. package/dist/chunks/{css-d3t41yfupsmz7l1a.js → css-j501gxq1am2gnikh.js} +1 -1
  138. package/dist/chunks/{date-picker-fwe3vllwco4u1utz.js → date-picker-oee5ehsrepnlmltj.js} +58 -51
  139. package/dist/chunks/{date-range-picker-iymdx410i1hpvxai.js → date-range-picker-hpx3cdu9ve01jx6d.js} +16 -15
  140. package/dist/chunks/{dialog-o0164pgcyc74lvp9.js → dialog-lgrwmsumwpftp2u8.js} +14 -11
  141. package/dist/chunks/{dropdown-d5qrzj1w1a96w2we.js → dropdown-o875yxeqod7qp871.js} +134 -31
  142. package/dist/chunks/empty-ft85jcbs7fd5t3tn.js +96 -0
  143. package/dist/chunks/{engine-io35xsj9fgfxtihg.js → engine-hzmefiqm63hu0c7i.js} +2 -2
  144. package/dist/chunks/{engine-javascript-d795u677f1802oaf.js → engine-javascript-e9xj8hhz9xfqhpnu.js} +200 -185
  145. package/dist/chunks/{engine-oniguruma-xjlw46ay321yj1av.js → engine-oniguruma-ias56ildu01gf939.js} +8 -7
  146. package/dist/chunks/error-lbnic2b20qr3mukp.js +6 -0
  147. package/dist/chunks/{field-kgz7w7yixmtpg010.js → field-jzzlgre0jmrr38o2.js} +4 -4
  148. package/dist/chunks/{flow-fmfb3ri8cxo7w9ci.js → flow-imvwzp5p2f8y2dxm.js} +83 -63
  149. package/dist/chunks/formatNumber-b4kjdsebslm2b3t0.js +21 -0
  150. package/dist/chunks/{getCssDimensions-mi941fe1jvztqm6b.js → getCssDimensions-gckwdrp86f73cv51.js} +2 -2
  151. package/dist/chunks/getElementTransform-cz3jyftv0x5io95f.js +38 -0
  152. package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
  153. package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
  154. package/dist/chunks/{getPseudoElementBounds-jg72lmrlwgbqhmjh.js → getPseudoElementBounds-csuw8kwsoeyxd5tv.js} +13 -4
  155. package/dist/chunks/{github-light-kb466scjoy42qxpu.js → github-light-hir7yctc38258pwt.js} +1 -1
  156. package/dist/chunks/{graphql-gtqr4wytdf0qjybo.js → graphql-n9vlzkvcp2j19p7a.js} +1 -1
  157. package/dist/chunks/{grid-fjlo3wlpkwgw56y9.js → grid-nwiczrab3r4w0zr2.js} +1 -1
  158. package/dist/chunks/{html-ijyj3f9k0foag15c.js → html-nimj6ljkkifnc9ni.js} +2 -2
  159. package/dist/chunks/{index.parts-lz9cnngidxppvhz7.js → index.parts-db9pzsm9rrs9tp0t.js} +27 -40
  160. package/dist/chunks/{index.parts-i5twygaksh86erb7.js → index.parts-ggacwr0yakuemead.js} +7 -6
  161. package/dist/chunks/{index.parts-kt0w73ciea6adi2i.js → index.parts-pcg3pmf3yyro841t.js} +2 -2
  162. package/dist/chunks/{inertValue-f9pgp32jxnm88df3.js → inertValue-n09gkjvwwa1kddov.js} +2 -2
  163. package/dist/chunks/inline-copy-text-57r67slswfqvgbaf.js +104 -0
  164. package/dist/chunks/{input-group-kshukialqry0fmra.js → input-group-n08mcd8b36wbylro.js} +11 -8
  165. package/dist/chunks/{input-ikfimmpl5sngvh9s.js → input-il37wjigy2xtgdo2.js} +12 -11
  166. package/dist/chunks/{input-pehjmr1q131tz38w.js → input-ksy1w6j1m6olz6ck.js} +3 -3
  167. package/dist/chunks/{isElementDisabled-ffsy1y4adxocmexb.js → isElementDisabled-dyqutxpzdfppbohx.js} +1 -1
  168. package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
  169. package/dist/chunks/{label-ie2gpde0nco1avi7.js → label-hugrtzreeqk5mtqu.js} +10 -6
  170. package/dist/chunks/{layer-card-dnikj7emx8qeaspz.js → layer-card-mar4dya5kl1vvie6.js} +6 -4
  171. package/dist/chunks/layer-dialog-dwrrgv1wasrerow4.js +406 -0
  172. package/dist/chunks/{link-gp4swsrd3vfnvori.js → link-h84bkh8eem39p529.js} +4 -4
  173. package/dist/chunks/{loader-j2v6fab8iucuxz1z.js → loader-kv5nk8j8tsuesxqo.js} +2 -6
  174. package/dist/chunks/locale-provider-e3310bgo4lnffqkd.js +41 -0
  175. package/dist/chunks/{menubar-ljbsj2ulayebjyza.js → menubar-m5pqhx7lu5z7mkks.js} +14 -13
  176. package/dist/chunks/{mergeCleanups-pexn3wul6a4zn873.js → mergeCleanups-nw73c6jfwl5tyhw4.js} +1 -1
  177. package/dist/chunks/{meter-fl03ece4glrrzizj.js → meter-poh8jpe0qtq6mvee.js} +2 -2
  178. package/dist/chunks/{pagination-i3jewbdolgru0xnr.js → pagination-h24on80p2z5ugqdb.js} +3 -3
  179. package/dist/chunks/{popover-jal8z9sv176703lf.js → popover-nqrt3ykqv6sic8pz.js} +71 -17
  180. package/dist/chunks/popupHandle-dk3ixgc8flr7v971.js +177 -0
  181. package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
  182. package/dist/chunks/{portal-provider-gznk6snyqj6egd6d.js → portal-provider-eveknxf26oudn7pp.js} +4 -0
  183. package/dist/chunks/radio-d3pkrvsldfbdefav.js +203 -0
  184. package/dist/chunks/reason-parts-hssx64rmlxyn6gw5.js +40 -0
  185. package/dist/chunks/{resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js → resolveAriaLabelledBy-knaucrjrjwnk7tvs.js} +1 -1
  186. package/dist/chunks/{resolveValueLabel-bq3nrzord518kp9q.js → resolveValueLabel-ntacnb58mhka5gg0.js} +11 -30
  187. package/dist/chunks/{safePolygon-szbj0u31i6mpt36d.js → safePolygon-ep4133qogeu5vjf3.js} +51 -49
  188. package/dist/chunks/{safeReact-bavzz23j5tex60z2.js → safeReact-ek77ilng4ekk7mgz.js} +2 -2
  189. package/dist/chunks/scrollable-k784b35i80aolmvg.js +29 -0
  190. package/dist/chunks/{select-ndqpqpmqtmn497rq.js → select-ey03k4630uckf1rk.js} +10 -11
  191. package/dist/chunks/{sensitive-input-jtbp3mvdynz9wewu.js → sensitive-input-lfrrtyg9n5ulq3tb.js} +23 -28
  192. package/dist/chunks/{serializeValue-ci3kihruew64i36f.js → serializeValue-d1otz2i7h5tygrwf.js} +1 -1
  193. package/dist/chunks/{sidebar-icky50wdc2b1biw8.js → sidebar-gluq5b5oacrdk4m4.js} +120 -40
  194. package/dist/chunks/{skeleton-line-hlk5vauzo7xsalbo.js → skeleton-line-gjf1fecmyy82aejz.js} +9 -6
  195. package/dist/chunks/slider-juwif2d8xa5n0429.js +87 -0
  196. package/dist/chunks/{sql-do9h6435gka97c4c.js → sql-hqp2eekl7qhmxe92.js} +1 -1
  197. package/dist/chunks/{stringifyLocale-cl8et9xf6zon4qbs.js → stringifyLocale-gbxouqj7ol627jxh.js} +1 -1
  198. package/dist/chunks/{styles-dbhgpd8fm76fdfo3.js → styles-eb8bvypmayf578jf.js} +2 -2
  199. package/dist/chunks/{surface-ef2kr5pn7r1y3ipk.js → surface-ginwpan1pz61l6k2.js} +2 -2
  200. package/dist/chunks/{switch-oghrd7f6i5jqar59.js → switch-mqf1ulvle4nd6d2t.js} +4 -4
  201. package/dist/chunks/{table-miggde3uqhhrd5at.js → table-nysse5tiwf47gg4k.js} +2 -2
  202. package/dist/chunks/{table-of-contents-cvduqgssxdcbpagh.js → table-of-contents-gkjv9ck8etbz64ej.js} +5 -2
  203. package/dist/chunks/{tabs-mr2dsloqfe0io4a5.js → tabs-mmkz7q5rofnmogwt.js} +3 -3
  204. package/dist/chunks/tag-input-b10gfxoob9vcizpm.js +140 -0
  205. package/dist/chunks/{text-jzp4mdlr222iuzxt.js → text-me99rjbjkaff98gp.js} +4 -4
  206. package/dist/chunks/{toast-g435fvt74w5orxqo.js → toast-b4t9rt9y1sumcmy2.js} +8 -7
  207. package/dist/chunks/{toolbar-e0b61hr6ys6dmwhv.js → toolbar-hov6sa3ui366f447.js} +7 -6
  208. package/dist/chunks/{tooltip-jq15p5jzgfrhslpo.js → tooltip-lguwh8bjhxwnjfus.js} +4 -4
  209. package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
  210. package/dist/chunks/{useAnchoredPopupScrollLock-lbrqp1zm5z821z20.js → useAnchoredPopupScrollLock-msm8tzkewysnunut.js} +4 -4
  211. package/dist/chunks/{useAnimationFrame-ssgc72hyq6sg3yit.js → useAnimationFrame-k9lqdj9quln3sd85.js} +5 -4
  212. package/dist/chunks/{useAriaLabelledBy-bvw56m1d7czf0w3f.js → useAriaLabelledBy-j3j9jqlr9ukyk08s.js} +7 -9
  213. package/dist/chunks/{useBaseUiId-gqkl5ep5pn6hd0rw.js → useBaseUiId-nk4k7nj9h1cy76ny.js} +2 -2
  214. package/dist/chunks/{useButton-cpo6u2idqcnou6vy.js → useButton-lklvdzuhvj22bx07.js} +58 -21
  215. package/dist/chunks/{useClick-fvwb39qgead2jyft.js → useClick-pcbkcc7r620v1smu.js} +13 -12
  216. package/dist/chunks/{useCollapsiblePanel-bw63vwvq9a3sj73q.js → useCollapsiblePanel-lrfsgx21ds36cwlp.js} +116 -80
  217. package/dist/chunks/{useCompositeItem-esr3n4pmlssiuxuy.js → useCompositeItem-2juex3zh9gyrs8e9.js} +4 -4
  218. package/dist/chunks/useCompositeListItem-ekwo2j2rjkggg7xj.js +54 -0
  219. package/dist/chunks/{useControlled-nlx0kk1ksgk0auvi.js → useControlled-i3srnkxy598s0au9.js} +4 -4
  220. package/dist/chunks/useFieldValidation-oe16jiigp971yrzr.js +224 -0
  221. package/dist/chunks/{useFloatingRootContext-o6mk8fvodtbbm2v1.js → useFloatingRootContext-k676b6m7f80bdapd.js} +7 -7
  222. package/dist/chunks/{useFocus-gdfx28bn90keg8cf.js → useFocus-mn7a9t9v6fnlb4mf.js} +17 -15
  223. package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
  224. package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
  225. package/dist/chunks/{useLabel-nh9hf8h7o6oquqn5.js → useLabel-me6zzfvkypo458pi.js} +23 -12
  226. package/dist/chunks/useLabelableId-bjeh6q3pgrqjb7er.js +56 -0
  227. package/dist/chunks/{useListNavigation-jnxpvegv3ak857b1.js → useListNavigation-hpddbd0cc9pvt461.js} +62 -68
  228. package/dist/chunks/{useOnMount-j4wobeq47l3u9olo.js → useOnMount-gxggz1m0n869s6r0.js} +3 -3
  229. package/dist/chunks/{useOpenChangeComplete-dpkex2e23s1evpol.js → useOpenChangeComplete-edtabjwqmechsyv6.js} +51 -39
  230. package/dist/chunks/usePopupHandleStore-gawjmfjf1xdgiph3.js +27 -0
  231. package/dist/chunks/{usePopupViewport-hu0kn0ziyf1vqzrs.js → usePopupViewport-l6w01iohvzloghy8.js} +99 -75
  232. package/dist/chunks/{usePositioner-fz9uswhkhg22lo42.js → usePositioner-mzvgnazldqvy44z2.js} +160 -182
  233. package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
  234. package/dist/chunks/{usePreviousValue-le0grv8f43vmunn1.js → usePreviousValue-o6swt5tb7xhpdu4e.js} +2 -2
  235. package/dist/chunks/{useRegisterFieldControl-m1rxsuvtpau2341n.js → useRegisterFieldControl-m1stc9l9y4cndf0k.js} +16 -10
  236. package/dist/chunks/{useRegisteredLabelId-dh83mybmzy75waje.js → useRegisteredLabelId-b7u9ygya03448zzn.js} +4 -4
  237. package/dist/chunks/{useRender-gtnbrp1ityffi4xf.js → useRender-h9ktka9xt4obdv6y.js} +2 -2
  238. package/dist/chunks/useRenderDialogRoot-bsqrqpc1ddau7xg4.js +312 -0
  239. package/dist/chunks/{useRenderElement-m8kc7jyuczp71mq8.js → useRenderElement-nkklxbq1rp7h2kw0.js} +59 -56
  240. package/dist/chunks/{useScrollLock-mpns3u42eks8hhex.js → useScrollLock-le7ajwlt7oh6fzxi.js} +108 -85
  241. package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
  242. package/dist/chunks/{useStableCallback-ninxmksdjvwl6ejj.js → useStableCallback-le5qgj6p9l04729n.js} +3 -3
  243. package/dist/chunks/{useSwipeDismiss-bpbyw2ihsw3fw6y9.js → useSwipeDismiss-e8tfxzlp05p86mgb.js} +96 -217
  244. package/dist/chunks/{useTimeout-oqptmu2xmyv5ccic.js → useTimeout-f0ayn2l2l9aop4l8.js} +3 -3
  245. package/dist/chunks/{useTransitionStatus-ig4waxl2kervpyw4.js → useTransitionStatus-disysoblzgk34w14.js} +15 -7
  246. package/dist/chunks/{useTriggerFocusGuards-j8nano0pqu9dscrz.js → useTriggerFocusGuards-dyd3hb1m8en8ct50.js} +12 -21
  247. package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
  248. package/dist/chunks/{useTypeahead-onenwjyhgw955ygx.js → useTypeahead-kfdsw1ksl5bgvvzl.js} +20 -23
  249. package/dist/chunks/{useValueAsRef-lrn42zari17368c9.js → useValueAsRef-dv0tmfr1xlpzdlru.js} +3 -3
  250. package/dist/chunks/{useValueChanged-kthmz4wk7ywnjwtx.js → useValueChanged-fjssa2v6d4w8y332.js} +5 -8
  251. package/dist/chunks/{utils-0i7gujfv3f3e9dqh.js → utils-o44zfmzz9z7uyj1v.js} +0 -1
  252. package/dist/chunks/{valueToPercent-henpkkj3juy3ukeu.js → valueToPercent-djk2mqnihth2uvf6.js} +1 -1
  253. package/dist/chunks/{vendor-floating-ui-dsysdmve7iazaaes.js → vendor-floating-ui-fqblx3wa0r71mjoo.js} +87 -187
  254. package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
  255. package/dist/chunks/{vendor-utils-luqsvbyuig727bnr.js → vendor-utils-io8z5lsfxq8m2dcc.js} +191 -43
  256. package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
  257. package/dist/chunks/{visuallyHidden-n14xllazfozg55ox.js → visuallyHidden-kzzs9hbe93is3rci.js} +2 -1
  258. package/dist/chunks/{wasm-nfbosyhilcq70atf.js → wasm-cpasy0o9lsjrm39j.js} +1 -1
  259. package/dist/code/server.d.ts +9 -10
  260. package/dist/code/server.js +8 -7
  261. package/dist/code.d.ts +8 -8
  262. package/dist/code.js +23 -26
  263. package/dist/components/autocomplete.d.ts +1 -1
  264. package/dist/components/autocomplete.js +1 -1
  265. package/dist/components/badge.js +1 -1
  266. package/dist/components/banner.js +1 -1
  267. package/dist/components/breadcrumbs.js +1 -1
  268. package/dist/components/button-group.d.ts +2 -0
  269. package/dist/components/button-group.js +3 -0
  270. package/dist/components/button.js +1 -1
  271. package/dist/components/chart.d.ts +2 -2
  272. package/dist/components/chart.js +2 -2
  273. package/dist/components/checkbox.d.ts +1 -1
  274. package/dist/components/checkbox.js +1 -1
  275. package/dist/components/clipboard-text.js +1 -1
  276. package/dist/components/cloudflare-logo.js +1 -1
  277. package/dist/components/code.js +1 -1
  278. package/dist/components/collapsible.js +1 -1
  279. package/dist/components/combobox.d.ts +1 -1
  280. package/dist/components/combobox.js +1 -1
  281. package/dist/components/command-palette.d.ts +1 -1
  282. package/dist/components/command-palette.js +1 -1
  283. package/dist/components/date-picker.d.ts +1 -1
  284. package/dist/components/date-picker.js +1 -1
  285. package/dist/components/date-range-picker.js +1 -1
  286. package/dist/components/dialog.d.ts +1 -1
  287. package/dist/components/dialog.js +1 -1
  288. package/dist/components/dropdown.d.ts +1 -1
  289. package/dist/components/dropdown.js +1 -1
  290. package/dist/components/empty.js +1 -1
  291. package/dist/components/field.js +1 -1
  292. package/dist/components/flow.js +1 -1
  293. package/dist/components/grid.js +1 -1
  294. package/dist/components/inline-copy-text.d.ts +2 -0
  295. package/dist/components/inline-copy-text.js +3 -0
  296. package/dist/components/input-group.d.ts +1 -1
  297. package/dist/components/input-group.js +1 -1
  298. package/dist/components/input.d.ts +1 -1
  299. package/dist/components/input.js +3 -3
  300. package/dist/components/label.d.ts +1 -1
  301. package/dist/components/label.js +1 -1
  302. package/dist/components/layer-card.js +1 -1
  303. package/dist/components/layer-dialog.d.ts +2 -0
  304. package/dist/components/layer-dialog.js +3 -0
  305. package/dist/components/link.d.ts +8 -9
  306. package/dist/components/link.js +1 -1
  307. package/dist/components/loader.js +2 -2
  308. package/dist/components/menubar.js +1 -1
  309. package/dist/components/meter.js +1 -1
  310. package/dist/components/pagination.js +1 -1
  311. package/dist/components/popover.d.ts +1 -1
  312. package/dist/components/popover.js +1 -1
  313. package/dist/components/radio.d.ts +1 -1
  314. package/dist/components/radio.js +1 -1
  315. package/dist/components/select.d.ts +1 -1
  316. package/dist/components/select.js +1 -1
  317. package/dist/components/sensitive-input.d.ts +1 -1
  318. package/dist/components/sensitive-input.js +1 -1
  319. package/dist/components/sidebar.d.ts +1 -1
  320. package/dist/components/sidebar.js +1 -1
  321. package/dist/components/slider.d.ts +2 -0
  322. package/dist/components/slider.js +3 -0
  323. package/dist/components/surface.js +1 -1
  324. package/dist/components/switch.d.ts +1 -1
  325. package/dist/components/switch.js +1 -1
  326. package/dist/components/table-of-contents.d.ts +1 -1
  327. package/dist/components/table-of-contents.js +1 -1
  328. package/dist/components/table.d.ts +1 -1
  329. package/dist/components/table.js +1 -1
  330. package/dist/components/tabs.d.ts +1 -1
  331. package/dist/components/tabs.js +1 -1
  332. package/dist/components/tag-input.d.ts +2 -0
  333. package/dist/components/tag-input.js +3 -0
  334. package/dist/components/text.d.ts +1 -1
  335. package/dist/components/text.js +1 -1
  336. package/dist/components/toast.d.ts +1 -1
  337. package/dist/components/toast.js +2 -2
  338. package/dist/components/toolbar.d.ts +1 -1
  339. package/dist/components/toolbar.js +1 -1
  340. package/dist/components/tooltip.d.ts +1 -1
  341. package/dist/components/tooltip.js +1 -1
  342. package/dist/{index-BXsHCLB82.d.ts → index--RbAKeBL.d.ts} +1 -1
  343. package/dist/index-5bJAnzUo.d.ts +156 -0
  344. package/dist/{index-BoPqM1Ia2.d.ts → index-AUC5xRcO.d.ts} +65 -8
  345. package/dist/{index-CeBzVJP8.d.ts → index-BK1tZgmP.d.ts} +1 -1
  346. package/dist/{index-CGbkysYW2.d.ts → index-BMe3cpLB.d.ts} +5 -4
  347. package/dist/{index-Di3sC6UF.d.ts → index-BW1HVU7T.d.ts} +34 -6
  348. package/dist/index-BWe6haHU.d.ts +64 -0
  349. package/dist/{index-BcRyiNd72.d.ts → index-BvNXYn7u.d.ts} +8 -1
  350. package/dist/index-C7RoG_CH.d.ts +57 -0
  351. package/dist/{index-D-y1ktn-.d.ts → index-CE09bLNb.d.ts} +5 -1
  352. package/dist/{index-DBlw3E9m.d.ts → index-CNJRbVxG.d.ts} +1 -1
  353. package/dist/{index-bAud6rG22.d.ts → index-CU_lnxg7.d.ts} +13 -4
  354. package/dist/index-CiwC1j1N.d.ts +37 -0
  355. package/dist/{index-Bw3M24Mi.d.ts → index-CrQi3QCY.d.ts} +2 -1
  356. package/dist/{index-Vj9ZzRh0.d.ts → index-DNsSKNUe.d.ts} +4 -1
  357. package/dist/{index-D97n4Bpf2.d.ts → index-DWZia2ui.d.ts} +1 -1
  358. package/dist/{index-J1qdw9mL.d.ts → index-DjSGDESy.d.ts} +36 -2
  359. package/dist/{index-_Sl5wohy2.d.ts → index-RP_rt8vB.d.ts} +1 -1
  360. package/dist/{index-Cp0aQngm.d.ts → index-T1sSoiWG.d.ts} +3 -1
  361. package/dist/{index-BlEUcijd.d.ts → index-fsZE0vPs.d.ts} +81 -1
  362. package/dist/index-jNWPjJl9.d.ts +75 -0
  363. package/dist/index.d.ts +36 -30
  364. package/dist/index.js +69 -59
  365. package/dist/{input-group-DpGSsAZy.d.ts → input-group-B3M_WRqm.d.ts} +1 -1
  366. package/dist/locale-provider-CAjVN3_0.d.ts +32 -0
  367. package/dist/{portal-provider-4AHCxYE6.d.ts → portal-provider-BAqPpq_a.d.ts} +4 -0
  368. package/dist/primitives/accordion.js +2 -2
  369. package/dist/primitives/alert-dialog.js +7 -2
  370. package/dist/primitives/autocomplete.js +5 -2
  371. package/dist/primitives/avatar.js +2 -2
  372. package/dist/primitives/button.js +2 -2
  373. package/dist/primitives/checkbox-group.js +3 -2
  374. package/dist/primitives/checkbox.js +3 -2
  375. package/dist/primitives/collapsible.js +4 -2
  376. package/dist/primitives/combobox.js +5 -2
  377. package/dist/primitives/context-menu.js +5 -2
  378. package/dist/primitives/csp-provider.js +1 -1
  379. package/dist/primitives/dialog.js +8 -2
  380. package/dist/primitives/direction-provider.js +2 -2
  381. package/dist/primitives/drawer.js +5 -2
  382. package/dist/primitives/field.js +3 -2
  383. package/dist/primitives/fieldset.js +2 -2
  384. package/dist/primitives/form.js +1 -1
  385. package/dist/primitives/input.js +3 -2
  386. package/dist/primitives/menu.js +5 -2
  387. package/dist/primitives/menubar.js +2 -2
  388. package/dist/primitives/meter.js +1 -1
  389. package/dist/primitives/navigation-menu.js +2 -2
  390. package/dist/primitives/number-field.js +2 -2
  391. package/dist/primitives/otp-field.js +3 -2
  392. package/dist/primitives/popover.js +2 -2
  393. package/dist/primitives/preview-card.js +2 -2
  394. package/dist/primitives/progress.js +2 -2
  395. package/dist/primitives/radio-group.js +3 -2
  396. package/dist/primitives/radio.js +3 -2
  397. package/dist/primitives/scroll-area.js +3 -2
  398. package/dist/primitives/select.js +4 -2
  399. package/dist/primitives/separator.js +3 -2
  400. package/dist/primitives/slider.js +3 -2
  401. package/dist/primitives/switch.js +3 -2
  402. package/dist/primitives/tabs.js +3 -2
  403. package/dist/primitives/toast.js +4 -2
  404. package/dist/primitives/toggle-group.js +2 -2
  405. package/dist/primitives/toggle.js +2 -2
  406. package/dist/primitives/toolbar.js +2 -2
  407. package/dist/primitives/tooltip.js +3 -2
  408. package/dist/primitives.d.ts +2 -2
  409. package/dist/primitives.js +70 -42
  410. package/dist/scripts/theme-generator/config.d.ts +4 -5
  411. package/dist/scripts/theme-generator/types.d.ts +12 -13
  412. package/dist/styles/kumo-standalone.css +1 -1
  413. package/dist/{index-Dzzi1o7w2.d.ts → text-B4l7S5Z0.d.ts} +60 -1
  414. package/dist/{tooltip-BuCo6Ki4.d.ts → tooltip-D_vhi1PN.d.ts} +1 -1
  415. package/dist/{types-C402rKiz.d.ts → types-C6in2C8V.d.ts} +6 -3
  416. package/dist/utils.d.ts +3 -3
  417. package/dist/utils.js +5 -4
  418. package/package.json +27 -6
  419. package/scripts/component-registry/discovery.ts +4 -0
  420. package/scripts/component-registry/metadata.ts +75 -0
  421. package/scripts/generate-globe-land-mask.mjs +80 -0
  422. package/dist/chunks/CheckboxIndicator-igofmpn0wcfdqooa.js +0 -49
  423. package/dist/chunks/CompositeList-tx08unuok7wsl2d9.js +0 -129
  424. package/dist/chunks/DialogHandle-b3froel96o9fwjmm.js +0 -139
  425. package/dist/chunks/DialogRoot-fp7d16uxogvye294.js +0 -15
  426. package/dist/chunks/FieldControl-oz007qbkl6ejp7di.js +0 -104
  427. package/dist/chunks/FieldLabel-f6vwzm8nefzxwlh8.js +0 -558
  428. package/dist/chunks/Form-is7d5c1kbk1wn39s.js +0 -102
  429. package/dist/chunks/MenuBackdrop-dlntmavtopj7wv0l.js +0 -78
  430. package/dist/chunks/areArraysEqual-nlbeaqlzf4274zr3.js +0 -7
  431. package/dist/chunks/clamp-kvu4wtr1dw6b3pnd.js +0 -7
  432. package/dist/chunks/createBaseUIEventDetails-ddivuhl74gni72qn.js +0 -86
  433. package/dist/chunks/empty-ox60d384lkwbj5n4.js +0 -89
  434. package/dist/chunks/error-mm98alb8acdy93vq.js +0 -15
  435. package/dist/chunks/formatNumber-hjijm58g645q6a0n.js +0 -26
  436. package/dist/chunks/getEmptyRootContext-ekvv3rp5w16ewoqx.js +0 -18
  437. package/dist/chunks/index.parts-c5yto0l67i7ok5fd.js +0 -206
  438. package/dist/chunks/index.parts-cpviii2nt413tb8k.js +0 -30
  439. package/dist/chunks/index.parts-gj1k50tf9fcs7nru.js +0 -81
  440. package/dist/chunks/index.parts-gslyp9n88qdh38n1.js +0 -10
  441. package/dist/chunks/index.parts-hve0zir3biaolih0.js +0 -128
  442. package/dist/chunks/index.parts-i4lbjqdnhsnjtny6.js +0 -88
  443. package/dist/chunks/index.parts-ieuelcd4z5e0mcb7.js +0 -73
  444. package/dist/chunks/index.parts-j2ecf25zajyd5ia3.js +0 -11
  445. package/dist/chunks/index.parts-jmb5ztstw4xlfyp9.js +0 -46
  446. package/dist/chunks/index.parts-jv5kiaeixrjah9js.js +0 -119
  447. package/dist/chunks/index.parts-k7ezm98skegahepw.js +0 -2464
  448. package/dist/chunks/index.parts-komdbdvf823cm5jw.js +0 -41
  449. package/dist/chunks/index.parts-lhpuh6pw7rjcddnl.js +0 -156
  450. package/dist/chunks/index.parts-mr7tgwe4pgfozkt5.js +0 -245
  451. package/dist/chunks/index.parts-nc6jzjq91z2nye75.js +0 -11
  452. package/dist/chunks/index.parts-nzwjx603vcq1kryz.js +0 -127
  453. package/dist/chunks/index2.parts-kiwz8e3k8utvm4zb.js +0 -67
  454. package/dist/chunks/index2.parts-mv7x6w0p2splvf6b.js +0 -10
  455. package/dist/chunks/popupStoreUtils-jrxqkz5jmlijlr91.js +0 -367
  456. package/dist/chunks/radio-gvy6ekh5hu9awlru.js +0 -173
  457. package/dist/chunks/store-9b2cp7rx1dvq90fp.js +0 -88
  458. package/dist/chunks/useCompositeListItem-0exfww37ospqz69b.js +0 -75
  459. package/dist/chunks/useDismiss-kbtx2o3ruyh3jwgn.js +0 -353
  460. package/dist/chunks/useFilteredItems-ns32d3hpp626kt73.js +0 -183
  461. package/dist/chunks/useForcedRerendering-el1fbg3ib5yo0v7k.js +0 -14
  462. package/dist/chunks/useId-l9soitgw3e4jk5ie.js +0 -32
  463. package/dist/chunks/useIsHydrating-b6whcsimonagru6u.js +0 -22
  464. package/dist/chunks/useLabelableId-b1kwq9st3rjrtakn.js +0 -60
  465. package/dist/chunks/useRenderDialogRoot-hhowqeoreyr6uuc7.js +0 -262
  466. package/dist/chunks/vendor-styling-da1xibnxfkjmtglr.js +0 -3631
  467. package/dist/chunks/vesper-ho3j3gt6ilwfuc1g.js +0 -5
  468. package/dist/cn-DCSItmT-.d.ts +0 -5
  469. /package/dist/{index-AMEc1MEg2.d.ts → index-AMEc1MEg.d.ts} +0 -0
  470. /package/dist/{index-D2Gvly0i2.d.ts → index-D2Gvly0i.d.ts} +0 -0
  471. /package/dist/{index-DIV3riUd2.d.ts → index-DIV3riUd.d.ts} +0 -0
  472. /package/dist/{index-FCkuxSvs2.d.ts → index-FCkuxSvs.d.ts} +0 -0
@@ -1,41 +1,42 @@
1
1
  "use client";
2
- import { a as EMPTY_ARRAY, d as useRefWithInit, o as EMPTY_OBJECT, r as mergeProps, s as NOOP, t as useRenderElement, u as useMergedRefs } from "./useRenderElement-m8kc7jyuczp71mq8.js";
3
- import { d as createSelector, i as pressableTriggerOpenStateMapping, l as Store, u as useStore } from "./popupStateMapping-hdv48wmkzb2mqful.js";
4
- import { n as useIsoLayoutEffect } from "./safeReact-bavzz23j5tex60z2.js";
5
- import { n as useTimeout } from "./useTimeout-oqptmu2xmyv5ccic.js";
6
- import { B as stopEvent, H as android, O as contains, W as ios, f as getGridNavigatedIndex, g as isIndexOutOfListBounds, k as getTarget } from "./vendor-utils-luqsvbyuig727bnr.js";
7
- import { t as gecko } from "./engine-io35xsj9fgfxtihg.js";
8
- import { E as none, _ as inputChange, b as inputPress, d as escapeKey, n as createGenericEventDetails, o as closePress, t as createChangeEventDetails, v as inputClear, x as itemPress } from "./createBaseUIEventDetails-ddivuhl74gni72qn.js";
9
- import { t as useValueAsRef } from "./useValueAsRef-lrn42zari17368c9.js";
10
- import { t as useStableCallback } from "./useStableCallback-ninxmksdjvwl6ejj.js";
11
- import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-n14xllazfozg55ox.js";
12
- import { t as useDismiss } from "./useDismiss-kbtx2o3ruyh3jwgn.js";
13
- import { r as useOpenInteractionType } from "./useScrollLock-mpns3u42eks8hhex.js";
14
- import { t as useOpenChangeComplete } from "./useOpenChangeComplete-dpkex2e23s1evpol.js";
15
- import { t as useClick } from "./useClick-fvwb39qgead2jyft.js";
16
- import { h as useOnFirstRender, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-jrxqkz5jmlijlr91.js";
17
- import { t as useTransitionStatus } from "./useTransitionStatus-ig4waxl2kervpyw4.js";
18
- import { t as useFloatingRootContext } from "./useFloatingRootContext-o6mk8fvodtbbm2v1.js";
19
- import { t as useListNavigation } from "./useListNavigation-jnxpvegv3ak857b1.js";
20
- import { t as useBaseUiId } from "./useBaseUiId-gqkl5ep5pn6hd0rw.js";
21
- import { n as useDirection } from "./DirectionContext-jc1g0w645603sd6p.js";
22
- import { a as useFieldRootContext, c as fieldValidityMapping, i as FieldRootContext, n as useLabelableContext, o as DEFAULT_FIELD_STATE_ATTRIBUTES, r as DEFAULT_FIELD_ROOT_CONTEXT } from "./LabelableContext-hetas2e4y0kywfas.js";
23
- import { n as useFormContext } from "./FormContext-xz0b4h7ue30fkkn1.js";
24
- import { t as useLabelableId } from "./useLabelableId-b1kwq9st3rjrtakn.js";
25
- import { t as useControlled } from "./useControlled-nlx0kk1ksgk0auvi.js";
26
- import { t as useRegisterFieldControl } from "./useRegisterFieldControl-m1rxsuvtpau2341n.js";
27
- import { t as useButton } from "./useButton-cpo6u2idqcnou6vy.js";
28
- import { t as useValueChanged } from "./useValueChanged-kthmz4wk7ywnjwtx.js";
29
- import { t as areArraysEqual } from "./areArraysEqual-nlbeaqlzf4274zr3.js";
30
- import { a as stringifyAsLabel, c as defaultItemEquality, d as selectedValueIncludes, l as findItemIndex, n as isGroupedItems, o as stringifyAsValue, s as compareItemEquality, t as hasNullItemLabel, u as removeItem } from "./resolveValueLabel-bq3nrzord518kp9q.js";
31
- import { t as stringifyLocale } from "./stringifyLocale-cl8et9xf6zon4qbs.js";
32
- import { n as resolveAriaLabelledBy } from "./resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js";
33
- import { t as CompositeList } from "./CompositeList-tx08unuok7wsl2d9.js";
34
- import { n as useCompositeListItem, t as IndexGuessBehavior } from "./useCompositeListItem-0exfww37ospqz69b.js";
2
+ import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
3
+ import { c as NOOP, f as useMergedRefs, i as mergeProps, n as useRenderElement, o as EMPTY_ARRAY, p as useRefWithInit, s as EMPTY_OBJECT } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
4
+ import { n as ReactStore } from "./FloatingRootStore-men6ufp3a2b296fh.js";
5
+ import { n as useIsoLayoutEffect } from "./safeReact-ek77ilng4ekk7mgz.js";
6
+ import { $ as getTarget, N as popupOpen$1, P as pressed$1, Q as contains, X as activeElement, Z as closest, at as stopEvent, d as getGridNavigatedIndex, g as isIndexOutOfListBounds, j as pressableTriggerOpenStateMapping, st as android } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
7
+ import { t as gecko } from "./engine-hzmefiqm63hu0c7i.js";
8
+ import { E as isHTMLElement, S as getOverflowAncestors } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
9
+ import { n as createGenericEventDetails, t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
10
+ import { d as imperativeAction, g as inputClear, h as inputChange, i as closePress, l as escapeKey, v as inputPress, w as none, y as itemPress } from "./reason-parts-hssx64rmlxyn6gw5.js";
11
+ import { t as useValueAsRef } from "./useValueAsRef-dv0tmfr1xlpzdlru.js";
12
+ import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
13
+ import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-kzzs9hbe93is3rci.js";
14
+ import { g as useDismiss, i as attachPreventUnmountOnClose, m as useUnmountAfterClose, t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-czfnxn051xakask5.js";
15
+ import { r as useOpenInteractionType } from "./useScrollLock-le7ajwlt7oh6fzxi.js";
16
+ import { t as useClick } from "./useClick-pcbkcc7r620v1smu.js";
17
+ import { t as useFloatingRootContext } from "./useFloatingRootContext-k676b6m7f80bdapd.js";
18
+ import { a as useListNavigation } from "./useListNavigation-hpddbd0cc9pvt461.js";
19
+ import { t as useBaseUiId } from "./useBaseUiId-nk4k7nj9h1cy76ny.js";
20
+ import { n as useDirection } from "./DirectionContext-kpby968j030psajn.js";
21
+ import { a as useFieldRootContext, c as fieldValidityMapping, i as FieldRootContext, n as useLabelableContext, o as DEFAULT_FIELD_STATE_ATTRIBUTES, r as DEFAULT_FIELD_ROOT_CONTEXT } from "./LabelableContext-dz4wz3lu3lgqusu7.js";
22
+ import { n as useFormContext } from "./FormContext-jv19engyccpf6xcl.js";
23
+ import { t as useLabelableId } from "./useLabelableId-bjeh6q3pgrqjb7er.js";
24
+ import { t as useSetFieldFocused } from "./useSetFieldFocused-fbvj7gcv67dqfkp0.js";
25
+ import { t as useRegisterFieldControl } from "./useRegisterFieldControl-m1stc9l9y4cndf0k.js";
26
+ import { t as useValueChanged } from "./useValueChanged-fjssa2v6d4w8y332.js";
27
+ import { t as useControlled } from "./useControlled-i3srnkxy598s0au9.js";
28
+ import { t as useButton } from "./useButton-lklvdzuhvj22bx07.js";
29
+ import { r as isScrollableY } from "./scrollable-k784b35i80aolmvg.js";
30
+ import { a as isSelectedValueDirty, c as selectedValueIncludes, i as findSelectionIndex, l as useOnFirstRender, n as defaultItemEquality, o as removeItem, r as findItemIndex, s as resolveSelectedIndex, t as compareItemEquality } from "./itemEquality-ki3x4tzdhjlqjey6.js";
31
+ import { t as getHighlightReason } from "./getHighlightReason-fhc53kq6qakcct9s.js";
32
+ import { n as hasNullItemLabel, o as stringifyAsLabel, r as isGroupedItems, s as stringifyAsValue, t as flattenLeafItems } from "./resolveValueLabel-ntacnb58mhka5gg0.js";
33
+ import { n as getFilter, t as useInitialLiveRegionTextMutation } from "./useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js";
34
+ import { t as CompositeList } from "./CompositeList-gwuaf6d14s4da0j0.js";
35
+ import { t as useCompositeListItem } from "./useCompositeListItem-ekwo2j2rjkggg7xj.js";
35
36
  import * as React$1 from "react";
36
37
  import { jsx, jsxs } from "react/jsx-runtime";
37
38
  import * as ReactDOM from "react-dom";
38
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/hooks/gridNavigation.mjs
39
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/hooks/gridNavigation.mjs
39
40
  /**
40
41
  * Positional arguments are deliberate: property names of an options object
41
42
  * don't minify, and the signature is locked to the caller via `typeof` on the
@@ -64,7 +65,7 @@ function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl,
64
65
  return isIndexOutOfListBounds(listRef.current, nextIndex) ? void 0 : nextIndex;
65
66
  }
66
67
  //#endregion
67
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/ComboboxRootContext.mjs
68
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/ComboboxRootContext.mjs
68
69
  const ComboboxRootContext = /*#__PURE__*/ React$1.createContext(void 0);
69
70
  ComboboxRootContext.displayName = "ComboboxRootContext";
70
71
  const ComboboxFloatingContext = /*#__PURE__*/ React$1.createContext(void 0);
@@ -97,69 +98,73 @@ function useComboboxHasItemsContext() {
97
98
  return React$1.useContext(ComboboxHasItemsContext);
98
99
  }
99
100
  //#endregion
100
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/store.mjs
101
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/store.mjs
102
+ /**
103
+ * Non-reactive values shared with the combobox parts. Nothing here is observable through
104
+ * `selectors`, so writing to a ref never notifies subscribers.
105
+ */
101
106
  const selectors = {
102
- id: createSelector((state) => state.id),
103
- labelId: createSelector((state) => state.labelId),
104
- items: createSelector((state) => state.items),
105
- selectedValue: createSelector((state) => state.selectedValue),
106
- hasSelectionChips: createSelector((state) => {
107
+ id: (state) => state.id,
108
+ labelId: (state) => state.labelId,
109
+ items: (state) => state.items,
110
+ selectedValue: (state) => state.selectedValue,
111
+ hasSelectionChips: (state) => {
107
112
  const selectedValue = state.selectedValue;
108
113
  return Array.isArray(selectedValue) && selectedValue.length > 0;
109
- }),
110
- hasSelectedValue: createSelector((state) => {
114
+ },
115
+ hasSelectedValue: (state) => {
111
116
  const { selectedValue, selectionMode } = state;
112
117
  if (selectedValue == null) return false;
113
118
  if (selectionMode === "multiple" && Array.isArray(selectedValue)) return selectedValue.length > 0;
114
119
  return true;
115
- }),
116
- hasNullItemLabel: createSelector((state, enabled) => {
120
+ },
121
+ hasNullItemLabel: (state, enabled) => {
117
122
  return enabled ? hasNullItemLabel(state.items) : false;
118
- }),
119
- open: createSelector((state) => state.open),
120
- mounted: createSelector((state) => state.mounted),
121
- forceMounted: createSelector((state) => state.forceMounted),
122
- inline: createSelector((state) => state.inline),
123
- activeIndex: createSelector((state) => state.activeIndex),
124
- selectedIndex: createSelector((state) => state.selectedIndex),
125
- isActive: createSelector((state, index) => state.activeIndex === index),
126
- isSelected: createSelector((state, itemValue) => {
123
+ },
124
+ open: (state) => state.open,
125
+ mounted: (state) => state.mounted,
126
+ forceMounted: (state) => state.forceMounted,
127
+ inline: (state) => state.inline,
128
+ activeIndex: (state) => state.activeIndex,
129
+ selectedIndex: (state) => state.selectedIndex,
130
+ isActive: (state, index) => state.activeIndex === index,
131
+ isSelected: (state, itemValue) => {
127
132
  const comparer = state.isItemEqualToValue;
128
133
  const selectedValue = state.selectedValue;
129
134
  if (Array.isArray(selectedValue)) return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
130
135
  return compareItemEquality(itemValue, selectedValue, comparer);
131
- }),
132
- transitionStatus: createSelector((state) => state.transitionStatus),
133
- popupProps: createSelector((state) => state.popupProps),
134
- inputProps: createSelector((state) => state.inputProps),
135
- triggerProps: createSelector((state) => state.triggerProps),
136
- itemProps: createSelector((state) => state.itemProps),
137
- positionerElement: createSelector((state) => state.positionerElement),
138
- listElement: createSelector((state) => state.listElement),
139
- popupId: createSelector((state) => state.popupId),
140
- triggerElement: createSelector((state) => state.triggerElement),
141
- inputElement: createSelector((state) => state.inputElement),
142
- inputGroupElement: createSelector((state) => state.inputGroupElement),
143
- popupSide: createSelector((state) => state.popupSide),
144
- openMethod: createSelector((state) => state.openMethod),
145
- inputInsidePopup: createSelector((state) => state.inputInsidePopup),
146
- inputOwnsFormValue: createSelector((state) => state.inputOwnsFormValue),
147
- selectionMode: createSelector((state) => state.selectionMode),
148
- name: createSelector((state) => state.name),
149
- form: createSelector((state) => state.form),
150
- disabled: createSelector((state) => state.disabled),
151
- readOnly: createSelector((state) => state.readOnly),
152
- required: createSelector((state) => state.required),
153
- grid: createSelector((state) => state.grid),
154
- virtualized: createSelector((state) => state.virtualized),
155
- itemToStringLabel: createSelector((state) => state.itemToStringLabel),
156
- isItemEqualToValue: createSelector((state) => state.isItemEqualToValue),
157
- modal: createSelector((state) => state.modal),
158
- autoHighlight: createSelector((state) => state.autoHighlight),
159
- submitOnItemClick: createSelector((state) => state.submitOnItemClick)
136
+ },
137
+ transitionStatus: (state) => state.transitionStatus,
138
+ popupProps: (state) => state.popupProps,
139
+ listProps: (state) => state.listProps,
140
+ inputProps: (state) => state.inputProps,
141
+ triggerProps: (state) => state.triggerProps,
142
+ itemRoot: (state) => state.itemRoot,
143
+ positionerElement: (state) => state.positionerElement,
144
+ listElement: (state) => state.listElement,
145
+ popupId: (state) => state.popupId,
146
+ triggerElement: (state) => state.triggerElement,
147
+ inputElement: (state) => state.inputElement,
148
+ inputGroupElement: (state) => state.inputGroupElement,
149
+ popupSide: (state) => state.popupSide,
150
+ openMethod: (state) => state.openMethod,
151
+ inputInsidePopup: (state) => state.inputInsidePopup,
152
+ inputOwnsFormValue: (state) => state.inputOwnsFormValue,
153
+ selectionMode: (state) => state.selectionMode,
154
+ name: (state) => state.name,
155
+ form: (state) => state.form,
156
+ disabled: (state) => state.disabled,
157
+ readOnly: (state) => state.readOnly,
158
+ required: (state) => state.required,
159
+ grid: (state) => state.grid,
160
+ virtualized: (state) => state.virtualized,
161
+ itemToStringLabel: (state) => state.itemToStringLabel,
162
+ isItemEqualToValue: (state) => state.isItemEqualToValue,
163
+ modal: (state) => state.modal,
164
+ autoHighlight: (state) => state.autoHighlight
160
165
  };
161
166
  //#endregion
162
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/index.mjs
167
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/index.mjs
163
168
  /**
164
169
  * Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.
165
170
  * Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)
@@ -177,8 +182,7 @@ function getComboboxPopupId(rootId) {
177
182
  function createCollatorItemFilter(collatorFilter, itemToStringLabel) {
178
183
  return (item, query) => {
179
184
  if (item == null) return false;
180
- const itemString = stringifyAsLabel(item, itemToStringLabel);
181
- return collatorFilter.contains(itemString, query);
185
+ return collatorFilter.contains(item, query, itemToStringLabel);
182
186
  };
183
187
  }
184
188
  /**
@@ -189,50 +193,14 @@ function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel,
189
193
  return (item, query) => {
190
194
  if (item == null) return false;
191
195
  if (!query) return true;
192
- const itemString = stringifyAsLabel(item, itemToStringLabel);
193
- const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, itemToStringLabel) : "";
196
+ const selectedValueToString = itemToStringLabel?.selected ?? itemToStringLabel;
197
+ const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, selectedValueToString) : "";
194
198
  if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) return true;
195
- return collatorFilter.contains(itemString, query);
196
- };
197
- }
198
- //#endregion
199
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/filter.mjs
200
- const filterCache = /* @__PURE__ */ new Map();
201
- function getFilter(options = {}) {
202
- const mergedOptions = {
203
- usage: "search",
204
- sensitivity: "base",
205
- ignorePunctuation: true,
206
- ...options
207
- };
208
- const cacheKey = `${stringifyLocale(options.locale)}|${JSON.stringify(mergedOptions)}`;
209
- const cachedFilter = filterCache.get(cacheKey);
210
- if (cachedFilter) return cachedFilter;
211
- const collator = new Intl.Collator(options.locale, mergedOptions);
212
- const filter = {
213
- contains(item, query, itemToString) {
214
- if (!query) return true;
215
- const itemString = stringifyAsLabel(item, itemToString);
216
- for (let i = 0; i <= itemString.length - query.length; i += 1) if (collator.compare(itemString.slice(i, i + query.length), query) === 0) return true;
217
- return false;
218
- },
219
- startsWith(item, query, itemToString) {
220
- if (!query) return true;
221
- const itemString = stringifyAsLabel(item, itemToString);
222
- return collator.compare(itemString.slice(0, query.length), query) === 0;
223
- },
224
- endsWith(item, query, itemToString) {
225
- if (!query) return true;
226
- const itemString = stringifyAsLabel(item, itemToString);
227
- const queryLength = query.length;
228
- return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;
229
- }
199
+ return collatorFilter.contains(item, query, itemToStringLabel);
230
200
  };
231
- filterCache.set(cacheKey, filter);
232
- return filter;
233
201
  }
234
202
  //#endregion
235
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/useFilter.mjs
203
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/useFilter.mjs
236
204
  /**
237
205
  * Matches items against a query using `Intl.Collator` for robust string matching.
238
206
  */
@@ -252,32 +220,98 @@ function useComboboxFilter(options = {}) {
252
220
  multiple
253
221
  ]);
254
222
  return React$1.useMemo(() => ({
255
- contains,
256
- startsWith: coreFilter.startsWith,
257
- endsWith: coreFilter.endsWith
223
+ ...coreFilter,
224
+ contains
258
225
  }), [contains, coreFilter]);
259
226
  }
260
227
  //#endregion
261
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/constants.mjs
228
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/constants.mjs
262
229
  const NO_ACTIVE_VALUE = Symbol("none");
263
230
  const INITIAL_LAST_HIGHLIGHT = {
264
231
  value: NO_ACTIVE_VALUE,
265
232
  index: -1
266
233
  };
267
234
  //#endregion
268
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/AriaCombobox.mjs
235
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/items/itemCollection.mjs
236
+ function findCollectionItem(valueToItem, itemValue, isEqual) {
237
+ const exactItem = valueToItem.get(itemValue);
238
+ if (exactItem !== void 0 || isEqual === defaultItemEquality) return exactItem;
239
+ for (const [derivedValue, item] of valueToItem) if (compareItemEquality(derivedValue, itemValue, isEqual)) return item;
240
+ }
241
+ /**
242
+ * An opaque collection created by `createItems()`.
243
+ *
244
+ * It carries the source item and derived value types so the root can infer the list item and
245
+ * selection value types.
246
+ *
247
+ * Pass it directly to the root's `items` prop; it has no public members.
248
+ */
249
+ /**
250
+ * Internal shape of a collection. The extra members let the root project items to
251
+ * their values and resolve a selected value back to its label while items are unmounted.
252
+ */
253
+ //#endregion
254
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/AriaCombobox.mjs
269
255
  /**
270
256
  * @internal
271
257
  */
272
258
  function AriaCombobox(props) {
273
- const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue: defaultInputValueProp, inputValue: inputValueProp, open: openProp, defaultOpen = false, selectionMode = "none", onItemHighlighted: onItemHighlightedProp, name: nameProp, form, disabled: disabledProp = false, readOnly = false, required = false, inputRef: inputRefProp, grid = false, items, filteredItems: filteredItemsProp, filter: filterProp, openOnInputClick = true, autoHighlight = false, keepHighlight = false, highlightItemOnHover = true, loopFocus = true, itemToStringLabel, itemToStringValue, isItemEqualToValue = defaultItemEquality, virtualized = false, inline: inlineProp = false, fillInputOnItemPress = true, modal = false, limit = -1, autoComplete = "list", formAutoComplete, locale, submitOnItemClick = false } = props;
259
+ const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue, inputValue: inputValueProp, open: openProp, defaultOpen = false, selectionMode, onItemHighlighted: onItemHighlightedProp, name: nameProp, form, disabled: disabledProp = false, readOnly = false, required = false, inputRef: inputRefProp, grid = false, items: itemsProp, filteredItems: filteredItemsProp, filter: filterProp, filterQuery: filterQueryProp, openOnInputClick = true, autoHighlight = false, keepHighlight = false, highlightItemOnHover = true, loopFocus = true, itemToStringLabel: itemToStringLabelProp, itemToStringValue, isItemEqualToValue = defaultItemEquality, virtualized = false, inline: inlineProp = false, fillInputOnItemPress = true, modal = false, limit = -1, autoComplete = "list", formAutoComplete, locale, submitOnItemClick = false } = props;
274
260
  const { clearErrors } = useFormContext();
275
261
  const { setDirty, validityData, setFilled, name: fieldName, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
276
262
  const direction = useDirection();
277
263
  const id = useLabelableId({ id: idProp });
278
264
  const collatorFilter = useCoreFilter({ locale });
265
+ const collection = Array.isArray(itemsProp) ? null : itemsProp;
266
+ if (collection && typeof collection.label !== "function") throw new Error("Base UI: the `items` prop received an object that is not a collection, so its items cannot be read. Pass an array of items, an array of groups with items, or the result of `createItems()`. See https://base-ui.com/react/components/combobox#createitems");
267
+ const items = collection ? collection.data : itemsProp;
268
+ const itemToValue = collection?.value;
269
+ const storeItems = itemToValue ? void 0 : items;
270
+ const externalWindow = React$1.useMemo(() => {
271
+ if (!filteredItemsProp || !itemToValue) return;
272
+ const flat = flattenLeafItems(filteredItemsProp);
273
+ const values = flat.map(itemToValue);
274
+ let valueToItem;
275
+ return {
276
+ values,
277
+ findItem(itemValue, isEqual) {
278
+ if (!valueToItem) {
279
+ valueToItem = /* @__PURE__ */ new Map();
280
+ for (let i = 0; i < values.length; i += 1) if (!valueToItem.has(values[i])) valueToItem.set(values[i], flat[i]);
281
+ }
282
+ return findCollectionItem(valueToItem, itemValue, isEqual);
283
+ }
284
+ };
285
+ }, [filteredItemsProp, itemToValue]);
286
+ const itemToStringLabel = React$1.useMemo(() => {
287
+ if (!collection) return itemToStringLabelProp;
288
+ return (itemValue) => {
289
+ return collection.label(itemValue, isItemEqualToValue, (unresolvedValue) => {
290
+ const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);
291
+ if (externalItem != null) return collection.itemLabel(externalItem);
292
+ return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);
293
+ });
294
+ };
295
+ }, [
296
+ collection,
297
+ itemToStringLabelProp,
298
+ externalWindow,
299
+ isItemEqualToValue
300
+ ]);
301
+ const filterItemToString = React$1.useMemo(() => {
302
+ if (!collection) return itemToStringLabelProp;
303
+ return Object.assign((item) => collection.itemLabel(item), { selected: (value) => stringifyAsLabel(value, itemToStringLabel) });
304
+ }, [
305
+ collection,
306
+ itemToStringLabel,
307
+ itemToStringLabelProp
308
+ ]);
309
+ function stringifyValueLabel(item) {
310
+ return stringifyAsLabel(item, itemToStringLabel);
311
+ }
279
312
  const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React$1.useState(false);
280
313
  const [closeQuery, setCloseQuery] = React$1.useState(null);
314
+ const previousCloseQueryRef = React$1.useRef(closeQuery);
281
315
  const listRef = React$1.useRef([]);
282
316
  const labelsRef = React$1.useRef([]);
283
317
  const popupRef = React$1.useRef(null);
@@ -285,7 +319,6 @@ function AriaCombobox(props) {
285
319
  const startDismissRef = React$1.useRef(null);
286
320
  const endDismissRef = React$1.useRef(null);
287
321
  const emptyRef = React$1.useRef(null);
288
- const keyboardActiveRef = React$1.useRef(true);
289
322
  const hadInputClearRef = React$1.useRef(false);
290
323
  const chipsContainerRef = React$1.useRef(null);
291
324
  const clearRef = React$1.useRef(null);
@@ -297,17 +330,15 @@ function AriaCombobox(props) {
297
330
  */
298
331
  const valuesRef = React$1.useRef([]);
299
332
  /**
300
- * Contains all item values in a stable, unfiltered order.
301
- * This is only used when `items` prop is not provided.
302
- * It accumulates values on first mount and does not remove them on unmount due to
303
- * filtering, providing a stable index for selected value tracking.
333
+ * The item element that received the last `pointerdown`, used to detect whether a
334
+ * `mouseup` on an item belongs to a drag-select gesture that started elsewhere.
304
335
  */
305
- const allValuesRef = React$1.useRef([]);
336
+ const pointerDownItemRef = React$1.useRef(null);
306
337
  const disabled = fieldDisabled || disabledProp;
307
338
  const name = fieldName ?? nameProp;
308
339
  const multiple = selectionMode === "multiple";
309
340
  const single = selectionMode === "single";
310
- const hasInputValue = inputValueProp !== void 0 || defaultInputValueProp !== void 0;
341
+ const hasInputValue = inputValueProp !== void 0 || defaultInputValue !== void 0;
311
342
  const hasItems = items !== void 0;
312
343
  const hasFilteredItemsProp = filteredItemsProp !== void 0;
313
344
  let autoHighlightMode;
@@ -322,19 +353,15 @@ function AriaCombobox(props) {
322
353
  const filter = React$1.useMemo(() => {
323
354
  if (filterProp === null) return () => true;
324
355
  if (filterProp !== void 0) return filterProp;
325
- if (single && !queryChangedAfterOpen) return createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue);
326
- return createCollatorItemFilter(collatorFilter, itemToStringLabel);
356
+ return createCollatorItemFilter(collatorFilter, filterItemToString);
327
357
  }, [
328
358
  filterProp,
329
- single,
330
- selectedValue,
331
- queryChangedAfterOpen,
332
359
  collatorFilter,
333
- itemToStringLabel
360
+ filterItemToString
334
361
  ]);
335
362
  const initialDefaultInputValue = useRefWithInit(() => {
336
- if (hasInputValue) return defaultInputValueProp ?? "";
337
- if (single) return stringifyAsLabel(selectedValue, itemToStringLabel);
363
+ if (hasInputValue) return defaultInputValue ?? "";
364
+ if (single) return stringifyValueLabel(selectedValue);
338
365
  return "";
339
366
  }).current;
340
367
  const [inputValue, setInputValueUnwrapped] = useControlled({
@@ -350,16 +377,12 @@ function AriaCombobox(props) {
350
377
  state: "open"
351
378
  });
352
379
  const isGrouped = isGroupedItems(items);
353
- const query = closeQuery ?? (inputValue === "" ? "" : String(inputValue).trim());
354
- const selectedLabelString = single ? stringifyAsLabel(selectedValue, itemToStringLabel) : "";
355
- const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
356
- const filterQuery = shouldBypassFiltering ? "" : query;
357
- const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;
358
- const flatItems = React$1.useMemo(() => {
359
- if (!items) return EMPTY_ARRAY;
360
- if (isGrouped) return items.flatMap((group) => group.items);
361
- return items;
362
- }, [items, isGrouped]);
380
+ const query = !open && closeQuery !== null ? closeQuery : String(inputValue).trim();
381
+ const selectedLabelString = single ? stringifyValueLabel(selectedValue) : "";
382
+ const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
383
+ const filterQuery = shouldBypassFiltering ? "" : filterQueryProp ?? query;
384
+ const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));
385
+ const flatItems = React$1.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);
363
386
  const filteredItems = React$1.useMemo(() => {
364
387
  if (filteredItemsProp && !shouldIgnoreExternalFiltering) return filteredItemsProp;
365
388
  if (!items) return EMPTY_ARRAY;
@@ -369,10 +392,12 @@ function AriaCombobox(props) {
369
392
  let currentCount = 0;
370
393
  for (const group of groupedItems) {
371
394
  if (limit > -1 && currentCount >= limit) break;
372
- const candidateItems = filterQuery === "" ? group.items : group.items.filter((item) => filter(item, filterQuery, itemToStringLabel));
373
- if (candidateItems.length === 0) continue;
374
395
  const remainingLimit = limit > -1 ? limit - currentCount : Infinity;
375
- const itemsToTake = candidateItems.slice(0, remainingLimit);
396
+ const itemsToTake = filterQuery === "" ? group.items.slice(0, remainingLimit) : [];
397
+ if (filterQuery !== "") for (const item of group.items) {
398
+ if (itemsToTake.length >= remainingLimit) break;
399
+ if (filter(item, filterQuery, filterItemToString)) itemsToTake.push(item);
400
+ }
376
401
  if (itemsToTake.length > 0) {
377
402
  const newGroup = {
378
403
  ...group,
@@ -388,7 +413,7 @@ function AriaCombobox(props) {
388
413
  const limitedItems = [];
389
414
  for (const item of flatItems) {
390
415
  if (limit > -1 && limitedItems.length >= limit) break;
391
- if (filter(item, filterQuery, itemToStringLabel)) limitedItems.push(item);
416
+ if (filter(item, filterQuery, filterItemToString)) limitedItems.push(item);
392
417
  }
393
418
  return limitedItems;
394
419
  }, [
@@ -399,80 +424,97 @@ function AriaCombobox(props) {
399
424
  filterQuery,
400
425
  limit,
401
426
  filter,
402
- itemToStringLabel,
427
+ filterItemToString,
403
428
  flatItems
404
429
  ]);
405
- const flatFilteredItems = React$1.useMemo(() => {
406
- if (isGrouped) return filteredItems.flatMap((g) => g.items);
407
- return filteredItems;
408
- }, [filteredItems, isGrouped]);
409
- const store = useRefWithInit(() => new Store({
410
- id,
411
- labelId: void 0,
412
- selectedValue,
413
- open,
414
- filter,
415
- query,
416
- items,
417
- selectionMode,
418
- listRef,
419
- labelsRef,
420
- popupRef,
421
- emptyRef,
422
- inputRef,
423
- startDismissRef,
424
- endDismissRef,
425
- keyboardActiveRef,
426
- chipsContainerRef,
427
- clearRef,
428
- valuesRef,
429
- allValuesRef,
430
- selectionEventRef,
431
- name,
432
- form,
433
- disabled,
434
- readOnly,
435
- required,
436
- grid,
437
- isGrouped,
438
- virtualized,
439
- openOnInputClick,
440
- itemToStringLabel,
441
- isItemEqualToValue,
442
- modal,
443
- autoHighlight: autoHighlightMode,
444
- submitOnItemClick,
445
- hasInputValue,
446
- mounted: false,
447
- forceMounted: false,
448
- transitionStatus: "idle",
449
- inline: inlineProp,
450
- activeIndex: null,
451
- selectedIndex: null,
452
- popupProps: {},
453
- inputProps: {},
454
- triggerProps: {},
455
- itemProps: EMPTY_OBJECT,
456
- positionerElement: null,
457
- listElement: null,
458
- popupId: void 0,
459
- triggerElement: null,
460
- inputElement: null,
461
- inputGroupElement: null,
462
- popupSide: null,
463
- openMethod: null,
464
- inputInsidePopup: true,
465
- inputOwnsFormValue: selectionMode === "none",
466
- onOpenChangeComplete: onOpenChangeCompleteProp || NOOP,
467
- setOpen: NOOP,
468
- setInputValue: NOOP,
469
- setSelectedValue: NOOP,
470
- setIndices: NOOP,
471
- onItemHighlighted: NOOP,
472
- handleSelection: NOOP,
473
- forceMount: NOOP,
474
- requestSubmit: NOOP
475
- })).current;
430
+ /**
431
+ * The filtered items flattened across groups and projected to their selection values.
432
+ */
433
+ const flatFilteredValues = React$1.useMemo(() => {
434
+ if (externalWindow && filteredItems === filteredItemsProp) return externalWindow.values;
435
+ const flat = flattenLeafItems(filteredItems);
436
+ return itemToValue ? flat.map((item) => itemToValue(item)) : flat;
437
+ }, [
438
+ filteredItems,
439
+ filteredItemsProp,
440
+ externalWindow,
441
+ itemToValue
442
+ ]);
443
+ const store = useRefWithInit(() => {
444
+ let initialSelectedIndex = null;
445
+ if (inlineProp && open && hasItems && selectionMode !== "none") initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);
446
+ return new ReactStore({
447
+ id,
448
+ labelId: void 0,
449
+ selectedValue,
450
+ open,
451
+ items: storeItems,
452
+ selectionMode,
453
+ name,
454
+ form,
455
+ disabled,
456
+ readOnly,
457
+ required,
458
+ grid,
459
+ virtualized,
460
+ openOnInputClick,
461
+ itemToStringLabel,
462
+ isItemEqualToValue,
463
+ modal,
464
+ autoHighlight: autoHighlightMode,
465
+ submitOnItemClick,
466
+ hasInputValue,
467
+ mounted: false,
468
+ forceMounted: false,
469
+ transitionStatus: "idle",
470
+ inline: inlineProp,
471
+ activeIndex: null,
472
+ selectedIndex: initialSelectedIndex,
473
+ popupProps: {},
474
+ listProps: {},
475
+ inputProps: {},
476
+ triggerProps: {},
477
+ itemRoot: {
478
+ props: EMPTY_OBJECT,
479
+ id,
480
+ selectionMode,
481
+ disabled,
482
+ readOnly,
483
+ isItemEqualToValue
484
+ },
485
+ positionerElement: null,
486
+ listElement: null,
487
+ popupId: void 0,
488
+ triggerElement: null,
489
+ inputElement: null,
490
+ inputGroupElement: null,
491
+ popupSide: null,
492
+ openMethod: null,
493
+ inputInsidePopup: true,
494
+ inputOwnsFormValue: selectionMode === "none"
495
+ }, {
496
+ onOpenChangeComplete: NOOP,
497
+ setOpen: NOOP,
498
+ setInputValue: NOOP,
499
+ setSelectedValue: NOOP,
500
+ setIndices: NOOP,
501
+ handleSelection: NOOP,
502
+ forceMount: NOOP,
503
+ requestSubmit: NOOP,
504
+ listRef,
505
+ labelsRef,
506
+ popupRef,
507
+ emptyRef,
508
+ inputRef,
509
+ startDismissRef,
510
+ endDismissRef,
511
+ chipsContainerRef,
512
+ clearRef,
513
+ valuesRef,
514
+ pointerDownItemRef,
515
+ selectionEventRef
516
+ }, selectors);
517
+ }).current;
476
518
  const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue;
477
519
  const fieldStringValue = React$1.useMemo(() => {
478
520
  if (selectionMode === "none") return fieldRawValue;
@@ -486,73 +528,97 @@ function AriaCombobox(props) {
486
528
  ]);
487
529
  const onItemHighlighted = useStableCallback(onItemHighlightedProp);
488
530
  const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
489
- const activeIndex = useStore(store, selectors.activeIndex);
490
- const selectedIndex = useStore(store, selectors.selectedIndex);
491
- const positionerElement = useStore(store, selectors.positionerElement);
492
- const listElement = useStore(store, selectors.listElement);
493
- const triggerElement = useStore(store, selectors.triggerElement);
494
- const inputElement = useStore(store, selectors.inputElement);
495
- const inputGroupElement = useStore(store, selectors.inputGroupElement);
496
- const inline = useStore(store, selectors.inline);
497
- const inputInsidePopup = useStore(store, selectors.inputInsidePopup);
498
- const inputOwnsFormValue = useStore(store, selectors.inputOwnsFormValue);
531
+ const activeIndex = store.useState("activeIndex");
532
+ const selectedIndex = store.useState("selectedIndex");
533
+ const positionerElement = store.useState("positionerElement");
534
+ const listElement = store.useState("listElement");
535
+ const triggerElement = store.useState("triggerElement");
536
+ const inputElement = store.useState("inputElement");
537
+ const inputGroupElement = store.useState("inputGroupElement");
538
+ const inline = store.useState("inline");
539
+ const inputInsidePopup = store.useState("inputInsidePopup");
540
+ const inputOwnsFormValue = store.useState("inputOwnsFormValue");
541
+ const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;
499
542
  const triggerRef = useValueAsRef(triggerElement);
500
- const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
501
543
  const { openMethod, triggerProps } = useOpenInteractionType(open);
502
544
  const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
503
545
  useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);
504
546
  const forceMount = useStableCallback(() => {
505
- if (items) labelsRef.current = flatFilteredItems.map((item) => stringifyAsLabel(item, itemToStringLabel));
547
+ if (items) labelsRef.current = flatFilteredValues.map(stringifyValueLabel);
506
548
  else store.set("forceMounted", true);
507
549
  });
508
- const initialSelectedValueRef = React$1.useRef(selectedValue);
509
- useIsoLayoutEffect(() => {
510
- if (selectedValue !== initialSelectedValueRef.current) forceMount();
511
- }, [forceMount, selectedValue]);
550
+ /**
551
+ * Emits `onItemHighlighted` for the item at `index`, or clears the highlight when `index` is `-1`
552
+ * (a no-op if nothing was highlighted). Keeps `lastHighlightRef` in sync with what was emitted.
553
+ */
554
+ const emitHighlight = useStableCallback((value, index, type, event) => {
555
+ if (index === -1) {
556
+ if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) return;
557
+ lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
558
+ } else lastHighlightRef.current = {
559
+ value,
560
+ index
561
+ };
562
+ onItemHighlighted(value, createGenericEventDetails(type, event, { index }));
563
+ });
512
564
  const setIndices = useStableCallback((options) => {
513
- store.update(options);
565
+ const update = {};
566
+ if (options.activeIndex !== void 0) update.activeIndex = options.activeIndex;
567
+ if (options.selectedIndex !== void 0) update.selectedIndex = options.selectedIndex;
568
+ store.update(update);
569
+ const activeIndexOption = options.activeIndex;
570
+ if (activeIndexOption === void 0) return;
514
571
  const type = options.type || "none";
515
- if (options.activeIndex === void 0) return;
516
- if (options.activeIndex === null) {
517
- if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
518
- lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
519
- onItemHighlighted(void 0, createGenericEventDetails(type, void 0, { index: -1 }));
520
- }
521
- } else {
522
- const activeValue = valuesRef.current[options.activeIndex];
523
- lastHighlightRef.current = {
524
- value: activeValue,
525
- index: options.activeIndex
526
- };
527
- onItemHighlighted(activeValue, createGenericEventDetails(type, void 0, { index: options.activeIndex }));
528
- }
572
+ if (activeIndexOption === null) emitHighlight(void 0, -1, type, options.event);
573
+ else emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type, options.event);
529
574
  });
530
575
  const setInputValue = useStableCallback((next, eventDetails) => {
531
- hadInputClearRef.current = eventDetails.reason === inputClear;
532
576
  props.onInputValueChange?.(next, eventDetails);
533
577
  if (eventDetails.isCanceled) return;
578
+ hadInputClearRef.current = eventDetails.reason === inputClear;
534
579
  if (eventDetails.reason === "input-change") {
580
+ if (open && closeQuery !== null) setCloseQuery(null);
535
581
  const event = eventDetails.event;
536
582
  const inputType = event.inputType;
537
583
  if (event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText") {
538
584
  const hasQuery = next.trim() !== "";
539
585
  if (hasQuery) setQueryChangedAfterOpen(true);
540
586
  pendingQueryHighlightRef.current = { hasQuery };
541
- if (hasQuery && autoHighlightMode && store.state.activeIndex == null) store.set("activeIndex", 0);
587
+ const list = store.state.listElement;
588
+ if (!store.state.virtualized && list) {
589
+ const popup = popupRef.current;
590
+ for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {
591
+ if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute("role") === "dialog")) break;
592
+ if (isScrollableY(ancestor)) {
593
+ ancestor.scrollTop = 0;
594
+ break;
595
+ }
596
+ }
597
+ }
598
+ if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open || inline)) store.set("activeIndex", 0);
542
599
  }
543
- }
600
+ } else if (eventDetails.reason === "input-clear" && next === "" && store.state.inputInsidePopup) pendingQueryHighlightRef.current = {
601
+ hasQuery: false,
602
+ selection: true
603
+ };
544
604
  setInputValueUnwrapped(next);
545
605
  });
606
+ const handleInterruptedReopen = useStableCallback((isInputChange) => {
607
+ const clearsPendingInput = !isInputChange && inputInsidePopup && !inline && inputValue !== "" && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);
608
+ if (!isInputChange && (clearsPendingInput || inputValue === "" || inputMatchesSelectedValue)) setQueryChangedAfterOpen(false);
609
+ setCloseQuery(null);
610
+ if (clearsPendingInput) setInputValue("", createChangeEventDetails(inputClear));
611
+ });
612
+ const [preventUnmountOnClose, setPreventUnmountOnClose] = React$1.useState(false);
546
613
  const setOpen = useStableCallback((nextOpen, eventDetails) => {
547
614
  if (open === nextOpen) return;
548
- if (eventDetails.reason === "escape-key" && hasItems && flatFilteredItems.length === 0 && !store.state.emptyRef.current) eventDetails.allowPropagation();
549
- props.onOpenChange?.(nextOpen, eventDetails);
615
+ if (eventDetails.reason === "escape-key" && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) eventDetails.allowPropagation();
616
+ const openEventDetails = eventDetails;
617
+ const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(openEventDetails);
618
+ props.onOpenChange?.(nextOpen, openEventDetails);
619
+ if (pendingQueryHighlightRef.current?.hasQuery && eventDetails.reason === "input-change" === eventDetails.isCanceled) pendingQueryHighlightRef.current = null;
550
620
  if (eventDetails.isCanceled) return;
551
- if (nextOpen && multiple && inputInsidePopup && !inline && closeQuery !== null) {
552
- setQueryChangedAfterOpen(false);
553
- setCloseQuery(null);
554
- if (inputValue !== "") setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
555
- }
621
+ if (nextOpen && closeQuery !== null) handleInterruptedReopen(eventDetails.reason === inputChange);
556
622
  if (!nextOpen && queryChangedAfterOpen) {
557
623
  if (single) {
558
624
  if (!inline) setCloseQuery(query);
@@ -560,9 +626,10 @@ function AriaCombobox(props) {
560
626
  } else if (multiple) {
561
627
  if (!inline) setCloseQuery(query);
562
628
  if (inputInsidePopup) setIndices({ activeIndex: null });
563
- if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
629
+ if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event, void 0, { isItemPress: eventDetails.reason === itemPress }));
564
630
  }
565
631
  }
632
+ if (!nextOpen) setPreventUnmountOnClose(shouldPreventUnmountOnClose());
566
633
  setOpenUnwrapped(nextOpen);
567
634
  if (!nextOpen && inputInsidePopup && (eventDetails.reason === "focus-out" || eventDetails.reason === "outside-press")) {
568
635
  setTouched(true);
@@ -577,32 +644,30 @@ function AriaCombobox(props) {
577
644
  onSelectedValueChange?.(nextValue, eventDetails);
578
645
  if (eventDetails.isCanceled) return;
579
646
  setSelectedValueUnwrapped(nextValue);
580
- if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event));
581
- if (single && nextValue != null && eventDetails.reason !== "input-change" && queryChangedAfterOpen && !inline) setCloseQuery(query);
647
+ if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));
582
648
  });
583
- const handleSelection = useStableCallback((event, passedValue) => {
584
- let itemValue = passedValue;
585
- if (itemValue === void 0) {
586
- if (activeIndex === null) return;
587
- itemValue = valuesRef.current[activeIndex];
588
- }
649
+ const handleSelection = useStableCallback((event, itemValue) => {
589
650
  const targetEl = getTarget(event);
590
651
  const overrideEvent = selectionEventRef.current ?? event;
591
652
  selectionEventRef.current = null;
592
653
  const eventDetails = createChangeEventDetails(itemPress, overrideEvent);
593
- const href = targetEl?.closest("a")?.getAttribute("href");
654
+ const href = closest(targetEl, "a")?.getAttribute("href");
594
655
  if (href) {
595
656
  if (href.startsWith("#")) setOpen(false, eventDetails);
596
657
  return;
597
658
  }
598
659
  if (multiple) {
599
660
  const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
600
- const nextValue = selectedValueIncludes(currentSelectedValue, itemValue, store.state.isItemEqualToValue) ? removeItem(currentSelectedValue, itemValue, store.state.isItemEqualToValue) : [...currentSelectedValue, itemValue];
661
+ const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);
662
+ const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];
601
663
  setSelectedValue(nextValue, eventDetails);
602
664
  if (eventDetails.isCanceled) return;
603
665
  if (!(inputRef.current ? inputRef.current.value.trim() !== "" : false)) return;
604
- if (store.state.inputInsidePopup) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
605
- else setOpen(false, eventDetails);
666
+ if (store.state.inputInsidePopup) {
667
+ setInputValue("", createChangeEventDetails(inputClear, eventDetails.event, void 0, { isItemPress: true }));
668
+ const pendingHighlight = pendingQueryHighlightRef.current;
669
+ if (pendingHighlight && !isCurrentlySelected) pendingHighlight.toggledValue = itemValue;
670
+ } else setOpen(false, eventDetails);
606
671
  } else {
607
672
  setSelectedValue(itemValue, eventDetails);
608
673
  if (eventDetails.isCanceled) return;
@@ -610,12 +675,10 @@ function AriaCombobox(props) {
610
675
  }
611
676
  });
612
677
  const requestSubmit = useStableCallback(() => {
613
- if (!store.state.submitOnItemClick) return;
614
678
  const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;
615
679
  if (formElement && typeof formElement.requestSubmit === "function") formElement.requestSubmit();
616
680
  });
617
- const handleUnmount = useStableCallback(() => {
618
- setMounted(false);
681
+ const handleUnmountCleanup = useStableCallback(() => {
619
682
  onOpenChangeComplete?.(false);
620
683
  setQueryChangedAfterOpen(false);
621
684
  setCloseQuery(null);
@@ -625,103 +688,124 @@ function AriaCombobox(props) {
625
688
  });
626
689
  else setIndices({ activeIndex: null });
627
690
  if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) setInputValue("", createChangeEventDetails(inputClear));
628
- if (single) if (store.state.inputInsidePopup) {
629
- if (inputRef.current && inputRef.current.value !== "") setInputValue("", createChangeEventDetails(inputClear));
630
- } else {
631
- const stringVal = stringifyAsLabel(selectedValue, itemToStringLabel);
632
- if (inputRef.current && inputRef.current.value !== stringVal) setInputValue(stringVal, createChangeEventDetails(stringVal === "" ? inputClear : none));
691
+ if (single) {
692
+ if (store.state.inputInsidePopup) {
693
+ if (inputRef.current && inputRef.current.value !== "") setInputValue("", createChangeEventDetails(inputClear));
694
+ } else {
695
+ const stringVal = stringifyValueLabel(selectedValue);
696
+ if (inputRef.current && inputRef.current.value !== stringVal) setInputValue(stringVal, createChangeEventDetails(stringVal === "" ? inputClear : none));
697
+ }
633
698
  }
634
699
  });
635
700
  const resolvedPopupRef = React$1.useMemo(() => {
636
- if (inline && positionerElement) return { current: positionerElement.closest("[role=\"dialog\"]") };
701
+ if (inline && positionerElement) return { current: closest(positionerElement, "[role=\"dialog\"]") };
637
702
  return popupRef;
638
703
  }, [inline, positionerElement]);
639
- useOpenChangeComplete({
640
- enabled: !props.actionsRef,
704
+ const { mounted, transitionStatus, forceUnmount: handleUnmount } = useUnmountAfterClose({
641
705
  open,
642
706
  ref: resolvedPopupRef,
643
- onComplete() {
644
- if (!open) handleUnmount();
645
- }
707
+ preventUnmountOnClose,
708
+ setPreventUnmountOnClose,
709
+ onUnmount: handleUnmountCleanup
646
710
  });
647
- React$1.useImperativeHandle(props.actionsRef, () => ({ unmount: handleUnmount }), [handleUnmount]);
711
+ React$1.useImperativeHandle(props.actionsRef, () => ({
712
+ unmount: handleUnmount,
713
+ close: () => setOpen(false, createChangeEventDetails(imperativeAction))
714
+ }), [handleUnmount, setOpen]);
648
715
  useIsoLayoutEffect(function syncSelectedIndex() {
649
- if (open || selectionMode === "none") return;
650
- const registry = items ? flatItems : allValuesRef.current;
651
- if (multiple) {
652
- const currentValue = Array.isArray(selectedValue) ? selectedValue : [];
653
- const lastValue = currentValue[currentValue.length - 1];
654
- const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);
655
- setIndices({ selectedIndex: lastIndex === -1 ? null : lastIndex });
656
- } else {
657
- const index = findItemIndex(registry, selectedValue, isItemEqualToValue);
658
- setIndices({ selectedIndex: index === -1 ? null : index });
659
- }
716
+ const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;
717
+ previousCloseQueryRef.current = closeQuery;
718
+ if (open && (!closeQueryReleased || !hasItems)) return;
719
+ if (!open) pointerDownItemRef.current = null;
720
+ if (selectionMode === "none") return;
721
+ const registry = hasItems ? flatFilteredValues : valuesRef.current;
722
+ setIndices({ selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple) });
660
723
  }, [
661
724
  open,
725
+ closeQuery,
662
726
  selectedValue,
663
- items,
664
727
  selectionMode,
665
- flatItems,
666
728
  multiple,
729
+ hasItems,
730
+ flatFilteredValues,
667
731
  isItemEqualToValue,
668
732
  setIndices
669
733
  ]);
670
734
  useIsoLayoutEffect(() => {
671
735
  if (items) {
672
- valuesRef.current = flatFilteredItems;
673
- listRef.current.length = flatFilteredItems.length;
736
+ valuesRef.current = flatFilteredValues;
737
+ listRef.current.length = flatFilteredValues.length;
674
738
  }
675
- }, [items, flatFilteredItems]);
739
+ }, [items, flatFilteredValues]);
676
740
  useIsoLayoutEffect(() => {
741
+ if (!open && pendingQueryHighlightRef.current?.hasQuery) pendingQueryHighlightRef.current = null;
742
+ }, [open]);
743
+ useIsoLayoutEffect(() => {
744
+ if (!open && inline && resolvedPopupRef.current) {
745
+ pendingQueryHighlightRef.current = null;
746
+ return;
747
+ }
748
+ const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
677
749
  const pendingHighlight = pendingQueryHighlightRef.current;
678
750
  if (pendingHighlight) {
751
+ const listIsNavigable = open || inline || store.state.positionerElement?.hidden === false;
679
752
  if (pendingHighlight.hasQuery) {
680
- if (autoHighlightMode) store.set("activeIndex", 0);
681
- } else if (autoHighlightMode === "always") store.set("activeIndex", 0);
682
- pendingQueryHighlightRef.current = null;
753
+ const input = inputRef.current;
754
+ if (!autoHighlightMode || String(inputValue).trim() === "" || inline && autoHighlightMode !== "always" && (!input || activeElement(input.ownerDocument) !== input)) pendingQueryHighlightRef.current = null;
755
+ else if (listIsNavigable && (candidateItems[0] !== void 0 || !hasItems && !hasFilteredItemsProp)) {
756
+ store.set("activeIndex", 0);
757
+ pendingQueryHighlightRef.current = null;
758
+ }
759
+ } else if (String(inputValue).trim() === "") {
760
+ pendingQueryHighlightRef.current = null;
761
+ if (listIsNavigable) {
762
+ const clearedBySelection = pendingHighlight.selection;
763
+ if (autoHighlightMode === "always" && !clearedBySelection && store.state.selectionMode === "none") store.set("activeIndex", 0);
764
+ queueMicrotask(() => {
765
+ if (!store.state.open && (!store.state.inline || resolvedPopupRef.current) || inputRef.current && inputRef.current.value.trim() !== "") return;
766
+ const currentSelectedValue = store.state.selectedValue;
767
+ const isMultiple = store.state.selectionMode === "multiple";
768
+ if (isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== "none" && currentSelectedValue != null) {
769
+ const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
770
+ const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);
771
+ store.set("activeIndex", toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));
772
+ } else if (clearedBySelection) store.set("activeIndex", null);
773
+ else if (autoHighlightMode === "always") store.set("activeIndex", 0);
774
+ });
775
+ }
776
+ }
683
777
  }
684
778
  if (!open && !inline) return;
685
- const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredItems : valuesRef.current;
686
779
  const storeActiveIndex = store.state.activeIndex;
687
780
  if (storeActiveIndex == null) {
688
781
  if (autoHighlightMode === "always" && candidateItems.length > 0) {
689
782
  store.set("activeIndex", 0);
690
783
  return;
691
784
  }
692
- if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
693
- lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
694
- store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
695
- }
785
+ emitHighlight(void 0, -1, none);
696
786
  return;
697
787
  }
698
788
  if (storeActiveIndex >= candidateItems.length) {
699
- if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
700
- lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
701
- store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
702
- }
789
+ emitHighlight(void 0, -1, none);
703
790
  store.set("activeIndex", null);
704
791
  return;
705
792
  }
706
793
  const itemValue = candidateItems[storeActiveIndex];
707
794
  const previouslyHighlightedItemValue = lastHighlightRef.current.value;
708
795
  const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
709
- if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {
710
- lastHighlightRef.current = {
711
- value: itemValue,
712
- index: storeActiveIndex
713
- };
714
- store.state.onItemHighlighted(itemValue, createGenericEventDetails(none, void 0, { index: storeActiveIndex }));
715
- }
796
+ if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) emitHighlight(itemValue, storeActiveIndex, none);
716
797
  }, [
717
798
  activeIndex,
718
799
  autoHighlightMode,
800
+ emitHighlight,
719
801
  hasFilteredItemsProp,
720
802
  hasItems,
721
- flatFilteredItems,
803
+ flatFilteredValues,
722
804
  inline,
723
805
  open,
724
- store
806
+ resolvedPopupRef,
807
+ store,
808
+ inputValue
725
809
  ]);
726
810
  useIsoLayoutEffect(() => {
727
811
  if (selectionMode === "none") {
@@ -737,43 +821,48 @@ function AriaCombobox(props) {
737
821
  multiple
738
822
  ]);
739
823
  React$1.useEffect(() => {
740
- if (hasItems && autoHighlightMode && flatFilteredItems.length === 0) setIndices({ activeIndex: null });
824
+ if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) setIndices({ activeIndex: null });
741
825
  }, [
742
826
  hasItems,
743
827
  autoHighlightMode,
744
- flatFilteredItems.length,
828
+ flatFilteredValues.length,
745
829
  setIndices
746
830
  ]);
747
- function isSelectedValueDirty(value) {
748
- const initialValue = validityData.initialValue;
749
- if (Array.isArray(value) && Array.isArray(initialValue)) return !areArraysEqual(value, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));
750
- return value !== initialValue;
831
+ function handleQueryChanged() {
832
+ if (open && query !== "" && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) setQueryChangedAfterOpen(true);
751
833
  }
752
- useValueChanged(query, () => {
753
- if (!open || query === "" || query === String(initialDefaultInputValue)) return;
754
- setQueryChangedAfterOpen(true);
755
- });
756
- useValueChanged(selectedValue, () => {
834
+ function handleOpenChanged() {
835
+ if (open && closeQuery !== null) handleInterruptedReopen(false);
836
+ }
837
+ let syncedSelectedLabel = false;
838
+ function syncInputToSelectedLabel() {
839
+ if (!syncedSelectedLabel && inputValue !== selectedLabelString) {
840
+ syncedSelectedLabel = true;
841
+ setInputValue(selectedLabelString, createChangeEventDetails(none));
842
+ }
843
+ }
844
+ function handleSelectedValueChanged() {
757
845
  if (selectionMode === "none") return;
758
846
  clearErrors(name);
759
- setDirty(isSelectedValueDirty(selectedValue));
847
+ setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));
760
848
  validation.change(selectedValue);
761
- if (single && !hasInputValue && !inputInsidePopup) {
762
- const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
763
- if (inputValue !== nextInputValue) setInputValue(nextInputValue, createChangeEventDetails(none));
764
- }
765
- });
766
- useValueChanged(inputValue, () => {
849
+ if (single && !hasInputValue && !inputInsidePopup) syncInputToSelectedLabel();
850
+ }
851
+ function syncInputAfterItemsOrLabelChange() {
852
+ if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) syncInputToSelectedLabel();
853
+ }
854
+ function handleInputValueChanged() {
767
855
  if (selectionMode !== "none") return;
768
856
  clearErrors(name);
769
857
  setDirty(inputValue !== validityData.initialValue);
770
858
  validation.change(inputValue);
771
- });
772
- useValueChanged(items, () => {
773
- if (!single || hasInputValue || inputInsidePopup || queryChangedAfterOpen) return;
774
- const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
775
- if (inputValue !== nextInputValue) setInputValue(nextInputValue, createChangeEventDetails(none));
776
- });
859
+ }
860
+ useValueChanged(query, handleQueryChanged);
861
+ useValueChanged(open, handleOpenChanged);
862
+ useValueChanged(selectedValue, handleSelectedValueChanged);
863
+ useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);
864
+ useValueChanged(items, syncInputAfterItemsOrLabelChange);
865
+ useValueChanged(inputValue, handleInputValueChanged);
777
866
  const floatingRootContext = useFloatingRootContext({
778
867
  open: inline ? true : open,
779
868
  onOpenChange: setOpen,
@@ -782,16 +871,13 @@ function AriaCombobox(props) {
782
871
  floating: positionerElement
783
872
  }
784
873
  });
785
- let ariaHasPopup;
786
- let ariaExpanded;
787
- if (!inline) {
788
- ariaHasPopup = grid ? "grid" : "listbox";
789
- ariaExpanded = open ? "true" : "false";
790
- }
874
+ const ariaHasPopup = grid ? "grid" : "listbox";
875
+ const expanded = open || inline;
876
+ const ariaExpanded = expanded ? "true" : "false";
791
877
  const role = React$1.useMemo(() => {
792
878
  const isPlainInput = inputElement?.tagName === "INPUT";
793
879
  const shouldTreatAsInput = inputElement == null || isPlainInput;
794
- const shouldApplyAria = shouldTreatAsInput || open;
880
+ const shouldApplyAria = shouldTreatAsInput || expanded;
795
881
  const reference = shouldTreatAsInput ? {
796
882
  autoComplete: "off",
797
883
  spellCheck: "false",
@@ -802,8 +888,8 @@ function AriaCombobox(props) {
802
888
  reference.role = "combobox";
803
889
  reference["aria-expanded"] = ariaExpanded;
804
890
  reference["aria-haspopup"] = ariaHasPopup;
805
- reference["aria-controls"] = open ? listElement?.id : void 0;
806
- reference["aria-autocomplete"] = autoComplete;
891
+ reference["aria-controls"] = expanded ? listElement?.id : void 0;
892
+ reference["aria-autocomplete"] = readOnly ? "none" : autoComplete;
807
893
  }
808
894
  return {
809
895
  reference,
@@ -811,21 +897,22 @@ function AriaCombobox(props) {
811
897
  };
812
898
  }, [
813
899
  inputElement,
814
- open,
900
+ expanded,
815
901
  ariaExpanded,
816
902
  ariaHasPopup,
817
903
  listElement?.id,
818
- autoComplete
904
+ autoComplete,
905
+ readOnly
819
906
  ]);
820
907
  const click = useClick(floatingRootContext, {
821
- enabled: !readOnly && !disabled && openOnInputClick,
908
+ enabled: !disabled && openOnInputClick,
822
909
  event: "mousedown-only",
823
910
  toggle: false,
824
911
  touchOpenDelay: inputInsidePopup ? 0 : 100,
825
912
  reason: inputPress
826
913
  });
827
914
  const dismiss = useDismiss(floatingRootContext, {
828
- enabled: !readOnly && !disabled && !inline,
915
+ enabled: !disabled && !inline,
829
916
  outsidePressEvent: {
830
917
  mouse: "sloppy",
831
918
  touch: "intentional"
@@ -837,7 +924,7 @@ function AriaCombobox(props) {
837
924
  }
838
925
  });
839
926
  const listNavigation = useListNavigation(floatingRootContext, {
840
- enabled: !readOnly && !disabled,
927
+ enabled: !disabled,
841
928
  id,
842
929
  listRef,
843
930
  activeIndex,
@@ -853,11 +940,11 @@ function AriaCombobox(props) {
853
940
  disabledIndices: EMPTY_ARRAY,
854
941
  grid: grid ? gridNavigation : void 0,
855
942
  onNavigate(nextActiveIndex, event) {
856
- if (!event && !open || transitionStatus === "ending") return;
857
- if (!event) setIndices({ activeIndex: nextActiveIndex });
858
- else setIndices({
943
+ if (!event && !open && !(inline && nextActiveIndex === null) || transitionStatus === "ending") return;
944
+ setIndices({
859
945
  activeIndex: nextActiveIndex,
860
- type: keyboardActiveRef.current ? "keyboard" : "pointer"
946
+ type: getHighlightReason(event),
947
+ event: event?.nativeEvent
861
948
  });
862
949
  }
863
950
  });
@@ -871,115 +958,94 @@ function AriaCombobox(props) {
871
958
  grid,
872
959
  store
873
960
  ]);
874
- const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, listNavigation.floating, dismiss.floating, role.floating), [
875
- listNavigation.floating,
876
- dismiss.floating,
877
- role.floating
878
- ]);
879
- const itemProps = React$1.useMemo(() => {
961
+ const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);
962
+ const listProps = React$1.useMemo(() => mergeProps(listNavigation.floating, role.floating), [listNavigation.floating, role.floating]);
963
+ const itemRoot = React$1.useMemo(() => {
880
964
  const listNavigationItemProps = listNavigation.item;
881
- if (!listNavigationItemProps) return EMPTY_OBJECT;
882
965
  return {
883
- ...listNavigationItemProps,
884
- onFocus: void 0
966
+ props: listNavigationItemProps ? {
967
+ ...listNavigationItemProps,
968
+ onFocus: void 0
969
+ } : EMPTY_OBJECT,
970
+ id,
971
+ selectionMode,
972
+ disabled,
973
+ readOnly,
974
+ isItemEqualToValue
885
975
  };
886
- }, [listNavigation.item]);
976
+ }, [
977
+ listNavigation.item,
978
+ id,
979
+ selectionMode,
980
+ disabled,
981
+ readOnly,
982
+ isItemEqualToValue
983
+ ]);
984
+ store.useContextCallback("setOpen", setOpen);
985
+ store.useContextCallback("setInputValue", setInputValue);
986
+ store.useContextCallback("setSelectedValue", setSelectedValue);
987
+ store.useContextCallback("setIndices", setIndices);
988
+ store.useContextCallback("handleSelection", handleSelection);
989
+ store.useContextCallback("forceMount", forceMount);
990
+ store.useContextCallback("requestSubmit", requestSubmit);
991
+ store.useContextCallback("onOpenChangeComplete", onOpenChangeCompleteProp);
887
992
  useOnFirstRender(() => {
888
993
  store.update({
889
994
  inline: inlineProp,
890
995
  popupProps,
996
+ listProps,
891
997
  inputProps,
892
998
  triggerProps,
893
- itemProps,
894
- setOpen,
895
- setInputValue,
896
- setSelectedValue,
897
- setIndices,
898
- onItemHighlighted,
899
- handleSelection,
900
- forceMount,
901
- requestSubmit
999
+ itemRoot
902
1000
  });
903
1001
  });
904
- useIsoLayoutEffect(() => {
905
- store.update({
906
- id,
907
- selectedValue,
908
- open,
909
- mounted,
910
- transitionStatus,
911
- items,
912
- inline: inlineProp,
913
- popupProps,
914
- inputProps,
915
- triggerProps,
916
- openMethod,
917
- itemProps,
918
- selectionMode,
919
- name,
920
- form,
921
- disabled,
922
- readOnly,
923
- required,
924
- grid,
925
- isGrouped,
926
- virtualized,
927
- onOpenChangeComplete,
928
- openOnInputClick,
929
- itemToStringLabel,
930
- modal,
931
- autoHighlight: autoHighlightMode,
932
- isItemEqualToValue,
933
- submitOnItemClick,
934
- hasInputValue,
935
- requestSubmit,
936
- inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
937
- });
938
- }, [
939
- store,
1002
+ const syncedValues = {
940
1003
  id,
941
1004
  selectedValue,
942
1005
  open,
943
1006
  mounted,
944
1007
  transitionStatus,
945
- items,
1008
+ items: storeItems,
1009
+ inline: inlineProp,
946
1010
  popupProps,
1011
+ listProps,
947
1012
  inputProps,
948
- itemProps,
949
- openMethod,
950
1013
  triggerProps,
1014
+ itemRoot,
1015
+ openMethod,
951
1016
  selectionMode,
952
1017
  name,
1018
+ form,
953
1019
  disabled,
954
1020
  readOnly,
955
1021
  required,
956
- validation,
957
1022
  grid,
958
- isGrouped,
959
1023
  virtualized,
960
- onOpenChangeComplete,
961
1024
  openOnInputClick,
962
1025
  itemToStringLabel,
963
1026
  modal,
1027
+ autoHighlight: autoHighlightMode,
964
1028
  isItemEqualToValue,
965
1029
  submitOnItemClick,
966
- hasInputValue,
967
- inlineProp,
968
- requestSubmit,
969
- autoHighlightMode,
970
- form
971
- ]);
1030
+ hasInputValue
1031
+ };
1032
+ useIsoLayoutEffect(() => {
1033
+ store.update({
1034
+ ...syncedValues,
1035
+ inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
1036
+ });
1037
+ }, [store, ...Object.values(syncedValues)]);
972
1038
  const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
973
1039
  const itemsContextValue = React$1.useMemo(() => ({
974
1040
  query,
975
1041
  hasItems,
976
1042
  filteredItems,
977
- flatFilteredItems
1043
+ flatFilteredValues
978
1044
  }), [
979
1045
  query,
980
1046
  hasItems,
981
1047
  filteredItems,
982
- flatFilteredItems
1048
+ flatFilteredValues
983
1049
  ]);
984
1050
  const serializedValue = React$1.useMemo(() => {
985
1051
  if (Array.isArray(fieldRawValue)) return "";
@@ -1023,7 +1089,7 @@ function AriaCombobox(props) {
1023
1089
  const nextValue = event.currentTarget.value;
1024
1090
  const nextValueLower = nextValue.toLowerCase();
1025
1091
  const details = createChangeEventDetails(none, event.nativeEvent);
1026
- const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyAsLabel(candidate, itemToStringLabel).toLowerCase() === nextValueLower);
1092
+ const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);
1027
1093
  function handleChange() {
1028
1094
  if (multiple) return;
1029
1095
  if (selectionMode === "none") {
@@ -1079,22 +1145,92 @@ function AriaCombobox(props) {
1079
1145
  });
1080
1146
  }
1081
1147
  //#endregion
1082
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/stateAttributesMapping.mjs
1148
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/input/ComboboxInputDataAttributes.mjs
1149
+ var ComboboxInputDataAttributes_exports = /* @__PURE__ */ __exportAll({
1150
+ dirty: () => dirty,
1151
+ disabled: () => disabled,
1152
+ filled: () => filled,
1153
+ focused: () => focused,
1154
+ invalid: () => invalid,
1155
+ listEmpty: () => listEmpty,
1156
+ popupOpen: () => popupOpen,
1157
+ popupSide: () => popupSide,
1158
+ pressed: () => pressed,
1159
+ readonly: () => readonly,
1160
+ required: () => required,
1161
+ touched: () => touched,
1162
+ valid: () => valid
1163
+ });
1164
+ /**
1165
+ * Present when the corresponding popup is open.
1166
+ */
1167
+ const popupOpen = popupOpen$1;
1168
+ /**
1169
+ * Present when the input is pressed.
1170
+ */
1171
+ const pressed = pressed$1;
1172
+ /**
1173
+ * Present when the component is disabled.
1174
+ */
1175
+ const disabled = "data-disabled";
1176
+ /**
1177
+ * Present when the component is readonly.
1178
+ */
1179
+ const readonly = "data-readonly";
1180
+ /**
1181
+ * Indicates which side the corresponding popup is positioned relative to its anchor.
1182
+ * @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
1183
+ */
1184
+ const popupSide = "data-popup-side";
1185
+ /**
1186
+ * Present when the component is required.
1187
+ */
1188
+ const required = "data-required";
1189
+ /**
1190
+ * Present when the component is in a valid state (when wrapped in Field.Root).
1191
+ */
1192
+ const valid = "data-valid";
1193
+ /**
1194
+ * Present when the component is in an invalid state (when wrapped in Field.Root).
1195
+ */
1196
+ const invalid = "data-invalid";
1197
+ /**
1198
+ * Present when the component has been touched (when wrapped in Field.Root).
1199
+ */
1200
+ const touched = "data-touched";
1201
+ /**
1202
+ * Present when the component's value has changed (when wrapped in Field.Root).
1203
+ */
1204
+ const dirty = "data-dirty";
1205
+ /**
1206
+ * Present when the component has a value (when wrapped in Field.Root).
1207
+ */
1208
+ const filled = "data-filled";
1209
+ /**
1210
+ * Present when the input is focused (when wrapped in Field.Root).
1211
+ */
1212
+ const focused = "data-focused";
1213
+ /**
1214
+ * Present when the corresponding items list is empty.
1215
+ */
1216
+ const listEmpty = "data-list-empty";
1217
+ //#endregion
1218
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/stateAttributesMapping.mjs
1083
1219
  const triggerStateAttributesMapping = {
1084
1220
  ...pressableTriggerOpenStateMapping,
1085
1221
  ...fieldValidityMapping,
1086
- popupSide: (side) => side ? { "data-popup-side": side } : null,
1087
- listEmpty: (empty) => empty ? { "data-list-empty": "" } : null
1222
+ popupSide: (side) => side ? { [popupSide]: side } : null,
1223
+ listEmpty: (empty) => empty ? { [listEmpty]: "" } : null
1088
1224
  };
1089
1225
  //#endregion
1090
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/chips/ComboboxChipsContext.mjs
1226
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/chips/ComboboxChipsContext.mjs
1091
1227
  const ComboboxChipsContext = /*#__PURE__*/ React$1.createContext(void 0);
1092
1228
  ComboboxChipsContext.displayName = "ComboboxChipsContext";
1093
1229
  function useComboboxChipsContext() {
1094
1230
  return React$1.useContext(ComboboxChipsContext);
1095
1231
  }
1096
1232
  //#endregion
1097
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs
1233
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs
1098
1234
  const ComboboxPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
1099
1235
  ComboboxPositionerContext.displayName = "ComboboxPositionerContext";
1100
1236
  function useComboboxPositionerContext(optional) {
@@ -1103,7 +1239,7 @@ function useComboboxPositionerContext(optional) {
1103
1239
  return context;
1104
1240
  }
1105
1241
  //#endregion
1106
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs
1242
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs
1107
1243
  /**
1108
1244
  * @internal
1109
1245
  */
@@ -1112,11 +1248,12 @@ const ComboboxInternalDismissButton = /*#__PURE__*/ React$1.forwardRef(function
1112
1248
  const { buttonRef, getButtonProps } = useButton({ native: false });
1113
1249
  const mergedRef = useMergedRefs(forwardedRef, buttonRef);
1114
1250
  function handleDismiss(event) {
1115
- store.state.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent, event.currentTarget));
1251
+ store.context.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent, event.currentTarget));
1116
1252
  }
1253
+ const dismissProps = getButtonProps({ onClick: handleDismiss });
1117
1254
  return /*#__PURE__*/ jsx("span", {
1118
1255
  ref: mergedRef,
1119
- ...getButtonProps({ onClick: handleDismiss }),
1256
+ ...dismissProps,
1120
1257
  "aria-label": "Dismiss",
1121
1258
  tabIndex: void 0,
1122
1259
  style: visuallyHiddenInput
@@ -1124,7 +1261,50 @@ const ComboboxInternalDismissButton = /*#__PURE__*/ React$1.forwardRef(function
1124
1261
  });
1125
1262
  ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton";
1126
1263
  //#endregion
1127
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/input/ComboboxInput.mjs
1264
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/parts.mjs
1265
+ /**
1266
+ * The popup side is only meaningful while the positioner is mounted, as the store retains the
1267
+ * last resolved side after the popup unmounts.
1268
+ */
1269
+ function usePopupSide(store) {
1270
+ const mounted = store.useState("mounted");
1271
+ const popupSide = store.useState("popupSide");
1272
+ const positionerElement = store.useState("positionerElement");
1273
+ return mounted && positionerElement ? popupSide : null;
1274
+ }
1275
+ /**
1276
+ * Whether the filtered list has no items to show.
1277
+ */
1278
+ function useListEmpty() {
1279
+ return useComboboxDerivedItemsContext().filteredItems.length === 0;
1280
+ }
1281
+ /**
1282
+ * The arrow keys that move the chip highlight backwards and forwards, in that order.
1283
+ */
1284
+ function getChipNavigationKeys(direction) {
1285
+ return direction === "rtl" ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"];
1286
+ }
1287
+ /**
1288
+ * Where the highlight lands once the chip at `index` is removed, or `undefined` for no highlight.
1289
+ */
1290
+ function getIndexAfterChipRemoval(index, chipCount) {
1291
+ const nextIndex = index >= chipCount - 1 ? chipCount - 2 : index;
1292
+ return nextIndex >= 0 ? nextIndex : void 0;
1293
+ }
1294
+ /**
1295
+ * Commits the highlighted item by clicking it, tagging the originating event so the item's
1296
+ * handler can attribute the selection to it.
1297
+ */
1298
+ function clickHighlightedItem(store, activeIndex, nativeEvent) {
1299
+ const listItem = store.context.listRef.current[activeIndex];
1300
+ if (listItem) {
1301
+ store.context.selectionEventRef.current = nativeEvent;
1302
+ listItem.click();
1303
+ store.context.selectionEventRef.current = null;
1304
+ }
1305
+ }
1306
+ //#endregion
1307
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/input/ComboboxInput.mjs
1128
1308
  /**
1129
1309
  * A text input to search for items in the list.
1130
1310
  * Renders an `<input>` element.
@@ -1133,56 +1313,63 @@ ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton";
1133
1313
  */
1134
1314
  const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(componentProps, forwardedRef) {
1135
1315
  const { render, className, disabled: disabledProp = false, id: idProp, style, ...elementProps } = componentProps;
1136
- const { state: fieldState, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
1316
+ const { state: fieldState, disabled: fieldDisabled, setTouched, validationMode, validation } = useFieldRootContext();
1137
1317
  const { labelId: fieldLabelId } = useLabelableContext();
1138
1318
  const comboboxChipsContext = useComboboxChipsContext();
1139
1319
  const positioning = useComboboxPositionerContext(true);
1140
1320
  const hasPositionerParent = Boolean(positioning);
1141
1321
  const store = useComboboxRootContext();
1142
- const { filteredItems } = useComboboxDerivedItemsContext();
1143
1322
  const inputValue = useComboboxInputValueContext();
1144
1323
  const direction = useDirection();
1145
- const required = useStore(store, selectors.required);
1146
- const comboboxDisabled = useStore(store, selectors.disabled);
1147
- const readOnly = useStore(store, selectors.readOnly);
1148
- const name = useStore(store, selectors.name);
1149
- const form = useStore(store, selectors.form);
1150
- const selectionMode = useStore(store, selectors.selectionMode);
1151
- const autoHighlightMode = useStore(store, selectors.autoHighlight);
1152
- const inputProps = useStore(store, selectors.inputProps);
1153
- const triggerProps = useStore(store, selectors.triggerProps);
1154
- const open = useStore(store, selectors.open);
1155
- const mounted = useStore(store, selectors.mounted);
1156
- const selectedValue = useStore(store, selectors.selectedValue);
1157
- const popupSideValue = useStore(store, selectors.popupSide);
1158
- const positionerElement = useStore(store, selectors.positionerElement);
1159
- const rootId = useStore(store, selectors.id);
1160
- const inline = useStore(store, selectors.inline);
1161
- const modal = useStore(store, selectors.modal);
1324
+ const required = store.useState("required");
1325
+ const comboboxDisabled = store.useState("disabled");
1326
+ const readOnly = store.useState("readOnly");
1327
+ const name = store.useState("name");
1328
+ const form = store.useState("form");
1329
+ const selectionMode = store.useState("selectionMode");
1330
+ const autoHighlightMode = store.useState("autoHighlight");
1331
+ const inputProps = store.useState("inputProps");
1332
+ const triggerProps = store.useState("triggerProps");
1333
+ const open = store.useState("open");
1334
+ const mounted = store.useState("mounted");
1335
+ const selectedValue = store.useState("selectedValue");
1336
+ const rootId = store.useState("id");
1337
+ const inline = store.useState("inline");
1338
+ const modal = store.useState("modal");
1162
1339
  const autoHighlightEnabled = Boolean(autoHighlightMode);
1163
- const popupSide = mounted && positionerElement ? popupSideValue : null;
1340
+ const popupSide = usePopupSide(store);
1164
1341
  const disabled = fieldDisabled || comboboxDisabled || disabledProp;
1165
- const listEmpty = filteredItems.length === 0;
1342
+ const listEmpty = useListEmpty();
1343
+ const setFocused = useSetFieldFocused(disabled, store.context.inputRef);
1166
1344
  const isInsidePopup = hasPositionerParent || inline;
1167
1345
  const focusManagerModal = !isInsidePopup || modal;
1168
1346
  const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0));
1169
- const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, void 0);
1170
1347
  const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;
1171
1348
  const [composingValue, setComposingValue] = React$1.useState(null);
1172
1349
  const isComposingRef = React$1.useRef(false);
1173
1350
  const lastActiveIndexRef = React$1.useRef(null);
1174
- const shouldRestoreActiveIndexRef = React$1.useRef(false);
1351
+ useIsoLayoutEffect(() => {
1352
+ if (!open) lastActiveIndexRef.current = null;
1353
+ }, [open]);
1175
1354
  const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent;
1176
1355
  const setInputElement = useStableCallback((element) => {
1177
1356
  const nextIsInsidePopup = hasPositionerParent || store.state.inline;
1178
- if (nextIsInsidePopup && !store.state.hasInputValue) store.state.setInputValue("", createChangeEventDetails(none));
1357
+ if (nextIsInsidePopup && !store.state.hasInputValue) store.context.setInputValue("", createChangeEventDetails(none));
1179
1358
  store.update({
1180
1359
  inputElement: element,
1181
1360
  inputInsidePopup: nextIsInsidePopup,
1182
1361
  inputOwnsFormValue
1183
1362
  });
1184
1363
  });
1185
- const validationProps = hasPositionerParent || !validation ? elementProps : validation.getValidationProps(disabled, elementProps);
1364
+ const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled, elementProps);
1365
+ function clearHighlight(event) {
1366
+ store.context.setIndices({
1367
+ activeIndex: null,
1368
+ selectedIndex: null,
1369
+ type: getHighlightReason(event),
1370
+ event
1371
+ });
1372
+ }
1186
1373
  const state = {
1187
1374
  ...fieldStateForInput,
1188
1375
  open,
@@ -1194,42 +1381,11 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1194
1381
  function handleKeyDown(event) {
1195
1382
  if (!comboboxChipsContext) return;
1196
1383
  let nextIndex;
1197
- const { highlightedChipIndex } = comboboxChipsContext;
1198
1384
  const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
1199
- const isRtl = direction === "rtl";
1200
- const previousChipKey = isRtl ? "ArrowRight" : "ArrowLeft";
1201
- const nextChipKey = isRtl ? "ArrowLeft" : "ArrowRight";
1202
- if (highlightedChipIndex !== void 0) {
1203
- if (event.key === previousChipKey) {
1204
- event.preventDefault();
1205
- if (highlightedChipIndex > 0) nextIndex = highlightedChipIndex - 1;
1206
- else nextIndex = void 0;
1207
- } else if (event.key === nextChipKey) {
1208
- event.preventDefault();
1209
- if (highlightedChipIndex < renderedChipsCount - 1) nextIndex = highlightedChipIndex + 1;
1210
- else nextIndex = void 0;
1211
- } else if (event.key === "Backspace" || event.key === "Delete") {
1212
- event.preventDefault();
1213
- const computedNextIndex = highlightedChipIndex >= selectedValue.length - 1 ? selectedValue.length - 2 : highlightedChipIndex;
1214
- nextIndex = computedNextIndex >= 0 ? computedNextIndex : void 0;
1215
- store.state.setIndices({
1216
- activeIndex: null,
1217
- selectedIndex: null,
1218
- type: "keyboard"
1219
- });
1220
- }
1221
- return nextIndex;
1222
- }
1385
+ const [previousChipKey] = getChipNavigationKeys(direction);
1223
1386
  if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {
1224
1387
  event.preventDefault();
1225
1388
  nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0;
1226
- } else if (event.key === "Backspace" && event.currentTarget.value === "" && selectedValue.length > 0) {
1227
- store.state.setIndices({
1228
- activeIndex: null,
1229
- selectedIndex: null,
1230
- type: "keyboard"
1231
- });
1232
- event.preventDefault();
1233
1389
  }
1234
1390
  return nextIndex;
1235
1391
  }
@@ -1237,18 +1393,17 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1237
1393
  state,
1238
1394
  ref: [
1239
1395
  forwardedRef,
1240
- store.state.inputRef,
1396
+ store.context.inputRef,
1241
1397
  setInputElement
1242
1398
  ],
1243
1399
  props: [
1244
1400
  inputProps,
1245
1401
  triggerProps,
1246
1402
  {
1247
- type: "text",
1248
- value: componentProps.value ?? composingValue ?? inputValue,
1403
+ value: composingValue ?? inputValue,
1249
1404
  "aria-readonly": readOnly || void 0,
1250
1405
  "aria-required": required || void 0,
1251
- "aria-labelledby": ariaLabelledBy,
1406
+ "aria-labelledby": fieldLabelId,
1252
1407
  disabled,
1253
1408
  readOnly,
1254
1409
  required: selectionMode === "none" ? required : void 0,
@@ -1257,11 +1412,11 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1257
1412
  id,
1258
1413
  onFocus() {
1259
1414
  setFocused(true);
1260
- if (!inline || !shouldRestoreActiveIndexRef.current) return;
1261
- shouldRestoreActiveIndexRef.current = false;
1415
+ if (!inline) return;
1262
1416
  const nextActiveIndex = lastActiveIndexRef.current;
1263
- if (nextActiveIndex == null || !Object.hasOwn(store.state.valuesRef.current, nextActiveIndex)) return;
1264
- store.state.setIndices({ activeIndex: nextActiveIndex });
1417
+ lastActiveIndexRef.current = null;
1418
+ if (nextActiveIndex == null || !Object.hasOwn(store.context.valuesRef.current, nextActiveIndex)) return;
1419
+ store.context.setIndices({ activeIndex: nextActiveIndex });
1265
1420
  },
1266
1421
  onBlur() {
1267
1422
  setTouched(true);
@@ -1269,8 +1424,7 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1269
1424
  const activeIndex = store.state.activeIndex;
1270
1425
  if (inline && activeIndex !== null && autoHighlightMode !== "always") {
1271
1426
  lastActiveIndexRef.current = activeIndex;
1272
- shouldRestoreActiveIndexRef.current = true;
1273
- store.state.setIndices({ activeIndex: null });
1427
+ store.context.setIndices({ activeIndex: null });
1274
1428
  }
1275
1429
  if (validationMode === "onBlur") {
1276
1430
  const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
@@ -1286,65 +1440,46 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1286
1440
  isComposingRef.current = false;
1287
1441
  const next = event.currentTarget.value;
1288
1442
  setComposingValue(null);
1289
- store.state.setInputValue(next, createChangeEventDetails(inputChange, event.nativeEvent));
1443
+ store.context.setInputValue(next, createChangeEventDetails(inputChange, event.nativeEvent));
1290
1444
  },
1291
1445
  onChange(event) {
1292
- const inputType = event.nativeEvent.inputType;
1446
+ const nativeEvent = event.nativeEvent;
1447
+ const inputType = nativeEvent.inputType;
1293
1448
  const autofillLikeInput = !inputType || inputType === "insertReplacementText";
1294
1449
  const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;
1450
+ function maybeOpenOnInput(trimmed) {
1451
+ if (readOnly || disabled || !trimmed || !shouldOpenOnInput) return;
1452
+ store.context.setOpen(true, createChangeEventDetails(inputChange, nativeEvent));
1453
+ if (!autoHighlightEnabled) clearHighlight(nativeEvent);
1454
+ }
1295
1455
  if (isComposingRef.current) {
1296
1456
  const nextVal = event.currentTarget.value;
1297
1457
  setComposingValue(nextVal);
1298
- if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.state.setOpen(false, createChangeEventDetails(inputClear, event.nativeEvent));
1458
+ if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.context.setOpen(false, createChangeEventDetails(inputClear, nativeEvent));
1299
1459
  const trimmed = nextVal.trim();
1300
1460
  const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== "";
1301
- if (!readOnly && !disabled && trimmed) {
1302
- if (shouldOpenOnInput) {
1303
- store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
1304
- if (!autoHighlightEnabled) store.state.setIndices({
1305
- activeIndex: null,
1306
- selectedIndex: null,
1307
- type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
1308
- });
1309
- }
1310
- }
1311
- if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) store.state.setIndices({
1312
- activeIndex: null,
1313
- selectedIndex: null,
1314
- type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
1315
- });
1461
+ maybeOpenOnInput(trimmed);
1462
+ if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) clearHighlight(nativeEvent);
1316
1463
  return;
1317
1464
  }
1318
- const inputChangeDetails = createChangeEventDetails(inputChange, event.nativeEvent);
1319
- store.state.setInputValue(event.currentTarget.value, inputChangeDetails);
1465
+ const inputChangeDetails = createChangeEventDetails(inputChange, nativeEvent);
1466
+ store.context.setInputValue(event.currentTarget.value, inputChangeDetails);
1320
1467
  if (inputChangeDetails.isCanceled) return;
1321
1468
  const empty = event.currentTarget.value === "";
1322
- const clearDetails = createChangeEventDetails(inputClear, event.nativeEvent);
1469
+ const clearDetails = createChangeEventDetails(inputClear, nativeEvent);
1323
1470
  if (empty && !store.state.inputInsidePopup) {
1324
- if (selectionMode === "single") store.state.setSelectedValue(null, clearDetails);
1325
- if (!store.state.openOnInputClick) store.state.setOpen(false, clearDetails);
1471
+ if (selectionMode === "single") store.context.setSelectedValue(null, clearDetails);
1472
+ if (!store.state.openOnInputClick) store.context.setOpen(false, clearDetails);
1326
1473
  }
1327
- const trimmed = event.currentTarget.value.trim();
1328
- if (!readOnly && !disabled && trimmed) {
1329
- if (shouldOpenOnInput) {
1330
- store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
1331
- if (!autoHighlightEnabled) store.state.setIndices({
1332
- activeIndex: null,
1333
- selectedIndex: null,
1334
- type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
1335
- });
1336
- }
1337
- }
1338
- if (open && store.state.activeIndex !== null && !autoHighlightEnabled) store.state.setIndices({
1339
- activeIndex: null,
1340
- selectedIndex: null,
1341
- type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
1342
- });
1474
+ maybeOpenOnInput(event.currentTarget.value.trim());
1475
+ if (open && store.state.activeIndex !== null && !autoHighlightEnabled) clearHighlight(nativeEvent);
1343
1476
  },
1344
1477
  onKeyDown(event) {
1345
- if (disabled || readOnly) return;
1346
1478
  if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;
1347
- store.state.keyboardActiveRef.current = true;
1479
+ if (disabled || readOnly) {
1480
+ if (readOnly && event.key === "Enter" && open && store.state.activeIndex !== null) stopEvent(event);
1481
+ return;
1482
+ }
1348
1483
  const input = event.currentTarget;
1349
1484
  const scrollAmount = input.scrollWidth - input.clientWidth;
1350
1485
  const isRTL = direction === "rtl";
@@ -1366,51 +1501,33 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1366
1501
  const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;
1367
1502
  const details = createChangeEventDetails(escapeKey, event.nativeEvent);
1368
1503
  const value = selectionMode === "multiple" ? [] : null;
1369
- store.state.setInputValue("", details);
1370
- store.state.setSelectedValue(value, details);
1504
+ store.context.setInputValue("", details);
1505
+ store.context.setSelectedValue(value, details);
1371
1506
  if (!isClear && !store.state.inline && !details.isPropagationAllowed) event.stopPropagation();
1372
1507
  return;
1373
1508
  }
1374
- if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && comboboxChipsContext.highlightedChipIndex === void 0 && Array.isArray(selectedValue) && selectedValue.length > 0) {
1509
+ if (comboboxChipsContext && event.key === "Backspace" && input.value === "" && Array.isArray(selectedValue) && selectedValue.length > 0) {
1375
1510
  const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
1376
1511
  const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;
1377
1512
  const newValue = selectedValue.filter((_, index) => index !== removalIndex);
1378
- store.state.setIndices({
1379
- activeIndex: null,
1380
- selectedIndex: null,
1381
- type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
1382
- });
1383
- store.state.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
1513
+ clearHighlight(event.nativeEvent);
1514
+ store.context.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
1384
1515
  return;
1385
1516
  }
1386
- const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== void 0;
1387
1517
  const nextIndex = handleKeyDown(event);
1388
- comboboxChipsContext?.setHighlightedChipIndex(nextIndex);
1389
1518
  if (nextIndex !== void 0) comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();
1390
- else if (hadHighlightedChip) store.state.inputRef.current?.focus();
1391
1519
  if (event.which === 229) return;
1392
1520
  if (event.key === "Enter" && open) {
1393
1521
  const activeIndex = store.state.activeIndex;
1394
1522
  const nativeEvent = event.nativeEvent;
1395
1523
  if (activeIndex === null) {
1396
1524
  if (inline) return;
1397
- store.state.setOpen(false, createChangeEventDetails(none, nativeEvent));
1525
+ store.context.setOpen(false, createChangeEventDetails(none, nativeEvent));
1398
1526
  return;
1399
1527
  }
1400
1528
  stopEvent(event);
1401
- const listItem = store.state.listRef.current[activeIndex];
1402
- if (listItem) {
1403
- store.state.selectionEventRef.current = nativeEvent;
1404
- listItem.click();
1405
- store.state.selectionEventRef.current = null;
1406
- }
1529
+ clickHighlightedItem(store, activeIndex, nativeEvent);
1407
1530
  }
1408
- },
1409
- onPointerMove() {
1410
- store.state.keyboardActiveRef.current = false;
1411
- },
1412
- onPointerDown() {
1413
- store.state.keyboardActiveRef.current = false;
1414
1531
  }
1415
1532
  },
1416
1533
  validationProps
@@ -1421,11 +1538,11 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
1421
1538
  value: DEFAULT_FIELD_ROOT_CONTEXT,
1422
1539
  children: element
1423
1540
  }) : element;
1424
- return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [open && focusManagerModal && /*#__PURE__*/ jsx(ComboboxInternalDismissButton, { ref: store.state.startDismissRef }), renderedInput] });
1541
+ return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [open && focusManagerModal && /*#__PURE__*/ jsx(ComboboxInternalDismissButton, { ref: store.context.startDismissRef }), renderedInput] });
1425
1542
  });
1426
1543
  ComboboxInput.displayName = "ComboboxInput";
1427
1544
  //#endregion
1428
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/collection/GroupCollectionContext.mjs
1545
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/collection/GroupCollectionContext.mjs
1429
1546
  const GroupCollectionContext = /*#__PURE__*/ React$1.createContext(null);
1430
1547
  GroupCollectionContext.displayName = "GroupCollectionContext";
1431
1548
  function useGroupCollectionContext() {
@@ -1440,7 +1557,7 @@ function GroupCollectionProvider(props) {
1440
1557
  });
1441
1558
  }
1442
1559
  //#endregion
1443
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/collection/ComboboxCollection.mjs
1560
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/collection/ComboboxCollection.mjs
1444
1561
  /**
1445
1562
  * Renders filtered list items.
1446
1563
  * Doesn't render its own HTML element.
@@ -1454,11 +1571,10 @@ function ComboboxCollection(props) {
1454
1571
  const { filteredItems } = useComboboxDerivedItemsContext();
1455
1572
  const groupContext = useGroupCollectionContext();
1456
1573
  const itemsToRender = groupContext ? groupContext.items : filteredItems;
1457
- if (!itemsToRender) return null;
1458
1574
  return /*#__PURE__*/ jsx(React$1.Fragment, { children: itemsToRender.map(children) });
1459
1575
  }
1460
1576
  //#endregion
1461
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/list/ComboboxList.mjs
1577
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/list/ComboboxList.mjs
1462
1578
  /**
1463
1579
  * A list container for the items.
1464
1580
  * Renders a `<div>` element.
@@ -1472,11 +1588,12 @@ const ComboboxList = /*#__PURE__*/ React$1.forwardRef(function ComboboxList(comp
1472
1588
  const floatingRootContext = useComboboxFloatingContext();
1473
1589
  const hasPositionerContext = Boolean(useComboboxPositionerContext(true));
1474
1590
  const { filteredItems, hasItems } = useComboboxDerivedItemsContext();
1475
- const selectionMode = useStore(store, selectors.selectionMode);
1476
- const grid = useStore(store, selectors.grid);
1477
- const popupProps = useStore(store, selectors.popupProps);
1478
- const virtualized = useStore(store, selectors.virtualized);
1479
- const forceMounted = useStore(store, selectors.forceMounted);
1591
+ const selectionMode = store.useState("selectionMode");
1592
+ const grid = store.useState("grid");
1593
+ const readOnly = store.useState("readOnly");
1594
+ const listProps = store.useState("listProps");
1595
+ const virtualized = store.useState("virtualized");
1596
+ const forceMounted = store.useState("forceMounted");
1480
1597
  const multiple = selectionMode === "multiple";
1481
1598
  const empty = filteredItems.length === 0;
1482
1599
  const setPositionerElement = useStableCallback((element) => {
@@ -1499,83 +1616,38 @@ const ComboboxList = /*#__PURE__*/ React$1.forwardRef(function ComboboxList(comp
1499
1616
  hasPositionerContext ? null : setPositionerElement
1500
1617
  ],
1501
1618
  props: [
1502
- popupProps,
1619
+ listProps,
1503
1620
  {
1504
1621
  children: resolvedChildren,
1505
1622
  tabIndex: -1,
1506
1623
  id: floatingId,
1507
1624
  role: grid ? "grid" : "listbox",
1508
1625
  "aria-multiselectable": multiple ? "true" : void 0,
1626
+ "aria-readonly": !grid && readOnly ? true : void 0,
1509
1627
  onKeyDown(event) {
1510
1628
  if (store.state.disabled || store.state.readOnly) return;
1511
1629
  if (event.key === "Enter") {
1512
1630
  const activeIndex = store.state.activeIndex;
1513
1631
  if (activeIndex == null) return;
1514
1632
  stopEvent(event);
1515
- const nativeEvent = event.nativeEvent;
1516
- const listItem = store.state.listRef.current[activeIndex];
1517
- if (listItem) {
1518
- store.state.selectionEventRef.current = nativeEvent;
1519
- listItem.click();
1520
- store.state.selectionEventRef.current = null;
1521
- }
1633
+ clickHighlightedItem(store, activeIndex, event.nativeEvent);
1522
1634
  }
1523
- },
1524
- onKeyDownCapture() {
1525
- store.state.keyboardActiveRef.current = true;
1526
- },
1527
- onPointerMoveCapture() {
1528
- store.state.keyboardActiveRef.current = false;
1529
1635
  }
1530
1636
  },
1531
1637
  elementProps
1532
1638
  ]
1533
1639
  });
1534
1640
  if (virtualized) return element;
1535
- const labelsRef = hasItems && !forceMounted ? void 0 : store.state.labelsRef;
1641
+ const labelsRef = hasItems && !forceMounted ? void 0 : store.context.labelsRef;
1536
1642
  return /*#__PURE__*/ jsx(CompositeList, {
1537
- elementsRef: store.state.listRef,
1643
+ elementsRef: store.context.listRef,
1538
1644
  labelsRef,
1539
1645
  children: element
1540
1646
  });
1541
1647
  });
1542
1648
  ComboboxList.displayName = "ComboboxList";
1543
1649
  //#endregion
1544
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/useInitialLiveRegionTextMutation.mjs
1545
- const LIVE_REGION_MARKER = "⁠";
1546
- function findLastTextNode(root) {
1547
- const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);
1548
- let lastTextNode = null;
1549
- while (walker.nextNode()) {
1550
- const textNode = walker.currentNode;
1551
- if (textNode.nodeValue !== "") lastTextNode = textNode;
1552
- }
1553
- return lastTextNode;
1554
- }
1555
- function useInitialLiveRegionTextMutation() {
1556
- const timeout = useTimeout();
1557
- const rootRef = React$1.useRef(null);
1558
- React$1.useEffect(() => {
1559
- if (ios) return;
1560
- const root = rootRef.current;
1561
- if (root == null) return;
1562
- const textNode = findLastTextNode(root);
1563
- if (textNode == null) return;
1564
- const originalValue = textNode.nodeValue ?? "";
1565
- const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;
1566
- textNode.nodeValue = markedValue;
1567
- timeout.start(200, () => {
1568
- if (textNode.nodeValue === markedValue) textNode.nodeValue = originalValue;
1569
- });
1570
- return () => {
1571
- timeout.clear();
1572
- if (textNode.nodeValue === markedValue) textNode.nodeValue = originalValue;
1573
- };
1574
- }, [rootRef, timeout]);
1575
- return rootRef;
1576
- }
1577
- //#endregion
1578
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group/ComboboxGroupContext.mjs
1650
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group/ComboboxGroupContext.mjs
1579
1651
  const ComboboxGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
1580
1652
  ComboboxGroupContext.displayName = "ComboboxGroupContext";
1581
1653
  function useComboboxGroupContext() {
@@ -1584,7 +1656,7 @@ function useComboboxGroupContext() {
1584
1656
  return context;
1585
1657
  }
1586
1658
  //#endregion
1587
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group/ComboboxGroup.mjs
1659
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group/ComboboxGroup.mjs
1588
1660
  /**
1589
1661
  * Groups related items with the corresponding label.
1590
1662
  * Renders a `<div>` element.
@@ -1593,6 +1665,7 @@ function useComboboxGroupContext() {
1593
1665
  */
1594
1666
  const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {
1595
1667
  const { render, className, style, items, ...elementProps } = componentProps;
1668
+ const grid = useComboboxRootContext().useState("grid");
1596
1669
  const [labelId, setLabelId] = React$1.useState();
1597
1670
  const contextValue = React$1.useMemo(() => ({
1598
1671
  labelId,
@@ -1606,7 +1679,7 @@ const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(co
1606
1679
  const element = useRenderElement("div", componentProps, {
1607
1680
  ref: forwardedRef,
1608
1681
  props: [{
1609
- role: "group",
1682
+ role: grid ? "rowgroup" : "group",
1610
1683
  "aria-labelledby": labelId
1611
1684
  }, elementProps]
1612
1685
  });
@@ -1622,7 +1695,7 @@ const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(co
1622
1695
  });
1623
1696
  ComboboxGroup.displayName = "ComboboxGroup";
1624
1697
  //#endregion
1625
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.mjs
1698
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.mjs
1626
1699
  /**
1627
1700
  * An accessible label that is automatically associated with its parent group.
1628
1701
  * Renders a `<div>` element.
@@ -1636,17 +1709,20 @@ const ComboboxGroupLabel = /*#__PURE__*/ React$1.forwardRef(function ComboboxGro
1636
1709
  useIsoLayoutEffect(() => {
1637
1710
  setLabelId(id);
1638
1711
  return () => {
1639
- setLabelId(void 0);
1712
+ setLabelId((currentId) => currentId === id ? void 0 : currentId);
1640
1713
  };
1641
1714
  }, [id, setLabelId]);
1642
1715
  return useRenderElement("div", componentProps, {
1643
1716
  ref: forwardedRef,
1644
- props: [{ id }, elementProps]
1717
+ props: [{
1718
+ id,
1719
+ "aria-hidden": true
1720
+ }, elementProps]
1645
1721
  });
1646
1722
  });
1647
1723
  ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
1648
1724
  //#endregion
1649
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/item/ComboboxItemContext.mjs
1725
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/item/ComboboxItemContext.mjs
1650
1726
  const ComboboxItemContext = /*#__PURE__*/ React$1.createContext(void 0);
1651
1727
  ComboboxItemContext.displayName = "ComboboxItemContext";
1652
1728
  function useComboboxItemContext() {
@@ -1655,44 +1731,39 @@ function useComboboxItemContext() {
1655
1731
  return context;
1656
1732
  }
1657
1733
  //#endregion
1658
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/row/ComboboxRowContext.mjs
1734
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/row/ComboboxRowContext.mjs
1659
1735
  const ComboboxRowContext = /*#__PURE__*/ React$1.createContext(false);
1660
1736
  ComboboxRowContext.displayName = "ComboboxRowContext";
1661
1737
  function useComboboxRowContext() {
1662
1738
  return React$1.useContext(ComboboxRowContext);
1663
1739
  }
1664
1740
  //#endregion
1665
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/item/ComboboxItem.mjs
1741
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/item/ComboboxItem.mjs
1666
1742
  function ComboboxItemInner(props) {
1667
1743
  const { componentProps, forwardedRef, virtualized, indexFromFilter } = props;
1668
- const { render, className, style, value: itemValue = null, index: indexProp, disabled = false, nativeButton = false, ...elementProps } = componentProps;
1669
- const didPointerDownRef = React$1.useRef(false);
1744
+ const { render, className, style, value: itemValue = null, index: indexProp, disabled: disabledProp = false, nativeButton = false, ...elementProps } = componentProps;
1670
1745
  const textRef = React$1.useRef(null);
1671
1746
  const listItem = useCompositeListItem({
1747
+ guess: true,
1672
1748
  index: indexProp,
1673
- textRef,
1674
- indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
1749
+ textRef
1675
1750
  });
1676
1751
  const store = useComboboxRootContext();
1677
1752
  const isRow = useComboboxRowContext();
1678
1753
  const hasItems = useComboboxHasItemsContext();
1679
- const open = useStore(store, selectors.open);
1680
- const selectionMode = useStore(store, selectors.selectionMode);
1681
- const readOnly = useStore(store, selectors.readOnly);
1682
- const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);
1754
+ const { props: itemProps, id: rootId, selectionMode, disabled: rootDisabled, readOnly, isItemEqualToValue } = store.useState("itemRoot");
1755
+ const disabled = rootDisabled || disabledProp;
1683
1756
  const selectable = selectionMode !== "none";
1684
- const index = indexProp ?? (virtualized ? indexFromFilter ?? -1 : listItem.index);
1685
- const hasRegistered = listItem.index !== -1;
1686
- const rootId = useStore(store, selectors.id);
1687
- const highlighted = useStore(store, selectors.isActive, index);
1688
- const matchesSelectedValue = useStore(store, selectors.isSelected, itemValue);
1689
- const itemProps = useStore(store, selectors.itemProps);
1757
+ const index = indexProp ?? indexFromFilter ?? listItem.index;
1758
+ const hasRegistered = index !== -1;
1759
+ const highlighted = store.useState("isActive", index);
1760
+ const matchesSelectedValue = store.useState("isSelected", itemValue);
1690
1761
  const itemRef = React$1.useRef(null);
1691
1762
  const id = rootId != null && hasRegistered ? `${rootId}-${index}` : void 0;
1692
1763
  const selected = matchesSelectedValue && selectable;
1693
1764
  useIsoLayoutEffect(() => {
1694
1765
  if (!(hasRegistered && (virtualized || indexProp != null))) return;
1695
- const list = store.state.listRef.current;
1766
+ const list = store.context.listRef.current;
1696
1767
  list[index] = itemRef.current;
1697
1768
  return () => {
1698
1769
  delete list[index];
@@ -1706,33 +1777,28 @@ function ComboboxItemInner(props) {
1706
1777
  ]);
1707
1778
  useIsoLayoutEffect(() => {
1708
1779
  if (!hasRegistered || hasItems) return;
1709
- const visibleMap = store.state.valuesRef.current;
1710
- visibleMap[index] = itemValue;
1711
- if (selectionMode !== "none") store.state.allValuesRef.current.push(itemValue);
1780
+ const visibleValues = store.context.valuesRef.current;
1781
+ visibleValues[index] = itemValue;
1712
1782
  return () => {
1713
- delete visibleMap[index];
1783
+ delete visibleValues[index];
1714
1784
  };
1715
1785
  }, [
1716
1786
  hasRegistered,
1717
1787
  hasItems,
1718
1788
  index,
1719
1789
  itemValue,
1720
- store,
1721
- selectionMode
1790
+ store
1722
1791
  ]);
1723
1792
  useIsoLayoutEffect(() => {
1724
- if (!open) {
1725
- didPointerDownRef.current = false;
1726
- return;
1727
- }
1728
1793
  if (!hasRegistered || hasItems) return;
1729
1794
  const selectedValue = store.state.selectedValue;
1730
- const lastSelectedValue = Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue;
1731
- if (compareItemEquality(itemValue, lastSelectedValue, isItemEqualToValue)) store.set("selectedIndex", index);
1795
+ let nextIndex = store.state.selectedIndex;
1796
+ if (store.state.selectionMode === "multiple" && Array.isArray(selectedValue)) nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, nextIndex);
1797
+ else if (compareItemEquality(itemValue, selectedValue, isItemEqualToValue)) nextIndex = index;
1798
+ store.set("selectedIndex", nextIndex);
1732
1799
  }, [
1733
1800
  hasRegistered,
1734
1801
  hasItems,
1735
- open,
1736
1802
  store,
1737
1803
  index,
1738
1804
  itemValue,
@@ -1751,11 +1817,11 @@ function ComboboxItemInner(props) {
1751
1817
  };
1752
1818
  function commitSelection(nativeEvent) {
1753
1819
  function selectItem() {
1754
- store.state.handleSelection(nativeEvent, itemValue);
1820
+ store.context.handleSelection(nativeEvent, itemValue);
1755
1821
  }
1756
1822
  if (store.state.submitOnItemClick) {
1757
1823
  ReactDOM.flushSync(selectItem);
1758
- store.state.requestSubmit();
1824
+ store.context.requestSubmit();
1759
1825
  } else selectItem();
1760
1826
  }
1761
1827
  const defaultProps = {
@@ -1764,7 +1830,7 @@ function ComboboxItemInner(props) {
1764
1830
  "aria-selected": selectable ? selected : void 0,
1765
1831
  tabIndex: void 0,
1766
1832
  onPointerDownCapture(event) {
1767
- didPointerDownRef.current = true;
1833
+ if (event.isPrimary) store.context.pointerDownItemRef.current = event.currentTarget;
1768
1834
  event.preventDefault();
1769
1835
  },
1770
1836
  onMouseDown(event) {
@@ -1775,8 +1841,8 @@ function ComboboxItemInner(props) {
1775
1841
  commitSelection(event.nativeEvent);
1776
1842
  },
1777
1843
  onMouseUp(event) {
1778
- const pointerStartedOnItem = didPointerDownRef.current;
1779
- didPointerDownRef.current = false;
1844
+ const pointerStartedOnItem = store.context.pointerDownItemRef.current === event.currentTarget;
1845
+ store.context.pointerDownItemRef.current = null;
1780
1846
  if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) return;
1781
1847
  commitSelection(event.nativeEvent);
1782
1848
  }
@@ -1814,13 +1880,15 @@ function ComboboxItemInner(props) {
1814
1880
  */
1815
1881
  function ComboboxItemVirtualizedIndex(props) {
1816
1882
  const { componentProps, forwardedRef } = props;
1817
- const isItemEqualToValue = useStore(useComboboxRootContext(), selectors.isItemEqualToValue);
1818
- const { flatFilteredItems } = useComboboxDerivedItemsContext();
1883
+ const isItemEqualToValue = useComboboxRootContext().useState("isItemEqualToValue");
1884
+ const { flatFilteredValues } = useComboboxDerivedItemsContext();
1885
+ const lookupValue = componentProps.value ?? null;
1886
+ const indexFromFilter = findItemIndex(flatFilteredValues, lookupValue, isItemEqualToValue);
1819
1887
  return /*#__PURE__*/ jsx(ComboboxItemInner, {
1820
1888
  componentProps,
1821
1889
  forwardedRef,
1822
1890
  virtualized: true,
1823
- indexFromFilter: findItemIndex(flatFilteredItems, componentProps.value ?? null, isItemEqualToValue)
1891
+ indexFromFilter
1824
1892
  });
1825
1893
  }
1826
1894
  /**
@@ -1830,7 +1898,7 @@ function ComboboxItemVirtualizedIndex(props) {
1830
1898
  * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
1831
1899
  */
1832
1900
  const ComboboxItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function ComboboxItem(componentProps, forwardedRef) {
1833
- const virtualized = useStore(useComboboxRootContext(), selectors.virtualized);
1901
+ const virtualized = useComboboxRootContext().useState("virtualized");
1834
1902
  if (virtualized && componentProps.index == null) return /*#__PURE__*/ jsx(ComboboxItemVirtualizedIndex, {
1835
1903
  componentProps,
1836
1904
  forwardedRef
@@ -1844,7 +1912,7 @@ const ComboboxItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef
1844
1912
  }));
1845
1913
  ComboboxItem.displayName = "ComboboxItem";
1846
1914
  //#endregion
1847
- //#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.mjs
1915
+ //#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.mjs
1848
1916
  /**
1849
1917
  * Renders its children only when the list is empty.
1850
1918
  * Requires the `items` prop on the root component.
@@ -1866,7 +1934,7 @@ const ComboboxEmpty = /*#__PURE__*/ React$1.forwardRef(function ComboboxEmpty(co
1866
1934
  return useRenderElement("div", componentProps, {
1867
1935
  ref: [
1868
1936
  forwardedRef,
1869
- store.state.emptyRef,
1937
+ store.context.emptyRef,
1870
1938
  emptyRef
1871
1939
  ],
1872
1940
  props: [{
@@ -1879,4 +1947,4 @@ const ComboboxEmpty = /*#__PURE__*/ React$1.forwardRef(function ComboboxEmpty(co
1879
1947
  });
1880
1948
  ComboboxEmpty.displayName = "ComboboxEmpty";
1881
1949
  //#endregion
1882
- export { useComboboxFloatingContext as C, useComboboxDerivedItemsContext as S, useComboboxRootContext as T, AriaCombobox as _, ComboboxGroupLabel as a, getComboboxPopupId as b, ComboboxList as c, ComboboxInternalDismissButton as d, ComboboxPositionerContext as f, triggerStateAttributesMapping as g, useComboboxChipsContext as h, useComboboxItemContext as i, ComboboxCollection as l, ComboboxChipsContext as m, ComboboxItem as n, ComboboxGroup as o, useComboboxPositionerContext as p, ComboboxRowContext as r, useInitialLiveRegionTextMutation as s, ComboboxEmpty as t, ComboboxInput as u, useComboboxFilter as v, useComboboxInputValueContext as w, selectors as x, useCoreFilter as y };
1950
+ export { useComboboxFilter as C, useComboboxFloatingContext as D, useComboboxDerivedItemsContext as E, useComboboxInputValueContext as O, findCollectionItem as S, getComboboxPopupId as T, ComboboxChipsContext as _, ComboboxGroupLabel as a, ComboboxInputDataAttributes_exports as b, ComboboxCollection as c, getIndexAfterChipRemoval as d, useListEmpty as f, useComboboxPositionerContext as g, ComboboxPositionerContext as h, useComboboxItemContext as i, useComboboxRootContext as k, ComboboxInput as l, ComboboxInternalDismissButton as m, ComboboxItem as n, ComboboxGroup as o, usePopupSide as p, ComboboxRowContext as r, ComboboxList as s, ComboboxEmpty as t, getChipNavigationKeys as u, useComboboxChipsContext as v, useCoreFilter as w, AriaCombobox as x, triggerStateAttributesMapping as y };